cpw.qulogic.gtk3: bf094b9d: Fix calls to GTK_WIDGET_SET_FLAGS, which...

qulogic at pidgin.im qulogic at pidgin.im
Sun Oct 9 04:34:53 EDT 2011


----------------------------------------------------------------------
Revision: bf094b9d16ac1d850f3d14fac0c1a91f22e12db6
Parent:   f87ae8592ef8d696073cc528016b5b5b024eea23
Author:   qulogic at pidgin.im
Date:     10/08/11 23:35:22
Branch:   im.pidgin.cpw.qulogic.gtk3
URL: http://d.pidgin.im/viewmtn/revision/info/bf094b9d16ac1d850f3d14fac0c1a91f22e12db6

Changelog: 

Fix calls to GTK_WIDGET_SET_FLAGS, which oddly enough does not seem to
be deprecated even though the underlying GTK_OBJECT_FLAGS is.

Changes against parent f87ae8592ef8d696073cc528016b5b5b024eea23

  patched  pidgin/gtkdialogs.c
  patched  pidgin/gtkrequest.c
  patched  pidgin/gtkstatusbox.c

-------------- next part --------------
============================================================
--- pidgin/gtkrequest.c	cb7b1638eb5f32651de9c1f6743d4ed9624fd7a7
+++ pidgin/gtkrequest.c	2576a5d62585b406fb1e8c6cf07a052235679325
@@ -39,6 +39,21 @@
 
 #include <gdk/gdkkeysyms.h>
 
+#if !GTK_CHECK_VERSION(2,18,0)
+#define gtk_widget_set_can_default(x,y) do {\
+	if (y) \
+		GTK_WIDGET_SET_FLAGS(x, GTK_CAN_DEFAULT); \
+	else \
+		GTK_WIDGET_UNSET_FLAGS(x, GTK_CAN_DEFAULT); \
+} while(0)
+#define gtk_widget_set_can_focus(x,y) do {\
+	if (y) \
+		GTK_WIDGET_SET_FLAGS(x, GTK_CAN_FOCUS); \
+	else \
+		GTK_WIDGET_UNSET_FLAGS(x, GTK_CAN_FOCUS); \
+} while(0)
+#endif
+
 static GtkWidget * create_account_field(PurpleRequestField *field);
 
 typedef struct
@@ -731,8 +746,8 @@ pidgin_request_action_with_icon(const ch
 
 
 	if (default_action == PURPLE_DEFAULT_ACTION_NONE) {
-		GTK_WIDGET_SET_FLAGS(img, GTK_CAN_DEFAULT);
-		GTK_WIDGET_SET_FLAGS(img, GTK_CAN_FOCUS);
+		gtk_widget_set_can_default(img, TRUE);
+		gtk_widget_set_can_focus(img, TRUE);
 		gtk_widget_grab_focus(img);
 		gtk_widget_grab_default(img);
 	} else
@@ -1270,12 +1285,12 @@ pidgin_request_fields(const char *title,
 
 	/* Cancel button */
 	button = pidgin_dialog_add_button(GTK_DIALOG(win), text_to_stock(cancel_text), G_CALLBACK(multifield_cancel_cb), data);
-	GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
+	gtk_widget_set_can_default(button, TRUE);
 
 	/* OK button */
 	button = pidgin_dialog_add_button(GTK_DIALOG(win), text_to_stock(ok_text), G_CALLBACK(multifield_ok_cb), data);
 	data->ok_button = button;
-	GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
+	gtk_widget_set_can_default(button, TRUE);
 	gtk_window_set_default(GTK_WINDOW(win), button);
 
 	pidgin_widget_decorate_account(hbox, account);
============================================================
--- pidgin/gtkdialogs.c	2dde71ada153e455e932abbfe3a47f5ece1fc692
+++ pidgin/gtkdialogs.c	92ed9179311d829e403a71c5f5e9b5871f8314b8
@@ -462,7 +462,11 @@ pidgin_build_help_dialog(const char *tit
 	button = pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_CLOSE,
 	                G_CALLBACK(destroy_win), win);
 
+#if GTK_CHECK_VERSION(2,18,0)
+	gtk_widget_set_can_default(button, TRUE);
+#else
 	GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
+#endif
 	gtk_widget_grab_default(button);
 
 	gtk_widget_show_all(win);
============================================================
--- pidgin/gtkstatusbox.c	cedf6ff878cea2c09eaa314309c75748d50a7d55
+++ pidgin/gtkstatusbox.c	74f9a87f6a5a62121920297003b53f9b750f8084
@@ -72,6 +72,12 @@
 
 #if !GTK_CHECK_VERSION(2,18,0)
 #define gtk_widget_is_sensitive(x) GTK_WIDGET_IS_SENSITIVE(x)
+#define gtk_widget_set_has_window(x, y) do { \
+	if (y) \
+		GTK_WIDGET_UNSET_FLAGS(x, GTK_WIDGET_NO_WINDOW); \
+	else \
+		GTK_WIDGET_SET_FLAGS(x, GTK_WIDGET_NO_WINDOW); \
+} while (0)
 #endif
 
 static void imhtml_changed_cb(GtkTextBuffer *buffer, void *data);
@@ -1753,7 +1759,7 @@ pidgin_status_box_init (PidginStatusBox 
 	GtkWidget *toplevel;
 	GtkTreeSelection *sel;
 
-	GTK_WIDGET_SET_FLAGS (status_box, GTK_NO_WINDOW);
+	gtk_widget_set_has_window(GTK_WIDGET(status_box), FALSE);
 	status_box->imhtml_visible = FALSE;
 	status_box->network_available = purple_network_is_available();
 	status_box->connecting = FALSE;


More information about the Commits mailing list