}
/* Get the path and the node */
- path = _gtk_tree_view_find_path (tree_view, tree, node);
+ path = _gtk_tree_path_new_from_rbtree (tree, node);
path_is_selectable = !row_is_separator (tree_view, NULL, path);
if (!path_is_selectable)
{
GtkTreePath *path = NULL;
- path = _gtk_tree_view_find_path (tree_view,
- tree_view->priv->button_pressed_tree,
- tree_view->priv->button_pressed_node);
+ path = _gtk_tree_path_new_from_rbtree (tree_view->priv->button_pressed_tree,
+ tree_view->priv->button_pressed_node);
/* Actually activate the node */
if (tree_view->priv->button_pressed_node->children == NULL)
gtk_tree_view_real_expand_row (tree_view, path,
if (tree_view->priv->prelight_node)
{
- path = _gtk_tree_view_find_path (tree_view,
- tree_view->priv->prelight_tree,
- tree_view->priv->prelight_node);
+ path = _gtk_tree_path_new_from_rbtree (tree_view->priv->prelight_tree,
+ tree_view->priv->prelight_node);
if (tree_view->priv->prelight_node->children)
gtk_tree_view_collapse_row (tree_view, path);
{
GtkTreePath *path;
- path = _gtk_tree_view_find_path (tree_view, tree, node);
+ path = _gtk_tree_path_new_from_rbtree (tree, node);
gtk_tree_selection_select_path (tree_view->priv->selection, path);
if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
{
gtk_widget_queue_draw (GTK_WIDGET (tree_view));
/* The anchor path should be set to the start path */
- tmp_path = _gtk_tree_view_find_path (tree_view,
- tree_view->priv->rubber_band_start_tree,
- tree_view->priv->rubber_band_start_node);
+ tmp_path = _gtk_tree_path_new_from_rbtree (tree_view->priv->rubber_band_start_tree,
+ tree_view->priv->rubber_band_start_node);
if (tree_view->priv->anchor)
gtk_tree_row_reference_free (tree_view->priv->anchor);
gtk_tree_path_free (tmp_path);
/* ... and the cursor to the end path */
- tmp_path = _gtk_tree_view_find_path (tree_view,
- tree_view->priv->rubber_band_end_tree,
- tree_view->priv->rubber_band_end_node);
+ tmp_path = _gtk_tree_path_new_from_rbtree (tree_view->priv->rubber_band_end_tree,
+ tree_view->priv->rubber_band_end_node);
gtk_tree_view_real_set_cursor (GTK_TREE_VIEW (tree_view), tmp_path, FALSE, FALSE);
gtk_tree_path_free (tmp_path);
GtkTreePath *path;
gboolean selectable;
- path = _gtk_tree_view_find_path (tree_view, start_tree, start_node);
+ path = _gtk_tree_path_new_from_rbtree (start_tree, start_node);
selectable = _gtk_tree_selection_row_is_selectable (tree_view->priv->selection, start_node, path);
gtk_tree_path_free (path);
return TRUE;
/* find the path for the node */
- path = _gtk_tree_view_find_path ((GtkTreeView *)widget,
- tree,
- node);
+ path = _gtk_tree_path_new_from_rbtree (tree, node);
gtk_tree_model_get_iter (tree_view->priv->model,
&iter,
path);
}
else
{
- path = _gtk_tree_view_find_path (tree_view, tree, node);
+ path = _gtk_tree_path_new_from_rbtree (tree, node);
total_height += offset;
}
GtkTreePath *tmppath;
GtkTreeIter tmpiter;
- tmppath = _gtk_tree_view_find_path (tree_view, tmptree, tmpnode);
+ tmppath = _gtk_tree_path_new_from_rbtree (tmptree, tmpnode);
gtk_tree_model_get_iter (tree_view->priv->model, &tmpiter, tmppath);
if (GTK_RBNODE_FLAG_SET (tmpnode, GTK_RBNODE_INVALID) ||
break;
gtk_tree_path_free (above_path);
- above_path = _gtk_tree_view_find_path (tree_view, tree, node);
+ above_path = _gtk_tree_path_new_from_rbtree (tree, node);
gtk_tree_model_get_iter (tree_view->priv->model, &iter, above_path);
tree = tree_view->priv->tree;
node = tree->root;
- path = _gtk_tree_view_find_path (tree_view, tree, node);
+ path = _gtk_tree_path_new_from_rbtree (tree, node);
gtk_tree_model_get_iter (tree_view->priv->model, &iter, path);
validate_row (tree_view, tree, node, &iter, path);
g_assert_not_reached ();
}
while (TRUE);
- path = _gtk_tree_view_find_path (tree_view, tree, node);
+ path = _gtk_tree_path_new_from_rbtree (tree, node);
gtk_tree_model_get_iter (tree_view->priv->model, &iter, path);
}
}
else
{
- path = _gtk_tree_view_find_path (tree_view, tree, node);
+ path = _gtk_tree_path_new_from_rbtree (tree, node);
gtk_tree_view_set_top_row (tree_view, path, offset);
gtk_tree_path_free (path);
}
gtk_tree_path_free (*path);
if (node)
- *path = _gtk_tree_view_find_path (tree_view, tree, node);
+ *path = _gtk_tree_path_new_from_rbtree (tree, node);
else
*path = NULL;
}
/* In theory, the model should have emitted has_child_toggled here. We
* try to catch it anyway, just to be safe, in case the model hasn't.
*/
- GtkTreePath *tmppath = _gtk_tree_view_find_path (tree_view,
- tree,
- tmpnode);
+ GtkTreePath *tmppath = _gtk_tree_path_new_from_rbtree (tree, tmpnode);
gtk_tree_view_row_has_child_toggled (model, tmppath, NULL, data);
gtk_tree_path_free (tmppath);
goto done;
+ gtk_adjustment_get_page_size (tree_view->priv->vadjustment)))
return;
- path = _gtk_tree_view_find_path (tree_view, tree, node);
+ path = _gtk_tree_path_new_from_rbtree (tree, node);
if (path)
{
/* We process updates because we want to clear old selected items when we scroll.
/* This function could be more efficient. I'll optimize it if profiling seems
* to imply that it is important */
GtkTreePath *
-_gtk_tree_view_find_path (GtkTreeView *tree_view,
- GtkRBTree *tree,
- GtkRBNode *node)
+_gtk_tree_path_new_from_rbtree (GtkRBTree *tree,
+ GtkRBNode *node)
{
GtkTreePath *path;
GtkRBTree *tmp_tree;
node = _gtk_rbtree_first (tree);
g_return_val_if_fail (node != NULL, FALSE);
- path = _gtk_tree_view_find_path (tree_view, tree, node);
+ path = _gtk_tree_path_new_from_rbtree (tree, node);
gtk_tree_model_get_iter (GTK_TREE_MODEL (tree_view->priv->model),
&iter, path);
retval = gtk_tree_view_unref_tree_helper (GTK_TREE_MODEL (tree_view->priv->model), &iter, tree, node);
if (new_cursor_node)
{
- cursor_path = _gtk_tree_view_find_path (tree_view,
- new_cursor_tree, new_cursor_node);
+ cursor_path = _gtk_tree_path_new_from_rbtree (new_cursor_tree, new_cursor_node);
search_first_focusable_path (tree_view, &cursor_path,
(count != -1),
if (new_cursor_node)
{
- cursor_path = _gtk_tree_view_find_path (tree_view, new_cursor_tree, new_cursor_node);
+ cursor_path = _gtk_tree_path_new_from_rbtree (new_cursor_tree, new_cursor_node);
gtk_tree_view_real_set_cursor (tree_view, cursor_path, TRUE, TRUE);
gtk_tree_path_free (cursor_path);
}
y -= tree_view->priv->cursor_offset;
- cursor_path = _gtk_tree_view_find_path (tree_view, cursor_tree, cursor_node);
+ cursor_path = _gtk_tree_path_new_from_rbtree (cursor_tree, cursor_node);
start_cursor_tree = cursor_tree;
start_cursor_node = cursor_node;
*/
cursor_tree = start_cursor_tree;
cursor_node = start_cursor_node;
- cursor_path = _gtk_tree_view_find_path (tree_view, cursor_tree, cursor_node);
+ cursor_path = _gtk_tree_path_new_from_rbtree (cursor_tree, cursor_node);
search_first_focusable_path (tree_view, &cursor_path,
(count == -1),
cursor_node = _gtk_rbtree_first (cursor_tree);
/* Now go forward to find the first focusable row. */
- path = _gtk_tree_view_find_path (tree_view, cursor_tree, cursor_node);
+ path = _gtk_tree_path_new_from_rbtree (cursor_tree, cursor_node);
search_first_focusable_path (tree_view, &path,
TRUE, &cursor_tree, &cursor_node);
}
while (1);
/* Now go backwards to find last focusable row. */
- path = _gtk_tree_view_find_path (tree_view, cursor_tree, cursor_node);
+ path = _gtk_tree_path_new_from_rbtree (cursor_tree, cursor_node);
search_first_focusable_path (tree_view, &path,
FALSE, &cursor_tree, &cursor_node);
}
GtkTreePath *path;
GtkTreeIter iter;
- path = _gtk_tree_view_find_path (tree_view, tree, node);
+ path = _gtk_tree_path_new_from_rbtree (tree, node);
gtk_tree_model_get_iter (tree_view->priv->model, &iter, path);
g_signal_emit (tree_view, tree_view_signals[ROW_EXPANDED], 0, &iter, path);
*cell_y = y_offset;
if (path)
- *path = _gtk_tree_view_find_path (tree_view, tree, node);
+ *path = _gtk_tree_path_new_from_rbtree (tree, node);
return TRUE;
}
TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, 0),
&tree, &node);
if (node)
- *start_path = _gtk_tree_view_find_path (tree_view, tree, node);
+ *start_path = _gtk_tree_path_new_from_rbtree (tree, node);
else
retval = FALSE;
}
_gtk_rbtree_find_offset (tree_view->priv->tree, y, &tree, &node);
if (node)
- *end_path = _gtk_tree_view_find_path (tree_view, tree, node);
+ *end_path = _gtk_tree_path_new_from_rbtree (tree, node);
else
retval = FALSE;
}