diff options
-rw-r--r-- | mate-settings-daemon/mate-settings-plugin.h | 126 | ||||
-rw-r--r-- | plugins/a11y-keyboard/msd-a11y-keyboard-plugin.c | 5 | ||||
-rw-r--r-- | plugins/background/msd-background-plugin.c | 121 | ||||
-rw-r--r-- | plugins/clipboard/msd-clipboard-plugin.c | 6 | ||||
-rw-r--r-- | plugins/dummy/msd-dummy-plugin.c | 5 | ||||
-rw-r--r-- | plugins/font/msd-font-plugin.c | 5 | ||||
-rw-r--r-- | plugins/housekeeping/msd-housekeeping-plugin.c | 6 | ||||
-rw-r--r-- | plugins/keyboard/msd-keyboard-plugin.c | 6 | ||||
-rw-r--r-- | plugins/media-keys/msd-media-keys-plugin.c | 6 | ||||
-rw-r--r-- | plugins/mouse/msd-mouse-plugin.c | 6 | ||||
-rw-r--r-- | plugins/smartcard/msd-smartcard-plugin.c | 6 | ||||
-rw-r--r-- | plugins/sound/msd-sound-plugin.c | 6 | ||||
-rw-r--r-- | plugins/typing-break/msd-typing-break-plugin.c | 5 | ||||
-rw-r--r-- | plugins/xrandr/msd-xrandr-plugin.c | 6 | ||||
-rw-r--r-- | plugins/xrdb/msd-xrdb-plugin.c | 6 | ||||
-rw-r--r-- | plugins/xsettings/msd-xsettings-plugin.c | 5 |
16 files changed, 152 insertions, 174 deletions
diff --git a/mate-settings-daemon/mate-settings-plugin.h b/mate-settings-daemon/mate-settings-plugin.h index 0f90567..534034f 100644 --- a/mate-settings-daemon/mate-settings-plugin.h +++ b/mate-settings-daemon/mate-settings-plugin.h @@ -59,123 +59,19 @@ void mate_settings_plugin_deactivate (MateSettingsPlugin *pl * * use: MATE_SETTINGS_PLUGIN_REGISTER (PluginName, plugin_name) */ -#define MATE_SETTINGS_PLUGIN_REGISTER(PluginName, plugin_name) \ - \ -static GType plugin_name##_type = 0; \ -static GTypeModule *plugin_module_type = 0; \ - \ -GType \ -plugin_name##_get_type (void) \ -{ \ - return plugin_name##_type; \ -} \ - \ -static void plugin_name##_init (PluginName *self); \ -static void plugin_name##_class_init (PluginName##Class *klass); \ -static gpointer plugin_name##_parent_class = NULL; \ -static void plugin_name##_class_intern_init (gpointer klass) \ -{ \ - plugin_name##_parent_class = g_type_class_peek_parent (klass); \ - plugin_name##_class_init ((PluginName##Class *) klass); \ -} \ - \ -G_MODULE_EXPORT GType \ -register_mate_settings_plugin (GTypeModule *module) \ -{ \ - static const GTypeInfo our_info = \ - { \ - sizeof (PluginName##Class), \ - NULL, /* base_init */ \ - NULL, /* base_finalize */ \ - (GClassInitFunc) plugin_name##_class_intern_init, \ - NULL, \ - NULL, /* class_data */ \ - sizeof (PluginName), \ - 0, /* n_preallocs */ \ - (GInstanceInitFunc) plugin_name##_init \ - }; \ - \ - g_debug ("Registering " #PluginName); \ - \ - /* Initialise the i18n stuff */ \ - bindtextdomain (GETTEXT_PACKAGE, MATE_SETTINGS_LOCALEDIR); \ - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); \ - \ - plugin_module_type = module; \ - plugin_name##_type = g_type_module_register_type (module, \ - MATE_TYPE_SETTINGS_PLUGIN, \ - #PluginName, \ - &our_info, \ - 0); \ - \ - return plugin_name##_type; \ +#define MATE_SETTINGS_PLUGIN_REGISTER(PluginName, plugin_name) \ + G_DEFINE_DYNAMIC_TYPE (PluginName, \ + plugin_name, \ + MATE_TYPE_SETTINGS_PLUGIN) \ + \ +G_MODULE_EXPORT GType \ +register_mate_settings_plugin (GTypeModule *type_module) \ +{ \ + plugin_name##_register_type (type_module); \ + \ + return plugin_name##_get_type(); \ } -/* - * Utility macro used to register gobject types in plugins with additional code - * - * use: MATE_SETTINGS_PLUGIN_DEFINE_TYPE_WITH_CODE(ObjectName, object_name, PARENT_TYPE, CODE) - */ -#define MATE_SETTINGS_PLUGIN_DEFINE_TYPE_WITH_CODE(ObjectName, object_name, PARENT_TYPE, CODE) \ -static void object_name##_init (ObjectName *self); \ -static void object_name##_class_init (ObjectName##Class *klass); \ -static gpointer object_name##_parent_class = ((void *)0); \ -static GType ojbect_name##_type_id = 0; \ - \ -static void object_name##_class_intern_init (gpointer klass) \ -{ \ - object_name##_parent_class = g_type_class_peek_parent (klass); \ - object_name##_class_init ((ObjectName##Class *) klass); \ -} \ - \ - \ -GType \ -object_name##_get_type (void) \ -{ \ - g_assert (object_name##_type_id != 0); \ - \ - return object_name##_type_id; \ -} \ - \ -GType \ -object_name##_register_type (GTypeModule *module) \ -{ \ - if ((object_name##_type_id == 0)) { \ - const GTypeInfo g_define_type_info = { \ - sizeof (ObjectName##Class), \ - (GBaseInitFunc) ((void *)0), \ - (GBaseFinalizeFunc) ((void *)0), \ - (GClassInitFunc) object_name##_class_intern_init, \ - (GClassFinalizeFunc) ((void *)0), \ - ((void *)0), \ - sizeof (ObjectName), \ - 0, \ - (GInstanceInitFunc) object_name##_init, \ - ((void *)0) \ - }; \ - object_name##_type_id = \ - g_type_module_register_type (module, \ - PARENT_TYPE, \ - #ObjectName, \ - &g_define_type_info, \ - (GTypeFlags) 0); \ - } \ - \ - g_debug ("Registering " #ObjectName); \ - \ - CODE \ - \ - return type_name##_type_id; \ -} - -/* - * Utility macro used to register gobject types in plugins - * - * use: MATE_SETTINGS_PLUGIN_DEFINE_TYPE(ObjectName, object_name, PARENT_TYPE) - */ -#define MATE_SETTINGS_PLUGIN_DEFINE_TYPE(ObjectName, object_name, PARENT_TYPE) \ - MATE_SETTINGS_PLUGIN_DEFINE_TYPE_WITH_CODE(ObjectName, object_name, PARENT_TYPE, ;) - #ifdef __cplusplus } #endif diff --git a/plugins/a11y-keyboard/msd-a11y-keyboard-plugin.c b/plugins/a11y-keyboard/msd-a11y-keyboard-plugin.c index d905336..57ac653 100644 --- a/plugins/a11y-keyboard/msd-a11y-keyboard-plugin.c +++ b/plugins/a11y-keyboard/msd-a11y-keyboard-plugin.c @@ -102,3 +102,8 @@ msd_a11y_keyboard_plugin_class_init (MsdA11yKeyboardPluginClass *klass) g_type_class_add_private (klass, sizeof (MsdA11yKeyboardPluginPrivate)); } + +static void +msd_a11y_keyboard_plugin_class_finalize (MsdA11yKeyboardPluginClass *klass) +{ +} diff --git a/plugins/background/msd-background-plugin.c b/plugins/background/msd-background-plugin.c index f5cb0d1..ee6b49c 100644 --- a/plugins/background/msd-background-plugin.c +++ b/plugins/background/msd-background-plugin.c @@ -27,85 +27,88 @@ #include "msd-background-plugin.h" #include "msd-background-manager.h" -//class MsdBackgroundPlugin -//{ - struct MsdBackgroundPluginPrivate { - MsdBackgroundManager* manager; - }; +struct MsdBackgroundPluginPrivate { + MsdBackgroundManager* manager; +}; - #define MSD_BACKGROUND_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE((object), MSD_TYPE_BACKGROUND_PLUGIN, MsdBackgroundPluginPrivate)) +#define MSD_BACKGROUND_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE((object), MSD_TYPE_BACKGROUND_PLUGIN, MsdBackgroundPluginPrivate)) - MATE_SETTINGS_PLUGIN_REGISTER(MsdBackgroundPlugin, msd_background_plugin) +MATE_SETTINGS_PLUGIN_REGISTER(MsdBackgroundPlugin, msd_background_plugin) - static void - msd_background_plugin_init (MsdBackgroundPlugin* plugin) - { - plugin->priv = MSD_BACKGROUND_PLUGIN_GET_PRIVATE(plugin); - - g_debug("MsdBackgroundPlugin initializing"); +static void +msd_background_plugin_init (MsdBackgroundPlugin* plugin) +{ + plugin->priv = MSD_BACKGROUND_PLUGIN_GET_PRIVATE(plugin); - plugin->priv->manager = msd_background_manager_new(); - } + g_debug("MsdBackgroundPlugin initializing"); - static void - msd_background_plugin_finalize (GObject* object) - { - MsdBackgroundPlugin* plugin; + plugin->priv->manager = msd_background_manager_new(); +} - g_return_if_fail(object != NULL); - g_return_if_fail(MSD_IS_BACKGROUND_PLUGIN(object)); +static void +msd_background_plugin_finalize (GObject* object) +{ + MsdBackgroundPlugin* plugin; - g_debug("MsdBackgroundPlugin finalizing"); + g_return_if_fail(object != NULL); + g_return_if_fail(MSD_IS_BACKGROUND_PLUGIN(object)); - plugin = MSD_BACKGROUND_PLUGIN(object); + g_debug("MsdBackgroundPlugin finalizing"); - g_return_if_fail(plugin->priv != NULL); + plugin = MSD_BACKGROUND_PLUGIN(object); - if (plugin->priv->manager != NULL) - { - g_object_unref (plugin->priv->manager); - } + g_return_if_fail(plugin->priv != NULL); - G_OBJECT_CLASS(msd_background_plugin_parent_class)->finalize(object); + if (plugin->priv->manager != NULL) + { + g_object_unref (plugin->priv->manager); } - static void - impl_activate (MateSettingsPlugin* plugin) - { - gboolean res; - GError* error; + G_OBJECT_CLASS(msd_background_plugin_parent_class)->finalize(object); +} - g_debug("Activating background plugin"); +static void +impl_activate (MateSettingsPlugin* plugin) +{ + gboolean res; + GError* error; - error = NULL; - res = msd_background_manager_start(MSD_BACKGROUND_PLUGIN(plugin)->priv->manager, &error); + g_debug("Activating background plugin"); - if (!res) - { - g_warning("Unable to start background manager: %s", error->message); - g_error_free(error); - } - } + error = NULL; + res = msd_background_manager_start(MSD_BACKGROUND_PLUGIN(plugin)->priv->manager, &error); - static void - impl_deactivate (MateSettingsPlugin* plugin) + if (!res) { - g_debug("Deactivating background plugin"); - - msd_background_manager_stop(MSD_BACKGROUND_PLUGIN(plugin)->priv->manager); + g_warning("Unable to start background manager: %s", error->message); + g_error_free(error); } +} - static void - msd_background_plugin_class_init (MsdBackgroundPluginClass* klass) - { - GObjectClass* object_class = G_OBJECT_CLASS(klass); - MateSettingsPluginClass* plugin_class = MATE_SETTINGS_PLUGIN_CLASS(klass); +static void +impl_deactivate (MateSettingsPlugin* plugin) +{ + g_debug("Deactivating background plugin"); - object_class->finalize = msd_background_plugin_finalize; + msd_background_manager_stop(MSD_BACKGROUND_PLUGIN(plugin)->priv->manager); +} - plugin_class->activate = impl_activate; - plugin_class->deactivate = impl_deactivate; +static void +msd_background_plugin_class_init (MsdBackgroundPluginClass* klass) +{ + GObjectClass* object_class = G_OBJECT_CLASS(klass); + MateSettingsPluginClass* plugin_class = MATE_SETTINGS_PLUGIN_CLASS(klass); + + object_class->finalize = msd_background_plugin_finalize; + + plugin_class->activate = impl_activate; + plugin_class->deactivate = impl_deactivate; + + g_type_class_add_private(klass, sizeof(MsdBackgroundPluginPrivate)); +} + +static void +msd_background_plugin_class_finalize (MsdBackgroundPluginClass *klass) +{ +} - g_type_class_add_private(klass, sizeof(MsdBackgroundPluginPrivate)); - } -//}
\ No newline at end of file diff --git a/plugins/clipboard/msd-clipboard-plugin.c b/plugins/clipboard/msd-clipboard-plugin.c index a7e4d86..da00eda 100644 --- a/plugins/clipboard/msd-clipboard-plugin.c +++ b/plugins/clipboard/msd-clipboard-plugin.c @@ -102,3 +102,9 @@ msd_clipboard_plugin_class_init (MsdClipboardPluginClass *klass) g_type_class_add_private (klass, sizeof (MsdClipboardPluginPrivate)); } + +static void +msd_clipboard_plugin_class_finalize (MsdClipboardPluginClass *klass) +{ +} + diff --git a/plugins/dummy/msd-dummy-plugin.c b/plugins/dummy/msd-dummy-plugin.c index 5fbbc0b..ff4046d 100644 --- a/plugins/dummy/msd-dummy-plugin.c +++ b/plugins/dummy/msd-dummy-plugin.c @@ -102,3 +102,8 @@ msd_dummy_plugin_class_init (MsdDummyPluginClass *klass) g_type_class_add_private (klass, sizeof (MsdDummyPluginPrivate)); } + +static void +msd_dummy_plugin_class_finalize (MsdDummyPluginClass *klass) +{ +} diff --git a/plugins/font/msd-font-plugin.c b/plugins/font/msd-font-plugin.c index b6a4452..d76aabb 100644 --- a/plugins/font/msd-font-plugin.c +++ b/plugins/font/msd-font-plugin.c @@ -102,3 +102,8 @@ msd_font_plugin_class_init (MsdFontPluginClass *klass) g_type_class_add_private (klass, sizeof (MsdFontPluginPrivate)); } + +static void +msd_font_plugin_class_finalize (MsdFontPluginClass *klass) +{ +} diff --git a/plugins/housekeeping/msd-housekeeping-plugin.c b/plugins/housekeeping/msd-housekeeping-plugin.c index 9d5c407..40cd547 100644 --- a/plugins/housekeeping/msd-housekeeping-plugin.c +++ b/plugins/housekeeping/msd-housekeeping-plugin.c @@ -102,3 +102,9 @@ msd_housekeeping_plugin_class_init (MsdHousekeepingPluginClass *klass) g_type_class_add_private (klass, sizeof (MsdHousekeepingPluginPrivate)); } + +static void +msd_housekeeping_plugin_class_finalize (MsdHousekeepingPluginClass *klass) +{ +} + diff --git a/plugins/keyboard/msd-keyboard-plugin.c b/plugins/keyboard/msd-keyboard-plugin.c index 310c74c..97ad9ef 100644 --- a/plugins/keyboard/msd-keyboard-plugin.c +++ b/plugins/keyboard/msd-keyboard-plugin.c @@ -102,3 +102,9 @@ msd_keyboard_plugin_class_init (MsdKeyboardPluginClass *klass) g_type_class_add_private (klass, sizeof (MsdKeyboardPluginPrivate)); } + +static void +msd_keyboard_plugin_class_finalize (MsdKeyboardPluginClass *klass) +{ +} + diff --git a/plugins/media-keys/msd-media-keys-plugin.c b/plugins/media-keys/msd-media-keys-plugin.c index 4d297bb..93a805f 100644 --- a/plugins/media-keys/msd-media-keys-plugin.c +++ b/plugins/media-keys/msd-media-keys-plugin.c @@ -102,3 +102,9 @@ msd_media_keys_plugin_class_init (MsdMediaKeysPluginClass *klass) g_type_class_add_private (klass, sizeof (MsdMediaKeysPluginPrivate)); } + +static void +msd_media_keys_plugin_class_finalize (MsdMediaKeysPluginClass *klass) +{ +} + diff --git a/plugins/mouse/msd-mouse-plugin.c b/plugins/mouse/msd-mouse-plugin.c index 9bd3d1b..19b96d7 100644 --- a/plugins/mouse/msd-mouse-plugin.c +++ b/plugins/mouse/msd-mouse-plugin.c @@ -102,3 +102,9 @@ msd_mouse_plugin_class_init (MsdMousePluginClass *klass) g_type_class_add_private (klass, sizeof (MsdMousePluginPrivate)); } + +static void +msd_mouse_plugin_class_finalize (MsdMousePluginClass *klass) +{ +} + diff --git a/plugins/smartcard/msd-smartcard-plugin.c b/plugins/smartcard/msd-smartcard-plugin.c index 08f6e6c..ae1b264 100644 --- a/plugins/smartcard/msd-smartcard-plugin.c +++ b/plugins/smartcard/msd-smartcard-plugin.c @@ -338,3 +338,9 @@ msd_smartcard_plugin_class_init (MsdSmartcardPluginClass *klass) g_type_class_add_private (klass, sizeof (MsdSmartcardPluginPrivate)); } + +static void +msd_smartcard_plugin_class_finalize (MsdSmartcardPluginClass *klass) +{ +} + diff --git a/plugins/sound/msd-sound-plugin.c b/plugins/sound/msd-sound-plugin.c index ac31450..f0e0a1e 100644 --- a/plugins/sound/msd-sound-plugin.c +++ b/plugins/sound/msd-sound-plugin.c @@ -98,3 +98,9 @@ msd_sound_plugin_class_init (MsdSoundPluginClass *klass) g_type_class_add_private (klass, sizeof (MsdSoundPluginPrivate)); } + +static void +msd_sound_plugin_class_finalize (MsdSoundPluginClass *klass) +{ +} + diff --git a/plugins/typing-break/msd-typing-break-plugin.c b/plugins/typing-break/msd-typing-break-plugin.c index f0d3580..3b5770b 100644 --- a/plugins/typing-break/msd-typing-break-plugin.c +++ b/plugins/typing-break/msd-typing-break-plugin.c @@ -102,3 +102,8 @@ msd_typing_break_plugin_class_init (MsdTypingBreakPluginClass *klass) g_type_class_add_private (klass, sizeof (MsdTypingBreakPluginPrivate)); } + +static void +msd_typing_break_plugin_class_finalize (MsdTypingBreakPluginClass *klass) +{ +} diff --git a/plugins/xrandr/msd-xrandr-plugin.c b/plugins/xrandr/msd-xrandr-plugin.c index e87baea..7680a0a 100644 --- a/plugins/xrandr/msd-xrandr-plugin.c +++ b/plugins/xrandr/msd-xrandr-plugin.c @@ -102,3 +102,9 @@ msd_xrandr_plugin_class_init (MsdXrandrPluginClass *klass) g_type_class_add_private (klass, sizeof (MsdXrandrPluginPrivate)); } + +static void +msd_xrandr_plugin_class_finalize (MsdXrandrPluginClass *klass) +{ +} + diff --git a/plugins/xrdb/msd-xrdb-plugin.c b/plugins/xrdb/msd-xrdb-plugin.c index 1506523..6c79c57 100644 --- a/plugins/xrdb/msd-xrdb-plugin.c +++ b/plugins/xrdb/msd-xrdb-plugin.c @@ -102,3 +102,9 @@ msd_xrdb_plugin_class_init (MsdXrdbPluginClass *klass) g_type_class_add_private (klass, sizeof (MsdXrdbPluginPrivate)); } + +static void +msd_xrdb_plugin_class_finalize (MsdXrdbPluginClass *klass) +{ +} + diff --git a/plugins/xsettings/msd-xsettings-plugin.c b/plugins/xsettings/msd-xsettings-plugin.c index 6449264..faa7068 100644 --- a/plugins/xsettings/msd-xsettings-plugin.c +++ b/plugins/xsettings/msd-xsettings-plugin.c @@ -102,3 +102,8 @@ mate_xsettings_plugin_class_init (MateXSettingsPluginClass *klass) g_type_class_add_private (klass, sizeof (MateXSettingsPluginPrivate)); } + +static void +mate_xsettings_plugin_class_finalize (MateXSettingsPluginClass *klass) +{ +} |