[gtk+] roundedbox: Take a GtkCssStyle instead of a GtkStyleContext
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] roundedbox: Take a GtkCssStyle instead of a GtkStyleContext
- Date: Tue, 20 Jan 2015 05:33:04 +0000 (UTC)
commit 8d94140da9a20499b43ddfac375b325efb9de12f
Author: Benjamin Otte <otte redhat com>
Date: Sat Jan 17 05:16:01 2015 +0100
roundedbox: Take a GtkCssStyle instead of a GtkStyleContext
This is in preparation for iusing GtkCssStyle instead of GtkStyleContext
in render functions.
gtk/gtkrender.c | 6 +++---
gtk/gtkroundedbox.c | 28 ++++++++++++++--------------
gtk/gtkroundedboxprivate.h | 10 +++++-----
gtk/gtkthemingbackground.c | 2 +-
4 files changed, 23 insertions(+), 23 deletions(-)
---
diff --git a/gtk/gtkrender.c b/gtk/gtkrender.c
index bfdad8e..f395bec 100644
--- a/gtk/gtkrender.c
+++ b/gtk/gtkrender.c
@@ -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));
_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);
}
@@ -1185,7 +1185,7 @@ gtk_do_render_focus (GtkStyleContext *context,
- 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_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);
}
@@ -2477,7 +2477,7 @@ gtk_render_content_path (GtkStyleContext *context,
g_return_if_fail (cr != NULL);
_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_css_number_value_get (_gtk_style_context_peek_property (context,
GTK_CSS_PROPERTY_BORDER_TOP_WIDTH), 100)
diff --git a/gtk/gtkroundedbox.c b/gtk/gtkroundedbox.c
index b439a8f..bbc8945 100644
--- a/gtk/gtkroundedbox.c
+++ b/gtk/gtkroundedbox.c
@@ -115,31 +115,31 @@ _gtk_rounded_box_apply_border_radius (GtkRoundedBox *box,
}
void
-_gtk_rounded_box_apply_border_radius_for_context (GtkRoundedBox *box,
- GtkStyleContext *context,
- GtkJunctionSides junction)
+_gtk_rounded_box_apply_border_radius_for_style (GtkRoundedBox *box,
+ GtkCssStyle *style,
+ GtkJunctionSides junction)
{
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_RIGHT] = _gtk_style_context_peek_property (context,
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_RIGHT] = _gtk_style_context_peek_property (context,
GTK_CSS_PROPERTY_BORDER_BOTTOM_RIGHT_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_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_TOP_RIGHT_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_css_style_get_value (style,
GTK_CSS_PROPERTY_BORDER_BOTTOM_RIGHT_RADIUS);
_gtk_rounded_box_apply_border_radius (box, corner, junction);
}
void
-_gtk_rounded_box_apply_outline_radius_for_context (GtkRoundedBox *box,
- GtkStyleContext *context,
- GtkJunctionSides junction)
+_gtk_rounded_box_apply_outline_radius_for_style (GtkRoundedBox *box,
+ GtkCssStyle *style,
+ GtkJunctionSides junction)
{
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_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);
+ corner[GTK_CSS_TOP_LEFT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_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_css_style_get_value (style, GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_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);
}
diff --git a/gtk/gtkroundedboxprivate.h b/gtk/gtkroundedboxprivate.h
index 3f98e20..cdbf1e1 100644
--- a/gtk/gtkroundedboxprivate.h
+++ b/gtk/gtkroundedboxprivate.h
@@ -47,13 +47,13 @@ void _gtk_rounded_box_init_rect (GtkRoundedBox
double width,
double height);
-void _gtk_rounded_box_apply_border_radius_for_context (GtkRoundedBox *box,
- GtkStyleContext *context,
+void _gtk_rounded_box_apply_border_radius_for_style (GtkRoundedBox *box,
+ GtkCssStyle *style,
GtkJunctionSides junction);
-void _gtk_rounded_box_apply_outline_radius_for_context (GtkRoundedBox *box,
- GtkStyleContext *context,
- GtkJunctionSides junction);
+void _gtk_rounded_box_apply_outline_radius_for_style (GtkRoundedBox *box,
+ GtkCssStyle *style,
+ GtkJunctionSides junction);
void _gtk_rounded_box_grow (GtkRoundedBox *box,
double top,
diff --git a/gtk/gtkthemingbackground.c b/gtk/gtkthemingbackground.c
index 3478f28..8cd8a4b 100644
--- a/gtk/gtkthemingbackground.c
+++ b/gtk/gtkthemingbackground.c
@@ -278,7 +278,7 @@ _gtk_theming_background_init_context (GtkThemingBackground *bg,
* 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_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];
_gtk_rounded_box_shrink (&bg->boxes[GTK_CSS_AREA_PADDING_BOX],
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]