Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
GestureSwipe
is a Gesture
implementation able to recognize
swipes, after a press/move/.../move/release sequence happens, the
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 on eg. a
update handler.
All velocities are reported in pixels/sec units.
Synopsis
- newtype GestureSwipe = GestureSwipe (ManagedPtr GestureSwipe)
- class (GObject o, IsDescendantOf GestureSwipe o) => IsGestureSwipe o
- toGestureSwipe :: (MonadIO m, IsGestureSwipe o) => o -> m GestureSwipe
- gestureSwipeGetVelocity :: (HasCallStack, MonadIO m, IsGestureSwipe a) => a -> m (Bool, Double, Double)
- gestureSwipeNew :: (HasCallStack, MonadIO m, IsWidget a) => a -> m GestureSwipe
- type C_GestureSwipeSwipeCallback = Ptr () -> CDouble -> CDouble -> Ptr () -> IO ()
- type GestureSwipeSwipeCallback = Double -> Double -> IO ()
- afterGestureSwipeSwipe :: (IsGestureSwipe a, MonadIO m) => a -> GestureSwipeSwipeCallback -> m SignalHandlerId
- genClosure_GestureSwipeSwipe :: MonadIO m => GestureSwipeSwipeCallback -> m (GClosure C_GestureSwipeSwipeCallback)
- mk_GestureSwipeSwipeCallback :: C_GestureSwipeSwipeCallback -> IO (FunPtr C_GestureSwipeSwipeCallback)
- noGestureSwipeSwipeCallback :: Maybe GestureSwipeSwipeCallback
- onGestureSwipeSwipe :: (IsGestureSwipe a, MonadIO m) => a -> GestureSwipeSwipeCallback -> m SignalHandlerId
- wrap_GestureSwipeSwipeCallback :: GestureSwipeSwipeCallback -> C_GestureSwipeSwipeCallback
Exported types
newtype GestureSwipe Source #
Memory-managed wrapper type.
GestureSwipe (ManagedPtr GestureSwipe) |
Instances
Eq GestureSwipe Source # | |
Defined in GI.Gtk.Objects.GestureSwipe (==) :: GestureSwipe -> GestureSwipe -> Bool # (/=) :: GestureSwipe -> GestureSwipe -> Bool # | |
GObject GestureSwipe Source # | |
Defined in GI.Gtk.Objects.GestureSwipe | |
ManagedPtrNewtype GestureSwipe Source # | |
Defined in GI.Gtk.Objects.GestureSwipe toManagedPtr :: GestureSwipe -> ManagedPtr GestureSwipe | |
TypedObject GestureSwipe Source # | |
Defined in GI.Gtk.Objects.GestureSwipe | |
HasParentTypes GestureSwipe Source # | |
Defined in GI.Gtk.Objects.GestureSwipe | |
IsGValue (Maybe GestureSwipe) Source # | Convert |
Defined in GI.Gtk.Objects.GestureSwipe gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe GestureSwipe -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe GestureSwipe) | |
type ParentTypes GestureSwipe Source # | |
Defined in GI.Gtk.Objects.GestureSwipe |
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
(GObject o, IsDescendantOf GestureSwipe o) => IsGestureSwipe o Source # | |
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
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, group, handleEvent, handlesSequence, isActive, isFloating, isGroupedWith, isRecognized, notify, notifyByPspec, ref, refSink, reset, runDispose, stealData, stealQdata, thawNotify, ungroup, unref, watchClosure.
Getters
getBoundingBox, getBoundingBoxCenter, getButton, getCurrentButton, getCurrentSequence, getData, getDevice, getExclusive, getGroup, getLastEvent, getLastUpdatedSequence, getPoint, getPropagationPhase, getProperty, getQdata, getSequenceState, getSequences, getTouchOnly, getVelocity, getWidget, getWindow.
Setters
setButton, setData, setDataFull, setExclusive, setPropagationPhase, setProperty, setSequenceState, setState, setTouchOnly, setWindow.
getVelocity
gestureSwipeGetVelocity Source #
:: (HasCallStack, MonadIO m, IsGestureSwipe a) | |
=> a |
|
-> m (Bool, Double, Double) | Returns: whether velocity could be calculated |
If the gesture is recognized, this function returns True
and fill in
velocityX
and velocityY
with the recorded velocity, as per the
last event(s) processed.
Since: 3.14
new
:: (HasCallStack, MonadIO m, IsWidget a) | |
=> a |
|
-> m GestureSwipe | Returns: a newly created |
Returns a newly created Gesture
that recognizes swipes.
Since: 3.14
Signals
swipe
type C_GestureSwipeSwipeCallback = Ptr () -> CDouble -> CDouble -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type GestureSwipeSwipeCallback Source #
= Double |
|
-> Double |
|
-> IO () |
This signal is emitted when the recognized gesture is finished, velocity and direction are a product of previously recorded events.
Since: 3.14
afterGestureSwipeSwipe :: (IsGestureSwipe a, MonadIO m) => 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
genClosure_GestureSwipeSwipe :: MonadIO m => GestureSwipeSwipeCallback -> m (GClosure C_GestureSwipeSwipeCallback) Source #
Wrap the callback into a GClosure
.
mk_GestureSwipeSwipeCallback :: C_GestureSwipeSwipeCallback -> IO (FunPtr C_GestureSwipeSwipeCallback) Source #
Generate a function pointer callable from C code, from a C_GestureSwipeSwipeCallback
.
noGestureSwipeSwipeCallback :: Maybe GestureSwipeSwipeCallback Source #
A convenience synonym for
.Nothing
:: Maybe
GestureSwipeSwipeCallback
onGestureSwipeSwipe :: (IsGestureSwipe a, MonadIO m) => 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