mirror of
https://github.com/brl/mutter.git
synced 2025-01-11 12:12:25 +00:00
gesture-action: add gesture_prepare() virtual function
The gesture_prepare() virtual function is called before the ::gesture-begin signal is emitted, and allows a subclass to reset its state. https://bugzilla.gnome.org/show_bug.cgi?id=683431
This commit is contained in:
parent
609766fa2b
commit
2001cd7a2c
@ -253,6 +253,12 @@ stage_captured_event_cb (ClutterActor *stage,
|
||||
{
|
||||
priv->in_gesture = TRUE;
|
||||
|
||||
if (!CLUTTER_GESTURE_ACTION_GET_CLASS (action)->gesture_prepare (action, actor))
|
||||
{
|
||||
cancel_gesture (action);
|
||||
return CLUTTER_EVENT_PROPAGATE;
|
||||
}
|
||||
|
||||
g_signal_emit (action, gesture_signals[GESTURE_BEGIN], 0, actor,
|
||||
&return_value);
|
||||
if (!return_value)
|
||||
@ -415,6 +421,7 @@ clutter_gesture_action_class_init (ClutterGestureActionClass *klass)
|
||||
|
||||
klass->gesture_begin = default_event_handler;
|
||||
klass->gesture_progress = default_event_handler;
|
||||
klass->gesture_prepare = default_event_handler;
|
||||
|
||||
/**
|
||||
* ClutterGestureAction::gesture-begin:
|
||||
|
@ -67,6 +67,8 @@ struct _ClutterGestureAction
|
||||
* @gesture_progress: class handler for the #ClutterGestureAction::gesture-progress signal
|
||||
* @gesture_end: class handler for the #ClutterGestureAction::gesture-end signal
|
||||
* @gesture_cancel: class handler for the #ClutterGestureAction::gesture-cancel signal
|
||||
* @gesture_prepare: virtual function called before emitting the
|
||||
* #ClutterGestureAction::gesture-cancel signal
|
||||
*
|
||||
* The <structname>ClutterGestureClass</structname> structure contains only
|
||||
* private data.
|
||||
@ -87,6 +89,8 @@ struct _ClutterGestureActionClass
|
||||
ClutterActor *actor);
|
||||
void (* gesture_cancel) (ClutterGestureAction *action,
|
||||
ClutterActor *actor);
|
||||
gboolean (* gesture_prepare) (ClutterGestureAction *action,
|
||||
ClutterActor *actor);
|
||||
|
||||
/*< private >*/
|
||||
void (* _clutter_gesture_action1) (void);
|
||||
@ -95,7 +99,6 @@ struct _ClutterGestureActionClass
|
||||
void (* _clutter_gesture_action4) (void);
|
||||
void (* _clutter_gesture_action5) (void);
|
||||
void (* _clutter_gesture_action6) (void);
|
||||
void (* _clutter_gesture_action7) (void);
|
||||
};
|
||||
|
||||
GType clutter_gesture_action_get_type (void) G_GNUC_CONST;
|
||||
|
Loading…
Reference in New Issue
Block a user