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 Lesser 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 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser 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-2000. 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 #ifdef GTK_ENABLE_BROKEN
29 #ifndef __GTK_TREE_H__
30 #define __GTK_TREE_H__
32 /* set this flag to enable tree debugging output */
33 /* #define TREE_DEBUG */
36 #include <gtk/gtkcontainer.h>
41 #endif /* __cplusplus */
44 #define GTK_TYPE_TREE (gtk_tree_get_type ())
45 #define GTK_TREE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TREE, GtkTree))
46 #define GTK_TREE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE, GtkTreeClass))
47 #define GTK_IS_TREE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TREE))
48 #define GTK_IS_TREE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TREE))
49 #define GTK_TREE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_TREE, GtkTreeClass))
52 #define GTK_IS_ROOT_TREE(obj) ((GtkObject*) GTK_TREE(obj)->root_tree == (GtkObject*)obj)
53 #define GTK_TREE_ROOT_TREE(obj) (GTK_TREE(obj)->root_tree ? GTK_TREE(obj)->root_tree : GTK_TREE(obj))
54 #define GTK_TREE_SELECTION_OLD(obj) (GTK_TREE_ROOT_TREE(obj)->selection)
58 GTK_TREE_VIEW_LINE, /* default view mode */
62 typedef struct _GtkTree GtkTree;
63 typedef struct _GtkTreeClass GtkTreeClass;
67 GtkContainer container;
71 GtkTree* root_tree; /* owner of selection list */
72 GtkWidget* tree_owner;
77 guint selection_mode : 2;
84 GtkContainerClass parent_class;
86 void (* selection_changed) (GtkTree *tree);
87 void (* select_child) (GtkTree *tree,
89 void (* unselect_child) (GtkTree *tree,
94 GtkType gtk_tree_get_type (void) G_GNUC_CONST;
95 GtkWidget* gtk_tree_new (void);
96 void gtk_tree_append (GtkTree *tree,
97 GtkWidget *tree_item);
98 void gtk_tree_prepend (GtkTree *tree,
99 GtkWidget *tree_item);
100 void gtk_tree_insert (GtkTree *tree,
101 GtkWidget *tree_item,
103 void gtk_tree_remove_items (GtkTree *tree,
105 void gtk_tree_clear_items (GtkTree *tree,
108 void gtk_tree_select_item (GtkTree *tree,
110 void gtk_tree_unselect_item (GtkTree *tree,
112 void gtk_tree_select_child (GtkTree *tree,
113 GtkWidget *tree_item);
114 void gtk_tree_unselect_child (GtkTree *tree,
115 GtkWidget *tree_item);
116 gint gtk_tree_child_position (GtkTree *tree,
118 void gtk_tree_set_selection_mode (GtkTree *tree,
119 GtkSelectionMode mode);
120 void gtk_tree_set_view_mode (GtkTree *tree,
121 GtkTreeViewMode mode);
122 void gtk_tree_set_view_lines (GtkTree *tree,
125 /* deprecated function, use gtk_container_remove instead.
127 void gtk_tree_remove_item (GtkTree *tree,
133 #endif /* __cplusplus */
136 #endif /* __GTK_TREE_H__ */
138 #endif /* GTK_ENABLE_BROKEN */