changeset 32616:0e123a0b7694

gtk_widget_[gs]et_{mapped,realized} were added in GTK+ 2.20.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 25 Jul 2010 22:37:17 +0000
parents fdc865966b01
children 3f9678300238
files pidgin/plugins/ticker/gtkticker.c
diffstat 1 files changed, 14 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/plugins/ticker/gtkticker.c	Sun Jul 25 01:11:18 2010 +0000
+++ b/pidgin/plugins/ticker/gtkticker.c	Sun Jul 25 22:37:17 2010 +0000
@@ -21,28 +21,24 @@
  * GtkTicker Copyright 2000 Syd Logan
  */
 
-/* FIXME: GTK+ deprecated GTK_WIDGET_MAPPED/REALIZED, but don't provide
-          accessor functions yet. */
-#undef GSEAL_ENABLE
-
 #include "gtkticker.h"
 #include <gtk/gtk.h>
 
-/* These don't seem to be in a release yet. See BZ #69872 */
-#define gtk_widget_is_mapped(x) GTK_WIDGET_MAPPED(x)
-#define gtk_widget_is_realized(x) GTK_WIDGET_REALIZED(x)
+#if !GTK_CHECK_VERSION(2,20,0)
+#define gtk_widget_get_mapped(x) GTK_WIDGET_MAPPED(x)
+#define gtk_widget_set_mapped(x,y) do {\
+	if (y) \
+		GTK_WIDGET_SET_FLAGS(x, GTK_MAPPED); \
+	else \
+		GTK_WIDGET_UNSET_FLAGS(x, GTK_MAPPED); \
+} while(0)
+#define gtk_widget_get_realized(x) GTK_WIDGET_REALIZED(x)
 #define gtk_widget_set_realized(x,y) do {\
 	if (y) \
 		GTK_WIDGET_SET_FLAGS(x, GTK_REALIZED); \
 	else \
 		GTK_WIDGET_UNSET_FLAGS(x, GTK_REALIZED); \
 } while(0)
-#define gtk_widget_set_mapped(x,y) do {\
-	if (y) \
-		GTK_WIDGET_SET_FLAGS(x, GTK_MAPPED); \
-	else \
-		GTK_WIDGET_UNSET_FLAGS(x, GTK_MAPPED); \
-} while(0)
 
 #if !GTK_CHECK_VERSION(2,18,0)
 #define gtk_widget_get_visible(x) GTK_WIDGET_VISIBLE(x)
@@ -51,6 +47,7 @@
 #define gtk_widget_get_window(x) x->window
 #endif
 #endif
+#endif
 
 static void gtk_ticker_compute_offsets (GtkTicker    *ticker);
 static void gtk_ticker_class_init    (GtkTickerClass    *klass);
@@ -181,13 +178,13 @@
 
 	ticker->children = g_list_append (ticker->children, child_info);
 
-	if (gtk_widget_is_realized (ticker))
+	if (gtk_widget_get_realized (ticker))
 		gtk_widget_realize (widget);
 
 	if (gtk_widget_get_visible (GTK_WIDGET (ticker)) &&
 		gtk_widget_get_visible (widget))
 	{
-		if (gtk_widget_is_mapped (GTK_WIDGET (ticker)))
+		if (gtk_widget_get_mapped (GTK_WIDGET (ticker)))
 			gtk_widget_map (widget);
 
 		gtk_widget_queue_resize (GTK_WIDGET (ticker));
@@ -298,7 +295,7 @@
 		children = children->next;
 
 		if (gtk_widget_get_visible (child->widget) &&
-				!gtk_widget_is_mapped (child->widget))
+				!gtk_widget_get_mapped (child->widget))
 			gtk_widget_map (child->widget);
 	}
 
@@ -474,7 +471,7 @@
 #else
 	widget->allocation = *allocation;
 #endif
-	if (gtk_widget_is_realized (widget))
+	if (gtk_widget_get_realized (widget))
 		gdk_window_move_resize (gtk_widget_get_window (widget),
 				allocation->x,
 				allocation->y,