Commit 04bf3d1e authored by Benjamin Otte's avatar Benjamin Otte

roundedbox: Remove functions that take a GtkThemingEngine

Instead, make the functions use a GtkStyleContext argument.
parent 5e8d3d53
......@@ -22,7 +22,6 @@
#include "gtkcsscornervalueprivate.h"
#include "gtkcsstypesprivate.h"
#include "gtkstylecontextprivate.h"
#include "gtkthemingengineprivate.h"
#include <string.h>
......@@ -131,24 +130,16 @@ _gtk_rounded_box_apply_border_radius_for_context (GtkRoundedBox *box,
}
void
_gtk_rounded_box_apply_border_radius_for_engine (GtkRoundedBox *box,
GtkThemingEngine *engine,
GtkJunctionSides junction)
{
_gtk_rounded_box_apply_border_radius_for_context (box, _gtk_theming_engine_get_context (engine), junction);
}
void
_gtk_rounded_box_apply_outline_radius_for_engine (GtkRoundedBox *box,
GtkThemingEngine *engine,
GtkJunctionSides junction)
_gtk_rounded_box_apply_outline_radius_for_context (GtkRoundedBox *box,
GtkStyleContext *context,
GtkJunctionSides junction)
{
GtkCssValue *corner[4];
corner[GTK_CSS_TOP_LEFT] = _gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS);
corner[GTK_CSS_TOP_RIGHT] = _gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_OUTLINE_TOP_RIGHT_RADIUS);
corner[GTK_CSS_BOTTOM_LEFT] = _gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS);
corner[GTK_CSS_BOTTOM_RIGHT] = _gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS);
corner[GTK_CSS_TOP_LEFT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS);
corner[GTK_CSS_TOP_RIGHT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_OUTLINE_TOP_RIGHT_RADIUS);
corner[GTK_CSS_BOTTOM_LEFT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS);
corner[GTK_CSS_BOTTOM_RIGHT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS);
_gtk_rounded_box_apply_border_radius (box, corner, junction);
}
......
......@@ -21,7 +21,7 @@
#include <glib-object.h>
#include <cairo.h>
#include <gtk/gtkenums.h>
#include <gtk/gtkthemingengine.h>
#include <gtk/gtktypes.h>
#include "gtkcsstypesprivate.h"
......@@ -47,16 +47,13 @@ void _gtk_rounded_box_init_rect (GtkRoundedBox
double width,
double height);
void _gtk_rounded_box_apply_border_radius_for_engine (GtkRoundedBox *box,
GtkThemingEngine *engine,
void _gtk_rounded_box_apply_border_radius_for_context (GtkRoundedBox *box,
GtkStyleContext *context,
GtkJunctionSides junction);
void _gtk_rounded_box_apply_border_radius_for_context (GtkRoundedBox *box,
GtkStyleContext *context,
GtkJunctionSides junction);
void _gtk_rounded_box_apply_outline_radius_for_engine (GtkRoundedBox *box,
GtkThemingEngine *engine,
GtkJunctionSides junction);
void _gtk_rounded_box_apply_outline_radius_for_context (GtkRoundedBox *box,
GtkStyleContext *context,
GtkJunctionSides junction);
void _gtk_rounded_box_grow (GtkRoundedBox *box,
double top,
......
......@@ -1776,7 +1776,7 @@ render_frame_internal (GtkThemingEngine *engine,
colors[3] = *_gtk_css_rgba_value_get_rgba (_gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_BORDER_LEFT_COLOR));
_gtk_rounded_box_init_rect (&border_box, x, y, width, height);
_gtk_rounded_box_apply_border_radius_for_engine (&border_box, engine, junction);
_gtk_rounded_box_apply_border_radius_for_context (&border_box, engine->priv->context, junction);
render_border (cr, &border_box, border_width, hidden_side, colors, border_style);
}
......@@ -1941,7 +1941,7 @@ gtk_theming_engine_render_focus (GtkThemingEngine *engine,
- border_width[GTK_CSS_RIGHT] - offset,
- border_width[GTK_CSS_LEFT] - offset,
- border_width[GTK_CSS_BOTTOM] - offset);
_gtk_rounded_box_apply_outline_radius_for_engine (&border_box, engine, GTK_JUNCTION_NONE);
_gtk_rounded_box_apply_outline_radius_for_context (&border_box, engine->priv->context, GTK_JUNCTION_NONE);
render_border (cr, &border_box, border_width, 0, colors, border_style);
}
......
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