forked from AuroraMiddleware/gtk
API: gdk: Remove gdk_set_pointer_hooks()
Its usecase was GERD - http://testbit.eu/~timj/historic/gerd/ - and that project is long since dead. It has been superseded in GTK 2.2 by GdkDisplayPointerHooks anyway.
This commit is contained in:
parent
d1ecd28695
commit
36a15720b1
@ -473,10 +473,6 @@ gdk_window_set_device_events
|
||||
gdk_window_get_source_events
|
||||
gdk_window_set_source_events
|
||||
|
||||
<SUBSECTION>
|
||||
GdkPointerHooks
|
||||
gdk_set_pointer_hooks
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_offscreen_window_get_surface
|
||||
gdk_offscreen_window_set_embedder
|
||||
|
@ -307,7 +307,6 @@ gdk_selection_property_get
|
||||
gdk_selection_send_notify
|
||||
gdk_selection_send_notify_for_display
|
||||
gdk_set_double_click_time
|
||||
gdk_set_pointer_hooks
|
||||
gdk_set_program_class
|
||||
gdk_set_show_events
|
||||
gdk_setting_action_get_type G_GNUC_CONST
|
||||
|
134
gdk/gdkdisplay.c
134
gdk/gdkdisplay.c
@ -103,27 +103,7 @@ static GdkWindow * multihead_default_window_at_pointer (GdkDisplay *displa
|
||||
gint *win_y);
|
||||
|
||||
|
||||
static void singlehead_get_pointer (GdkDisplay *display,
|
||||
GdkScreen **screen,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
static GdkWindow* singlehead_window_get_pointer (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
static GdkWindow* singlehead_window_at_pointer (GdkDisplay *display,
|
||||
gint *win_x,
|
||||
gint *win_y);
|
||||
|
||||
static GdkWindow* singlehead_default_window_get_pointer (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
static GdkWindow* singlehead_default_window_at_pointer (GdkScreen *screen,
|
||||
gint *win_x,
|
||||
gint *win_y);static GdkWindow *gdk_window_real_window_get_device_position (GdkDisplay *display,
|
||||
static GdkWindow *gdk_window_real_window_get_device_position (GdkDisplay *display,
|
||||
GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gint *x,
|
||||
@ -161,18 +141,6 @@ static const GdkDisplayPointerHooks multihead_default_pointer_hooks = {
|
||||
multihead_default_window_at_pointer
|
||||
};
|
||||
|
||||
static const GdkDisplayPointerHooks singlehead_pointer_hooks = {
|
||||
singlehead_get_pointer,
|
||||
singlehead_window_get_pointer,
|
||||
singlehead_window_at_pointer
|
||||
};
|
||||
|
||||
static const GdkPointerHooks singlehead_default_pointer_hooks = {
|
||||
singlehead_default_window_get_pointer,
|
||||
singlehead_default_window_at_pointer
|
||||
};
|
||||
|
||||
static const GdkPointerHooks *singlehead_current_pointer_hooks = &singlehead_default_pointer_hooks;
|
||||
static const GdkDisplayPointerHooks *multihead_current_pointer_hooks = &multihead_default_pointer_hooks;
|
||||
|
||||
G_DEFINE_TYPE (GdkDisplay, gdk_display, G_TYPE_OBJECT)
|
||||
@ -990,106 +958,6 @@ gdk_display_set_pointer_hooks (GdkDisplay *display,
|
||||
return (GdkDisplayPointerHooks *)result;
|
||||
}
|
||||
|
||||
static void
|
||||
singlehead_get_pointer (GdkDisplay *display,
|
||||
GdkScreen **screen,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask)
|
||||
{
|
||||
GdkScreen *default_screen = gdk_display_get_default_screen (display);
|
||||
GdkWindow *root_window = gdk_screen_get_root_window (default_screen);
|
||||
|
||||
*screen = default_screen;
|
||||
|
||||
singlehead_current_pointer_hooks->get_pointer (root_window, x, y, mask);
|
||||
}
|
||||
|
||||
static GdkWindow*
|
||||
singlehead_window_get_pointer (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask)
|
||||
{
|
||||
return singlehead_current_pointer_hooks->get_pointer (window, x, y, mask);
|
||||
}
|
||||
|
||||
static GdkWindow*
|
||||
singlehead_window_at_pointer (GdkDisplay *display,
|
||||
gint *win_x,
|
||||
gint *win_y)
|
||||
{
|
||||
GdkScreen *default_screen = gdk_display_get_default_screen (display);
|
||||
|
||||
return singlehead_current_pointer_hooks->window_at_pointer (default_screen,
|
||||
win_x, win_y);
|
||||
}
|
||||
|
||||
static GdkWindow*
|
||||
singlehead_default_window_get_pointer (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
|
||||
display = gdk_window_get_display (window);
|
||||
|
||||
return gdk_window_real_window_get_device_position (display,
|
||||
display->core_pointer,
|
||||
window, x, y, mask);
|
||||
}
|
||||
|
||||
static GdkWindow*
|
||||
singlehead_default_window_at_pointer (GdkScreen *screen,
|
||||
gint *win_x,
|
||||
gint *win_y)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
|
||||
display = gdk_screen_get_display (screen);
|
||||
|
||||
return gdk_display_real_get_window_at_device_position (display,
|
||||
display->core_pointer,
|
||||
win_x, win_y);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_set_pointer_hooks:
|
||||
* @new_hooks: (allow-none): a table of pointers to functions for getting
|
||||
* quantities related to the current pointer position,
|
||||
* or %NULL to restore the default table.
|
||||
*
|
||||
* This function allows for hooking into the operation
|
||||
* of getting the current location of the pointer. This
|
||||
* is only useful for such low-level tools as an
|
||||
* event recorder. Applications should never have any
|
||||
* reason to use this facility.
|
||||
*
|
||||
* This function is not multihead safe. For multihead operation,
|
||||
* see gdk_display_set_pointer_hooks().
|
||||
*
|
||||
* Return value: the previous pointer hook table
|
||||
*
|
||||
* Deprecated: 3.0: Use gdk_display_set_device_hooks() instead.
|
||||
**/
|
||||
GdkPointerHooks *
|
||||
gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks)
|
||||
{
|
||||
const GdkPointerHooks *result = singlehead_current_pointer_hooks;
|
||||
|
||||
if (new_hooks)
|
||||
singlehead_current_pointer_hooks = new_hooks;
|
||||
else
|
||||
singlehead_current_pointer_hooks = &singlehead_default_pointer_hooks;
|
||||
|
||||
gdk_display_set_pointer_hooks (gdk_display_get_default (),
|
||||
&singlehead_pointer_hooks);
|
||||
|
||||
return (GdkPointerHooks *)result;
|
||||
}
|
||||
|
||||
static void
|
||||
generate_grab_broken_event (GdkWindow *window,
|
||||
GdkDevice *device,
|
||||
|
@ -38,7 +38,6 @@ G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GdkGeometry GdkGeometry;
|
||||
typedef struct _GdkWindowAttr GdkWindowAttr;
|
||||
typedef struct _GdkPointerHooks GdkPointerHooks;
|
||||
typedef struct _GdkWindowRedirect GdkWindowRedirect;
|
||||
|
||||
/**
|
||||
@ -446,34 +445,6 @@ struct _GdkGeometry
|
||||
GdkGravity win_gravity;
|
||||
};
|
||||
|
||||
/**
|
||||
* GdkPointerHooks:
|
||||
* @get_pointer: Obtains the current pointer position and modifier state.
|
||||
* The position is given in coordinates relative to the window containing
|
||||
* the pointer, which is returned in @window.
|
||||
* @window_at_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 (for example,
|
||||
* belongs to another application).
|
||||
*
|
||||
* A table of pointers to functions for getting quantities related to
|
||||
* the current pointer position. GDK has one global table of this type,
|
||||
* which can be set using gdk_set_pointer_hooks().
|
||||
*
|
||||
* This is only useful for such low-level tools as an event recorder.
|
||||
* Applications should never have any reason to use this facility
|
||||
*/
|
||||
struct _GdkPointerHooks
|
||||
{
|
||||
GdkWindow* (*get_pointer) (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y,
|
||||
GdkModifierType *mask);
|
||||
GdkWindow* (*window_at_pointer) (GdkScreen *screen, /* unused */
|
||||
gint *win_x,
|
||||
gint *win_y);
|
||||
};
|
||||
|
||||
typedef struct _GdkWindowClass GdkWindowClass;
|
||||
|
||||
#define GDK_TYPE_WINDOW (gdk_window_get_type ())
|
||||
@ -872,10 +843,6 @@ void gdk_window_constrain_size (GdkGeometry *geometry,
|
||||
void gdk_window_enable_synchronized_configure (GdkWindow *window);
|
||||
void gdk_window_configure_finished (GdkWindow *window);
|
||||
|
||||
#if !defined (GDK_MULTIHEAD_SAFE) && !defined (GDK_MULTIDEVICE_SAFE)
|
||||
GdkPointerHooks *gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks);
|
||||
#endif /* !GDK_MULTIHEAD_SAFE && !GDK_MULTIDEVICE_SAFE */
|
||||
|
||||
GdkWindow *gdk_get_default_root_window (void);
|
||||
|
||||
/* Offscreen redirection */
|
||||
|
Loading…
Reference in New Issue
Block a user