qulogic/pidgin

Remove support for GTK+2

2015-12-20, Jorge VillaseƱor
07dcc28b6039
Parents ee3bd4532a33
Children d2f0259aa43f
Remove support for GTK+2

* Remove conditional configuration and default to GTK+3
* Remove all code that requires a Gtk version lower than 3.

Note: PidginCellRendererExpander was not updated since most probably
will be deleted.
--- a/configure.ac Wed Dec 16 00:35:23 2015 -0800
+++ b/configure.ac Sun Dec 20 20:46:34 2015 -0800
@@ -517,9 +517,6 @@
AC_ARG_ENABLE(gtkui, [AS_HELP_STRING([--disable-gtkui],
[compile without GTK+ user interface])],
enable_gtkui="$enableval", enable_gtkui="yes")
-AC_ARG_WITH(gtk, [AS_HELP_STRING([--with-gtk=<version>],
- [compile with GTK+ 2 or 3 user interface (default: auto)])],
- with_gtk="$withval", with_gtk="auto")
AC_ARG_ENABLE(consoleui, [AS_HELP_STRING([--disable-consoleui],
[compile without console user interface])],
[enable_consoleui=$enableval force_finch=$enableval], [enable_consoleui=yes force_finch=no])
@@ -575,44 +572,22 @@
x_incpath_add="-I$x_includes"
fi
+dnl #######################################################################
+dnl Check Pidgin dependencies
+dnl #######################################################################
if test "x$enable_gtkui" = "xyes" ; then
- if test "x$with_gtk" = "x3"; then
- PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= 3.0.0], , [
- AC_MSG_RESULT(no)
- AC_MSG_ERROR([
+ PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= 3.0.0], , [
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR([
You must have GTK+ 3.0.0 or newer development headers installed to compile
Pidgin. If you want to build only Finch then specify --disable-gtkui when
running configure.
])])
- elif test "x$with_gtk" = "x2"; then
- PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.18.0], , [
- AC_MSG_RESULT(no)
- AC_MSG_ERROR([
-You must have GTK+ 2.18.0 or newer development headers installed to compile
-Pidgin. If you want to build only Finch then specify --disable-gtkui when
-running configure.
-])])
- elif test "x$with_gtk" = "xauto"; then
- dnl Leaved this here to simplify changeset. Remove when removing gtk2 support
- gst10_pkg="gstreamer-1.0"
- gst010_pkg="gstreamer-0.10"
- PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= 3.0.0 $gst10_pkg], [with_gtk=3], [
- AC_MSG_RESULT(no)
- PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.18.0 $gst10_pkg], [with_gtk=2], [
- AC_MSG_RESULT(no)
- AC_MSG_ERROR([
-You must have GTK+ 2.18.0 or newer and GStreamer development headers installed to compile
-Pidgin. If you want to build only Finch then specify --disable-gtkui when
-running configure. Use --disable-gstreamer if you do not need GStreamer (sound) support.
-])])])
- else
- AC_MSG_ERROR([--with-gtk must specify one of 2, 3 or auto.])
- fi
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
- GTK_PC_MODULE="gtk+-${with_gtk}.0"
- GTK_VERSION=${with_gtk}
+ GTK_PC_MODULE="gtk+-3.0"
+ GTK_VERSION="3"
AC_SUBST(GTK_PC_MODULE)
AC_SUBST(GTK_VERSION)
@@ -621,25 +596,14 @@
AC_DEFINE(HAVE_PANGO14, 1, [Define if we have Pango 1.4 or newer.]),:)
WEBKIT_VERSION=1.3.7
- if test "x$with_gtk" = "x3"; then
- WEBKIT_PC_MODULE="webkitgtk-3.0"
- PKG_CHECK_MODULES(WEBKIT, [$WEBKIT_PC_MODULE >= $WEBKIT_VERSION], , [
- AC_MSG_RESULT(no)
- AC_MSG_ERROR([
+ WEBKIT_PC_MODULE="webkitgtk-3.0"
+ PKG_CHECK_MODULES(WEBKIT, [$WEBKIT_PC_MODULE >= $WEBKIT_VERSION], , [
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR([
You must have WebKit for GTK+3 $WEBKIT_VERSION or newer development headers
installed to compile Pidgin. If you want to build only Finch then specify
--disable-gtkui when running configure.
])])
- else
- WEBKIT_PC_MODULE="webkit-1.0"
- PKG_CHECK_MODULES(WEBKIT, [$WEBKIT_PC_MODULE >= $WEBKIT_VERSION], , [
- AC_MSG_RESULT(no)
- AC_MSG_ERROR([
-You must have WebKit for GTK+2 $WEBKIT_VERSION or newer development headers
-installed to compile Pidgin. If you want to build only Finch then specify
---disable-gtkui when running configure.
-])])
- fi
AC_SUBST(WEBKIT_CFLAGS)
AC_SUBST(WEBKIT_LIBS)
AC_SUBST(WEBKIT_PC_MODULE)
@@ -818,29 +782,16 @@
dnl # Check for GCR for its certificate widgets
dnl #######################################################################
if test "x$enable_gcr" = "xyes"; then
- if test "x$with_gtk" = "x3"; then
- PKG_CHECK_MODULES(GCR, gcr-3, [
- AC_DEFINE(ENABLE_GCR, 1, [Define to 1 if GCR is found.])], [
- AC_MSG_RESULT(no)
- enable_gcr="no"
- if test "x$force_deps" = "xyes" ; then
- AC_MSG_ERROR([
+ PKG_CHECK_MODULES(GCR, gcr-3, [
+ AC_DEFINE(ENABLE_GCR, 1, [Define to 1 if GCR is found.])], [
+ AC_MSG_RESULT(no)
+ enable_gcr="no"
+ if test "x$force_deps" = "xyes" ; then
+ AC_MSG_ERROR([
GCR for GTK+3 development headers not found.
Use --disable-gcr if you do not need GCR certificate widgets.
])
- fi])
- else
- PKG_CHECK_MODULES(GCR, gcr-0, [
- AC_DEFINE(ENABLE_GCR, 1, [Define to 1 if GCR is found.])], [
- AC_MSG_RESULT(no)
- enable_gcr="no"
- if test "x$force_deps" = "xyes" ; then
- AC_MSG_ERROR([
-GCR for GTK+2 development headers not found.
-Use --disable-gcr if you do not need GCR certificate widgets.
-])
- fi])
- fi
+ fi])
fi
@@ -1795,7 +1746,7 @@
if test "x$enable_plugins" = "xyes" ; then
PKG_CHECK_MODULES(GPLUGIN, [gplugin >= 0.0.17 gmodule-2.0], [
dnl # GPLUGIN_REQ sets pkg-config requirements in the .pc file
- if test "x$with_gtk" != "xno" ; then
+ if test "x$enable_gtkui" != "xno" ; then
GPLUGIN_REQ=[", gplugin, gplugin-gtk"]
else
GPLUGIN_REQ=[", gplugin"]
@@ -2370,9 +2321,6 @@
echo
echo Build GTK+ UI................. : $enable_gtkui
-if test "x$enable_gtkui" = "xyes"; then
- echo Build for GTK+ version........ : $with_gtk
-fi
echo Build console UI.............. : $enable_consoleui
echo Build for X11................. : $with_x
echo
--- a/pidgin/gtkaccount.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkaccount.c Sun Dec 20 20:46:34 2015 -0800
@@ -114,11 +114,7 @@
GtkWidget *password_box;
gchar *password;
GtkWidget *username_entry;
-#if GTK_CHECK_VERSION(3,0,0)
GdkRGBA username_entry_hint_color;
-#else
- GdkColor *username_entry_hint_color;
-#endif
GtkWidget *password_entry;
GtkWidget *alias_entry;
GtkWidget *remember_pass_check;
@@ -325,11 +321,7 @@
if(!strcmp(gtk_entry_get_text(GTK_ENTRY(widget)), label)) {
gtk_entry_set_text(GTK_ENTRY(widget), "");
-#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_override_color(widget, GTK_STATE_NORMAL, NULL);
-#else
- gtk_widget_modify_text(widget, GTK_STATE_NORMAL,NULL);
-#endif
}
g_hash_table_destroy(table);
@@ -355,11 +347,7 @@
gtk_entry_set_text(GTK_ENTRY(widget), label);
/* Make sure we can hit it again */
g_signal_handlers_unblock_by_func(widget, G_CALLBACK(username_changed_cb), dialog);
-#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_override_color(widget, GTK_STATE_NORMAL, &dialog->username_entry_hint_color);
-#else
- gtk_widget_modify_text(widget, GTK_STATE_NORMAL, dialog->username_entry_hint_color);
-#endif
}
g_hash_table_destroy(table);
@@ -374,13 +362,8 @@
GHashTable *table;
const char *label, *text;
char *temp_text = NULL;
-#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *context;
GtkBorder border;
-#else
- GtkStyle *style;
- const GtkBorder *border = NULL;
-#endif
gint xsize;
table = purple_protocol_client_iface_get_account_text_table(dialog->protocol, NULL);
@@ -392,51 +375,25 @@
if (strcmp(text, label)) {
temp_text = g_strdup(text);
gtk_entry_set_text(GTK_ENTRY(widget), label);
-#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_override_color(GTK_WIDGET(widget), GTK_STATE_NORMAL, NULL);
-#else
- gtk_widget_modify_text(GTK_WIDGET(widget), GTK_STATE_NORMAL, NULL);
-#endif
}
-#if GTK_CHECK_VERSION(3,0,0)
context = gtk_widget_get_style_context(dialog->username_entry);
gtk_style_context_get_color(context, GTK_STATE_FLAG_INSENSITIVE,
&dialog->username_entry_hint_color);
-#else
- style = gtk_rc_get_style(dialog->username_entry);
- dialog->username_entry_hint_color = &(style->fg[GTK_STATE_INSENSITIVE]);
-#endif
pango_layout_get_pixel_size(gtk_entry_get_layout(GTK_ENTRY(widget)), &xsize, NULL);
-#if GTK_CHECK_VERSION(3,0,0)
gtk_style_context_get_margin(context, GTK_STATE_FLAG_NORMAL, &border);
xsize += border.left + border.right;
gtk_style_context_get_padding(context, GTK_STATE_FLAG_NORMAL, &border);
xsize += border.left + border.right;
-#else
- xsize += 2 * style->xthickness;
- gtk_style_get(style, GTK_TYPE_ENTRY, "inner-border", &border, NULL);
- if (border)
- xsize += border->left + border->right;
- else
- xsize += 4; /* 2 * default inner-border */
-#endif
gtk_widget_set_size_request(GTK_WIDGET(widget), xsize, -1);
if (temp_text) {
gtk_entry_set_text(GTK_ENTRY(widget), temp_text);
g_free(temp_text);
-#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_override_color(GTK_WIDGET(widget), GTK_STATE_NORMAL, NULL);
-#else
- gtk_widget_modify_text(GTK_WIDGET(widget), GTK_STATE_NORMAL, NULL);
-#endif
} else
-#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_override_color(GTK_WIDGET(widget), GTK_STATE_NORMAL, &dialog->username_entry_hint_color);
-#else
- gtk_widget_modify_text(GTK_WIDGET(widget), GTK_STATE_NORMAL, dialog->username_entry_hint_color);
-#endif
g_signal_handlers_unblock_by_func(widget, G_CALLBACK(username_themechange_cb), dialog);
g_signal_handlers_unblock_by_func(widget, G_CALLBACK(username_changed_cb), dialog);
@@ -548,12 +505,8 @@
static void
update_editable(PurpleConnection *gc, AccountPrefsDialog *dialog)
{
-#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *style;
GdkRGBA color;
-#else
- GtkStyle *style;
-#endif
gboolean set;
GList *l;
@@ -566,7 +519,6 @@
set = !(purple_account_is_connected(dialog->account) || purple_account_is_connecting(dialog->account));
gtk_widget_set_sensitive(dialog->protocol_menu, set);
gtk_editable_set_editable(GTK_EDITABLE(dialog->username_entry), set);
-#if GTK_CHECK_VERSION(3,0,0)
style = set ? NULL : gtk_widget_get_style_context(dialog->username_entry);
if (style) {
gtk_style_context_get_background_color(style, GTK_STATE_FLAG_INSENSITIVE, &color);
@@ -574,18 +526,12 @@
} else {
gtk_widget_override_background_color(dialog->username_entry, GTK_STATE_FLAG_NORMAL, NULL);
}
-#else
- style = set ? NULL : gtk_widget_get_style(dialog->username_entry);
- gtk_widget_modify_base(dialog->username_entry, GTK_STATE_NORMAL,
- style ? &style->base[GTK_STATE_INSENSITIVE] : NULL);
-#endif
for (l = dialog->user_split_entries ; l != NULL ; l = l->next) {
if (l->data == NULL)
continue;
if (GTK_IS_EDITABLE(l->data)) {
gtk_editable_set_editable(GTK_EDITABLE(l->data), set);
-#if GTK_CHECK_VERSION(3,0,0)
style = set ? NULL : gtk_widget_get_style_context(GTK_WIDGET(l->data));
if (style) {
gtk_style_context_get_background_color(style, GTK_STATE_FLAG_INSENSITIVE, &color);
@@ -593,11 +539,6 @@
} else {
gtk_widget_override_background_color(GTK_WIDGET(l->data), GTK_STATE_FLAG_NORMAL, NULL);
}
-#else
- style = set ? NULL : gtk_widget_get_style(GTK_WIDGET(l->data));
- gtk_widget_modify_base(GTK_WIDGET(l->data), GTK_STATE_NORMAL,
- style ? &style->base[GTK_STATE_INSENSITIVE] : NULL);
-#endif
} else {
gtk_widget_set_sensitive(GTK_WIDGET(l->data), set);
}
@@ -2574,11 +2515,7 @@
width = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/accounts/dialog/width");
height = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/accounts/dialog/height");
-#if GTK_CHECK_VERSION(3,0,0)
dialog->window = win = pidgin_create_dialog(_("Accounts"), 0, "accounts", TRUE);
-#else
- dialog->window = win = pidgin_create_dialog(_("Accounts"), PIDGIN_HIG_BORDER, "accounts", TRUE);
-#endif
gtk_window_set_default_size(GTK_WINDOW(win), width, height);
g_signal_connect(G_OBJECT(win), "delete_event",
--- a/pidgin/gtkblist.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkblist.c Sun Dec 20 20:46:34 2015 -0800
@@ -122,11 +122,6 @@
guint select_notebook_page_timeout;
-#if !GTK_CHECK_VERSION(3,0,0)
- GdkCursor *hand_cursor; /* Hand cursor */
- GdkCursor *arrow_cursor; /* Arrow cursor */
- gboolean changing_style; /* True when changing GTK+ theme style */
-#endif
} PidginBuddyListPrivate;
@@ -2943,11 +2938,7 @@
static gboolean
pidgin_blist_paint_tip(GtkWidget *widget, cairo_t *cr, gpointer null)
{
-#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *context;
-#else
- GtkStyle *style;
-#endif
int current_height, max_width;
int max_text_width;
int max_avatar_width;
@@ -2959,12 +2950,8 @@
if(gtkblist->tooltipdata == NULL)
return FALSE;
-#if GTK_CHECK_VERSION(3,0,0)
context = gtk_widget_get_style_context(gtkblist->tipwindow);
gtk_style_context_add_class(context, GTK_STYLE_CLASS_TOOLTIP);
-#else
- style = gtk_widget_get_style(gtkblist->tipwindow);
-#endif
max_text_width = 0;
max_avatar_width = 0;
@@ -2993,7 +2980,6 @@
if (td->avatar && pidgin_gdk_pixbuf_is_opaque(td->avatar))
{
-#if GTK_CHECK_VERSION(3,0,0)
gtk_style_context_save(context);
gtk_style_context_add_class(context, GTK_STYLE_CLASS_FRAME);
if (dir == GTK_TEXT_DIR_RTL) {
@@ -3007,22 +2993,6 @@
td->avatar_width + 2, td->avatar_height + 2);
}
gtk_style_context_restore(context);
-#else
- if (dir == GTK_TEXT_DIR_RTL) {
- gtk_paint_flat_box(style, gtkblist->tipwindow->window,
- GTK_STATE_NORMAL, GTK_SHADOW_OUT,
- NULL, gtkblist->tipwindow, "tooltip",
- TOOLTIP_BORDER - 1, current_height - 1,
- td->avatar_width + 2, td->avatar_height + 2);
- } else {
- gtk_paint_flat_box(style, gtkblist->tipwindow->window,
- GTK_STATE_NORMAL, GTK_SHADOW_OUT,
- NULL, gtkblist->tipwindow, "tooltip",
- max_width - (td->avatar_width + TOOLTIP_BORDER) - 1,
- current_height - 1, td->avatar_width + 2,
- td->avatar_height + 2);
- }
-#endif
}
if (td->status_icon) {
@@ -3059,7 +3029,6 @@
}
if (td->name_layout) {
-#if GTK_CHECK_VERSION(3,0,0)
if (dir == GTK_TEXT_DIR_RTL) {
gtk_render_layout(context, cr,
max_width - (TOOLTIP_BORDER + status_size + SMALL_SPACE) - PANGO_PIXELS(300000),
@@ -3069,22 +3038,9 @@
TOOLTIP_BORDER + status_size + SMALL_SPACE,
current_height, td->name_layout);
}
-#else
- if (dir == GTK_TEXT_DIR_RTL) {
- gtk_paint_layout(style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, FALSE,
- NULL, gtkblist->tipwindow, "tooltip",
- max_width -(TOOLTIP_BORDER + status_size + SMALL_SPACE) - PANGO_PIXELS(300000),
- current_height, td->name_layout);
- } else {
- gtk_paint_layout(style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, FALSE,
- NULL, gtkblist->tipwindow, "tooltip",
- TOOLTIP_BORDER + status_size + SMALL_SPACE, current_height, td->name_layout);
- }
-#endif
}
if (td->layout) {
-#if GTK_CHECK_VERSION(3,0,0)
if (dir != GTK_TEXT_DIR_RTL) {
gtk_render_layout(context, cr,
TOOLTIP_BORDER + status_size + SMALL_SPACE,
@@ -3096,20 +3052,6 @@
current_height + td->name_height,
td->layout);
}
-#else
- if (dir != GTK_TEXT_DIR_RTL) {
- gtk_paint_layout(style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, FALSE,
- NULL, gtkblist->tipwindow, "tooltip",
- TOOLTIP_BORDER + status_size + SMALL_SPACE,
- current_height + td->name_height, td->layout);
- } else {
- gtk_paint_layout(style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, FALSE,
- NULL, gtkblist->tipwindow, "tooltip",
- max_width - (TOOLTIP_BORDER + status_size + SMALL_SPACE) - PANGO_PIXELS(300000),
- current_height + td->name_height,
- td->layout);
- }
-#endif
}
current_height += MAX(td->name_height + td->height, td->avatar_height) + td->padding;
@@ -5088,24 +5030,6 @@
return FALSE;
}
-#if !GTK_CHECK_VERSION(3,0,0)
-static gboolean
-headline_box_enter_cb(GtkWidget *widget, GdkEventCrossing *event,
- PidginBuddyListPrivate *priv)
-{
- gdk_window_set_cursor(widget->window, priv->hand_cursor);
- return FALSE;
-}
-
-static gboolean
-headline_box_leave_cb(GtkWidget *widget, GdkEventCrossing *event,
- PidginBuddyListPrivate *priv)
-{
- gdk_window_set_cursor(widget->window, priv->arrow_cursor);
- return FALSE;
-}
-#endif
-
static void
reset_headline(PidginBuddyList *gtkblist)
{
@@ -5124,8 +5048,6 @@
return FALSE;
}
-#if GTK_CHECK_VERSION(3,0,0)
-
static gboolean
headline_response_cb(GtkInfoBar *infobar, int resp, PidginBuddyList *gtkblist)
{
@@ -5163,31 +5085,6 @@
return TRUE;
}
-#else
-
-static gboolean
-headline_close_press_cb(GtkButton *button, PidginBuddyList *gtkblist)
-{
- gtk_widget_hide(gtkblist->headline);
- return FALSE;
-}
-
-static gboolean
-headline_box_press_cb(GtkWidget *widget, GdkEventButton *event, PidginBuddyList *gtkblist)
-{
- gtk_widget_hide(gtkblist->headline);
- if (gtkblist->headline_callback)
- g_idle_add(headline_click_callback, NULL);
- else {
- if (gtkblist->headline_destroy)
- gtkblist->headline_destroy(gtkblist->headline_data);
- reset_headline(gtkblist);
- }
- return TRUE;
-}
-
-#endif
-
/***********************************/
/* Connection error handling stuff */
/***********************************/
@@ -5611,27 +5508,6 @@
}
}
-#if !GTK_CHECK_VERSION(3,0,0)
-static gboolean
-paint_headline_hbox (GtkWidget *widget,
- GdkEventExpose *event,
- gpointer user_data)
-{
- gtk_paint_flat_box (widget->style,
- widget->window,
- GTK_STATE_NORMAL,
- GTK_SHADOW_OUT,
- NULL,
- widget,
- "tooltip",
- widget->allocation.x + 1,
- widget->allocation.y + 1,
- widget->allocation.width - 2,
- widget->allocation.height - 2);
- return FALSE;
-}
-#endif
-
/* This assumes there are not things like groupless buddies or multi-leveled groups.
* I'm sure other things in this code assumes that also.
*/
@@ -5648,34 +5524,6 @@
}
}
-#if !GTK_CHECK_VERSION(3,0,0)
-static void
-headline_style_set (GtkWidget *widget,
- GtkStyle *prev_style)
-{
- PidginBuddyListPrivate *priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist);
- GtkStyle *style;
- GtkWidget *window;
-
- if (priv->changing_style)
- return;
-
- /* This is a hack needed to use the tooltip background colour */
- window = gtk_window_new(GTK_WINDOW_POPUP);
- gtk_widget_set_name(window, "gtk-tooltip");
- gtk_widget_ensure_style(window);
- style = gtk_widget_get_style(window);
-
- priv->changing_style = TRUE;
- gtk_widget_set_style(gtkblist->headline, style);
- priv->changing_style = FALSE;
-
- gtk_widget_destroy(window);
-
- gtk_widget_queue_draw(gtkblist->headline);
-}
-#endif
-
/******************************************/
/* End of connection error handling stuff */
/******************************************/
@@ -5905,12 +5753,8 @@
GtkTreeViewColumn *column;
GtkWidget *menu;
GtkWidget *sep;
-#if GTK_CHECK_VERSION(3,0,0)
GtkWidget *infobar;
GtkWidget *content_area;
-#else
- GtkWidget *ebox;
-#endif
GtkWidget *label;
GtkWidget *close;
char *pretty, *tmp;
@@ -5919,9 +5763,6 @@
GError *error;
GtkAccelGroup *accel_group;
GtkTreeSelection *selection;
-#if ! GTK_CHECK_VERSION(3,0,0)
- int blist_width;
-#endif
GtkTargetEntry dte[] = {{"PURPLE_BLIST_NODE", GTK_TARGET_SAME_APP, DRAG_ROW},
{"application/x-im-contact", 0, DRAG_BUDDY},
{"text/x-vcard", 0, DRAG_VCARD },
@@ -5956,11 +5797,6 @@
g_signal_connect(G_OBJECT(gtkblist->window), "focus-out-event",
G_CALLBACK(blist_focus_cb), gtkblist);
- /* TODO: how is this done in gtk+ 3.0? */
-#if !GTK_CHECK_VERSION(3,0,0)
- GTK_WINDOW(gtkblist->window)->allow_shrink = TRUE;
-#endif
-
gtkblist->main_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show(gtkblist->main_vbox);
gtk_container_add(GTK_CONTAINER(gtkblist->window), gtkblist->main_vbox);
@@ -6043,7 +5879,6 @@
pidgin_blist_select_notebook_page(gtkblist);
/****************************** Headline **********************************/
-#if GTK_CHECK_VERSION(3,0,0)
gtkblist->headline = gtk_event_box_new();
gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->headline,
@@ -6078,50 +5913,6 @@
g_signal_connect(gtkblist->headline, "button-press-event",
G_CALLBACK(headline_press_cb), infobar);
-#else
-
- ebox = gtk_event_box_new();
- gtk_box_pack_start(GTK_BOX(gtkblist->vbox), ebox, FALSE, FALSE, 0);
- gtkblist->headline = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 3);
- gtk_container_set_border_width(GTK_CONTAINER(gtkblist->headline), 6);
- gtk_container_add(GTK_CONTAINER(ebox), gtkblist->headline);
- gtkblist->headline_image = gtk_image_new_from_pixbuf(NULL);
- gtk_misc_set_alignment(GTK_MISC(gtkblist->headline_image), 0.0, 0);
- gtkblist->headline_label = gtk_label_new(NULL);
- blist_width = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/width") - 25;
- if (blist_width < -1)
- blist_width = -1;
- gtk_widget_set_size_request(gtkblist->headline_label, blist_width, -1);
- gtk_label_set_line_wrap(GTK_LABEL(gtkblist->headline_label), TRUE);
- gtk_box_pack_start(GTK_BOX(gtkblist->headline), gtkblist->headline_image, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(gtkblist->headline), gtkblist->headline_label, TRUE, TRUE, 0);
- g_signal_connect(gtkblist->headline_label, /* connecting on headline doesn't work, because
- the signal is not emitted when theme is changed */
- "style-set",
- G_CALLBACK(headline_style_set),
- NULL);
- g_signal_connect (gtkblist->headline,
- "expose_event",
- G_CALLBACK (paint_headline_hbox),
- NULL);
- gtk_widget_set_name(gtkblist->headline, "gtk-tooltips");
-
- priv->hand_cursor = gdk_cursor_new (GDK_HAND2);
- priv->arrow_cursor = gdk_cursor_new (GDK_LEFT_PTR);
-
- /* Close button. */
- 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);
- gtk_widget_set_tooltip_text(close, _("Close"));
- 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);
- g_signal_connect(G_OBJECT(ebox), "leave-notify-event", G_CALLBACK(headline_box_leave_cb), priv);
- g_signal_connect(G_OBJECT(ebox), "button-press-event", G_CALLBACK(headline_box_press_cb), gtkblist);
-
-#endif
-
/****************************** GtkTreeView **********************************/
gtkblist->treemodel = gtk_tree_store_new(BLIST_COLUMNS,
GDK_TYPE_PIXBUF, /* Status icon */
@@ -6220,9 +6011,6 @@
gtkblist->statusbox = pidgin_status_box_new();
gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtkblist->statusbox, FALSE, TRUE, 0);
gtk_widget_set_name(gtkblist->statusbox, "pidgin_blist_statusbox");
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_container_set_border_width(GTK_CONTAINER(gtkblist->statusbox), 3);
-#endif
gtk_widget_show(gtkblist->statusbox);
/* set the Show Offline Buddies option. must be done
@@ -7119,13 +6907,6 @@
priv = PIDGIN_BUDDY_LIST_GET_PRIVATE(gtkblist);
-#if !GTK_CHECK_VERSION(3,0,0)
- gdk_cursor_unref(priv->hand_cursor);
- gdk_cursor_unref(priv->arrow_cursor);
- priv->hand_cursor = NULL;
- priv->arrow_cursor = NULL;
-#endif
-
if (priv->current_theme)
g_object_unref(priv->current_theme);
if (priv->select_notebook_page_timeout)
--- a/pidgin/gtkcertmgr.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkcertmgr.c Sun Dec 20 20:46:34 2015 -0800
@@ -608,11 +608,7 @@
win = dlg->window =
pidgin_create_dialog(_("Certificate Manager"),/* Title */
-#if GTK_CHECK_VERSION(3,0,0)
0, /*Window border*/
-#else
- PIDGIN_HIG_BORDER, /*Window border*/
-#endif
"certmgr", /* Role */
TRUE); /* Allow resizing */
g_signal_connect(G_OBJECT(win), "delete_event",
--- a/pidgin/gtkconv.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkconv.c Sun Dec 20 20:46:34 2015 -0800
@@ -5198,12 +5198,8 @@
static gboolean
pidgin_conv_end_quickfind(PidginConversation *gtkconv)
{
-#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *context = gtk_widget_get_style_context(gtkconv->quickfind_entry);
gtk_style_context_remove_class(context, "not-found");
-#else
- gtk_widget_modify_base(gtkconv->quickfind_entry, GTK_STATE_NORMAL, NULL);
-#endif
webkit_web_view_unmark_text_matches(WEBKIT_WEB_VIEW(gtkconv->webview));
gtk_widget_hide(gtkconv->quickfind_container);
@@ -5219,23 +5215,11 @@
case GDK_KEY_Return:
case GDK_KEY_KP_Enter:
if (webkit_web_view_search_text(WEBKIT_WEB_VIEW(gtkconv->webview), gtk_entry_get_text(GTK_ENTRY(entry)), FALSE, TRUE, TRUE)) {
-#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *context = gtk_widget_get_style_context(gtkconv->quickfind_entry);
gtk_style_context_remove_class(context, "not-found");
-#else
- gtk_widget_modify_base(gtkconv->quickfind_entry, GTK_STATE_NORMAL, NULL);
-#endif
} else {
-#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *context = gtk_widget_get_style_context(gtkconv->quickfind_entry);
gtk_style_context_add_class(context, "not-found");
-#else
- GdkColor col;
- col.red = 0xffff;
- col.green = 0xafff;
- col.blue = 0xafff;
- gtk_widget_modify_base(gtkconv->quickfind_entry, GTK_STATE_NORMAL, &col);
-#endif
}
break;
case GDK_KEY_Escape:
@@ -5252,7 +5236,6 @@
{
GtkWidget *widget = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
GtkWidget *label, *entry, *close;
-#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *context;
GtkCssProvider *filter_css;
const gchar filter_style[] =
@@ -5262,7 +5245,6 @@
"background-image: none;"
"background-color: @error_bg_color;"
"}";
-#endif
gtk_box_pack_start(GTK_BOX(container), widget, FALSE, FALSE, 0);
@@ -5275,14 +5257,12 @@
entry = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(widget), entry, TRUE, TRUE, 0);
-#if GTK_CHECK_VERSION(3,0,0)
filter_css = gtk_css_provider_new();
gtk_css_provider_load_from_data(filter_css, filter_style, -1, NULL);
context = gtk_widget_get_style_context(entry);
gtk_style_context_add_provider(context,
GTK_STYLE_PROVIDER(filter_css),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-#endif
gtkconv->quickfind_entry = entry;
gtkconv->quickfind_container = widget;
@@ -8918,43 +8898,6 @@
default_conv_theme = purple_theme_manager_load_theme(theme_dir, "conversation");
g_free(theme_dir);
-#if !GTK_CHECK_VERSION(3,0,0)
- {
- /* Set default tab colors */
- GString *str = g_string_new(NULL);
- GtkSettings *settings = gtk_settings_get_default();
- GtkStyle *parent = gtk_rc_get_style_by_paths(settings, "tab-container.tab-label*", NULL, G_TYPE_NONE), *now;
- struct {
- const char *stylename;
- const char *labelname;
- const char *color;
- } styles[] = {
- {"pidgin_tab_label_typing_default", "tab-label-typing", "#4e9a06"},
- {"pidgin_tab_label_typed_default", "tab-label-typed", "#c4a000"},
- {"pidgin_tab_label_attention_default", "tab-label-attention", "#006aff"},
- {"pidgin_tab_label_unreadchat_default", "tab-label-unreadchat", "#cc0000"},
- {"pidgin_tab_label_event_default", "tab-label-event", "#888a85"},
- {NULL, NULL, NULL}
- };
- int iter;
- for (iter = 0; styles[iter].stylename; iter++) {
- now = gtk_rc_get_style_by_paths(settings, styles[iter].labelname, NULL, G_TYPE_NONE);
- if (parent == now ||
- (parent && now && parent->rc_style == now->rc_style)) {
- g_string_append_printf(str, "style \"%s\" {\n"
- "fg[ACTIVE] = \"%s\"\n"
- "}\n"
- "widget \"*%s\" style \"%s\"\n",
- styles[iter].stylename,
- styles[iter].color,
- styles[iter].labelname, styles[iter].stylename);
- }
- }
- gtk_rc_parse_string(str->str);
- g_string_free(str, TRUE);
- gtk_rc_reset_styles(settings);
- }
-#endif
}
static void
@@ -9242,9 +9185,7 @@
notebook_init_grab(PidginConvWindow *gtkwin, GtkWidget *widget, GdkEvent *event)
{
static GdkCursor *cursor = NULL;
-#if GTK_CHECK_VERSION(3,0,0)
GdkDevice *device;
-#endif
gtkwin->in_drag = TRUE;
@@ -9259,23 +9200,12 @@
/* Grab the pointer */
gtk_grab_add(gtkwin->notebook);
-#if GTK_CHECK_VERSION(3,0,0)
device = gdk_event_get_device(event);
if (!gdk_display_device_is_grabbed(gdk_device_get_display(device), device))
gdk_device_grab(device, gtk_widget_get_window(gtkwin->notebook),
GDK_OWNERSHIP_WINDOW, FALSE,
GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
cursor, gdk_event_get_time(event));
-#else
-#ifndef _WIN32
- /* Currently for win32 GTK+ (as of 2.2.1), gdk_pointer_is_grabbed will
- always be true after a button press. */
- if (!gdk_pointer_is_grabbed())
-#endif
- gdk_pointer_grab(gtk_widget_get_window(gtkwin->notebook), FALSE,
- GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
- NULL, cursor, gdk_event_get_time(event));
-#endif
}
static gboolean
@@ -9541,9 +9471,7 @@
gint dest_page_num = 0;
gboolean new_window = FALSE;
gboolean to_right = FALSE;
-#if GTK_CHECK_VERSION(3,0,0)
GdkDevice *device;
-#endif
/*
* Don't check to make sure that the event's window matches the
@@ -9553,18 +9481,11 @@
if (e->button != 1 && e->type != GDK_BUTTON_RELEASE)
return FALSE;
-#if GTK_CHECK_VERSION(3,0,0)
device = gdk_event_get_device((GdkEvent *)e);
if (gdk_display_device_is_grabbed(gdk_device_get_display(device), device)) {
gdk_device_ungrab(device, gdk_event_get_time((GdkEvent *)e));
gtk_grab_remove(widget);
}
-#else
- if (gdk_pointer_is_grabbed()) {
- gdk_pointer_ungrab(gdk_event_get_time((GdkEvent *)e));
- gtk_grab_remove(widget);
- }
-#endif
if (!win->in_predrag && !win->in_drag)
return FALSE;
@@ -10367,7 +10288,6 @@
return FALSE;
}
-#if GTK_CHECK_VERSION(3,0,0)
static void
set_default_tab_colors(GtkWidget *widget)
{
@@ -10411,7 +10331,6 @@
g_error_free(error);
g_string_free(str, TRUE);
}
-#endif
void
pidgin_conv_window_add_gtkconv(PidginConvWindow *win, PidginConversation *gtkconv)
@@ -10448,9 +10367,7 @@
/* Tab label. */
gtkconv->tab_label = gtk_label_new(tmp_lab = purple_conversation_get_title(conv));
-#if GTK_CHECK_VERSION(3,0,0)
set_default_tab_colors(gtkconv->tab_label);
-#endif
gtk_widget_set_name(gtkconv->tab_label, "tab-label");
gtkconv->menu_tabby = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, PIDGIN_HIG_BOX_SPACE);
@@ -10671,12 +10588,8 @@
GList *l;
int x, y;
-#if GTK_CHECK_VERSION(3,0,0)
gdkwin = gdk_device_get_window_at_position(gdk_event_get_device(event),
&x, &y);
-#else
- gdkwin = gdk_window_at_pointer(&x, &y);
-#endif
if (gdkwin)
gdkwin = gdk_window_get_toplevel(gdkwin);
--- a/pidgin/gtkdebug.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkdebug.c Sun Dec 20 20:46:34 2015 -0800
@@ -148,18 +148,13 @@
*****************************************************************************/
static void
regex_clear_color(GtkWidget *w) {
-#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *context = gtk_widget_get_style_context(w);
gtk_style_context_remove_class(context, "good-filter");
gtk_style_context_remove_class(context, "bad-filter");
-#else
- gtk_widget_modify_base(w, GTK_STATE_NORMAL, NULL);
-#endif
}
static void
regex_change_color(GtkWidget *w, gboolean success) {
-#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *context = gtk_widget_get_style_context(w);
if (success) {
@@ -169,21 +164,6 @@
gtk_style_context_add_class(context, "bad-filter");
gtk_style_context_remove_class(context, "good-filter");
}
-#else
- GdkColor color;
-
- if (success) {
- color.red = 0xAFFF;
- color.green = 0xFFFF;
- color.blue = 0xAFFF;
- } else {
- color.red = 0xFFFF;
- color.green = 0xAFFF;
- color.blue = 0xAFFF;
- }
-
- gtk_widget_modify_base(w, GTK_STATE_NORMAL, &color);
-#endif
}
static void
@@ -438,7 +418,6 @@
gint width, height;
void *handle;
GtkToolItem *item;
-#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *context;
GtkCssProvider *filter_css;
const gchar filter_style[] =
@@ -454,7 +433,6 @@
"background-image: none;"
"background-color: @success_color;"
"}";
-#endif
win = g_new0(DebugWindow, 1);
@@ -548,14 +526,12 @@
gtk_container_add(GTK_CONTAINER(item), GTK_WIDGET(win->expression));
gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item));
-#if GTK_CHECK_VERSION(3,0,0)
filter_css = gtk_css_provider_new();
gtk_css_provider_load_from_data(filter_css, filter_style, -1, NULL);
context = gtk_widget_get_style_context(win->expression);
gtk_style_context_add_provider(context,
GTK_STYLE_PROVIDER(filter_css),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-#endif
/* this needs to be before the text is set from the pref if we want it
* to colorize a stored expression.
--- a/pidgin/gtkdialogs.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkdialogs.c Sun Dec 20 20:46:34 2015 -0800
@@ -467,13 +467,8 @@
AtkObject *obj;
char *filename, *tmp;
-#if GTK_CHECK_VERSION(3,0,0)
win = pidgin_create_dialog(title, 0, role, TRUE);
vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(win), FALSE, 0);
-#else
- win = pidgin_create_dialog(title, PIDGIN_HIG_BORDER, role, TRUE);
- vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(win), FALSE, PIDGIN_HIG_BORDER);
-#endif
gtk_window_set_default_size(GTK_WINDOW(win), 475, 450);
/* Generate a logo with a version number */
--- a/pidgin/gtkdnd-hints.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkdnd-hints.c Sun Dec 20 20:46:34 2015 -0800
@@ -48,8 +48,6 @@
{ NULL, NULL, 0, 0 }
};
-#if GTK_CHECK_VERSION(3,0,0)
-
static void
dnd_hints_realized_cb(GtkWidget *window, GtkWidget *pix)
{
@@ -99,41 +97,6 @@
return win;
}
-#else
-
-static GtkWidget *
-dnd_hints_init_window(const gchar *fname)
-{
- GdkPixbuf *pixbuf;
- GdkPixmap *pixmap;
- GdkBitmap *bitmap;
- GtkWidget *pix;
- GtkWidget *win;
- GdkColormap *colormap;
-
- pixbuf = gdk_pixbuf_new_from_file(fname, NULL);
- g_return_val_if_fail(pixbuf, NULL);
-
- win = gtk_window_new(GTK_WINDOW_POPUP);
- colormap = gtk_widget_get_colormap(win);
- gdk_pixbuf_render_pixmap_and_mask_for_colormap(pixbuf, colormap,
- &pixmap, &bitmap, 128);
- g_object_unref(G_OBJECT(pixbuf));
-
- pix = gtk_image_new_from_pixmap(pixmap, bitmap);
- gtk_container_add(GTK_CONTAINER(win), pix);
- gtk_widget_shape_combine_mask(win, bitmap, 0, 0);
-
- g_object_unref(G_OBJECT(pixmap));
- g_object_unref(G_OBJECT(bitmap));
-
- gtk_widget_show_all(pix);
-
- return win;
-}
-
-#endif
-
static void
get_widget_coords(GtkWidget *w, gint *x1, gint *y1, gint *x2, gint *y2)
{
--- a/pidgin/gtkdocklet.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkdocklet.c Sun Dec 20 20:46:34 2015 -0800
@@ -107,18 +107,6 @@
if (icon_name) {
gtk_status_icon_set_from_icon_name(docklet, icon_name);
}
-
-#if !GTK_CHECK_VERSION(3,0,0)
- if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/docklet/blink")) {
- gboolean pending = FALSE;
- pending |= (newflag & PIDGIN_DOCKLET_EMAIL_PENDING);
- pending |= (newflag & PIDGIN_DOCKLET_CONV_PENDING);
- gtk_status_icon_set_blinking(docklet, pending &&
- !(newflag & PIDGIN_DOCKLET_CONNECTING));
- } else if (gtk_status_icon_get_blinking(docklet)) {
- gtk_status_icon_set_blinking(docklet, FALSE);
- }
-#endif
}
static GList *
@@ -341,15 +329,6 @@
gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(toggle)));
}
-#if !GTK_CHECK_VERSION(3,0,0)
-static void
-docklet_toggle_blink(GtkWidget *toggle, void *data)
-{
- purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/docklet/blink",
- gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(toggle)));
-}
-#endif
-
static void
docklet_toggle_blist(GtkWidget *toggle, void *data)
{
@@ -761,13 +740,6 @@
g_signal_connect(G_OBJECT(menuitem), "toggled", G_CALLBACK(docklet_toggle_mute), NULL);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
-#if !GTK_CHECK_VERSION(3,0,0)
- menuitem = gtk_check_menu_item_new_with_mnemonic(_("_Blink on New Message"));
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/docklet/blink"));
- g_signal_connect(G_OBJECT(menuitem), "toggled", G_CALLBACK(docklet_toggle_blink), NULL);
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
-#endif
-
pidgin_separator(menu);
/* add plugin actions */
--- a/pidgin/gtkmedia.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkmedia.c Sun Dec 20 20:46:34 2015 -0800
@@ -922,11 +922,7 @@
PidginMediaRealizeData *data;
GtkWidget *aspect;
GtkWidget *remote_video;
-#if GTK_CHECK_VERSION(3,0,0)
GdkRGBA color = {0.0, 0.0, 0.0, 1.0};
-#else
- GdkColor color = {0, 0, 0, 0};
-#endif
aspect = gtk_aspect_frame_new(NULL, 0, 0, 4.0/3.0, FALSE);
gtk_frame_set_shadow_type(GTK_FRAME(aspect), GTK_SHADOW_IN);
@@ -938,11 +934,7 @@
data->participant = g_strdup(gtkmedia->priv->screenname);
remote_video = gtk_drawing_area_new();
-#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_override_background_color(remote_video, GTK_STATE_FLAG_NORMAL, &color);
-#else
- gtk_widget_modify_bg(remote_video, GTK_STATE_NORMAL, &color);
-#endif
g_signal_connect(G_OBJECT(remote_video), "realize",
G_CALLBACK(realize_cb), data);
gtk_container_add(GTK_CONTAINER(aspect), remote_video);
@@ -961,11 +953,7 @@
PidginMediaRealizeData *data;
GtkWidget *aspect;
GtkWidget *local_video;
-#if GTK_CHECK_VERSION(3,0,0)
GdkRGBA color = {0.0, 0.0, 0.0, 1.0};
-#else
- GdkColor color = {0, 0, 0, 0};
-#endif
aspect = gtk_aspect_frame_new(NULL, 0, 0, 4.0/3.0, TRUE);
gtk_frame_set_shadow_type(GTK_FRAME(aspect), GTK_SHADOW_IN);
@@ -977,11 +965,7 @@
data->participant = NULL;
local_video = gtk_drawing_area_new();
-#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_override_background_color(local_video, GTK_STATE_FLAG_NORMAL, &color);
-#else
- gtk_widget_modify_bg(local_video, GTK_STATE_NORMAL, &color);
-#endif
g_signal_connect(G_OBJECT(local_video), "realize",
G_CALLBACK(realize_cb), data);
gtk_container_add(GTK_CONTAINER(aspect), local_video);
--- a/pidgin/gtkmenutray.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkmenutray.c Sun Dec 20 20:46:34 2015 -0800
@@ -45,7 +45,6 @@
/******************************************************************************
* Item Stuff
*****************************************************************************/
-#if GTK_CHECK_VERSION(3,0,0)
static void
pidgin_menu_tray_select(GtkMenuItem *widget) {
/* this may look like nothing, but it's really overriding the
@@ -60,21 +59,6 @@
* overridding the select, so it makes sense to override deselect as well.
*/
}
-#else
-static void
-pidgin_menu_tray_select(GtkItem *widget) {
- /* this may look like nothing, but it's really overriding the
- * GtkMenuItem's select function so that it doesn't get highlighted like
- * a normal menu item would.
- */
-}
-static void
-pidgin_menu_tray_deselect(GtkItem *widget) {
- /* Probably not necessary, but I'd rather be safe than sorry. We're
- * overridding the select, so it makes sense to override deselect as well.
- */
-}
-#endif
/******************************************************************************
* Object Stuff
@@ -125,11 +109,7 @@
static void
pidgin_menu_tray_class_init(PidginMenuTrayClass *klass) {
GObjectClass *object_class = G_OBJECT_CLASS(klass);
-#if GTK_CHECK_VERSION(3,0,0)
GtkMenuItemClass *menu_item_class = GTK_MENU_ITEM_CLASS(klass);
-#else
- GtkItemClass *menu_item_class = GTK_ITEM_CLASS(klass);
-#endif
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
GParamSpec *pspec;
--- a/pidgin/gtknotify.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtknotify.c Sun Dec 20 20:46:34 2015 -0800
@@ -888,9 +888,6 @@
window = gtk_dialog_new();
gtk_window_set_title(GTK_WINDOW(window), title);
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_container_set_border_width(GTK_CONTAINER(window), PIDGIN_HIG_BORDER);
-#endif
gtk_window_set_resizable(GTK_WINDOW(window), TRUE);
g_signal_connect(G_OBJECT(window), "delete_event",
--- a/pidgin/gtkplugin.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkplugin.c Sun Dec 20 20:46:34 2015 -0800
@@ -808,15 +808,9 @@
pidgin_plugins_paint_tooltip(GtkWidget *tipwindow, cairo_t *cr, gpointer data)
{
PangoLayout *layout = g_object_get_data(G_OBJECT(tipwindow), "tooltip-plugin");
-#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *context = gtk_widget_get_style_context(tipwindow);
gtk_style_context_add_class(context, GTK_STYLE_CLASS_TOOLTIP);
gtk_render_layout(context, cr, 6, 6, layout);
-#else
- gtk_paint_layout(tipwindow->style, tipwindow->window, GTK_STATE_NORMAL, FALSE,
- NULL, tipwindow, "tooltip",
- 6, 6, layout);
-#endif
return TRUE;
}
--- a/pidgin/gtkpluginpref.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkpluginpref.c Sun Dec 20 20:46:34 2015 -0800
@@ -203,9 +203,6 @@
sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
parent = ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, 16);
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER);
-#endif
gtk_widget_show(ret);
for(pp = purple_plugin_pref_frame_get_prefs(frame);
--- a/pidgin/gtkpounce.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkpounce.c Sun Dec 20 20:46:34 2015 -0800
@@ -545,9 +545,6 @@
dialog->window = window = gtk_dialog_new();
gtk_window_set_title(GTK_WINDOW(window), (cur_pounce == NULL ? _("Add Buddy Pounce") : _("Modify Buddy Pounce")));
gtk_window_set_role(GTK_WINDOW(window), "buddy_pounce");
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_container_set_border_width(GTK_CONTAINER(dialog->window), PIDGIN_HIG_BORDER);
-#endif
g_signal_connect(G_OBJECT(window), "delete_event",
G_CALLBACK(delete_win_cb), dialog);
@@ -1343,11 +1340,8 @@
width = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/pounces/dialog/width");
height = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/pounces/dialog/height");
-#if GTK_CHECK_VERSION(3,0,0)
dialog->window = win = pidgin_create_dialog(_("Buddy Pounces"), 0, "pounces", TRUE);
-#else
- dialog->window = win = pidgin_create_dialog(_("Buddy Pounces"), PIDGIN_HIG_BORDER, "pounces", TRUE);
-#endif
+
gtk_window_set_default_size(GTK_WINDOW(win), width, height);
g_signal_connect(G_OBJECT(win), "delete_event",
--- a/pidgin/gtkprefs.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkprefs.c Sun Dec 20 20:46:34 2015 -0800
@@ -1983,7 +1983,6 @@
static void
network_ip_changed(GtkEntry *entry, gpointer data)
{
-#if GTK_CHECK_VERSION(3,0,0)
const gchar *text = gtk_entry_get_text(entry);
GtkStyleContext *context = gtk_widget_get_style_context(GTK_WIDGET(entry));
@@ -2002,30 +2001,6 @@
gtk_style_context_remove_class(context, "bad-ip");
gtk_style_context_remove_class(context, "good-ip");
}
-#else
- const gchar *text = gtk_entry_get_text(entry);
- GdkColor color;
-
- if (text && *text) {
- if (purple_ip_address_is_valid(text)) {
- color.red = 0xAFFF;
- color.green = 0xFFFF;
- color.blue = 0xAFFF;
-
- purple_network_set_public_ip(text);
- } else {
- color.red = 0xFFFF;
- color.green = 0xAFFF;
- color.blue = 0xAFFF;
- }
-
- gtk_widget_modify_base(GTK_WIDGET(entry), GTK_STATE_NORMAL, &color);
-
- } else {
- purple_network_set_public_ip("");
- gtk_widget_modify_base(GTK_WIDGET(entry), GTK_STATE_NORMAL, NULL);
- }
-#endif
}
static gboolean
@@ -2148,7 +2123,6 @@
GtkWidget *vbox, *hbox, *entry;
GtkWidget *label, *auto_ip_checkbox, *ports_checkbox, *spin_button;
GtkSizeGroup *sg;
-#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *context;
GtkCssProvider *ip_css;
const gchar ip_style[] =
@@ -2164,7 +2138,6 @@
"background-image: none;"
"background-color: @success_color;"
"}";
-#endif
ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, PIDGIN_HIG_CAT_SPACE);
gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER);
@@ -2206,14 +2179,12 @@
g_signal_connect(G_OBJECT(entry), "changed",
G_CALLBACK(network_ip_changed), NULL);
-#if GTK_CHECK_VERSION(3,0,0)
ip_css = gtk_css_provider_new();
gtk_css_provider_load_from_data(ip_css, ip_style, -1, NULL);
context = gtk_widget_get_style_context(entry);
gtk_style_context_add_provider(context,
GTK_STYLE_PROVIDER(ip_css),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-#endif
hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Public _IP:"),
sg, entry, TRUE, NULL);
@@ -3904,19 +3875,11 @@
{
GtkWidget *test;
GtkWidget *video;
-#if GTK_CHECK_VERSION(3,0,0)
GdkRGBA color = {0.0, 0.0, 0.0, 1.0};
-#else
- GdkColor color = {0, 0, 0, 0};
-#endif
video_drawing_area = video = gtk_drawing_area_new();
gtk_box_pack_start(GTK_BOX(vbox), video, TRUE, TRUE, 0);
-#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_override_background_color(video, GTK_STATE_FLAG_NORMAL, &color);
-#else
- gtk_widget_modify_bg(video, GTK_STATE_NORMAL, &color);
-#endif
gtk_widget_set_size_request(GTK_WIDGET(video), 240, 180);
test = gtk_toggle_button_new_with_label(_("Test Video"));
@@ -4101,11 +4064,7 @@
/* Back to instant-apply! I win! BU-HAHAHA! */
/* Create the window */
-#if GTK_CHECK_VERSION(3,0,0)
prefs = pidgin_create_dialog(_("Preferences"), 0, "preferences", FALSE);
-#else
- prefs = pidgin_create_dialog(_("Preferences"), PIDGIN_HIG_BORDER, "preferences", FALSE);
-#endif
g_signal_connect(G_OBJECT(prefs), "destroy",
G_CALLBACK(delete_prefs), NULL);
--- a/pidgin/gtkrequest.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkrequest.c Sun Dec 20 20:46:34 2015 -0800
@@ -37,9 +37,6 @@
#ifdef ENABLE_GCR
#define GCR_API_SUBJECT_TO_CHANGE
#include <gcr/gcr.h>
-#if !GTK_CHECK_VERSION(3,0,0)
-#include <gcr/gcr-simple-certificate.h>
-#endif
#endif
#include "gtk3compat.h"
--- a/pidgin/gtkroomlist.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkroomlist.c Sun Dec 20 20:46:34 2015 -0800
@@ -355,23 +355,16 @@
int current_height, max_width;
int max_text_width;
GtkTextDirection dir = gtk_widget_get_direction(GTK_WIDGET(grl->tree));
-#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *context;
context = gtk_widget_get_style_context(grl->tipwindow);
gtk_style_context_add_class(context, GTK_STYLE_CLASS_TOOLTIP);
-#else
- GtkStyle *style;
-
- style = gtk_widget_get_style(grl->tipwindow);
-#endif
max_text_width = MAX(grl->tip_width, grl->tip_name_width);
max_width = TOOLTIP_BORDER + SMALL_SPACE + max_text_width + TOOLTIP_BORDER;
current_height = 12;
-#if GTK_CHECK_VERSION(3,0,0)
if (dir == GTK_TEXT_DIR_RTL) {
gtk_render_layout(context, cr,
max_width - (TOOLTIP_BORDER + SMALL_SPACE) - PANGO_PIXELS(600000),
@@ -394,34 +387,6 @@
current_height + grl->tip_name_height,
grl->tip_layout);
}
-#else
- if (dir == GTK_TEXT_DIR_RTL) {
- gtk_paint_layout(style, grl->tipwindow->window, GTK_STATE_NORMAL, FALSE,
- NULL, grl->tipwindow, "tooltip",
- max_width - (TOOLTIP_BORDER + SMALL_SPACE) - PANGO_PIXELS(600000),
- current_height,
- grl->tip_name_layout);
- } else {
- gtk_paint_layout(style, grl->tipwindow->window, GTK_STATE_NORMAL, FALSE,
- NULL, grl->tipwindow, "tooltip",
- TOOLTIP_BORDER + SMALL_SPACE,
- current_height,
- grl->tip_name_layout);
- }
- if (dir != GTK_TEXT_DIR_RTL) {
- gtk_paint_layout(style, grl->tipwindow->window, GTK_STATE_NORMAL, FALSE,
- NULL, grl->tipwindow, "tooltip",
- TOOLTIP_BORDER + SMALL_SPACE,
- current_height + grl->tip_name_height,
- grl->tip_layout);
- } else {
- gtk_paint_layout(style, grl->tipwindow->window, GTK_STATE_NORMAL, FALSE,
- NULL, grl->tipwindow, "tooltip",
- max_width - (TOOLTIP_BORDER + SMALL_SPACE) - PANGO_PIXELS(600000),
- current_height + grl->tip_name_height,
- grl->tip_layout);
- }
-#endif
return FALSE;
}
@@ -567,11 +532,7 @@
dialog->account = account;
/* Create the window. */
-#if GTK_CHECK_VERSION(3,0,0)
dialog->window = window = pidgin_create_dialog(_("Room List"), 0, "room list", TRUE);
-#else
- dialog->window = window = pidgin_create_dialog(_("Room List"), PIDGIN_HIG_BORDER, "room list", TRUE);
-#endif
g_signal_connect(G_OBJECT(window), "delete_event",
G_CALLBACK(delete_win_cb), dialog);
--- a/pidgin/gtksmiley-manager.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtksmiley-manager.c Sun Dec 20 20:46:34 2015 -0800
@@ -339,47 +339,26 @@
g_object_ref(smiley);
}
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_container_set_border_width(
- GTK_CONTAINER(edit_dialog->window), PIDGIN_HIG_BORDER);
-#endif
/* The vbox */
-#if GTK_CHECK_VERSION(3,0,0)
vbox = gtk_grid_new();
gtk_grid_set_row_spacing(GTK_GRID(vbox), PIDGIN_HIG_BORDER);
-#else
- vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER);
-#endif
gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(
edit_dialog->window)), vbox);
gtk_widget_show(vbox);
/* The hbox */
-#if GTK_CHECK_VERSION(3,0,0)
hbox = gtk_grid_new();
gtk_grid_set_column_spacing(GTK_GRID(hbox), PIDGIN_HIG_BORDER);
gtk_grid_attach(GTK_GRID(vbox), hbox, 0, 0, 1, 1);
-#else
- hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER);
- gtk_container_add(GTK_CONTAINER(GTK_VBOX(vbox)), hbox);
-#endif
label = GTK_LABEL(gtk_label_new_with_mnemonic(_("_Image:")));
-#if GTK_CHECK_VERSION(3,0,0)
gtk_grid_attach(GTK_GRID(hbox), GTK_WIDGET(label), 0, 0, 1, 1);
-#else
- gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(label), FALSE, FALSE, 0);
-#endif
gtk_widget_show(GTK_WIDGET(label));
filech = GTK_BUTTON(gtk_button_new());
-#if GTK_CHECK_VERSION(3,0,0)
gtk_grid_attach_next_to(GTK_GRID(hbox), GTK_WIDGET(filech), NULL,
GTK_POS_RIGHT, 1, 1);
-#else
- gtk_box_pack_end(GTK_BOX(hbox), GTK_WIDGET(filech), FALSE, FALSE, 0);
-#endif
pidgin_set_accessible_label(GTK_WIDGET(filech), label);
edit_dialog->thumbnail = GTK_IMAGE(gtk_image_new());
@@ -389,37 +368,23 @@
gtk_widget_show_all(hbox);
/* info */
-#if GTK_CHECK_VERSION(3,0,0)
hbox = gtk_grid_new();
gtk_grid_set_column_spacing(GTK_GRID(hbox), PIDGIN_HIG_BORDER);
gtk_grid_attach_next_to(GTK_GRID(vbox), hbox, NULL,
GTK_POS_BOTTOM, 1, 1);
-#else
- hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER);
- gtk_container_add(GTK_CONTAINER(GTK_VBOX(vbox)), hbox);
-#endif
/* Shortcut text */
label = GTK_LABEL(gtk_label_new_with_mnemonic(_("S_hortcut text:")));
-#if GTK_CHECK_VERSION(3,0,0)
gtk_grid_attach(GTK_GRID(hbox), GTK_WIDGET(label), 0, 0, 1, 1);
-#else
- gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(label), FALSE, FALSE, 0);
-#endif
gtk_widget_show(GTK_WIDGET(label));
edit_dialog->shortcut = GTK_ENTRY(gtk_entry_new());
gtk_entry_set_activates_default(edit_dialog->shortcut, TRUE);
pidgin_set_accessible_label(GTK_WIDGET(edit_dialog->shortcut), label);
-#if GTK_CHECK_VERSION(3,0,0)
gtk_grid_attach_next_to(GTK_GRID(hbox),
GTK_WIDGET(edit_dialog->shortcut), NULL, GTK_POS_RIGHT, 1, 1);
-#else
- gtk_box_pack_end(GTK_BOX(hbox), GTK_WIDGET(edit_dialog->shortcut),
- FALSE, FALSE, 0);
-#endif
gtk_widget_show(GTK_WIDGET(edit_dialog->shortcut));
gtk_widget_show(hbox);
@@ -810,9 +775,6 @@
gtk_window_set_default_size(GTK_WINDOW(win), 50, 400);
gtk_window_set_role(GTK_WINDOW(win), "custom_smiley_manager");
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_container_set_border_width(GTK_CONTAINER(win), PIDGIN_HIG_BORDER);
-#endif
gtk_dialog_set_response_sensitive(win, GTK_RESPONSE_NO, FALSE);
gtk_dialog_set_response_sensitive(win, PIDGIN_RESPONSE_MODIFY, FALSE);
--- a/pidgin/gtkstatusbox.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkstatusbox.c Sun Dec 20 20:46:34 2015 -0800
@@ -71,14 +71,9 @@
static void status_menu_refresh_iter(PidginStatusBox *status_box, gboolean status_changed);
static void pidgin_status_box_regenerate(PidginStatusBox *status_box, gboolean status_changed);
static void pidgin_status_box_changed(PidginStatusBox *box);
-#if GTK_CHECK_VERSION(3,0,0)
static void pidgin_status_box_get_preferred_height (GtkWidget *widget,
gint *minimum_height, gint *natural_height);
static gboolean pidgin_status_box_draw (GtkWidget *widget, cairo_t *cr);
-#else
-static void pidgin_status_box_size_request (GtkWidget *widget, GtkRequisition *requisition);
-static gboolean pidgin_status_box_expose_event (GtkWidget *widget, GdkEventExpose *event);
-#endif
static void pidgin_status_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation);
static void pidgin_status_box_redisplay_buddy_icon(PidginStatusBox *status_box);
static void pidgin_status_box_forall (GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data);
@@ -451,13 +446,8 @@
gtk_widget_destroy(statusbox->icon_box);
-#if GTK_CHECK_VERSION(3,0,0)
g_object_unref(statusbox->hand_cursor);
g_object_unref(statusbox->arrow_cursor);
-#else
- gdk_cursor_unref(statusbox->hand_cursor);
- gdk_cursor_unref(statusbox->arrow_cursor);
-#endif
if (statusbox->buddy_icon_img)
g_object_unref(statusbox->buddy_icon_img);
@@ -566,13 +556,8 @@
parent_class = g_type_class_peek_parent(klass);
widget_class = (GtkWidgetClass*)klass;
-#if GTK_CHECK_VERSION(3,0,0)
widget_class->get_preferred_height = pidgin_status_box_get_preferred_height;
widget_class->draw = pidgin_status_box_draw;
-#else
- widget_class->size_request = pidgin_status_box_size_request;
- widget_class->expose_event = pidgin_status_box_expose_event;
-#endif
widget_class->size_allocate = pidgin_status_box_size_allocate;
container_class->child_type = pidgin_status_box_child_type;
@@ -1325,7 +1310,6 @@
popup_grab_on_window(GdkWindow *window, GdkEvent *event)
{
guint32 activate_time = gdk_event_get_time(event);
-#if GTK_CHECK_VERSION(3,0,0)
GdkDevice *device = gdk_event_get_device(event);
GdkGrabStatus status;
@@ -1346,23 +1330,6 @@
}
return FALSE;
-#else
- if ((gdk_pointer_grab(window, TRUE,
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_POINTER_MOTION_MASK,
- NULL, NULL, activate_time) == 0))
- {
- if (gdk_keyboard_grab(window, TRUE, activate_time) == 0)
- return TRUE;
- else {
- gdk_display_pointer_ungrab(gdk_window_get_display(window),
- activate_time);
- return FALSE;
- }
- }
-
- return FALSE;
-#endif
}
@@ -1396,22 +1363,15 @@
pidgin_status_box_popdown(PidginStatusBox *box, GdkEvent *event)
{
guint32 time;
-#if GTK_CHECK_VERSION(3,0,0)
GdkDevice *device;
-#endif
gtk_widget_hide(box->popup_window);
box->popup_in_progress = FALSE;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(box->toggle_button), FALSE);
gtk_grab_remove(box->popup_window);
time = gdk_event_get_time(event);
-#if GTK_CHECK_VERSION(3,0,0)
device = gdk_event_get_device(event);
gdk_device_ungrab(device, time);
gdk_device_ungrab(gdk_device_get_associated_device(device), time);
-#else
- gdk_pointer_ungrab(time);
- gdk_keyboard_ungrab(time);
-#endif
}
static gboolean
@@ -1911,7 +1871,6 @@
}
-#if GTK_CHECK_VERSION(3,0,0)
static void
pidgin_status_box_get_preferred_height(GtkWidget *widget, gint *minimum_height,
gint *natural_height)
@@ -1937,30 +1896,6 @@
*natural_height += box_nat_height + border_width * 2;
}
}
-#else
-static void
-pidgin_status_box_size_request(GtkWidget *widget,
- GtkRequisition *requisition)
-{
- GtkRequisition box_req;
- gint border_width = GTK_CONTAINER (widget)->border_width;
-
- gtk_widget_size_request(PIDGIN_STATUS_BOX(widget)->toggle_button, requisition);
-
- /* Make this icon the same size as other buddy icons in the list; unless it already wants to be bigger */
- requisition->height = MAX(requisition->height, 34);
- requisition->height += border_width * 2;
-
- /* If the gtkwebview is visible, then add some additional padding */
- if (PIDGIN_STATUS_BOX(widget)->webview_visible) {
- gtk_widget_size_request(PIDGIN_STATUS_BOX(widget)->vbox, &box_req);
- if (box_req.height > 1)
- requisition->height += box_req.height + border_width * 2;
- }
-
- requisition->width = 1;
-}
-#endif
/* From gnome-panel */
static void
@@ -2051,7 +1986,6 @@
gtk_widget_set_allocation(GTK_WIDGET(status_box), allocation);
}
-#if GTK_CHECK_VERSION(3,0,0)
static gboolean
pidgin_status_box_draw(GtkWidget *widget, cairo_t *cr)
{
@@ -2069,22 +2003,6 @@
}
return FALSE;
}
-#else
-static gboolean
-pidgin_status_box_expose_event(GtkWidget *widget,
- GdkEventExpose *event)
-{
- PidginStatusBox *status_box = PIDGIN_STATUS_BOX(widget);
- gtk_container_propagate_expose(GTK_CONTAINER(widget), status_box->vbox, event);
- gtk_container_propagate_expose(GTK_CONTAINER(widget), status_box->toggle_button, event);
- if (status_box->icon_box && status_box->icon_opaque) {
- gtk_paint_box(widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL,
- status_box->icon_box, "button", status_box->icon_box->allocation.x-1, status_box->icon_box->allocation.y-1,
- 34, 34);
- }
- return FALSE;
-}
-#endif
static void
pidgin_status_box_forall(GtkContainer *container,
--- a/pidgin/gtkutils.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkutils.c Sun Dec 20 20:46:34 2015 -0800
@@ -210,11 +210,6 @@
/* don't allow focus on the close button */
gtk_button_set_focus_on_click(GTK_BUTTON(button), FALSE);
- /* set style to make it as small as possible */
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_widget_set_name(button, "pidgin-small-close-button");
-#endif
-
gtk_widget_show(image);
gtk_container_add(GTK_CONTAINER(button), image);
@@ -2116,11 +2111,7 @@
cursor = gdk_cursor_new(cursor_type);
gdk_window_set_cursor(gtk_widget_get_window(widget), cursor);
-#if GTK_CHECK_VERSION(3,0,0)
g_object_unref(cursor);
-#else
- gdk_cursor_unref(cursor);
-#endif
gdk_display_flush(gdk_window_get_display(gtk_widget_get_window(widget)));
}
@@ -2805,14 +2796,8 @@
GtkComboBoxText *ret = NULL;
GtkWidget *the_entry = NULL;
-#if GTK_CHECK_VERSION(2,24,0)
ret = GTK_COMBO_BOX_TEXT(gtk_combo_box_text_new_with_entry());
the_entry = gtk_bin_get_child(GTK_BIN(ret));
-#else
- ret = GTK_COMBO_BOX(gtk_combo_box_entry_new_text());
- the_entry = gtk_entry_new();
- gtk_container_add(GTK_CONTAINER(ret), the_entry);
-#endif
if (default_item)
gtk_entry_set_text(GTK_ENTRY(the_entry), default_item);
@@ -3554,11 +3539,7 @@
#if GTK_CHECK_VERSION(3,8,0)
gtk_container_add(GTK_CONTAINER(sw), child);
#else
-#if GTK_CHECK_VERSION(3,0,0)
if (GTK_IS_SCROLLABLE(child))
-#else
- if (GTK_WIDGET_GET_CLASS(child)->set_scroll_adjustments_signal)
-#endif /* GTK_CHECK_VERSION(3,0,0) */
gtk_container_add(GTK_CONTAINER(sw), child);
else
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), child);
@@ -3584,21 +3565,6 @@
/* Example custom URL handler. */
pidgin_webview_class_register_protocol("open://", open_dialog, dummy);
- /* Used to make small buttons */
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_rc_parse_string("style \"pidgin-small-close-button\"\n"
- "{\n"
- "GtkWidget::focus-padding = 0\n"
- "GtkWidget::focus-line-width = 0\n"
- "xthickness = 0\n"
- "ythickness = 0\n"
- "GtkContainer::border-width = 0\n"
- "GtkButton::inner-border = {0, 0, 0, 0}\n"
- "GtkButton::default-border = {0, 0, 0, 0}\n"
- "}\n"
- "widget \"*.pidgin-small-close-button\" style \"pidgin-small-close-button\"");
-#endif
-
#ifdef _WIN32
winpidgin_register_win32_url_handlers();
#endif
--- a/pidgin/gtkwhiteboard.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkwhiteboard.c Sun Dec 20 20:46:34 2015 -0800
@@ -87,11 +87,6 @@
static gboolean
pidgin_whiteboard_draw_event(GtkWidget *widget, cairo_t *cr,
gpointer _gtkwb);
-#if !GTK_CHECK_VERSION(3,0,0)
-static gboolean
-pidgin_whiteboard_expose_event(GtkWidget *widget, GdkEventExpose *event,
- gpointer _gtkwb);
-#endif
static gboolean pidgin_whiteboard_brush_down(GtkWidget *widget, GdkEventButton *event, gpointer data);
static gboolean pidgin_whiteboard_brush_motion(GtkWidget *widget, GdkEventMotion *event, gpointer data);
@@ -219,19 +214,11 @@
gtk_widget_show(drawing_area);
/* Signals used to handle backing pixmap */
-#if GTK_CHECK_VERSION(3,0,0)
g_signal_connect(G_OBJECT(drawing_area), "draw",
G_CALLBACK(pidgin_whiteboard_draw_event), gtkwb);
g_signal_connect(G_OBJECT(drawing_area), "configure-event",
G_CALLBACK(pidgin_whiteboard_configure_event), gtkwb);
-#else
- g_signal_connect(G_OBJECT(drawing_area), "expose_event",
- G_CALLBACK(pidgin_whiteboard_expose_event), gtkwb);
-
- g_signal_connect(G_OBJECT(drawing_area), "configure_event",
- G_CALLBACK(pidgin_whiteboard_configure_event), gtkwb);
-#endif
/* Event signals */
g_signal_connect(G_OBJECT(drawing_area), "button_press_event",
@@ -389,9 +376,7 @@
PidginWhiteboard *gtkwb = (PidginWhiteboard*)data;
cairo_t *cr;
GtkAllocation allocation;
-#if GTK_CHECK_VERSION(3,0,0)
GdkRGBA white = {1.0, 1.0, 1.0, 1.0};
-#endif
if (gtkwb->priv->cr)
cairo_destroy(gtkwb->priv->cr);
@@ -403,11 +388,7 @@
gtkwb->priv->surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24,
allocation.width, allocation.height);
gtkwb->priv->cr = cr = cairo_create(gtkwb->priv->surface);
-#if GTK_CHECK_VERSION(3,0,0)
gdk_cairo_set_source_rgba(cr, &white);
-#else
- gdk_cairo_set_source_color(cr, &gtk_widget_get_style(widget)->white);
-#endif
cairo_rectangle(cr, 0, 0, allocation.width, allocation.height);
cairo_fill(cr);
@@ -426,23 +407,6 @@
return FALSE;
}
-#if !GTK_CHECK_VERSION(3,0,0)
-static gboolean
-pidgin_whiteboard_expose_event(GtkWidget *widget, GdkEventExpose *event,
- gpointer _gtkwb)
-{
- cairo_t *cr;
-
- cr = gdk_cairo_create(GDK_DRAWABLE(widget->window));
-
- pidgin_whiteboard_draw_event(widget, cr, _gtkwb);
-
- cairo_destroy(cr);
-
- return FALSE;
-}
-#endif
-
static gboolean pidgin_whiteboard_brush_down(GtkWidget *widget, GdkEventButton *event, gpointer data)
{
PidginWhiteboard *gtkwb = (PidginWhiteboard*)data;
@@ -502,12 +466,8 @@
GList *draw_list = purple_whiteboard_get_draw_list(wb);
if(event->is_hint)
-#if GTK_CHECK_VERSION(3,0,0)
gdk_window_get_device_position(event->window, event->device, &x, &y,
&state);
-#else
- gdk_window_get_pointer(event->window, &x, &y, &state);
-#endif
else
{
x = event->x;
@@ -645,22 +605,16 @@
GtkWidget *widget = gtkwb->drawing_area;
cairo_t *gfx_con = gtkwb->priv->cr;
GdkColor col;
-#if GTK_CHECK_VERSION(3,0,0)
GdkRGBA rgba;
-#endif
/* Interpret and convert color */
pidgin_whiteboard_rgb24_to_rgb48(color, &col);
-#if GTK_CHECK_VERSION(3,0,0)
rgba.red = col.red / 0xffff;
rgba.green = col.green / 0xffff;
rgba.blue = col.blue / 0xffff;
rgba.alpha = 1.0;
gdk_cairo_set_source_rgba(gfx_con, &rgba);
-#else
- gdk_cairo_set_source_color(gfx_con, &col);
-#endif
/* Draw a circle */
cairo_arc(gfx_con,
@@ -763,18 +717,11 @@
GtkWidget *drawing_area = gtkwb->drawing_area;
cairo_t *cr = gtkwb->priv->cr;
GtkAllocation allocation;
-#if GTK_CHECK_VERSION(3,0,0)
GdkRGBA white = {1.0, 1.0, 1.0, 1.0};
-#endif
gtk_widget_get_allocation(drawing_area, &allocation);
-#if GTK_CHECK_VERSION(3,0,0)
gdk_cairo_set_source_rgba(cr, &white);
-#else
- gdk_cairo_set_source_color(cr,
- &gtk_widget_get_style(drawing_area)->white);
-#endif
cairo_rectangle(cr, 0, 0, allocation.width, allocation.height);
cairo_fill(cr);
--- a/pidgin/gtkxfer.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/gtkxfer.c Sun Dec 20 20:46:34 2015 -0800
@@ -718,11 +718,7 @@
purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/filetransfer/clear_finished");
/* Create the window. */
-#if GTK_CHECK_VERSION(3,0,0)
dialog->window = window = pidgin_create_dialog(_("File Transfers"), 0, "file transfer", TRUE);
-#else
- dialog->window = window = pidgin_create_dialog(_("File Transfers"), PIDGIN_HIG_BORDER, "file transfer", TRUE);
-#endif
gtk_window_set_default_size(GTK_WINDOW(window), 450, 250);
g_signal_connect(G_OBJECT(window), "delete_event",
--- a/pidgin/libpidgin.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/libpidgin.c Sun Dec 20 20:46:34 2015 -0800
@@ -431,10 +431,8 @@
char *opt_login_arg = NULL;
char *opt_session_arg = NULL;
char *search_path;
-#if GTK_CHECK_VERSION(3,0,0)
GtkCssProvider *provider;
GdkScreen *screen;
-#endif
GList *accounts;
#ifdef HAVE_SIGNAL_H
int sig_indx; /* for setting up signal catching */
@@ -443,13 +441,11 @@
GIOChannel *signal_channel;
GIOStatus signal_status;
guint signal_channel_watcher;
+ GError *error;
#ifndef DEBUG
char *segfault_message_tmp;
-#endif
-#endif
-#if defined(HAVE_SIGNAL_H) || GTK_CHECK_VERSION(3,0,0)
- GError *error;
-#endif
+#endif /* DEBUG */
+#endif /* HAVE_SIGNAL_N */
int opt;
gboolean gui_check;
gboolean debug_enabled, debug_colored;
@@ -694,12 +690,6 @@
purple_debug_set_enabled(debug_enabled);
purple_debug_set_colored(debug_colored);
-#if !GTK_CHECK_VERSION(3,0,0)
- search_path = g_build_filename(purple_user_dir(), "gtkrc-2.0", NULL);
- gtk_rc_add_default_file(search_path);
- g_free(search_path);
-#endif
-
gui_check = gtk_init_check(&argc, &argv);
if (!gui_check) {
char *display = gdk_get_display();
@@ -715,7 +705,6 @@
return 1;
}
-#if GTK_CHECK_VERSION(3,0,0)
search_path = g_build_filename(purple_user_dir(), "gtk-3.0.css", NULL);
error = NULL;
@@ -733,7 +722,6 @@
}
g_free(search_path);
-#endif
#ifdef _WIN32
winpidgin_init();
--- a/pidgin/minidialog.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/minidialog.c Sun Dec 20 20:46:34 2015 -0800
@@ -446,38 +446,10 @@
g_object_class_install_properties(object_class, LAST_PROPERTY, properties);
}
-#if !GTK_CHECK_VERSION(3,0,0)
-/* 16 is the width of the icon, due to PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL */
-#define BLIST_WIDTH_OTHER_THAN_LABEL \
- ((PIDGIN_HIG_BOX_SPACE * 3) + 16)
-
-#define BLIST_WIDTH_PREF \
- (PIDGIN_PREFS_ROOT "/blist/width")
-
-static void
-blist_width_changed_cb(const char *name,
- PurplePrefType type,
- gconstpointer val,
- gpointer data)
-{
- PidginMiniDialog *self = PIDGIN_MINI_DIALOG(data);
- PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE(self);
- guint blist_width = GPOINTER_TO_INT(val);
- guint label_width = blist_width - BLIST_WIDTH_OTHER_THAN_LABEL;
-
- gtk_widget_set_size_request(GTK_WIDGET(priv->title), label_width, -1);
- gtk_widget_set_size_request(GTK_WIDGET(priv->desc), label_width, -1);
-}
-#endif
-
static void
pidgin_mini_dialog_init(PidginMiniDialog *self)
{
GtkBox *self_box = GTK_BOX(self);
-#if !GTK_CHECK_VERSION(3,0,0)
- guint blist_width = purple_prefs_get_int(BLIST_WIDTH_PREF);
- guint label_width = blist_width - BLIST_WIDTH_OTHER_THAN_LABEL;
-#endif
PidginMiniDialogPrivate *priv = g_new0(PidginMiniDialogPrivate, 1);
self->priv = priv;
@@ -490,9 +462,6 @@
gtk_misc_set_alignment(GTK_MISC(priv->icon), 0, 0);
priv->title = GTK_LABEL(gtk_label_new(NULL));
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_widget_set_size_request(GTK_WIDGET(priv->title), label_width, -1);
-#endif
gtk_label_set_line_wrap(priv->title, TRUE);
gtk_label_set_selectable(priv->title, TRUE);
gtk_misc_set_alignment(GTK_MISC(priv->title), 0, 0);
@@ -501,9 +470,6 @@
gtk_box_pack_start(priv->title_box, GTK_WIDGET(priv->title), TRUE, TRUE, 0);
priv->desc = GTK_LABEL(gtk_label_new(NULL));
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_widget_set_size_request(GTK_WIDGET(priv->desc), label_width, -1);
-#endif
gtk_label_set_line_wrap(priv->desc, TRUE);
gtk_misc_set_alignment(GTK_MISC(priv->desc), 0, 0);
gtk_label_set_selectable(priv->desc, TRUE);
@@ -512,11 +478,6 @@
*/
g_object_set(G_OBJECT(priv->desc), "no-show-all", TRUE, NULL);
-#if !GTK_CHECK_VERSION(3,0,0)
- purple_prefs_connect_callback(self, BLIST_WIDTH_PREF,
- blist_width_changed_cb, self);
-#endif
-
self->contents = GTK_BOX(gtk_box_new(GTK_ORIENTATION_VERTICAL, 0));
priv->buttons = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0));
--- a/pidgin/pidginstock.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/pidginstock.c Sun Dec 20 20:46:34 2015 -0800
@@ -388,13 +388,7 @@
static void
reload_settings(void)
{
-#if GTK_CHECK_VERSION(3,0,0)
gtk_style_context_reset_widgets(gdk_screen_get_default());
-#else
- GtkSettings *setting = NULL;
- setting = gtk_settings_get_default();
- gtk_rc_reset_styles(setting);
-#endif
}
/*****************************************************************************
@@ -522,13 +516,8 @@
if (stock_icons[i].dir == NULL) {
/* GTK+ Stock icon */
-#if GTK_CHECK_VERSION(3,0,0)
iconset = gtk_style_context_lookup_icon_set(gtk_widget_get_style_context(win),
stock_icons[i].filename);
-#else
- iconset = gtk_style_lookup_icon_set(gtk_widget_get_style(win),
- stock_icons[i].filename);
-#endif
} else {
filename = find_file(stock_icons[i].dir, stock_icons[i].filename);
--- a/pidgin/pidgintooltip.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/pidgintooltip.c Sun Dec 20 20:46:34 2015 -0800
@@ -88,7 +88,6 @@
}
}
-#if GTK_CHECK_VERSION(3,0,0)
static gboolean
pidgin_tooltip_draw_cb(GtkWidget *widget, cairo_t *cr, gpointer data)
{
@@ -105,20 +104,6 @@
}
return FALSE;
}
-#else
-static gboolean
-pidgin_tooltip_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer data)
-{
- if (pidgin_tooltip.paint_tooltip) {
- cairo_t *cr = gdk_cairo_create(GDK_DRAWABLE(gtk_widget_get_window(widget)));
- gtk_paint_flat_box(widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
- NULL, widget, "tooltip", 0, 0, -1, -1);
- pidgin_tooltip.paint_tooltip(widget, cr, data);
- cairo_destroy(cr);
- }
- return FALSE;
-}
-#endif
static GtkWidget*
setup_tooltip_window(void)
@@ -149,17 +134,12 @@
GdkRectangle mon_size;
GtkWidget *tipwindow = pidgin_tooltip.tipwindow;
-#if GTK_CHECK_VERSION(3,0,0)
GdkDeviceManager *devmgr;
GdkDevice *dev;
devmgr = gdk_display_get_device_manager(gdk_display_get_default());
dev = gdk_device_manager_get_client_pointer(devmgr);
gdk_device_get_position(dev, &screen, &x, &y);
-#else
- gdk_display_get_pointer(gdk_display_get_default(),
- &screen, &x, &y, NULL);
-#endif
mon_num = gdk_screen_get_monitor_at_point(screen, x, y);
gdk_screen_get_monitor_geometry(screen, mon_num, &mon_size);
@@ -209,13 +189,8 @@
gtk_window_move(GTK_WINDOW(tipwindow), x, y);
gtk_widget_show(tipwindow);
-#if GTK_CHECK_VERSION(3,0,0)
g_signal_connect(G_OBJECT(tipwindow), "draw",
G_CALLBACK(pidgin_tooltip_draw_cb), data);
-#else
- g_signal_connect(G_OBJECT(tipwindow), "expose_event",
- G_CALLBACK(pidgin_tooltip_expose_event), data);
-#endif
/* Hide the tooltip when the widget is destroyed */
sig = g_signal_connect(G_OBJECT(pidgin_tooltip.widget), "destroy", G_CALLBACK(pidgin_tooltip_destroy), NULL);
--- a/pidgin/plugins/disco/gtkdisco.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/plugins/disco/gtkdisco.c Sun Dec 20 20:46:34 2015 -0800
@@ -435,17 +435,9 @@
disco_paint_tooltip(GtkWidget *tipwindow, cairo_t *cr, gpointer data)
{
PangoLayout *layout = g_object_get_data(G_OBJECT(tipwindow), "tooltip-plugin");
-#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *context = gtk_widget_get_style_context(tipwindow);
gtk_style_context_add_class(context, GTK_STYLE_CLASS_TOOLTIP);
gtk_render_layout(context, cr, 6, 6, layout);
-#else
- gtk_paint_layout(gtk_widget_get_style(tipwindow),
- gtk_widget_get_window(tipwindow),
- GTK_STATE_NORMAL, FALSE,
- NULL, tipwindow, "tooltip",
- 6, 6, layout);
-#endif
return TRUE;
}
--- a/pidgin/plugins/gestures/stroke-draw.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/plugins/gestures/stroke-draw.c Sun Dec 20 20:46:34 2015 -0800
@@ -57,21 +57,15 @@
{
gint x, y;
struct gstroke_metrics *metrics;
-#if GTK_CHECK_VERSION(3,0,0)
GdkDeviceManager *devmgr;
GdkDevice *dev;
-#endif
g_return_if_fail(widget != NULL);
-#if GTK_CHECK_VERSION(3,0,0)
devmgr = gdk_display_get_device_manager(gtk_widget_get_display(widget));
dev = gdk_device_manager_get_client_pointer(devmgr);
gdk_window_get_device_position(gtk_widget_get_window(widget),
dev, &x, &y, NULL);
-#else
- gtk_widget_get_pointer(widget, &x, &y);
-#endif
if (last_mouse_position.invalid)
last_mouse_position.invalid = FALSE;
@@ -125,11 +119,7 @@
timer_id = 0;
if( event != NULL )
-#if GTK_CHECK_VERSION(3,0,0)
gdk_device_ungrab(gdk_event_get_device(event), event->button.time);
-#else
- gdk_pointer_ungrab (event->button.time);
-#endif
if (gstroke_draw_strokes() && gstroke_disp != NULL) {
/* get rid of the invisible stroke window */
@@ -167,16 +157,10 @@
if (cursor == NULL)
cursor = gdk_cursor_new(GDK_PENCIL);
-#if GTK_CHECK_VERSION(3,0,0)
gdk_device_grab(gdk_event_get_device(event),
gtk_widget_get_window(widget), GDK_OWNERSHIP_WINDOW,
FALSE, GDK_BUTTON_RELEASE_MASK, cursor,
event->button.time);
-#else
- gdk_pointer_grab (gtk_widget_get_window(widget), FALSE,
- GDK_BUTTON_RELEASE_MASK, NULL, cursor,
- event->button.time);
-#endif
timer_id = g_timeout_add (GSTROKE_TIMEOUT_DURATION,
gstroke_timeout, widget);
return TRUE;
@@ -195,11 +179,7 @@
last_mouse_position.invalid = TRUE;
original_widget = NULL;
g_source_remove (timer_id);
-#if GTK_CHECK_VERSION(3,0,0)
gdk_device_ungrab(gdk_event_get_device(event), event->button.time);
-#else
- gdk_pointer_ungrab (event->button.time);
-#endif
timer_id = 0;
{
--- a/pidgin/plugins/screencap.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/plugins/screencap.c Sun Dec 20 20:46:34 2015 -0800
@@ -276,21 +276,6 @@
return FALSE;
}
-#if !GTK_CHECK_VERSION(3,0,0)
-static gboolean
-scrncap_draw_window_expose(GtkWidget *widget, GdkEventExpose *event,
- gpointer _surface)
-{
- cairo_t *cr = gdk_cairo_create(GDK_DRAWABLE(widget->window));
-
- scrncap_draw_window_paint(widget, cr, _surface);
-
- cairo_destroy(cr);
-
- return FALSE;
-}
-#endif
-
static void
scrncap_draw_window_response(GtkDialog *draw_window, gint response_id,
gpointer _webview)
@@ -372,13 +357,8 @@
G_CALLBACK(scrncap_draw_window_close), NULL);
draw_cursor = gdk_cursor_new(GDK_PENCIL);
-#if GTK_CHECK_VERSION(3,0,0)
g_object_set_data_full(G_OBJECT(draw_window), "draw-cursor",
draw_cursor, g_object_unref);
-#else
- g_object_set_data_full(G_OBJECT(draw_window), "draw-cursor",
- draw_cursor, (GDestroyNotify)gdk_cursor_unref);
-#endif
width = gdk_pixbuf_get_width(screen);
height = gdk_pixbuf_get_height(screen);
@@ -397,13 +377,8 @@
drawing_area = gtk_drawing_area_new();
gtk_widget_set_size_request(drawing_area, width, height);
-#if GTK_CHECK_VERSION(3,0,0)
g_signal_connect(G_OBJECT(drawing_area), "draw",
G_CALLBACK(scrncap_draw_window_paint), surface);
-#else
- g_signal_connect(G_OBJECT(drawing_area), "expose_event",
- G_CALLBACK(scrncap_draw_window_expose), surface);
-#endif
gtk_widget_add_events(drawing_area, GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_MOTION_MASK |
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK);
@@ -423,9 +398,7 @@
scroll_area = pidgin_make_scrollable(box,
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC,
GTK_SHADOW_NONE, -1, -1);
-#if GTK_CHECK_VERSION(3,0,0)
g_object_set(G_OBJECT(scroll_area), "expand", TRUE, NULL);
-#endif
gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(
GTK_DIALOG(draw_window))), scroll_area);
@@ -585,11 +558,7 @@
cursor = gdk_cursor_new(GDK_CROSSHAIR);
gdk_window_set_cursor(gdkwindow, cursor);
-#if GTK_CHECK_VERSION(3,0,0)
g_object_unref(cursor);
-#else
- gdk_cursor_unref(cursor);
-#endif
}
static gboolean
--- a/pidgin/plugins/ticker/gtkticker.c Wed Dec 16 00:35:23 2015 -0800
+++ b/pidgin/plugins/ticker/gtkticker.c Sun Dec 20 20:46:34 2015 -0800
@@ -31,17 +31,12 @@
static void gtk_ticker_init (GtkTicker *ticker);
static void gtk_ticker_map (GtkWidget *widget);
static void gtk_ticker_realize (GtkWidget *widget);
-#if GTK_CHECK_VERSION(3,0,0)
static void gtk_ticker_get_preferred_width (GtkWidget *widget,
gint *minimal_width,
gint *natural_width);
static void gtk_ticker_get_preferred_height (GtkWidget *widget,
gint *minimal_height,
gint *natural_height);
-#else
-static void gtk_ticker_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
-#endif
static void gtk_ticker_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_ticker_add_real (GtkContainer *container,
@@ -82,12 +77,8 @@
widget_class->map = gtk_ticker_map;
widget_class->realize = gtk_ticker_realize;
-#if GTK_CHECK_VERSION(3,0,0)
widget_class->get_preferred_width = gtk_ticker_get_preferred_width;
widget_class->get_preferred_height = gtk_ticker_get_preferred_height;
-#else
- widget_class->size_request = gtk_ticker_size_request;
-#endif
widget_class->size_allocate = gtk_ticker_size_allocate;
container_class->add = gtk_ticker_add_real;
@@ -262,11 +253,7 @@
GdkWindowAttr attributes;
gint attributes_mask;
GdkWindow *window;
-#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *context;
-#else
- GtkStyle *style;
-#endif
GtkAllocation allocation;
g_return_if_fail (widget != NULL);
@@ -282,36 +269,22 @@
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
-#if !GTK_CHECK_VERSION(3,0,0)
- attributes.colormap = gtk_widget_get_colormap (widget);
-#endif
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |= GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK;
-#if GTK_CHECK_VERSION(3,0,0)
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
-#else
- attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
-#endif
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
gtk_widget_set_window (widget, window);
gdk_window_set_user_data (window, widget);
-#if GTK_CHECK_VERSION(3,0,0)
context = gtk_widget_get_style_context(widget);
gtk_style_context_add_class(context, GTK_STYLE_CLASS_BACKGROUND);
gtk_style_context_set_state(context, GTK_STATE_FLAG_NORMAL);
gtk_style_context_set_background(context, window);
-#else
- style = gtk_style_attach (gtk_widget_get_style (widget), window);
- gtk_widget_set_style (widget, style);
- gtk_style_set_background (style, window, GTK_STATE_NORMAL);
-#endif
}
-#if GTK_CHECK_VERSION(3,0,0)
static void
gtk_ticker_get_preferred_width (GtkWidget *widget,
gint *minimal_width,
@@ -384,47 +357,6 @@
*minimal_height = *natural_height = height;
}
-#else
-
-static void gtk_ticker_size_request (GtkWidget *widget, GtkRequisition *requisition)
-{
- GtkTicker *ticker;
- GtkTickerChild *child;
- GList *children;
- GtkRequisition child_requisition;
- guint border_width;
-
- g_return_if_fail (widget != NULL);
- g_return_if_fail (GTK_IS_TICKER (widget));
- g_return_if_fail (requisition != NULL);
-
- ticker = GTK_TICKER (widget);
- requisition->width = 0;
- requisition->height = 0;
-
- children = ticker->children;
- while (children)
- {
- child = children->data;
- children = children->next;
-
- if (gtk_widget_get_visible (child->widget))
- {
- gtk_widget_size_request (child->widget, &child_requisition);
-
- requisition->height = MAX (requisition->height,
- child_requisition.height);
- requisition->width += child_requisition.width + ticker->spacing;
- }
- }
- if ( requisition->width > ticker->spacing )
- requisition->width -= ticker->spacing;
-
- border_width = gtk_container_get_border_width (GTK_CONTAINER (ticker));
- requisition->height += border_width * 2;
- requisition->width += border_width * 2;
-}
-#endif
static void gtk_ticker_compute_offsets (GtkTicker *ticker)
{