diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2020-04-16 17:23:36 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2020-04-16 19:54:02 +0100 |
commit | f28aa1ba026dad82c4d3a128f99d4e99615a5a52 (patch) | |
tree | 4ae2801c19e8b53b6b491961575ea5d03af35d0c /gtk/gtkgesturezoom.c | |
parent | 96cfb12946f13581a2ecd89da035f14b555a0a47 (diff) | |
download | gtk+-f28aa1ba026dad82c4d3a128f99d4e99615a5a52.tar.gz |
Restructure the GdkEvent type hierarchy
GdkEvent has been a "I-can't-believe-this-is-not-OOP" type for ages,
using a union of sub-types. This has always been problematic when it
comes to implementing accessor functions: either you get generic API
that takes a GdkEvent and uses a massive switch() to determine which
event types have the data you're looking for; or you create namespaced
accessors, but break language bindings horribly, as boxed types cannot
have derived types.
The recent conversion of GskRenderNode (which had similar issues) to
GTypeInstance, and the fact that GdkEvent is now a completely opaque
type, provide us with the chance of moving GdkEvent to GTypeInstance,
and have sub-types for GdkEvent.
The change from boxed type to GTypeInstance is pretty small, all things
considered, but ends up cascading to a larger commit, as we still have
backends and code in GTK trying to access GdkEvent structures directly.
Additionally, the naming of the public getter functions requires
renaming all the data structures to conform to the namespace/type-name
pattern.
Diffstat (limited to 'gtk/gtkgesturezoom.c')
-rw-r--r-- | gtk/gtkgesturezoom.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gtk/gtkgesturezoom.c b/gtk/gtkgesturezoom.c index 3eefa3f60a..83f8e3a276 100644 --- a/gtk/gtkgesturezoom.c +++ b/gtk/gtkgesturezoom.c @@ -104,7 +104,7 @@ _gtk_gesture_zoom_get_distance (GtkGestureZoom *zoom, double scale; /* Touchpad pinch */ - scale = gdk_touchpad_pinch_event_get_scale (last_event); + scale = gdk_touchpad_event_get_pinch_scale (last_event); *distance = scale; } else |