Trait clutter::GestureActionExt[][src]

pub trait GestureActionExt: 'static {
Show methods fn cancel(&self);
fn get_device(&self, point: u32) -> Option<InputDevice>;
fn get_last_event(&self, point: u32) -> Option<Event>;
fn get_motion_coords(&self, point: u32) -> (f32, f32);
fn get_motion_delta(&self, point: u32) -> (f32, f32, f32);
fn get_n_current_points(&self) -> u32;
fn get_n_touch_points(&self) -> i32;
fn get_press_coords(&self, point: u32) -> (f32, f32);
fn get_release_coords(&self, point: u32) -> (f32, f32);
fn get_sequence(&self, point: u32) -> Option<EventSequence>;
fn get_threshold_trigger_distance(&self) -> (f32, f32);
fn get_threshold_trigger_edge(&self) -> GestureTriggerEdge;
fn get_velocity(&self, point: u32) -> (f32, f32, f32);
fn set_n_touch_points(&self, nb_points: i32);
fn set_threshold_trigger_distance(&self, x: f32, y: f32);
fn set_threshold_trigger_edge(&self, edge: GestureTriggerEdge);
fn get_property_threshold_trigger_distance_x(&self) -> f32;
fn get_property_threshold_trigger_distance_y(&self) -> f32;
fn connect_gesture_begin<F: Fn(&Self, &Actor) -> bool + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_gesture_cancel<F: Fn(&Self, &Actor) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_gesture_end<F: Fn(&Self, &Actor) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_gesture_progress<F: Fn(&Self, &Actor) -> bool + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_n_touch_points_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
}

Trait containing all GestureAction methods.

Implementors

GestureAction, PanAction, RotateAction, SwipeAction, TapAction, ZoomAction

Required methods

fn cancel(&self)[src]

Cancel a GestureAction before it begins

fn get_device(&self, point: u32) -> Option<InputDevice>[src]

Retrieves the InputDevice of a touch point.

point

the touch point index, with 0 being the first touch point received by the action

Returns

the InputDevice of a touch point.

fn get_last_event(&self, point: u32) -> Option<Event>[src]

Retrieves a reference to the last ClutterEvent for a touch point. Call clutter_event_copy if you need to store the reference somewhere.

point

index of a point currently active

Returns

the last ClutterEvent for a touch point.

fn get_motion_coords(&self, point: u32) -> (f32, f32)[src]

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

point

the touch point index, with 0 being the first touch point received by the action

motion_x

return location for the latest motion event’s X coordinate

motion_y

return location for the latest motion event’s Y coordinate

fn get_motion_delta(&self, point: u32) -> (f32, f32, f32)[src]

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

point

the touch point index, with 0 being the first touch point received by the action

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

Returns

the distance since last motion event

fn get_n_current_points(&self) -> u32[src]

Retrieves the number of points currently active.

Returns

the number of points currently active.

fn get_n_touch_points(&self) -> i32[src]

Retrieves the number of requested points to trigger the gesture.

Returns

the number of points to trigger the gesture.

fn get_press_coords(&self, point: u32) -> (f32, f32)[src]

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

point

the touch point index, with 0 being the first touch point received by the action

press_x

return location for the press event’s X coordinate

press_y

return location for the press event’s Y coordinate

fn get_release_coords(&self, point: u32) -> (f32, f32)[src]

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

point

the touch point index, with 0 being the first touch point received by the action

release_x

return location for the X coordinate of the last release

release_y

return location for the Y coordinate of the last release

fn get_sequence(&self, point: u32) -> Option<EventSequence>[src]

Retrieves the EventSequence of a touch point.

point

index of a point currently active

Returns

the EventSequence of a touch point.

fn get_threshold_trigger_distance(&self) -> (f32, f32)[src]

Retrieves the threshold trigger distance of the gesture self, as set using GestureActionExt::set_threshold_trigger_distance.

x

The return location for the horizontal distance, or None

y

The return location for the vertical distance, or None

fn get_threshold_trigger_edge(&self) -> GestureTriggerEdge[src]

Retrieves the edge trigger of the gesture self, as set using GestureActionExt::set_threshold_trigger_edge.

Returns

the edge trigger

fn get_velocity(&self, point: u32) -> (f32, f32, f32)[src]

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

point

the touch point index, with 0 being the first touch point received by the action

velocity_x

return location for the latest motion event’s X velocity

velocity_y

return location for the latest motion event’s Y velocity

fn set_n_touch_points(&self, nb_points: i32)[src]

Sets the number of points needed to trigger the gesture.

nb_points

a number of points

fn set_threshold_trigger_distance(&self, x: f32, y: f32)[src]

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

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

x

the distance on the horizontal axis

y

the distance on the vertical axis

fn set_threshold_trigger_edge(&self, edge: GestureTriggerEdge)[src]

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

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

edge

the GestureTriggerEdge

fn get_property_threshold_trigger_distance_x(&self) -> f32[src]

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

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

fn get_property_threshold_trigger_distance_y(&self) -> f32[src]

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

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

fn connect_gesture_begin<F: Fn(&Self, &Actor) -> bool + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

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

actor

the Actor attached to the action

Returns

true if the gesture should start, and false if the gesture should be ignored.

fn connect_gesture_cancel<F: Fn(&Self, &Actor) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

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

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

actor

the Actor attached to the action

fn connect_gesture_end<F: Fn(&Self, &Actor) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

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 GestureAction::gesture-begin signal has been emitted first.

actor

the Actor attached to the action

fn connect_gesture_progress<F: Fn(&Self, &Actor) -> bool + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

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

actor

the Actor attached to the action

Returns

true if the gesture should continue, and false if the gesture should be cancelled.

fn connect_property_n_touch_points_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Loading content...

Implementors

impl<O: IsA<GestureAction>> GestureActionExt for O[src]

Loading content...