[gtk+/icon-shadow: 4/11] stylecontext: add gtk_render_icon()



commit a1c95ac8e87e4c0a802ed8f81ca2ab46719520da
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue May 24 20:59:50 2011 -0400

    stylecontext: add gtk_render_icon()

 gtk/gtkstylecontext.c |   33 +++++++++++++++++++++++++++++++++
 gtk/gtkstylecontext.h |    8 ++++++++
 2 files changed, 41 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index b93dc36..287ba1a 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -4403,3 +4403,36 @@ gtk_render_icon_pixbuf (GtkStyleContext     *context,
   _gtk_theming_engine_set_context (priv->theming_engine, context);
   return engine_class->render_icon_pixbuf (priv->theming_engine, source, size);
 }
+
+void
+gtk_render_icon (GtkStyleContext *context,
+                 cairo_t         *cr,
+                 gdouble          x,
+                 gdouble          y,
+                 gdouble          width,
+                 gdouble          height,
+                 cairo_surface_t *surface,
+                 gboolean         symbolic)
+{
+  GtkStyleContextPrivate *priv;
+  GtkThemingEngineClass *engine_class;
+
+  g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
+  g_return_if_fail (cr != NULL);
+
+  if (width <= 0 || height <= 0)
+    return;
+
+  priv = context->priv;
+  engine_class = GTK_THEMING_ENGINE_GET_CLASS (priv->theming_engine);
+
+  cairo_save (cr);
+
+  store_animation_region (context, x, y, width, height);
+
+  _gtk_theming_engine_set_context (priv->theming_engine, context);
+  engine_class->render_icon (priv->theming_engine, cr,
+                             x, y, width, height, surface, symbolic);
+
+  cairo_restore (cr);  
+}
diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h
index e687ff1..ccd45bd 100644
--- a/gtk/gtkstylecontext.h
+++ b/gtk/gtkstylecontext.h
@@ -745,6 +745,14 @@ void        gtk_render_activity    (GtkStyleContext     *context,
 GdkPixbuf * gtk_render_icon_pixbuf (GtkStyleContext     *context,
                                     const GtkIconSource *source,
                                     GtkIconSize          size);
+void        gtk_render_icon        (GtkStyleContext     *context,
+                                    cairo_t             *cr,
+                                    gdouble              x,
+                                    gdouble              y,
+                                    gdouble              width,
+                                    gdouble              height,
+                                    cairo_surface_t     *surface,
+                                    gboolean             symbolic);
 
 G_END_DECLS
 



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