Trim trailing white spaces.
[geeqie.git] / src / compat.c
1 /*
2  * Geeqie
3  * Copyright (C) 2008 - 2012 The Geeqie Team
4  *
5  * Authors: Vladimir Nadvornik / Laurent Monin
6  *
7  * This software is released under the GNU General Public License (GNU GPL).
8  * Please read the included file COPYING for more information.
9  * This software comes with no warranty of any kind, use at your own risk!
10  */
11
12 #include "main.h"
13 #include "compat.h"
14
15 #if !GTK_CHECK_VERSION(2,24,0)
16 gint compat_gdk_window_get_width(GdkWindow *window)
17 {
18         gint w, h;
19         gdk_drawable_get_size(window, &w, &h);
20         return w;
21 }
22
23 gint compat_gdk_window_get_height(GdkWindow *window)
24 {
25         gint w, h;
26         gdk_drawable_get_size(window, &w, &h);
27         return h;
28 }
29 #endif
30
31 #if !GTK_CHECK_VERSION(2,22,0)
32 cairo_surface_t *compat_gdk_window_create_similar_surface (GdkWindow *window, cairo_content_t content, gint width, gint height)
33 {
34         cairo_t *cr = gdk_cairo_create(window);
35         cairo_surface_t *ws = cairo_get_target(cr);
36         cairo_surface_t *ret = cairo_surface_create_similar(ws, content, width, height);
37         cairo_destroy(cr);
38         return ret;
39 }
40 #endif
41 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */