summaryrefslogtreecommitdiff
path: root/gtk/gtkgesturerotate.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-02-17 22:11:56 -0500
committerMatthias Clasen <mclasen@redhat.com>2020-02-21 00:51:03 -0500
commitb1eaa502dfda1dd727e938ce710c3861f1cad8fe (patch)
tree3cb71e60ccf5c6fdae527c9c4ef2e9bee8f0cd15 /gtk/gtkgesturerotate.c
parentf1cf0eb3fc95c94d5594aa700cbcb12bc32ebc43 (diff)
downloadgtk+-b1eaa502dfda1dd727e938ce710c3861f1cad8fe.tar.gz
events: reorganize getters
Restructure the getters for event fields to be more targeted at particular event types. Update all callers, and replace all direct event struct access with getters. As a side-effect, this drops some unused getters.
Diffstat (limited to 'gtk/gtkgesturerotate.c')
-rw-r--r--gtk/gtkgesturerotate.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gtk/gtkgesturerotate.c b/gtk/gtkgesturerotate.c
index fa0568fb70..2f0541ab78 100644
--- a/gtk/gtkgesturerotate.c
+++ b/gtk/gtkgesturerotate.c
@@ -97,7 +97,7 @@ _gtk_gesture_rotate_get_angle (GtkGestureRotate *rotate,
goto out;
last_event = gtk_gesture_get_last_event (gesture, sequences->data);
- gdk_event_get_touchpad_gesture_phase (last_event, &phase);
+ phase = gdk_touchpad_event_get_gesture_phase (last_event);
if (gdk_event_get_event_type (last_event) == GDK_TOUCHPAD_PINCH &&
(phase == GDK_TOUCHPAD_GESTURE_PHASE_BEGIN ||
@@ -179,7 +179,7 @@ gtk_gesture_rotate_filter_event (GtkEventController *controller,
{
guint n_fingers;
- gdk_event_get_touchpad_gesture_n_fingers (event, &n_fingers);
+ n_fingers = gdk_touchpad_event_get_n_fingers (event);
if (n_fingers == 2)
return FALSE;
@@ -203,11 +203,10 @@ gtk_gesture_rotate_handle_event (GtkEventController *controller,
priv = gtk_gesture_rotate_get_instance_private (rotate);
- gdk_event_get_touchpad_gesture_phase (event, &phase);
- gdk_event_get_touchpad_angle_delta (event, &delta);
-
if (gdk_event_get_event_type (event) == GDK_TOUCHPAD_PINCH)
{
+ phase = gdk_touchpad_event_get_gesture_phase (event);
+ delta = gdk_touchpad_pinch_event_get_angle_delta (event);
if (phase == GDK_TOUCHPAD_GESTURE_PHASE_BEGIN ||
phase == GDK_TOUCHPAD_GESTURE_PHASE_END)
priv->accum_touchpad_angle = 0;