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§
Sourcefn get_device(&self, point: u32) -> Option<InputDevice>
fn get_device(&self, point: u32) -> Option<InputDevice>
Sourcefn get_last_event(&self, point: u32) -> Option<Event>
fn get_last_event(&self, point: u32) -> Option<Event>
Sourcefn get_motion_coords(&self, point: u32) -> (f32, f32)
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
Sourcefn get_motion_delta(&self, point: u32) -> (f32, f32, f32)
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
Sourcefn get_n_current_points(&self) -> u32
fn get_n_current_points(&self) -> u32
Sourcefn get_n_touch_points(&self) -> i32
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.
Sourcefn get_press_coords(&self, point: u32) -> (f32, f32)
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
Sourcefn get_release_coords(&self, point: u32) -> (f32, f32)
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
Sourcefn get_sequence(&self, point: u32) -> Option<EventSequence>
fn get_sequence(&self, point: u32) -> Option<EventSequence>
Sourcefn get_threshold_trigger_distance(&self) -> (f32, f32)
fn get_threshold_trigger_distance(&self) -> (f32, f32)
Sourcefn get_threshold_trigger_edge(&self) -> GestureTriggerEdge
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
Sourcefn get_velocity(&self, point: u32) -> (f32, f32, f32)
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
Sourcefn set_n_touch_points(&self, nb_points: i32)
fn set_n_touch_points(&self, nb_points: i32)
Sourcefn set_threshold_trigger_distance(&self, x: f32, y: f32)
fn set_threshold_trigger_distance(&self, x: f32, y: f32)
Sourcefn set_threshold_trigger_edge(&self, edge: GestureTriggerEdge)
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
Sourcefn get_property_threshold_trigger_distance_x(&self) -> f32
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.
Sourcefn get_property_threshold_trigger_distance_y(&self) -> f32
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.
Sourcefn connect_gesture_begin<F: Fn(&Self, &Actor) -> bool + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_gesture_begin<F: Fn(&Self, &Actor) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId
Sourcefn connect_gesture_cancel<F: Fn(&Self, &Actor) + 'static>(
&self,
f: F,
) -> SignalHandlerId
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
Sourcefn connect_gesture_end<F: Fn(&Self, &Actor) + 'static>(
&self,
f: F,
) -> SignalHandlerId
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
Sourcefn connect_gesture_progress<F: Fn(&Self, &Actor) -> bool + '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
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.