gi-gtk4-4.0.12: Gtk 4.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.GestureClick

Contents

- Exported types
- Methods
  - new
- Signals
  - pressed
  - released
  - stopped
  - unpairedRelease

Description

Recognizes click gestures.

It is able to recognize multiple clicks on a nearby zone, which can be listened for through the GestureClick::pressed signal. Whenever time or distance between clicks exceed the GTK defaults, GestureClick::stopped is emitted, and the click counter is reset.

Synopsis

- newtype GestureClick = GestureClick (ManagedPtr GestureClick)
- class (GObject o, IsDescendantOf GestureClick o) => IsGestureClick o
- toGestureClick :: (MonadIO m, IsGestureClick o) => o -> m GestureClick
- gestureClickNew :: (HasCallStack, MonadIO m) => m GestureClick
- type GestureClickPressedCallback = Int32 -> Double -> Double -> IO ()
- afterGestureClickPressed :: (IsGestureClick a, MonadIO m) => a -> ((?self :: a) => GestureClickPressedCallback) -> m SignalHandlerId
- onGestureClickPressed :: (IsGestureClick a, MonadIO m) => a -> ((?self :: a) => GestureClickPressedCallback) -> m SignalHandlerId
- type GestureClickReleasedCallback = Int32 -> Double -> Double -> IO ()
- afterGestureClickReleased :: (IsGestureClick a, MonadIO m) => a -> ((?self :: a) => GestureClickReleasedCallback) -> m SignalHandlerId
- onGestureClickReleased :: (IsGestureClick a, MonadIO m) => a -> ((?self :: a) => GestureClickReleasedCallback) -> m SignalHandlerId
- type GestureClickStoppedCallback = IO ()
- afterGestureClickStopped :: (IsGestureClick a, MonadIO m) => a -> ((?self :: a) => GestureClickStoppedCallback) -> m SignalHandlerId
- onGestureClickStopped :: (IsGestureClick a, MonadIO m) => a -> ((?self :: a) => GestureClickStoppedCallback) -> m SignalHandlerId
- type GestureClickUnpairedReleaseCallback = Double -> Double -> Word32 -> Maybe EventSequence -> IO ()
- afterGestureClickUnpairedRelease :: (IsGestureClick a, MonadIO m) => a -> ((?self :: a) => GestureClickUnpairedReleaseCallback) -> m SignalHandlerId
- onGestureClickUnpairedRelease :: (IsGestureClick a, MonadIO m) => a -> ((?self :: a) => GestureClickUnpairedReleaseCallback) -> m SignalHandlerId

# Exported types

newtype GestureClick Source #

Memory-managed wrapper type.

Constructors

GestureClick (ManagedPtr GestureClick) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf GestureClick o) => IsGestureClick o Source #

Type class for types which can be safely cast to `GestureClick`, for instance with `toGestureClick`.

#### Instances

Instances details

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

toGestureClick :: (MonadIO m, IsGestureClick o) => o -> m GestureClick Source #

Cast to `GestureClick`, 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, handlesSequence, isActive, isFloating, isGroupedWith, isRecognized, notify, notifyByPspec, ref, refSink, reset, runDispose, stealData, stealQdata, thawNotify, ungroup, unref, watchClosure.

#### Getters

getBoundingBox, getBoundingBoxCenter, getButton, getCurrentButton, getCurrentEvent, getCurrentEventDevice, getCurrentEventState, getCurrentEventTime, getCurrentSequence, getData, getDevice, getExclusive, getGroup, getLastEvent, getLastUpdatedSequence, getName, getPoint, getPropagationLimit, getPropagationPhase, getProperty, getQdata, getSequenceState, getSequences, getTouchOnly, getWidget.

#### Setters

setButton, setData, setDataFull, setExclusive, setName, setPropagationLimit, setPropagationPhase, setProperty, setSequenceState, setState, setStaticName, setTouchOnly.

## new

gestureClickNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m GestureClick | Returns: a newly created `GtkGestureClick`

Returns a newly created `GtkGesture` that recognizes single and multiple presses.

# Signals

## pressed

type GestureClickPressedCallback Source #

Arguments

= Int32 | `nPress`: how many touch/button presses happened with this one
-> Double | `x`: The X coordinate, in widget allocation coordinates
-> Double | `y`: The Y coordinate, in widget allocation coordinates
-> IO () |

Emitted whenever a button or touch press happens.

afterGestureClickPressed :: (IsGestureClick a, MonadIO m) => a -> ((?self :: a) => GestureClickPressedCallback) -> m SignalHandlerId Source #

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

    after gestureClick #pressed 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.

onGestureClickPressed :: (IsGestureClick a, MonadIO m) => a -> ((?self :: a) => GestureClickPressedCallback) -> m SignalHandlerId Source #

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

    on gestureClick #pressed callback

## released

type GestureClickReleasedCallback Source #

Arguments

= Int32 | `nPress`: number of press that is paired with this release
-> Double | `x`: The X coordinate, in widget allocation coordinates
-> Double | `y`: The Y coordinate, in widget allocation coordinates
-> IO () |

Emitted when a button or touch is released.

`nPress` will report the number of press that is paired to this event, note that GestureClick::stopped may have been emitted between the press and its release, `nPress` will only start over at the next press.

afterGestureClickReleased :: (IsGestureClick a, MonadIO m) => a -> ((?self :: a) => GestureClickReleasedCallback) -> m SignalHandlerId Source #

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

    after gestureClick #released 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.

onGestureClickReleased :: (IsGestureClick a, MonadIO m) => a -> ((?self :: a) => GestureClickReleasedCallback) -> m SignalHandlerId Source #

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

    on gestureClick #released callback

## stopped

type GestureClickStoppedCallback = IO () Source #

Emitted whenever any time/distance threshold has been exceeded.

afterGestureClickStopped :: (IsGestureClick a, MonadIO m) => a -> ((?self :: a) => GestureClickStoppedCallback) -> m SignalHandlerId Source #

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

    after gestureClick #stopped 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.

onGestureClickStopped :: (IsGestureClick a, MonadIO m) => a -> ((?self :: a) => GestureClickStoppedCallback) -> m SignalHandlerId Source #

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

    on gestureClick #stopped callback

## unpairedRelease

type GestureClickUnpairedReleaseCallback Source #

Arguments

= Double | `x`: X coordinate of the event
-> Double | `y`: Y coordinate of the event
-> Word32 | `button`: Button being released
-> Maybe EventSequence | `sequence`: Sequence being released
-> IO () |

Emitted whenever the gesture receives a release event that had no previous corresponding press.

Due to implicit grabs, this can only happen on situations where input is grabbed elsewhere mid-press or the pressed widget voluntarily relinquishes its implicit grab.

afterGestureClickUnpairedRelease :: (IsGestureClick a, MonadIO m) => a -> ((?self :: a) => GestureClickUnpairedReleaseCallback) -> m SignalHandlerId Source #

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

    after gestureClick #unpairedRelease 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.

onGestureClickUnpairedRelease :: (IsGestureClick a, MonadIO m) => a -> ((?self :: a) => GestureClickUnpairedReleaseCallback) -> m SignalHandlerId Source #

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

    on gestureClick #unpairedRelease callback