1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   -- 
  5. --                Copyright (C) 2000-2001 ACT-Europe                 -- 
  6. --                                                                   -- 
  7. -- This library is free software; you can redistribute it and/or     -- 
  8. -- modify it under the terms of the GNU General Public               -- 
  9. -- License as published by the Free Software Foundation; either      -- 
  10. -- version 2 of the License, or (at your option) any later version.  -- 
  11. --                                                                   -- 
  12. -- This library is distributed in the hope that it will be useful,   -- 
  13. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  14. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  15. -- General Public License for more details.                          -- 
  16. --                                                                   -- 
  17. -- You should have received a copy of the GNU General Public         -- 
  18. -- License along with this library; if not, write to the             -- 
  19. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  20. -- Boston, MA 02111-1307, USA.                                       -- 
  21. --                                                                   -- 
  22. -- -- -- -- -- -- -- -- -- -- -- --
  23. ----------------------------------------------------------------------- 
  24.  
  25. --  <group>Glib, the general-purpose library</group> 
  26. with Glib.Enums; use Glib.Enums; 
  27.  
  28. package Glib.Gnodes is 
  29.  
  30.    type Gnode is new C_Proxy; 
  31.  
  32.    --  pop_allocator 
  33.    --  push_allocator 
  34.  
  35.    function Child_Position (Node  : in Gnode; Child : in Gnode) return Gint; 
  36.  
  37.    function Depth (Node : in Gnode) return Guint; 
  38.  
  39.    procedure Destroy (Node : in out Gnode); 
  40.  
  41.    function First_Child (Node : in Gnode) return Gnode; 
  42.  
  43.    function First_Sibling (Node : in Gnode) return Gnode; 
  44.  
  45.    function Get_Root (Node : in Gnode) return Gnode; 
  46.  
  47.    procedure Insert 
  48.      (Parent   : in out Gnode; 
  49.       Position : in     Gint; 
  50.       Node     : in out Gnode); 
  51.  
  52.    procedure Insert_Before 
  53.      (Parent  : in out Gnode; 
  54.       Sibling : in out Gnode; 
  55.       Node    : in out Gnode); 
  56.  
  57.    function Is_Ancestor 
  58.      (Node       : in Gnode; 
  59.       Descendant : in Gnode) return Boolean; 
  60.  
  61.    function Is_Leaf (Node : in Gnode) return Boolean; 
  62.  
  63.    function Is_Root (Node : in Gnode) return Boolean; 
  64.  
  65.    function Last_Child (Node : in Gnode) return Gnode; 
  66.  
  67.    function Last_Sibling (Node : in Gnode) return Gnode; 
  68.  
  69.    function Max_Height (Root : in Gnode) return Guint; 
  70.  
  71.    function N_Nodes 
  72.      (Root  : in Gnode; Flags : in Glib_Traverse_Flags) return Guint; 
  73.  
  74.    function Next_Sibling (Node : in Gnode) return Gnode; 
  75.  
  76.    function Nth_Child (Node : in Gnode; N : in Guint) return Gnode; 
  77.  
  78.    procedure Prepend (Parent : in out Gnode; Node : in out Gnode); 
  79.  
  80.    function Prev_Sibling (Node : in Gnode) return Gnode; 
  81.  
  82.    procedure Reverse_Children (Node : in out Gnode); 
  83.  
  84.    procedure Unlink (Node : in out Gnode); 
  85.  
  86.    generic 
  87.       type Element (<>) is private; 
  88.       type Element_Access is access all Element; 
  89.    package Gnode_Data is 
  90.  
  91.       --  type Gnode_Traverse_Func 
  92.       --  type Gnode_Foreach_Func 
  93.  
  94.       --  child_index 
  95.       --  children_foreach 
  96.       --  find 
  97.       --  find_child 
  98.  
  99.       procedure Glib_New (Node : out Gnode; Data : in Element_Access); 
  100.  
  101.       --  traverse 
  102.    end Gnode_Data; 
  103.  
  104. private 
  105.    pragma Import (C, Child_Position, "g_node_child_position"); 
  106.    pragma Import (C, Depth, "g_node_depth"); 
  107.    pragma Import (C, First_Child, "ada_gnode_first_child"); 
  108.    pragma Import (C, First_Sibling, "g_node_first_sibling"); 
  109.    pragma Import (C, Get_Root, "g_node_get_root"); 
  110.    pragma Import (C, Insert, "g_node_insert"); 
  111.    pragma Import (C, Insert_Before, "g_node_insert_before"); 
  112.    pragma Import (C, Last_Child, "g_node_last_child"); 
  113.    pragma Import (C, Last_Sibling, "g_node_last_sibling"); 
  114.    pragma Import (C, Max_Height, "g_node_max_height"); 
  115.    pragma Import (C, Next_Sibling, "ada_gnode_next_sibling"); 
  116.    pragma Import (C, Nth_Child, "g_node_nth_child"); 
  117.    pragma Import (C, Prepend, "g_node_prepend"); 
  118.    pragma Import (C, Prev_Sibling, "ada_gnode_prev_sibling"); 
  119.    pragma Import (C, Reverse_Children, "g_node_reverse_children"); 
  120.    pragma Import (C, Unlink, "g_node_unlink"); 
  121. end Glib.Gnodes;