gi-gtk-4.0.9: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.GestureSingle

Description

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

Exported types

newtype GestureSingle Source #

Memory-managed wrapper type.

Constructors

GestureSingle (ManagedPtr GestureSingle) 

Instances

Instances details
Eq GestureSingle Source # 
Instance details

Defined in GI.Gtk.Objects.GestureSingle

GObject GestureSingle Source # 
Instance details

Defined in GI.Gtk.Objects.GestureSingle

ManagedPtrNewtype GestureSingle Source # 
Instance details

Defined in GI.Gtk.Objects.GestureSingle

Methods

toManagedPtr :: GestureSingle -> ManagedPtr GestureSingle

TypedObject GestureSingle Source # 
Instance details

Defined in GI.Gtk.Objects.GestureSingle

Methods

glibType :: IO GType

HasParentTypes GestureSingle Source # 
Instance details

Defined in GI.Gtk.Objects.GestureSingle

IsGValue (Maybe GestureSingle) Source #

Convert GestureSingle to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.GestureSingle

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe GestureSingle -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe GestureSingle)

type ParentTypes GestureSingle Source # 
Instance details

Defined in GI.Gtk.Objects.GestureSingle

type ParentTypes GestureSingle = '[Gesture, EventController, Object]

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

Instances details
(GObject o, IsDescendantOf GestureSingle o) => IsGestureSingle o Source # 
Instance details

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

getButton

gestureSingleGetButton Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureSingle a) 
=> a

gesture: a GtkGestureSingle

-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsGestureSingle a) 
=> a

gesture: a GtkGestureSingle

-> m Word32

Returns: The current button number

Returns the button number currently interacting with gesture, or 0 if there is none.

getCurrentSequence

gestureSingleGetCurrentSequence Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureSingle a) 
=> a

gesture: a GtkGestureSingle

-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsGestureSingle a) 
=> a

gesture: a GtkGestureSingle

-> m Bool

Returns: Whether the gesture is exclusive

Gets whether a gesture is exclusive.

For more information, see gestureSingleSetExclusive.

getTouchOnly

gestureSingleGetTouchOnly Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureSingle a) 
=> a

gesture: a GtkGestureSingle

-> m Bool

Returns: True if the gesture only handles touch events

Returns True if the gesture is only triggered by touch events.

setButton

gestureSingleSetButton Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureSingle a) 
=> a

gesture: a GtkGestureSingle

-> Word32

button: button number to listen to, or 0 for any button

-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsGestureSingle a) 
=> a

gesture: a GtkGestureSingle

-> Bool

exclusive: True to make gesture exclusive

-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsGestureSingle a) 
=> a

gesture: a GtkGestureSingle

-> Bool

touchOnly: whether gesture handles only touch events

-> 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 ]