[]Struct gtk::GestureSwipe

pub struct GestureSwipe(_, _);

GestureSwipe is a Gesture implementation able to recognize swipes, after a press/move/.../move/release sequence happens, the GestureSwipe::swipe signal will be emitted, providing the velocity and directionality of the sequence at the time it was lifted.

If the velocity is desired in intermediate points, GestureSwipe::get_velocity can be called on eg. a Gesture::update handler.

All velocities are reported in pixels/sec units.

Implements

GestureSingleExt, GestureExt, EventControllerExt, glib::object::ObjectExt

Implementations

impl GestureSwipe[src]

pub fn new<P: IsA<Widget>>(widget: &P) -> GestureSwipe[src]

Returns a newly created Gesture that recognizes swipes.

widget

a Widget

Returns

a newly created GestureSwipe

pub fn get_velocity(&self) -> Option<(f64, f64)>[src]

If the gesture is recognized, this function returns true and fill in velocity_x and velocity_y with the recorded velocity, as per the last event(s) processed.

velocity_x

return value for the velocity in the X axis, in pixels/sec

velocity_y

return value for the velocity in the Y axis, in pixels/sec

Returns

whether velocity could be calculated

pub fn connect_swipe<F: Fn(&GestureSwipe, f64, f64) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

This signal is emitted when the recognized gesture is finished, velocity and direction are a product of previously recorded events.

velocity_x

velocity in the X axis, in pixels/sec

velocity_y

velocity in the Y axis, in pixels/sec

Trait Implementations

impl Clone for GestureSwipe

impl Debug for GestureSwipe

impl Display for GestureSwipe[src]

impl Eq for GestureSwipe

impl Hash for GestureSwipe

impl IsA<EventController> for GestureSwipe

impl IsA<Gesture> for GestureSwipe

impl IsA<GestureSingle> for GestureSwipe

impl Ord for GestureSwipe

impl<T: ObjectType> PartialEq<T> for GestureSwipe

impl<T: ObjectType> PartialOrd<T> for GestureSwipe

impl StaticType for GestureSwipe

Auto Trait Implementations

impl RefUnwindSafe for GestureSwipe

impl !Send for GestureSwipe

impl !Sync for GestureSwipe

impl Unpin for GestureSwipe

impl UnwindSafe for GestureSwipe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> Cast for T where
    T: ObjectType, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.