pub trait PanActionExt: 'static {
Show 17 methods
// Required methods
fn get_acceleration_factor(&self) -> f64;
fn get_constrained_motion_delta(&self, point: u32) -> (f32, f32, f32);
fn get_deceleration(&self) -> f64;
fn get_interpolate(&self) -> bool;
fn get_interpolated_coords(&self) -> (f32, f32);
fn get_interpolated_delta(&self) -> (f32, f32, f32);
fn get_pan_axis(&self) -> PanAxis;
fn set_acceleration_factor(&self, factor: f64);
fn set_deceleration(&self, rate: f64);
fn set_interpolate(&self, should_interpolate: bool);
fn set_pan_axis(&self, axis: PanAxis);
fn connect_pan<F: Fn(&Self, &Actor, bool) -> bool + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_pan_stopped<F: Fn(&Self, &Actor) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_acceleration_factor_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_deceleration_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_interpolate_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_pan_axis_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}
Required Methods§
Sourcefn get_acceleration_factor(&self) -> f64
fn get_acceleration_factor(&self) -> f64
Retrieves the initial acceleration factor for interpolated ::pan events.
§Returns
The initial acceleration factor for interpolated events.
Sourcefn get_constrained_motion_delta(&self, point: u32) -> (f32, f32, f32)
fn get_constrained_motion_delta(&self, point: u32) -> (f32, f32, f32)
Retrieves the delta, in stage space, dependent on the current state
of the PanAction
, and respecting the constraint specified by the
PanAction:pan-axis
property.
§point
the touch point index, with 0 being the first touch point received by the action
§delta_x
return location for the X delta
§delta_y
return location for the Y delta
§Returns
the distance since last motion event
Sourcefn get_deceleration(&self) -> f64
fn get_deceleration(&self) -> f64
Retrieves the deceleration rate of interpolated ::pan events.
§Returns
The deceleration rate of the interpolated events.
Sourcefn get_interpolate(&self) -> bool
fn get_interpolate(&self) -> 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.
§Returns
true
if interpolated events emission is active.
Sourcefn get_interpolated_coords(&self) -> (f32, f32)
fn get_interpolated_coords(&self) -> (f32, f32)
Sourcefn get_interpolated_delta(&self) -> (f32, f32, f32)
fn get_interpolated_delta(&self) -> (f32, f32, f32)
Retrieves the delta, in stage space, since the latest interpolated
event, analogous to GestureActionExt::get_motion_delta
.
§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
§Returns
the distance since the latest interpolated event
Sourcefn get_pan_axis(&self) -> PanAxis
fn get_pan_axis(&self) -> PanAxis
Sourcefn set_acceleration_factor(&self, factor: f64)
fn set_acceleration_factor(&self, factor: f64)
Factor applied to the momentum velocity at the time of releasing the pointer when generating interpolated ::pan events.
§factor
The acceleration factor
Sourcefn set_deceleration(&self, rate: f64)
fn set_deceleration(&self, rate: f64)
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.
§rate
The deceleration rate
Sourcefn set_interpolate(&self, should_interpolate: bool)
fn set_interpolate(&self, should_interpolate: bool)
Sets whether the action should emit interpolated ::pan events after the drag has ended, to emulate the gesture kinetic inertia.
§should_interpolate
whether to enable interpolated pan events
Sourcefn set_pan_axis(&self, axis: PanAxis)
fn set_pan_axis(&self, axis: PanAxis)
Sourcefn connect_pan<F: Fn(&Self, &Actor, bool) -> bool + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_pan<F: Fn(&Self, &Actor, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId
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
.
§actor
the Actor
attached to the action
§is_interpolated
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.
Sourcefn connect_pan_stopped<F: Fn(&Self, &Actor) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_pan_stopped<F: Fn(&Self, &Actor) + 'static>( &self, f: F, ) -> SignalHandlerId
The ::pan-stopped signal is emitted at the end of the interpolation
phase of the pan action, only when :interpolate is set to true
.
§actor
the Actor
attached to the action
fn connect_property_acceleration_factor_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_property_deceleration_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_property_interpolate_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_property_pan_axis_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.