gi-clutter-1.0.2: clutter GObject bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Clutter.Objects.ClickAction

Description

The ClickAction structure contains only private data and should be accessed using the provided API

Since: 1.4

Synopsis

Exported types

class (GObject o, IsDescendantOf ClickAction o) => IsClickAction o Source #

Type class for types which can be safely cast to ClickAction, for instance with toClickAction.

Instances

Instances details
(GObject o, IsDescendantOf ClickAction o) => IsClickAction o Source # 
Instance details

Defined in GI.Clutter.Objects.ClickAction

toClickAction :: (MonadIO m, IsClickAction o) => o -> m ClickAction Source #

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

Methods

getButton

clickActionGetButton Source #

Arguments

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

action: a ClickAction

-> m Word32

Returns: the button value

Retrieves the button that was pressed.

Since: 1.4

getCoords

clickActionGetCoords Source #

Arguments

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

action: a ClickAction

-> m (Float, Float) 

Retrieves the screen coordinates of the button press.

Since: 1.8

getState

clickActionGetState Source #

Arguments

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

action: a ClickAction

-> m [ModifierType]

Returns: the modifier state parameter, or 0

Retrieves the modifier state of the click action.

Since: 1.6

new

clickActionNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m ClickAction

Returns: the newly created ClickAction

Creates a new ClickAction instance

Since: 1.4

release

clickActionRelease Source #

Arguments

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

action: a ClickAction

-> m () 

Emulates a release of the pointer button, which ungrabs the pointer and unsets the ClickAction:pressed state.

This function will also cancel the long press gesture if one was initiated.

This function is useful to break a grab, for instance after a certain amount of time has passed.

Since: 1.4

Properties

held

Whether the clickable actor has the pointer grabbed

Since: 1.4

getClickActionHeld :: (MonadIO m, IsClickAction o) => o -> m Bool Source #

Get the value of the “held” property. When overloading is enabled, this is equivalent to

get clickAction #held

longPressDuration

The minimum duration of a press for it to be recognized as a long press gesture, in milliseconds.

A value of -1 will make the ClickAction use the value of the Settings:long-press-duration property.

Since: 1.8

constructClickActionLongPressDuration :: (IsClickAction o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “long-press-duration” property. This is rarely needed directly, but it is used by new.

getClickActionLongPressDuration :: (MonadIO m, IsClickAction o) => o -> m Int32 Source #

Get the value of the “long-press-duration” property. When overloading is enabled, this is equivalent to

get clickAction #longPressDuration

setClickActionLongPressDuration :: (MonadIO m, IsClickAction o) => o -> Int32 -> m () Source #

Set the value of the “long-press-duration” property. When overloading is enabled, this is equivalent to

set clickAction [ #longPressDuration := value ]

longPressThreshold

The maximum allowed distance that can be covered (on both axes) before a long press gesture is cancelled, in pixels.

A value of -1 will make the ClickAction use the value of the Settings:dnd-drag-threshold property.

Since: 1.8

constructClickActionLongPressThreshold :: (IsClickAction o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “long-press-threshold” property. This is rarely needed directly, but it is used by new.

getClickActionLongPressThreshold :: (MonadIO m, IsClickAction o) => o -> m Int32 Source #

Get the value of the “long-press-threshold” property. When overloading is enabled, this is equivalent to

get clickAction #longPressThreshold

setClickActionLongPressThreshold :: (MonadIO m, IsClickAction o) => o -> Int32 -> m () Source #

Set the value of the “long-press-threshold” property. When overloading is enabled, this is equivalent to

set clickAction [ #longPressThreshold := value ]

pressed

Whether the clickable actor should be in "pressed" state

Since: 1.4

getClickActionPressed :: (MonadIO m, IsClickAction o) => o -> m Bool Source #

Get the value of the “pressed” property. When overloading is enabled, this is equivalent to

get clickAction #pressed

Signals

clicked

type ClickActionClickedCallback Source #

Arguments

 = Actor

actor: the Actor attached to the action

-> IO () 

The clicked signal is emitted when the Actor to which a ClickAction has been applied should respond to a pointer button press and release events

Since: 1.4

afterClickActionClicked :: (IsClickAction a, MonadIO m) => a -> ((?self :: a) => ClickActionClickedCallback) -> m SignalHandlerId Source #

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

after clickAction #clicked callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onClickActionClicked :: (IsClickAction a, MonadIO m) => a -> ((?self :: a) => ClickActionClickedCallback) -> m SignalHandlerId Source #

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

on clickAction #clicked callback

longPress

type ClickActionLongPressCallback Source #

Arguments

 = Actor

actor: the Actor attached to the action

-> LongPressState

state: the long press state

-> IO Bool

Returns: Only the LongPressStateQuery state uses the returned value of the handler; other states will ignore it

The longPress signal is emitted during the long press gesture handling.

This signal can be emitted multiple times with different states.

The LongPressStateQuery state will be emitted on button presses, and its return value will determine whether the long press handling should be initiated. If the signal handlers will return True, the LongPressStateQuery state will be followed either by a signal emission with the LongPressStateActivate state if the long press constraints were respected, or by a signal emission with the LongPressStateCancel state if the long press was cancelled.

It is possible to forcibly cancel a long press detection using clickActionRelease.

Since: 1.8

afterClickActionLongPress :: (IsClickAction a, MonadIO m) => a -> ((?self :: a) => ClickActionLongPressCallback) -> m SignalHandlerId Source #

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

after clickAction #longPress callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onClickActionLongPress :: (IsClickAction a, MonadIO m) => a -> ((?self :: a) => ClickActionLongPressCallback) -> m SignalHandlerId Source #

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

on clickAction #longPress callback