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 |
GtkGestureSingle
is a GtkGestures
subclass optimized for singe-touch
and mouse 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 it to 0. While the gesture is active, the
button being currently pressed can be known through
gestureSingleGetCurrentButton
.
Synopsis
- newtype GestureSingle = GestureSingle (ManagedPtr GestureSingle)
- class (GObject o, IsDescendantOf GestureSingle o) => IsGestureSingle o
- toGestureSingle :: (MonadIO m, IsGestureSingle o) => o -> m 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, MonadIO m) => Word32 -> m (GValueConstruct o)
- getGestureSingleButton :: (MonadIO m, IsGestureSingle o) => o -> m Word32
- setGestureSingleButton :: (MonadIO m, IsGestureSingle o) => o -> Word32 -> m ()
- constructGestureSingleExclusive :: (IsGestureSingle o, MonadIO m) => Bool -> m (GValueConstruct o)
- getGestureSingleExclusive :: (MonadIO m, IsGestureSingle o) => o -> m Bool
- setGestureSingleExclusive :: (MonadIO m, IsGestureSingle o) => o -> Bool -> m ()
- constructGestureSingleTouchOnly :: (IsGestureSingle o, MonadIO m) => Bool -> m (GValueConstruct o)
- getGestureSingleTouchOnly :: (MonadIO m, IsGestureSingle o) => o -> m Bool
- setGestureSingleTouchOnly :: (MonadIO m, IsGestureSingle o) => o -> Bool -> m ()
Exported types
newtype GestureSingle Source #
Memory-managed wrapper type.
GestureSingle (ManagedPtr GestureSingle) |
Instances
Eq GestureSingle Source # | |
Defined in GI.Gtk.Objects.GestureSingle (==) :: GestureSingle -> GestureSingle -> Bool # (/=) :: GestureSingle -> GestureSingle -> Bool # | |
GObject GestureSingle Source # | |
Defined in GI.Gtk.Objects.GestureSingle | |
ManagedPtrNewtype GestureSingle Source # | |
Defined in GI.Gtk.Objects.GestureSingle toManagedPtr :: GestureSingle -> ManagedPtr GestureSingle | |
TypedObject GestureSingle Source # | |
Defined in GI.Gtk.Objects.GestureSingle | |
HasParentTypes GestureSingle Source # | |
Defined in GI.Gtk.Objects.GestureSingle | |
IsGValue (Maybe GestureSingle) Source # | Convert |
Defined in GI.Gtk.Objects.GestureSingle gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe GestureSingle -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe GestureSingle) | |
type ParentTypes GestureSingle Source # | |
Defined in GI.Gtk.Objects.GestureSingle |
class (GObject o, IsDescendantOf GestureSingle o) => IsGestureSingle o Source #
Type class for types which can be safely cast to GestureSingle
, for instance with toGestureSingle
.
Instances
(GObject o, IsDescendantOf GestureSingle o) => IsGestureSingle o Source # | |
Defined in GI.Gtk.Objects.GestureSingle |
toGestureSingle :: (MonadIO m, IsGestureSingle o) => o -> m GestureSingle Source #
Cast to GestureSingle
, 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, handlesSequence, isActive, isFloating, isGroupedWith, isRecognized, notify, notifyByPspec, ref, refSink, reset, runDispose, stealData, stealQdata, thawNotify, ungroup, unref, watchClosure.
Getters
getBoundingBox, getBoundingBoxCenter, getButton, getCurrentButton, getCurrentEvent, getCurrentEventDevice, getCurrentEventState, getCurrentEventTime, getCurrentSequence, getData, getDevice, getExclusive, getGroup, getLastEvent, getLastUpdatedSequence, getName, getPoint, getPropagationLimit, getPropagationPhase, getProperty, getQdata, getSequenceState, getSequences, getTouchOnly, getWidget.
Setters
setButton, setData, setDataFull, setExclusive, setName, setPropagationLimit, setPropagationPhase, setProperty, setSequenceState, setState, setStaticName, setTouchOnly.
getButton
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.
If this is 0, the gesture reacts to any button press.
getCurrentButton
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.
getCurrentSequence
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
.
getExclusive
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
.
getTouchOnly
gestureSingleGetTouchOnly Source #
:: (HasCallStack, MonadIO m, IsGestureSingle a) | |
=> a |
|
-> m Bool | Returns: |
Returns True
if the gesture is only triggered by touch events.
setButton
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.
setExclusive
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.
setTouchOnly
gestureSingleSetTouchOnly Source #
:: (HasCallStack, MonadIO m, IsGestureSingle a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether to handle only touch events.
If touchOnly
is True
, gesture
will only handle events of type
EventTypeTouchBegin
, EventTypeTouchUpdate
or EventTypeTouchEnd
. If False
,
mouse events will be handled too.
Properties
button
Mouse button number to listen to, or 0 to listen for any button.
constructGestureSingleButton :: (IsGestureSingle o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “button
” property. This is rarely needed directly, but it is used by new
.
getGestureSingleButton :: (MonadIO m, IsGestureSingle o) => o -> m Word32 Source #
Get the value of the “button
” property.
When overloading is enabled, this is equivalent to
get
gestureSingle #button
setGestureSingleButton :: (MonadIO m, IsGestureSingle o) => o -> Word32 -> m () Source #
Set the value of the “button
” property.
When overloading is enabled, this is equivalent to
set
gestureSingle [ #button:=
value ]
exclusive
Whether the gesture is exclusive.
Exclusive gestures only listen to pointer and pointer emulated events.
constructGestureSingleExclusive :: (IsGestureSingle o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “exclusive
” property. This is rarely needed directly, but it is used by new
.
getGestureSingleExclusive :: (MonadIO m, IsGestureSingle o) => o -> m Bool Source #
Get the value of the “exclusive
” property.
When overloading is enabled, this is equivalent to
get
gestureSingle #exclusive
setGestureSingleExclusive :: (MonadIO m, IsGestureSingle o) => o -> Bool -> m () Source #
Set the value of the “exclusive
” property.
When overloading is enabled, this is equivalent to
set
gestureSingle [ #exclusive:=
value ]
touchOnly
Whether the gesture handles only touch events.
constructGestureSingleTouchOnly :: (IsGestureSingle o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “touch-only
” property. This is rarely needed directly, but it is used by new
.
getGestureSingleTouchOnly :: (MonadIO m, IsGestureSingle o) => o -> m Bool Source #
Get the value of the “touch-only
” property.
When overloading is enabled, this is equivalent to
get
gestureSingle #touchOnly
setGestureSingleTouchOnly :: (MonadIO m, IsGestureSingle o) => o -> Bool -> m () Source #
Set the value of the “touch-only
” property.
When overloading is enabled, this is equivalent to
set
gestureSingle [ #touchOnly:=
value ]