_gtk_tree_view_find_path() was not a name that not really described what
the function does. And I kept forgetting it. Also, it took the tree view
as an argument and that was completely unnecessary.
static GtkTreePath *
cell_info_get_path (GtkTreeViewAccessibleCellInfo *cell_info)
{
static GtkTreePath *
cell_info_get_path (GtkTreeViewAccessibleCellInfo *cell_info)
{
- return _gtk_tree_view_find_path (NULL,
- cell_info->tree,
- cell_info->node);
+ return _gtk_tree_path_new_from_rbtree (cell_info->tree, cell_info->node);
if (!get_rbtree_column_from_index (tree_view, i, &tree, &node, &tv_col))
return NULL;
if (!get_rbtree_column_from_index (tree_view, i, &tree, &node, &tv_col))
return NULL;
- path = _gtk_tree_view_find_path (tree_view, tree, node);
+ path = _gtk_tree_path_new_from_rbtree (tree, node);
tree_model = gtk_tree_view_get_model (tree_view);
retval = gtk_tree_model_get_iter (tree_model, &iter, path);
if (!retval)
tree_model = gtk_tree_view_get_model (tree_view);
retval = gtk_tree_model_get_iter (tree_model, &iter, path);
if (!retval)
GtkTreePath *path,
GtkRBTree **tree,
GtkRBNode **node);
GtkTreePath *path,
GtkRBTree **tree,
GtkRBNode **node);
-GtkTreePath *_gtk_tree_view_find_path (GtkTreeView *tree_view,
- GtkRBTree *tree,
+GtkTreePath *_gtk_tree_path_new_from_rbtree (GtkRBTree *tree,
GtkRBNode *node);
void _gtk_tree_view_child_move_resize (GtkTreeView *tree_view,
GtkWidget *widget,
GtkRBNode *node);
void _gtk_tree_view_child_move_resize (GtkTreeView *tree_view,
GtkWidget *widget,
if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED) != select)
{
if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED) != select)
{
- path = _gtk_tree_view_find_path (priv->tree_view, tree, node);
+ path = _gtk_tree_path_new_from_rbtree (tree, node);
toggle = _gtk_tree_selection_row_is_selectable (selection, node, path);
gtk_tree_path_free (path);
}
toggle = _gtk_tree_selection_row_is_selectable (selection, node, path);
gtk_tree_path_free (path);
}
}
/* Get the path and the node */
}
/* 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)
path_is_selectable = !row_is_separator (tree_view, NULL, path);
if (!path_is_selectable)
{
GtkTreePath *path = NULL;
{
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,
/* 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)
{
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);
if (tree_view->priv->prelight_node->children)
gtk_tree_view_collapse_row (tree_view, 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_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 */
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);
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 */
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);
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;
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);
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 */
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);
gtk_tree_model_get_iter (tree_view->priv->model,
&iter,
path);
- path = _gtk_tree_view_find_path (tree_view, tree, node);
+ path = _gtk_tree_path_new_from_rbtree (tree, node);
total_height += offset;
}
total_height += offset;
}
GtkTreePath *tmppath;
GtkTreeIter tmpiter;
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) ||
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);
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);
gtk_tree_model_get_iter (tree_view->priv->model, &iter, above_path);
tree = tree_view->priv->tree;
node = tree->root;
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);
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);
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);
}
gtk_tree_model_get_iter (tree_view->priv->model, &iter, path);
}
- 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_view_set_top_row (tree_view, path, offset);
gtk_tree_path_free (path);
}
gtk_tree_path_free (*path);
if (node)
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);
/* 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.
*/
/* 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_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;
+ 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.
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 *
/* 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;
{
GtkTreePath *path;
GtkRBTree *tmp_tree;
node = _gtk_rbtree_first (tree);
g_return_val_if_fail (node != NULL, FALSE);
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);
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);
- 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),
search_first_focusable_path (tree_view, &cursor_path,
(count != -1),
- 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);
gtk_tree_view_real_set_cursor (tree_view, cursor_path, TRUE, TRUE);
gtk_tree_path_free (cursor_path);
}
y -= tree_view->priv->cursor_offset;
}
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;
start_cursor_tree = cursor_tree;
start_cursor_node = cursor_node;
*/
cursor_tree = start_cursor_tree;
cursor_node = start_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),
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. */
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);
}
search_first_focusable_path (tree_view, &path,
TRUE, &cursor_tree, &cursor_node);
}
while (1);
/* Now go backwards to find last focusable row. */
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);
}
search_first_focusable_path (tree_view, &path,
FALSE, &cursor_tree, &cursor_node);
}
GtkTreePath *path;
GtkTreeIter iter;
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);
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)
*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);
TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, 0),
&tree, &node);
if (node)
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);
_gtk_rbtree_find_offset (tree_view->priv->tree, y, &tree, &node);
if (node)
_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);