aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--em-format/Makefile.am30
-rw-r--r--em-format/e-mail-formatter-enums.h90
-rw-r--r--em-format/e-mail-formatter-quote.h6
-rw-r--r--em-format/e-mail-formatter.c6
-rw-r--r--em-format/e-mail-formatter.h37
-rw-r--r--em-format/e-mail-parser-extension.h16
-rw-r--r--em-format/e-mail-part.h10
7 files changed, 127 insertions, 68 deletions
diff --git a/em-format/Makefile.am b/em-format/Makefile.am
index f26a004d0a..ad85d5cf85 100644
--- a/em-format/Makefile.am
+++ b/em-format/Makefile.am
@@ -1,11 +1,31 @@
+privsolib_LTLIBRARIES = libemformat.la
+
emformatincludedir = $(privincludedir)/em-format
-privsolib_LTLIBRARIES = libemformat.la
+ENUM_TYPES = e-mail-formatter-enums.h
+
+e-mail-formatter-enumtypes.h: $(top_srcdir)/enumtypes.h.template $(ENUM_TYPES)
+ $(AM_V_GEN) $(GLIB_MKENUMS) --template $(top_srcdir)/enumtypes.h.template \
+ --fhead "#ifndef E_MAIL_FORMATTER_ENUMTYPES_H\n#define E_MAIL_FORMATTER_ENUMTYPES_H\n" \
+ --ftail "#endif /* E_MAIL_FORMATTER_ENUMTYPES_H */\n" \
+ $(addprefix $(srcdir)/,$(ENUM_TYPES)) > $@
+
+e-mail-formatter-enumtypes.c: $(top_srcdir)/enumtypes.c.template $(ENUM_TYPES)
+ $(AM_V_GEN) $(GLIB_MKENUMS) --template $(top_srcdir)/enumtypes.c.template \
+ --fhead "#include \"e-mail-formatter-enumtypes.h\"" \
+ $(addprefix $(srcdir)/,$(ENUM_TYPES)) > $@
+
+ENUM_GENERATED = \
+ e-mail-formatter-enumtypes.c \
+ e-mail-formatter-enumtypes.h \
+ $(NULL)
emformatinclude_HEADERS = \
e-mail-extension-registry.h \
e-mail-formatter-extension.h \
e-mail-formatter.h \
+ e-mail-formatter-enums.h \
+ e-mail-formatter-enumtypes.h \
e-mail-formatter-print.h \
e-mail-formatter-quote.h \
e-mail-formatter-utils.h \
@@ -46,6 +66,7 @@ libemformat_la_SOURCES = \
e-mail-formatter-utils.c \
e-mail-formatter-attachment.c \
e-mail-formatter-attachment-bar.c \
+ e-mail-formatter-enumtypes.c \
e-mail-formatter-error.c \
e-mail-formatter-extension.c \
e-mail-formatter-headers.c \
@@ -96,7 +117,6 @@ libemformat_la_SOURCES = \
libemformat_la_LDFLAGS = -avoid-version $(NO_UNDEFINED)
-
if ENABLE_SMIME
SMIME_LIBS = \
$(top_builddir)/smime/lib/libessmime.la \
@@ -113,4 +133,10 @@ libemformat_la_LIBADD = \
$(LIBSOUP_LIBS) \
$(SMIME_LIBS)
+BUILT_SOURCES = \
+ $(ENUM_GENERATED) \
+ $(NULL)
+
+CLEANFILES = $(BUILT_SOURCES)
+
-include $(top_srcdir)/git.mk
diff --git a/em-format/e-mail-formatter-enums.h b/em-format/e-mail-formatter-enums.h
new file mode 100644
index 0000000000..e1b41d6cf6
--- /dev/null
+++ b/em-format/e-mail-formatter-enums.h
@@ -0,0 +1,90 @@
+/*
+ * e-mail-formatter-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_FORMATTER_ENUMS_H
+#define E_MAIL_FORMATTER_ENUMS_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+typedef enum {
+ E_MAIL_FORMATTER_COLOR_BODY, /* header area background */
+ E_MAIL_FORMATTER_COLOR_CITATION, /* citation font color */
+ E_MAIL_FORMATTER_COLOR_CONTENT, /* message area background */
+ E_MAIL_FORMATTER_COLOR_FRAME, /* frame around message area */
+ E_MAIL_FORMATTER_COLOR_HEADER, /* header font color */
+ E_MAIL_FORMATTER_COLOR_TEXT, /* message font color */
+ E_MAIL_FORMATTER_NUM_COLOR_TYPES /*< skip >*/
+} EMailFormatterColor;
+
+typedef enum { /*< flags >*/
+ E_MAIL_FORMATTER_HEADER_FLAG_COLLAPSABLE = 1 << 0,
+ E_MAIL_FORMATTER_HEADER_FLAG_COLLAPSED = 1 << 1,
+ E_MAIL_FORMATTER_HEADER_FLAG_HTML = 1 << 2,
+ E_MAIL_FORMATTER_HEADER_FLAG_NOCOLUMNS = 1 << 3,
+ E_MAIL_FORMATTER_HEADER_FLAG_BOLD = 1 << 4,
+ E_MAIL_FORMATTER_HEADER_FLAG_NODEC = 1 << 5,
+ E_MAIL_FORMATTER_HEADER_FLAG_HIDDEN = 1 << 6,
+ E_MAIL_FORMATTER_HEADER_FLAG_NOLINKS = 1 << 7,
+ E_MAIL_FORMATTER_HEADER_FLAG_NOELIPSIZE = 1 << 8
+} EMailFormatterHeaderFlags;
+
+typedef enum {
+ E_MAIL_FORMATTER_MODE_INVALID = -1,
+ E_MAIL_FORMATTER_MODE_NORMAL = 0,
+ E_MAIL_FORMATTER_MODE_SOURCE,
+ E_MAIL_FORMATTER_MODE_RAW,
+ E_MAIL_FORMATTER_MODE_CID,
+ E_MAIL_FORMATTER_MODE_PRINTING,
+ E_MAIL_FORMATTER_MODE_ALL_HEADERS
+} EMailFormatterMode;
+
+typedef enum { /*< flags >*/
+ E_MAIL_FORMATTER_QUOTE_FLAG_CITE = 1 << 0,
+ E_MAIL_FORMATTER_QUOTE_FLAG_HEADERS = 1 << 1,
+ E_MAIL_FORMATTER_QUOTE_FLAG_KEEP_SIG = 1 << 2 /* do not strip signature */
+} EMailFormatterQuoteFlags;
+
+/**
+ * EMailParserExtensionFlags:
+ * @E_MAIL_PARSER_EXTENSION_INLINE:
+ * Don't parse as attachment.
+ * @E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION:
+ * Always expand.
+ * @E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE:
+ * Always check what's inside.
+ **/
+typedef enum { /*< flags >*/
+ E_MAIL_PARSER_EXTENSION_INLINE = 1 << 0,
+ E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION = 1 << 1,
+ E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE = 1 << 2
+} EMailParserExtensionFlags;
+
+typedef enum { /*< flags >*/
+ E_MAIL_PART_VALIDITY_NONE = 0,
+ E_MAIL_PART_VALIDITY_PGP = 1 << 0,
+ E_MAIL_PART_VALIDITY_SMIME = 1 << 1,
+ E_MAIL_PART_VALIDITY_SIGNED = 1 << 2,
+ E_MAIL_PART_VALIDITY_ENCRYPTED = 1 << 3
+} EMailPartValidityFlags;
+
+G_END_DECLS
+
+#endif /* E_MAIL_FORMATTER_ENUMS_H */
+
diff --git a/em-format/e-mail-formatter-quote.h b/em-format/e-mail-formatter-quote.h
index 380f94a806..241a5b9ef6 100644
--- a/em-format/e-mail-formatter-quote.h
+++ b/em-format/e-mail-formatter-quote.h
@@ -48,12 +48,6 @@ typedef struct _EMailFormatterQuoteClass EMailFormatterQuoteClass;
typedef struct _EMailFormatterQuotePrivate EMailFormatterQuotePrivate;
typedef struct _EMailFormatterQuoteContext EMailFormatterQuoteContext;
-typedef enum {
- E_MAIL_FORMATTER_QUOTE_FLAG_CITE = 1 << 0,
- E_MAIL_FORMATTER_QUOTE_FLAG_HEADERS = 1 << 1,
- E_MAIL_FORMATTER_QUOTE_FLAG_KEEP_SIG = 1 << 2 /* do not strip signature */
-} EMailFormatterQuoteFlags;
-
struct _EMailFormatterQuoteContext {
EMailFormatterContext parent;
diff --git a/em-format/e-mail-formatter.c b/em-format/e-mail-formatter.c
index c7f3f32b1b..a897aeb1e2 100644
--- a/em-format/e-mail-formatter.c
+++ b/em-format/e-mail-formatter.c
@@ -469,7 +469,7 @@ mail_formatter_set_style (EMailFormatter *formatter,
GtkStateType state)
{
GdkColor *color;
- EMailFormatterColorType type;
+ EMailFormatterColor type;
g_object_freeze_notify (G_OBJECT (formatter));
@@ -1099,7 +1099,7 @@ e_mail_formatter_get_text_format_flags (EMailFormatter *formatter)
const GdkColor *
e_mail_formatter_get_color (EMailFormatter *formatter,
- EMailFormatterColorType type)
+ EMailFormatterColor type)
{
g_return_val_if_fail (E_IS_MAIL_FORMATTER (formatter), NULL);
g_return_val_if_fail (type < E_MAIL_FORMATTER_NUM_COLOR_TYPES, NULL);
@@ -1109,7 +1109,7 @@ e_mail_formatter_get_color (EMailFormatter *formatter,
void
e_mail_formatter_set_color (EMailFormatter *formatter,
- EMailFormatterColorType type,
+ EMailFormatterColor type,
const GdkColor *color)
{
GdkColor *format_color;
diff --git a/em-format/e-mail-formatter.h b/em-format/e-mail-formatter.h
index 2d58b9ed14..2a73112bfc 100644
--- a/em-format/e-mail-formatter.h
+++ b/em-format/e-mail-formatter.h
@@ -23,6 +23,7 @@
#include <libemail-engine/e-mail-enums.h>
#include <em-format/e-mail-extension-registry.h>
+#include <em-format/e-mail-formatter-enums.h>
#include <em-format/e-mail-part-list.h>
/* Standard GObject macros */
@@ -46,38 +47,6 @@
G_BEGIN_DECLS;
-typedef enum {
- E_MAIL_FORMATTER_MODE_INVALID = -1,
- E_MAIL_FORMATTER_MODE_NORMAL = 0,
- E_MAIL_FORMATTER_MODE_SOURCE,
- E_MAIL_FORMATTER_MODE_RAW,
- E_MAIL_FORMATTER_MODE_CID,
- E_MAIL_FORMATTER_MODE_PRINTING,
- E_MAIL_FORMATTER_MODE_ALL_HEADERS
-} EMailFormatterMode;
-
-typedef enum {
- E_MAIL_FORMATTER_HEADER_FLAG_COLLAPSABLE = 1 << 0,
- E_MAIL_FORMATTER_HEADER_FLAG_COLLAPSED = 1 << 1,
- E_MAIL_FORMATTER_HEADER_FLAG_HTML = 1 << 2,
- E_MAIL_FORMATTER_HEADER_FLAG_NOCOLUMNS = 1 << 3,
- E_MAIL_FORMATTER_HEADER_FLAG_BOLD = 1 << 4,
- E_MAIL_FORMATTER_HEADER_FLAG_NODEC = 1 << 5,
- E_MAIL_FORMATTER_HEADER_FLAG_HIDDEN = 1 << 6,
- E_MAIL_FORMATTER_HEADER_FLAG_NOLINKS = 1 << 7,
- E_MAIL_FORMATTER_HEADER_FLAG_NOELIPSIZE = 1 << 8
-} EMailFormatterHeaderFlags;
-
-typedef enum {
- E_MAIL_FORMATTER_COLOR_BODY, /* header area background */
- E_MAIL_FORMATTER_COLOR_CITATION, /* citation font color */
- E_MAIL_FORMATTER_COLOR_CONTENT, /* message area background */
- E_MAIL_FORMATTER_COLOR_FRAME, /* frame around message area */
- E_MAIL_FORMATTER_COLOR_HEADER, /* header font color */
- E_MAIL_FORMATTER_COLOR_TEXT, /* message font color */
- E_MAIL_FORMATTER_NUM_COLOR_TYPES
-} EMailFormatterColorType;
-
typedef struct _EMailFormatter EMailFormatter;
typedef struct _EMailFormatterClass EMailFormatterClass;
typedef struct _EMailFormatterPrivate EMailFormatterPrivate;
@@ -177,9 +146,9 @@ CamelMimeFilterToHTMLFlags
const GdkColor *
e_mail_formatter_get_color (EMailFormatter *formatter,
- EMailFormatterColorType type);
+ EMailFormatterColor type);
void e_mail_formatter_set_color (EMailFormatter *efh,
- EMailFormatterColorType type,
+ EMailFormatterColor type,
const GdkColor *color);
void e_mail_formatter_set_style (EMailFormatter *formatter,
GtkStyle *style,
diff --git a/em-format/e-mail-parser-extension.h b/em-format/e-mail-parser-extension.h
index c011df62ab..840f84dc3c 100644
--- a/em-format/e-mail-parser-extension.h
+++ b/em-format/e-mail-parser-extension.h
@@ -21,6 +21,7 @@
#include <camel/camel.h>
#include <em-format/e-mail-parser.h>
+#include <em-format/e-mail-formatter-enums.h>
/* Standard GObject macros */
#define E_TYPE_MAIL_PARSER_EXTENSION \
@@ -48,21 +49,6 @@ typedef struct _EMailParserExtensionClass EMailParserExtensionClass;
typedef struct _EMailParserExtensionPrivate EMailParserExtensionPrivate;
/**
- * EMailParserExtensionFlags:
- * @E_MAIL_PARSER_EXTENSION_INLINE:
- * Don't parse as attachment.
- * @E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION:
- * Always expand.
- * @E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE:
- * Always check what's inside.
- **/
-typedef enum {
- E_MAIL_PARSER_EXTENSION_INLINE = 1 << 0,
- E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION = 1 << 1,
- E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE = 1 << 2
-} EMailParserExtensionFlags;
-
-/**
* EMailParserExtension:
*
* The #EMailParserExtension is an abstract interface for all extensions for
diff --git a/em-format/e-mail-part.h b/em-format/e-mail-part.h
index 774828eb23..1f1a5d752f 100644
--- a/em-format/e-mail-part.h
+++ b/em-format/e-mail-part.h
@@ -24,6 +24,8 @@
#include <e-util/e-util.h>
+#include <em-format/e-mail-formatter-enums.h>
+
#define E_MAIL_PART_IS(p,s_t) \
((p != NULL) && (e_mail_part_get_instance_size (p) == sizeof (s_t)))
#define E_MAIL_PART(o) ((EMailPart *) o)
@@ -36,14 +38,6 @@ typedef struct _EMailPartPrivate EMailPartPrivate;
typedef void (*EMailPartDOMBindFunc) (EMailPart *part,
WebKitDOMElement *element);
-enum {
- E_MAIL_PART_VALIDITY_NONE = 0,
- E_MAIL_PART_VALIDITY_PGP = 1 << 0,
- E_MAIL_PART_VALIDITY_SMIME = 1 << 1,
- E_MAIL_PART_VALIDITY_SIGNED = 1 << 2,
- E_MAIL_PART_VALIDITY_ENCRYPTED = 1 << 3
-} EMailPartValidityFlags;
-
typedef struct _EMailPartValidityPair EMailPartValidityPair;
struct _EMailPartValidityPair {