Top | Description | Object Hierarchy | Properties | Signals | ![]() |
![]() |
![]() |
![]() |
struct ClutterZoomAction; struct ClutterZoomActionClass; ClutterAction * clutter_zoom_action_new (void
); enum ClutterZoomAxis; void clutter_zoom_action_set_zoom_axis (ClutterZoomAction *action
,ClutterZoomAxis axis
); ClutterZoomAxis clutter_zoom_action_get_zoom_axis (ClutterZoomAction *action
); void clutter_zoom_action_get_focal_point (ClutterZoomAction *action
,ClutterPoint *point
); void clutter_zoom_action_get_transformed_focal_point (ClutterZoomAction *action
,ClutterPoint *point
);
GObject +----GInitiallyUnowned +----ClutterActorMeta +----ClutterAction +----ClutterGestureAction +----ClutterZoomAction
ClutterZoomAction is a sub-class of ClutterGestureAction that implements all the necessary logic for zooming actors using a "pinch" gesture between two touch points.
The simplest usage of ClutterZoomAction consists in adding it to a ClutterActor and setting it as reactive; for instance, the following code:
1 2 |
clutter_actor_add_action (actor, clutter_zoom_action_new ()); clutter_actor_set_reactive (actor, TRUE); |
will automatically result in the actor to be scale according to the distance between two touch points.
struct ClutterZoomAction;
The ClutterZoomAction structure contains only private data and should be accessed using the provided API
Since 1.12
struct ClutterZoomActionClass { gboolean (* zoom) (ClutterZoomAction *action, ClutterActor *actor, ClutterPoint *focal_point, gdouble factor); };
The ClutterZoomActionClass structure contains only private data
class handler of the "zoom" signal |
Since 1.12
ClutterAction * clutter_zoom_action_new (void
);
Creates a new ClutterZoomAction instance
Returns : |
the newly created ClutterZoomAction |
Since 1.12
typedef enum { /*< prefix=CLUTTER_ZOOM >*/ CLUTTER_ZOOM_X_AXIS, CLUTTER_ZOOM_Y_AXIS, CLUTTER_ZOOM_BOTH } ClutterZoomAxis;
The axis of the constraint that should be applied by the zooming action.
Scale only on the X axis | |
Scale only on the Y axis | |
Scale on both axis |
Since 1.12
void clutter_zoom_action_set_zoom_axis (ClutterZoomAction *action
,ClutterZoomAxis axis
);
Restricts the zooming action to a specific axis
|
a ClutterZoomAction |
|
the axis to constraint the zooming to |
Since 1.12
ClutterZoomAxis clutter_zoom_action_get_zoom_axis (ClutterZoomAction *action
);
Retrieves the axis constraint set by clutter_zoom_action_set_zoom_axis()
|
a ClutterZoomAction |
Returns : |
the axis constraint |
Since 1.12
void clutter_zoom_action_get_focal_point (ClutterZoomAction *action
,ClutterPoint *point
);
Retrieves the focal point of the current zoom
|
a ClutterZoomAction |
|
a ClutterPoint. [out] |
Since 1.12
void clutter_zoom_action_get_transformed_focal_point (ClutterZoomAction *action
,ClutterPoint *point
);
Retrieves the focal point relative to the actor's coordinates of the current zoom
|
a ClutterZoomAction |
|
a ClutterPoint. [out] |
Since 1.12
"zoom-axis"
property"zoom-axis" ClutterZoomAxis : Read / Write
Constraints the zooming action to the specified axis
Default value: CLUTTER_ZOOM_BOTH
Since 1.12
"zoom"
signalgboolean user_function (ClutterZoomAction *action,
ClutterActor *actor,
ClutterPoint *focal_point,
gdouble factor,
gpointer user_data) : Run Last
The ::zoom signal is emitted for each series of touch events that change the distance and focal point between the touch points.
The default handler of the signal will call
clutter_actor_set_scale()
on actor
using the ratio of the first
distance between the touch points and the current distance. To
override the default behaviour, connect to this signal and return
FALSE
.
|
the ClutterZoomAction that emitted the signal |
|
the ClutterActor attached to the action |
|
the focal point of the zoom |
|
the initial distance between the 2 touch points |
|
user data set when the signal handler was connected. |
Returns : |
TRUE if the zoom should continue, and FALSE if
the zoom should be cancelled. |
Since 1.12