gi-gtk3-3.0.44: Gtk 3.x 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.GesturePan

Contents

- Exported types
- Methods
  - getOrientation
  - new
  - setOrientation
- Properties
  - orientation
- Signals
  - pan

Description

`GesturePan` is a `Gesture` implementation able to recognize pan gestures, those are drags that are locked to happen along one axis. The axis that a `GesturePan` handles is defined at construct time, and can be changed through `gesturePanSetOrientation`.

When the gesture starts to be recognized, `GesturePan` will attempt to determine as early as possible whether the sequence is moving in the expected direction, and denying the sequence if this does not happen.

Once a panning gesture along the expected axis is recognized, the GesturePan::pan signal will be emitted as input events are received, containing the offset in the given axis.

Synopsis

- newtype GesturePan = GesturePan (ManagedPtr GesturePan)
- class (GObject o, IsDescendantOf GesturePan o) => IsGesturePan o
- toGesturePan :: (MonadIO m, IsGesturePan o) => o -> m GesturePan
- gesturePanGetOrientation :: (HasCallStack, MonadIO m, IsGesturePan a) => a -> m Orientation
- gesturePanNew :: (HasCallStack, MonadIO m, IsWidget a) => a -> Orientation -> m GesturePan
- gesturePanSetOrientation :: (HasCallStack, MonadIO m, IsGesturePan a) => a -> Orientation -> m ()
- constructGesturePanOrientation :: (IsGesturePan o, MonadIO m) => Orientation -> m (GValueConstruct o)
- getGesturePanOrientation :: (MonadIO m, IsGesturePan o) => o -> m Orientation
- setGesturePanOrientation :: (MonadIO m, IsGesturePan o) => o -> Orientation -> m ()
- type GesturePanPanCallback = PanDirection -> Double -> IO ()
- afterGesturePanPan :: (IsGesturePan a, MonadIO m) => a -> ((?self :: a) => GesturePanPanCallback) -> m SignalHandlerId
- onGesturePanPan :: (IsGesturePan a, MonadIO m) => a -> ((?self :: a) => GesturePanPanCallback) -> m SignalHandlerId

# Exported types

newtype GesturePan Source #

Memory-managed wrapper type.

Constructors

GesturePan (ManagedPtr GesturePan) |

#### Instances

Instances details

Eq GesturePan Source # |
Instance details Defined in GI.Gtk.Objects.GesturePan Methods (==) :: GesturePan -> GesturePan -> Bool Source # (/=) :: GesturePan -> GesturePan -> Bool Source #
GObject GesturePan Source # |
Instance details Defined in GI.Gtk.Objects.GesturePan
ManagedPtrNewtype GesturePan Source # |
Instance details Defined in GI.Gtk.Objects.GesturePan Methods toManagedPtr :: GesturePan -> ManagedPtr GesturePan Source #
TypedObject GesturePan Source # |
Instance details Defined in GI.Gtk.Objects.GesturePan Methods glibType :: IO GType Source #
HasParentTypes GesturePan Source # |
Instance details Defined in GI.Gtk.Objects.GesturePan
IsGValue (Maybe GesturePan) Source # | Convert `GesturePan` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.GesturePan Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe GesturePan -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe GesturePan) Source #
type ParentTypes GesturePan Source # |
Instance details Defined in GI.Gtk.Objects.GesturePan type ParentTypes GesturePan = '[GestureDrag, GestureSingle, Gesture, EventController, Object]

class (GObject o, IsDescendantOf GesturePan o) => IsGesturePan o Source #

Type class for types which can be safely cast to `GesturePan`, for instance with `toGesturePan`.

#### Instances

Instances details

(GObject o, IsDescendantOf GesturePan o) => IsGesturePan o Source # |
Instance details Defined in GI.Gtk.Objects.GesturePan

toGesturePan :: (MonadIO m, IsGesturePan o) => o -> m GesturePan Source #

Cast to `GesturePan`, 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, getOffset, getOrientation, getPoint, getPropagationPhase, getProperty, getQdata, getSequenceState, getSequences, getStartPoint, getTouchOnly, getWidget, getWindow.

#### Setters

setButton, setData, setDataFull, setExclusive, setOrientation, setPropagationPhase, setProperty, setSequenceState, setState, setTouchOnly, setWindow.

## getOrientation

gesturePanGetOrientation Source #

Arguments

:: (HasCallStack, MonadIO m, IsGesturePan a) |
=> a | `gesture`: A `GesturePan`
-> m Orientation | Returns: the expected orientation for pan gestures

Returns the orientation of the pan gestures that this `gesture` expects.

Since: 3.14

## new

gesturePanNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a) |
=> a | `widget`: a `Widget`
-> Orientation | `orientation`: expected orientation
-> m GesturePan | Returns: a newly created `GesturePan`

Returns a newly created `Gesture` that recognizes pan gestures.

Since: 3.14

## setOrientation

gesturePanSetOrientation Source #

Arguments

:: (HasCallStack, MonadIO m, IsGesturePan a) |
=> a | `gesture`: A `GesturePan`
-> Orientation | `orientation`: expected orientation
-> m () |

Sets the orientation to be expected on pan gestures.

Since: 3.14

# Properties

## orientation

The expected orientation of pan gestures.

Since: 3.14

constructGesturePanOrientation :: (IsGesturePan o, MonadIO m) => Orientation -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`orientation`” property. This is rarely needed directly, but it is used by `new`.

getGesturePanOrientation :: (MonadIO m, IsGesturePan o) => o -> m Orientation Source #

Get the value of the “`orientation`” property. When overloading is enabled, this is equivalent to

    get gesturePan #orientation

setGesturePanOrientation :: (MonadIO m, IsGesturePan o) => o -> Orientation -> m () Source #

Set the value of the “`orientation`” property. When overloading is enabled, this is equivalent to

    set gesturePan [ #orientation := value ]

# Signals

## pan

type GesturePanPanCallback Source #

Arguments

= PanDirection | `direction`: current direction of the pan gesture
-> Double | `offset`: Offset along the gesture orientation
-> IO () |

This signal is emitted once a panning gesture along the expected axis is detected.

Since: 3.14

afterGesturePanPan :: (IsGesturePan a, MonadIO m) => a -> ((?self :: a) => GesturePanPanCallback) -> m SignalHandlerId Source #

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

    after gesturePan #pan 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.

onGesturePanPan :: (IsGesturePan a, MonadIO m) => a -> ((?self :: a) => GesturePanPanCallback) -> m SignalHandlerId Source #

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

    on gesturePan #pan callback