diff options
Diffstat (limited to 'eel')
-rw-r--r-- | eel/eel-gdk-extensions.c | 13 | ||||
-rw-r--r-- | eel/eel-gdk-extensions.h | 18 |
2 files changed, 25 insertions, 6 deletions
diff --git a/eel/eel-gdk-extensions.c b/eel/eel-gdk-extensions.c index 2a5f8734..ed694277 100644 --- a/eel/eel-gdk-extensions.c +++ b/eel/eel-gdk-extensions.c @@ -477,16 +477,23 @@ eel_gdk_parse_geometry (const char *string, int *x_return, int *y_return, } void +#if GTK_CHECK_VERSION(3,0,0) +eel_cairo_draw_layout_with_drop_shadow (cairo_t *cr, +#else eel_gdk_draw_layout_with_drop_shadow (GdkDrawable *drawable, +#endif GdkColor *text_color, GdkColor *shadow_color, int x, int y, PangoLayout *layout) { +#if GTK_CHECK_VERSION(3,0,0) + cairo_save (cr); +#else cairo_t *cr; - cr = gdk_cairo_create (drawable); +#endif gdk_cairo_set_source_color (cr, shadow_color); cairo_move_to (cr, x+1, y+1); @@ -496,7 +503,11 @@ eel_gdk_draw_layout_with_drop_shadow (GdkDrawable *drawable, cairo_move_to (cr, x, y); pango_cairo_show_layout (cr, layout); +#if GTK_CHECK_VERSION(3,0,0) + cairo_restore +#else cairo_destroy (cr); +#endif } #if ! defined (EEL_OMIT_SELF_CHECK) diff --git a/eel/eel-gdk-extensions.h b/eel/eel-gdk-extensions.h index a879bdce..2036eec4 100644 --- a/eel/eel-gdk-extensions.h +++ b/eel/eel-gdk-extensions.h @@ -28,6 +28,10 @@ #include <gdk/gdk.h> +#ifndef GTK_CHECK_VERSION +#include <gtk/gtk.h> +#endif + #define EEL_RGB_COLOR_RED 0xFF0000 #define EEL_RGB_COLOR_GREEN 0x00FF00 #define EEL_RGB_COLOR_BLUE 0x0000FF @@ -118,10 +122,14 @@ EelGdkGeometryFlags eel_gdk_parse_geometry (const char int *y_return, guint *width_return, guint *height_return); +#if GTK_CHECK_VERSION(3,0,0) +void eel_cairo_draw_layout_with_drop_shadow (cairo_t *cr, +#else void eel_gdk_draw_layout_with_drop_shadow (GdkDrawable *drawable, - GdkColor *text_color, - GdkColor *shadow_color, - int x, - int y, - PangoLayout *layout); +#endif + GdkColor *text_color, + GdkColor *shadow_color, + int x, + int y, + PangoLayout *layout); #endif /* EEL_GDK_EXTENSIONS_H */ |