[gtk+/xi2: 729/1239] GdkDeviceXI2: Implement warp().



commit 25d37efee0aab3a971bc9541afdb9e543f1fbe17
Author: Carlos Garnacho <carlos lanedo com>
Date:   Wed Aug 12 20:35:22 2009 +0200

    GdkDeviceXI2: Implement warp().

 gdk/x11/gdkdevice-xi2.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c
index 36838c8..1dd274f 100644
--- a/gdk/x11/gdkdevice-xi2.c
+++ b/gdk/x11/gdkdevice-xi2.c
@@ -53,6 +53,10 @@ static gboolean gdk_device_xi2_get_axis (GdkDevice    *device,
 static void gdk_device_xi2_set_window_cursor (GdkDevice *device,
                                               GdkWindow *window,
                                               GdkCursor *cursor);
+static void gdk_device_xi2_warp (GdkDevice *device,
+                                 GdkScreen *screen,
+                                 gint       x,
+                                 gint       y);
 
 
 G_DEFINE_TYPE (GdkDeviceXI2, gdk_device_xi2, GDK_TYPE_DEVICE)
@@ -75,6 +79,7 @@ gdk_device_xi2_class_init (GdkDeviceXI2Class *klass)
   device_class->get_state = gdk_device_xi2_get_state;
   device_class->get_axis = gdk_device_xi2_get_axis;
   device_class->set_window_cursor = gdk_device_xi2_set_window_cursor;
+  device_class->warp = gdk_device_xi2_warp;
 
   g_object_class_install_property (object_class,
 				   PROP_DEVICE_ID,
@@ -210,6 +215,23 @@ gdk_device_xi2_set_window_cursor (GdkDevice *device,
                       GDK_WINDOW_XWINDOW (window));
 }
 
+static void gdk_device_xi2_warp (GdkDevice *device,
+                                 GdkScreen *screen,
+                                 gint       x,
+                                 gint       y)
+{
+  GdkDeviceXI2Private *priv;
+  Window dest;
+
+  priv = GDK_DEVICE_XI2_GET_PRIVATE (device);
+  dest = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen));
+
+  XIWarpPointer (GDK_SCREEN_XDISPLAY (screen),
+                 priv->device_id,
+                 None, dest,
+                 0, 0, 0, 0, x, y);
+}
+
 void
 gdk_device_xi2_add_axis (GdkDeviceXI2 *device,
                          GdkAxisUse    use)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]