[gtk+] roundedbox: Remove functions that take a GtkThemingEngine



commit 04bf3d1e1fc231275d876b4f472b804f66712618
Author: Benjamin Otte <otte redhat com>
Date:   Mon Jun 16 04:28:06 2014 +0200

    roundedbox: Remove functions that take a GtkThemingEngine
    
    Instead, make the functions use a GtkStyleContext argument.

 gtk/gtkroundedbox.c        |   23 +++++++----------------
 gtk/gtkroundedboxprivate.h |   15 ++++++---------
 gtk/gtkthemingengine.c     |    4 ++--
 3 files changed, 15 insertions(+), 27 deletions(-)
---
diff --git a/gtk/gtkroundedbox.c b/gtk/gtkroundedbox.c
index 5aa53de..c3e2650 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 6bc96fa..753c5c2 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 98a297c..bdb10d2 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);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]