gi-gdk-4.0.1: Gdk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gdk.Objects.Drag

Description

The GdkDrag struct contains only private fields and should not be accessed directly.

Synopsis

Exported types

newtype Drag Source #

Memory-managed wrapper type.

Constructors

Drag (ManagedPtr Drag) 

Instances

Instances details
Eq Drag Source # 
Instance details

Defined in GI.Gdk.Objects.Drag

Methods

(==) :: Drag -> Drag -> Bool #

(/=) :: Drag -> Drag -> Bool #

GObject Drag Source # 
Instance details

Defined in GI.Gdk.Objects.Drag

Methods

gobjectType :: IO GType #

IsGValue Drag Source #

Convert Drag to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gdk.Objects.Drag

HasParentTypes Drag Source # 
Instance details

Defined in GI.Gdk.Objects.Drag

type ParentTypes Drag Source # 
Instance details

Defined in GI.Gdk.Objects.Drag

class (GObject o, IsDescendantOf Drag o) => IsDrag o Source #

Type class for types which can be safely cast to Drag, for instance with toDrag.

Instances

Instances details
(GObject o, IsDescendantOf Drag o) => IsDrag o Source # 
Instance details

Defined in GI.Gdk.Objects.Drag

toDrag :: (MonadIO m, IsDrag o) => o -> m Drag Source #

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

noDrag :: Maybe Drag Source #

A convenience alias for Nothing :: Maybe Drag.

Methods

Overloaded methods

begin

dragBegin Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a, IsDevice b, IsContentProvider c) 
=> a

surface: the source surface for this drag

-> b

device: the device that controls this drag

-> c

content: the offered content

-> [DragAction]

actions: the actions supported by this drag

-> Int32

dx: the x offset to device's position where the drag nominally started

-> Int32

dy: the y offset to device's position where the drag nominally started

-> m (Maybe Drag)

Returns: a newly created Drag or Nothing on error.

Starts a drag and creates a new drag context for it.

This function is called by the drag source.

dropDone

dragDropDone Source #

Arguments

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

drag: a Drag

-> Bool

success: whether the drag was ultimatively successful

-> m () 

Inform GDK if the drop ended successfully. Passing False for success may trigger a drag cancellation animation.

This function is called by the drag source, and should be the last call before dropping the reference to the drag.

The Drag will only take the first dragDropDone call as effective, if this function is called multiple times, all subsequent calls will be ignored.

getActions

dragGetActions Source #

Arguments

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

drag: a Drag

-> m [DragAction]

Returns: the DragAction flags

Determines the bitmask of possible actions proposed by the source.

getDevice

dragGetDevice Source #

Arguments

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

drag: a Drag

-> m Device

Returns: The Device associated to drag.

Returns the Device associated to the GdkDrag object.

getDisplay

dragGetDisplay Source #

Arguments

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

drag: a Drag

-> m Display

Returns: a Display

Gets the Display that the drag object was created for.

getDragSurface

dragGetDragSurface Source #

Arguments

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

drag: a Drag

-> m (Maybe Surface)

Returns: the drag surface, or Nothing

Returns the surface on which the drag icon should be rendered during the drag operation. Note that the surface may not be available until the drag operation has begun. GDK will move the surface in accordance with the ongoing drag operation. The surface is owned by drag and will be destroyed when the drag operation is over.

getFormats

dragGetFormats Source #

Arguments

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

drag: a Drag

-> m ContentFormats

Returns: a ContentFormats

Retrieves the formats supported by this GdkDrag object.

getSelectedAction

dragGetSelectedAction Source #

Arguments

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

drag: a Drag

-> m [DragAction]

Returns: a DragAction value

Determines the action chosen by the drag destination.

setHotspot

dragSetHotspot Source #

Arguments

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

drag: a Drag

-> Int32

hotX: x coordinate of the drag surface hotspot

-> Int32

hotY: y coordinate of the drag surface hotspot

-> m () 

Sets the position of the drag surface that will be kept under the cursor hotspot. Initially, the hotspot is at the top left corner of the drag surface.

Properties

actions

No description available in the introspection data.

constructDragActions :: IsDrag o => [DragAction] -> IO (GValueConstruct o) Source #

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

getDragActions :: (MonadIO m, IsDrag o) => o -> m [DragAction] Source #

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

get drag #actions

setDragActions :: (MonadIO m, IsDrag o) => o -> [DragAction] -> m () Source #

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

set drag [ #actions := value ]

content

constructDragContent :: (IsDrag o, IsContentProvider a) => a -> IO (GValueConstruct o) Source #

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

getDragContent :: (MonadIO m, IsDrag o) => o -> m (Maybe ContentProvider) Source #

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

get drag #content

device

The Device that is performing the drag.

constructDragDevice :: (IsDrag o, IsDevice a) => a -> IO (GValueConstruct o) Source #

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

getDragDevice :: (MonadIO m, IsDrag o) => o -> m Device Source #

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

get drag #device

display

The Display that the drag belongs to.

getDragDisplay :: (MonadIO m, IsDrag o) => o -> m Display Source #

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

get drag #display

formats

The possible formats that the drag can provide its data in.

constructDragFormats :: IsDrag o => ContentFormats -> IO (GValueConstruct o) Source #

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

getDragFormats :: (MonadIO m, IsDrag o) => o -> m ContentFormats Source #

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

get drag #formats

selectedAction

No description available in the introspection data.

constructDragSelectedAction :: IsDrag o => [DragAction] -> IO (GValueConstruct o) Source #

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

getDragSelectedAction :: (MonadIO m, IsDrag o) => o -> m [DragAction] Source #

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

get drag #selectedAction

setDragSelectedAction :: (MonadIO m, IsDrag o) => o -> [DragAction] -> m () Source #

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

set drag [ #selectedAction := value ]

surface

No description available in the introspection data.

constructDragSurface :: (IsDrag o, IsSurface a) => a -> IO (GValueConstruct o) Source #

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

getDragSurface :: (MonadIO m, IsDrag o) => o -> m (Maybe Surface) Source #

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

get drag #surface

Signals

cancel

type C_DragCancelCallback = Ptr () -> CUInt -> Ptr () -> IO () Source #

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

type DragCancelCallback Source #

Arguments

 = DragCancelReason

reason: The reason the drag was cancelled

-> IO () 

The drag operation was cancelled.

afterDragCancel :: (IsDrag a, MonadIO m) => a -> DragCancelCallback -> m SignalHandlerId Source #

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

after drag #cancel callback

mk_DragCancelCallback :: C_DragCancelCallback -> IO (FunPtr C_DragCancelCallback) Source #

Generate a function pointer callable from C code, from a C_DragCancelCallback.

onDragCancel :: (IsDrag a, MonadIO m) => a -> DragCancelCallback -> m SignalHandlerId Source #

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

on drag #cancel callback

dndFinished

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

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

type DragDndFinishedCallback = IO () Source #

The drag operation was finished, the destination finished reading all data. The drag object can now free all miscellaneous data.

afterDragDndFinished :: (IsDrag a, MonadIO m) => a -> DragDndFinishedCallback -> m SignalHandlerId Source #

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

after drag #dndFinished callback

onDragDndFinished :: (IsDrag a, MonadIO m) => a -> DragDndFinishedCallback -> m SignalHandlerId Source #

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

on drag #dndFinished callback

dropPerformed

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

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

type DragDropPerformedCallback = IO () Source #

The drag operation was performed on an accepting client.

afterDragDropPerformed :: (IsDrag a, MonadIO m) => a -> DragDropPerformedCallback -> m SignalHandlerId Source #

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

after drag #dropPerformed callback

onDragDropPerformed :: (IsDrag a, MonadIO m) => a -> DragDropPerformedCallback -> m SignalHandlerId Source #

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

on drag #dropPerformed callback