]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkcssinheritvalue.c
Rename property to be more neutral
[~andy/gtk] / gtk / gtkcssinheritvalue.c
index 692ec5821f1e938ac7f001fd9a5a6f73811b0566..e2c3f163300b2a19c889ae52057d815936ff2e1b 100644 (file)
@@ -19,6 +19,9 @@
 
 #include "gtkcssinheritvalueprivate.h"
 
+#include "gtkcssinitialvalueprivate.h"
+#include "gtkstylecontextprivate.h"
+
 struct _GtkCssValue {
   GTK_CSS_VALUE_BASE
 };
@@ -30,6 +33,30 @@ gtk_css_value_inherit_free (GtkCssValue *value)
   g_assert_not_reached ();
 }
 
+static GtkCssValue *
+gtk_css_value_inherit_compute (GtkCssValue             *value,
+                               guint                    property_id,
+                               GtkStyleProviderPrivate *provider,
+                               GtkCssComputedValues    *values,
+                               GtkCssComputedValues    *parent_values,
+                               GtkCssDependencies      *dependencies)
+{
+  if (parent_values)
+    {
+      *dependencies = GTK_CSS_EQUALS_PARENT;
+      return _gtk_css_value_ref (_gtk_css_computed_values_get_value (parent_values, property_id));
+    }
+  else
+    {
+      return _gtk_css_value_compute (_gtk_css_initial_value_get (),
+                                     property_id,
+                                     provider,
+                                     values,
+                                     parent_values,
+                                     dependencies);
+    }
+}
+
 static gboolean
 gtk_css_value_inherit_equal (const GtkCssValue *value1,
                              const GtkCssValue *value2)
@@ -40,6 +67,7 @@ gtk_css_value_inherit_equal (const GtkCssValue *value1,
 static GtkCssValue *
 gtk_css_value_inherit_transition (GtkCssValue *start,
                                   GtkCssValue *end,
+                                  guint        property_id,
                                   double       progress)
 {
   return NULL;
@@ -54,6 +82,7 @@ gtk_css_value_inherit_print (const GtkCssValue *value,
 
 static const GtkCssValueClass GTK_CSS_VALUE_INHERIT = {
   gtk_css_value_inherit_free,
+  gtk_css_value_inherit_compute,
   gtk_css_value_inherit_equal,
   gtk_css_value_inherit_transition,
   gtk_css_value_inherit_print
@@ -66,11 +95,3 @@ _gtk_css_inherit_value_new (void)
 {
   return _gtk_css_value_ref (&inherit);
 }
-
-gboolean
-_gtk_css_value_is_inherit (const GtkCssValue *value)
-{
-  g_return_val_if_fail (value != NULL, FALSE);
-
-  return value == &inherit;
-}