aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-11-11 02:37:34 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-11-11 21:29:20 +0800
commit9c1975632e679406e93d860703760c76fcd20814 (patch)
tree9f41631d3bcc5d73848b3349a7b47d16a0285b1d
parentab13a0e01a9ee7609ee2ef86cc5aeee3172c87cc (diff)
downloadgsoc2013-evolution-9c1975632e679406e93d860703760c76fcd20814.tar
gsoc2013-evolution-9c1975632e679406e93d860703760c76fcd20814.tar.gz
gsoc2013-evolution-9c1975632e679406e93d860703760c76fcd20814.tar.bz2
gsoc2013-evolution-9c1975632e679406e93d860703760c76fcd20814.tar.lz
gsoc2013-evolution-9c1975632e679406e93d860703760c76fcd20814.tar.xz
gsoc2013-evolution-9c1975632e679406e93d860703760c76fcd20814.tar.zst
gsoc2013-evolution-9c1975632e679406e93d860703760c76fcd20814.zip
Generate enum GTypes for libevolution-mail.
Steals some enum types that libemail-engine doesn't need to know about.
-rw-r--r--libemail-engine/e-mail-engine-enums.h21
-rw-r--r--mail/Makefile.am20
-rw-r--r--mail/e-mail-enums.h50
-rw-r--r--mail/e-mail-reader.c2
-rw-r--r--mail/e-mail-reader.h1
-rw-r--r--mail/em-composer-utils.h7
-rw-r--r--modules/settings/e-settings-deprecated.c1
7 files changed, 77 insertions, 25 deletions
diff --git a/libemail-engine/e-mail-engine-enums.h b/libemail-engine/e-mail-engine-enums.h
index dc36f1b338..aa59c07031 100644
--- a/libemail-engine/e-mail-engine-enums.h
+++ b/libemail-engine/e-mail-engine-enums.h
@@ -24,12 +24,6 @@
G_BEGIN_DECLS
typedef enum {
- E_MAIL_FORWARD_STYLE_ATTACHED,
- E_MAIL_FORWARD_STYLE_INLINE,
- E_MAIL_FORWARD_STYLE_QUOTED
-} EMailForwardStyle;
-
-typedef enum {
E_MAIL_IMAGE_LOADING_POLICY_NEVER,
E_MAIL_IMAGE_LOADING_POLICY_SOMETIMES,
E_MAIL_IMAGE_LOADING_POLICY_ALWAYS
@@ -48,21 +42,6 @@ typedef enum {
E_MAIL_NUM_LOCAL_FOLDERS
} EMailLocalFolder;
-typedef enum {
- E_MAIL_REPLY_STYLE_QUOTED,
- E_MAIL_REPLY_STYLE_DO_NOT_QUOTE,
- E_MAIL_REPLY_STYLE_ATTACH,
- E_MAIL_REPLY_STYLE_OUTLOOK
-} EMailReplyStyle;
-
-typedef enum {
- E_MAIL_REPLY_TO_SENDER,
- E_MAIL_REPLY_TO_RECIPIENT,
- E_MAIL_REPLY_TO_FROM,
- E_MAIL_REPLY_TO_ALL,
- E_MAIL_REPLY_TO_LIST
-} EMailReplyType;
-
G_END_DECLS
#endif /* E_MAIL_ENGINE_ENUMS_H */
diff --git a/mail/Makefile.am b/mail/Makefile.am
index b5a9caa3ea..d99e2e8dc1 100644
--- a/mail/Makefile.am
+++ b/mail/Makefile.am
@@ -2,6 +2,21 @@ SUBDIRS = . default importers
privsolib_LTLIBRARIES = libevolution-mail.la
+ENUM_TYPES = e-mail-enums.h
+
+e-mail-enumtypes.h: $(top_srcdir)/enumtypes.h.template $(ENUM_TYPES)
+ $(AM_V_GEN) $(GLIB_MKENUMS) --template $(top_srcdir)/enumtypes.h.template \
+ --fhead "#ifndef E_MAIL_ENUMTYPES_H\n#define E_MAIL_ENUMTYPES_H\n" \
+ --ftail "#endif /* E_MAIL_ENUMTYPES_H */\n" \
+ $(addprefix $(srcdir)/,$(ENUM_TYPES)) > $@
+
+e-mail-enumtypes.c: $(top_srcdir)/enumtypes.c.template $(ENUM_TYPES)
+ $(AM_V_GEN) $(GLIB_MKENUMS) --template $(top_srcdir)/enumtypes.c.template \
+ --fhead "#include \"e-mail-enumtypes.h\"" \
+ $(addprefix $(srcdir)/,$(ENUM_TYPES)) > $@
+
+ENUM_GENERATED = e-mail-enumtypes.h e-mail-enumtypes.c
+
mailincludedir = $(privincludedir)/mail
libevolution_mail_la_CPPFLAGS = \
@@ -65,6 +80,8 @@ mailinclude_HEADERS = \
e-mail-config-window.h \
e-mail-display.h \
e-mail-display-popup-extension.h \
+ e-mail-enums.h \
+ e-mail-enumtypes.h \
e-mail-folder-pane.h \
e-mail-junk-options.h \
e-mail-label-action.h \
@@ -140,6 +157,7 @@ libevolution_mail_la_SOURCES = \
e-mail-config-window.c \
e-mail-display.c \
e-mail-display-popup-extension.c \
+ e-mail-enumtypes.c \
e-mail-folder-pane.c \
e-mail-junk-options.c \
e-mail-label-action.c \
@@ -277,7 +295,7 @@ endif
dist-hook:
cd $(distdir); rm -f $(BUILT_SOURCES)
-BUILT_SOURCES = $(error_DATA)
+BUILT_SOURCES = $(ENUM_GENERATED) $(error_DATA)
CLEANFILES = $(BUILT_SOURCES)
diff --git a/mail/e-mail-enums.h b/mail/e-mail-enums.h
new file mode 100644
index 0000000000..7ad767f940
--- /dev/null
+++ b/mail/e-mail-enums.h
@@ -0,0 +1,50 @@
+/*
+ * e-mail-enums.h
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+#ifndef E_MAIL_ENUMS_H
+#define E_MAIL_ENUMS_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+typedef enum {
+ E_MAIL_FORWARD_STYLE_ATTACHED,
+ E_MAIL_FORWARD_STYLE_INLINE,
+ E_MAIL_FORWARD_STYLE_QUOTED
+} EMailForwardStyle;
+
+typedef enum {
+ E_MAIL_REPLY_STYLE_QUOTED,
+ E_MAIL_REPLY_STYLE_DO_NOT_QUOTE,
+ E_MAIL_REPLY_STYLE_ATTACH,
+ E_MAIL_REPLY_STYLE_OUTLOOK
+} EMailReplyStyle;
+
+typedef enum {
+ E_MAIL_REPLY_TO_SENDER,
+ E_MAIL_REPLY_TO_RECIPIENT,
+ E_MAIL_REPLY_TO_FROM,
+ E_MAIL_REPLY_TO_ALL,
+ E_MAIL_REPLY_TO_LIST
+} EMailReplyType;
+
+G_END_DECLS
+
+#endif /* E_MAIL_ENUMS_H */
+
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 2477e1c286..aee670d60a 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -34,7 +34,6 @@
#include "shell/e-shell-utils.h"
-#include "libemail-engine/e-mail-engine-enumtypes.h"
#include "libemail-engine/e-mail-utils.h"
#include "libemail-engine/mail-mt.h"
#include "libemail-engine/mail-ops.h"
@@ -45,6 +44,7 @@
#include "e-mail-backend.h"
#include "e-mail-browser.h"
+#include "e-mail-enumtypes.h"
#include "e-mail-reader-utils.h"
#include "e-mail-ui-session.h"
#include "e-mail-view.h"
diff --git a/mail/e-mail-reader.h b/mail/e-mail-reader.h
index fbaa67c072..fe5da3daa6 100644
--- a/mail/e-mail-reader.h
+++ b/mail/e-mail-reader.h
@@ -34,6 +34,7 @@
#include <mail/e-mail-backend.h>
#include <mail/e-mail-display.h>
+#include <mail/e-mail-enums.h>
/* Standard GObject macros */
#define E_TYPE_MAIL_READER \
diff --git a/mail/em-composer-utils.h b/mail/em-composer-utils.h
index 3f2465daeb..a46b752e63 100644
--- a/mail/em-composer-utils.h
+++ b/mail/em-composer-utils.h
@@ -25,10 +25,13 @@
#define EM_COMPOSER_UTILS_H
#include <em-format/e-mail-part.h>
-#include <mail/e-mail-backend.h>
-#include <composer/e-msg-composer.h>
#include <em-format/e-mail-part-list.h>
+#include <composer/e-msg-composer.h>
+
+#include <mail/e-mail-backend.h>
+#include <mail/e-mail-enums.h>
+
G_BEGIN_DECLS
EMsgComposer * em_utils_compose_new_message (EShell *shell,
diff --git a/modules/settings/e-settings-deprecated.c b/modules/settings/e-settings-deprecated.c
index 7050e1e2a6..63fbc3ee6e 100644
--- a/modules/settings/e-settings-deprecated.c
+++ b/modules/settings/e-settings-deprecated.c
@@ -24,6 +24,7 @@
#include "e-settings-deprecated.h"
#include <shell/e-shell.h>
+#include <mail/e-mail-enums.h>
#include <libemail-engine/e-mail-engine-enums.h>
#define E_SETTINGS_DEPRECATED_GET_PRIVATE(obj) \