/pidgin/main: bf243e3394a7: Remove all unnecessary GTK_CHECK_VER...
Mark Doliner
mark at kingant.net
Sat Jan 26 21:13:24 EST 2013
Changeset: bf243e3394a7aeebbddc2e33e12b1100392d8536
Author: Mark Doliner <mark at kingant.net>
Date: 2013-01-26 18:12 -0800
Branch: default
URL: http://hg.pidgin.im/pidgin/main/rev/bf243e3394a7
Description:
Remove all unnecessary GTK_CHECK_VERSION calls.
diffstat:
pidgin/gtk3compat.h | 82 ---------------------------------------
pidgin/gtkaccount.c | 12 -----
pidgin/gtkblist.c | 44 +-------------------
pidgin/gtkconv.c | 7 ---
pidgin/gtkconv.h | 4 -
pidgin/gtkdebug.c | 9 ----
pidgin/gtkdocklet.c | 41 +++---------------
pidgin/gtkimhtml.c | 6 +-
pidgin/gtkimhtmltoolbar.c | 7 ---
pidgin/gtkimhtmltoolbar.h | 4 -
pidgin/gtkmedia.c | 26 ------------
pidgin/gtkmenutray.c | 34 ----------------
pidgin/gtknotify.c | 5 --
pidgin/gtkpluginpref.c | 4 -
pidgin/gtkprefs.c | 4 -
pidgin/gtkrequest.c | 13 ------
pidgin/gtkstatusbox.c | 2 -
pidgin/minidialog.c | 4 -
pidgin/pidgin.h | 17 --------
pidgin/pidgintooltip.c | 7 ---
pidgin/plugins/convcolors.c | 10 ----
pidgin/plugins/notify.c | 4 -
pidgin/plugins/pidginrc.c | 8 ---
pidgin/plugins/themeedit.c | 14 ------
pidgin/plugins/timestamp_format.c | 9 ----
pidgin/plugins/xmppconsole.c | 12 -----
26 files changed, 15 insertions(+), 374 deletions(-)
diffs (truncated from 942 to 300 lines):
diff --git a/pidgin/gtk3compat.h b/pidgin/gtk3compat.h
--- a/pidgin/gtk3compat.h
+++ b/pidgin/gtk3compat.h
@@ -97,88 +97,6 @@ static inline gint gdk_window_get_height
GTK_WIDGET_UNSET_FLAGS(x, GTK_REALIZED); \
} while(0)
-#if !GTK_CHECK_VERSION(2,18,0)
-
-#define gtk_widget_get_state GTK_WIDGET_STATE
-#define gtk_widget_is_drawable GTK_WIDGET_DRAWABLE
-#define gtk_widget_get_visible GTK_WIDGET_VISIBLE
-#define gtk_widget_has_focus GTK_WIDGET_HAS_FOCUS
-#define gtk_widget_is_sensitive GTK_WIDGET_IS_SENSITIVE
-#define gtk_widget_get_has_window(x) !GTK_WIDGET_NO_WINDOW(x)
-#define gtk_widget_set_has_window(x,y) do { \
- if (!y) \
- GTK_WIDGET_SET_FLAGS(x, GTK_NO_WINDOW); \
- else \
- GTK_WIDGET_UNSET_FLAGS(x, GTK_NO_WINDOW); \
-} while(0)
-#define gtk_widget_get_allocation(x,y) *(y) = (x)->allocation
-#define gtk_widget_set_allocation(x,y) (x)->allocation = *(y)
-#define gtk_widget_set_window(x,y) ((x)->window = (y))
-#define gtk_widget_set_can_default(w,y) do { \
- if (y) \
- GTK_WIDGET_SET_FLAGS((w), GTK_CAN_DEFAULT); \
- else \
- GTK_WIDGET_UNSET_FLAGS((w), 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)
-#define gtk_cell_renderer_set_padding(x,y,z) do { \
- (x)->xpad = (y); \
- (x)->ypad = (z); \
-} while (0)
-#define gtk_cell_renderer_get_padding(x,y,z) do { \
- *(y) = (x)->xpad; \
- *(z) = (x)->ypad; \
-} while (0)
-#define gtk_cell_renderer_get_alignment(x,y,z) do { \
- *(y) = (x)->xalign; \
- *(z) = (x)->yalign; \
-} while (0)
-
-#if !GTK_CHECK_VERSION(2,16,0)
-
-#define gtk_status_icon_set_tooltip_text gtk_status_icon_set_tooltip
-
-#if !GTK_CHECK_VERSION(2,14,0)
-
-#define gtk_widget_get_window(x) (x)->window
-#define gtk_widget_set_style(x,y) (x)->style = (y)
-#define gtk_selection_data_get_data(x) (x)->data
-#define gtk_selection_data_get_length(x) (x)->length
-#define gtk_selection_data_get_format(x) (x)->format
-#define gtk_selection_data_get_target(x) (x)->target
-#define gtk_dialog_get_content_area(x) GTK_DIALOG(x)->vbox
-#define gtk_dialog_get_action_area(x) GTK_DIALOG(x)->action_area
-#define gtk_adjustment_get_page_size(x) (x)->page_size
-#define gtk_adjustment_get_lower(x) (x)->lower
-#define gtk_adjustment_get_upper(x) (x)->upper
-#define gtk_font_selection_get_size_entry(x) (x)->size_entry
-#define gtk_font_selection_get_family_list(x) (x)->family_list
-#define gtk_font_selection_dialog_get_ok_button(x) (x)->ok_button
-#define gtk_font_selection_dialog_get_cancel_button(x) (x)->cancel_button
-#define gtk_color_selection_dialog_get_color_selection(x) (x)->colorsel
-#define gtk_menu_item_get_accel_path(x) (x)->accel_path
-
-#if !GTK_CHECK_VERSION(2,12,0)
-
-#ifdef GTK_TOOLTIPS_VAR
-#define gtk_widget_set_tooltip_text(w, t) gtk_tooltips_set_tip(GTK_TOOLTIPS_VAR, (w), (t), NULL)
-#else
-#define gtk_widget_set_tooltip_text(w, t) gtk_tooltips_set_tip(tooltips, (w), (t), NULL)
-#endif
-
-#endif /* 2.12.0 */
-
-#endif /* 2.14.0 */
-
-#endif /* 2.16.0 */
-
-#endif /* 2.18.0 */
-
#endif /* 2.20.0 */
#endif /* 2.22.0 */
diff --git a/pidgin/gtkaccount.c b/pidgin/gtkaccount.c
--- a/pidgin/gtkaccount.c
+++ b/pidgin/gtkaccount.c
@@ -617,10 +617,6 @@ add_login_options(AccountPrefsDialog *di
/* Password */
dialog->password_entry = gtk_entry_new();
gtk_entry_set_visibility(GTK_ENTRY(dialog->password_entry), FALSE);
-#if !GTK_CHECK_VERSION(2,16,0)
- if (gtk_entry_get_invisible_char(GTK_ENTRY(dialog->password_entry)) == '*')
- gtk_entry_set_invisible_char(GTK_ENTRY(dialog->password_entry), PIDGIN_INVISIBLE_CHAR);
-#endif /* Less than GTK+ 2.16 */
dialog->password_box = add_pref_box(dialog, vbox, _("_Password:"),
dialog->password_entry);
@@ -935,10 +931,6 @@ add_protocol_options(AccountPrefsDialog
else if (purple_account_option_string_get_masked(option))
{
gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
-#if !GTK_CHECK_VERSION(2,16,0)
- if (gtk_entry_get_invisible_char(GTK_ENTRY(entry)) == '*')
- gtk_entry_set_invisible_char(GTK_ENTRY(entry), PIDGIN_INVISIBLE_CHAR);
-#endif /* Less than GTK+ 2.16 */
}
if (str_value != NULL && str_hints)
@@ -1176,10 +1168,6 @@ add_proxy_options(AccountPrefsDialog *di
/* Password */
dialog->proxy_pass_entry = gtk_entry_new();
gtk_entry_set_visibility(GTK_ENTRY(dialog->proxy_pass_entry), FALSE);
-#if !GTK_CHECK_VERSION(2,16,0)
- if (gtk_entry_get_invisible_char(GTK_ENTRY(dialog->proxy_pass_entry)) == '*')
- gtk_entry_set_invisible_char(GTK_ENTRY(dialog->proxy_pass_entry), PIDGIN_INVISIBLE_CHAR);
-#endif /* Less than GTK+ 2.16 */
add_pref_box(dialog, vbox2, _("Pa_ssword:"), dialog->proxy_pass_entry);
if (dialog->account != NULL &&
diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c
--- a/pidgin/gtkblist.c
+++ b/pidgin/gtkblist.c
@@ -1110,10 +1110,6 @@ rebuild_chat_entries(PidginChatData *dat
if (pce->secret)
{
gtk_entry_set_visibility(GTK_ENTRY(input), FALSE);
-#if !GTK_CHECK_VERSION(2,16,0)
- if (gtk_entry_get_invisible_char(GTK_ENTRY(input)) == '*')
- gtk_entry_set_invisible_char(GTK_ENTRY(input), PIDGIN_INVISIBLE_CHAR);
-#endif /* Less than GTK+ 2.16 */
}
pidgin_add_widget_to_vbox(data->rq_data.vbox, pce->label, data->rq_data.sg, input, TRUE, NULL);
g_signal_connect(G_OBJECT(input), "changed",
@@ -5473,6 +5469,7 @@ create_account_label(PurpleAccount *acco
GtkWidget *hbox, *label;
const char *username = purple_account_get_username(account);
char *markup;
+ char *description;
hbox = gtk_hbox_new(FALSE, 6);
g_object_set_data(G_OBJECT(hbox), OBJECT_DATA_KEY_ACCOUNT, account);
@@ -5485,14 +5482,9 @@ create_account_label(PurpleAccount *acco
g_free(markup);
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
g_object_set(G_OBJECT(label), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
-#if GTK_CHECK_VERSION(2,12,0)
- { /* avoid unused variable warnings on pre-2.12 Gtk */
- char *description =
- purple_account_get_current_error(account)->description;
- if (description != NULL && *description != '\0')
- gtk_widget_set_tooltip_text(label, description);
- }
-#endif
+ description = purple_account_get_current_error(account)->description;
+ if (description != NULL && *description != '\0')
+ gtk_widget_set_tooltip_text(label, description);
gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
return hbox;
@@ -5536,12 +5528,10 @@ static void
update_signed_on_elsewhere_tooltip(PurpleAccount *account,
const char *description)
{
-#if GTK_CHECK_VERSION(2,12,0)
PidginBuddyListPrivate *priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist);
GtkContainer *c = GTK_CONTAINER(priv->signed_on_elsewhere->contents);
GtkWidget *label = find_child_widget_by_account(c, account);
gtk_widget_set_tooltip_text(label, description);
-#endif
}
@@ -5667,7 +5657,6 @@ headline_style_set (GtkWidget *widget,
{
PidginBuddyListPrivate *priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist);
GtkStyle *style;
-#if GTK_CHECK_VERSION(2,12,0)
GtkWidget *window;
if (priv->changing_style)
@@ -5686,25 +5675,6 @@ headline_style_set (GtkWidget *widget,
gtk_widget_destroy(window);
gtk_widget_queue_draw(gtkblist->headline);
-#else
- GtkTooltips *tooltips;
-
- if (gtkblist->changing_style)
- return;
-
- tooltips = gtk_tooltips_new ();
- g_object_ref_sink (tooltips);
-
- gtk_tooltips_force_window (tooltips);
- gtk_widget_ensure_style (tooltips->tip_window);
- style = gtk_widget_get_style (tooltips->tip_window);
-
- priv->changing_style = TRUE;
- gtk_widget_set_style (gtkblist->headline, style);
- priv->changing_style = FALSE;
-
- g_object_unref (tooltips);
-#endif
}
#endif
@@ -6141,9 +6111,7 @@ static void pidgin_blist_show(PurpleBudd
close = gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
close = pidgin_create_small_button(close);
gtk_box_pack_start(GTK_BOX(gtkblist->headline), close, FALSE, FALSE, 0);
-#if GTK_CHECK_VERSION(2,12,0)
gtk_widget_set_tooltip_text(close, _("Close"));
-#endif
g_signal_connect(close, "clicked", G_CALLBACK(headline_close_press_cb), gtkblist);
g_signal_connect(G_OBJECT(ebox), "enter-notify-event", G_CALLBACK(headline_box_enter_cb), priv);
@@ -7811,10 +7779,6 @@ void pidgin_blist_init(void)
purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/y", 0);
purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/width", 250); /* Golden ratio, baby */
purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/height", 405); /* Golden ratio, baby */
-#if !GTK_CHECK_VERSION(2,14,0)
- /* This pref is used in pidgintooltip.c. */
- purple_prefs_add_int(PIDGIN_PREFS_ROOT "/blist/tooltip_delay", 500);
-#endif
purple_prefs_add_string(PIDGIN_PREFS_ROOT "/blist/theme", "");
purple_theme_manager_register_type(g_object_new(PIDGIN_TYPE_BLIST_THEME_LOADER, "type", "blist", NULL));
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -5771,9 +5771,6 @@ private_gtkconv_new(PurpleConversation *
gtkconv->send_history = g_list_append(NULL, NULL);
/* Setup some initial variables. */
-#if !GTK_CHECK_VERSION(2,12,0)
- gtkconv->tooltips = gtk_tooltips_new();
-#endif
gtkconv->unseen_state = PIDGIN_UNSEEN_NONE;
gtkconv->unseen_count = 0;
theme_name = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/theme");
@@ -5992,10 +5989,6 @@ pidgin_conv_destroy(PurpleConversation *
g_free(gtkconv->u.chat);
}
-#if !GTK_CHECK_VERSION(2,12,0)
- gtk_object_sink(GTK_OBJECT(gtkconv->tooltips));
-#endif
-
gtkconv->send_history = g_list_first(gtkconv->send_history);
g_list_foreach(gtkconv->send_history, (GFunc)g_free, NULL);
g_list_free(gtkconv->send_history);
diff --git a/pidgin/gtkconv.h b/pidgin/gtkconv.h
--- a/pidgin/gtkconv.h
+++ b/pidgin/gtkconv.h
@@ -90,11 +90,7 @@ struct _PidginConversation
gboolean make_sound;
-#if GTK_CHECK_VERSION(2,12,0)
gpointer depr2;
-#else
- GtkTooltips *tooltips;
-#endif
GtkWidget *tab_cont;
GtkWidget *tabby;
diff --git a/pidgin/gtkdebug.c b/pidgin/gtkdebug.c
--- a/pidgin/gtkdebug.c
+++ b/pidgin/gtkdebug.c
@@ -700,9 +700,6 @@ debug_window_new(void)
gint width, height;
void *handle;
GtkToolItem *item;
-#if !GTK_CHECK_VERSION(2,12,0)
- GtkTooltips *tooltips;
-#endif
win = g_new0(DebugWindow, 1);
@@ -729,12 +726,6 @@ debug_window_new(void)
if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/toolbar")) {
/* Setup our top button bar thingie. */
toolbar = gtk_toolbar_new();
-#if !GTK_CHECK_VERSION(2,12,0)
- tooltips = gtk_tooltips_new();
-#endif
-#if !GTK_CHECK_VERSION(2,14,0)
- gtk_toolbar_set_tooltips(GTK_TOOLBAR(toolbar), TRUE);
-#endif
gtk_toolbar_set_show_arrow(GTK_TOOLBAR(toolbar), TRUE);
g_signal_connect(G_OBJECT(toolbar), "button-press-event", G_CALLBACK(toolbar_context), win);
More information about the Commits
mailing list