Trait GestureActionExt

Source
pub trait GestureActionExt: 'static {
Show 23 methods // Required 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;
}
Expand description

Trait containing all GestureAction methods.

§Implementors

GestureAction, PanAction, RotateAction, SwipeAction, TapAction, ZoomAction

Required Methods§

Source

fn cancel(&self)

Cancel a GestureAction before it begins

Source

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

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.

Source

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

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

§point

index of a point currently active

§Returns

the last Event for a touch point.

Source

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

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

Source

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

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

Source

fn get_n_current_points(&self) -> u32

Retrieves the number of points currently active.

§Returns

the number of points currently active.

Source

fn get_n_touch_points(&self) -> i32

Retrieves the number of requested points to trigger the gesture.

§Returns

the number of points to trigger the gesture.

Source

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

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

Source

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

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

Source

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

Retrieves the EventSequence of a touch point.

§point

index of a point currently active

§Returns

the EventSequence of a touch point.

Source

fn get_threshold_trigger_distance(&self) -> (f32, f32)

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

Source

fn get_threshold_trigger_edge(&self) -> GestureTriggerEdge

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

§Returns

the edge trigger

Source

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

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

Source

fn set_n_touch_points(&self, nb_points: i32)

Sets the number of points needed to trigger the gesture.

§nb_points

a number of points

Source

fn set_threshold_trigger_distance(&self, x: f32, y: f32)

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

Source

fn set_threshold_trigger_edge(&self, edge: GestureTriggerEdge)

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

Source

fn get_property_threshold_trigger_distance_x(&self) -> f32

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.

Source

fn get_property_threshold_trigger_distance_y(&self) -> f32

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.

Source

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

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.

Source

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

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

Source

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

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

Source

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

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.

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§