From f6d386ff93e929092ba105385a29d760aeba9ff7 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Tue, 30 Sep 2008 15:37:53 +0000 Subject: [PATCH] * Changes in the autotools stuff affecting a lot of platform dependent code. Now we have a platform (maemo/gnome) and a toolkit (gtk, hildon1 and hildon2). * hildon2 is still pointing to maemo directory. But this change will enable us to begin the hildon2 port work in a different folder. * The change is also important for MID compatibility, as it's platform would be gnome, and the toolkit a hildon flavor. * Removed the HAVE_HILDON0_WIDGETS and similars. Now we have a MODEST_HILDON_API variable with the major number of the hildon library. pmo-trunk-r5822 --- configure.ac | 149 ++++++++++++++------ src/Makefile.am | 11 +- src/dbus_api/Makefile.am | 4 +- src/gnome/Makefile.am | 4 +- src/maemo/Makefile.am | 4 +- src/maemo/easysetup/Makefile.am | 4 +- .../easysetup/modest-easysetup-country-combo-box.c | 68 +++++++-- .../easysetup/modest-easysetup-country-combo-box.h | 13 ++ .../easysetup/modest-easysetup-wizard-dialog.c | 14 +- src/maemo/modest-hildon-includes.h | 4 +- src/modest-defs.h | 2 +- src/modest-dimming-rules-group.c | 6 +- src/modest-init.c | 16 +-- src/modest-plugin-1.0.pc.in | 1 + src/modest-tny-account.c | 8 +- src/modest-ui-actions.c | 34 ++--- src/modest-widget-memory.c | 2 +- src/widgets/Makefile.am | 4 +- src/widgets/modest-global-settings-dialog.c | 12 +- src/widgets/modest-gtkhtml-msg-view.c | 4 +- src/widgets/modest-header-view.c | 8 +- src/widgets/modest-recpt-editor.c | 4 +- src/widgets/modest-ui-constants.h | 4 +- src/widgets/modest-window-mgr.c | 6 +- src/widgets/modest-window.c | 2 +- src/widgets/modest-window.h | 12 +- src/widgets/modest-wizard-dialog.c | 20 +-- tests/dbus_api/Makefile.am | 6 +- 28 files changed, 280 insertions(+), 146 deletions(-) diff --git a/configure.ac b/configure.ac index a5e2946..cf443cd 100644 --- a/configure.ac +++ b/configure.ac @@ -145,6 +145,82 @@ elif test "$with_platform" = "gnome"; then MODEST_PLUGIN_DEFINES=" -DMODEST_PLATFORM_GNOME" fi +# +# check the widgets library +# +have_hildon2=false +have_hildon1=false +have_hildon0=false +have_gtk=false +PKG_CHECK_EXISTS(hildon-1, have_hildon1=true,have_hildon1=false) +if test "$have_hildon1" = "true"; then + PKG_CHECK_EXISTS(hildon-1 >= 2.1.0, have_hildon2=true, have_hildon2=false) + PKG_CHECK_MODULES(MODEST_HILDON_WIDGETS,hildon-1 hildon-fm-2) + hildonpkgs="hildon-1 hildon-fm-2" + detected_toolkit=hildon1 + echo "DETECTED HILDON 1 $have_hildon2." + if test "$have_hildon2" = "true"; then + echo "DETECTED HILDON 2 $have_hildon2." + detected_toolkit=hildon2 + fi +else + hildonpkgs="hildon-libs hildon-fm" + detected_toolkit=hildon1 + PKG_CHECK_EXISTS(hildon-libs >= 0.12.0, have_hildon1=true, have_hildon1=false) + if test "$have_hildon1" = "false"; then + PKG_CHECK_EXISTS(hildon-libs, have_hildon0=true, have_hildon0=false) + if test "$have_hildon0" = "false"; then + have_gtk=true + detected_toolkit=gtk + hildonpkgs= + fi + fi + if test "$have_gtk" = "false"; then + PKG_CHECK_MODULES(MODEST_HILDON_WIDGETS,hildon-libs hildon-fm) + fi +fi + +hildon_api= +if test "$have_hildon0" = "true"; then + hildon_api=0 +elif test "$have_hildon1" = "true"; then + hildon_api=1 +elif test "$have_gtk" = "false"; then + hildon_api=`$PKG_CONFIG --modversion hildon-1 | cut -d. -f1` +fi + +AC_DEFINE_UNQUOTED(MODEST_HILDON_API, $hildon_api, ["the API version of hildon"]) +MODEST_PLUGIN_DEFINES="$MODEST_PLUGIN_DEFINES -DMODEST_HILDON_API=$hildon_api" + +AC_ARG_WITH(toolkit, [ +Target toolkit: + --with-toolkit=detect detect target toolkit (default) + --with-toolkit=gtk build for Gnome + --with-toolkit=hildon1 build for Hildon 1.x + --with-toolkit=hildon2 build for Hildon 2.x +], +[case "${with_toolkit}" in + gtk|hildon1|hildon2|detect) MODEST_TOOLKIT=${with_toolkit};; + *) AC_MSG_ERROR([Unknown platform selected]);; +esac], [MODEST_TOOLKIT=detect]) + +if test "$MODEST_TOOLKIT" = "detect"; then + MODEST_TOOLKIT="$detected_toolkit" + with_toolkit=$detected_toolkit +fi + +if test "$with_toolkit" = "hildon1"; then + MODEST_PLUGIN_DEFINES="$MODEST_PLUGIN_DEFINES -DMODEST_TOOLKIT_HILDON1" +elif test "$with_platform" = "hildon2"; then + MODEST_PLUGIN_DEFINES="$MODEST_PLUGIN_DEFINES -DMODEST_TOOLKIT_HILDON2" +elif test "$with_platform" = "gtk"; then + MODEST_PLUGIN_DEFINES="$MODEST_PLUGIN_DEFINES -DMODEST_TOOLKIT_GNOME" +fi + +AC_SUBST(hildonpkgs) +AC_SUBST(MODEST_PLUGIN_DEFINES) + + dnl Whether to use maemo-launcher or not AC_ARG_ENABLE([maemo-launcher], [AS_HELP_STRING([--enable-maemo-launcher], @@ -162,19 +238,35 @@ then fi have_easysetup=false +if test "x$with_toolkit" == "xgtk"; then + PKG_CHECK_MODULES(MODEST_TOOLKIT,glib-2.0 >= 2.8 gtk+-2.0 >= 2.10 libnotify) + AC_DEFINE_UNQUOTED(MODEST_TOOLKIT_GTK, 1, ["Whether modest is being build for the gtk toolkit."]) + MODEST_TOOLKIT_DIR=gnome +else + have_easysetup=true + PKG_CHECK_MODULES(MODEST_TOOLKIT,$hildonpkgs) + if test "$with_toolkit" = "hildon2"; then + AC_DEFINE_UNQUOTED(MODEST_TOOLKIT_HILDON2, 1, ["Whether modest is being build for the hildon2 toolkit."]) + MODEST_TOOLKIT_DIR=maemo + else + AC_DEFINE_UNQUOTED(MODEST_TOOLKIT_HILDON1, 1, ["Whether modest is being build for the hildon2 toolkit."]) + MODEST_TOOLKIT_DIR=maemo + fi + AC_DEFINE_UNQUOTED(MODEST_HAVE_EASYSETUP, 1, ["Whether we have the easysetup feature"]) +fi +AM_CONDITIONAL(MODEST_HAVE_EASYSETUP,test "x$have_easysetup" == "xtrue") +AC_SUBST(MODEST_TOOLKIT) +AC_SUBST(MODEST_TOOLKIT_DIR) + if test "x$with_platform" == "xgnome"; then - PKG_CHECK_MODULES(MODEST_PLATFORM,libtinymail-gnome-desktop-1.0 libnm_glib glib-2.0 >= 2.8 gtk+-2.0 >= 2.10 libnotify) + PKG_CHECK_MODULES(MODEST_PLATFORM,libtinymail-gnome-desktop-1.0 libnm_glib glib-2.0 >= 2.8 libnotify) AC_DEFINE_UNQUOTED(MODEST_PLATFORM_GNOME, 1, ["Whether modest is being built for the GNOME platform."]) dnl AC_MSG_ERROR([The GNOME Build is currently broken; please try the Maemo build instead]) else - have_easysetup=true have_dbusapi=true PKG_CHECK_MODULES(MODEST_PLATFORM,libosso dbus-1 libtinymail-maemo-1.0 libebook-1.2 ) AC_DEFINE_UNQUOTED(MODEST_PLATFORM_MAEMO, 1, ["Whether modest is being built for the MAEMO platform."]) - AC_DEFINE_UNQUOTED(MODEST_HAVE_EASYSETUP, 1, ["Whether we have the easysetup feature"]) -fi - -AM_CONDITIONAL(MODEST_HAVE_EASYSETUP,test "x$have_easysetup" == "xtrue") +fi AM_CONDITIONAL(MODEST_HAVE_DBUS_API,test "x$have_dbusapi" == "xtrue") AC_SUBST(MODEST_PLATFORM) @@ -183,7 +275,7 @@ AC_SUBST(MODEST_PLATFORM) # # check for wpeditor or libwpeditor-plus (on maemo) # -if test "x$with_platform" == "xmaemo"; then +if test "x$with_toolkit" != "xgtk"; then PKG_CHECK_MODULES(MODEST_WPEDITOR,wpeditor,have_wpeditor=true,have_wpeditor=false) if test "x$have_wpeditor" == "xfalse"; then PKG_CHECK_MODULES(MODEST_WPEDITOR,libwpeditor-plus,have_libwpeditorplus=true,have_libwpeditorplus=false) @@ -251,7 +343,7 @@ fi # # check hildon-help (only for maemo) # -if test "x$with_platform" == "xmaemo"; then +if test "x$with_toolkit" != "xgtk"; then PKG_CHECK_MODULES(MODEST_HILDON_HELP,hildon-help,have_hildon_help=true,have_hildon_help=false) if test "x$have_hildon_help" == "xfalse"; then PKG_CHECK_MODULES(MODEST_HILDON_HELP,libossohelp,have_osso_help=true,have_osso_help=false) @@ -272,7 +364,7 @@ fi # # check for the notification stuff (only maemo) # -if test "x$with_platform" == "xmaemo"; then +if test "x$with_toolkit" != "xgtk"; then PKG_CHECK_MODULES(MODEST_HILDON_NOTIFY,hildon-notify libnotify,have_hildon_notify=true,have_hildon_notify=false) if test "x$have_hildon_notify" == "xtrue"; then AC_DEFINE_UNQUOTED(MODEST_HAVE_HILDON_NOTIFY, 1, ["Whether hildon-notify is available"]) @@ -283,7 +375,7 @@ fi # # check for the uri/mime stuff # -if test "x$with_platform" == "xmaemo"; then +if test "x$with_toolkit" != "xgtk"; then PKG_CHECK_MODULES(MODEST_HILDON_MIME,libhildonmime,have_hildonmime=true,have_hildonmime=false) if test "x$have_hildonmime" == "xfalse"; then PKG_CHECK_MODULES(MODEST_HILDON_MIME,libossomime,have_ossomime=true,have_ossomime=false) @@ -347,30 +439,6 @@ fi -# -# check the version of the widgets on maemo -# -hildonpkgs= -if test "x$with_platform" == "xmaemo"; then -PKG_CHECK_MODULES(MODEST_HILDON_WIDGETS, hildon-1 >= 0.9.9 hildon-fm-2, have_hildon1=true,have_hildon1=false) -hildonpkgs=hildon-1 - -if test "x$have_hildon1" == "xfalse"; then - PKG_CHECK_MODULES(MODEST_HILDON_WIDGETS, hildon-libs >= 0.12.0 hildon-fm, have_hildon0=true,have_hildon0=false) - hildonpkgs=hildon-libs - if test "x$have_hildon0" == "xtrue"; then - AC_DEFINE_UNQUOTED(MODEST_HAVE_HILDON0_WIDGETS, 1, ["Whether hildon0 widgets are used."]) - MODEST_PLUGIN_DEFINES+=" -DMODEST_HAVE_HILDON0_WIDGETS" - else - AC_MSG_ERROR([hildon widgets and/or hildon-fm not found]) - fi -else - AC_DEFINE_UNQUOTED(MODEST_HAVE_HILDON1_WIDGETS, 1, ["Whether hildon1 widgets are used."]) -fi -fi - -AC_SUBST(hildonpkgs) -AC_SUBST(MODEST_PLUGIN_DEFINES) # # check the version of the addressbook on maemo @@ -444,20 +512,8 @@ if test "x$with_platform" == "xmaemo"; then AC_SUBST(pluginlibdir) AC_SUBST(plugindesktopentrydir) -else - # gnome frontend - PKG_CHECK_MODULES(MODEST_LIBTINYMAIL_GNOME_DESKTOP,libtinymail-gnome-desktop-1.0 libnm_glib glib-2.0 >= 2.8 gtk+-2.0 >= 2.10 libnotify) - AC_SUBST(MODEST_LIBTINYMAIL_GNOME_DESKTOP_CFLAGS) - AC_SUBST(MODEST_LIBTINYMAIL_GNOME_DESKTOP_LIBS) - AC_DEFINE_UNQUOTED(MODEST_PLATFORM_GNOME, 1, ["Whether modest is being built for the GNOME platform."]) - - # no dbus api for gnome - dbus_api="" - AC_SUBST(dbus_api) - fi - dnl ## setup the testing framework (ie., make check) build_tests=false AC_ARG_ENABLE(tests, @@ -520,6 +576,7 @@ echo echo "modest configure results" echo "-----------------------------------" echo "Platform : $with_platform" +echo "Toolkit : $with_toolkit" echo "Prefix : ${prefix}" echo "Build tests : $build_tests" echo "Build docs : $build_docs" diff --git a/src/Makefile.am b/src/Makefile.am index 8144eb6..379915e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,14 +2,13 @@ # Makefile.am # Time-stamp: <2008-01-06 10:18:49 (djcb)> -SUBDIRS= $(MODEST_PLATFORM) widgets $(dbus_api) - +SUBDIRS= $(MODEST_TOOLKIT_DIR) widgets $(dbus_api) DIST_SUBDIRS = widgets gnome maemo dbus_api INCLUDES=\ $(MODEST_GSTUFF_CFLAGS) \ $(MODEST_PLATFORM_CFLAGS) \ - $(MODEST_HILDON_WIDGETS_CFLAGS) \ + $(MODEST_TOOLKIT_CFLAGS) \ $(MODEST_OGS_CFLAGS) \ $(MODEST_HILDON_HELP_CFLAGS) \ $(MODEST_LIBCONIC_CFLAGS) \ @@ -155,7 +154,7 @@ libmodest_la_SOURCES=\ if MODEST_USE_DUMMY_ADDRESS_BOOK libmodest_la_SOURCES += modest-address-book-dummy.c -endif +endif libmodest_la_CFLAGS = $(MAEMO_LAUNCHER_CFLAGS) @@ -164,7 +163,7 @@ libmodest_la_LIBADD = \ $(MODEST_GSTUFF_LIBS) \ $(MODEST_MOZEMBED_LIBS) \ $(MODEST_PLATFORM_LIBS) \ - $(MODEST_HILDON_WIDGETS_LIBS) \ + $(MODEST_TOOLKIT_LIBS) \ $(MODEST_HILDON_HELP_LIBS) \ $(MODEST_HILDON_NOTIFY_LIBS) \ $(MODEST_OGS_LIBS) \ @@ -192,7 +191,7 @@ modest_LDADD = \ $(MODEST_GSTUFF_LIBS) \ $(MODEST_MOZEMBED_LIBS) \ $(MODEST_PLATFORM_LIBS) \ - $(MODEST_HILDON_WIDGETS_LIBS) \ + $(MODEST_TOOLKIT_LIBS) \ $(MODEST_HILDON_HELP_LIBS) \ $(MODEST_HILDON_NOTIFY_LIBS) \ $(MODEST_OGS_LIBS) \ diff --git a/src/dbus_api/Makefile.am b/src/dbus_api/Makefile.am index b5b31f8..2b6f2d1 100644 --- a/src/dbus_api/Makefile.am +++ b/src/dbus_api/Makefile.am @@ -30,7 +30,7 @@ INCLUDES=\ $(MODEST_GSTUFF_CFLAGS) \ $(MODEST_PLATFORM_CFLAGS) \ - $(MODEST_HILDON_WIDGETS_CFLAGS)\ + $(MODEST_TOOLKIT_CFLAGS)\ $(MODEST_OGS_CFLAGS) \ -I ${top_srcdir}/src/widgets \ -I ${top_srcdir}/src \ @@ -51,6 +51,6 @@ libmodest_dbus_api_la_SOURCES= \ LDADD = \ $(MODEST_GSTUFF_LIBS) \ $(MODEST_PLATFORM_LIBS) \ - $(MODEST_HILDON_WIDGETS_LIBS) \ + $(MODEST_TOOLKIT_LIBS) \ $(MODEST_OGS_LIBS) diff --git a/src/gnome/Makefile.am b/src/gnome/Makefile.am index fe15b23..e7c8c75 100644 --- a/src/gnome/Makefile.am +++ b/src/gnome/Makefile.am @@ -9,6 +9,7 @@ INCLUDES=\ $(MODEST_GSTUFF_CFLAGS) \ $(MODEST_PLATFORM_CFLAGS) \ + $(MODEST_TOOLKIT_CFLAGS) \ -I ${top_srcdir}/src \ -DPREFIX=\"@prefix@\" \ -DPIXMAP_PREFIX=\"${datadir}/pixmaps/modest/\" \ @@ -45,7 +46,8 @@ libmodest_ui_la_SOURCES= \ LDADD = \ $(MODEST_GSTUFF_LIBS) \ - $(MODEST_PLATFORM_LIBS) + $(MODEST_PLATFORM_LIBS) \ + $(MODEST_TOOKIT_LIBS) pixmapdir = $(datadir)/pixmaps/modest pixmap_DATA = $(PIXMAP_FILES) diff --git a/src/maemo/Makefile.am b/src/maemo/Makefile.am index 6405431..f4a8a34 100644 --- a/src/maemo/Makefile.am +++ b/src/maemo/Makefile.am @@ -32,8 +32,8 @@ INCLUDES=\ $(MODEST_GSTUFF_CFLAGS) \ $(MODEST_WPEDITOR_CFLAGS) \ $(MODEST_PLATFORM_CFLAGS) \ + $(MODEST_TOOLKIT_CFLAGS) \ $(MODEST_ABOOK_CFLAGS) \ - $(MODEST_HILDON_WIDGETS_CFLAGS) \ $(MODEST_HILDON_HELP_CFLAGS) \ $(MODEST_LIBCONIC_CFLAGS) \ $(MODEST_HILDON_MIME_CFLAGS) \ @@ -88,8 +88,8 @@ libmodest_ui_la_LIBADD = \ $(MODEST_GSTUFF_LIBS) \ $(MODEST_ABOOK_LIBS) \ $(MODEST_PLATFORM_LIBS) \ + $(MODEST_TOOLKIT_LIBS) \ $(MODEST_WPEDITOR_LIBS) \ - $(MODEST_HILDON_WIDGETS_LIBS) \ $(MODEST_HILDON_MIME_LIBS) \ $(MODEST_LIBCONIC_LIBS) \ $(MODEST_HILDON_HELP_LIBS) \ diff --git a/src/maemo/easysetup/Makefile.am b/src/maemo/easysetup/Makefile.am index 31d60f5..b921c7c 100644 --- a/src/maemo/easysetup/Makefile.am +++ b/src/maemo/easysetup/Makefile.am @@ -30,7 +30,7 @@ INCLUDES=\ $(MODEST_GSTUFF_CFLAGS) \ $(MODEST_PLATFORM_CFLAGS) \ - $(MODEST_HILDON_WIDGETS_CFLAGS) \ + $(MODEST_TOOLKIT_CFLAGS) \ $(MODEST_HILDON_HELP_CFLAGS) \ $(MODEST_HILDON_NOTIFY_CFLAGS)\ -I ${top_srcdir}/src/widgets \ @@ -56,7 +56,7 @@ libmodest_easysetup_la_SOURCES= \ LDADD = \ $(MODEST_HILDON_HELP_LIBS) \ $(MODEST_HILDON_NOTIFY_LIBS)\ - $(MODEST_HILDON_WIDGETS_LIBS) \ + $(MODEST_TOOLKIT_LIBS) \ $(MODEST_GSTUFF_LIBS) \ $(MODEST_PLATFORM_LIBS) diff --git a/src/maemo/easysetup/modest-easysetup-country-combo-box.c b/src/maemo/easysetup/modest-easysetup-country-combo-box.c index 6d64626..0f7b3dc 100644 --- a/src/maemo/easysetup/modest-easysetup-country-combo-box.c +++ b/src/maemo/easysetup/modest-easysetup-country-combo-box.c @@ -52,7 +52,11 @@ #define MAX_LINE_LEN 128 /* max length of a line in MCC file */ +#if MODEST_HILDON_API < 2 G_DEFINE_TYPE (EasysetupCountryComboBox, easysetup_country_combo_box, GTK_TYPE_COMBO_BOX); +#else +G_DEFINE_TYPE (EasysetupCountryComboBox, easysetup_country_combo_box, HILDON_TYPE_PICKER_BUTTON); +#endif typedef struct { @@ -274,28 +278,47 @@ easysetup_country_combo_box_load_data(EasysetupCountryComboBox *self) */ model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT); - /* Setup the combo box: */ - GtkComboBox *combobox = GTK_COMBO_BOX (self); - /* Country column: * The ID model column in not shown in the view. */ GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); g_object_set (G_OBJECT (renderer), "ellipsize", PANGO_ELLIPSIZE_END, NULL); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combobox), renderer, TRUE); - gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combobox), renderer, - "text", MODEL_COL_NAME, NULL); + +#if MODEST_HILDON_API < 2 + gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (self), renderer, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (self), renderer, + "text", MODEL_COL_NAME, NULL); +#else + GtkWidget *selector = hildon_touch_selector_new (); + hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (self), HILDON_TOUCH_SELECTOR (selector)); + hildon_touch_selector_append_column (hildon_picker_button_get_selector (HILDON_PICKER_BUTTON (self)), + GTK_TREE_MODEL (model), + renderer, "text", MODEL_COL_NAME, NULL); +#endif /* Fill the model with rows: */ load_from_file (self, model); /* Set this _after_ loading from file, it makes loading faster */ - gtk_combo_box_set_model (combobox, GTK_TREE_MODEL (model)); +#if MODEST_HILDON_API < 2 + gtk_combo_box_set_model (GTK_COMBO_BOX (self), GTK_TREE_MODEL (model)); +#else + hildon_touch_selector_set_model (hildon_picker_button_get_selector (HILDON_PICKER_BUTTON (self)), + 0, GTK_TREE_MODEL (model)); +#endif } EasysetupCountryComboBox* easysetup_country_combo_box_new (void) { - return g_object_new (MODEST_EASYSETUP_TYPE_COUNTRY_COMBO_BOX, NULL); +#if MODEST_HILDON_API >= 2 + return g_object_new (MODEST_EASYSETUP_TYPE_COUNTRY_COMBO_BOX, + "arrangement", HILDON_BUTTON_ARRANGEMENT_VERTICAL, + "size", HILDON_SIZE_AUTO, + NULL); +#else + return g_object_new (MODEST_EASYSETUP_TYPE_COUNTRY_COMBO_BOX, + NULL); +#endif } /** @@ -305,11 +328,25 @@ gint easysetup_country_combo_box_get_active_country_mcc (EasysetupCountryComboBox *self) { GtkTreeIter active; - const gboolean found = gtk_combo_box_get_active_iter (GTK_COMBO_BOX (self), &active); + gboolean found; + +#if MODEST_HILDON_API < 2 + found = gtk_combo_box_get_active_iter (GTK_COMBO_BOX (self), &active); +#else + found = hildon_touch_selector_get_selected (hildon_picker_button_get_selector + (HILDON_PICKER_BUTTON (self)), 0, &active); +#endif if (found) { gint mcc = 0; +#if MODEST_HILDON_API < 2 gtk_tree_model_get (gtk_combo_box_get_model (GTK_COMBO_BOX (self)), &active, MODEL_COL_MCC, &mcc, -1); +#else + gtk_tree_model_get (hildon_touch_selector_get_model (hildon_picker_button_get_selector + (HILDON_PICKER_BUTTON (self)), + 0), + &active, MODEL_COL_MCC, &mcc, -1); +#endif return mcc; } return 0; /* Failed. */ @@ -328,13 +365,26 @@ easysetup_country_combo_box_set_active_country_locale (EasysetupCountryComboBox gint current_mcc; GtkTreeModel *model; +#if MODEST_HILDON_API < 2 model = gtk_combo_box_get_model (GTK_COMBO_BOX (self)); + g_message ("HILDON < 2"); +#else + model = hildon_touch_selector_get_model (hildon_picker_button_get_selector + (HILDON_PICKER_BUTTON (self)), 0); + g_message ("HILDON >= 2"); +#endif if (!gtk_tree_model_get_iter_first (model, &iter)) return FALSE; do { gtk_tree_model_get (model, &iter, MODEL_COL_MCC, ¤t_mcc, -1); if (priv->locale_mcc == current_mcc) { +#if MODEST_HILDON_API < 2 gtk_combo_box_set_active_iter (GTK_COMBO_BOX (self), &iter); +#else + hildon_touch_selector_select_iter (hildon_picker_button_get_selector + (HILDON_PICKER_BUTTON (self)), 0, + &iter, TRUE); +#endif return TRUE; } } while (gtk_tree_model_iter_next (model, &iter)); diff --git a/src/maemo/easysetup/modest-easysetup-country-combo-box.h b/src/maemo/easysetup/modest-easysetup-country-combo-box.h index f8aa457..56f1741 100644 --- a/src/maemo/easysetup/modest-easysetup-country-combo-box.h +++ b/src/maemo/easysetup/modest-easysetup-country-combo-box.h @@ -30,7 +30,11 @@ #ifndef _MODEST_EASYSETUP_COUNTRY_COMBO_BOX #define _MODEST_EASYSETUP_COUNTRY_COMBO_BOX +#if MODEST_HILDON_API < 2 #include +#else +#include +#endif G_BEGIN_DECLS @@ -56,6 +60,7 @@ G_BEGIN_DECLS (G_TYPE_INSTANCE_GET_CLASS ((obj), \ MODEST_EASYSETUP_TYPE_COUNTRY_COMBO_BOX, EasysetupCountryComboBoxClass)) +#if MODEST_HILDON_API < 2 typedef struct { GtkComboBox parent; } EasysetupCountryComboBox; @@ -63,7 +68,15 @@ typedef struct { typedef struct { GtkComboBoxClass parent_class; } EasysetupCountryComboBoxClass; +#else +typedef struct { + HildonPickerButton parent; +} EasysetupCountryComboBox; +typedef struct { + HildonPickerButtonClass parent_class; +} EasysetupCountryComboBoxClass; +#endif GType easysetup_country_combo_box_get_type (void); EasysetupCountryComboBox* easysetup_country_combo_box_new (void); diff --git a/src/maemo/easysetup/modest-easysetup-wizard-dialog.c b/src/maemo/easysetup/modest-easysetup-wizard-dialog.c index 24b8ef7..9e61d43 100644 --- a/src/maemo/easysetup/modest-easysetup-wizard-dialog.c +++ b/src/maemo/easysetup/modest-easysetup-wizard-dialog.c @@ -28,7 +28,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - +#include #include "modest-easysetup-wizard-dialog.h" #include #include @@ -390,8 +390,13 @@ create_page_welcome (ModestEasysetupWizardDialog *self) return GTK_WIDGET (box); } +#if MODEST_HILDON_API < 2 static void on_combo_account_country (GtkComboBox *widget, gpointer user_data) +#else +static void +on_combo_account_country (HildonTouchSelector *widget, gint column, gpointer user_data) +#endif { ModestEasysetupWizardDialog *self = MODEST_EASYSETUP_WIZARD_DIALOG (user_data); g_assert(self); @@ -469,8 +474,15 @@ create_page_account_details (ModestEasysetupWizardDialog *self) gtk_widget_show (caption); /* connect to country combo's changed signal, so we can fill the provider combo: */ +#if MODEST_HILDON_API < 2 g_signal_connect (G_OBJECT (priv->combo_account_country), "changed", G_CALLBACK (on_combo_account_country), self); +#else + g_signal_connect (G_OBJECT (hildon_picker_button_get_selector + (HILDON_PICKER_BUTTON (priv->combo_account_country))), + "changed", + G_CALLBACK (on_combo_account_country), self); +#endif GtkWidget *separator = gtk_hseparator_new (); gtk_box_pack_start (GTK_BOX (box), separator, FALSE, FALSE, MODEST_MARGIN_HALF); diff --git a/src/maemo/modest-hildon-includes.h b/src/maemo/modest-hildon-includes.h index fb69e86..6dd1306 100644 --- a/src/maemo/modest-hildon-includes.h +++ b/src/maemo/modest-hildon-includes.h @@ -58,7 +58,7 @@ k * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, #include #endif /*MODEST_HILDON_NOTIFY*/ -#ifdef MODEST_HAVE_HILDON0_WIDGETS +#if MODEST_HILDON_API == 0 #include #include #include @@ -73,7 +73,7 @@ k * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, #else -#ifdef MODEST_HAVE_HILDON1_WIDGETS +#if MODEST_HILDON_API >= 1 #include #include #include diff --git a/src/modest-defs.h b/src/modest-defs.h index 48620f2..4927cbb 100644 --- a/src/modest-defs.h +++ b/src/modest-defs.h @@ -80,7 +80,7 @@ #define MODEST_MAEMO_PROVIDER_DATA_FILE PREFIX "/share/modest/provider-data/maemo-provider-data.keyfile" -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK #define MODEST_ICON_SIZE_SMALL 26 #define MODEST_ICON_SIZE_BIG 64 #else diff --git a/src/modest-dimming-rules-group.c b/src/modest-dimming-rules-group.c index 89c388f..14ea232 100644 --- a/src/modest-dimming-rules-group.c +++ b/src/modest-dimming-rules-group.c @@ -37,7 +37,7 @@ static void modest_dimming_rules_group_class_init (ModestDimmingRulesGroupClass static void modest_dimming_rules_group_init (ModestDimmingRulesGroup *obj); static void modest_dimming_rules_group_finalize (GObject *obj); -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK static void _insensitive_press_callback (GtkWidget *widget, gpointer user_data); #endif @@ -191,7 +191,7 @@ _add_rule (ModestDimmingRulesGroup *self, priv->window = MODEST_WINDOW (window); widget = modest_dimming_rule_get_widget (rule); -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK /* Connect insensitive-presss handler to show notifications */ g_signal_connect (G_OBJECT (widget), "insensitive-press", G_CALLBACK (_insensitive_press_callback), @@ -334,7 +334,7 @@ _execute_widget_dimming_rule (gpointer data, gpointer user_data) modest_dimming_rule_process (MODEST_DIMMING_RULE(data)); } -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK static void _insensitive_press_callback (GtkWidget *widget, gpointer user_data) { diff --git a/src/modest-init.c b/src/modest-init.c index 2c00d84..976c2e2 100644 --- a/src/modest-init.c +++ b/src/modest-init.c @@ -51,7 +51,7 @@ #include #include -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK #include "modest-hildon-includes.h" #endif #include @@ -111,7 +111,7 @@ static const FolderCols SENT_COLUMNS_TWOLINES[] = { {MODEST_HEADER_VIEW_COLUMN_COMPACT_HEADER_OUT,180, 0}, }; -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK static const TnyFolderType LOCAL_FOLDERS[] = { /* TNY_FOLDER_TYPE_OUTBOX, */ TNY_FOLDER_TYPE_DRAFTS, @@ -125,7 +125,7 @@ static const TnyFolderType LOCAL_FOLDERS[] = { TNY_FOLDER_TYPE_TRASH, TNY_FOLDER_TYPE_ARCHIVE }; -#endif /* MODEST_PLATFORM_MAEMO */ +#endif /* MODEST_TOOLKIT_GTK */ static GList* new_cold_ids_gslist_from_array( const FolderCols* cols, guint col_num) @@ -625,10 +625,10 @@ init_stock_icons (void) gint i; static GtkStockItem items[] = { -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK { MODEST_STOCK_SORT, "sort mail", 0, 0, NULL }, { MODEST_STOCK_REFRESH, "refresh mail", 0, 0, NULL }, -#endif /*MODEST_PLATFORM_MAEMO*/ +#endif /*MODEST_TOOLKIT_GTK*/ { MODEST_STOCK_SPLIT_VIEW, "split view", 0, 0, NULL }, { MODEST_STOCK_MAIL_SEND, "send mail", 0, 0, NULL }, { MODEST_STOCK_NEW_MAIL, "new mail", 0, 0, NULL }, @@ -643,10 +643,10 @@ init_stock_icons (void) }; static gchar *items_names [] = { -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK MODEST_TOOLBAR_ICON_SORT, MODEST_TOOLBAR_ICON_REFRESH, -#endif /*MODEST_PLATFORM_MAEMO*/ +#endif /*MODEST_TOOLKIT_GTK*/ MODEST_TOOLBAR_ICON_SPLIT_VIEW, MODEST_TOOLBAR_ICON_MAIL_SEND, MODEST_TOOLBAR_ICON_NEW_MAIL, @@ -675,7 +675,7 @@ init_stock_icons (void) /* Register icons to accompany stock items */ for (i = 0; i < G_N_ELEMENTS (items); i++) { -#ifdef MODEST_PLATFORM_MAEMO /* MODES_PLATFORM_ID: 1 ==> gnome, 2==> maemo */ +#ifndef MODEST_PLATFORM_GTK pixbuf = gtk_icon_theme_load_icon (current_theme, items_names[i], 26, diff --git a/src/modest-plugin-1.0.pc.in b/src/modest-plugin-1.0.pc.in index 63d5543..ca07b08 100644 --- a/src/modest-plugin-1.0.pc.in +++ b/src/modest-plugin-1.0.pc.in @@ -13,6 +13,7 @@ Cflags: -I${includedir}/modest-plugin-1.0 @MODEST_PLUGIN_DEFINES@ $(MODEST_GSTUFF_LIBS) \ $(MODEST_MOZEMBED_LIBS) \ $(MODEST_PLATFORM_LIBS) \ + $(MODEST_TOOLKIT_LIBS) \ $(MODEST_HILDON_WIDGETS_LIBS) \ $(MODEST_HILDON_HELP_LIBS) \ $(MODEST_HILDON_NOTIFY_LIBS) \ diff --git a/src/modest-tny-account.c b/src/modest-tny-account.c index ac6810d..63e87ec 100644 --- a/src/modest-tny-account.c +++ b/src/modest-tny-account.c @@ -48,8 +48,8 @@ #include #include #include -#ifdef MODEST_PLATFORM_MAEMO -#ifdef MODEST_HAVE_HILDON0_WIDGETS +#ifndef MODEST_TOOLKIT_GTK +#if MODEST_HILDON_API == 0 #include #else #include @@ -591,7 +591,7 @@ typedef struct -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK /* Gets the memory card name: */ static void on_modest_file_system_info (HildonFileSystemInfoHandle *handle, @@ -632,7 +632,7 @@ on_modest_file_system_info (HildonFileSystemInfoHandle *handle, void modest_tny_account_get_mmc_account_name (TnyStoreAccount* self, ModestTnyAccountGetMmcAccountNameCallback callback, gpointer user_data) { -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK /* Just use the hard-coded path for the single memory card, * rather than try to figure out the path to the specific card by * looking at the maildir URI: diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 6890a4e..2239f56 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -51,9 +51,11 @@ #ifdef MODEST_PLATFORM_MAEMO #include "maemo/modest-osso-state-saving.h" +#endif /* MODEST_PLATFORM_MAEMO */ +#ifndef MODEST_TOOLKIT_GTK #include "maemo/modest-hildon-includes.h" #include "maemo/modest-connection-specific-smtp-window.h" -#endif /* MODEST_PLATFORM_MAEMO */ +#endif /* !MODEST_TOOLKIT_GTK */ #include #include "widgets/modest-ui-constants.h" @@ -673,7 +675,7 @@ modest_ui_actions_on_smtp_servers (GtkAction *action, ModestWindow *win) * because it requires an API (libconic) to detect different connection * possiblities. */ -#ifdef MODEST_PLATFORM_MAEMO /* Defined in config.h */ +#ifndef MODEST_TOOLKIT_GTK /* Defined in config.h */ /* Create the window if necessary: */ GtkWidget *specific_window = GTK_WIDGET (modest_connection_specific_smtp_window_new ()); @@ -685,7 +687,7 @@ modest_ui_actions_on_smtp_servers (GtkAction *action, ModestWindow *win) modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), GTK_WINDOW (specific_window)); gtk_widget_show (specific_window); -#endif /* MODEST_PLATFORM_MAEMO */ +#endif /* !MODEST_TOOLKIT_GTK */ } void @@ -2452,7 +2454,7 @@ modest_ui_actions_on_folder_selection_changed (ModestFolderView *folder_view, already being done by the sort dialog. Remove it when the GNOME version has the same behaviour */ -#ifdef MODEST_PLATFORM_GNOME +#ifdef MODEST_TOOLKIT_GTK if (modest_main_window_get_contents_style (main_window) == MODEST_MAIN_WINDOW_CONTENTS_STYLE_HEADERS) modest_widget_memory_save (conf, G_OBJECT (header_view), @@ -3032,7 +3034,7 @@ modest_ui_actions_on_remove_attachments (GtkAction *action, } -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK typedef struct { guint handler; gchar *name; @@ -3087,7 +3089,7 @@ do_create_folder_cb (ModestMailOperation *mail_op, /* Try again. Do *NOT* show any error because the mail operations system will do it for us because we created the mail_op with new_with_error_handler */ -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK CreateFolderHelper *helper; helper = g_slice_new0 (CreateFolderHelper); helper->name = g_strdup (suggested_name); @@ -3538,7 +3540,7 @@ modest_ui_actions_on_password_requested (TnyAccountStore *account_store, if (remember) *remember = TRUE; -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK /* Maemo uses a different (awkward) button order, * It should probably just use gtk_alternative_dialog_button_order (). */ @@ -3559,7 +3561,7 @@ modest_ui_actions_on_password_requested (TnyAccountStore *account_store, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); -#endif /* MODEST_PLATFORM_MAEMO */ +#endif /* !MODEST_TOOLKIT_GTK */ modest_window_mgr_set_modal (modest_runtime_get_window_mgr(), GTK_WINDOW (dialog)); @@ -3600,7 +3602,7 @@ modest_ui_actions_on_password_requested (TnyAccountStore *account_store, */ gtk_widget_set_sensitive (entry_username, FALSE); -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK /* Auto-capitalization is the default, so let's turn it off: */ hildon_gtk_entry_set_input_mode (GTK_ENTRY (entry_username), HILDON_GTK_INPUT_MODE_FULL); @@ -3618,14 +3620,14 @@ modest_ui_actions_on_password_requested (TnyAccountStore *account_store, #else gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), entry_username, TRUE, FALSE, 0); -#endif /* MODEST_PLATFORM_MAEMO */ +#endif /* !MODEST_TOOLKIT_GTK */ /* password: */ GtkWidget *entry_password = gtk_entry_new (); gtk_entry_set_visibility (GTK_ENTRY(entry_password), FALSE); /* gtk_entry_set_invisible_char (GTK_ENTRY(entry_password), "*"); */ -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK /* Auto-capitalization is the default, so let's turn it off: */ hildon_gtk_entry_set_input_mode (GTK_ENTRY (entry_password), HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_INVISIBLE); @@ -3640,7 +3642,7 @@ modest_ui_actions_on_password_requested (TnyAccountStore *account_store, #else gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), entry_password, TRUE, FALSE, 0); -#endif /* MODEST_PLATFORM_MAEMO */ +#endif /* !MODEST_TOOLKIT_GTK */ if (initial_username != NULL) gtk_widget_grab_focus (GTK_WIDGET (entry_password)); @@ -4465,7 +4467,7 @@ on_move_to_dialog_folder_selection_changed (ModestFolderView* self, return; children = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area)); -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK ok_button = GTK_WIDGET (children->next->next->data); new_button = GTK_WIDGET (children->next->data); #else @@ -4610,7 +4612,7 @@ create_move_to_dialog (GtkWindow *win, GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR | GTK_DIALOG_DESTROY_WITH_PARENT, NULL); -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK gtk_dialog_add_button (GTK_DIALOG (dialog), _("mcen_bd_dialog_ok"), GTK_RESPONSE_ACCEPT); /* We do this manually so GTK+ does not associate a response ID for * the button. */ @@ -4635,7 +4637,7 @@ create_move_to_dialog (GtkWindow *win, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); -#ifndef MODEST_PLATFORM_MAEMO +#ifdef MODEST_TOOLKIT_GTK gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll), GTK_SHADOW_IN); #endif @@ -4718,7 +4720,7 @@ create_move_to_dialog (GtkWindow *win, scroll, TRUE, TRUE, 0); gtk_widget_show_all (GTK_WIDGET(GTK_DIALOG(dialog)->vbox)); -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK gtk_window_set_default_size (GTK_WINDOW (dialog), 300, 300); #else gtk_window_set_default_size (GTK_WINDOW (dialog), 600, 400); diff --git a/src/modest-widget-memory.c b/src/modest-widget-memory.c index 56ab18a..1409a97 100644 --- a/src/modest-widget-memory.c +++ b/src/modest-widget-memory.c @@ -194,7 +194,7 @@ restore_settings_window (ModestConf *conf, GtkWindow *win, const gchar *name) gtk_window_set_default_size() makes "drag-motion" signal report bad coordinates, so drag-and-drop do not work properly */ -#ifdef MODEST_PLATFORM_GNOME +#ifdef MODEST_TOOLKIT_GTK if (height && width) gtk_window_set_default_size (win, width, height); #endif diff --git a/src/widgets/Makefile.am b/src/widgets/Makefile.am index 535adc8..ccdef8f 100644 --- a/src/widgets/Makefile.am +++ b/src/widgets/Makefile.am @@ -5,7 +5,7 @@ INCLUDES=\ $(MODEST_GSTUFF_CFLAGS) \ $(MODEST_PLATFORM_CFLAGS) \ - $(MODEST_HILDON_WIDGETS_CFLAGS) \ + $(MODEST_TOOLKIT_CFLAGS) \ $(MODEST_HILDON_HELP_CFLAGS) \ $(MODEST_MOZEMBED_CFLAGS) \ $(MODEST_HILDON_NOTIFY_CFLAGS) \ @@ -128,4 +128,4 @@ LDADD = \ $(MODEST_GSTUFF_LIBS) \ $(MODEST_MOZEMBED_LIBS) \ $(MODEST_PLATFORM_LIBS) \ - $(MODEST_HILDON_WIDGETS_LIBS) + $(MODEST_TOOLKIT_LIBS) diff --git a/src/widgets/modest-global-settings-dialog.c b/src/widgets/modest-global-settings-dialog.c index 0c18ea7..69b0ef5 100644 --- a/src/widgets/modest-global-settings-dialog.c +++ b/src/widgets/modest-global-settings-dialog.c @@ -42,12 +42,12 @@ #include "modest-tny-msg.h" #include "modest-platform.h" #include "widgets/modest-combo-box.h" -#ifdef MODEST_PLATFORM_MAEMO -#ifdef MODEST_HAVE_HILDON0_WIDGETS +#ifndef MODEST_TOOLKIT_GTK +#if MODEST_HILDON_API == 0 #include #else #include -#endif /*MODEST_HAVE_HILDON0_WIDGETS*/ +#endif /*MODEST_HILDON_API = 0*/ #endif /* include other impl specific header files */ @@ -168,7 +168,7 @@ _modest_global_settings_dialog_get_connected_via (void) GSList *list = NULL; const gchar *message; -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK const gchar *env_var = getenv ("OSSO_PRODUCT_HARDWARE"); /* Check if WIMAX is available */ if (env_var && !strncmp (env_var, "RX-48", 5)) @@ -290,7 +290,7 @@ _modest_global_settings_dialog_load_conf (ModestGlobalSettingsDialog *self) } /* It's better to do this in the subclasses, but it's just one line, so we'll leave it here for the moment */ -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK hildon_number_editor_set_value (HILDON_NUMBER_EDITOR (priv->size_limit), value); #else gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->size_limit), value); @@ -330,7 +330,7 @@ get_current_settings (ModestGlobalSettingsDialogPrivate *priv, state->auto_update = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->auto_update)); id = modest_combo_box_get_active_id (MODEST_COMBO_BOX (priv->connect_via)); state->connect_via = *id; -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK state->size_limit = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR (priv->size_limit)); #else state->size_limit = gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->size_limit)); diff --git a/src/widgets/modest-gtkhtml-msg-view.c b/src/widgets/modest-gtkhtml-msg-view.c index 3bacb9b..75c5526 100644 --- a/src/widgets/modest-gtkhtml-msg-view.c +++ b/src/widgets/modest-gtkhtml-msg-view.c @@ -50,9 +50,9 @@ #include /* FIXNE: we should have no maemo-deps in widgets/ */ -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK #include "maemo/modest-hildon-includes.h" -#endif /*MODEST_PLATFORM_MAEMO*/ +#endif /*!MODEST_TOOLKIT_GTK*/ /* 'private'/'protected' functions */ diff --git a/src/widgets/modest-header-view.c b/src/widgets/modest-header-view.c index bd101d9..78ec1b3 100644 --- a/src/widgets/modest-header-view.c +++ b/src/widgets/modest-header-view.c @@ -379,7 +379,7 @@ modest_header_view_set_columns (ModestHeaderView *self, const GList *columns, Tn g_object_set_data (G_OBJECT (renderer_recpt_box), "date-renderer", renderer_compact_date_or_status); g_object_set (G_OBJECT (renderer_subject_box), "yalign", 1.0, NULL); -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK gtk_cell_renderer_set_fixed_size (renderer_subject_box, -1, 32); gtk_cell_renderer_set_fixed_size (renderer_recpt_box, -1, 32); #endif @@ -404,7 +404,7 @@ modest_header_view_set_columns (ModestHeaderView *self, const GList *columns, Tn g_object_set (G_OBJECT (renderer_attach), "yalign", 0.0, NULL); -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK gtk_cell_renderer_set_fixed_size (renderer_attach, 32, 26); gtk_cell_renderer_set_fixed_size (renderer_priority, 32, 26); gtk_cell_renderer_set_fixed_size (renderer_compact_header, -1, 64); @@ -787,7 +787,7 @@ modest_header_view_get_selected_headers (ModestHeaderView *self) static void scroll_to_selected (ModestHeaderView *self, GtkTreeIter *iter, gboolean up) { -#ifdef MODEST_PLATFORM_GNOME +#ifdef MODEST_TOOLKIT_GTK GtkTreePath *selected_path; GtkTreePath *start, *end; @@ -812,7 +812,7 @@ scroll_to_selected (ModestHeaderView *self, GtkTreeIter *iter, gboolean up) gtk_tree_path_free (start); gtk_tree_path_free (end); -#endif /* MODEST_PLATFORM_GNOME */ +#endif /* MODEST_TOOLKIT_GTK */ } diff --git a/src/widgets/modest-recpt-editor.c b/src/widgets/modest-recpt-editor.c index a1d408e..11e1232 100644 --- a/src/widgets/modest-recpt-editor.c +++ b/src/widgets/modest-recpt-editor.c @@ -45,9 +45,9 @@ #include /* FIXNE: we should have no maemo-deps in widgets/ */ -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK #include "maemo/modest-hildon-includes.h" -#endif /*MODEST_PLATFORM_MAEMO*/ +#endif /*!MODEST_TOOLKIT_GTK*/ static GObjectClass *parent_class = NULL; diff --git a/src/widgets/modest-ui-constants.h b/src/widgets/modest-ui-constants.h index 7eb9ffb..a16ed12 100644 --- a/src/widgets/modest-ui-constants.h +++ b/src/widgets/modest-ui-constants.h @@ -35,7 +35,7 @@ * title "RE: Standard widget spacing and padding?": */ -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK #define MODEST_MARGIN_DEFAULT 6 #define MODEST_MARGIN_DOUBLE 12 #define MODEST_MARGIN_TRIPLE 18 @@ -45,8 +45,8 @@ #define MODEST_DIALOG_WINDOW_MIN_HEIGHT 172 #define MODEST_DIALOG_WINDOW_MAX_WIDTH 642 #define MODEST_DIALOG_WINDOW_MIN_WIDTH 172 +#else /* MODEST_TOOLKIT_GTK */ /* TODO: review this values with GNOME HIG */ -#else #define MODEST_MARGIN_DEFAULT 6 #define MODEST_MARGIN_DOUBLE 12 #define MODEST_MARGIN_TRIPLE 18 diff --git a/src/widgets/modest-window-mgr.c b/src/widgets/modest-window-mgr.c index 1d84505..fb88abf 100644 --- a/src/widgets/modest-window-mgr.c +++ b/src/widgets/modest-window-mgr.c @@ -546,7 +546,7 @@ get_show_toolbar_key (GType window_type, return key; } -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK static void on_window_is_topmost (GObject *gobject, GParamSpec *arg1, @@ -672,7 +672,7 @@ modest_window_mgr_register_window (ModestWindowMgr *self, /* Listen to window state changes. Unfortunately window-state-event does not properly work for the Maemo version, so we need to use is-topmost and the ifdef */ -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK priv->window_state_uids = modest_signal_mgr_connect (priv->window_state_uids, G_OBJECT (window), @@ -904,7 +904,7 @@ modest_window_mgr_unregister_window (ModestWindowMgr *self, /* Disconnect the "window-state-event" handler, we won't need it anymore */ if (priv->window_state_uids) { -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK priv->window_state_uids = modest_signal_mgr_disconnect (priv->window_state_uids, G_OBJECT (window), diff --git a/src/widgets/modest-window.c b/src/widgets/modest-window.c index 32b415e..acf9d90 100644 --- a/src/widgets/modest-window.c +++ b/src/widgets/modest-window.c @@ -88,7 +88,7 @@ modest_window_get_type (void) (GInstanceInitFunc) modest_window_init, NULL }; -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK parent_type = HILDON_TYPE_WINDOW; #else parent_type = GTK_TYPE_WINDOW; diff --git a/src/widgets/modest-window.h b/src/widgets/modest-window.h index 03acc1c..cd159d4 100644 --- a/src/widgets/modest-window.h +++ b/src/widgets/modest-window.h @@ -45,18 +45,16 @@ G_BEGIN_DECLS * admittedly, the ifdefs for gtk and maemo are rather ugly; still * this way is probably the easiest to maintain */ -#ifdef MODEST_PLATFORM_GNOME +#ifdef MODEST_TOOLKIT_GTK #include typedef GtkWindow ModestWindowParent; typedef GtkWindowClass ModestWindowParentClass; -#endif /* MODEST_PLATFORM_GNOME */ - -#ifdef MODEST_PLATFORM_MAEMO -#ifdef MODEST_HAVE_HILDON0_WIDGETS +#else +#if MODEST_HILDON_API == 0 #include #else #include -#endif /*MODEST_HAVE_HILDON0_WIDGETS*/ +#endif /*MODEST_HILDON_API == 0*/ typedef HildonWindow ModestWindowParent; typedef HildonWindowClass ModestWindowParentClass; @@ -64,7 +62,7 @@ typedef HildonWindowClass ModestWindowParentClass; #define GTK_STOCK_FULLSCREEN "" #endif /*GTK_STOCK_FULLSCREEN*/ -#endif /*MODEST_PLATFORM_MAEMO */ +#endif /*!MODEST_TOOLKIT_GTK */ /* Dimmed state variables */ typedef struct _DimmedState { diff --git a/src/widgets/modest-wizard-dialog.c b/src/widgets/modest-wizard-dialog.c index ce595ae..2e8ce6e 100644 --- a/src/widgets/modest-wizard-dialog.c +++ b/src/widgets/modest-wizard-dialog.c @@ -54,13 +54,13 @@ #include #endif -#ifdef MODEST_PLATFORM_MAEMO -#ifdef MODEST_HAVE_HILDON0_WIDGETS +#ifndef MODEST_TOOLKIT_GTK +#if MODEST_HILDON_API == 0 #include #else #include -#endif /*MODEST_HAVE_HILDON0_WIDGETS*/ -#endif /*MODEST_PLATFORM_MAEMO*/ +#endif /*MODEST_HILDON_API == 0*/ +#endif /*!MODEST_TOOLKIT_GTK*/ #include "modest-wizard-dialog.h" #include "modest-debug.h" @@ -249,8 +249,8 @@ init (ModestWizardDialog *wizard_dialog) gtk_dialog_set_has_separator (dialog, FALSE); wizard_dialog->priv = priv; priv->box = GTK_BOX (gtk_hbox_new (FALSE, 0)); -#ifdef MODEST_PLATFORM_MAEMO -#ifdef MODEST_HAVE_HILDON0_WIDGETS +#ifndef MODEST_TOOLKIT_GTK +#if MODEST_HILDON_API == 0 priv->image = gtk_image_new_from_icon_name ("qgn_widg_wizard", HILDON_ICON_SIZE_WIDG_WIZARD); #else @@ -259,10 +259,10 @@ init (ModestWizardDialog *wizard_dialog) icon_size = gtk_icon_size_register("modest_wizard", 50, 50); priv->image = gtk_image_new_from_icon_name ("qgn_widg_wizard", icon_size); -#endif /*MODEST_HILDON_VERSION_0*/ -#else /*MODEST_PLATFORM_MAEMO*/ +#endif /*MODEST_HILDON_API == 0*/ +#else /*MODEST_TOOLKIT_GTK*/ priv->image = gtk_image_new_from_stock (GTK_STOCK_PREFERENCES, GTK_ICON_SIZE_DIALOG); -#endif /*MODEST_PLATFORM_MAEMO*/ +#endif /*!MODEST_TOOLKIT_GTK*/ /* Default values for user provided properties */ priv->notebook = NULL; priv->wizard_name = NULL; @@ -274,7 +274,7 @@ init (ModestWizardDialog *wizard_dialog) gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (priv->image), FALSE, FALSE, 0); /* Add response buttons: finish, previous, next, cancel */ -#ifdef MODEST_PLATFORM_MAEMO +#ifndef MODEST_TOOLKIT_GTK gtk_dialog_add_button (dialog, _HL("ecdg_bd_wizard_finish"), MODEST_WIZARD_DIALOG_FINISH); gtk_dialog_add_button (dialog, _HL("ecdg_bd_wizard_previous"), MODEST_WIZARD_DIALOG_PREVIOUS); gtk_dialog_add_button (dialog, _HL("ecdg_bd_wizard_next"), MODEST_WIZARD_DIALOG_NEXT); diff --git a/tests/dbus_api/Makefile.am b/tests/dbus_api/Makefile.am index 07bea5f..01fa744 100644 --- a/tests/dbus_api/Makefile.am +++ b/tests/dbus_api/Makefile.am @@ -8,17 +8,17 @@ INCLUDES=\ -I$(top_srcdir) \ -DPREFIX=\"@prefix@\" \ -DMODESTLOCALEDIR=\""$(modestlocaledir)"\" - + objects=\ @CHECK_LIBS@ \ $(MODEST_GSTUFF_LIBS) \ $(MODEST_PLATFORM_LIBS) \ - $(MODEST_HILDON_WIDGETS_LIBS) \ + $(MODEST_TOOLKIT_LIBS) \ $(MODEST_HILDON_HELP_LIBS) \ $(MODEST_HILDON_NOTIFY_LIBS) \ $(MODEST_OGS_LIBS) \ ${top_srcdir}/libmodest-dbus-client/libmodest-dbus-client-1.0.la - + noinst_PROGRAMS = \ test_mail_to \ test_open_message \ -- 1.7.9.5