summaryrefslogtreecommitdiff
path: root/gtk/gtkcssshorthandproperty.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-01-01 21:58:45 +0100
committerBenjamin Otte <otte@redhat.com>2012-01-09 18:37:53 +0100
commit79a171de0a592dcacdcd2151229ec77733441f15 (patch)
tree38d08c070fa91036379c6172c299e7dc860bd6a7 /gtk/gtkcssshorthandproperty.c
parentb904679a111224039a92e6f50acd97f6218a2d3a (diff)
downloadgtk+-79a171de0a592dcacdcd2151229ec77733441f15.tar.gz
styleproperty: Make query() and assign() vfuncs
... and implement them in the 2 known subclasses.
Diffstat (limited to 'gtk/gtkcssshorthandproperty.c')
-rw-r--r--gtk/gtkcssshorthandproperty.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/gtk/gtkcssshorthandproperty.c b/gtk/gtkcssshorthandproperty.c
index 64c8633d03..6b85a98bc9 100644
--- a/gtk/gtkcssshorthandproperty.c
+++ b/gtk/gtkcssshorthandproperty.c
@@ -60,9 +60,42 @@ gtk_css_shorthand_property_set_property (GObject *object,
}
static void
+_gtk_css_shorthand_property_assign (GtkStyleProperty *property,
+ GtkStyleProperties *props,
+ GtkStateFlags state,
+ const GValue *value)
+{
+ GParameter *parameters;
+ guint i, n_parameters;
+
+ parameters = _gtk_style_property_unpack (property, value, &n_parameters);
+
+ for (i = 0; i < n_parameters; i++)
+ {
+ _gtk_style_property_assign (_gtk_style_property_lookup (parameters[i].name),
+ props,
+ state,
+ &parameters[i].value);
+ g_value_unset (&parameters[i].value);
+ }
+ g_free (parameters);
+}
+
+static void
+_gtk_css_shorthand_property_query (GtkStyleProperty *property,
+ GtkStyleProperties *props,
+ GtkStateFlags state,
+ GtkStylePropertyContext *context,
+ GValue *value)
+{
+ property->pack_func (value, props, state, context);
+}
+
+static void
_gtk_css_shorthand_property_class_init (GtkCssShorthandPropertyClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkStylePropertyClass *property_class = GTK_STYLE_PROPERTY_CLASS (klass);
object_class->set_property = gtk_css_shorthand_property_set_property;
@@ -73,6 +106,9 @@ _gtk_css_shorthand_property_class_init (GtkCssShorthandPropertyClass *klass)
P_("The list of subproperties"),
G_TYPE_STRV,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
+
+ property_class->assign = _gtk_css_shorthand_property_assign;
+ property_class->query = _gtk_css_shorthand_property_query;
}
static void