Commit 5e8d3d53 authored by Benjamin Otte's avatar Benjamin Otte

themingbackground: Remove initializer that takes a GtkThemingEngine

With the unification to use style contexts everywhere, make that
initializer the only one to use.

Also rename it appropriately.
parent 7e5b58c7
......@@ -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))
{
......
......@@ -31,7 +31,7 @@
#include "gtkcsspositionvalueprivate.h"
#include "gtkcssrepeatvalueprivate.h"
#include "gtkcsstypesprivate.h"
#include "gtkthemingengineprivate.h"
#include "gtkstylecontextprivate.h"
#include <math.h>
......@@ -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);
......
......@@ -24,8 +24,8 @@
#include <cairo.h>
#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);
......
......@@ -20,7 +20,8 @@
#include <math.h>
#include <gtk/gtk.h>
#include <gtk/gtkthemingengine.h>
#include "gtkthemingengineprivate.h"
#include <gtk/gtkstylecontext.h>
#include <gtk/gtkintl.h>
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment