From e46b4adef5c6c6805b3ca6dbfbe99a4299252514 Mon Sep 17 00:00:00 2001 From: haxar Date: Tue, 21 Feb 2012 20:14:01 -0800 Subject: gsd to msd complete rename patch by NiceandGently; file rename commit --- plugins/dummy/gsd-dummy-manager.c | 186 -------------------------------------- plugins/dummy/gsd-dummy-manager.h | 61 ------------- plugins/dummy/gsd-dummy-plugin.c | 104 --------------------- plugins/dummy/gsd-dummy-plugin.h | 63 ------------- plugins/dummy/msd-dummy-manager.c | 186 ++++++++++++++++++++++++++++++++++++++ plugins/dummy/msd-dummy-manager.h | 61 +++++++++++++ plugins/dummy/msd-dummy-plugin.c | 104 +++++++++++++++++++++ plugins/dummy/msd-dummy-plugin.h | 63 +++++++++++++ 8 files changed, 414 insertions(+), 414 deletions(-) delete mode 100644 plugins/dummy/gsd-dummy-manager.c delete mode 100644 plugins/dummy/gsd-dummy-manager.h delete mode 100644 plugins/dummy/gsd-dummy-plugin.c delete mode 100644 plugins/dummy/gsd-dummy-plugin.h create mode 100644 plugins/dummy/msd-dummy-manager.c create mode 100644 plugins/dummy/msd-dummy-manager.h create mode 100644 plugins/dummy/msd-dummy-plugin.c create mode 100644 plugins/dummy/msd-dummy-plugin.h (limited to 'plugins/dummy') diff --git a/plugins/dummy/gsd-dummy-manager.c b/plugins/dummy/gsd-dummy-manager.c deleted file mode 100644 index 2744aeb..0000000 --- a/plugins/dummy/gsd-dummy-manager.c +++ /dev/null @@ -1,186 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- - * - * Copyright (C) 2007 William Jon McCann - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include "mate-settings-profile.h" -#include "msd-dummy-manager.h" - -#define MSD_DUMMY_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), MSD_TYPE_DUMMY_MANAGER, MsdDummyManagerPrivate)) - -struct MsdDummyManagerPrivate -{ - gboolean padding; -}; - -enum { - PROP_0, -}; - -static void msd_dummy_manager_class_init (MsdDummyManagerClass *klass); -static void msd_dummy_manager_init (MsdDummyManager *dummy_manager); -static void msd_dummy_manager_finalize (GObject *object); - -G_DEFINE_TYPE (MsdDummyManager, msd_dummy_manager, G_TYPE_OBJECT) - -static gpointer manager_object = NULL; - -gboolean -msd_dummy_manager_start (MsdDummyManager *manager, - GError **error) -{ - g_debug ("Starting dummy manager"); - mate_settings_profile_start (NULL); - mate_settings_profile_end (NULL); - return TRUE; -} - -void -msd_dummy_manager_stop (MsdDummyManager *manager) -{ - g_debug ("Stopping dummy manager"); -} - -static void -msd_dummy_manager_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - MsdDummyManager *self; - - self = MSD_DUMMY_MANAGER (object); - - switch (prop_id) { - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -msd_dummy_manager_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - MsdDummyManager *self; - - self = MSD_DUMMY_MANAGER (object); - - switch (prop_id) { - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static GObject * -msd_dummy_manager_constructor (GType type, - guint n_construct_properties, - GObjectConstructParam *construct_properties) -{ - MsdDummyManager *dummy_manager; - MsdDummyManagerClass *klass; - - klass = MSD_DUMMY_MANAGER_CLASS (g_type_class_peek (MSD_TYPE_DUMMY_MANAGER)); - - dummy_manager = MSD_DUMMY_MANAGER (G_OBJECT_CLASS (msd_dummy_manager_parent_class)->constructor (type, - n_construct_properties, - construct_properties)); - - return G_OBJECT (dummy_manager); -} - -static void -msd_dummy_manager_dispose (GObject *object) -{ - MsdDummyManager *dummy_manager; - - dummy_manager = MSD_DUMMY_MANAGER (object); - - G_OBJECT_CLASS (msd_dummy_manager_parent_class)->dispose (object); -} - -static void -msd_dummy_manager_class_init (MsdDummyManagerClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - object_class->get_property = msd_dummy_manager_get_property; - object_class->set_property = msd_dummy_manager_set_property; - object_class->constructor = msd_dummy_manager_constructor; - object_class->dispose = msd_dummy_manager_dispose; - object_class->finalize = msd_dummy_manager_finalize; - - g_type_class_add_private (klass, sizeof (MsdDummyManagerPrivate)); -} - -static void -msd_dummy_manager_init (MsdDummyManager *manager) -{ - manager->priv = MSD_DUMMY_MANAGER_GET_PRIVATE (manager); - -} - -static void -msd_dummy_manager_finalize (GObject *object) -{ - MsdDummyManager *dummy_manager; - - g_return_if_fail (object != NULL); - g_return_if_fail (MSD_IS_DUMMY_MANAGER (object)); - - dummy_manager = MSD_DUMMY_MANAGER (object); - - g_return_if_fail (dummy_manager->priv != NULL); - - G_OBJECT_CLASS (msd_dummy_manager_parent_class)->finalize (object); -} - -MsdDummyManager * -msd_dummy_manager_new (void) -{ - if (manager_object != NULL) { - g_object_ref (manager_object); - } else { - manager_object = g_object_new (MSD_TYPE_DUMMY_MANAGER, NULL); - g_object_add_weak_pointer (manager_object, - (gpointer *) &manager_object); - } - - return MSD_DUMMY_MANAGER (manager_object); -} diff --git a/plugins/dummy/gsd-dummy-manager.h b/plugins/dummy/gsd-dummy-manager.h deleted file mode 100644 index 91f989a..0000000 --- a/plugins/dummy/gsd-dummy-manager.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- - * - * Copyright (C) 2007 William Jon McCann - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef __MSD_DUMMY_MANAGER_H -#define __MSD_DUMMY_MANAGER_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define MSD_TYPE_DUMMY_MANAGER (msd_dummy_manager_get_type ()) -#define MSD_DUMMY_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MSD_TYPE_DUMMY_MANAGER, MsdDummyManager)) -#define MSD_DUMMY_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MSD_TYPE_DUMMY_MANAGER, MsdDummyManagerClass)) -#define MSD_IS_DUMMY_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MSD_TYPE_DUMMY_MANAGER)) -#define MSD_IS_DUMMY_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MSD_TYPE_DUMMY_MANAGER)) -#define MSD_DUMMY_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MSD_TYPE_DUMMY_MANAGER, MsdDummyManagerClass)) - -typedef struct MsdDummyManagerPrivate MsdDummyManagerPrivate; - -typedef struct -{ - GObject parent; - MsdDummyManagerPrivate *priv; -} MsdDummyManager; - -typedef struct -{ - GObjectClass parent_class; -} MsdDummyManagerClass; - -GType msd_dummy_manager_get_type (void); - -MsdDummyManager * msd_dummy_manager_new (void); -gboolean msd_dummy_manager_start (MsdDummyManager *manager, - GError **error); -void msd_dummy_manager_stop (MsdDummyManager *manager); - -#ifdef __cplusplus -} -#endif - -#endif /* __MSD_DUMMY_MANAGER_H */ diff --git a/plugins/dummy/gsd-dummy-plugin.c b/plugins/dummy/gsd-dummy-plugin.c deleted file mode 100644 index c1e18bb..0000000 --- a/plugins/dummy/gsd-dummy-plugin.c +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- - * - * Copyright (C) 2007 William Jon McCann - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#include "config.h" - -#include -#include - -#include "mate-settings-plugin.h" -#include "msd-dummy-plugin.h" -#include "msd-dummy-manager.h" - -struct MsdDummyPluginPrivate { - MsdDummyManager *manager; -}; - -#define MSD_DUMMY_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), MSD_TYPE_DUMMY_PLUGIN, MsdDummyPluginPrivate)) - -MATE_SETTINGS_PLUGIN_REGISTER (MsdDummyPlugin, msd_dummy_plugin) - -static void -msd_dummy_plugin_init (MsdDummyPlugin *plugin) -{ - plugin->priv = MSD_DUMMY_PLUGIN_GET_PRIVATE (plugin); - - g_debug ("MsdDummyPlugin initializing"); - - plugin->priv->manager = msd_dummy_manager_new (); -} - -static void -msd_dummy_plugin_finalize (GObject *object) -{ - MsdDummyPlugin *plugin; - - g_return_if_fail (object != NULL); - g_return_if_fail (MSD_IS_DUMMY_PLUGIN (object)); - - g_debug ("MsdDummyPlugin finalizing"); - - plugin = MSD_DUMMY_PLUGIN (object); - - g_return_if_fail (plugin->priv != NULL); - - if (plugin->priv->manager != NULL) { - g_object_unref (plugin->priv->manager); - } - - G_OBJECT_CLASS (msd_dummy_plugin_parent_class)->finalize (object); -} - -static void -impl_activate (MateSettingsPlugin *plugin) -{ - gboolean res; - GError *error; - - g_debug ("Activating dummy plugin"); - - error = NULL; - res = msd_dummy_manager_start (MSD_DUMMY_PLUGIN (plugin)->priv->manager, &error); - if (! res) { - g_warning ("Unable to start dummy manager: %s", error->message); - g_error_free (error); - } -} - -static void -impl_deactivate (MateSettingsPlugin *plugin) -{ - g_debug ("Deactivating dummy plugin"); - msd_dummy_manager_stop (MSD_DUMMY_PLUGIN (plugin)->priv->manager); -} - -static void -msd_dummy_plugin_class_init (MsdDummyPluginClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - MateSettingsPluginClass *plugin_class = MATE_SETTINGS_PLUGIN_CLASS (klass); - - object_class->finalize = msd_dummy_plugin_finalize; - - plugin_class->activate = impl_activate; - plugin_class->deactivate = impl_deactivate; - - g_type_class_add_private (klass, sizeof (MsdDummyPluginPrivate)); -} diff --git a/plugins/dummy/gsd-dummy-plugin.h b/plugins/dummy/gsd-dummy-plugin.h deleted file mode 100644 index f07f78c..0000000 --- a/plugins/dummy/gsd-dummy-plugin.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- - * - * Copyright (C) 2007 William Jon McCann - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef __MSD_DUMMY_PLUGIN_H__ -#define __MSD_DUMMY_PLUGIN_H__ - -#include -#include -#include - -#include "mate-settings-plugin.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define MSD_TYPE_DUMMY_PLUGIN (msd_dummy_plugin_get_type ()) -#define MSD_DUMMY_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MSD_TYPE_DUMMY_PLUGIN, MsdDummyPlugin)) -#define MSD_DUMMY_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MSD_TYPE_DUMMY_PLUGIN, MsdDummyPluginClass)) -#define MSD_IS_DUMMY_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MSD_TYPE_DUMMY_PLUGIN)) -#define MSD_IS_DUMMY_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MSD_TYPE_DUMMY_PLUGIN)) -#define MSD_DUMMY_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MSD_TYPE_DUMMY_PLUGIN, MsdDummyPluginClass)) - -typedef struct MsdDummyPluginPrivate MsdDummyPluginPrivate; - -typedef struct -{ - MateSettingsPlugin parent; - MsdDummyPluginPrivate *priv; -} MsdDummyPlugin; - -typedef struct -{ - MateSettingsPluginClass parent_class; -} MsdDummyPluginClass; - -GType msd_dummy_plugin_get_type (void) G_GNUC_CONST; - -/* All the plugins must implement this function */ -G_MODULE_EXPORT GType register_mate_settings_plugin (GTypeModule *module); - -#ifdef __cplusplus -} -#endif - -#endif /* __MSD_DUMMY_PLUGIN_H__ */ diff --git a/plugins/dummy/msd-dummy-manager.c b/plugins/dummy/msd-dummy-manager.c new file mode 100644 index 0000000..2744aeb --- /dev/null +++ b/plugins/dummy/msd-dummy-manager.c @@ -0,0 +1,186 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * + * Copyright (C) 2007 William Jon McCann + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include "mate-settings-profile.h" +#include "msd-dummy-manager.h" + +#define MSD_DUMMY_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), MSD_TYPE_DUMMY_MANAGER, MsdDummyManagerPrivate)) + +struct MsdDummyManagerPrivate +{ + gboolean padding; +}; + +enum { + PROP_0, +}; + +static void msd_dummy_manager_class_init (MsdDummyManagerClass *klass); +static void msd_dummy_manager_init (MsdDummyManager *dummy_manager); +static void msd_dummy_manager_finalize (GObject *object); + +G_DEFINE_TYPE (MsdDummyManager, msd_dummy_manager, G_TYPE_OBJECT) + +static gpointer manager_object = NULL; + +gboolean +msd_dummy_manager_start (MsdDummyManager *manager, + GError **error) +{ + g_debug ("Starting dummy manager"); + mate_settings_profile_start (NULL); + mate_settings_profile_end (NULL); + return TRUE; +} + +void +msd_dummy_manager_stop (MsdDummyManager *manager) +{ + g_debug ("Stopping dummy manager"); +} + +static void +msd_dummy_manager_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + MsdDummyManager *self; + + self = MSD_DUMMY_MANAGER (object); + + switch (prop_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +msd_dummy_manager_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + MsdDummyManager *self; + + self = MSD_DUMMY_MANAGER (object); + + switch (prop_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static GObject * +msd_dummy_manager_constructor (GType type, + guint n_construct_properties, + GObjectConstructParam *construct_properties) +{ + MsdDummyManager *dummy_manager; + MsdDummyManagerClass *klass; + + klass = MSD_DUMMY_MANAGER_CLASS (g_type_class_peek (MSD_TYPE_DUMMY_MANAGER)); + + dummy_manager = MSD_DUMMY_MANAGER (G_OBJECT_CLASS (msd_dummy_manager_parent_class)->constructor (type, + n_construct_properties, + construct_properties)); + + return G_OBJECT (dummy_manager); +} + +static void +msd_dummy_manager_dispose (GObject *object) +{ + MsdDummyManager *dummy_manager; + + dummy_manager = MSD_DUMMY_MANAGER (object); + + G_OBJECT_CLASS (msd_dummy_manager_parent_class)->dispose (object); +} + +static void +msd_dummy_manager_class_init (MsdDummyManagerClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->get_property = msd_dummy_manager_get_property; + object_class->set_property = msd_dummy_manager_set_property; + object_class->constructor = msd_dummy_manager_constructor; + object_class->dispose = msd_dummy_manager_dispose; + object_class->finalize = msd_dummy_manager_finalize; + + g_type_class_add_private (klass, sizeof (MsdDummyManagerPrivate)); +} + +static void +msd_dummy_manager_init (MsdDummyManager *manager) +{ + manager->priv = MSD_DUMMY_MANAGER_GET_PRIVATE (manager); + +} + +static void +msd_dummy_manager_finalize (GObject *object) +{ + MsdDummyManager *dummy_manager; + + g_return_if_fail (object != NULL); + g_return_if_fail (MSD_IS_DUMMY_MANAGER (object)); + + dummy_manager = MSD_DUMMY_MANAGER (object); + + g_return_if_fail (dummy_manager->priv != NULL); + + G_OBJECT_CLASS (msd_dummy_manager_parent_class)->finalize (object); +} + +MsdDummyManager * +msd_dummy_manager_new (void) +{ + if (manager_object != NULL) { + g_object_ref (manager_object); + } else { + manager_object = g_object_new (MSD_TYPE_DUMMY_MANAGER, NULL); + g_object_add_weak_pointer (manager_object, + (gpointer *) &manager_object); + } + + return MSD_DUMMY_MANAGER (manager_object); +} diff --git a/plugins/dummy/msd-dummy-manager.h b/plugins/dummy/msd-dummy-manager.h new file mode 100644 index 0000000..91f989a --- /dev/null +++ b/plugins/dummy/msd-dummy-manager.h @@ -0,0 +1,61 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * + * Copyright (C) 2007 William Jon McCann + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef __MSD_DUMMY_MANAGER_H +#define __MSD_DUMMY_MANAGER_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define MSD_TYPE_DUMMY_MANAGER (msd_dummy_manager_get_type ()) +#define MSD_DUMMY_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MSD_TYPE_DUMMY_MANAGER, MsdDummyManager)) +#define MSD_DUMMY_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MSD_TYPE_DUMMY_MANAGER, MsdDummyManagerClass)) +#define MSD_IS_DUMMY_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MSD_TYPE_DUMMY_MANAGER)) +#define MSD_IS_DUMMY_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MSD_TYPE_DUMMY_MANAGER)) +#define MSD_DUMMY_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MSD_TYPE_DUMMY_MANAGER, MsdDummyManagerClass)) + +typedef struct MsdDummyManagerPrivate MsdDummyManagerPrivate; + +typedef struct +{ + GObject parent; + MsdDummyManagerPrivate *priv; +} MsdDummyManager; + +typedef struct +{ + GObjectClass parent_class; +} MsdDummyManagerClass; + +GType msd_dummy_manager_get_type (void); + +MsdDummyManager * msd_dummy_manager_new (void); +gboolean msd_dummy_manager_start (MsdDummyManager *manager, + GError **error); +void msd_dummy_manager_stop (MsdDummyManager *manager); + +#ifdef __cplusplus +} +#endif + +#endif /* __MSD_DUMMY_MANAGER_H */ diff --git a/plugins/dummy/msd-dummy-plugin.c b/plugins/dummy/msd-dummy-plugin.c new file mode 100644 index 0000000..c1e18bb --- /dev/null +++ b/plugins/dummy/msd-dummy-plugin.c @@ -0,0 +1,104 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * + * Copyright (C) 2007 William Jon McCann + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#include "config.h" + +#include +#include + +#include "mate-settings-plugin.h" +#include "msd-dummy-plugin.h" +#include "msd-dummy-manager.h" + +struct MsdDummyPluginPrivate { + MsdDummyManager *manager; +}; + +#define MSD_DUMMY_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), MSD_TYPE_DUMMY_PLUGIN, MsdDummyPluginPrivate)) + +MATE_SETTINGS_PLUGIN_REGISTER (MsdDummyPlugin, msd_dummy_plugin) + +static void +msd_dummy_plugin_init (MsdDummyPlugin *plugin) +{ + plugin->priv = MSD_DUMMY_PLUGIN_GET_PRIVATE (plugin); + + g_debug ("MsdDummyPlugin initializing"); + + plugin->priv->manager = msd_dummy_manager_new (); +} + +static void +msd_dummy_plugin_finalize (GObject *object) +{ + MsdDummyPlugin *plugin; + + g_return_if_fail (object != NULL); + g_return_if_fail (MSD_IS_DUMMY_PLUGIN (object)); + + g_debug ("MsdDummyPlugin finalizing"); + + plugin = MSD_DUMMY_PLUGIN (object); + + g_return_if_fail (plugin->priv != NULL); + + if (plugin->priv->manager != NULL) { + g_object_unref (plugin->priv->manager); + } + + G_OBJECT_CLASS (msd_dummy_plugin_parent_class)->finalize (object); +} + +static void +impl_activate (MateSettingsPlugin *plugin) +{ + gboolean res; + GError *error; + + g_debug ("Activating dummy plugin"); + + error = NULL; + res = msd_dummy_manager_start (MSD_DUMMY_PLUGIN (plugin)->priv->manager, &error); + if (! res) { + g_warning ("Unable to start dummy manager: %s", error->message); + g_error_free (error); + } +} + +static void +impl_deactivate (MateSettingsPlugin *plugin) +{ + g_debug ("Deactivating dummy plugin"); + msd_dummy_manager_stop (MSD_DUMMY_PLUGIN (plugin)->priv->manager); +} + +static void +msd_dummy_plugin_class_init (MsdDummyPluginClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + MateSettingsPluginClass *plugin_class = MATE_SETTINGS_PLUGIN_CLASS (klass); + + object_class->finalize = msd_dummy_plugin_finalize; + + plugin_class->activate = impl_activate; + plugin_class->deactivate = impl_deactivate; + + g_type_class_add_private (klass, sizeof (MsdDummyPluginPrivate)); +} diff --git a/plugins/dummy/msd-dummy-plugin.h b/plugins/dummy/msd-dummy-plugin.h new file mode 100644 index 0000000..f07f78c --- /dev/null +++ b/plugins/dummy/msd-dummy-plugin.h @@ -0,0 +1,63 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * + * Copyright (C) 2007 William Jon McCann + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef __MSD_DUMMY_PLUGIN_H__ +#define __MSD_DUMMY_PLUGIN_H__ + +#include +#include +#include + +#include "mate-settings-plugin.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define MSD_TYPE_DUMMY_PLUGIN (msd_dummy_plugin_get_type ()) +#define MSD_DUMMY_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MSD_TYPE_DUMMY_PLUGIN, MsdDummyPlugin)) +#define MSD_DUMMY_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MSD_TYPE_DUMMY_PLUGIN, MsdDummyPluginClass)) +#define MSD_IS_DUMMY_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MSD_TYPE_DUMMY_PLUGIN)) +#define MSD_IS_DUMMY_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MSD_TYPE_DUMMY_PLUGIN)) +#define MSD_DUMMY_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MSD_TYPE_DUMMY_PLUGIN, MsdDummyPluginClass)) + +typedef struct MsdDummyPluginPrivate MsdDummyPluginPrivate; + +typedef struct +{ + MateSettingsPlugin parent; + MsdDummyPluginPrivate *priv; +} MsdDummyPlugin; + +typedef struct +{ + MateSettingsPluginClass parent_class; +} MsdDummyPluginClass; + +GType msd_dummy_plugin_get_type (void) G_GNUC_CONST; + +/* All the plugins must implement this function */ +G_MODULE_EXPORT GType register_mate_settings_plugin (GTypeModule *module); + +#ifdef __cplusplus +} +#endif + +#endif /* __MSD_DUMMY_PLUGIN_H__ */ -- cgit v1.2.1