device: Allow enabling/disabling non-master devices

Slave and floating devices should always be disabled, and not deliver
events to the scene. It is up to the user to enable non-master devices
and handle events coming from them.

ClutterInputDevice gets a new :enabled property, defaulting to FALSE;
when a device manager creates a new device it has to set it to TRUE if
the :device-mode property is set to CLUTTER_INPUT_MODE_MASTER.

The main event queue entry point, _clutter_event_push(), will
automatically discard events coming from disabled devices.
This commit is contained in:
Emmanuele Bassi
2011-01-19 16:23:45 +00:00
parent 137f7d42a8
commit 73cf6bd52c
7 changed files with 100 additions and 4 deletions

View File

@ -138,6 +138,9 @@ ClutterStage * clutter_input_device_get_pointer_stage (ClutterInputDev
G_CONST_RETURN gchar * clutter_input_device_get_device_name (ClutterInputDevice *device);
ClutterInputMode clutter_input_device_get_device_mode (ClutterInputDevice *device);
gboolean clutter_input_device_get_has_cursor (ClutterInputDevice *device);
void clutter_input_device_set_enabled (ClutterInputDevice *device,
gboolean enabled);
gboolean clutter_input_device_get_enabled (ClutterInputDevice *device);
guint clutter_input_device_get_n_axes (ClutterInputDevice *device);
ClutterInputAxis clutter_input_device_get_axis (ClutterInputDevice *device,