From ca1c89c5bda7cffd7eacec0c8a7be06e7a98131c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 8 Jun 2020 18:19:57 -0400 Subject: [PATCH 1/4] broadway: Drop a pointless vfunc A vfunc that just returns FALSE is not useful. --- gdk/broadway/gdkdevice-broadway.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/gdk/broadway/gdkdevice-broadway.c b/gdk/broadway/gdkdevice-broadway.c index a936d36d36..4ab5295c7d 100644 --- a/gdk/broadway/gdkdevice-broadway.c +++ b/gdk/broadway/gdkdevice-broadway.c @@ -23,12 +23,6 @@ #include "gdksurfaceprivate.h" #include "gdkprivate-broadway.h" -static gboolean gdk_broadway_device_get_history (GdkDevice *device, - GdkSurface *surface, - guint32 start, - guint32 stop, - GdkTimeCoord ***events, - gint *n_events); static void gdk_broadway_device_get_state (GdkDevice *device, GdkSurface *surface, gdouble *axes, @@ -64,7 +58,6 @@ gdk_broadway_device_class_init (GdkBroadwayDeviceClass *klass) { GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass); - device_class->get_history = gdk_broadway_device_get_history; device_class->get_state = gdk_broadway_device_get_state; device_class->set_surface_cursor = gdk_broadway_device_set_surface_cursor; device_class->query_state = gdk_broadway_device_query_state; @@ -84,17 +77,6 @@ gdk_broadway_device_init (GdkBroadwayDevice *device_core) _gdk_device_add_axis (device, NULL, GDK_AXIS_Y, 0, 0, 1); } -static gboolean -gdk_broadway_device_get_history (GdkDevice *device, - GdkSurface *surface, - guint32 start, - guint32 stop, - GdkTimeCoord ***events, - gint *n_events) -{ - return FALSE; -} - static void gdk_broadway_device_get_state (GdkDevice *device, GdkSurface *surface, From 876560924fe9e5affff16d75cef7817b539c057d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 8 Jun 2020 18:20:20 -0400 Subject: [PATCH 2/4] wayland: Drop a pointless vfunc A vfunc that just returns FALSE is not useful. --- gdk/wayland/gdkdevice-wayland.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index c0708bc8af..17001aff1b 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -309,17 +309,6 @@ static void deliver_key_event (GdkWaylandSeat *seat, uint32_t state, gboolean from_key_repeat); -static gboolean -gdk_wayland_device_get_history (GdkDevice *device, - GdkSurface *surface, - guint32 start, - guint32 stop, - GdkTimeCoord ***events, - gint *n_events) -{ - return FALSE; -} - static void gdk_wayland_device_get_state (GdkDevice *device, GdkSurface *surface, @@ -828,7 +817,6 @@ gdk_wayland_device_class_init (GdkWaylandDeviceClass *klass) { GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass); - device_class->get_history = gdk_wayland_device_get_history; device_class->get_state = gdk_wayland_device_get_state; device_class->set_surface_cursor = gdk_wayland_device_set_surface_cursor; device_class->query_state = gdk_wayland_device_query_state; From da9b3a92563d6ed977504ca48cfe8162f3d4e8f4 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 8 Jun 2020 18:21:12 -0400 Subject: [PATCH 3/4] win32: Drop pointless vfuncs These are not useful. --- gdk/win32/gdkdevice-virtual.c | 13 ------------- gdk/win32/gdkdevice-win32.c | 12 ------------ gdk/win32/gdkdevice-wintab.c | 12 ------------ 3 files changed, 37 deletions(-) diff --git a/gdk/win32/gdkdevice-virtual.c b/gdk/win32/gdkdevice-virtual.c index 4435cf5a20..f0643da42c 100644 --- a/gdk/win32/gdkdevice-virtual.c +++ b/gdk/win32/gdkdevice-virtual.c @@ -63,18 +63,6 @@ _gdk_device_virtual_set_active (GdkDevice *device, g_signal_emit_by_name (G_OBJECT (device), "changed"); } -static gboolean -gdk_device_virtual_get_history (GdkDevice *device, - GdkSurface *window, - guint32 start, - guint32 stop, - GdkTimeCoord ***events, - gint *n_events) -{ - /* History is only per slave device */ - return FALSE; -} - static void gdk_device_virtual_get_state (GdkDevice *device, GdkSurface *window, @@ -188,7 +176,6 @@ gdk_device_virtual_class_init (GdkDeviceVirtualClass *klass) { GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass); - device_class->get_history = gdk_device_virtual_get_history; device_class->get_state = gdk_device_virtual_get_state; device_class->set_surface_cursor = gdk_device_virtual_set_surface_cursor; device_class->query_state = gdk_device_virtual_query_state; diff --git a/gdk/win32/gdkdevice-win32.c b/gdk/win32/gdkdevice-win32.c index 588e624db3..ec8198f4ba 100644 --- a/gdk/win32/gdkdevice-win32.c +++ b/gdk/win32/gdkdevice-win32.c @@ -29,17 +29,6 @@ G_DEFINE_TYPE (GdkDeviceWin32, gdk_device_win32, GDK_TYPE_DEVICE) -static gboolean -gdk_device_win32_get_history (GdkDevice *device, - GdkSurface *window, - guint32 start, - guint32 stop, - GdkTimeCoord ***events, - gint *n_events) -{ - return FALSE; -} - static void gdk_device_win32_get_state (GdkDevice *device, GdkSurface *window, @@ -235,7 +224,6 @@ gdk_device_win32_class_init (GdkDeviceWin32Class *klass) { GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass); - device_class->get_history = gdk_device_win32_get_history; device_class->get_state = gdk_device_win32_get_state; device_class->set_surface_cursor = gdk_device_win32_set_surface_cursor; device_class->query_state = gdk_device_win32_query_state; diff --git a/gdk/win32/gdkdevice-wintab.c b/gdk/win32/gdkdevice-wintab.c index a05b56e2c4..052c71bee6 100644 --- a/gdk/win32/gdkdevice-wintab.c +++ b/gdk/win32/gdkdevice-wintab.c @@ -28,17 +28,6 @@ G_DEFINE_TYPE (GdkDeviceWintab, gdk_device_wintab, GDK_TYPE_DEVICE) -static gboolean -gdk_device_wintab_get_history (GdkDevice *device, - GdkSurface *window, - guint32 start, - guint32 stop, - GdkTimeCoord ***events, - gint *n_events) -{ - return FALSE; -} - static GdkModifierType get_current_mask (void) { @@ -267,7 +256,6 @@ gdk_device_wintab_class_init (GdkDeviceWintabClass *klass) { GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass); - device_class->get_history = gdk_device_wintab_get_history; device_class->get_state = gdk_device_wintab_get_state; device_class->set_surface_cursor = gdk_device_wintab_set_surface_cursor; device_class->query_state = gdk_device_wintab_query_state; From 805ddc3c3a8e3d4a4a0125919b2cd0693d18ba3c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 8 Jun 2020 18:22:52 -0400 Subject: [PATCH 4/4] gdk: Drop gdk_device_get_history This function is not implemented anywhere. --- docs/reference/gdk/gdk4-sections.txt | 2 - gdk/gdkdevice.c | 87 ---------------------------- gdk/gdkdevice.h | 10 ---- gdk/gdkdeviceprivate.h | 7 --- 4 files changed, 106 deletions(-) diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt index b20bcaf341..cc1bdd0189 100644 --- a/docs/reference/gdk/gdk4-sections.txt +++ b/docs/reference/gdk/gdk4-sections.txt @@ -382,8 +382,6 @@ gdk_device_has_bidi_layouts gdk_device_get_state gdk_device_get_surface_at_position -gdk_device_get_history -gdk_device_free_history GdkTimeCoord gdk_device_get_axis gdk_device_get_axis_names diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c index b617423fe9..969d05f777 100644 --- a/gdk/gdkdevice.c +++ b/gdk/gdkdevice.c @@ -635,93 +635,6 @@ gdk_device_get_surface_at_position (GdkDevice *device, return surface; } -/** - * gdk_device_get_history: (skip) - * @device: a #GdkDevice - * @surface: the surface with respect to which the event coordinates will be reported - * @start: starting timestamp for range of events to return - * @stop: ending timestamp for the range of events to return - * @events: (array length=n_events) (out) (transfer full) (optional): - * location to store a newly-allocated array of #GdkTimeCoord, or - * %NULL - * @n_events: (out) (optional): location to store the length of - * @events, or %NULL - * - * Obtains the motion history for a pointer device; given a starting and - * ending timestamp, return all events in the motion history for - * the device in the given range of time. Some windowing systems - * do not support motion history, in which case, %FALSE will - * be returned. (This is not distinguishable from the case where - * motion history is supported and no events were found.) - * - * Note that there is also gdk_surface_set_event_compression() to get - * more motion events delivered directly, independent of the windowing - * system. - * - * Returns: %TRUE if the windowing system supports motion history and - * at least one event was found. - **/ -gboolean -gdk_device_get_history (GdkDevice *device, - GdkSurface *surface, - guint32 start, - guint32 stop, - GdkTimeCoord ***events, - gint *n_events) -{ - g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE); - g_return_val_if_fail (device->source != GDK_SOURCE_KEYBOARD, FALSE); - g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE); - - if (n_events) - *n_events = 0; - - if (events) - *events = NULL; - - if (GDK_SURFACE_DESTROYED (surface)) - return FALSE; - - if (!GDK_DEVICE_GET_CLASS (device)->get_history) - return FALSE; - - return GDK_DEVICE_GET_CLASS (device)->get_history (device, surface, - start, stop, - events, n_events); -} - -GdkTimeCoord ** -_gdk_device_allocate_history (GdkDevice *device, - gint n_events) -{ - GdkTimeCoord **result = g_new (GdkTimeCoord *, n_events); - gint i; - - for (i = 0; i < n_events; i++) - result[i] = g_malloc (sizeof (GdkTimeCoord) - - sizeof (double) * (GDK_MAX_TIMECOORD_AXES - device->axes->len)); - return result; -} - -/** - * gdk_device_free_history: (skip) - * @events: (array length=n_events): an array of #GdkTimeCoord. - * @n_events: the length of the array. - * - * Frees an array of #GdkTimeCoord that was returned by gdk_device_get_history(). - */ -void -gdk_device_free_history (GdkTimeCoord **events, - gint n_events) -{ - gint i; - - for (i = 0; i < n_events; i++) - g_free (events[i]); - - g_free (events); -} - /** * gdk_device_get_name: * @device: a #GdkDevice diff --git a/gdk/gdkdevice.h b/gdk/gdkdevice.h index b1cdf583a4..a45a3163fb 100644 --- a/gdk/gdkdevice.h +++ b/gdk/gdkdevice.h @@ -146,16 +146,6 @@ GDK_AVAILABLE_IN_ALL GdkSurface * gdk_device_get_surface_at_position (GdkDevice *device, double *win_x, double *win_y); -GDK_AVAILABLE_IN_ALL -gboolean gdk_device_get_history (GdkDevice *device, - GdkSurface *surface, - guint32 start, - guint32 stop, - GdkTimeCoord ***events, - gint *n_events); -GDK_AVAILABLE_IN_ALL -void gdk_device_free_history (GdkTimeCoord **events, - gint n_events); GDK_AVAILABLE_IN_ALL gint gdk_device_get_n_axes (GdkDevice *device); diff --git a/gdk/gdkdeviceprivate.h b/gdk/gdkdeviceprivate.h index 55d4f0beef..de7c9e5c34 100644 --- a/gdk/gdkdeviceprivate.h +++ b/gdk/gdkdeviceprivate.h @@ -70,13 +70,6 @@ struct _GdkDeviceClass { GObjectClass parent_class; - gboolean (* get_history) (GdkDevice *device, - GdkSurface *surface, - guint32 start, - guint32 stop, - GdkTimeCoord ***events, - gint *n_events); - void (* get_state) (GdkDevice *device, GdkSurface *surface, gdouble *axes,