gi-gdk-3.0.23: Gdk bindings

Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gdk.Objects.DragContext

Contents

- Exported types
- Methods
  - Overloaded methods
  - getActions
  - getDestWindow
  - getDevice
  - getDragWindow
  - getProtocol
  - getSelectedAction
  - getSourceWindow
  - getSuggestedAction
  - listTargets
  - manageDnd
  - setDevice
  - setHotspot
- Signals
  - actionChanged
  - cancel
  - dndFinished
  - dropPerformed

Description

No description available in the introspection data.

Synopsis

- newtype DragContext = DragContext (ManagedPtr DragContext)
- class (GObject o, IsDescendantOf DragContext o) => IsDragContext o
- toDragContext :: (MonadIO m, IsDragContext o) => o -> m DragContext
- dragContextGetActions :: (HasCallStack, MonadIO m, IsDragContext a) => a -> m [DragAction]
- dragContextGetDestWindow :: (HasCallStack, MonadIO m, IsDragContext a) => a -> m Window
- dragContextGetDevice :: (HasCallStack, MonadIO m, IsDragContext a) => a -> m Device
- dragContextGetDragWindow :: (HasCallStack, MonadIO m, IsDragContext a) => a -> m (Maybe Window)
- dragContextGetProtocol :: (HasCallStack, MonadIO m, IsDragContext a) => a -> m DragProtocol
- dragContextGetSelectedAction :: (HasCallStack, MonadIO m, IsDragContext a) => a -> m [DragAction]
- dragContextGetSourceWindow :: (HasCallStack, MonadIO m, IsDragContext a) => a -> m Window
- dragContextGetSuggestedAction :: (HasCallStack, MonadIO m, IsDragContext a) => a -> m [DragAction]
- dragContextListTargets :: (HasCallStack, MonadIO m, IsDragContext a) => a -> m [Atom]
- dragContextManageDnd :: (HasCallStack, MonadIO m, IsDragContext a, IsWindow b) => a -> b -> [DragAction] -> m Bool
- dragContextSetDevice :: (HasCallStack, MonadIO m, IsDragContext a, IsDevice b) => a -> b -> m ()
- dragContextSetHotspot :: (HasCallStack, MonadIO m, IsDragContext a) => a -> Int32 -> Int32 -> m ()
- type C_DragContextActionChangedCallback = Ptr () -> CUInt -> Ptr () -> IO ()
- type DragContextActionChangedCallback = [DragAction] -> IO ()
- afterDragContextActionChanged :: (IsDragContext a, MonadIO m) => a -> DragContextActionChangedCallback -> m SignalHandlerId
- genClosure_DragContextActionChanged :: MonadIO m => DragContextActionChangedCallback -> m (GClosure C_DragContextActionChangedCallback)
- mk_DragContextActionChangedCallback :: C_DragContextActionChangedCallback -> IO (FunPtr C_DragContextActionChangedCallback)
- noDragContextActionChangedCallback :: Maybe DragContextActionChangedCallback
- onDragContextActionChanged :: (IsDragContext a, MonadIO m) => a -> DragContextActionChangedCallback -> m SignalHandlerId
- wrap_DragContextActionChangedCallback :: DragContextActionChangedCallback -> C_DragContextActionChangedCallback
- type C_DragContextCancelCallback = Ptr () -> CUInt -> Ptr () -> IO ()
- type DragContextCancelCallback = DragCancelReason -> IO ()
- afterDragContextCancel :: (IsDragContext a, MonadIO m) => a -> DragContextCancelCallback -> m SignalHandlerId
- genClosure_DragContextCancel :: MonadIO m => DragContextCancelCallback -> m (GClosure C_DragContextCancelCallback)
- mk_DragContextCancelCallback :: C_DragContextCancelCallback -> IO (FunPtr C_DragContextCancelCallback)
- noDragContextCancelCallback :: Maybe DragContextCancelCallback
- onDragContextCancel :: (IsDragContext a, MonadIO m) => a -> DragContextCancelCallback -> m SignalHandlerId
- wrap_DragContextCancelCallback :: DragContextCancelCallback -> C_DragContextCancelCallback
- type C_DragContextDndFinishedCallback = Ptr () -> Ptr () -> IO ()
- type DragContextDndFinishedCallback = IO ()
- afterDragContextDndFinished :: (IsDragContext a, MonadIO m) => a -> DragContextDndFinishedCallback -> m SignalHandlerId
- genClosure_DragContextDndFinished :: MonadIO m => DragContextDndFinishedCallback -> m (GClosure C_DragContextDndFinishedCallback)
- mk_DragContextDndFinishedCallback :: C_DragContextDndFinishedCallback -> IO (FunPtr C_DragContextDndFinishedCallback)
- noDragContextDndFinishedCallback :: Maybe DragContextDndFinishedCallback
- onDragContextDndFinished :: (IsDragContext a, MonadIO m) => a -> DragContextDndFinishedCallback -> m SignalHandlerId
- wrap_DragContextDndFinishedCallback :: DragContextDndFinishedCallback -> C_DragContextDndFinishedCallback
- type C_DragContextDropPerformedCallback = Ptr () -> Int32 -> Ptr () -> IO ()
- type DragContextDropPerformedCallback = Int32 -> IO ()
- afterDragContextDropPerformed :: (IsDragContext a, MonadIO m) => a -> DragContextDropPerformedCallback -> m SignalHandlerId
- genClosure_DragContextDropPerformed :: MonadIO m => DragContextDropPerformedCallback -> m (GClosure C_DragContextDropPerformedCallback)
- mk_DragContextDropPerformedCallback :: C_DragContextDropPerformedCallback -> IO (FunPtr C_DragContextDropPerformedCallback)
- noDragContextDropPerformedCallback :: Maybe DragContextDropPerformedCallback
- onDragContextDropPerformed :: (IsDragContext a, MonadIO m) => a -> DragContextDropPerformedCallback -> m SignalHandlerId
- wrap_DragContextDropPerformedCallback :: DragContextDropPerformedCallback -> C_DragContextDropPerformedCallback

# Exported types

newtype DragContext Source #

Memory-managed wrapper type.

Constructors

DragContext (ManagedPtr DragContext) |

#### Instances

Instances details

Eq DragContext Source # |
Instance details Defined in GI.Gdk.Objects.DragContext Methods (==) :: DragContext -> DragContext -> Bool # (/=) :: DragContext -> DragContext -> Bool #
GObject DragContext Source # |
Instance details Defined in GI.Gdk.Objects.DragContext
TypedObject DragContext Source # |
Instance details Defined in GI.Gdk.Objects.DragContext Methods glibType :: IO GType Source #
ManagedPtrNewtype DragContext Source # |
Instance details Defined in GI.Gdk.Objects.DragContext Methods toManagedPtr :: DragContext -> ManagedPtr DragContext Source #
IsGValue DragContext Source # | Convert `DragContext` to and from `GValue` with `toGValue` and `fromGValue`.
Instance details Defined in GI.Gdk.Objects.DragContext Methods toGValue :: DragContext -> IO GValue Source # fromGValue :: GValue -> IO DragContext Source #
HasParentTypes DragContext Source # |
Instance details Defined in GI.Gdk.Objects.DragContext
type ParentTypes DragContext Source # |
Instance details Defined in GI.Gdk.Objects.DragContext type ParentTypes DragContext = '[Object]

class (GObject o, IsDescendantOf DragContext o) => IsDragContext o Source #

Type class for types which can be safely cast to `DragContext`, for instance with `toDragContext`.

#### Instances

Instances details

(GObject o, IsDescendantOf DragContext o) => IsDragContext o Source # |
Instance details Defined in GI.Gdk.Objects.DragContext

toDragContext :: (MonadIO m, IsDragContext o) => o -> m DragContext Source #

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

# Methods

## Overloaded methods

## getActions

dragContextGetActions Source #

Arguments

:: (HasCallStack, MonadIO m, IsDragContext a) |
=> a | `context`: a `DragContext`
-> m [DragAction] | Returns: the `DragAction` flags

Determines the bitmask of actions proposed by the source if `dragContextGetSuggestedAction` returns `DragActionAsk`.

Since: 2.22

## getDestWindow

dragContextGetDestWindow Source #

Arguments

:: (HasCallStack, MonadIO m, IsDragContext a) |
=> a | `context`: a `DragContext`
-> m Window | Returns: a `Window`

Returns the destination window for the DND operation.

Since: 3.0

## getDevice

dragContextGetDevice Source #

Arguments

:: (HasCallStack, MonadIO m, IsDragContext a) |
=> a | `context`: a `DragContext`
-> m Device | Returns: The `Device` associated to `context`.

Returns the `Device` associated to the drag context.

## getDragWindow

dragContextGetDragWindow Source #

Arguments

:: (HasCallStack, MonadIO m, IsDragContext a) |
=> a | `context`: a `DragContext`
-> m (Maybe Window) | Returns: the drag window, or `Nothing`

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

Since: 3.20

## getProtocol

dragContextGetProtocol Source #

Arguments

:: (HasCallStack, MonadIO m, IsDragContext a) |
=> a | `context`: a `DragContext`
-> m DragProtocol | Returns: the drag protocol

Returns the drag protocol that is used by this context.

Since: 3.0

## getSelectedAction

dragContextGetSelectedAction Source #

Arguments

:: (HasCallStack, MonadIO m, IsDragContext a) |
=> a | `context`: a `DragContext`
-> m [DragAction] | Returns: a `DragAction` value

Determines the action chosen by the drag destination.

Since: 2.22

## getSourceWindow

dragContextGetSourceWindow Source #

Arguments

:: (HasCallStack, MonadIO m, IsDragContext a) |
=> a | `context`: a `DragContext`
-> m Window | Returns: a `Window`

Returns the `Window` where the DND operation started.

Since: 2.22

## getSuggestedAction

dragContextGetSuggestedAction Source #

Arguments

:: (HasCallStack, MonadIO m, IsDragContext a) |
=> a | `context`: a `DragContext`
-> m [DragAction] | Returns: a `DragAction` value

Determines the suggested drag action of the context.

Since: 2.22

## listTargets

dragContextListTargets Source #

Arguments

:: (HasCallStack, MonadIO m, IsDragContext a) |
=> a | `context`: a `DragContext`
-> m [Atom] | Returns: a `List` of targets

Retrieves the list of targets of the context.

Since: 2.22

## manageDnd

dragContextManageDnd Source #

Arguments

:: (HasCallStack, MonadIO m, IsDragContext a, IsWindow b) |
=> a | `context`: a `DragContext`
-> b | `ipcWindow`: Window to use for IPC messaging/events
-> [DragAction] | `actions`: the actions supported by the drag source
-> m Bool | Returns: `TRUE` if the drag and drop operation is managed.

Requests the drag and drop operation to be managed by `context`. When a drag and drop operation becomes managed, the `DragContext` will internally handle all input and source-side `EventDND` events as required by the windowing system.

Once the drag and drop operation is managed, the drag context will emit the following signals:

- The actionChanged signal whenever the final action to be performed by the drag and drop operation changes.
- The dropPerformed signal after the user performs the drag and drop gesture (typically by releasing the mouse button).
- The dndFinished signal after the drag and drop operation concludes (after all `GdkSelection` transfers happen).
- The cancel signal if the drag and drop operation is finished but doesn't happen over an accepting destination, or is cancelled through other means.

Since: 3.20

## setDevice

dragContextSetDevice Source #

Arguments

:: (HasCallStack, MonadIO m, IsDragContext a, IsDevice b) |
=> a | `context`: a `DragContext`
-> b | `device`: a `Device`
-> m () |

Associates a `Device` to `context`, so all Drag and Drop events for `context` are emitted as if they came from this device.

## setHotspot

dragContextSetHotspot Source #

Arguments

:: (HasCallStack, MonadIO m, IsDragContext a) |
=> a | `context`: a `DragContext`
-> Int32 | `hotX`: x coordinate of the drag window hotspot
-> Int32 | `hotY`: y coordinate of the drag window hotspot
-> m () |

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

Since: 3.20

# Signals

## actionChanged

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

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

type DragContextActionChangedCallback Source #

Arguments

= [DragAction] | `action`: The action currently chosen
-> IO () |

A new action is being chosen for the drag and drop operation.

This signal will only be emitted if the `DragContext` manages the drag and drop operation. See `dragContextManageDnd` for more information.

Since: 3.20

afterDragContextActionChanged :: (IsDragContext a, MonadIO m) => a -> DragContextActionChangedCallback -> m SignalHandlerId Source #

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

    after dragContext #actionChanged callback

genClosure_DragContextActionChanged :: MonadIO m => DragContextActionChangedCallback -> m (GClosure C_DragContextActionChangedCallback) Source #

Wrap the callback into a `GClosure`.

mk_DragContextActionChangedCallback :: C_DragContextActionChangedCallback -> IO (FunPtr C_DragContextActionChangedCallback) Source #

Generate a function pointer callable from C code, from a `C_DragContextActionChangedCallback`.

noDragContextActionChangedCallback :: Maybe DragContextActionChangedCallback Source #

A convenience synonym for ``Nothing` :: `Maybe` `DragContextActionChangedCallback``.

onDragContextActionChanged :: (IsDragContext a, MonadIO m) => a -> DragContextActionChangedCallback -> m SignalHandlerId Source #

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

    on dragContext #actionChanged callback

wrap_DragContextActionChangedCallback :: DragContextActionChangedCallback -> C_DragContextActionChangedCallback Source #

Wrap a `DragContextActionChangedCallback` into a `C_DragContextActionChangedCallback`.

## cancel

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

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

type DragContextCancelCallback Source #

Arguments

= DragCancelReason | `reason`: The reason the context was cancelled
-> IO () |

The drag and drop operation was cancelled.

This signal will only be emitted if the `DragContext` manages the drag and drop operation. See `dragContextManageDnd` for more information.

Since: 3.20

afterDragContextCancel :: (IsDragContext a, MonadIO m) => a -> DragContextCancelCallback -> 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 dragContext #cancel callback

genClosure_DragContextCancel :: MonadIO m => DragContextCancelCallback -> m (GClosure C_DragContextCancelCallback) Source #

Wrap the callback into a `GClosure`.

mk_DragContextCancelCallback :: C_DragContextCancelCallback -> IO (FunPtr C_DragContextCancelCallback) Source #

Generate a function pointer callable from C code, from a `C_DragContextCancelCallback`.

noDragContextCancelCallback :: Maybe DragContextCancelCallback Source #

A convenience synonym for ``Nothing` :: `Maybe` `DragContextCancelCallback``.

onDragContextCancel :: (IsDragContext a, MonadIO m) => a -> DragContextCancelCallback -> 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 dragContext #cancel callback

wrap_DragContextCancelCallback :: DragContextCancelCallback -> C_DragContextCancelCallback Source #

Wrap a `DragContextCancelCallback` into a `C_DragContextCancelCallback`.

## dndFinished

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

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

type DragContextDndFinishedCallback = IO () Source #

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

This signal will only be emitted if the `DragContext` manages the drag and drop operation. See `dragContextManageDnd` for more information.

Since: 3.20

afterDragContextDndFinished :: (IsDragContext a, MonadIO m) => a -> DragContextDndFinishedCallback -> 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 dragContext #dndFinished callback

genClosure_DragContextDndFinished :: MonadIO m => DragContextDndFinishedCallback -> m (GClosure C_DragContextDndFinishedCallback) Source #

Wrap the callback into a `GClosure`.

mk_DragContextDndFinishedCallback :: C_DragContextDndFinishedCallback -> IO (FunPtr C_DragContextDndFinishedCallback) Source #

Generate a function pointer callable from C code, from a `C_DragContextDndFinishedCallback`.

noDragContextDndFinishedCallback :: Maybe DragContextDndFinishedCallback Source #

A convenience synonym for ``Nothing` :: `Maybe` `DragContextDndFinishedCallback``.

onDragContextDndFinished :: (IsDragContext a, MonadIO m) => a -> DragContextDndFinishedCallback -> 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 dragContext #dndFinished callback

wrap_DragContextDndFinishedCallback :: DragContextDndFinishedCallback -> C_DragContextDndFinishedCallback Source #

Wrap a `DragContextDndFinishedCallback` into a `C_DragContextDndFinishedCallback`.

## dropPerformed

type C_DragContextDropPerformedCallback = Ptr () -> Int32 -> Ptr () -> IO () Source #

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

type DragContextDropPerformedCallback Source #

Arguments

= Int32 | `time`: the time at which the drop happened.
-> IO () |

The drag and drop operation was performed on an accepting client.

This signal will only be emitted if the `DragContext` manages the drag and drop operation. See `dragContextManageDnd` for more information.

Since: 3.20

afterDragContextDropPerformed :: (IsDragContext a, MonadIO m) => a -> DragContextDropPerformedCallback -> 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 dragContext #dropPerformed callback

genClosure_DragContextDropPerformed :: MonadIO m => DragContextDropPerformedCallback -> m (GClosure C_DragContextDropPerformedCallback) Source #

Wrap the callback into a `GClosure`.

mk_DragContextDropPerformedCallback :: C_DragContextDropPerformedCallback -> IO (FunPtr C_DragContextDropPerformedCallback) Source #

Generate a function pointer callable from C code, from a `C_DragContextDropPerformedCallback`.

noDragContextDropPerformedCallback :: Maybe DragContextDropPerformedCallback Source #

A convenience synonym for ``Nothing` :: `Maybe` `DragContextDropPerformedCallback``.

onDragContextDropPerformed :: (IsDragContext a, MonadIO m) => a -> DragContextDropPerformedCallback -> 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 dragContext #dropPerformed callback

wrap_DragContextDropPerformedCallback :: DragContextDropPerformedCallback -> C_DragContextDropPerformedCallback Source #

Wrap a `DragContextDropPerformedCallback` into a `C_DragContextDropPerformedCallback`.