X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkcssrgbavalue.c;h=fb52acefa5052105a33c444cf4712778bdcecc10;hb=9d81b69e06cd9c2ad9cb5204056bfae5a3128e9c;hp=61d8b1f8c5d0786ae442e3146760d21d3854fd05;hpb=1a9dfab825eb18ee101b579743a47ebb55e06a35;p=~andy%2Fgtk diff --git a/gtk/gtkcssrgbavalue.c b/gtk/gtkcssrgbavalue.c index 61d8b1f8c..fb52acefa 100644 --- a/gtk/gtkcssrgbavalue.c +++ b/gtk/gtkcssrgbavalue.c @@ -19,8 +19,8 @@ #include "gtkcssrgbavalueprivate.h" +#include "gtkcssstylepropertyprivate.h" #include "gtkstylecontextprivate.h" -#include "gtksymboliccolorprivate.h" struct _GtkCssValue { GTK_CSS_VALUE_BASE @@ -33,6 +33,17 @@ gtk_css_value_rgba_free (GtkCssValue *value) g_slice_free (GtkCssValue, value); } +static GtkCssValue * +gtk_css_value_rgba_compute (GtkCssValue *value, + guint property_id, + GtkStyleProviderPrivate *provider, + GtkCssComputedValues *values, + GtkCssComputedValues *parent_values, + GtkCssDependencies *dependencies) +{ + return _gtk_css_value_ref (value); +} + static gboolean gtk_css_value_rgba_equal (const GtkCssValue *rgba1, const GtkCssValue *rgba2) @@ -43,6 +54,7 @@ gtk_css_value_rgba_equal (const GtkCssValue *rgba1, static GtkCssValue * gtk_css_value_rgba_transition (GtkCssValue *start, GtkCssValue *end, + guint property_id, double progress) { GdkRGBA transition; @@ -67,6 +79,7 @@ gtk_css_value_rgba_print (const GtkCssValue *rgba, static const GtkCssValueClass GTK_CSS_VALUE_RGBA = { gtk_css_value_rgba_free, + gtk_css_value_rgba_compute, gtk_css_value_rgba_equal, gtk_css_value_rgba_transition, gtk_css_value_rgba_print @@ -92,47 +105,3 @@ _gtk_css_rgba_value_get_rgba (const GtkCssValue *rgba) return &rgba->rgba; } - -GtkCssValue * -_gtk_css_rgba_value_compute_from_symbolic (GtkCssValue *rgba, - GtkCssValue *fallback, - GtkStyleContext *context, - gboolean for_color_property) -{ - GtkSymbolicColor *symbolic; - GtkCssValue *resolved; - - g_return_val_if_fail (rgba != NULL, NULL); - - symbolic = _gtk_css_value_get_symbolic_color (rgba); - - if (symbolic == _gtk_symbolic_color_get_current_color ()) - { - /* The computed value of the ‘currentColor’ keyword is the computed - * value of the ‘color’ property. If the ‘currentColor’ keyword is - * set on the ‘color’ property itself, it is treated as ‘color: inherit’. - */ - if (for_color_property) - { - GtkStyleContext *parent = gtk_style_context_get_parent (context); - - if (parent) - return _gtk_css_value_ref (_gtk_style_context_peek_property (parent, "color")); - else - return _gtk_css_rgba_value_compute_from_symbolic (fallback, NULL, context, TRUE); - } - else - { - return _gtk_css_value_ref (_gtk_style_context_peek_property (context, "color")); - } - } - - resolved = _gtk_style_context_resolve_color_value (context, symbolic); - - if (resolved == NULL) - return _gtk_css_rgba_value_compute_from_symbolic (fallback, NULL, context, for_color_property); - - g_assert (resolved->class == >K_CSS_VALUE_RGBA); - return resolved; -} -