Clutter.PanAction

g Clutter.Action Clutter.Action Clutter.GestureAction Clutter.GestureAction Clutter.Action->Clutter.GestureAction Clutter.ActorMeta Clutter.ActorMeta Clutter.ActorMeta->Clutter.Action Clutter.PanAction Clutter.PanAction Clutter.GestureAction->Clutter.PanAction GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Clutter.ActorMeta GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned

Subclasses:

None

Methods

Inherited:

Clutter.GestureAction (18), Clutter.ActorMeta (5), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

get_acceleration_factor ()

get_constrained_motion_delta (point)

get_deceleration ()

get_interpolate ()

get_interpolated_coords ()

get_interpolated_delta ()

get_motion_coords (point)

get_motion_delta (point)

get_pan_axis ()

set_acceleration_factor (factor)

set_deceleration (rate)

set_interpolate (should_interpolate)

set_pan_axis (axis)

Virtual Methods

Inherited:

Clutter.GestureAction (5), Clutter.ActorMeta (1), GObject.Object (7)

do_pan (actor, is_interpolated)

do_pan_stopped (actor)

Properties

Inherited:

Clutter.GestureAction (4), Clutter.ActorMeta (3)

Name

Type

Flags

Short Description

acceleration-factor

float

r/w

Factor applied to the momentum when starting the interpolated phase

deceleration

float

r/w

Rate at which the interpolated panning will decelerate in

interpolate

bool

r/w

Whether interpolated events emission is enabled.

pan-axis

Clutter.PanAxis

r/w

Constraints the panning to an axis

Signals

Inherited:

Clutter.GestureAction (4), GObject.Object (1)

Name

Short Description

pan

The ::pan signal is emitted to keep track of the motion during a pan gesture.

pan-stopped

The ::pan-stopped signal is emitted at the end of the interpolation phase of the pan action, only when :interpolate is set to True.

Fields

Inherited:

Clutter.GestureAction (4), GObject.Object (1)

Name

Type

Access

Description

parent_instance

Clutter.GestureAction

r

Class Details

class Clutter.PanAction(**kwargs)
Bases:

Clutter.GestureAction

Abstract:

No

Structure:

Clutter.PanActionClass

The Clutter.PanAction structure contains only private data and should be accessed using the provided API

New in version 1.12.

classmethod new()
Returns:

the newly created Clutter.PanAction

Return type:

Clutter.Action

Creates a new Clutter.PanAction instance

New in version 1.12.

get_acceleration_factor()
Returns:

The initial acceleration factor for interpolated events.

Return type:

float

Retrieves the initial acceleration factor for interpolated ::pan events.

New in version 1.12.

get_constrained_motion_delta(point)
Parameters:

point (int) – the touch point index, with 0 being the first touch point received by the action

Returns:

the distance since last motion event

delta_x:

return location for the X delta

delta_y:

return location for the Y delta

Return type:

(float, delta_x: float, delta_y: float)

Retrieves the delta, in stage space, dependent on the current state of the Clutter.PanAction, and respecting the constraint specified by the Clutter.PanAction :pan-axis property.

New in version 1.24.

get_deceleration()
Returns:

The deceleration rate of the interpolated events.

Return type:

float

Retrieves the deceleration rate of interpolated ::pan events.

New in version 1.12.

get_interpolate()
Returns:

True if interpolated events emission is active.

Return type:

bool

Checks if the action should emit ::pan events even after releasing the pointer during a panning gesture, to emulate some kind of kinetic inertia.

New in version 1.12.

get_interpolated_coords()
Returns:

interpolated_x:

return location for the latest interpolated event’s X coordinate

interpolated_y:

return location for the latest interpolated event’s Y coordinate

Return type:

(interpolated_x: float, interpolated_y: float)

Retrieves the coordinates, in stage space, of the latest interpolated event, analogous to Clutter.GestureAction.get_motion_coords().

New in version 1.12.

get_interpolated_delta()
Returns:

the distance since the latest interpolated event

delta_x:

return location for the X delta since the latest interpolated event

delta_y:

return location for the Y delta since the latest interpolated event

Return type:

(float, delta_x: float, delta_y: float)

Retrieves the delta, in stage space, since the latest interpolated event, analogous to Clutter.GestureAction.get_motion_delta().

New in version 1.12.

get_motion_coords(point)
Parameters:

point (int) – the touch point index, with 0 being the first touch point received by the action

Returns:

motion_x:

return location for the X coordinate

motion_y:

return location for the Y coordinate

Return type:

(motion_x: float, motion_y: float)

Retrieves the coordinates, in stage space, dependent on the current state of the Clutter.PanAction. If it is inactive, both fields will be set to 0. If it is panning by user action, the values will be equivalent to those returned by Clutter.GestureAction.get_motion_coords(). If it is interpolating with some form of kinetic scrolling, the values will be equivalent to those returned by Clutter.PanAction.get_interpolated_coords(). This is a convenience method designed to be used in replacement “pan” signal handlers.

New in version 1.14.

get_motion_delta(point)
Parameters:

point (int) – the touch point index, with 0 being the first touch point received by the action

Returns:

delta_x:

return location for the X delta

delta_y:

return location for the Y delta

Return type:

(float, delta_x: float, delta_y: float)

Retrieves the delta, in stage space, dependent on the current state of the Clutter.PanAction. If it is inactive, both fields will be set to 0. If it is panning by user action, the values will be equivalent to those returned by Clutter.GestureAction.get_motion_delta(). If it is interpolating with some form of kinetic scrolling, the values will be equivalent to those returned by Clutter.PanAction.get_interpolated_delta(). This is a convenience method designed to be used in replacement “pan” signal handlers.

New in version 1.14.

get_pan_axis()
Returns:

the axis constraint

Return type:

Clutter.PanAxis

Retrieves the axis constraint set by Clutter.PanAction.set_pan_axis()

New in version 1.12.

set_acceleration_factor(factor)
Parameters:

factor (float) – The acceleration factor

Factor applied to the momentum velocity at the time of releasing the pointer when generating interpolated ::pan events.

New in version 1.12.

set_deceleration(rate)
Parameters:

rate (float) – The deceleration 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.

New in version 1.12.

set_interpolate(should_interpolate)
Parameters:

should_interpolate (bool) – whether to enable interpolated pan events

Sets whether the action should emit interpolated ::pan events after the drag has ended, to emulate the gesture kinetic inertia.

New in version 1.12.

set_pan_axis(axis)
Parameters:

axis (Clutter.PanAxis) – the axis to constraint the panning to

Restricts the panning action to a specific axis

New in version 1.12.

do_pan(actor, is_interpolated) virtual
Parameters:
Return type:

bool

do_pan_stopped(actor) virtual
Parameters:

actor (Clutter.Actor) –

Signal Details

Clutter.PanAction.signals.pan(pan_action, actor, is_interpolated)
Signal Name:

pan

Flags:

RUN_LAST

Parameters:
  • pan_action (Clutter.PanAction) – The object which received the signal

  • actor (Clutter.Actor) – the Clutter.Actor attached to the action

  • is_interpolated (bool) – if the event is the result of interpolating the motion velocity at the end of the drag

Returns:

True if the pan should continue, and False if the pan should be cancelled.

Return type:

bool

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.

New in version 1.12.

Clutter.PanAction.signals.pan_stopped(pan_action, actor)
Signal Name:

pan-stopped

Flags:

RUN_LAST

Parameters:

The ::pan-stopped signal is emitted at the end of the interpolation phase of the pan action, only when :interpolate is set to True.

New in version 1.12.

Property Details

Clutter.PanAction.props.acceleration_factor
Name:

acceleration-factor

Type:

float

Default Value:

1.0

Flags:

READABLE, WRITABLE

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.

New in version 1.12.

Clutter.PanAction.props.deceleration
Name:

deceleration

Type:

float

Default Value:

0.949999988079071

Flags:

READABLE, WRITABLE

The rate at which the interpolated panning will decelerate in

Clutter.PanAction will emit interpolated ::pan events with decreasing scroll deltas, using the rate specified by this property.

New in version 1.12.

Clutter.PanAction.props.interpolate
Name:

interpolate

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether interpolated events emission is enabled.

New in version 1.12.

Clutter.PanAction.props.pan_axis
Name:

pan-axis

Type:

Clutter.PanAxis

Default Value:

Clutter.PanAxis.AXIS_NONE

Flags:

READABLE, WRITABLE

Constraints the panning action to the specified axis

New in version 1.12.