gi-gtk-3.0.31: Gtk bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (inaki@blueleaf.cc)
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.GestureMultiPress

Contents

Description

GestureMultiPress is a Gesture implementation able to recognize multiple clicks on a nearby zone, which can be listened for through the GestureMultiPress::pressed signal. Whenever time or distance between clicks exceed the GTK+ defaults, GestureMultiPress::stopped is emitted, and the click counter is reset.

Callers may also restrict the area that is considered valid for a >1 touch/button press through gestureMultiPressSetArea, so any click happening outside that area is considered to be a first click of its own.

Synopsis

Exported types

class (GObject o, IsDescendantOf GestureMultiPress o) => IsGestureMultiPress o Source #

Type class for types which can be safely cast to GestureMultiPress, for instance with toGestureMultiPress.

toGestureMultiPress :: (MonadIO m, IsGestureMultiPress o) => o -> m GestureMultiPress Source #

Cast to GestureMultiPress, for types for which this is known to be safe. For general casts, use castTo.

Methods

getArea

gestureMultiPressGetArea Source #

Arguments

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

gesture: a GestureMultiPress

-> m (Bool, Rectangle)

Returns: True if rect was filled with the press area

If an area was set through gestureMultiPressSetArea, this function will return True and fill in rect with the press area. See gestureMultiPressSetArea for more details on what the press area represents.

Since: 3.14

new

gestureMultiPressNew Source #

Arguments

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

widget: a Widget

-> m GestureMultiPress

Returns: a newly created GestureMultiPress

Returns a newly created Gesture that recognizes single and multiple presses.

Since: 3.14

setArea

gestureMultiPressSetArea Source #

Arguments

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

gesture: a GestureMultiPress

-> Maybe Rectangle

rect: rectangle to receive coordinates on

-> m () 

If rect is non-Nothing, the press area will be checked to be confined within the rectangle, otherwise the button count will be reset so the press is seen as being the first one. If rect is Nothing, the area will be reset to an unrestricted state.

Note: The rectangle is only used to determine whether any non-first click falls within the expected area. This is not akin to an input shape.

Since: 3.14

Signals

pressed

type C_GestureMultiPressPressedCallback = Ptr () -> Int32 -> CDouble -> CDouble -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type GestureMultiPressPressedCallback Source #

Arguments

 = Int32

nPress: how many touch/button presses happened with this one

-> Double

x: The X coordinate, in widget allocation coordinates

-> Double

y: The Y coordinate, in widget allocation coordinates

-> IO () 

This signal is emitted whenever a button or touch press happens.

Since: 3.14

afterGestureMultiPressPressed :: (IsGestureMultiPress a, MonadIO m) => a -> GestureMultiPressPressedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “pressed” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after gestureMultiPress #pressed callback

onGestureMultiPressPressed :: (IsGestureMultiPress a, MonadIO m) => a -> GestureMultiPressPressedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “pressed” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on gestureMultiPress #pressed callback

released

type C_GestureMultiPressReleasedCallback = Ptr () -> Int32 -> CDouble -> CDouble -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type GestureMultiPressReleasedCallback Source #

Arguments

 = Int32

nPress: number of press that is paired with this release

-> Double

x: The X coordinate, in widget allocation coordinates

-> Double

y: The Y coordinate, in widget allocation coordinates

-> IO () 

This signal is emitted when a button or touch is released. nPress will report the number of press that is paired to this event, note that GestureMultiPress::stopped may have been emitted between the press and its release, nPress will only start over at the next press.

Since: 3.14

afterGestureMultiPressReleased :: (IsGestureMultiPress a, MonadIO m) => a -> GestureMultiPressReleasedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “released” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after gestureMultiPress #released callback

onGestureMultiPressReleased :: (IsGestureMultiPress a, MonadIO m) => a -> GestureMultiPressReleasedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “released” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on gestureMultiPress #released callback

stopped

type C_GestureMultiPressStoppedCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type GestureMultiPressStoppedCallback = IO () Source #

This signal is emitted whenever any time/distance threshold has been exceeded.

Since: 3.14

afterGestureMultiPressStopped :: (IsGestureMultiPress a, MonadIO m) => a -> GestureMultiPressStoppedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “stopped” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after gestureMultiPress #stopped callback

onGestureMultiPressStopped :: (IsGestureMultiPress a, MonadIO m) => a -> GestureMultiPressStoppedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “stopped” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on gestureMultiPress #stopped callback