/pidgin/main: b2fdbd09f180: Merge GTK+3 branch.

Elliott Sales de Andrade qulogic at pidgin.im
Tue Jul 24 04:04:05 EDT 2012


Changeset: b2fdbd09f1807bb95eabf8593081e8f6107a409d
Author:	 Elliott Sales de Andrade <qulogic at pidgin.im>
Date:	 2012-07-24 03:43 -0400
Branch:	 default
URL: http://hg.pidgin.im/pidgin/main/rev/b2fdbd09f180

Description:

Merge GTK+3 branch.

Fixes #8932.

diffstat:

 configure.ac                          |   85 ++++-
 pidgin/gtk3compat.h                   |  172 ++++++++++
 pidgin/gtkaccount.c                   |   39 +-
 pidgin/gtkblist-theme-loader.c        |    2 +
 pidgin/gtkblist.c                     |  322 ++++++++++++++-----
 pidgin/gtkcellrendererexpander.c      |  136 +++++--
 pidgin/gtkcertmgr.c                   |    4 +
 pidgin/gtkconv.c                      |  559 +++++++++++++++++++--------------
 pidgin/gtkconvwin.h                   |    2 +
 pidgin/gtkdebug.c                     |   50 +--
 pidgin/gtkdialogs.c                   |   24 +-
 pidgin/gtkdnd-hints.c                 |   82 ++++-
 pidgin/gtkdocklet.c                   |   22 +-
 pidgin/gtkft.c                        |   31 +-
 pidgin/gtkimhtml.c                    |  285 +++++++++++------
 pidgin/gtkimhtmltoolbar.c             |  105 +++--
 pidgin/gtklog.c                       |   18 +-
 pidgin/gtkmedia.c                     |   12 +-
 pidgin/gtkmenutray.c                  |   38 +-
 pidgin/gtknotify.c                    |   41 +-
 pidgin/gtkplugin.c                    |   30 +-
 pidgin/gtkpluginpref.c                |    2 +
 pidgin/gtkpounce.c                    |   28 +-
 pidgin/gtkprefs.c                     |   34 +-
 pidgin/gtkprivacy.c                   |   10 +-
 pidgin/gtkrequest.c                   |   94 +---
 pidgin/gtkroomlist.c                  |   69 +++-
 pidgin/gtksavedstatuses.c             |    6 +-
 pidgin/gtkscrollbook.c                |    4 +-
 pidgin/gtksession.c                   |    4 +-
 pidgin/gtksmiley.c                    |   21 +-
 pidgin/gtksourceundomanager.c         |    2 +
 pidgin/gtkstatusbox.c                 |  281 ++++++++++------
 pidgin/gtkutils.c                     |   76 ++--
 pidgin/gtkwebview.c                   |   21 +-
 pidgin/gtkwebviewtoolbar.c            |   72 ++-
 pidgin/gtkwhiteboard.c                |  114 ++++--
 pidgin/minidialog.c                   |    7 +-
 pidgin/pidginstock.c                  |    2 +-
 pidgin/pidgintooltip.c                |   30 +-
 pidgin/pidgintooltip.h                |    4 +-
 pidgin/plugins/contact_priority.c     |   11 +-
 pidgin/plugins/convcolors.c           |    4 +-
 pidgin/plugins/disco/gtkdisco.c       |   18 +-
 pidgin/plugins/gestures/stroke-draw.c |    6 +-
 pidgin/plugins/themeedit.c            |    3 -
 pidgin/plugins/ticker/gtkticker.c     |  174 ++++++----
 pidgin/plugins/timestamp.c            |    2 +-
 pidgin/plugins/timestamp_format.c     |    2 +-
 pidgin/plugins/vvconfig.c             |    4 +-
 pidgin/plugins/xmppconsole.c          |   74 ++--
 51 files changed, 2056 insertions(+), 1182 deletions(-)

diffs (truncated from 7031 to 300 lines):

diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -372,6 +372,9 @@
 AC_ARG_ENABLE(gtkui, [AC_HELP_STRING([--disable-gtkui],
 		[compile without GTK+ user interface])],
 	enable_gtkui="$enableval", enable_gtkui="yes")
+AC_ARG_WITH(gtk, [AC_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, [AC_HELP_STRING([--disable-consoleui],
 		[compile without console user interface])],
 	[enable_consoleui=$enableval force_finch=$enableval], [enable_consoleui=yes force_finch=no])
@@ -428,15 +431,35 @@
 fi
 
 if test "x$enable_gtkui" = "xyes" ; then
-	PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.10.0], , [
-		AC_MSG_RESULT(no)
-		AC_MSG_ERROR([
-
+	if test "x$with_gtk" = "x3"; then
+		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.10.0], , [
+			AC_MSG_RESULT(no)
+			AC_MSG_ERROR([
 You must have GTK+ 2.10.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
+		PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= 3.0.0], [with_gtk=3], [
+			AC_MSG_RESULT(no)
+			PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.10.0], [with_gtk=2], [
+				AC_MSG_RESULT(no)
+				AC_MSG_ERROR([
+You must have GTK+ 2.10.0 or newer development headers installed to compile
+Pidgin.  If you want to build only Finch then specify --disable-gtkui when
+running configure.
+])])])
+	else
+		AC_MSG_ERROR([--with-gtk must specify one of 2, 3 or auto.])
+	fi
 	AC_SUBST(GTK_CFLAGS)
 	AC_SUBST(GTK_LIBS)
 
@@ -444,13 +467,23 @@
 	PKG_CHECK_MODULES(PANGO, [pango >= 1.4.0],
 			AC_DEFINE(HAVE_PANGO14, 1, [Define if we have Pango 1.4 or newer.]),:)
 
-	PKG_CHECK_MODULES(WEBKIT, [webkit-1.0 >= 1.1.1], , [
-		AC_MSG_RESULT(no)
-		AC_MSG_ERROR([
+	if test "x$with_gtk" = "x3"; then
+		PKG_CHECK_MODULES(WEBKIT, [webkitgtk-3.0 >= 1.1.1], , [
+			AC_MSG_RESULT(no)
+			AC_MSG_ERROR([
 You must have WebKit 1.1.1 or newer development headers installed to compile
 Pidgin.  If you want to build only Finch then specify --disable-gtkui when
 running configure.
 ])])
+	else
+		PKG_CHECK_MODULES(WEBKIT, [webkit-1.0 >= 1.1.1], , [
+			AC_MSG_RESULT(no)
+			AC_MSG_ERROR([
+You must have WebKit 1.1.1 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)
 
@@ -565,6 +598,10 @@
 	dnl #######################################################################
 	dnl # Check for GtkSpell
 	dnl #######################################################################
+	dnl GtkSpell is not GTK+3 compatible yet
+	if test "x$with_gtk" = "x3"; then
+		enable_gtkspell="no"
+	fi
 	if test "x$enable_gtkspell" = "xyes" ; then
 		PKG_CHECK_MODULES(GTKSPELL, gtkspell-2.0 >= 2.0.2, , [
 			AC_MSG_RESULT(no)
@@ -629,16 +666,29 @@
 	dnl # Check for GCR for its certificate widgets
 	dnl #######################################################################
 	if test "x$enable_gcr" = "xyes"; then
-		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([
+		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([
 GCR development headers not found.
 Use --disable-gcr if you do not need GCR certificate widgets.
 ])
-			fi])
+				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 development headers not found.
+Use --disable-gcr if you do not need GCR certificate widgets.
+])
+				fi])
+		fi
 	fi
 
 
@@ -2589,7 +2639,10 @@
 echo $PACKAGE $VERSION
 
 echo
-echo Build GTK+ 2.x UI............. : $enable_gtkui
+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/gtk3compat.h b/pidgin/gtk3compat.h
new file mode 100644
--- /dev/null
+++ b/pidgin/gtk3compat.h
@@ -0,0 +1,172 @@
+/* pidgin
+ *
+ * Pidgin is the legal property of its developers, whose names are too numerous
+ * to list here.  Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+#ifndef _PIDGINGTK3COMPAT_H_
+#define _PIDGINGTK3COMPAT_H_
+
+/* This file is internal to Pidgin. Do not use!
+ * Also, any public API should not depend on this file.
+ */
+
+#if !GTK_CHECK_VERSION(3,0,0)
+
+#define gdk_x11_window_get_xid GDK_WINDOW_XWINDOW
+
+#if !GTK_CHECK_VERSION(2,24,0)
+
+#define gdk_x11_set_sm_client_id gdk_set_sm_client_id
+#define gdk_window_get_display gdk_drawable_get_display
+#define GtkComboBoxText GtkComboBox
+#define GTK_COMBO_BOX_TEXT GTK_COMBO_BOX
+#define gtk_combo_box_text_new gtk_combo_box_new_text
+#define gtk_combo_box_text_append_text gtk_combo_box_append_text
+#define gtk_combo_box_text_get_active_text gtk_combo_box_get_active_text
+#define gtk_combo_box_text_remove gtk_combo_box_remove_text
+
+static inline gint gdk_window_get_width(GdkWindow *x)
+{
+	gint w;
+	gdk_drawable_get_size(GDK_DRAWABLE(x), &w, NULL);
+	return w;
+}
+
+static inline gint gdk_window_get_height(GdkWindow *x)
+{
+	gint h;
+	gdk_drawable_get_size(GDK_DRAWABLE(x), NULL, &h);
+	return h;
+}
+
+#if !GTK_CHECK_VERSION(2,22,0)
+
+#define gdk_drag_context_get_actions(x) (x)->action
+#define gdk_drag_context_get_suggested_action(x) (x)->suggested_action
+#define gtk_text_view_get_vadjustment(x) (x)->vadjustment
+#define gtk_font_selection_dialog_get_font_selection(x) (x)->fontsel
+
+#if !GTK_CHECK_VERSION(2,20,0)
+
+#define gtk_widget_get_mapped GTK_WIDGET_MAPPED
+#define gtk_widget_set_mapped(x,y) do { \
+	if (y) \
+		GTK_WIDGET_SET_FLAGS(x, GTK_MAPPED); \
+	else \
+		GTK_WIDGET_UNSET_FLAGS(x, GTK_MAPPED); \
+} while(0)
+#define gtk_widget_get_realized GTK_WIDGET_REALIZED
+#define gtk_widget_set_realized(x,y) do { \
+	if (y) \
+		GTK_WIDGET_SET_FLAGS(x, GTK_REALIZED); \
+	else \
+		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
+



More information about the Commits mailing list