1 /* GDK - The GIMP Drawing Kit
2 * gdkdeprecated.c
3 *
4 * Copyright 1995-2011 Red Hat Inc.
5 *
6 * Benjamin Otte <otte@gnome.org>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 #define GDK_DISABLE_DEPRECATION_WARNINGS
23
24 #include "config.h"
25
26 #include "gdkdisplay.h"
27 #include "gdkmain.h"
28 #include "gdkwindow.h"
29
30 /**
31 * gdk_pointer_ungrab:
32 * @time_: a timestamp from a #GdkEvent, or %GDK_CURRENT_TIME if no
33 * timestamp is available.
34 *
35 * Ungrabs the pointer on the default display, if it is grabbed by this
36 * application.
37 *
38 * Deprecated: 3.0: Use gdk_device_ungrab(), together with gdk_device_grab()
39 * instead.
40 **/
41 void
gdk_pointer_ungrab(guint32 time)42 gdk_pointer_ungrab (guint32 time)
43 {
44 gdk_display_pointer_ungrab (gdk_display_get_default (), time);
45 }
46
47 /**
48 * gdk_pointer_is_grabbed:
49 *
50 * Returns %TRUE if the pointer on the default display is currently
51 * grabbed by this application.
52 *
53 * Note that this does not take the inmplicit pointer grab on button
54 * presses into account.
55 *
56 * Returns: %TRUE if the pointer is currently grabbed by this application.
57 *
58 * Deprecated: 3.0: Use gdk_display_device_is_grabbed() instead.
59 **/
60 gboolean
gdk_pointer_is_grabbed(void)61 gdk_pointer_is_grabbed (void)
62 {
63 return gdk_display_pointer_is_grabbed (gdk_display_get_default ());
64 }
65
66 /**
67 * gdk_keyboard_ungrab:
68 * @time_: a timestamp from a #GdkEvent, or %GDK_CURRENT_TIME if no
69 * timestamp is available.
70 *
71 * Ungrabs the keyboard on the default display, if it is grabbed by this
72 * application.
73 *
74 * Deprecated: 3.0: Use gdk_device_ungrab(), together with gdk_device_grab()
75 * instead.
76 **/
77 void
gdk_keyboard_ungrab(guint32 time)78 gdk_keyboard_ungrab (guint32 time)
79 {
80 gdk_display_keyboard_ungrab (gdk_display_get_default (), time);
81 }
82
83 /**
84 * gdk_window_at_pointer:
85 * @win_x: (out) (allow-none): return location for origin of the window under the pointer
86 * @win_y: (out) (allow-none): return location for origin of the window under the pointer
87 *
88 * Obtains the window underneath the mouse pointer, returning the
89 * location of that window in @win_x, @win_y. Returns %NULL if the
90 * window under the mouse pointer is not known to GDK (if the window
91 * belongs to another application and a #GdkWindow hasn’t been created
92 * for it with gdk_window_foreign_new())
93 *
94 * NOTE: For multihead-aware widgets or applications use
95 * gdk_display_get_window_at_pointer() instead.
96 *
97 * Returns: (transfer none): window under the mouse pointer
98 *
99 * Deprecated: 3.0: Use gdk_device_get_window_at_position() instead.
100 **/
101 GdkWindow*
gdk_window_at_pointer(gint * win_x,gint * win_y)102 gdk_window_at_pointer (gint *win_x,
103 gint *win_y)
104 {
105 return gdk_display_get_window_at_pointer (gdk_display_get_default (), win_x, win_y);
106 }
107
108