]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkcssinheritvalue.c
filechooserbutton: Don't duplicate tests for GTK_RESPONSE_DELETE_EVENT
[~andy/gtk] / gtk / gtkcssinheritvalue.c
index 52f21a0e41c0ecbfa8a5859db0a17febfaf4426c..e2c3f163300b2a19c889ae52057d815936ff2e1b 100644 (file)
@@ -19,6 +19,9 @@
 
 #include "gtkcssinheritvalueprivate.h"
 
+#include "gtkcssinitialvalueprivate.h"
+#include "gtkstylecontextprivate.h"
+
 struct _GtkCssValue {
   GTK_CSS_VALUE_BASE
 };
@@ -31,11 +34,27 @@ gtk_css_value_inherit_free (GtkCssValue *value)
 }
 
 static GtkCssValue *
-gtk_css_value_inherit_compute (GtkCssValue     *value,
-                               GtkStyleContext *context)
+gtk_css_value_inherit_compute (GtkCssValue             *value,
+                               guint                    property_id,
+                               GtkStyleProviderPrivate *provider,
+                               GtkCssComputedValues    *values,
+                               GtkCssComputedValues    *parent_values,
+                               GtkCssDependencies      *dependencies)
 {
-  /* This value should be caught further up */
-  g_return_val_if_reached (_gtk_css_value_ref (value));
+  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
@@ -48,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;
@@ -75,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;
-}