summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2014-06-16 04:28:06 +0200
committerBenjamin Otte <otte@redhat.com>2014-08-16 19:39:44 +0200
commit04bf3d1e1fc231275d876b4f472b804f66712618 (patch)
tree267bd677557628073c939802c0c5999e1263408c
parent5e8d3d533fc9e33d902fbef5c7e4560bb38d7dcf (diff)
downloadgtk+-04bf3d1e1fc231275d876b4f472b804f66712618.tar.gz
roundedbox: Remove functions that take a GtkThemingEngine
Instead, make the functions use a GtkStyleContext argument.
-rw-r--r--gtk/gtkroundedbox.c23
-rw-r--r--gtk/gtkroundedboxprivate.h15
-rw-r--r--gtk/gtkthemingengine.c4
3 files changed, 15 insertions, 27 deletions
diff --git a/gtk/gtkroundedbox.c b/gtk/gtkroundedbox.c
index 5aa53def2a..c3e2650e4c 100644
--- a/gtk/gtkroundedbox.c
+++ b/gtk/gtkroundedbox.c
@@ -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);
}
diff --git a/gtk/gtkroundedboxprivate.h b/gtk/gtkroundedboxprivate.h
index 6bc96faf81..753c5c237a 100644
--- a/gtk/gtkroundedboxprivate.h
+++ b/gtk/gtkroundedboxprivate.h
@@ -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,
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index 98a297c05a..bdb10d241b 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -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);
}