gi-gtk-3.0.27: Gtk bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

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.

Synopsis

Exported types

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 GestureSingle

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

gesture: a GestureSingle

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

gesture: a GestureSingle

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

gesture: a GestureSingle

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

gesture: a GestureSingle

-> m Bool

Returns: True if the gesture only handles touch events

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

Since: 3.14

setButton

gestureSingleSetButton Source #

Arguments

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

gesture: a GestureSingle

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

Since: 3.14

setExclusive

gestureSingleSetExclusive Source #

Arguments

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

gesture: a GestureSingle

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

Since: 3.14

setTouchOnly

gestureSingleSetTouchOnly Source #

Arguments

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

gesture: a GestureSingle

-> Bool

touchOnly: whether gesture handles only touch events

-> m () 

If touchOnly is True, gesture will only handle events of type GDK_TOUCH_BEGIN, GDK_TOUCH_UPDATE or GDK_TOUCH_END. If False, mouse events will be handled too.

Since: 3.14

Properties

button

Mouse button number to listen to, or 0 to listen for any button.

Since: 3.14

constructGestureSingleButton :: IsGestureSingle o => Word32 -> IO (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.

Since: 3.14

constructGestureSingleExclusive :: IsGestureSingle o => Bool -> IO (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.

Since: 3.14

constructGestureSingleTouchOnly :: IsGestureSingle o => Bool -> IO (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 ]