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 |
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 :: IsGestureSingle o => o -> IO GestureSingle
- noGestureSingle :: Maybe GestureSingle
- data GestureSingleGetButtonMethodInfo
- gestureSingleGetButton :: (HasCallStack, MonadIO m, IsGestureSingle a) => a -> m Word32
- data GestureSingleGetCurrentButtonMethodInfo
- gestureSingleGetCurrentButton :: (HasCallStack, MonadIO m, IsGestureSingle a) => a -> m Word32
- data GestureSingleGetCurrentSequenceMethodInfo
- gestureSingleGetCurrentSequence :: (HasCallStack, MonadIO m, IsGestureSingle a) => a -> m (Maybe EventSequence)
- data GestureSingleGetExclusiveMethodInfo
- gestureSingleGetExclusive :: (HasCallStack, MonadIO m, IsGestureSingle a) => a -> m Bool
- data GestureSingleGetTouchOnlyMethodInfo
- gestureSingleGetTouchOnly :: (HasCallStack, MonadIO m, IsGestureSingle a) => a -> m Bool
- data GestureSingleSetButtonMethodInfo
- gestureSingleSetButton :: (HasCallStack, MonadIO m, IsGestureSingle a) => a -> Word32 -> m ()
- data GestureSingleSetExclusiveMethodInfo
- gestureSingleSetExclusive :: (HasCallStack, MonadIO m, IsGestureSingle a) => a -> Bool -> m ()
- data GestureSingleSetTouchOnlyMethodInfo
- gestureSingleSetTouchOnly :: (HasCallStack, MonadIO m, IsGestureSingle a) => a -> Bool -> m ()
- data GestureSingleButtonPropertyInfo
- constructGestureSingleButton :: IsGestureSingle o => Word32 -> IO (GValueConstruct o)
- gestureSingleButton :: AttrLabelProxy "button"
- getGestureSingleButton :: (MonadIO m, IsGestureSingle o) => o -> m Word32
- setGestureSingleButton :: (MonadIO m, IsGestureSingle o) => o -> Word32 -> m ()
- data GestureSingleExclusivePropertyInfo
- constructGestureSingleExclusive :: IsGestureSingle o => Bool -> IO (GValueConstruct o)
- gestureSingleExclusive :: AttrLabelProxy "exclusive"
- getGestureSingleExclusive :: (MonadIO m, IsGestureSingle o) => o -> m Bool
- setGestureSingleExclusive :: (MonadIO m, IsGestureSingle o) => o -> Bool -> m ()
- data GestureSingleTouchOnlyPropertyInfo
- constructGestureSingleTouchOnly :: IsGestureSingle o => Bool -> IO (GValueConstruct o)
- gestureSingleTouchOnly :: AttrLabelProxy "touchOnly"
- getGestureSingleTouchOnly :: (MonadIO m, IsGestureSingle o) => o -> m Bool
- setGestureSingleTouchOnly :: (MonadIO m, IsGestureSingle o) => o -> Bool -> m ()
Exported types
newtype GestureSingle Source #
GObject GestureSingle Source # | |
IsObject GestureSingle Source # | |
IsGestureSingle GestureSingle Source # | |
IsGesture GestureSingle Source # | |
IsEventController GestureSingle Source # | |
((~) * info (ResolveGestureSingleMethod t GestureSingle), MethodInfo * info GestureSingle p) => IsLabel t (GestureSingle -> p) Source # | |
((~) * info (ResolveGestureSingleMethod t GestureSingle), MethodInfo * info GestureSingle p) => IsLabelProxy t (GestureSingle -> p) Source # | |
HasAttributeList * GestureSingle Source # | |
type AttributeList GestureSingle Source # | |
type SignalList GestureSingle Source # | |
class GObject o => IsGestureSingle o Source #
toGestureSingle :: IsGestureSingle o => o -> IO GestureSingle Source #
Methods
getButton
data GestureSingleGetButtonMethodInfo Source #
((~) * signature (m Word32), MonadIO m, IsGestureSingle a) => MethodInfo * GestureSingleGetButtonMethodInfo a signature Source # | |
gestureSingleGetButton Source #
:: (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
data GestureSingleGetCurrentButtonMethodInfo Source #
((~) * signature (m Word32), MonadIO m, IsGestureSingle a) => MethodInfo * GestureSingleGetCurrentButtonMethodInfo a signature Source # | |
gestureSingleGetCurrentButton Source #
:: (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
data GestureSingleGetCurrentSequenceMethodInfo Source #
((~) * signature (m (Maybe EventSequence)), MonadIO m, IsGestureSingle a) => MethodInfo * GestureSingleGetCurrentSequenceMethodInfo a signature Source # | |
gestureSingleGetCurrentSequence Source #
:: (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
data GestureSingleGetExclusiveMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsGestureSingle a) => MethodInfo * GestureSingleGetExclusiveMethodInfo a signature Source # | |
gestureSingleGetExclusive Source #
:: (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
data GestureSingleGetTouchOnlyMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsGestureSingle a) => MethodInfo * GestureSingleGetTouchOnlyMethodInfo a signature Source # | |
gestureSingleGetTouchOnly Source #
:: (HasCallStack, MonadIO m, IsGestureSingle a) | |
=> a |
|
-> m Bool | Returns: |
Returns True
if the gesture is only triggered by touch events.
Since: 3.14
setButton
data GestureSingleSetButtonMethodInfo Source #
((~) * signature (Word32 -> m ()), MonadIO m, IsGestureSingle a) => MethodInfo * GestureSingleSetButtonMethodInfo a signature Source # | |
gestureSingleSetButton Source #
:: (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
data GestureSingleSetExclusiveMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsGestureSingle a) => MethodInfo * GestureSingleSetExclusiveMethodInfo a signature Source # | |
gestureSingleSetExclusive Source #
:: (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
data GestureSingleSetTouchOnlyMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsGestureSingle a) => MethodInfo * GestureSingleSetTouchOnlyMethodInfo a signature Source # | |
gestureSingleSetTouchOnly Source #
:: (HasCallStack, MonadIO m, IsGestureSingle a) | |
=> a |
|
-> Bool |
|
-> m () |
Properties
button
data GestureSingleButtonPropertyInfo Source #
constructGestureSingleButton :: IsGestureSingle o => Word32 -> IO (GValueConstruct o) Source #
gestureSingleButton :: AttrLabelProxy "button" Source #
getGestureSingleButton :: (MonadIO m, IsGestureSingle o) => o -> m Word32 Source #
setGestureSingleButton :: (MonadIO m, IsGestureSingle o) => o -> Word32 -> m () Source #
exclusive
data GestureSingleExclusivePropertyInfo Source #
constructGestureSingleExclusive :: IsGestureSingle o => Bool -> IO (GValueConstruct o) Source #
gestureSingleExclusive :: AttrLabelProxy "exclusive" Source #
getGestureSingleExclusive :: (MonadIO m, IsGestureSingle o) => o -> m Bool Source #
setGestureSingleExclusive :: (MonadIO m, IsGestureSingle o) => o -> Bool -> m () Source #
touchOnly
data GestureSingleTouchOnlyPropertyInfo Source #
constructGestureSingleTouchOnly :: IsGestureSingle o => Bool -> IO (GValueConstruct o) Source #
gestureSingleTouchOnly :: AttrLabelProxy "touchOnly" Source #
getGestureSingleTouchOnly :: (MonadIO m, IsGestureSingle o) => o -> m Bool Source #
setGestureSingleTouchOnly :: (MonadIO m, IsGestureSingle o) => o -> Bool -> m () Source #