From ec451b46748745a38db3e607b1d7aad4eae481c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 23 Jul 2018 20:29:02 +0200 Subject: [PATCH] plugin: Add META_DECLARE_PLUGIN_WITH_CODE() variant Thanks to G_DEFINE_DYNAMIC_TYPE_EXTENDED(), this is a trivial addition that will allow using G_IMPLEMENT_INTERFACE_DYNAMIC() or G_ADD_PRIVATE_DYNAMIC() when declaring a plugin. https://gitlab.gnome.org/GNOME/mutter/merge_requests/176 --- src/meta/meta-plugin.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/meta/meta-plugin.h b/src/meta/meta-plugin.h index f973ec6ce..3dc428642 100644 --- a/src/meta/meta-plugin.h +++ b/src/meta/meta-plugin.h @@ -303,7 +303,7 @@ struct _MetaPluginVersion /* * Convenience macro to set up the plugin type. Based on GEdit. */ -#define META_PLUGIN_DECLARE(ObjectName, object_name) \ +#define META_PLUGIN_DECLARE_WITH_CODE(ObjectName, object_name, CODE) \ G_MODULE_EXPORT MetaPluginVersion meta_plugin_version = \ { \ META_MAJOR_VERSION, \ @@ -312,7 +312,8 @@ struct _MetaPluginVersion META_PLUGIN_API_VERSION \ }; \ \ - G_DEFINE_DYNAMIC_TYPE(ObjectName, object_name, META_TYPE_PLUGIN) \ + G_DEFINE_DYNAMIC_TYPE_EXTENDED(ObjectName, object_name, \ + META_TYPE_PLUGIN, 0, CODE) \ \ /* Unused, but required by G_DEFINE_DYNAMIC_TYPE */ \ static void \ @@ -325,6 +326,9 @@ struct _MetaPluginVersion return object_name##_get_type (); \ } \ +#define META_PLUGIN_DECLARE(ObjectName, object_name) \ + META_PLUGIN_DECLARE_WITH_CODE(ObjectName, object_name, {}) + void meta_plugin_switch_workspace_completed (MetaPlugin *plugin);