/**
 * gdk_device_manager_get_client_pointer:
 * @device_manager: a #GdkDeviceManager
 *
 * Returns the client pointer, that is, the master pointer that acts as the core pointer
 * for this application. In X11, window managers may change this depending on the interaction
 * pattern under the presence of several pointers.
 *
 * You should use this function seldomly, only in code that isn’t triggered by a #GdkEvent
 * and there aren’t other means to get a meaningful #GdkDevice to operate on.
 *
 * Returns: (transfer none): The client pointer. This memory is
 *          owned by GDK and must not be freed or unreferenced.
 *
 * Since: 3.0
 **/
GdkDevice *
gdk_device_manager_get_client_pointer (GdkDeviceManager *device_manager)
{
  g_return_val_if_fail (GDK_IS_DEVICE_MANAGER (device_manager), NULL);

  return GDK_DEVICE_MANAGER_GET_CLASS (device_manager)->get_client_pointer (device_manager);
}
/**
 * gdk_device_manager_get_display:
 * @device_manager: a #GdkDeviceManager
 *
 * Gets the #GdkDisplay associated to @device_manager.
 *
 * Returns: (transfer none): the #GdkDisplay to which @device_manager is
 *          associated to, or #NULL. This memory is owned by GDK and
 *          must not be freed or unreferenced.
 *
 * Since: 3.0
 **/
GdkDisplay *
gdk_device_manager_get_display (GdkDeviceManager *device_manager)
{
  g_return_val_if_fail (GDK_IS_DEVICE_MANAGER (device_manager), NULL);

  return device_manager->display;
}
Beispiel #3
0
/**
 * gdk_x11_device_manager_lookup:
 * @device_manager: (type GdkX11DeviceManagerCore): a #GdkDeviceManager
 * @device_id: a device ID, as understood by the XInput2 protocol
 *
 * Returns the #GdkDevice that wraps the given device ID.
 *
 * Returns: (transfer none) (allow-none) (type GdkX11DeviceCore): The #GdkDevice wrapping the device ID,
 *          or %NULL if the given ID doesn’t currently represent a device.
 *
 * Since: 3.2
 **/
GdkDevice *
gdk_x11_device_manager_lookup (GdkDeviceManager *device_manager,
			       gint              device_id)
{
  GdkDevice *device = NULL;

  g_return_val_if_fail (GDK_IS_DEVICE_MANAGER (device_manager), NULL);

#ifdef XINPUT_2
  if (GDK_IS_X11_DEVICE_MANAGER_XI2 (device_manager))
    device = _gdk_x11_device_manager_xi2_lookup (GDK_X11_DEVICE_MANAGER_XI2 (device_manager),
                                                 device_id);
  else
#endif /* XINPUT_2 */
    if (GDK_IS_X11_DEVICE_MANAGER_CORE (device_manager))
      {
        /* It is a core/xi1 device manager, we only map
         * IDs 2 and 3, matching XI2's Virtual Core Pointer
         * and Keyboard.
         */
        if (device_id == VIRTUAL_CORE_POINTER_ID)
          device = GDK_X11_DEVICE_MANAGER_CORE (device_manager)->core_pointer;
        else if (device_id == VIRTUAL_CORE_KEYBOARD_ID)
          device = GDK_X11_DEVICE_MANAGER_CORE (device_manager)->core_keyboard;
      }

  return device;
}
/**
 * gdk_device_manager_list_devices:
 * @device_manager: a #GdkDeviceManager
 * @type: device type to get.
 *
 * Returns the list of devices of type @type currently attached to
 * @device_manager.
 *
 * Returns: (transfer container) (element-type Gdk.Device): a list of 
 *          #GdkDevices. The returned list must be
 *          freed with g_list_free (). The list elements are owned by
 *          GTK+ and must not be freed or unreffed.
 *
 * Since: 3.0
 **/
GList *
gdk_device_manager_list_devices (GdkDeviceManager *device_manager,
                                 GdkDeviceType     type)
{
  g_return_val_if_fail (GDK_IS_DEVICE_MANAGER (device_manager), NULL);

  return GDK_DEVICE_MANAGER_GET_CLASS (device_manager)->list_devices (device_manager, type);
}