From d15854911034f7cce3c949aee2ec39f512890ae3 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Sun, 11 Nov 2012 06:44:47 +0200 Subject: [mate-bg] Proper update for GTK3 changes, simplify GTK2 compatability Reverts: bc53751054ab "some ugly gtk3 porting", then: 1. use upstream commit below as a reference (GTK3) 2. simplify our GTK_VERSION_CHECK's, hopefully to make the code more readable, and the GTK2 backwards-compatibility snippets easier to cleanup later. -- Includes a renaming of all "pixmap" names in APIs to "surface": http://git.gnome.org/browse/gnome-desktop/commit/?id=28f2b06f50e3f1adf19389c2c3a1f63872539fa9 https://bugzilla.gnome.org/show_bug.cgi?id=630724 Remove unnecessary, deprecated, GDK_DRAWABLE cast: http://git.gnome.org/browse/gnome-desktop/commit/?id=260f6d2431088c5cd0ad1eb8d57f0ec994240f08 --- libmate-desktop/libmateui/mate-bg.h | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) (limited to 'libmate-desktop/libmateui/mate-bg.h') diff --git a/libmate-desktop/libmateui/mate-bg.h b/libmate-desktop/libmateui/mate-bg.h index 45b3615..61e2a01 100644 --- a/libmate-desktop/libmateui/mate-bg.h +++ b/libmate-desktop/libmateui/mate-bg.h @@ -96,10 +96,14 @@ void mate_bg_draw (MateBG *bg, gboolean is_root); #if GTK_CHECK_VERSION(3, 0, 0) - cairo_surface_t* mate_bg_create_pixmap(MateBG* bg, GdkWindow* window, int width, int height, gboolean root); +cairo_surface_t *mate_bg_create_surface (MateBG *bg, #else - GdkPixmap* mate_bg_create_pixmap(MateBG* bg, GdkWindow* window, int width, int height, gboolean root); +GdkPixmap *mate_bg_create_pixmap (MateBG *bg, #endif + GdkWindow *window, + int width, + int height, + gboolean root); gboolean mate_bg_get_image_size (MateBG *bg, MateDesktopThumbnailFactory *factory, @@ -124,20 +128,25 @@ GdkPixbuf * mate_bg_create_frame_thumbnail (MateBG *bg, int dest_height, int frame_num); -/* Set a pixmap as root - not a MateBG method. At some point +/* Set a surface as root - not a MateBG method. At some point * if we decide to stabilize the API then we may want to make - * these object methods, drop mate_bg_create_pixmap, etc. + * these object methods, drop mate_bg_create_surface, etc. */ - #if GTK_CHECK_VERSION(3, 0, 0) - void mate_bg_set_pixmap_as_root(GdkScreen* screen, cairo_surface_t* pixmap); - MateBGCrossfade* mate_bg_set_pixmap_as_root_with_crossfade(GdkScreen* screen, cairo_surface_t* pixmap); - cairo_surface_t* mate_bg_get_pixmap_from_root(GdkScreen* screen); -#else - void mate_bg_set_pixmap_as_root(GdkScreen* screen, GdkPixmap* pixmap); - MateBGCrossfade* mate_bg_set_pixmap_as_root_with_crossfade(GdkScreen* screen, GdkPixmap* pixmap); - GdkPixmap* mate_bg_get_pixmap_from_root(GdkScreen* screen); -#endif +void mate_bg_set_surface_as_root (GdkScreen *screen, + cairo_surface_t *surface); +MateBGCrossfade *mate_bg_set_surface_as_root_with_crossfade (GdkScreen *screen, + cairo_surface_t *surface); +cairo_surface_t *mate_bg_get_surface_from_root (GdkScreen *screen); + +#else /* GTK_CHECK_VERSION(3, 0, 0) */ + +void mate_bg_set_pixmap_as_root (GdkScreen *screen, + GdkPixmap *pixmap); +MateBGCrossfade *mate_bg_set_pixmap_as_root_with_crossfade (GdkScreen *screen, + GdkPixmap *pixmap); +GdkPixmap *mate_bg_get_pixmap_from_root (GdkScreen *screen); +#endif /* GTK_CHECK_VERSION(3, 0, 0) */ #ifdef __cplusplus } -- cgit v1.2.1