Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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.
GestureMultiPress (ManagedPtr GestureMultiPress) |
Instances
Eq GestureMultiPress Source # | |
Defined in GI.Gtk.Objects.GestureMultiPress (==) :: GestureMultiPress -> GestureMultiPress -> Bool # (/=) :: GestureMultiPress -> GestureMultiPress -> Bool # | |
GObject GestureMultiPress Source # | |
Defined in GI.Gtk.Objects.GestureMultiPress | |
ManagedPtrNewtype GestureMultiPress Source # | |
Defined in GI.Gtk.Objects.GestureMultiPress toManagedPtr :: GestureMultiPress -> ManagedPtr GestureMultiPress | |
TypedObject GestureMultiPress Source # | |
Defined in GI.Gtk.Objects.GestureMultiPress | |
HasParentTypes GestureMultiPress Source # | |
Defined in GI.Gtk.Objects.GestureMultiPress | |
IsGValue (Maybe GestureMultiPress) Source # | Convert |
Defined in GI.Gtk.Objects.GestureMultiPress gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe GestureMultiPress -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe GestureMultiPress) | |
type ParentTypes GestureMultiPress Source # | |
Defined in GI.Gtk.Objects.GestureMultiPress |
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
(GObject o, IsDescendantOf GestureMultiPress o) => IsGestureMultiPress o Source # | |
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
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 #
:: (HasCallStack, MonadIO m, IsGestureMultiPress a) | |
=> a |
|
-> m (Bool, Rectangle) | Returns: |
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
:: (HasCallStack, MonadIO m, IsWidget a) | |
=> a |
|
-> m GestureMultiPress | Returns: a newly created |
Returns a newly created Gesture
that recognizes single and multiple
presses.
Since: 3.14
setArea
gestureMultiPressSetArea Source #
:: (HasCallStack, MonadIO m, IsGestureMultiPress a) | |
=> a |
|
-> Maybe Rectangle |
|
-> 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 #
= Int32 |
|
-> Double |
|
-> Double |
|
-> 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 #
= Int32 |
|
-> Double |
|
-> Double |
|
-> 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