1. ----------------------------------------------------------------------- 
  2. --              GtkAda - Ada95 binding for Gtk+/Gnome                -- 
  3. --                                                                   -- 
  4. --               Copyright (C) 2001-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. -- -- -- -- -- -- -- -- -- -- -- --
  22. ----------------------------------------------------------------------- 
  23.  
  24. --  <description> 
  25. --  The type Gtk_Tree_Model defined in this model defines an abstract interface 
  26. --  to represent sets of data that will be displayed in a Gtk_Tree_View. 
  27. --  Various default implementations are provided  in the Gtk.Tree_Store and 
  28. --  Gtk.List_Store packages. 
  29. -- 
  30. --  Data are considered as being organized into a tree-like structure. 
  31. -- 
  32. --  This package also defines a number of other types to manipulate these 
  33. --  models: 
  34. -- 
  35. --  A Gtk_Tree_Path is a textual pointer to a specific row/node in the 
  36. --  model. It is a column separate list of numbers, that indicate the index of 
  37. --  the child they point to. 
  38. --  For instance, "10:4:0" would points to the first (0) child of the fifth (4) 
  39. --  child of the eleventh child of the root. The depth of this path is 3. 
  40. -- 
  41. --  A Gtk_Tree_Iter is similar to a path, but is a direct pointer to the actual 
  42. --  data. It is also more efficient to use than paths. 
  43. -- 
  44. --  A Gtk_Row_Reference is an object that tracks model changes, so that it 
  45. --  always refere to the same row. A Gtk_Tree_Path refers to a position in the 
  46. --  model, not a fixed row. 
  47. -- 
  48. --  </description> 
  49. --  <c_version>2.8.17</c_version> 
  50. --  <group>Trees and Lists</group> 
  51.  
  52. with Ada.Unchecked_Conversion; 
  53. with Glib.Glist; 
  54. with Glib.Object; 
  55. with Glib.Values; 
  56.  
  57. package Gtk.Tree_Model is 
  58.  
  59.    type Gtk_Tree_Model_Record is new Glib.Object.GObject_Record 
  60.      with private; 
  61.    type Gtk_Tree_Model is access all Gtk_Tree_Model_Record'Class; 
  62.    --  This is an abstract interface 
  63.  
  64.    type Gtk_Tree_Path is new Glib.C_Proxy; 
  65.    type Gtk_Tree_Iter is private; 
  66.  
  67.    type Tree_Model_Flags is mod 2 ** 32; 
  68.    Tree_Model_Iters_Persist : constant Tree_Model_Flags; 
  69.    Tree_Model_List_Only     : constant Tree_Model_Flags; 
  70.  
  71.    ----------------- 
  72.    -- Tree models -- 
  73.    ----------------- 
  74.  
  75.    function Get_Type return Glib.GType; 
  76.    --  Return the internal value associated with a Gtk_Tree_Model. 
  77.  
  78.    function Get_Flags (Model : access Gtk_Tree_Model_Record) 
  79.       return Tree_Model_Flags; 
  80.    --  Return a set of flags supported by this interface. The flags 
  81.    --  supported should not change during the lifecycle of the tree_model. 
  82.    --  The flags should not change in the lifetime of the model. 
  83.  
  84.    function Get_N_Columns (Tree_Model : access Gtk_Tree_Model_Record) 
  85.      return Gint; 
  86.    --  Return the number of columns supported by Tree_Model. 
  87.  
  88.    function Get_Column_Type 
  89.      (Tree_Model : access Gtk_Tree_Model_Record; Index : Gint) return GType; 
  90.    --  Return the type of the Index-th column in the model. 
  91.  
  92.    type Gtk_Tree_Model_Foreach_Func is access function 
  93.      (Model     : access Gtk_Tree_Model_Record'Class; 
  94.       Path      : Gtk_Tree_Path; 
  95.       Iter      : Gtk_Tree_Iter; 
  96.       User_Data : System.Address) return Boolean; 
  97.  
  98.    procedure Foreach 
  99.      (Model     : access Gtk_Tree_Model_Record; 
  100.       Func      : Gtk_Tree_Model_Foreach_Func; 
  101.       User_Data : System.Address); 
  102.    --  Calls func on each node in model in a depth-first fashion. If func 
  103.    --  returns True, then the tree ceases to be walked, and Foreach returns. 
  104.  
  105.    ------------------------ 
  106.    -- Paths manipulation -- 
  107.    ------------------------ 
  108.  
  109.    function Gtk_New (Path : String := "") return Gtk_Tree_Path; 
  110.    --  Create a new Gtk_Tree_Path from a path string. 
  111.    --  Path should have the format described above, like "10:4:0". If it is the 
  112.    --  empty string, then a Gtk_Tree_Path of depth 0 is returned. 
  113.    --  The memory allocated for the path must be freed explicitely by calling 
  114.    --  Path_Free below. 
  115.  
  116.    function Gtk_New_First return Gtk_Tree_Path; 
  117.    --  Return a new path pointed to the first row in the model. The string 
  118.    --  representation is "0" 
  119.  
  120.    function Path_Get_Type return Glib.GType; 
  121.    --  Return the internal type used for Gtk_Tree_Path 
  122.  
  123.    function To_String (Path : Gtk_Tree_Path) return String; 
  124.    --  Generate a string representation of the path. 
  125.    --  This string is a colon-separated list of numbers, as described above. 
  126.  
  127.    function Get_Tree_Path (Val : Glib.Values.GValue) return Gtk_Tree_Path; 
  128.    --  Extract the path from the given GValue. 
  129.  
  130.    procedure Append_Index (Path : Gtk_Tree_Path; Index : Gint); 
  131.    --  Append a new index to a path. 
  132.    --  As a result, the depth of the path is increased. See Path_Up for the 
  133.    --  opposite operation. 
  134.  
  135.    procedure Prepend_Index (Path : Gtk_Tree_Path; Index : Gint); 
  136.    --  Prepend a new index to a path.  As a result, the depth of the path is 
  137.    --  increased. 
  138.  
  139.    function Get_Depth (Path : Gtk_Tree_Path) return Gint; 
  140.    --  Return the current depth of Path. 
  141.  
  142.    function Get_Indices (Path : Gtk_Tree_Path) return Glib.Gint_Array; 
  143.    --  Return the list of indices from the path. This is an array of integers, 
  144.    --  each representing a node in a tree, as described in the path format. 
  145.  
  146.    procedure Path_Free (Path : Gtk_Tree_Path); 
  147.    --  Free the memory allocated for Path. 
  148.  
  149.    function Copy (Path : Gtk_Tree_Path) return Gtk_Tree_Path; 
  150.    --  Create a new Gtk_Tree_Path as a copy of Path. The memory allocated for 
  151.    --  the new path must be freed by a call to Path_Free. 
  152.  
  153.    function Compare (A, B : Gtk_Tree_Path) return Gint; 
  154.    --  Compare two paths.  If A appears before B in a tree, then -1 is 
  155.    --  returned.  If B appears before A, then 1 is returned.  If the two nodes 
  156.    --  are equal, then 0 is returned. 
  157.  
  158.    procedure Next (Path : Gtk_Tree_Path); 
  159.    --  Move the Path to point to the next node at the current depth. In effect, 
  160.    --  it increments the last indice of the path. Note that the path might 
  161.    --  become invalid if there is no more node at this depth. 
  162.  
  163.    function Prev (Path : Gtk_Tree_Path) return Boolean; 
  164.    --  Move Path to point to the previous node at the current depth, 
  165.    --  if it exists. 
  166.    --  Return True if Path has a previous node, and the move was made. If it 
  167.    --  returns False, then Path has not been changed. 
  168.  
  169.    function Up (Path : Gtk_Tree_Path) return Boolean; 
  170.    --  Moves the Path to point to it's parent node, if it has a parent. 
  171.    --  Return True if Path has a parent, and the move was made. 
  172.    --  In practive, the depth of Path is decreased by 1. 
  173.  
  174.    procedure Down (Path : Gtk_Tree_Path); 
  175.    --  Moves Path to point to the first child of the current path. 
  176.  
  177.    function Is_Ancestor (Path, Descendant : Gtk_Tree_Path) return Boolean; 
  178.    --  Return True if Descendant is contained inside Path. 
  179.  
  180.    function Is_Descendant (Path, Ancestor : Gtk_Tree_Path) return Boolean; 
  181.    --  Return True if Path is contained inside Ancestor. 
  182.  
  183.    function Convert is new Ada.Unchecked_Conversion 
  184.      (Gtk_Tree_Path, System.Address); 
  185.    function Convert is new Ada.Unchecked_Conversion 
  186.      (System.Address, Gtk_Tree_Path); 
  187.    package Gtk_Tree_Path_List is new Glib.Glist.Generic_List (Gtk_Tree_Path); 
  188.  
  189.    -------------------------------- 
  190.    -- Row_Reference manipulation -- 
  191.    -------------------------------- 
  192.  
  193.    type Gtk_Tree_Row_Reference is new Glib.C_Proxy; 
  194.  
  195.    function Gtk_New 
  196.      (Model : access Gtk_Tree_Model_Record; 
  197.       Path  : Gtk_Tree_Path) 
  198.       return Gtk_Tree_Row_Reference; 
  199.    --  Create a row reference based on Path. This reference will keep pointing 
  200.    --  to the node pointed to by Path, so long as it exists.  It listens to 
  201.    --  all signals on model, and updates it's path appropriately.  If Path 
  202.    --  isn't a valid path in Model, then null is returned. 
  203.  
  204.    function Row_Reference_Get_Type return Glib.GType; 
  205.    --  Return the internal type used for row reference. 
  206.  
  207.    function Get_Path (Reference : Gtk_Tree_Row_Reference) return Gtk_Tree_Path; 
  208.    --  Return the path that Reference currently points to. 
  209.    --  null is returned if Reference is no longer valid. 
  210.    --  The caller must free the returned path. 
  211.  
  212.    function Valid (Reference : Gtk_Tree_Row_Reference) return Boolean; 
  213.    --  Return True if Reference is non null and is still valid. 
  214.  
  215.    function Row_Reference_Copy 
  216.      (Ref : Gtk_Tree_Row_Reference) return Gtk_Tree_Row_Reference; 
  217.    --  Return a newly allocated copy of Ref 
  218.  
  219.    procedure Row_Reference_Free (Reference : Gtk_Tree_Row_Reference); 
  220.    --  Free the memory occupied by Reference. 
  221.  
  222.    function Get_Model 
  223.      (Reference : Gtk_Tree_Row_Reference) return Gtk_Tree_Model; 
  224.    --  Returns the model which Reference is monitoring in order to 
  225.    --  appropriately the path. 
  226.  
  227.    --------------- 
  228.    -- Iterators -- 
  229.    --------------- 
  230.    --  ??? Need to be able to access the user_data fields, so that new models 
  231.    --  can define their own iterators 
  232.  
  233.    Null_Iter : constant Gtk_Tree_Iter; 
  234.  
  235.    function "=" (Left : Gtk_Tree_Iter; Right : Gtk_Tree_Iter) return Boolean; 
  236.  
  237.    function Iter_Get_Type return Glib.GType; 
  238.    --  Return the internal type used for iterators 
  239.  
  240.    procedure Iter_Copy (Source : Gtk_Tree_Iter; Dest : out Gtk_Tree_Iter); 
  241.    --  Create a copy of Source. 
  242.    --  You can also copy tree iters simply by using the ":=" Ada construct. 
  243.  
  244.    procedure Set_Tree_Iter 
  245.      (Val  : in out Glib.Values.GValue; 
  246.       Iter : Gtk_Tree_Iter); 
  247.    --  Set the value of the given GValue to Iter. 
  248.    --  Note that Iter is stored by reference, which means no copy of Iter 
  249.    --  is made. Iter should remain allocated as long as Val is being used. 
  250.  
  251.    procedure Get_Tree_Iter 
  252.      (Val  : Glib.Values.GValue; 
  253.       Iter : out Gtk_Tree_Iter); 
  254.    --  Extract the iterator from the given GValue. 
  255.    --  Note that the iterator returned is a copy of the iterator referenced 
  256.    --  by the give GValue. Modifying the iterator returned does not modify 
  257.    --  the iterator referenced by the GValue. 
  258.  
  259.    function Get_Tree_Iter (Val : Glib.Values.GValue) return Gtk_Tree_Iter; 
  260.    --  Extract the iterator from the given GValue. 
  261.  
  262.    function To_Address (Iter : Gtk_Tree_Iter) return System.Address; 
  263.    --  Returns address of the specified iterator. 
  264.  
  265.    function Get_Iter 
  266.      (Tree_Model : access Gtk_Tree_Model_Record; 
  267.       Path       : Gtk_Tree_Path) return Gtk_Tree_Iter; 
  268.    --  Return an iterator pointing to Path. 
  269.    --  Null_Iter is returned if Path was invalid or no iterator could be set. 
  270.  
  271.    function Get_Iter_From_String 
  272.      (Tree_Model  : access Gtk_Tree_Model_Record; 
  273.       Path_String : String) return Gtk_Tree_Iter; 
  274.    --  Return an iterator pointing to Path_String. 
  275.    --  Null_Iter is returned if Path was invalid or no iterator could be set. 
  276.  
  277.    function Get_String_From_Iter 
  278.      (Tree_Model : access Gtk_Tree_Model_Record; 
  279.       Iter       : Gtk_Tree_Iter) return String; 
  280.    --  Generates a string representation of the iter. This string is a ':' 
  281.    --  separated list of numbers. For example, "4:10:0:3" would be an 
  282.    --  acceptable return value for this string. 
  283.  
  284.    function Get_Iter_First 
  285.      (Tree_Model : access Gtk_Tree_Model_Record) return Gtk_Tree_Iter; 
  286.    --  Return an iterator pointing to the root of Tree_Model. 
  287.    --  Null_Iter is returned if Tree_Model is empty. 
  288.  
  289.    function Get_Path 
  290.      (Tree_Model : access Gtk_Tree_Model_Record; 
  291.       Iter       : Gtk_Tree_Iter) return Gtk_Tree_Path; 
  292.    --  Return a newly created Gtk_Tree_Path referenced by Iter. 
  293.    --  This path must be freed with Path_Free. 
  294.  
  295.    procedure Next 
  296.      (Tree_Model : access Gtk_Tree_Model_Record; 
  297.       Iter       : in out Gtk_Tree_Iter); 
  298.    --  Sets Iter to point to the node following it at the current level. 
  299.    --  If there is none, Iter is set to Null_Iter. 
  300.  
  301.    function Children 
  302.      (Tree_Model : access Gtk_Tree_Model_Record; 
  303.       Parent     : Gtk_Tree_Iter) return Gtk_Tree_Iter; 
  304.    --  Return the first child of Parent. 
  305.    --  If Parent has no children, return Null_Iter. 
  306.    --  Parent will remain a valid node after this function has been called. 
  307.  
  308.    function Has_Child 
  309.      (Tree_Model : access Gtk_Tree_Model_Record; 
  310.       Iter       : Gtk_Tree_Iter) return Boolean; 
  311.    --  Return True if Iter has children, False otherwise. 
  312.  
  313.    function N_Children 
  314.      (Tree_Model : access Gtk_Tree_Model_Record; 
  315.       Iter       : Gtk_Tree_Iter := Null_Iter) return Gint; 
  316.    --  Return the number of children that Iter has. 
  317.    --  As a special case, if Iter is Null_Iter, then the number of toplevel 
  318.    --  nodes is returned. 
  319.  
  320.    function Nth_Child 
  321.      (Tree_Model : access Gtk_Tree_Model_Record; 
  322.       Parent     : Gtk_Tree_Iter; 
  323.       N          : Gint) return Gtk_Tree_Iter; 
  324.    --  Return the child of Parent, using the given index. 
  325.    --  The First index is 0. If Index is too big, or Parent has no children, 
  326.    --  return Null_Iter. 
  327.    --  If Parent is Null_Iter, then the nth root node is set. 
  328.  
  329.    function Parent 
  330.      (Tree_Model : access Gtk_Tree_Model_Record; 
  331.       Child      : Gtk_Tree_Iter) return Gtk_Tree_Iter; 
  332.    --  Return the parent of Child. 
  333.    --  If Child is at the toplevel, and doesn't have a parent, then Null_Iter 
  334.    --  is returned. 
  335.  
  336.    procedure Ref_Node 
  337.      (Tree_Model : access Gtk_Tree_Model_Record; 
  338.       Iter       : Gtk_Tree_Iter); 
  339.    --  Let the tree reference the node. 
  340.    --  This is an optional method for models to implement. 
  341.    --  To be more specific, models may ignore this call as it exists primarily 
  342.    --  for performance reasons. This function is primarily meant as a way for 
  343.    --  views to let caching model know when nodes are being displayed (and 
  344.    --  hence, whether or not to cache that node). For example, a file-system 
  345.    --  based model would not want to keep the entire file-hierarchy in memory, 
  346.    --  just the sections that are currently being displayed by every current 
  347.    --  view. 
  348.  
  349.    procedure Unref_Node 
  350.      (Tree_Model : access Gtk_Tree_Model_Record; 
  351.       Iter       : Gtk_Tree_Iter); 
  352.    --  Let the tree unref the node. 
  353.    --  This is an optional method for models to implement. To be more specific, 
  354.    --  models may ignore this call as it exists primarily for performance 
  355.    --  reasons. For more information on what this means, please see 
  356.    --  Tree_Model_Ref_Node. Please note that nodes that are deleted are not 
  357.    --  unreferenced. 
  358.  
  359.    procedure Get_Value 
  360.      (Tree_Model : access Gtk_Tree_Model_Record; 
  361.       Iter       : Gtk_Tree_Iter; 
  362.       Column     : Gint; 
  363.       Value      : out Glib.Values.GValue); 
  364.    --  Get a value from the model, at column Column and line Iter. 
  365.    --  Value must be freed by the caller. 
  366.  
  367.    function Get_Int 
  368.      (Tree_Model : access Gtk_Tree_Model_Record; 
  369.       Iter       : Gtk_Tree_Iter; 
  370.       Column     : Gint) return Gint; 
  371.    --  Get the int value of one cell in the row referenced by Iter. 
  372.  
  373.    function Get_Boolean 
  374.      (Tree_Model : access Gtk_Tree_Model_Record; 
  375.       Iter       : Gtk_Tree_Iter; 
  376.       Column     : Gint) return Boolean; 
  377.    --  Get the boolean value of one cell in the row referenced by Iter. 
  378.  
  379.    function Get_Object 
  380.      (Tree_Model : access Gtk_Tree_Model_Record; 
  381.       Iter       : Gtk_Tree_Iter; 
  382.       Column     : Gint) return Glib.Object.GObject; 
  383.    --  Get the object value of one cell in the row referenced by Iter. 
  384.  
  385.    function Get_C_Proxy 
  386.      (Tree_Model : access Gtk_Tree_Model_Record; 
  387.       Iter       : Gtk_Tree_Iter; 
  388.       Column     : Gint) return Glib.C_Proxy; 
  389.    --  Get the address value of one cell in the row referenced by Iter. 
  390.  
  391.    function Get_String 
  392.      (Tree_Model : access Gtk_Tree_Model_Record; 
  393.       Iter       : Gtk_Tree_Iter; 
  394.       Column     : Gint) return UTF8_String; 
  395.    --  Get the string stored at a specific location in the model. 
  396.  
  397.    function Get_Address 
  398.      (Tree_Model : access Gtk_Tree_Model_Record; 
  399.       Iter       : Gtk_Tree_Iter; 
  400.       Column     : Gint) return System.Address; 
  401.    --  Get the pointer stored at a specific location in the model. 
  402.  
  403.    ------------- 
  404.    -- Signals -- 
  405.    ------------- 
  406.  
  407.    --  <signals> 
  408.    --  The following new signals are defined for this widget: 
  409.    -- 
  410.    --  - "row_changed" 
  411.    --    procedure Handler 
  412.    --       (Tree_Model : access Gtk_Tree_Model_Record'Class; 
  413.    --        Path       : Gtk_Tree_Path; 
  414.    --        Iter       : Gtk_Tree_Iter); 
  415.    --    This signal should be emitted every time the contents of a row (any 
  416.    --    column) has changed. This forces the tree_view to refresh the display. 
  417.    -- 
  418.    --  - "row_inserted" 
  419.    --    procedure Handler 
  420.    --      (Tree_Model : access Gtk_Tree_Model_Record'Class; 
  421.    --       Path       : Gtk_Tree_Path; 
  422.    --       Iter       : Gtk_Tree_Iter); 
  423.    --    This signal should be emitted every time a new row has been inserted. 
  424.    -- 
  425.    --  - "row_has_child_toggled" 
  426.    --    procedure Handler 
  427.    --      (Tree_Model : access Gtk_Tree_Model_Record'Class; 
  428.    --       Path       : Gtk_Tree_Path; 
  429.    --       Iter       : Gtk_Tree_Iter); 
  430.    --    This should be emitted by models after the child state of a node 
  431.    --    changes. 
  432.    -- 
  433.    --  - "row_deleted" 
  434.    --    procedure Handler 
  435.    --      (Tree_Model : access Gtk_Tree_Model_Record'Class; 
  436.    --       Path       : Gtk_Tree_Path); 
  437.    --    This should be emitted by models after the child state of a node 
  438.    --    changes. 
  439.    -- 
  440.    --  - "rows_reordered" 
  441.    --    procedure Handler 
  442.    --      (Tree_Model : access Gtk_Tree_Model_Record'Class; 
  443.    --       Path       : Gtk_Tree_Path; 
  444.    --       Iter       : Gtk_Tree_Iter; 
  445.    --       New_Order  : Gint_Array); 
  446.    --   This should be emitted when the rows have been reordered 
  447.    -- 
  448.    --  </signals> 
  449.  
  450.    procedure Row_Changed 
  451.      (Tree_Model : access Gtk_Tree_Model_Record'Class; 
  452.       Path       : Gtk_Tree_Path; 
  453.       Iter       : Gtk_Tree_Iter); 
  454.    --  Emit the "row_changed" signal. 
  455.  
  456.    procedure Row_Inserted 
  457.      (Tree_Model : access Gtk_Tree_Model_Record'Class; 
  458.       Path       : Gtk_Tree_Path; 
  459.       Iter       : Gtk_Tree_Iter); 
  460.    --  Emit the "row_inserted" signal. 
  461.  
  462.    procedure Row_Has_Child_Toggled 
  463.      (Tree_Model : access Gtk_Tree_Model_Record'Class; 
  464.       Path       : Gtk_Tree_Path; 
  465.       Iter       : Gtk_Tree_Iter); 
  466.    --  Emit the "row_has_child_toggled" signal. 
  467.  
  468.    procedure Row_Deleted 
  469.      (Tree_Model : access Gtk_Tree_Model_Record'Class; 
  470.       Path       : Gtk_Tree_Path); 
  471.    --  Emit the "row_has_child_toggled" signal. 
  472.  
  473.    procedure Rows_Reordered 
  474.      (Tree_Model : access Gtk_Tree_Model_Record'Class; 
  475.       Path       : Gtk_Tree_Path; 
  476.       Iter       : Gtk_Tree_Iter; 
  477.       New_Order  : Gint_Array); 
  478.    --  Emit the "rows_reordered" signal 
  479.  
  480.    Signal_Row_Changed           : constant Glib.Signal_Name := 
  481.                                     "row_changed"; 
  482.    Signal_Row_Inserted          : constant Glib.Signal_Name := 
  483.                                     "row_inserted"; 
  484.    Signal_Row_Has_Child_Toggled : constant Glib.Signal_Name := 
  485.                                     "row_has_child_toggled"; 
  486.    Signal_Row_Deleted           : constant Glib.Signal_Name := 
  487.                                     "row_deleted"; 
  488.    Signal_Rows_Reordered        : constant Glib.Signal_Name := 
  489.                                     "rows_reordered"; 
  490.  
  491. private 
  492.    pragma Convention (C, Tree_Model_Flags); 
  493.    Tree_Model_Iters_Persist : constant Tree_Model_Flags := 2 ** 0; 
  494.    Tree_Model_List_Only     : constant Tree_Model_Flags := 2 ** 1; 
  495.  
  496.    type Gtk_Tree_Model_Record is new Glib.Object.GObject_Record 
  497.      with null record; 
  498.  
  499.    type Gtk_Tree_Iter is record 
  500.       Stamp      : Gint; 
  501.       User_Data  : System.Address; 
  502.       User_Data2 : System.Address; 
  503.       User_Data3 : System.Address; 
  504.    end record; 
  505.    pragma Convention (C, Gtk_Tree_Iter); 
  506.  
  507.    Null_Iter : constant Gtk_Tree_Iter := 
  508.      (0, System.Null_Address, System.Null_Address, System.Null_Address); 
  509.  
  510.    pragma Import (C, Get_Type,      "gtk_tree_model_get_type"); 
  511.    pragma Import (C, Row_Reference_Free, "gtk_tree_row_reference_free"); 
  512.    pragma Import (C, Append_Index,  "gtk_tree_path_append_index"); 
  513.    pragma Import (C, Prepend_Index, "gtk_tree_path_prepend_index"); 
  514.    pragma Import (C, Get_Depth,     "gtk_tree_path_get_depth"); 
  515.    pragma Import (C, Path_Free,     "gtk_tree_path_free"); 
  516.    pragma Import (C, Copy,          "gtk_tree_path_copy"); 
  517.    pragma Import (C, Compare,       "gtk_tree_path_compare"); 
  518.    pragma Import (C, Down,          "gtk_tree_path_down"); 
  519.    pragma Import (C, Iter_Get_Type, "gtk_tree_iter_get_type"); 
  520.    pragma Import (C, Path_Get_Type, "gtk_tree_path_get_type"); 
  521.    pragma Import (C, Gtk_New_First, "gtk_tree_path_new_first"); 
  522.    pragma Import (C, Iter_Copy,     "ada_tree_iter_copy"); 
  523.    pragma Import (C, Row_Reference_Copy, "gtk_tree_row_reference_copy"); 
  524.    pragma Import 
  525.      (C, Row_Reference_Get_Type, "gtk_tree_row_reference_get_type"); 
  526.  
  527.    pragma Import (C, Set_Tree_Iter, "g_value_set_pointer"); 
  528.    --  External binding: g_value_set_pointer 
  529.  
  530. end Gtk.Tree_Model; 
  531.  
  532. --  This function is not intended to be used by applications anyway 
  533. --  No binding: gtk_tree_iter_copy 
  534. --  No binding: gtk_tree_iter_free 
  535.  
  536. --  variable number of arguments, no convenient binding 
  537. --  No binding: gtk_tree_model_get 
  538. --  No binding: gtk_tree_model_get_valist 
  539. --  No binding: gtk_tree_path_new_from_indices 
  540.  
  541. --  Not needed by most applications, in fact, only for low-level monitoring: 
  542. --  No binding: gtk_tree_row_reference_deleted 
  543. --  No binding: gtk_tree_row_reference_inserted 
  544. --  No binding: gtk_tree_row_reference_new_proxy 
  545. --  No binding: gtk_tree_row_reference_reordered