Added values other then G_TYPE_STRING. Minor commenting updates. Format

2000-10-12  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreedatalist.[ch] (gtk_tree_data_list_value_to_node): Added
	values other then G_TYPE_STRING.
	* gtk/gtktreeselection.c: Minor commenting updates.
	* gtk/gtktreeview.c: Format updates.
This commit is contained in:
Jonathan Blandford 2000-10-13 00:34:38 +00:00 committed by Jonathan Blandford
parent c659596e22
commit 829872e948
3 changed files with 47 additions and 0 deletions

View File

@ -136,9 +136,30 @@ gtk_tree_data_list_node_to_value (GtkTreeDataList *list,
switch (type)
{
case G_TYPE_BOOLEAN:
g_value_set_boolean (value, (gboolean) list->data.v_int);
break;
case G_TYPE_CHAR:
g_value_set_char (value, list->data.v_char);
break;
case G_TYPE_UCHAR:
g_value_set_uchar (value, list->data.v_uchar);
break;
case G_TYPE_INT:
g_value_set_int (value, list->data.v_int);
break;
case G_TYPE_UINT:
g_value_set_uint (value, list->data.v_uint);
break;
case G_TYPE_FLOAT:
g_value_set_float (value, list->data.v_float);
break;
case G_TYPE_STRING:
g_value_set_string (value, (gchar *) list->data.v_pointer);
break;
case G_TYPE_OBJECT:
g_value_set_object (value, (GObject *) list->data.v_pointer);
break;
}
}
@ -148,12 +169,34 @@ gtk_tree_data_list_value_to_node (GtkTreeDataList *list,
{
switch (value->g_type)
{
case G_TYPE_BOOLEAN:
list->data.v_int = g_value_get_boolean (value);
break;
case G_TYPE_CHAR:
list->data.v_char = g_value_get_char (value);
break;
case G_TYPE_UCHAR:
list->data.v_uchar = g_value_get_uchar (value);
break;
case G_TYPE_INT:
list->data.v_int = g_value_get_int (value);
break;
case G_TYPE_UINT:
list->data.v_uint = g_value_get_uint (value);
break;
case G_TYPE_FLOAT:
list->data.v_float = g_value_get_float (value);
break;
case G_TYPE_STRING:
list->data.v_pointer = g_value_dup_string (value);
break;
case G_TYPE_OBJECT:
list->data.v_pointer = g_value_dup_object (value);
break;
default:
g_warning ("Unsupported type (%s) stored.", g_type_name (value->g_type));
return;
}
}

View File

@ -31,6 +31,8 @@ struct _GtkTreeDataList
union {
gint v_int;
gint8 v_char;
guint8 v_uchar;
guint v_uint;
gfloat v_float;
gpointer v_pointer;

View File

@ -726,6 +726,8 @@ _gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
gtk_signal_emit (GTK_OBJECT (selection), tree_selection_signals[SELECTION_CHANGED]);
}
/* NOTE: Any {un,}selection ever done _MUST_ be done through this function!
*/
static gint
gtk_tree_selection_real_select_node (GtkTreeSelection *selection,
GtkRBTree *tree,