diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-12-07 05:40:13 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-12-08 03:01:05 +0800 |
commit | 54455ca1ad6cae527544fed12d0de4ae95341082 (patch) | |
tree | b223d428459e3be79d1162d8217be6c2856f643b /modules | |
parent | 9d34f72ec1b99d58ee1c3a6d1a964a6dde166f79 (diff) | |
download | gsoc2013-evolution-54455ca1ad6cae527544fed12d0de4ae95341082.tar gsoc2013-evolution-54455ca1ad6cae527544fed12d0de4ae95341082.tar.gz gsoc2013-evolution-54455ca1ad6cae527544fed12d0de4ae95341082.tar.bz2 gsoc2013-evolution-54455ca1ad6cae527544fed12d0de4ae95341082.tar.lz gsoc2013-evolution-54455ca1ad6cae527544fed12d0de4ae95341082.tar.xz gsoc2013-evolution-54455ca1ad6cae527544fed12d0de4ae95341082.tar.zst gsoc2013-evolution-54455ca1ad6cae527544fed12d0de4ae95341082.zip |
Remove EMailExtension.
EMailExtension is now too trivial to keep as a standalone interface.
Add a 'mime_types' string array to the EMailFormatterExtension and
EMailFormatterParser interface structs.
Alter e_mail_extension_registry_add_extension() to take a 'mime_types'
string array and the GType of an extension to instantiate, rather than
the extension instance directly.
e_mail_extension_registry_remove_extension() is no longer needed.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/audio-inline/e-mail-formatter-audio-inline.c | 85 | ||||
-rw-r--r-- | modules/audio-inline/e-mail-parser-audio-inline.c | 73 | ||||
-rw-r--r-- | modules/itip-formatter/e-mail-formatter-itip.c | 84 | ||||
-rw-r--r-- | modules/itip-formatter/e-mail-parser-itip.c | 72 | ||||
-rw-r--r-- | modules/prefer-plain/e-mail-parser-prefer-plain.c | 91 | ||||
-rw-r--r-- | modules/text-highlight/e-mail-formatter-text-highlight.c | 84 | ||||
-rw-r--r-- | modules/text-highlight/e-mail-parser-text-highlight.c | 70 | ||||
-rw-r--r-- | modules/tnef-attachment/e-mail-parser-tnef-attachment.c | 67 | ||||
-rw-r--r-- | modules/vcard-inline/e-mail-formatter-vcard-inline.c | 79 | ||||
-rw-r--r-- | modules/vcard-inline/e-mail-parser-vcard-inline.c | 73 |
10 files changed, 432 insertions, 346 deletions
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); } + |