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.
This commit is contained in:
@ -126,7 +126,7 @@ swatch_draw (GtkWidget *widget,
|
|||||||
gtk_style_context_save (context);
|
gtk_style_context_save (context);
|
||||||
gtk_style_context_set_state (context, state);
|
gtk_style_context_set_state (context, state);
|
||||||
|
|
||||||
_gtk_theming_background_init_from_context (&background, context,
|
_gtk_theming_background_init (&background, context,
|
||||||
0, 0, width, height,
|
0, 0, width, height,
|
||||||
GTK_JUNCTION_NONE);
|
GTK_JUNCTION_NONE);
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ swatch_draw (GtkWidget *widget,
|
|||||||
GIcon *gicon;
|
GIcon *gicon;
|
||||||
|
|
||||||
gtk_style_context_add_class (context, "color-active-badge");
|
gtk_style_context_add_class (context, "color-active-badge");
|
||||||
_gtk_theming_background_init_from_context (&background, context,
|
_gtk_theming_background_init (&background, context,
|
||||||
(width - 2 * ACTIVE_BADGE_RADIUS) / 2, (height - 2 * ACTIVE_BADGE_RADIUS) / 2,
|
(width - 2 * ACTIVE_BADGE_RADIUS) / 2, (height - 2 * ACTIVE_BADGE_RADIUS) / 2,
|
||||||
2 * ACTIVE_BADGE_RADIUS, 2* ACTIVE_BADGE_RADIUS,
|
2 * ACTIVE_BADGE_RADIUS, 2* ACTIVE_BADGE_RADIUS,
|
||||||
GTK_JUNCTION_NONE);
|
GTK_JUNCTION_NONE);
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
#include "gtkcsspositionvalueprivate.h"
|
#include "gtkcsspositionvalueprivate.h"
|
||||||
#include "gtkcssrepeatvalueprivate.h"
|
#include "gtkcssrepeatvalueprivate.h"
|
||||||
#include "gtkcsstypesprivate.h"
|
#include "gtkcsstypesprivate.h"
|
||||||
#include "gtkthemingengineprivate.h"
|
#include "gtkstylecontextprivate.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
@ -308,25 +308,6 @@ _gtk_theming_background_init_context (GtkThemingBackground *bg)
|
|||||||
|
|
||||||
void
|
void
|
||||||
_gtk_theming_background_init (GtkThemingBackground *bg,
|
_gtk_theming_background_init (GtkThemingBackground *bg,
|
||||||
GtkThemingEngine *engine,
|
|
||||||
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,
|
GtkStyleContext *context,
|
||||||
gdouble x,
|
gdouble x,
|
||||||
gdouble y,
|
gdouble y,
|
||||||
|
|||||||
@ -24,8 +24,8 @@
|
|||||||
#include <cairo.h>
|
#include <cairo.h>
|
||||||
|
|
||||||
#include "gtkcssimageprivate.h"
|
#include "gtkcssimageprivate.h"
|
||||||
#include "gtkstylecontextprivate.h"
|
|
||||||
#include "gtkroundedboxprivate.h"
|
#include "gtkroundedboxprivate.h"
|
||||||
|
#include "gtktypes.h"
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
@ -44,14 +44,6 @@ struct _GtkThemingBackground {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void _gtk_theming_background_init (GtkThemingBackground *bg,
|
void _gtk_theming_background_init (GtkThemingBackground *bg,
|
||||||
GtkThemingEngine *engine,
|
|
||||||
gdouble x,
|
|
||||||
gdouble y,
|
|
||||||
gdouble width,
|
|
||||||
gdouble height,
|
|
||||||
GtkJunctionSides junction);
|
|
||||||
|
|
||||||
void _gtk_theming_background_init_from_context (GtkThemingBackground *bg,
|
|
||||||
GtkStyleContext *context,
|
GtkStyleContext *context,
|
||||||
gdouble x,
|
gdouble x,
|
||||||
gdouble y,
|
gdouble y,
|
||||||
|
|||||||
@ -20,7 +20,8 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
#include <gtk/gtkthemingengine.h>
|
#include "gtkthemingengineprivate.h"
|
||||||
|
|
||||||
#include <gtk/gtkstylecontext.h>
|
#include <gtk/gtkstylecontext.h>
|
||||||
#include <gtk/gtkintl.h>
|
#include <gtk/gtkintl.h>
|
||||||
|
|
||||||
@ -38,8 +39,8 @@
|
|||||||
#include "gtkcsstransformvalueprivate.h"
|
#include "gtkcsstransformvalueprivate.h"
|
||||||
#include "gtkcsstypesprivate.h"
|
#include "gtkcsstypesprivate.h"
|
||||||
#include "gtkhslaprivate.h"
|
#include "gtkhslaprivate.h"
|
||||||
#include "gtkthemingengineprivate.h"
|
|
||||||
#include "gtkroundedboxprivate.h"
|
#include "gtkroundedboxprivate.h"
|
||||||
|
#include "gtkstylecontextprivate.h"
|
||||||
#include "gtkthemingbackgroundprivate.h"
|
#include "gtkthemingbackgroundprivate.h"
|
||||||
|
|
||||||
#include "fallback-c89.c"
|
#include "fallback-c89.c"
|
||||||
@ -1385,7 +1386,7 @@ gtk_theming_engine_render_background (GtkThemingEngine *engine,
|
|||||||
{
|
{
|
||||||
GtkThemingBackground bg;
|
GtkThemingBackground bg;
|
||||||
|
|
||||||
_gtk_theming_background_init (&bg, engine,
|
_gtk_theming_background_init (&bg, engine->priv->context,
|
||||||
x, y,
|
x, y,
|
||||||
width, height,
|
width, height,
|
||||||
gtk_theming_engine_get_junction_sides (engine));
|
gtk_theming_engine_get_junction_sides (engine));
|
||||||
@ -2171,7 +2172,7 @@ gtk_theming_engine_render_extension (GtkThemingEngine *engine,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
_gtk_theming_background_init (&bg, engine,
|
_gtk_theming_background_init (&bg, engine->priv->context,
|
||||||
x, y,
|
x, y,
|
||||||
width, height,
|
width, height,
|
||||||
junction);
|
junction);
|
||||||
@ -2241,7 +2242,7 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
|
|||||||
color_shade (&bg_color, 0.7, &darker);
|
color_shade (&bg_color, 0.7, &darker);
|
||||||
color_shade (&bg_color, 1.3, &lighter);
|
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);
|
has_image = _gtk_theming_background_has_background_image (&bg);
|
||||||
_gtk_theming_background_render (&bg, cr);
|
_gtk_theming_background_render (&bg, cr);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user