From 0b1269a7704d0e89f690bddd9b63f6fb596dff33 Mon Sep 17 00:00:00 2001 From: waker Date: Fri, 5 Nov 2010 22:13:31 +0100 Subject: added fallback gtkui plugin --- plugins/gtkui/gtkui.c | 6 +++--- plugins/gtkui/gtkui.h | 14 +++++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'plugins') diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index f468f0c5..8c30f090 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -223,7 +223,7 @@ update_songinfo (gpointer ctx) { void set_tray_tooltip (const char *text) { if (trayicon) { -#if (GTK_MINOR_VERSION < 16) +#if !GTK_CHECK_VERSION(2,16,0) || defined(ULTRA_COMPATIBLE) gtk_status_icon_set_tooltip (trayicon, text); #else gtk_status_icon_set_tooltip_text (trayicon, text); @@ -292,7 +292,7 @@ mainwin_toggle_visible (void) { } } -#if GTK_MINOR_VERSION<=14 +#if !GTK_CHECK_VERSION(2,14,0) || defined(ULTRA_COMPATIBLE) gboolean on_trayicon_activate (GtkWidget *widget, @@ -588,7 +588,7 @@ gtkui_update_status_icon (gpointer unused) { g_object_set (trayicon, "visible", FALSE, NULL); } -#if GTK_MINOR_VERSION <= 14 +#if !GTK_CHECK_VERSION(2,14,0) || defined(ULTRA_COMPATIBLE) g_signal_connect ((gpointer)trayicon, "activate", G_CALLBACK (on_trayicon_activate), NULL); #else g_signal_connect ((gpointer)trayicon, "scroll_event", G_CALLBACK (on_trayicon_scroll_event), NULL); diff --git a/plugins/gtkui/gtkui.h b/plugins/gtkui/gtkui.h index 53db09af..7cb2dff4 100644 --- a/plugins/gtkui/gtkui.h +++ b/plugins/gtkui/gtkui.h @@ -25,12 +25,20 @@ #include +#ifdef HAVE_CONFIG_H +#include "../../config.h" +#endif + +#if defined(ULTRA_COMPATIBLE) +#warning compiling for compatibility with gtk <2.14 +#endif + // workaround to make older gtk compatible with vala codegen -#if !GTK_CHECK_VERSION(2,14,0) +#if !GTK_CHECK_VERSION(2,14,0) || defined(ULTRA_COMPATIBLE) #define gtk_widget_get_window(widget) ((widget)->window) #endif -#if !GTK_CHECK_VERSION(2,18,0) +#if !GTK_CHECK_VERSION(2,18,0) || defined(ULTRA_COMPATIBLE) #define gtk_widget_set_has_window(widget, has_window) \ if (has_window) GTK_WIDGET_UNSET_FLAGS (widget, GTK_NO_WINDOW); \ else GTK_WIDGET_SET_FLAGS (widget, GTK_NO_WINDOW); @@ -39,7 +47,7 @@ #define gtk_widget_get_has_window(widget) (!GTK_WIDGET_NO_WINDOW(widget)) #endif -#if !GTK_CHECK_VERSION(2,20,0) +#if !GTK_CHECK_VERSION(2,20,0) || defined(ULTRA_COMPATIBLE) #define gtk_widget_get_realized(widget) (GTK_WIDGET_REALIZED(widget)) #endif -- cgit v1.2.3