## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

## Index

Package: Dnd

- Goto spec source

# Description

    package Gdk.Dnd is

# Types

### Drag_Action

- Goto declaration in source

    type Drag_Action is mod 2 ** 32;

Possible actions for a drop onto a widget, during a drag-and-drop. The drag widgets (ie the ones from which the user can start a drag-and-drop operation) should set a mask, indicating which actions it wants to do. The first action in the list below has the highest priority, the last one the lowest. The actual action chosen for the drag-and-drop will be the highest-priority one that is also accepted by the drop site. Note that in the case where the drag source supports multiple actions, the user can select the one he wants. As explained above, the default one is the highest priority one. But if the user pressed Shift at the same time, Action_Move will be used if present. Ctrl-Shift selects an Action_Link, and Ctrl selects an Action_Copy.

### Drag_Protocol

- Goto declaration in source

    type Drag_Protocol is
         (Drag_Proto_Motif,
          Drag_Proto_Xdnd,
          Drag_Proto_Rootwin,
          Drag_Proto_None,
          Drag_Proto_Win32_Dropfiles,
          Drag_Proto_Ole2,
          Drag_Proto_Local);

The various dnd protocols recognized by a window. Note that not every window recognizes every protocol, and you should be careful as to which one you use. The function Gdk.Drag_Get_Protocol returns which one is recognized by a window.

### Drag_Context

- Goto declaration in source

    type Drag_Context is new Gdk.C_Proxy;

Structure that holds information about a drag in progress. This is used on both source and destination sides.

### Gdk_Atom_Array

- Goto declaration in source

    type Gdk_Atom_Array is array (Natural range <>) of Gdk.Types.Gdk_Atom;

# Constants & Global variables

### Action_Any

- Goto declaration in source

(Drag_Action)

    Action_Any : constant Drag_Action;

Any of the default action is accepted.

### Action_Default

- Goto declaration in source

(Drag_Action)

    Action_Default : constant Drag_Action;

???

### Action_Copy

- Goto declaration in source

(Drag_Action)

    Action_Copy    : constant Drag_Action;

Copy the data to the drop site.

### Action_Move

- Goto declaration in source

(Drag_Action)

    Action_Move    : constant Drag_Action;

Copy the data to the drop site, and delete it from the drag source. The delete command is invoked automatically by GtkAda.

### Action_Link

- Goto declaration in source

(Drag_Action)

    Action_Link    : constant Drag_Action;

Allow the drop site to access the data, without copying it.

### Action_Private

- Goto declaration in source

(Drag_Action)

    Action_Private : constant Drag_Action;

Any action you want to implement. No automatic behavior is provided by GtkAda.

### Action_Ask

- Goto declaration in source

(Drag_Action)

    Action_Ask     : constant Drag_Action;

???

# Subprograms & Entries

### Get_Actions

- Goto spec in source
- Goto body in source

    function Get_Actions (Context: Drag_Context) return Drag_Action;

Return the possible actions associated with the context. This is the list of actions defined by the source of the drag-and-drop operation, in Source_Set. (for instance, if Source_Set was used with Action_Copy + Action_Move, the result will be exactly this sum, whatever was used for Dest_Set).

### Get_Suggested_Action

- Goto spec in source
- Goto body in source

    function Get_Suggested_Action (Context: Drag_Context) return Drag_Action;

Return the suggested action for that context. This is the highest priority action that was set by the source of the drag-and-drop, ie the one it would rather use. The action that is actually used is the one returned by Get_Action, and depends on the mask set by the target.

### Get_Selected_Action

- Goto spec in source
- Goto body in source

    function Get_Selected_Action (Context: Drag_Context) return Drag_Action;

Return the action selected for the drag-and-drop operation. This is the highest priority action common between the drag site and the drop widget (for instance, if Source_Set was used with Action_Copy + Action_Move and Dest_Set was used with only Action_Move, this will be Action_Move).

### Get_Action

- Goto spec in source

    function Get_Action (Context: Drag_Context) return Drag_Action renames Get_Selected_Action;

For backwards compatibility.

### Get_Targets

- Goto spec in source

    function Get_Targets (Context: Drag_Context) return Gdk_Atom_Array;

Return the list of targets supported by this context.

### Drag_Context_Ref

- Goto spec in source

    procedure Drag_Context_Ref (Context: Drag_Context);

### Drag_Context_Unref

- Goto spec in source

    procedure Drag_Context_Unref (Context: Drag_Context);

### Drag_Status

- Goto spec in source

    procedure Drag_Status (Context: Drag_Context;Action: Drag_Action;Time: Guint32);

### Drop_Reply

- Goto spec in source

    procedure Drop_Reply (Context: Drag_Context;Ok: Boolean;Time: Guint32);

### Drop_Finish

- Goto spec in source

    procedure Drop_Finish (Context: Drag_Context;Success: Boolean;Time: Guint32);

Clean up from the drag, and display snapback, if necessary.

### Drag_Get_Selection

- Goto spec in source

    function Drag_Get_Selection (Context: Drag_Context) return Gdk_Atom;

### Drag_Begin

- Goto spec in source

    function Drag_Begin (Window: Gdk.Window.Gdk_Window;Targets: Target_List) return Drag_Context;

### Drag_Get_Protocol

- Goto spec in source

    function Drag_Get_Protocol (Xid: Guint32;Protocol: Drag_Protocol) return Guint32;

Return which drag protocol is recognized by a given low level window.

### Drag_Find_Window

- Goto spec in source

    procedure Drag_Find_Window (Context: Drag_Context;Drag_Window: Gdk.Window.Gdk_Window;X_Root: Gint;Y_Root: Gint;Dest_Window: Gdk.Window.Gdk_Window;Protocol: Drag_Protocol);

### Drag_Motion

- Goto spec in source

    function Drag_Motion (Context: Drag_Context;Dest_Window: Gdk.Window.Gdk_Window;Protocol: Drag_Protocol;X_Root: Gint;Y_Root: Gint;Suggested_Action: Drag_Action;Possible_Actions: Drag_Action;Time: Guint32) return Boolean;

### Drag_Drop

- Goto spec in source

    procedure Drag_Drop (Context: Drag_Context;Time: Guint32);

### Drag_Abort

- Goto spec in source

    procedure Drag_Abort (Context: Drag_Context;Time: Guint32);