-static void
-gtk_tree_view_calc_size (GtkTreeView *tree_view,
- GtkRBTree *tree,
- GtkTreeIter *iter,
- gint depth)
-{
- GtkRBNode *temp;
- GtkTreeIter child;
- GList *list;
- GtkTreeViewColumn *column;
- gint max_height;
- gint vertical_separator;
- gint horizontal_separator;
- TREE_VIEW_INTERNAL_ASSERT_VOID (tree != NULL);
-
- gtk_widget_style_get (GTK_WIDGET (tree_view),
- "vertical_separator", &vertical_separator,
- "horizontal_separator", &horizontal_separator,
- NULL);
-
- temp = tree->root;
- while (temp->left != tree->nil)
- temp = temp->left;
-
- do
- {
- max_height = 0;
- /* Do stuff with node */
- for (list = tree_view->priv->columns; list; list = list->next)
- {
- gint height = 0, width = 0;
- column = list->data;
-
- if (!column->visible)
- continue;
-
- gtk_tree_view_column_cell_set_cell_data (column, tree_view->priv->model, iter,
- GTK_RBNODE_FLAG_SET (temp, GTK_RBNODE_IS_PARENT),
- temp->children?TRUE:FALSE);
- gtk_tree_view_column_cell_get_size (column, NULL, NULL, NULL, &width, &height);
- max_height = MAX (max_height, vertical_separator + height);
-
- /* FIXME: I'm getting the width of all nodes here. )-: */
- if (column->dirty == FALSE)
- continue;
-
- if (column->column_type == GTK_TREE_VIEW_COLUMN_FIXED)
- {
- continue;
- }
- if (gtk_tree_view_is_expander_column (tree_view, column) &&
- TREE_VIEW_DRAW_EXPANDERS (tree_view))
- _gtk_tree_view_column_set_width (column,
- MAX (column->width, depth * tree_view->priv->tab_offset + width + horizontal_separator));
- else
- _gtk_tree_view_column_set_width (column, MAX (column->width, width + horizontal_separator));
- }
-
- _gtk_rbtree_node_set_height (tree, temp, max_height);
-
- if (temp->children != NULL &&
- gtk_tree_model_iter_children (tree_view->priv->model, &child, iter))
- gtk_tree_view_calc_size (tree_view, temp->children, &child, depth + 1);
- temp = _gtk_rbtree_next (tree, temp);
- }
- while (gtk_tree_model_iter_next (tree_view->priv->model, iter));
-}
-