Commit c82dc58f authored by Jonathan Blandford's avatar Jonathan Blandford Committed by Jonathan Blandford

Proxy out to _gtk_tree_row_reference_deleted. (inserted_callback): Proxy

Tue Feb 27 19:32:53 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreemodel.c (deleted_callback): Proxy out to
	_gtk_tree_row_reference_deleted.
	(inserted_callback): Proxy out to
	_gtk_tree_row_reference_inserted.
	(_gtk_tree_row_reference_new_from_view): Somewhat yukky hack to
	get around signal emission ordering problem.

	* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
	fix to work with SINGLE
	(_gtk_tree_selection_internal_select_node): Major sanitization on
	selections.  SINGLE now seems to work.

	* tests/Makefile.am: add testtreecolumn.c:

	* tests/testtreecolumn.c: New test.  Mostly points out selection
	bugs currently, but will test columns later.

	* gtk/gtkrbtree.c (_gtk_rbtree_remove_node): Fix really nasty
	selection bug.  I hate touching this code -- it's scary.
parent 75d79abf
Tue Feb 27 19:32:53 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c (deleted_callback): Proxy out to
_gtk_tree_row_reference_deleted.
(inserted_callback): Proxy out to
_gtk_tree_row_reference_inserted.
(_gtk_tree_row_reference_new_from_view): Somewhat yukky hack to
get around signal emission ordering problem.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
fix to work with SINGLE
(_gtk_tree_selection_internal_select_node): Major sanitization on
selections. SINGLE now seems to work.
* tests/Makefile.am: add testtreecolumn.c:
* tests/testtreecolumn.c: New test. Mostly points out selection
bugs currently, but will test columns later.
* gtk/gtkrbtree.c (_gtk_rbtree_remove_node): Fix really nasty
selection bug. I hate touching this code -- it's scary.
2001-02-26 Havoc Pennington <hp@redhat.com>
* gtk/testgtk.c: test the window state stuff
......
Tue Feb 27 19:32:53 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c (deleted_callback): Proxy out to
_gtk_tree_row_reference_deleted.
(inserted_callback): Proxy out to
_gtk_tree_row_reference_inserted.
(_gtk_tree_row_reference_new_from_view): Somewhat yukky hack to
get around signal emission ordering problem.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
fix to work with SINGLE
(_gtk_tree_selection_internal_select_node): Major sanitization on
selections. SINGLE now seems to work.
* tests/Makefile.am: add testtreecolumn.c:
* tests/testtreecolumn.c: New test. Mostly points out selection
bugs currently, but will test columns later.
* gtk/gtkrbtree.c (_gtk_rbtree_remove_node): Fix really nasty
selection bug. I hate touching this code -- it's scary.
2001-02-26 Havoc Pennington <hp@redhat.com>
* gtk/testgtk.c: test the window state stuff
......
Tue Feb 27 19:32:53 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c (deleted_callback): Proxy out to
_gtk_tree_row_reference_deleted.
(inserted_callback): Proxy out to
_gtk_tree_row_reference_inserted.
(_gtk_tree_row_reference_new_from_view): Somewhat yukky hack to
get around signal emission ordering problem.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
fix to work with SINGLE
(_gtk_tree_selection_internal_select_node): Major sanitization on
selections. SINGLE now seems to work.
* tests/Makefile.am: add testtreecolumn.c:
* tests/testtreecolumn.c: New test. Mostly points out selection
bugs currently, but will test columns later.
* gtk/gtkrbtree.c (_gtk_rbtree_remove_node): Fix really nasty
selection bug. I hate touching this code -- it's scary.
2001-02-26 Havoc Pennington <hp@redhat.com>
* gtk/testgtk.c: test the window state stuff
......
Tue Feb 27 19:32:53 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c (deleted_callback): Proxy out to
_gtk_tree_row_reference_deleted.
(inserted_callback): Proxy out to
_gtk_tree_row_reference_inserted.
(_gtk_tree_row_reference_new_from_view): Somewhat yukky hack to
get around signal emission ordering problem.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
fix to work with SINGLE
(_gtk_tree_selection_internal_select_node): Major sanitization on
selections. SINGLE now seems to work.
* tests/Makefile.am: add testtreecolumn.c:
* tests/testtreecolumn.c: New test. Mostly points out selection
bugs currently, but will test columns later.
* gtk/gtkrbtree.c (_gtk_rbtree_remove_node): Fix really nasty
selection bug. I hate touching this code -- it's scary.
2001-02-26 Havoc Pennington <hp@redhat.com>
* gtk/testgtk.c: test the window state stuff
......
Tue Feb 27 19:32:53 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c (deleted_callback): Proxy out to
_gtk_tree_row_reference_deleted.
(inserted_callback): Proxy out to
_gtk_tree_row_reference_inserted.
(_gtk_tree_row_reference_new_from_view): Somewhat yukky hack to
get around signal emission ordering problem.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
fix to work with SINGLE
(_gtk_tree_selection_internal_select_node): Major sanitization on
selections. SINGLE now seems to work.
* tests/Makefile.am: add testtreecolumn.c:
* tests/testtreecolumn.c: New test. Mostly points out selection
bugs currently, but will test columns later.
* gtk/gtkrbtree.c (_gtk_rbtree_remove_node): Fix really nasty
selection bug. I hate touching this code -- it's scary.
2001-02-26 Havoc Pennington <hp@redhat.com>
* gtk/testgtk.c: test the window state stuff
......
Tue Feb 27 19:32:53 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c (deleted_callback): Proxy out to
_gtk_tree_row_reference_deleted.
(inserted_callback): Proxy out to
_gtk_tree_row_reference_inserted.
(_gtk_tree_row_reference_new_from_view): Somewhat yukky hack to
get around signal emission ordering problem.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
fix to work with SINGLE
(_gtk_tree_selection_internal_select_node): Major sanitization on
selections. SINGLE now seems to work.
* tests/Makefile.am: add testtreecolumn.c:
* tests/testtreecolumn.c: New test. Mostly points out selection
bugs currently, but will test columns later.
* gtk/gtkrbtree.c (_gtk_rbtree_remove_node): Fix really nasty
selection bug. I hate touching this code -- it's scary.
2001-02-26 Havoc Pennington <hp@redhat.com>
* gtk/testgtk.c: test the window state stuff
......
Tue Feb 27 19:32:53 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c (deleted_callback): Proxy out to
_gtk_tree_row_reference_deleted.
(inserted_callback): Proxy out to
_gtk_tree_row_reference_inserted.
(_gtk_tree_row_reference_new_from_view): Somewhat yukky hack to
get around signal emission ordering problem.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
fix to work with SINGLE
(_gtk_tree_selection_internal_select_node): Major sanitization on
selections. SINGLE now seems to work.
* tests/Makefile.am: add testtreecolumn.c:
* tests/testtreecolumn.c: New test. Mostly points out selection
bugs currently, but will test columns later.
* gtk/gtkrbtree.c (_gtk_rbtree_remove_node): Fix really nasty
selection bug. I hate touching this code -- it's scary.
2001-02-26 Havoc Pennington <hp@redhat.com>
* gtk/testgtk.c: test the window state stuff
......
......@@ -705,7 +705,9 @@ gtk_cell_renderer_text_set_property (GObject *object,
{
GdkColor color;
if (gdk_color_parse (g_value_get_string (value), &color))
if (!g_value_get_string (value))
set_bg_color (celltext, NULL); /* reset to backgrounmd_set to FALSE */
else if (gdk_color_parse (g_value_get_string (value), &color))
set_bg_color (celltext, &color);
else
g_warning ("Don't know color `%s'", g_value_get_string (value));
......@@ -718,8 +720,10 @@ gtk_cell_renderer_text_set_property (GObject *object,
{
GdkColor color;
if (gdk_color_parse (g_value_get_string (value), &color))
set_bg_color (celltext, &color);
if (!g_value_get_string (value))
set_fg_color (celltext, NULL); /* reset to foreground_set to FALSE */
else if (gdk_color_parse (g_value_get_string (value), &color))
set_fg_color (celltext, &color);
else
g_warning ("Don't know color `%s'", g_value_get_string (value));
......
......@@ -1009,7 +1009,6 @@ gtk_list_store_append (GtkListStore *list_store,
GtkTreeIter *iter)
{
GtkTreePath *path;
gint i = 0;
g_return_if_fail (list_store != NULL);
g_return_if_fail (GTK_IS_LIST_STORE (list_store));
......@@ -1030,7 +1029,7 @@ gtk_list_store_append (GtkListStore *list_store,
validate_list_store (list_store);
path = gtk_tree_path_new ();
gtk_tree_path_append_index (path, i);
gtk_tree_path_append_index (path, list_store->length - 1);
gtk_tree_model_inserted (GTK_TREE_MODEL (list_store), path, iter);
gtk_tree_path_free (path);
}
......
......@@ -914,7 +914,14 @@ _gtk_rbtree_remove_node (GtkRBTree *tree,
tree->root = x;
if (y != node)
node->children = y->children;
{
/* Copy the node over */
if (GTK_RBNODE_GET_COLOR (node) == GTK_RBNODE_BLACK)
node->flags = ((y->flags & (GTK_RBNODE_NON_COLORS)) | GTK_RBNODE_BLACK);
else
node->flags = ((y->flags & (GTK_RBNODE_NON_COLORS)) | GTK_RBNODE_RED);
node->children = y->children;
}
if (GTK_RBNODE_GET_COLOR (y) == GTK_RBNODE_BLACK)
_gtk_rbtree_remove_node_fixup (tree, x);
......
......@@ -32,8 +32,8 @@ typedef enum
GTK_RBNODE_IS_PARENT = 1 << 2,
GTK_RBNODE_IS_SELECTED = 1 << 3,
GTK_RBNODE_IS_PRELIT = 1 << 4,
GTK_RBNODE_IS_VIEW = 1 << 5
GTK_RBNODE_IS_VIEW = 1 << 5,
GTK_RBNODE_NON_COLORS = GTK_RBNODE_IS_PARENT | GTK_RBNODE_IS_SELECTED | GTK_RBNODE_IS_PRELIT | GTK_RBNODE_IS_VIEW,
} GtkRBNodeColor;
typedef struct _GtkRBTree GtkRBTree;
......
......@@ -516,6 +516,69 @@ struct _RowRefList
GSList *list;
};
/*
* row_reference
*/
void
_gtk_tree_row_reference_inserted (GtkTreeRowReference *reference,
GtkTreePath *path)
{
if (reference->path)
{
gint depth = gtk_tree_path_get_depth (path);
gint ref_depth = gtk_tree_path_get_depth (reference->path);
if (ref_depth >= depth)
{
gint *indices = gtk_tree_path_get_indices (path);
gint *ref_indices = gtk_tree_path_get_indices (reference->path);
gint i;
/* This is the depth that might affect us. */
i = depth - 1;
if (indices[i] <= ref_indices[i])
ref_indices[i] += 1;
}
}
}
/* Returns TRUE if the reference path was deleted; FALSE otherwise */
gboolean
_gtk_tree_row_reference_deleted (GtkTreeRowReference *reference,
GtkTreePath *path)
{
if (reference->path)
{
gint depth = gtk_tree_path_get_depth (path);
gint ref_depth = gtk_tree_path_get_depth (reference->path);
if (ref_depth >= depth)
{
/* Need to adjust path upward */
gint *indices = gtk_tree_path_get_indices (path);
gint *ref_indices = gtk_tree_path_get_indices (reference->path);
gint i;
i = depth - 1;
if (indices[i] < ref_indices[i])
ref_indices[i] -= 1;
else if (indices[i] == ref_indices[i])
{
/* the referenced node itself, or its parent, was
* deleted, mark invalid
*/
gtk_tree_path_free (reference->path);
reference->path = NULL;
return TRUE;
}
}
}
return FALSE;
}
static void
release_row_references (gpointer data)
{
......@@ -562,28 +625,7 @@ inserted_callback (GtkTreeModel *tree_model,
{
GtkTreeRowReference *reference = tmp_list->data;
/* if reference->path == NULL then the reference was already
* deleted.
*/
if (reference->path)
{
gint depth = gtk_tree_path_get_depth (path);
gint ref_depth = gtk_tree_path_get_depth (reference->path);
if (ref_depth >= depth)
{
gint *indices = gtk_tree_path_get_indices (path);
gint *ref_indices = gtk_tree_path_get_indices (reference->path);
gint i;
/* This is the depth that might affect us. */
i = depth - 1;
if (indices[i] <= ref_indices[i])
ref_indices[i] += 1;
}
}
_gtk_tree_row_reference_inserted (reference, path);
tmp_list = g_slist_next (tmp_list);
}
......@@ -614,36 +656,7 @@ deleted_callback (GtkTreeModel *tree_model,
{
GtkTreeRowReference *reference = tmp_list->data;
/* if reference->path == NULL then the reference was already
* deleted.
*/
if (reference->path)
{
gint depth = gtk_tree_path_get_depth (path);
gint ref_depth = gtk_tree_path_get_depth (reference->path);
if (ref_depth >= depth)
{
/* Need to adjust path upward */
gint *indices = gtk_tree_path_get_indices (path);
gint *ref_indices = gtk_tree_path_get_indices (reference->path);
gint i;
i = depth - 1;
if (indices[i] < ref_indices[i])
ref_indices[i] -= 1;
else if (indices[i] == ref_indices[i])
{
/* the referenced node itself, or its parent, was
* deleted, mark invalid
*/
gtk_tree_path_free (reference->path);
reference->path = NULL;
}
}
}
_gtk_tree_row_reference_deleted (reference, path);
tmp_list = g_slist_next (tmp_list);
}
......@@ -673,7 +686,7 @@ connect_ref_callbacks (GtkTreeModel *model,
/* FIXME */
g_signal_connect_data (G_OBJECT (model),
"reordered",
(GCallback) reorderedc_allback,
(GCallback) reordered_callback,
refs,
NULL,
FALSE,
......@@ -721,7 +734,20 @@ gtk_tree_row_reference_new (GtkTreeModel *model,
}
refs->list = g_slist_prepend (refs->list, reference);
return reference;
}
GtkTreeRowReference *
_gtk_tree_row_reference_new_from_view (GtkTreePath *path)
{
GtkTreeRowReference *reference;
reference = g_new (GtkTreeRowReference, 1);
reference->model = NULL;
reference->path = gtk_tree_path_copy (path);
return reference;
}
......
......@@ -202,11 +202,19 @@ GtkTreePath *_gtk_tree_view_find_path (GtkTreeView *tree_v
void _gtk_tree_view_update_size (GtkTreeView *tree_view);
void _gtk_tree_view_column_set_tree_view (GtkTreeViewColumn *column,
GtkTreeView *tree_view);
GtkTreeSelection* _gtk_tree_selection_new (void);
GtkTreeSelection* _gtk_tree_selection_new_with_tree_view (GtkTreeView *tree_view);
void _gtk_tree_selection_set_tree_view (GtkTreeSelection *selection,
GtkTreeView *tree_view);
GtkTreeRowReference *_gtk_tree_row_reference_new_from_view (GtkTreePath *path);
void _gtk_tree_row_reference_inserted (GtkTreeRowReference *reference,
GtkTreePath *path);
gboolean _gtk_tree_row_reference_deleted (GtkTreeRowReference *reference,
GtkTreePath *path);
#ifdef __cplusplus
}
#endif /* __cplusplus */
......
......@@ -24,6 +24,8 @@
static void gtk_tree_selection_init (GtkTreeSelection *selection);
static void gtk_tree_selection_class_init (GtkTreeSelectionClass *class);
static void gtk_tree_selection_finalize (GObject *object);
static gint gtk_tree_selection_real_select_all (GtkTreeSelection *selection);
static gint gtk_tree_selection_real_unselect_all (GtkTreeSelection *selection);
static gint gtk_tree_selection_real_select_node (GtkTreeSelection *selection,
......@@ -69,11 +71,12 @@ gtk_tree_selection_get_type (void)
static void
gtk_tree_selection_class_init (GtkTreeSelectionClass *class)
{
GtkObjectClass *object_class;
GObjectClass *object_class;
object_class = (GtkObjectClass*) class;
object_class = (GObjectClass*) class;
parent_class = g_type_class_peek_parent (class);
object_class->finalize = gtk_tree_selection_finalize;
class->selection_changed = NULL;
tree_selection_signals[SELECTION_CHANGED] =
......@@ -91,6 +94,13 @@ gtk_tree_selection_init (GtkTreeSelection *selection)
selection->type = GTK_TREE_SELECTION_SINGLE;
}
static void
gtk_tree_selection_finalize (GObject *object)
{
if (GTK_TREE_SELECTION (object)->destroy)
(* GTK_TREE_SELECTION (object)->destroy) (GTK_TREE_SELECTION (object)->user_data);
}
/**
* _gtk_tree_selection_new:
*
......@@ -214,6 +224,7 @@ gtk_tree_selection_set_mode (GtkTreeSelection *selection,
* @selection: A #GtkTreeSelection.
* @func: The selection function.
* @data: The selection function's data.
* @destroy: The destroy function for user data. May be NULL.
*
* Sets the selection function. If set, this function is called before any node
* is selected or unselected, giving some control over which nodes are selected.
......@@ -221,7 +232,8 @@ gtk_tree_selection_set_mode (GtkTreeSelection *selection,
void
gtk_tree_selection_set_select_function (GtkTreeSelection *selection,
GtkTreeSelectionFunc func,
gpointer data)
gpointer data,
GtkDestroyNotify destroy)
{
g_return_if_fail (selection != NULL);
g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
......@@ -229,6 +241,7 @@ gtk_tree_selection_set_select_function (GtkTreeSelection *selection,
selection->user_func = func;
selection->user_data = data;
selection->destroy = destroy;
}
/**
......@@ -263,9 +276,10 @@ gtk_tree_selection_get_tree_view (GtkTreeSelection *selection)
* @iter: The #GtkTreeIter, or NULL.
*
* Sets @iter to the currently selected node if @selection is set to
* #GTK_TREE_SELECTION_SINGLE. Otherwise, it uses the anchor. @iter may be
* NULL if you just want to test if @selection has any selected nodes. @model
* is filled with the current model as a convenience.
* #GTK_TREE_SELECTION_SINGLE. @iter may be NULL if you just want to test if
* @selection has any selected nodes. @model is filled with the current model
* as a convenience. This function will not work if you use @selection is
* #GTK_TREE_SELECTION_MULTI.
*
* Return value: TRUE, if there is a selected node.
**/
......@@ -281,6 +295,9 @@ gtk_tree_selection_get_selected (GtkTreeSelection *selection,
g_return_val_if_fail (selection != NULL, FALSE);
g_return_val_if_fail (GTK_IS_TREE_SELECTION (selection), FALSE);
g_return_val_if_fail (selection->type == GTK_TREE_SELECTION_SINGLE, FALSE);
g_return_val_if_fail (selection->tree_view != NULL, FALSE);
g_return_val_if_fail (selection->tree_view->priv->model != NULL, FALSE);
if (model)
*model = selection->tree_view->priv->model;
......@@ -299,9 +316,6 @@ gtk_tree_selection_get_selected (GtkTreeSelection *selection,
return TRUE;
}
g_return_val_if_fail (selection->tree_view != NULL, FALSE);
g_return_val_if_fail (selection->tree_view->priv->model != NULL, FALSE);
retval = FALSE;
if (!_gtk_tree_view_find_node (selection->tree_view,
......@@ -713,8 +727,12 @@ gtk_tree_selection_real_unselect_all (GtkTreeSelection *selection)
if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
{
gtk_tree_selection_real_select_node (selection, tree, node, FALSE);
return TRUE;
if (gtk_tree_selection_real_select_node (selection, tree, node, FALSE))
{
gtk_tree_row_reference_free (selection->tree_view->priv->anchor);
selection->tree_view->priv->anchor = NULL;
return TRUE;
}
}
return FALSE;
}
......@@ -870,8 +888,8 @@ gtk_tree_selection_select_range (GtkTreeSelection *selection,
if (gtk_tree_selection_real_select_range (selection, start_path, end_path))
gtk_signal_emit (GTK_OBJECT (selection), tree_selection_signals[SELECTION_CHANGED]);
}
/* Called internally by gtktreeview.c It handles actually selecting the tree.
* This should almost certainly ever be called by anywhere else.
*/
void
_gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
......@@ -884,62 +902,103 @@ _gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
gint dirty = FALSE;
GtkTreePath *anchor_path = NULL;
if (selection->tree_view->priv->anchor)
anchor_path = gtk_tree_row_reference_get_path (selection->tree_view->priv->anchor);
if (((state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) && (anchor_path == NULL))
{
if (selection->tree_view->priv->anchor)
gtk_tree_row_reference_free (selection->tree_view->priv->anchor);
selection->tree_view->priv->anchor =
gtk_tree_row_reference_new (selection->tree_view->priv->model,
path);
dirty = gtk_tree_selection_real_select_node (selection, tree, node, TRUE);
}
else if ((state & (GDK_CONTROL_MASK|GDK_SHIFT_MASK)) == (GDK_SHIFT_MASK|GDK_CONTROL_MASK))
if (selection->type == GTK_TREE_SELECTION_SINGLE)
{
gtk_tree_selection_select_range (selection,
anchor_path,
path);
/* Did we try to select the same node again? */
if (anchor_path && gtk_tree_path_compare (path, anchor_path) == 0)
{
if ((state & GDK_CONTROL_MASK) == GDK_CONTROL_MASK)
{
dirty = gtk_tree_selection_real_unselect_all (selection);
}
}
else
{
/* FIXME: We only want to select the new node if we can unselect the
* old one, and we can select the new one. We are currently
* unselecting the old one first, then trying the new one. */
if (anchor_path)
{
dirty = gtk_tree_selection_real_unselect_all (selection);
if (dirty)
{
if (selection->tree_view->priv->anchor)
gtk_tree_row_reference_free (selection->tree_view->priv->anchor);
if (gtk_tree_selection_real_select_node (selection, tree, node, TRUE))
{
selection->tree_view->priv->anchor =
gtk_tree_row_reference_new (selection->tree_view->priv->model, path);
}
}
}
else
{
if (gtk_tree_selection_real_select_node (selection, tree, node, TRUE))
{
dirty = TRUE;
selection->tree_view->priv->anchor =
gtk_tree_row_reference_new (selection->tree_view->priv->model, path);
}
}
}
}
else if ((state & GDK_CONTROL_MASK) == GDK_CONTROL_MASK)
else if (selection->type == GTK_TREE_SELECTION_MULTI)
{
flags = node->flags;
if (selection->type == GTK_TREE_SELECTION_SINGLE)
dirty = gtk_tree_selection_real_unselect_all (selection);
if (selection->tree_view->priv->anchor)
gtk_tree_row_reference_free (selection->tree_view->priv->anchor);
if (((state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) && (anchor_path == NULL))
{
if (selection->tree_view->priv->anchor)
gtk_tree_row_reference_free (selection->tree_view->priv->anchor);
selection->tree_view->priv->anchor =
gtk_tree_row_reference_new (selection->tree_view->priv->model,
path);
selection->tree_view->priv->anchor =
gtk_tree_row_reference_new (selection->tree_view->priv->model,
path);
dirty = gtk_tree_selection_real_select_node (selection, tree, node, TRUE);
}
else if ((state & (GDK_CONTROL_MASK|GDK_SHIFT_MASK)) == (GDK_SHIFT_MASK|GDK_CONTROL_MASK))
{
gtk_tree_selection_select_range (selection,
anchor_path,
path);
}
else if ((state & GDK_CONTROL_MASK) == GDK_CONTROL_MASK)
{
flags = node->flags;
if (selection->tree_view->priv->anchor)
gtk_tree_row_reference_free (selection->tree_view->priv->anchor);
selection->tree_view->priv->anchor =
gtk_tree_row_reference_new (selection->tree_view->priv->model,
path);
if ((flags & GTK_RBNODE_IS_SELECTED) == GTK_RBNODE_IS_SELECTED)
dirty |= gtk_tree_selection_real_select_node (selection, tree, node, FALSE);
if ((flags & GTK_RBNODE_IS_SELECTED) == GTK_RBNODE_IS_SELECTED)
dirty |= gtk_tree_selection_real_select_node (selection, tree, node, FALSE);
else
dirty |= gtk_tree_selection_real_select_node (selection, tree, node, TRUE);
}
else if ((state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK)
{
dirty = gtk_tree_selection_real_unselect_all (selection);
dirty |= gtk_tree_selection_real_select_range (selection,
anchor_path,
path);
}
else
dirty |= gtk_tree_selection_real_select_node (selection, tree, node, TRUE);
}
else if ((state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK)
{
dirty = gtk_tree_selection_real_unselect_all (selection);
dirty |= gtk_tree_selection_real_select_range (selection,
anchor_path,
path);
}
else
{
dirty = gtk_tree_selection_real_unselect_all (selection);
{
dirty = gtk_tree_selection_real_unselect_all (selection);
if (selection->tree_view->priv->anchor)
gtk_tree_row_reference_free (selection->tree_view->priv->anchor);
if (selection->tree_view->priv->anchor)
gtk_tree_row_reference_free (selection->tree_view->priv->anchor);
selection->tree_view->priv->anchor =
gtk_tree_row_reference_new (selection->tree_view->priv->model,
path);
selection->tree_view->priv->anchor =
gtk_tree_row_reference_new (selection->tree_view->priv->model,