diff options
author | Wu Xiaotian <[email protected]> | 2019-07-01 15:49:56 +0800 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-07-15 19:20:58 +0200 |
commit | de2761ddea2ca22cba4bb3668fb4328352210775 (patch) | |
tree | 4d4d30168d83ad5111aa9a7e4fc73aa585cfe7ad | |
parent | 22b646166eadfa939bb17f770811a34670145b4f (diff) | |
download | mate-settings-daemon-de2761ddea2ca22cba4bb3668fb4328352210775.tar.bz2 mate-settings-daemon-de2761ddea2ca22cba4bb3668fb4328352210775.tar.xz |
add new macro MATE_SETTINGS_PLUGIN_REGISTER_WITH_PRIVATE
-rw-r--r-- | mate-settings-daemon/mate-settings-plugin.h | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/mate-settings-daemon/mate-settings-plugin.h b/mate-settings-daemon/mate-settings-plugin.h index 534034f..4bdd2e7 100644 --- a/mate-settings-daemon/mate-settings-plugin.h +++ b/mate-settings-daemon/mate-settings-plugin.h @@ -25,9 +25,8 @@ #include <glib-object.h> #include <gmodule.h> -#ifdef __cplusplus -extern "C" { -#endif +G_BEGIN_DECLS + #define MATE_TYPE_SETTINGS_PLUGIN (mate_settings_plugin_get_type()) #define MATE_SETTINGS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MATE_TYPE_SETTINGS_PLUGIN, MateSettingsPlugin)) #define MATE_SETTINGS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), MATE_TYPE_SETTINGS_PLUGIN, MateSettingsPluginClass)) @@ -59,11 +58,7 @@ void mate_settings_plugin_deactivate (MateSettingsPlugin *pl * * use: MATE_SETTINGS_PLUGIN_REGISTER (PluginName, plugin_name) */ -#define MATE_SETTINGS_PLUGIN_REGISTER(PluginName, plugin_name) \ - G_DEFINE_DYNAMIC_TYPE (PluginName, \ - plugin_name, \ - MATE_TYPE_SETTINGS_PLUGIN) \ - \ +#define _REGISTER_PLUGIN_FUNC(plugin_name) \ G_MODULE_EXPORT GType \ register_mate_settings_plugin (GTypeModule *type_module) \ { \ @@ -72,8 +67,22 @@ register_mate_settings_plugin (GTypeModule *type_module) \ return plugin_name##_get_type(); \ } -#ifdef __cplusplus -} -#endif +#define MATE_SETTINGS_PLUGIN_REGISTER(PluginName, plugin_name) \ + G_DEFINE_DYNAMIC_TYPE (PluginName, \ + plugin_name, \ + MATE_TYPE_SETTINGS_PLUGIN) \ + \ +_REGISTER_PLUGIN_FUNC(plugin_name) + +#define MATE_SETTINGS_PLUGIN_REGISTER_WITH_PRIVATE(PluginName, plugin_name) \ + G_DEFINE_DYNAMIC_TYPE_EXTENDED (PluginName, \ + plugin_name, \ + MATE_TYPE_SETTINGS_PLUGIN, \ + 0, \ + G_ADD_PRIVATE_DYNAMIC(PluginName)) \ + \ +_REGISTER_PLUGIN_FUNC(plugin_name) + +G_END_DECLS #endif /* __MATE_SETTINGS_PLUGIN_H__ */ |