roundedbox: Take a GtkCssStyle instead of a GtkStyleContext

This is in preparation for iusing GtkCssStyle instead of GtkStyleContext
in render functions.
This commit is contained in:
Benjamin Otte 2015-01-17 05:16:01 +01:00
parent 73b3b9ee94
commit 8d94140da9
4 changed files with 23 additions and 23 deletions

View File

@ -939,7 +939,7 @@ render_frame_internal (GtkStyleContext *context,
colors[3] = *_gtk_css_rgba_value_get_rgba (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_LEFT_COLOR)); colors[3] = *_gtk_css_rgba_value_get_rgba (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_LEFT_COLOR));
_gtk_rounded_box_init_rect (&border_box, x, y, width, height); _gtk_rounded_box_init_rect (&border_box, x, y, width, height);
_gtk_rounded_box_apply_border_radius_for_context (&border_box, context, junction); _gtk_rounded_box_apply_border_radius_for_style (&border_box, gtk_style_context_lookup_style (context), junction);
render_border (cr, &border_box, border_width, hidden_side, colors, border_style); render_border (cr, &border_box, border_width, hidden_side, colors, border_style);
} }
@ -1185,7 +1185,7 @@ gtk_do_render_focus (GtkStyleContext *context,
- border_width[GTK_CSS_RIGHT] - offset, - border_width[GTK_CSS_RIGHT] - offset,
- border_width[GTK_CSS_LEFT] - offset, - border_width[GTK_CSS_LEFT] - offset,
- border_width[GTK_CSS_BOTTOM] - offset); - border_width[GTK_CSS_BOTTOM] - offset);
_gtk_rounded_box_apply_outline_radius_for_context (&border_box, context, GTK_JUNCTION_NONE); _gtk_rounded_box_apply_outline_radius_for_style (&border_box, gtk_style_context_lookup_style (context), GTK_JUNCTION_NONE);
render_border (cr, &border_box, border_width, 0, colors, border_style); render_border (cr, &border_box, border_width, 0, colors, border_style);
} }
@ -2477,7 +2477,7 @@ gtk_render_content_path (GtkStyleContext *context,
g_return_if_fail (cr != NULL); g_return_if_fail (cr != NULL);
_gtk_rounded_box_init_rect (&box, x, y, width, height); _gtk_rounded_box_init_rect (&box, x, y, width, height);
_gtk_rounded_box_apply_border_radius_for_context (&box, context, 0); _gtk_rounded_box_apply_border_radius_for_style (&box, gtk_style_context_lookup_style (context), 0);
_gtk_rounded_box_shrink (&box, _gtk_rounded_box_shrink (&box,
_gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_WIDTH), 100) _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_WIDTH), 100)

View File

@ -115,31 +115,31 @@ _gtk_rounded_box_apply_border_radius (GtkRoundedBox *box,
} }
void void
_gtk_rounded_box_apply_border_radius_for_context (GtkRoundedBox *box, _gtk_rounded_box_apply_border_radius_for_style (GtkRoundedBox *box,
GtkStyleContext *context, GtkCssStyle *style,
GtkJunctionSides junction) GtkJunctionSides junction)
{ {
GtkCssValue *corner[4]; GtkCssValue *corner[4];
corner[GTK_CSS_TOP_LEFT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_LEFT_RADIUS); corner[GTK_CSS_TOP_LEFT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_TOP_LEFT_RADIUS);
corner[GTK_CSS_TOP_RIGHT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_RIGHT_RADIUS); corner[GTK_CSS_TOP_RIGHT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_TOP_RIGHT_RADIUS);
corner[GTK_CSS_BOTTOM_LEFT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_BOTTOM_LEFT_RADIUS); corner[GTK_CSS_BOTTOM_LEFT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_BOTTOM_LEFT_RADIUS);
corner[GTK_CSS_BOTTOM_RIGHT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_BOTTOM_RIGHT_RADIUS); corner[GTK_CSS_BOTTOM_RIGHT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_BOTTOM_RIGHT_RADIUS);
_gtk_rounded_box_apply_border_radius (box, corner, junction); _gtk_rounded_box_apply_border_radius (box, corner, junction);
} }
void void
_gtk_rounded_box_apply_outline_radius_for_context (GtkRoundedBox *box, _gtk_rounded_box_apply_outline_radius_for_style (GtkRoundedBox *box,
GtkStyleContext *context, GtkCssStyle *style,
GtkJunctionSides junction) GtkJunctionSides junction)
{ {
GtkCssValue *corner[4]; GtkCssValue *corner[4];
corner[GTK_CSS_TOP_LEFT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS); corner[GTK_CSS_TOP_LEFT] = gtk_css_style_get_value (style, 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_TOP_RIGHT] = gtk_css_style_get_value (style, 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_LEFT] = gtk_css_style_get_value (style, 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); corner[GTK_CSS_BOTTOM_RIGHT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS);
_gtk_rounded_box_apply_border_radius (box, corner, junction); _gtk_rounded_box_apply_border_radius (box, corner, junction);
} }

View File

@ -47,12 +47,12 @@ void _gtk_rounded_box_init_rect (GtkRoundedBox
double width, double width,
double height); double height);
void _gtk_rounded_box_apply_border_radius_for_context (GtkRoundedBox *box, void _gtk_rounded_box_apply_border_radius_for_style (GtkRoundedBox *box,
GtkStyleContext *context, GtkCssStyle *style,
GtkJunctionSides junction); GtkJunctionSides junction);
void _gtk_rounded_box_apply_outline_radius_for_context (GtkRoundedBox *box, void _gtk_rounded_box_apply_outline_radius_for_style (GtkRoundedBox *box,
GtkStyleContext *context, GtkCssStyle *style,
GtkJunctionSides junction); GtkJunctionSides junction);
void _gtk_rounded_box_grow (GtkRoundedBox *box, void _gtk_rounded_box_grow (GtkRoundedBox *box,

View File

@ -278,7 +278,7 @@ _gtk_theming_background_init_context (GtkThemingBackground *bg,
* right now we just shrink to the default. * right now we just shrink to the default.
*/ */
_gtk_rounded_box_init_rect (&bg->boxes[GTK_CSS_AREA_BORDER_BOX], 0, 0, width, height); _gtk_rounded_box_init_rect (&bg->boxes[GTK_CSS_AREA_BORDER_BOX], 0, 0, width, height);
_gtk_rounded_box_apply_border_radius_for_context (&bg->boxes[GTK_CSS_AREA_BORDER_BOX], bg->context, junction); _gtk_rounded_box_apply_border_radius_for_style (&bg->boxes[GTK_CSS_AREA_BORDER_BOX], gtk_style_context_lookup_style (bg->context), junction);
bg->boxes[GTK_CSS_AREA_PADDING_BOX] = bg->boxes[GTK_CSS_AREA_BORDER_BOX]; bg->boxes[GTK_CSS_AREA_PADDING_BOX] = bg->boxes[GTK_CSS_AREA_BORDER_BOX];
_gtk_rounded_box_shrink (&bg->boxes[GTK_CSS_AREA_PADDING_BOX], _gtk_rounded_box_shrink (&bg->boxes[GTK_CSS_AREA_PADDING_BOX],