From 00b211b0f515d6b6d9147c1ca568d0c4b42af699 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 7 Dec 2012 09:37:37 -0500 Subject: Convert EMailFormatterExtension to an abstract class. With the previous changes, all formatter extensions derive from GObjectClass and implement the EMailFormatterExtensionInterface. Simplify things further by making EMailFormatterExtension an abstract base class so formatter extensions are now just direct subclasses and need not bother with implementing GObject interfaces. --- modules/itip-formatter/e-mail-formatter-itip.c | 32 +++++++++----------------- 1 file changed, 11 insertions(+), 21 deletions(-) (limited to 'modules/itip-formatter/e-mail-formatter-itip.c') diff --git a/modules/itip-formatter/e-mail-formatter-itip.c b/modules/itip-formatter/e-mail-formatter-itip.c index 2aab01288b..41bf368227 100644 --- a/modules/itip-formatter/e-mail-formatter-itip.c +++ b/modules/itip-formatter/e-mail-formatter-itip.c @@ -34,24 +34,19 @@ #define d(x) -typedef GObject EMailFormatterItip; -typedef GObjectClass EMailFormatterItipClass; +typedef EMailFormatterExtension EMailFormatterItip; +typedef EMailFormatterExtensionClass 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); -G_DEFINE_DYNAMIC_TYPE_EXTENDED ( +G_DEFINE_DYNAMIC_TYPE ( EMailFormatterItip, e_mail_formatter_itip, - G_TYPE_OBJECT, - 0, - G_IMPLEMENT_INTERFACE_DYNAMIC ( - E_TYPE_MAIL_FORMATTER_EXTENSION, - e_mail_formatter_formatter_extension_interface_init)); + E_TYPE_MAIL_FORMATTER_EXTENSION) G_DEFINE_DYNAMIC_TYPE ( EMailFormatterItipLoader, @@ -154,26 +149,21 @@ emfe_itip_get_description (EMailFormatterExtension *extension) } static void -e_mail_formatter_itip_class_init (EMailFormatterItipClass *class) -{ -} - -static void -e_mail_formatter_itip_class_finalize (EMailFormatterItipClass *class) +e_mail_formatter_itip_class_init (EMailFormatterExtensionClass *class) { + class->mime_types = formatter_mime_types; + class->format = emfe_itip_format; + class->get_display_name = emfe_itip_get_display_name; + class->get_description = emfe_itip_get_description; } static void -e_mail_formatter_formatter_extension_interface_init (EMailFormatterExtensionInterface *iface) +e_mail_formatter_itip_class_finalize (EMailFormatterExtensionClass *class) { - 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_init (EMailFormatterItip *formatter) +e_mail_formatter_itip_init (EMailFormatterExtension *extension) { } -- cgit v1.2.3