gdk_x11_lookup_xdisplay
gdk_x11_get_server_time
gdk_x11_device_get_id
+gdk_x11_device_manager_lookup
gdk_x11_display_get_user_time
gdk_x11_display_broadcast_startup_message
gdk_x11_display_get_startup_notification_id
gdk_x11_device_core_get_type
gdk_x11_device_get_id
gdk_x11_device_manager_core_get_type
+gdk_x11_device_manager_lookup
gdk_x11_device_manager_xi2_get_type
gdk_x11_device_manager_xi_get_type
gdk_x11_device_xi2_get_type
gdkx11device-core.h \
gdkx11device-xi.h \
gdkx11device-xi2.h \
+ gdkx11devicemanager.h \
gdkx11devicemanager-core.h \
gdkx11devicemanager-xi.h \
gdkx11devicemanager-xi2.h \
#include "config.h"
#include "gdkx11devicemanager-core.h"
+#include "gdkdevicemanagerprivate-core.h"
#ifdef XINPUT_XFREE
#include "gdkx11devicemanager-xi.h"
#ifdef XINPUT_2
NULL);
}
+/**
+ * gdk_x11_device_manager_lookup:
+ * @device_manager: 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): The #GdkDevice wrapping the device ID,
+ * or %NULL if the given ID doesn't currently represent a device.
+ **/
+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_x11_device_get_id:
* @device: a #GdkDevice
}
#endif /* XINPUT_2 */
+
+GdkDevice *
+_gdk_x11_device_manager_xi2_lookup (GdkX11DeviceManagerXI2 *device_manager_xi2,
+ gint device_id)
+{
+ return g_hash_table_lookup (device_manager_xi2->id_table,
+ GINT_TO_POINTER (device_id));
+}
XIGroupState *group_state);
gint _gdk_x11_device_xi2_get_id (GdkX11DeviceXI2 *device);
+GdkDevice * _gdk_x11_device_manager_xi2_lookup (GdkX11DeviceManagerXI2 *device_manager_xi2,
+ gint device_id);
#endif
#include <gdk/x11/gdkx11device-core.h>
#include <gdk/x11/gdkx11device-xi.h>
#include <gdk/x11/gdkx11device-xi2.h>
+#include <gdk/x11/gdkx11devicemanager.h>
#include <gdk/x11/gdkx11devicemanager-core.h>
#include <gdk/x11/gdkx11devicemanager-xi.h>
#include <gdk/x11/gdkx11devicemanager-xi2.h>
--- /dev/null
+/* GDK - The GIMP Drawing Kit
+ * Copyright (C) 2011 Carlos Garnacho
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#if !defined (__GDKX_H_INSIDE__) && !defined (GDK_COMPILATION)
+#error "Only <gdk/gdkx.h> can be included directly."
+#endif
+
+#ifndef __GDK_X11_DEVICE_MANAGER_H__
+#define __GDK_X11_DEVICE_MANAGER_H__
+
+#include <gdk/gdk.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+G_BEGIN_DECLS
+
+GdkDevice * gdk_x11_device_manager_lookup (GdkDeviceManager *device_manager,
+ gint device_id);
+
+G_END_DECLS
+
+#endif /* __GDK_X11_DEVICE_MANAGER_H__ */