]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/lablgtk/lablgtk_20001129-0.1.0/applications/radtest/gtktree2.h
Initial revision
[helm.git] / helm / DEVEL / lablgtk / lablgtk_20001129-0.1.0 / applications / radtest / gtktree2.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /*
21  * Modified by the GTK+ Team and others 1997-1999.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
25  */
26
27 #ifndef __GTK_TREE2_H__
28 #define __GTK_TREE2_H__
29
30 /* set this flag to enable tree debugging output */
31 /* #define TREE_DEBUG */
32
33 #include <gdk/gdk.h>
34 #include <gtk/gtkcontainer.h>
35
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif /* __cplusplus */
40
41
42 #define GTK_TYPE_TREE2                  (gtk_tree2_get_type ())
43 #define GTK_TREE2(obj)                  (GTK_CHECK_CAST ((obj), GTK_TYPE_TREE2, GtkTree2))
44 #define GTK_TREE2_CLASS(klass)          (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE2, GtkTree2Class))
45 #define GTK_IS_TREE2(obj)               (GTK_CHECK_TYPE ((obj), GTK_TYPE_TREE2))
46 #define GTK_IS_TREE2_CLASS(klass)       (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TREE2))
47
48 #define GTK_IS_ROOT_TREE2(obj)   ((GtkObject*) GTK_TREE2(obj)->root_tree == (GtkObject*)obj)
49 #define GTK_TREE2_ROOT_TREE(obj) (GTK_TREE2(obj)->root_tree ? GTK_TREE2(obj)->root_tree : GTK_TREE2(obj))
50 #define GTK_TREE2_SELECTION(obj) (GTK_TREE2_ROOT_TREE(obj)->selection)
51
52 typedef enum 
53 {
54   GTK_TREE2_VIEW_LINE,  /* default view mode */
55   GTK_TREE2_VIEW_ITEM
56 } GtkTree2ViewMode;
57
58 typedef struct _GtkTree2       GtkTree2;
59 typedef struct _GtkTree2Class  GtkTree2Class;
60
61 struct _GtkTree2
62 {
63   GtkContainer container;
64   
65   GList *children;
66   
67   GtkTree2* root_tree; /* owner of selection list */
68   GtkWidget* tree_owner;
69   GList *selection;
70   guint level;
71   guint indent_value;
72   guint current_indent;
73   guint selection_mode : 2;
74   guint view_mode : 1;
75   guint view_line : 1;
76 };
77
78 struct _GtkTree2Class
79 {
80   GtkContainerClass parent_class;
81   
82   void (* selection_changed) (GtkTree2   *tree);
83   void (* select_child)      (GtkTree2   *tree,
84                               GtkWidget *child);
85   void (* unselect_child)    (GtkTree2   *tree,
86                               GtkWidget *child);
87 };
88
89
90 GtkType    gtk_tree2_get_type           (void);
91 GtkWidget* gtk_tree2_new                (void);
92 void       gtk_tree2_append             (GtkTree2          *tree,
93                                         GtkWidget        *tree_item);
94 void       gtk_tree2_prepend            (GtkTree2          *tree,
95                                         GtkWidget        *tree_item);
96 void       gtk_tree2_insert             (GtkTree2          *tree,
97                                         GtkWidget        *tree_item,
98                                         gint              position);
99 void       gtk_tree2_remove_items       (GtkTree2          *tree,
100                                         GList            *items);
101 void       gtk_tree2_clear_items        (GtkTree2          *tree,
102                                         gint              start,
103                                         gint              end);
104 void       gtk_tree2_select_item        (GtkTree2          *tree,
105                                         gint              item);
106 void       gtk_tree2_unselect_item      (GtkTree2          *tree,
107                                         gint              item);
108 void       gtk_tree2_select_child       (GtkTree2          *tree,
109                                         GtkWidget        *tree_item);
110 void       gtk_tree2_unselect_child     (GtkTree2          *tree,
111                                         GtkWidget        *tree_item);
112 gint       gtk_tree2_child_position     (GtkTree2          *tree,
113                                         GtkWidget        *child);
114 void       gtk_tree2_set_selection_mode (GtkTree2          *tree,
115                                         GtkSelectionMode  mode);
116 void       gtk_tree2_set_view_mode      (GtkTree2          *tree,
117                                         GtkTree2ViewMode   mode); 
118 void       gtk_tree2_set_view_lines     (GtkTree2          *tree,
119                                         guint            flag);
120
121 /* deprecated function, use gtk_container_remove instead.
122  */
123 void       gtk_tree2_remove_item        (GtkTree2          *tree,
124                                         GtkWidget        *child);
125 void       gtk_tree2_item_up             (GtkTree2   *tree,
126                                          gint       position);
127
128 void gtk_tree2_select_next_child (GtkTree2   *tree,
129                                   GtkWidget *tree_item, gboolean descend);
130
131 void gtk_tree2_select_prev_child (GtkTree2   *tree,
132                                   GtkWidget *tree_item);
133
134 #ifdef __cplusplus
135 }
136 #endif /* __cplusplus */
137
138
139 #endif /* __GTK_TREE2_H__ */