diff options
61 files changed, 556 insertions, 963 deletions
diff --git a/em-format/Makefile.am b/em-format/Makefile.am index cafe098dc0..6e45b0f6f1 100644 --- a/em-format/Makefile.am +++ b/em-format/Makefile.am @@ -4,7 +4,6 @@ privsolib_LTLIBRARIES = libemformat.la emformatinclude_HEADERS = \ e-mail-extension-registry.h \ - e-mail-extension.h \ e-mail-formatter-extension.h \ e-mail-formatter.h \ e-mail-formatter-print.h \ @@ -40,7 +39,6 @@ endif libemformat_la_SOURCES = \ $(emformatinclude_HEADERS) \ e-mail-extension-registry.c \ - e-mail-extension.c \ e-mail-inline-filter.c \ e-mail-format-extensions.c \ e-mail-format-extensions.h \ diff --git a/em-format/e-mail-extension-registry.c b/em-format/e-mail-extension-registry.c index 41a3d6f664..cc6da4b9a8 100644 --- a/em-format/e-mail-extension-registry.c +++ b/em-format/e-mail-extension-registry.c @@ -19,7 +19,6 @@ #include <glib-object.h> #include "e-mail-extension-registry.h" -#include "e-mail-extension.h" #include "e-mail-format-extensions.h" #include <libebackend/libebackend.h> #include <camel/camel.h> @@ -96,95 +95,47 @@ e_mail_extension_registry_init (EMailExtensionRegistry *reg) /** * e_mail_extension_registry_add_extension: - * @reg: An #EMailExtensionRegistry - * @extension: An #EMailExtension + * @reg: an #EMailExtensionRegistry + * @mime_types: a %NULL-terminated array of MIME types + * @extension_type: the #GType of the extension being added * - * Registrys the @extension as a handler for all mime-types that it is able - * to handle. + * Creates an instance of @extension_type and registers the instance for + * all provided MIME types. */ void e_mail_extension_registry_add_extension (EMailExtensionRegistry *reg, - EMailExtension *extension) + const gchar **mime_types, + GType extension_type) { - EMailExtensionInterface *interface; + GObject *extension; gint ii; g_return_if_fail (E_IS_MAIL_EXTENSION_REGISTRY (reg)); - g_return_if_fail (E_IS_MAIL_EXTENSION (extension)); - - /* One reference per extension is enough */ - g_object_ref (extension); + g_return_if_fail (mime_types != NULL); + g_return_if_fail (extension_type != G_TYPE_INVALID); - interface = E_MAIL_EXTENSION_GET_INTERFACE (extension); - if (interface->mime_types == NULL) { - g_critical ( - "%s does not define any MIME types", - G_OBJECT_TYPE_NAME (extension)); - return; - } + extension = g_object_new (extension_type, NULL); - for (ii = 0; interface->mime_types[ii] != NULL; ii++) { + for (ii = 0; mime_types[ii] != NULL; ii++) { GQueue *queue; queue = g_hash_table_lookup ( - reg->priv->table, interface->mime_types[ii]); + reg->priv->table, mime_types[ii]); if (queue == NULL) { queue = g_queue_new (); - g_queue_push_head (queue, extension); g_hash_table_insert ( reg->priv->table, - (gpointer) interface->mime_types[ii], + (gpointer) mime_types[ii], queue); - } else { - g_queue_push_head (queue, extension); } - if (camel_debug ("emformat:registry")) { - printf ( - "Added extension '%s' for type '%s'\n", - G_OBJECT_TYPE_NAME (extension), - interface->mime_types[ii]); - } - } -} - -/** - * e_mail_extension_registry_remove_extension: - * @reg: An #EMailExtensionRegistry - * @extension: An #EMailExtension - * - * Removes @extension from the registry. - */ -void -e_mail_extension_registry_remove_extension (EMailExtensionRegistry *reg, - EMailExtension *extension) -{ - EMailExtensionInterface *interface; - gint ii; - - g_return_if_fail (E_IS_MAIL_EXTENSION_REGISTRY (reg)); - g_return_if_fail (E_IS_MAIL_EXTENSION (extension)); - - interface = E_MAIL_EXTENSION_GET_INTERFACE (extension); - if (interface->mime_types == NULL) - return; - - for (ii = 0; interface->mime_types[ii] != NULL; ii++) { - GQueue *queue; - - queue = g_hash_table_lookup ( - reg->priv->table, - interface->mime_types[ii]); - if (queue == NULL) - continue; - - g_queue_remove (queue, extension); + g_queue_push_head (queue, g_object_ref (extension)); if (camel_debug ("emformat:registry")) { printf ( - "Removed extension '%s' from type '%s'\n", - G_OBJECT_TYPE_NAME (extension), - interface->mime_types[ii]); + "Added extension '%s' for type '%s'\n", + g_type_name (extension_type), + mime_types[ii]); } } diff --git a/em-format/e-mail-extension-registry.h b/em-format/e-mail-extension-registry.h index a6ddb441e0..4d17b759d7 100644 --- a/em-format/e-mail-extension-registry.h +++ b/em-format/e-mail-extension-registry.h @@ -19,7 +19,7 @@ #ifndef E_MAIL_EXTENSION_REGISTRY_H_ #define E_MAIL_EXTENSION_REGISTRY_H_ -#include <em-format/e-mail-extension.h> +#include <glib-object.h> /* Standard GObject macros */ #define E_TYPE_MAIL_EXTENSION_REGISTRY \ @@ -55,21 +55,18 @@ struct _EMailExtensionRegistry { EMailExtensionRegistryPrivate *priv; }; -GType e_mail_extension_registry_get_type (void); - -void e_mail_extension_registry_add_extension (EMailExtensionRegistry *reg, - EMailExtension *extension); - -void e_mail_extension_registry_remove_extension - (EMailExtensionRegistry *reg, - EMailExtension *extension); - +GType e_mail_extension_registry_get_type + (void) G_GNUC_CONST; +void e_mail_extension_registry_add_extension + (EMailExtensionRegistry *reg, + const gchar **mime_types, + GType extension_type); GQueue * e_mail_extension_registry_get_for_mime_type - (EMailExtensionRegistry *reg, - const gchar *mime_type); - -GQueue * e_mail_extension_registry_get_fallback (EMailExtensionRegistry *reg, - const gchar *mime_type); + (EMailExtensionRegistry *reg, + const gchar *mime_type); +GQueue * e_mail_extension_registry_get_fallback + (EMailExtensionRegistry *reg, + const gchar *mime_type); G_END_DECLS @@ -109,7 +106,8 @@ struct _EMailParserExtensionRegistry { EMailParserExtensionRegistryPrivate *priv; }; -GType e_mail_parser_extension_registry_get_type (void); +GType e_mail_parser_extension_registry_get_type + (void) G_GNUC_CONST; G_END_DECLS @@ -149,7 +147,8 @@ struct _EMailFormatterExtensionRegistry { EMailFormatterExtensionRegistryPrivate *priv; }; -GType e_mail_formatter_extension_registry_get_type (void); +GType e_mail_formatter_extension_registry_get_type + (void) G_GNUC_CONST; G_END_DECLS diff --git a/em-format/e-mail-extension.c b/em-format/e-mail-extension.c deleted file mode 100644 index ee319773c1..0000000000 --- a/em-format/e-mail-extension.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * e-mail-extension.c - * - * 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/> - * - */ - -#include "e-mail-extension.h" - -#include <glib-object.h> - -G_DEFINE_INTERFACE (EMailExtension, e_mail_extension, G_TYPE_OBJECT) - -static void -e_mail_extension_default_init (EMailExtensionInterface *iface) -{ - -} - -/** - * EMailExtension: - * - * The #EMailExtension is an abstract interface for all extensions for - * #EMailParser and #EmailFormatter. - * - * The interface is further extended by #EMailParserExtension and - * #EMailFormatterExtension interfaces which define final API for both types - * of extensions. - */ - diff --git a/em-format/e-mail-extension.h b/em-format/e-mail-extension.h deleted file mode 100644 index 4050cce169..0000000000 --- a/em-format/e-mail-extension.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * e-mail-extension.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_EXTENSION_H -#define E_MAIL_EXTENSION_H - -#include <glib-object.h> - -/* Standard GObject macros */ -#define E_TYPE_MAIL_EXTENSION \ - (e_mail_extension_get_type ()) -#define E_MAIL_EXTENSION(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST \ - ((obj), E_TYPE_MAIL_EXTENSION, EMailExtension)) -#define E_MAIL_EXTENSION_INTERFACE(cls) \ - (G_TYPE_CHECK_CLASS_CAST \ - ((cls), E_TYPE_MAIL_EXTENSION, EMailExtensionInterface)) -#define E_IS_MAIL_EXTENSION(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE \ - ((obj), E_TYPE_MAIL_EXTENSION)) -#define E_IS_MAIL_EXTENSION_INTERFACE(cls) \ - (G_TYPE_CHECK_CLASS_TYPE \ - ((cls), E_TYPE_MAIL_EXTENSION)) -#define E_MAIL_EXTENSION_GET_INTERFACE(obj) \ - (G_TYPE_INSTANCE_GET_INTERFACE \ - ((obj), E_TYPE_MAIL_EXTENSION, EMailExtensionInterface)) - -G_BEGIN_DECLS - -typedef struct _EMailExtension EMailExtension; -typedef struct _EMailExtensionInterface EMailExtensionInterface; - -struct _EMailExtensionInterface { - GTypeInterface parent_interface; - - /* 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; -}; - -GType e_mail_extension_get_type (void) G_GNUC_CONST; - -G_END_DECLS - -#endif /* E_MAIL_EXTENSION_H */ diff --git a/em-format/e-mail-format-extensions.c b/em-format/e-mail-format-extensions.c index fa7d5d8683..01162bc9ea 100644 --- a/em-format/e-mail-format-extensions.c +++ b/em-format/e-mail-format-extensions.c @@ -86,16 +86,44 @@ static void load (EMailExtensionRegistry *ereg, TypeFunc *func_array) { - gint i = 0; + gint ii; - for (i = 0; func_array[i] != NULL; i++) { - GType type; - EMailExtension *extension; + for (ii = 0; func_array[ii] != NULL; ii++) { + GType extension_type; + GType interface_type; + gpointer extension_class; + const gchar **mime_types = NULL; - type = func_array[i](); - extension = g_object_new (type, NULL); + extension_type = func_array[ii](); + extension_class = g_type_class_ref (extension_type); - e_mail_extension_registry_add_extension (ereg, extension); + interface_type = E_TYPE_MAIL_FORMATTER_EXTENSION; + if (g_type_is_a (extension_type, interface_type)) { + EMailFormatterExtensionInterface *interface; + + interface = g_type_interface_peek ( + extension_class, interface_type); + mime_types = interface->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 (mime_types != NULL) + e_mail_extension_registry_add_extension ( + ereg, mime_types, extension_type); + else + g_critical ( + "%s does not define any MIME types", + g_type_name (extension_type)); + + g_type_class_unref (extension_class); } } diff --git a/em-format/e-mail-formatter-attachment-bar.c b/em-format/e-mail-formatter-attachment-bar.c index 33b13675a9..160c8af891 100644 --- a/em-format/e-mail-formatter-attachment-bar.c +++ b/em-format/e-mail-formatter-attachment-bar.c @@ -37,7 +37,6 @@ typedef struct _EMailFormatterAttachmentBarClass { } EMailFormatterAttachmentBarClass; static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailFormatterAttachmentBar, @@ -45,9 +44,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_formatter_extension_interface_init)); @@ -133,6 +129,7 @@ e_mail_formatter_attachment_bar_class_init (EMailFormatterAttachmentBarClass *cl static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emfe_attachment_bar_format; iface->get_widget = emfe_attachment_bar_get_widget; iface->get_display_name = emfe_attachment_bar_get_display_name; @@ -140,12 +137,6 @@ e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInte } static void -e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = formatter_mime_types; -} - -static void e_mail_formatter_attachment_bar_init (EMailFormatterAttachmentBar *extension) { diff --git a/em-format/e-mail-formatter-attachment.c b/em-format/e-mail-formatter-attachment.c index d583801a0a..f637766f1d 100644 --- a/em-format/e-mail-formatter-attachment.c +++ b/em-format/e-mail-formatter-attachment.c @@ -49,7 +49,6 @@ typedef struct _EMailFormatterAttachmentClass { } EMailFormatterAttachmentClass; static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailFormatterAttachment, @@ -57,9 +56,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_formatter_extension_interface_init) ) @@ -398,6 +394,7 @@ e_mail_formatter_attachment_class_init (EMailFormatterAttachmentClass *class) static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emfe_attachment_format; iface->get_widget = emfe_attachment_get_widget; iface->get_display_name = emfe_attachment_get_display_name; @@ -405,12 +402,6 @@ e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInte } static void -e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = formatter_mime_types; -} - -static void e_mail_formatter_attachment_init (EMailFormatterAttachment *formatter) { diff --git a/em-format/e-mail-formatter-error.c b/em-format/e-mail-formatter-error.c index 0c183a0aeb..8c8615662c 100644 --- a/em-format/e-mail-formatter-error.c +++ b/em-format/e-mail-formatter-error.c @@ -38,7 +38,6 @@ typedef struct _EMailFormatterErrorClass { } EMailFormatterErrorClass; static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailFormatterError, @@ -46,9 +45,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_formatter_extension_interface_init)); @@ -139,18 +135,13 @@ e_mail_formatter_error_class_init (EMailFormatterErrorClass *class) static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emfe_error_format; iface->get_display_name = emfe_error_get_display_name; iface->get_description = emfe_error_get_description; } static void -e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = formatter_mime_types; -} - -static void e_mail_formatter_error_init (EMailFormatterError *formatter) { diff --git a/em-format/e-mail-formatter-extension.c b/em-format/e-mail-formatter-extension.c index 381855bac5..3e10aa1488 100644 --- a/em-format/e-mail-formatter-extension.c +++ b/em-format/e-mail-formatter-extension.c @@ -21,7 +21,7 @@ G_DEFINE_INTERFACE ( EMailFormatterExtension, e_mail_formatter_extension, - E_TYPE_MAIL_EXTENSION) + G_TYPE_OBJECT) /** * EMailFormatterExtension: diff --git a/em-format/e-mail-formatter-extension.h b/em-format/e-mail-formatter-extension.h index e2c4ee6cf1..9a3f3925c4 100644 --- a/em-format/e-mail-formatter-extension.h +++ b/em-format/e-mail-formatter-extension.h @@ -19,7 +19,6 @@ #ifndef E_MAIL_FORMATTER_EXTENSION_H #define E_MAIL_FORMATTER_EXTENSION_H -#include <em-format/e-mail-extension.h> #include <em-format/e-mail-part.h> #include <em-format/e-mail-formatter.h> #include <camel/camel.h> @@ -53,7 +52,12 @@ typedef struct _EMailFormatterExtension EMailFormatterExtension; typedef struct _EMailFormatterExtensionInterface EMailFormatterExtensionInterface; struct _EMailFormatterExtensionInterface { - EMailExtensionInterface parent_interface; + GTypeInterface parent_interface; + + /* 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 (*format) (EMailFormatterExtension *extension, EMailFormatter *formatter, diff --git a/em-format/e-mail-formatter-headers.c b/em-format/e-mail-formatter-headers.c index 5b62d5659d..855f6a6320 100644 --- a/em-format/e-mail-formatter-headers.c +++ b/em-format/e-mail-formatter-headers.c @@ -51,7 +51,6 @@ static const gchar *formatter_mime_types[] = { }; static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailFormatterHeaders, @@ -59,9 +58,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_formatter_extension_interface_init)) @@ -594,18 +590,13 @@ e_mail_formatter_headers_class_init (EMailFormatterHeadersClass *class) static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emfe_headers_format; iface->get_display_name = emfe_headers_get_display_name; iface->get_description = emfe_headers_get_description; } static void -e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = formatter_mime_types; -} - -static void e_mail_formatter_headers_init (EMailFormatterHeaders *formatter) { diff --git a/em-format/e-mail-formatter-image.c b/em-format/e-mail-formatter-image.c index 24ee2ef217..cd4d2e1e93 100644 --- a/em-format/e-mail-formatter-image.c +++ b/em-format/e-mail-formatter-image.c @@ -63,7 +63,6 @@ typedef struct _EMailFormatterImageClass { } EMailFormatterImageClass; static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailFormatterImage, @@ -71,9 +70,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_formatter_extension_interface_init)); @@ -174,18 +170,13 @@ e_mail_formatter_image_class_init (EMailFormatterImageClass *class) static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emfe_image_format; iface->get_display_name = emfe_image_get_display_name; iface->get_description = emfe_image_get_description; } static void -e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = formatter_mime_types; -} - -static void e_mail_formatter_image_init (EMailFormatterImage *formatter) { diff --git a/em-format/e-mail-formatter-message-rfc822.c b/em-format/e-mail-formatter-message-rfc822.c index f2d7d1cc66..dea737deb9 100644 --- a/em-format/e-mail-formatter-message-rfc822.c +++ b/em-format/e-mail-formatter-message-rfc822.c @@ -50,7 +50,6 @@ typedef struct _EMailFormatterMessageRFC822Class { } EMailFormatterMessageRFC822Class; static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailFormatterMessageRFC822, @@ -58,9 +57,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_formatter_extension_interface_init)); @@ -265,18 +261,13 @@ e_mail_formatter_message_rfc822_class_init (EMailFormatterMessageRFC822Class *cl static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emfe_message_rfc822_format; iface->get_display_name = emfe_message_rfc822_get_display_name; iface->get_description = emfe_message_rfc822_get_description; } static void -e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = formatter_mime_types; -} - -static void e_mail_formatter_message_rfc822_init (EMailFormatterMessageRFC822 *formatter) { diff --git a/em-format/e-mail-formatter-print-headers.c b/em-format/e-mail-formatter-print-headers.c index 2397f92308..1821268424 100644 --- a/em-format/e-mail-formatter-print-headers.c +++ b/em-format/e-mail-formatter-print-headers.c @@ -50,8 +50,6 @@ static const gchar *formatter_mime_types[] = { static void e_mail_formatter_print_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_print_mail_extension_interface_init - (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailFormatterPrintHeaders, @@ -59,9 +57,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_print_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_print_formatter_extension_interface_init)) @@ -243,18 +238,13 @@ e_mail_formatter_print_headers_class_init (EMailFormatterPrintHeadersClass *clas static void e_mail_formatter_print_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emfpe_headers_format; iface->get_display_name = emfpe_headers_get_display_name; iface->get_description = emfpe_headers_get_description; } static void -e_mail_formatter_print_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = formatter_mime_types; -} - -static void e_mail_formatter_print_headers_init (EMailFormatterPrintHeaders *formatter) { diff --git a/em-format/e-mail-formatter-quote-attachment.c b/em-format/e-mail-formatter-quote-attachment.c index 8dff36af53..0dcf5f0206 100644 --- a/em-format/e-mail-formatter-quote-attachment.c +++ b/em-format/e-mail-formatter-quote-attachment.c @@ -42,7 +42,6 @@ typedef struct _EMailFormatterQuoteAttachmentClass { } EMailFormatterQuoteAttachmentClass; static void e_mail_formatter_quote_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_quote_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailFormatterQuoteAttachment, @@ -50,9 +49,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_quote_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_quote_formatter_extension_interface_init) ) @@ -143,18 +139,13 @@ e_mail_formatter_quote_attachment_class_init (EMailFormatterQuoteAttachmentClass static void e_mail_formatter_quote_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emfqe_attachment_format; iface->get_display_name = emfqe_attachment_get_display_name; iface->get_description = emfqe_attachment_get_description; } static void -e_mail_formatter_quote_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = formatter_mime_types; -} - -static void e_mail_formatter_quote_attachment_init (EMailFormatterQuoteAttachment *formatter) { diff --git a/em-format/e-mail-formatter-quote-headers.c b/em-format/e-mail-formatter-quote-headers.c index 368245c931..3f059dc1bb 100644 --- a/em-format/e-mail-formatter-quote-headers.c +++ b/em-format/e-mail-formatter-quote-headers.c @@ -45,8 +45,6 @@ typedef struct _EMailFormatterQuoteHeadersClass { static void e_mail_formatter_quote_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_quote_mail_extension_interface_init - (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailFormatterQuoteHeaders, @@ -54,9 +52,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_quote_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_quote_formatter_extension_interface_init)) @@ -269,18 +264,13 @@ e_mail_formatter_quote_headers_class_init (EMailFormatterQuoteHeadersClass *clas static void e_mail_formatter_quote_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emqfe_headers_format; iface->get_display_name = emqfe_headers_get_display_name; iface->get_description = emqfe_headers_get_description; } static void -e_mail_formatter_quote_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = formatter_mime_types; -} - -static void e_mail_formatter_quote_headers_init (EMailFormatterQuoteHeaders *formatter) { diff --git a/em-format/e-mail-formatter-quote-message-rfc822.c b/em-format/e-mail-formatter-quote-message-rfc822.c index d1b5ae5b68..19f77c0792 100644 --- a/em-format/e-mail-formatter-quote-message-rfc822.c +++ b/em-format/e-mail-formatter-quote-message-rfc822.c @@ -44,7 +44,6 @@ typedef struct _EMailFormatterQuoteMessageRFC822Class { } EMailFormatterQuoteMessageRFC822Class; static void e_mail_formatter_quote_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_quote_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailFormatterQuoteMessageRFC822, @@ -52,9 +51,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_quote_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_quote_formatter_extension_interface_init)); @@ -171,18 +167,13 @@ e_mail_formatter_quote_message_rfc822_class_init (EMailFormatterQuoteMessageRFC8 static void e_mail_formatter_quote_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emfqe_message_rfc822_format; iface->get_display_name = emfqe_message_rfc822_get_display_name; iface->get_description = emfqe_message_rfc822_get_description; } static void -e_mail_formatter_quote_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = formatter_mime_types; -} - -static void e_mail_formatter_quote_message_rfc822_init (EMailFormatterQuoteMessageRFC822 *formatter) { diff --git a/em-format/e-mail-formatter-quote-text-enriched.c b/em-format/e-mail-formatter-quote-text-enriched.c index 68d19ab633..ba991db2f4 100644 --- a/em-format/e-mail-formatter-quote-text-enriched.c +++ b/em-format/e-mail-formatter-quote-text-enriched.c @@ -40,8 +40,6 @@ typedef struct _EMailFormatterQuoteTextEnrichedClass { static void e_mail_formatter_quote_formatter_extension_interace_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_quote_mail_extension_interface_init - (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailFormatterQuoteTextEnriched, @@ -49,9 +47,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_quote_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_quote_formatter_extension_interace_init)); @@ -118,18 +113,13 @@ e_mail_formatter_quote_text_enriched_class_init (EMailFormatterQuoteTextEnriched static void e_mail_formatter_quote_formatter_extension_interace_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emqfe_text_enriched_format; iface->get_display_name = emqfe_text_enriched_get_display_name; iface->get_description = emqfe_text_enriched_get_description; } static void -e_mail_formatter_quote_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = formatter_mime_types; -} - -static void e_mail_formatter_quote_text_enriched_init (EMailFormatterQuoteTextEnriched *formatter) { diff --git a/em-format/e-mail-formatter-quote-text-html.c b/em-format/e-mail-formatter-quote-text-html.c index d592150c28..bbc81905a1 100644 --- a/em-format/e-mail-formatter-quote-text-html.c +++ b/em-format/e-mail-formatter-quote-text-html.c @@ -43,8 +43,6 @@ typedef struct _EMailFormatterQuoteTextHTMLClass { static void e_mail_formatter_quote_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_quote_mail_extension_interface_init - (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailFormatterQuoteTextHTML, @@ -52,9 +50,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_quote_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_quote_formatter_extension_interface_init)); @@ -121,18 +116,13 @@ e_mail_formatter_quote_text_html_class_init (EMailFormatterQuoteTextHTMLClass *c static void e_mail_formatter_quote_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emqfe_text_html_format; iface->get_display_name = emqfe_text_html_get_display_name; iface->get_description = emqfe_text_html_get_description; } static void -e_mail_formatter_quote_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = formatter_mime_types; -} - -static void e_mail_formatter_quote_text_html_init (EMailFormatterQuoteTextHTML *formatter) { diff --git a/em-format/e-mail-formatter-quote-text-plain.c b/em-format/e-mail-formatter-quote-text-plain.c index 584c6d1aeb..7deb9ebb75 100644 --- a/em-format/e-mail-formatter-quote-text-plain.c +++ b/em-format/e-mail-formatter-quote-text-plain.c @@ -41,8 +41,6 @@ typedef struct _EMailFormatterQuoteTextPlainClass { static void e_mail_formatter_quote_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_quote_mail_extension_interface_init - (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailFormatterQuoteTextPlain, @@ -50,9 +48,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_quote_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_quote_formatter_extension_interface_init)); @@ -140,18 +135,13 @@ e_mail_formatter_quote_text_plain_class_init (EMailFormatterQuoteTextPlainClass static void e_mail_formatter_quote_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emqfe_text_plain_format; iface->get_display_name = emqfe_text_plain_get_display_name; iface->get_description = emqfe_text_plain_get_description; } static void -e_mail_formatter_quote_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = formatter_mime_types; -} - -static void e_mail_formatter_quote_text_plain_init (EMailFormatterQuoteTextPlain *formatter) { diff --git a/em-format/e-mail-formatter-secure-button.c b/em-format/e-mail-formatter-secure-button.c index 6c41467c7c..b31c6fb819 100644 --- a/em-format/e-mail-formatter-secure-button.c +++ b/em-format/e-mail-formatter-secure-button.c @@ -43,7 +43,6 @@ typedef struct _EMailFormatterSecureButtonClass { } EMailFormatterSecureButtonClass; static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailFormatterSecureButton, @@ -51,9 +50,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_formatter_extension_interface_init)); @@ -494,6 +490,7 @@ e_mail_formatter_secure_button_class_init (EMailFormatterSecureButtonClass *clas static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emfe_secure_button_format; iface->get_widget = emfe_secure_button_get_widget; iface->get_display_name = emfe_secure_button_get_display_name; @@ -501,12 +498,6 @@ e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInte } static void -e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = formatter_mime_types; -} - -static void e_mail_formatter_secure_button_init (EMailFormatterSecureButton *extension) { diff --git a/em-format/e-mail-formatter-source.c b/em-format/e-mail-formatter-source.c index becf1a81b5..ce9fc36957 100644 --- a/em-format/e-mail-formatter-source.c +++ b/em-format/e-mail-formatter-source.c @@ -39,7 +39,6 @@ typedef struct _EMailFormatterSourceClass { } EMailFormatterSourceClass; static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailFormatterSource, @@ -47,9 +46,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_formatter_extension_interface_init) ) @@ -157,18 +153,13 @@ e_mail_formatter_source_class_init (EMailFormatterSourceClass *class) static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emfe_source_format; iface->get_display_name = emfe_source_get_display_name; iface->get_description = emfe_source_get_description; } static void -e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = formatter_mime_types; -} - -static void e_mail_formatter_source_init (EMailFormatterSource *formatter) { diff --git a/em-format/e-mail-formatter-text-enriched.c b/em-format/e-mail-formatter-text-enriched.c index ca24c354dd..7a358bdfad 100644 --- a/em-format/e-mail-formatter-text-enriched.c +++ b/em-format/e-mail-formatter-text-enriched.c @@ -45,7 +45,6 @@ typedef struct _EMailFormatterTextEnrichedClass { } EMailFormatterTextEnrichedClass; static void e_mail_formatter_formatter_extension_interace_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailFormatterTextEnriched, @@ -53,9 +52,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_formatter_extension_interace_init)); @@ -132,19 +128,13 @@ e_mail_formatter_text_enriched_class_init (EMailFormatterTextEnrichedClass *clas static void e_mail_formatter_formatter_extension_interace_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emfe_text_enriched_format; iface->get_display_name = emfe_text_enriched_get_display_name; iface->get_description = emfe_text_enriched_get_description; } static void -e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = formatter_mime_types; -} - -static void e_mail_formatter_text_enriched_init (EMailFormatterTextEnriched *formatter) { - } diff --git a/em-format/e-mail-formatter-text-html.c b/em-format/e-mail-formatter-text-html.c index 838de92a92..08c40127d0 100644 --- a/em-format/e-mail-formatter-text-html.c +++ b/em-format/e-mail-formatter-text-html.c @@ -48,7 +48,6 @@ typedef struct _EMailFormatterTextHTMLClass { } EMailFormatterTextHTMLClass; static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailFormatterTextHTML, @@ -56,9 +55,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_formatter_extension_interface_init)); @@ -371,18 +367,13 @@ e_mail_formatter_text_html_class_init (EMailFormatterTextHTMLClass *class) static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emfe_text_html_format; iface->get_display_name = emfe_text_html_get_display_name; iface->get_description = emfe_text_html_get_description; } static void -e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = formatter_mime_types; -} - -static void e_mail_formatter_text_html_init (EMailFormatterTextHTML *formatter) { diff --git a/em-format/e-mail-formatter-text-plain.c b/em-format/e-mail-formatter-text-plain.c index 4fc01187ce..ce620016a7 100644 --- a/em-format/e-mail-formatter-text-plain.c +++ b/em-format/e-mail-formatter-text-plain.c @@ -48,7 +48,6 @@ typedef struct _EMailFormatterTextPlainClass { } EMailFormatterTextPlainClass; static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailFormatterTextPlain, @@ -56,9 +55,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_formatter_extension_interface_init)); @@ -206,18 +202,13 @@ e_mail_formatter_text_plain_class_init (EMailFormatterTextPlainClass *class) static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emfe_text_plain_format; iface->get_display_name = emfe_text_plain_get_display_name; iface->get_description = emfe_text_plain_get_description; } static void -e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = formatter_mime_types; -} - -static void e_mail_formatter_text_plain_init (EMailFormatterTextPlain *formatter) { diff --git a/em-format/e-mail-parser-application-mbox.c b/em-format/e-mail-parser-application-mbox.c index d7b41b0c86..2821e981de 100644 --- a/em-format/e-mail-parser-application-mbox.c +++ b/em-format/e-mail-parser-application-mbox.c @@ -43,7 +43,6 @@ typedef struct _EMailParserApplicationMBoxClass { } EMailParserApplicationMBoxClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserApplicationMBox, @@ -51,9 +50,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -190,17 +186,12 @@ e_mail_parser_application_mbox_class_init (EMailParserApplicationMBoxClass *clas static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *interface) { + interface->mime_types = parser_mime_types; interface->parse = empe_app_mbox_parse; interface->get_flags = empe_app_mbox_get_flags; } static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *interface) -{ - interface->mime_types = parser_mime_types; -} - -static void e_mail_parser_application_mbox_init (EMailParserApplicationMBox *self) { } diff --git a/em-format/e-mail-parser-application-smime.c b/em-format/e-mail-parser-application-smime.c index ba47fdf736..e5eab1bc4d 100644 --- a/em-format/e-mail-parser-application-smime.c +++ b/em-format/e-mail-parser-application-smime.c @@ -43,7 +43,6 @@ typedef struct _EMailParserAppplicationSMIMEClass { } EMailParserApplicationSMIMEClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserApplicationSMIME, @@ -51,9 +50,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -179,17 +175,12 @@ e_mail_parser_application_smime_class_init (EMailParserApplicationSMIMEClass *cl static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *interface) { + 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_mail_extension_interface_init (EMailExtensionInterface *interface) -{ - interface->mime_types = parser_mime_types; -} - -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 a2b8ddd0be..77a796cae0 100644 --- a/em-format/e-mail-parser-attachment-bar.c +++ b/em-format/e-mail-parser-attachment-bar.c @@ -51,7 +51,6 @@ typedef struct _EMailParserAttachmentBarClass { } EMailParserAttachmentBarClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserAttachmentBar, @@ -59,9 +58,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)) @@ -103,13 +99,8 @@ e_mail_parser_attachment_bar_class_init (EMailParserAttachmentBarClass *class) static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - iface->parse = empe_attachment_bar_parse; -} - -static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ iface->mime_types = parser_mime_types; + iface->parse = empe_attachment_bar_parse; } static void diff --git a/em-format/e-mail-parser-extension.c b/em-format/e-mail-parser-extension.c index df8fc54dcb..5497d3a1c6 100644 --- a/em-format/e-mail-parser-extension.c +++ b/em-format/e-mail-parser-extension.c @@ -23,7 +23,7 @@ G_DEFINE_INTERFACE ( EMailParserExtension, e_mail_parser_extension, - E_TYPE_MAIL_EXTENSION) + G_TYPE_OBJECT) static guint32 mail_parser_extension_get_flags (EMailParserExtension *extension) diff --git a/em-format/e-mail-parser-extension.h b/em-format/e-mail-parser-extension.h index e5acece68e..06128cf68c 100644 --- a/em-format/e-mail-parser-extension.h +++ b/em-format/e-mail-parser-extension.h @@ -19,7 +19,6 @@ #ifndef E_MAIL_PARSER_EXTENSION_H #define E_MAIL_PARSER_EXTENSION_H -#include <em-format/e-mail-extension.h> #include <em-format/e-mail-parser.h> #include <camel/camel.h> @@ -66,7 +65,12 @@ typedef enum { } EMailParserExtensionFlags; struct _EMailParserExtensionInterface { - EMailExtensionInterface parent_interface; + GTypeInterface parent_interface; + + /* 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, diff --git a/em-format/e-mail-parser-headers.c b/em-format/e-mail-parser-headers.c index 366cedd4d2..e31f2932be 100644 --- a/em-format/e-mail-parser-headers.c +++ b/em-format/e-mail-parser-headers.c @@ -42,7 +42,6 @@ typedef struct _EMailParserHeadersClass { } EMailParserHeadersClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserHeaders, @@ -50,9 +49,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -123,13 +119,8 @@ e_mail_parser_headers_class_init (EMailParserHeadersClass *class) static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - iface->parse = empe_headers_parse; -} - -static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ iface->mime_types = parser_mime_types; + iface->parse = empe_headers_parse; } static void diff --git a/em-format/e-mail-parser-image.c b/em-format/e-mail-parser-image.c index d2ca8d69d0..18bc8ff208 100644 --- a/em-format/e-mail-parser-image.c +++ b/em-format/e-mail-parser-image.c @@ -39,7 +39,6 @@ typedef struct _EMailParserImageClass { } EMailParserImageClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserImage, @@ -47,9 +46,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -127,13 +123,8 @@ e_mail_parser_image_class_init (EMailParserImageClass *class) static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - iface->parse = empe_image_parse; -} - -static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ iface->mime_types = parser_mime_types; + iface->parse = empe_image_parse; } static void diff --git a/em-format/e-mail-parser-inlinepgp-encrypted.c b/em-format/e-mail-parser-inlinepgp-encrypted.c index 6a8ff8e1e1..081ba15dd8 100644 --- a/em-format/e-mail-parser-inlinepgp-encrypted.c +++ b/em-format/e-mail-parser-inlinepgp-encrypted.c @@ -41,7 +41,6 @@ typedef struct _EMailParserInlinePGPEncryptedClass { } EMailParserInlinePGPEncryptedClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserInlinePGPEncrypted, @@ -49,9 +48,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -183,13 +179,8 @@ e_mail_parser_inline_pgp_encrypted_class_init (EMailParserInlinePGPEncryptedClas static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - iface->parse = empe_inlinepgp_encrypted_parse; -} - -static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ iface->mime_types = parser_mime_types; + iface->parse = empe_inlinepgp_encrypted_parse; } static void diff --git a/em-format/e-mail-parser-inlinepgp-signed.c b/em-format/e-mail-parser-inlinepgp-signed.c index dc8f4aa31f..c7a79b863f 100644 --- a/em-format/e-mail-parser-inlinepgp-signed.c +++ b/em-format/e-mail-parser-inlinepgp-signed.c @@ -41,7 +41,6 @@ typedef struct _EMailParserInlinePGPSignedClass { } EMailParserInlinePGPSignedClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserInlinePGPSigned, @@ -49,9 +48,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -207,13 +203,8 @@ e_mail_parser_inline_pgp_signed_class_init (EMailParserInlinePGPSignedClass *cla static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - iface->parse = empe_inlinepgp_signed_parse; -} - -static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ iface->mime_types = parser_mime_types; + iface->parse = empe_inlinepgp_signed_parse; } static void diff --git a/em-format/e-mail-parser-message-deliverystatus.c b/em-format/e-mail-parser-message-deliverystatus.c index 6bec6e64ef..b7df31ec31 100644 --- a/em-format/e-mail-parser-message-deliverystatus.c +++ b/em-format/e-mail-parser-message-deliverystatus.c @@ -41,7 +41,6 @@ typedef struct _EMailParserMessageDeliveryStatusClass { } EMailParserMessageDeliveryStatusClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserMessageDeliveryStatus, @@ -49,9 +48,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -100,13 +96,8 @@ e_mail_parser_message_delivery_status_class_init (EMailParserMessageDeliveryStat static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - iface->parse = empe_msg_deliverystatus_parse; -} - -static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ iface->mime_types = parser_mime_types; + iface->parse = empe_msg_deliverystatus_parse; } static void diff --git a/em-format/e-mail-parser-message-external.c b/em-format/e-mail-parser-message-external.c index 79bbfd7247..c05ad0e6e4 100644 --- a/em-format/e-mail-parser-message-external.c +++ b/em-format/e-mail-parser-message-external.c @@ -41,7 +41,6 @@ typedef struct _EMailParserMessageExternalClass { } EMailParserMessageExternalClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserMessageExternal, @@ -49,9 +48,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -190,13 +186,8 @@ e_mail_parser_message_external_class_init (EMailParserMessageExternalClass *clas static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - iface->parse = empe_msg_external_parse; -} - -static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ iface->mime_types = parser_mime_types; + iface->parse = empe_msg_external_parse; } static void diff --git a/em-format/e-mail-parser-message-rfc822.c b/em-format/e-mail-parser-message-rfc822.c index 8ddf4806b9..ad50f59b49 100644 --- a/em-format/e-mail-parser-message-rfc822.c +++ b/em-format/e-mail-parser-message-rfc822.c @@ -44,7 +44,6 @@ typedef struct _EMailParserMessageRFC822Class { } EMailParserMessageRFC822Class; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserMessageRFC822, @@ -52,9 +51,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -153,17 +149,12 @@ e_mail_parser_message_rfc822_class_init (EMailParserMessageRFC822Class *class) static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { + 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_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = parser_mime_types; -} - -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 dcb9d998af..a4818392b5 100644 --- a/em-format/e-mail-parser-message.c +++ b/em-format/e-mail-parser-message.c @@ -43,7 +43,6 @@ typedef struct _EMailParserMessageClass { } EMailParserMessageClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserMessage, @@ -51,9 +50,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -120,13 +116,8 @@ e_mail_parser_message_class_init (EMailParserMessageClass *class) static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - iface->parse = empe_message_parse; -} - -static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ iface->mime_types = parser_mime_types; + iface->parse = empe_message_parse; } static void diff --git a/em-format/e-mail-parser-multipart-alternative.c b/em-format/e-mail-parser-multipart-alternative.c index ca7fbddd57..cc06f41db4 100644 --- a/em-format/e-mail-parser-multipart-alternative.c +++ b/em-format/e-mail-parser-multipart-alternative.c @@ -40,7 +40,6 @@ typedef struct _EMailParserMultipartAlternativeClass { } EMailParserMultipartAlternativeClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserMultipartAlternative, @@ -48,9 +47,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -169,13 +165,8 @@ e_mail_parser_multipart_alternative_class_init (EMailParserMultipartAlternativeC static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - iface->parse = empe_mp_alternative_parse; -} - -static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ iface->mime_types = parser_mime_types; + iface->parse = empe_mp_alternative_parse; } static void diff --git a/em-format/e-mail-parser-multipart-appledouble.c b/em-format/e-mail-parser-multipart-appledouble.c index 08ea90faea..3f47280051 100644 --- a/em-format/e-mail-parser-multipart-appledouble.c +++ b/em-format/e-mail-parser-multipart-appledouble.c @@ -36,7 +36,6 @@ typedef struct _EMailParserMultipartAppleDoubleClass { } EMailParserMultipartAppleDoubleClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserMultipartAppleDouble, @@ -44,9 +43,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -107,13 +103,8 @@ e_mail_parser_multipart_apple_double_class_init (EMailParserMultipartAppleDouble static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - iface->parse = empe_mp_appledouble_parse; -} - -static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ iface->mime_types = parser_mime_types; + iface->parse = empe_mp_appledouble_parse; } static void diff --git a/em-format/e-mail-parser-multipart-digest.c b/em-format/e-mail-parser-multipart-digest.c index ed6a6daa63..7ca643d48a 100644 --- a/em-format/e-mail-parser-multipart-digest.c +++ b/em-format/e-mail-parser-multipart-digest.c @@ -39,7 +39,6 @@ typedef struct _EMailParserMultipartDigestClass { } EMailParserMultipartDigestClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserMultipartDigest, @@ -47,9 +46,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -146,17 +142,12 @@ e_mail_parser_multipart_digest_class_init (EMailParserMultipartDigestClass *clas static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { + 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_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = parser_mime_types; -} - -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 bae8de5166..05b192bcf4 100644 --- a/em-format/e-mail-parser-multipart-encrypted.c +++ b/em-format/e-mail-parser-multipart-encrypted.c @@ -39,7 +39,6 @@ typedef struct _EMailParserMultipartEncryptedClass { } EMailParserMultipartEncryptedClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserMultipartEncrypted, @@ -47,9 +46,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)) @@ -193,13 +189,8 @@ e_mail_parser_multipart_encrypted_class_init (EMailParserMultipartEncryptedClass static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - iface->parse = empe_mp_encrypted_parse; -} - -static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ iface->mime_types = parser_mime_types; + iface->parse = empe_mp_encrypted_parse; } static void diff --git a/em-format/e-mail-parser-multipart-mixed.c b/em-format/e-mail-parser-multipart-mixed.c index 77feb71bcb..9127a51640 100644 --- a/em-format/e-mail-parser-multipart-mixed.c +++ b/em-format/e-mail-parser-multipart-mixed.c @@ -40,7 +40,6 @@ typedef struct _EMailParserMultipartMixedClass { } EMailParserMultipartMixedClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserMultipartMixed, @@ -48,9 +47,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -144,17 +140,12 @@ e_mail_parser_multipart_mixed_class_init (EMailParserMultipartMixedClass *class) static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { + iface->mime_types = parser_mime_types; iface->parse = empe_mp_mixed_parse; iface->get_flags = empe_mp_mixed_get_flags; } static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = parser_mime_types; -} - -static void e_mail_parser_multipart_mixed_init (EMailParserMultipartMixed *parser) { } diff --git a/em-format/e-mail-parser-multipart-related.c b/em-format/e-mail-parser-multipart-related.c index f9e893f060..1fca09636c 100644 --- a/em-format/e-mail-parser-multipart-related.c +++ b/em-format/e-mail-parser-multipart-related.c @@ -40,7 +40,6 @@ typedef struct _EMailParserMultipartRelatedClass { } EMailParserMultipartRelatedClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserMultipartRelated, @@ -48,9 +47,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -138,13 +134,8 @@ e_mail_parser_multipart_related_class_init (EMailParserMultipartRelatedClass *cl static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - iface->parse = empe_mp_related_parse; -} - -static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ iface->mime_types = parser_mime_types; + iface->parse = empe_mp_related_parse; } static void diff --git a/em-format/e-mail-parser-multipart-signed.c b/em-format/e-mail-parser-multipart-signed.c index 45b29ff8aa..a57053f49e 100644 --- a/em-format/e-mail-parser-multipart-signed.c +++ b/em-format/e-mail-parser-multipart-signed.c @@ -39,7 +39,6 @@ typedef struct _EMailParserMultipartSignedClass { } EMailParserMultipartSignedClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserMultipartSigned, @@ -47,9 +46,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -227,13 +223,8 @@ e_mail_parser_multipart_signed_class_init (EMailParserMultipartSignedClass *clas static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - iface->parse = empe_mp_signed_parse; -} - -static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ iface->mime_types = parser_mime_types; + iface->parse = empe_mp_signed_parse; } static void diff --git a/em-format/e-mail-parser-secure-button.c b/em-format/e-mail-parser-secure-button.c index 4f49dd99a0..ca38021388 100644 --- a/em-format/e-mail-parser-secure-button.c +++ b/em-format/e-mail-parser-secure-button.c @@ -38,7 +38,6 @@ typedef struct _EMailParserSecureButtonClass { } EMailParserSecureButtonClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserSecureButton, @@ -46,9 +45,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)) @@ -87,13 +83,8 @@ e_mail_parser_secure_button_class_init (EMailParserSecureButtonClass *class) static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - iface->parse = empe_secure_button_parse; -} - -static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ iface->mime_types = parser_mime_types; + iface->parse = empe_secure_button_parse; } static void diff --git a/em-format/e-mail-parser-source.c b/em-format/e-mail-parser-source.c index ce22b0805b..1aef5fc074 100644 --- a/em-format/e-mail-parser-source.c +++ b/em-format/e-mail-parser-source.c @@ -38,7 +38,6 @@ typedef struct _EMailParserSourceClass { } EMailParserSourceClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserSource, @@ -46,9 +45,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -88,13 +84,8 @@ e_mail_parser_source_class_init (EMailParserSourceClass *class) static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - iface->parse = empe_source_parse; -} - -static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ iface->mime_types = parser_mime_types; + iface->parse = empe_source_parse; } static void diff --git a/em-format/e-mail-parser-text-enriched.c b/em-format/e-mail-parser-text-enriched.c index 503176ff6c..b666704625 100644 --- a/em-format/e-mail-parser-text-enriched.c +++ b/em-format/e-mail-parser-text-enriched.c @@ -39,7 +39,6 @@ typedef struct _EMailParserTextEnrichedClass { } EMailParserTextEnrichedClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserTextEnriched, @@ -47,9 +46,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -108,13 +104,8 @@ e_mail_parser_text_enriched_class_init (EMailParserTextEnrichedClass *class) static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - iface->parse = empe_text_enriched_parse; -} - -static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ iface->mime_types = parser_mime_types; + iface->parse = empe_text_enriched_parse; } static void diff --git a/em-format/e-mail-parser-text-html.c b/em-format/e-mail-parser-text-html.c index 98f359e573..5edce60f8a 100644 --- a/em-format/e-mail-parser-text-html.c +++ b/em-format/e-mail-parser-text-html.c @@ -41,7 +41,6 @@ typedef struct _EMailParserTextHTMLClass { } EMailParserTextHTMLClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserTextHTML, @@ -49,9 +48,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -119,13 +115,8 @@ e_mail_parser_text_html_class_init (EMailParserTextHTMLClass *class) static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - iface->parse = empe_text_html_parse; -} - -static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ iface->mime_types = parser_mime_types; + iface->parse = empe_text_html_parse; } static void diff --git a/em-format/e-mail-parser-text-plain.c b/em-format/e-mail-parser-text-plain.c index 0ed85c2806..3d79901f5a 100644 --- a/em-format/e-mail-parser-text-plain.c +++ b/em-format/e-mail-parser-text-plain.c @@ -41,7 +41,6 @@ typedef struct _EMailParserTextPlainClass { } EMailParserTextPlainClass; static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_TYPE_EXTENDED ( EMailParserTextPlain, @@ -49,9 +48,6 @@ G_DEFINE_TYPE_EXTENDED ( G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); @@ -246,13 +242,8 @@ e_mail_parser_text_plain_class_init (EMailParserTextPlainClass *class) static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - iface->parse = empe_text_plain_parse; -} - -static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ iface->mime_types = parser_mime_types; + iface->parse = empe_text_plain_parse; } static void diff --git a/modules/audio-inline/e-mail-formatter-audio-inline.c b/modules/audio-inline/e-mail-formatter-audio-inline.c index 51d250067f..461a3ab739 100644 --- a/modules/audio-inline/e-mail-formatter-audio-inline.c +++ b/modules/audio-inline/e-mail-formatter-audio-inline.c @@ -38,30 +38,30 @@ #define d(x) -typedef struct _EMailFormatterAudioInline { - EExtension parent; -} EMailFormatterAudioInline; +typedef GObject EMailFormatterAudioInline; +typedef GObjectClass EMailFormatterAudioInlineClass; -typedef struct _EMailFormatterAudioInlineClass { - EExtensionClass parent_class; -} EMailFormatterAudioInlineClass; +typedef EExtension EMailFormatterAudioInlineLoader; +typedef EExtensionClass EMailFormatterAudioInlineLoaderClass; GType e_mail_formatter_audio_inline_get_type (void); +GType e_mail_formatter_audio_inline_loader_get_type (void); static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_DYNAMIC_TYPE_EXTENDED ( EMailFormatterAudioInline, e_mail_formatter_audio_inline, - E_TYPE_EXTENSION, + G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE_DYNAMIC ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE_DYNAMIC ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_formatter_extension_interface_init)); +G_DEFINE_DYNAMIC_TYPE ( + EMailFormatterAudioInlineLoader, + e_mail_formatter_audio_inline_loader, + E_TYPE_EXTENSION) + static const gchar *formatter_mime_types[] = { "application/vnd.evolution.widget.audio-inline", "audio/ac3", @@ -329,33 +329,14 @@ emfe_audio_inline_get_description (EMailFormatterExtension *extension) } static void -e_mail_formatter_audio_inline_constructed (GObject *object) -{ - EExtensible *extensible; - EMailExtensionRegistry *reg; - - extensible = e_extension_get_extensible (E_EXTENSION (object)); - reg = E_MAIL_EXTENSION_REGISTRY (extensible); - - e_mail_extension_registry_add_extension (reg, E_MAIL_EXTENSION (object)); -} - -static void e_mail_formatter_audio_inline_class_init (EMailFormatterAudioInlineClass *class) { - GObjectClass *object_class; - EExtensionClass *extension_class; - - object_class = G_OBJECT_CLASS (class); - object_class->constructed = e_mail_formatter_audio_inline_constructed; - - extension_class = E_EXTENSION_CLASS (class); - extension_class->extensible_type = E_TYPE_MAIL_FORMATTER_EXTENSION_REGISTRY; } static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emfe_audio_inline_format; iface->get_widget = emfe_audio_inline_get_widget; iface->get_display_name = emfe_audio_inline_get_display_name; @@ -363,25 +344,53 @@ e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInte } static void -e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) +e_mail_formatter_audio_inline_init (EMailFormatterAudioInline *formatter) { - iface->mime_types = formatter_mime_types; } static void -e_mail_formatter_audio_inline_init (EMailFormatterAudioInline *formatter) +e_mail_formatter_audio_inline_class_finalize (EMailFormatterAudioInlineClass *class) { +} +static void +mail_formatter_audio_inline_loader_constructed (GObject *object) +{ + EExtensible *extensible; + + extensible = e_extension_get_extensible (E_EXTENSION (object)); + + e_mail_extension_registry_add_extension ( + E_MAIL_EXTENSION_REGISTRY (extensible), + formatter_mime_types, + e_mail_formatter_audio_inline_get_type ()); } -void -e_mail_formatter_audio_inline_type_register (GTypeModule *type_module) +static void +e_mail_formatter_audio_inline_loader_class_init (EExtensionClass *class) { - e_mail_formatter_audio_inline_register_type (type_module); + GObjectClass *object_class; + + object_class = G_OBJECT_CLASS (class); + object_class->constructed = mail_formatter_audio_inline_loader_constructed; + + class->extensible_type = E_TYPE_MAIL_FORMATTER_EXTENSION_REGISTRY; } static void -e_mail_formatter_audio_inline_class_finalize (EMailFormatterAudioInlineClass *class) +e_mail_formatter_audio_inline_loader_class_finalize (EExtensionClass *class) { +} +static void +e_mail_formatter_audio_inline_loader_init (EExtension *extension) +{ } + +void +e_mail_formatter_audio_inline_type_register (GTypeModule *type_module) +{ + e_mail_formatter_audio_inline_register_type (type_module); + e_mail_formatter_audio_inline_loader_register_type (type_module); +} + diff --git a/modules/audio-inline/e-mail-parser-audio-inline.c b/modules/audio-inline/e-mail-parser-audio-inline.c index 5fa4611a97..7fc025efec 100644 --- a/modules/audio-inline/e-mail-parser-audio-inline.c +++ b/modules/audio-inline/e-mail-parser-audio-inline.c @@ -38,30 +38,30 @@ #define d(x) -typedef struct _EMailParserInlineAudio { - EExtension parent; -} EMailParserAudioInline; +typedef GObject EMailParserAudioInline; +typedef GObjectClass EMailParserAudioInlineClass; -typedef struct _EMailParserAudioInlineClass { - EExtensionClass parent_class; -} EMailParserAudioInlineClass; +typedef EExtension EMailParserAudioInlineLoader; +typedef EExtensionClass EMailParserAudioInlineLoaderClass; GType e_mail_parser_audio_inline_get_type (void); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); +GType e_mail_parser_audio_inline_loader_get_type (void); static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); G_DEFINE_DYNAMIC_TYPE_EXTENDED ( EMailParserAudioInline, e_mail_parser_audio_inline, - E_TYPE_EXTENSION, + G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE_DYNAMIC ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE_DYNAMIC ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); +G_DEFINE_DYNAMIC_TYPE ( + EMailParserAudioInlineLoader, + e_mail_parser_audio_inline_loader, + E_TYPE_EXTENSION) + static const gchar *parser_mime_types[] = { "audio/ac3", "audio/x-ac3", @@ -156,57 +156,68 @@ empe_audio_inline_get_flags (EMailParserExtension *extension) return E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION; } -void -e_mail_parser_audio_inline_type_register (GTypeModule *type_module) +static void +e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - e_mail_parser_audio_inline_register_type (type_module); + iface->mime_types = parser_mime_types; + iface->parse = empe_audio_inline_parse; + iface->get_flags = empe_audio_inline_get_flags; } static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) +e_mail_parser_audio_inline_class_init (EMailParserAudioInlineClass *class) { - iface->mime_types = parser_mime_types; } static void -e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) +e_mail_parser_audio_inline_class_finalize (EMailParserAudioInlineClass *class) { - iface->parse = empe_audio_inline_parse; - iface->get_flags = empe_audio_inline_get_flags; + } static void -e_mail_parser_audio_inline_constructed (GObject *object) +e_mail_parser_audio_inline_init (EMailParserAudioInline *self) +{ +} + +static void +mail_parser_audio_inline_loader_constructed (GObject *object) { EExtensible *extensible; - EMailExtensionRegistry *reg; extensible = e_extension_get_extensible (E_EXTENSION (object)); - reg = E_MAIL_EXTENSION_REGISTRY (extensible); - e_mail_extension_registry_add_extension (reg, E_MAIL_EXTENSION (object)); + e_mail_extension_registry_add_extension ( + E_MAIL_EXTENSION_REGISTRY (extensible), + parser_mime_types, + e_mail_parser_audio_inline_get_type ()); } static void -e_mail_parser_audio_inline_class_init (EMailParserAudioInlineClass *class) +e_mail_parser_audio_inline_loader_class_init (EExtensionClass *class) { GObjectClass *object_class; - EExtensionClass *extension_class; object_class = G_OBJECT_CLASS (class); - object_class->constructed = e_mail_parser_audio_inline_constructed; + object_class->constructed = mail_parser_audio_inline_loader_constructed; - extension_class = E_EXTENSION_CLASS (class); - extension_class->extensible_type = E_TYPE_MAIL_PARSER_EXTENSION_REGISTRY; + class->extensible_type = E_TYPE_MAIL_PARSER_EXTENSION_REGISTRY; } static void -e_mail_parser_audio_inline_class_finalize (EMailParserAudioInlineClass *class) +e_mail_parser_audio_inline_loader_class_finalize (EExtensionClass *class) { - } static void -e_mail_parser_audio_inline_init (EMailParserAudioInline *self) +e_mail_parser_audio_inline_loader_init (EExtension *extension) +{ +} + +void +e_mail_parser_audio_inline_type_register (GTypeModule *type_module) { + e_mail_parser_audio_inline_register_type (type_module); + e_mail_parser_audio_inline_loader_register_type (type_module); } + diff --git a/modules/itip-formatter/e-mail-formatter-itip.c b/modules/itip-formatter/e-mail-formatter-itip.c index 9e2afc4459..2aab01288b 100644 --- a/modules/itip-formatter/e-mail-formatter-itip.c +++ b/modules/itip-formatter/e-mail-formatter-itip.c @@ -34,30 +34,30 @@ #define d(x) -typedef struct _EMailFormatterItip { - EExtension parent; -} EMailFormatterItip; +typedef GObject EMailFormatterItip; +typedef GObjectClass EMailFormatterItipClass; -typedef struct _EMailFormatterItipClass { - EExtensionClass parent_class; -} EMailFormatterItipClass; +typedef EExtension EMailFormatterItipLoader; +typedef EExtensionClass EMailFormatterItipLoaderClass; GType e_mail_formatter_itip_get_type (void); +GType e_mail_formatter_itip_loader_get_type (void); static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_DYNAMIC_TYPE_EXTENDED ( EMailFormatterItip, e_mail_formatter_itip, - E_TYPE_EXTENSION, + G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE_DYNAMIC ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE_DYNAMIC ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_formatter_extension_interface_init)); +G_DEFINE_DYNAMIC_TYPE ( + EMailFormatterItipLoader, + e_mail_formatter_itip_loader, + E_TYPE_EXTENSION) + static const gchar *formatter_mime_types[] = { "text/calendar", "application/ics", @@ -154,59 +154,60 @@ emfe_itip_get_description (EMailFormatterExtension *extension) } static void -e_mail_formatter_itip_constructed (GObject *object) +e_mail_formatter_itip_class_init (EMailFormatterItipClass *class) { - EExtensible *extensible; - EMailExtensionRegistry *reg; +} - extensible = e_extension_get_extensible (E_EXTENSION (object)); - reg = E_MAIL_EXTENSION_REGISTRY (extensible); +static void +e_mail_formatter_itip_class_finalize (EMailFormatterItipClass *class) +{ +} - e_mail_extension_registry_add_extension (reg, E_MAIL_EXTENSION (object)); +static void +e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) +{ + iface->mime_types = formatter_mime_types; + iface->format = emfe_itip_format; + iface->get_display_name = emfe_itip_get_display_name; + iface->get_description = emfe_itip_get_description; } static void -e_mail_formatter_itip_finalize (GObject *object) +e_mail_formatter_itip_init (EMailFormatterItip *formatter) +{ +} + +static void +mail_formatter_itip_loader_constructed (GObject *object) { EExtensible *extensible; - EMailExtensionRegistry *reg; extensible = e_extension_get_extensible (E_EXTENSION (object)); - reg = E_MAIL_EXTENSION_REGISTRY (extensible); - e_mail_extension_registry_remove_extension (reg, E_MAIL_EXTENSION (object)); + e_mail_extension_registry_add_extension ( + E_MAIL_EXTENSION_REGISTRY (extensible), + formatter_mime_types, + e_mail_formatter_itip_get_type ()); } static void -e_mail_formatter_itip_class_init (EMailFormatterItipClass *class) +e_mail_formatter_itip_loader_class_init (EExtensionClass *class) { GObjectClass *object_class; - EExtensionClass *extension_class; object_class = G_OBJECT_CLASS (class); - object_class->constructed = e_mail_formatter_itip_constructed; - object_class->finalize = e_mail_formatter_itip_finalize; + object_class->constructed = mail_formatter_itip_loader_constructed; - extension_class = E_EXTENSION_CLASS (class); - extension_class->extensible_type = E_TYPE_MAIL_FORMATTER_EXTENSION_REGISTRY; + class->extensible_type = E_TYPE_MAIL_FORMATTER_EXTENSION_REGISTRY; } static void -e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) +e_mail_formatter_itip_loader_class_finalize (EExtensionClass *class) { - iface->format = emfe_itip_format; - iface->get_display_name = emfe_itip_get_display_name; - iface->get_description = emfe_itip_get_description; } static void -e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = formatter_mime_types; -} - -static void -e_mail_formatter_itip_init (EMailFormatterItip *formatter) +e_mail_formatter_itip_loader_init (EExtension *extension) { } @@ -214,10 +215,5 @@ void e_mail_formatter_itip_type_register (GTypeModule *type_module) { e_mail_formatter_itip_register_type (type_module); -} - -static void -e_mail_formatter_itip_class_finalize (EMailFormatterItipClass *class) -{ - + e_mail_formatter_itip_loader_register_type (type_module); } diff --git a/modules/itip-formatter/e-mail-parser-itip.c b/modules/itip-formatter/e-mail-parser-itip.c index f8fb4f68fb..2894b525e6 100644 --- a/modules/itip-formatter/e-mail-parser-itip.c +++ b/modules/itip-formatter/e-mail-parser-itip.c @@ -44,30 +44,30 @@ #define d(x) -typedef struct _EMailParserItip { - EExtension parent; -} EMailParserItip; +typedef GObject EMailParserItip; +typedef GObjectClass EMailParserItipClass; -typedef struct _EMailParserItipClass { - EExtensionClass parent_class; -} EMailParserItipClass; +typedef EExtension EMailParserItipLoader; +typedef EExtensionClass EMailParserItipLoaderClass; GType e_mail_parser_itip_get_type (void); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); +GType e_mail_parser_itip_loader_get_type (void); static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); G_DEFINE_DYNAMIC_TYPE_EXTENDED ( EMailParserItip, e_mail_parser_itip, - E_TYPE_EXTENSION, + G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE_DYNAMIC ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE_DYNAMIC ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); +G_DEFINE_DYNAMIC_TYPE ( + EMailParserItipLoader, + e_mail_parser_itip_loader, + E_TYPE_EXTENSION) + static const gchar *parser_mime_types[] = { "text/calendar", "application/ics", @@ -259,70 +259,68 @@ empe_itip_get_flags (EMailParserExtension *extension) return E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION; } -void -e_mail_parser_itip_type_register (GTypeModule *type_module) +static void +e_mail_parser_itip_class_init (EMailParserItipClass *class) { - e_mail_parser_itip_register_type (type_module); } static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) +e_mail_parser_itip_class_finalize (EMailParserItipClass *class) { - iface->mime_types = parser_mime_types; + } static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { + iface->mime_types = parser_mime_types; iface->parse = empe_itip_parse; iface->get_flags = empe_itip_get_flags; } static void -e_mail_parser_itip_constructed (GObject *object) +e_mail_parser_itip_init (EMailParserItip *self) { - EExtensible *extensible; - EMailExtensionRegistry *reg; - - extensible = e_extension_get_extensible (E_EXTENSION (object)); - reg = E_MAIL_EXTENSION_REGISTRY (extensible); - - e_mail_extension_registry_add_extension (reg, E_MAIL_EXTENSION (object)); } static void -e_mail_parser_itip_finalize (GObject *object) +mail_parser_itip_loader_constructed (GObject *object) { EExtensible *extensible; - EMailExtensionRegistry *reg; extensible = e_extension_get_extensible (E_EXTENSION (object)); - reg = E_MAIL_EXTENSION_REGISTRY (extensible); - e_mail_extension_registry_remove_extension (reg, E_MAIL_EXTENSION (object)); + e_mail_extension_registry_add_extension ( + E_MAIL_EXTENSION_REGISTRY (extensible), + parser_mime_types, + e_mail_parser_itip_get_type ()); } static void -e_mail_parser_itip_class_init (EMailParserItipClass *class) +e_mail_parser_itip_loader_class_init (EExtensionClass *class) { GObjectClass *object_class; - EExtensionClass *extension_class; object_class = G_OBJECT_CLASS (class); - object_class->constructed = e_mail_parser_itip_constructed; - object_class->finalize = e_mail_parser_itip_finalize; + object_class->constructed = mail_parser_itip_loader_constructed; - extension_class = E_EXTENSION_CLASS (class); - extension_class->extensible_type = E_TYPE_MAIL_PARSER_EXTENSION_REGISTRY; + class->extensible_type = E_TYPE_MAIL_PARSER_EXTENSION_REGISTRY; } static void -e_mail_parser_itip_class_finalize (EMailParserItipClass *class) +e_mail_parser_itip_loader_class_finalize (EExtensionClass *class) { - } static void -e_mail_parser_itip_init (EMailParserItip *self) +e_mail_parser_itip_loader_init (EExtension *extension) { } + +void +e_mail_parser_itip_type_register (GTypeModule *type_module) +{ + e_mail_parser_itip_register_type (type_module); + e_mail_parser_itip_loader_register_type (type_module); +} + diff --git a/modules/prefer-plain/e-mail-parser-prefer-plain.c b/modules/prefer-plain/e-mail-parser-prefer-plain.c index aad1ea6277..eea1d280b5 100644 --- a/modules/prefer-plain/e-mail-parser-prefer-plain.c +++ b/modules/prefer-plain/e-mail-parser-prefer-plain.c @@ -35,8 +35,11 @@ typedef struct _EMailParserPreferPlain EMailParserPreferPlain; typedef struct _EMailParserPreferPlainClass EMailParserPreferPlainClass; +typedef EExtension EMailParserPreferPlainLoader; +typedef EExtensionClass EMailParserPreferPlainLoaderClass; + struct _EMailParserPreferPlain { - EExtension parent; + GObject parent; GSettings *settings; gint mode; @@ -44,11 +47,11 @@ struct _EMailParserPreferPlain { }; struct _EMailParserPreferPlainClass { - EExtensionClass parent_class; + GObjectClass parent_class; }; GType e_mail_parser_prefer_plain_get_type (void); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); +GType e_mail_parser_prefer_plain_loader_get_type (void); static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); enum { @@ -60,15 +63,17 @@ enum { G_DEFINE_DYNAMIC_TYPE_EXTENDED ( EMailParserPreferPlain, e_mail_parser_prefer_plain, - E_TYPE_EXTENSION, + G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE_DYNAMIC ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE_DYNAMIC ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); +G_DEFINE_DYNAMIC_TYPE ( + EMailParserPreferPlainLoader, + e_mail_parser_prefer_plain_loader, + E_TYPE_EXTENSION) + static const gchar *parser_mime_types[] = { "multipart/alternative", "text/html", @@ -326,37 +331,14 @@ empe_prefer_plain_parse (EMailParserExtension *extension, return TRUE; } -void -e_mail_parser_prefer_plain_type_register (GTypeModule *type_module) -{ - e_mail_parser_prefer_plain_register_type (type_module); -} - -static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) -{ - iface->mime_types = parser_mime_types; -} - static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { + iface->mime_types = parser_mime_types; iface->parse = empe_prefer_plain_parse; } static void -e_mail_parser_prefer_plain_constructed (GObject *object) -{ - EExtensible *extensible; - EMailExtensionRegistry *reg; - - extensible = e_extension_get_extensible (E_EXTENSION (object)); - reg = E_MAIL_EXTENSION_REGISTRY (extensible); - - e_mail_extension_registry_add_extension (reg, E_MAIL_EXTENSION (object)); -} - -static void e_mail_parser_prefer_plain_get_property (GObject *object, guint property_id, GValue *value, @@ -418,17 +400,12 @@ static void e_mail_parser_prefer_plain_class_init (EMailParserPreferPlainClass *class) { GObjectClass *object_class; - EExtensionClass *extension_class; object_class = G_OBJECT_CLASS (class); - object_class->constructed = e_mail_parser_prefer_plain_constructed; object_class->get_property = e_mail_parser_prefer_plain_get_property; object_class->set_property = e_mail_parser_prefer_plain_set_property; object_class->dispose = e_mail_parser_prefer_plain_dispose; - extension_class = E_EXTENSION_CLASS (class); - extension_class->extensible_type = E_TYPE_MAIL_PARSER_EXTENSION_REGISTRY; - g_object_class_install_property ( object_class, PROP_MODE, @@ -520,3 +497,45 @@ e_mail_parser_prefer_plain_init (EMailParserPreferPlain *parser) parser->show_suppressed = g_settings_get_boolean (parser->settings, "show-suppressed"); } + +static void +mail_parser_prefer_plain_loader_constructed (GObject *object) +{ + EExtensible *extensible; + + extensible = e_extension_get_extensible (E_EXTENSION (object)); + + e_mail_extension_registry_add_extension ( + E_MAIL_EXTENSION_REGISTRY (extensible), + parser_mime_types, + e_mail_parser_prefer_plain_get_type ()); +} + +static void +e_mail_parser_prefer_plain_loader_class_init (EExtensionClass *class) +{ + GObjectClass *object_class; + + object_class = G_OBJECT_CLASS (class); + object_class->constructed = mail_parser_prefer_plain_loader_constructed; + + class->extensible_type = E_TYPE_MAIL_PARSER_EXTENSION_REGISTRY; +} + +static void +e_mail_parser_prefer_plain_loader_class_finalize (EExtensionClass *class) +{ +} + +static void +e_mail_parser_prefer_plain_loader_init (EExtension *extension) +{ +} + +void +e_mail_parser_prefer_plain_type_register (GTypeModule *type_module) +{ + e_mail_parser_prefer_plain_register_type (type_module); + e_mail_parser_prefer_plain_loader_register_type (type_module); +} + diff --git a/modules/text-highlight/e-mail-formatter-text-highlight.c b/modules/text-highlight/e-mail-formatter-text-highlight.c index 1400c9488d..4655d3182d 100644 --- a/modules/text-highlight/e-mail-formatter-text-highlight.c +++ b/modules/text-highlight/e-mail-formatter-text-highlight.c @@ -38,33 +38,30 @@ #include <X11/Xlib.h> #include <camel/camel.h> -typedef struct _EMailFormatterTextHighlight EMailFormatterTextHighlight; -typedef struct _EMailFormatterTextHighlightClass EMailFormatterTextHighlightClass; +typedef GObject EMailFormatterTextHighlight; +typedef GObjectClass EMailFormatterTextHighlightClass; -struct _EMailFormatterTextHighlight { - EExtension parent; -}; - -struct _EMailFormatterTextHighlightClass { - EExtensionClass parent_class; -}; +typedef EExtension EMailFormatterTextHighlightLoader; +typedef EExtensionClass EMailFormatterTextHighlightLoaderClass; GType e_mail_formatter_text_highlight_get_type (void); +GType e_mail_formatter_text_highlight_loader_get_type (void); static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_DYNAMIC_TYPE_EXTENDED ( EMailFormatterTextHighlight, e_mail_formatter_text_highlight, - E_TYPE_EXTENSION, + G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE_DYNAMIC ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE_DYNAMIC ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_formatter_extension_interface_init)); +G_DEFINE_DYNAMIC_TYPE ( + EMailFormatterTextHighlightLoader, + e_mail_formatter_text_highlight_loader, + E_TYPE_EXTENSION) + static gchar * get_default_font (void) { @@ -377,15 +374,22 @@ emfe_text_highlight_get_description (EMailFormatterExtension *extension) } static void -emfe_text_highlight_constructed (GObject *object) +e_mail_formatter_text_highlight_class_init (EMailFormatterTextHighlightClass *class) { - EExtensible *extensible; - EMailExtensionRegistry *reg; +} - extensible = e_extension_get_extensible (E_EXTENSION (object)); - reg = E_MAIL_EXTENSION_REGISTRY (extensible); +static void +e_mail_formatter_text_highlight_class_finalize (EMailFormatterTextHighlightClass *class) +{ +} - e_mail_extension_registry_add_extension (reg, E_MAIL_EXTENSION (object)); +static void +e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) +{ + iface->mime_types = get_mime_types (); + iface->format = emfe_text_highlight_format; + iface->get_display_name = emfe_text_highlight_get_display_name; + iface->get_description = emfe_text_highlight_get_description; } static void @@ -394,39 +398,43 @@ e_mail_formatter_text_highlight_init (EMailFormatterTextHighlight *object) } static void -e_mail_formatter_text_highlight_class_init (EMailFormatterTextHighlightClass *class) +mail_formatter_text_highlight_loader_constructed (GObject *object) { - GObjectClass *object_class; - EExtensionClass *extension_class; + EExtensible *extensible; - object_class = G_OBJECT_CLASS (class); - object_class->constructed = emfe_text_highlight_constructed; + extensible = e_extension_get_extensible (E_EXTENSION (object)); - extension_class = E_EXTENSION_CLASS (class); - extension_class->extensible_type = E_TYPE_MAIL_FORMATTER_EXTENSION_REGISTRY; + e_mail_extension_registry_add_extension ( + E_MAIL_EXTENSION_REGISTRY (extensible), + get_mime_types (), + e_mail_formatter_text_highlight_get_type ()); } static void -e_mail_formatter_text_highlight_class_finalize (EMailFormatterTextHighlightClass *class) +e_mail_formatter_text_highlight_loader_class_init (EExtensionClass *class) { + GObjectClass *object_class; + + object_class = G_OBJECT_CLASS (class); + object_class->constructed = mail_formatter_text_highlight_loader_constructed; + + class->extensible_type = E_TYPE_MAIL_FORMATTER_EXTENSION_REGISTRY; } -void -e_mail_formatter_text_highlight_type_register (GTypeModule *type_module) +static void +e_mail_formatter_text_highlight_loader_class_finalize (EExtensionClass *class) { - e_mail_formatter_text_highlight_register_type (type_module); } static void -e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) +e_mail_formatter_text_highlight_loader_init (EExtension *extension) { - iface->format = emfe_text_highlight_format; - iface->get_display_name = emfe_text_highlight_get_display_name; - iface->get_description = emfe_text_highlight_get_description; } -static void -e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) +void +e_mail_formatter_text_highlight_type_register (GTypeModule *type_module) { - iface->mime_types = get_mime_types (); + e_mail_formatter_text_highlight_register_type (type_module); + e_mail_formatter_text_highlight_loader_register_type (type_module); } + diff --git a/modules/text-highlight/e-mail-parser-text-highlight.c b/modules/text-highlight/e-mail-parser-text-highlight.c index a8c17fd812..cf8ff5f11a 100644 --- a/modules/text-highlight/e-mail-parser-text-highlight.c +++ b/modules/text-highlight/e-mail-parser-text-highlight.c @@ -34,30 +34,30 @@ #define d(x) -typedef struct _EMailParserTextHighlight { - EExtension parent; -} EMailParserTextHighlight; +typedef GObject EMailParserTextHighlight; +typedef GObjectClass EMailParserTextHighlightClass; -typedef struct _EMailParserTextHighlightClass { - EExtensionClass parent_class; -} EMailParserTextHighlightClass; +typedef EExtension EMailParserTextHighlightLoader; +typedef EExtensionClass EMailParserTextHighlightLoaderClass; GType e_mail_parser_text_highlight_get_type (void); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); +GType e_mail_parser_text_highlight_loader_get_type (void); static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); G_DEFINE_DYNAMIC_TYPE_EXTENDED ( EMailParserTextHighlight, e_mail_parser_text_highlight, - E_TYPE_EXTENSION, + G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE_DYNAMIC ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE_DYNAMIC ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); +G_DEFINE_DYNAMIC_TYPE ( + EMailParserTextHighlightLoader, + e_mail_parser_text_highlight_loader, + E_TYPE_EXTENSION) + static gboolean empe_text_highlight_parse (EMailParserExtension *extension, EMailParser *parser, @@ -98,56 +98,66 @@ empe_text_highlight_parse (EMailParserExtension *extension, return TRUE; } -void -e_mail_parser_text_highlight_type_register (GTypeModule *type_module) +static void +e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - e_mail_parser_text_highlight_register_type (type_module); + iface->mime_types = get_mime_types (); + iface->parse = empe_text_highlight_parse; } static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) +e_mail_parser_text_highlight_class_init (EMailParserTextHighlightClass *class) +{ +} + +void +e_mail_parser_text_highlight_class_finalize (EMailParserTextHighlightClass *class) { - iface->mime_types = get_mime_types (); } static void -e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) +e_mail_parser_text_highlight_init (EMailParserTextHighlight *parser) { - iface->parse = empe_text_highlight_parse; } static void -e_mail_parser_text_highlight_constructed (GObject *object) +mail_parser_text_highlight_loader_constructed (GObject *object) { EExtensible *extensible; - EMailExtensionRegistry *reg; extensible = e_extension_get_extensible (E_EXTENSION (object)); - reg = E_MAIL_EXTENSION_REGISTRY (extensible); - e_mail_extension_registry_add_extension (reg, E_MAIL_EXTENSION (object)); + e_mail_extension_registry_add_extension ( + E_MAIL_EXTENSION_REGISTRY (extensible), + get_mime_types (), + e_mail_parser_text_highlight_get_type ()); } static void -e_mail_parser_text_highlight_class_init (EMailParserTextHighlightClass *class) +e_mail_parser_text_highlight_loader_class_init (EExtensionClass *class) { GObjectClass *object_class; - EExtensionClass *extension_class; object_class = G_OBJECT_CLASS (class); - object_class->constructed = e_mail_parser_text_highlight_constructed; + object_class->constructed = mail_parser_text_highlight_loader_constructed; - extension_class = E_EXTENSION_CLASS (class); - extension_class->extensible_type = E_TYPE_MAIL_PARSER_EXTENSION_REGISTRY; + class->extensible_type = E_TYPE_MAIL_PARSER_EXTENSION_REGISTRY; } -void -e_mail_parser_text_highlight_class_finalize (EMailParserTextHighlightClass *class) +static void +e_mail_parser_text_highlight_loader_class_finalize (EExtensionClass *class) { } static void -e_mail_parser_text_highlight_init (EMailParserTextHighlight *parser) +e_mail_parser_text_highlight_loader_init (EExtension *extension) { +} +void +e_mail_parser_text_highlight_type_register (GTypeModule *type_module) +{ + e_mail_parser_text_highlight_register_type (type_module); + e_mail_parser_text_highlight_loader_register_type (type_module); } + diff --git a/modules/tnef-attachment/e-mail-parser-tnef-attachment.c b/modules/tnef-attachment/e-mail-parser-tnef-attachment.c index dda02e23b1..27d8c7019b 100644 --- a/modules/tnef-attachment/e-mail-parser-tnef-attachment.c +++ b/modules/tnef-attachment/e-mail-parser-tnef-attachment.c @@ -50,7 +50,7 @@ #define d(x) typedef struct _EMailParserTnefAttachment { - EExtension parent; + GObject parent; GSettings *settings; gint mode; @@ -58,25 +58,30 @@ typedef struct _EMailParserTnefAttachment { } EMailParserTnefAttachment; typedef struct _EMailParserTnefAttachmentClass { - EExtensionClass parent_class; + GObjectClass parent_class; } EMailParserTnefAttachmentClass; +typedef EExtension EMailParserTnefAttachmentLoader; +typedef EExtensionClass EMailParserTnefAttachmentLoaderClass; + GType e_mail_parser_tnef_attachment_get_type (void); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); +GType e_mail_parser_tnef_attachment_loader_get_type (void); static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); G_DEFINE_DYNAMIC_TYPE_EXTENDED ( EMailParserTnefAttachment, e_mail_parser_tnef_attachment, - E_TYPE_EXTENSION, + G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE_DYNAMIC ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE_DYNAMIC ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); +G_DEFINE_DYNAMIC_TYPE ( + EMailParserTnefAttachmentLoader, + e_mail_parser_tnef_attachment_loader, + E_TYPE_EXTENSION) + static const gchar *parser_mime_types[] = { "application/vnd.ms-tnef", "application/ms-tnefl", @@ -261,60 +266,70 @@ empe_tnef_attachment_parse (EMailParserExtension *extension, return TRUE; } -void -e_mail_parser_tnef_attachment_type_register (GTypeModule *type_module) +static void +e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - e_mail_parser_tnef_attachment_register_type (type_module); + iface->mime_types = parser_mime_types; + iface->parse = empe_tnef_attachment_parse; } static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) +e_mail_parser_tnef_attachment_class_init (EMailParserTnefAttachmentClass *class) +{ +} + +void +e_mail_parser_tnef_attachment_class_finalize (EMailParserTnefAttachmentClass *class) { - iface->mime_types = parser_mime_types; } static void -e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) +e_mail_parser_tnef_attachment_init (EMailParserTnefAttachment *parser) { - iface->parse = empe_tnef_attachment_parse; } static void -e_mail_parser_tnef_attachment_constructed (GObject *object) +mail_parser_tnef_attachment_loader_constructed (GObject *object) { EExtensible *extensible; - EMailExtensionRegistry *reg; extensible = e_extension_get_extensible (E_EXTENSION (object)); - reg = E_MAIL_EXTENSION_REGISTRY (extensible); - e_mail_extension_registry_add_extension (reg, E_MAIL_EXTENSION (object)); + e_mail_extension_registry_add_extension ( + E_MAIL_EXTENSION_REGISTRY (extensible), + parser_mime_types, + e_mail_parser_tnef_attachment_get_type ()); } static void -e_mail_parser_tnef_attachment_class_init (EMailParserTnefAttachmentClass *class) +e_mail_parser_tnef_attachment_loader_class_init (EExtensionClass *class) { GObjectClass *object_class; - EExtensionClass *extension_class; object_class = G_OBJECT_CLASS (class); - object_class->constructed = e_mail_parser_tnef_attachment_constructed; + object_class->constructed = mail_parser_tnef_attachment_loader_constructed; - extension_class = E_EXTENSION_CLASS (class); - extension_class->extensible_type = E_TYPE_MAIL_PARSER_EXTENSION_REGISTRY; + class->extensible_type = E_TYPE_MAIL_PARSER_EXTENSION_REGISTRY; } -void -e_mail_parser_tnef_attachment_class_finalize (EMailParserTnefAttachmentClass *class) +static void +e_mail_parser_tnef_attachment_loader_class_finalize (EExtensionClass *class) { } static void -e_mail_parser_tnef_attachment_init (EMailParserTnefAttachment *parser) +e_mail_parser_tnef_attachment_loader_init (EExtension *extension) { } void +e_mail_parser_tnef_attachment_type_register (GTypeModule *type_module) +{ + e_mail_parser_tnef_attachment_register_type (type_module); + e_mail_parser_tnef_attachment_loader_register_type (type_module); +} + +void processTnef (TNEFStruct *tnef, const gchar *tmpdir) { diff --git a/modules/vcard-inline/e-mail-formatter-vcard-inline.c b/modules/vcard-inline/e-mail-formatter-vcard-inline.c index 7d2abfc626..8c88729455 100644 --- a/modules/vcard-inline/e-mail-formatter-vcard-inline.c +++ b/modules/vcard-inline/e-mail-formatter-vcard-inline.c @@ -36,30 +36,30 @@ #define d(x) -typedef struct _EMailFormatterVCardInline { - EExtension parent; -} EMailFormatterVCardInline; +typedef GObject EMailFormatterVCardInline; +typedef GObjectClass EMailFormatterVCardInlineClass; -typedef struct _EMailFormatterVCardInlineClass { - EExtensionClass parent_class; -} EMailFormatterVCardInlineClass; +typedef EExtension EMailFormatterVCardInlineLoader; +typedef EExtensionClass EMailFormatterVCardInlineLoaderClass; GType e_mail_formatter_vcard_inline_get_type (void); +GType e_mail_formatter_vcard_inline_loader_get_type (void); static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface); -static void e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface); G_DEFINE_DYNAMIC_TYPE_EXTENDED ( EMailFormatterVCardInline, e_mail_formatter_vcard_inline, - E_TYPE_EXTENSION, + G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE_DYNAMIC ( - E_TYPE_MAIL_EXTENSION, - e_mail_formatter_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE_DYNAMIC ( E_TYPE_MAIL_FORMATTER_EXTENSION, e_mail_formatter_formatter_extension_interface_init)); +G_DEFINE_DYNAMIC_TYPE ( + EMailFormatterVCardInlineLoader, + e_mail_formatter_vcard_inline_loader, + E_TYPE_EXTENSION) + static const gchar *formatter_mime_types[] = { "text/vcard", "text/x-vcard", @@ -212,58 +212,67 @@ emfe_vcard_inline_get_description (EMailFormatterExtension *extension) } static void -e_mail_formatter_vcard_inline_constructed (GObject *object) +e_mail_formatter_vcard_inline_class_init (EMailFormatterVCardInlineClass *class) { - EExtensible *extensible; - EMailExtensionRegistry *reg; - - extensible = e_extension_get_extensible (E_EXTENSION (object)); - reg = E_MAIL_EXTENSION_REGISTRY (extensible); - - e_mail_extension_registry_add_extension (reg, E_MAIL_EXTENSION (object)); } static void -e_mail_formatter_vcard_inline_class_init (EMailFormatterVCardInlineClass *class) +e_mail_formatter_vcard_inline_class_finalize (EMailFormatterVCardInlineClass *class) { - GObjectClass *object_class; - EExtensionClass *extension_class; - - object_class = G_OBJECT_CLASS (class); - object_class->constructed = e_mail_formatter_vcard_inline_constructed; - - extension_class = E_EXTENSION_CLASS (class); - extension_class->extensible_type = E_TYPE_MAIL_FORMATTER_EXTENSION_REGISTRY; } static void e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) { + iface->mime_types = formatter_mime_types; iface->format = emfe_vcard_inline_format; iface->get_display_name = emfe_vcard_inline_get_display_name; iface->get_description = emfe_vcard_inline_get_description; } static void -e_mail_formatter_mail_extension_interface_init (EMailExtensionInterface *iface) +e_mail_formatter_vcard_inline_init (EMailFormatterVCardInline *formatter) { - iface->mime_types = formatter_mime_types; } static void -e_mail_formatter_vcard_inline_init (EMailFormatterVCardInline *formatter) +mail_formatter_vcard_inline_loader_constructed (GObject *object) { + EExtensible *extensible; + + extensible = e_extension_get_extensible (E_EXTENSION (object)); + e_mail_extension_registry_add_extension ( + E_MAIL_EXTENSION_REGISTRY (extensible), + formatter_mime_types, + e_mail_formatter_vcard_inline_get_type ()); } -void -e_mail_formatter_vcard_inline_type_register (GTypeModule *type_module) +static void +e_mail_formatter_vcard_inline_loader_class_init (EExtensionClass *class) { - e_mail_formatter_vcard_inline_register_type (type_module); + GObjectClass *object_class; + + object_class = G_OBJECT_CLASS (class); + object_class->constructed = mail_formatter_vcard_inline_loader_constructed; + + class->extensible_type = E_TYPE_MAIL_FORMATTER_EXTENSION_REGISTRY; } static void -e_mail_formatter_vcard_inline_class_finalize (EMailFormatterVCardInlineClass *class) +e_mail_formatter_vcard_inline_loader_class_finalize (EExtensionClass *class) { +} +static void +e_mail_formatter_vcard_inline_loader_init (EExtension *extension) +{ } + +void +e_mail_formatter_vcard_inline_type_register (GTypeModule *type_module) +{ + e_mail_formatter_vcard_inline_register_type (type_module); + e_mail_formatter_vcard_inline_loader_register_type (type_module); +} + diff --git a/modules/vcard-inline/e-mail-parser-vcard-inline.c b/modules/vcard-inline/e-mail-parser-vcard-inline.c index 0f0014265b..c3998c79f8 100644 --- a/modules/vcard-inline/e-mail-parser-vcard-inline.c +++ b/modules/vcard-inline/e-mail-parser-vcard-inline.c @@ -48,30 +48,30 @@ #define d(x) -typedef struct _EMailParserVCardInline { - EExtension parent; -} EMailParserVCardInline; +typedef GObject EMailParserVCardInline; +typedef GObjectClass EMailParserVCardInlineClass; -typedef struct _EMailParserVCardInlineClass { - EExtensionClass parent_class; -} EMailParserVCardInlineClass; +typedef EExtension EMailParserVCardInlineLoader; +typedef EExtensionClass EMailParserVCardInlineLoaderClass; GType e_mail_parser_vcard_inline_get_type (void); -static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface); +GType e_mail_parser_vcard_inline_loader_get_type (void); static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface); G_DEFINE_DYNAMIC_TYPE_EXTENDED ( EMailParserVCardInline, e_mail_parser_vcard_inline, - E_TYPE_EXTENSION, + G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE_DYNAMIC ( - E_TYPE_MAIL_EXTENSION, - e_mail_parser_mail_extension_interface_init) - G_IMPLEMENT_INTERFACE_DYNAMIC ( E_TYPE_MAIL_PARSER_EXTENSION, e_mail_parser_parser_extension_interface_init)); +G_DEFINE_DYNAMIC_TYPE ( + EMailParserVCardInlineLoader, + e_mail_parser_vcard_inline_loader, + E_TYPE_EXTENSION) + static const gchar *parser_mime_types[] = { "text/vcard", "text/x-vcard", @@ -380,57 +380,68 @@ empe_vcard_inline_get_flags (EMailParserExtension *extension) return E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION; } -void -e_mail_parser_vcard_inline_type_register (GTypeModule *type_module) +static void +e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) { - e_mail_parser_vcard_inline_register_type (type_module); + iface->mime_types = parser_mime_types; + iface->parse = empe_vcard_inline_parse; + iface->get_flags = empe_vcard_inline_get_flags; } static void -e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface) +e_mail_parser_vcard_inline_class_init (EMailParserVCardInlineClass *class) { - iface->mime_types = parser_mime_types; } static void -e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface) +e_mail_parser_vcard_inline_class_finalize (EMailParserVCardInlineClass *class) { - iface->parse = empe_vcard_inline_parse; - iface->get_flags = empe_vcard_inline_get_flags; + } static void -e_mail_parser_vcard_inline_constructed (GObject *object) +e_mail_parser_vcard_inline_init (EMailParserVCardInline *self) +{ +} + +static void +mail_parser_vcard_inline_loader_constructed (GObject *object) { EExtensible *extensible; - EMailExtensionRegistry *reg; extensible = e_extension_get_extensible (E_EXTENSION (object)); - reg = E_MAIL_EXTENSION_REGISTRY (extensible); - e_mail_extension_registry_add_extension (reg, E_MAIL_EXTENSION (object)); + e_mail_extension_registry_add_extension ( + E_MAIL_EXTENSION_REGISTRY (extensible), + parser_mime_types, + e_mail_parser_vcard_inline_get_type ()); } static void -e_mail_parser_vcard_inline_class_init (EMailParserVCardInlineClass *class) +e_mail_parser_vcard_inline_loader_class_init (EExtensionClass *class) { GObjectClass *object_class; - EExtensionClass *extension_class; object_class = G_OBJECT_CLASS (class); - object_class->constructed = e_mail_parser_vcard_inline_constructed; + object_class->constructed = mail_parser_vcard_inline_loader_constructed; - extension_class = E_EXTENSION_CLASS (class); - extension_class->extensible_type = E_TYPE_MAIL_PARSER_EXTENSION_REGISTRY; + class->extensible_type = E_TYPE_MAIL_PARSER_EXTENSION_REGISTRY; } static void -e_mail_parser_vcard_inline_class_finalize (EMailParserVCardInlineClass *class) +e_mail_parser_vcard_inline_loader_class_finalize (EExtensionClass *class) { - } static void -e_mail_parser_vcard_inline_init (EMailParserVCardInline *self) +e_mail_parser_vcard_inline_loader_init (EExtension *extension) +{ +} + +void +e_mail_parser_vcard_inline_type_register (GTypeModule *type_module) { + e_mail_parser_vcard_inline_register_type (type_module); + e_mail_parser_vcard_inline_loader_register_type (type_module); } + |