[glide] Add glide_cairo_set_fd_color to cairo-util



commit 26585db5be23d244319761c6441fc14e1c63c96f
Author: Robert Carr <racarr Valentine localdomain>
Date:   Thu May 6 03:13:41 2010 -0400

    Add glide_cairo_set_fd_color to cairo-util

 libglide/glide-cairo-util.c |   14 ++++++++++++++
 libglide/glide-cairo-util.h |    3 +++
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/libglide/glide-cairo-util.c b/libglide/glide-cairo-util.c
index ee445bd..8e365f6 100644
--- a/libglide/glide-cairo-util.c
+++ b/libglide/glide-cairo-util.c
@@ -24,3 +24,17 @@ glide_cairo_set_clutter_color (cairo_t *cr, ClutterColor *c)
 {
   cairo_set_source_rgba (cr, c->red/255.0, c->green/255.0, c->blue/255.0, c->alpha/255.0);
 }
+
+void
+glide_cairo_set_fg_color (cairo_t *cr, 
+			  GtkWidget *widget,
+			  GtkStateType state)
+{
+  GdkColor c;
+  GtkStyle *style = gtk_widget_get_style (widget);
+  
+  c = style->fg[state];
+  gdk_cairo_set_source_color (cr, &c);
+  
+}
+			  
diff --git a/libglide/glide-cairo-util.h b/libglide/glide-cairo-util.h
index 8e40e9a..b8ef320 100644
--- a/libglide/glide-cairo-util.h
+++ b/libglide/glide-cairo-util.h
@@ -21,8 +21,11 @@
 #define __GLIDE_CAIRO_UTIL_H__
 
 #include <cairo.h>
+#include <gtk/gtk.h>
 #include <clutter/clutter.h>
 
 void glide_cairo_set_clutter_color (cairo_t *cr, ClutterColor *c);
 
+void glide_cairo_set_fg_color (cairo_t *cr, GtkWidget *widget, GtkStateType state);
+
 #endif



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