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 |
GI.Gtk.Objects.GestureSingle
Contents
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
.
- newtype GestureSingle = GestureSingle (ManagedPtr GestureSingle)
- class GObject o => IsGestureSingle o
- toGestureSingle :: (MonadIO m, IsGestureSingle o) => o -> m GestureSingle
- noGestureSingle :: Maybe 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 => Word32 -> IO (GValueConstruct o)
- getGestureSingleButton :: (MonadIO m, IsGestureSingle o) => o -> m Word32
- setGestureSingleButton :: (MonadIO m, IsGestureSingle o) => o -> Word32 -> m ()
- constructGestureSingleExclusive :: IsGestureSingle o => Bool -> IO (GValueConstruct o)
- getGestureSingleExclusive :: (MonadIO m, IsGestureSingle o) => o -> m Bool
- setGestureSingleExclusive :: (MonadIO m, IsGestureSingle o) => o -> Bool -> m ()
- constructGestureSingleTouchOnly :: IsGestureSingle o => Bool -> IO (GValueConstruct o)
- getGestureSingleTouchOnly :: (MonadIO m, IsGestureSingle o) => o -> m Bool
- setGestureSingleTouchOnly :: (MonadIO m, IsGestureSingle o) => o -> Bool -> m ()
Exported types
newtype GestureSingle Source #
Constructors
GestureSingle (ManagedPtr GestureSingle) |
class GObject o => IsGestureSingle o Source #
Instances
toGestureSingle :: (MonadIO m, IsGestureSingle o) => o -> m GestureSingle Source #
Methods
getButton
gestureSingleGetButton Source #
Arguments
:: (HasCallStack, MonadIO m, IsGestureSingle a) | |
=> a |
|
-> 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 |
|
-> 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 |
|
-> 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 |
|
-> 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 |
|
-> m Bool | Returns: |
Returns True
if the gesture is only triggered by touch events.
Since: 3.14
setButton
gestureSingleSetButton Source #
Arguments
:: (HasCallStack, MonadIO m, IsGestureSingle a) | |
=> a |
|
-> Word32 |
|
-> 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 |
|
-> Bool |
|
-> 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 |
|
-> Bool |
|
-> m () |
Properties
button
constructGestureSingleButton :: IsGestureSingle o => Word32 -> IO (GValueConstruct o) Source #
getGestureSingleButton :: (MonadIO m, IsGestureSingle o) => o -> m Word32 Source #
setGestureSingleButton :: (MonadIO m, IsGestureSingle o) => o -> Word32 -> m () Source #
exclusive
constructGestureSingleExclusive :: IsGestureSingle o => Bool -> IO (GValueConstruct o) Source #
getGestureSingleExclusive :: (MonadIO m, IsGestureSingle o) => o -> m Bool Source #
setGestureSingleExclusive :: (MonadIO m, IsGestureSingle o) => o -> Bool -> m () Source #
touchOnly
constructGestureSingleTouchOnly :: IsGestureSingle o => Bool -> IO (GValueConstruct o) Source #
getGestureSingleTouchOnly :: (MonadIO m, IsGestureSingle o) => o -> m Bool Source #
setGestureSingleTouchOnly :: (MonadIO m, IsGestureSingle o) => o -> Bool -> m () Source #