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-- As a special exception, if other files instantiate generics from  --
23-- this unit, or you link this unit with other files to produce an   --
24-- executable, this  unit  does not  by itself cause  the resulting  --
25-- executable to be covered by the GNU General Public License. This  --
26-- exception does not however invalidate any other reasons why the   --
27-- executable file  might be covered by the  GNU Public License.     --
28-----------------------------------------------------------------------
29
30--  <group>Glib, the general-purpose library</group>
31with Glib.Enums; use Glib.Enums;
32
33package Glib.Gnodes is
34
35   type Gnode is new C_Proxy;
36
37   --  pop_allocator
38   --  push_allocator
39
40   function Child_Position (Node  : in Gnode; Child : in Gnode) return Gint;
41
42   function Depth (Node : in Gnode) return Guint;
43
44   procedure Destroy (Node : in out Gnode);
45
46   function First_Child (Node : in Gnode) return Gnode;
47
48   function First_Sibling (Node : in Gnode) return Gnode;
49
50   function Get_Root (Node : in Gnode) return Gnode;
51
52   procedure Insert
53     (Parent   : in out Gnode;
54      Position : in     Gint;
55      Node     : in out Gnode);
56
57   procedure Insert_Before
58     (Parent  : in out Gnode;
59      Sibling : in out Gnode;
60      Node    : in out Gnode);
61
62   function Is_Ancestor
63     (Node       : in Gnode;
64      Descendant : in Gnode) return Boolean;
65
66   function Is_Leaf (Node : in Gnode) return Boolean;
67
68   function Is_Root (Node : in Gnode) return Boolean;
69
70   function Last_Child (Node : in Gnode) return Gnode;
71
72   function Last_Sibling (Node : in Gnode) return Gnode;
73
74   function Max_Height (Root : in Gnode) return Guint;
75
76   function N_Nodes
77     (Root  : in Gnode; Flags : in Glib_Traverse_Flags) return Guint;
78
79   function Next_Sibling (Node : in Gnode) return Gnode;
80
81   function Nth_Child (Node : in Gnode; N : in Guint) return Gnode;
82
83   procedure Prepend (Parent : in out Gnode; Node : in out Gnode);
84
85   function Prev_Sibling (Node : in Gnode) return Gnode;
86
87   procedure Reverse_Children (Node : in out Gnode);
88
89   procedure Unlink (Node : in out Gnode);
90
91   generic
92      type Element (<>) is private;
93      type Element_Access is access all Element;
94   package Gnode_Data is
95
96      --  type Gnode_Traverse_Func
97      --  type Gnode_Foreach_Func
98
99      --  child_index
100      --  children_foreach
101      --  find
102      --  find_child
103
104      procedure Glib_New (Node : out Gnode; Data : in Element_Access);
105
106      --  traverse
107   end Gnode_Data;
108
109private
110   pragma Import (C, Child_Position, "g_node_child_position");
111   pragma Import (C, Depth, "g_node_depth");
112   pragma Import (C, First_Child, "ada_gnode_first_child");
113   pragma Import (C, First_Sibling, "g_node_first_sibling");
114   pragma Import (C, Get_Root, "g_node_get_root");
115   pragma Import (C, Insert, "g_node_insert");
116   pragma Import (C, Insert_Before, "g_node_insert_before");
117   pragma Import (C, Last_Child, "g_node_last_child");
118   pragma Import (C, Last_Sibling, "g_node_last_sibling");
119   pragma Import (C, Max_Height, "g_node_max_height");
120   pragma Import (C, Next_Sibling, "ada_gnode_next_sibling");
121   pragma Import (C, Nth_Child, "g_node_nth_child");
122   pragma Import (C, Prepend, "g_node_prepend");
123   pragma Import (C, Prev_Sibling, "ada_gnode_prev_sibling");
124   pragma Import (C, Reverse_Children, "g_node_reverse_children");
125   pragma Import (C, Unlink, "g_node_unlink");
126end Glib.Gnodes;
127