summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@redhat.com>2000-10-13 00:34:38 +0000
committerJonathan Blandford <jrb@src.gnome.org>2000-10-13 00:34:38 +0000
commit829872e94821c1abfb5c5a8b6dcd383c18302474 (patch)
treea09889ffde9b3aedadc3eabe27d5f98a938d819a /gtk
parentc659596e223245c7253ca2f65e9bdbc5df10789e (diff)
downloadgtk+-829872e94821c1abfb5c5a8b6dcd383c18302474.tar.gz
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.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtktreedatalist.c43
-rw-r--r--gtk/gtktreedatalist.h2
-rw-r--r--gtk/gtktreeselection.c2
3 files changed, 47 insertions, 0 deletions
diff --git a/gtk/gtktreedatalist.c b/gtk/gtktreedatalist.c
index 47f022fc1c..e8a1cab7ae 100644
--- a/gtk/gtktreedatalist.c
+++ b/gtk/gtktreedatalist.c
@@ -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;
}
}
+
diff --git a/gtk/gtktreedatalist.h b/gtk/gtktreedatalist.h
index 823349c48f..78f4db651a 100644
--- a/gtk/gtktreedatalist.h
+++ b/gtk/gtktreedatalist.h
@@ -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;
diff --git a/gtk/gtktreeselection.c b/gtk/gtktreeselection.c
index 50dbdf0625..22d7a56744 100644
--- a/gtk/gtktreeselection.c
+++ b/gtk/gtktreeselection.c
@@ -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,