## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

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

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

3.     --                                                                   --

4.     --                Copyright (C) 2006, 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.     --  GTK+ supports Drag-and-Drop in tree views with a high-level and a low-level

31.     --  API.

32.     --

33.     --  The low-level API consists of the GTK+ DND API, augmented by some treeview

34.     --  utility functions: Gtk.Tree_View.Set_Drag_Dest_Row,

35.     --  Gtk.Tree_View.Get_Drag_Dest_Row, Gtk.Tree_View.Get_Dest_Row_At_Pos,

36.     --  Gtk.Tree_View.Create_Row_Drag_Icon, Set_Row_Drag_Data and

37.     --  Get_Row_Drag_Data. This API leaves a lot of flexibility, but

38.     --  nothing is done automatically, and implementing advanced features like

39.     --  hover-to-open-rows or autoscrolling on top of this API is a lot of work.

40.     --

41.     --  On the other hand, if you write to the high-level API, then all the

42.     --  bookkeeping of rows is done for you, as well as things like hover-to-open

43.     --  and auto-scroll, but your models have to implement the Gtk_Tree_Drag_Source

44.     --  and Gtk_Tree_Drag_Dest interfaces.

45.     --  </description>

46.     --  <c_version>2.8.17</c_version>

47.     --  <group>Trees and Lists</group>

49.     with Glib.TypesTo API docTo specTo body;

50.     with Gtk.SelectionTo API docTo specTo body;

51.     with Gtk.Tree_ModelTo API docTo specTo body;

53.     package Gtk.Tree_DndTo API docTo specTo body is

54.        type Gtk_Tree_Drag_Source is new Glib.Types.GType_InterfaceTo API docTo spec;

55.        type Gtk_Tree_Drag_Dest   is new Glib.Types.GType_InterfaceTo API docTo spec;

57.        function Drag_Dest_Get_TypeTo API docTo body   return GTypeTo API docTo spec;

58.        function Drag_Source_Get_TypeTo API docTo body return GTypeTo API docTo spec;

59.        --  Return the low-level types associated with the interfaces

61.        function Drag_Dest_Drag_Data_ReceivedTo API docTo body

62.          (Drag_Dest      : Gtk_Tree_Drag_DestTo API docTo spec;

63.           Dest           : Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec;

64.           Selection_Data : Gtk.Selection.Selection_DataTo API docTo spec)

65.           return Boolean;

66.        --  Asks the Drag_Dest to insert a row before the path Dest,

67.        --  deriving the contents of the row from Selection_Data. If Dest is

68.        --  outside the tree so that inserting before it is impossible, False

69.        --  will be returned. Also, False may be returned if the new row is

70.        --  not created for some model-specific reason.  Should robustly handle

71.        --  a Dest no longer found in the model!

73.        function Drag_Dest_Row_Drop_PossibleTo API docTo body

74.          (Drag_Dest      : Gtk_Tree_Drag_DestTo API docTo spec;

75.           Dest_Path      : Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec;

76.           Selection_Data : Gtk.Selection.Selection_DataTo API docTo spec)

77.           return Boolean;

78.        --  Determines whether a drop is possible before the given Dest_Path,

79.        --  at the same depth as Dest_Path. i.e., can we drop the data in

80.        --  Selection_Data at that location. Dest_Path does not have to

81.        --  exist; the return value will almost certainly be False if the

82.        --  parent of Dest_Path doesn't exist, though.

84.        function Drag_Source_Drag_Data_DeleteTo API docTo body

85.          (Drag_Source : Gtk_Tree_Drag_SourceTo API docTo spec;

86.           Path        : Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec)

87.           return Boolean;

88.        --  Asks the Drag_Source to delete the row at Path, because

89.        --  it was moved somewhere else via drag-and-drop. Returns False

90.        --  if the deletion fails because Path no longer exists, or for

91.        --  some model-specific reason. Should robustly handle a Path no

92.        --  longer found in the model!

94.        function Drag_Source_Drag_Data_GetTo API docTo body

95.          (Drag_Source    : Gtk_Tree_Drag_SourceTo API docTo spec;

96.           Path           : Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec;

97.           Selection_Data : Gtk.Selection.Selection_DataTo API docTo spec)

98.           return Boolean;

99.        --  Asks the Drag_Source to fill in Selection_Data with a

100.        --  representation of the row at Path. Get_Target (Selection_Data) gives

101.        --  the required type of the data.  Should robustly handle a Path no

102.        --  longer found in the model!

104.        function Drag_Source_Row_DraggableTo API docTo body

105.          (Drag_Source : Gtk_Tree_Drag_SourceTo API docTo spec;

106.           Path        : Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec)

107.           return Boolean;

108.        --  Asks the Drag_Source whether a particular row can be used as

109.        --  the source of a DND operation. If the source doesn't implement

110.        --  this interface, the row is assumed draggable.

112.        procedure Get_Row_Drag_DataTo API docTo body

113.          (Selection_Data : Gtk.Selection.Selection_DataTo API docTo spec;

114.           Tree_Model     : out Gtk.Tree_Model.Gtk_Tree_ModelTo API docTo spec;

115.           Path           : out Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec;

116.           Success        : out Boolean);

117.        --  Obtains a Tree_Model and Path from selection data of target type

118.        --  GTK_TREE_MODEL_ROW. Normally called from a drag_data_received handler.

119.        --

120.        --  This function can only be used if Selection_Data originates from the

121.        --  same process that's calling this function, because a pointer to the tree

122.        --  model is being passed around. If you aren't in the same process, then

123.        --  you'll get memory corruption. In the Gtk_Tree_Drag_Dest

124.        --  drag_data_received handler, you can assume that selection data of type

125.        --  GTK_TREE_MODEL_ROW is in from the current process.

126.        --

127.        --  The returned path must be freed with

129.        function Set_Row_Drag_DataTo API docTo body

130.          (Selection_Data : Gtk.Selection.Selection_DataTo API docTo spec;

131.           Tree_Model     : access Gtk.Tree_Model.Gtk_Tree_Model_RecordTo API docTo specTo body'Class;

132.           Path           : Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec)

133.           return Boolean;

134.        --  Sets selection data of target type GTK_TREE_MODEL_ROW. Normally used

135.        --  in a drag_data_get handler.

137.     private

138.        pragma Import (C, Drag_Dest_Get_TypeTo API docTo spec, "gtk_tree_drag_dest_get_type");

139.        pragma Import (C, Drag_Source_Get_TypeTo API docTo spec, "gtk_tree_drag_source_get_type");

141.     end Gtk.Tree_DndTo API docTo specTo body;