~ubuntu-branches/ubuntu/vivid/clutter-1.0/vivid-proposed

« back to all changes in this revision

Viewing changes to clutter/clutter-zoom-action.c

  • Committer: Package Import Robot
  • Author(s): Sjoerd Simons
  • Date: 2013-03-15 23:20:40 UTC
  • mto: (4.1.25 experimental) (1.5.1)
  • mto: This revision was merged to the branch mainline in revision 23.
  • Revision ID: package-import@ubuntu.com-20130315232040-9wwd4f9mgx8lewoz
Tags: upstream-1.13.8
ImportĀ upstreamĀ versionĀ 1.13.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 * @Short_Description: Action enabling zooming on actors
29
29
 *
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.
32
33
 *
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
40
41
 * ]|
41
42
 *
42
43
 * will automatically result in the actor to be scale according to the
43
 
 * distance between 2 touch points.
 
44
 * distance between two touch points.
44
45
 *
45
46
 * Since: 1.12
46
47
 */
118
119
static void
119
120
capture_point_initial_position (ClutterGestureAction *action,
120
121
                                ClutterActor         *actor,
121
 
                                gint                  device,
 
122
                                gint                  index,
122
123
                                ZoomPoint            *point)
123
124
{
124
 
  clutter_gesture_action_get_motion_coords (action, device,
 
125
  clutter_gesture_action_get_motion_coords (action, index,
125
126
                                            &point->start_x,
126
127
                                            &point->start_y);
127
128
 
138
139
static void
139
140
capture_point_update_position (ClutterGestureAction *action,
140
141
                               ClutterActor         *actor,
141
 
                               gint                  device,
 
142
                               gint                  index,
142
143
                               ZoomPoint            *point)
143
144
{
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);
147
148
 
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
368
 
   *
369
 
   * The ::zoom signal is emitted for each touch event after the
370
 
   * #ClutterZoomAction::zoom-begin signal has been emitted.
371
 
   *
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
 
370
   *
 
371
   * The ::zoom signal is emitted for each series of touch events that
 
372
   * change the distance and focal point between the touch points.
377
373
   *
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
383
 
   * your callback.
 
376
   * distance between the touch points and the current distance. To
 
377
   * override the default behaviour, connect to this signal and return
 
378
   * %FALSE.
384
379
   *
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.
387
382
   *
388
383
   * Since: 1.12
389
384
   */