diff options
Diffstat (limited to 'modules/audio-inline')
-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 |
2 files changed, 89 insertions, 69 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); } + |