Represents the source of an ongoing DND operation.
A GdkDrag is created when a drag is started, and stays alive for duration of the DND operation. After a drag has been started with [funcGdk.Drag.begin], the caller gets informed about the status of the ongoing drag operation with signals on the GdkDrag object.
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.
Actions_Property : constant Glib.Properties.Property_Boxed;
Type: Drag_Action The possible actions of this drag.
function Begin_Drag
(Surface : not null access Gdk.Surface.Gdk_Surface_Record'Class;
Device : not null access Gdk.Device.Gdk_Device_Record'Class;
Content : not null access Gdk.Content_Provider.Gdk_Content_Provider_Record'Class;
Actions : Drag_Action;
Dx : Gdouble;
Dy : Gdouble) return Gdk_Drag
Starts a drag and creates a new drag context for it. This function is called by the drag source. After this call, you probably want to set up the drag icon using the surface returned by [methodGdk.Drag.get_drag_surface]. This function returns a reference to the [classGdk.Drag] object, but GTK keeps its own reference as well, as long as the DND operation is going on. Note: if Actions include Gdk.Drag.Gdk_Action_Move, you need to listen for the [signalGdk.Drag::dnd-finished] signal and delete the data at the source if [methodGdk.Drag.get_selected_action] returns Gdk.Drag.Gdk_Action_Move.
the source surface for this drag
the device that controls this drag
the offered content
the actions supported by this drag
the x offset to Device's position where the drag nominally started
the y offset to Device's position where the drag nominally started
a newly created GdkDrag. Has transfer-ownership='full'.
type Cb_Gdk_Drag_Drag_Cancel_Reason_Void is not null access procedure
(Self : access Gdk_Drag_Record'Class;
Reason : Drag_Cancel_Reason);
type Cb_Gdk_Drag_Void is not null access procedure (Self : access Gdk_Drag_Record'Class);
type Cb_GObject_Drag_Cancel_Reason_Void is not null access procedure
(Self : access Glib.Object.GObject_Record'Class;
Reason : Drag_Cancel_Reason);
type Cb_GObject_Void is not null access procedure
(Self : access Glib.Object.GObject_Record'Class);
Content_Property : constant Glib.Properties.Property_Boxed;
Type: Content_Provider The GdkContentProvider.
Device_Property : constant Glib.Properties.Property_Boxed;
Type: Device The GdkDevice that is performing the drag.
Display_Property : constant Glib.Properties.Property_Boxed;
Type: Display The GdkDisplay that the drag belongs to.
type Drag_Action is mod 2 ** Integer'Size;
Used in GdkDrop and GdkDrag to indicate the actions that the destination can and should do with the dropped data.
package Drag_Action_Properties is
new Generic_Internal_Flags_Property (Drag_Action);
type Drag_Cancel_Reason is (
No_Target,
User_Cancelled,
Error);
Used in GdkDrag to the reason of a cancelled DND operation.
package Drag_Cancel_Reason_Properties is
new Generic_Internal_Discrete_Property (Drag_Cancel_Reason);
procedure Drop_Done
(Self : not null access Gdk_Drag_Record;
Success : Boolean)
Informs GDK that the drop ended. 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 GdkDrag will only take the first [methodGdk.Drag.drop_done] call as effective, if this function is called multiple times, all subsequent calls will be ignored.
whether the drag was ultimatively successful
Formats_Property : constant Glib.Properties.Property_Boxed;
Type: Content_Formats The possible formats that the drag can provide its data in.
Gdk_Action_Ask : constant Drag_Action := 8;
Gdk_Action_Copy : constant Drag_Action := 1;
Gdk_Action_Link : constant Drag_Action := 4;
Gdk_Action_Move : constant Drag_Action := 2;
Gdk_Action_None : constant Drag_Action := 0;
type Gdk_Drag is access all Gdk_Drag_Record'Class;
type Gdk_Drag_Record is new GObject_Record with null record;
function Get_Actions
(Self : not null access Gdk_Drag_Record) return Drag_Action
Determines the bitmask of possible actions proposed by the source.
the GdkDragAction flags
function Get_Content
(Self : not null access Gdk_Drag_Record)
return Gdk.Content_Provider.Gdk_Content_Provider
Returns the GdkContentProvider associated to the GdkDrag object.
The GdkContentProvider associated to Drag. Has transfer-ownership='none'.
function Get_Device
(Self : not null access Gdk_Drag_Record) return Gdk.Gdk_Device
Returns the GdkDevice associated to the GdkDrag object.
The GdkDevice associated to Drag. Has transfer-ownership='none'.
function Get_Display
(Self : not null access Gdk_Drag_Record) return Gdk.Gdk_Display
Gets the GdkDisplay that the drag object was created for.
a GdkDisplay. Has transfer-ownership='none'.
function Get_Drag_Surface
(Self : not null access Gdk_Drag_Record) return Gdk.Gdk_Surface
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.
the drag surface. Has transfer-ownership='none'.
function Get_Formats
(Self : not null access Gdk_Drag_Record)
return Gdk.Content_Formats.Gdk_Content_Formats
Retrieves the formats supported by this GdkDrag object.
a GdkContentFormats. Has transfer-ownership='none'.
function Get_Selected_Action
(Self : not null access Gdk_Drag_Record) return Drag_Action
Determines the action chosen by the drag destination.
a GdkDragAction value
function Get_Surface
(Self : not null access Gdk_Drag_Record) return Gdk.Gdk_Surface
Returns the GdkSurface where the drag originates.
The GdkSurface where the drag originates. Has transfer-ownership='none'.
function Get_Type return Glib.GType
procedure On_Cancel
(Self : not null access Gdk_Drag_Record;
Call : Cb_Gdk_Drag_Drag_Cancel_Reason_Void;
After : Boolean := False)
Emitted when the drag operation is cancelled.
procedure On_Cancel
(Self : not null access Gdk_Drag_Record;
Call : Cb_GObject_Drag_Cancel_Reason_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
Emitted when the drag operation is cancelled.
procedure On_Dnd_Finished
(Self : not null access Gdk_Drag_Record;
Call : Cb_Gdk_Drag_Void;
After : Boolean := False)
Emitted when the destination side has finished reading all data.
The drag object can now free all miscellaneous data.
procedure On_Dnd_Finished
(Self : not null access Gdk_Drag_Record;
Call : Cb_GObject_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
Emitted when the destination side has finished reading all data.
The drag object can now free all miscellaneous data.
procedure On_Drop_Performed
(Self : not null access Gdk_Drag_Record;
Call : Cb_Gdk_Drag_Void;
After : Boolean := False)
Emitted when the drop operation is performed on an accepting client.
procedure On_Drop_Performed
(Self : not null access Gdk_Drag_Record;
Call : Cb_GObject_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
Emitted when the drop operation is performed on an accepting client.
type Property_Drag_Action is new Drag_Action_Properties.Property;
type Property_Drag_Cancel_Reason is new Drag_Cancel_Reason_Properties.Property;
Selected_Action_Property : constant Glib.Properties.Property_Boxed;
Type: Drag_Action The currently selected action of the drag.
procedure Set_Hotspot
(Self : not null access Gdk_Drag_Record;
Hot_X : Glib.Gint;
Hot_Y : Glib.Gint)
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.
x coordinate of the drag surface hotspot
y coordinate of the drag surface hotspot
Signal_Cancel : constant Glib.Signal_Name := "cancel";
Emitted when the drag operation is cancelled.
Signal_Dnd_Finished : constant Glib.Signal_Name := "dnd-finished";
Emitted when the destination side has finished reading all data.
The drag object can now free all miscellaneous data.
Signal_Drop_Performed : constant Glib.Signal_Name := "drop-performed";
Emitted when the drop operation is performed on an accepting client.
Surface_Property : constant Glib.Properties.Property_Boxed;
Type: Surface The surface where the drag originates.