1. ------------------------------------------------------------------------------ 
  2. --                                                                          -- 
  3. --      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       -- 
  4. --                     Copyright (C) 2000-2014, AdaCore                     -- 
  5. --                                                                          -- 
  6. -- This library is free software;  you can redistribute it and/or modify it -- 
  7. -- under terms of the  GNU General Public License  as published by the Free -- 
  8. -- Software  Foundation;  either version 3,  or (at your  option) any later -- 
  9. -- version. This library is distributed in the hope that it will be useful, -- 
  10. -- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- -- 
  11. -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            -- 
  12. --                                                                          -- 
  13. -- As a special exception under Section 7 of GPL version 3, you are granted -- 
  14. -- additional permissions described in the GCC Runtime Library Exception,   -- 
  15. -- version 3.1, as published by the Free Software Foundation.               -- 
  16. --                                                                          -- 
  17. -- You should have received a copy of the GNU General Public License and    -- 
  18. -- a copy of the GCC Runtime Library Exception along with this program;     -- 
  19. -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    -- 
  20. -- <http://www.gnu.org/licenses/>.                                          -- 
  21. --                                                                          -- 
  22. ------------------------------------------------------------------------------ 
  23.  
  24. --  <description> 
  25. --  The Gtk.Tree_Model.Gtk_Tree_Model interface defines a generic tree 
  26. --  interface for use by the Gtk.Tree_View.Gtk_Tree_View widget. It is an 
  27. --  abstract interface, and is designed to be usable with any appropriate data 
  28. --  structure. The programmer just has to implement this interface on their own 
  29. --  data type for it to be viewable by a Gtk.Tree_View.Gtk_Tree_View widget. 
  30. -- 
  31. --  The model is represented as a hierarchical tree of strongly-typed, 
  32. --  columned data. In other words, the model can be seen as a tree where every 
  33. --  node has different values depending on which column is being queried. The 
  34. --  type of data found in a column is determined by using the GType system (ie. 
  35. --  G_TYPE_INT, GTK_TYPE_BUTTON, G_TYPE_POINTER, etc). The types are 
  36. --  homogeneous per column across all nodes. It is important to note that this 
  37. --  interface only provides a way of examining a model and observing changes. 
  38. --  The implementation of each individual model decides how and if changes are 
  39. --  made. 
  40. -- 
  41. --  In order to make life simpler for programmers who do not need to write 
  42. --  their own specialized model, two generic models are provided &mdash; the 
  43. --  Gtk.Tree_Store.Gtk_Tree_Store and the Gtk.List_Store.Gtk_List_Store. To use 
  44. --  these, the developer simply pushes data into these models as necessary. 
  45. --  These models provide the data structure as well as all appropriate tree 
  46. --  interfaces. As a result, implementing drag and drop, sorting, and storing 
  47. --  data is trivial. For the vast majority of trees and lists, these two models 
  48. --  are sufficient. 
  49. -- 
  50. --  Models are accessed on a node/column level of granularity. One can query 
  51. --  for the value of a model at a certain node and a certain column on that 
  52. --  node. There are two structures used to reference a particular node in a 
  53. --  model. They are the Gtk.Tree_Model.Gtk_Tree_Path and the 
  54. --  Gtk.Tree_Model.Gtk_Tree_Iter[ 
  55. -- 
  56. --  Here, <abbrev>iter</abbrev> is short for <quote>iterator</quote>]. Most of 
  57. --  the interface consists of operations on a Gtk.Tree_Model.Gtk_Tree_Iter. 
  58. -- 
  59. --  A path is essentially a potential node. It is a location on a model that 
  60. --  may or may not actually correspond to a node on a specific model. The 
  61. --  Gtk.Tree_Model.Gtk_Tree_Path struct can be converted into either an array 
  62. --  of unsigned integers or a string. The string form is a list of numbers 
  63. --  separated by a colon. Each number refers to the offset at that level. Thus, 
  64. --  the path <quote>0</quote> refers to the root node and the path 
  65. --  <quote>2:4</quote> refers to the fifth child of the third node. 
  66. -- 
  67. --  By contrast, a Gtk.Tree_Model.Gtk_Tree_Iter is a reference to a specific 
  68. --  node on a specific model. It is a generic struct with an integer and three 
  69. --  generic pointers. These are filled in by the model in a model-specific way. 
  70. --  One can convert a path to an iterator by calling Gtk.Tree_Model.Get_Iter. 
  71. --  These iterators are the primary way of accessing a model and are similar to 
  72. --  the iterators used by Gtk.Text_Buffer.Gtk_Text_Buffer. They are generally 
  73. --  statically allocated on the stack and only used for a short time. The model 
  74. --  interface defines a set of operations using them for navigating the model. 
  75. -- 
  76. --  It is expected that models fill in the iterator with private data. For 
  77. --  example, the Gtk.List_Store.Gtk_List_Store model, which is internally a 
  78. --  simple linked list, stores a list node in one of the pointers. The 
  79. --  Gtk.Tree_Model_Sort.Gtk_Tree_Model_Sort stores an array and an offset in 
  80. --  two of the pointers. Additionally, there is an integer field. This field is 
  81. --  generally filled with a unique stamp per model. This stamp is for catching 
  82. --  errors resulting from using invalid iterators with a model. 
  83. -- 
  84. --  The lifecycle of an iterator can be a little confusing at first. Iterators 
  85. --  are expected to always be valid for as long as the model is unchanged (and 
  86. --  doesn't emit a signal). The model is considered to own all outstanding 
  87. --  iterators and nothing needs to be done to free them from the user's point 
  88. --  of view. Additionally, some models guarantee that an iterator is valid for 
  89. --  as long as the node it refers to is valid (most notably the 
  90. --  Gtk.Tree_Store.Gtk_Tree_Store and Gtk.List_Store.Gtk_List_Store). Although 
  91. --  generally uninteresting, as one always has to allow for the case where 
  92. --  iterators do not persist beyond a signal, some very important performance 
  93. --  enhancements were made in the sort model. As a result, the 
  94. --  GTK_TREE_MODEL_ITERS_PERSIST flag was added to indicate this behavior. 
  95. -- 
  96. --  To help show some common operation of a model, some examples are provided. 
  97. --  The first example shows three ways of getting the iter at the location 
  98. --  <quote>3:2:5</quote>. While the first method shown is easier, the second is 
  99. --  much more common, as you often get paths from callbacks. 
  100. -- 
  101. --  == Acquiring a <structname>GtkTreeIter</structname> == 
  102. -- 
  103. --    /* Three ways of getting the iter pointing to the location */ 
  104. --    GtkTreePath *path; 
  105. --    GtkTreeIter iter; 
  106. --    GtkTreeIter parent_iter; 
  107. --    /* get the iterator from a string */ 
  108. --    gtk_tree_model_get_iter_from_string (model, &amp;iter, "3:2:5"); 
  109. --    /* get the iterator from a path */ 
  110. --    path = gtk_tree_path_new_from_string ("3:2:5"); 
  111. --    gtk_tree_model_get_iter (model, &amp;iter, path); 
  112. --    gtk_tree_path_free (path); 
  113. --    /* walk the tree to find the iterator */ 
  114. --    gtk_tree_model_iter_nth_child (model, &amp;iter, NULL, 3); 
  115. --    parent_iter = iter; 
  116. --    gtk_tree_model_iter_nth_child (model, &amp;iter, &amp;parent_iter, 2); 
  117. --    parent_iter = iter; 
  118. --    gtk_tree_model_iter_nth_child (model, &amp;iter, &amp;parent_iter, 5); 
  119. -- 
  120. --  This second example shows a quick way of iterating through a list and 
  121. --  getting a string and an integer from each row. The 
  122. --  <function>populate_model</function> function used below is not shown, as it 
  123. --  is specific to the Gtk.List_Store.Gtk_List_Store. For information on how to 
  124. --  write such a function, see the Gtk.List_Store.Gtk_List_Store documentation. 
  125. -- 
  126. --  == Reading data from a <structname>GtkTreeModel</structname> == 
  127. -- 
  128. --    enum 
  129. --    { 
  130. --       STRING_COLUMN, 
  131. --       INT_COLUMN, 
  132. --       N_COLUMNS 
  133. --    }; 
  134. --    ... 
  135. --    GtkTreeModel *list_store; 
  136. --    GtkTreeIter iter; 
  137. --    gboolean valid; 
  138. --    gint row_count = 0; 
  139. --    /* make a new list_store */ 
  140. --    list_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_INT); 
  141. --    /* Fill the list store with data */ 
  142. --    populate_model (list_store); 
  143. --    /* Get the first iter in the list, check it is valid and walk 
  144. --    * through the list, reading each row. */ 
  145. --    for (valid = gtk_tree_model_get_iter_first (list_store, &amp;iter); 
  146. --       valid; 
  147. --       valid = gtk_tree_model_iter_next (list_store, &amp;iter)) 
  148. --    { 
  149. --       gchar *str_data; 
  150. --       gint   int_data; 
  151. --       /* Make sure you terminate calls to gtk_tree_model_get 
  152. --       * with a '-1' value 
  153. --       */ 
  154. --       gtk_tree_model_get (list_store, &amp;iter, 
  155. --          STRING_COLUMN, &amp;str_data, 
  156. --          INT_COLUMN, &amp;int_data, 
  157. --          -1); 
  158. --       /* Do something with the data */ 
  159. --       g_print ("Row %d: (%s,%d)\n", row_count, str_data, int_data); 
  160. --       g_free (str_data); 
  161. --       row_count++; 
  162. --    } 
  163. -- 
  164. --  The Gtk.Tree_Model.Gtk_Tree_Model interface contains two methods for 
  165. --  reference counting: Gtk.Tree_Model.Ref_Node and Gtk.Tree_Model.Unref_Node. 
  166. --  These two methods are optional to implement. The reference counting is 
  167. --  meant as a way for views to let models know when nodes are being displayed. 
  168. --  Gtk.Tree_View.Gtk_Tree_View will take a reference on a node when it is 
  169. --  visible, which means the node is either in the toplevel or expanded. Being 
  170. --  displayed does not mean that the node is currently directly visible to the 
  171. --  user in the viewport. Based on this reference counting scheme a caching 
  172. --  model, for example, can decide whether or not to cache a node based on the 
  173. --  reference count. A file-system based model would not want to keep the 
  174. --  entire file hierarchy in memory, but just the folders that are currently 
  175. --  expanded in every current view. 
  176. -- 
  177. --  When working with reference counting, the following rules must be taken 
  178. --  into account: 
  179. -- 
  180. --     * Never take a reference on a node without owning a reference on its 
  181. --  parent. This means that all parent nodes of a referenced node must be 
  182. --  referenced as well. 
  183. -- 
  184. --     * Outstanding references on a deleted node are not released. This is 
  185. --  not possible because the node has already been deleted by the time the 
  186. --  row-deleted signal is received. 
  187. -- 
  188. --     * Models are not obligated to emit a signal on rows of which none of 
  189. --  its siblings are referenced. To phrase this differently, signals are only 
  190. --  required for levels in which nodes are referenced. For the root level 
  191. --  however, signals must be emitted at all times (however the root level is 
  192. --  always referenced when any view is attached). 
  193. -- 
  194. -- 
  195. --  </description> 
  196. pragma Ada_2005; 
  197.  
  198. pragma Warnings (Off, "*is already use-visible*"); 
  199. with Glib;                    use Glib; 
  200. with Glib.Generic_Properties; use Glib.Generic_Properties; 
  201. with Glib.Glist;              use Glib.Glist; 
  202. with Glib.Object;             use Glib.Object; 
  203. with Glib.Types;              use Glib.Types; 
  204. with Glib.Values;             use Glib.Values; 
  205.  
  206. package Gtk.Tree_Model is 
  207.  
  208.    type Gtk_Tree_Model is new Glib.Types.GType_Interface; 
  209.    Null_Gtk_Tree_Model : constant Gtk_Tree_Model; 
  210.  
  211.    type Tree_Model_Flags is mod 2 ** Integer'Size; 
  212.    pragma Convention (C, Tree_Model_Flags); 
  213.    --  These flags indicate various properties of a 
  214.    --  Gtk.Tree_Model.Gtk_Tree_Model. 
  215.    -- 
  216.    --  They are returned by Gtk.Tree_Model.Get_Flags, and must be static for 
  217.    --  the lifetime of the object. A more complete description of 
  218.    --  GTK_TREE_MODEL_ITERS_PERSIST can be found in the overview of this 
  219.    --  section. 
  220.  
  221.    Tree_Model_Iters_Persist : constant Tree_Model_Flags := 1; 
  222.    Tree_Model_List_Only : constant Tree_Model_Flags := 2; 
  223.  
  224.    type Gtk_Tree_Iter is private; 
  225.    function From_Object_Free (B : access Gtk_Tree_Iter) return Gtk_Tree_Iter; 
  226.    pragma Inline (From_Object_Free); 
  227.    --  The <structname>GtkTreeIter</structname> is the primary structure for 
  228.    --  accessing a Gtk.Tree_Model.Gtk_Tree_Model. Models are expected to put a 
  229.    --  unique integer in the <structfield>stamp</structfield> member, and put 
  230.    --  model-specific data in the three <structfield>user_data</structfield> 
  231.    --  members. 
  232.  
  233.    Null_Iter : constant Gtk_Tree_Iter; 
  234.  
  235.    type Gtk_Tree_Path is new Glib.C_Boxed with null record; 
  236.    Null_Gtk_Tree_Path : constant Gtk_Tree_Path; 
  237.  
  238.    function From_Object (Object : System.Address) return Gtk_Tree_Path; 
  239.    function From_Object_Free (B : access Gtk_Tree_Path'Class) return Gtk_Tree_Path; 
  240.    pragma Inline (From_Object_Free, From_Object); 
  241.  
  242.    --------------- 
  243.    -- Callbacks -- 
  244.    --------------- 
  245.  
  246.    type Gtk_Tree_Model_Foreach_Func is access function 
  247.      (Model : Gtk_Tree_Model; 
  248.       Path  : Gtk_Tree_Path; 
  249.       Iter  : Gtk_Tree_Iter) return Boolean; 
  250.    --  Type of the callback passed to Gtk.Tree_Model.Foreach to iterate over 
  251.    --  the rows in a tree model. 
  252.    --  "model": the Gtk.Tree_Model.Gtk_Tree_Model being iterated 
  253.    --  "path": the current Gtk.Tree_Model.Gtk_Tree_Path 
  254.    --  "iter": the current Gtk.Tree_Model.Gtk_Tree_Iter 
  255.  
  256.    ---------------------------- 
  257.    -- Enumeration Properties -- 
  258.    ---------------------------- 
  259.  
  260.    package Tree_Model_Flags_Properties is 
  261.       new Generic_Internal_Discrete_Property (Tree_Model_Flags); 
  262.    type Property_Tree_Model_Flags is new Tree_Model_Flags_Properties.Property; 
  263.  
  264.    ------------------ 
  265.    -- Constructors -- 
  266.    ------------------ 
  267.  
  268.    function Get_Type return Glib.GType; 
  269.    pragma Import (C, Get_Type, "gtk_tree_model_get_type"); 
  270.  
  271.    function Iter_Get_Type return Glib.GType; 
  272.    pragma Import (C, Iter_Get_Type, "gtk_tree_iter_get_type"); 
  273.  
  274.    procedure Gtk_New (Path : out Gtk_Tree_Path); 
  275.    --  Creates a new Gtk.Tree_Model.Gtk_Tree_Path. This structure refers to a 
  276.    --  row. 
  277.  
  278.    function Gtk_Tree_Path_New return Gtk_Tree_Path; 
  279.    --  Creates a new Gtk.Tree_Model.Gtk_Tree_Path. This structure refers to a 
  280.    --  row. 
  281.  
  282.    procedure Gtk_New_First (Path : out Gtk_Tree_Path); 
  283.    --  Creates a new Gtk.Tree_Model.Gtk_Tree_Path. 
  284.    --  The string representation of this path is "0". 
  285.  
  286.    function Gtk_Tree_Path_New_First return Gtk_Tree_Path; 
  287.    --  Creates a new Gtk.Tree_Model.Gtk_Tree_Path. 
  288.    --  The string representation of this path is "0". 
  289.  
  290.    procedure Gtk_New (Self : out Gtk_Tree_Path; Path : UTF8_String); 
  291.    --  Creates a new Gtk.Tree_Model.Gtk_Tree_Path initialized to Path. 
  292.    --  Path is expected to be a colon separated list of numbers. For example, 
  293.    --  the string "10:4:0" would create a path of depth 3 pointing to the 11th 
  294.    --  child of the root node, the 5th child of that 11th child, and the 1st 
  295.    --  child of that 5th child. If an invalid path string is passed in, null is 
  296.    --  returned. 
  297.    --  "path": The string representation of a path 
  298.  
  299.    function Gtk_Tree_Path_New_From_String 
  300.       (Path : UTF8_String) return Gtk_Tree_Path; 
  301.    --  Creates a new Gtk.Tree_Model.Gtk_Tree_Path initialized to Path. 
  302.    --  Path is expected to be a colon separated list of numbers. For example, 
  303.    --  the string "10:4:0" would create a path of depth 3 pointing to the 11th 
  304.    --  child of the root node, the 5th child of that 11th child, and the 1st 
  305.    --  child of that 5th child. If an invalid path string is passed in, null is 
  306.    --  returned. 
  307.    --  "path": The string representation of a path 
  308.  
  309.    function Path_Get_Type return Glib.GType; 
  310.    pragma Import (C, Path_Get_Type, "gtk_tree_path_get_type"); 
  311.  
  312.    ------------- 
  313.    -- Methods -- 
  314.    ------------- 
  315.  
  316.    procedure Foreach 
  317.       (Tree_Model : Gtk_Tree_Model; 
  318.        Func       : Gtk_Tree_Model_Foreach_Func); 
  319.    --  Calls func on each node in model in a depth-first fashion. 
  320.    --  If Func returns True, then the tree ceases to be walked, and 
  321.    --  Gtk.Tree_Model.Foreach returns. 
  322.    --  "func": a function to be called on each row 
  323.  
  324.    generic 
  325.       type User_Data_Type (<>) is private; 
  326.       with procedure Destroy (Data : in out User_Data_Type) is null; 
  327.    package Foreach_User_Data is 
  328.  
  329.       type Gtk_Tree_Model_Foreach_Func is access function 
  330.         (Model : Gtk.Tree_Model.Gtk_Tree_Model; 
  331.          Path  : Gtk.Tree_Model.Gtk_Tree_Path; 
  332.          Iter  : Gtk.Tree_Model.Gtk_Tree_Iter; 
  333.          Data  : User_Data_Type) return Boolean; 
  334.       --  Type of the callback passed to Gtk.Tree_Model.Foreach to iterate over 
  335.       --  the rows in a tree model. 
  336.       --  "model": the Gtk.Tree_Model.Gtk_Tree_Model being iterated 
  337.       --  "path": the current Gtk.Tree_Model.Gtk_Tree_Path 
  338.       --  "iter": the current Gtk.Tree_Model.Gtk_Tree_Iter 
  339.       --  "data": The user data passed to Gtk.Tree_Model.Foreach 
  340.  
  341.       procedure Foreach 
  342.          (Tree_Model : Gtk.Tree_Model.Gtk_Tree_Model; 
  343.           Func       : Gtk_Tree_Model_Foreach_Func; 
  344.           User_Data  : User_Data_Type); 
  345.       --  Calls func on each node in model in a depth-first fashion. 
  346.       --  If Func returns True, then the tree ceases to be walked, and 
  347.       --  Gtk.Tree_Model.Foreach returns. 
  348.       --  "func": a function to be called on each row 
  349.       --  "user_data": user data to passed to Func 
  350.  
  351.    end Foreach_User_Data; 
  352.  
  353.    function Get_Column_Type 
  354.       (Tree_Model : Gtk_Tree_Model; 
  355.        Index      : Gint) return GType; 
  356.    pragma Import (C, Get_Column_Type, "gtk_tree_model_get_column_type"); 
  357.    --  Returns the type of the column. 
  358.    --  "index_": the column index 
  359.  
  360.    function Get_Flags (Tree_Model : Gtk_Tree_Model) return Tree_Model_Flags; 
  361.    pragma Import (C, Get_Flags, "gtk_tree_model_get_flags"); 
  362.    --  Returns a set of flags supported by this interface. 
  363.    --  The flags are a bitwise combination of Gtk.Tree_Model.Tree_Model_Flags. 
  364.    --  The flags supported should not change during the lifetime of the 
  365.    --  Tree_Model. 
  366.  
  367.    function Get_Iter 
  368.       (Tree_Model : Gtk_Tree_Model; 
  369.        Path       : Gtk_Tree_Path) return Gtk_Tree_Iter; 
  370.    --  Sets Iter to a valid iterator pointing to Path. If Path does not exist, 
  371.    --  Iter is set to an invalid iterator and False is returned. 
  372.    --  "path": the Gtk.Tree_Model.Gtk_Tree_Path 
  373.  
  374.    function Get_Iter_First 
  375.       (Tree_Model : Gtk_Tree_Model) return Gtk_Tree_Iter; 
  376.    --  Initializes Iter with the first iterator in the tree (the one at the 
  377.    --  path "0") and returns True. Returns False if the tree is empty. 
  378.  
  379.    function Get_Iter_From_String 
  380.       (Tree_Model  : Gtk_Tree_Model; 
  381.        Path_String : UTF8_String) return Gtk_Tree_Iter; 
  382.    --  Sets Iter to a valid iterator pointing to Path_String, if it exists. 
  383.    --  Otherwise, Iter is left invalid and False is returned. 
  384.    --  "path_string": a string representation of a 
  385.    --  Gtk.Tree_Model.Gtk_Tree_Path 
  386.  
  387.    function Get_N_Columns (Tree_Model : Gtk_Tree_Model) return Gint; 
  388.    pragma Import (C, Get_N_Columns, "gtk_tree_model_get_n_columns"); 
  389.    --  Returns the number of columns supported by Tree_Model. 
  390.  
  391.    function Get_Path 
  392.       (Tree_Model : Gtk_Tree_Model; 
  393.        Iter       : Gtk_Tree_Iter) return Gtk_Tree_Path; 
  394.    --  Returns a newly-created Gtk.Tree_Model.Gtk_Tree_Path referenced by 
  395.    --  Iter. 
  396.    --  This path should be freed with Gtk.Tree_Model.Path_Free. 
  397.    --  "iter": the Gtk.Tree_Model.Gtk_Tree_Iter 
  398.  
  399.    function Get_String_From_Iter 
  400.       (Tree_Model : Gtk_Tree_Model; 
  401.        Iter       : Gtk_Tree_Iter) return UTF8_String; 
  402.    --  Generates a string representation of the iter. 
  403.    --  This string is a ':' separated list of numbers. For example, "4:10:0:3" 
  404.    --  would be an acceptable return value for this string. 
  405.    --  Since: gtk+ 2.2 
  406.    --  "iter": a Gtk.Tree_Model.Gtk_Tree_Iter 
  407.  
  408.    procedure Get_Value 
  409.       (Tree_Model : Gtk_Tree_Model; 
  410.        Iter       : Gtk_Tree_Iter; 
  411.        Column     : Gint; 
  412.        Value      : out Glib.Values.GValue); 
  413.    pragma Import (C, Get_Value, "gtk_tree_model_get_value"); 
  414.    --  Initializes and sets Value to that at Column. 
  415.    --  When done with Value, g_value_unset needs to be called to free any 
  416.    --  allocated memory. 
  417.    --  "iter": the Gtk.Tree_Model.Gtk_Tree_Iter 
  418.    --  "column": the column to lookup the value at 
  419.    --  "value": an empty Glib.Values.GValue to set 
  420.  
  421.    function Children 
  422.       (Tree_Model : Gtk_Tree_Model; 
  423.        Parent     : Gtk_Tree_Iter) return Gtk_Tree_Iter; 
  424.    --  Sets Iter to point to the first child of Parent. 
  425.    --  If Parent has no children, False is returned and Iter is set to be 
  426.    --  invalid. Parent will remain a valid node after this function has been 
  427.    --  called. 
  428.    --  If Parent is null returns the first node, equivalent to 
  429.    --  'gtk_tree_model_get_iter_first (tree_model, iter);' 
  430.    --  "parent": the Gtk.Tree_Model.Gtk_Tree_Iter, or null 
  431.  
  432.    function Has_Child 
  433.       (Tree_Model : Gtk_Tree_Model; 
  434.        Iter       : Gtk_Tree_Iter) return Boolean; 
  435.    --  Returns True if Iter has children, False otherwise. 
  436.    --  "iter": the Gtk.Tree_Model.Gtk_Tree_Iter to test for children 
  437.  
  438.    function N_Children 
  439.       (Tree_Model : Gtk_Tree_Model; 
  440.        Iter       : Gtk_Tree_Iter := Gtk.Tree_Model.Null_Iter) return Gint; 
  441.    --  Returns the number of children that Iter has. 
  442.    --  As a special case, if Iter is null, then the number of toplevel nodes 
  443.    --  is returned. 
  444.    --  "iter": the Gtk.Tree_Model.Gtk_Tree_Iter, or null 
  445.  
  446.    procedure Next (Tree_Model : Gtk_Tree_Model; Iter : in out Gtk_Tree_Iter); 
  447.    --  Sets Iter to point to the node following it at the current level. 
  448.    --  If there is no next Iter, False is returned and Iter is set to be 
  449.    --  invalid. 
  450.    --  "iter": the Gtk.Tree_Model.Gtk_Tree_Iter 
  451.  
  452.    procedure Next (Path : Gtk_Tree_Path); 
  453.    --  Moves the Path to point to the next node at the current depth. 
  454.  
  455.    function Nth_Child 
  456.       (Tree_Model : Gtk_Tree_Model; 
  457.        Parent     : Gtk_Tree_Iter; 
  458.        N          : Gint) return Gtk_Tree_Iter; 
  459.    --  Sets Iter to be the child of Parent, using the given index. 
  460.    --  The first index is 0. If N is too big, or Parent has no children, Iter 
  461.    --  is set to an invalid iterator and False is returned. Parent will remain 
  462.    --  a valid node after this function has been called. As a special case, if 
  463.    --  Parent is null, then the N<!-- -->th root node is set. 
  464.    --  "parent": the Gtk.Tree_Model.Gtk_Tree_Iter to get the child from, or 
  465.    --  null. 
  466.    --  "n": the index of the desired child 
  467.  
  468.    function Parent 
  469.       (Tree_Model : Gtk_Tree_Model; 
  470.        Child      : Gtk_Tree_Iter) return Gtk_Tree_Iter; 
  471.    --  Sets Iter to be the parent of Child. 
  472.    --  If Child is at the toplevel, and doesn't have a parent, then Iter is 
  473.    --  set to an invalid iterator and False is returned. Child will remain a 
  474.    --  valid node after this function has been called. 
  475.    --  "child": the Gtk.Tree_Model.Gtk_Tree_Iter 
  476.  
  477.    procedure Previous 
  478.       (Tree_Model : Gtk_Tree_Model; 
  479.        Iter       : in out Gtk_Tree_Iter); 
  480.    --  Sets Iter to point to the previous node at the current level. 
  481.    --  If there is no previous Iter, False is returned and Iter is set to be 
  482.    --  invalid. 
  483.    --  Since: gtk+ 3.0 
  484.    --  "iter": the Gtk.Tree_Model.Gtk_Tree_Iter 
  485.  
  486.    procedure Ref_Node (Tree_Model : Gtk_Tree_Model; Iter : Gtk_Tree_Iter); 
  487.    pragma Import (C, Ref_Node, "gtk_tree_model_ref_node"); 
  488.    --  Lets the tree ref the node. 
  489.    --  This is an optional method for models to implement. To be more 
  490.    --  specific, models may ignore this call as it exists primarily for 
  491.    --  performance reasons. 
  492.    --  This function is primarily meant as a way for views to let caching 
  493.    --  models know when nodes are being displayed (and hence, whether or not to 
  494.    --  cache that node). Being displayed means a node is in an expanded branch, 
  495.    --  regardless of whether the node is currently visible in the viewport. For 
  496.    --  example, a file-system based model would not want to keep the entire 
  497.    --  file-hierarchy in memory, just the sections that are currently being 
  498.    --  displayed by every current view. 
  499.    --  A model should be expected to be able to get an iter independent of its 
  500.    --  reffed state. 
  501.    --  "iter": the Gtk.Tree_Model.Gtk_Tree_Iter 
  502.  
  503.    procedure Row_Changed 
  504.       (Tree_Model : Gtk_Tree_Model; 
  505.        Path       : Gtk_Tree_Path; 
  506.        Iter       : Gtk_Tree_Iter); 
  507.    --  Emits the Gtk.Tree_Model.Gtk_Tree_Model::row-changed signal on 
  508.    --  Tree_Model. 
  509.    --  "path": a Gtk.Tree_Model.Gtk_Tree_Path pointing to the changed row 
  510.    --  "iter": a valid Gtk.Tree_Model.Gtk_Tree_Iter pointing to the changed 
  511.    --  row 
  512.  
  513.    procedure Row_Deleted (Tree_Model : Gtk_Tree_Model; Path : Gtk_Tree_Path); 
  514.    --  Emits the Gtk.Tree_Model.Gtk_Tree_Model::row-deleted signal on 
  515.    --  Tree_Model. 
  516.    --  This should be called by models after a row has been removed. The 
  517.    --  location pointed to by Path should be the location that the row 
  518.    --  previously was at. It may not be a valid location anymore. 
  519.    --  Nodes that are deleted are not unreffed, this means that any 
  520.    --  outstanding references on the deleted node should not be released. 
  521.    --  "path": a Gtk.Tree_Model.Gtk_Tree_Path pointing to the previous 
  522.    --  location of the deleted row 
  523.  
  524.    procedure Row_Has_Child_Toggled 
  525.       (Tree_Model : Gtk_Tree_Model; 
  526.        Path       : Gtk_Tree_Path; 
  527.        Iter       : Gtk_Tree_Iter); 
  528.    --  Emits the Gtk.Tree_Model.Gtk_Tree_Model::row-has-child-toggled signal 
  529.    --  on Tree_Model. This should be called by models after the child state of 
  530.    --  a node changes. 
  531.    --  "path": a Gtk.Tree_Model.Gtk_Tree_Path pointing to the changed row 
  532.    --  "iter": a valid Gtk.Tree_Model.Gtk_Tree_Iter pointing to the changed 
  533.    --  row 
  534.  
  535.    procedure Row_Inserted 
  536.       (Tree_Model : Gtk_Tree_Model; 
  537.        Path       : Gtk_Tree_Path; 
  538.        Iter       : Gtk_Tree_Iter); 
  539.    --  Emits the Gtk.Tree_Model.Gtk_Tree_Model::row-inserted signal on 
  540.    --  Tree_Model. 
  541.    --  "path": a Gtk.Tree_Model.Gtk_Tree_Path pointing to the inserted row 
  542.    --  "iter": a valid Gtk.Tree_Model.Gtk_Tree_Iter pointing to the inserted 
  543.    --  row 
  544.  
  545.    procedure Rows_Reordered 
  546.       (Tree_Model : Gtk_Tree_Model; 
  547.        Path       : Gtk_Tree_Path; 
  548.        Iter       : Gtk_Tree_Iter; 
  549.        New_Order  : Gint_Array); 
  550.    --  Emits the Gtk.Tree_Model.Gtk_Tree_Model::rows-reordered signal on 
  551.    --  Tree_Model. 
  552.    --  This should be called by models when their rows have been reordered. 
  553.    --  "path": a Gtk.Tree_Model.Gtk_Tree_Path pointing to the tree node whose 
  554.    --  children have been reordered 
  555.    --  "iter": a valid Gtk.Tree_Model.Gtk_Tree_Iter pointing to the node whose 
  556.    --  children have been reordered, or null if the depth of Path is 0 
  557.    --  "new_order": an array of integers mapping the current position of each 
  558.    --  child to its old position before the re-ordering, i.e. 
  559.    --  New_Order'[newpos] = oldpos' 
  560.  
  561.    procedure Unref_Node (Tree_Model : Gtk_Tree_Model; Iter : Gtk_Tree_Iter); 
  562.    pragma Import (C, Unref_Node, "gtk_tree_model_unref_node"); 
  563.    --  Lets the tree unref the node. 
  564.    --  This is an optional method for models to implement. To be more 
  565.    --  specific, models may ignore this call as it exists primarily for 
  566.    --  performance reasons. For more information on what this means, see 
  567.    --  Gtk.Tree_Model.Ref_Node. 
  568.    --  Please note that nodes that are deleted are not unreffed. 
  569.    --  "iter": the Gtk.Tree_Model.Gtk_Tree_Iter 
  570.  
  571.    function Iter_Copy (Self : Gtk_Tree_Iter) return Gtk_Tree_Iter; 
  572.    pragma Import (C, Iter_Copy, "gtk_tree_iter_copy"); 
  573.    --  Creates a dynamically allocated tree iterator as a copy of Iter. 
  574.    --  This function is not intended for use in applications, because you can 
  575.    --  just copy the structs by value ('GtkTreeIter new_iter = iter;'). You 
  576.    --  must free this iter with Gtk.Tree_Model.Free. 
  577.  
  578.    procedure Free (Self : Gtk_Tree_Iter); 
  579.    pragma Import (C, Free, "gtk_tree_iter_free"); 
  580.    --  Frees an iterator that has been allocated by Gtk.Tree_Model.Iter_Copy. 
  581.    --  This function is mainly used for language bindings. 
  582.  
  583.    procedure Append_Index (Path : Gtk_Tree_Path; Index : Gint); 
  584.    --  Appends a new index to a path. 
  585.    --  As a result, the depth of the path is increased. 
  586.    --  "index_": the index 
  587.  
  588.    function Compare (Path : Gtk_Tree_Path; B : Gtk_Tree_Path) return Gint; 
  589.    --  Compares two paths. 
  590.    --  If A appears before B in a tree, then -1 is returned. If B appears 
  591.    --  before A, then 1 is returned. If the two nodes are equal, then 0 is 
  592.    --  returned. 
  593.    --  "b": a Gtk.Tree_Model.Gtk_Tree_Path to compare with 
  594.  
  595.    function Copy (Path : Gtk_Tree_Path) return Gtk_Tree_Path; 
  596.    --  Creates a new Gtk.Tree_Model.Gtk_Tree_Path as a copy of Path. 
  597.  
  598.    procedure Down (Path : Gtk_Tree_Path); 
  599.    --  Moves Path to point to the first child of the current path. 
  600.  
  601.    procedure Path_Free (Path : Gtk_Tree_Path); 
  602.    --  Frees Path. If Path is null, it simply returns. 
  603.  
  604.    function Get_Depth (Path : Gtk_Tree_Path) return Gint; 
  605.    --  Returns the current depth of Path. 
  606.  
  607.    function Get_Indices (Path : Gtk_Tree_Path) return Glib.Gint_Array; 
  608.    --  Returns the current indices of Path. 
  609.    --  This is an array of integers, each representing a node in a tree. This 
  610.    --  value should not be freed. 
  611.    --  The length of the array can be obtained with Gtk.Tree_Model.Get_Depth. 
  612.  
  613.    function Is_Ancestor 
  614.       (Path       : Gtk_Tree_Path; 
  615.        Descendant : Gtk_Tree_Path) return Boolean; 
  616.    --  Returns True if Descendant is a descendant of Path. 
  617.    --  "descendant": another Gtk.Tree_Model.Gtk_Tree_Path 
  618.  
  619.    function Is_Descendant 
  620.       (Path     : Gtk_Tree_Path; 
  621.        Ancestor : Gtk_Tree_Path) return Boolean; 
  622.    --  Returns True if Path is a descendant of Ancestor. 
  623.    --  "ancestor": another Gtk.Tree_Model.Gtk_Tree_Path 
  624.  
  625.    procedure Prepend_Index (Path : Gtk_Tree_Path; Index : Gint); 
  626.    --  Prepends a new index to a path. 
  627.    --  As a result, the depth of the path is increased. 
  628.    --  "index_": the index 
  629.  
  630.    function Prev (Path : Gtk_Tree_Path) return Boolean; 
  631.    --  Moves the Path to point to the previous node at the current depth, if 
  632.    --  it exists. 
  633.  
  634.    function To_String (Path : Gtk_Tree_Path) return UTF8_String; 
  635.    --  Generates a string representation of the path. 
  636.    --  This string is a ':' separated list of numbers. For example, "4:10:0:3" 
  637.    --  would be an acceptable return value for this string. 
  638.  
  639.    function Up (Path : Gtk_Tree_Path) return Boolean; 
  640.    --  Moves the Path to point to its parent node, if it has a parent. 
  641.  
  642.    ---------------------- 
  643.    -- GtkAda additions -- 
  644.    ---------------------- 
  645.  
  646.    type Gtk_Root_Tree_Model_Record is new Glib.Object.GObject_Record 
  647.    with null record; 
  648.    type Gtk_Root_Tree_Model is 
  649.       access all Gtk_Root_Tree_Model_Record'Class; 
  650.       --  A common base type for all objects that implement GtkTreeModel. This 
  651.       --  is used to conveniently provide a number of primitive operations. 
  652.  
  653.       function Get_Int 
  654.         (Tree_Model : access Gtk_Root_Tree_Model_Record; 
  655.          Iter       : Gtk_Tree_Iter; 
  656.          Column     : Gint) return Gint; 
  657.       function Get_Boolean 
  658.         (Tree_Model : access Gtk_Root_Tree_Model_Record; 
  659.          Iter       : Gtk_Tree_Iter; 
  660.          Column     : Gint) return Boolean; 
  661.       function Get_Object 
  662.         (Tree_Model : access Gtk_Root_Tree_Model_Record; 
  663.          Iter       : Gtk_Tree_Iter; 
  664.          Column     : Gint) return Glib.Object.GObject; 
  665.       function Get_C_Proxy 
  666.         (Tree_Model : access Gtk_Root_Tree_Model_Record; 
  667.          Iter       : Gtk_Tree_Iter; 
  668.          Column     : Gint) return Glib.C_Proxy; 
  669.       function Get_String 
  670.         (Tree_Model : access Gtk_Root_Tree_Model_Record; 
  671.          Iter       : Gtk_Tree_Iter; 
  672.          Column     : Gint) return UTF8_String; 
  673.       function Get_Address 
  674.         (Tree_Model : access Gtk_Root_Tree_Model_Record; 
  675.          Iter       : Gtk_Tree_Iter; 
  676.          Column     : Gint) return System.Address; 
  677.       --  Get the value of one cell of the model 
  678.  
  679.       function Get_Int 
  680.         (Tree_Model : Gtk_Tree_Model; 
  681.          Iter       : Gtk_Tree_Iter; 
  682.          Column     : Gint) return Gint; 
  683.       function Get_Boolean 
  684.         (Tree_Model : Gtk_Tree_Model; 
  685.          Iter       : Gtk_Tree_Iter; 
  686.          Column     : Gint) return Boolean; 
  687.       function Get_Object 
  688.         (Tree_Model : Gtk_Tree_Model; 
  689.          Iter       : Gtk_Tree_Iter; 
  690.          Column     : Gint) return Glib.Object.GObject; 
  691.       function Get_C_Proxy 
  692.         (Tree_Model : Gtk_Tree_Model; 
  693.          Iter       : Gtk_Tree_Iter; 
  694.          Column     : Gint) return Glib.C_Proxy; 
  695.       function Get_String 
  696.         (Tree_Model : Gtk_Tree_Model; 
  697.          Iter       : Gtk_Tree_Iter; 
  698.          Column     : Gint) return UTF8_String; 
  699.       function Get_Address 
  700.         (Tree_Model : Gtk_Tree_Model; 
  701.          Iter       : Gtk_Tree_Iter; 
  702.          Column     : Gint) return System.Address; 
  703.  
  704.       package Implements_Gtk_Tree_Model is new Glib.Types.Implements 
  705.         (Gtk_Tree_Model, Gtk_Root_Tree_Model_Record, Gtk_Root_Tree_Model); 
  706.       function To_Interface 
  707.         (Widget : access Gtk_Root_Tree_Model_Record'Class) 
  708.       return Gtk_Tree_Model renames Implements_Gtk_Tree_Model.To_Interface; 
  709.       function "-" 
  710.         (Interf : Gtk_Tree_Model) return Gtk_Root_Tree_Model 
  711.       renames Implements_Gtk_Tree_Model.To_Object; 
  712.       --  Convert from the gtk+ interface to an actual object. The return type 
  713.       --  depends on the exact model, and will likely be an instance of 
  714.       --  Gtk_Tree_Store'Class or Gtk_List_Store'Class depending on how you 
  715.       --  created it. 
  716.  
  717.    function "=" (Left : Gtk_Tree_Iter; Right : Gtk_Tree_Iter) return Boolean; 
  718.  
  719.    procedure Set_Tree_Iter 
  720.      (Val  : in out Glib.Values.GValue; 
  721.       Iter : Gtk_Tree_Iter); 
  722.    pragma Import (C, Set_Tree_Iter, "g_value_set_pointer"); 
  723.    --  Set the value of the given GValue to Iter. 
  724.    --  Note that Iter is stored by reference, which means no copy of Iter 
  725.    --  is made. Iter should remain allocated as long as Val is being used. 
  726.  
  727.    procedure Get_Tree_Iter 
  728.      (Val  : Glib.Values.GValue; 
  729.       Iter : out Gtk_Tree_Iter); 
  730.    --  Extract the iterator from the given GValue. 
  731.    --  Note that the iterator returned is a copy of the iterator referenced 
  732.    --  by the give GValue. Modifying the iterator returned does not modify 
  733.    --  the iterator referenced by the GValue. 
  734.  
  735.    function Get_Tree_Iter (Val : Glib.Values.GValue) return Gtk_Tree_Iter; 
  736.    --  Extract the iterator from the given GValue. 
  737.  
  738.    function To_Address (Iter : Gtk_Tree_Iter) return System.Address; 
  739.    pragma Convention (C, To_Address); 
  740.    --  Return address of the specified iterator. 
  741.    --  Note: To_Address needs a pass-by-reference semantic to work properly 
  742.    --  On some ABIs (e.g. IA64), Gtk_Tree_Iter is passed by copy, since it's 
  743.    --  a "small enough" record. 
  744.  
  745.    function Iter_Or_Null (Iter : System.Address) return System.Address; 
  746.    --  Internal function for GtkAda 
  747.  
  748.    function Get_Tree_Path (Val : Glib.Values.GValue) return Gtk_Tree_Path; 
  749.    --  Extract the path from the given GValue. 
  750.  
  751.    ----------- 
  752.    -- Lists -- 
  753.    ----------- 
  754.  
  755.    function Convert (R : Gtk.Tree_Model.Gtk_Tree_Path) return System.Address; 
  756.    function Convert (R : System.Address) return Gtk.Tree_Model.Gtk_Tree_Path; 
  757.    package Gtk_Tree_Path_List is new Generic_List (Gtk.Tree_Model.Gtk_Tree_Path); 
  758.  
  759.    ------------- 
  760.    -- Signals -- 
  761.    ------------- 
  762.  
  763.    type Cb_Gtk_Tree_Model_Gtk_Tree_Path_Gtk_Tree_Iter_Void is not null access procedure 
  764.      (Self : Gtk_Tree_Model; 
  765.       Path : Gtk_Tree_Path; 
  766.       Iter : Gtk_Tree_Iter); 
  767.  
  768.    type Cb_GObject_Gtk_Tree_Path_Gtk_Tree_Iter_Void is not null access procedure 
  769.      (Self : access Glib.Object.GObject_Record'Class; 
  770.       Path : Gtk_Tree_Path; 
  771.       Iter : Gtk_Tree_Iter); 
  772.  
  773.    Signal_Row_Changed : constant Glib.Signal_Name := "row-changed"; 
  774.    procedure On_Row_Changed 
  775.       (Self  : Gtk_Tree_Model; 
  776.        Call  : Cb_Gtk_Tree_Model_Gtk_Tree_Path_Gtk_Tree_Iter_Void; 
  777.        After : Boolean := False); 
  778.    procedure On_Row_Changed 
  779.       (Self  : Gtk_Tree_Model; 
  780.        Call  : Cb_GObject_Gtk_Tree_Path_Gtk_Tree_Iter_Void; 
  781.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  782.        After : Boolean := False); 
  783.    --  This signal is emitted when a row in the model has changed. 
  784.    --  
  785.    --  Callback parameters: 
  786.    --    --  "path": a Gtk.Tree_Model.Gtk_Tree_Path identifying the changed row 
  787.    --    --  "iter": a valid Gtk.Tree_Model.Gtk_Tree_Iter pointing to the changed 
  788.    --    --  row 
  789.  
  790.    type Cb_Gtk_Tree_Model_Gtk_Tree_Path_Void is not null access procedure 
  791.      (Self : Gtk_Tree_Model; 
  792.       Path : Gtk_Tree_Path); 
  793.  
  794.    type Cb_GObject_Gtk_Tree_Path_Void is not null access procedure 
  795.      (Self : access Glib.Object.GObject_Record'Class; 
  796.       Path : Gtk_Tree_Path); 
  797.  
  798.    Signal_Row_Deleted : constant Glib.Signal_Name := "row-deleted"; 
  799.    procedure On_Row_Deleted 
  800.       (Self  : Gtk_Tree_Model; 
  801.        Call  : Cb_Gtk_Tree_Model_Gtk_Tree_Path_Void; 
  802.        After : Boolean := False); 
  803.    procedure On_Row_Deleted 
  804.       (Self  : Gtk_Tree_Model; 
  805.        Call  : Cb_GObject_Gtk_Tree_Path_Void; 
  806.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  807.        After : Boolean := False); 
  808.    --  This signal is emitted when a row has been deleted. 
  809.    -- 
  810.    --  Note that no iterator is passed to the signal handler, since the row is 
  811.    --  already deleted. 
  812.    -- 
  813.    --  This should be called by models after a row has been removed. The 
  814.    --  location pointed to by Path should be the location that the row 
  815.    --  previously was at. It may not be a valid location anymore. 
  816.  
  817.    Signal_Row_Has_Child_Toggled : constant Glib.Signal_Name := "row-has-child-toggled"; 
  818.    procedure On_Row_Has_Child_Toggled 
  819.       (Self  : Gtk_Tree_Model; 
  820.        Call  : Cb_Gtk_Tree_Model_Gtk_Tree_Path_Gtk_Tree_Iter_Void; 
  821.        After : Boolean := False); 
  822.    procedure On_Row_Has_Child_Toggled 
  823.       (Self  : Gtk_Tree_Model; 
  824.        Call  : Cb_GObject_Gtk_Tree_Path_Gtk_Tree_Iter_Void; 
  825.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  826.        After : Boolean := False); 
  827.    --  This signal is emitted when a row has gotten the first child row or 
  828.    --  lost its last child row. 
  829.    --  
  830.    --  Callback parameters: 
  831.    --    --  "path": a Gtk.Tree_Model.Gtk_Tree_Path identifying the row 
  832.    --    --  "iter": a valid Gtk.Tree_Model.Gtk_Tree_Iter pointing to the row 
  833.  
  834.    Signal_Row_Inserted : constant Glib.Signal_Name := "row-inserted"; 
  835.    procedure On_Row_Inserted 
  836.       (Self  : Gtk_Tree_Model; 
  837.        Call  : Cb_Gtk_Tree_Model_Gtk_Tree_Path_Gtk_Tree_Iter_Void; 
  838.        After : Boolean := False); 
  839.    procedure On_Row_Inserted 
  840.       (Self  : Gtk_Tree_Model; 
  841.        Call  : Cb_GObject_Gtk_Tree_Path_Gtk_Tree_Iter_Void; 
  842.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  843.        After : Boolean := False); 
  844.    --  This signal is emitted when a new row has been inserted in the model. 
  845.    -- 
  846.    --  Note that the row may still be empty at this point, since it is a 
  847.    --  common pattern to first insert an empty row, and then fill it with the 
  848.    --  desired values. 
  849.    --  
  850.    --  Callback parameters: 
  851.    --    --  "path": a Gtk.Tree_Model.Gtk_Tree_Path identifying the new row 
  852.    --    --  "iter": a valid Gtk.Tree_Model.Gtk_Tree_Iter pointing to the new row 
  853.  
  854.    type Cb_Gtk_Tree_Model_Gtk_Tree_Path_Gtk_Tree_Iter_Address_Void is not null access procedure 
  855.      (Self      : Gtk_Tree_Model; 
  856.       Path      : Gtk_Tree_Path; 
  857.       Iter      : Gtk_Tree_Iter; 
  858.       New_Order : System.Address); 
  859.  
  860.    type Cb_GObject_Gtk_Tree_Path_Gtk_Tree_Iter_Address_Void is not null access procedure 
  861.      (Self      : access Glib.Object.GObject_Record'Class; 
  862.       Path      : Gtk_Tree_Path; 
  863.       Iter      : Gtk_Tree_Iter; 
  864.       New_Order : System.Address); 
  865.  
  866.    Signal_Rows_Reordered : constant Glib.Signal_Name := "rows-reordered"; 
  867.    procedure On_Rows_Reordered 
  868.       (Self  : Gtk_Tree_Model; 
  869.        Call  : Cb_Gtk_Tree_Model_Gtk_Tree_Path_Gtk_Tree_Iter_Address_Void; 
  870.        After : Boolean := False); 
  871.    procedure On_Rows_Reordered 
  872.       (Self  : Gtk_Tree_Model; 
  873.        Call  : Cb_GObject_Gtk_Tree_Path_Gtk_Tree_Iter_Address_Void; 
  874.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  875.        After : Boolean := False); 
  876.    --  This signal is emitted when the children of a node in the 
  877.    --  Gtk.Tree_Model.Gtk_Tree_Model have been reordered. 
  878.    -- 
  879.    --  Note that this signal is *not* emitted when rows are reordered by DND, 
  880.    --  since this is implemented by removing and then reinserting the row. 
  881.    --  
  882.    --  Callback parameters: 
  883.    --    --  "path": a Gtk.Tree_Model.Gtk_Tree_Path identifying the tree node whose 
  884.    --    --  children have been reordered 
  885.    --    --  "iter": a valid Gtk.Tree_Model.Gtk_Tree_Iter pointing to the node whose 
  886.    --    --  "new_order": an array of integers mapping the current position of each 
  887.    --    --  child to its old position before the re-ordering, i.e. 
  888.    --    --  New_Order'[newpos] = oldpos' 
  889.  
  890.    ---------------- 
  891.    -- Interfaces -- 
  892.    ---------------- 
  893.    --  This class implements several interfaces. See Glib.Types 
  894.    -- 
  895.    --  - "Gtk_Tree_Model" 
  896.  
  897.    function "+" (W : Gtk_Tree_Model) return Gtk_Tree_Model; 
  898.    pragma Inline ("+"); 
  899.  
  900. private 
  901. type Gtk_Tree_Iter is record 
  902.    Stamp : Gint; 
  903.    User_Data : System.Address; 
  904.    User_Data2 : System.Address; 
  905.    User_Data3 : System.Address; 
  906. end record; 
  907. pragma Convention (C, Gtk_Tree_Iter); 
  908.  
  909.  
  910. Null_Gtk_Tree_Model : constant Gtk_Tree_Model := 
  911.    Gtk_Tree_Model (Glib.Types.Null_Interface); 
  912.  
  913.    Null_Iter : constant Gtk_Tree_Iter := 
  914.      (0, System.Null_Address, System.Null_Address, System.Null_Address); 
  915.         
  916.  
  917.    Null_Gtk_Tree_Path : constant Gtk_Tree_Path := (Glib.C_Boxed with null record); 
  918.  
  919. end Gtk.Tree_Model;