gi-gtk-3.0.43: Gtk bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.GestureSwipe

Contents

- Exported types
- Methods
  - getVelocity
  - new
- Signals
  - swipe

Description

`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, `gestureSwipeGetVelocity` can be called on eg. a Gesture::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 GestureSwipeSwipeCallback = Double -> Double -> IO ()
- afterGestureSwipeSwipe :: (IsGestureSwipe a, MonadIO m) => a -> ((?self :: a) => GestureSwipeSwipeCallback) -> m SignalHandlerId
- onGestureSwipeSwipe :: (IsGestureSwipe a, MonadIO m) => a -> ((?self :: a) => GestureSwipeSwipeCallback) -> m SignalHandlerId

# 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 Methods (==) :: GestureSwipe -> GestureSwipe -> Bool Source # (/=) :: GestureSwipe -> GestureSwipe -> Bool Source #
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 Source #
TypedObject GestureSwipe Source # |
Instance details Defined in GI.Gtk.Objects.GestureSwipe Methods glibType :: IO GType Source #
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 Source # gvalueSet_ :: Ptr GValue -> Maybe GestureSwipe -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe GestureSwipe) Source #
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

### Click to display all available methods, including inherited ones

Expand

#### 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 #

Arguments

:: (HasCallStack, MonadIO m, IsGestureSwipe a) |
=> a | `gesture`: a `GestureSwipe`
-> 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

gestureSwipeNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a) |
=> a | `widget`: a `Widget`
-> m GestureSwipe | Returns: a newly created `GestureSwipe`

Returns a newly created `Gesture` that recognizes swipes.

Since: 3.14

# 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 () |

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 -> ((?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