## ClutterDeviceManager ClutterDeviceManager — Maintains the list of input devices |

## Synopsis

    struct              ClutterDeviceManager;
    struct              ClutterDeviceManagerClass;
    ClutterDeviceManager * clutter_device_manager_get_default
                                                            (void);
    GSList *               clutter_device_manager_list_devices
                                                            (ClutterDeviceManager *device_manager);
    const GSList *         clutter_device_manager_peek_devices
                                                            (ClutterDeviceManager *device_manager);
    ClutterInputDevice *   clutter_device_manager_get_device
                                                            (ClutterDeviceManager *device_manager,
                                                             gint device_id);
    ClutterInputDevice *   clutter_device_manager_get_core_device
                                                            (ClutterDeviceManager *device_manager,
                                                             ClutterInputDeviceType device_type);

    ClutterInputDevice * clutter_get_input_device_for_id    (gint id);

## Object Hierarchy

      GObject
       +----ClutterDeviceManager

## Properties

      "backend"                  ClutterBackend*       : Read / Write / Construct Only

## Signals

      "device-added"                                   : Run Last
      "device-removed"                                 : Run Last

## Description

ClutterDeviceManager is a singleton object, owned by Clutter, which maintains the list of ClutterInputDevices.

Depending on the backend used by Clutter it is possible to use the "device-added" and "device-removed" to monitor addition and removal of devices.

ClutterDeviceManager is available since Clutter 1.2

## Details

### struct ClutterDeviceManager

    struct ClutterDeviceManager;

The ClutterDeviceManager structure contains only private data

Since 1.2

### struct ClutterDeviceManagerClass

    struct ClutterDeviceManagerClass {
    };

The ClutterDeviceManagerClass structure contains only private data

Since 1.2

### clutter_device_manager_get_default ()

    ClutterDeviceManager * clutter_device_manager_get_default
                                                            (void);

Retrieves the device manager singleton

Returns : | the ClutterDeviceManager singleton. The returned instance is owned by Clutter and it should not be modified or freed. [transfer none]

Since 1.2

### clutter_device_manager_list_devices ()

    GSList *               clutter_device_manager_list_devices
                                                            (ClutterDeviceManager *device_manager);

Lists all currently registered input devices

`device_manager` : | a ClutterDeviceManager
Returns : | a newly allocated list of ClutterInputDevice objects. Use `g_slist_free()` to deallocate it when done. [transfer container][element-type Clutter.InputDevice]

Since 1.2

### clutter_device_manager_peek_devices ()

    const GSList *         clutter_device_manager_peek_devices
                                                            (ClutterDeviceManager *device_manager);

Lists all currently registered input devices

`device_manager` : | a ClutterDeviceManager
Returns : | a pointer to the internal list of ClutterInputDevice objects. The returned list is owned by the ClutterDeviceManager and should never be modified or freed. [transfer none][element-type Clutter.InputDevice]

Since 1.2

### clutter_device_manager_get_device ()

    ClutterInputDevice *   clutter_device_manager_get_device
                                                            (ClutterDeviceManager *device_manager,
                                                             gint device_id);

Retrieves the ClutterInputDevice with the given `device_id`

`device_manager` : | a ClutterDeviceManager
`device_id` : | the integer id of a device
Returns : | a ClutterInputDevice or `NULL`. The returned device is owned by the ClutterDeviceManager and should never be modified or freed. [transfer none]

Since 1.2

### clutter_device_manager_get_core_device ()

    ClutterInputDevice *   clutter_device_manager_get_core_device
                                                            (ClutterDeviceManager *device_manager,
                                                             ClutterInputDeviceType device_type);

Retrieves the core ClutterInputDevice of type `device_type`

Core devices are devices created automatically by the default Clutter backend

`device_manager` : | a ClutterDeviceManager
`device_type` : | the type of the core device
Returns : | a ClutterInputDevice or `NULL`. The returned device is owned by the ClutterDeviceManager and should not be modified or freed. [transfer none]

Since 1.2

### clutter_get_input_device_for_id ()

    ClutterInputDevice * clutter_get_input_device_for_id    (gint id);

Retrieves the ClutterInputDevice from its `id`. This is a convenience wrapper for `clutter_device_manager_get_device()` and it is functionally equivalent to:

    1
    2
    3
    4
    5
    ClutterDeviceManager *manager;
    ClutterInputDevice *device;

    manager = clutter_device_manager_get_default ();
    device = clutter_device_manager_get_device (manager, id);

`id` : | the unique id for a device
Returns : | a ClutterInputDevice, or `NULL`. [transfer none]

Since 0.8

## Property Details

### The `"backend"` property

      "backend"                  ClutterBackend*       : Read / Write / Construct Only

The ClutterBackend of the device manager.

## Signal Details

### The `"device-added"` signal

    void                user_function                      (ClutterDeviceManager *manager,
                                                            ClutterInputDevice   *device,
                                                            gpointer              user_data)      : Run Last

The ::device-added signal is emitted each time a device has been added to the ClutterDeviceManager

`manager` : | the ClutterDeviceManager that emitted the signal
`device` : | the newly added ClutterInputDevice
`user_data` : | user data set when the signal handler was connected.

Since 1.2

### The `"device-removed"` signal

    void                user_function                      (ClutterDeviceManager *manager,
                                                            ClutterInputDevice   *device,
                                                            gpointer              user_data)      : Run Last

The ::device-removed signal is emitted each time a device has been removed from the ClutterDeviceManager

`manager` : | the ClutterDeviceManager that emitted the signal
`device` : | the removed ClutterInputDevice
`user_data` : | user data set when the signal handler was connected.

Since 1.2