Commit 36c79712 authored by Benjamin Otte's avatar Benjamin Otte

csscustomproperty: Move compute code to GtkCssTypedValue

This way, we don't need the print_value vfunc anymore.
parent c9b918b7
......@@ -122,22 +122,9 @@ _gtk_css_custom_property_class_init (GtkCssCustomPropertyClass *klass)
property_class->assign = gtk_css_custom_property_assign;
}
static GtkCssValue *
gtk_css_custom_property_compute_value (GtkCssStyleProperty *property,
GtkStyleContext *context,
GtkCssValue *specified)
{
GtkCssCustomProperty *custom = GTK_CSS_CUSTOM_PROPERTY (property);
return _gtk_css_style_compute_value (context, custom->pspec->value_type, specified);
}
static void
_gtk_css_custom_property_init (GtkCssCustomProperty *custom)
{
GtkCssStyleProperty *style = GTK_CSS_STYLE_PROPERTY (custom);
style->compute_value = gtk_css_custom_property_compute_value;
}
static GtkCssValue *
......
......@@ -19,6 +19,7 @@
#include "gtkcsstypedvalueprivate.h"
#include "gtkcsscustompropertyprivate.h"
#include "gtkcssstylefuncsprivate.h"
struct _GtkCssValue {
......@@ -38,7 +39,9 @@ gtk_css_value_typed_compute (GtkCssValue *value,
guint property_id,
GtkStyleContext *context)
{
return _gtk_css_value_ref (value);
GtkCssCustomProperty *custom = GTK_CSS_CUSTOM_PROPERTY (_gtk_css_style_property_lookup_by_id (property_id));
return _gtk_css_style_compute_value (context, custom->pspec->value_type, value);
}
static gboolean
......
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