## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

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

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

3.     --                                                                   --

4.     --                 Copyright (C) 2000-2011, 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.     --  This package implements support for the selection mechanism (ie a way to

31.     --  get a currently active selection anywhere on your Xserver or on your

32.     --  Windows machine).

33.     --

34.     --  This also acts as the low-level support for drag-and-drop, as described

35.     --  in Gtk.Dnd.

36.     --

37.     --  A lot of subprograms in this package work on Gdk_Atom types, instead of

38.     --  strings. Converting from one to the other can easily be done through

39.     --  calls to the subprograms in Gdk.Property (Atom_Intern and Atom_Name).

40.     --  The reason we use Gdk_Atom is for efficiency, since comparing two integers

41.     --  is of course faster than comparing two strings.

42.     --

43.     --  The selection mechanism is the primary mechanism by which applications

44.     --  can transfer data to each other on a given system. Even though both

45.     --  applications must be visible on the same screen, this does not mean that

46.     --  they can access the same files or ressources, since they might in fact

47.     --  be running on different machines. You should always keep this in mind

48.     --  when setting the data to be transfered.

50.     --  A selection is a essentially a named clipboard, identified by a string

51.     --  interned as a Gdk_Atom. By claiming ownership of a selection, an

52.     --  application indicates that it will be responsible for supplying its

53.     --  contents.

55.     --  The contents of a selection can be represented in a number of formats,

56.     --  called targets. Each target is identified by an atom. A list of all

57.     --  possible targets supported by the selection owner can be retrieved by

58.     --  requesting the special target TARGETS. When a selection is retrieved, the

59.     --  data is accompanied by a type (an atom), and a format (an integer,

60.     --  representing the number of bits per item).

61.     --

62.     --  See also http://standards.freedesktop.org/clipboards-spec/ for

63.     --  more information on the way selection works on X-Window systems.

64.     --

65.     --  </description>

66.     --  <c_version>2.8.17</c_version>

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

68.     --  <testgtk>create_selection.adb</testgtk>

70.     with Gdk.TypesTo API docTo spec;

71.     with Gdk.PixbufTo API docTo specTo body;

72.     with Gtk.WidgetTo API docTo specTo body;

73.     with Gtkada.TypesTo API docTo specTo body;

74.     with GNAT.Strings;

76.     package Gtk.SelectionTo API docTo specTo body is

78.        type Selection_Data is new Gdk.C_ProxyTo API docTo spec;

79.        --  Contents of a selection or a drag-and-drop operation.

80.        --  This structure can only be created internally by GtkAda. However, you

81.        --  need to be able to access it to get the selection.

82.        --   - Selection and Target identify the request.

83.        --   - Type specifies the type of the return.

84.        --   - if Length is negative, the Data should be ignored. Otherwise, it

85.        --     contains the data itself.

86.        --   - Time gives the timestamp at which the data was sent.

88.        ---------------

89.        -- Selection --

90.        ---------------

92.        subtype Gdk_Selection is Gdk.Types.Gdk_AtomTo API docTo spec;

93.        --  These are predefined atom values for several common selections.

94.        --  You are of course free to create new ones, but most of the time you

95.        --  should simply use Selection_Primary unless you foresee the need for

96.        --  multiple simultaneous selections.

97.        --  To access the clipboard on windows machines, you might need to create

98.        --  a new selection with Gdk.Property.Atom_Intern ("CLIPBOARD");

100.        Selection_Primary   : constant Gdk_SelectionTo API docTo spec;

101.        Selection_Secondary : constant Gdk_SelectionTo API docTo spec;

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

104.        -- Selection_Type --

105.        --------------------

107.        subtype Gdk_Selection_Type is Gdk.Types.Gdk_AtomTo API docTo spec;

108.        --  Predefined atom values for selection types.

109.        --  Although the preferred way in GtkAda to indicate the type of a selection

110.        --  is to use mime types, these values are provided for compatibility with

111.        --  older X11 applications.

113.        Selection_Type_Atom     : constant Gdk_Selection_TypeTo API docTo spec;

114.        --  A Gdk_Atom (format=32 bits)

116.        Selection_Type_Bitmap   : constant Gdk_Selection_TypeTo API docTo spec;

117.        --  A Gdk_Bitmap Id (format=32 bits)

119.        Selection_Type_Colormap : constant Gdk_Selection_TypeTo API docTo spec;

120.        --  A colormap Id (format=32 bits)

122.        Selection_Type_Drawable : constant Gdk_Selection_TypeTo API docTo spec;

123.        --  A drawable Id (format=32 bits), ie the result of Gdk.Window.Get_Window.

125.        Selection_Type_Integer  : constant Gdk_Selection_TypeTo API docTo spec;

126.        --  An integer (format=32 bits)

128.        Selection_Type_Pixmap   : constant Gdk_Selection_TypeTo API docTo spec;

129.        --  A Gdk_Pixmap ID (format=32 bits)

131.        Selection_Type_Window   : constant Gdk_Selection_TypeTo API docTo spec;

132.        --  A Gdk_Window ID (format=32 bits)

134.        Selection_Type_String   : constant Gdk_Selection_TypeTo API docTo spec;

135.        --  A string encoded in Iso-latin1 format (format=8 bits per character)

137.        ----------------

138.        -- Gdk_Target --

139.        ----------------

141.        subtype Gdk_Target is Gdk.Types.Gdk_AtomTo API docTo spec;

142.        --  Predefined atom values which are used to describe possible targets for

143.        --  a selection. Other atoms can be used, and the recommended practice for

144.        --  GtkAda is to to use mime types for this purpose. However, supporting

145.        --  these types may be useful for compatibility with older programs.

147.        Target_Bitmap   : constant Gdk_TargetTo API docTo spec;

148.        Target_Colormap : constant Gdk_TargetTo API docTo spec;

149.        Target_Drawable : constant Gdk_TargetTo API docTo spec;

150.        Target_Pixmap   : constant Gdk_TargetTo API docTo spec;

151.        Target_String   : constant Gdk_TargetTo API docTo spec;

153.        ------------------

154.        -- Target_Flags --

155.        ------------------

157.        type Target_Flags is new Integer;

158.        --  Used to specify constraints on an entry

160.        Target_No_Constraint : constant Target_FlagsTo API docTo spec;

161.        --  No constraint is specified.

163.        Target_Same_App      : constant Target_FlagsTo API docTo spec;

164.        --  If this is set, the target will only be selected for drags within a

165.        --  single application.

167.        Target_Same_Widget   : constant Target_FlagsTo API docTo spec;

168.        --  If this is set, the target will only be selected for drags within a

169.        --  single widget.

171.        ------------------

172.        -- Target_Entry --

173.        ------------------

175.        type Target_Entry is record

176.           Target : Gtkada.Types.Chars_PtrTo API docTo spec;

177.           Flags  : Target_FlagsTo API docTo spec;

178.           Info   : GuintTo API docTo spec;

179.        end record;

180.        --  A single type of data that can be supplied or received during a

181.        --  drag-and-drop or a selection.

182.        --

183.        --  Target is a string that represents the drag type. This can be any

184.        --  string if you want to implement drag-and-drop inside your application.

185.        --  However, if you want to communicate with other external application,

186.        --  you should use MIME types, ie "text/plain", "text/uri-list", ...

187.        --  See the RFCs 2045, 2046, 2047, 2048, 2049 for more information on

188.        --  MIME types.

189.        --

190.        --  For more information, see

191.        --  ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/

192.        --

193.        --  Another set of supported names are the ones associated with the X

194.        --  Inter-Client Communications Conventions Manual (ICCCM).

195.        --  Here some of the default names and their meaning. See the ICCCM manual

196.        --  online for a complete list (for instance at

197.        --  http://www.tronche.com/gui/x/icccm/).

198.        --

199.        --   - "TIMESTAMP"   (type Integer)  Timestamp used to acquire the selection

200.        --   - "TEXT"        (type Text)     Text in owner's encoding

201.        --   - "STRING"      (type String)   Iso Latin1 text

202.        --   - "PIXMAP"      (type Drawable) Pixmap Id

203.        --   - "BITMAP"      (type Bitmap)   Bitmap Id

204.        --   - "FOREGROUND"  (type Pixel)    Pixel Value

205.        --   - "BACKGROUND"  (type Pixel)    Pixel Value

206.        --

207.        --  Info is an application-assigned integer (i.e. that you choose), that

208.        --  will be passed as a signal parameter for all the dnd-related signals,

209.        --  like "selection_get". This saves a lot of expensive string compares,

210.        --  and in fact replaced Target everywhere in your application expect in

211.        --  Source_Set and Dest_Set.

213.        type Target_Entry_Array is array (Natural range <>) of Target_EntryTo API docTo spec;

215.        Any_Target_Entry : Target_Entry_ArrayTo API docTo spec (1 .. 0);

216.        --  To be used for drop sites that accept any kind of data.

218.        -----------------

219.        -- Target_List --

220.        -----------------

222.        type Target_List is new Gdk.C_ProxyTo API docTo spec;

223.        --  A list of targets.

224.        --  You can only manipulate this list through the functions below.

226.        function Target_List_NewTo API docTo body (Targets : Target_Entry_ArrayTo API docTo spec) return Target_ListTo API docTo spec;

227.        --  Create a new list of target, starting from an array.

229.        procedure Target_List_RefTo API docTo body (List : Target_ListTo API docTo spec);

230.        --  Increment the reference count for the list.

231.        --  You should almost never have to use this function, this is done

232.        --  transparently by GtkAda.

234.        procedure Target_List_UnrefTo API docTo body (List : Target_ListTo API docTo spec);

235.        --  Decrement the reference count for the list.

236.        --  You should almost never have to use this function, since everything is

237.        --  done transparently by GtkAda.

238.        --  As usual, the list is freed when the reference count reaches 0.

240.        procedure Target_List_AddTo API docTo body

241.          (List   : Target_ListTo API docTo spec;

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

243.           Flags  : GuintTo API docTo spec;

244.           Info   : GuintTo API docTo spec);

245.        --  Add a new target to the list.

246.        --  You can for instance use the result of Get_Targets (Drag_Context) for

247.        --  the value of Target.

249.        procedure Target_List_Add_TableTo API docTo body

250.          (List    : Target_ListTo API docTo spec;

251.           Targets : Target_Entry_ArrayTo API docTo spec);

252.        --  Add a new set of targets to the list.

254.        procedure Target_List_Add_Text_TargetsTo API docTo body

255.          (List      : Target_ListTo API docTo spec;

256.           Info      : GuintTo API docTo spec);

257.        --  Appends the text targets supported internally by gtk+ to List.

258.        --  All targets are added with the same info.

259.        --  Info will be passed back to the application.

261.        procedure Target_List_Add_URI_TargetsTo API docTo body

262.          (List      : Target_ListTo API docTo spec;

263.           Info      : GuintTo API docTo spec);

264.        --  Appends the URI targets supported internally by gtk+ to List.

265.        --  All targets are added with the same info.

267.        procedure Target_List_Add_Image_TargetsTo API docTo body

268.          (List      : Target_ListTo API docTo spec;

269.           Info      : GuintTo API docTo spec;

270.           Writable  : Boolean);

271.        --  Appends the image targets supported internally by gtk+ to List.

272.        --  All targets are added with the same info.

273.        --  If Writable is True, then only those targets for which gtk+ knows how to

274.        --  convert a Gdk_Pixbuf into the format are added.

276.        procedure Target_List_RemoveTo API docTo body

277.          (List   : Target_ListTo API docTo spec;

278.           Target : Gdk.Types.Gdk_AtomTo API docTo spec);

279.        --  Remove a specific target from the list.

281.        procedure Target_List_FindTo API docTo body

282.          (List   : Target_ListTo API docTo spec;

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

284.           Info   : out GuintTo API docTo spec;

285.           Found  : out Boolean);

286.        --  Search for a specific target in the list.

287.        --  If the target was found, Found is set to True and Info contains the

288.        --  integer that was associated with the target when it was created.

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

291.        -- Selection_Data --

292.        --------------------

294.        function Selection_Get_TypeTo API docTo body return Glib.GTypeTo API docTo spec;

295.        --  Return the internal type used for a selection

297.        function Get_SelectionTo API docTo body (Selection : Selection_DataTo API docTo spec) return Gdk_SelectionTo API docTo spec;

298.        --  Return the selection used (primary, clipboard, ...)

300.        function Get_TargetTo API docTo body (Selection : Selection_DataTo API docTo spec) return Gdk.Types.Gdk_AtomTo API docTo spec;

301.        --  Return the target of the selection (ie a MIME string that identifies

302.        --  the selection).

304.        function Get_TypeTo API docTo body (Selection : Selection_DataTo API docTo spec) return Gdk.Types.Gdk_AtomTo API docTo spec;

305.        --  Return the type of the selection, as defined in Gdk_Selection_Type,

306.        --  ie for compatibility with older X11 applications.

308.        function Get_FormatTo API docTo body (Selection : Selection_DataTo API docTo spec) return GintTo API docTo spec;

309.        --  Return the format of the data.

310.        --  The semantics depends on the type of data. For instance, for strings

311.        --  this is the number of bits per character.

313.        function Get_DataTo API docTo body (Selection : Selection_DataTo API docTo spec) return System.Address;

314.        --  Return the data of the selection.

315.        --  This should be ignored if Get_Length returns a value < 0.

317.        function Get_Data_As_StringTo API docTo body (Selection : Selection_DataTo API docTo spec) return String;

318.        --  Return the data as a string.

319.        --  This is only a convenience function, since it simply creates a string

320.        --  from the return of Get_Data.

322.        function Get_LengthTo API docTo body (Selection : Selection_DataTo API docTo spec) return GintTo API docTo spec;

323.        --  Return the length of the data.

325.        ----------------------------------

326.        -- Setting and getting contents --

327.        ----------------------------------

329.        function Set_PixbufTo API docTo body

330.          (Selection : Selection_DataTo API docTo spec;

331.           Pixbuf    : Gdk.Pixbuf.Gdk_PixbufTo API docTo spec) return Boolean;

332.        --  Sets the contents of the selection from a pixbuf

333.        --  The pixbuf is converted to the form determined by

334.        --  Get_Target (Selection_Data).

335.        --  Returns True if the selection was successfully set.

337.        function Get_PixbufTo API docTo body

338.          (Selection : Selection_DataTo API docTo spec) return Gdk.Pixbuf.Gdk_PixbufTo API docTo spec;

339.        --  Gets the contents of the selection data as a pixbuf.

340.        --  Return value: if the selection data contained a recognized

341.        --  image type and it could be converted to a pixbuf, a

342.        --  newly allocated pixbuf is returned, otherwise null.

343.        --  If the result is non-null it must be freed with Unref.

345.        function Targets_Include_ImageTo API docTo body

346.          (Selection : Selection_DataTo API docTo spec; Writable : Boolean := True) return Boolean;

347.        --  Given a Selection object holding a list of targets, determines if any of

348.        --  the targets in these targets can be used to provide a Gdk.Pixbuf.

349.        --  Writable: whether to accept only targets for which gtk+ knows how to

350.        --  convert a pixbuf into the format.

351.        --  Returns True if Selection holds a list of targets and a suitable

352.        --  target for images is included

354.        function Set_TextTo API docTo body

355.          (Selection : Selection_DataTo API docTo spec;

356.           Str       : UTF8_StringTo API docTo spec) return Boolean;

357.        --  Sets the contents of the selection from a UTF-8 encoded string.

358.        --  The string is converted to the form determined by

359.        --  Get_Target (Selection_Data).

361.        function Get_TextTo API docTo body (Selection : Selection_DataTo API docTo spec) return UTF8_StringTo API docTo spec;

362.        --  Gets the contents of the selection data as a UTF-8 string.

363.        --  Return value: if the selection data contained a recognized

364.        --  text type and it could be converted to UTF-8, the string is returned.

366.        function Targets_Include_TextTo API docTo body (Selection : Selection_DataTo API docTo spec) return Boolean;

367.        --  Given a Selection object holding a list of targets, determines if any of

368.        --  the targets can be used to provide text.

370.        function Set_UrisTo API docTo body

371.          (Selection : Selection_DataTo API docTo spec;

372.           URIs      : GNAT.Strings.String_List)

373.           return Boolean;

374.        --  Sets the contents of the selection from a list of URIs.

375.        --  The string is converted to the form determined by

376.        --  Get_Target (Selection).

377.        --  Return True if the selection was successfully set.

379.        function Get_UrisTo API docTo body

380.          (Selection : Selection_DataTo API docTo spec)

381.           return GNAT.Strings.String_List;

382.        --  Gets the contents of the selection data as array of URIs.

383.        --  The returned value must be freed by the caller.

385.        function Get_TargetsTo API docTo body

386.          (Selection : Selection_DataTo API docTo spec) return Gdk.Types.Gdk_Atom_ArrayTo API docTo spec;

387.        --  Gets the contents of Selection_Data as an array of targets.

388.        --  This can be used to interpret the results of getting

389.        --  the standard TARGETS target that is always supplied for

390.        --  any selection.

391.        --  This is different from Get_Target, which indicate the current format

392.        --  that the selection contains. Get_Targets only applies when Get_Target

393.        --  is "TARGETS".

395.        procedure Selection_Data_SetTo API docTo body

396.          (Selection : Selection_DataTo API docTo spec;

397.           The_Type  : Gdk.Types.Gdk_AtomTo API docTo spec;

398.           Format    : GintTo API docTo spec;

399.           Data      : System.Address;

400.           Length    : GintTo API docTo spec);

401.        --  General form of Selection_Data_Set.

402.        --  Any data can be transmitted. Length is the number of bytes in Data.

404.        pragma Import (C, Selection_Data_SetTo API docTo spec, "gtk_selection_data_set");

406.        procedure Selection_Data_SetTo API docTo body

407.          (Selection : Selection_DataTo API docTo spec;

408.           The_Type  : Gdk.Types.Gdk_AtomTo API docTo spec;

409.           Format    : GintTo API docTo spec;

410.           Data      : String);

411.        --  Set the data for a selection (special case for strings)

412.        --  This function is generally called when a drag-and-drop operation

413.        --  ask the source widget for the data to be transmitted. In that case,

414.        --  a Selection_Data was already transmitted and is given as a handler

415.        --  parameter for the signal "drag_data_get". The_Type can simply be

416.        --  extracted from the Selection_Data.

418.        function Selection_Data_CopyTo API docTo body

419.          (Selection : Selection_DataTo API docTo spec) return Selection_DataTo API docTo spec;

420.        --  Make a copy of a selection data.

422.        procedure Selection_Data_FreeTo API docTo body (Selection : Selection_DataTo API docTo spec);

423.        --  Free a Selection_Data structure returned from Selection_Data_Copy.

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

426.        -- Manipulating the selection --

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

429.        function Owner_SetTo API docTo body

430.          (Widget    : Gtk.Widget.Gtk_WidgetTo API docTo spec;

431.           Selection : Gdk_SelectionTo API docTo spec := Selection_PrimaryTo API docTo spec;

432.           Time      : Guint32To API docTo spec := 0) return Boolean;

433.        --  Claim ownership of a given selection for a particular widget,

434.        --  or, if widget is null, release ownership of the selection.

435.        --

436.        --  Once a Widget has claimed selection, it is responsible for delivering

437.        --  the data whenever it is needed.

438.        --

439.        --  Time is the timestamp for claiming the selection (default is the current

440.        --  time).

441.        --  This function returns True if the operation succeeded.

443.        procedure Add_TargetTo API docTo body

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

445.           Selection : Gdk_SelectionTo API docTo spec;

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

447.           Info      : GuintTo API docTo spec);

448.        --  Add specified target to the list of supported targets for a given

449.        --  widget and selection.

450.        --  Info is an integer which will be passed back to the application instead

451.        --  of a string when the target is used.

453.        procedure Add_TargetsTo API docTo body

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

455.           Selection : Gdk_SelectionTo API docTo spec;

456.           Targets   : Target_Entry_ArrayTo API docTo spec);

457.        --  Add a set of targets to the list of supported targets for a given widget

458.        --  and selection.

460.        procedure Clear_TargetsTo API docTo body

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

462.           Selection : Gdk_SelectionTo API docTo spec);

463.        --  Clear the list of supported targets for a given widget and selection.

465.        function ConvertTo API docTo body

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

467.           Selection : Gdk_SelectionTo API docTo spec := Selection_PrimaryTo API docTo spec;

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

469.           Time      : Guint32To API docTo spec := 0) return Boolean;

470.        --  Request the contents of a selection.

471.        --  When received, a "selection_received" signal will be generated, and the

472.        --  widget needs to have a handler for it.

473.        --

474.        --  Target is the form of information desired, for instance an intern

475.        --  Gdk_Atom whose name is "text/plain", or one of the Gdk_Target values.

476.        --

477.        --  This function returns True if the request succeeded, False if the

478.        --  request could not be processed, for instance if there was already a

479.        --  request in process for this widget or this target is not known by the

480.        --  owner of the selection.

481.        --

482.        --  Widget is the widget which acts as a requestor.

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

485.        --  Remove all handlers and unsets ownership of all selections for a widget.

486.        --  Called when widget is being destroyed. This function will not generally

487.        --  be called by applications.

489.        -------------

490.        -- Signals --

491.        -------------

493.        --  <signals>

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

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

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

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

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

499.        --  Gtk_Args structure.

500.        --

501.        --  - "selection_get"  (source side)

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

503.        --                       Data   : Selection_Data;

504.        --                       Info   : Guint;

505.        --                       Time   : Guint);

506.        --

507.        --    This signal is sent to the owner of a selection whenever some other

508.        --    widget wants to get data from that selection. The type of the data

509.        --    is indicated in Info, and is the third field that was set in the

510.        --    Target_Entrys for that specific widget and selection.

511.        --

512.        --    The handler should modify the Data in the selection.

513.        --

514.        --  - "selection_received"  (client side)

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

516.        --                       Data   : Selection_Data;

517.        --                       Time   : Guint);

518.        --

519.        --    This signal is sent to the receiver end of a selection, when the data

520.        --    has been sent by the owner. The receiver should call Convert, which

521.        --    will emit the signal selection_get to ask for the contents of the

522.        --    selection, and then selection_received will be emitted to warn the

523.        --    receiver.

524.        --

525.        --    Note: you can not connect this signal to a widget that does not have

526.        --    an associated Gdk_Window (i.e the flag Gtk.Widget.No_Window must not

527.        --    be set for this widget), since it needs to be able to receive

528.        --    Property_Notify events from the server. It will not work with a

529.        --    Gtk_Label for instance.

530.        --

531.        --  </signals>

533.     private

535.        pragma Import (C, Target_List_RefTo API docTo spec, "gtk_target_list_ref");

536.        pragma Import (C, Target_List_UnrefTo API docTo spec, "gtk_target_list_unref");

537.        pragma Import (C, Target_List_AddTo API docTo spec, "gtk_target_list_add");

538.        pragma Import (C, Target_List_RemoveTo API docTo spec, "gtk_target_list_remove");

540.        pragma Import (C, Get_SelectionTo API docTo spec, "gtk_selection_data_get_selection");

541.        pragma Import (C, Get_TargetTo API docTo spec,    "gtk_selection_data_get_target");

542.        pragma Import (C, Get_TypeTo API docTo spec,      "gtk_selection_data_get_data_type");

543.        pragma Import (C, Get_FormatTo API docTo spec,    "gtk_selection_data_get_format");

544.        pragma Import (C, Get_DataTo API docTo spec,      "gtk_selection_data_get_data");

545.        pragma Import (C, Get_LengthTo API docTo spec,    "gtk_selection_data_get_length");

547.        pragma Import (C, Selection_Data_CopyTo API docTo spec, "gtk_selection_data_copy");

548.        pragma Import (C, Selection_Data_FreeTo API docTo spec, "gtk_selection_data_free");

549.        pragma Import (C, Selection_Get_TypeTo API docTo spec, "gtk_selection_data_get_type");

550.        pragma Import (C, Target_List_Add_Text_TargetsTo API docTo spec,

551.                       "gtk_target_list_add_text_targets");

552.        pragma Import (C, Target_List_Add_URI_TargetsTo API docTo spec,

553.                       "gtk_target_list_add_uri_targets");

555.        function Make_Atom (Num : GulongTo API docTo spec) return Gdk.Types.Gdk_AtomTo API docTo spec;

556.        pragma Import (C, Make_Atom, "ada_make_atom");

558.        Selection_PrimaryTo API docTo spec   : constant Gdk_SelectionTo API docTo spec := Make_Atom (1);

559.        Selection_SecondaryTo API docTo spec : constant Gdk_SelectionTo API docTo spec := Make_Atom (2);

561.        Selection_Type_AtomTo API docTo spec     : constant Gdk_Selection_TypeTo API docTo spec := Make_Atom (4);

562.        Selection_Type_BitmapTo API docTo spec   : constant Gdk_Selection_TypeTo API docTo spec := Make_Atom (5);

563.        Selection_Type_ColormapTo API docTo spec : constant Gdk_Selection_TypeTo API docTo spec := Make_Atom (7);

564.        Selection_Type_DrawableTo API docTo spec : constant Gdk_Selection_TypeTo API docTo spec := Make_Atom (17);

565.        Selection_Type_IntegerTo API docTo spec  : constant Gdk_Selection_TypeTo API docTo spec := Make_Atom (19);

566.        Selection_Type_PixmapTo API docTo spec   : constant Gdk_Selection_TypeTo API docTo spec := Make_Atom (20);

567.        Selection_Type_WindowTo API docTo spec   : constant Gdk_Selection_TypeTo API docTo spec := Make_Atom (33);

568.        Selection_Type_StringTo API docTo spec   : constant Gdk_Selection_TypeTo API docTo spec := Make_Atom (31);

570.        Target_No_ConstraintTo API docTo spec : constant Target_FlagsTo API docTo spec := 0;

571.        Target_Same_AppTo API docTo spec      : constant Target_FlagsTo API docTo spec := 1;

572.        Target_Same_WidgetTo API docTo spec   : constant Target_FlagsTo API docTo spec := 2;

574.        Target_BitmapTo API docTo spec   : constant Gdk_TargetTo API docTo spec := Make_Atom (5);

575.        Target_ColormapTo API docTo spec : constant Gdk_TargetTo API docTo spec := Make_Atom (7);

576.        Target_DrawableTo API docTo spec : constant Gdk_TargetTo API docTo spec := Make_Atom (17);

577.        Target_PixmapTo API docTo spec   : constant Gdk_TargetTo API docTo spec := Make_Atom (20);

578.        Target_StringTo API docTo spec   : constant Gdk_TargetTo API docTo spec := Make_Atom (31);

579.     end Gtk.SelectionTo API docTo specTo body;

581.     --  This function is indicated as obsolescent by gtk+ developers:

582.     --  No binding: gtk_selection_clear

584.     --  No binding: gtk_selection_owner_set_for_display