forked from AuroraMiddleware/gtk
Remove unused dirty iter discovery functions
gtk_tree_view_discover_dirty_iter() and gtk_tree_view_discover_iter() have been in the tree forever, but unused since 1.3.8 or so. I guess we no longer need them, so removed them. Fixes a compiler warning as well.
This commit is contained in:
parent
6007761549
commit
c035c122e2
@ -345,15 +345,6 @@ static void gtk_tree_view_build_tree (GtkTreeView
|
|||||||
GtkTreeIter *iter,
|
GtkTreeIter *iter,
|
||||||
gint depth,
|
gint depth,
|
||||||
gboolean recurse);
|
gboolean recurse);
|
||||||
static gboolean gtk_tree_view_discover_dirty_iter (GtkTreeView *tree_view,
|
|
||||||
GtkTreeIter *iter,
|
|
||||||
gint depth,
|
|
||||||
gint *height,
|
|
||||||
GtkRBNode *node);
|
|
||||||
static void gtk_tree_view_discover_dirty (GtkTreeView *tree_view,
|
|
||||||
GtkRBTree *tree,
|
|
||||||
GtkTreeIter *iter,
|
|
||||||
gint depth);
|
|
||||||
static void gtk_tree_view_clamp_node_visible (GtkTreeView *tree_view,
|
static void gtk_tree_view_clamp_node_visible (GtkTreeView *tree_view,
|
||||||
GtkRBTree *tree,
|
GtkRBTree *tree,
|
||||||
GtkRBNode *node);
|
GtkRBNode *node);
|
||||||
@ -8761,133 +8752,6 @@ gtk_tree_view_build_tree (GtkTreeView *tree_view,
|
|||||||
gtk_tree_path_free (path);
|
gtk_tree_path_free (path);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If height is non-NULL, then we set it to be the new height. if it's all
|
|
||||||
* dirty, then height is -1. We know we'll remeasure dirty rows, anyways.
|
|
||||||
*/
|
|
||||||
static gboolean
|
|
||||||
gtk_tree_view_discover_dirty_iter (GtkTreeView *tree_view,
|
|
||||||
GtkTreeIter *iter,
|
|
||||||
gint depth,
|
|
||||||
gint *height,
|
|
||||||
GtkRBNode *node)
|
|
||||||
{
|
|
||||||
GtkTreeViewColumn *column;
|
|
||||||
GList *list;
|
|
||||||
gboolean retval = FALSE;
|
|
||||||
gint tmpheight;
|
|
||||||
gint horizontal_separator;
|
|
||||||
|
|
||||||
gtk_widget_style_get (GTK_WIDGET (tree_view),
|
|
||||||
"horizontal-separator", &horizontal_separator,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
if (height)
|
|
||||||
*height = -1;
|
|
||||||
|
|
||||||
for (list = tree_view->priv->columns; list; list = list->next)
|
|
||||||
{
|
|
||||||
gint width;
|
|
||||||
column = list->data;
|
|
||||||
if (column->dirty == TRUE)
|
|
||||||
continue;
|
|
||||||
if (height == NULL && column->column_type == GTK_TREE_VIEW_COLUMN_FIXED)
|
|
||||||
continue;
|
|
||||||
if (!column->visible)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
gtk_tree_view_column_cell_set_cell_data (column, tree_view->priv->model, iter,
|
|
||||||
GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_PARENT),
|
|
||||||
node->children?TRUE:FALSE);
|
|
||||||
|
|
||||||
if (height)
|
|
||||||
{
|
|
||||||
gtk_tree_view_column_cell_get_size (column,
|
|
||||||
NULL, NULL, NULL,
|
|
||||||
&width, &tmpheight);
|
|
||||||
*height = MAX (*height, tmpheight);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gtk_tree_view_column_cell_get_size (column,
|
|
||||||
NULL, NULL, NULL,
|
|
||||||
&width, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gtk_tree_view_is_expander_column (tree_view, column))
|
|
||||||
{
|
|
||||||
int tmp = 0;
|
|
||||||
|
|
||||||
tmp = horizontal_separator + width + (depth - 1) * tree_view->priv->level_indentation;
|
|
||||||
if (TREE_VIEW_DRAW_EXPANDERS (tree_view))
|
|
||||||
tmp += depth * tree_view->priv->expander_size;
|
|
||||||
|
|
||||||
if (tmp > column->requested_width)
|
|
||||||
{
|
|
||||||
_gtk_tree_view_column_cell_set_dirty (column, TRUE);
|
|
||||||
retval = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (horizontal_separator + width > column->requested_width)
|
|
||||||
{
|
|
||||||
_gtk_tree_view_column_cell_set_dirty (column, TRUE);
|
|
||||||
retval = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_tree_view_discover_dirty (GtkTreeView *tree_view,
|
|
||||||
GtkRBTree *tree,
|
|
||||||
GtkTreeIter *iter,
|
|
||||||
gint depth)
|
|
||||||
{
|
|
||||||
GtkRBNode *temp = tree->root;
|
|
||||||
GtkTreeViewColumn *column;
|
|
||||||
GList *list;
|
|
||||||
GtkTreeIter child;
|
|
||||||
gboolean is_all_dirty;
|
|
||||||
|
|
||||||
TREE_VIEW_INTERNAL_ASSERT_VOID (tree != NULL);
|
|
||||||
|
|
||||||
while (temp->left != tree->nil)
|
|
||||||
temp = temp->left;
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
TREE_VIEW_INTERNAL_ASSERT_VOID (temp != NULL);
|
|
||||||
is_all_dirty = TRUE;
|
|
||||||
for (list = tree_view->priv->columns; list; list = list->next)
|
|
||||||
{
|
|
||||||
column = list->data;
|
|
||||||
if (column->dirty == FALSE)
|
|
||||||
{
|
|
||||||
is_all_dirty = FALSE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_all_dirty)
|
|
||||||
return;
|
|
||||||
|
|
||||||
gtk_tree_view_discover_dirty_iter (tree_view,
|
|
||||||
iter,
|
|
||||||
depth,
|
|
||||||
NULL,
|
|
||||||
temp);
|
|
||||||
if (gtk_tree_model_iter_children (tree_view->priv->model, &child, iter) &&
|
|
||||||
temp->children != NULL)
|
|
||||||
gtk_tree_view_discover_dirty (tree_view, temp->children, &child, depth + 1);
|
|
||||||
temp = _gtk_rbtree_next (tree, temp);
|
|
||||||
}
|
|
||||||
while (gtk_tree_model_iter_next (tree_view->priv->model, iter));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Make sure the node is visible vertically */
|
/* Make sure the node is visible vertically */
|
||||||
static void
|
static void
|
||||||
gtk_tree_view_clamp_node_visible (GtkTreeView *tree_view,
|
gtk_tree_view_clamp_node_visible (GtkTreeView *tree_view,
|
||||||
|
Loading…
Reference in New Issue
Block a user