Add ClutterDeviceManager

The ClutterDeviceManager is a singleton object that behaves like the
StageManager: it holds all input devices and notifies on addition and
removal.
This commit is contained in:
Emmanuele Bassi
2009-11-20 15:35:40 +00:00
parent 14a28620ae
commit d34f1aa775
7 changed files with 224 additions and 33 deletions

View File

@ -3025,7 +3025,17 @@ clutter_get_font_flags (void)
* clutter_get_input_device_for_id:
* @id: a device id
*
* Retrieves the #ClutterInputDevice from its id.
* Retrieves the #ClutterInputDevice from its id. This is a convenience
* wrapper for clutter_device_manager_get_device() and it is functionally
* equivalent to:
*
* |[
* ClutterDeviceManager *manager;
* ClutterInputDevice *device;
*
* manager = clutter_device_manager_get_default ();
* device = clutter_device_manager_get_device (manager, id);
* ]|
*
* Return value: (transfer none): a #ClutterInputDevice, or %NULL
*
@ -3034,23 +3044,11 @@ clutter_get_font_flags (void)
ClutterInputDevice *
clutter_get_input_device_for_id (gint id)
{
GSList *item;
ClutterInputDevice *device = NULL;
ClutterMainContext *context;
ClutterDeviceManager *manager;
context = _clutter_context_get_default ();
manager = clutter_device_manager_get_default ();
for (item = context->input_devices;
item != NULL;
item = item->next)
{
device = item->data;
if (device->id == id)
return device;
}
return NULL;
return clutter_device_manager_get_device (manager, id);
}
/**