Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
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 => IsGestureMultiPress o
- toGestureMultiPress :: (MonadIO m, IsGestureMultiPress o) => o -> m GestureMultiPress
- noGestureMultiPress :: Maybe 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 C_GestureMultiPressPressedCallback = Ptr () -> Int32 -> CDouble -> CDouble -> Ptr () -> IO ()
- type GestureMultiPressPressedCallback = Int32 -> Double -> Double -> IO ()
- afterGestureMultiPressPressed :: (IsGestureMultiPress a, MonadIO m) => a -> GestureMultiPressPressedCallback -> m SignalHandlerId
- genClosure_GestureMultiPressPressed :: GestureMultiPressPressedCallback -> IO Closure
- mk_GestureMultiPressPressedCallback :: C_GestureMultiPressPressedCallback -> IO (FunPtr C_GestureMultiPressPressedCallback)
- noGestureMultiPressPressedCallback :: Maybe GestureMultiPressPressedCallback
- onGestureMultiPressPressed :: (IsGestureMultiPress a, MonadIO m) => a -> GestureMultiPressPressedCallback -> m SignalHandlerId
- wrap_GestureMultiPressPressedCallback :: GestureMultiPressPressedCallback -> C_GestureMultiPressPressedCallback
- type C_GestureMultiPressReleasedCallback = Ptr () -> Int32 -> CDouble -> CDouble -> Ptr () -> IO ()
- type GestureMultiPressReleasedCallback = Int32 -> Double -> Double -> IO ()
- afterGestureMultiPressReleased :: (IsGestureMultiPress a, MonadIO m) => a -> GestureMultiPressReleasedCallback -> m SignalHandlerId
- genClosure_GestureMultiPressReleased :: GestureMultiPressReleasedCallback -> IO Closure
- mk_GestureMultiPressReleasedCallback :: C_GestureMultiPressReleasedCallback -> IO (FunPtr C_GestureMultiPressReleasedCallback)
- noGestureMultiPressReleasedCallback :: Maybe GestureMultiPressReleasedCallback
- onGestureMultiPressReleased :: (IsGestureMultiPress a, MonadIO m) => a -> GestureMultiPressReleasedCallback -> m SignalHandlerId
- wrap_GestureMultiPressReleasedCallback :: GestureMultiPressReleasedCallback -> C_GestureMultiPressReleasedCallback
- type C_GestureMultiPressStoppedCallback = Ptr () -> Ptr () -> IO ()
- type GestureMultiPressStoppedCallback = IO ()
- afterGestureMultiPressStopped :: (IsGestureMultiPress a, MonadIO m) => a -> GestureMultiPressStoppedCallback -> m SignalHandlerId
- genClosure_GestureMultiPressStopped :: GestureMultiPressStoppedCallback -> IO Closure
- mk_GestureMultiPressStoppedCallback :: C_GestureMultiPressStoppedCallback -> IO (FunPtr C_GestureMultiPressStoppedCallback)
- noGestureMultiPressStoppedCallback :: Maybe GestureMultiPressStoppedCallback
- onGestureMultiPressStopped :: (IsGestureMultiPress a, MonadIO m) => a -> GestureMultiPressStoppedCallback -> m SignalHandlerId
- wrap_GestureMultiPressStoppedCallback :: GestureMultiPressStoppedCallback -> C_GestureMultiPressStoppedCallback
Exported types
newtype GestureMultiPress Source #
Memory-managed wrapper type.
Instances
class GObject o => IsGestureMultiPress o Source #
Type class for types which can be safely cast to GestureMultiPress
, for instance with toGestureMultiPress
.
Instances
(GObject a, (UnknownAncestorError GestureMultiPress a :: Constraint)) => IsGestureMultiPress a Source # | |
Defined in GI.Gtk.Objects.GestureMultiPress | |
IsGestureMultiPress GestureMultiPress 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
.
noGestureMultiPress :: Maybe GestureMultiPress Source #
A convenience alias for Nothing
:: Maybe
GestureMultiPress
.
Methods
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 C_GestureMultiPressPressedCallback = Ptr () -> Int32 -> CDouble -> CDouble -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
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 -> 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
genClosure_GestureMultiPressPressed :: GestureMultiPressPressedCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_GestureMultiPressPressedCallback :: C_GestureMultiPressPressedCallback -> IO (FunPtr C_GestureMultiPressPressedCallback) Source #
Generate a function pointer callable from C code, from a C_GestureMultiPressPressedCallback
.
noGestureMultiPressPressedCallback :: Maybe GestureMultiPressPressedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
GestureMultiPressPressedCallback
onGestureMultiPressPressed :: (IsGestureMultiPress a, MonadIO m) => 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
wrap_GestureMultiPressPressedCallback :: GestureMultiPressPressedCallback -> C_GestureMultiPressPressedCallback Source #
released
type C_GestureMultiPressReleasedCallback = Ptr () -> Int32 -> CDouble -> CDouble -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
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 -> 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
genClosure_GestureMultiPressReleased :: GestureMultiPressReleasedCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_GestureMultiPressReleasedCallback :: C_GestureMultiPressReleasedCallback -> IO (FunPtr C_GestureMultiPressReleasedCallback) Source #
Generate a function pointer callable from C code, from a C_GestureMultiPressReleasedCallback
.
noGestureMultiPressReleasedCallback :: Maybe GestureMultiPressReleasedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
GestureMultiPressReleasedCallback
onGestureMultiPressReleased :: (IsGestureMultiPress a, MonadIO m) => 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
wrap_GestureMultiPressReleasedCallback :: GestureMultiPressReleasedCallback -> C_GestureMultiPressReleasedCallback Source #
stopped
type C_GestureMultiPressStoppedCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
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 -> 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
genClosure_GestureMultiPressStopped :: GestureMultiPressStoppedCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_GestureMultiPressStoppedCallback :: C_GestureMultiPressStoppedCallback -> IO (FunPtr C_GestureMultiPressStoppedCallback) Source #
Generate a function pointer callable from C code, from a C_GestureMultiPressStoppedCallback
.
noGestureMultiPressStoppedCallback :: Maybe GestureMultiPressStoppedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
GestureMultiPressStoppedCallback
onGestureMultiPressStopped :: (IsGestureMultiPress a, MonadIO m) => 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