Class: Gdk::Drop
- Inherits:
-
Object
- Object
- Gdk::Drop
- Defined in:
- (unknown)
Overview
The GdkDrop object represents the target of an ongoing DND operation.
Possible drop sites get informed about the status of the ongoing drag
operation with events of type %GDK_DRAG_ENTER, %GDK_DRAG_LEAVE,
%GDK_DRAG_MOTION and %GDK_DROP_START. The GdkDrop object can be obtained
from these [classGdk.Event] types using [methodGdk.DNDEvent.get_drop].
The actual data transfer is initiated from the target side via an async
read, using one of the GdkDrop methods for this purpose:
[methodGdk.Drop.read_async] or [methodGdk.Drop.read_value_async].
GTK provides a higher level abstraction based on top of these functions, and so they are not normally needed in GTK applications. See the "Drag and Drop" section of the GTK documentation for more information.
Instance Method Summary collapse
-
#actions ⇒ Gdk::DragAction
The possible actions for this drop.
-
#actions=(actions) ⇒ Gdk::DragAction
The possible actions for this drop.
-
#device ⇒ Gdk::Device
The
GdkDeviceperforming the drop. -
#device=(device) ⇒ Gdk::Device
The
GdkDeviceperforming the drop. -
#display ⇒ Gdk::Display
The
GdkDisplaythat the drop belongs to. -
#display=(display) ⇒ Gdk::Display
The
GdkDisplaythat the drop belongs to. -
#drag ⇒ Gdk::Drag
The
GdkDragthat initiated this drop. -
#drag=(drag) ⇒ Gdk::Drag
The
GdkDragthat initiated this drop. -
#finish(action) ⇒ nil
Ends the drag operation after a drop.
-
#formats ⇒ Gdk::ContentFormats
The possible formats that the drop can provide its data in.
-
#formats=(formats) ⇒ Gdk::ContentFormats
The possible formats that the drop can provide its data in.
-
#read_async(mime_types, io_priority, cancellable, callback, user_data) ⇒ nil
Asynchronously read the dropped data from a
GdkDropin a format that complies with one of the mime types. -
#read_finish(result, out_mime_type) ⇒ Gio::InputStream
Finishes an async drop read operation.
-
#read_value_async(type, io_priority, cancellable, callback, user_data) ⇒ nil
Asynchronously request the drag operation's contents converted to the given type.
-
#read_value_finish(result) ⇒ GObject::Value
Finishes an async drop read.
-
#status(actions, preferred) ⇒ nil
Selects all actions that are potentially supported by the destination.
-
#surface ⇒ Gdk::Surface
The
GdkSurfacethe drop happens on. -
#surface=(surface) ⇒ Gdk::Surface
The
GdkSurfacethe drop happens on.
Instance Method Details
#actions ⇒ Gdk::DragAction
The possible actions for this drop
#actions=(actions) ⇒ Gdk::DragAction
The possible actions for this drop
#device ⇒ Gdk::Device
The GdkDevice performing the drop
#device=(device) ⇒ Gdk::Device
The GdkDevice performing the drop
#display ⇒ Gdk::Display
The GdkDisplay that the drop belongs to.
#display=(display) ⇒ Gdk::Display
The GdkDisplay that the drop belongs to.
#drag ⇒ Gdk::Drag
The GdkDrag that initiated this drop
#drag=(drag) ⇒ Gdk::Drag
The GdkDrag that initiated this drop
#finish(action) ⇒ nil
Ends the drag operation after a drop.
The action must be a single action selected from the actions available via [methodGdk.Drop.get_actions].
#formats ⇒ Gdk::ContentFormats
The possible formats that the drop can provide its data in.
#formats=(formats) ⇒ Gdk::ContentFormats
The possible formats that the drop can provide its data in.
#read_async(mime_types, io_priority, cancellable, callback, user_data) ⇒ nil
Asynchronously read the dropped data from a GdkDrop
in a format that complies with one of the mime types.
#read_finish(result, out_mime_type) ⇒ Gio::InputStream
Finishes an async drop read operation.
Note that you must not use blocking read calls on the returned stream in the GTK thread, since some platforms might require communication with GTK to complete the data transfer. You can use async APIs such as g_input_stream_read_bytes_async().
See [methodGdk.Drop.read_async].
#read_value_async(type, io_priority, cancellable, callback, user_data) ⇒ nil
Asynchronously request the drag operation's contents converted to the given type.
When the operation is finished callback will be called. You must
then call [methodGdk.Drop.read_value_finish] to get the resulting
GValue.
For local drag-and-drop operations that are available in the given
GType, the value will be copied directly. Otherwise, GDK will
try to use [funcGdk.content_deserialize_async] to convert the data.
#read_value_finish(result) ⇒ GObject::Value
Finishes an async drop read.
See [methodGdk.Drop.read_value_async].
#status(actions, preferred) ⇒ nil
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 [methodGdk.Drop.get_actions]. Those actions may change in the future, even depending on the actions you provide here.
The preferred action is a hint to the drag-and-drop mechanism about which action to use when multiple actions are possible.
This function should be called by drag destinations in response to %GDK_DRAG_ENTER or %GDK_DRAG_MOTION 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.
#surface ⇒ Gdk::Surface
The GdkSurface the drop happens on
#surface=(surface) ⇒ Gdk::Surface
The GdkSurface the drop happens on