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.GestureSingle

Contents

- Exported types
- Methods
  - getButton
  - getCurrentButton
  - getCurrentSequence
  - getExclusive
  - getTouchOnly
  - setButton
  - setExclusive
  - setTouchOnly
- Properties
  - button
  - exclusive
  - touchOnly

Description

`GestureSingle` is a subclass of `Gesture`, optimized (although not restricted) for dealing with mouse and single-touch gestures. Under interaction, these gestures stick to the first interacting sequence, which is accessible through `gestureSingleGetCurrentSequence` while the gesture is being interacted with.

By default gestures react to both `BUTTON_PRIMARY` and touch events, `gestureSingleSetTouchOnly` can be used to change the touch behavior. Callers may also specify a different mouse button number to interact with through `gestureSingleSetButton`, or react to any mouse button by setting 0. While the gesture is active, the button being currently pressed can be known through `gestureSingleGetCurrentButton`.

Synopsis

- newtype GestureSingle = GestureSingle (ManagedPtr GestureSingle)
- class (GObject o, IsDescendantOf GestureSingle o) => IsGestureSingle o
- toGestureSingle :: (MonadIO m, IsGestureSingle o) => o -> m GestureSingle
- gestureSingleGetButton :: (HasCallStack, MonadIO m, IsGestureSingle a) => a -> m Word32
- gestureSingleGetCurrentButton :: (HasCallStack, MonadIO m, IsGestureSingle a) => a -> m Word32
- gestureSingleGetCurrentSequence :: (HasCallStack, MonadIO m, IsGestureSingle a) => a -> m (Maybe EventSequence)
- gestureSingleGetExclusive :: (HasCallStack, MonadIO m, IsGestureSingle a) => a -> m Bool
- gestureSingleGetTouchOnly :: (HasCallStack, MonadIO m, IsGestureSingle a) => a -> m Bool
- gestureSingleSetButton :: (HasCallStack, MonadIO m, IsGestureSingle a) => a -> Word32 -> m ()
- gestureSingleSetExclusive :: (HasCallStack, MonadIO m, IsGestureSingle a) => a -> Bool -> m ()
- gestureSingleSetTouchOnly :: (HasCallStack, MonadIO m, IsGestureSingle a) => a -> Bool -> m ()
- constructGestureSingleButton :: (IsGestureSingle o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getGestureSingleButton :: (MonadIO m, IsGestureSingle o) => o -> m Word32
- setGestureSingleButton :: (MonadIO m, IsGestureSingle o) => o -> Word32 -> m ()
- constructGestureSingleExclusive :: (IsGestureSingle o, MonadIO m) => Bool -> m (GValueConstruct o)
- getGestureSingleExclusive :: (MonadIO m, IsGestureSingle o) => o -> m Bool
- setGestureSingleExclusive :: (MonadIO m, IsGestureSingle o) => o -> Bool -> m ()
- constructGestureSingleTouchOnly :: (IsGestureSingle o, MonadIO m) => Bool -> m (GValueConstruct o)
- getGestureSingleTouchOnly :: (MonadIO m, IsGestureSingle o) => o -> m Bool
- setGestureSingleTouchOnly :: (MonadIO m, IsGestureSingle o) => o -> Bool -> m ()

# Exported types

newtype GestureSingle Source #

Memory-managed wrapper type.

Constructors

GestureSingle (ManagedPtr GestureSingle) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf GestureSingle o) => IsGestureSingle o Source #

Type class for types which can be safely cast to `GestureSingle`, for instance with `toGestureSingle`.

#### Instances

Instances details

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

toGestureSingle :: (MonadIO m, IsGestureSingle o) => o -> m GestureSingle Source #

Cast to `GestureSingle`, 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, getWidget, getWindow.

#### Setters

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

## getButton

gestureSingleGetButton Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureSingle a) |
=> a | `gesture`: a `GestureSingle`
-> m Word32 | Returns: The button number, or 0 for any button

Returns the button number `gesture` listens for, or 0 if `gesture` reacts to any button press.

Since: 3.14

## getCurrentButton

gestureSingleGetCurrentButton Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureSingle a) |
=> a | `gesture`: a `GestureSingle`
-> m Word32 | Returns: The current button number

Returns the button number currently interacting with `gesture`, or 0 if there is none.

Since: 3.14

## getCurrentSequence

gestureSingleGetCurrentSequence Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureSingle a) |
=> a | `gesture`: a `GestureSingle`
-> m (Maybe EventSequence) | Returns: the current sequence

Returns the event sequence currently interacting with `gesture`. This is only meaningful if `gestureIsActive` returns `True`.

Since: 3.14

## getExclusive

gestureSingleGetExclusive Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureSingle a) |
=> a | `gesture`: a `GestureSingle`
-> m Bool | Returns: Whether the gesture is exclusive

Gets whether a gesture is exclusive. For more information, see `gestureSingleSetExclusive`.

Since: 3.14

## getTouchOnly

gestureSingleGetTouchOnly Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureSingle a) |
=> a | `gesture`: a `GestureSingle`
-> m Bool | Returns: `True` if the gesture only handles touch events

Returns `True` if the gesture is only triggered by touch events.

Since: 3.14

## setButton

gestureSingleSetButton Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureSingle a) |
=> a | `gesture`: a `GestureSingle`
-> Word32 | `button`: button number to listen to, or 0 for any button
-> m () |

Sets the button number `gesture` listens to. If non-0, every button press from a different button number will be ignored. Touch events implicitly match with button 1.

Since: 3.14

## setExclusive

gestureSingleSetExclusive Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureSingle a) |
=> a | `gesture`: a `GestureSingle`
-> Bool | `exclusive`: `True` to make `gesture` exclusive
-> m () |

Sets whether `gesture` is exclusive. An exclusive gesture will only handle pointer and "pointer emulated" touch events, so at any given time, there is only one sequence able to interact with those.

Since: 3.14

## setTouchOnly

gestureSingleSetTouchOnly Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureSingle a) |
=> a | `gesture`: a `GestureSingle`
-> Bool | `touchOnly`: whether `gesture` handles only touch events
-> m () |

If `touchOnly` is `True`, `gesture` will only handle events of type `GDK_TOUCH_BEGIN`, `GDK_TOUCH_UPDATE` or `GDK_TOUCH_END`. If `False`, mouse events will be handled too.

Since: 3.14

# Properties

## button

Mouse button number to listen to, or 0 to listen for any button.

Since: 3.14

constructGestureSingleButton :: (IsGestureSingle o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #

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

getGestureSingleButton :: (MonadIO m, IsGestureSingle o) => o -> m Word32 Source #

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

    get gestureSingle #button

setGestureSingleButton :: (MonadIO m, IsGestureSingle o) => o -> Word32 -> m () Source #

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

    set gestureSingle [ #button := value ]

## exclusive

Whether the gesture is exclusive. Exclusive gestures only listen to pointer and pointer emulated events.

Since: 3.14

constructGestureSingleExclusive :: (IsGestureSingle o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getGestureSingleExclusive :: (MonadIO m, IsGestureSingle o) => o -> m Bool Source #

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

    get gestureSingle #exclusive

setGestureSingleExclusive :: (MonadIO m, IsGestureSingle o) => o -> Bool -> m () Source #

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

    set gestureSingle [ #exclusive := value ]

## touchOnly

Whether the gesture handles only touch events.

Since: 3.14

constructGestureSingleTouchOnly :: (IsGestureSingle o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getGestureSingleTouchOnly :: (MonadIO m, IsGestureSingle o) => o -> m Bool Source #

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

    get gestureSingle #touchOnly

setGestureSingleTouchOnly :: (MonadIO m, IsGestureSingle o) => o -> Bool -> m () Source #

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

    set gestureSingle [ #touchOnly := value ]