GestureAction


Object Hierarchy:

Object hierarchy for GestureAction

Description:

[ CCode ( type_id = "clutter_gesture_action_get_type ()" ) ]
[ Version ( since = "1.8" ) ]
public class GestureAction : Action

GestureAction is a sub-class of Action that implements the logic for recognizing gesture gestures.

It listens for low level events such as ButtonEvent and MotionEvent on the stage to raise the gesture_begin, gesture_progress, and gesture_end signals.

To use GestureAction you just need to apply it to a Actor using add_action and connect to the signals:

  ClutterAction *action = clutter_gesture_action_new ();

clutter_actor_add_action (actor, action);

g_signal_connect (action, "gesture-begin", G_CALLBACK (on_gesture_begin), NULL);
g_signal_connect (action, "gesture-progress", G_CALLBACK (on_gesture_progress), NULL);
g_signal_connect (action, "gesture-end", G_CALLBACK (on_gesture_end), NULL);

typeof (unichar2) typeof (unichar2) Creating Gesture actions

A GestureAction provides four separate states that can be used to recognize or ignore gestures when writing a new action class:

- Prepare -> Cancel - Prepare -> Begin -> Cancel - Prepare -> Begin -> End - Prepare -> Begin -> Progress -> Cancel - Prepare -> Begin -> Progress -> End

Each GestureAction starts in the "prepare" state, and calls the gesture_prepare virtual function; this state can be used to reset the internal state of a GestureAction subclass, but it can also immediately cancel a gesture without going through the rest of the states.

The "begin" state follows the "prepare" state, and calls the gesture_begin virtual function. This state signals the start of a gesture recognizing process. From the "begin" state the gesture recognition process can successfully end, by going to the "end" state; it can continue in the "progress" state, in case of a continuous gesture; or it can be terminated, by moving to the "cancel" state.

In case of continuous gestures, the GestureAction will use the "progress" state, calling the gesture_progress virtual function; the "progress" state will continue until the end of the gesture, in which case the "end" state will be reached, or until the gesture is cancelled, in which case the "cancel" gesture will be used instead.


Namespace: Clutter
Package: clutter-1.0

Content:

Properties:

Creation methods:

Methods:

Signals:

Inherited Members:

All known members inherited from class Clutter.ActorMeta