pidgin: fa030de9: Add some GTK+3 compatible updates.
qulogic at pidgin.im
qulogic at pidgin.im
Thu Jan 5 23:01:52 EST 2012
----------------------------------------------------------------------
Revision: fa030de9716f95e08b05826a691cb152c311050e
Parent: 5df25f701eaca872aec652518a29969114a01d1a
Author: qulogic at pidgin.im
Date: 01/05/12 04:50:46
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/fa030de9716f95e08b05826a691cb152c311050e
Changelog:
Add some GTK+3 compatible updates.
Changes against parent 5df25f701eaca872aec652518a29969114a01d1a
patched pidgin/gtkwebviewtoolbar.c
-------------- next part --------------
============================================================
--- pidgin/gtkwebviewtoolbar.c 594cc48957eb1f5a83e6131100c0734bdf1636d1
+++ pidgin/gtkwebviewtoolbar.c 1cb95230dfb25c02e5252eed1b17087fbed7c505
@@ -43,6 +43,15 @@
#include <gdk/gdkkeysyms.h>
+#if !GTK_CHECK_VERSION(2,18,0)
+#define gtk_widget_get_visible(x) GTK_WIDGET_VISIBLE((x))
+#define gtk_widget_is_sensitive(x) GTK_WIDGET_IS_SENSITIVE((x))
+#if !GTK_CHECK_VERSION(2,12,0)
+#define gtk_widget_set_tooltip_text(w, t) \
+ gtk_tooltips_set_tip(priv->tooltips, (w), (t), NULL)
+#endif
+#endif
+
#define GTK_WEBVIEWTOOLBAR_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE((obj), GTK_TYPE_WEBVIEWTOOLBAR, GtkWebViewToolbarPriv))
@@ -56,7 +65,9 @@ typedef struct _GtkWebViewToolbarPriv {
GtkWidget *wide_view;
GtkWidget *lean_view;
+#if !GTK_CHECK_VERSION(2,12,0)
GtkTooltips *tooltips;
+#endif
GtkWidget *font_label;
GtkWidget *font_menu;
@@ -769,7 +780,7 @@ sort_smileys(struct smiley_button_list *
g_object_set_data(G_OBJECT(button), "smiley_text", face);
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(insert_smiley_text), toolbar);
- gtk_tooltips_set_tip(priv->tooltips, button, face, NULL);
+ gtk_widget_set_tooltip_text(button, face);
/* these look really weird with borders */
gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
@@ -783,7 +794,7 @@ sort_smileys(struct smiley_button_list *
g_snprintf(tip, sizeof(tip),
_("This smiley is disabled because a custom smiley exists for this shortcut:\n %s"),
face);
- gtk_tooltips_set_tip(priv->tooltips, button, tip, NULL);
+ gtk_widget_set_tooltip_text(button, tip);
gtk_widget_set_sensitive(button, FALSE);
} else if (psmiley) {
/* Remove the button if the smiley is destroyed */
@@ -1266,7 +1277,7 @@ gtk_webviewtoolbar_popup_menu(GtkWidget
if (event->button != 3)
return FALSE;
- wide = GTK_WIDGET_VISIBLE(priv->bold);
+ wide = gtk_widget_get_visible(priv->bold);
menu = gtk_menu_new();
item = gtk_menu_item_new_with_mnemonic(wide ? _("Group Items") : _("Ungroup Items"));
@@ -1282,7 +1293,7 @@ button_visibility_changed(GtkWidget *but
static void
button_visibility_changed(GtkWidget *button, gpointer dontcare, GtkWidget *item)
{
- if (GTK_WIDGET_VISIBLE(button))
+ if (gtk_widget_get_visible(button))
gtk_widget_hide(item);
else
gtk_widget_show(item);
@@ -1291,7 +1302,7 @@ button_sensitiveness_changed(GtkWidget *
static void
button_sensitiveness_changed(GtkWidget *button, gpointer dontcare, GtkWidget *item)
{
- gtk_widget_set_sensitive(item, GTK_WIDGET_IS_SENSITIVE(button));
+ gtk_widget_set_sensitive(item, gtk_widget_is_sensitive(button));
}
static void
@@ -1361,7 +1372,10 @@ gtk_webviewtoolbar_finalize(GObject *obj
}
g_free(priv->sml);
+
+#if !GTK_CHECK_VERSION(2,12,0)
gtk_object_sink(GTK_OBJECT(priv->tooltips));
+#endif
if (priv->font_menu)
gtk_widget_destroy(priv->font_menu);
@@ -1431,7 +1445,7 @@ gtk_webviewtoolbar_create_old_buttons(Gt
g_signal_connect(G_OBJECT(button), "clicked",
G_CALLBACK(buttons[iter].callback), toolbar);
*(buttons[iter].button) = button;
- gtk_tooltips_set_tip(priv->tooltips, button, buttons[iter].tooltip, NULL);
+ gtk_widget_set_tooltip_text(button, buttons[iter].tooltip);
} else
button = gtk_vseparator_new();
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
@@ -1490,7 +1504,9 @@ gtk_webviewtoolbar_init(GtkWebViewToolba
priv->smiley_dialog = NULL;
priv->image_dialog = NULL;
+#if !GTK_CHECK_VERSION(2,12,0)
priv->tooltips = gtk_tooltips_new();
+#endif
gtk_box_set_spacing(GTK_BOX(toolbar), 3);
More information about the Commits
mailing list