API: gdk: Remove gdk_display_set_device_hooks()

There's no usecase for them, so remove them before we have to commit to
keeping an API.

Make the hooks private for now, actually removing them will come in
followup patches.
This commit is contained in:
Benjamin Otte 2011-01-03 16:49:13 +01:00
parent ff1ad99dce
commit d72d19d247
5 changed files with 22 additions and 77 deletions

View File

@ -126,8 +126,6 @@ gdk_display_set_double_click_distance
gdk_display_get_pointer
gdk_display_list_devices
gdk_display_get_window_at_pointer
GdkDisplayDeviceHooks
gdk_display_set_device_hooks
gdk_display_warp_pointer
gdk_display_supports_cursor_color
gdk_display_supports_cursor_alpha

View File

@ -116,7 +116,6 @@ gdk_display_pointer_is_grabbed
gdk_display_pointer_ungrab
gdk_display_put_event
gdk_display_request_selection_notification
gdk_display_set_device_hooks
gdk_display_set_double_click_distance
gdk_display_set_double_click_time
gdk_display_store_clipboard

View File

@ -619,37 +619,6 @@ _gdk_display_enable_motion_hints (GdkDisplay *display,
}
}
/**
* gdk_display_set_device_hooks:
* @display: a #GdkDisplay.
* @new_hooks: (allow-none): a table of pointers to functions for getting quantities related
* to all devices position, or %NULL to restore the default table.
*
* This function allows for hooking into the operation of getting the current location of any
* #GdkDevice on a particular #GdkDisplay. This is only useful for such low-level tools as
* an event recorder. Applications should never have any reason to use this facility.
*
* Returns: (transfer none): The previous device hook table.
*
* Since: 3.0
**/
GdkDisplayDeviceHooks *
gdk_display_set_device_hooks (GdkDisplay *display,
const GdkDisplayDeviceHooks *new_hooks)
{
const GdkDisplayDeviceHooks *result;
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
result = display->device_hooks;
if (new_hooks)
display->device_hooks = new_hooks;
else
display->device_hooks = &default_device_hooks;
return (GdkDisplayDeviceHooks *) result;
}
/**
* gdk_display_get_pointer:
* @display: a #GdkDisplay

View File

@ -41,46 +41,6 @@ G_BEGIN_DECLS
#define GDK_DISPLAY_OBJECT(object) GDK_DISPLAY(object)
#endif
typedef struct _GdkDisplayDeviceHooks GdkDisplayDeviceHooks;
/**
* GdkDisplayDeviceHooks:
* @get_device_state: Obtains the current position and modifier state for
* @device. The position is given in coordinates relative to the window
* containing the pointer, which is returned in @window.
* @window_get_device_position: Obtains the window underneath the device
* position. Current device position and modifier state are returned in
* @x, @y and @mask. The position is given in coordinates relative to
* @window.
* @window_at_device_position: Obtains the window underneath the device
* position, 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 device position. Each #GdkDisplay has a table of this type,
* which can be set using gdk_display_set_device_hooks().
*/
struct _GdkDisplayDeviceHooks
{
void (* get_device_state) (GdkDisplay *display,
GdkDevice *device,
GdkScreen **screen,
gint *x,
gint *y,
GdkModifierType *mask);
GdkWindow * (* window_get_device_position) (GdkDisplay *display,
GdkDevice *device,
GdkWindow *window,
gint *x,
gint *y,
GdkModifierType *mask);
GdkWindow * (* window_at_device_position) (GdkDisplay *display,
GdkDevice *device,
gint *win_x,
gint *win_y);
};
GType gdk_display_get_type (void) G_GNUC_CONST;
GdkDisplay *gdk_display_open (const gchar *display_name);
@ -149,9 +109,6 @@ void gdk_display_warp_pointer (GdkDisplay *disp
#endif /* GDK_DISABLE_DEPRECATED */
#endif /* GDK_MULTIDEVICE_SAFE */
GdkDisplayDeviceHooks *gdk_display_set_device_hooks (GdkDisplay *display,
const GdkDisplayDeviceHooks *new_hooks);
GdkDisplay *gdk_display_open_default_libgtk_only (void);
gboolean gdk_display_supports_cursor_alpha (GdkDisplay *display);

View File

@ -31,6 +31,28 @@ G_BEGIN_DECLS
#define GDK_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DISPLAY, GdkDisplayClass))
typedef struct _GdkDisplayDeviceHooks GdkDisplayDeviceHooks;
struct _GdkDisplayDeviceHooks
{
void (* get_device_state) (GdkDisplay *display,
GdkDevice *device,
GdkScreen **screen,
gint *x,
gint *y,
GdkModifierType *mask);
GdkWindow * (* window_get_device_position) (GdkDisplay *display,
GdkDevice *device,
GdkWindow *window,
gint *x,
gint *y,
GdkModifierType *mask);
GdkWindow * (* window_at_device_position) (GdkDisplay *display,
GdkDevice *device,
gint *win_x,
gint *win_y);
};
typedef struct _GdkDisplayClass GdkDisplayClass;
/* Tracks information about the keyboard grab on this display */