Commit 30f9fab4 authored by Jonathan Blandford's avatar Jonathan Blandford Committed by Jonathan Blandford

Add GTK_SELECTION_NONE enum, #61695

Wed Oct 31 14:45:08 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtkenums.h (enum): Add GTK_SELECTION_NONE enum, #61695

	* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): Handle new
	GTK_SELECTION_NONE enum.
	(_gtk_tree_selection_internal_select_node): ditto

	* gtk/gtkcellrenderer.h (struct _GtkCellRendererClass): add
	constness.

	* gtk/gtkcellrenderertoggle.c: more yummy constness.

	* gtk/gtkclist.c (gtk_clist_set_selection_mode): g_return_if_fail
	if mode == GTK_SELECTION_NONE
parent c49351c8
Wed Oct 31 14:45:08 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkenums.h (enum): Add GTK_SELECTION_NONE enum, #61695
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): Handle new
GTK_SELECTION_NONE enum.
(_gtk_tree_selection_internal_select_node): ditto
* gtk/gtkcellrenderer.h (struct _GtkCellRendererClass): add
constness.
* gtk/gtkcellrenderertoggle.c: more yummy constness.
* gtk/gtkclist.c (gtk_clist_set_selection_mode): g_return_if_fail
if mode == GTK_SELECTION_NONE
Wed Oct 31 14:05:17 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_class_init): Added a
......
Wed Oct 31 14:45:08 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkenums.h (enum): Add GTK_SELECTION_NONE enum, #61695
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): Handle new
GTK_SELECTION_NONE enum.
(_gtk_tree_selection_internal_select_node): ditto
* gtk/gtkcellrenderer.h (struct _GtkCellRendererClass): add
constness.
* gtk/gtkcellrenderertoggle.c: more yummy constness.
* gtk/gtkclist.c (gtk_clist_set_selection_mode): g_return_if_fail
if mode == GTK_SELECTION_NONE
Wed Oct 31 14:05:17 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_class_init): Added a
......
Wed Oct 31 14:45:08 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkenums.h (enum): Add GTK_SELECTION_NONE enum, #61695
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): Handle new
GTK_SELECTION_NONE enum.
(_gtk_tree_selection_internal_select_node): ditto
* gtk/gtkcellrenderer.h (struct _GtkCellRendererClass): add
constness.
* gtk/gtkcellrenderertoggle.c: more yummy constness.
* gtk/gtkclist.c (gtk_clist_set_selection_mode): g_return_if_fail
if mode == GTK_SELECTION_NONE
Wed Oct 31 14:05:17 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_class_init): Added a
......
Wed Oct 31 14:45:08 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkenums.h (enum): Add GTK_SELECTION_NONE enum, #61695
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): Handle new
GTK_SELECTION_NONE enum.
(_gtk_tree_selection_internal_select_node): ditto
* gtk/gtkcellrenderer.h (struct _GtkCellRendererClass): add
constness.
* gtk/gtkcellrenderertoggle.c: more yummy constness.
* gtk/gtkclist.c (gtk_clist_set_selection_mode): g_return_if_fail
if mode == GTK_SELECTION_NONE
Wed Oct 31 14:05:17 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_class_init): Added a
......
Wed Oct 31 14:45:08 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkenums.h (enum): Add GTK_SELECTION_NONE enum, #61695
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): Handle new
GTK_SELECTION_NONE enum.
(_gtk_tree_selection_internal_select_node): ditto
* gtk/gtkcellrenderer.h (struct _GtkCellRendererClass): add
constness.
* gtk/gtkcellrenderertoggle.c: more yummy constness.
* gtk/gtkclist.c (gtk_clist_set_selection_mode): g_return_if_fail
if mode == GTK_SELECTION_NONE
Wed Oct 31 14:05:17 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_class_init): Added a
......
Wed Oct 31 14:45:08 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkenums.h (enum): Add GTK_SELECTION_NONE enum, #61695
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): Handle new
GTK_SELECTION_NONE enum.
(_gtk_tree_selection_internal_select_node): ditto
* gtk/gtkcellrenderer.h (struct _GtkCellRendererClass): add
constness.
* gtk/gtkcellrenderertoggle.c: more yummy constness.
* gtk/gtkclist.c (gtk_clist_set_selection_mode): g_return_if_fail
if mode == GTK_SELECTION_NONE
Wed Oct 31 14:05:17 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_class_init): Added a
......
Wed Oct 31 14:45:08 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkenums.h (enum): Add GTK_SELECTION_NONE enum, #61695
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): Handle new
GTK_SELECTION_NONE enum.
(_gtk_tree_selection_internal_select_node): ditto
* gtk/gtkcellrenderer.h (struct _GtkCellRendererClass): add
constness.
* gtk/gtkcellrenderertoggle.c: more yummy constness.
* gtk/gtkclist.c (gtk_clist_set_selection_mode): g_return_if_fail
if mode == GTK_SELECTION_NONE
Wed Oct 31 14:05:17 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_class_init): Added a
......
......@@ -279,6 +279,7 @@ contains grayscale or red-green-blue data.
</para>
@GTK_SELECTION_NONE:
@GTK_SELECTION_SINGLE:
@GTK_SELECTION_BROWSE:
@GTK_SELECTION_MULTIPLE:
......
......@@ -735,6 +735,13 @@ GtkTreeView
@treeview: the object which received the signal.
<!-- ##### SIGNAL GtkTreeView::cursor-changed ##### -->
<para>
</para>
@treeview: the object which received the signal.
<!-- ##### SIGNAL GtkTreeView::expand-collapse-cursor-row ##### -->
<para>
......
......@@ -93,7 +93,7 @@ struct _GtkCellRendererClass
gboolean (* activate) (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
gchar *path,
const gchar *path,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GtkCellRendererState flags);
......
......@@ -49,7 +49,7 @@ static void gtk_cell_renderer_toggle_render (GtkCellRenderer *cel
static gboolean gtk_cell_renderer_toggle_activate (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
const gchar *path,
const gchar *path,
GdkRectangle *background_area,
GdkRectangle *cell_area,
guint flags);
......
......@@ -1276,6 +1276,7 @@ gtk_clist_set_selection_mode (GtkCList *clist,
GtkSelectionMode mode)
{
g_return_if_fail (GTK_IS_CLIST (clist));
g_return_if_fail (mode != GTK_SELECTION_NONE);
if (mode == clist->selection_mode)
return;
......@@ -1299,6 +1300,9 @@ gtk_clist_set_selection_mode (GtkCList *clist,
case GTK_SELECTION_SINGLE:
gtk_clist_unselect_all (clist);
break;
default:
/* Someone set it by hand */
g_assert_not_reached ();
}
}
......@@ -3594,6 +3598,8 @@ toggle_row (GtkCList *clist,
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW],
row, column, event);
break;
default:
g_assert_not_reached ();
}
}
......@@ -3814,6 +3820,8 @@ real_select_all (GtkCList *clist)
update_extended_selection (clist, clist->rows);
GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL);
return;
default:
g_assert_not_reached ();
}
}
......@@ -7390,6 +7398,8 @@ gtk_clist_drag_begin (GtkWidget *widget,
clist->anchor = -1;
case GTK_SELECTION_BROWSE:
break;
default:
g_assert_not_reached ();
}
info = g_dataset_get_data (context, "gtk-clist-drag-source");
......
......@@ -317,6 +317,7 @@ typedef enum
/* list selection modes */
typedef enum
{
GTK_SELECTION_NONE, /* Nothing can be selected */
GTK_SELECTION_SINGLE,
GTK_SELECTION_BROWSE,
GTK_SELECTION_MULTIPLE,
......
......@@ -176,22 +176,33 @@ void
gtk_tree_selection_set_mode (GtkTreeSelection *selection,
GtkSelectionMode type)
{
GtkTreeSelectionFunc tmp_func;
g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
if (selection->type == type)
return;
if (type == GTK_SELECTION_SINGLE ||
type == GTK_SELECTION_BROWSE)
if (type == GTK_SELECTION_NONE)
{
gtk_tree_row_reference_free (selection->tree_view->priv->anchor);
/* We do this so that we unconditionally unset all rows
*/
tmp_func = selection->user_func;
selection->user_func = NULL;
gtk_tree_selection_unselect_all (selection);
selection->user_func = tmp_func;
}
else if (type == GTK_SELECTION_SINGLE ||
type == GTK_SELECTION_BROWSE)
{
GtkRBTree *tree = NULL;
GtkRBNode *node = NULL;
gint selected = FALSE;
GtkTreePath *anchor_path = NULL;
if (selection->tree_view->priv->anchor)
{
GtkTreePath *anchor_path;
anchor_path = gtk_tree_row_reference_get_path (selection->tree_view->priv->anchor);
if (anchor_path)
......@@ -203,19 +214,25 @@ gtk_tree_selection_set_mode (GtkTreeSelection *selection,
if (node && GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
selected = TRUE;
gtk_tree_path_free (anchor_path);
}
}
/* FIXME: if user_func is set, then it needs to unconditionally unselect
* all.
/* We do this so that we unconditionally unset all rows
*/
tmp_func = selection->user_func;
selection->user_func = NULL;
gtk_tree_selection_unselect_all (selection);
selection->user_func = tmp_func;
/* FIXME are we properly emitting the selection_changed signal here? */
if (node && selected)
GTK_RBNODE_SET_FLAG (node, GTK_RBNODE_IS_SELECTED);
_gtk_tree_selection_internal_select_node (selection,
node,
tree,
anchor_path,
0);
gtk_tree_path_free (anchor_path);
}
selection->type = type;
}
......@@ -955,6 +972,8 @@ _gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
gint dirty = FALSE;
GtkTreePath *anchor_path = NULL;
if (selection->type == GTK_SELECTION_NONE)
return;
if (selection->tree_view->priv->anchor)
anchor_path = gtk_tree_row_reference_get_path (selection->tree_view->priv->anchor);
......
......@@ -93,7 +93,6 @@ main (int argc, char *argv[])
ssmodel = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (smodel));
*/
tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
/* 12 iters now, 12 later... */
for (i = 0; data[i].word_1 != NULL; i++)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment