2 * Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb@redhat.com>
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.
20 #ifndef __GTK_TREE_PRIVATE_H__
21 #define __GTK_TREE_PRIVATE_H__
26 #endif /* __cplusplus */
28 #include <gtk/gtktreeview.h>
29 #include <gtk/gtktreeselection.h>
30 #include <gtk/gtkrbtree.h>
34 GTK_TREE_VIEW_IS_LIST = 1 << 0,
35 GTK_TREE_VIEW_SHOW_EXPANDERS = 1 << 1,
36 GTK_TREE_VIEW_IN_COLUMN_RESIZE = 1 << 2,
37 GTK_TREE_VIEW_ARROW_PRELIT = 1 << 3,
38 GTK_TREE_VIEW_HEADERS_VISIBLE = 1 << 4,
39 GTK_TREE_VIEW_DRAW_KEYFOCUS = 1 << 5,
40 GTK_TREE_VIEW_MODEL_SETUP = 1 << 6
43 #define GTK_TREE_VIEW_SET_FLAG(tree_view, flag) G_STMT_START{ (tree_view->priv->flags|=flag); }G_STMT_END
44 #define GTK_TREE_VIEW_UNSET_FLAG(tree_view, flag) G_STMT_START{ (tree_view->priv->flags&=~(flag)); }G_STMT_END
45 #define GTK_TREE_VIEW_FLAG_SET(tree_view, flag) ((tree_view->priv->flags&flag)==flag)
46 #define TREE_VIEW_HEADER_HEIGHT(tree_view) (GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_HEADERS_VISIBLE)?tree_view->priv->header_height:0)
47 #define TREE_VIEW_COLUMN_SIZE(column) (CLAMP (column->size, (column->min_width!=-1)?column->min_width:column->size, (column->max_width!=-1)?column->max_width:column->size))
48 #define TREE_VIEW_DRAW_EXPANDERS(tree_view) (!GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IS_LIST)&>K_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_SHOW_EXPANDERS))
50 struct _GtkTreeViewPrivate
55 /* tree information */
59 GtkRBNode *button_pressed_node;
60 GtkRBTree *button_pressed_tree;
66 GtkAdjustment *hadjustment;
67 GtkAdjustment *vadjustment;
69 GdkWindow *bin_window;
70 GdkWindow *header_window;
77 GdkCursor *cursor_drag;
82 /* Prelight information */
83 GtkRBNode *prelight_node;
84 GtkRBTree *prelight_tree;
87 /* Selection information */
88 GtkTreeSelection *selection;
90 /* Header information */
98 #define TREE_VIEW_INTERNAL_ASSERT(expr, ret) G_STMT_START{ \
101 g_log (G_LOG_DOMAIN, \
102 G_LOG_LEVEL_CRITICAL, \
103 "file %s: line %d (%s): assertion `%s' failed.\n" \
104 "There is a disparity between the internal view of the GtkTreeView,\n" \
105 "and the GtkTreeModel. This generally means that the model has changed\n"\
106 "without letting the view know. Any display from now on is likely to\n" \
110 __PRETTY_FUNCTION__, \
115 #define TREE_VIEW_INTERNAL_ASSERT_VOID(expr) G_STMT_START{ \
118 g_log (G_LOG_DOMAIN, \
119 G_LOG_LEVEL_CRITICAL, \
120 "file %s: line %d (%s): assertion `%s' failed.\n" \
121 "There is a disparity between the internal view of the GtkTreeView,\n" \
122 "and the GtkTreeModel. This generally means that the model has changed\n"\
123 "without letting the view know. Any display from now on is likely to\n" \
127 __PRETTY_FUNCTION__, \
134 #define TREE_VIEW_INTERNAL_ASSERT(expr, ret) G_STMT_START{ \
137 g_log (G_LOG_DOMAIN, \
138 G_LOG_LEVEL_CRITICAL, \
139 "file %s: line %d: assertion `%s' failed.\n" \
140 "There is a disparity between the internal view of the GtkTreeView,\n" \
141 "and the GtkTreeModel. This generally means that the model has changed\n"\
142 "without letting the view know. Any display from now on is likely to\n" \
150 #define TREE_VIEW_INTERNAL_ASSERT_VOID(expr) G_STMT_START{ \
153 g_log (G_LOG_DOMAIN, \
154 G_LOG_LEVEL_CRITICAL, \
155 "file %s: line %d: assertion '%s' failed.\n" \
156 "There is a disparity between the internal view of the GtkTreeView,\n" \
157 "and the GtkTreeModel. This generally means that the model has changed\n"\
158 "without letting the view know. Any display from now on is likely to\n" \
167 /* functions that shouldn't be exported */
168 void _gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
172 GdkModifierType state);
173 gboolean _gtk_tree_view_find_node (GtkTreeView *tree_view,
177 GtkTreePath *_gtk_tree_view_find_path (GtkTreeView *tree_view,
180 void _gtk_tree_view_set_size (GtkTreeView *tree_view,
185 GtkTreeSelection* _gtk_tree_selection_new (void);
186 GtkTreeSelection* _gtk_tree_selection_new_with_tree_view (GtkTreeView *tree_view);
187 void _gtk_tree_selection_set_tree_view (GtkTreeSelection *selection,
188 GtkTreeView *tree_view);
192 #endif /* __cplusplus */
195 #endif /* __GTK_TREE_PRIVATE_H__ */