diff options
author | Emanuele Aina <emanuele.aina@collabora.com> | 2012-10-08 17:44:13 +0200 |
---|---|---|
committer | Emanuele Aina <emanuele.aina@collabora.com> | 2012-10-19 14:13:17 +0200 |
commit | ccdbd362345d2224b3edaa60879a6ed55235da1f (patch) | |
tree | cf5cf6cebde428a0c9867bedb2aba3472250219c /examples | |
parent | 61f2d751d08aeade38b67f477bf4273e04231995 (diff) | |
download | clutter-ccdbd362345d2224b3edaa60879a6ed55235da1f.tar.gz |
gesture-action: Add clutter_gesture_action_get_last_event()
Export the last event received for each touch point in its entirety,
instead of duplicating ClutterEvent accessors one at a time.
examples/pan-action.c has been updated to show the type of the event
that's causing the panning.
https://bugzilla.gnome.org/show_bug.cgi?id=685737
Diffstat (limited to 'examples')
-rw-r--r-- | examples/pan-action.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/examples/pan-action.c b/examples/pan-action.c index 642a39df0..a8875824a 100644 --- a/examples/pan-action.c +++ b/examples/pan-action.c @@ -42,13 +42,22 @@ on_pan (ClutterPanAction *action, gpointer *user_data) { gfloat delta_x, delta_y; + const ClutterEvent *event = NULL; if (is_interpolated) clutter_pan_action_get_interpolated_delta (action, &delta_x, &delta_y); else - clutter_gesture_action_get_motion_delta (CLUTTER_GESTURE_ACTION (action), 0, &delta_x, &delta_y); + { + clutter_gesture_action_get_motion_delta (CLUTTER_GESTURE_ACTION (action), 0, &delta_x, &delta_y); + event = clutter_gesture_action_get_last_event (CLUTTER_GESTURE_ACTION (action), 0); + } - g_print ("panning dx:%.2f dy:%.2f\n", delta_x, delta_y); + g_print ("[%s] panning dx:%.2f dy:%.2f\n", + event == NULL ? "INTERPOLATED" : + event->type == CLUTTER_MOTION ? "MOTION" : + event->type == CLUTTER_TOUCH_UPDATE ? "TOUCH UPDATE" : + "?", + delta_x, delta_y); return TRUE; } |