GNOME Bugzilla – Bug 685737
Export the last event for each touch point on GestureAction
Last modified: 2012-10-19 12:21:59 UTC
Instead of adding dozen of accessors duplicating the ones from ClutterEvent, we can export the last event received for each touch point and then use the usual ClutterEvent API.
Created attachment 226056 [details] [review] 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.
The patch uses the CLUTTER_AVAILABLE_IN_1_14 version macro from http://bugzilla-attachments.gnome.org/attachment.cgi?id=225318
Review of attachment 226056 [details] [review]: looks generally okay to me, but the getter semantics are odd. ::: clutter/clutter-gesture-action.c @@ +1057,3 @@ + gesture_point = &g_array_index (action->priv->points, GesturePoint, point); + + return clutter_event_copy (gesture_point->last_event); mmh, we don't follow this pattern for getters anywhere else in Clutter. you should just return a const ClutterEvent*, and tell users to copy the event if they want to hang to it.
Created attachment 226208 [details] [review] gesture-action: Add clutter_gesture_action_get_last_event() Return const reference to the event.
Created attachment 226528 [details] [review] gesture-action: Add clutter_gesture_action_get_last_event() Fixed const qualifier in the pan-action example.
Review of attachment 226528 [details] [review]: looks okay to me.
The following fix has been pushed: ccdbd36 gesture-action: Add clutter_gesture_action_get_last_event()
Created attachment 226818 [details] [review] 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.