From ccdbd362345d2224b3edaa60879a6ed55235da1f Mon Sep 17 00:00:00 2001 From: Emanuele Aina Date: Mon, 8 Oct 2012 17:44:13 +0200 Subject: 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 --- examples/pan-action.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'examples') 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; } -- cgit v1.2.1