diff --git a/gtk/gtkcolorswatch.c b/gtk/gtkcolorswatch.c index 503d8f734b..b5329fa5ad 100644 --- a/gtk/gtkcolorswatch.c +++ b/gtk/gtkcolorswatch.c @@ -126,9 +126,9 @@ swatch_draw (GtkWidget *widget, gtk_style_context_save (context); gtk_style_context_set_state (context, state); - _gtk_theming_background_init_from_context (&background, context, - 0, 0, width, height, - GTK_JUNCTION_NONE); + _gtk_theming_background_init (&background, context, + 0, 0, width, height, + GTK_JUNCTION_NONE); if (swatch->priv->has_color) { @@ -195,10 +195,10 @@ swatch_draw (GtkWidget *widget, GIcon *gicon; gtk_style_context_add_class (context, "color-active-badge"); - _gtk_theming_background_init_from_context (&background, context, - (width - 2 * ACTIVE_BADGE_RADIUS) / 2, (height - 2 * ACTIVE_BADGE_RADIUS) / 2, - 2 * ACTIVE_BADGE_RADIUS, 2* ACTIVE_BADGE_RADIUS, - GTK_JUNCTION_NONE); + _gtk_theming_background_init (&background, context, + (width - 2 * ACTIVE_BADGE_RADIUS) / 2, (height - 2 * ACTIVE_BADGE_RADIUS) / 2, + 2 * ACTIVE_BADGE_RADIUS, 2* ACTIVE_BADGE_RADIUS, + GTK_JUNCTION_NONE); if (_gtk_theming_background_has_background_image (&background)) { diff --git a/gtk/gtkthemingbackground.c b/gtk/gtkthemingbackground.c index 380eb5ad1e..413a928c8d 100644 --- a/gtk/gtkthemingbackground.c +++ b/gtk/gtkthemingbackground.c @@ -31,7 +31,7 @@ #include "gtkcsspositionvalueprivate.h" #include "gtkcssrepeatvalueprivate.h" #include "gtkcsstypesprivate.h" -#include "gtkthemingengineprivate.h" +#include "gtkstylecontextprivate.h" #include @@ -308,31 +308,12 @@ _gtk_theming_background_init_context (GtkThemingBackground *bg) void _gtk_theming_background_init (GtkThemingBackground *bg, - GtkThemingEngine *engine, + GtkStyleContext *context, gdouble x, gdouble y, gdouble width, gdouble height, GtkJunctionSides junction) -{ - GtkStyleContext *context; - - g_assert (bg != NULL); - - context = _gtk_theming_engine_get_context (engine); - _gtk_theming_background_init_from_context (bg, context, - x, y, width, height, - junction); -} - -void -_gtk_theming_background_init_from_context (GtkThemingBackground *bg, - GtkStyleContext *context, - gdouble x, - gdouble y, - gdouble width, - gdouble height, - GtkJunctionSides junction) { g_assert (bg != NULL); diff --git a/gtk/gtkthemingbackgroundprivate.h b/gtk/gtkthemingbackgroundprivate.h index 23fe092157..cb1f600093 100644 --- a/gtk/gtkthemingbackgroundprivate.h +++ b/gtk/gtkthemingbackgroundprivate.h @@ -24,8 +24,8 @@ #include #include "gtkcssimageprivate.h" -#include "gtkstylecontextprivate.h" #include "gtkroundedboxprivate.h" +#include "gtktypes.h" G_BEGIN_DECLS @@ -44,21 +44,13 @@ struct _GtkThemingBackground { }; void _gtk_theming_background_init (GtkThemingBackground *bg, - GtkThemingEngine *engine, + GtkStyleContext *context, gdouble x, gdouble y, gdouble width, gdouble height, GtkJunctionSides junction); -void _gtk_theming_background_init_from_context (GtkThemingBackground *bg, - GtkStyleContext *context, - gdouble x, - gdouble y, - gdouble width, - gdouble height, - GtkJunctionSides junction); - void _gtk_theming_background_render (GtkThemingBackground *bg, cairo_t *cr); diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c index 1e5278499a..98a297c05a 100644 --- a/gtk/gtkthemingengine.c +++ b/gtk/gtkthemingengine.c @@ -20,7 +20,8 @@ #include #include -#include +#include "gtkthemingengineprivate.h" + #include #include @@ -38,8 +39,8 @@ #include "gtkcsstransformvalueprivate.h" #include "gtkcsstypesprivate.h" #include "gtkhslaprivate.h" -#include "gtkthemingengineprivate.h" #include "gtkroundedboxprivate.h" +#include "gtkstylecontextprivate.h" #include "gtkthemingbackgroundprivate.h" #include "fallback-c89.c" @@ -1385,7 +1386,7 @@ gtk_theming_engine_render_background (GtkThemingEngine *engine, { GtkThemingBackground bg; - _gtk_theming_background_init (&bg, engine, + _gtk_theming_background_init (&bg, engine->priv->context, x, y, width, height, gtk_theming_engine_get_junction_sides (engine)); @@ -2171,7 +2172,7 @@ gtk_theming_engine_render_extension (GtkThemingEngine *engine, break; } - _gtk_theming_background_init (&bg, engine, + _gtk_theming_background_init (&bg, engine->priv->context, x, y, width, height, junction); @@ -2241,7 +2242,7 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine, color_shade (&bg_color, 0.7, &darker); color_shade (&bg_color, 1.3, &lighter); - _gtk_theming_background_init (&bg, engine, x, y, width, height, sides); + _gtk_theming_background_init (&bg, engine->priv->context, x, y, width, height, sides); has_image = _gtk_theming_background_has_background_image (&bg); _gtk_theming_background_render (&bg, cr);