Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
The DragAction
structure contains only
private data and should be accessed using the provided API
Since: 1.4
Synopsis
- newtype DragAction = DragAction (ManagedPtr DragAction)
- class (GObject o, IsDescendantOf DragAction o) => IsDragAction o
- toDragAction :: (MonadIO m, IsDragAction o) => o -> m DragAction
- dragActionGetDragArea :: (HasCallStack, MonadIO m, IsDragAction a) => a -> m (Bool, Rect)
- dragActionGetDragAxis :: (HasCallStack, MonadIO m, IsDragAction a) => a -> m DragAxis
- dragActionGetDragHandle :: (HasCallStack, MonadIO m, IsDragAction a) => a -> m Actor
- dragActionGetDragThreshold :: (HasCallStack, MonadIO m, IsDragAction a) => a -> m (Word32, Word32)
- dragActionGetMotionCoords :: (HasCallStack, MonadIO m, IsDragAction a) => a -> m (Float, Float)
- dragActionGetPressCoords :: (HasCallStack, MonadIO m, IsDragAction a) => a -> m (Float, Float)
- dragActionNew :: (HasCallStack, MonadIO m) => m DragAction
- dragActionSetDragArea :: (HasCallStack, MonadIO m, IsDragAction a) => a -> Maybe Rect -> m ()
- dragActionSetDragAxis :: (HasCallStack, MonadIO m, IsDragAction a) => a -> DragAxis -> m ()
- dragActionSetDragHandle :: (HasCallStack, MonadIO m, IsDragAction a, IsActor b) => a -> Maybe b -> m ()
- dragActionSetDragThreshold :: (HasCallStack, MonadIO m, IsDragAction a) => a -> Int32 -> Int32 -> m ()
- clearDragActionDragArea :: (MonadIO m, IsDragAction o) => o -> m ()
- constructDragActionDragArea :: (IsDragAction o, MonadIO m) => Rect -> m (GValueConstruct o)
- getDragActionDragArea :: (MonadIO m, IsDragAction o) => o -> m (Maybe Rect)
- setDragActionDragArea :: (MonadIO m, IsDragAction o) => o -> Rect -> m ()
- getDragActionDragAreaSet :: (MonadIO m, IsDragAction o) => o -> m Bool
- constructDragActionDragAxis :: (IsDragAction o, MonadIO m) => DragAxis -> m (GValueConstruct o)
- getDragActionDragAxis :: (MonadIO m, IsDragAction o) => o -> m DragAxis
- setDragActionDragAxis :: (MonadIO m, IsDragAction o) => o -> DragAxis -> m ()
- clearDragActionDragHandle :: (MonadIO m, IsDragAction o) => o -> m ()
- constructDragActionDragHandle :: (IsDragAction o, MonadIO m, IsActor a) => a -> m (GValueConstruct o)
- getDragActionDragHandle :: (MonadIO m, IsDragAction o) => o -> m Actor
- setDragActionDragHandle :: (MonadIO m, IsDragAction o, IsActor a) => o -> a -> m ()
- constructDragActionXDragThreshold :: (IsDragAction o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getDragActionXDragThreshold :: (MonadIO m, IsDragAction o) => o -> m Int32
- setDragActionXDragThreshold :: (MonadIO m, IsDragAction o) => o -> Int32 -> m ()
- constructDragActionYDragThreshold :: (IsDragAction o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getDragActionYDragThreshold :: (MonadIO m, IsDragAction o) => o -> m Int32
- setDragActionYDragThreshold :: (MonadIO m, IsDragAction o) => o -> Int32 -> m ()
- type DragActionDragBeginCallback = Actor -> Float -> Float -> [ModifierType] -> IO ()
- afterDragActionDragBegin :: (IsDragAction a, MonadIO m) => a -> ((?self :: a) => DragActionDragBeginCallback) -> m SignalHandlerId
- onDragActionDragBegin :: (IsDragAction a, MonadIO m) => a -> ((?self :: a) => DragActionDragBeginCallback) -> m SignalHandlerId
- type DragActionDragEndCallback = Actor -> Float -> Float -> [ModifierType] -> IO ()
- afterDragActionDragEnd :: (IsDragAction a, MonadIO m) => a -> ((?self :: a) => DragActionDragEndCallback) -> m SignalHandlerId
- onDragActionDragEnd :: (IsDragAction a, MonadIO m) => a -> ((?self :: a) => DragActionDragEndCallback) -> m SignalHandlerId
- type DragActionDragMotionCallback = Actor -> Float -> Float -> IO ()
- afterDragActionDragMotion :: (IsDragAction a, MonadIO m) => a -> ((?self :: a) => DragActionDragMotionCallback) -> m SignalHandlerId
- onDragActionDragMotion :: (IsDragAction a, MonadIO m) => a -> ((?self :: a) => DragActionDragMotionCallback) -> m SignalHandlerId
- type DragActionDragProgressCallback = Actor -> Float -> Float -> IO Bool
- afterDragActionDragProgress :: (IsDragAction a, MonadIO m) => a -> ((?self :: a) => DragActionDragProgressCallback) -> m SignalHandlerId
- onDragActionDragProgress :: (IsDragAction a, MonadIO m) => a -> ((?self :: a) => DragActionDragProgressCallback) -> m SignalHandlerId
Exported types
newtype DragAction Source #
Memory-managed wrapper type.
DragAction (ManagedPtr DragAction) |
Instances
Eq DragAction Source # | |
Defined in GI.Clutter.Objects.DragAction (==) :: DragAction -> DragAction -> Bool # (/=) :: DragAction -> DragAction -> Bool # | |
GObject DragAction Source # | |
Defined in GI.Clutter.Objects.DragAction | |
ManagedPtrNewtype DragAction Source # | |
Defined in GI.Clutter.Objects.DragAction toManagedPtr :: DragAction -> ManagedPtr DragAction | |
TypedObject DragAction Source # | |
Defined in GI.Clutter.Objects.DragAction | |
HasParentTypes DragAction Source # | |
Defined in GI.Clutter.Objects.DragAction | |
IsGValue (Maybe DragAction) Source # | Convert |
Defined in GI.Clutter.Objects.DragAction gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe DragAction -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe DragAction) | |
type ParentTypes DragAction Source # | |
Defined in GI.Clutter.Objects.DragAction |
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
(GObject o, IsDescendantOf DragAction o) => IsDragAction o Source # | |
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
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getActor, getData, getDragArea, getDragAxis, getDragHandle, getDragThreshold, getEnabled, getMotionCoords, getName, getPressCoords, getProperty, getQdata.
Setters
setData, setDataFull, setDragArea, setDragAxis, setDragHandle, setDragThreshold, setEnabled, setName, setProperty.
getDragArea
dragActionGetDragArea Source #
:: (HasCallStack, MonadIO m, IsDragAction a) | |
=> a |
|
-> m (Bool, Rect) | Returns: |
Retrieves the "drag area" associated with action
, that
is a Rect
that constrains the actor movements,
in parents coordinates.
getDragAxis
dragActionGetDragAxis Source #
:: (HasCallStack, MonadIO m, IsDragAction a) | |
=> a |
|
-> m DragAxis | Returns: the axis constraint |
Retrieves the axis constraint set by dragActionSetDragAxis
Since: 1.4
getDragHandle
dragActionGetDragHandle Source #
:: (HasCallStack, MonadIO m, IsDragAction a) | |
=> a |
|
-> m Actor | Returns: a |
Retrieves the drag handle set by dragActionSetDragHandle
Since: 1.4
getDragThreshold
dragActionGetDragThreshold Source #
:: (HasCallStack, MonadIO m, IsDragAction a) | |
=> a |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsDragAction a) | |
=> a |
|
-> m (Float, Float) |
Retrieves the coordinates, in stage space, of the latest motion event during the dragging
Since: 1.4
getPressCoords
dragActionGetPressCoords Source #
:: (HasCallStack, MonadIO m, IsDragAction a) | |
=> a |
|
-> m (Float, Float) |
Retrieves the coordinates, in stage space, of the press event that started the dragging
Since: 1.4
new
:: (HasCallStack, MonadIO m) | |
=> m DragAction | Returns: the newly created |
Creates a new DragAction
instance
Since: 1.4
setDragArea
dragActionSetDragArea Source #
:: (HasCallStack, MonadIO m, IsDragAction a) | |
=> a |
|
-> Maybe 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 #
:: (HasCallStack, MonadIO m, IsDragAction a) | |
=> a |
|
-> DragAxis |
|
-> m () |
Restricts the dragging action to a specific axis
Since: 1.4
setDragHandle
dragActionSetDragHandle Source #
:: (HasCallStack, MonadIO m, IsDragAction a, IsActor b) | |
=> a |
|
-> Maybe b | |
-> m () |
Sets the actor to be used as the drag handle.
Since: 1.4
setDragThreshold
dragActionSetDragThreshold Source #
:: (HasCallStack, MonadIO m, IsDragAction a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> 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 #
= Actor |
|
-> Float |
|
-> Float |
|
-> [ModifierType] |
|
-> 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 #
= Actor |
|
-> Float |
|
-> Float |
|
-> [ModifierType] |
|
-> 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 #
= Actor |
|
-> Float |
|
-> Float |
|
-> 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 #
= Actor |
|
-> Float |
|
-> Float |
|
-> IO Bool | Returns: |
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