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 |
The GdkDrop struct contains only private fields and should not be accessed directly.
Synopsis
- newtype Drop = Drop (ManagedPtr Drop)
- class (GObject o, IsDescendantOf Drop o) => IsDrop o
- toDrop :: (MonadIO m, IsDrop o) => o -> m Drop
- noDrop :: Maybe Drop
- dropFinish :: (HasCallStack, MonadIO m, IsDrop a) => a -> [DragAction] -> m ()
- dropGetActions :: (HasCallStack, MonadIO m, IsDrop a) => a -> m [DragAction]
- dropGetDevice :: (HasCallStack, MonadIO m, IsDrop a) => a -> m Device
- dropGetDisplay :: (HasCallStack, MonadIO m, IsDrop a) => a -> m Display
- dropGetDrag :: (HasCallStack, MonadIO m, IsDrop a) => a -> m (Maybe Drag)
- dropGetFormats :: (HasCallStack, MonadIO m, IsDrop a) => a -> m ContentFormats
- dropGetSurface :: (HasCallStack, MonadIO m, IsDrop a) => a -> m Surface
- dropReadAsync :: (HasCallStack, MonadIO m, IsDrop a, IsCancellable b) => a -> [Text] -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- dropReadFinish :: (HasCallStack, MonadIO m, IsDrop a, IsAsyncResult b) => a -> b -> m (Maybe InputStream, Text)
- dropReadTextAsync :: (HasCallStack, MonadIO m, IsDrop a, IsCancellable b) => a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- dropReadTextFinish :: (HasCallStack, MonadIO m, IsDrop a, IsAsyncResult b) => a -> b -> m (Maybe Text)
- dropReadValueAsync :: (HasCallStack, MonadIO m, IsDrop a, IsCancellable b) => a -> GType -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- dropReadValueFinish :: (HasCallStack, MonadIO m, IsDrop a, IsAsyncResult b) => a -> b -> m GValue
- dropStatus :: (HasCallStack, MonadIO m, IsDrop a) => a -> [DragAction] -> m ()
- constructDropActions :: IsDrop o => [DragAction] -> IO (GValueConstruct o)
- getDropActions :: (MonadIO m, IsDrop o) => o -> m [DragAction]
- constructDropDevice :: (IsDrop o, IsDevice a) => a -> IO (GValueConstruct o)
- getDropDevice :: (MonadIO m, IsDrop o) => o -> m Device
- getDropDisplay :: (MonadIO m, IsDrop o) => o -> m Display
- constructDropDrag :: (IsDrop o, IsDrag a) => a -> IO (GValueConstruct o)
- getDropDrag :: (MonadIO m, IsDrop o) => o -> m (Maybe Drag)
- constructDropFormats :: IsDrop o => ContentFormats -> IO (GValueConstruct o)
- getDropFormats :: (MonadIO m, IsDrop o) => o -> m ContentFormats
- constructDropSurface :: (IsDrop o, IsSurface a) => a -> IO (GValueConstruct o)
- getDropSurface :: (MonadIO m, IsDrop o) => o -> m Surface
Exported types
Memory-managed wrapper type.
Instances
Eq Drop Source # | |
GObject Drop Source # | |
Defined in GI.Gdk.Objects.Drop gobjectType :: IO GType # | |
IsGValue Drop Source # | Convert |
HasParentTypes Drop Source # | |
Defined in GI.Gdk.Objects.Drop | |
type ParentTypes Drop Source # | |
Defined in GI.Gdk.Objects.Drop |
class (GObject o, IsDescendantOf Drop o) => IsDrop o Source #
Instances
(GObject o, IsDescendantOf Drop o) => IsDrop o Source # | |
Defined in GI.Gdk.Objects.Drop |
Methods
Overloaded methods
finish
:: (HasCallStack, MonadIO m, IsDrop a) | |
=> a |
|
-> [DragAction] |
|
-> m () |
Ends the drag operation after a drop.
The action
must be a single action selected from the actions
available via dropGetActions
.
getActions
:: (HasCallStack, MonadIO m, IsDrop a) | |
=> a |
|
-> m [DragAction] | Returns: The possible |
Returns the possible actions for this Drop
. If this value
contains multiple actions - ie dragActionIsUnique
returns False
for the result - gdk_drag_finish()
must choose
the action to use when accepting the drop.
This value may change over the lifetime of the Drop
both
as a response to source side actions as well as to calls to
dropStatus
or gdk_drag_finish()
. The source side will
not change this value anymore once a drop has started.
getDevice
:: (HasCallStack, MonadIO m, IsDrop a) | |
=> a |
|
-> m Device | Returns: The |
Returns the Device
performing the drop.
getDisplay
Gets the Display
that self
was created for.
getDrag
getFormats
:: (HasCallStack, MonadIO m, IsDrop a) | |
=> a |
|
-> m ContentFormats | Returns: The possible |
Returns the ContentFormats
that the drop offers the data
to be read in.
getSurface
:: (HasCallStack, MonadIO m, IsDrop a) | |
=> a |
|
-> m Surface | Returns: The |
Returns the Surface
performing the drop.
readAsync
:: (HasCallStack, MonadIO m, IsDrop a, IsCancellable b) | |
=> a |
|
-> [Text] |
|
-> Int32 |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronously read the dropped data from a Drop
in a format that complies with one of the mime types.
readFinish
:: (HasCallStack, MonadIO m, IsDrop a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m (Maybe InputStream, Text) | Returns: the |
Finishes an async drop read operation, see dropReadAsync
.
readTextAsync
:: (HasCallStack, MonadIO m, IsDrop a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronously request the drag operation's contents converted to a string.
When the operation is finished callback
will be called. You can then
call dropReadTextFinish
to get the result.
This is a simple wrapper around dropReadValueAsync
. Use
that function or dropReadAsync
directly if you need more
control over the operation.
readTextFinish
:: (HasCallStack, MonadIO m, IsDrop a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m (Maybe Text) | Returns: a new string or |
Finishes an asynchronous read started with
dropReadTextAsync
.
readValueAsync
:: (HasCallStack, MonadIO m, IsDrop a, IsCancellable b) | |
=> a |
|
-> GType |
|
-> Int32 |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronously request the drag operation's contents converted to the given
type
. When the operation is finished callback
will be called.
You can then call dropReadValueFinish
to get the resulting
Value
.
For local drag'n'drop operations that are available in the given GType
, the
value will be copied directly. Otherwise, GDK will try to use
contentDeserializeAsync
to convert the data.
readValueFinish
:: (HasCallStack, MonadIO m, IsDrop a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m GValue |
Finishes an async drop read started with
dropReadValueAsync
.
status
:: (HasCallStack, MonadIO m, IsDrop a) | |
=> a |
|
-> [DragAction] |
|
-> m () |
Selects all actions that are potentially supported by the destination.
When calling this function, do not restrict the passed in actions to
the ones provided by dropGetActions
. Those actions may
change in the future, even depending on the actions you provide here.
This function should be called by drag destinations in response to
EventTypeDragEnter
or EventTypeDragMotion
events. If the destination does
not yet know the exact actions it supports, it should set any possible
actions first and then later call this function again.
Properties
actions
The possible actions for this drop
constructDropActions :: IsDrop 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
.
getDropActions :: (MonadIO m, IsDrop o) => o -> m [DragAction] Source #
Get the value of the “actions
” property.
When overloading is enabled, this is equivalent to
get
drop #actions
device
The Device
performing the drop
constructDropDevice :: (IsDrop 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
.
getDropDevice :: (MonadIO m, IsDrop o) => o -> m Device Source #
Get the value of the “device
” property.
When overloading is enabled, this is equivalent to
get
drop #device
display
The Display
that the drop belongs to.
getDropDisplay :: (MonadIO m, IsDrop o) => o -> m Display Source #
Get the value of the “display
” property.
When overloading is enabled, this is equivalent to
get
drop #display
drag
The Drag
that initiated this drop
constructDropDrag :: (IsDrop o, IsDrag a) => a -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “drag
” property. This is rarely needed directly, but it is used by new
.
getDropDrag :: (MonadIO m, IsDrop o) => o -> m (Maybe Drag) Source #
Get the value of the “drag
” property.
When overloading is enabled, this is equivalent to
get
drop #drag
formats
The possible formats that the drop can provide its data in.
constructDropFormats :: IsDrop 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
.
getDropFormats :: (MonadIO m, IsDrop o) => o -> m ContentFormats Source #
Get the value of the “formats
” property.
When overloading is enabled, this is equivalent to
get
drop #formats
surface
The Surface
the drop happens on
constructDropSurface :: (IsDrop 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
.
getDropSurface :: (MonadIO m, IsDrop o) => o -> m Surface Source #
Get the value of the “surface
” property.
When overloading is enabled, this is equivalent to
get
drop #surface