[gtk+/gdk-backend] Move warp functions to the frontend



commit 95f0f11b15c07254c46c2f55e3483c33c60ba251
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Dec 13 13:53:34 2010 -0500

    Move warp functions to the frontend
    
    There were already GdkDevice vfuncs for this.

 gdk/gdkdisplay.c        |   73 +++++++++++++++++++++++++++++++++++++++++++++
 gdk/x11/gdkwindow-x11.c |   75 -----------------------------------------------
 2 files changed, 73 insertions(+), 75 deletions(-)
---
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 30c7f5c..d4d4494 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -26,6 +26,7 @@
 #include "gdkdisplay.h"
 #include "gdkdisplayprivate.h"
 
+#include "gdkdeviceprivate.h"
 #include "gdkevents.h"
 #include "gdkwindowimpl.h"
 #include "gdkinternals.h"
@@ -2350,3 +2351,75 @@ gdk_display_get_maximal_cursor_size (GdkDisplay *display,
                                                             width,
                                                             height);
 }
+
+/**
+ * gdk_display_warp_pointer:
+ * @display: a #GdkDisplay
+ * @screen: the screen of @display to warp the pointer to
+ * @x: the x coordinate of the destination
+ * @y: the y coordinate of the destination
+ *
+ * Warps the pointer of @display to the point @x,@y on
+ * the screen @screen, unless the pointer is confined
+ * to a window by a grab, in which case it will be moved
+ * as far as allowed by the grab. Warping the pointer
+ * creates events as if the user had moved the mouse
+ * instantaneously to the destination.
+ *
+ * Note that the pointer should normally be under the
+ * control of the user. This function was added to cover
+ * some rare use cases like keyboard navigation support
+ * for the color picker in the #GtkColorSelectionDialog.
+ *
+ * Since: 2.8
+ *
+ * Deprecated: 3.0: Use gdk_display_warp_device() instead.
+ */
+void
+gdk_display_warp_pointer (GdkDisplay *display,
+                          GdkScreen  *screen,
+                          gint        x,
+                          gint        y)
+{
+  gdk_display_warp_device (display,
+                           gdk_display_get_core_pointer (display),
+                           screen,
+                           x, y);
+}
+
+/**
+ * gdk_display_warp_device:
+ * @display: a #GdkDisplay.
+ * @device: a #GdkDevice.
+ * @screen: the screen of @display to warp @device to.
+ * @x: the X coordinate of the destination.
+ * @y: the Y coordinate of the destination.
+ *
+ * Warps @device in @display to the point @x,@y on
+ * the screen @screen, unless the device is confined
+ * to a window by a grab, in which case it will be moved
+ * as far as allowed by the grab. Warping the pointer
+ * creates events as if the user had moved the mouse
+ * instantaneously to the destination.
+ *
+ * Note that the pointer should normally be under the
+ * control of the user. This function was added to cover
+ * some rare use cases like keyboard navigation support
+ * for the color picker in the #GtkColorSelectionDialog.
+ *
+ * Since: 3.0
+ **/
+void
+gdk_display_warp_device (GdkDisplay *display,
+                         GdkDevice  *device,
+                         GdkScreen  *screen,
+                         gint        x,
+                         gint        y)
+{
+  g_return_if_fail (GDK_IS_DISPLAY (display));
+  g_return_if_fail (GDK_IS_DEVICE (device));
+  g_return_if_fail (GDK_IS_SCREEN (screen));
+  g_return_if_fail (display == gdk_device_get_display (device));
+
+  GDK_DEVICE_GET_CLASS (device)->warp (device, screen, x, y);
+}
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 5f0ccf1..87cb0d1 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -2894,81 +2894,6 @@ gdk_window_x11_get_device_state (GdkWindow       *window,
   return return_val;
 }
 
-/**
- * gdk_display_warp_pointer:
- * @display: a #GdkDisplay
- * @screen: the screen of @display to warp the pointer to
- * @x: the x coordinate of the destination
- * @y: the y coordinate of the destination
- * 
- * Warps the pointer of @display to the point @x,@y on 
- * the screen @screen, unless the pointer is confined
- * to a window by a grab, in which case it will be moved
- * as far as allowed by the grab. Warping the pointer 
- * creates events as if the user had moved the mouse 
- * instantaneously to the destination.
- * 
- * Note that the pointer should normally be under the
- * control of the user. This function was added to cover
- * some rare use cases like keyboard navigation support
- * for the color picker in the #GtkColorSelectionDialog.
- *
- * Since: 2.8
- *
- * Deprecated: 3.0: Use gdk_display_warp_device() instead.
- */ 
-void
-gdk_display_warp_pointer (GdkDisplay *display,
-			  GdkScreen  *screen,
-			  gint        x,
-			  gint        y)
-{
-  GdkDevice *device;
-
-  g_return_if_fail (GDK_IS_DISPLAY (display));
-  g_return_if_fail (GDK_IS_SCREEN (screen));
-
-  device = gdk_display_get_core_pointer (display);
-  GDK_DEVICE_GET_CLASS (device)->warp (device, screen, x, y);
-}
-
-/**
- * gdk_display_warp_device:
- * @display: a #GdkDisplay.
- * @device: a #GdkDevice.
- * @screen: the screen of @display to warp @device to.
- * @x: the X coordinate of the destination.
- * @y: the Y coordinate of the destination.
- *
- * Warps @device in @display to the point @x,@y on
- * the screen @screen, unless the device is confined
- * to a window by a grab, in which case it will be moved
- * as far as allowed by the grab. Warping the pointer
- * creates events as if the user had moved the mouse
- * instantaneously to the destination.
- *
- * Note that the pointer should normally be under the
- * control of the user. This function was added to cover
- * some rare use cases like keyboard navigation support
- * for the color picker in the #GtkColorSelectionDialog.
- *
- * Since: 3.0
- **/
-void
-gdk_display_warp_device (GdkDisplay *display,
-                         GdkDevice  *device,
-                         GdkScreen  *screen,
-                         gint        x,
-                         gint        y)
-{
-  g_return_if_fail (GDK_IS_DISPLAY (display));
-  g_return_if_fail (GDK_IS_DEVICE (device));
-  g_return_if_fail (GDK_IS_SCREEN (screen));
-  g_return_if_fail (display == gdk_device_get_display (device));
-
-  GDK_DEVICE_GET_CLASS (device)->warp (device, screen, x, y);
-}
-
 GdkWindow*
 _gdk_windowing_window_at_device_position (GdkDisplay      *display,
                                           GdkDevice       *device,



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