gi-clutter-1.0.5: 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.DragAction

Description

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

Since: 1.4

Synopsis

Exported types

newtype DragAction Source #

Memory-managed wrapper type.

Constructors

DragAction (ManagedPtr DragAction) 

Instances

Instances details
Eq DragAction Source # 
Instance details

Defined in GI.Clutter.Objects.DragAction

GObject DragAction Source # 
Instance details

Defined in GI.Clutter.Objects.DragAction

ManagedPtrNewtype DragAction Source # 
Instance details

Defined in GI.Clutter.Objects.DragAction

Methods

toManagedPtr :: DragAction -> ManagedPtr DragAction

TypedObject DragAction Source # 
Instance details

Defined in GI.Clutter.Objects.DragAction

Methods

glibType :: IO GType

HasParentTypes DragAction Source # 
Instance details

Defined in GI.Clutter.Objects.DragAction

IsGValue (Maybe DragAction) Source #

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

Instance details

Defined in GI.Clutter.Objects.DragAction

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes DragAction Source # 
Instance details

Defined in GI.Clutter.Objects.DragAction

type ParentTypes DragAction = '[Action, ActorMeta, Object]

class (GObject o, IsDescendantOf DragAction o) => IsDragAction o Source #

Type class for types which can be safely cast to DragAction, for instance with toDragAction.

Instances

Instances details
(GObject o, IsDescendantOf DragAction o) => IsDragAction o Source # 
Instance details

Defined in GI.Clutter.Objects.DragAction

toDragAction :: (MonadIO m, IsDragAction o) => o -> m DragAction Source #

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

Methods

getDragArea

dragActionGetDragArea Source #

Arguments

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

action: a DragAction

-> m (Bool, Rect)

Returns: True if the actor is actually constrained (and thus dragArea is valid), False otherwise

Retrieves the "drag area" associated with action, that is a Rect that constrains the actor movements, in parents coordinates.

getDragAxis

dragActionGetDragAxis Source #

Arguments

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

action: a DragAction

-> m DragAxis

Returns: the axis constraint

Retrieves the axis constraint set by dragActionSetDragAxis

Since: 1.4

getDragHandle

dragActionGetDragHandle Source #

Arguments

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

action: a DragAction

-> m Actor

Returns: a Actor, used as the drag handle, or Nothing if none was set

Retrieves the drag handle set by dragActionSetDragHandle

Since: 1.4

getDragThreshold

dragActionGetDragThreshold Source #

Arguments

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

action: a DragAction

-> m (Word32, Word32) 

Retrieves the values set by dragActionSetDragThreshold.

If the DragAction:xDragThreshold property or the DragAction:yDragThreshold property have been set to -1 then this function will return the default drag threshold value as stored by the Settings:dndDragThreshold property of Settings.

Since: 1.4

getMotionCoords

dragActionGetMotionCoords Source #

Arguments

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

action: a DragAction

-> m (Float, Float) 

Retrieves the coordinates, in stage space, of the latest motion event during the dragging

Since: 1.4

getPressCoords

dragActionGetPressCoords Source #

Arguments

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

action: a DragAction

-> m (Float, Float) 

Retrieves the coordinates, in stage space, of the press event that started the dragging

Since: 1.4

new

dragActionNew Source #

Arguments

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

Returns: the newly created DragAction

Creates a new DragAction instance

Since: 1.4

setDragArea

dragActionSetDragArea Source #

Arguments

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

action: a DragAction

-> Maybe Rect

dragArea: a Rect

-> m () 

Sets dragArea to constrain the dragging of the actor associated with action, so that it position is always within dragArea, expressed in parent's coordinates. If dragArea is Nothing, the actor is not constrained.

setDragAxis

dragActionSetDragAxis Source #

Arguments

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

action: a DragAction

-> DragAxis

axis: the axis to constraint the dragging to

-> m () 

Restricts the dragging action to a specific axis

Since: 1.4

setDragHandle

dragActionSetDragHandle Source #

Arguments

:: (HasCallStack, MonadIO m, IsDragAction a, IsActor b) 
=> a

action: a DragAction

-> Maybe b

handle: a Actor, or Nothing to unset

-> m () 

Sets the actor to be used as the drag handle.

Since: 1.4

setDragThreshold

dragActionSetDragThreshold Source #

Arguments

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

action: a DragAction

-> Int32

xThreshold: a distance on the horizontal axis, in pixels, or -1 to use the default drag threshold from Settings

-> Int32

yThreshold: a distance on the vertical axis, in pixels, or -1 to use the default drag threshold from Settings

-> m () 

Sets the horizontal and vertical drag thresholds that must be cleared by the pointer before action can begin the dragging.

If xThreshold or yThreshold are set to -1 then the default drag threshold stored in the Settings:dndDragThreshold property of Settings will be used.

Since: 1.4

Properties

dragArea

Constains the dragging action (or in particular, the resulting actor position) to the specified Rect, in parent's coordinates.

Since: 1.12

clearDragActionDragArea :: (MonadIO m, IsDragAction o) => o -> m () Source #

Set the value of the “drag-area” property to Nothing. When overloading is enabled, this is equivalent to

clear #dragArea

constructDragActionDragArea :: (IsDragAction o, MonadIO m) => Rect -> m (GValueConstruct o) Source #

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

getDragActionDragArea :: (MonadIO m, IsDragAction o) => o -> m (Maybe Rect) Source #

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

get dragAction #dragArea

setDragActionDragArea :: (MonadIO m, IsDragAction o) => o -> Rect -> m () Source #

Set the value of the “drag-area” property. When overloading is enabled, this is equivalent to

set dragAction [ #dragArea := value ]

dragAreaSet

Whether the DragAction:dragArea property has been set.

Since: 1.12

getDragActionDragAreaSet :: (MonadIO m, IsDragAction o) => o -> m Bool Source #

Get the value of the “drag-area-set” property. When overloading is enabled, this is equivalent to

get dragAction #dragAreaSet

dragAxis

Constraints the dragging action to the specified axis

Since: 1.4

constructDragActionDragAxis :: (IsDragAction o, MonadIO m) => DragAxis -> m (GValueConstruct o) Source #

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

getDragActionDragAxis :: (MonadIO m, IsDragAction o) => o -> m DragAxis Source #

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

get dragAction #dragAxis

setDragActionDragAxis :: (MonadIO m, IsDragAction o) => o -> DragAxis -> m () Source #

Set the value of the “drag-axis” property. When overloading is enabled, this is equivalent to

set dragAction [ #dragAxis := value ]

dragHandle

The Actor that is effectively being dragged

A DragAction will, be default, use the Actor that has been attached to the action; it is possible to create a separate Actor and use it instead.

Setting this property has no effect on the Actor argument passed to the DragAction signals

Since: 1.4

clearDragActionDragHandle :: (MonadIO m, IsDragAction o) => o -> m () Source #

Set the value of the “drag-handle” property to Nothing. When overloading is enabled, this is equivalent to

clear #dragHandle

constructDragActionDragHandle :: (IsDragAction o, MonadIO m, IsActor a) => a -> m (GValueConstruct o) Source #

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

getDragActionDragHandle :: (MonadIO m, IsDragAction o) => o -> m Actor Source #

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

get dragAction #dragHandle

setDragActionDragHandle :: (MonadIO m, IsDragAction o, IsActor a) => o -> a -> m () Source #

Set the value of the “drag-handle” property. When overloading is enabled, this is equivalent to

set dragAction [ #dragHandle := value ]

xDragThreshold

The horizontal threshold, in pixels, that the cursor must travel in order to begin a drag action.

When set to a positive value, DragAction will only emit DragAction::dragBegin if the pointer has moved horizontally at least of the given amount of pixels since the button press event.

When set to -1, DragAction will use the default threshold stored in the Settings:dndDragThreshold property of Settings.

When read, this property will always return a valid drag threshold, either as set or the default one.

Since: 1.4

constructDragActionXDragThreshold :: (IsDragAction o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

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

getDragActionXDragThreshold :: (MonadIO m, IsDragAction o) => o -> m Int32 Source #

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

get dragAction #xDragThreshold

setDragActionXDragThreshold :: (MonadIO m, IsDragAction o) => o -> Int32 -> m () Source #

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

set dragAction [ #xDragThreshold := value ]

yDragThreshold

The vertical threshold, in pixels, that the cursor must travel in order to begin a drag action.

When set to a positive value, DragAction will only emit DragAction::dragBegin if the pointer has moved vertically at least of the given amount of pixels since the button press event.

When set to -1, DragAction will use the value stored in the Settings:dndDragThreshold property of Settings.

When read, this property will always return a valid drag threshold, either as set or the default one.

Since: 1.4

constructDragActionYDragThreshold :: (IsDragAction o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

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

getDragActionYDragThreshold :: (MonadIO m, IsDragAction o) => o -> m Int32 Source #

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

get dragAction #yDragThreshold

setDragActionYDragThreshold :: (MonadIO m, IsDragAction o) => o -> Int32 -> m () Source #

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

set dragAction [ #yDragThreshold := value ]

Signals

dragBegin

type DragActionDragBeginCallback Source #

Arguments

 = Actor

actor: the Actor attached to the action

-> Float

eventX: the X coordinate (in stage space) of the press event

-> Float

eventY: the Y coordinate (in stage space) of the press event

-> [ModifierType]

modifiers: the modifiers of the press event

-> IO () 

The dragBegin signal is emitted when the DragAction starts the dragging

The emission of this signal can be delayed by using the DragAction:xDragThreshold and DragAction:yDragThreshold properties

Since: 1.4

afterDragActionDragBegin :: (IsDragAction a, MonadIO m) => a -> ((?self :: a) => DragActionDragBeginCallback) -> m SignalHandlerId Source #

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

after dragAction #dragBegin 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.

onDragActionDragBegin :: (IsDragAction a, MonadIO m) => a -> ((?self :: a) => DragActionDragBeginCallback) -> m SignalHandlerId Source #

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

on dragAction #dragBegin callback

dragEnd

type DragActionDragEndCallback Source #

Arguments

 = Actor

actor: the Actor attached to the action

-> Float

eventX: the X coordinate (in stage space) of the release event

-> Float

eventY: the Y coordinate (in stage space) of the release event

-> [ModifierType]

modifiers: the modifiers of the release event

-> IO () 

The dragEnd signal is emitted at the end of the dragging, when the pointer button's is released

This signal is emitted if and only if the DragAction::dragBegin signal has been emitted first

Since: 1.4

afterDragActionDragEnd :: (IsDragAction a, MonadIO m) => a -> ((?self :: a) => DragActionDragEndCallback) -> m SignalHandlerId Source #

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

after dragAction #dragEnd 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.

onDragActionDragEnd :: (IsDragAction a, MonadIO m) => a -> ((?self :: a) => DragActionDragEndCallback) -> m SignalHandlerId Source #

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

on dragAction #dragEnd callback

dragMotion

type DragActionDragMotionCallback Source #

Arguments

 = Actor

actor: the Actor attached to the action

-> Float

deltaX: the X component of the distance between the press event that began the dragging and the current position of the pointer, as of the latest motion event

-> Float

deltaY: the Y component of the distance between the press event that began the dragging and the current position of the pointer, as of the latest motion event

-> IO () 

The dragMotion signal is emitted for each motion event after the DragAction::dragBegin signal has been emitted.

The components of the distance between the press event and the latest motion event are computed in the actor's coordinate space, to take into account eventual transformations. If you want the stage coordinates of the latest motion event you can use dragActionGetMotionCoords.

The default handler of the signal will call actorMoveBy either on actor or, if set, of DragAction:dragHandle using the deltaX and deltaY components of the dragging motion. If you want to override the default behaviour, you can connect to the DragAction::dragProgress signal and return False from the handler.

Since: 1.4

afterDragActionDragMotion :: (IsDragAction a, MonadIO m) => a -> ((?self :: a) => DragActionDragMotionCallback) -> m SignalHandlerId Source #

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

after dragAction #dragMotion 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.

onDragActionDragMotion :: (IsDragAction a, MonadIO m) => a -> ((?self :: a) => DragActionDragMotionCallback) -> m SignalHandlerId Source #

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

on dragAction #dragMotion callback

dragProgress

type DragActionDragProgressCallback Source #

Arguments

 = Actor

actor: the Actor attached to the action

-> Float

deltaX: the X component of the distance between the press event that began the dragging and the current position of the pointer, as of the latest motion event

-> Float

deltaY: the Y component of the distance between the press event that began the dragging and the current position of the pointer, as of the latest motion event

-> IO Bool

Returns: True if the drag should continue, and False if it should be stopped.

The dragProgress signal is emitted for each motion event after the DragAction::dragBegin signal has been emitted.

The components of the distance between the press event and the latest motion event are computed in the actor's coordinate space, to take into account eventual transformations. If you want the stage coordinates of the latest motion event you can use dragActionGetMotionCoords.

The default handler will emit DragAction::dragMotion, if DragAction::dragProgress emission returns True.

Since: 1.12

afterDragActionDragProgress :: (IsDragAction a, MonadIO m) => a -> ((?self :: a) => DragActionDragProgressCallback) -> m SignalHandlerId Source #

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

after dragAction #dragProgress 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.

onDragActionDragProgress :: (IsDragAction a, MonadIO m) => a -> ((?self :: a) => DragActionDragProgressCallback) -> m SignalHandlerId Source #

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

on dragAction #dragProgress callback