csscustomproperty: Move compute code to GtkCssTypedValue

This way, we don't need the print_value vfunc anymore.
This commit is contained in:
Benjamin Otte 2012-07-16 14:15:19 +02:00
parent c9b918b70f
commit 36c79712a1
2 changed files with 4 additions and 14 deletions

View File

@ -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 *

View File

@ -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