Ardour  9.0-pre0-582-g084a23a80d
gtktreeprivate.h
Go to the documentation of this file.
1 /* gtktreeprivate.h
2  * Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb@redhat.com>
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 #ifndef __GTK_TREE_PRIVATE_H__
21 #define __GTK_TREE_PRIVATE_H__
22 
23 
24 G_BEGIN_DECLS
25 
26 
27 #include <gtk/gtktreeview.h>
28 #include <gtk/gtktreeselection.h>
29 #include <gtk/gtkrbtree.h>
30 
31 #define TREE_VIEW_DRAG_WIDTH 6
32 
33 typedef enum
34 {
44 
45 typedef enum
46 {
49 }
51 
52 enum
53 {
59 };
60 
61 enum
62 {
66 };
67 
68 #define GTK_TREE_VIEW_SET_FLAG(tree_view, flag) G_STMT_START{ (tree_view->priv->flags|=flag); }G_STMT_END
69 #define GTK_TREE_VIEW_UNSET_FLAG(tree_view, flag) G_STMT_START{ (tree_view->priv->flags&=~(flag)); }G_STMT_END
70 #define GTK_TREE_VIEW_FLAG_SET(tree_view, flag) ((tree_view->priv->flags&flag)==flag)
71 #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)
72 #define TREE_VIEW_COLUMN_REQUESTED_WIDTH(column) (CLAMP (column->requested_width, (column->min_width!=-1)?column->min_width:column->requested_width, (column->max_width!=-1)?column->max_width:column->requested_width))
73 #define TREE_VIEW_DRAW_EXPANDERS(tree_view) (!GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IS_LIST)&&GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_SHOW_EXPANDERS))
74 
75  /* This lovely little value is used to determine how far away from the title bar
76  * you can move the mouse and still have a column drag work.
77  */
78 #define TREE_VIEW_COLUMN_DRAG_DEAD_MULTIPLIER(tree_view) (10*TREE_VIEW_HEADER_HEIGHT(tree_view))
79 
82 {
83  gint left_align;
87 };
88 
90 {
92 
93  guint flags;
94  /* tree information */
96 
97  /* Container info */
98  GList *children;
99  gint width;
100  gint height;
101 
102  /* Adjustments */
105 
106  /* Sub windows */
109 
110  /* Scroll position state keeping */
113  /* dy == y pos of top_row + top_row_dy */
114  /* we cache it for simplicity of the code */
115  gint dy;
116 
120 
121  /* Indentation and expander layout */
124 
126 
127  /* Key navigation (focus), selection */
129 
132 
134 
135  /* Current pressed node, previously pressed, prelight */
138 
142 
145 
149 
152 
153  /* Cell Editing */
155 
156  /* The node that's currently being collapsed or expanded */
160 
161  /* Auto expand/collapse timeout in hover mode */
163 
164  /* Selection information */
166 
167  /* Header information */
168  gint n_columns;
169  GList *columns;
171 
177 
179 
180  /* Interactive Header reordering */
185 
186  /* Interactive Header Resizing */
187  gint drag_pos;
188  gint x_drag;
189 
190  /* Non-interactive Header Resizing, expand flag support */
192 
196 
197  /* ATK Hack */
200  GDestroyNotify destroy_count_destroy;
201 
202  /* Scroll timeout (e.g. during dnd, rubber banding) */
204 
205  /* Row drag-and-drop */
209 
210  /* Rubber banding */
216 
219 
222 
223  /* fixed height */
225 
226  /* Scroll-to functionality when unrealized */
231 
232  /* Interactive search */
238  GDestroyNotify search_destroy;
240  GDestroyNotify search_position_destroy;
245 
246  /* Grid and tree lines */
248  double grid_line_dashes[2];
250 
252  double tree_line_dashes[2];
254 
255  /* Row separators */
258  GDestroyNotify row_separator_destroy;
259 
260  /* Tooltip support */
262 
263  /* Here comes the bitfield */
265 
266  guint fixed_height_mode : 1;
268 
269  guint reorderable : 1;
270  guint header_has_focus : 1;
272  /* hint to display rows in alternating colors */
273  guint has_rules : 1;
275 
276  /* for DnD */
277  guint empty_view_drop : 1;
278 
281 
283 
284  guint in_top_row_to_dy : 1;
285 
286  /* interactive search */
287  guint enable_search : 1;
288  guint disable_popdown : 1;
290 
291  guint hover_selection : 1;
292  guint hover_expand : 1;
293  guint imcontext_changed : 1;
294 
296 
297  guint in_grab : 1;
298 
300 
301  /* Whether our key press handler is to avoid sending an unhandled binding to the search entry */
303 };
304 
305 #ifdef __GNUC__
306 
307 #define TREE_VIEW_INTERNAL_ASSERT(expr, ret) G_STMT_START{ \
308  if (!(expr)) \
309  { \
310  g_log (G_LOG_DOMAIN, \
311  G_LOG_LEVEL_CRITICAL, \
312  "%s (%s): assertion `%s' failed.\n" \
313  "There is a disparity between the internal view of the GtkTreeView,\n" \
314  "and the GtkTreeModel. This generally means that the model has changed\n"\
315  "without letting the view know. Any display from now on is likely to\n" \
316  "be incorrect.\n", \
317  G_STRLOC, \
318  G_STRFUNC, \
319  #expr); \
320  return ret; \
321  }; }G_STMT_END
322 
323 #define TREE_VIEW_INTERNAL_ASSERT_VOID(expr) G_STMT_START{ \
324  if (!(expr)) \
325  { \
326  g_log (G_LOG_DOMAIN, \
327  G_LOG_LEVEL_CRITICAL, \
328  "%s (%s): assertion `%s' failed.\n" \
329  "There is a disparity between the internal view of the GtkTreeView,\n" \
330  "and the GtkTreeModel. This generally means that the model has changed\n"\
331  "without letting the view know. Any display from now on is likely to\n" \
332  "be incorrect.\n", \
333  G_STRLOC, \
334  G_STRFUNC, \
335  #expr); \
336  return; \
337  }; }G_STMT_END
338 
339 #else
340 
341 #define TREE_VIEW_INTERNAL_ASSERT(expr, ret) G_STMT_START{ \
342  if (!(expr)) \
343  { \
344  g_log (G_LOG_DOMAIN, \
345  G_LOG_LEVEL_CRITICAL, \
346  "file %s: line %d: assertion `%s' failed.\n" \
347  "There is a disparity between the internal view of the GtkTreeView,\n" \
348  "and the GtkTreeModel. This generally means that the model has changed\n"\
349  "without letting the view know. Any display from now on is likely to\n" \
350  "be incorrect.\n", \
351  __FILE__, \
352  __LINE__, \
353  #expr); \
354  return ret; \
355  }; }G_STMT_END
356 
357 #define TREE_VIEW_INTERNAL_ASSERT_VOID(expr) G_STMT_START{ \
358  if (!(expr)) \
359  { \
360  g_log (G_LOG_DOMAIN, \
361  G_LOG_LEVEL_CRITICAL, \
362  "file %s: line %d: assertion '%s' failed.\n" \
363  "There is a disparity between the internal view of the GtkTreeView,\n" \
364  "and the GtkTreeModel. This generally means that the model has changed\n"\
365  "without letting the view know. Any display from now on is likely to\n" \
366  "be incorrect.\n", \
367  __FILE__, \
368  __LINE__, \
369  #expr); \
370  return; \
371  }; }G_STMT_END
372 #endif
373 
374 
375 /* functions that shouldn't be exported */
377  GtkRBNode *node,
378  GtkRBTree *tree,
379  GtkTreePath *path,
380  GtkTreeSelectMode mode,
381  gboolean override_browse_mode);
384  GtkTreePath *path,
385  GtkRBTree **tree,
386  GtkRBNode **node);
388  GtkRBTree *tree,
389  GtkRBNode *node);
391  GtkWidget *widget,
392  gint x,
393  gint y,
394  gint width,
395  gint height);
397  GtkRBTree *tree,
398  GtkRBNode *node,
399  const GdkRectangle *clip_rect);
400 
404  GtkTreeView *tree_view);
406  GtkTreeModel *old_model);
409  gint width);
411  GtkTreeViewColumn *column);
413  GtkCellEditable **editable_widget,
414  GdkEvent *event,
415  gchar *path_string,
416  const GdkRectangle *background_area,
417  const GdkRectangle *cell_area,
418  guint flags);
420  GtkCellEditable *editable_widget);
424  GtkTreeViewColumn *column);
425 
430  gint x);
431 
435  GtkTreeView *tree_view);
437  GtkRBNode *node,
438  GtkTreePath *path);
439 
441  GdkWindow *window,
442  const GdkRectangle *background_area,
443  const GdkRectangle *cell_area,
444  const GdkRectangle *expose_area,
445  guint flags);
447  const GdkRectangle *background_area,
448  const GdkRectangle *cell_area,
449  GdkRectangle *focus_area);
451  gint direction,
452  gboolean left,
453  gboolean right);
455  GdkWindow *window,
456  const GdkRectangle *background_area,
457  const GdkRectangle *cell_area,
458  const GdkRectangle *expose_area,
459  guint flags);
461  gboolean install_handler);
463  GtkCellRenderer *cell,
464  gint *left,
465  gint *right);
466 
467 
468 G_END_DECLS
469 
470 
471 #endif /* __GTK_TREE_PRIVATE_H__ */
472 
struct _GtkCellEditable GtkCellEditable
GtkTreeViewGridLines
Definition: gtkenums.h:565
struct _GtkTreePath GtkTreePath
Definition: gtktreemodel.h:44
struct _GtkTreeRowReference GtkTreeRowReference
Definition: gtktreemodel.h:45
struct _GtkTreeModel GtkTreeModel
Definition: gtktreemodel.h:46
void _gtk_tree_view_child_move_resize(GtkTreeView *tree_view, GtkWidget *widget, gint x, gint y, gint width, gint height)
void _gtk_tree_selection_emit_changed(GtkTreeSelection *selection)
void _gtk_tree_view_queue_draw_node(GtkTreeView *tree_view, GtkRBTree *tree, GtkRBNode *node, const GdkRectangle *clip_rect)
gboolean _gtk_tree_selection_row_is_selectable(GtkTreeSelection *selection, GtkRBNode *node, GtkTreePath *path)
void _gtk_tree_view_column_cell_render(GtkTreeViewColumn *tree_column, GdkWindow *window, const GdkRectangle *background_area, const GdkRectangle *cell_area, const GdkRectangle *expose_area, guint flags)
gboolean _gtk_tree_view_find_node(GtkTreeView *tree_view, GtkTreePath *path, GtkRBTree **tree, GtkRBNode **node)
void _gtk_tree_view_column_set_tree_view(GtkTreeViewColumn *column, GtkTreeView *tree_view)
gboolean _gtk_tree_view_column_cell_focus(GtkTreeViewColumn *tree_column, gint direction, gboolean left, gboolean right)
void _gtk_tree_selection_set_tree_view(GtkTreeSelection *selection, GtkTreeView *tree_view)
GtkTreePath * _gtk_tree_view_find_path(GtkTreeView *tree_view, GtkRBTree *tree, GtkRBNode *node)
void _gtk_tree_view_column_realize_button(GtkTreeViewColumn *column)
void _gtk_tree_view_column_cell_set_dirty(GtkTreeViewColumn *tree_column, gboolean install_handler)
void _gtk_tree_view_column_start_drag(GtkTreeView *tree_view, GtkTreeViewColumn *column)
void _gtk_tree_view_column_unrealize_button(GtkTreeViewColumn *column)
void _gtk_tree_view_column_autosize(GtkTreeView *tree_view, GtkTreeViewColumn *column)
GtkTreeSelection * _gtk_tree_selection_new(void)
GtkTreeViewFlags
@ GTK_TREE_VIEW_ARROW_PRELIT
@ GTK_TREE_VIEW_IN_COLUMN_RESIZE
@ GTK_TREE_VIEW_HEADERS_VISIBLE
@ GTK_TREE_VIEW_MODEL_SETUP
@ GTK_TREE_VIEW_SHOW_EXPANDERS
@ GTK_TREE_VIEW_DRAW_KEYFOCUS
@ GTK_TREE_VIEW_IS_LIST
@ GTK_TREE_VIEW_IN_COLUMN_DRAG
void _gtk_tree_view_column_stop_editing(GtkTreeViewColumn *tree_column)
void _gtk_tree_view_column_get_focus_area(GtkTreeViewColumn *tree_column, const GdkRectangle *background_area, const GdkRectangle *cell_area, GdkRectangle *focus_area)
void _gtk_tree_view_column_get_neighbor_sizes(GtkTreeViewColumn *column, GtkCellRenderer *cell, gint *left, gint *right)
gint _gtk_tree_view_column_count_special_cells(GtkTreeViewColumn *column)
GtkCellRenderer * _gtk_tree_view_column_get_cell_at_pos(GtkTreeViewColumn *column, gint x)
void _gtk_tree_view_column_start_editing(GtkTreeViewColumn *tree_column, GtkCellEditable *editable_widget)
gboolean _gtk_tree_view_column_has_editable_cell(GtkTreeViewColumn *column)
void _gtk_tree_view_column_unset_model(GtkTreeViewColumn *column, GtkTreeModel *old_model)
GtkTreeSelection * _gtk_tree_selection_new_with_tree_view(GtkTreeView *tree_view)
GtkTreeSelectMode
@ GTK_TREE_SELECT_MODE_EXTEND
@ GTK_TREE_SELECT_MODE_TOGGLE
void _gtk_tree_selection_internal_select_node(GtkTreeSelection *selection, GtkRBNode *node, GtkRBTree *tree, GtkTreePath *path, GtkTreeSelectMode mode, gboolean override_browse_mode)
@ DRAG_COLUMN_WINDOW_STATE_ORIGINAL
@ DRAG_COLUMN_WINDOW_STATE_ARROW
@ DRAG_COLUMN_WINDOW_STATE_ARROW_RIGHT
@ DRAG_COLUMN_WINDOW_STATE_UNSET
@ DRAG_COLUMN_WINDOW_STATE_ARROW_LEFT
void _gtk_tree_view_install_mark_rows_col_dirty(GtkTreeView *tree_view)
void _gtk_tree_view_column_unset_tree_view(GtkTreeViewColumn *column)
void _gtk_tree_view_column_cell_draw_focus(GtkTreeViewColumn *tree_column, GdkWindow *window, const GdkRectangle *background_area, const GdkRectangle *cell_area, const GdkRectangle *expose_area, guint flags)
void _gtk_tree_view_column_set_width(GtkTreeViewColumn *column, gint width)
gboolean _gtk_tree_view_column_cell_event(GtkTreeViewColumn *tree_column, GtkCellEditable **editable_widget, GdkEvent *event, gchar *path_string, const GdkRectangle *background_area, const GdkRectangle *cell_area, guint flags)
GtkCellRenderer * _gtk_tree_view_column_get_edited_cell(GtkTreeViewColumn *column)
@ RUBBER_BAND_ACTIVE
@ RUBBER_BAND_MAYBE_START
@ RUBBER_BAND_OFF
gboolean(* GtkTreeViewColumnDropFunc)(GtkTreeView *tree_view, GtkTreeViewColumn *column, GtkTreeViewColumn *prev_column, GtkTreeViewColumn *next_column, gpointer data)
Definition: gtktreeview.h:118
void(* GtkTreeViewSearchPositionFunc)(GtkTreeView *tree_view, GtkWidget *search_dialog, gpointer user_data)
Definition: gtktreeview.h:134
GtkTreeViewDropPosition
Definition: gtktreeview.h:37
gboolean(* GtkTreeViewRowSeparatorFunc)(GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
Definition: gtktreeview.h:131
gboolean(* GtkTreeViewSearchEqualFunc)(GtkTreeModel *model, gint column, const gchar *key, GtkTreeIter *iter, gpointer search_data)
Definition: gtktreeview.h:126
void(* GtkTreeDestroyCountFunc)(GtkTreeView *tree_view, GtkTreePath *path, gint children, gpointer user_data)
Definition: gtktreeview.h:365
GtkTreeViewColumn * left_column
GtkTreeViewColumn * right_column
GtkTreeViewGridLines grid_lines
GDestroyNotify search_position_destroy
GtkTreeDestroyCountFunc destroy_count_func
GDestroyNotify destroy_count_destroy
GdkWindow * drag_window
GtkTreeModel * model
double grid_line_dashes[2]
GtkAdjustment * vadjustment
GtkTreeRowReference * drag_dest_row
GtkRBTree * prelight_tree
double tree_line_dashes[2]
GtkTreeRowReference * scroll_to_path
GdkWindow * drag_highlight_window
gpointer column_drop_func_data
GDestroyNotify row_separator_destroy
GtkRBTree * expanded_collapsed_tree
GDestroyNotify column_drop_func_data_destroy
GdkWindow * bin_window
GtkTreeRowReference * anchor
GtkWidget * search_entry
GtkAdjustment * hadjustment
GtkWidget * search_window
GtkTreeViewColumn * scroll_to_column
GtkRBNode * expanded_collapsed_node
GtkTreeViewColumn * drag_column
GtkRBNode * button_pressed_node
guint search_entry_avoid_unhandled_binding
gpointer search_position_user_data
GtkTreeViewColumnReorder * cur_reorder
GtkRBTree * rubber_band_end_tree
GtkTreeSelection * selection
GtkTreeRowReference * top_row
GtkRBTree * rubber_band_start_tree
GtkRBNode * rubber_band_start_node
GtkRBTree * button_pressed_tree
GtkRBNode * rubber_band_end_node
GtkTreeViewColumn * edited_column
GDestroyNotify search_destroy
GtkRBNode * prelight_node
GtkTreeViewSearchEqualFunc search_equal_func
GtkTreeViewSearchPositionFunc search_position_func
GtkTreeViewRowSeparatorFunc row_separator_func
GtkTreeRowReference * cursor
GdkWindow * header_window
GtkTreeViewDropPosition drag_dest_pos
GtkTreeViewColumn * expander_column
GtkTreeViewColumnDropFunc column_drop_func
GtkTreeViewColumn * focus_column
link region and track selection
gint height
Definition: xcursors.h:1
gint width
Definition: xcursors.h:1