summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-10-28 08:34:30 -0700
committerBenjamin Otte <otte@redhat.com>2011-11-02 02:32:53 +0100
commitb120cb04a5ad172f066ecbc95420ceb7e6df4710 (patch)
treedac35b62b62d7acade6f8a084d7fc49f9e8d898b
parentc9a648395ea3fb7db7dde4517b646cfc8703417d (diff)
downloadgtk+-b120cb04a5ad172f066ecbc95420ceb7e6df4710.tar.gz
gdk: Move a bunch of deprecated code to a new file
The new file defines GDK_DISABLE_DEPRECATION_WARNINGS so it can happily use deprecated APIs. This commit moves those functions there that use deprecated functions and currently cause warnings. With this commit, GDK compiles without deprecation warnings.
-rw-r--r--gdk/Makefile.am1
-rw-r--r--gdk/gdkdeprecated.c107
-rw-r--r--gdk/gdkdisplay.c53
-rw-r--r--gdk/gdkwindow.c25
4 files changed, 108 insertions, 78 deletions
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
index 0c8011558f..0c38d9a672 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -113,6 +113,7 @@ gdk_c_sources = \
gdkcairo.c \
gdkcolor.c \
gdkcursor.c \
+ gdkdeprecated.c \
gdkdevice.c \
gdkdevicemanager.c \
gdkdisplay.c \
diff --git a/gdk/gdkdeprecated.c b/gdk/gdkdeprecated.c
new file mode 100644
index 0000000000..aa0973bf3a
--- /dev/null
+++ b/gdk/gdkdeprecated.c
@@ -0,0 +1,107 @@
+/* GDK - The GIMP Drawing Kit
+ * gdkdeprecated.c
+ *
+ * Copyright 1995-2011 Red Hat Inc.
+ *
+ * Benjamin Otte <otte@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library 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.
+ */
+
+#define GDK_DISABLE_DEPRECATION_WARNINGS
+
+#include "config.h"
+
+#include "gdkdisplay.h"
+
+/**
+ * gdk_pointer_ungrab:
+ * @time_: a timestamp from a #GdkEvent, or %GDK_CURRENT_TIME if no
+ * timestamp is available.
+ *
+ * Ungrabs the pointer on the default display, if it is grabbed by this
+ * application.
+ *
+ * Deprecated: 3.0: Use gdk_device_ungrab(), together with gdk_device_grab()
+ * instead.
+ **/
+void
+gdk_pointer_ungrab (guint32 time)
+{
+ gdk_display_pointer_ungrab (gdk_display_get_default (), time);
+}
+
+/**
+ * gdk_pointer_is_grabbed:
+ *
+ * Returns %TRUE if the pointer on the default display is currently
+ * grabbed by this application.
+ *
+ * Note that this does not take the inmplicit pointer grab on button
+ * presses into account.
+ *
+ * Return value: %TRUE if the pointer is currently grabbed by this application.
+ *
+ * Deprecated: 3.0: Use gdk_display_device_is_grabbed() instead.
+ **/
+gboolean
+gdk_pointer_is_grabbed (void)
+{
+ return gdk_display_pointer_is_grabbed (gdk_display_get_default ());
+}
+
+/**
+ * gdk_keyboard_ungrab:
+ * @time_: a timestamp from a #GdkEvent, or %GDK_CURRENT_TIME if no
+ * timestamp is available.
+ *
+ * Ungrabs the keyboard on the default display, if it is grabbed by this
+ * application.
+ *
+ * Deprecated: 3.0: Use gdk_device_ungrab(), together with gdk_device_grab()
+ * instead.
+ **/
+void
+gdk_keyboard_ungrab (guint32 time)
+{
+ gdk_display_keyboard_ungrab (gdk_display_get_default (), time);
+}
+
+/**
+ * gdk_window_at_pointer:
+ * @win_x: (out) (allow-none): return location for origin of the window under the pointer
+ * @win_y: (out) (allow-none): return location for origin of the window under the pointer
+ *
+ * Obtains the window underneath the mouse pointer, returning the
+ * location of that window in @win_x, @win_y. Returns %NULL if the
+ * window under the mouse pointer is not known to GDK (if the window
+ * belongs to another application and a #GdkWindow hasn't been created
+ * for it with gdk_window_foreign_new())
+ *
+ * NOTE: For multihead-aware widgets or applications use
+ * gdk_display_get_window_at_pointer() instead.
+ *
+ * Return value: (transfer none): window under the mouse pointer
+ *
+ * Deprecated: 3.0: Use gdk_device_get_window_at_position() instead.
+ **/
+GdkWindow*
+gdk_window_at_pointer (gint *win_x,
+ gint *win_y)
+{
+ return gdk_display_get_window_at_pointer (gdk_display_get_default (), win_x, win_y);
+}
+
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 2e70c49d5e..5302ab8677 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -405,42 +405,6 @@ gdk_display_pointer_ungrab (GdkDisplay *display,
}
/**
- * gdk_pointer_ungrab:
- * @time_: a timestamp from a #GdkEvent, or %GDK_CURRENT_TIME if no
- * timestamp is available.
- *
- * Ungrabs the pointer on the default display, if it is grabbed by this
- * application.
- *
- * Deprecated: 3.0: Use gdk_device_ungrab(), together with gdk_device_grab()
- * instead.
- **/
-void
-gdk_pointer_ungrab (guint32 time)
-{
- gdk_display_pointer_ungrab (gdk_display_get_default (), time);
-}
-
-/**
- * gdk_pointer_is_grabbed:
- *
- * Returns %TRUE if the pointer on the default display is currently
- * grabbed by this application.
- *
- * Note that this does not take the inmplicit pointer grab on button
- * presses into account.
- *
- * Return value: %TRUE if the pointer is currently grabbed by this application.
- *
- * Deprecated: 3.0: Use gdk_display_device_is_grabbed() instead.
- **/
-gboolean
-gdk_pointer_is_grabbed (void)
-{
- return gdk_display_pointer_is_grabbed (gdk_display_get_default ());
-}
-
-/**
* gdk_display_keyboard_ungrab:
* @display: a #GdkDisplay.
* @time_: a timestap (e.g #GDK_CURRENT_TIME).
@@ -481,23 +445,6 @@ gdk_display_keyboard_ungrab (GdkDisplay *display,
}
/**
- * gdk_keyboard_ungrab:
- * @time_: a timestamp from a #GdkEvent, or %GDK_CURRENT_TIME if no
- * timestamp is available.
- *
- * Ungrabs the keyboard on the default display, if it is grabbed by this
- * application.
- *
- * Deprecated: 3.0: Use gdk_device_ungrab(), together with gdk_device_grab()
- * instead.
- **/
-void
-gdk_keyboard_ungrab (guint32 time)
-{
- gdk_display_keyboard_ungrab (gdk_display_get_default (), time);
-}
-
-/**
* gdk_beep:
*
* Emits a short beep on the default display.
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index eb4bcbd322..c8faa921cd 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -4981,31 +4981,6 @@ gdk_window_get_device_position (GdkWindow *window,
}
/**
- * gdk_window_at_pointer:
- * @win_x: (out) (allow-none): return location for origin of the window under the pointer
- * @win_y: (out) (allow-none): return location for origin of the window under the pointer
- *
- * Obtains the window underneath the mouse pointer, returning the
- * location of that window in @win_x, @win_y. Returns %NULL if the
- * window under the mouse pointer is not known to GDK (if the window
- * belongs to another application and a #GdkWindow hasn't been created
- * for it with gdk_window_foreign_new())
- *
- * NOTE: For multihead-aware widgets or applications use
- * gdk_display_get_window_at_pointer() instead.
- *
- * Return value: (transfer none): window under the mouse pointer
- *
- * Deprecated: 3.0: Use gdk_device_get_window_at_position() instead.
- **/
-GdkWindow*
-gdk_window_at_pointer (gint *win_x,
- gint *win_y)
-{
- return gdk_display_get_window_at_pointer (gdk_display_get_default (), win_x, win_y);
-}
-
-/**
* gdk_get_default_root_window:
*
* Obtains the root window (parent all other windows are inside)