Mercurial > pidgin.yaz
changeset 26706:4aa5400b1b99
Replace the deprecated GtkSignalFunc and GTK_SIGNAL_FUNC with GCallback and
G_CALLBACK. It shouldn't break API since they have the same signature, and
most of our code was already using the G_CALLBACK cast anyway (proving that
it doesn't cause any adverse effects).
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sat, 18 Apr 2009 21:45:41 +0000 |
parents | a3f7ade9e45b |
children | 397afd0ce007 |
files | pidgin/gtkdocklet.c pidgin/gtkutils.c pidgin/gtkutils.h pidgin/plugins/win32/transparency/win2ktrans.c |
diffstat | 4 files changed, 25 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/gtkdocklet.c Sat Apr 18 07:31:32 2009 +0000 +++ b/pidgin/gtkdocklet.c Sat Apr 18 21:45:41 2009 +0000 @@ -482,7 +482,7 @@ } static GtkWidget * -new_menu_item_with_status_icon(GtkWidget *menu, const char *str, PurpleStatusPrimitive primitive, GtkSignalFunc sf, gpointer data, guint accel_key, guint accel_mods, char *mod) +new_menu_item_with_status_icon(GtkWidget *menu, const char *str, PurpleStatusPrimitive primitive, GCallback cb, gpointer data, guint accel_key, guint accel_mods, char *mod) { GtkWidget *menuitem; GdkPixbuf *pixbuf; @@ -493,8 +493,8 @@ if (menu) gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); - if (sf) - g_signal_connect(G_OBJECT(menuitem), "activate", sf, data); + if (cb) + g_signal_connect(G_OBJECT(menuitem), "activate", cb, data); pixbuf = pidgin_create_status_icon(primitive, menu, PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL); image = gtk_image_new_from_pixbuf(pixbuf);
--- a/pidgin/gtkutils.c Sat Apr 18 07:31:32 2009 +0000 +++ b/pidgin/gtkutils.c Sat Apr 18 21:45:41 2009 +0000 @@ -358,7 +358,7 @@ } GtkWidget *pidgin_new_check_item(GtkWidget *menu, const char *str, - GtkSignalFunc sf, gpointer data, gboolean checked) + GCallback cb, gpointer data, gboolean checked) { GtkWidget *menuitem; menuitem = gtk_check_menu_item_new_with_mnemonic(str); @@ -368,8 +368,8 @@ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), checked); - if (sf) - g_signal_connect(G_OBJECT(menuitem), "activate", sf, data); + if (cb) + g_signal_connect(G_OBJECT(menuitem), "activate", cb, data); gtk_widget_show_all(menuitem); @@ -439,7 +439,7 @@ } -GtkWidget *pidgin_new_item_from_stock(GtkWidget *menu, const char *str, const char *icon, GtkSignalFunc sf, gpointer data, guint accel_key, guint accel_mods, char *mod) +GtkWidget *pidgin_new_item_from_stock(GtkWidget *menu, const char *str, const char *icon, GCallback cb, gpointer data, guint accel_key, guint accel_mods, char *mod) { GtkWidget *menuitem; /* @@ -456,8 +456,8 @@ if (menu) gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); - if (sf) - g_signal_connect(G_OBJECT(menuitem), "activate", sf, data); + if (cb) + g_signal_connect(G_OBJECT(menuitem), "activate", cb, data); if (icon != NULL) { image = gtk_image_new_from_stock(icon, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL));
--- a/pidgin/gtkutils.h Sat Apr 18 07:31:32 2009 +0000 +++ b/pidgin/gtkutils.h Sat Apr 18 21:45:41 2009 +0000 @@ -233,14 +233,14 @@ * * @param menu The menu to which to append the check menu item. * @param str The title to use for the newly created menu item. - * @param sf A function to call when the menu item is activated. + * @param cb A function to call when the menu item is activated. * @param data Data to pass to the signal function. * @param checked The initial state of the check item * * @return The newly created menu item. */ GtkWidget *pidgin_new_check_item(GtkWidget *menu, const char *str, - GtkSignalFunc sf, gpointer data, gboolean checked); + GCallback cb, gpointer data, gboolean checked); /** * Creates a menu item. @@ -249,7 +249,7 @@ * @param str The title for the menu item. * @param icon An icon to place to the left of the menu item, * or @c NULL for no icon. - * @param sf A function to call when the menu item is activated. + * @param cb A function to call when the menu item is activated. * @param data Data to pass to the signal function. * @param accel_key Something. * @param accel_mods Something. @@ -258,7 +258,7 @@ * @return The newly created menu item. */ GtkWidget *pidgin_new_item_from_stock(GtkWidget *menu, const char *str, - const char *icon, GtkSignalFunc sf, + const char *icon, GCallback cb, gpointer data, guint accel_key, guint accel_mods, char *mod);
--- a/pidgin/plugins/win32/transparency/win2ktrans.c Sat Apr 18 07:31:32 2009 +0000 +++ b/pidgin/plugins/win32/transparency/win2ktrans.c Sat Apr 18 21:45:41 2009 +0000 @@ -182,7 +182,7 @@ /* On slider val change, update window's transparency level */ g_signal_connect(GTK_OBJECT(slider), "value-changed", - GTK_SIGNAL_FUNC(change_alpha), win); + G_CALLBACK(change_alpha), win); gtk_box_pack_start(GTK_BOX(hbox), slider, FALSE, TRUE, 5); @@ -563,7 +563,7 @@ button = pidgin_prefs_checkbox(_("_IM window transparency"), OPT_WINTRANS_IM_ENABLED, imtransbox); g_signal_connect(GTK_OBJECT(button), "clicked", - GTK_SIGNAL_FUNC(update_convs_wintrans), + G_CALLBACK(update_convs_wintrans), (gpointer) OPT_WINTRANS_IM_ENABLED); trans_box = gtk_vbox_new(FALSE, 18); @@ -572,12 +572,12 @@ gtk_widget_show(trans_box); g_signal_connect(GTK_OBJECT(button), "clicked", - GTK_SIGNAL_FUNC(pidgin_toggle_sensitive), trans_box); + G_CALLBACK(pidgin_toggle_sensitive), trans_box); button = pidgin_prefs_checkbox(_("_Show slider bar in IM window"), OPT_WINTRANS_IM_SLIDER, trans_box); g_signal_connect(GTK_OBJECT(button), "clicked", - GTK_SIGNAL_FUNC(update_convs_wintrans), + G_CALLBACK(update_convs_wintrans), (gpointer) OPT_WINTRANS_IM_SLIDER); button = pidgin_prefs_checkbox( @@ -587,7 +587,7 @@ button = pidgin_prefs_checkbox(_("Always on top"), OPT_WINTRANS_IM_ONTOP, trans_box); g_signal_connect(GTK_OBJECT(button), "clicked", - GTK_SIGNAL_FUNC(update_convs_wintrans), + G_CALLBACK(update_convs_wintrans), (gpointer) OPT_WINTRANS_IM_ONTOP); gtk_box_pack_start(GTK_BOX(imtransbox), trans_box, FALSE, FALSE, 5); @@ -604,9 +604,9 @@ gtk_widget_set_usize(GTK_WIDGET(slider), 200, -1); g_signal_connect(GTK_OBJECT(slider), "value-changed", - GTK_SIGNAL_FUNC(alpha_change), NULL); + G_CALLBACK(alpha_change), NULL); g_signal_connect(GTK_OBJECT(slider), "focus-out-event", - GTK_SIGNAL_FUNC(alpha_pref_set_int), + G_CALLBACK(alpha_pref_set_int), (gpointer) OPT_WINTRANS_IM_ALPHA); gtk_box_pack_start(GTK_BOX(hbox), slider, FALSE, TRUE, 5); @@ -620,7 +620,7 @@ button = pidgin_prefs_checkbox(_("_Buddy List window transparency"), OPT_WINTRANS_BL_ENABLED, bltransbox); g_signal_connect(GTK_OBJECT(button), "clicked", - GTK_SIGNAL_FUNC(set_blist_trans), + G_CALLBACK(set_blist_trans), (gpointer) OPT_WINTRANS_BL_ENABLED); trans_box = gtk_vbox_new(FALSE, 18); @@ -628,14 +628,14 @@ gtk_widget_set_sensitive(GTK_WIDGET(trans_box), FALSE); gtk_widget_show(trans_box); g_signal_connect(GTK_OBJECT(button), "clicked", - GTK_SIGNAL_FUNC(pidgin_toggle_sensitive), trans_box); + G_CALLBACK(pidgin_toggle_sensitive), trans_box); button = pidgin_prefs_checkbox( _("Remove Buddy List window transparency on focus"), OPT_WINTRANS_BL_ONFOCUS, trans_box); button = pidgin_prefs_checkbox(_("Always on top"), OPT_WINTRANS_BL_ONTOP, trans_box); g_signal_connect(GTK_OBJECT(button), "clicked", - GTK_SIGNAL_FUNC(set_blist_trans), + G_CALLBACK(set_blist_trans), (gpointer) OPT_WINTRANS_BL_ONTOP); gtk_box_pack_start(GTK_BOX(bltransbox), trans_box, FALSE, FALSE, 5); @@ -652,9 +652,9 @@ gtk_widget_set_usize(GTK_WIDGET(slider), 200, -1); g_signal_connect(GTK_OBJECT(slider), "value-changed", - GTK_SIGNAL_FUNC(bl_alpha_change), NULL); + G_CALLBACK(bl_alpha_change), NULL); g_signal_connect(GTK_OBJECT(slider), "focus-out-event", - GTK_SIGNAL_FUNC(alpha_pref_set_int), + G_CALLBACK(alpha_pref_set_int), (gpointer) OPT_WINTRANS_BL_ALPHA); gtk_box_pack_start(GTK_BOX(hbox), slider, FALSE, TRUE, 5);