## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

1.     -----------------------------------------------------------------------

2.     --               GtkAda - Ada95 binding for Gtk+/Gnome               --

3.     --                                                                   --

4.     --                Copyright (C) 2000-2010 AdaCore                    --

5.     --                                                                   --

6.     -- This library is free software; you can redistribute it and/or     --

7.     -- modify it under the terms of the GNU General Public               --

8.     -- License as published by the Free Software Foundation; either      --

9.     -- version 2 of the License, or (at your option) any later version.  --

10.     --                                                                   --

11.     -- This library is distributed in the hope that it will be useful,   --

12.     -- but WITHOUT ANY WARRANTY; without even the implied warranty of    --

13.     -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU --

14.     -- General Public License for more details.                          --

15.     --                                                                   --

16.     -- You should have received a copy of the GNU General Public         --

17.     -- License along with this library; if not, write to the             --

18.     -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      --

19.     -- Boston, MA 02111-1307, USA.                                       --

20.     --                                                                   --

21.     -- As a special exception, if other files instantiate generics from  --

22.     -- this unit, or you link this unit with other files to produce an   --

23.     -- executable, this  unit  does not  by itself cause  the resulting  --

24.     -- executable to be covered by the GNU General Public License. This  --

25.     -- exception does not however invalidate any other reasons why the   --

26.     -- executable file  might be covered by the  GNU Public License.     --

27.     -----------------------------------------------------------------------

29.     --  <description>

30.     --  Like all modern GUI toolkits, GtkAda has a full support for drag-and-drop

31.     --  operations. This is a mechanism for interactively transferring data between

32.     --  two widgets, either in the same application or in two different

33.     --  applications. The user clicks on a widget (called a "drag source"), and,

34.     --  while keeping the mouse button pressed, moves it to another widget, where

35.     --  the mouse button is released (this other widget is called a "drop site").

36.     --  As a result, and if both widgets can handle the same type of data, some

37.     --  data is either copied or moved to this new widget.

38.     --

39.     --  This is a very intuitive way, in some cases, to enhance the usability of

40.     --  your application, although you should carefully consider whether this

41.     --  should be used or not.

42.     --

43.     --  GtkAda supports several drag-and-drop protocols, so as to be able to

44.     --  communicate with the maximum number of applications. These protocols are

45.     --  Xdnd and Motif.

46.     --

47.     --  Below is a summary of what is needed to add drag-and-drop capabilities to

48.     --  your application. We highly recommend that you look at, and understand,

49.     --  the example in testgtk (create_dnd.adb), before using these features in

50.     --  your own application.

51.     --

52.     --  See also the package Gtk.Selection, that contains some lower subprograms

53.     --  and data types that are used when implementing drag-and-drop.

54.     --

55.     --  - Defining a widget as a possible drag source

56.     --

57.     --  You need to call Source_Set, specifying which mouse buttons can activate

58.     --  the drag, which types of data will be given, and which kind of action

59.     --  will be performed.

60.     --  You then need to connect to the signal "drag_data_get", that will be

61.     --  emitted when the user has dropped the item and GtkAda needs to find the

62.     --  data. You must call Selection_Data_Set in the handler to set the actual

63.     --  data.

64.     --  You can also connect the widget to "drag_data_delete", which will be

65.     --  called whenever the data set for the selection is no longer required and

66.     --  should be deleted. The signal will be emitted only if the drop site

67.     --  requests it, or if the selected action for the drag-and-drop operation

68.     --  was Action_Move. It will not be called automatically for an Action_Copy.

69.     --  Note that the callback might be called several times, if for instance this

70.     --  was an Action_Move, and the drop site requires explicitly to delete the

71.     --  data in its call to Finish.

72.     --

73.     --  - Defining a widget as a possible drop site

74.     --

75.     --  You need to call Dest_Set, specifying which types of Data are accepted

76.     --  by the widget, which actions are recognized, and whether you accept drops

77.     --  from external applications.

78.     --  You also need to connect to "drag_data_received", that will be emitted

79.     --  when the user has dropped some data on the widget. The handler should

80.     --  call Finish, to warn the source widget that the drag and drop operation

81.     --  is finished, and whether it was successful or not.

82.     --  </description>

83.     --  <c_version>2.16.6</c_version>

84.     --  <group>Inter-Process communication</group>

85.     --  <testgtk>create_dnd.adb</testgtk>

87.     with Gdk.BitmapTo API docTo specTo body;

88.     with Gdk.ColorTo API docTo specTo body;

89.     with Gdk.DndTo API docTo specTo body;        use Gdk.DndTo API docTo specTo body;

90.     with Gdk.EventTo API docTo specTo body;

91.     with Gdk.PixmapTo API docTo specTo body;

92.     with Gdk.PixbufTo API docTo specTo body;

93.     with Gdk.TypesTo API docTo spec;

94.     with Gdk.WindowTo API docTo specTo body;

96.     with Gtk.WidgetTo API docTo specTo body;

97.     with Gtk.SelectionTo API docTo specTo body;  use Gtk.SelectionTo API docTo specTo body;

99.     package Gtk.DndTo API docTo specTo body is

101.        -------------------

102.        -- Dest_Defaults --

103.        -------------------

105.        type Dest_Defaults is new Integer;

106.        --  Specify the various types of action that will be taken on behalf of the

107.        --  user for a drag destination site.

109.        Dest_No_Default        : constant Dest_DefaultsTo API docTo spec;

110.        --  No default behavior is provided for the drop site, this is your own

111.        --  responsabily. You need to handler the "drag_drop" signal yourself.

113.        Dest_Default_Motion    : constant Dest_DefaultsTo API docTo spec;

114.        --  If set for a widget, GtkAda, during a drag over this widget will check

115.        --  if the drag matches this widget's list of possible targets and

116.        --  actions. gdk_drag_status is called as appropriate.

118.        Dest_Default_Highlight : constant Dest_DefaultsTo API docTo spec;

119.        --  If set for a widget, GtkAda will draw a highlight on this widget as

120.        --  long as a drag is over this widget and the wiget drag format and action

121.        --  is acceptable.

123.        Dest_Default_Drop      : constant Dest_DefaultsTo API docTo spec;

124.        --  If set for a widget, when a drop occurs, GtkAda+ will check if the drag

125.        --  matches this widget's list of possible targets and actions. If so,

126.        --  GtkAda will call Get_Data on behalf of the widget. Whether or not

127.        --  the drop is succesful, GtkAda will call Drag_Finish. If the

128.        --  action was a move, then if the drag was succesful, then True will be

129.        --  passed for the delete parameter to Finish.

131.        Dest_Default_All       : constant Dest_DefaultsTo API docTo spec;

132.        --  If set, specifies that all default actions should be taken.

134.        ------------------------------------------

135.        -- Setting up a widget as a destination --

136.        ------------------------------------------

138.        procedure Dest_SetTo API docTo body

139.          (Widget  : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

140.           Flags   : Dest_DefaultsTo API docTo spec := Dest_No_DefaultTo API docTo spec;

141.           Targets : Target_Entry_ArrayTo API docTo spec := Any_Target_EntryTo API docTo spec;

142.           Actions : Drag_ActionTo API docTo spec := Action_AnyTo API docTo spec);

143.        --  Set a widget as a potential drop destination.

144.        --

145.        --  Flags specifies what action GtkAda should take on behalf of a widget for

146.        --  drops onto that widget. The Targets and Actions fields are used only

147.        --  if Dest_Default_Motion or Dest_Default_Drop are given.

148.        --

149.        --  Targets indicates the drop types that Widget accepts. If no item from

150.        --  Targets matches the list of targets emitted by the source (as set in

151.        --  Source_Set), then the drop will be considered illegal and refused.

152.        --

153.        --  Actions is a bitmask of possible actions for a drop onto Widget. At

154.        --  least of the actions must be in common with what was set for the source

155.        --  in Source_Set, or the drop is considered illegal.

157.        --  if Flags = Dest_No_Default, no default behavior is provided, and

158.        --  Targets and Actions are simply ignored.

160.        procedure Dest_Set_ProxyTo API docTo body

161.          (Widget          : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

162.           Proxy_Window    : Gdk.Window.Gdk_WindowTo API docTo spec;

163.           ProtocolTo API docTo body        : Drag_ProtocolTo API docTo spec;

164.           Use_Coordinates : Boolean);

165.        --  Set this widget as a proxy for drops to another window.

166.        --  All drag events on Widget will be forwarded to Proxy_Window.

167.        --  Protocol is the drag protocol that Proxy_Window accepts. You can use

168.        --  Gdk.Drag.Get_Protocol to determine this.

169.        --  If Use_Coordinates is True, send the same coordinates to the destination

170.        --  because it is an embedded subwindow.

172.        procedure Dest_UnsetTo API docTo body

173.          (Widget : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class);

174.        --  Clear information about a drop destination set with Dest_Set. The

175.        --  widget will no longer receive notification of drags.

177.        procedure Dest_Set_Target_ListTo API docTo body

178.          (Widget      : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

179.           Target_List : Gtk.Selection.Target_ListTo API docTo spec);

180.        function Dest_Get_Target_ListTo API docTo body

181.          (Widget : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class) return Target_ListTo API docTo spec;

182.        --  Sets the target types that this widget can accept from drag-and-drop.

183.        --  The widget must first be made into a drag destination with

184.        --  Dest_Set.

186.        procedure Dest_Add_Image_TargetsTo API docTo body

187.          (Widget : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class);

188.        procedure Dest_Add_Text_TargetsTo API docTo body

189.          (Widget : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class);

190.        procedure Dest_Add_Uri_TargetsTo API docTo body

191.          (Widget : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class);

192.        --  Add the image/text/URI targets supported by Gtk_Selection to the target

193.        --  list of the drag destination. The targets are added with Info = 0. If

194.        --  you need another value, use Gtk.Selection.Target_List_Add_*_Targets, and

195.        --  Dest_Set_Target_List

197.        function Dest_Find_TargetTo API docTo body

198.          (Widget      : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

199.           Context     : Gdk.Dnd.Drag_ContextTo API docTo spec;

200.           Target_List : Gtk.Selection.Target_ListTo API docTo spec) return Gdk.Types.Gdk_AtomTo API docTo spec;

201.        --  Looks for a match between the targets set for context and the

202.        --  Target_List, returning the first matching target, otherwise returning

203.        --  GDK_NONE. Target_List should usually be the return value from

204.        --  Dest_Get_Target_List, but some widgets may have different valid targets

205.        --  for different parts of the widget; in that case, they will have to

206.        --  implement a drag_motion handler that passes the correct target list to

207.        --  this function.

209.        function Dest_Get_Track_MotionTo API docTo body

210.          (Widget : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class)

211.           return Boolean;

212.        procedure Dest_Set_Track_MotionTo API docTo body

213.          (Widget       : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

214.           Track_Motion : Boolean);

215.        --  Control whether the widget emits drag-motion and drag-leave

216.        --  events regardless of the targets and the Dest_Default_Motion

217.        --  flag.

218.        --

219.        --  This may be used when a widget wants to do generic

220.        --  actions regardless of the targets that the source offers.

222.        -------------------------------------

223.        -- Setting up a widget as a source --

224.        -------------------------------------

226.        procedure Source_SetTo API docTo body

227.          (Widget            : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

228.           Start_Button_Mask : Gdk.Types.Gdk_Modifier_TypeTo API docTo spec;

229.           Targets           : Target_Entry_ArrayTo API docTo spec;

230.           Actions           : Drag_ActionTo API docTo spec);

231.        --  Set up a widget so that GtkAda will start a drag operation when the

232.        --  user clicks and drags on the widget. The widget must have a window.

233.        --

234.        --  Targets is the list of targets that the drag can provide. The first

235.        --  possible target accepted by the drop site will be used. For instance,

236.        --  if Targets contains "text/plain" and "text/url", and the drop site only

237.        --  accepts "text/url", this will be the one used. However, if the drop site

238.        --  also accepts "text/plain", the latter will be prefered.

239.        --

240.        --  Widget needs to be able to convert the data to any of the types in

241.        --  Target, as any of them might be requested by the drop site.

242.        --

243.        --  Actions is a list of possible actions for drags from Widget. At least

244.        --  one of the actions must be in common with the drop site for the

245.        --  drag-and-drop operation to succeed.

247.        procedure Source_UnsetTo API docTo body (Widget : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class);

248.        --  Undo the effects of Source_Set

250.        procedure Source_Set_Target_ListTo API docTo body

251.          (Widget      : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

252.           Target_List : Gtk.Selection.Target_ListTo API docTo spec);

253.        function Source_Get_Target_ListTo API docTo body

254.          (Widget : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class) return Target_ListTo API docTo spec;

255.        --  Changes the target types that this widget offers for drag-and-drop. The

256.        --  widget must first be made into a drag source with Source_Set.

258.        procedure Source_Add_Image_TargetsTo API docTo body

259.          (Widget : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class);

260.        procedure Source_Add_Text_TargetsTo API docTo body

261.          (Widget : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class);

262.        procedure Source_Add_Uri_TargetsTo API docTo body

263.          (Widget : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class);

264.        --  Add the writable image/text/URI targets supported by Gtk_Selection to

265.        --  the target list of the drag source. The targets are added with Info = 0.

266.        --  If you need another value, use Gtk.Selection.Target_List_Add_*_Targets,

267.        --  and Source_Set_Target_List

268.        --  Widget: a #GtkWidget that's is a drag source

270.        procedure Source_Set_IconTo API docTo body

271.          (Widget   : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

272.           Colormap : Gdk.Color.Gdk_ColormapTo API docTo spec;

273.           Pixmap   : Gdk.Pixmap.Gdk_PixmapTo API docTo spec;

274.           Mask     : Gdk.Bitmap.Gdk_BitmapTo API docTo spec);

275.        procedure Source_Set_Icon_PixbufTo API docTo body

276.          (Widget : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

277.           Pixbuf : Gdk.Pixbuf.Gdk_PixbufTo API docTo spec);

278.        procedure Source_Set_Icon_StockTo API docTo body

279.          (Widget   : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

280.           Stock_Id : String);

281.        procedure Source_Set_Icon_NameTo API docTo body

282.          (Widget    : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

283.           Icon_Name : String);

284.        --  Set the icon that will be used for drags from a particular widget.

285.        --  GtkAda retains a reference count for the arguments, and will release

286.        --  them when they are no longer needed.

288.        ---------------------------------

289.        -- The drag-and-drop operation --

290.        ---------------------------------

292.        procedure FinishTo API docTo body

293.          (Context : Drag_ContextTo API docTo spec;

294.           Success : Boolean;

295.           Del     : Boolean;

296.           Time    : Guint32To API docTo spec := 0);

297.        --  Inform the drag source that the drop is finished, and that the data of

298.        --  the drag will no longer be required.

299.        --  Success should indicate whether the drop was successful.

300.        --  Del should be set to True if the source should delete the original

301.        --  data (this should be True for a move).

303.        procedure Get_DataTo API docTo body

304.          (Widget  : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

305.           Context : Drag_ContextTo API docTo spec;

306.           Target  : Gdk.Types.Gdk_AtomTo API docTo spec;

307.           Time    : Guint32To API docTo spec := 0);

308.        --  Get the data associated with a drag. When the data is received or the

309.        --  retrieval fails, GtkAda will emit a "drag_data_received"

310.        --  signal. Failure of the retrieval is indicated by the length field of

311.        --  the selection_data signal parameter being negative. However, when

312.        --  Get_Data is called implicitely because the Drag_Default_Drop was set,

313.        --  then the widget will not receive notification of failed drops.

314.        --

315.        --  Target is the target (form of the data) to retrieve.

316.        --  Time is a timestamp to retrive the data, and will be given to

317.        --  "drag_data_motion" or "drag_data_drop" signals.

319.        function Get_Source_WidgetTo API docTo body

320.          (Context : Drag_ContextTo API docTo spec) return Gtk.Widget.Gtk_WidgetTo API docTo spec;

321.        --  Determine the source widget for a drag.

322.        --  If the drag is occuring within a single application, this function

323.        --  returns the source widget. Otherwise, it returns null.

325.        procedure HighlightTo API docTo body (Widget : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class);

326.        --  Draw a highlight around a widget.

328.        procedure UnhighlightTo API docTo body (Widget : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class);

329.        --  Remove a highlight set by Highlight.

331.        function Drag_BeginTo API docTo body

332.          (Widget  : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

333.           Targets : Target_ListTo API docTo spec;

334.           Actions : Drag_ActionTo API docTo spec;

335.           Button  : GintTo API docTo spec;

336.           Event   : Gdk.Event.Gdk_EventTo API docTo spec) return Drag_ContextTo API docTo spec;

337.        --  Initiate a drag on the source side. The function only needs to be used

338.        --  when the application is starting drags itself, and is not needed when

339.        --  Source_Set is used.

340.        --  Targets is the list of targets (data formats) in which the source can

341.        --  provide the data.

342.        --  Actions is a bitmask of the allowed drag actions for this drag.

343.        --  Button is the button the user clicked to start the drag.

344.        --  Event is the event that triggered the start of the drag.

346.        function Check_ThresholdTo API docTo body

347.          (Widget    : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

348.           Start_X   : GintTo API docTo spec;

349.           Start_Y   : GintTo API docTo spec;

350.           Current_X : GintTo API docTo spec;

351.           Current_Y : GintTo API docTo spec) return Boolean;

352.        --  Checks to see if a mouse drag starting at (Start_X, Start_Y) and ending

353.        --  at (Current_X, Current_Y) has passed the GTK drag threshhold, and thus

354.        --  should trigger the beginning of a drag-and-drop operation.

355.        --  Return True if the drag threshold has been passed.

357.        -----------

358.        -- Icons --

359.        -----------

361.        procedure Set_Icon_WidgetTo API docTo body

362.          (Context : Drag_ContextTo API docTo spec;

363.           Widget  : access Gtk.Widget.Gtk_Widget_RecordTo API docTo specTo body'Class;

364.           Hot_X   : GintTo API docTo spec;

365.           Hot_Y   : GintTo API docTo spec);

366.        --  Change the icon for a drag.

367.        --  GtkAda will not destroy the icon, so if you don't want it to persist,

368.        --  you should connect to the "drag_end" signal and destroy it yourself.

369.        --  Context is the reference to the current drag operation.

370.        --  Widget is the toplevel window to use as an icon. (Hot_X, Hot_Y) is the

371.        --  coordinates of the hot point (that will be just under the mouse) within

372.        --  Widget.

374.        procedure Set_Icon_PixmapTo API docTo body

375.          (Context  : Drag_ContextTo API docTo spec;

376.           Colormap : Gdk.Color.Gdk_ColormapTo API docTo spec;

377.           Pixmap   : Gdk.Pixmap.Gdk_PixmapTo API docTo spec;

378.           Mask     : Gdk.Bitmap.Gdk_BitmapTo API docTo spec;

379.           Hot_X    : GintTo API docTo spec;

380.           Hot_Y    : GintTo API docTo spec);

381.        --  Sets a given pixmap as the icon for a given drag. GtkAda retains a

382.        --  reference count for the arguments, and will release them when they are

383.        --  no longer needed.

384.        --  (Hot_X, Hot_Y) is the coordinates of the hotspot within Pixmap.

386.        procedure Set_Icon_DefaultTo API docTo body (Context : Drag_ContextTo API docTo spec);

387.        --  Set the icon for a particular drag to the default icon.

388.        --  This must be called with a context for the source side of a drag.

390.        procedure Set_Icon_PixbufTo API docTo body

391.          (Context : Drag_ContextTo API docTo spec;

392.           Pixbuf  : Gdk.Pixbuf.Gdk_PixbufTo API docTo spec;

393.           Hot_X   : GintTo API docTo spec;

394.           Hot_Y   : GintTo API docTo spec);

395.        --  Sets Pixbuf as the icon for a given drag.

396.        --  Context: the context for a drag. (This must be called

397.        --             with a  context for the source side of a drag)

398.        --  Pixbuf: the Gdk_Pixbuf to use as the drag icon.

399.        --  Hot_x: the X offset within the pixbuf of the hotspot.

400.        --  Hot_y: the Y offset within the pixbuf of the hotspot.

402.        procedure Set_Icon_StockTo API docTo body

403.          (Context  : Drag_ContextTo API docTo spec;

404.           Stock_Id : String;

405.           Hot_X    : GintTo API docTo spec;

406.           Hot_Y    : GintTo API docTo spec);

407.        --  Sets the icon for a given drag from a stock ID

408.        --  Context: the context for a drag. (This must be called

409.        --             with a  context for the source side of a drag)

410.        --  Stock: the ID of the stock icon to use for the drag.

411.        --  Hot_x: the X offset within the icon of the hotspot.

412.        --  Hot_y: the Y offset within the icon of the hotspot.

414.        procedure Set_Icon_NameTo API docTo body

415.          (Context   : Drag_ContextTo API docTo spec;

416.           Icon_Name : String;

417.           Hot_X     : GintTo API docTo spec;

418.           Hot_Y     : GintTo API docTo spec);

419.        --  Sets the icon for a given drag from a named themed icon. See

420.        --  the docs for Gtk_Icon_Theme for more details. Note that the

421.        --  size of the icon depends on the icon theme (the icon is

422.        --  loaded at the symbolic size GTK_ICON_SIZE_DND), thus

423.        --  Hot_X and Hot_Y have to be used with care.

425.        -----------------

426.        -- Obsolescent --

427.        -----------------

428.        --  All subprograms below are now obsolescent in gtk+. They might be removed

429.        --  from future versions of gtk+ (and therefore GtkAda).

430.        --  To find out whether your code uses any of these, we recommend compiling

431.        --  with the -gnatwj switch

432.        --  <doc_ignore>

434.        procedure Set_Default_IconTo API docTo body

435.          (Colormap : Gdk.Color.Gdk_ColormapTo API docTo spec;

436.           Pixmap   : Gdk.Pixmap.Gdk_PixmapTo API docTo spec;

437.           Mask     : Gdk.Bitmap.Gdk_BitmapTo API docTo spec;

438.           Hot_X    : GintTo API docTo spec;

439.           Hot_Y    : GintTo API docTo spec);

440.        pragma Obsolescent; --  Set_Default_Icon

441.        --  Change the default drag icon. GtkAda retains a reference count for the

442.        --  arguments, and will release them when they are no longer needed.

443.        --  This procedure is deprecated.

445.        --  </doc_ignore>

447.        -------------

448.        -- Signals --

449.        -------------

451.        --  <signals>

452.        --  The following new signals are defined for the class

453.        --  Gtk.Widget.Gtk_Widget to support drag-and-drop.

454.        --  Please note that no default marshaller is provided in GtkAda for these

455.        --  handlers, and that you will have to use the general form of callbacks

456.        --  instead, getting the value of the parameters directly from the

457.        --  Gtk_Args structure.

458.        --

459.        --  - "drag_begin"   (source side)

460.        --    procedure Handler (Widget  : access Gtk_Widget_Record'Class;

461.        --                       Context : Drag_Context);

462.        --

463.        --    A new drag-and-drop operation has just been started from Widget. This

464.        --    callback can be used for instance to modify the visual aspect of the

465.        --    widget, so as to give a visual clue as to what widget is the source.

466.        --

467.        --  - "drag_end"     (source side)

468.        --    procedure Handler (Widget  : access Gtk_Widget_Record'Class;

469.        --                       Context : Drag_Context);

470.        --

471.        --    The drag-and-drop operation that was started from the widget has been

472.        --    completed, and the standard set of the widget can be restored.

473.        --

474.        --  - "drag_data_get"  (source side)

475.        --    procedure Handler (Widget  : access Gtk_Widget_Record'Class;

476.        --                       Context : Drag_Context;

477.        --                       Data    : Selection_Data;

478.        --                       Info    : Guint;

479.        --                       Time    : Guint);

480.        --

481.        --    This should be connected to every drag source.

482.        --    This is used to request the actual data to be transfered to the drop

483.        --    site once the drop has been done.

484.        --    Info is the type of the expected Data, and is in fact the third

485.        --    field of the Target_Entry record, whose value you have define

486.        --    yourself.

487.        --    Data should be modified to include a pointer or a copy of the data,

488.        --    through Selection_Data_Set.

489.        --

490.        --  - "drag_data_delete"  (source side)

491.        --    procedure Handler (Widget  : access Gtk_Widget_Record'Class;

492.        --                       Context : Drag_Context);

493.        --

494.        --    This handler is called whenever the drop site of a drag-and-drop

495.        --    operation has decided that the data should be deleted, or

496.        --    automaticallyif the selected action was Action_Move.

497.        --    Widget is the drag source.

498.        --

499.        --  - "drag_leave"  (target side)

500.        --    procedure Handler (Widget  : access Gtk_Widget_Record'Class;

501.        --                       Context : Drag_Context;

502.        --                       Time    : Guint);

504.        --    Signal emitted whenever a drag-and-drop operation is being performed,

505.        --    and the mouse has just left the area covered by a widget on the

506.        --    screen. This can be used to restore the default visual aspect of the

507.        --    widget. This is also emitted when the drop has been performed on the

508.        --    widget.

509.        --

510.        --  - "drag_motion"  (target side)

511.        --    function Handler (Widget  : access Gtk_Widget_Record'Class;

512.        --                      Context : Drag_Context;

513.        --                      X       : Gint;

514.        --                      Y       : Gint;

515.        --                      Time    : Guint)

516.        --                     return Boolean;

517.        --

518.        --    This is called every time the user is doing a dnd operation, and

519.        --    the mouse is currently over Widget (but not released yet).

520.        --    This can be used to change the visual aspect of Widget to provide

521.        --    visual clues to the user. The "opposite" signal is drag_leave.

522.        --

523.        --    The return value is ignored if Dest_Default_Motion was set when

524.        --    Source_Set was called. This handler should return True if Widget

525.        --    acknowledges that it is a possible drop site for the particular

526.        --    targets provided by the drag source.

527.        --

528.        --  - "drag_drop"  (target side)

529.        --    function Handler (Widget  : access Gtk_Widget_Record'Class;

530.        --                      Context : Drag_Context;

531.        --                      X       : Gint;

532.        --                      Y       : Gint;

533.        --                      Time    : Guint)

534.        --                     return Boolean;

535.        --

536.        --    This is called whenever a drop is about to be performed on the widget.

537.        --    Note that this is called even if no common target type has been found

538.        --    between the drag source and the drop site. Thus, you will need to

539.        --    analyze the result of Get_Targets (Context) to find the possible

540.        --    targets.

541.        --    The data is sent separately through the "drag_data_received" signal,

542.        --    and might not even be available when "drag_drop" is emitted.

543.        --    This signal is mostly used if you have chosen not to use any of the

544.        --    default behavior when calling Dest_Set. Otherwise, everything is

545.        --    already handled directly by GtkAda.

546.        --

547.        --    This handler should return True if Widget acknowledges that it is a

548.        --    possible drop site for the particular targets provided by the drag

549.        --    source.

550.        --

551.        --  - "drag_data_received"  (target_side)

552.        --    procedure Handler (Widget  : access Gtk_Widget_Record'Class;

553.        --                       Context : Drag_Context;

554.        --                       X       : Gint;

555.        --                       Y       : Gint;

556.        --                       Data    : Selection_Data;

557.        --                       Info    : Guint;

558.        --                       Time    : Guint);

559.        --

560.        --    This signal should be connected to every drop site.

561.        --    The handler is called every time some new data has been dropped onto

562.        --    Widget. (X, Y) are the mouse coordinates, relative to the widget's

563.        --    window, where the data was dropped. Info is the type of the data,

564.        --    has set in the third field of the Target_Entry record, and Data

565.        --    contains a pointer to the actual data.

566.        --

567.        --  </signals>

569.     private

570.        Dest_No_DefaultTo API docTo spec        : constant Dest_DefaultsTo API docTo spec := 0;

571.        Dest_Default_MotionTo API docTo spec    : constant Dest_DefaultsTo API docTo spec := 2 ** 0;

572.        Dest_Default_HighlightTo API docTo spec : constant Dest_DefaultsTo API docTo spec := 2 ** 1;

573.        Dest_Default_DropTo API docTo spec      : constant Dest_DefaultsTo API docTo spec := 2 ** 2;

574.        Dest_Default_AllTo API docTo spec       : constant Dest_DefaultsTo API docTo spec := 7;

576.        pragma Import (C, Set_Icon_PixmapTo API docTo spec, "gtk_drag_set_icon_pixmap");

577.        pragma Import (C, Set_Icon_DefaultTo API docTo spec, "gtk_drag_set_icon_default");

578.        pragma Import (C, Set_Default_IconTo API docTo spec, "gtk_drag_set_default_icon");

579.     end Gtk.DndTo API docTo specTo body;