## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

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

2.     --          GtkAda - Ada95 binding for the Gimp Toolkit              --

3.     --                                                                   --

4.     --                     Copyright (C) 2008-2009, 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.     with Glib.ValuesTo API docTo specTo body;

30.     with Gtk.Tree_ModelTo API docTo specTo body;

32.     package Gtkada.Abstract_Tree_ModelTo API docTo specTo body is

34.        type Gtk_Abstract_Tree_Model_RecordTo API docTo body is

35.           abstract new Gtk.Tree_Model.Gtk_Tree_Model_RecordTo API docTo specTo body with private;

37.        type Gtk_Abstract_Tree_Model is

38.           access all Gtk_Abstract_Tree_Model_RecordTo API docTo specTo body'Class;

40.        procedure InitializeTo API docTo body (Self : access Gtk_Abstract_Tree_Model_RecordTo API docTo specTo body'Class);

42.        ------------------------------

43.        -- Interface implementation --

44.        ------------------------------

46.        --  The following subprograms can be overridden to implement the custom

47.        --  tree model.

48.        --  Note that they are called from C (wrapped through calls to the

49.        --  Dispatch_* functions defined in the body of this package) so it is

50.        --  advised to add exception handlers in these subprograms, just like in

51.        --  regular GtkAda callbacks.

53.        function Get_FlagsTo API docTo body

54.          (Self : access Gtk_Abstract_Tree_Model_RecordTo API docTo specTo body)

55.           return Gtk.Tree_Model.Tree_Model_FlagsTo API docTo spec;

56.        --  Override this to return a set of flags supported by this interface.

57.        --  The flags supported should not change during the lifecycle of the

58.        --  tree_model.

60.        function Get_N_Columns

61.          (Self : access Gtk_Abstract_Tree_Model_RecordTo API docTo specTo body)

62.           return Glib.GintTo API docTo spec is abstract;

63.        --  Override this to return the number of columns supported by Tree_Model.

65.        function Get_Column_Type

66.          (Self  : access Gtk_Abstract_Tree_Model_RecordTo API docTo specTo body;

67.           Index : Glib.GintTo API docTo spec) return Glib.GTypeTo API docTo spec is abstract;

68.        --  Override this to return the type of the Index-th column in the model.

70.        function Get_Iter

71.          (Self : access Gtk_Abstract_Tree_Model_RecordTo API docTo specTo body;

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

73.           return Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body is abstract;

74.        --  Override this return an iterator pointing to Path.

75.        --  Null_Iter is returned if Path was invalid or no iterator could be set.

77.        function Get_Path

78.          (Self : access Gtk_Abstract_Tree_Model_RecordTo API docTo specTo body;

79.           Iter : Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body)

80.           return Gtk.Tree_Model.Gtk_Tree_PathTo API docTo spec is abstract;

81.        --  Override this to return a newly created Gtk_Tree_Path referenced by

82.        --  Iter. This path will be freed with Path_Free by the caller.

84.        procedure Get_Value

85.          (Self   : access Gtk_Abstract_Tree_Model_RecordTo API docTo specTo body;

86.           Iter   : Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body;

87.           Column : Glib.GintTo API docTo spec;

88.           Value  : out Glib.Values.GValueTo API docTo specTo body) is abstract;

89.        --  Override this get a value from the model, at column Column and line

90.        --  Iter. Value must be freed by the caller.

92.        procedure Next

93.          (Self : access Gtk_Abstract_Tree_Model_RecordTo API docTo specTo body;

94.           Iter : in out Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body) is abstract;

95.        --  Override this to set Iter to point to the node following it at the

96.        --  current level. If there is none, Iter is set to Null_Iter.

98.        function Children

99.          (Self   : access Gtk_Abstract_Tree_Model_RecordTo API docTo specTo body;

100.           Parent : Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body)

101.           return Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body is abstract;

102.        --  Override this to return the first child of Parent. If Parent has no

103.        --  children, return Null_Iter. Parent will remain a valid node after this

104.        --  function has been called.

106.        function Has_Child

107.          (Self : access Gtk_Abstract_Tree_Model_RecordTo API docTo specTo body;

108.           Iter : Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body) return Boolean is abstract;

109.        --  Override this to return True if Iter has children, False otherwise.

111.        function N_Children

112.          (Self : access Gtk_Abstract_Tree_Model_RecordTo API docTo specTo body;

113.           Iter : Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body := Gtk.Tree_Model.Null_IterTo API docTo specTo body)

114.           return Glib.GintTo API docTo spec is abstract;

115.        --  Override this to return the number of children that Iter has.

116.        --  As a special case, if Iter is Null_Iter, then the number of toplevel

117.        --  nodes is returned.

119.        function Nth_Child

120.          (Self   : access Gtk_Abstract_Tree_Model_RecordTo API docTo specTo body;

121.           Parent : Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body;

122.           N      : Glib.GintTo API docTo spec) return Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body is abstract;

123.        --  Override this to return the child of Parent, using the given index.

124.        --  The First index is 0. If Index is too big, or Parent has no children,

125.        --  return Null_Iter. If Parent is Null_Iter, then the nth root node is set.

127.        function Parent

128.          (Self  : access Gtk_Abstract_Tree_Model_RecordTo API docTo specTo body;

129.           Child : Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body)

130.           return Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body is abstract;

131.        --  Override this to return the parent of Child. If Child is at the

132.        --  toplevel, and doesn't have a parent, then Null_Iter is returned.

134.        procedure Ref_NodeTo API docTo body

135.          (Self : access Gtk_Abstract_Tree_Model_RecordTo API docTo specTo body;

136.           IterTo API docTo body : Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body);

137.        --  Let the tree reference the node.

138.        --  This is an optional method for models to implement.

139.        --  To be more specific, models may ignore this call as it exists primarily

140.        --  for performance reasons. This function is primarily meant as a way for

141.        --  views to let caching model know when nodes are being displayed (and

142.        --  hence, whether or not to cache that node). For example, a file-system

143.        --  based model would not want to keep the entire file-hierarchy in memory,

144.        --  just the sections that are currently being displayed by every current

145.        --  view.

146.        --  Technically, the idea is to increase the refcount for the node itself,

147.        --  not for any data associated with it (should you want to associate a

148.        --  reference counted type with the rows). Most of the time you will not

149.        --  need to do anything here.

150.        --  Every time the view makes a row visible (for instance when you expand

151.        --  a node), it calls Ref_Node for that row. When the row is hidden again,

152.        --  it calls Unref_Node.

154.        procedure Unref_NodeTo API docTo body

155.          (Self : access Gtk_Abstract_Tree_Model_RecordTo API docTo specTo body;

156.           IterTo API docTo body : Gtk.Tree_Model.Gtk_Tree_IterTo API docTo specTo body);

157.        --  Let the tree unref the node.

158.        --  This is an optional method for models to implement. To be more specific,

159.        --  models may ignore this call as it exists primarily for performance

160.        --  reasons. For more information on what this means, please see

161.        --  Tree_Model_Ref_Node. Please note that nodes that are deleted are not

162.        --  unreferenced.

163.        --  Technically, your model is the one deleting a row (and it should do so

164.        --  only if the refcount for the row is not 1, see Ref_Node). Thus gtk+

165.        --  avoids a potential callback to your application by not emitting

166.        --  Unref_Node in such a case.

168.     private

170.        type Gtk_Abstract_Tree_Model_RecordTo API docTo spec is

171.           abstract new Gtk.Tree_Model.Gtk_Tree_Model_RecordTo API docTo specTo body with null record;

173.     end Gtkada.Abstract_Tree_ModelTo API docTo specTo body;