Clutter.GestureAction

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

Subclasses:

Clutter.PanAction, Clutter.RotateAction, Clutter.SwipeAction, Clutter.TapAction, Clutter.ZoomAction

Methods

Inherited:

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

Structs:

GObject.ObjectClass (5)

class

new ()

cancel ()

get_device (point)

get_last_event (point)

get_motion_coords (point)

get_motion_delta (point)

get_n_current_points ()

get_n_touch_points ()

get_press_coords (point)

get_release_coords (point)

get_sequence (point)

get_threshold_trigger_distance ()

get_threshold_trigger_edge ()

get_threshold_trigger_egde ()

get_velocity (point)

set_n_touch_points (nb_points)

set_threshold_trigger_distance (x, y)

set_threshold_trigger_edge (edge)

Virtual Methods

Inherited:

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

do_gesture_begin (actor)

do_gesture_cancel (actor)

do_gesture_end (actor)

do_gesture_prepare (actor)

do_gesture_progress (actor)

Properties

Inherited:

Clutter.ActorMeta (3)

Name

Type

Flags

Short Description

n-touch-points

int

r/w

Number of touch points

threshold-trigger-distance-x

float

r/w/co

The horizontal trigger distance used by the action

threshold-trigger-distance-y

float

r/w/co

The vertical trigger distance used by the action

threshold-trigger-edge

Clutter.GestureTriggerEdge

r/w/co

The trigger edge used by the action

Signals

Inherited:

GObject.Object (1)

Name

Short Description

gesture-begin

The ::gesture_begin signal is emitted when the Clutter.Actor to which a Clutter.GestureAction has been applied starts receiving a gesture.

gesture-cancel

The ::gesture-cancel signal is emitted when the ongoing gesture gets cancelled from the Clutter.GestureAction ::gesture-progress signal handler.

gesture-end

The ::gesture-end signal is emitted at the end of the gesture gesture, when the pointer’s button is released This signal is emitted if and only if the Clutter.GestureAction ::gesture-begin signal has been emitted first.

gesture-progress

The ::gesture-progress signal is emitted for each motion event after the Clutter.GestureAction ::gesture-begin signal has been emitted.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Clutter.Action

r

Class Details

class Clutter.GestureAction(**kwargs)
Bases:

Clutter.Action

Abstract:

No

Structure:

Clutter.GestureActionClass

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

New in version 1.8.

classmethod new()
Returns:

the newly created Clutter.GestureAction

Return type:

Clutter.Action

Creates a new Clutter.GestureAction instance.

New in version 1.8.

cancel()

Cancel a Clutter.GestureAction before it begins

New in version 1.12.

get_device(point)
Parameters:

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

Returns:

the Clutter.InputDevice of a touch point.

Return type:

Clutter.InputDevice

Retrieves the Clutter.InputDevice of a touch point.

New in version 1.12.

get_last_event(point)
Parameters:

point (int) – index of a point currently active

Returns:

the last Clutter.Event for a touch point.

Return type:

Clutter.Event

Retrieves a reference to the last Clutter.Event for a touch point. Call Clutter.Event.copy() if you need to store the reference somewhere.

New in version 1.14.

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 latest motion event’s X coordinate

motion_y:

return location for the latest motion event’s Y coordinate

Return type:

(motion_x: float, motion_y: float)

Retrieves the coordinates, in stage space, of the latest motion event during the dragging.

New in version 1.8.

get_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 axis component of the incremental motion delta

delta_y:

return location for the Y axis component of the incremental motion delta

Return type:

(float, delta_x: float, delta_y: float)

Retrieves the incremental delta since the last motion event during the dragging.

New in version 1.12.

get_n_current_points()
Returns:

the number of points currently active.

Return type:

int

Retrieves the number of points currently active.

New in version 1.12.

get_n_touch_points()
Returns:

the number of points to trigger the gesture.

Return type:

int

Retrieves the number of requested points to trigger the gesture.

New in version 1.12.

get_press_coords(point)
Parameters:

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

Returns:

press_x:

return location for the press event’s X coordinate

press_y:

return location for the press event’s Y coordinate

Return type:

(press_x: float, press_y: float)

Retrieves the coordinates, in stage space, of the press event that started the dragging for a specific touch point.

New in version 1.8.

get_release_coords(point)
Parameters:

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

Returns:

release_x:

return location for the X coordinate of the last release

release_y:

return location for the Y coordinate of the last release

Return type:

(release_x: float, release_y: float)

Retrieves the coordinates, in stage space, where the touch point was last released.

New in version 1.8.

get_sequence(point)
Parameters:

point (int) – index of a point currently active

Returns:

the Clutter.EventSequence of a touch point.

Return type:

Clutter.EventSequence

Retrieves the Clutter.EventSequence of a touch point.

New in version 1.12.

get_threshold_trigger_distance()
Returns:

x:

The return location for the horizontal distance, or None

y:

The return location for the vertical distance, or None

Return type:

(x: float, y: float)

Retrieves the threshold trigger distance of the gesture self, as set using Clutter.GestureAction.set_threshold_trigger_distance().

New in version 1.18.

get_threshold_trigger_edge()
Returns:

the edge trigger

Return type:

Clutter.GestureTriggerEdge

Retrieves the edge trigger of the gesture self, as set using Clutter.GestureAction.set_threshold_trigger_edge().

New in version 1.20.

get_threshold_trigger_egde()
Returns:

the edge trigger

Return type:

Clutter.GestureTriggerEdge

Retrieves the edge trigger of the gesture self, as set using Clutter.GestureAction.set_threshold_trigger_edge().

New in version 1.18.

Deprecated since version 1.20: Use Clutter.GestureAction.get_threshold_trigger_edge() instead.

get_velocity(point)
Parameters:

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

Returns:

velocity_x:

return location for the latest motion event’s X velocity

velocity_y:

return location for the latest motion event’s Y velocity

Return type:

(float, velocity_x: float, velocity_y: float)

Retrieves the velocity, in stage pixels per millisecond, of the latest motion event during the dragging.

New in version 1.12.

set_n_touch_points(nb_points)
Parameters:

nb_points (int) – a number of points

Sets the number of points needed to trigger the gesture.

New in version 1.12.

set_threshold_trigger_distance(x, y)
Parameters:
  • x (float) – the distance on the horizontal axis

  • y (float) – the distance on the vertical axis

Sets the threshold trigger distance for the gesture drag threshold, if any.

This function should only be called by sub-classes of Clutter.GestureAction during their construction phase.

New in version 1.18.

set_threshold_trigger_edge(edge)
Parameters:

edge (Clutter.GestureTriggerEdge) – the Clutter.GestureTriggerEdge

Sets the edge trigger for the gesture drag threshold, if any.

This function should only be called by sub-classes of Clutter.GestureAction during their construction phase.

New in version 1.18.

do_gesture_begin(actor) virtual
Parameters:

actor (Clutter.Actor) –

Return type:

bool

do_gesture_cancel(actor) virtual
Parameters:

actor (Clutter.Actor) –

do_gesture_end(actor) virtual
Parameters:

actor (Clutter.Actor) –

do_gesture_prepare(actor) virtual
Parameters:

actor (Clutter.Actor) –

Return type:

bool

do_gesture_progress(actor) virtual
Parameters:

actor (Clutter.Actor) –

Return type:

bool

Signal Details

Clutter.GestureAction.signals.gesture_begin(gesture_action, actor)
Signal Name:

gesture-begin

Flags:

RUN_LAST

Parameters:
Returns:

True if the gesture should start, and False if the gesture should be ignored.

Return type:

bool

The ::gesture_begin signal is emitted when the Clutter.Actor to which a Clutter.GestureAction has been applied starts receiving a gesture.

New in version 1.8.

Clutter.GestureAction.signals.gesture_cancel(gesture_action, actor)
Signal Name:

gesture-cancel

Flags:

RUN_LAST

Parameters:

The ::gesture-cancel signal is emitted when the ongoing gesture gets cancelled from the Clutter.GestureAction ::gesture-progress signal handler.

This signal is emitted if and only if the Clutter.GestureAction ::gesture-begin signal has been emitted first.

New in version 1.8.

Clutter.GestureAction.signals.gesture_end(gesture_action, actor)
Signal Name:

gesture-end

Flags:

RUN_LAST

Parameters:

The ::gesture-end signal is emitted at the end of the gesture gesture, when the pointer’s button is released

This signal is emitted if and only if the Clutter.GestureAction ::gesture-begin signal has been emitted first.

New in version 1.8.

Clutter.GestureAction.signals.gesture_progress(gesture_action, actor)
Signal Name:

gesture-progress

Flags:

RUN_LAST

Parameters:
Returns:

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

Return type:

bool

The ::gesture-progress signal is emitted for each motion event after the Clutter.GestureAction ::gesture-begin signal has been emitted.

New in version 1.8.

Property Details

Clutter.GestureAction.props.n_touch_points
Name:

n-touch-points

Type:

int

Default Value:

1

Flags:

READABLE, WRITABLE

Number of touch points to trigger a gesture action.

New in version 1.16.

Clutter.GestureAction.props.threshold_trigger_distance_x
Name:

threshold-trigger-distance-x

Type:

float

Default Value:

-1.0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The horizontal trigger distance to be used by the action to either emit the Clutter.GestureAction ::gesture-begin signal or to emit the Clutter.GestureAction ::gesture-cancel signal.

A negative value will be interpreted as the default drag threshold.

New in version 1.18.

Clutter.GestureAction.props.threshold_trigger_distance_y
Name:

threshold-trigger-distance-y

Type:

float

Default Value:

-1.0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The vertical trigger distance to be used by the action to either emit the Clutter.GestureAction ::gesture-begin signal or to emit the Clutter.GestureAction ::gesture-cancel signal.

A negative value will be interpreted as the default drag threshold.

New in version 1.18.

Clutter.GestureAction.props.threshold_trigger_edge
Name:

threshold-trigger-edge

Type:

Clutter.GestureTriggerEdge

Default Value:

Clutter.GestureTriggerEdge.NONE

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The trigger edge to be used by the action to either emit the Clutter.GestureAction ::gesture-begin signal or to emit the Clutter.GestureAction ::gesture-cancel signal.

New in version 1.18.