device: Make InputDevice an object and subclass it for X11

ClutterInputDevice should be a type that we can subclass per-backend
to add functionality.
This commit is contained in:
Emmanuele Bassi
2009-11-23 16:07:16 +00:00
parent d5331bfb57
commit d23dd9af6b
11 changed files with 484 additions and 165 deletions

View File

@ -29,6 +29,7 @@
#define __CLUTTER_EVENT_H__
#include <glib-object.h>
#include <clutter/clutter-input-device.h>
#include <clutter/clutter-types.h>
#define CLUTTER_TYPE_EVENT (clutter_event_get_type ())
@ -201,37 +202,6 @@ typedef struct _ClutterScrollEvent ClutterScrollEvent;
typedef struct _ClutterStageStateEvent ClutterStageStateEvent;
typedef struct _ClutterCrossingEvent ClutterCrossingEvent;
/**
* ClutterInputDevice:
*
* Generic representation of an input device. The
* actual contents of this structure depend on the
* backend used.
*/
typedef struct _ClutterInputDevice ClutterInputDevice;
/**
* ClutterInputDeviceType:
* @CLUTTER_POINTER_DEVICE: A pointer device
* @CLUTTER_KEYBOARD_DEVICE: A keyboard device
* @CLUTTER_EXTENSION_DEVICE: A generic extension device
* @CLUTTER_N_DEVICE_TYPES: The number of device types
*
* The types of input devices available.
*
* The #ClutterInputDeviceType enumeration can be extended at later
* date; not every platform supports every input device type.
*
* Since: 1.0
*/
typedef enum {
CLUTTER_POINTER_DEVICE,
CLUTTER_KEYBOARD_DEVICE,
CLUTTER_EXTENSION_DEVICE,
CLUTTER_N_DEVICE_TYPES
} ClutterInputDeviceType;
/**
* ClutterAnyEvent:
* @type: event type
@ -509,9 +479,6 @@ guint32 clutter_keysym_to_unicode (guint k
guint32 clutter_get_current_event_time (void);
G_CONST_RETURN ClutterEvent *clutter_get_current_event (void);
ClutterInputDeviceType clutter_input_device_get_device_type (ClutterInputDevice *device);
gint clutter_input_device_get_device_id (ClutterInputDevice *device);
G_END_DECLS
#endif /* __CLUTTER_EVENT_H__ */