From bc53751054ab3b2e693620311e6cd80bccb8b831 Mon Sep 17 00:00:00 2001 From: Perberos Date: Wed, 22 Feb 2012 01:58:42 -0300 Subject: some ugly gtk3 porting --- libmate-desktop/libmateui/mate-bg-crossfade.h | 15 +++++++++++---- libmate-desktop/libmateui/mate-bg.h | 26 ++++++++++++++++---------- 2 files changed, 27 insertions(+), 14 deletions(-) (limited to 'libmate-desktop/libmateui') diff --git a/libmate-desktop/libmateui/mate-bg-crossfade.h b/libmate-desktop/libmateui/mate-bg-crossfade.h index 6da8795..2f8b3cb 100644 --- a/libmate-desktop/libmateui/mate-bg-crossfade.h +++ b/libmate-desktop/libmateui/mate-bg-crossfade.h @@ -30,6 +30,7 @@ #endif #include +#include #ifdef __cplusplus extern "C" { @@ -62,10 +63,16 @@ struct _MateBGCrossfadeClass GType mate_bg_crossfade_get_type (void); MateBGCrossfade *mate_bg_crossfade_new (int width, int height); -gboolean mate_bg_crossfade_set_start_pixmap (MateBGCrossfade *fade, - GdkPixmap *pixmap); -gboolean mate_bg_crossfade_set_end_pixmap (MateBGCrossfade *fade, - GdkPixmap *pixmap); + + +#if GTK_CHECK_VERSION(3, 0, 0) + gboolean mate_bg_crossfade_set_start_pixmap(MateBGCrossfade* fade, cairo_surface_t* pixmap); + gboolean mate_bg_crossfade_set_end_pixmap(MateBGCrossfade* fade, cairo_surface_t* pixmap); +#else + gboolean mate_bg_crossfade_set_start_pixmap(MateBGCrossfade* fade, GdkPixmap* pixmap); + gboolean mate_bg_crossfade_set_end_pixmap(MateBGCrossfade* fade, GdkPixmap* pixmap); +#endif + void mate_bg_crossfade_start (MateBGCrossfade *fade, GdkWindow *window); gboolean mate_bg_crossfade_is_started (MateBGCrossfade *fade); diff --git a/libmate-desktop/libmateui/mate-bg.h b/libmate-desktop/libmateui/mate-bg.h index 0506d86..42b0997 100644 --- a/libmate-desktop/libmateui/mate-bg.h +++ b/libmate-desktop/libmateui/mate-bg.h @@ -93,11 +93,13 @@ void mate_bg_draw (MateBG *bg, GdkPixbuf *dest, GdkScreen *screen, gboolean is_root); -GdkPixmap * mate_bg_create_pixmap (MateBG *bg, - GdkWindow *window, - int width, - int height, - gboolean 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); +#else + GdkPixmap* mate_bg_create_pixmap(MateBG* bg, GdkWindow* window, int width, int height, gboolean root); +#endif + gboolean mate_bg_get_image_size (MateBG *bg, MateDesktopThumbnailFactory *factory, int best_width, @@ -125,12 +127,16 @@ GdkPixbuf * mate_bg_create_frame_thumbnail (MateBG *bg, * if we decide to stabilize the API then we may want to make * these object methods, drop mate_bg_create_pixmap, etc. */ -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); +#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 #ifdef __cplusplus } -- cgit v1.2.1