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