diff options
author | Bastien Nocera <hadess@hadess.net> | 2010-08-06 16:37:45 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2010-08-06 16:37:45 +0100 |
commit | 3f013e69936a13287a42339f7c1afbd2499c7af9 (patch) | |
tree | a9759c6d858fca27c6b884dda6bf5d6c046434b9 /src | |
parent | 22d2912eb034869a9b9881a0cedcd1e39a75edc4 (diff) | |
download | totem-3f013e69936a13287a42339f7c1afbd2499c7af9.tar.gz |
Require libpeas 0.5.4
And update the helper macros.
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/totem-plugin.h | 80 | ||||
-rw-r--r-- | src/plugins/totem-plugins-engine.c | 4 |
2 files changed, 79 insertions, 5 deletions
diff --git a/src/plugins/totem-plugin.h b/src/plugins/totem-plugin.h index e2f7412be..c9e1b07b2 100644 --- a/src/plugins/totem-plugin.h +++ b/src/plugins/totem-plugin.h @@ -46,10 +46,14 @@ G_BEGIN_DECLS * deactivate functions. **/ #define TOTEM_PLUGIN_REGISTER(TYPE_NAME, TypeName, type_name) \ - static void impl_activate (PeasActivatable *plugin, GObject *totem); \ - static void impl_deactivate (PeasActivatable *plugin, GObject *totem); \ + static void impl_activate (PeasActivatable *plugin); \ + static void impl_deactivate (PeasActivatable *plugin); \ G_MODULE_EXPORT void peas_register_types (PeasObjectModule *module); \ static void peas_activatable_iface_init (PeasActivatableInterface *iface); \ + enum { \ + PROP_0, \ + PROP_OBJECT \ + }; \ G_DEFINE_DYNAMIC_TYPE_EXTENDED (TypeName, \ type_name, \ PEAS_TYPE_EXTENSION_BASE, \ @@ -63,6 +67,38 @@ G_BEGIN_DECLS iface->deactivate = impl_deactivate; \ } \ static void \ + set_property (GObject *object, \ + guint prop_id, \ + const GValue *value, \ + GParamSpec *pspec) \ + { \ + switch (prop_id) { \ + case PROP_OBJECT: \ + g_object_set_data_full (object, "object", \ + g_value_dup_object (value), \ + g_object_unref); \ + break; \ + default: \ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); \ + break; \ + } \ + } \ + static void \ + get_property (GObject *object, \ + guint prop_id, \ + GValue *value, \ + GParamSpec *pspec) \ + { \ + switch (prop_id) { \ + case PROP_OBJECT: \ + g_value_set_object (value, g_object_get_data (object, "object")); \ + break; \ + default: \ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); \ + break; \ + } \ + } \ + static void \ type_name##_class_finalize (TypeName##Class *klass) \ { \ } \ @@ -85,12 +121,16 @@ G_BEGIN_DECLS * and deactivate and widget creation functions. **/ #define TOTEM_PLUGIN_REGISTER_CONFIGURABLE(TYPE_NAME, TypeName, type_name) \ - static void impl_activate (PeasActivatable *plugin, GObject *totem); \ - static void impl_deactivate (PeasActivatable *plugin, GObject *totem); \ + static void impl_activate (PeasActivatable *plugin); \ + static void impl_deactivate (PeasActivatable *plugin); \ static GtkWidget *impl_create_configure_widget (PeasUIConfigurable *configurable); \ G_MODULE_EXPORT void peas_register_types (PeasObjectModule *module); \ static void peas_activatable_iface_init (PeasActivatableInterface *iface); \ static void peas_ui_configurable_iface_init (PeasUIConfigurableInterface *iface); \ + enum { \ + PROP_0, \ + PROP_OBJECT \ + }; \ G_DEFINE_DYNAMIC_TYPE_EXTENDED (TypeName, \ type_name, \ PEAS_TYPE_EXTENSION_BASE, \ @@ -111,6 +151,38 @@ G_BEGIN_DECLS iface->create_configure_widget = impl_create_configure_widget; \ } \ static void \ + set_property (GObject *object, \ + guint prop_id, \ + const GValue *value, \ + GParamSpec *pspec) \ + { \ + switch (prop_id) { \ + case PROP_OBJECT: \ + g_object_set_data_full (object, "object", \ + g_value_dup_object (value), \ + g_object_unref); \ + break; \ + default: \ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); \ + break; \ + } \ + } \ + static void \ + get_property (GObject *object, \ + guint prop_id, \ + GValue *value, \ + GParamSpec *pspec) \ + { \ + switch (prop_id) { \ + case PROP_OBJECT: \ + g_value_set_object (value, g_object_get_data (object, "object")); \ + break; \ + default: \ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); \ + break; \ + } \ + } \ + static void \ type_name##_class_finalize (TypeName##Class *klass) \ { \ } \ diff --git a/src/plugins/totem-plugins-engine.c b/src/plugins/totem-plugins-engine.c index 4cd9f47d8..14f178d09 100644 --- a/src/plugins/totem-plugins-engine.c +++ b/src/plugins/totem-plugins-engine.c @@ -208,7 +208,9 @@ totem_plugins_engine_get_default (TotemObject *totem) engine->priv->totem = g_object_ref (totem); engine->priv->activatable_extensions = peas_extension_set_new (PEAS_ENGINE (engine), - PEAS_TYPE_ACTIVATABLE); + PEAS_TYPE_ACTIVATABLE, + "object", totem, + NULL); totem_plugins_engine_load_all (engine); totem_plugins_engine_monitor (engine); |