diff options
author | Benjamin Otte <otte@redhat.com> | 2012-03-26 07:46:18 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-04-17 08:59:11 +0200 |
commit | df45983fcb26b0cab9fa95b40c87f5029eecb133 (patch) | |
tree | 28b133b23c80a6c57efb84ed35864cf0a3d8e557 /gtk/gtkcssvalue.c | |
parent | 8e3e3d582f7df902caa3c3e0ec9f503d1c6d9fd0 (diff) | |
download | gtk+-df45983fcb26b0cab9fa95b40c87f5029eecb133.tar.gz |
cssvalue: Remove _gtk_css_value_new_take_gvalue()
Having two constructors from GValues complicates refactorings, so I'd
rather not have them.
Diffstat (limited to 'gtk/gtkcssvalue.c')
-rw-r--r-- | gtk/gtkcssvalue.c | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/gtk/gtkcssvalue.c b/gtk/gtkcssvalue.c index b79c4ee180..7bd1a55e45 100644 --- a/gtk/gtkcssvalue.c +++ b/gtk/gtkcssvalue.c @@ -160,63 +160,6 @@ _gtk_css_value_new_from_gvalue (const GValue *g_value) } GtkCssValue * -_gtk_css_value_new_take_gvalue (GValue *g_value) -{ - GtkCssValue *value; - GType type; - - g_return_val_if_fail (g_value != NULL, NULL); - - type = G_VALUE_TYPE (g_value); - - /* Make sure we reuse the int/number singletons */ - if (type == G_TYPE_INT) - { - value = _gtk_css_value_new_from_int (g_value_get_int (g_value)); - g_value_unset (g_value); - } - else if (type == GTK_TYPE_CSS_NUMBER) - { - value = _gtk_css_value_new_from_number (g_value_get_boxed (g_value)); - g_value_unset (g_value); - } - else - { - value = gtk_css_value_new (type); - - if (g_type_is_a (type, G_TYPE_OBJECT)) - value->u.ptr = g_value_get_object (g_value); - else if (g_type_is_a (type, G_TYPE_BOXED)) - value->u.ptr = g_value_get_boxed (g_value); - else if (g_type_is_a (type, G_TYPE_INT)) - value->u.gint = g_value_get_int (g_value); - else if (g_type_is_a (type, G_TYPE_UINT)) - value->u.guint = g_value_get_uint (g_value); - else if (g_type_is_a (type, G_TYPE_BOOLEAN)) - value->u.gint = g_value_get_boolean (g_value); - else if (g_type_is_a (type, G_TYPE_ENUM)) - value->u.gint = g_value_get_enum (g_value); - else if (g_type_is_a (type, G_TYPE_FLAGS)) - value->u.guint = g_value_get_flags (g_value); - else if (g_type_is_a (type, G_TYPE_STRING)) - value->u.ptr = g_value_dup_string (g_value); - else if (g_type_is_a (type, G_TYPE_DOUBLE)) - value->u.dbl = g_value_get_double (g_value); - else if (g_type_is_a (type, G_TYPE_FLOAT)) - value->u.flt = g_value_get_float (g_value); - else - { - value->u.ptr = g_slice_new0 (GValue); - g_value_init (value->u.ptr, G_VALUE_TYPE (g_value)); - g_value_copy (g_value, value->u.ptr); - g_value_unset (g_value); - } - } - - return value; -} - -GtkCssValue * _gtk_css_value_new_from_int (gint val) { GtkCssValue *value; |