28
28
* @Short_Description: Action enabling zooming on actors
30
30
* #ClutterZoomAction is a sub-class of #ClutterGestureAction that
31
* implements all the necessary logic for zooming actors.
31
* implements all the necessary logic for zooming actors using a "pinch"
32
* gesture between two touch points.
33
34
* The simplest usage of #ClutterZoomAction consists in adding it to
34
35
* a #ClutterActor and setting it as reactive; for instance, the following
119
120
capture_point_initial_position (ClutterGestureAction *action,
120
121
ClutterActor *actor,
122
123
ZoomPoint *point)
124
clutter_gesture_action_get_motion_coords (action, device,
125
clutter_gesture_action_get_motion_coords (action, index,
126
127
&point->start_y);
139
140
capture_point_update_position (ClutterGestureAction *action,
140
141
ClutterActor *actor,
142
143
ZoomPoint *point)
144
clutter_gesture_action_get_motion_coords (action, device,
145
clutter_gesture_action_get_motion_coords (action, index,
145
146
&point->update_x,
146
147
&point->update_y);
364
365
* ClutterZoomAction::zoom:
365
366
* @action: the #ClutterZoomAction that emitted the signal
366
367
* @actor: the #ClutterActor attached to the action
367
* @distance: the initial distance between the 2 touch points
369
* The ::zoom signal is emitted for each touch event after the
370
* #ClutterZoomAction::zoom-begin signal has been emitted.
372
* The components of the distance between the touch begin event and
373
* the latest touch update event are computed in the actor's
374
* coordinate space, to take into account eventual transformations.
375
* If you want the stage coordinates of the latest motion event you
376
* can use clutter_zoom_action_get_motion_coords().
368
* @focal_point: the focal point of the zoom
369
* @factor: the initial distance between the 2 touch points
371
* The ::zoom signal is emitted for each series of touch events that
372
* change the distance and focal point between the touch points.
378
374
* The default handler of the signal will call
379
375
* clutter_actor_set_scale() on @actor using the ratio of the first
380
* distance between the 2 touch points and the current distance. If
381
* you want to override the default behaviour, you can connect to
382
* this signal and call g_signal_stop_emission_by_name() from within
376
* distance between the touch points and the current distance. To
377
* override the default behaviour, connect to this signal and return
385
* Return value: %TRUE if the zoom action has been handled by one of
386
* the listener or %FALSE to continue the emission.
380
* Return value: %TRUE if the zoom should continue, and %FALSE if
381
* the zoom should be cancelled.