![]() |
![]() |
![]() |
Clutter Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
struct ClutterPanAction; struct ClutterPanActionClass; ClutterAction * clutter_pan_action_new (void
); enum ClutterPanAxis; void clutter_pan_action_set_pan_axis (ClutterPanAction *self
,ClutterPanAxis axis
); ClutterPanAxis clutter_pan_action_get_pan_axis (ClutterPanAction *self
); void clutter_pan_action_set_interpolate (ClutterPanAction *self
,gboolean should_interpolate
); gboolean clutter_pan_action_get_interpolate (ClutterPanAction *self
); void clutter_pan_action_set_deceleration (ClutterPanAction *self
,gdouble rate
); gdouble clutter_pan_action_get_deceleration (ClutterPanAction *self
); void clutter_pan_action_set_acceleration_factor (ClutterPanAction *self
,gdouble factor
); gdouble clutter_pan_action_get_acceleration_factor (ClutterPanAction *self
); void clutter_pan_action_get_interpolated_coords (ClutterPanAction *self
,gfloat *interpolated_x
,gfloat *interpolated_y
); void clutter_pan_action_get_interpolated_delta (ClutterPanAction *self
,gfloat *delta_x
,gfloat *delta_y
);
GObject +----GInitiallyUnowned +----ClutterActorMeta +----ClutterAction +----ClutterGestureAction +----ClutterPanAction
"acceleration-factor" gdouble : Read / Write "deceleration" gdouble : Read / Write "interpolate" gboolean : Read / Write "pan-axis" ClutterPanAxis : Read / Write
ClutterPanAction is a sub-class of ClutterGestureAction that implements the logic for recognizing pan gestures.
The simplest usage of ClutterPanAction consists in adding it to a ClutterActor with a child and setting it as reactive; for instance, the following code:
1 2 |
clutter_actor_add_action (actor, clutter_pan_action_new ()); clutter_actor_set_reactive (actor, TRUE); |
will automatically result in the actor children to be moved when dragging.
struct ClutterPanAction;
The ClutterPanAction structure contains only private data and should be accessed using the provided API
Since 1.12
struct ClutterPanActionClass { gboolean (* pan) (ClutterPanAction *action, ClutterActor *actor, gboolean is_interpolated); void (* pan_stopped) (ClutterPanAction *action, ClutterActor *actor); };
The ClutterPanActionClass structure contains only private data.
class handler for the "pan" signal | |
class handler for the "pan-stopped" signal |
Since 1.12
ClutterAction * clutter_pan_action_new (void
);
Creates a new ClutterPanAction instance
Returns : |
the newly created ClutterPanAction |
Since 1.12
typedef enum { /*< prefix=CLUTTER_PAN >*/ CLUTTER_PAN_AXIS_NONE = 0, CLUTTER_PAN_X_AXIS, CLUTTER_PAN_Y_AXIS } ClutterPanAxis;
The axis of the constraint that should be applied on the panning action
No constraint | |
Set a constraint on the X axis | |
Set a constraint on the Y axis |
Since 1.12
void clutter_pan_action_set_pan_axis (ClutterPanAction *self
,ClutterPanAxis axis
);
Restricts the panning action to a specific axis
|
a ClutterPanAction |
|
the axis to constraint the panning to |
Since 1.12
ClutterPanAxis clutter_pan_action_get_pan_axis (ClutterPanAction *self
);
Retrieves the axis constraint set by clutter_pan_action_set_pan_axis()
|
a ClutterPanAction |
Returns : |
the axis constraint |
Since 1.12
void clutter_pan_action_set_interpolate (ClutterPanAction *self
,gboolean should_interpolate
);
Sets whether the action should emit interpolated ::pan events after the drag has ended, to emulate the gesture kinetic inertia.
|
a ClutterPanAction |
|
whether to enable interpolated pan events |
Since 1.12
gboolean clutter_pan_action_get_interpolate (ClutterPanAction *self
);
Checks if the action should emit ::pan events even after releasing the pointer during a panning gesture, to emulate some kind of kinetic inertia.
|
a ClutterPanAction |
Returns : |
TRUE if interpolated events emission is active. |
Since 1.12
void clutter_pan_action_set_deceleration (ClutterPanAction *self
,gdouble rate
);
Sets the deceleration rate of the interpolated ::pan events generated after a pan gesture. This is approximately the value that the momentum at the time of releasing the pointer is divided by every 60th of a second.
|
A ClutterPanAction |
|
The deceleration rate |
Since 1.12
gdouble clutter_pan_action_get_deceleration (ClutterPanAction *self
);
Retrieves the deceleration rate of interpolated ::pan events.
|
A ClutterPanAction |
Returns : |
The deceleration rate of the interpolated events. |
Since 1.12
void clutter_pan_action_set_acceleration_factor (ClutterPanAction *self
,gdouble factor
);
Factor applied to the momentum velocity at the time of releasing the pointer when generating interpolated ::pan events.
|
A ClutterPanAction |
|
The acceleration factor |
Since 1.12
gdouble clutter_pan_action_get_acceleration_factor
(ClutterPanAction *self
);
Retrieves the initial acceleration factor for interpolated ::pan events.
|
A ClutterPanAction |
Returns : |
The initial acceleration factor for interpolated events. |
Since 1.12
void clutter_pan_action_get_interpolated_coords (ClutterPanAction *self
,gfloat *interpolated_x
,gfloat *interpolated_y
);
Retrieves the coordinates, in stage space, of the latest interpolated
event, analogous to clutter_gesture_action_get_motion_coords()
.
|
A ClutterPanAction |
|
return location for the latest interpolated event's X coordinate. [out][allow-none] |
|
return location for the latest interpolated event's Y coordinate. [out][allow-none] |
Since 1.12
void clutter_pan_action_get_interpolated_delta (ClutterPanAction *self
,gfloat *delta_x
,gfloat *delta_y
);
Retrieves the delta, in stage space, since the latest interpolated
event, analogous to clutter_gesture_action_get_motion_delta()
.
|
A ClutterPanAction |
|
return location for the X delta since the latest interpolated event. [out][allow-none] |
|
return location for the Y delta since the latest interpolated event. [out][allow-none] |
Since 1.12
"acceleration-factor"
property "acceleration-factor" gdouble : Read / Write
The initial acceleration factor
The kinetic momentum measured at the time of releasing the pointer will be multiplied by the factor specified by this property before being used to generate interpolated ::pan events.
Allowed values: >= 1
Default value: 1
Since 1.12
"deceleration"
property "deceleration" gdouble : Read / Write
The rate at which the interpolated panning will decelerate in
ClutterPanAction will emit interpolated ::pan events with decreasing scroll deltas, using the rate specified by this property.
Allowed values: [1e-15,1]
Default value: 0.95
Since 1.12
"interpolate"
property "interpolate" gboolean : Read / Write
Whether interpolated events emission is enabled.
Default value: FALSE
Since 1.12
"pan-axis"
property"pan-axis" ClutterPanAxis : Read / Write
Constraints the panning action to the specified axis
Default value: CLUTTER_PAN_AXIS_NONE
Since 1.12
"pan"
signalgboolean user_function (ClutterPanAction *action,
ClutterActor *actor,
gboolean is_interpolated,
gpointer user_data) : Run Last
The ::pan signal is emitted to keep track of the motion during
a pan gesture. is_interpolated
is set to TRUE
during the
interpolation phase of the pan, after the drag has ended and
the :interpolate property was set to TRUE
.
|
the ClutterPanAction that emitted the signal |
|
the ClutterActor attached to the action
|
|
if the event is the result of interpolating the motion velocity at the end of the drag |
|
user data set when the signal handler was connected. |
Returns : |
TRUE if the pan action has been handled by one of
the listener or FALSE to continue the emission. |
Since 1.12
"pan-stopped"
signalvoid user_function (ClutterPanAction *action,
ClutterActor *actor,
gpointer user_data) : Run Last
The ::pan-stopped signal is emitted at the end of the interpolation
phase of the pan action, only when :interpolate is set to TRUE
.
|
the ClutterPanAction that emitted the signal |
|
the ClutterActor attached to the action
|
|
user data set when the signal handler was connected. |
Since 1.12