/pidgin/main: 07dcc28b6039: Remove support for GTK+2

Jorge Villase?or salinasv at pidgin.im
Sun Dec 20 23:51:49 EST 2015


Changeset: 07dcc28b60397d6f25fae3aca45d2c7fbb60c48b
Author:	 Jorge Villase?or <salinasv at pidgin.im>
Date:	 2015-12-20 20:46 -0800
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/07dcc28b6039

Description:

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.

diffstat:

 configure.ac                          |   92 +++-----------
 pidgin/gtkaccount.c                   |   63 ---------
 pidgin/gtkblist.c                     |  219 ----------------------------------
 pidgin/gtkcertmgr.c                   |    4 -
 pidgin/gtkconv.c                      |   87 -------------
 pidgin/gtkdebug.c                     |   24 ---
 pidgin/gtkdialogs.c                   |    5 -
 pidgin/gtkdnd-hints.c                 |   37 -----
 pidgin/gtkdocklet.c                   |   28 ----
 pidgin/gtkmedia.c                     |   16 --
 pidgin/gtkmenutray.c                  |   20 ---
 pidgin/gtknotify.c                    |    3 -
 pidgin/gtkplugin.c                    |    6 -
 pidgin/gtkpluginpref.c                |    3 -
 pidgin/gtkpounce.c                    |    8 +-
 pidgin/gtkprefs.c                     |   41 ------
 pidgin/gtkrequest.c                   |    3 -
 pidgin/gtkroomlist.c                  |   39 ------
 pidgin/gtksmiley-manager.c            |   38 -----
 pidgin/gtkstatusbox.c                 |   82 ------------
 pidgin/gtkutils.c                     |   34 -----
 pidgin/gtkwhiteboard.c                |   53 --------
 pidgin/gtkxfer.c                      |    4 -
 pidgin/libpidgin.c                    |   18 +--
 pidgin/minidialog.c                   |   39 ------
 pidgin/pidginstock.c                  |   11 -
 pidgin/pidgintooltip.c                |   25 ---
 pidgin/plugins/disco/gtkdisco.c       |    8 -
 pidgin/plugins/gestures/stroke-draw.c |   20 ---
 pidgin/plugins/screencap.c            |   31 ----
 pidgin/plugins/ticker/gtkticker.c     |   68 ----------
 31 files changed, 24 insertions(+), 1105 deletions(-)

diffs (truncated from 2499 to 300 lines):

diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -517,9 +517,6 @@ AC_ARG_WITH(x, [],
 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 @@ else
     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 @@ running configure.  Use --disable-gstrea
 			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 @@ Use --disable-cap if you do not need the
 	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 @@ dnl ####################################
 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 $PACKAGE $VERSION
 
 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
diff --git a/pidgin/gtkaccount.c b/pidgin/gtkaccount.c
--- a/pidgin/gtkaccount.c
+++ b/pidgin/gtkaccount.c
@@ -114,11 +114,7 @@ typedef struct
 	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 @@ username_focus_cb(GtkWidget *widget, Gdk
 
 	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 @@ username_nofocus_cb(GtkWidget *widget, G
 			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 @@ username_themechange_cb(GObject *widget,
 	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 @@ username_themechange_cb(GObject *widget,
 	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 @@ account_dnd_recv(GtkWidget *widget, GdkD
 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 @@ update_editable(PurpleConnection *gc, Ac
 	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 @@ update_editable(PurpleConnection *gc, Ac
 	} 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 @@ update_editable(PurpleConnection *gc, Ac
 			} else {
 				gtk_widget_override_background_color(GTK_WIDGET(l->data), GTK_STATE_FLAG_NORMAL, NULL);



More information about the Commits mailing list