2011-10-07 [colin] 3.7.10cvs21
authorColin Leroy <colin@colino.net>
Fri, 7 Oct 2011 09:40:16 +0000 (09:40 +0000)
committerColin Leroy <colin@colino.net>
Fri, 7 Oct 2011 09:40:16 +0000 (09:40 +0000)
* configure.ac
* src/action.c
* src/addr_compl.c
* src/addrgather.c
* src/compose.c
* src/compose.h
* src/editldap.c
* src/mainwindow.c
* src/message_search.c
* src/mimeview.c
* src/mimeview.h
* src/prefs_account.c
* src/prefs_compose_writing.c
* src/prefs_filtering_action.c
* src/prefs_folder_item.c
* src/prefs_logging.c
* src/prefs_matcher.c
* src/prefs_message.c
* src/prefs_other.c
* src/prefs_receive.c
* src/prefs_summaries.c
* src/prefs_wrapping.c
* src/printing.c
* src/ssl_manager.c
* src/statusbar.c
* src/stock_pixmap.c
* src/summary_search.c
* src/textview.c
* src/gtk/Makefile.am
* src/gtk/colorlabel.c
* src/gtk/gtkutils.c
* src/gtk/gtkutils.h
* src/gtk/logwindow.c
* src/gtk/menu.c
* src/gtk/menu.h
* src/gtk/quicksearch.c
* src/gtk/spell_entry.c
* src/plugins/bogofilter/bogofilter_gtk.c
* src/plugins/dillo_viewer/dillo_viewer.c
* src/plugins/pgpcore/prefs_gpg.c
* src/plugins/spamassassin/spamassassin_gtk.c
Bug #2371, "Port to GTK+ 3.0". Third patch from Hanno, starting
the real job. GtkCMOptionMenu and GTKHSRuler disabled, should be
ported (especially GtkCMOptionMenu)

43 files changed:
ChangeLog
PATCHSETS
configure.ac
src/action.c
src/addr_compl.c
src/addrgather.c
src/compose.c
src/compose.h
src/editldap.c
src/gtk/Makefile.am
src/gtk/colorlabel.c
src/gtk/gtkutils.c
src/gtk/gtkutils.h
src/gtk/logwindow.c
src/gtk/menu.c
src/gtk/menu.h
src/gtk/quicksearch.c
src/gtk/spell_entry.c
src/mainwindow.c
src/message_search.c
src/mimeview.c
src/mimeview.h
src/plugins/bogofilter/bogofilter_gtk.c
src/plugins/dillo_viewer/dillo_viewer.c
src/plugins/pgpcore/prefs_gpg.c
src/plugins/spamassassin/spamassassin_gtk.c
src/prefs_account.c
src/prefs_compose_writing.c
src/prefs_filtering_action.c
src/prefs_folder_item.c
src/prefs_logging.c
src/prefs_matcher.c
src/prefs_message.c
src/prefs_other.c
src/prefs_receive.c
src/prefs_summaries.c
src/prefs_wrapping.c
src/printing.c
src/ssl_manager.c
src/statusbar.c
src/stock_pixmap.c
src/summary_search.c
src/textview.c

index 69c587d..5520bc7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,50 @@
+2011-10-07 [colin]     3.7.10cvs21
+
+       * configure.ac
+       * src/action.c
+       * src/addr_compl.c
+       * src/addrgather.c
+       * src/compose.c
+       * src/compose.h
+       * src/editldap.c
+       * src/mainwindow.c
+       * src/message_search.c
+       * src/mimeview.c
+       * src/mimeview.h
+       * src/prefs_account.c
+       * src/prefs_compose_writing.c
+       * src/prefs_filtering_action.c
+       * src/prefs_folder_item.c
+       * src/prefs_logging.c
+       * src/prefs_matcher.c
+       * src/prefs_message.c
+       * src/prefs_other.c
+       * src/prefs_receive.c
+       * src/prefs_summaries.c
+       * src/prefs_wrapping.c
+       * src/printing.c
+       * src/ssl_manager.c
+       * src/statusbar.c
+       * src/stock_pixmap.c
+       * src/summary_search.c
+       * src/textview.c
+       * src/gtk/Makefile.am
+       * src/gtk/colorlabel.c
+       * src/gtk/gtkutils.c
+       * src/gtk/gtkutils.h
+       * src/gtk/logwindow.c
+       * src/gtk/menu.c
+       * src/gtk/menu.h
+       * src/gtk/quicksearch.c
+       * src/gtk/spell_entry.c
+       * src/plugins/bogofilter/bogofilter_gtk.c
+       * src/plugins/dillo_viewer/dillo_viewer.c
+       * src/plugins/pgpcore/prefs_gpg.c
+       * src/plugins/spamassassin/spamassassin_gtk.c
+               Bug #2371, "Port to GTK+ 3.0". Third patch from Hanno, starting
+               the real job. GtkCMOptionMenu and GTKHSRuler disabled, should be
+               ported (especially GtkCMOptionMenu)
+
 2011-10-07 [colin]     3.7.10cvs20
 
        * src/account.c
index 2f319d4..27b105f 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.9.2.49 -r 1.9.2.50 src/common/ssl.c;  ) > 3.7.10cvs18.patchset
 ( cvs diff -u -r 1.100.2.79 -r 1.100.2.80 AUTHORS;  cvs diff -u -r 1.61.2.98 -r 1.61.2.99 src/account.c;  cvs diff -u -r 1.12.2.66 -r 1.12.2.67 src/action.c;  cvs diff -u -r 1.27.2.53 -r 1.27.2.54 src/addr_compl.c;  cvs diff -u -r 1.60.2.143 -r 1.60.2.144 src/addressbook.c;  cvs diff -u -r 1.17.2.43 -r 1.17.2.44 src/alertpanel.c;  cvs diff -u -r 1.382.2.580 -r 1.382.2.581 src/compose.c;  cvs diff -u -r 1.1.2.24 -r 1.1.2.25 src/edittags.c;  cvs diff -u -r 1.207.2.220 -r 1.207.2.221 src/folderview.c;  cvs diff -u -r 1.14.2.28 -r 1.14.2.29 src/grouplistdialog.c;  cvs diff -u -r 1.1.2.30 -r 1.1.2.31 src/image_viewer.c;  cvs diff -u -r 1.274.2.328 -r 1.274.2.329 src/mainwindow.c;  cvs diff -u -r 1.83.2.170 -r 1.83.2.171 src/mimeview.c;  cvs diff -u -r 1.5.2.25 -r 1.5.2.26 src/noticeview.c;  cvs diff -u -r 1.1.4.69 -r 1.1.4.70 src/prefs_filtering_action.c;  cvs diff -u -r 1.1.2.18 -r 1.1.2.19 src/prefs_folder_column.c;  cvs diff -u -r 1.1.2.42 -r 1.1.2.43 src/prefs_msg_colors.c;  cvs diff -u -r 1.10.2.27 -r 1.10.2.28 src/prefs_summary_column.c;  cvs diff -u -r 1.30.2.67 -r 1.30.2.68 src/prefs_toolbar.c;  cvs diff -u -r 1.1.2.31 -r 1.1.2.32 src/printing.c;  cvs diff -u -r 1.25.2.68 -r 1.25.2.69 src/stock_pixmap.c;  cvs diff -u -r 1.395.2.430 -r 1.395.2.431 src/summaryview.c;  cvs diff -u -r 1.96.2.232 -r 1.96.2.233 src/textview.c;  cvs diff -u -r 1.13.2.22 -r 1.13.2.23 src/undo.c;  cvs diff -u -r 1.1.2.84 -r 1.1.2.85 src/wizard.c;  cvs diff -u -r 1.4.2.79 -r 1.4.2.80 src/gtk/about.c;  cvs diff -u -r 1.1.2.73 -r 1.1.2.74 src/gtk/authors.h;  cvs diff -u -r 1.2.2.33 -r 1.2.2.34 src/gtk/colorlabel.c;  cvs diff -u -r 1.1.4.15 -r 1.1.4.16 src/gtk/colorsel.c;  cvs diff -u -r 1.1.2.15 -r 1.1.2.16 src/gtk/gtkcmclist.c;  cvs diff -u -r 1.1.2.17 -r 1.1.2.18 src/gtk/gtkcmctree.c;  cvs diff -u -r 1.1.2.6 -r 1.1.2.7 src/gtk/gtkcmoptionmenu.c;  cvs diff -u -r 1.1.4.60 -r 1.1.4.61 src/gtk/gtksctree.c;  cvs diff -u -r 1.5.2.95 -r 1.5.2.96 src/gtk/gtkutils.c;  cvs diff -u -r 1.5.2.21 -r 1.5.2.22 src/gtk/gtkvscrollbutton.c;  cvs diff -u -r 1.2.2.42 -r 1.2.2.43 src/gtk/inputdialog.c;  cvs diff -u -r 1.1.4.37 -r 1.1.4.38 src/gtk/logwindow.c;  cvs diff -u -r 1.5.2.42 -r 1.5.2.43 src/gtk/menu.c;  cvs diff -u -r 1.12.2.56 -r 1.12.2.57 src/gtk/prefswindow.c;  cvs diff -u -r 1.1.4.27 -r 1.1.4.28 src/gtk/progressdialog.c;  cvs diff -u -r 1.1.2.34 -r 1.1.2.35 src/plugins/pgpcore/passphrase.c;  cvs diff -u -r 1.14.2.77 -r 1.14.2.78 src/plugins/trayicon/trayicon.c;  ) > 3.7.10cvs19.patchset
 ( cvs diff -u -r 1.61.2.99 -r 1.61.2.100 src/account.c;  cvs diff -u -r 1.12.2.67 -r 1.12.2.68 src/action.c;  cvs diff -u -r 1.27.2.54 -r 1.27.2.55 src/addr_compl.c;  cvs diff -u -r 1.1.2.9 -r 1.1.2.10 src/addrcustomattr.c;  cvs diff -u -r 1.1.2.17 -r 1.1.2.18 src/addrduplicates.c;  cvs diff -u -r 1.9.2.32 -r 1.9.2.33 src/addressadd.c;  cvs diff -u -r 1.60.2.144 -r 1.60.2.145 src/addressbook.c;  cvs diff -u -r 1.1.2.19 -r 1.1.2.20 src/addressbook_foldersel.c;  cvs diff -u -r 1.5.10.33 -r 1.5.10.34 src/addrgather.c;  cvs diff -u -r 1.17.2.44 -r 1.17.2.45 src/alertpanel.c;  cvs diff -u -r 1.2.4.26 -r 1.2.4.27 src/browseldap.c;  cvs diff -u -r 1.382.2.581 -r 1.382.2.582 src/compose.c;  cvs diff -u -r 1.14.2.60 -r 1.14.2.61 src/editaddress.c;  cvs diff -u -r 1.1.2.15 -r 1.1.2.16 src/editaddress_other_attributes_ldap.c;  cvs diff -u -r 1.5.12.16 -r 1.5.12.17 src/editbook.c;  cvs diff -u -r 1.11.2.26 -r 1.11.2.27 src/editgroup.c;  cvs diff -u -r 1.5.12.18 -r 1.5.12.19 src/editjpilot.c;  cvs diff -u -r 1.8.2.40 -r 1.8.2.41 src/editldap.c;  cvs diff -u -r 1.10.2.18 -r 1.10.2.19 src/editldap_basedn.c;  cvs diff -u -r 1.1.2.25 -r 1.1.2.26 src/edittags.c;  cvs diff -u -r 1.5.12.17 -r 1.5.12.18 src/editvcard.c;  cvs diff -u -r 1.3.2.28 -r 1.3.2.29 src/exphtmldlg.c;  cvs diff -u -r 1.1.4.33 -r 1.1.4.34 src/expldifdlg.c;  cvs diff -u -r 1.8.2.31 -r 1.8.2.32 src/export.c;  cvs diff -u -r 1.26.2.46 -r 1.26.2.47 src/foldersel.c;  cvs diff -u -r 1.207.2.221 -r 1.207.2.222 src/folderview.c;  cvs diff -u -r 1.14.2.29 -r 1.14.2.30 src/grouplistdialog.c;  cvs diff -u -r 1.13.2.30 -r 1.13.2.31 src/import.c;  cvs diff -u -r 1.14.2.26 -r 1.14.2.27 src/importldif.c;  cvs diff -u -r 1.4.12.22 -r 1.4.12.23 src/importmutt.c;  cvs diff -u -r 1.1.14.22 -r 1.1.14.23 src/importpine.c;  cvs diff -u -r 1.274.2.329 -r 1.274.2.330 src/mainwindow.c;  cvs diff -u -r 1.3.12.39 -r 1.3.12.40 src/message_search.c;  cvs diff -u -r 1.94.2.218 -r 1.94.2.219 src/messageview.c;  cvs diff -u -r 1.83.2.171 -r 1.83.2.172 src/mimeview.c;  cvs diff -u -r 1.60.2.73 -r 1.60.2.74 src/prefs_actions.c;  cvs diff -u -r 1.16.2.41 -r 1.16.2.42 src/prefs_customheader.c;  cvs diff -u -r 1.16.2.43 -r 1.16.2.44 src/prefs_display_header.c;  cvs diff -u -r 1.59.2.82 -r 1.59.2.83 src/prefs_filtering.c;  cvs diff -u -r 1.1.4.70 -r 1.1.4.71 src/prefs_filtering_action.c;  cvs diff -u -r 1.1.2.19 -r 1.1.2.20 src/prefs_folder_column.c;  cvs diff -u -r 1.43.2.89 -r 1.43.2.90 src/prefs_matcher.c;  cvs diff -u -r 1.1.2.43 -r 1.1.2.44 src/prefs_msg_colors.c;  cvs diff -u -r 1.1.2.41 -r 1.1.2.42 src/prefs_other.c;  cvs diff -u -r 1.1.2.66 -r 1.1.2.67 src/prefs_summaries.c;  cvs diff -u -r 1.10.2.28 -r 1.10.2.29 src/prefs_summary_column.c;  cvs diff -u -r 1.1.2.10 -r 1.1.2.11 src/prefs_summary_open.c;  cvs diff -u -r 1.12.2.75 -r 1.12.2.76 src/prefs_template.c;  cvs diff -u -r 1.30.2.68 -r 1.30.2.69 src/prefs_toolbar.c;  cvs diff -u -r 1.1.2.32 -r 1.1.2.33 src/printing.c;  cvs diff -u -r 1.9.2.26 -r 1.9.2.27 src/sourcewindow.c;  cvs diff -u -r 1.3.2.35 -r 1.3.2.36 src/ssl_manager.c;  cvs diff -u -r 1.15.2.65 -r 1.15.2.66 src/summary_search.c;  cvs diff -u -r 1.395.2.431 -r 1.395.2.432 src/summaryview.c;  cvs diff -u -r 1.96.2.233 -r 1.96.2.234 src/textview.c;  cvs diff -u -r 1.1.2.14 -r 1.1.2.15 src/uri_opener.c;  cvs diff -u -r 1.4.2.80 -r 1.4.2.81 src/gtk/about.c;  cvs diff -u -r 1.1.4.16 -r 1.1.4.17 src/gtk/colorsel.c;  cvs diff -u -r 1.1.2.23 -r 1.1.2.24 src/gtk/combobox.c;  cvs diff -u -r 1.5.2.31 -r 1.5.2.32 src/gtk/description_window.c;  cvs diff -u -r 1.1.2.21 -r 1.1.2.22 src/gtk/foldersort.c;  cvs diff -u -r 1.9.2.72 -r 1.9.2.73 src/gtk/gtkaspell.c;  cvs diff -u -r 1.1.2.16 -r 1.1.2.17 src/gtk/gtkcmclist.c;  cvs diff -u -r 1.1.2.18 -r 1.1.2.19 src/gtk/gtkcmctree.c;  cvs diff -u -r 1.1.2.7 -r 1.1.2.8 src/gtk/gtkcmoptionmenu.c;  cvs diff -u -r 1.5.2.96 -r 1.5.2.97 src/gtk/gtkutils.c;  cvs diff -u -r 1.1.2.19 -r 1.1.2.20 src/gtk/icon_legend.c;  cvs diff -u -r 1.2.2.43 -r 1.2.2.44 src/gtk/inputdialog.c;  cvs diff -u -r 1.1.4.38 -r 1.1.4.39 src/gtk/logwindow.c;  cvs diff -u -r 1.5.2.59 -r 1.5.2.60 src/gtk/pluginwindow.c;  cvs diff -u -r 1.12.2.57 -r 1.12.2.58 src/gtk/prefswindow.c;  cvs diff -u -r 1.1.2.103 -r 1.1.2.104 src/gtk/quicksearch.c;  cvs diff -u -r 1.1.2.35 -r 1.1.2.36 src/plugins/pgpcore/passphrase.c;  cvs diff -u -r 1.1.2.29 -r 1.1.2.30 src/plugins/pgpcore/select-keys.c;  ) > 3.7.10cvs20.patchset
+( cvs diff -u -r 1.654.2.4301 -r 1.654.2.4302 configure.ac;  cvs diff -u -r 1.12.2.68 -r 1.12.2.69 src/action.c;  cvs diff -u -r 1.27.2.55 -r 1.27.2.56 src/addr_compl.c;  cvs diff -u -r 1.5.10.34 -r 1.5.10.35 src/addrgather.c;  cvs diff -u -r 1.382.2.582 -r 1.382.2.583 src/compose.c;  cvs diff -u -r 1.50.2.62 -r 1.50.2.63 src/compose.h;  cvs diff -u -r 1.8.2.41 -r 1.8.2.42 src/editldap.c;  cvs diff -u -r 1.274.2.330 -r 1.274.2.331 src/mainwindow.c;  cvs diff -u -r 1.3.12.40 -r 1.3.12.41 src/message_search.c;  cvs diff -u -r 1.83.2.172 -r 1.83.2.173 src/mimeview.c;  cvs diff -u -r 1.20.2.32 -r 1.20.2.33 src/mimeview.h;  cvs diff -u -r 1.105.2.168 -r 1.105.2.169 src/prefs_account.c;  cvs diff -u -r 1.1.2.30 -r 1.1.2.31 src/prefs_compose_writing.c;  cvs diff -u -r 1.1.4.71 -r 1.1.4.72 src/prefs_filtering_action.c;  cvs diff -u -r 1.52.2.83 -r 1.52.2.84 src/prefs_folder_item.c;  cvs diff -u -r 1.1.2.19 -r 1.1.2.20 src/prefs_logging.c;  cvs diff -u -r 1.43.2.90 -r 1.43.2.91 src/prefs_matcher.c;  cvs diff -u -r 1.1.2.33 -r 1.1.2.34 src/prefs_message.c;  cvs diff -u -r 1.1.2.42 -r 1.1.2.43 src/prefs_other.c;  cvs diff -u -r 1.1.2.28 -r 1.1.2.29 src/prefs_receive.c;  cvs diff -u -r 1.1.2.67 -r 1.1.2.68 src/prefs_summaries.c;  cvs diff -u -r 1.1.2.22 -r 1.1.2.23 src/prefs_wrapping.c;  cvs diff -u -r 1.1.2.33 -r 1.1.2.34 src/printing.c;  cvs diff -u -r 1.3.2.36 -r 1.3.2.37 src/ssl_manager.c;  cvs diff -u -r 1.5.2.29 -r 1.5.2.30 src/statusbar.c;  cvs diff -u -r 1.25.2.69 -r 1.25.2.70 src/stock_pixmap.c;  cvs diff -u -r 1.15.2.66 -r 1.15.2.67 src/summary_search.c;  cvs diff -u -r 1.96.2.234 -r 1.96.2.235 src/textview.c;  cvs diff -u -r 1.20.2.24 -r 1.20.2.25 src/gtk/Makefile.am;  cvs diff -u -r 1.2.2.34 -r 1.2.2.35 src/gtk/colorlabel.c;  cvs diff -u -r 1.5.2.97 -r 1.5.2.98 src/gtk/gtkutils.c;  cvs diff -u -r 1.4.2.57 -r 1.4.2.58 src/gtk/gtkutils.h;  cvs diff -u -r 1.1.4.39 -r 1.1.4.40 src/gtk/logwindow.c;  cvs diff -u -r 1.5.2.43 -r 1.5.2.44 src/gtk/menu.c;  cvs diff -u -r 1.4.2.24 -r 1.4.2.25 src/gtk/menu.h;  cvs diff -u -r 1.1.2.104 -r 1.1.2.105 src/gtk/quicksearch.c;  cvs diff -u -r 1.1.2.11 -r 1.1.2.12 src/gtk/spell_entry.c;  cvs diff -u -r 1.1.2.38 -r 1.1.2.39 src/plugins/bogofilter/bogofilter_gtk.c;  cvs diff -u -r 1.12.2.29 -r 1.12.2.30 src/plugins/dillo_viewer/dillo_viewer.c;  cvs diff -u -r 1.1.2.34 -r 1.1.2.35 src/plugins/pgpcore/prefs_gpg.c;  cvs diff -u -r 1.23.2.55 -r 1.23.2.56 src/plugins/spamassassin/spamassassin_gtk.c;  ) > 3.7.10cvs21.patchset
index b8a2f1b..78a6fcf 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=20
+EXTRA_VERSION=21
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
@@ -157,7 +157,7 @@ fi
 CFLAGS="$CFLAGS -Wall"
 
 #if test $USE_MAINTAINER_MODE = yes; then
-#      CFLAGS="-g -Wall -Wno-pointer-sign -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES"
+#      CFLAGS="-g -Wall -Wno-pointer-sign -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDESi -DGDK_PIXBUF_DISABLE_DEPRECATED -DGSEAL_ENABLE"
 #fi
 
 pthread_name=
@@ -464,11 +464,21 @@ dnl ** GTK user interface **
 dnl ************************
 
 dnl Checks for GTK
-PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.10)
+AC_ARG_ENABLE(gtk3,
+       AS_HELP_STRING([--enable-gtk3],
+               [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
+               [ac_cv_enable_gtk3=$enableval],[ac_cv_enable_gtk3=no])
+if test x"$ac_cv_enable_gtk3" = x"yes"; then
+       PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.0 cairo)
+       AC_SUBST(GTK3, 1)
+else
+       PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.10)
+       AC_SUBST(GTK2, 1)
 
 dnl --disable-deprecated switch for GTK2 purification
 AC_ARG_ENABLE(deprecated, [  --disable-deprecated  disable deprecated GTK functions. ],
                          [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
+fi
 
 AC_SUBST(GTK_CFLAGS)
 AC_SUBST(GTK_LIBS)
index 27d0796..9a39be4 100644 (file)
@@ -1421,8 +1421,15 @@ static void create_io_dialog(Children *children)
 #endif
                
                progress_bar = gtk_progress_bar_new();
+#if !GTK_CHECK_VERSION(3, 0, 0)
                gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(progress_bar),
                                GTK_PROGRESS_LEFT_TO_RIGHT);
+#else
+               gtk_orientable_set_orientation(GTK_PROGRESS_BAR(progress_bar),
+                               GTK_ORIENTATION_HORIZONTAL);
+               gtk_progress_bar_set_inverted(GTK_PROGRESS_BAR(progress_bar),
+                               FALSE);
+#endif
                text = g_strdup_printf(format, _("Completed"), 
                                       children->initial_nb);
                gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress_bar),
index f8e4407..de179ea 100644 (file)
@@ -1157,7 +1157,7 @@ void address_completion_register_entry(GtkEntry *entry, gboolean allow_commas)
  */
 void address_completion_unregister_entry(GtkEntry *entry)
 {
-       GtkObject *entry_obj;
+       GObject *entry_obj;
 
        cm_return_if_fail(entry != NULL);
        cm_return_if_fail(GTK_IS_ENTRY(entry));
index e268178..5bdaaa8 100644 (file)
@@ -271,7 +271,7 @@ static void addrgather_page_fields(gint pageNum, gchar *pageLbl)
        GtkWidget *frameHeader;
        GtkWidget *checkHeader[NUM_FIELDS];
        GtkWidget *spinbtnFolder;
-       GtkObject *adjFolder;
+       GtkAdjustment *adjFolder;
        GtkWidget *checkRecurse;
        gint top;
        gint i;
index f26aada..f228edb 100644 (file)
@@ -86,7 +86,9 @@
 #include "socket.h"
 #include "alertpanel.h"
 #include "manage_window.h"
+#if !GTK_CHECK_VERSION(3, 0, 0)
 #include "gtkshruler.h"
+#endif
 #include "folder.h"
 #include "addr_compl.h"
 #include "quote_fmt.h"
@@ -351,9 +353,11 @@ static void compose_add_field_list ( Compose *compose,
 
 /* callback functions */
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static gboolean compose_edit_size_alloc (GtkEditable   *widget,
                                         GtkAllocation  *allocation,
                                         GtkSHRuler     *shruler);
+#endif
 static void account_activated          (GtkComboBox *optmenu,
                                         gpointer        data);
 static void attach_selected            (GtkTreeView    *tree_view, 
@@ -437,8 +441,10 @@ static void compose_toggle_autowrap_cb     (GtkToggleAction *action,
 static void compose_toggle_autoindent_cb(GtkToggleAction *action,
                                         gpointer        data);
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static void compose_toggle_ruler_cb    (GtkToggleAction *action,
                                         gpointer        data);
+#endif
 static void compose_toggle_sign_cb     (GtkToggleAction *action,
                                         gpointer        data);
 static void compose_toggle_encrypt_cb  (GtkToggleAction *action,
@@ -668,7 +674,9 @@ static GtkToggleActionEntry compose_toggle_entries[] =
        {"Options/Encrypt",             NULL, N_("_Encrypt"), NULL, NULL, G_CALLBACK(compose_toggle_encrypt_cb) }, /* Toggle */
        {"Options/RequestRetRcpt",      NULL, N_("_Request Return Receipt"), NULL, NULL, G_CALLBACK(compose_toggle_return_receipt_cb) }, /* TOGGLE */
        {"Options/RemoveReferences",    NULL, N_("Remo_ve references"), NULL, NULL, G_CALLBACK(compose_toggle_remove_refs_cb) }, /* TOGGLE */
+#if !GTK_CHECK_VERSION(3, 0, 0)
        {"Tools/ShowRuler",             NULL, N_("Show _ruler"), NULL, NULL, G_CALLBACK(compose_toggle_ruler_cb) }, /* Toggle */
+#endif
 };
 
 static GtkRadioActionEntry compose_radio_rm_entries[] =
@@ -786,9 +794,11 @@ static void compose_create_tags(GtkTextView *text, Compose *compose)
 {
        GtkTextBuffer *buffer;
        GdkColor black = {(gulong)0, (gushort)0, (gushort)0, (gushort)0};
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GdkColormap *cmap;
-       GdkColor color[8];
        gboolean success[8];
+#endif
+       GdkColor color[8];
        int i;
 
        buffer = gtk_text_view_get_buffer(text);
@@ -859,6 +869,7 @@ static void compose_create_tags(GtkTextView *text, Compose *compose)
        color[5] = quote_bgcolor3;
        color[6] = signature_color;
        color[7] = uri_color;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        cmap = gdk_drawable_get_colormap(gtk_widget_get_window(compose->window));
        gdk_colormap_alloc_colors(cmap, color, 8, FALSE, TRUE, success);
 
@@ -873,6 +884,7 @@ static void compose_create_tags(GtkTextView *text, Compose *compose)
                                signature_color = uri_color = black;
                }
        }
+#endif
 }
 
 Compose *compose_new(PrefsAccount *account, const gchar *mailto,
@@ -2424,7 +2436,9 @@ Compose *compose_redirect(PrefsAccount *account, MsgInfo *msginfo,
        cm_menu_set_sensitive_full(compose->ui_manager, "Menu/Message/InsertSig", FALSE);
        cm_menu_set_sensitive_full(compose->ui_manager, "Menu/Edit", FALSE);
        cm_menu_set_sensitive_full(compose->ui_manager, "Menu/Options", FALSE);
+#if !GTK_CHECK_VERSION(3, 0, 0)
        cm_menu_set_sensitive_full(compose->ui_manager, "Menu/Tools/ShowRuler", FALSE);
+#endif
        cm_menu_set_sensitive_full(compose->ui_manager, "Menu/Tools/Actions", FALSE);
        
        if (compose->toolbar->draft_btn)
@@ -2533,12 +2547,18 @@ void compose_entry_append(Compose *compose, const gchar *address,
 
 static void compose_entry_mark_default_to(Compose *compose, const gchar *mailto)
 {
+#if !GTK_CHECK_VERSION(3, 0, 0)
        static GdkColor yellow;
        static GdkColor black;
        static gboolean yellow_initialised = FALSE;
+#else
+       static GdkColor yellow = { (guint32)0, (guint16)0xf5, (guint16)0xf6, (guint16)0xbe };
+       static GdkColor black = { (guint32)0, (guint16)0x0, (guint16)0x0, (guint16)0x0 };
+#endif
        GSList *h_list;
        GtkEntry *entry;
                
+#if !GTK_CHECK_VERSION(3, 0, 0)
        if (!yellow_initialised) {
                gdk_color_parse("#f5f6be", &yellow);
                gdk_color_parse("#000000", &black);
@@ -2547,19 +2567,24 @@ static void compose_entry_mark_default_to(Compose *compose, const gchar *mailto)
                yellow_initialised &= gdk_colormap_alloc_color(
                        gdk_colormap_get_system(), &black, FALSE, TRUE);
        }
+#endif
 
        for (h_list = compose->header_list; h_list != NULL; h_list = h_list->next) {
                entry = GTK_ENTRY(((ComposeHeaderEntry *)h_list->data)->entry);
                if (gtk_entry_get_text(entry) && 
                    !g_utf8_collate(gtk_entry_get_text(entry), mailto)) {
+#if !GTK_CHECK_VERSION(3, 0, 0)
                        if (yellow_initialised) {
+#endif
                                gtk_widget_modify_base(
                                        GTK_WIDGET(((ComposeHeaderEntry *)h_list->data)->entry),
                                        GTK_STATE_NORMAL, &yellow);
                                gtk_widget_modify_text(
                                        GTK_WIDGET(((ComposeHeaderEntry *)h_list->data)->entry),
                                        GTK_STATE_NORMAL, &black);
+#if !GTK_CHECK_VERSION(3, 0, 0)
                        }
+#endif
                }
        }
 }
@@ -7059,8 +7084,10 @@ static Compose *compose_create(PrefsAccount *account,
        GtkWidget *paned;
 
        GtkWidget *edit_vbox;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GtkWidget *ruler_hbox;
        GtkWidget *ruler;
+#endif
        GtkWidget *scrolledwin;
        GtkWidget *text;
        GtkTextBuffer *buffer;
@@ -7316,7 +7343,9 @@ static Compose *compose_create(PrefsAccount *account,
 /* phew. */
 
 /* Tools menu */
+#if !GTK_CHECK_VERSION(3, 0, 0)
        MENUITEM_ADDUI_MANAGER(compose->ui_manager, "/Menu/Tools", "ShowRuler", "Tools/ShowRuler", GTK_UI_MANAGER_MENUITEM)
+#endif
        MENUITEM_ADDUI_MANAGER(compose->ui_manager, "/Menu/Tools", "AddressBook", "Tools/AddressBook", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(compose->ui_manager, "/Menu/Tools", "Template", "Tools/Template", GTK_UI_MANAGER_MENU)
        MENUITEM_ADDUI_MANAGER(compose->ui_manager, "/Menu/Tools/Template", "PlaceHolder", "Tools/Template/PlaceHolder", GTK_UI_MANAGER_MENUITEM)
@@ -7418,6 +7447,7 @@ static Compose *compose_create(PrefsAccount *account,
 
        gtk_box_pack_start(GTK_BOX(edit_vbox), subject_hbox, FALSE, FALSE, 0);
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        /* ruler */
        ruler_hbox = gtk_hbox_new(FALSE, 0);
        gtk_box_pack_start(GTK_BOX(edit_vbox), ruler_hbox, FALSE, FALSE, 0);
@@ -7426,6 +7456,7 @@ static Compose *compose_create(PrefsAccount *account,
        gtk_ruler_set_range(GTK_RULER(ruler), 0.0, 100.0, 1.0, 100.0);
        gtk_box_pack_start(GTK_BOX(ruler_hbox), ruler, TRUE, TRUE,
                           BORDER_WIDTH);
+#endif
 
        /* text widget */
        scrolledwin = gtk_scrolled_window_new(NULL, NULL);
@@ -7449,10 +7480,11 @@ static Compose *compose_create(PrefsAccount *account,
        gtk_text_buffer_add_selection_clipboard(buffer, clipboard);
        
        gtk_container_add(GTK_CONTAINER(scrolledwin), text);
-
+#if !GTK_CHECK_VERSION(3, 0, 0)
        g_signal_connect_after(G_OBJECT(text), "size_allocate",
                               G_CALLBACK(compose_edit_size_alloc),
                               ruler);
+#endif
        g_signal_connect(G_OBJECT(buffer), "changed",
                         G_CALLBACK(compose_changed_cb), compose);
        g_signal_connect(G_OBJECT(text), "grab_focus",
@@ -7546,8 +7578,10 @@ static Compose *compose_create(PrefsAccount *account,
 
        compose->notebook      = notebook;
        compose->edit_vbox     = edit_vbox;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        compose->ruler_hbox    = ruler_hbox;
        compose->ruler         = ruler;
+#endif
        compose->scrolledwin   = scrolledwin;
        compose->text          = text;
 
@@ -7666,10 +7700,12 @@ static Compose *compose_create(PrefsAccount *account,
 
        compose_list = g_list_append(compose_list, compose);
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        if (!prefs_common.show_ruler)
                gtk_widget_hide(ruler_hbox);
                
        cm_toggle_menu_set_active_full(compose->ui_manager, "Menu/Tools/ShowRuler", prefs_common.show_ruler);
+#endif
 
        /* Priority */
        compose->priority = PRIORITY_NORMAL;
@@ -9113,6 +9149,7 @@ static void compose_undo_state_changed(UndoMain *undostruct, gint undo_state,
  * includes "non-client" (windows-izm) in calculation, so this calculation
  * may not be accurate.
  */
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static gboolean compose_edit_size_alloc(GtkEditable *widget,
                                        GtkAllocation *allocation,
                                        GtkSHRuler *shruler)
@@ -9134,6 +9171,7 @@ static gboolean compose_edit_size_alloc(GtkEditable *widget,
 
        return TRUE;
 }
+#endif
 
 typedef struct {
        gchar                   *header;
@@ -10555,6 +10593,7 @@ static void activate_privacy_system(Compose *compose, PrefsAccount *account, gbo
        compose_update_privacy_system_menu_item(compose, warn);
 }
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static void compose_toggle_ruler_cb(GtkToggleAction *action, gpointer data)
 {
        Compose *compose = (Compose *)data;
@@ -10568,6 +10607,7 @@ static void compose_toggle_ruler_cb(GtkToggleAction *action, gpointer data)
                prefs_common.show_ruler = FALSE;
        }
 }
+#endif
 
 static void compose_attach_drag_received_cb (GtkWidget         *widget,
                                             GdkDragContext     *context,
index 2572846..cdaf032 100644 (file)
@@ -133,8 +133,10 @@ struct _Compose
 
        /* Textedit */
        GtkWidget *edit_vbox;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GtkWidget *ruler_hbox;
        GtkWidget *ruler;
+#endif
        GtkWidget *scrolledwin;
        GtkWidget *text;
        GtkWidget *from_name;
index 0da8c95..61e58e7 100644 (file)
@@ -396,7 +396,7 @@ static void addressbook_edit_ldap_page_basic( gint pageNum, gchar *pageLbl ) {
        GtkWidget *entry_name;
        GtkWidget *entry_server;
        GtkWidget *hbox_spin;
-       GtkObject *spinbtn_port_adj;
+       GtkAdjustment *spinbtn_port_adj;
        GtkWidget *spinbtn_port;
 #ifdef USE_LDAP_TLS
        GtkWidget *enable_ssl_checkbtn, *enable_tls_checkbtn;
@@ -550,7 +550,7 @@ static void addressbook_edit_ldap_page_search( gint pageNum, gchar *pageLbl ) {
        GtkWidget *label;
        GtkWidget *entry_criteria;
        GtkWidget *hbox_spin;
-       GtkObject *spinbtn_queryage_adj;
+       GtkAdjustment *spinbtn_queryage_adj;
        GtkWidget *spinbtn_queryage;
        GtkWidget *check_dynsearch;
        GtkWidget *check_matchoption;
@@ -675,9 +675,9 @@ static void addressbook_edit_ldap_page_extended( gint pageNum, gchar *pageLbl )
        GtkWidget *entry_bindDN;
        GtkWidget *entry_bindPW;
        GtkWidget *hbox_spin;
-       GtkObject *spinbtn_timeout_adj;
+       GtkAdjustment *spinbtn_timeout_adj;
        GtkWidget *spinbtn_timeout;
-       GtkObject *spinbtn_maxentry_adj;
+       GtkAdjustment *spinbtn_maxentry_adj;
        GtkWidget *spinbtn_maxentry;
        CLAWS_TIP_DECL();
        gint top;
index 628ff93..be15aab 100644 (file)
@@ -15,11 +15,6 @@ libclawsgtk_la_SOURCES = \
        filesel.c \
        foldersort.c \
        gtkaspell.c \
-       gtkcmctree.c \
-       gtkcmclist.c \
-       gtkcmoptionmenu.c \
-       gtkshruler.c \
-       gtksctree.c \
        gtkutils.c \
        gtkvscrollbutton.c \
        icon_legend.c \
@@ -46,11 +41,6 @@ clawsgtkinclude_HEADERS = \
        filesel.h \
        foldersort.h \
        gtkaspell.h \
-       gtkcmctree.h \
-       gtkcmclist.h \
-       gtkcmoptionmenu.h \
-       gtksctree.h \
-       gtkshruler.h \
        gtkutils.h \
        gtkvscrollbutton.h \
        headers.h \
@@ -67,6 +57,22 @@ clawsgtkinclude_HEADERS = \
        sslcertwindow.h \
        claws-marshal.h
 
+if GTK2
+libclawsgtk_la_SOURCES += \
+       gtkcmctree.c \
+       gtkcmclist.c \
+       gtkcmoptionmenu.c \
+       gtksctree.c \
+       gtkshruler.c
+
+clawsgtkinclude_HEADERS += \
+       gtkcmctree.h \
+       gtkcmclist.h \
+       gtkcmoptionmenu.h \
+       gtksctree.h \
+       gtkshruler.h
+endif
+
 AM_CPPFLAGS = \
        -I$(srcdir)/../common \
        -I../common \
index 8fa7d12..c5014bf 100644 (file)
@@ -189,20 +189,28 @@ gchar *colorlabel_get_color_default_text(gint color_index)
 }
 
 static gboolean colorlabel_drawing_area_expose_event_cb
+#if !GTK_CHECK_VERSION(3, 0, 0)
        (GtkWidget *widget, GdkEventExpose *expose, gpointer data)
+#else
+       (GtkWidget *widget, cairo_t *cr, gpointer data)
+#endif
 {
-       GdkDrawable *drawable = gtk_widget_get_window(widget);
+#if !GTK_CHECK_VERSION(3, 0, 0)
+       cairo_t *cr;
+       GdkWindow *drawable = gtk_widget_get_window(widget);
+#endif
        GtkAllocation allocation;
        gulong c = (gulong) GPOINTER_TO_INT(data);
        GdkColor color;
-       cairo_t *cr;
 
        INTCOLOR_TO_GDKCOLOR(c, color)
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        gdk_colormap_alloc_color(gtk_widget_get_colormap(widget), &color, FALSE, TRUE);
+       cr = gdk_cairo_create(drawable);
+#endif
        gtk_widget_get_allocation(widget, &allocation);
 
-       cr = gdk_cairo_create(drawable);
        cairo_set_source_rgb(cr, 0., 0., 0.);
        cairo_rectangle(cr, 0, 0,
            allocation.width - 1,
@@ -213,7 +221,9 @@ static gboolean colorlabel_drawing_area_expose_event_cb
            allocation.width - 2,
            allocation.height - 2);
        cairo_fill(cr);
+#if !GTK_CHECK_VERSION(3, 0, 0)
        cairo_destroy(cr);
+#endif
        
        return FALSE;
 }
@@ -231,11 +241,19 @@ static GtkWidget *colorlabel_create_color_widget(GdkColor color)
                         (CL(g) << (gulong)  8) | \
                         (CL(b)))
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        g_signal_connect(G_OBJECT(widget), "expose_event", 
                         G_CALLBACK
                                (colorlabel_drawing_area_expose_event_cb),
                         GINT_TO_POINTER
                                ((gint)CR(color.red, color.green, color.blue)));
+#else
+       g_signal_connect(G_OBJECT(widget), "draw", 
+                        G_CALLBACK
+                               (colorlabel_drawing_area_expose_event_cb),
+                        GINT_TO_POINTER
+                               ((gint)CR(color.red, color.green, color.blue)));
+#endif
 
        return widget;
 }
index 49cd05f..9ec46c2 100644 (file)
@@ -26,7 +26,9 @@
 #include <gdk/gdkkeysyms.h>
 #include <gdk/gdk.h>
 #include <gtk/gtk.h>
+#if !GTK_CHECK_VERSION(3, 0, 0)
 #include "gtk/gtksctree.h"
+#endif
 #include <stdlib.h>
 #include <stdarg.h>
 #include <sys/stat.h>
@@ -49,7 +51,9 @@
 #include "defs.h"
 #include "gtkutils.h"
 #include "utils.h"
+#if !GTK_CHECK_VERSION(3, 0, 0)
 #include "gtksctree.h"
+#endif
 #include "codeconv.h"
 #include "stock_pixmap.h"
 #include "menu.h"
@@ -1215,9 +1219,11 @@ GtkWidget *gtkut_get_link_btn(GtkWidget *window, const gchar *url, const gchar *
 {
        GtkWidget *btn;
        GtkWidget *btn_label;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GdkColormap *cmap;
-       GdkColor uri_color[2] = {{0, 0, 0, 0xffff}, {0, 0xffff, 0, 0}};
        gboolean success[2];
+#endif
+       GdkColor uri_color[2] = {{0, 0, 0, 0xffff}, {0, 0xffff, 0, 0}};
        gchar *local_url = NULL;
        if (!url)
                return NULL;
@@ -1230,9 +1236,11 @@ GtkWidget *gtkut_get_link_btn(GtkWidget *window, const gchar *url, const gchar *
        btn = gtk_button_new_with_label(label?label:url);
        gtk_button_set_relief(GTK_BUTTON(btn), GTK_RELIEF_NONE);
        btn_label = gtk_bin_get_child(GTK_BIN((btn)));
+#if !GTK_CHECK_VERSION(3, 0, 0)
        cmap = gdk_drawable_get_colormap(gtk_widget_get_window(window));
        gdk_colormap_alloc_colors(cmap, uri_color, 2, FALSE, TRUE, success);
        if (success[0] == TRUE && success[1] == TRUE) {
+#endif
                GtkStyle *style;
                gtk_widget_ensure_style(btn_label);
                style = gtk_style_copy
@@ -1241,8 +1249,10 @@ GtkWidget *gtkut_get_link_btn(GtkWidget *window, const gchar *url, const gchar *
                style->fg[GTK_STATE_ACTIVE]   = uri_color[1];
                style->fg[GTK_STATE_PRELIGHT] = uri_color[0];
                gtk_widget_set_style(btn_label, style);
+#if !GTK_CHECK_VERSION(3, 0, 0)
        } else
                g_warning("about_create(): color allocation failed.\n");
+#endif
 
        g_signal_connect(G_OBJECT(btn), "enter",
                         G_CALLBACK(link_btn_enter), window);
index 0de05c0..fc969fc 100644 (file)
@@ -42,7 +42,9 @@
 #include "main.h"
 #endif
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 #include "gtkcmctree.h"
+#endif
 
 #define GTK_EVENTS_FLUSH() \
 { \
@@ -92,6 +94,7 @@ void gtkut_stock_with_text_button_set_create(GtkWidget **bbox,
                                   GtkWidget **button2, const gchar *label2, const gchar *text2,
                                   GtkWidget **button3, const gchar *label3, const gchar *text3);
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 void gtkut_ctree_node_move_if_on_the_edge
                                        (GtkCMCTree     *ctree,
                                         GtkCMCTreeNode *node,
@@ -113,6 +116,7 @@ gboolean gtkut_ctree_node_is_parent (GtkCMCTreeNode         *parent,
                                         GtkCMCTreeNode         *node);
 void gtkut_ctree_set_focus_row         (GtkCMCTree     *ctree,
                                         GtkCMCTreeNode *node);
+#endif
 
 void gtkut_clist_set_focus_row         (GtkCMCList     *clist,
                                         gint            row);
index cb3d11d..4b01d3f 100644 (file)
@@ -155,9 +155,11 @@ LogWindow *log_window_create(LogInstance instance)
 void log_window_init(LogWindow *logwin)
 {
        GtkTextBuffer *buffer;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GdkColormap *colormap;
-       GdkColor color[LOG_COLORS];
        gboolean success[LOG_COLORS];
+#endif
+       GdkColor color[LOG_COLORS];
        gint i;
 
        gtkut_convert_int_to_gdk_color(prefs_common.log_msg_color, &color[0]);
@@ -178,6 +180,7 @@ void log_window_init(LogWindow *logwin)
        logwin->status_nok_color = color[6];
        logwin->status_skip_color = color[7];
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        colormap = gdk_drawable_get_colormap(gtk_widget_get_window(logwin->window));
        gdk_colormap_alloc_colors(colormap, color, LOG_COLORS, FALSE, TRUE, success);
 
@@ -195,6 +198,7 @@ void log_window_init(LogWindow *logwin)
                        break;
                }
        }
+#endif
 
        buffer = logwin->buffer;
        gtk_text_buffer_create_tag(buffer, "message",
index c38ee92..6ed5205 100644 (file)
@@ -25,7 +25,9 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 #include "gtkcmoptionmenu.h"
+#endif
 #include "menu.h"
 #include "utils.h"
 #include "gtkutils.h"
@@ -169,6 +171,7 @@ void menu_button_position(GtkMenu *menu, gint *x, gint *y, gboolean *push_in,
                *y -= mreq.height;
 }
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 gint menu_find_option_menu_index(GtkCMOptionMenu *optmenu, gpointer data,
                                 GCompareFunc func)
 {
@@ -198,3 +201,4 @@ gint menu_find_option_menu_index(GtkCMOptionMenu *optmenu, gpointer data,
 
        return -1;
 }
+#endif
index 1efdaea..2c00d5c 100644 (file)
@@ -22,7 +22,9 @@
 
 #include <glib.h>
 #include <gtk/gtk.h>
+#if !GTK_CHECK_VERSION(3, 0, 0)
 #include "gtkcmoptionmenu.h"
+#endif
 
 #define MENU_VAL_ID "Claws::Menu::ValueID"
 #define MENU_VAL_DATA "Claws::Menu::ValueDATA"
@@ -92,8 +94,10 @@ void cm_toggle_menu_set_active(gchar *menu, gboolean active);
 void cm_menu_set_sensitive_full(GtkUIManager *gui_manager, gchar *menu, gboolean sensitive);
 void cm_toggle_menu_set_active_full(GtkUIManager *gui_manager, gchar *menu, gboolean active);
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 gint menu_find_option_menu_index(GtkCMOptionMenu *optmenu, gpointer data,
                                 GCompareFunc func);
+#endif
 
 void menu_button_position      (GtkMenu                *menu,
                                 gint                   *x,
index b32db51..8d8042b 100644 (file)
@@ -29,7 +29,9 @@
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 #include "gtkcmoptionmenu.h"
+#endif
 #include "utils.h"
 #include "combobox.h"
 #include "menu.h"
@@ -57,7 +59,9 @@ struct _QuickSearch
 {
        GtkWidget                       *hbox_search;
        GtkWidget                       *search_type;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GtkWidget                       *search_type_opt;
+#endif
        GtkWidget                       *search_string_entry;
        GtkWidget                       *search_condition_expression;
        GtkWidget                       *search_description;
@@ -113,6 +117,7 @@ void quicksearch_set_recursive(QuickSearch *quicksearch, gboolean recursive)
 
 static void quicksearch_set_type(QuickSearch *quicksearch, gint type)
 {
+#if !GTK_CHECK_VERSION(3, 0, 0)
        gint index;
        quicksearch->request->type = type;
        if (quicksearch->gui == FALSE)
@@ -121,6 +126,7 @@ static void quicksearch_set_type(QuickSearch *quicksearch, gint type)
                                        GINT_TO_POINTER(type),
                                        NULL);
        gtk_cmoption_menu_set_history(GTK_CMOPTION_MENU(quicksearch->search_type_opt), index);  
+#endif
 }
 
 static gchar *quicksearch_get_text(QuickSearch * quicksearch)
@@ -679,7 +685,9 @@ QuickSearch *quicksearch_new()
        QuickSearch *quicksearch;
 
        GtkWidget *hbox_search;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GtkWidget *search_type_opt;
+#endif
        GtkWidget *search_type;
        GtkWidget *search_string_entry;
        GtkWidget *search_hbox;
@@ -696,9 +704,11 @@ QuickSearch *quicksearch_new()
        /* quick search */
        hbox_search = gtk_hbox_new(FALSE, 0);
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        search_type_opt = gtk_cmoption_menu_new();
        gtk_widget_show(search_type_opt);
        gtk_box_pack_start(GTK_BOX(hbox_search), search_type_opt, FALSE, FALSE, 0);
+#endif
 
        search_type = gtk_menu_new();
        MENUITEM_ADD (search_type, menuitem,
@@ -777,9 +787,11 @@ QuickSearch *quicksearch_new()
                         G_CALLBACK(searchtype_autorun_changed),
                         quicksearch);
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        gtk_cmoption_menu_set_menu(GTK_CMOPTION_MENU(search_type_opt), search_type);
 
        quicksearch->search_type_opt = search_type_opt;
+#endif
        quicksearch_set_type(quicksearch, prefs_common.summary_quicksearch_type);
 
        gtk_widget_show(search_type);
@@ -980,10 +992,16 @@ gboolean quicksearch_is_active(QuickSearch *quicksearch)
 
 static void quicksearch_set_active(QuickSearch *quicksearch, gboolean active)
 {
+#if !GTK_CHECK_VERSION(3, 0, 0)
        static GdkColor yellow;
        static GdkColor red;
        static GdkColor black;
        static gboolean colors_initialised = FALSE;
+#else
+       static GdkColor yellow = { (guint32)0, (guint16)0xf5, (guint16)0xf6, (guint16)0xbe };
+       static GdkColor red = { (guint32)0, (guint16)0xff, (guint16)0x70, (guint16)0x70 };
+       static GdkColor black = { (guint32)0, (guint16)0x0, (guint16)0x0, (guint16)0x0 };
+#endif
        gboolean error = FALSE;
 
        
@@ -991,6 +1009,7 @@ static void quicksearch_set_active(QuickSearch *quicksearch, gboolean active)
        if (quicksearch->gui == FALSE)
                return;
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        if (!colors_initialised) {
                gdk_color_parse("#f5f6be", &yellow);
                gdk_color_parse("#000000", &black);
@@ -1002,6 +1021,7 @@ static void quicksearch_set_active(QuickSearch *quicksearch, gboolean active)
                colors_initialised &= gdk_colormap_alloc_color(
                        gdk_colormap_get_system(), &red, FALSE, TRUE);
        }
+#endif
 
        if (active && 
                (prefs_common.summary_quicksearch_type == QUICK_SEARCH_EXTENDED
@@ -1010,14 +1030,18 @@ static void quicksearch_set_active(QuickSearch *quicksearch, gboolean active)
 
        if (active) {
                gtk_widget_set_sensitive(quicksearch->clear_search, TRUE);
+#if !GTK_CHECK_VERSION(3, 0, 0)
                if (colors_initialised) {
+#endif
                        gtk_widget_modify_base(
                                gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))),
                                GTK_STATE_NORMAL, error ? &red : &yellow);
                        gtk_widget_modify_text(
                                gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))),
                                GTK_STATE_NORMAL, &black);
+#if !GTK_CHECK_VERSION(3, 0, 0)
                }
+#endif
        } else {
                gtk_widget_set_sensitive(quicksearch->clear_search, FALSE);
                if (colors_initialised) {
@@ -1027,7 +1051,9 @@ static void quicksearch_set_active(QuickSearch *quicksearch, gboolean active)
                        gtk_widget_modify_text(
                                gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))),
                                GTK_STATE_NORMAL, NULL);
+#if !GTK_CHECK_VERSION(3, 0, 0)
                }
+#endif
        }
 
        if (!active) {
index f96e461..1d6dbb5 100644 (file)
 static void claws_spell_entry_init             (ClawsSpellEntry *entry);
 static void claws_spell_entry_editable_init    (GtkEditableClass *iface);
 static void claws_spell_entry_finalize         (GObject *object);
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static void claws_spell_entry_destroy          (GtkObject *object);
 static gint claws_spell_entry_expose           (GtkWidget *widget,
                                                 GdkEventExpose *event);
+#else
+static void claws_spell_entry_destroy          (GtkWidget *object);
+static gint claws_spell_entry_expose           (GtkWidget *widget,
+                                                cairo_t *cr);
+#endif
 static gint claws_spell_entry_button_press     (GtkWidget *widget,
                                                 GdkEventButton *event);
 static gboolean claws_spell_entry_popup_menu   (GtkWidget *widget,
@@ -76,7 +82,9 @@ G_DEFINE_TYPE_EXTENDED(ClawsSpellEntry, claws_spell_entry, GTK_TYPE_ENTRY, 0, G_
 static void claws_spell_entry_class_init(ClawsSpellEntryClass *klass)
 {
        GObjectClass    *g_object_class;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GtkObjectClass  *gtk_object_class;
+#endif
        GtkWidgetClass  *widget_class;
        
        parent_class = g_type_class_peek_parent(klass);
@@ -84,12 +92,19 @@ static void claws_spell_entry_class_init(ClawsSpellEntryClass *klass)
        g_object_class = G_OBJECT_CLASS(klass);
        g_object_class->finalize = claws_spell_entry_finalize;
        
+#if !GTK_CHECK_VERSION(3, 0, 0)
        gtk_object_class = GTK_OBJECT_CLASS(klass);
        gtk_object_class->destroy = claws_spell_entry_destroy;
+#endif
        
        widget_class = GTK_WIDGET_CLASS(klass);
-       widget_class->expose_event = claws_spell_entry_expose;
        widget_class->button_press_event = claws_spell_entry_button_press;
+#if !GTK_CHECK_VERSION(3, 0, 0)
+       widget_class->expose_event = claws_spell_entry_expose;
+#else
+       widget_class->draw = claws_spell_entry_expose;
+       widget_class->destroy = claws_spell_entry_destroy;
+#endif
        
        g_type_class_add_private(g_object_class,
                        sizeof(struct _ClawsSpellEntryPriv));
@@ -129,10 +144,17 @@ static void claws_spell_entry_finalize(GObject *object)
        G_OBJECT_CLASS(parent_class)->finalize(object);
 }
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static void claws_spell_entry_destroy(GtkObject *object)
 {
        GTK_OBJECT_CLASS(parent_class)->destroy(object);
 }
+#else
+static void claws_spell_entry_destroy(GtkWidget *object)
+{
+       GTK_WIDGET_CLASS(parent_class)->destroy(object);
+}
+#endif
 
 GtkWidget *claws_spell_entry_new(void)
 {
@@ -436,7 +458,11 @@ void claws_spell_entry_recheck_all(ClawsSpellEntry *entry)
        }
 }
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static gint claws_spell_entry_expose(GtkWidget *widget, GdkEventExpose *event)
+#else
+static gint claws_spell_entry_expose(GtkWidget *widget, cairo_t *cr)
+#endif
 {
        ClawsSpellEntry *entry = CLAWS_SPELL_ENTRY(widget);
        GtkEntry *gtk_entry = GTK_ENTRY(widget);
@@ -447,7 +473,11 @@ static gint claws_spell_entry_expose(GtkWidget *widget, GdkEventExpose *event)
                pango_layout_set_attributes(layout, entry->priv->attr_list);
        }
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        return GTK_WIDGET_CLASS(parent_class)->expose_event (widget, event);
+#else
+       return GTK_WIDGET_CLASS(parent_class)->draw (widget, cr);
+#endif
 }
 
 static gint claws_spell_entry_button_press(GtkWidget *widget, GdkEventButton *event)
index d226f82..6b6ea7d 100644 (file)
@@ -1553,9 +1553,11 @@ MainWindow *main_window_create()
        FolderView *folderview;
        SummaryView *summaryview;
        MessageView *messageview;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GdkColormap *colormap;
-       GdkColor color[4];
        gboolean success[4];
+#endif
+       GdkColor color[4];
        GtkWidget *ac_menu;
        gint i;
 
@@ -2206,12 +2208,14 @@ MainWindow *main_window_create()
        color[2] = folderview->color_new;
        color[3] = folderview->color_op;
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        colormap = gdk_drawable_get_colormap(gtk_widget_get_window(window));
        gdk_colormap_alloc_colors(colormap, color, 4, FALSE, TRUE, success);
        for (i = 0; i < 4; i++) {
                if (success[i] == FALSE)
                        g_warning("MainWindow: color allocation %d failed\n", i);
        }
+#endif
 
        debug_print("done.\n");
 
index 4dbf1af..0fc06cc 100644 (file)
@@ -27,7 +27,6 @@
 #include <glib/gi18n.h>
 #include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
-#include "gtk/gtksctree.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
index 7a3f519..ac2cb49 100644 (file)
@@ -73,12 +73,14 @@ typedef enum
 
 #define N_MIMEVIEW_COLS        3
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static void mimeview_set_multipart_tree                (MimeView       *mimeview,
                                                 MimeInfo       *mimeinfo,
                                                 GtkCMCTreeNode *parent);
 static GtkCMCTreeNode *mimeview_append_part    (MimeView       *mimeview,
                                                 MimeInfo       *partinfo,
                                                 GtkCMCTreeNode *parent);
+#endif
 static void mimeview_show_message_part         (MimeView       *mimeview,
                                                 MimeInfo       *partinfo);
 static void mimeview_change_view_type          (MimeView       *mimeview,
@@ -89,10 +91,12 @@ static gchar *mimeview_get_filename_for_part                (MimeInfo       *partinfo,
 static gboolean mimeview_write_part            (const gchar    *filename,
                                                 MimeInfo       *partinfo);
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static void mimeview_selected          (GtkCMCTree     *ctree,
                                         GtkCMCTreeNode *node,
                                         gint            column,
                                         MimeView       *mimeview);
+#endif
 static void mimeview_start_drag        (GtkWidget      *widget,
                                         gint            button,
                                         GdkEvent       *event,
index 2d360ba..0432559 100644 (file)
@@ -27,7 +27,9 @@ typedef struct _MimeViewer            MimeViewer;
 #include <glib.h>
 #include <gdk/gdk.h>
 #include <gtk/gtk.h>
+#if !GTK_CHECK_VERSION(3, 0, 0)
 #include "gtk/gtksctree.h"
+#endif
 #ifdef USE_PTHREAD
 #include <pthread.h>
 #endif
@@ -77,7 +79,9 @@ struct _MimeView
 
        GtkWidget *popupmenu;
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GtkCMCTreeNode *opened;
+#endif
 
        TextView *textview;
        MimeViewer *mimeviewer;
index 201a2c7..7c06787 100644 (file)
@@ -106,7 +106,7 @@ static void bogofilter_create_widget_func(PrefsPage * _page,
        GtkWidget *hbox_mark_as_read;
 
        GtkWidget *max_size_label;
-       GtkObject *max_size_spinbtn_adj;
+       GtkAdjustment *max_size_spinbtn_adj;
        GtkWidget *max_size_spinbtn;
        GtkWidget *max_size_kb_label;
 
index ecbd077..41d2f30 100644 (file)
@@ -26,6 +26,9 @@
 #include <glib.h>
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
+#if GTK_CHECK_VERSION(3, 0, 0)
+#include <gtk/gtkx.h>
+#endif
 #include <gdk/gdkx.h>
 
 #include "common/claws.h"
@@ -60,7 +63,11 @@ static GtkWidget *dillo_get_widget(MimeViewer *_viewer)
        return GTK_WIDGET(viewer->widget);
 }
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
+static gboolean socket_destroy_cb(GtkObject *object, gpointer data)
+#else
 static gboolean socket_destroy_cb(GtkObject *object, gpointer data)
+#endif
 {
        DilloViewer *viewer = (DilloViewer *) data;
        debug_print("Destroyed dillo socket %p\n", viewer->socket);
index ae6e7df..5c149ff 100644 (file)
@@ -84,7 +84,7 @@ static void prefs_gpg_create_widget_func(PrefsPage *_page,
        GtkWidget *hbox1;
        GtkWidget *vbox1, *vbox2;
        GtkWidget *label_expire1;
-       GtkObject *spinbtn_store_passphrase_adj;
+       GtkAdjustment *spinbtn_store_passphrase_adj;
        GtkWidget *spinbtn_store_passphrase;
        GtkWidget *label_expire2;
        GtkWidget *frame_passphrase;
index 5454a3c..79c3074 100644 (file)
@@ -229,17 +229,17 @@ static void spamassassin_create_widget_func(PrefsPage * _page,
        GtkWidget *spamd_label;
        GtkWidget *spamd_hostname_entry;
        GtkWidget *spamd_colon_label;
-       GtkObject *spamd_port_spinbtn_adj;
+       GtkAdjustment *spamd_port_spinbtn_adj;
        GtkWidget *spamd_port_spinbtn;
        GtkWidget *spamd_socket_entry;
 
        GtkWidget *max_size_label;
-       GtkObject *max_size_spinbtn_adj;
+       GtkAdjustment *max_size_spinbtn_adj;
        GtkWidget *max_size_spinbtn;
        GtkWidget *max_size_kb_label;
 
        GtkWidget *timeout_label;
-       GtkObject *timeout_spinbtn_adj;
+       GtkAdjustment *timeout_spinbtn_adj;
        GtkWidget *timeout_spinbtn;
        GtkWidget *timeout_seconds_label;
 
index 7f53ecb..91a3f55 100644 (file)
@@ -34,7 +34,9 @@
 #include <string.h>
 #include <stdlib.h>
 #include <ctype.h>
+#if !GTK_CHECK_VERSION(3, 0, 0)
 #include "gtkcmoptionmenu.h"
+#endif
 #include "main.h"
 #include "prefs_gtk.h"
 #include "prefs_account.h"
@@ -152,7 +154,7 @@ typedef struct ReceivePage
        GtkWidget *frame_maxarticle;
        GtkWidget *maxarticle_label;
        GtkWidget *maxarticle_spinbtn;
-       GtkObject *maxarticle_spinbtn_adj;
+       GtkAdjustment *maxarticle_spinbtn_adj;
 } ReceivePage;
 
 typedef struct SendPage
@@ -283,8 +285,10 @@ typedef struct AdvancedPage
        GtkWidget *nntpport_spinbtn;
        GtkWidget *domain_checkbtn;
        GtkWidget *domain_entry;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GtkWidget *crosspost_checkbtn;
        GtkWidget *crosspost_colormenu;
+#endif
 
 #ifndef G_OS_WIN32
        GtkWidget *tunnelcmd_checkbtn;
@@ -349,9 +353,11 @@ static void prefs_account_smtp_auth_type_set_optmenu       (PrefParam *pparam);
 static void prefs_account_enum_set_data_from_radiobtn  (PrefParam *pparam);
 static void prefs_account_enum_set_radiobtn            (PrefParam *pparam);
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static void crosspost_color_toggled(void);
 static void prefs_account_crosspost_set_data_from_colormenu(PrefParam *pparam);
 static void prefs_account_crosspost_set_colormenu(PrefParam *pparam);
+#endif
 
 static void prefs_account_nntpauth_toggled(GtkToggleButton *button,
                                           gpointer user_data);
@@ -814,6 +820,7 @@ static PrefParam advanced_param[] = {
         &advanced_page.tunnelcmd_entry,
         prefs_set_data_from_entry, prefs_set_entry},
 #endif
+#if !GTK_CHECK_VERSION(3, 0, 0)
        {"mark_crosspost_read", "FALSE", &tmp_ac_prefs.mark_crosspost_read, P_BOOL,
         &advanced_page.crosspost_checkbtn,
         prefs_set_data_from_toggle, prefs_set_toggle},
@@ -822,6 +829,7 @@ static PrefParam advanced_param[] = {
         &advanced_page.crosspost_colormenu,
         prefs_account_crosspost_set_data_from_colormenu,
         prefs_account_crosspost_set_colormenu},
+#endif
 
        {"set_sent_folder", "FALSE", &tmp_ac_prefs.set_sent_folder, P_BOOL,
         &advanced_page.sent_folder_checkbtn,
@@ -1382,7 +1390,7 @@ static void receive_create_widget_func(PrefsPage * _page,
        GtkWidget *frame2;
        GtkWidget *maxarticle_label;
        GtkWidget *maxarticle_spinbtn;
-       GtkObject *maxarticle_spinbtn_adj;
+       GtkAdjustment *maxarticle_spinbtn_adj;
        CLAWS_TIP_DECL();
 
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
@@ -2609,9 +2617,11 @@ static void advanced_create_widget_func(PrefsPage * _page,
        GtkWidget *checkbtn_domain;
        GtkWidget *entry_domain;
        gchar *tip_domain;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GtkWidget *checkbtn_crosspost;
        GtkWidget *colormenu_crosspost;
        GtkWidget *menu;
+#endif
 #ifndef G_OS_WIN32
        GtkWidget *checkbtn_tunnelcmd;
        GtkWidget *entry_tunnelcmd;
@@ -2710,6 +2720,7 @@ static void advanced_create_widget_func(PrefsPage * _page,
        CLAWS_SET_TIP(imap_use_trash_checkbtn,
                             _("Moves deleted mails to trash instead of using the \\Deleted flag without expunging."));
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        PACK_CHECK_BUTTON (hbox1, checkbtn_crosspost, 
                           _("Mark cross-posted messages as read and color:"));
        g_signal_connect (G_OBJECT (checkbtn_crosspost), "toggled",
@@ -2723,6 +2734,7 @@ static void advanced_create_widget_func(PrefsPage * _page,
        menu = colorlabel_create_color_menu();
        gtk_cmoption_menu_set_menu (GTK_CMOPTION_MENU(colormenu_crosspost), menu);
        SET_TOGGLE_SENSITIVITY(checkbtn_crosspost, colormenu_crosspost);
+#endif
 
        PACK_HBOX (hbox1);
 #undef PACK_HBOX
@@ -2788,8 +2800,10 @@ static void advanced_create_widget_func(PrefsPage * _page,
        page->nntpport_spinbtn          = spinbtn_nntpport;
        page->domain_checkbtn           = checkbtn_domain;
        page->domain_entry              = entry_domain;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        page->crosspost_checkbtn        = checkbtn_crosspost;
        page->crosspost_colormenu       = colormenu_crosspost;
+#endif
 
 #ifndef G_OS_WIN32
        page->tunnelcmd_checkbtn        = checkbtn_tunnelcmd;
@@ -3692,6 +3706,7 @@ PrefsAccount *prefs_account_open(PrefsAccount *ac_prefs, gboolean *dirty)
                return ac_prefs;
 }
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static void crosspost_color_toggled(void)
 {
        gboolean is_active;
@@ -3724,6 +3739,7 @@ static void prefs_account_crosspost_set_colormenu(PrefParam *pparam)
        menuitem = gtk_menu_get_active(GTK_MENU(menu));
        gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
 }
+#endif
 
 static void pop_bfr_smtp_tm_set_sens(GtkWidget *widget, gpointer data)
 {
@@ -4155,8 +4171,10 @@ static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
                gtk_widget_hide(advanced_page.popport_hbox);
                gtk_widget_hide(advanced_page.imapport_hbox);
                gtk_widget_show(advanced_page.nntpport_hbox);
+#if !GTK_CHECK_VERSION(3, 0, 0)
                gtk_widget_show(advanced_page.crosspost_checkbtn);
                gtk_widget_show(advanced_page.crosspost_colormenu);
+#endif
 #ifndef G_OS_WIN32
                gtk_widget_hide(advanced_page.tunnelcmd_checkbtn);
                gtk_widget_hide(advanced_page.tunnelcmd_entry);
@@ -4251,8 +4269,10 @@ static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
                gtk_widget_hide(advanced_page.popport_hbox);
                gtk_widget_hide(advanced_page.imapport_hbox);
                gtk_widget_hide(advanced_page.nntpport_hbox);
+#if !GTK_CHECK_VERSION(3, 0, 0)
                gtk_widget_hide(advanced_page.crosspost_checkbtn);
                gtk_widget_hide(advanced_page.crosspost_colormenu);
+#endif
 #ifndef G_OS_WIN32
                gtk_widget_hide(advanced_page.tunnelcmd_checkbtn);
                gtk_widget_hide(advanced_page.tunnelcmd_entry);
@@ -4360,8 +4380,10 @@ static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
                gtk_widget_hide(advanced_page.popport_hbox);
                gtk_widget_show(advanced_page.imapport_hbox);
                gtk_widget_hide(advanced_page.nntpport_hbox);
+#if !GTK_CHECK_VERSION(3, 0, 0)
                gtk_widget_hide(advanced_page.crosspost_checkbtn);
                gtk_widget_hide(advanced_page.crosspost_colormenu);
+#endif
 #ifndef G_OS_WIN32
                gtk_widget_show(advanced_page.tunnelcmd_checkbtn);
                gtk_widget_show(advanced_page.tunnelcmd_entry);
@@ -4454,8 +4476,10 @@ static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
                gtk_widget_hide(advanced_page.popport_hbox);
                gtk_widget_hide(advanced_page.imapport_hbox);
                gtk_widget_hide(advanced_page.nntpport_hbox);
+#if !GTK_CHECK_VERSION(3, 0, 0)
                gtk_widget_hide(advanced_page.crosspost_checkbtn);
                gtk_widget_hide(advanced_page.crosspost_colormenu);
+#endif
 #ifndef G_OS_WIN32
                gtk_widget_hide(advanced_page.tunnelcmd_checkbtn);
                gtk_widget_hide(advanced_page.tunnelcmd_entry);
@@ -4554,8 +4578,10 @@ static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
                gtk_widget_show(advanced_page.popport_hbox);
                gtk_widget_hide(advanced_page.imapport_hbox);
                gtk_widget_hide(advanced_page.nntpport_hbox);
+#if !GTK_CHECK_VERSION(3, 0, 0)
                gtk_widget_hide(advanced_page.crosspost_checkbtn);
                gtk_widget_hide(advanced_page.crosspost_colormenu);
+#endif
 #ifndef G_OS_WIN32
                gtk_widget_hide(advanced_page.tunnelcmd_checkbtn);
                gtk_widget_hide(advanced_page.tunnelcmd_entry);
index 769b8a2..dd29b62 100644 (file)
@@ -85,12 +85,12 @@ static void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *win
 
        GtkWidget *hbox_undolevel;
        GtkWidget *label_undolevel;
-       GtkObject *spinbtn_undolevel_adj;
+       GtkAdjustment *spinbtn_undolevel_adj;
        GtkWidget *spinbtn_undolevel;
 
        GtkWidget *hbox_warn_large_insert;
        GtkWidget *checkbtn_warn_large_insert;
-       GtkObject *spinbtn_warn_large_insert_adj;
+       GtkAdjustment *spinbtn_warn_large_insert_adj;
        GtkWidget *spinbtn_warn_large_insert_size;
        GtkWidget *label_warn_large_insert_size;
 
@@ -102,7 +102,7 @@ static void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *win
 
        GtkWidget *hbox_autosave;
        GtkWidget *checkbtn_autosave;
-       GtkObject *spinbtn_autosave_adj;
+       GtkAdjustment *spinbtn_autosave_adj;
        GtkWidget *spinbtn_autosave_length;
        GtkWidget *label_autosave_length;
        
index 8f28788..678cf59 100644 (file)
@@ -32,7 +32,9 @@
 #include <string.h>
 #include <errno.h>
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 #include "gtkcmoptionmenu.h"
+#endif
 #include "main.h"
 #include "prefs_gtk.h"
 #include "prefs_filtering_action.h"
@@ -113,7 +115,9 @@ static struct FilteringAction_ {
        GtkWidget *dest_entry;
        GtkWidget *dest_btn;
        GtkWidget *exec_btn;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GtkWidget *color_optmenu;
+#endif
        GtkWidget *header_combo;
        GtkWidget *header_entry;
        GtkWidget *addressbook_btn;
@@ -172,7 +176,9 @@ static struct {
        { N_("Message flags"),  N_("Mark as spam"),             ACTION_MARK_AS_SPAM },
        { N_("Message flags"),  N_("Mark as ham"),              ACTION_MARK_AS_HAM },
        { NULL,                 N_("Execute"),                  ACTION_EXECUTE },
+#if !GTK_CHECK_VERSION(3, 0, 0)
        { NULL,                 N_("Color label"),              ACTION_COLOR },
+#endif
        { N_("Resend"),         N_("Forward"),                  ACTION_FORWARD },
        { N_("Resend"),         N_("Forward as attachment"),    ACTION_FORWARD_AS_ATTACHMENT },
        { N_("Resend"),         N_("Redirect"),                 ACTION_REDIRECT },
@@ -270,9 +276,11 @@ void prefs_filtering_action_open(GSList *action_list,
        if (!filtering_action.window) {
                prefs_filtering_action_create();
        } else {
+#if !GTK_CHECK_VERSION(3, 0, 0)
                /* update color label menu */
                gtk_cmoption_menu_set_menu(GTK_CMOPTION_MENU(filtering_action.color_optmenu),
                                colorlabel_create_color_menu());
+#endif
        }
 
        manage_window_set_transient(GTK_WINDOW(filtering_action.window));
@@ -355,7 +363,9 @@ static void prefs_filtering_action_create(void)
 
        GtkWidget *exec_btn;
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GtkWidget *color_optmenu;
+#endif
 
        static GdkGeometry geometry;
 
@@ -503,12 +513,14 @@ static void prefs_filtering_action_create(void)
        score_entry = gtk_spin_button_new_with_range(-1000, 1000, 1);
        gtk_box_pack_start(GTK_BOX(hbox1), score_entry, FALSE, FALSE, 0);
        
+#if !GTK_CHECK_VERSION(3, 0, 0)
        color_optmenu = gtk_cmoption_menu_new();
        gtk_size_group_add_widget(size_action, color_optmenu);
        gtk_cmoption_menu_set_menu(GTK_CMOPTION_MENU(color_optmenu),
                                 colorlabel_create_color_menu());
        prefs_filtering_action_check_widget_width(color_optmenu);
        gtk_box_pack_start(GTK_BOX(hbox1), color_optmenu, FALSE, FALSE, 0);
+#endif
 
        tags_combo = gtk_combo_box_new_text ();
        gtk_size_group_add_widget(size_action, tags_combo);
@@ -627,7 +639,9 @@ static void prefs_filtering_action_create(void)
        filtering_action.dest_entry = dest_entry;
        filtering_action.dest_btn = dest_btn;
        filtering_action.exec_btn = exec_btn;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        filtering_action.color_optmenu = color_optmenu;
+#endif
        filtering_action.score_entry = score_entry;
        filtering_action.header_combo = header_combo;
        filtering_action.header_entry = header_entry;
@@ -826,8 +840,10 @@ static gint prefs_filtering_action_get_matching_from_action(Action action_id)
                return MATCHACTION_REDIRECT;
        case ACTION_EXECUTE:
                return MATCHACTION_EXECUTE;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        case ACTION_COLOR:
                return MATCHACTION_COLOR;
+#endif
        case ACTION_HIDE:
                return MATCHACTION_HIDE;
        case ACTION_IGNORE:
@@ -899,11 +915,13 @@ static FilteringAction * prefs_filtering_action_dialog_to_action(gboolean alert)
                        return NULL;
                }
                break;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        case ACTION_COLOR:
                labelcolor = colorlabel_get_color_menu_active_item(
                        gtk_cmoption_menu_get_menu(GTK_CMOPTION_MENU(filtering_action.color_optmenu)));
                destination = NULL;     
                break;
+#endif
         case ACTION_CHANGE_SCORE:
         case ACTION_SET_SCORE:
                score = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(
@@ -1335,8 +1353,10 @@ static void prefs_filtering_action_type_selection_changed(GtkWidget *combo,
        prefs_filtering_action_enable_widget(filtering_action.exec_btn,
                                                (value == ACTION_EXECUTE));
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        prefs_filtering_action_enable_widget(filtering_action.color_optmenu,
                                                (value == ACTION_COLOR));
+#endif
 
        prefs_filtering_action_enable_widget(filtering_action.header_combo,
                                        (value == ACTION_ADD_TO_ADDRESSBOOK));  
@@ -1362,9 +1382,11 @@ static void prefs_filtering_action_type_selection_changed(GtkWidget *combo,
        case ACTION_MOVE:
                gtk_label_set_text(GTK_LABEL(filtering_action.label3), _("Destination"));
                break;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        case ACTION_COLOR:
                gtk_label_set_text(GTK_LABEL(filtering_action.label3), _("Color"));
                break;
+#endif
        case ACTION_EXECUTE:
                gtk_label_set_text(GTK_LABEL(filtering_action.label3), _("Execute"));
                break;
@@ -1568,6 +1590,7 @@ static gboolean prefs_filtering_actions_selected
                combobox_select_by_data(GTK_COMBO_BOX(filtering_action.action_combo),
                                     ACTION_EXECUTE);
                break;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        case MATCHACTION_COLOR:
                combobox_select_by_data(GTK_COMBO_BOX(filtering_action.action_combo),
                                     ACTION_COLOR);
@@ -1577,6 +1600,7 @@ static gboolean prefs_filtering_actions_selected
                                                filtering_action.color_optmenu));
                g_signal_emit_by_name(G_OBJECT(menu), "selection-done", menu);
                break;
+#endif
        case MATCHACTION_CHANGE_SCORE:
                combobox_select_by_data(GTK_COMBO_BOX(filtering_action.action_combo),
                                     ACTION_CHANGE_SCORE);
index 6e48087..82a6e9f 100644 (file)
@@ -1665,8 +1665,12 @@ static regex_t *summary_compile_simplify_regexp(gchar *simplify_subject_regexp)
 
 static void folder_regexp_test_cb(GtkWidget *widget, gpointer data)
 {
+#if !GTK_CHECK_VERSION(3, 0, 0)
        static GdkColor red;
        static gboolean colors_initialised = FALSE;
+#else
+       static GdkColor red = { (guint32)0, (guint16)0xff, (guint16)0x70, (guint16)0x70 };
+#endif
        static gchar buf[BUFFSIZE];
        FolderItemGeneralPage *page = (FolderItemGeneralPage *)data;
        gchar *test_string, *regexp;
@@ -1692,17 +1696,20 @@ static void folder_regexp_test_cb(GtkWidget *widget, gpointer data)
                return;
        }
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        if (!colors_initialised) {
                gdk_color_parse("#ff7070", &red);
                colors_initialised = gdk_colormap_alloc_color(
                        gdk_colormap_get_system(), &red, FALSE, TRUE);
        }
+#endif
 
        preg = summary_compile_simplify_regexp(regexp);
-       if (colors_initialised) {
+#if !GTK_CHECK_VERSION(3, 0, 0)
+       if (colors_initialised)
                gtk_widget_modify_base(page->entry_simplify_subject,
                                GTK_STATE_NORMAL, preg ? NULL : &red);
-       }
+#endif
 
        if (preg != NULL) {
                string_remove_match(buf, BUFFSIZE, test_string, preg);
index 7d6c560..e22d659 100644 (file)
@@ -97,14 +97,14 @@ static void prefs_logging_create_widget(PrefsPage *_page, GtkWindow *window,
        GtkWidget *hbox_clip_network_log;
        GtkWidget *checkbtn_clip_network_log;
        GtkWidget *spinbtn_network_log_length;
-       GtkObject *spinbtn_network_log_length_adj;
+       GtkAdjustment *spinbtn_network_log_length_adj;
        GtkWidget *hbox_checkbtn;
 #ifndef G_OS_WIN32
        GtkWidget *vbox1_filtering_log;
        GtkWidget *hbox_clip_filtering_log;
        GtkWidget *checkbtn_clip_filtering_log;
        GtkWidget *spinbtn_filtering_log_length;
-       GtkObject *spinbtn_filtering_log_length_adj;
+       GtkAdjustment *spinbtn_filtering_log_length_adj;
        GtkWidget *hbox_filtering_log;
        GtkWidget *checkbtn_filtering_log;
        GtkWidget *frame_filtering_log;
index 5f81798..c615f76 100644 (file)
@@ -32,7 +32,9 @@
 #include <string.h>
 #include <errno.h>
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 #include "gtkcmoptionmenu.h"
+#endif
 #include "main.h"
 #include "prefs_gtk.h"
 #include "prefs_matcher.h"
@@ -93,7 +95,9 @@ static struct Matcher {
 #ifndef G_OS_WIN32
        GtkWidget *regexp_checkbtn;
 #endif
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GtkWidget *color_optmenu;
+#endif
 
        GtkWidget *test_btn;
        GtkWidget *addressbook_select_btn;
@@ -429,9 +433,11 @@ void prefs_matcher_open(MatcherList *matchers, PrefsMatcherSignal *cb)
                prefs_matcher_models_create();
                prefs_matcher_create();
        } else {
+#if !GTK_CHECK_VERSION(3, 0, 0)
                /* update color label menu */
                gtk_cmoption_menu_set_menu(GTK_CMOPTION_MENU(matcher.color_optmenu),
                                colorlabel_create_color_menu());
+#endif
        }
 
        manage_window_set_transient(GTK_WINDOW(matcher.window));
@@ -523,7 +529,9 @@ static void prefs_matcher_create(void)
        GtkWidget *test_btn;
        GtkWidget *addressbook_select_btn;
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GtkWidget *color_optmenu;
+#endif
 
        static GdkGeometry geometry;
        GtkSizeGroup *size_group;
@@ -665,11 +673,13 @@ static void prefs_matcher_create(void)
        match_combo = gtkut_sc_combobox_create(NULL, TRUE);
        gtk_box_pack_start(GTK_BOX(match_hbox), match_combo, TRUE, TRUE, 0);
        
+#if !GTK_CHECK_VERSION(3, 0, 0)
        /* color labels combo */
        color_optmenu = gtk_cmoption_menu_new();
        gtk_cmoption_menu_set_menu(GTK_CMOPTION_MENU(color_optmenu),
                                 colorlabel_create_color_menu());
        gtk_box_pack_start(GTK_BOX(match_hbox), color_optmenu, FALSE, FALSE, 0);
+#endif
        
        /* address header name */
        header_addr_combo = combobox_text_new(TRUE,
@@ -824,7 +834,9 @@ static void prefs_matcher_create(void)
        matcher.bool_op_combo = bool_op_combo;
        matcher.test_btn = test_btn;
        matcher.addressbook_select_btn = addressbook_select_btn;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        matcher.color_optmenu = color_optmenu;
+#endif
        matcher.match_label = match_label;
        matcher.criteria_label2 = criteria_label2;
        matcher.headers_combo = headers_combo;
@@ -914,7 +926,9 @@ static void prefs_matcher_reset_condition(void)
                gtk_combo_box_set_active(GTK_COMBO_BOX(matcher.match_combo), 0);
        if (match_combo2_model_set())
                gtk_combo_box_set_active(GTK_COMBO_BOX(matcher.match_combo2), 0);
+#if !GTK_CHECK_VERSION(3, 0, 0)
        gtk_cmoption_menu_set_history(GTK_CMOPTION_MENU(matcher.color_optmenu), 0);
+#endif
        gtk_spin_button_set_value(GTK_SPIN_BUTTON(matcher.numeric_entry), 0);
        gtk_entry_set_text(GTK_ENTRY(matcher.header_entry), "");
        gtk_entry_set_text(GTK_ENTRY(matcher.header_addr_entry), "");
@@ -1055,9 +1069,11 @@ static gint prefs_matcher_get_criteria_from_matching(gint matching_id)
        case MATCHCRITERIA_PARTIAL:
        case MATCHCRITERIA_NOT_PARTIAL:
                return CRITERIA_PARTIAL;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        case MATCHCRITERIA_COLORLABEL:
        case MATCHCRITERIA_NOT_COLORLABEL:
                return CRITERIA_COLORLABEL;
+#endif
        case MATCHCRITERIA_IGNORE_THREAD:
        case MATCHCRITERIA_NOT_IGNORE_THREAD:
                return CRITERIA_IGNORE_THREAD;
@@ -1168,8 +1184,10 @@ static gint prefs_matcher_get_matching_from_criteria(gint criteria_id)
                return MATCHCRITERIA_SIGNED;
        case CRITERIA_PARTIAL:
                return MATCHCRITERIA_PARTIAL;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        case CRITERIA_COLORLABEL:
                return MATCHCRITERIA_COLORLABEL;
+#endif
        case CRITERIA_IGNORE_THREAD:
                return MATCHCRITERIA_IGNORE_THREAD;
        case CRITERIA_WATCH_THREAD:
@@ -1260,8 +1278,10 @@ static gint prefs_matcher_not_criteria(gint matcher_criteria)
                return MATCHCRITERIA_NOT_SIGNED;
        case MATCHCRITERIA_PARTIAL:
                return MATCHCRITERIA_NOT_PARTIAL;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        case MATCHCRITERIA_COLORLABEL:
                return MATCHCRITERIA_NOT_COLORLABEL;
+#endif
        case MATCHCRITERIA_IGNORE_THREAD:
                return MATCHCRITERIA_NOT_IGNORE_THREAD;
        case MATCHCRITERIA_WATCH_THREAD:
@@ -1323,8 +1343,10 @@ static gint prefs_matcher_get_criteria(void)
        case MATCH_HEADER:
                header = gtk_entry_get_text(GTK_ENTRY(matcher.header_entry));
                return header_name_to_crit(header);
+#if !GTK_CHECK_VERSION(3, 0, 0)
        case MATCH_LABEL:
                return CRITERIA_COLORLABEL;
+#endif
        case MATCH_PARTIAL:
                return CRITERIA_PARTIAL;
        case MATCH_TEST:
@@ -1508,11 +1530,13 @@ static MatcherProp *prefs_matcher_dialog_to_matcher(void)
                        value *= KB_SIZE;
                break;
                
+#if !GTK_CHECK_VERSION(3, 0, 0)
        case CRITERIA_COLORLABEL:
                value = colorlabel_get_color_menu_active_item
                        (gtk_cmoption_menu_get_menu(GTK_CMOPTION_MENU
                                (matcher.color_optmenu))); 
                break;
+#endif
 
        case CRITERIA_HEADER:
                header = gtk_entry_get_text(GTK_ENTRY(matcher.header_entry));
@@ -1870,8 +1894,10 @@ static void prefs_matcher_criteria_select(GtkWidget *widget,
                                    (value == MATCH_TEST));
        prefs_matcher_enable_widget(matcher.addressbook_select_btn,
                                    (value == MATCH_ABOOK));
+#if !GTK_CHECK_VERSION(3, 0, 0)
        prefs_matcher_enable_widget(matcher.color_optmenu,
                                    (value == MATCH_LABEL));
+#endif
        prefs_matcher_enable_widget(matcher.upper_filler,
                                    MATCH_CASE_REGEXP(value));
        prefs_matcher_enable_widget(matcher.lower_filler,
@@ -1913,12 +1939,14 @@ static void prefs_matcher_criteria_select(GtkWidget *widget,
 #endif
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(matcher.case_checkbtn), FALSE);
                break;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        case MATCH_LABEL:
                gtk_cmoption_menu_set_history(GTK_CMOPTION_MENU(matcher.color_optmenu), 0);
                prefs_matcher_set_model(matcher.match_combo2, matcher.model_set);
                gtk_label_set_text(GTK_LABEL(matcher.match_label), _("Label"));
                gtk_label_set_text(GTK_LABEL(matcher.match_label2), _("is"));
                break;
+#endif
        case MATCH_PARTIAL:
                prefs_matcher_set_model(matcher.criteria_combo2, matcher.model_partial);
                gtk_label_set_text(GTK_LABEL(matcher.criteria_label2), _("Value:"));
@@ -2248,9 +2276,11 @@ static void prefs_matcher_set_criteria(const gint criteria)
        case CRITERIA_TEST:
                match_criteria = MATCH_TEST;
                break;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        case CRITERIA_COLORLABEL:
                match_criteria = MATCH_LABEL;
                break;
+#endif
        case CRITERIA_TAG:
        case CRITERIA_TAGGED:
                match_criteria = MATCH_TAGS;
@@ -2479,6 +2509,7 @@ static gboolean prefs_matcher_selected(GtkTreeSelection *selector,
                }
                break;
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        case MATCHCRITERIA_NOT_COLORLABEL:
        case MATCHCRITERIA_COLORLABEL:
                gtk_cmoption_menu_set_history(GTK_CMOPTION_MENU(matcher.color_optmenu),
@@ -2486,6 +2517,7 @@ static gboolean prefs_matcher_selected(GtkTreeSelection *selector,
                menu = gtk_cmoption_menu_get_menu(GTK_CMOPTION_MENU(matcher.color_optmenu));
                g_signal_emit_by_name(G_OBJECT(menu), "selection-done", menu);
                break;
+#endif
 
        case MATCHCRITERIA_NOT_HEADER:
        case MATCHCRITERIA_HEADER:
index 9ac59f3..d0b8a65 100644 (file)
@@ -91,7 +91,7 @@ static void prefs_message_create_widget(PrefsPage *_page, GtkWindow *window,
        GtkWidget *checkbtn_promote_html_part;
        GtkWidget *hbox_linespc;
        GtkWidget *label_linespc;
-       GtkObject *spinbtn_linespc_adj;
+       GtkAdjustment *spinbtn_linespc_adj;
        GtkWidget *spinbtn_linespc;
 
        GtkWidget *frame;
@@ -99,7 +99,7 @@ static void prefs_message_create_widget(PrefsPage *_page, GtkWindow *window,
        GtkWidget *checkbtn_smoothscroll;
        GtkWidget *hbox_scr;
        GtkWidget *label_scr;
-       GtkObject *spinbtn_scrollstep_adj;
+       GtkAdjustment *spinbtn_scrollstep_adj;
        GtkWidget *spinbtn_scrollstep;
        GtkWidget *checkbtn_halfpage;
        GtkWidget *checkbtn_hide_quoted;
index 6f375fc..50642d2 100644 (file)
@@ -446,7 +446,7 @@ static void prefs_other_create_widget(PrefsPage *_page, GtkWindow *window,
 
        GtkWidget *label_iotimeout;
        GtkWidget *spinbtn_iotimeout;
-       GtkObject *spinbtn_iotimeout_adj;
+       GtkAdjustment *spinbtn_iotimeout_adj;
 
        GtkWidget *vbox2;
        GtkWidget *checkbtn_askonclean;
index f00b525..cf13090 100644 (file)
@@ -100,7 +100,7 @@ static void prefs_receive_create_widget(PrefsPage *_page, GtkWindow *window,
 
        GtkWidget *hbox_autochk;
        GtkWidget *checkbtn_autochk;
-       GtkObject *spinbtn_autochk_adj;
+       GtkAdjustment *spinbtn_autochk_adj;
        GtkWidget *spinbtn_autochk;
        GtkWidget *label_autochk2;
        GtkWidget *checkbtn_chkonstartup;
index 8802f87..44ce060 100644 (file)
@@ -318,7 +318,7 @@ static void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
        GtkWidget *hbox1;
        GtkWidget *label_ng_abbrev;
        GtkWidget *spinbtn_ng_abbrev_len;
-       GtkObject *spinbtn_ng_abbrev_len_adj;
+       GtkAdjustment *spinbtn_ng_abbrev_len_adj;
        GtkWidget *vbox2;
        GtkWidget *vbox3;
        GtkWidget *checkbtn_useaddrbook;
@@ -333,7 +333,7 @@ static void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
        GtkWidget *checkbtn_reopen_last_folder;
        GtkWidget *optmenu_always_show_msg;
        GtkWidget *spinbtn_mark_as_read_delay;
-       GtkObject *spinbtn_mark_as_read_delay_adj;
+       GtkAdjustment *spinbtn_mark_as_read_delay_adj;
        GtkWidget *checkbtn_immedexec;
        GtkWidget *checkbtn_ask_mark_all_read;
        GtkWidget *label, *label_fill;
index dd495b6..76bc06b 100644 (file)
@@ -60,7 +60,7 @@ static void prefs_wrapping_create_widget(PrefsPage *_page, GtkWindow *window,
        GtkWidget *vbox1;
        GtkWidget *vbox2;
        GtkWidget *label_linewrap;
-       GtkObject *spinbtn_linewrap_adj;
+       GtkAdjustment *spinbtn_linewrap_adj;
        GtkWidget *spinbtn_linewrap;
        GtkWidget *checkbtn_wrapquote;
        GtkWidget *checkbtn_wrappastes;
index e7b93ef..7df939c 100644 (file)
@@ -91,7 +91,11 @@ static gboolean cb_preview_close(GtkWidget*, GdkEventAny*, gpointer);
 static void     cb_preview_size_allocate(GtkWidget*, GtkAllocation*);
 static void     cb_preview_ready(GtkPrintOperationPreview*,
                                 GtkPrintContext*, gpointer);
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static gboolean cb_preview_expose(GtkWidget*, GdkEventExpose*, gpointer);
+#else
+static gboolean cb_preview_expose(GtkWidget*, cairo_t*, gpointer);
+#endif
 static void     cb_preview_got_page_size(GtkPrintOperationPreview*,
                                         GtkPrintContext*,
                                         GtkPageSetup*, gpointer);
@@ -620,9 +624,15 @@ static void cb_preview_ready(GtkPrintOperationPreview *preview,
        preview_data->current_page = preview_data->pages_to_print;
        preview_data->context = context;
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        g_signal_connect(preview_data->area, "expose_event",
                         G_CALLBACK(cb_preview_expose),
                         preview_data);
+#else
+       g_signal_connect(preview_data->area, "draw",
+                        G_CALLBACK(cb_preview_expose),
+                        preview_data);
+#endif
 
        gtk_widget_queue_draw(preview_data->area);
 }
@@ -655,19 +665,32 @@ static void cb_preview_got_page_size(GtkPrintOperationPreview *preview,
                                    paper_width, paper_height);
 }
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static gboolean cb_preview_expose(GtkWidget *widget, GdkEventExpose *event,
                                  gpointer data)
+#else
+static gboolean cb_preview_expose(GtkWidget *widget, cairo_t *event,
+                                 gpointer data)
+#endif
 {
        PreviewData *preview_data = data;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        cairo_t *cr;
+#endif
 
        debug_print("preview_expose (current %p)\n", preview_data->current_page);
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        cr = gdk_cairo_create(gtk_widget_get_window(preview_data->area));
+#endif
 
        /* background */
        cairo_set_source_rgb(cr, 0.5, 0.5, 0.5);
+#if !GTK_CHECK_VERSION(3, 0, 0)
        cairo_rectangle(cr, event->area.x, event->area.y, event->area.width, event->area.height);
+#else
+       cairo_rectangle(cr, 0, 0, event->area.width, event->area.height);
+#endif
        cairo_fill(cr);
 
        /* shadow */
@@ -685,7 +708,9 @@ static gboolean cb_preview_expose(GtkWidget *widget, GdkEventExpose *event,
        cairo_fill(cr);
 
        gtk_print_context_set_cairo_context(preview_data->context, cr, PREVIEW_SCALE, PREVIEW_SCALE);
+#if !GTK_CHECK_VERSION(3, 0, 0)
        cairo_destroy(cr);
+#endif
 
        if (preview_data->current_page) {
                preview_data->rendering = TRUE;
index 5a21653..ebbc313 100644 (file)
@@ -34,7 +34,6 @@
 #include "manage_window.h"
 #include "utils.h"
 #include "mainwindow.h"
-#include "gtksctree.h"
 #include "alertpanel.h"
 #include "sslcertwindow.h"
 #include "prefs_common.h"
index 1c4a9a1..020031e 100644 (file)
@@ -57,8 +57,13 @@ GtkWidget *statusbar_create(void)
        statusbar = gtk_statusbar_new();
        gtk_widget_set_size_request(statusbar, 1, -1);
        statusbar_list = g_list_append(statusbar_list, statusbar);
+#if !GTK_CHECK_VERSION(3, 0, 0)
        gtk_statusbar_set_has_resize_grip(GTK_STATUSBAR(statusbar), 
                                          FALSE);
+#else
+       gtk_window_set_has_resize_grip(GTK_WINDOW(statusbar), 
+                                         FALSE);
+#endif
        gtk_container_set_border_width(GTK_CONTAINER(statusbar), 1);
 #if GTK_CHECK_VERSION (2, 19, 1)
        child = gtk_statusbar_get_message_area(GTK_STATUSBAR(statusbar));
index f8e1c75..f4d953a 100644 (file)
@@ -195,8 +195,13 @@ typedef struct _StockPixmapData    StockPixmapData;
 struct _StockPixmapData
 {
        gchar **data;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GdkPixmap *pixmap;
        GdkBitmap *mask;
+#else
+       cairo_surface_t *pixmap;
+       cairo_pattern_t *mask;
+#endif
        gchar *file;
        gchar *icon_path;
        GdkPixbuf *pixbuf;
@@ -207,10 +212,15 @@ typedef struct _OverlayData OverlayData;
 struct _OverlayData
 {
        gboolean is_pixmap;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GdkPixmap *base_pixmap;
        GdkBitmap *base_mask;
        GdkPixmap *overlay_pixmap;
        GdkBitmap *overlay_mask;
+#else
+       cairo_surface_t *base_pixmap;
+       cairo_surface_t *overlay_pixmap;
+#endif
        
        GdkPixbuf *base_pixbuf;
        GdkPixbuf *overlay_pixbuf;
@@ -590,24 +600,43 @@ StockPixmap stock_pixmap_get_icon (gchar *file)
        return -1;
 }
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static gboolean pixmap_with_overlay_expose_event_cb(GtkWidget *widget, GdkEventExpose *expose,
                                                    OverlayData *data) 
+#else
+static gboolean pixmap_with_overlay_expose_event_cb(GtkWidget *widget, cairo_t *cr,
+                                                   OverlayData *data) 
+#endif
 {
-       GdkDrawable *drawable = gtk_widget_get_window(widget);  
+#if !GTK_CHECK_VERSION(3, 0, 0)
        cairo_t *cr;
+#endif
+       GdkWindow *drawable = gtk_widget_get_window(widget);    
        gint left = 0;
        gint top = 0;
 
        if (data->is_pixmap) {
                cm_return_val_if_fail(data->base_pixmap != NULL, FALSE);
+#if !GTK_CHECK_VERSION(3, 0, 0)
                cm_return_val_if_fail(data->base_mask != NULL, FALSE);
+#endif
        } else {
                cm_return_val_if_fail(data->base_pixbuf != NULL, FALSE);
        }
+#if !GTK_CHECK_VERSION(3, 0, 0)
        cr = gdk_cairo_create(drawable);
 
        gdk_window_clear_area (drawable, expose->area.x, expose->area.y,
                               expose->area.width, expose->area.height);
+#else
+       cairo_pattern_t *pattern = gdk_window_get_background_pattern(drawable);
+       if (pattern == NULL)
+               pattern = gdk_window_get_background_pattern(gdk_window_get_parent(drawable));
+
+       cairo_set_source(cr, pattern);
+       cairo_fill(cr);
+       cairo_pattern_destroy(pattern);
+#endif
 
        if (data->highlight) {
                MainWindow *mw = NULL;
@@ -631,13 +660,25 @@ static gboolean pixmap_with_overlay_expose_event_cb(GtkWidget *widget, GdkEventE
        }
 
        if (data->is_pixmap) {
+#if !GTK_CHECK_VERSION(3, 0, 0)
                gdk_cairo_set_source_pixmap(cr, data->base_pixmap, data->border_x, data->border_y);
+#else
+               cairo_set_source_surface(cr, data->base_pixmap, data->border_x, data->border_y);
+#endif
                cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT);
+#if !GTK_CHECK_VERSION(3, 0, 0)
                cairo_rectangle(cr, data->border_x, data->border_y,
         data->base_width, data->base_height);
+#else
+               cairo_rectangle(cr, 0, 0, data->base_width, data->base_height);
+#endif
                cairo_fill(cr);
        } else {
+#if !GTK_CHECK_VERSION(3, 0, 0)
                gdk_cairo_set_source_pixbuf(cr, data->base_pixbuf, data->border_x, data->border_y);
+#else
+               gdk_cairo_set_source_pixbuf(cr, data->base_pixbuf, 0, 0);
+#endif
                cairo_paint(cr);
        }
 
@@ -653,13 +694,21 @@ static gboolean pixmap_with_overlay_expose_event_cb(GtkWidget *widget, GdkEventE
                        case OVERLAY_TOP_CENTER:
                        case OVERLAY_MID_CENTER:
                        case OVERLAY_BOTTOM_CENTER:
+#if !GTK_CHECK_VERSION(3, 0, 0)
                                left = (data->base_width + data->border_x * 2  - data->overlay_width)/2;
+#else
+                               left = (data->base_width - data->overlay_width)/2;
+#endif
                                break;
 
                        case OVERLAY_TOP_RIGHT:
                        case OVERLAY_MID_RIGHT:
                        case OVERLAY_BOTTOM_RIGHT:
+#if !GTK_CHECK_VERSION(3, 0, 0)
                                left = data->base_width + data->border_x * 2 - data->overlay_width;
+#else
+                               left = data->base_width - data->overlay_width;
+#endif
                                break;
 
                        default:
@@ -675,13 +724,21 @@ static gboolean pixmap_with_overlay_expose_event_cb(GtkWidget *widget, GdkEventE
                        case OVERLAY_MID_LEFT:
                        case OVERLAY_MID_CENTER:
                        case OVERLAY_MID_RIGHT:
+#if !GTK_CHECK_VERSION(3, 0, 0)
                                top = (data->base_height + data->border_y * 2  - data->overlay_height)/2;
+#else
+                               top = (data->base_height - data->overlay_height)/2;
+#endif
                                break;
                                        
                        case OVERLAY_BOTTOM_LEFT:
                        case OVERLAY_BOTTOM_CENTER:
                        case OVERLAY_BOTTOM_RIGHT:
+#if !GTK_CHECK_VERSION(3, 0, 0)
                                top = data->base_height + data->border_y * 2 - data->overlay_height;
+#else
+                               top = data->base_height - data->overlay_height;
+#endif
                                break;
 
                        default:
@@ -692,8 +749,12 @@ static gboolean pixmap_with_overlay_expose_event_cb(GtkWidget *widget, GdkEventE
        if (data->position != OVERLAY_NONE) {
                if (data->is_pixmap) {
                        cm_return_val_if_fail(data->overlay_pixmap != NULL, FALSE);
+#if !GTK_CHECK_VERSION(3, 0, 0)
                        cm_return_val_if_fail(data->overlay_mask != NULL, FALSE);
                        gdk_cairo_set_source_pixmap(cr, data->overlay_pixmap, left, top);
+#else
+                       cairo_set_source_surface(cr, data->overlay_pixmap, left, top);
+#endif
                        cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT);
                        cairo_rectangle (cr, left, top, data->overlay_width, data->overlay_height);
                        cairo_fill(cr);
@@ -704,20 +765,33 @@ static gboolean pixmap_with_overlay_expose_event_cb(GtkWidget *widget, GdkEventE
                }
        }
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        cairo_destroy(cr);
+#endif
        
        return TRUE;
 }
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static void pixmap_with_overlay_destroy_cb(GtkObject *object, OverlayData *data) 
+#else
+static void pixmap_with_overlay_destroy_cb(GtkWidget *object, OverlayData *data) 
+#endif
 {
        if (data->is_pixmap) {
+#if !GTK_CHECK_VERSION(3, 0, 0)
                g_object_unref(data->base_pixmap);
                g_object_unref(data->base_mask);
                if (data->position != OVERLAY_NONE) {
                        g_object_unref(data->overlay_pixmap);
                        g_object_unref(data->overlay_mask);
                }
+#else
+               cairo_surface_destroy(data->base_pixmap);
+               if (data->position != OVERLAY_NONE) {
+                       cairo_surface_destroy(data->overlay_pixmap);
+               }
+#endif
        } else {
                g_object_unref(data->base_pixbuf);
                if (data->position != OVERLAY_NONE) {
@@ -744,8 +818,12 @@ GtkWidget *stock_pixmap_widget_with_overlay(GtkWidget *window, StockPixmap icon,
                                            StockPixmap overlay, OverlayPosition pos,
                                            gint border_x, gint border_y)
 {
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GdkPixmap *stock_pixmap = NULL;
        GdkBitmap *stock_mask = NULL;
+#else
+       cairo_surface_t *stock_pixmap = NULL;
+#endif
        GdkPixbuf *stock_pixbuf = NULL;
        GtkWidget *widget = NULL;
        GtkWidget *stock_wid = NULL;
@@ -763,25 +841,45 @@ GtkWidget *stock_pixmap_widget_with_overlay(GtkWidget *window, StockPixmap icon,
                data->is_pixmap = FALSE;
 
        if (data->is_pixmap) {
+#if !GTK_CHECK_VERSION(3, 0, 0)
                gtk_image_get_pixmap(GTK_IMAGE(stock_wid), &stock_pixmap, &stock_mask);
                g_object_ref(stock_pixmap);
                g_object_ref(stock_mask);
+#else
+               cr = gdk_cairo_create(gtk_widget_get_window(stock_wid));
+               stock_pixmap = cairo_get_target(cr);
+               cairo_surface_reference(stock_pixmap);
+               cairo_destroy(cr);
+#endif
                data->base_pixmap = stock_pixmap;
+#if !GTK_CHECK_VERSION(3, 0, 0)
                data->base_mask   = stock_mask;
+#endif
                data->base_height = requisition.height;
                data->base_width  = requisition.width;
                gtk_widget_destroy(stock_wid);
 
                if (pos == OVERLAY_NONE) {
                        data->overlay_pixmap = NULL;
+#if !GTK_CHECK_VERSION(3, 0, 0)
                        data->overlay_mask   = NULL;
+#endif
                } else {
                        stock_wid = stock_pixmap_widget(window, overlay);
+#if !GTK_CHECK_VERSION(3, 0, 0)
                        gtk_image_get_pixmap(GTK_IMAGE(stock_wid), &stock_pixmap, &stock_mask);
                        g_object_ref(stock_pixmap);
                        g_object_ref(stock_mask);
+#else
+                       cr = gdk_cairo_create(gtk_widget_get_window(stock_wid));
+                       stock_pixmap = cairo_get_target(cr);
+                       cairo_surface_reference(stock_pixmap);
+                       cairo_destroy(cr);
+#endif
                        data->overlay_pixmap = stock_pixmap;
+#if !GTK_CHECK_VERSION(3, 0, 0)
                        data->overlay_mask   = stock_mask;
+#endif
                        data->overlay_height = requisition.height;
                        data->overlay_width  = requisition.width;
 
@@ -797,7 +895,9 @@ GtkWidget *stock_pixmap_widget_with_overlay(GtkWidget *window, StockPixmap icon,
                gtk_widget_destroy(stock_wid);
                if (pos == OVERLAY_NONE) {
                        data->overlay_pixmap = NULL;
+#if !GTK_CHECK_VERSION(3, 0, 0)
                        data->overlay_mask   = NULL;
+#endif
                } else {
                        stock_wid = stock_pixmap_widget(window, overlay);
                        stock_pixbuf = gtk_image_get_pixbuf(GTK_IMAGE(stock_wid));
@@ -817,8 +917,13 @@ GtkWidget *stock_pixmap_widget_with_overlay(GtkWidget *window, StockPixmap icon,
        widget = gtk_drawing_area_new();
        gtk_widget_set_size_request(widget, data->base_width + border_x * 2, 
                              data->base_height + border_y * 2);
+#if !GTK_CHECK_VERSION(3, 0, 0)
        g_signal_connect(G_OBJECT(widget), "expose_event", 
                         G_CALLBACK(pixmap_with_overlay_expose_event_cb), data);
+#else
+       g_signal_connect(G_OBJECT(widget), "draw", 
+                        G_CALLBACK(pixmap_with_overlay_expose_event_cb), data);
+#endif
        g_signal_connect(G_OBJECT(widget), "destroy",
                         G_CALLBACK(pixmap_with_overlay_destroy_cb), data);
        g_object_set_data(G_OBJECT(widget), "highlight", &(data->highlight));
index bec71ea..762e72c 100644 (file)
@@ -27,7 +27,9 @@
 #include <glib/gi18n.h>
 #include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
+#if !GTK_CHECK_VERSION(3, 0, 0)
 #include "gtk/gtksctree.h"
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
index ad60f40..3aa5feb 100644 (file)
@@ -380,10 +380,16 @@ static void textview_create_tags(GtkTextView *text, TextView *textview)
 {
        GtkTextBuffer *buffer;
        GtkTextTag *tag, *qtag;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        static GdkColor yellow, black;
        static gboolean color_init = FALSE;
+#else
+       static GdkColor yellow = { (guint32)0, (guint16)0xf5, (guint16)0xf6, (guint16)0xbe };
+       static GdkColor black = { (guint32)0, (guint16)0x0, (guint16)0x0, (guint16)0x0 };
+#endif
        static PangoFontDescription *font_desc, *bold_font_desc;
        
+#if !GTK_CHECK_VERSION(3, 0, 0)
        if (!color_init) {
                gdk_color_parse("#f5f6be", &yellow);
                gdk_color_parse("#000000", &black);
@@ -392,6 +398,7 @@ static void textview_create_tags(GtkTextView *text, TextView *textview)
                color_init &= gdk_colormap_alloc_color(
                        gdk_colormap_get_system(), &black, FALSE, TRUE);
        }
+#endif
 
        if (!font_desc)
                font_desc = pango_font_description_from_string