[totem] Port all the C plugins to libpeas 0.5.4



commit 3560fbf5541902f6343dbdf237b83bb19f161ec1
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Aug 6 16:39:51 2010 +0100

    Port all the C plugins to libpeas 0.5.4

 src/plugins/bemused/totem-bemused.c                |   15 +++++---
 .../brasero-disc-recorder/totem-disc-recorder.c    |   32 +++++++++++--------
 src/plugins/gromit/totem-gromit.c                  |   16 +++++-----
 src/plugins/lirc/totem-lirc.c                      |   15 +++++---
 .../media-player-keys/totem-media-player-keys.c    |   20 ++++++++---
 src/plugins/mythtv/totem-mythtv.c                  |   13 ++++---
 src/plugins/ontop/totem-ontop.c                    |   27 +++++++++-------
 src/plugins/properties/totem-movie-properties.c    |   17 ++++++---
 src/plugins/publish/totem-publish.c                |   12 +++++--
 src/plugins/screensaver/totem-screensaver.c        |   16 ++++++---
 src/plugins/screenshot/totem-screenshot-plugin.c   |   14 +++++---
 src/plugins/sidebar-test/totem-sidebar-test.c      |   18 ++++++----
 src/plugins/skipto/totem-skipto-plugin.c           |   30 +++++++++--------
 src/plugins/thumbnail/totem-thumbnail.c            |   33 +++++++++++---------
 src/plugins/youtube/totem-youtube.c                |   19 +++++++----
 15 files changed, 175 insertions(+), 122 deletions(-)
---
diff --git a/src/plugins/bemused/totem-bemused.c b/src/plugins/bemused/totem-bemused.c
index 61f8ec7..886aa50 100644
--- a/src/plugins/bemused/totem-bemused.c
+++ b/src/plugins/bemused/totem-bemused.c
@@ -682,6 +682,12 @@ sdp_svc_del (sdp_session_t *session)
 static void
 totem_bemused_plugin_class_init (TotemBemusedPluginClass *klass)
 {
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->set_property = set_property;
+	object_class->get_property = get_property;
+
+	g_object_class_override_property (object_class, PROP_OBJECT, "object");
 }
 
 static void
@@ -690,15 +696,13 @@ totem_bemused_plugin_init (TotemBemusedPlugin *plugin)
 }
 
 static void
-impl_activate (PeasActivatable *plugin,
-	       GObject *object)
+impl_activate (PeasActivatable *plugin)
 {
 	TotemBemusedPlugin *tp = TOTEM_BEMUSED_PLUGIN (plugin);
-	TotemObject *totem = TOTEM_OBJECT (object);
 	int fd, channel;
 	struct sockaddr_rc addr;
 
-	tp->totem = totem;
+	tp->totem = g_object_get_data (G_OBJECT (plugin), "object");
 
 	fd = socket (PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
 	if (fd < 0) {
@@ -757,8 +761,7 @@ impl_activate (PeasActivatable *plugin,
 }
 
 static void
-impl_deactivate (PeasActivatable *plugin,
-		 GObject *object)
+impl_deactivate (PeasActivatable *plugin)
 {
 	//FIXME
 }
diff --git a/src/plugins/brasero-disc-recorder/totem-disc-recorder.c b/src/plugins/brasero-disc-recorder/totem-disc-recorder.c
index 57b9aa7..a5afea2 100644
--- a/src/plugins/brasero-disc-recorder/totem-disc-recorder.c
+++ b/src/plugins/brasero-disc-recorder/totem-disc-recorder.c
@@ -366,10 +366,9 @@ totem_disc_recorder_file_opened (TotemObject *totem,
 }
 
 static void
-impl_activate (PeasActivatable *plugin, GObject *object)
+impl_activate (PeasActivatable *plugin)
 {
 	TotemDiscRecorderPlugin *pi = TOTEM_DISC_RECORDER_PLUGIN (plugin);
-	TotemObject *totem = TOTEM_OBJECT (object);
 	GtkUIManager *uimanager = NULL;
 	GtkAction *action;
 	char *path;
@@ -388,13 +387,13 @@ impl_activate (PeasActivatable *plugin, GObject *object)
 	g_free (path);
 #endif
 
-	pi->totem = totem;
+	pi->totem = g_object_get_data (G_OBJECT (plugin), "object");
 
-	g_signal_connect (totem,
+	g_signal_connect (pi->totem,
 			  "file-opened",
 			  G_CALLBACK (totem_disc_recorder_file_opened),
 			  plugin);
-	g_signal_connect (totem,
+	g_signal_connect (pi->totem,
 			  "file-closed",
 			  G_CALLBACK (totem_disc_recorder_file_closed),
 			  plugin);
@@ -407,7 +406,7 @@ impl_activate (PeasActivatable *plugin, GObject *object)
 				      G_N_ELEMENTS (totem_disc_recorder_plugin_actions),
 				      pi);
 
-	uimanager = totem_get_ui_manager (totem);
+	uimanager = totem_get_ui_manager (pi->totem);
 	gtk_ui_manager_insert_action_group (uimanager, pi->action_group, -1);
 	g_object_unref (pi->action_group);
 
@@ -458,7 +457,7 @@ impl_activate (PeasActivatable *plugin, GObject *object)
 			       GTK_UI_MANAGER_MENUITEM,
 			       TRUE);
 
-	if (!totem_is_paused (totem) && !totem_is_playing (totem)) {
+	if (!totem_is_paused (pi->totem) && !totem_is_playing (pi->totem)) {
 		action = gtk_action_group_get_action (pi->action_group, "VideoBurnToDisc");
 		gtk_action_set_visible (action, FALSE);
 		action = gtk_action_group_get_action (pi->action_group, "VideoDVDCopy");
@@ -468,25 +467,24 @@ impl_activate (PeasActivatable *plugin, GObject *object)
 	else {
 		char *mrl;
 
-		mrl = totem_get_current_mrl (totem);
-		totem_disc_recorder_file_opened (totem, mrl, pi);
+		mrl = totem_get_current_mrl (pi->totem);
+		totem_disc_recorder_file_opened (pi->totem, mrl, pi);
 		g_free (mrl);
 	}
 }
 
 static void
-impl_deactivate (PeasActivatable *plugin, GObject *object)
+impl_deactivate (PeasActivatable *plugin)
 {
 	TotemDiscRecorderPlugin *pi = TOTEM_DISC_RECORDER_PLUGIN (plugin);
-	TotemObject *totem = TOTEM_OBJECT (object);
 	GtkUIManager *uimanager = NULL;
 
 	pi->enabled = FALSE;
 
-	g_signal_handlers_disconnect_by_func (totem, totem_disc_recorder_file_opened, plugin);
-	g_signal_handlers_disconnect_by_func (totem, totem_disc_recorder_file_closed, plugin);
+	g_signal_handlers_disconnect_by_func (pi->totem, totem_disc_recorder_file_opened, plugin);
+	g_signal_handlers_disconnect_by_func (pi->totem, totem_disc_recorder_file_closed, plugin);
 
-	uimanager = totem_get_ui_manager (totem);
+	uimanager = totem_get_ui_manager (pi->totem);
 	gtk_ui_manager_remove_ui (uimanager, pi->ui_merge_id);
 	gtk_ui_manager_remove_action_group (uimanager, pi->action_group);
 
@@ -496,6 +494,12 @@ impl_deactivate (PeasActivatable *plugin, GObject *object)
 static void
 totem_disc_recorder_plugin_class_init (TotemDiscRecorderPluginClass *klass)
 {
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->set_property = set_property;
+	object_class->get_property = get_property;
+
+	g_object_class_override_property (object_class, PROP_OBJECT, "object");
 }
 
 static void
diff --git a/src/plugins/gromit/totem-gromit.c b/src/plugins/gromit/totem-gromit.c
index 52df53f..d7afa6e 100644
--- a/src/plugins/gromit/totem-gromit.c
+++ b/src/plugins/gromit/totem-gromit.c
@@ -105,7 +105,11 @@ totem_gromit_plugin_class_init (TotemGromitPluginClass *klass)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
+	object_class->set_property = set_property;
+	object_class->get_property = get_property;
 	object_class->finalize = totem_gromit_plugin_finalize;
+
+	g_object_class_override_property (object_class, PROP_OBJECT, "object");
 }
 
 static void
@@ -254,11 +258,9 @@ on_window_key_press_event (GtkWidget *window, GdkEventKey *event, TotemGromitPlu
 }
 
 static void
-impl_activate (PeasActivatable *plugin,
-	       GObject *object)
+impl_activate (PeasActivatable *plugin)
 {
 	TotemGromitPlugin *pi = TOTEM_GROMIT_PLUGIN (plugin);
-	TotemObject *totem = TOTEM_OBJECT (object);
 	GtkWindow *window;
 
 	if (!totem_gromit_available (pi)) {
@@ -271,22 +273,20 @@ impl_activate (PeasActivatable *plugin,
 #endif
 	}
 
-	window = totem_get_main_window (totem);
+	window = totem_get_main_window (g_object_get_data (G_OBJECT (plugin), "object"));
 	pi->handler_id = g_signal_connect (G_OBJECT(window), "key-press-event", 
 			G_CALLBACK (on_window_key_press_event), plugin);
 	g_object_unref (window);
 }
 
 static void
-impl_deactivate	(PeasActivatable *plugin,
-		 GObject *object)
+impl_deactivate (PeasActivatable *plugin)
 {
 	TotemGromitPlugin *pi = TOTEM_GROMIT_PLUGIN (plugin);
-	TotemObject *totem = TOTEM_OBJECT (object);
 	GtkWindow *window;
 
 	if (pi->handler_id != 0) {
-		window = totem_get_main_window (totem);
+		window = totem_get_main_window (g_object_get_data (G_OBJECT (plugin), "object"));
 		g_signal_handler_disconnect (G_OBJECT(window), pi->handler_id);
 		pi->handler_id = 0;
 		g_object_unref (window);
diff --git a/src/plugins/lirc/totem-lirc.c b/src/plugins/lirc/totem-lirc.c
index c348927..08d6dde 100644
--- a/src/plugins/lirc/totem-lirc.c
+++ b/src/plugins/lirc/totem-lirc.c
@@ -103,6 +103,12 @@ TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_LIRC_PLUGIN, TotemLircPlugin, totem_lirc_plugin
 static void
 totem_lirc_plugin_class_init (TotemLircPluginClass *klass)
 {
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->set_property = set_property;
+	object_class->get_property = get_property;
+
+	g_object_class_override_property (object_class, PROP_OBJECT, "object");
 }
 
 static void
@@ -246,15 +252,13 @@ totem_lirc_read_code (GIOChannel *source, GIOCondition condition, TotemLircPlugi
 }
 
 static void
-impl_activate (PeasActivatable *plugin,
-	       GObject *object)
+impl_activate (PeasActivatable *plugin)
 {
 	TotemLircPlugin *pi = TOTEM_LIRC_PLUGIN (plugin);
-	TotemObject *totem = TOTEM_OBJECT (object);
 	char *path;
 	int fd;
 
-	pi->totem = g_object_ref (totem);
+	pi->totem = g_object_ref (g_object_get_data (G_OBJECT (plugin), "object"));
 
 	fd = lirc_init ((char*) "Totem", 0);
 	if (fd < 0) {
@@ -291,8 +295,7 @@ impl_activate (PeasActivatable *plugin,
 }
 
 static void
-impl_deactivate (PeasActivatable *plugin,
-		 GObject *object)
+impl_deactivate (PeasActivatable *plugin)
 {
 	TotemLircPlugin *pi = TOTEM_LIRC_PLUGIN (plugin);
 	GError *error = NULL;
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 273eeab..a38aa61 100644
--- a/src/plugins/media-player-keys/totem-media-player-keys.c
+++ b/src/plugins/media-player-keys/totem-media-player-keys.c
@@ -71,6 +71,12 @@ TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_MEDIA_PLAYER_KEYS_PLUGIN,
 static void
 totem_media_player_keys_plugin_class_init (TotemMediaPlayerKeysPluginClass *klass)
 {
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->set_property = set_property;
+	object_class->get_property = get_property;
+
+	g_object_class_override_property (object_class, PROP_OBJECT, "object");
 }
 
 static void
@@ -114,11 +120,10 @@ proxy_destroy (DBusGProxy *proxy,
 }
 
 static void
-impl_activate (PeasActivatable *plugin,
-	       GObject *object)
+impl_activate (PeasActivatable *plugin)
 {
 	TotemMediaPlayerKeysPlugin *pi = TOTEM_MEDIA_PLAYER_KEYS_PLUGIN (plugin);
-	TotemObject *totem = TOTEM_OBJECT (object);
+	TotemObject *totem;
 	DBusGConnection *connection;
 	GError *err = NULL;
 	GtkWindow *window;
@@ -169,6 +174,8 @@ impl_activate (PeasActivatable *plugin,
 			   G_TYPE_STRING, "Totem", G_TYPE_UINT, 0, G_TYPE_INVALID,
 			   G_TYPE_INVALID);
 
+	totem = g_object_get_data (G_OBJECT (plugin), "object");
+
 	dbus_g_object_register_marshaller (totem_marshal_VOID__STRING_STRING,
 			G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID);
 	dbus_g_proxy_add_signal (pi->media_player_keys_proxy, "MediaPlayerKeyPressed",
@@ -184,11 +191,9 @@ impl_activate (PeasActivatable *plugin,
 }
 
 static void
-impl_deactivate	(PeasActivatable *plugin,
-		 GObject *object)
+impl_deactivate (PeasActivatable *plugin)
 {
 	TotemMediaPlayerKeysPlugin *pi = TOTEM_MEDIA_PLAYER_KEYS_PLUGIN (plugin);
-	TotemObject *totem = TOTEM_OBJECT (object);
 	GtkWindow *window;
 
 	if (pi->media_player_keys_proxy != NULL) {
@@ -200,6 +205,9 @@ impl_deactivate	(PeasActivatable *plugin,
 	}
 
 	if (pi->handler_id != 0) {
+		TotemObject *totem;
+
+		totem = g_object_get_data (G_OBJECT (plugin), "object");
 		window = totem_get_main_window (totem);
 		if (window == NULL)
 			return;
diff --git a/src/plugins/mythtv/totem-mythtv.c b/src/plugins/mythtv/totem-mythtv.c
index 73de0ec..0fde2cf 100644
--- a/src/plugins/mythtv/totem-mythtv.c
+++ b/src/plugins/mythtv/totem-mythtv.c
@@ -340,7 +340,11 @@ totem_mythtv_plugin_class_init (TotemMythtvPluginClass *klass)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
+	object_class->set_property = set_property;
+	object_class->get_property = get_property;
 	object_class->finalize = totem_mythtv_plugin_finalize;
+
+	g_object_class_override_property (object_class, PROP_OBJECT, "object");
 }
 
 static void
@@ -503,13 +507,11 @@ add_sidebar (TotemMythtvPlugin *tm, const char *name, const char *label)
 }
 
 static void
-impl_activate (PeasActivatable *plugin,
-	       GObject *object)
+impl_activate (PeasActivatable *plugin)
 {
 	TotemMythtvPlugin *tm = TOTEM_MYTHTV_PLUGIN(plugin);
-	TotemObject *totem = TOTEM_OBJECT (object);
 
-	tm->totem = g_object_ref (totem);
+	tm->totem = g_object_ref (g_object_get_data (G_OBJECT (plugin), "object"));
 
 	tm->sidebar_recordings = add_sidebar (tm, "mythtv-recordings", _("MythTV Recordings"));
 	tm->sidebar_livetv = add_sidebar (tm, "mythtv-livetv", _("MythTV LiveTV"));
@@ -526,8 +528,7 @@ impl_activate (PeasActivatable *plugin,
 }
 
 static void
-impl_deactivate	(PeasActivatable *plugin,
-		 GObject *object)
+impl_deactivate	(PeasActivatable *plugin)
 {
 	TotemMythtvPlugin *tm = TOTEM_MYTHTV_PLUGIN(plugin);
 
diff --git a/src/plugins/ontop/totem-ontop.c b/src/plugins/ontop/totem-ontop.c
index c62e169..2d4929d 100644
--- a/src/plugins/ontop/totem-ontop.c
+++ b/src/plugins/ontop/totem-ontop.c
@@ -72,7 +72,14 @@ TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_ONTOP_PLUGIN, TotemOntopPlugin, totem_ontop_plu
 static void
 totem_ontop_plugin_class_init (TotemOntopPluginClass *klass)
 {
-	g_type_class_add_private (klass, sizeof (TotemOntopPluginPrivate));
+       GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+       object_class->set_property = set_property;
+       object_class->get_property = get_property;
+
+       g_object_class_override_property (object_class, PROP_OBJECT, "object");
+
+       g_type_class_add_private (klass, sizeof (TotemOntopPluginPrivate));
 }
 
 static void
@@ -109,17 +116,15 @@ property_notify_cb (TotemObject *totem,
 }
 
 static void
-impl_activate (PeasActivatable *plugin,
-	       GObject *object)
+impl_activate (PeasActivatable *plugin)
 {
 	TotemOntopPlugin *pi = TOTEM_ONTOP_PLUGIN (plugin);
-	TotemObject *totem = TOTEM_OBJECT (object);
 
-	pi->priv->window = totem_get_main_window (totem);
-	pi->priv->bvw = BACON_VIDEO_WIDGET (totem_get_video_widget (totem));
-	pi->priv->totem = totem;
+	pi->priv->totem = g_object_get_data (G_OBJECT (plugin), "object");
+	pi->priv->window = totem_get_main_window (pi->priv->totem);
+	pi->priv->bvw = BACON_VIDEO_WIDGET (totem_get_video_widget (pi->priv->totem));
 
-	pi->priv->handler_id = g_signal_connect (G_OBJECT (totem),
+	pi->priv->handler_id = g_signal_connect (G_OBJECT (pi->priv->totem),
 					   "notify::playing",
 					   G_CALLBACK (property_notify_cb),
 					   pi);
@@ -132,13 +137,11 @@ impl_activate (PeasActivatable *plugin,
 }
 
 static void
-impl_deactivate (PeasActivatable *plugin,
-		 GObject *object)
+impl_deactivate (PeasActivatable *plugin)
 {
 	TotemOntopPlugin *pi = TOTEM_ONTOP_PLUGIN (plugin);
-	TotemObject *totem = TOTEM_OBJECT (object);
 
-	g_signal_handler_disconnect (G_OBJECT (totem), pi->priv->handler_id);
+	g_signal_handler_disconnect (G_OBJECT (pi->priv->totem), pi->priv->handler_id);
 	g_signal_handler_disconnect (G_OBJECT (pi->priv->bvw), pi->priv->handler_id_metadata);
 
 	g_object_unref (pi->priv->bvw);
diff --git a/src/plugins/properties/totem-movie-properties.c b/src/plugins/properties/totem-movie-properties.c
index ed678a4..334b390 100644
--- a/src/plugins/properties/totem-movie-properties.c
+++ b/src/plugins/properties/totem-movie-properties.c
@@ -69,6 +69,12 @@ TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_MOVIE_PROPERTIES_PLUGIN,
 static void
 totem_movie_properties_plugin_class_init (TotemMoviePropertiesPluginClass *klass)
 {
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->set_property = set_property;
+	object_class->get_property = get_property;
+
+	g_object_class_override_property (object_class, PROP_OBJECT, "object");
 }
 
 static void
@@ -133,14 +139,13 @@ totem_movie_properties_plugin_metadata_updated (TotemObject *totem,
 }
 
 static void
-impl_activate (PeasActivatable *plugin,
-	       GObject *object)
+impl_activate (PeasActivatable *plugin)
 {
 	TotemMoviePropertiesPlugin *pi;
 	TotemObject *totem;
 
 	pi = TOTEM_MOVIE_PROPERTIES_PLUGIN (plugin);
-	totem = TOTEM_OBJECT (object);
+	totem = g_object_get_data (G_OBJECT (plugin), "object");
 
 	pi->props = bacon_video_widget_properties_new ();
 	gtk_widget_show (pi->props);
@@ -169,13 +174,13 @@ impl_activate (PeasActivatable *plugin,
 }
 
 static void
-impl_deactivate	(PeasActivatable *plugin,
-		 GObject *object)
+impl_deactivate (PeasActivatable *plugin)
 {
 	TotemMoviePropertiesPlugin *pi;
-	TotemObject *totem = TOTEM_OBJECT (object);
+	TotemObject *totem;
 
 	pi = TOTEM_MOVIE_PROPERTIES_PLUGIN (plugin);
+	totem = g_object_get_data (G_OBJECT (plugin), "object");
 
 	g_signal_handler_disconnect (G_OBJECT (totem), pi->handler_id_stream_length);
 	g_signal_handlers_disconnect_by_func (G_OBJECT (totem),
diff --git a/src/plugins/publish/totem-publish.c b/src/plugins/publish/totem-publish.c
index d08bc10..3ae0612 100644
--- a/src/plugins/publish/totem-publish.c
+++ b/src/plugins/publish/totem-publish.c
@@ -521,10 +521,9 @@ totem_publish_plugin_create_neigbours_page (TotemPublishPlugin *self, GtkBuilder
 }
 
 static void
-impl_activate (PeasActivatable *plugin, GObject *object)
+impl_activate (PeasActivatable *plugin)
 {
 	TotemPublishPlugin *self = TOTEM_PUBLISH_PLUGIN (plugin);
-	TotemObject *totem = TOTEM_OBJECT (object);
 	EpcProtocol protocol = EPC_PROTOCOL_HTTPS;
 	GtkWindow *window;
 	GtkBuilder *builder;
@@ -540,7 +539,7 @@ impl_activate (PeasActivatable *plugin, GObject *object)
 
 	G_LOCK (totem_publish_plugin_lock);
 
-	self->totem = g_object_ref (totem);
+	self->totem = g_object_ref (g_object_get_data (G_OBJECT (plugin), "object"));
 
 	window = totem_get_main_window (self->totem);
 	builder = totem_plugin_load_interface ("publish", "publish-plugin.ui", TRUE, window, self);
@@ -625,7 +624,7 @@ impl_activate (PeasActivatable *plugin, GObject *object)
 }
 
 static void
-impl_deactivate (PeasActivatable *plugin, GObject *totem)
+impl_deactivate (PeasActivatable *plugin)
 {
 	TotemPublishPlugin *self = TOTEM_PUBLISH_PLUGIN (plugin);
 	TotemPlaylist *playlist = NULL;
@@ -743,6 +742,11 @@ static void
 totem_publish_plugin_class_init (TotemPublishPluginClass *klass)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->set_property = set_property;
+	object_class->get_property = get_property;
 	object_class->dispose = totem_publish_plugin_dispose;
+
+	g_object_class_override_property (object_class, PROP_OBJECT, "object");
 }
 
diff --git a/src/plugins/screensaver/totem-screensaver.c b/src/plugins/screensaver/totem-screensaver.c
index 2935a03..df20851 100644
--- a/src/plugins/screensaver/totem-screensaver.c
+++ b/src/plugins/screensaver/totem-screensaver.c
@@ -79,7 +79,11 @@ totem_screensaver_plugin_class_init (TotemScreensaverPluginClass *klass)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
+	object_class->set_property = set_property;
+	object_class->get_property = get_property;
 	object_class->finalize = totem_screensaver_plugin_finalize;
+
+	g_object_class_override_property (object_class, PROP_OBJECT, "object");
 }
 
 static void
@@ -149,13 +153,13 @@ lock_screensaver_on_audio_changed_cb (GConfClient *client, guint cnxn_id,
 }
 
 static void
-impl_activate (PeasActivatable *plugin,
-	       GObject *object)
+impl_activate (PeasActivatable *plugin)
 {
 	TotemScreensaverPlugin *pi = TOTEM_SCREENSAVER_PLUGIN (plugin);
-	TotemObject *totem = TOTEM_OBJECT (object);
+	TotemObject *totem;
 	GConfClient *gc;
 
+	totem = g_object_get_data (G_OBJECT (plugin), "object");
 	pi->bvw = BACON_VIDEO_WIDGET (totem_get_video_widget (totem));
 
 	gc = gconf_client_get_default ();
@@ -182,11 +186,9 @@ impl_activate (PeasActivatable *plugin,
 }
 
 static void
-impl_deactivate	(PeasActivatable *plugin,
-		 GObject *object)
+impl_deactivate	(PeasActivatable *plugin)
 {
 	TotemScreensaverPlugin *pi = TOTEM_SCREENSAVER_PLUGIN (plugin);
-	TotemObject *totem = TOTEM_OBJECT (object);
 	GConfClient *gc;
 
 	gc = gconf_client_get_default ();
@@ -194,6 +196,8 @@ impl_deactivate	(PeasActivatable *plugin,
 	g_object_unref (gc);
 
 	if (pi->handler_id_playing != 0) {
+		TotemObject *totem;
+		totem = g_object_get_data (G_OBJECT (plugin), "object");
 		g_signal_handler_disconnect (G_OBJECT (totem), pi->handler_id_playing);
 		pi->handler_id_playing = 0;
 	}
diff --git a/src/plugins/screenshot/totem-screenshot-plugin.c b/src/plugins/screenshot/totem-screenshot-plugin.c
index 7d2e999..fa596b6 100644
--- a/src/plugins/screenshot/totem-screenshot-plugin.c
+++ b/src/plugins/screenshot/totem-screenshot-plugin.c
@@ -67,6 +67,12 @@ TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_SCREENSHOT_PLUGIN,
 static void
 totem_screenshot_plugin_class_init (TotemScreenshotPluginClass *klass)
 {
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->set_property = set_property;
+	object_class->get_property = get_property;
+
+	g_object_class_override_property (object_class, PROP_OBJECT, "object");
 	g_type_class_add_private (klass, sizeof (TotemScreenshotPluginPrivate));
 }
 
@@ -195,8 +201,7 @@ disable_save_to_disk_changed_cb (GConfClient *client, guint connection_id, GConf
 }
 
 static void
-impl_activate (PeasActivatable *plugin,
-	       GObject *totem)
+impl_activate (PeasActivatable *plugin)
 {
 	GtkWindow *window;
 	GtkUIManager *manager;
@@ -208,7 +213,7 @@ impl_activate (PeasActivatable *plugin,
 		{ "take-gallery", NULL, N_("Create Screenshot _Gallery..."), NULL, N_("Create a gallery of screenshots"), G_CALLBACK (take_gallery_action_cb) }
 	};
 
-	priv->totem = TOTEM_OBJECT (totem);
+	priv->totem = g_object_get_data (G_OBJECT (plugin), "object");
 	priv->bvw = BACON_VIDEO_WIDGET (totem_get_video_widget (priv->totem));
 	priv->got_metadata_signal = g_signal_connect (G_OBJECT (priv->bvw),
 						      "got-metadata",
@@ -262,8 +267,7 @@ impl_activate (PeasActivatable *plugin,
 }
 
 static void
-impl_deactivate (PeasActivatable *plugin,
-		 GObject *totem)
+impl_deactivate (PeasActivatable *plugin)
 {
 	TotemScreenshotPluginPrivate *priv = TOTEM_SCREENSHOT_PLUGIN (plugin)->priv;
 	GtkWindow *window;
diff --git a/src/plugins/sidebar-test/totem-sidebar-test.c b/src/plugins/sidebar-test/totem-sidebar-test.c
index dd6c57f..90bc9a9 100644
--- a/src/plugins/sidebar-test/totem-sidebar-test.c
+++ b/src/plugins/sidebar-test/totem-sidebar-test.c
@@ -61,6 +61,12 @@ TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_SIDEBAR_TEST_PLUGIN, TotemSidebarTestPlugin, to
 static void
 totem_sidebar_test_plugin_class_init (TotemSidebarTestPluginClass *klass)
 {
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->set_property = set_property;
+	object_class->get_property = get_property;
+
+	g_object_class_override_property (object_class, PROP_OBJECT, "object");
 }
 
 static void
@@ -69,15 +75,13 @@ totem_sidebar_test_plugin_init (TotemSidebarTestPlugin *plugin)
 }
 
 static void
-impl_activate (PeasActivatable *plugin,
-	       GObject *object)
+impl_activate (PeasActivatable *plugin)
 {
 	GtkWidget *label;
-	TotemObject *totem = TOTEM_OBJECT (object);
 
 	label = gtk_label_new ("This is a test sidebar main widget");
 	gtk_widget_show (label);
-	totem_add_sidebar_page (totem,
+	totem_add_sidebar_page (g_object_get_data (G_OBJECT (plugin), "object"),
 				"sidebar-test",
 				"Sidebar Test",
 				label);
@@ -85,11 +89,11 @@ impl_activate (PeasActivatable *plugin,
 }
 
 static void
-impl_deactivate	(PeasActivatable *plugin,
-		 GObject *object)
+impl_deactivate (PeasActivatable *plugin)
 {
-	TotemObject *totem = TOTEM_OBJECT (object);
+	TotemObject *totem;
 
+	totem = g_object_get_data (G_OBJECT (plugin), "object");
 	totem_remove_sidebar_page (totem, "sidebar-test");
 	g_message ("Just removed a test sidebar");
 }
diff --git a/src/plugins/skipto/totem-skipto-plugin.c b/src/plugins/skipto/totem-skipto-plugin.c
index d167161..80252d7 100644
--- a/src/plugins/skipto/totem-skipto-plugin.c
+++ b/src/plugins/skipto/totem-skipto-plugin.c
@@ -58,9 +58,12 @@ totem_skipto_plugin_class_init (TotemSkiptoPluginClass *klass)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-	g_type_class_add_private (klass, sizeof (TotemSkiptoPluginPrivate));
-
+	object_class->set_property = set_property;
+	object_class->get_property = get_property;
 	object_class->finalize = totem_skipto_plugin_finalize;
+
+	g_type_class_add_private (klass, sizeof (TotemSkiptoPluginPrivate));
+	g_object_class_override_property (object_class, PROP_OBJECT, "object");
 }
 static void
 totem_skipto_plugin_init (TotemSkiptoPlugin *plugin)
@@ -195,31 +198,29 @@ on_window_key_press_event (GtkWidget *window, GdkEventKey *event, TotemSkiptoPlu
 }
 
 static void
-impl_activate (PeasActivatable *plugin,
-	       GObject *object)
+impl_activate (PeasActivatable *plugin)
 {
 	GtkWindow *window;
 	GtkUIManager *manager;
 	TotemSkiptoPlugin *pi = TOTEM_SKIPTO_PLUGIN (plugin);
 	TotemSkiptoPluginPrivate *priv = pi->priv;
-	TotemObject *totem = TOTEM_OBJECT (object);
 
 	const GtkActionEntry menu_entries[] = {
 		{ "skip-to", GTK_STOCK_JUMP_TO, N_("_Skip to..."), "<Control>K", N_("Skip to a specific time"), G_CALLBACK (skip_to_action_callback) }
 	};
 
-	pi->totem = totem;
-	priv->handler_id_stream_length = g_signal_connect (G_OBJECT (totem),
+	pi->totem = g_object_get_data (G_OBJECT (plugin), "object");
+	priv->handler_id_stream_length = g_signal_connect (G_OBJECT (pi->totem),
 				"notify::stream-length",
 				G_CALLBACK (property_notify_cb),
 				pi);
-	priv->handler_id_seekable = g_signal_connect (G_OBJECT (totem),
+	priv->handler_id_seekable = g_signal_connect (G_OBJECT (pi->totem),
 				"notify::seekable",
 				G_CALLBACK (property_notify_cb),
 				pi);
 
 	/* Key press handler */
-	window = totem_get_main_window (totem);
+	window = totem_get_main_window (pi->totem);
 	priv->handler_id_key_press = g_signal_connect (G_OBJECT(window),
 				"key-press-event",
 				G_CALLBACK (on_window_key_press_event),
@@ -232,7 +233,7 @@ impl_activate (PeasActivatable *plugin,
 	gtk_action_group_add_actions (priv->action_group, menu_entries,
 				G_N_ELEMENTS (menu_entries), pi);
 
-	manager = totem_get_ui_manager (totem);
+	manager = totem_get_ui_manager (pi->totem);
 
 	gtk_ui_manager_insert_action_group (manager, priv->action_group, -1);
 	g_object_unref (priv->action_group);
@@ -242,18 +243,19 @@ impl_activate (PeasActivatable *plugin,
 			       "/ui/tmw-menubar/go/skip-forward", "skip-to",
 			       "skip-to", GTK_UI_MANAGER_AUTO, TRUE);
 
-	totem_skipto_update_from_state (totem, pi);
+	totem_skipto_update_from_state (pi->totem, pi);
 }
 
 static void
-impl_deactivate	(PeasActivatable *plugin,
-		 GObject *object)
+impl_deactivate (PeasActivatable *plugin)
 {
 	GtkWindow *window;
 	GtkUIManager *manager;
-	TotemObject *totem = TOTEM_OBJECT (object);
+	TotemObject *totem;
 	TotemSkiptoPluginPrivate *priv = TOTEM_SKIPTO_PLUGIN (plugin)->priv;
 
+	totem = g_object_get_data (G_OBJECT (plugin), "object");
+
 	g_signal_handler_disconnect (G_OBJECT (totem),
 				     priv->handler_id_stream_length);
 	g_signal_handler_disconnect (G_OBJECT (totem),
diff --git a/src/plugins/thumbnail/totem-thumbnail.c b/src/plugins/thumbnail/totem-thumbnail.c
index 7d244c4..afbe58a 100644
--- a/src/plugins/thumbnail/totem-thumbnail.c
+++ b/src/plugins/thumbnail/totem-thumbnail.c
@@ -72,6 +72,13 @@ TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_THUMBNAIL_PLUGIN, TotemThumbnailPlugin, totem_t
 static void
 totem_thumbnail_plugin_class_init (TotemThumbnailPluginClass *klass)
 {
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->set_property = set_property;
+	object_class->get_property = get_property;
+
+	g_object_class_override_property (object_class, PROP_OBJECT, "object");
+
 	g_type_class_add_private (klass, sizeof (TotemThumbnailPluginPrivate));
 }
 
@@ -169,42 +176,38 @@ file_closed_cb (TotemObject *totem,
 }
 
 static void
-impl_activate (PeasActivatable *plugin,
-	       GObject *object)
+impl_activate (PeasActivatable *plugin)
 {
 	TotemThumbnailPlugin *pi = TOTEM_THUMBNAIL_PLUGIN (plugin);
-	TotemObject *totem = TOTEM_OBJECT (object);
 	char *mrl;
 
-	pi->priv->window = totem_get_main_window (totem);
-	pi->priv->totem = totem;
+	pi->priv->totem = g_object_get_data (G_OBJECT (plugin), "object");
+	pi->priv->window = totem_get_main_window (pi->priv->totem);
 
-	pi->priv->file_opened_handler_id = g_signal_connect (G_OBJECT (totem),
+	pi->priv->file_opened_handler_id = g_signal_connect (G_OBJECT (pi->priv->totem),
 							     "file-opened",
 							     G_CALLBACK (file_opened_cb),
 							     pi);
-	pi->priv->file_closed_handler_id = g_signal_connect (G_OBJECT (totem),
+	pi->priv->file_closed_handler_id = g_signal_connect (G_OBJECT (pi->priv->totem),
 							     "file-closed",
 							     G_CALLBACK (file_closed_cb),
 							     pi);
 
-	g_object_get (totem, "current-mrl", &mrl, NULL);
+	g_object_get (pi->priv->totem, "current-mrl", &mrl, NULL);
 
-	update_from_state (pi->priv, totem, mrl);
+	update_from_state (pi->priv, pi->priv->totem, mrl);
 
 	g_free (mrl);
 }
 
 static void
-impl_deactivate (PeasActivatable *plugin,
-		 GObject *object)
+impl_deactivate (PeasActivatable *plugin)
 {
 	TotemThumbnailPlugin *pi = TOTEM_THUMBNAIL_PLUGIN (plugin);
-	TotemObject *totem = TOTEM_OBJECT (object);
 
-	g_signal_handler_disconnect (totem, pi->priv->file_opened_handler_id);
-	g_signal_handler_disconnect (totem, pi->priv->file_closed_handler_id);
+	g_signal_handler_disconnect (pi->priv->totem, pi->priv->file_opened_handler_id);
+	g_signal_handler_disconnect (pi->priv->totem, pi->priv->file_closed_handler_id);
 
-	set_icon_to_default (totem);
+	set_icon_to_default (pi->priv->totem);
 }
 
diff --git a/src/plugins/youtube/totem-youtube.c b/src/plugins/youtube/totem-youtube.c
index 6882bda..bb653dd 100644
--- a/src/plugins/youtube/totem-youtube.c
+++ b/src/plugins/youtube/totem-youtube.c
@@ -108,6 +108,12 @@ TOTEM_PLUGIN_REGISTER (TOTEM_TYPE_YOUTUBE_PLUGIN, TotemYouTubePlugin, totem_yout
 static void
 totem_youtube_plugin_class_init (TotemYouTubePluginClass *klass)
 {
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->set_property = set_property;
+	object_class->get_property = get_property;
+
+	g_object_class_override_property (object_class, PROP_OBJECT, "object");
 }
 
 static void
@@ -328,19 +334,18 @@ set_up_tree_view (TotemYouTubePlugin *self, GtkBuilder *builder, guint key)
 }
 
 static void
-impl_activate (PeasActivatable *plugin, GObject *object)
+impl_activate (PeasActivatable *plugin)
 {
 	TotemYouTubePlugin *self = TOTEM_YOUTUBE_PLUGIN (plugin);
-	TotemObject *totem = TOTEM_OBJECT (object);
 	GtkWindow *main_window;
 	GtkBuilder *builder;
 	guint i;
 
-	self->totem = g_object_ref (totem);
-	self->bvw = BACON_VIDEO_WIDGET (totem_get_video_widget (totem));
+	self->totem = g_object_ref (g_object_get_data (G_OBJECT (plugin), "object"));
+	self->bvw = BACON_VIDEO_WIDGET (totem_get_video_widget (self->totem));
 
 	/* Set up the interface */
-	main_window = totem_get_main_window (totem);
+	main_window = totem_get_main_window (self->totem);
 	builder = totem_plugin_load_interface ("youtube", "youtube.ui", TRUE, main_window, self);
 	g_object_unref (main_window);
 
@@ -357,12 +362,12 @@ impl_activate (PeasActivatable *plugin, GObject *object)
 	gtk_widget_show_all (self->vbox);
 
 	/* Add the sidebar page */
-	totem_add_sidebar_page (totem, "youtube", _("YouTube"), self->vbox);
+	totem_add_sidebar_page (self->totem, "youtube", _("YouTube"), self->vbox);
 	g_object_unref (builder);
 }
 
 static void
-impl_deactivate (PeasActivatable *plugin, GObject *totem)
+impl_deactivate (PeasActivatable *plugin)
 {
 	guint i;
 	TotemYouTubePlugin *self = TOTEM_YOUTUBE_PLUGIN (plugin);



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