aboutsummaryrefslogtreecommitdiffstats
path: root/em-format
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-12-08 01:32:32 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-12-08 03:01:05 +0800
commitcab6eac8f14974ea1c2fedaf9143e98cf630c489 (patch)
tree38cd8e6e510b6c461f7537c64aea88a11c385f4f /em-format
parent3ae26f0ab68776e230a2be58939e5bf69c8fa2d5 (diff)
downloadgsoc2013-evolution-cab6eac8f14974ea1c2fedaf9143e98cf630c489.tar
gsoc2013-evolution-cab6eac8f14974ea1c2fedaf9143e98cf630c489.tar.gz
gsoc2013-evolution-cab6eac8f14974ea1c2fedaf9143e98cf630c489.tar.bz2
gsoc2013-evolution-cab6eac8f14974ea1c2fedaf9143e98cf630c489.tar.lz
gsoc2013-evolution-cab6eac8f14974ea1c2fedaf9143e98cf630c489.tar.xz
gsoc2013-evolution-cab6eac8f14974ea1c2fedaf9143e98cf630c489.tar.zst
gsoc2013-evolution-cab6eac8f14974ea1c2fedaf9143e98cf630c489.zip
Convert EMailParserExtension to an abstract class.
With the previous changes, all parser extensions derive from GObjectClass and implement the EMailParserExtensionInterface. Simplify things further by making EMailParserExtension an abstract base class so parser extensions are now just direct subclasses and need not bother with implementing GObject interfaces.
Diffstat (limited to 'em-format')
-rw-r--r--em-format/e-mail-format-extensions.c10
-rw-r--r--em-format/e-mail-parser-application-mbox.c34
-rw-r--r--em-format/e-mail-parser-application-smime.c45
-rw-r--r--em-format/e-mail-parser-attachment-bar.c33
-rw-r--r--em-format/e-mail-parser-extension.c32
-rw-r--r--em-format/e-mail-parser-extension.h46
-rw-r--r--em-format/e-mail-parser-headers.c33
-rw-r--r--em-format/e-mail-parser-image.c33
-rw-r--r--em-format/e-mail-parser-inlinepgp-encrypted.c33
-rw-r--r--em-format/e-mail-parser-inlinepgp-signed.c33
-rw-r--r--em-format/e-mail-parser-message-deliverystatus.c33
-rw-r--r--em-format/e-mail-parser-message-external.c33
-rw-r--r--em-format/e-mail-parser-message-rfc822.c35
-rw-r--r--em-format/e-mail-parser-message.c33
-rw-r--r--em-format/e-mail-parser-multipart-alternative.c33
-rw-r--r--em-format/e-mail-parser-multipart-appledouble.c33
-rw-r--r--em-format/e-mail-parser-multipart-digest.c35
-rw-r--r--em-format/e-mail-parser-multipart-encrypted.c33
-rw-r--r--em-format/e-mail-parser-multipart-mixed.c34
-rw-r--r--em-format/e-mail-parser-multipart-related.c33
-rw-r--r--em-format/e-mail-parser-multipart-signed.c32
-rw-r--r--em-format/e-mail-parser-secure-button.c33
-rw-r--r--em-format/e-mail-parser-source.c33
-rw-r--r--em-format/e-mail-parser-text-enriched.c33
-rw-r--r--em-format/e-mail-parser-text-html.c33
-rw-r--r--em-format/e-mail-parser-text-plain.c33
26 files changed, 240 insertions, 624 deletions
diff --git a/em-format/e-mail-format-extensions.c b/em-format/e-mail-format-extensions.c
index 117d51a90e..8ba36702a8 100644
--- a/em-format/e-mail-format-extensions.c
+++ b/em-format/e-mail-format-extensions.c
@@ -103,13 +103,9 @@ load (EMailExtensionRegistry *ereg,
extension_class)->mime_types;
interface_type = E_TYPE_MAIL_PARSER_EXTENSION;
- if (g_type_is_a (extension_type, interface_type)) {
- EMailParserExtensionInterface *interface;
-
- interface = g_type_interface_peek (
- extension_class, interface_type);
- mime_types = interface->mime_types;
- }
+ if (g_type_is_a (extension_type, interface_type))
+ mime_types = ((EMailParserExtensionClass *)
+ extension_class)->mime_types;
if (mime_types != NULL)
e_mail_extension_registry_add_extension (
diff --git a/em-format/e-mail-parser-application-mbox.c b/em-format/e-mail-parser-application-mbox.c
index 2821e981de..d4ff6b11bf 100644
--- a/em-format/e-mail-parser-application-mbox.c
+++ b/em-format/e-mail-parser-application-mbox.c
@@ -34,24 +34,13 @@
#include <string.h>
-typedef struct _EMailParserApplicationMBox {
- GObject parent;
-} EMailParserApplicationMBox;
+typedef EMailParserExtension EMailParserApplicationMBox;
+typedef EMailParserExtensionClass EMailParserApplicationMBoxClass;
-typedef struct _EMailParserApplicationMBoxClass {
- GObjectClass parent_class;
-} EMailParserApplicationMBoxClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserApplicationMBox,
e_mail_parser_application_mbox,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"application/mbox",
@@ -179,19 +168,14 @@ empe_app_mbox_get_flags (EMailParserExtension *extension)
}
static void
-e_mail_parser_application_mbox_class_init (EMailParserApplicationMBoxClass *class)
-{
-}
-
-static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *interface)
+e_mail_parser_application_mbox_class_init (EMailParserExtensionClass *class)
{
- interface->mime_types = parser_mime_types;
- interface->parse = empe_app_mbox_parse;
- interface->get_flags = empe_app_mbox_get_flags;
+ class->mime_types = parser_mime_types;
+ class->parse = empe_app_mbox_parse;
+ class->get_flags = empe_app_mbox_get_flags;
}
static void
-e_mail_parser_application_mbox_init (EMailParserApplicationMBox *self)
+e_mail_parser_application_mbox_init (EMailParserExtension *extension)
{
}
diff --git a/em-format/e-mail-parser-application-smime.c b/em-format/e-mail-parser-application-smime.c
index e5eab1bc4d..29e623b52c 100644
--- a/em-format/e-mail-parser-application-smime.c
+++ b/em-format/e-mail-parser-application-smime.c
@@ -34,24 +34,13 @@
#include <string.h>
-typedef struct _EMailParserApplicationSMIME {
- GObject parent;
-} EMailParserApplicationSMIME;
+typedef EMailParserExtension EMailParserApplicationSMIME;
+typedef EMailParserExtensionClass EMailParserApplicationSMIMEClass;
-typedef struct _EMailParserAppplicationSMIMEClass {
- GObjectClass parent_class;
-} EMailParserApplicationSMIMEClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserApplicationSMIME,
e_mail_parser_application_smime,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"application/xpkcs7mime",
@@ -65,11 +54,11 @@ static const gchar *parser_mime_types[] = {
static gboolean
empe_app_smime_parse (EMailParserExtension *extension,
- EMailParser *parser,
- CamelMimePart *part,
- GString *part_id,
- GCancellable *cancellable,
- GQueue *out_mail_parts)
+ EMailParser *parser,
+ CamelMimePart *part,
+ GString *part_id,
+ GCancellable *cancellable,
+ GQueue *out_mail_parts)
{
CamelCipherContext *context;
CamelMimePart *opart;
@@ -168,20 +157,14 @@ empe_app_smime_get_flags (EMailParserExtension *extension)
}
static void
-e_mail_parser_application_smime_class_init (EMailParserApplicationSMIMEClass *class)
+e_mail_parser_application_smime_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_app_smime_parse;
+ class->get_flags = empe_app_smime_get_flags;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *interface)
+e_mail_parser_application_smime_init (EMailParserExtension *extension)
{
- interface->mime_types = parser_mime_types;
- interface->parse = empe_app_smime_parse;
- interface->get_flags = empe_app_smime_get_flags;
-}
-
-static void
-e_mail_parser_application_smime_init (EMailParserApplicationSMIME *parser)
-{
-
}
diff --git a/em-format/e-mail-parser-attachment-bar.c b/em-format/e-mail-parser-attachment-bar.c
index 77a796cae0..8b4489ec8b 100644
--- a/em-format/e-mail-parser-attachment-bar.c
+++ b/em-format/e-mail-parser-attachment-bar.c
@@ -42,24 +42,13 @@ mail_part_attachment_bar_free (EMailPart *part)
/******************************************************************************/
-typedef struct _EMailParserAttachmentBar {
- GObject parent;
-} EMailParserAttachmentBar;
+typedef EMailParserExtension EMailParserAttachmentBar;
+typedef EMailParserExtensionClass EMailParserAttachmentBarClass;
-typedef struct _EMailParserAttachmentBarClass {
- GObjectClass parent_class;
-} EMailParserAttachmentBarClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserAttachmentBar,
e_mail_parser_attachment_bar,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init))
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"application/vnd.evolution.widget.attachment-bar",
@@ -92,19 +81,13 @@ empe_attachment_bar_parse (EMailParserExtension *extension,
}
static void
-e_mail_parser_attachment_bar_class_init (EMailParserAttachmentBarClass *class)
+e_mail_parser_attachment_bar_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_attachment_bar_parse;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_attachment_bar_init (EMailParserExtension *extension)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_attachment_bar_parse;
-}
-
-static void
-e_mail_parser_attachment_bar_init (EMailParserAttachmentBar *parser)
-{
-
}
diff --git a/em-format/e-mail-parser-extension.c b/em-format/e-mail-parser-extension.c
index 5497d3a1c6..b20ae90e32 100644
--- a/em-format/e-mail-parser-extension.c
+++ b/em-format/e-mail-parser-extension.c
@@ -20,7 +20,7 @@
#include "e-mail-parser-extension.h"
-G_DEFINE_INTERFACE (
+G_DEFINE_ABSTRACT_TYPE (
EMailParserExtension,
e_mail_parser_extension,
G_TYPE_OBJECT)
@@ -31,17 +31,15 @@ mail_parser_extension_get_flags (EMailParserExtension *extension)
return 0;
}
-/**
- * EMailParserExtension:
- *
- * The #EMailParserExtension is an abstract interface for all extensions for
- * #EMailParser.
- */
+static void
+e_mail_parser_extension_class_init (EMailParserExtensionClass *class)
+{
+ class->get_flags = mail_parser_extension_get_flags;
+}
static void
-e_mail_parser_extension_default_init (EMailParserExtensionInterface *interface)
+e_mail_parser_extension_init (EMailParserExtension *extension)
{
- interface->get_flags = mail_parser_extension_get_flags;
}
/**
@@ -85,19 +83,19 @@ e_mail_parser_extension_parse (EMailParserExtension *extension,
GCancellable *cancellable,
GQueue *out_mail_parts)
{
- EMailParserExtensionInterface *interface;
+ EMailParserExtensionClass *class;
g_return_val_if_fail (E_IS_MAIL_PARSER_EXTENSION (extension), FALSE);
g_return_val_if_fail (E_IS_MAIL_PARSER (parser), FALSE);
- interface = E_MAIL_PARSER_EXTENSION_GET_INTERFACE (extension);
- g_return_val_if_fail (interface->parse != NULL, FALSE);
+ class = E_MAIL_PARSER_EXTENSION_GET_CLASS (extension);
+ g_return_val_if_fail (class->parse != NULL, FALSE);
/* Check for cancellation before calling the method. */
if (g_cancellable_is_cancelled (cancellable))
return FALSE;
- return interface->parse (
+ return class->parse (
extension, parser, mime_part, part_id,
cancellable, out_mail_parts);
}
@@ -105,12 +103,12 @@ e_mail_parser_extension_parse (EMailParserExtension *extension,
guint32
e_mail_parser_extension_get_flags (EMailParserExtension *extension)
{
- EMailParserExtensionInterface *interface;
+ EMailParserExtensionClass *class;
g_return_val_if_fail (E_IS_MAIL_PARSER_EXTENSION (extension), 0);
- interface = E_MAIL_PARSER_EXTENSION_GET_INTERFACE (extension);
- g_return_val_if_fail (interface->get_flags != NULL, 0);
+ class = E_MAIL_PARSER_EXTENSION_GET_CLASS (extension);
+ g_return_val_if_fail (class->get_flags != NULL, 0);
- return interface->get_flags (extension);
+ return class->get_flags (extension);
}
diff --git a/em-format/e-mail-parser-extension.h b/em-format/e-mail-parser-extension.h
index 06128cf68c..e510a15591 100644
--- a/em-format/e-mail-parser-extension.h
+++ b/em-format/e-mail-parser-extension.h
@@ -28,18 +28,18 @@
#define E_MAIL_PARSER_EXTENSION(obj) \
(G_TYPE_CHECK_INSTANCE_CAST \
((obj), E_TYPE_MAIL_PARSER_EXTENSION, EMailParserExtension))
-#define E_MAIL_PARSER_EXTENSION_INTERFACE(cls) \
+#define E_MAIL_PARSER_EXTENSION_CLASS(cls) \
(G_TYPE_CHECK_CLASS_CAST \
- ((cls), E_TYPE_MAIL_PARSER_EXTENSION, EMailParserExtensionInterface))
+ ((cls), E_TYPE_MAIL_PARSER_EXTENSION, EMailParserExtensionClass))
#define E_IS_MAIL_PARSER_EXTENSION(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE \
((obj), E_TYPE_MAIL_PARSER_EXTENSION))
-#define E_IS_MAIL_PARSER_EXTENSION_INTERFACE(cls) \
+#define E_IS_MAIL_PARSER_EXTENSION_CLASS(cls) \
(G_TYPE_CHECK_CLASS_TYPE \
((cls), E_TYPE_MAIL_PARSER_EXTENSION))
-#define E_MAIL_PARSER_EXTENSION_GET_INTERFACE(obj) \
- (G_TYPE_INSTANCE_GET_INTERFACE \
- ((obj), E_TYPE_MAIL_PARSER_EXTENSION, EMailParserExtensionInterface))
+#define E_MAIL_PARSER_EXTENSION_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_MAIL_PARSER_EXTENSION, EMailParserExtensionClass))
#define EMP_EXTENSION_GET_PARSER(e) \
E_MAIL_PARSER (e_extension_get_extensible (E_EXTENSION (e)))
@@ -47,7 +47,8 @@
G_BEGIN_DECLS
typedef struct _EMailParserExtension EMailParserExtension;
-typedef struct _EMailParserExtensionInterface EMailParserExtensionInterface;
+typedef struct _EMailParserExtensionClass EMailParserExtensionClass;
+typedef struct _EMailParserExtensionPrivate EMailParserExtensionPrivate;
/**
* EMailParserExtensionFlags:
@@ -64,23 +65,32 @@ typedef enum {
E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE = 1 << 2
} EMailParserExtensionFlags;
-struct _EMailParserExtensionInterface {
- GTypeInterface parent_interface;
+/**
+ * EMailParserExtension:
+ *
+ * The #EMailParserExtension is an abstract interface for all extensions for
+ * #EMailParser.
+ */
+struct _EMailParserExtension {
+ GObject parent;
+ EMailParserExtensionPrivate *priv;
+};
+
+struct _EMailParserExtensionClass {
+ GObjectClass parent_class;
/* This is a NULL-terminated array of supported MIME types.
* The MIME types can be exact (e.g. "text/plain") or use a
* wildcard (e.g. "text/ *"). */
const gchar **mime_types;
- gboolean (*parse) (EMailParserExtension *extension,
- EMailParser *parser,
- CamelMimePart *mime_part,
- GString *part_id,
- GCancellable *cancellable,
- GQueue *out_mail_parts);
-
- guint32 (*get_flags) (EMailParserExtension *extension);
-
+ gboolean (*parse) (EMailParserExtension *extension,
+ EMailParser *parser,
+ CamelMimePart *mime_part,
+ GString *part_id,
+ GCancellable *cancellable,
+ GQueue *out_mail_parts);
+ guint32 (*get_flags) (EMailParserExtension *extension);
};
GType e_mail_parser_extension_get_type
diff --git a/em-format/e-mail-parser-headers.c b/em-format/e-mail-parser-headers.c
index e31f2932be..4646fd3107 100644
--- a/em-format/e-mail-parser-headers.c
+++ b/em-format/e-mail-parser-headers.c
@@ -33,24 +33,13 @@
#include <string.h>
-typedef struct _EMailParserHeaders {
- GObject parent;
-} EMailParserHeaders;
+typedef EMailParserExtension EMailParserHeaders;
+typedef EMailParserExtensionClass EMailParserHeadersClass;
-typedef struct _EMailParserHeadersClass {
- GObjectClass parent_class;
-} EMailParserHeadersClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserHeaders,
e_mail_parser_headers,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"application/vnd.evolution.headers",
@@ -112,19 +101,13 @@ empe_headers_parse (EMailParserExtension *extension,
}
static void
-e_mail_parser_headers_class_init (EMailParserHeadersClass *class)
+e_mail_parser_headers_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_headers_parse;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_headers_init (EMailParserExtension *extension)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_headers_parse;
-}
-
-static void
-e_mail_parser_headers_init (EMailParserHeaders *parser)
-{
-
}
diff --git a/em-format/e-mail-parser-image.c b/em-format/e-mail-parser-image.c
index 18bc8ff208..976cfe4463 100644
--- a/em-format/e-mail-parser-image.c
+++ b/em-format/e-mail-parser-image.c
@@ -30,24 +30,13 @@
#include <glib/gi18n-lib.h>
#include <camel/camel.h>
-typedef struct _EMailParserImage {
- GObject parent;
-} EMailParserImage;
+typedef EMailParserExtension EMailParserImage;
+typedef EMailParserExtensionClass EMailParserImageClass;
-typedef struct _EMailParserImageClass {
- GObjectClass parent_class;
-} EMailParserImageClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserImage,
e_mail_parser_image,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"image/gif",
@@ -116,19 +105,13 @@ empe_image_parse (EMailParserExtension *extension,
}
static void
-e_mail_parser_image_class_init (EMailParserImageClass *class)
+e_mail_parser_image_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_image_parse;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_image_init (EMailParserExtension *extension)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_image_parse;
-}
-
-static void
-e_mail_parser_image_init (EMailParserImage *parser)
-{
-
}
diff --git a/em-format/e-mail-parser-inlinepgp-encrypted.c b/em-format/e-mail-parser-inlinepgp-encrypted.c
index 081ba15dd8..709446c2bb 100644
--- a/em-format/e-mail-parser-inlinepgp-encrypted.c
+++ b/em-format/e-mail-parser-inlinepgp-encrypted.c
@@ -32,24 +32,13 @@
#include <string.h>
-typedef struct _EMailParserInlinePGPEncrypted {
- GObject parent;
-} EMailParserInlinePGPEncrypted;
+typedef EMailParserExtension EMailParserInlinePGPEncrypted;
+typedef EMailParserExtensionClass EMailParserInlinePGPEncryptedClass;
-typedef struct _EMailParserInlinePGPEncryptedClass {
- GObjectClass parent_class;
-} EMailParserInlinePGPEncryptedClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserInlinePGPEncrypted,
e_mail_parser_inline_pgp_encrypted,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"application/x-inlinepgp-encrypted",
@@ -172,19 +161,13 @@ empe_inlinepgp_encrypted_parse (EMailParserExtension *extension,
}
static void
-e_mail_parser_inline_pgp_encrypted_class_init (EMailParserInlinePGPEncryptedClass *class)
+e_mail_parser_inline_pgp_encrypted_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_inlinepgp_encrypted_parse;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_inline_pgp_encrypted_init (EMailParserExtension *extension)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_inlinepgp_encrypted_parse;
-}
-
-static void
-e_mail_parser_inline_pgp_encrypted_init (EMailParserInlinePGPEncrypted *parser)
-{
-
}
diff --git a/em-format/e-mail-parser-inlinepgp-signed.c b/em-format/e-mail-parser-inlinepgp-signed.c
index c7a79b863f..77df84743e 100644
--- a/em-format/e-mail-parser-inlinepgp-signed.c
+++ b/em-format/e-mail-parser-inlinepgp-signed.c
@@ -32,24 +32,13 @@
#include <string.h>
-typedef struct _EMailParserInlinePGPSigned {
- GObject parent;
-} EMailParserInlinePGPSigned;
+typedef EMailParserExtension EMailParserInlinePGPSigned;
+typedef EMailParserExtensionClass EMailParserInlinePGPSignedClass;
-typedef struct _EMailParserInlinePGPSignedClass {
- GObjectClass parent_class;
-} EMailParserInlinePGPSignedClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserInlinePGPSigned,
e_mail_parser_inline_pgp_signed,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"application/x-inlinepgp-signed",
@@ -196,19 +185,13 @@ empe_inlinepgp_signed_parse (EMailParserExtension *extension,
}
static void
-e_mail_parser_inline_pgp_signed_class_init (EMailParserInlinePGPSignedClass *class)
+e_mail_parser_inline_pgp_signed_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_inlinepgp_signed_parse;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_inline_pgp_signed_init (EMailParserExtension *extension)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_inlinepgp_signed_parse;
-}
-
-static void
-e_mail_parser_inline_pgp_signed_init (EMailParserInlinePGPSigned *parser)
-{
-
}
diff --git a/em-format/e-mail-parser-message-deliverystatus.c b/em-format/e-mail-parser-message-deliverystatus.c
index b7df31ec31..3acbff7ea3 100644
--- a/em-format/e-mail-parser-message-deliverystatus.c
+++ b/em-format/e-mail-parser-message-deliverystatus.c
@@ -32,24 +32,13 @@
#include <string.h>
-typedef struct _EMailParserMessageDeliveryStatus {
- GObject parent;
-} EMailParserMessageDeliveryStatus;
+typedef EMailParserExtension EMailParserMessageDeliveryStatus;
+typedef EMailParserExtensionClass EMailParserMessageDeliveryStatusClass;
-typedef struct _EMailParserMessageDeliveryStatusClass {
- GObjectClass parent_class;
-} EMailParserMessageDeliveryStatusClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserMessageDeliveryStatus,
e_mail_parser_message_delivery_status,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"message/delivery-status",
@@ -89,19 +78,13 @@ empe_msg_deliverystatus_parse (EMailParserExtension *extension,
}
static void
-e_mail_parser_message_delivery_status_class_init (EMailParserMessageDeliveryStatusClass *class)
+e_mail_parser_message_delivery_status_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_msg_deliverystatus_parse;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_message_delivery_status_init (EMailParserExtension *extension)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_msg_deliverystatus_parse;
-}
-
-static void
-e_mail_parser_message_delivery_status_init (EMailParserMessageDeliveryStatus *parser)
-{
-
}
diff --git a/em-format/e-mail-parser-message-external.c b/em-format/e-mail-parser-message-external.c
index c05ad0e6e4..8c355fbd15 100644
--- a/em-format/e-mail-parser-message-external.c
+++ b/em-format/e-mail-parser-message-external.c
@@ -32,24 +32,13 @@
#include <string.h>
#include <ctype.h>
-typedef struct _EMailParserMessageExternal {
- GObject parent;
-} EMailParserMessageExternal;
+typedef EMailParserExtension EMailParserMessageExternal;
+typedef EMailParserExtensionClass EMailParserMessageExternalClass;
-typedef struct _EMailParserMessageExternalClass {
- GObjectClass parent_class;
-} EMailParserMessageExternalClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserMessageExternal,
e_mail_parser_message_external,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"message/external-body",
@@ -179,19 +168,13 @@ addPart:
}
static void
-e_mail_parser_message_external_class_init (EMailParserMessageExternalClass *class)
+e_mail_parser_message_external_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_msg_external_parse;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_message_external_init (EMailParserExtension *extension)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_msg_external_parse;
-}
-
-static void
-e_mail_parser_message_external_init (EMailParserMessageExternal *parser)
-{
-
}
diff --git a/em-format/e-mail-parser-message-rfc822.c b/em-format/e-mail-parser-message-rfc822.c
index ad50f59b49..d2cd7ee7fe 100644
--- a/em-format/e-mail-parser-message-rfc822.c
+++ b/em-format/e-mail-parser-message-rfc822.c
@@ -35,24 +35,13 @@
#include <string.h>
-typedef struct _EMailParserMessageRFC822 {
- GObject parent;
-} EMailParserMessageRFC822;
+typedef EMailParserExtension EMailParserMessageRFC822;
+typedef EMailParserExtensionClass EMailParserMessageRFC822Class;
-typedef struct _EMailParserMessageRFC822Class {
- GObjectClass parent_class;
-} EMailParserMessageRFC822Class;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserMessageRFC822,
e_mail_parser_message_rfc822,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"message/rfc822",
@@ -142,20 +131,14 @@ empe_msg_rfc822_get_flags (EMailParserExtension *extension)
}
static void
-e_mail_parser_message_rfc822_class_init (EMailParserMessageRFC822Class *class)
+e_mail_parser_message_rfc822_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_msg_rfc822_parse;
+ class->get_flags = empe_msg_rfc822_get_flags;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_message_rfc822_init (EMailParserExtension *extension)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_msg_rfc822_parse;
- iface->get_flags = empe_msg_rfc822_get_flags;
-}
-
-static void
-e_mail_parser_message_rfc822_init (EMailParserMessageRFC822 *parser)
-{
-
}
diff --git a/em-format/e-mail-parser-message.c b/em-format/e-mail-parser-message.c
index a4818392b5..1039d9a8bd 100644
--- a/em-format/e-mail-parser-message.c
+++ b/em-format/e-mail-parser-message.c
@@ -34,24 +34,13 @@
#include <string.h>
-typedef struct _EMailParserMessage {
- GObject parent;
-} EMailParserMessage;
+typedef EMailParserExtension EMailParserMessage;
+typedef EMailParserExtensionClass EMailParserMessageClass;
-typedef struct _EMailParserMessageClass {
- GObjectClass parent_class;
-} EMailParserMessageClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserMessage,
e_mail_parser_message,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"application/vnd.evolution.message",
@@ -109,19 +98,13 @@ empe_message_parse (EMailParserExtension *extension,
}
static void
-e_mail_parser_message_class_init (EMailParserMessageClass *class)
+e_mail_parser_message_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_message_parse;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_message_init (EMailParserExtension *extension)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_message_parse;
-}
-
-static void
-e_mail_parser_message_init (EMailParserMessage *parser)
-{
-
}
diff --git a/em-format/e-mail-parser-multipart-alternative.c b/em-format/e-mail-parser-multipart-alternative.c
index cc06f41db4..d19137bd75 100644
--- a/em-format/e-mail-parser-multipart-alternative.c
+++ b/em-format/e-mail-parser-multipart-alternative.c
@@ -31,24 +31,13 @@
#include <string.h>
-typedef struct _EMailParserMultipartAlternative {
- GObject parent;
-} EMailParserMultipartAlternative;
+typedef EMailParserExtension EMailParserMultipartAlternative;
+typedef EMailParserExtensionClass EMailParserMultipartAlternativeClass;
-typedef struct _EMailParserMultipartAlternativeClass {
- GObjectClass parent_class;
-} EMailParserMultipartAlternativeClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserMultipartAlternative,
e_mail_parser_multipart_alternative,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"multipart/alternative",
@@ -158,19 +147,13 @@ empe_mp_alternative_parse (EMailParserExtension *extension,
}
static void
-e_mail_parser_multipart_alternative_class_init (EMailParserMultipartAlternativeClass *class)
+e_mail_parser_multipart_alternative_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_mp_alternative_parse;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_multipart_alternative_init (EMailParserExtension *extension)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_mp_alternative_parse;
-}
-
-static void
-e_mail_parser_multipart_alternative_init (EMailParserMultipartAlternative *parser)
-{
-
}
diff --git a/em-format/e-mail-parser-multipart-appledouble.c b/em-format/e-mail-parser-multipart-appledouble.c
index 3f47280051..3fe0181ef5 100644
--- a/em-format/e-mail-parser-multipart-appledouble.c
+++ b/em-format/e-mail-parser-multipart-appledouble.c
@@ -27,24 +27,13 @@
#include <camel/camel.h>
-typedef struct _EMailParserMultipartAppleDouble {
- GObject parent;
-} EMailParserMultipartAppleDouble;
+typedef EMailParserExtension EMailParserMultipartAppleDouble;
+typedef EMailParserExtensionClass EMailParserMultipartAppleDoubleClass;
-typedef struct _EMailParserMultipartAppleDoubleClass {
- GObjectClass parent_class;
-} EMailParserMultipartAppleDoubleClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserMultipartAppleDouble,
e_mail_parser_multipart_apple_double,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"multipart/appledouble",
@@ -96,19 +85,13 @@ empe_mp_appledouble_parse (EMailParserExtension *extension,
}
static void
-e_mail_parser_multipart_apple_double_class_init (EMailParserMultipartAppleDoubleClass *class)
+e_mail_parser_multipart_apple_double_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_mp_appledouble_parse;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_multipart_apple_double_init (EMailParserExtension *extension)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_mp_appledouble_parse;
-}
-
-static void
-e_mail_parser_multipart_apple_double_init (EMailParserMultipartAppleDouble *parser)
-{
-
}
diff --git a/em-format/e-mail-parser-multipart-digest.c b/em-format/e-mail-parser-multipart-digest.c
index 7ca643d48a..2097b0cab8 100644
--- a/em-format/e-mail-parser-multipart-digest.c
+++ b/em-format/e-mail-parser-multipart-digest.c
@@ -30,24 +30,13 @@
#include <string.h>
-typedef struct _EMailParserMultipartDigest {
- GObject parent;
-} EMailParserMultipartDigest;
+typedef EMailParserExtension EMailParserMultipartDigest;
+typedef EMailParserExtensionClass EMailParserMultipartDigestClass;
-typedef struct _EMailParserMultipartDigestClass {
- GObjectClass parent_class;
-} EMailParserMultipartDigestClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserMultipartDigest,
e_mail_parser_multipart_digest,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"multipart/digest",
@@ -135,20 +124,14 @@ empe_mp_digest_get_flags (EMailParserExtension *extension)
}
static void
-e_mail_parser_multipart_digest_class_init (EMailParserMultipartDigestClass *class)
+e_mail_parser_multipart_digest_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_mp_digest_parse;
+ class->get_flags = empe_mp_digest_get_flags;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_multipart_digest_init (EMailParserExtension *extension)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_mp_digest_parse;
- iface->get_flags = empe_mp_digest_get_flags;
-}
-
-static void
-e_mail_parser_multipart_digest_init (EMailParserMultipartDigest *parser)
-{
-
}
diff --git a/em-format/e-mail-parser-multipart-encrypted.c b/em-format/e-mail-parser-multipart-encrypted.c
index 05b192bcf4..6a08adc5ef 100644
--- a/em-format/e-mail-parser-multipart-encrypted.c
+++ b/em-format/e-mail-parser-multipart-encrypted.c
@@ -30,24 +30,13 @@
#include <camel/camel.h>
#include <libedataserver/libedataserver.h>
-typedef struct _EMailParserMultipartEncrypted {
- GObject parent;
-} EMailParserMultipartEncrypted;
+typedef EMailParserExtension EMailParserMultipartEncrypted;
+typedef EMailParserExtensionClass EMailParserMultipartEncryptedClass;
-typedef struct _EMailParserMultipartEncryptedClass {
- GObjectClass parent_class;
-} EMailParserMultipartEncryptedClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserMultipartEncrypted,
e_mail_parser_multipart_encrypted,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init))
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"multipart/encrypted",
@@ -182,19 +171,13 @@ empe_mp_encrypted_parse (EMailParserExtension *extension,
}
static void
-e_mail_parser_multipart_encrypted_class_init (EMailParserMultipartEncryptedClass *class)
+e_mail_parser_multipart_encrypted_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_mp_encrypted_parse;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_multipart_encrypted_init (EMailParserExtension *extension)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_mp_encrypted_parse;
-}
-
-static void
-e_mail_parser_multipart_encrypted_init (EMailParserMultipartEncrypted *parser)
-{
-
}
diff --git a/em-format/e-mail-parser-multipart-mixed.c b/em-format/e-mail-parser-multipart-mixed.c
index 9127a51640..67671afc1d 100644
--- a/em-format/e-mail-parser-multipart-mixed.c
+++ b/em-format/e-mail-parser-multipart-mixed.c
@@ -31,24 +31,13 @@
#include <string.h>
-typedef struct _EMailParserMultipartMixed {
- GObject parent;
-} EMailParserMultipartMixed;
+typedef EMailParserExtension EMailParserMultipartMixed;
+typedef EMailParserExtensionClass EMailParserMultipartMixedClass;
-typedef struct _EMailParserMultipartMixedClass {
- GObjectClass parent_class;
-} EMailParserMultipartMixedClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserMultipartMixed,
e_mail_parser_multipart_mixed,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"multipart/mixed",
@@ -133,19 +122,14 @@ empe_mp_mixed_get_flags (EMailParserExtension *extension)
}
static void
-e_mail_parser_multipart_mixed_class_init (EMailParserMultipartMixedClass *class)
-{
-}
-
-static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_multipart_mixed_class_init (EMailParserExtensionClass *class)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_mp_mixed_parse;
- iface->get_flags = empe_mp_mixed_get_flags;
+ class->mime_types = parser_mime_types;
+ class->parse = empe_mp_mixed_parse;
+ class->get_flags = empe_mp_mixed_get_flags;
}
static void
-e_mail_parser_multipart_mixed_init (EMailParserMultipartMixed *parser)
+e_mail_parser_multipart_mixed_init (EMailParserExtension *extension)
{
}
diff --git a/em-format/e-mail-parser-multipart-related.c b/em-format/e-mail-parser-multipart-related.c
index 1fca09636c..a9ae149241 100644
--- a/em-format/e-mail-parser-multipart-related.c
+++ b/em-format/e-mail-parser-multipart-related.c
@@ -31,24 +31,13 @@
#include <string.h>
-typedef struct _EMailParserMultipartRelated {
- GObject parent;
-} EMailParserMultipartRelated;
+typedef EMailParserExtension EMailParserMultipartRelated;
+typedef EMailParserExtensionClass EMailParserMultipartRelatedClass;
-typedef struct _EMailParserMultipartRelatedClass {
- GObjectClass parent_class;
-} EMailParserMultipartRelatedClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserMultipartRelated,
e_mail_parser_multipart_related,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"multipart/related",
@@ -127,19 +116,13 @@ empe_mp_related_parse (EMailParserExtension *extension,
}
static void
-e_mail_parser_multipart_related_class_init (EMailParserMultipartRelatedClass *class)
+e_mail_parser_multipart_related_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_mp_related_parse;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_multipart_related_init (EMailParserExtension *extension)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_mp_related_parse;
-}
-
-static void
-e_mail_parser_multipart_related_init (EMailParserMultipartRelated *parser)
-{
-
}
diff --git a/em-format/e-mail-parser-multipart-signed.c b/em-format/e-mail-parser-multipart-signed.c
index a57053f49e..20a257758f 100644
--- a/em-format/e-mail-parser-multipart-signed.c
+++ b/em-format/e-mail-parser-multipart-signed.c
@@ -30,24 +30,13 @@
#include <camel/camel.h>
#include <libedataserver/libedataserver.h>
-typedef struct _EMailParserMultipartSigned {
- GObject parent;
-} EMailParserMultipartSigned;
+typedef EMailParserExtension EMailParserMultipartSigned;
+typedef EMailParserExtensionClass EMailParserMultipartSignedClass;
-typedef struct _EMailParserMultipartSignedClass {
- GObjectClass parent_class;
-} EMailParserMultipartSignedClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserMultipartSigned,
e_mail_parser_multipart_signed,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"multipart/signed",
@@ -216,18 +205,13 @@ empe_mp_signed_parse (EMailParserExtension *extension,
}
static void
-e_mail_parser_multipart_signed_class_init (EMailParserMultipartSignedClass *class)
-{
-}
-
-static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_multipart_signed_class_init (EMailParserExtensionClass *class)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_mp_signed_parse;
+ class->mime_types = parser_mime_types;
+ class->parse = empe_mp_signed_parse;
}
static void
-e_mail_parser_multipart_signed_init (EMailParserMultipartSigned *parser)
+e_mail_parser_multipart_signed_init (EMailParserExtension *extension)
{
}
diff --git a/em-format/e-mail-parser-secure-button.c b/em-format/e-mail-parser-secure-button.c
index ca38021388..c590fba426 100644
--- a/em-format/e-mail-parser-secure-button.c
+++ b/em-format/e-mail-parser-secure-button.c
@@ -29,24 +29,13 @@
#include <camel/camel.h>
-typedef struct _EMailParserSecureButton {
- GObject parent;
-} EMailParserSecureButton;
+typedef EMailParserExtension EMailParserSecureButton;
+typedef EMailParserExtensionClass EMailParserSecureButtonClass;
-typedef struct _EMailParserSecureButtonClass {
- GObjectClass parent_class;
-} EMailParserSecureButtonClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserSecureButton,
e_mail_parser_secure_button,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init))
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"application/vnd.evolution.widget.secure-button",
@@ -76,19 +65,13 @@ empe_secure_button_parse (EMailParserExtension *extension,
}
static void
-e_mail_parser_secure_button_class_init (EMailParserSecureButtonClass *class)
+e_mail_parser_secure_button_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_secure_button_parse;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_secure_button_init (EMailParserExtension *extension)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_secure_button_parse;
-}
-
-static void
-e_mail_parser_secure_button_init (EMailParserSecureButton *parser)
-{
-
}
diff --git a/em-format/e-mail-parser-source.c b/em-format/e-mail-parser-source.c
index 1aef5fc074..b41fdccdf6 100644
--- a/em-format/e-mail-parser-source.c
+++ b/em-format/e-mail-parser-source.c
@@ -29,24 +29,13 @@
#include <glib/gi18n-lib.h>
#include <camel/camel.h>
-typedef struct _EMailParserSource {
- GObject parent;
-} EMailParserSource;
+typedef EMailParserExtension EMailParserSource;
+typedef EMailParserExtensionClass EMailParserSourceClass;
-typedef struct _EMailParserSourceClass {
- GObjectClass parent_class;
-} EMailParserSourceClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserSource,
e_mail_parser_source,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"application/vnd.evolution.source",
@@ -77,19 +66,13 @@ empe_source_parse (EMailParserExtension *extension,
}
static void
-e_mail_parser_source_class_init (EMailParserSourceClass *class)
+e_mail_parser_source_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_source_parse;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_source_init (EMailParserExtension *extension)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_source_parse;
-}
-
-static void
-e_mail_parser_source_init (EMailParserSource *parser)
-{
-
}
diff --git a/em-format/e-mail-parser-text-enriched.c b/em-format/e-mail-parser-text-enriched.c
index b666704625..bc5ab75efa 100644
--- a/em-format/e-mail-parser-text-enriched.c
+++ b/em-format/e-mail-parser-text-enriched.c
@@ -30,24 +30,13 @@
#include <glib/gi18n-lib.h>
#include <camel/camel.h>
-typedef struct _EMailParserTextEnriched {
- GObject parent;
-} EMailParserTextEnriched;
+typedef EMailParserExtension EMailParserTextEnriched;
+typedef EMailParserExtensionClass EMailParserTextEnrichedClass;
-typedef struct _EMailParserTextEnrichedClass {
- GObjectClass parent_class;
-} EMailParserTextEnrichedClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserTextEnriched,
e_mail_parser_text_enriched,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"text/richtext",
@@ -97,19 +86,13 @@ empe_text_enriched_parse (EMailParserExtension *extension,
}
static void
-e_mail_parser_text_enriched_class_init (EMailParserTextEnrichedClass *class)
+e_mail_parser_text_enriched_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_text_enriched_parse;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_text_enriched_init (EMailParserExtension *extension)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_text_enriched_parse;
-}
-
-static void
-e_mail_parser_text_enriched_init (EMailParserTextEnriched *parser)
-{
-
}
diff --git a/em-format/e-mail-parser-text-html.c b/em-format/e-mail-parser-text-html.c
index 5edce60f8a..0b2841683a 100644
--- a/em-format/e-mail-parser-text-html.c
+++ b/em-format/e-mail-parser-text-html.c
@@ -32,24 +32,13 @@
#include <string.h>
-typedef struct _EMailParserTextHTML {
- GObject parent;
-} EMailParserTextHTML;
+typedef EMailParserExtension EMailParserTextHTML;
+typedef EMailParserExtensionClass EMailParserTextHTMLClass;
-typedef struct _EMailParserTextHTMLClass {
- GObjectClass parent_class;
-} EMailParserTextHTMLClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserTextHTML,
e_mail_parser_text_html,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"text/html",
@@ -108,19 +97,13 @@ empe_text_html_parse (EMailParserExtension *extension,
}
static void
-e_mail_parser_text_html_class_init (EMailParserTextHTMLClass *class)
+e_mail_parser_text_html_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_text_html_parse;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_text_html_init (EMailParserExtension *extension)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_text_html_parse;
-}
-
-static void
-e_mail_parser_text_html_init (EMailParserTextHTML *parser)
-{
-
}
diff --git a/em-format/e-mail-parser-text-plain.c b/em-format/e-mail-parser-text-plain.c
index 3d79901f5a..354937aff2 100644
--- a/em-format/e-mail-parser-text-plain.c
+++ b/em-format/e-mail-parser-text-plain.c
@@ -32,24 +32,13 @@
#include <camel/camel.h>
#include <ctype.h>
-typedef struct _EMailParserTextPlain {
- GObject parent;
-} EMailParserTextPlain;
+typedef EMailParserExtension EMailParserTextPlain;
+typedef EMailParserExtensionClass EMailParserTextPlainClass;
-typedef struct _EMailParserTextPlainClass {
- GObjectClass parent_class;
-} EMailParserTextPlainClass;
-
-static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
-
-G_DEFINE_TYPE_EXTENDED (
+G_DEFINE_TYPE (
EMailParserTextPlain,
e_mail_parser_text_plain,
- G_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (
- E_TYPE_MAIL_PARSER_EXTENSION,
- e_mail_parser_parser_extension_interface_init));
+ E_TYPE_MAIL_PARSER_EXTENSION)
static const gchar *parser_mime_types[] = {
"text/plain",
@@ -235,19 +224,13 @@ empe_text_plain_parse (EMailParserExtension *extension,
}
static void
-e_mail_parser_text_plain_class_init (EMailParserTextPlainClass *class)
+e_mail_parser_text_plain_class_init (EMailParserExtensionClass *class)
{
+ class->mime_types = parser_mime_types;
+ class->parse = empe_text_plain_parse;
}
static void
-e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
+e_mail_parser_text_plain_init (EMailParserExtension *extension)
{
- iface->mime_types = parser_mime_types;
- iface->parse = empe_text_plain_parse;
-}
-
-static void
-e_mail_parser_text_plain_init (EMailParserTextPlain *parser)
-{
-
}