diff options
-rw-r--r-- | gtk/gtkcssenumvalue.c | 38 | ||||
-rw-r--r-- | gtk/gtkcssenumvalueprivate.h | 4 | ||||
-rw-r--r-- | gtk/gtkcssstylepropertyimpl.c | 2 | ||||
-rw-r--r-- | gtk/gtkcsstypes.c | 34 | ||||
-rw-r--r-- | gtk/gtkcsstypesprivate.h | 22 | ||||
-rw-r--r-- | gtk/gtkrenderbackground.c | 6 |
6 files changed, 44 insertions, 62 deletions
diff --git a/gtk/gtkcssenumvalue.c b/gtk/gtkcssenumvalue.c index 784f97e3e6..3120a817a9 100644 --- a/gtk/gtkcssenumvalue.c +++ b/gtk/gtkcssenumvalue.c @@ -137,26 +137,26 @@ static const GtkCssValueClass GTK_CSS_VALUE_BLEND_MODE = { }; static GtkCssValue blend_mode_values[] = { - { >K_CSS_VALUE_BLEND_MODE, 1, GTK_CSS_BLEND_MODE_COLOR_BURN, "color-burn" }, - { >K_CSS_VALUE_BLEND_MODE, 1, GTK_CSS_BLEND_MODE_COLOR_DODGE, "color-dodge" }, - { >K_CSS_VALUE_BLEND_MODE, 1, GTK_CSS_BLEND_MODE_COLOR, "color" }, - { >K_CSS_VALUE_BLEND_MODE, 1, GTK_CSS_BLEND_MODE_DARKEN, "darken" }, - { >K_CSS_VALUE_BLEND_MODE, 1, GTK_CSS_BLEND_MODE_DIFFERENCE, "difference" }, - { >K_CSS_VALUE_BLEND_MODE, 1, GTK_CSS_BLEND_MODE_EXCLUSION, "exclusion" }, - { >K_CSS_VALUE_BLEND_MODE, 1, GTK_CSS_BLEND_MODE_HARD_LIGHT, "hard-light" }, - { >K_CSS_VALUE_BLEND_MODE, 1, GTK_CSS_BLEND_MODE_HUE, "hue" }, - { >K_CSS_VALUE_BLEND_MODE, 1, GTK_CSS_BLEND_MODE_LIGHTEN, "lighten" }, - { >K_CSS_VALUE_BLEND_MODE, 1, GTK_CSS_BLEND_MODE_LUMINOSITY, "luminosity" }, - { >K_CSS_VALUE_BLEND_MODE, 1, GTK_CSS_BLEND_MODE_MULTIPLY, "multiply" }, - { >K_CSS_VALUE_BLEND_MODE, 1, GTK_CSS_BLEND_MODE_NORMAL, "normal" }, - { >K_CSS_VALUE_BLEND_MODE, 1, GTK_CSS_BLEND_MODE_OVERLAY, "overlay" }, - { >K_CSS_VALUE_BLEND_MODE, 1, GTK_CSS_BLEND_MODE_SATURATE, "saturate" }, - { >K_CSS_VALUE_BLEND_MODE, 1, GTK_CSS_BLEND_MODE_SCREEN, "screen" }, - { >K_CSS_VALUE_BLEND_MODE, 1, GTK_CSS_BLEND_MODE_SOFT_LIGHT, "soft-light" } + { >K_CSS_VALUE_BLEND_MODE, 1, GSK_BLEND_MODE_DEFAULT, "normal" }, + { >K_CSS_VALUE_BLEND_MODE, 1, GSK_BLEND_MODE_MULTIPLY, "multiply" }, + { >K_CSS_VALUE_BLEND_MODE, 1, GSK_BLEND_MODE_SCREEN, "screen" }, + { >K_CSS_VALUE_BLEND_MODE, 1, GSK_BLEND_MODE_OVERLAY, "overlay" }, + { >K_CSS_VALUE_BLEND_MODE, 1, GSK_BLEND_MODE_DARKEN, "darken" }, + { >K_CSS_VALUE_BLEND_MODE, 1, GSK_BLEND_MODE_LIGHTEN, "lighten" }, + { >K_CSS_VALUE_BLEND_MODE, 1, GSK_BLEND_MODE_COLOR_DODGE, "color_dodge" }, + { >K_CSS_VALUE_BLEND_MODE, 1, GSK_BLEND_MODE_COLOR_BURN, "color_burn" }, + { >K_CSS_VALUE_BLEND_MODE, 1, GSK_BLEND_MODE_HARD_LIGHT, "hard_light" }, + { >K_CSS_VALUE_BLEND_MODE, 1, GSK_BLEND_MODE_SOFT_LIGHT, "soft_light" }, + { >K_CSS_VALUE_BLEND_MODE, 1, GSK_BLEND_MODE_DIFFERENCE, "difference" }, + { >K_CSS_VALUE_BLEND_MODE, 1, GSK_BLEND_MODE_EXCLUSION, "exclusion" }, + { >K_CSS_VALUE_BLEND_MODE, 1, GSK_BLEND_MODE_COLOR, "color" }, + { >K_CSS_VALUE_BLEND_MODE, 1, GSK_BLEND_MODE_HUE, "hue" }, + { >K_CSS_VALUE_BLEND_MODE, 1, GSK_BLEND_MODE_SATURATION, "saturation" }, + { >K_CSS_VALUE_BLEND_MODE, 1, GSK_BLEND_MODE_LUMINOSITY, "luminosity" } }; GtkCssValue * -_gtk_css_blend_mode_value_new (GtkCssBlendMode blend_mode) +_gtk_css_blend_mode_value_new (GskBlendMode blend_mode) { g_return_val_if_fail (blend_mode < G_N_ELEMENTS (blend_mode_values), NULL); @@ -179,10 +179,10 @@ _gtk_css_blend_mode_value_try_parse (GtkCssParser *parser) return NULL; } -GtkCssBlendMode +GskBlendMode _gtk_css_blend_mode_value_get (const GtkCssValue *value) { - g_return_val_if_fail (value->class == >K_CSS_VALUE_BLEND_MODE, GTK_CSS_BLEND_MODE_NORMAL); + g_return_val_if_fail (value->class == >K_CSS_VALUE_BLEND_MODE, GSK_BLEND_MODE_DEFAULT); return value->value; } diff --git a/gtk/gtkcssenumvalueprivate.h b/gtk/gtkcssenumvalueprivate.h index deb145cb2e..b1be91ddf2 100644 --- a/gtk/gtkcssenumvalueprivate.h +++ b/gtk/gtkcssenumvalueprivate.h @@ -27,9 +27,9 @@ G_BEGIN_DECLS -GtkCssValue * _gtk_css_blend_mode_value_new (GtkCssBlendMode blend_mode); +GtkCssValue * _gtk_css_blend_mode_value_new (GskBlendMode blend_mode); GtkCssValue * _gtk_css_blend_mode_value_try_parse (GtkCssParser *parser); -GtkCssBlendMode _gtk_css_blend_mode_value_get (const GtkCssValue *value); +GskBlendMode _gtk_css_blend_mode_value_get (const GtkCssValue *value); GtkCssValue * _gtk_css_border_style_value_new (GtkBorderStyle border_style); GtkCssValue * _gtk_css_border_style_value_try_parse (GtkCssParser *parser); diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c index d781d51251..66f0586001 100644 --- a/gtk/gtkcssstylepropertyimpl.c +++ b/gtk/gtkcssstylepropertyimpl.c @@ -1378,7 +1378,7 @@ _gtk_css_style_property_init_properties (void) GTK_CSS_AFFECTS_BACKGROUND, blend_mode_value_parse, NULL, - _gtk_css_array_value_new (_gtk_css_blend_mode_value_new (GTK_CSS_BLEND_MODE_NORMAL))); + _gtk_css_array_value_new (_gtk_css_blend_mode_value_new (GSK_BLEND_MODE_DEFAULT))); gtk_css_style_property_register ("border-image-source", GTK_CSS_PROPERTY_BORDER_IMAGE_SOURCE, diff --git a/gtk/gtkcsstypes.c b/gtk/gtkcsstypes.c index 9a701da480..0399e4920c 100644 --- a/gtk/gtkcsstypes.c +++ b/gtk/gtkcsstypes.c @@ -23,40 +23,40 @@ #include "gtkstylecontextprivate.h" cairo_operator_t -_gtk_css_blend_mode_get_operator (GtkCssBlendMode mode) +_gtk_css_blend_mode_get_operator (GskBlendMode mode) { switch (mode) { - case GTK_CSS_BLEND_MODE_COLOR: + case GSK_BLEND_MODE_COLOR: return CAIRO_OPERATOR_HSL_COLOR; - case GTK_CSS_BLEND_MODE_COLOR_BURN: + case GSK_BLEND_MODE_COLOR_BURN: return CAIRO_OPERATOR_COLOR_BURN; - case GTK_CSS_BLEND_MODE_COLOR_DODGE: + case GSK_BLEND_MODE_COLOR_DODGE: return CAIRO_OPERATOR_COLOR_DODGE; - case GTK_CSS_BLEND_MODE_DARKEN: + case GSK_BLEND_MODE_DARKEN: return CAIRO_OPERATOR_DARKEN; - case GTK_CSS_BLEND_MODE_DIFFERENCE: + case GSK_BLEND_MODE_DIFFERENCE: return CAIRO_OPERATOR_DIFFERENCE; - case GTK_CSS_BLEND_MODE_EXCLUSION: + case GSK_BLEND_MODE_EXCLUSION: return CAIRO_OPERATOR_EXCLUSION; - case GTK_CSS_BLEND_MODE_HARD_LIGHT: + case GSK_BLEND_MODE_HARD_LIGHT: return CAIRO_OPERATOR_HARD_LIGHT; - case GTK_CSS_BLEND_MODE_HUE: + case GSK_BLEND_MODE_HUE: return CAIRO_OPERATOR_HSL_HUE; - case GTK_CSS_BLEND_MODE_LIGHTEN: + case GSK_BLEND_MODE_LIGHTEN: return CAIRO_OPERATOR_LIGHTEN; - case GTK_CSS_BLEND_MODE_LUMINOSITY: + case GSK_BLEND_MODE_LUMINOSITY: return CAIRO_OPERATOR_HSL_LUMINOSITY; - case GTK_CSS_BLEND_MODE_MULTIPLY: + case GSK_BLEND_MODE_MULTIPLY: return CAIRO_OPERATOR_MULTIPLY; - case GTK_CSS_BLEND_MODE_OVERLAY: + case GSK_BLEND_MODE_OVERLAY: return CAIRO_OPERATOR_OVERLAY; - case GTK_CSS_BLEND_MODE_SATURATE: - return CAIRO_OPERATOR_SATURATE; - case GTK_CSS_BLEND_MODE_SCREEN: + case GSK_BLEND_MODE_SATURATION: + return CAIRO_OPERATOR_HSL_SATURATION; + case GSK_BLEND_MODE_SCREEN: return CAIRO_OPERATOR_SCREEN; - case GTK_CSS_BLEND_MODE_NORMAL: + case GSK_BLEND_MODE_DEFAULT: default: return CAIRO_OPERATOR_OVER; } diff --git a/gtk/gtkcsstypesprivate.h b/gtk/gtkcsstypesprivate.h index d6548bf197..b9a4fce534 100644 --- a/gtk/gtkcsstypesprivate.h +++ b/gtk/gtkcsstypesprivate.h @@ -19,6 +19,7 @@ #define __GTK_CSS_TYPES_PRIVATE_H__ #include <glib-object.h> +#include <gsk/gsk.h> #include <gtk/gtkstylecontext.h> G_BEGIN_DECLS @@ -232,25 +233,6 @@ enum { /*< skip >*/ }; typedef enum /*< skip >*/ { - GTK_CSS_BLEND_MODE_COLOR, - GTK_CSS_BLEND_MODE_COLOR_BURN, - GTK_CSS_BLEND_MODE_COLOR_DODGE, - GTK_CSS_BLEND_MODE_DARKEN, - GTK_CSS_BLEND_MODE_DIFFERENCE, - GTK_CSS_BLEND_MODE_EXCLUSION, - GTK_CSS_BLEND_MODE_HARD_LIGHT, - GTK_CSS_BLEND_MODE_HUE, - GTK_CSS_BLEND_MODE_LIGHTEN, - GTK_CSS_BLEND_MODE_LUMINOSITY, - GTK_CSS_BLEND_MODE_MULTIPLY, - GTK_CSS_BLEND_MODE_NORMAL, - GTK_CSS_BLEND_MODE_OVERLAY, - GTK_CSS_BLEND_MODE_SATURATE, - GTK_CSS_BLEND_MODE_SCREEN, - GTK_CSS_BLEND_MODE_SOFT_LIGHT -} GtkCssBlendMode; - -typedef enum /*< skip >*/ { GTK_CSS_IMAGE_BUILTIN_NONE, GTK_CSS_IMAGE_BUILTIN_CHECK, GTK_CSS_IMAGE_BUILTIN_CHECK_INCONSISTENT, @@ -377,7 +359,7 @@ typedef enum /*< skip >*/ { GTK_CSS_MS, } GtkCssUnit; -cairo_operator_t _gtk_css_blend_mode_get_operator (GtkCssBlendMode mode); +cairo_operator_t _gtk_css_blend_mode_get_operator (GskBlendMode mode); GtkCssChange _gtk_css_change_for_sibling (GtkCssChange match); GtkCssChange _gtk_css_change_for_child (GtkCssChange match); diff --git a/gtk/gtkrenderbackground.c b/gtk/gtkrenderbackground.c index 719761fab4..0bedcf1f61 100644 --- a/gtk/gtkrenderbackground.c +++ b/gtk/gtkrenderbackground.c @@ -123,11 +123,11 @@ _gtk_theming_background_needs_push_group (GtkCssStyle *style) */ for (i = _gtk_css_array_value_get_n_values (blend_modes); i > 0; i--) { - GtkCssBlendMode blend_mode; + GskBlendMode blend_mode; blend_mode = _gtk_css_blend_mode_value_get (_gtk_css_array_value_get_nth (blend_modes, i - 1)); - if (blend_mode != GTK_CSS_BLEND_MODE_NORMAL) + if (blend_mode != GSK_BLEND_MODE_DEFAULT) return TRUE; } @@ -142,7 +142,7 @@ gtk_theming_background_paint_layer (GtkThemingBackground *bg, GtkCssRepeatStyle hrepeat, vrepeat; const GtkCssValue *pos, *repeat; GtkCssImage *image; - GtkCssBlendMode blend_mode; + GskBlendMode blend_mode; const GskRoundedRect *origin; double image_width, image_height; double width, height; |