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

Contents

- Exported types
- Methods
  - getArea
  - new
  - setArea
- Signals
  - pressed
  - released
  - stopped

Description

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

Callers may also restrict the area that is considered valid for a >1 touch/button press through `gestureMultiPressSetArea`, so any click happening outside that area is considered to be a first click of its own.

Synopsis

- newtype GestureMultiPress = GestureMultiPress (ManagedPtr GestureMultiPress)
- class (GObject o, IsDescendantOf GestureMultiPress o) => IsGestureMultiPress o
- toGestureMultiPress :: (MonadIO m, IsGestureMultiPress o) => o -> m GestureMultiPress
- gestureMultiPressGetArea :: (HasCallStack, MonadIO m, IsGestureMultiPress a) => a -> m (Bool, Rectangle)
- gestureMultiPressNew :: (HasCallStack, MonadIO m, IsWidget a) => a -> m GestureMultiPress
- gestureMultiPressSetArea :: (HasCallStack, MonadIO m, IsGestureMultiPress a) => a -> Maybe Rectangle -> m ()
- type GestureMultiPressPressedCallback = Int32 -> Double -> Double -> IO ()
- afterGestureMultiPressPressed :: (IsGestureMultiPress a, MonadIO m) => a -> ((?self :: a) => GestureMultiPressPressedCallback) -> m SignalHandlerId
- onGestureMultiPressPressed :: (IsGestureMultiPress a, MonadIO m) => a -> ((?self :: a) => GestureMultiPressPressedCallback) -> m SignalHandlerId
- type GestureMultiPressReleasedCallback = Int32 -> Double -> Double -> IO ()
- afterGestureMultiPressReleased :: (IsGestureMultiPress a, MonadIO m) => a -> ((?self :: a) => GestureMultiPressReleasedCallback) -> m SignalHandlerId
- onGestureMultiPressReleased :: (IsGestureMultiPress a, MonadIO m) => a -> ((?self :: a) => GestureMultiPressReleasedCallback) -> m SignalHandlerId
- type GestureMultiPressStoppedCallback = IO ()
- afterGestureMultiPressStopped :: (IsGestureMultiPress a, MonadIO m) => a -> ((?self :: a) => GestureMultiPressStoppedCallback) -> m SignalHandlerId
- onGestureMultiPressStopped :: (IsGestureMultiPress a, MonadIO m) => a -> ((?self :: a) => GestureMultiPressStoppedCallback) -> m SignalHandlerId

# Exported types

newtype GestureMultiPress Source #

Memory-managed wrapper type.

Constructors

GestureMultiPress (ManagedPtr GestureMultiPress) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf GestureMultiPress o) => IsGestureMultiPress o Source #

Type class for types which can be safely cast to `GestureMultiPress`, for instance with `toGestureMultiPress`.

#### Instances

Instances details

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

toGestureMultiPress :: (MonadIO m, IsGestureMultiPress o) => o -> m GestureMultiPress Source #

Cast to `GestureMultiPress`, 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

getArea, getBoundingBox, getBoundingBoxCenter, getButton, getCurrentButton, getCurrentSequence, getData, getDevice, getExclusive, getGroup, getLastEvent, getLastUpdatedSequence, getPoint, getPropagationPhase, getProperty, getQdata, getSequenceState, getSequences, getTouchOnly, getWidget, getWindow.

#### Setters

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

## getArea

gestureMultiPressGetArea Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureMultiPress a) |
=> a | `gesture`: a `GestureMultiPress`
-> m (Bool, Rectangle) | Returns: `True` if `rect` was filled with the press area

If an area was set through `gestureMultiPressSetArea`, this function will return `True` and fill in `rect` with the press area. See `gestureMultiPressSetArea` for more details on what the press area represents.

Since: 3.14

## new

gestureMultiPressNew Source #

Arguments

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

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

Since: 3.14

## setArea

gestureMultiPressSetArea Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureMultiPress a) |
=> a | `gesture`: a `GestureMultiPress`
-> Maybe Rectangle | `rect`: rectangle to receive coordinates on
-> m () |

If `rect` is non-`Nothing`, the press area will be checked to be confined within the rectangle, otherwise the button count will be reset so the press is seen as being the first one. If `rect` is `Nothing`, the area will be reset to an unrestricted state.

Note: The rectangle is only used to determine whether any non-first click falls within the expected area. This is not akin to an input shape.

Since: 3.14

# Signals

## pressed

type GestureMultiPressPressedCallback 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 () |

This signal is emitted whenever a button or touch press happens.

Since: 3.14

afterGestureMultiPressPressed :: (IsGestureMultiPress a, MonadIO m) => a -> ((?self :: a) => GestureMultiPressPressedCallback) -> 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 gestureMultiPress #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.

onGestureMultiPressPressed :: (IsGestureMultiPress a, MonadIO m) => a -> ((?self :: a) => GestureMultiPressPressedCallback) -> 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 gestureMultiPress #pressed callback

## released

type GestureMultiPressReleasedCallback 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 () |

This signal is emitted when a button or touch is released. `nPress` will report the number of press that is paired to this event, note that GestureMultiPress::stopped may have been emitted between the press and its release, `nPress` will only start over at the next press.

Since: 3.14

afterGestureMultiPressReleased :: (IsGestureMultiPress a, MonadIO m) => a -> ((?self :: a) => GestureMultiPressReleasedCallback) -> 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 gestureMultiPress #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.

onGestureMultiPressReleased :: (IsGestureMultiPress a, MonadIO m) => a -> ((?self :: a) => GestureMultiPressReleasedCallback) -> 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 gestureMultiPress #released callback

## stopped

type GestureMultiPressStoppedCallback = IO () Source #

This signal is emitted whenever any time/distance threshold has been exceeded.

Since: 3.14

afterGestureMultiPressStopped :: (IsGestureMultiPress a, MonadIO m) => a -> ((?self :: a) => GestureMultiPressStoppedCallback) -> 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 gestureMultiPress #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.

onGestureMultiPressStopped :: (IsGestureMultiPress a, MonadIO m) => a -> ((?self :: a) => GestureMultiPressStoppedCallback) -> 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 gestureMultiPress #stopped callback