[evolution] Generate enum GTypes for libevolution-mail.



commit 9c1975632e679406e93d860703760c76fcd20814
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Nov 10 13:37:34 2013 -0500

    Generate enum GTypes for libevolution-mail.
    
    Steals some enum types that libemail-engine doesn't need to know about.

 libemail-engine/e-mail-engine-enums.h    |   21 ------------
 mail/Makefile.am                         |   20 +++++++++++-
 mail/e-mail-enums.h                      |   50 ++++++++++++++++++++++++++++++
 mail/e-mail-reader.c                     |    2 +-
 mail/e-mail-reader.h                     |    1 +
 mail/em-composer-utils.h                 |    7 +++-
 modules/settings/e-settings-deprecated.c |    1 +
 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 dc36f1b..aa59c07 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 b5a9caa..d99e2e8 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 0000000..7ad767f
--- /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 2477e1c..aee670d 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 fbaa67c..fe5da3d 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 3f2465d..a46b752 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 7050e1e..63fbc3e 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) \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]