[nautilus] [eel] Add eel_cairo_draw_layout_with_drop_shadow



commit d2f141f4a5435b10b43abea0822e3d0569b67886
Author: Christian Persch <chpe gnome org>
Date:   Thu Sep 16 16:49:55 2010 +0200

    [eel] Add eel_cairo_draw_layout_with_drop_shadow
    
    Renamed from eel_gdk_draw_layout_with_drop_shadow.

 eel/eel-gdk-extensions.c |    8 +++-----
 eel/eel-gdk-extensions.h |    4 ++--
 2 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/eel/eel-gdk-extensions.c b/eel/eel-gdk-extensions.c
index 04173aa..31ff008 100644
--- a/eel/eel-gdk-extensions.c
+++ b/eel/eel-gdk-extensions.c
@@ -454,16 +454,14 @@ eel_gdk_parse_geometry (const char *string, int *x_return, int *y_return,
 }
 
 void
-eel_gdk_draw_layout_with_drop_shadow (GdkDrawable         *drawable,
+eel_cairo_draw_layout_with_drop_shadow (cairo_t             *cr,
 				      GdkColor            *text_color,
 				      GdkColor            *shadow_color,
 				      int                  x,
 				      int                  y,
 				      PangoLayout         *layout)
 {
-	cairo_t *cr;
-
-	cr = gdk_cairo_create (drawable);
+        cairo_save (cr);
 
 	gdk_cairo_set_source_color (cr, shadow_color);
 	cairo_move_to (cr, x+1, y+1);
@@ -473,7 +471,7 @@ eel_gdk_draw_layout_with_drop_shadow (GdkDrawable         *drawable,
 	cairo_move_to (cr, x, y);
 	pango_cairo_show_layout (cr, layout);
 	
-	cairo_destroy (cr);
+	cairo_restore (cr);
 }
 
 #if ! defined (EEL_OMIT_SELF_CHECK)
diff --git a/eel/eel-gdk-extensions.h b/eel/eel-gdk-extensions.h
index 3d1e3f2..b3778c6 100644
--- a/eel/eel-gdk-extensions.h
+++ b/eel/eel-gdk-extensions.h
@@ -1,4 +1,4 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+// /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 
 /* eel-gdk-extensions.h: Graphics routines to augment what's in gdk.
 
@@ -117,7 +117,7 @@ EelGdkGeometryFlags eel_gdk_parse_geometry                 (const char
 							    int                 *y_return,
 							    guint               *width_return,
 							    guint               *height_return);
-void                eel_gdk_draw_layout_with_drop_shadow   (GdkDrawable         *drawable,
+void                eel_cairo_draw_layout_with_drop_shadow (cairo_t             *cr,
 							    GdkColor            *text_color,
 							    GdkColor            *shadow_color,
 							    int                  x,



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