gi-gtk-4.0.8: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.GestureSwipe

Description

GtkGestureSwipe is a GtkGesture for swipe gestures.

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, gestureSwipeGetVelocity can be called in a Gesture::update handler.

All velocities are reported in pixels/sec units.

Synopsis

Exported types

newtype GestureSwipe Source #

Memory-managed wrapper type.

Constructors

GestureSwipe (ManagedPtr GestureSwipe) 

Instances

Instances details
Eq GestureSwipe Source # 
Instance details

Defined in GI.Gtk.Objects.GestureSwipe

GObject GestureSwipe Source # 
Instance details

Defined in GI.Gtk.Objects.GestureSwipe

ManagedPtrNewtype GestureSwipe Source # 
Instance details

Defined in GI.Gtk.Objects.GestureSwipe

Methods

toManagedPtr :: GestureSwipe -> ManagedPtr GestureSwipe

TypedObject GestureSwipe Source # 
Instance details

Defined in GI.Gtk.Objects.GestureSwipe

Methods

glibType :: IO GType

HasParentTypes GestureSwipe Source # 
Instance details

Defined in GI.Gtk.Objects.GestureSwipe

IsGValue (Maybe GestureSwipe) Source #

Convert GestureSwipe to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.GestureSwipe

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe GestureSwipe -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe GestureSwipe)

type ParentTypes GestureSwipe Source # 
Instance details

Defined in GI.Gtk.Objects.GestureSwipe

type ParentTypes GestureSwipe = '[GestureSingle, Gesture, EventController, Object]

class (GObject o, IsDescendantOf GestureSwipe o) => IsGestureSwipe o Source #

Type class for types which can be safely cast to GestureSwipe, for instance with toGestureSwipe.

Instances

Instances details
(GObject o, IsDescendantOf GestureSwipe o) => IsGestureSwipe o Source # 
Instance details

Defined in GI.Gtk.Objects.GestureSwipe

toGestureSwipe :: (MonadIO m, IsGestureSwipe o) => o -> m GestureSwipe Source #

Cast to GestureSwipe, for types for which this is known to be safe. For general casts, use castTo.

Methods

getVelocity

gestureSwipeGetVelocity Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureSwipe a) 
=> a

gesture: a GtkGestureSwipe

-> m (Bool, Double, Double)

Returns: whether velocity could be calculated

Gets the current velocity.

If the gesture is recognized, this function returns True and fills in velocityX and velocityY with the recorded velocity, as per the last events processed.

new

gestureSwipeNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m GestureSwipe

Returns: a newly created GtkGestureSwipe

Returns a newly created GtkGesture that recognizes swipes.

Signals

swipe

type GestureSwipeSwipeCallback Source #

Arguments

 = Double

velocityX: velocity in the X axis, in pixels/sec

-> Double

velocityY: velocity in the Y axis, in pixels/sec

-> IO () 

Emitted when the recognized gesture is finished.

Velocity and direction are a product of previously recorded events.

afterGestureSwipeSwipe :: (IsGestureSwipe a, MonadIO m) => a -> ((?self :: a) => GestureSwipeSwipeCallback) -> m SignalHandlerId Source #

Connect a signal handler for the swipe signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after gestureSwipe #swipe callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onGestureSwipeSwipe :: (IsGestureSwipe a, MonadIO m) => a -> ((?self :: a) => GestureSwipeSwipeCallback) -> m SignalHandlerId Source #

Connect a signal handler for the swipe signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on gestureSwipe #swipe callback