summaryrefslogtreecommitdiff
path: root/eel/eel-gdk-pixbuf-extensions.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2013-07-24 18:07:09 +0200
committerStefano Karapetsas <[email protected]>2013-07-24 18:07:09 +0200
commitd89968247ad185d4c9e37ab9930cb64dcda058dd (patch)
treef63c7a4b9cf0dc3e14610c1ddfbaa6ff20f0ad71 /eel/eel-gdk-pixbuf-extensions.c
parent3d3cfc6566a29aea5da9f3223f3d4a0e28e3fa60 (diff)
downloadcaja-d89968247ad185d4c9e37ab9930cb64dcda058dd.tar.bz2
caja-d89968247ad185d4c9e37ab9930cb64dcda058dd.tar.xz
eel: Add GTK3 support
Diffstat (limited to 'eel/eel-gdk-pixbuf-extensions.c')
-rw-r--r--eel/eel-gdk-pixbuf-extensions.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/eel/eel-gdk-pixbuf-extensions.c b/eel/eel-gdk-pixbuf-extensions.c
index c913cb10..6870e932 100644
--- a/eel/eel-gdk-pixbuf-extensions.c
+++ b/eel/eel-gdk-pixbuf-extensions.c
@@ -622,10 +622,14 @@ eel_gdk_pixbuf_unref_if_not_null (GdkPixbuf *pixbuf_or_null)
void
eel_gdk_pixbuf_draw_to_drawable (const GdkPixbuf *pixbuf,
+#if GTK_CHECK_VERSION (3, 0, 0)
+ cairo_t *cr,
+#else
GdkDrawable *drawable,
+#endif
int source_x,
int source_y,
- EelIRect destination_area)
+ EelIRect destination_area)
{
EelDimensions dimensions;
EelIRect target;
@@ -634,10 +638,16 @@ eel_gdk_pixbuf_draw_to_drawable (const GdkPixbuf *pixbuf,
int target_height;
int source_width;
int source_height;
- cairo_t *cr;
+#if !GTK_CHECK_VERSION (3, 0, 0)
+ cairo_t *cr;
+#endif
g_return_if_fail (eel_gdk_pixbuf_is_valid (pixbuf));
+#if GTK_CHECK_VERSION (3, 0, 0)
+ g_return_if_fail (cr != NULL);
+#else
g_return_if_fail (drawable != NULL);
+#endif
g_return_if_fail (!eel_irect_is_empty (&destination_area));
dimensions = eel_gdk_pixbuf_get_dimensions (pixbuf);
@@ -673,7 +683,9 @@ eel_gdk_pixbuf_draw_to_drawable (const GdkPixbuf *pixbuf,
target.x1 = target.x0 + MIN (target_width, source_width);
target.y1 = target.y0 + MIN (target_height, source_height);
+#if !GTK_CHECK_VERSION (3, 0, 0)
cr = gdk_cairo_create (drawable);
+#endif
gdk_cairo_set_source_pixbuf (cr, (GdkPixbuf *) pixbuf,
source.x0 - target.x0, source.y0 - target.y0);
cairo_rectangle (cr, target.x0, target.y0,