[gtk+] csscustomproperty: Move compute code to GtkCssTypedValue
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] csscustomproperty: Move compute code to GtkCssTypedValue
- Date: Tue, 28 Aug 2012 13:46:46 +0000 (UTC)
commit 36c79712a120eac52d600c90ecd2affc34d21b50
Author: Benjamin Otte <otte redhat com>
Date: Mon Jul 16 14:15:19 2012 +0200
csscustomproperty: Move compute code to GtkCssTypedValue
This way, we don't need the print_value vfunc anymore.
gtk/gtkcsscustomproperty.c | 13 -------------
gtk/gtkcsstypedvalue.c | 5 ++++-
2 files changed, 4 insertions(+), 14 deletions(-)
---
diff --git a/gtk/gtkcsscustomproperty.c b/gtk/gtkcsscustomproperty.c
index f017f7c..6c8960e 100644
--- a/gtk/gtkcsscustomproperty.c
+++ b/gtk/gtkcsscustomproperty.c
@@ -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 *
diff --git a/gtk/gtkcsstypedvalue.c b/gtk/gtkcsstypedvalue.c
index eb98684..60eeea8 100644
--- a/gtk/gtkcsstypedvalue.c
+++ b/gtk/gtkcsstypedvalue.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]