[totem] Cleanup media-player-keys plugin definition



commit aefc430b0fb60bde2d2b6f7a7fd2156ce45adb21
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jun 16 18:39:14 2010 +0100

    Cleanup media-player-keys plugin definition

 .../media-player-keys/totem-media-player-keys.c    |   48 ++------------------
 1 files changed, 4 insertions(+), 44 deletions(-)
---
diff --git a/src/plugins/media-player-keys/totem-media-player-keys.c b/src/plugins/media-player-keys/totem-media-player-keys.c
index 3834061..273eeab 100644
--- a/src/plugins/media-player-keys/totem-media-player-keys.c
+++ b/src/plugins/media-player-keys/totem-media-player-keys.c
@@ -37,6 +37,7 @@
 #include <libpeas/peas-activatable.h>
 #include <string.h>
 
+#include "totem-plugin.h"
 #include "totem-marshal.h"
 #include "totem.h"
 
@@ -61,40 +62,15 @@ typedef struct
 	PeasExtensionBaseClass parent_class;
 } TotemMediaPlayerKeysPluginClass;
 
-G_MODULE_EXPORT void peas_register_types		(PeasObjectModule *module);
 GType	totem_media_player_keys_plugin_get_type		(void) G_GNUC_CONST;
 
-static void peas_activatable_iface_init			(PeasActivatableInterface *iface);
-static void totem_media_player_keys_plugin_finalize	(GObject *object);
-static void impl_activate				(PeasActivatable *plugin, GObject *object);
-static void impl_deactivate				(PeasActivatable *plugin, GObject *object);
-
-G_DEFINE_DYNAMIC_TYPE_EXTENDED (TotemMediaPlayerKeysPlugin,
-				totem_media_player_keys_plugin,
-				PEAS_TYPE_EXTENSION_BASE,
-				0,
-				G_IMPLEMENT_INTERFACE_DYNAMIC (PEAS_TYPE_ACTIVATABLE,
-							       peas_activatable_iface_init))
+TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_MEDIA_PLAYER_KEYS_PLUGIN,
+		      TotemMediaPlayerKeysPlugin,
+		      totem_media_player_keys_plugin);
 
 static void
 totem_media_player_keys_plugin_class_init (TotemMediaPlayerKeysPluginClass *klass)
 {
-	GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
-	object_class->finalize = totem_media_player_keys_plugin_finalize;
-}
-
-static void
-totem_media_player_keys_plugin_class_finalize (TotemMediaPlayerKeysPluginClass *klass)
-{
-}
-
-
-static void
-peas_activatable_iface_init (PeasActivatableInterface *iface)
-{
-	iface->activate = impl_activate;
-	iface->deactivate = impl_deactivate;
 }
 
 static void
@@ -103,12 +79,6 @@ totem_media_player_keys_plugin_init (TotemMediaPlayerKeysPlugin *plugin)
 }
 
 static void
-totem_media_player_keys_plugin_finalize (GObject *object)
-{
-	G_OBJECT_CLASS (totem_media_player_keys_plugin_parent_class)->finalize (object);
-}
-
-static void
 on_media_player_key_pressed (DBusGProxy *proxy, const gchar *application, const gchar *key, TotemObject *totem)
 {
 	if (strcmp ("Totem", application) == 0) {
@@ -240,13 +210,3 @@ impl_deactivate	(PeasActivatable *plugin,
 	}
 }
 
-G_MODULE_EXPORT void
-peas_register_types (PeasObjectModule *module)
-{
-	totem_media_player_keys_plugin_register_type (G_TYPE_MODULE (module));
-
-	peas_object_module_register_extension_type (module,
-						    PEAS_TYPE_ACTIVATABLE,
-						    TOTEM_TYPE_MEDIA_PLAYER_KEYS_PLUGIN);
-}
-



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]