1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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.
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.
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.
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/.
27 #ifndef __GTK_TREE2_H__
28 #define __GTK_TREE2_H__
30 /* set this flag to enable tree debugging output */
31 /* #define TREE_DEBUG */
34 #include <gtk/gtkcontainer.h>
39 #endif /* __cplusplus */
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))
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)
54 GTK_TREE2_VIEW_LINE, /* default view mode */
58 typedef struct _GtkTree2 GtkTree2;
59 typedef struct _GtkTree2Class GtkTree2Class;
63 GtkContainer container;
67 GtkTree2* root_tree; /* owner of selection list */
68 GtkWidget* tree_owner;
73 guint selection_mode : 2;
80 GtkContainerClass parent_class;
82 void (* selection_changed) (GtkTree2 *tree);
83 void (* select_child) (GtkTree2 *tree,
85 void (* unselect_child) (GtkTree2 *tree,
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,
99 void gtk_tree2_remove_items (GtkTree2 *tree,
101 void gtk_tree2_clear_items (GtkTree2 *tree,
104 void gtk_tree2_select_item (GtkTree2 *tree,
106 void gtk_tree2_unselect_item (GtkTree2 *tree,
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,
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,
121 /* deprecated function, use gtk_container_remove instead.
123 void gtk_tree2_remove_item (GtkTree2 *tree,
125 void gtk_tree2_item_up (GtkTree2 *tree,
128 void gtk_tree2_select_next_child (GtkTree2 *tree,
129 GtkWidget *tree_item, gboolean descend);
131 void gtk_tree2_select_prev_child (GtkTree2 *tree,
132 GtkWidget *tree_item);
136 #endif /* __cplusplus */
139 #endif /* __GTK_TREE2_H__ */