ClutterZoomAction

ClutterZoomAction — Action enabling zooming on actors

Functions

Types and Values

Description

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.

Functions

clutter_zoom_action_new ()

ClutterAction *
clutter_zoom_action_new (void);

Creates a new ClutterZoomAction instance

Returns

the newly created ClutterZoomAction

Since: 1.12


clutter_zoom_action_set_zoom_axis ()

void
clutter_zoom_action_set_zoom_axis (ClutterZoomAction *action,
                                   ClutterZoomAxis axis);

Restricts the zooming action to a specific axis

Parameters

action

a ClutterZoomAction

 

axis

the axis to constraint the zooming to

 

Since: 1.12


clutter_zoom_action_get_zoom_axis ()

ClutterZoomAxis
clutter_zoom_action_get_zoom_axis (ClutterZoomAction *action);

Retrieves the axis constraint set by clutter_zoom_action_set_zoom_axis()

Parameters

action

a ClutterZoomAction

 

Returns

the axis constraint

Since: 1.12


clutter_zoom_action_get_focal_point ()

void
clutter_zoom_action_get_focal_point (ClutterZoomAction *action,
                                     ClutterPoint *point);

Retrieves the focal point of the current zoom

Parameters

action

a ClutterZoomAction

 

point

a ClutterPoint.

[out]

Since: 1.12


clutter_zoom_action_get_transformed_focal_point ()

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

Parameters

action

a ClutterZoomAction

 

point

a ClutterPoint.

[out]

Since: 1.12

Types and Values

struct ClutterZoomAction

struct ClutterZoomAction {
};

The ClutterZoomAction structure contains only private data and should be accessed using the provided API

Since: 1.12


struct ClutterZoomActionClass

struct ClutterZoomActionClass {
  gboolean (* zoom)  (ClutterZoomAction *action,
                      ClutterActor      *actor,
                      ClutterPoint      *focal_point,
                      gdouble            factor);
};

The ClutterZoomActionClass structure contains only private data

Members

zoom ()

class handler of the “zoom” signal

 

Since: 1.12


enum ClutterZoomAxis

The axis of the constraint that should be applied by the zooming action.

Members

CLUTTER_ZOOM_X_AXIS

Scale only on the X axis

 

CLUTTER_ZOOM_Y_AXIS

Scale only on the Y axis

 

CLUTTER_ZOOM_BOTH

Scale on both axis

 

Since: 1.12