[totem] Move plugin struct and init functions to totem-plugin.h



commit 0377eca3c0548121bee91b16c7c50a2f8d269b5e
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sun Sep 5 02:26:36 2010 +0100

    Move plugin struct and init functions to totem-plugin.h
    
    If all plugins are forced to use private data structs correctly, their
    instance structs and init functions become very standard, so can be moved
    into _TOTEM_PLUGIN_REGISTER to save code.

 src/plugins/bemused/totem-bemused.c                |  121 ++++-----
 .../brasero-disc-recorder/totem-disc-recorder.c    |  131 ++++-----
 src/plugins/chapters/totem-chapters.c              |  104 +++-----
 src/plugins/galago/totem-galago.c                  |   40 +--
 src/plugins/gromit/totem-gromit.c                  |   75 ++----
 src/plugins/lirc/totem-lirc.c                      |   63 ++---
 .../media-player-keys/totem-media-player-keys.c    |   58 ++---
 src/plugins/mythtv/totem-mythtv.c                  |  113 ++++-----
 src/plugins/ontop/totem-ontop.c                    |   25 --
 src/plugins/properties/totem-movie-properties.c    |   49 +---
 src/plugins/publish/totem-publish.c                |  215 +++++++--------
 src/plugins/screensaver/totem-screensaver.c        |   72 ++---
 src/plugins/screenshot/totem-gallery.c             |    2 +-
 src/plugins/screenshot/totem-gallery.h             |    3 +-
 src/plugins/screenshot/totem-screenshot-plugin.c   |   35 +--
 src/plugins/screenshot/totem-screenshot-plugin.h   |   14 -
 src/plugins/screenshot/totem-screenshot.c          |    2 +-
 src/plugins/screenshot/totem-screenshot.h          |    5 +-
 src/plugins/sidebar-test/totem-sidebar-test.c      |   23 +--
 src/plugins/skipto/totem-skipto-plugin.c           |   51 +---
 src/plugins/thumbnail/totem-thumbnail.c            |   27 --
 src/plugins/totem-plugin.h                         |   22 ++-
 src/plugins/tracker/totem-tracker.c                |   23 +--
 src/plugins/youtube/totem-youtube.c                |  283 ++++++++++----------
 24 files changed, 610 insertions(+), 946 deletions(-)
---
diff --git a/src/plugins/bemused/totem-bemused.c b/src/plugins/bemused/totem-bemused.c
index 7c720e6..e24f457 100644
--- a/src/plugins/bemused/totem-bemused.c
+++ b/src/plugins/bemused/totem-bemused.c
@@ -56,17 +56,14 @@
 #define TOTEM_IS_BEMUSED_PLUGIN_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), TOTEM_TYPE_BEMUSED_PLUGIN))
 #define TOTEM_BEMUSED_PLUGIN_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), TOTEM_TYPE_BEMUSED_PLUGIN, TotemBemusedPluginClass))
 
-typedef struct
-{
-	PeasExtensionBase parent;
-
+typedef struct {
 	TotemObject *totem;
 	BaconVideoWidget *bvw;
 	guint server_watch_id;
 	guint client_watch_id;
 	GIOChannel *server_iochan, *client_iochan;
 	sdp_session_t *sdp_session;
-} TotemBemusedPlugin;
+} TotemBemusedPluginPrivate;
 
 TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_BEMUSED_PLUGIN, TotemBemusedPlugin, totem_bemused_plugin)
 
@@ -146,11 +143,12 @@ read_filename (TotemBemusedPlugin *tp, GIOChannel *source)
 static void
 write_playlist (TotemBemusedPlugin *tp, GIOChannel *source)
 {
+	TotemBemusedPluginPrivate *priv = tp->priv;
 	char buf[11];
 	int playlist_pos, playlist_len, i;
 
-	playlist_pos = totem_get_playlist_pos (tp->totem);
-	playlist_len = totem_get_playlist_length (tp->totem);
+	playlist_pos = totem_get_playlist_pos (priv->totem);
+	playlist_len = totem_get_playlist_length (priv->totem);
 
 	strncpy(buf, "PLSTACK", strlen ("PLSTACK"));
 	if (playlist_len == 0) {
@@ -167,7 +165,7 @@ write_playlist (TotemBemusedPlugin *tp, GIOChannel *source)
 	for (i = 0; i < playlist_len; i++) {
 		char *title;
 
-		title = totem_get_title_at_playlist_pos (tp->totem, i);
+		title = totem_get_title_at_playlist_pos (priv->totem, i);
 		if (title == NULL) {
 			/* Translators: the parameter is a number used to identify this playlist entry */
 			title = g_strdup_printf (_("Untitled %d"), i);
@@ -188,7 +186,7 @@ write_current_volume (TotemBemusedPlugin *tp, GIOChannel *source)
 	char buf[8];
 
 	strncpy(buf, "GVOLACK", strlen ("GVOLACK"));
-	volume = bacon_video_widget_get_volume (tp->bvw);
+	volume = bacon_video_widget_get_volume (tp->priv->bvw);
 	if (volume >= 1.0)
 		buf[7] = (unsigned char) 255;
 	else
@@ -204,7 +202,7 @@ set_volume (TotemBemusedPlugin *tp, GIOChannel *source)
 
 	read_response (tp, source, &buf, 1);
 	volume = (double) buf / (double) 256;
-	bacon_video_widget_set_volume (tp->bvw, volume);
+	bacon_video_widget_set_volume (tp->priv->bvw, volume);
 }
 
 static void
@@ -225,7 +223,7 @@ set_setting (TotemBemusedPlugin *tp, GIOChannel *source, TotemRemoteSetting sett
 	char buf;
 
 	read_response (tp, source, &buf, 1);
-	totem_action_remote_set_setting (tp->totem, setting, buf != 0);
+	totem_action_remote_set_setting (tp->priv->totem, setting, buf != 0);
 }
 
 static void
@@ -240,7 +238,7 @@ seek_to_pos (TotemBemusedPlugin *tp, GIOChannel *source)
 	_time += buf[2] << 8;
 	_time += buf[3];
 
-	totem_action_seek_time (tp->totem, (gint64) _time * 1000, FALSE);
+	totem_action_seek_time (tp->priv->totem, (gint64) _time * 1000, FALSE);
 }
 
 static void
@@ -249,7 +247,7 @@ write_playlist_length (TotemBemusedPlugin *tp, GIOChannel *source)
 	char buf[2];
 	int len;
 
-	len = totem_get_playlist_length (tp->totem);
+	len = totem_get_playlist_length (tp->priv->totem);
 
 	buf[0] = (len >> 8) & 0xFF;
 	buf[1] = len & 0xFF;
@@ -343,6 +341,7 @@ write_detailed_file_info (TotemBemusedPlugin *tp, GIOChannel *source)
 static void
 write_song_info (TotemBemusedPlugin *tp, GIOChannel *source, gboolean send_null)
 {
+	TotemBemusedPluginPrivate *priv = tp->priv;
 	char *title;
 	char status;
 
@@ -352,22 +351,22 @@ write_song_info (TotemBemusedPlugin *tp, GIOChannel *source, gboolean send_null)
 		send_response_flush (tp, source, "INFOACK", strlen ("INFOACK"), FALSE);
 	else
 		send_response_flush (tp, source, "INF2ACK", strlen ("INF2ACK"), FALSE);
-	if (totem_is_playing (tp->totem) != FALSE)
+	if (totem_is_playing (priv->totem) != FALSE)
 		status = 1;
-	else if (totem_is_paused (tp->totem) != FALSE)
+	else if (totem_is_paused (priv->totem) != FALSE)
 		status = 2;
 	else
 		status = 0;
 
 	send_response_flush (tp, source, &status, 1, FALSE);
-	STUFF4((int) bacon_video_widget_get_stream_length (tp->bvw) / 1000);
-	STUFF4((int) bacon_video_widget_get_current_time (tp->bvw) / 1000);
-	status = totem_action_remote_get_setting (tp->totem, TOTEM_REMOTE_SETTING_SHUFFLE);
+	STUFF4((int) bacon_video_widget_get_stream_length (priv->bvw) / 1000);
+	STUFF4((int) bacon_video_widget_get_current_time (priv->bvw) / 1000);
+	status = totem_action_remote_get_setting (priv->totem, TOTEM_REMOTE_SETTING_SHUFFLE);
 	send_response_flush (tp, source, &status, 1, FALSE);
-	status = totem_action_remote_get_setting (tp->totem, TOTEM_REMOTE_SETTING_REPEAT);
+	status = totem_action_remote_get_setting (priv->totem, TOTEM_REMOTE_SETTING_REPEAT);
 	send_response_flush (tp, source, &status, 1, FALSE);
 
-	title = totem_get_short_title (tp->totem);
+	title = totem_get_short_title (priv->totem);
 	g_message ("written info for %s", title);
 	if (title == NULL) {
 		flush_response (tp, source);
@@ -389,7 +388,7 @@ set_playlist_at_pos (TotemBemusedPlugin *tp, GIOChannel *source)
 
 	read_response (tp, source, buf, 2);
 	idx = (buf[0] << 8) + buf[1];
-	totem_action_set_playlist_index (tp->totem, idx);
+	totem_action_set_playlist_index (tp->priv->totem, idx);
 }
 
 #if 0
@@ -437,6 +436,8 @@ endoflist:
 static void
 handle_command (TotemBemusedPlugin *tp, GIOChannel *source, const char *cmd)
 {
+	TotemBemusedPluginPrivate *priv = tp->priv;
+
 	g_message ("cmd: %s", cmd);
 
 	CMD_IS("CHCK") {
@@ -450,7 +451,7 @@ handle_command (TotemBemusedPlugin *tp, GIOChannel *source, const char *cmd)
 	} else CMD_IS("FADE") {
 		//stop
 	} else CMD_IS("FFWD") {
-		totem_action_remote (tp->totem, TOTEM_REMOTE_COMMAND_SEEK_FORWARD, NULL);
+		totem_action_remote (priv->totem, TOTEM_REMOTE_COMMAND_SEEK_FORWARD, NULL);
 	} else CMD_IS("FINF") {
 		write_detailed_file_info (tp, source);
 	} else CMD_IS("GVOL") {
@@ -464,9 +465,9 @@ handle_command (TotemBemusedPlugin *tp, GIOChannel *source, const char *cmd)
 	} else CMD_IS("LIST") {
 		write_directory_listing (tp, source, TRUE);
 	} else CMD_IS("NEXT") {
-		totem_action_remote (tp->totem, TOTEM_REMOTE_COMMAND_NEXT, NULL);
+		totem_action_remote (priv->totem, TOTEM_REMOTE_COMMAND_NEXT, NULL);
 	} else CMD_IS("PAUS") {
-		totem_action_remote (tp->totem, TOTEM_REMOTE_COMMAND_PAUSE, NULL);
+		totem_action_remote (priv->totem, TOTEM_REMOTE_COMMAND_PAUSE, NULL);
 	} else CMD_IS("PLAY") {
 		add_or_enqueue (tp, source, TOTEM_REMOTE_COMMAND_REPLACE);
 	} else CMD_IS("PLEN") {
@@ -474,19 +475,19 @@ handle_command (TotemBemusedPlugin *tp, GIOChannel *source, const char *cmd)
 	} else CMD_IS("PLST") {
 		write_playlist (tp, source);
 	} else CMD_IS("PREV") {
-		totem_action_remote (tp->totem, TOTEM_REMOTE_COMMAND_PREVIOUS, NULL);
+		totem_action_remote (priv->totem, TOTEM_REMOTE_COMMAND_PREVIOUS, NULL);
 	} else CMD_IS("REPT") {
 		set_setting (tp, source, TOTEM_REMOTE_SETTING_REPEAT);
 	} else CMD_IS("RMAL") {
-		totem_action_remote (tp->totem, TOTEM_REMOTE_COMMAND_REPLACE, NULL);
+		totem_action_remote (priv->totem, TOTEM_REMOTE_COMMAND_REPLACE, NULL);
 	} else CMD_IS("RWND") {
-		totem_action_remote (tp->totem, TOTEM_REMOTE_COMMAND_SEEK_BACKWARD, NULL);
+		totem_action_remote (priv->totem, TOTEM_REMOTE_COMMAND_SEEK_BACKWARD, NULL);
 	} else CMD_IS("SHFL") {
 		set_setting (tp, source, TOTEM_REMOTE_SETTING_SHUFFLE);
 	} else CMD_IS("SEEK") {
 		seek_to_pos (tp, source);
 	} else CMD_IS("SHUT") {
-		totem_action_remote (tp->totem, TOTEM_REMOTE_COMMAND_QUIT, NULL);
+		totem_action_remote (priv->totem, TOTEM_REMOTE_COMMAND_QUIT, NULL);
 	} else CMD_IS("STEN") {
 		//stop at end of track
 	} else CMD_IS("SLCT") {
@@ -494,7 +495,7 @@ handle_command (TotemBemusedPlugin *tp, GIOChannel *source, const char *cmd)
 	} else CMD_IS("STOP") {
 		//stop
 	} else CMD_IS("STRT") {
-		totem_action_remote (tp->totem, TOTEM_REMOTE_COMMAND_PLAY, NULL);
+		totem_action_remote (priv->totem, TOTEM_REMOTE_COMMAND_PLAY, NULL);
 	} else CMD_IS("VOLM") {
 		set_volume (tp, source);
 	} else CMD_IS("VERS") {
@@ -541,9 +542,9 @@ client_watch_func (GIOChannel *source, GIOCondition condition, gpointer data)
 }
 
 static gboolean
-server_watch_func (GIOChannel *source, GIOCondition condition, gpointer data)
+server_watch_func (GIOChannel *source, GIOCondition condition, TotemBemusedPlugin *tp)
 {
-	TotemBemusedPlugin *tp = (TotemBemusedPlugin *) data;
+	TotemBemusedPluginPrivate *priv = tp->priv;
 
 	g_message ("server_watch_func");
 
@@ -568,21 +569,21 @@ server_watch_func (GIOChannel *source, GIOCondition condition, gpointer data)
 			//FIXME check batostr(&ba) is our expected client
 			g_message ("connected from %s", batostr(&ba));
 
-			if (tp->bvw != NULL)
-				g_object_unref (G_OBJECT (tp->bvw));
-			tp->bvw = BACON_VIDEO_WIDGET (totem_get_video_widget (tp->totem));
+			if (priv->bvw != NULL)
+				g_object_unref (G_OBJECT (priv->bvw));
+			priv->bvw = BACON_VIDEO_WIDGET (totem_get_video_widget (priv->totem));
 
-			tp->client_iochan = g_io_channel_unix_new (client_fd);
-			g_io_channel_set_encoding (tp->client_iochan, NULL, NULL);
-			g_io_channel_set_buffered (tp->client_iochan, FALSE);
-			g_io_channel_set_flags (tp->client_iochan,
-						g_io_channel_get_flags (tp->client_iochan) | G_IO_FLAG_NONBLOCK,
+			priv->client_iochan = g_io_channel_unix_new (client_fd);
+			g_io_channel_set_encoding (priv->client_iochan, NULL, NULL);
+			g_io_channel_set_buffered (priv->client_iochan, FALSE);
+			g_io_channel_set_flags (priv->client_iochan,
+						g_io_channel_get_flags (priv->client_iochan) | G_IO_FLAG_NONBLOCK,
 						NULL);
-			tp->client_watch_id = g_io_add_watch (tp->client_iochan,
+			priv->client_watch_id = g_io_add_watch (priv->client_iochan,
 						       G_IO_IN | G_IO_PRI | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
 						       client_watch_func,
 						       tp);
-			g_io_channel_unref (tp->client_iochan);
+			g_io_channel_unref (priv->client_iochan);
 		}
 	}
 
@@ -673,31 +674,15 @@ sdp_svc_del (sdp_session_t *session)
 }
 
 /* Object functions */
-
-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
-totem_bemused_plugin_init (TotemBemusedPlugin *plugin)
-{
-}
-
 static void
 impl_activate (PeasActivatable *plugin)
 {
 	TotemBemusedPlugin *tp = TOTEM_BEMUSED_PLUGIN (plugin);
+	TotemBemusedPluginPrivate *priv = tp->priv;
 	int fd, channel;
 	struct sockaddr_rc addr;
 
-	tp->totem = g_object_get_data (G_OBJECT (plugin), "object");
+	priv->totem = g_object_get_data (G_OBJECT (plugin), "object");
 
 	fd = socket (PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
 	if (fd < 0) {
@@ -709,12 +694,12 @@ impl_activate (PeasActivatable *plugin)
 	g_message ("socket created");
 
 	channel = 1;
-	tp->sdp_session = sdp_svc_add_spp (channel,
+	priv->sdp_session = sdp_svc_add_spp (channel,
 					   BEMUSED_SVC_NAME,
 					   BEMUSED_SVC_DESC,
 					   BEMUSED_SVC_PROV,
 					   BEMUSED_SVC_UUID);
-	if (tp->sdp_session == NULL) {
+	if (priv->sdp_session == NULL) {
 		close (fd);
 		g_message ("registering service failed");
 		return;
@@ -726,7 +711,7 @@ impl_activate (PeasActivatable *plugin)
 
 	if (bind(fd, (struct sockaddr*) &addr, sizeof(addr)) < 0) {
 		//FIXME
-		sdp_svc_del (tp->sdp_session);
+		sdp_svc_del (priv->sdp_session);
 		g_message ("couldn't bind");
 		return;
 	}
@@ -736,19 +721,19 @@ impl_activate (PeasActivatable *plugin)
 	if (listen (fd, 10) < 0) {
 		//FIXME
 		g_message ("couldn't listen");
-		sdp_svc_del (tp->sdp_session);
+		sdp_svc_del (priv->sdp_session);
 		return;
 	}
 
 	g_message ("listen launched");
 
-	tp->server_iochan = g_io_channel_unix_new (fd);
-	g_io_channel_set_encoding (tp->server_iochan, NULL, NULL);
-	tp->server_watch_id = g_io_add_watch (tp->server_iochan,
+	priv->server_iochan = g_io_channel_unix_new (fd);
+	g_io_channel_set_encoding (priv->server_iochan, NULL, NULL);
+	priv->server_watch_id = g_io_add_watch (priv->server_iochan,
 					      G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
-					      server_watch_func,
+					      (GIOFunc) server_watch_func,
 					      plugin);
-	g_io_channel_unref (tp->server_iochan);
+	g_io_channel_unref (priv->server_iochan);
 
 	g_message ("io chan set");
 
diff --git a/src/plugins/brasero-disc-recorder/totem-disc-recorder.c b/src/plugins/brasero-disc-recorder/totem-disc-recorder.c
index 03dbc6f..ebd62e2 100644
--- a/src/plugins/brasero-disc-recorder/totem-disc-recorder.c
+++ b/src/plugins/brasero-disc-recorder/totem-disc-recorder.c
@@ -47,19 +47,14 @@
 #define TOTEM_IS_DISC_RECORDER_PLUGIN_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), TOTEM_TYPE_DISC_RECORDER_PLUGIN))
 #define TOTEM_DISC_RECORDER_PLUGIN_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), TOTEM_TYPE_DISC_RECORDER_PLUGIN, TotemDiscRecorderPluginClass))
 
-typedef struct TotemDiscRecorderPluginPrivate         TotemDiscRecorderPluginPrivate;
-
-typedef struct
-{
-	PeasExtensionBase parent;
-
+typedef struct {
 	TotemObject *totem;
 
 	GtkActionGroup *action_group;
 	guint ui_merge_id;
 
 	gboolean enabled;
-} TotemDiscRecorderPlugin;
+} TotemDiscRecorderPluginPrivate;
 
 TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_DISC_RECORDER_PLUGIN, TotemDiscRecorderPlugin, totem_disc_recorder_plugin)
 
@@ -101,7 +96,7 @@ totem_disc_recorder_plugin_start_burning (TotemDiscRecorderPlugin *pi,
 		g_ptr_array_add (array, (gpointer) "-r");
 	g_ptr_array_add (array, (gpointer) path);
 
-	main_window = totem_get_main_window (pi->totem);
+	main_window = totem_get_main_window (pi->priv->totem);
 	screen = gtk_widget_get_screen (GTK_WIDGET (main_window));
 	xid = gdk_x11_drawable_get_xid (GDK_DRAWABLE (gtk_widget_get_window (GTK_WIDGET (main_window))));
 	xid_str = g_strdup_printf ("%d", xid);
@@ -118,11 +113,11 @@ totem_disc_recorder_plugin_start_burning (TotemDiscRecorderPlugin *pi,
 		if (copy != FALSE) {
 			totem_interface_error (_("The video disc could not be duplicated."),
 					       error->message,
-					       totem_get_main_window (pi->totem));
+					       totem_get_main_window (pi->priv->totem));
 		} else {
 			totem_interface_error (_("The movie could not be recorded."),
 					       error->message,
-					       totem_get_main_window (pi->totem));
+					       totem_get_main_window (pi->priv->totem));
 		}
 		ret = FALSE;
 		g_error_free (error);
@@ -187,7 +182,7 @@ totem_disc_recorder_plugin_write_video_project (TotemDiscRecorderPlugin *pi,
 	if (success < 0)
 		goto error;
 
-	title = totem_get_short_title (pi->totem);
+	title = totem_get_short_title (pi->priv->totem);
 	if (title) {
 		success = xmlTextWriterWriteElement (project,
 						     (xmlChar *) "label",
@@ -206,7 +201,7 @@ totem_disc_recorder_plugin_write_video_project (TotemDiscRecorderPlugin *pi,
 	if (success < 0)
 		goto error;
 
-	uri = totem_get_current_mrl (pi->totem);
+	uri = totem_get_current_mrl (pi->priv->totem);
 	escaped = (unsigned char *) g_uri_escape_string (uri, NULL, FALSE);
 	g_free (uri);
 
@@ -273,7 +268,7 @@ totem_disc_recorder_plugin_burn (GtkAction *action,
 	if (!path) {
 		totem_interface_error (_("The movie could not be recorded."),
 				       error,
-				       totem_get_main_window (pi->totem));
+				       totem_get_main_window (pi->priv->totem));
 		g_free (error);
 		return;
 	}
@@ -290,7 +285,7 @@ totem_disc_recorder_plugin_copy (GtkAction *action,
 {
 	char *mrl;
 
-	mrl = totem_get_current_mrl (pi->totem);
+	mrl = totem_get_current_mrl (pi->priv->totem);
 	if (!g_str_has_prefix (mrl, "dvd:") && !g_str_has_prefix (mrl, "vcd:")) {
 		g_free (mrl);
 		g_assert_not_reached ();
@@ -306,11 +301,11 @@ totem_disc_recorder_file_closed (TotemObject *totem,
 {
 	GtkAction *action;
 
-	action = gtk_action_group_get_action (pi->action_group, "VideoBurnToDisc");
+	action = gtk_action_group_get_action (pi->priv->action_group, "VideoBurnToDisc");
 	gtk_action_set_visible (action, FALSE);
-	action = gtk_action_group_get_action (pi->action_group, "VideoDVDCopy");
+	action = gtk_action_group_get_action (pi->priv->action_group, "VideoDVDCopy");
 	gtk_action_set_visible (action, FALSE);
-	action = gtk_action_group_get_action (pi->action_group, "VideoVCDCopy");
+	action = gtk_action_group_get_action (pi->priv->action_group, "VideoVCDCopy");
 	gtk_action_set_visible (action, FALSE);
 }
 
@@ -319,41 +314,42 @@ totem_disc_recorder_file_opened (TotemObject *totem,
 				 const char *mrl,
 				 TotemDiscRecorderPlugin *pi)
 {
+	TotemDiscRecorderPluginPrivate *priv = pi->priv;
 	GtkAction *action;
 
 	/* Check if that stream is supported by brasero */
 	if (g_str_has_prefix (mrl, "file:")) {
 		/* If the file is supported we can always burn, even if there
 		 * aren't any burner since we can still create an image. */
-		action = gtk_action_group_get_action (pi->action_group, "VideoBurnToDisc");
+		action = gtk_action_group_get_action (priv->action_group, "VideoBurnToDisc");
 		gtk_action_set_visible (action, TRUE);
-		action = gtk_action_group_get_action (pi->action_group, "VideoDVDCopy");
+		action = gtk_action_group_get_action (priv->action_group, "VideoDVDCopy");
 		gtk_action_set_visible (action, FALSE);
-		action = gtk_action_group_get_action (pi->action_group, "VideoVCDCopy");
+		action = gtk_action_group_get_action (priv->action_group, "VideoVCDCopy");
 		gtk_action_set_visible (action, FALSE);
 	}
 	else if (g_str_has_prefix (mrl, "dvd:")) {
-		action = gtk_action_group_get_action (pi->action_group, "VideoBurnToDisc");
+		action = gtk_action_group_get_action (priv->action_group, "VideoBurnToDisc");
 		gtk_action_set_visible (action, FALSE);
-		action = gtk_action_group_get_action (pi->action_group, "VideoDVDCopy");
+		action = gtk_action_group_get_action (priv->action_group, "VideoDVDCopy");
 		gtk_action_set_visible (action, TRUE);
-		action = gtk_action_group_get_action (pi->action_group, "VideoVCDCopy");
+		action = gtk_action_group_get_action (priv->action_group, "VideoVCDCopy");
 		gtk_action_set_visible (action, FALSE);
 	}
 	else if (g_str_has_prefix (mrl, "vcd:")) {
-		action = gtk_action_group_get_action (pi->action_group, "VideoBurnToDisc");
+		action = gtk_action_group_get_action (priv->action_group, "VideoBurnToDisc");
 		gtk_action_set_visible (action, FALSE);
-		action = gtk_action_group_get_action (pi->action_group, "VideoDVDCopy");
+		action = gtk_action_group_get_action (priv->action_group, "VideoDVDCopy");
 		gtk_action_set_visible (action, FALSE);
-		action = gtk_action_group_get_action (pi->action_group, "VideoVCDCopy");
+		action = gtk_action_group_get_action (priv->action_group, "VideoVCDCopy");
 		gtk_action_set_visible (action, TRUE);
 	}
 	else {
-		action = gtk_action_group_get_action (pi->action_group, "VideoBurnToDisc");
+		action = gtk_action_group_get_action (priv->action_group, "VideoBurnToDisc");
 		gtk_action_set_visible (action, FALSE);
-		action = gtk_action_group_get_action (pi->action_group, "VideoDVDCopy");
+		action = gtk_action_group_get_action (priv->action_group, "VideoDVDCopy");
 		gtk_action_set_visible (action, FALSE);
-		action = gtk_action_group_get_action (pi->action_group, "VideoVCDCopy");
+		action = gtk_action_group_get_action (priv->action_group, "VideoVCDCopy");
 		gtk_action_set_visible (action, FALSE);
 	}
 }
@@ -362,6 +358,7 @@ static void
 impl_activate (PeasActivatable *plugin)
 {
 	TotemDiscRecorderPlugin *pi = TOTEM_DISC_RECORDER_PLUGIN (plugin);
+	TotemDiscRecorderPluginPrivate *priv = pi->priv;
 	GtkUIManager *uimanager = NULL;
 	GtkAction *action;
 	char *path;
@@ -380,40 +377,40 @@ impl_activate (PeasActivatable *plugin)
 	g_free (path);
 #endif
 
-	pi->totem = g_object_get_data (G_OBJECT (plugin), "object");
+	priv->totem = g_object_get_data (G_OBJECT (plugin), "object");
 
-	g_signal_connect (pi->totem,
+	g_signal_connect (priv->totem,
 			  "file-opened",
 			  G_CALLBACK (totem_disc_recorder_file_opened),
 			  plugin);
-	g_signal_connect (pi->totem,
+	g_signal_connect (priv->totem,
 			  "file-closed",
 			  G_CALLBACK (totem_disc_recorder_file_closed),
 			  plugin);
 
 	/* add UI */
-	pi->action_group = gtk_action_group_new ("DiscRecorderActions");
-	gtk_action_group_set_translation_domain (pi->action_group, GETTEXT_PACKAGE);
-	gtk_action_group_add_actions (pi->action_group,
+	priv->action_group = gtk_action_group_new ("DiscRecorderActions");
+	gtk_action_group_set_translation_domain (priv->action_group, GETTEXT_PACKAGE);
+	gtk_action_group_add_actions (priv->action_group,
 				      totem_disc_recorder_plugin_actions,
 				      G_N_ELEMENTS (totem_disc_recorder_plugin_actions),
 				      pi);
 
-	uimanager = totem_get_ui_manager (pi->totem);
-	gtk_ui_manager_insert_action_group (uimanager, pi->action_group, -1);
-	g_object_unref (pi->action_group);
+	uimanager = totem_get_ui_manager (priv->totem);
+	gtk_ui_manager_insert_action_group (uimanager, priv->action_group, -1);
+	g_object_unref (priv->action_group);
 
-	pi->ui_merge_id = gtk_ui_manager_new_merge_id (uimanager);
+	priv->ui_merge_id = gtk_ui_manager_new_merge_id (uimanager);
 
 	gtk_ui_manager_add_ui (uimanager,
-			       pi->ui_merge_id,
+			       priv->ui_merge_id,
 			       "/ui/tmw-menubar/movie/burn-placeholder",
 			       "VideoBurnToDisc",
 			       "VideoBurnToDisc",
 			       GTK_UI_MANAGER_MENUITEM,
 			       TRUE);
 	gtk_ui_manager_add_ui (uimanager,
-			       pi->ui_merge_id,
+			       priv->ui_merge_id,
 			       "/ui/totem-main-popup/burn-placeholder",
 			       "VideoBurnToDisc",
 			       "VideoBurnToDisc",
@@ -421,14 +418,14 @@ impl_activate (PeasActivatable *plugin)
 			       TRUE);
 
 	gtk_ui_manager_add_ui (uimanager,
-			       pi->ui_merge_id,
+			       priv->ui_merge_id,
 			       "/ui/tmw-menubar/movie/burn-placeholder",
 			       "VideoDVDCopy",
 			       "VideoDVDCopy",
 			       GTK_UI_MANAGER_MENUITEM,
 			       TRUE);
 	gtk_ui_manager_add_ui (uimanager,
-			       pi->ui_merge_id,
+			       priv->ui_merge_id,
 			       "/ui/totem-main-popup/burn-placeholder",
 			       "VideoDVDCopy",
 			       "VideoDVDCopy",
@@ -436,32 +433,32 @@ impl_activate (PeasActivatable *plugin)
 			       TRUE);
 
 	gtk_ui_manager_add_ui (uimanager,
-			       pi->ui_merge_id,
+			       priv->ui_merge_id,
 			       "/ui/tmw-menubar/movie/burn-placeholder",
 			       "VideoVCDCopy",
 			       "VideoVCDCopy",
 			       GTK_UI_MANAGER_MENUITEM,
 			       TRUE);
 	gtk_ui_manager_add_ui (uimanager,
-			       pi->ui_merge_id,
+			       priv->ui_merge_id,
 			       "/ui/totem-main-popup/burn-placeholder",
 			       "VideoVCDCopy",
 			       "VideoVCDCopy",
 			       GTK_UI_MANAGER_MENUITEM,
 			       TRUE);
 
-	if (!totem_is_paused (pi->totem) && !totem_is_playing (pi->totem)) {
-		action = gtk_action_group_get_action (pi->action_group, "VideoBurnToDisc");
+	if (!totem_is_paused (priv->totem) && !totem_is_playing (priv->totem)) {
+		action = gtk_action_group_get_action (priv->action_group, "VideoBurnToDisc");
 		gtk_action_set_visible (action, FALSE);
-		action = gtk_action_group_get_action (pi->action_group, "VideoDVDCopy");
+		action = gtk_action_group_get_action (priv->action_group, "VideoDVDCopy");
 		gtk_action_set_visible (action, FALSE);
-		action = gtk_action_group_get_action (pi->action_group, "VideoVCDCopy");
+		action = gtk_action_group_get_action (priv->action_group, "VideoVCDCopy");
 		gtk_action_set_visible (action, FALSE);	}
 	else {
 		char *mrl;
 
-		mrl = totem_get_current_mrl (pi->totem);
-		totem_disc_recorder_file_opened (pi->totem, mrl, pi);
+		mrl = totem_get_current_mrl (priv->totem);
+		totem_disc_recorder_file_opened (priv->totem, mrl, pi);
 		g_free (mrl);
 	}
 }
@@ -470,33 +467,17 @@ static void
 impl_deactivate (PeasActivatable *plugin)
 {
 	TotemDiscRecorderPlugin *pi = TOTEM_DISC_RECORDER_PLUGIN (plugin);
+	TotemDiscRecorderPluginPrivate *priv = pi->priv;
 	GtkUIManager *uimanager = NULL;
 
-	pi->enabled = FALSE;
-
-	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 (pi->totem);
-	gtk_ui_manager_remove_ui (uimanager, pi->ui_merge_id);
-	gtk_ui_manager_remove_action_group (uimanager, pi->action_group);
-
-	pi->totem = NULL;
-}
-
-static void
-totem_disc_recorder_plugin_class_init (TotemDiscRecorderPluginClass *klass)
-{
-	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+	priv->enabled = FALSE;
 
-	object_class->set_property = set_property;
-	object_class->get_property = get_property;
+	g_signal_handlers_disconnect_by_func (priv->totem, totem_disc_recorder_file_opened, plugin);
+	g_signal_handlers_disconnect_by_func (priv->totem, totem_disc_recorder_file_closed, plugin);
 
-	g_object_class_override_property (object_class, PROP_OBJECT, "object");
-}
+	uimanager = totem_get_ui_manager (priv->totem);
+	gtk_ui_manager_remove_ui (uimanager, priv->ui_merge_id);
+	gtk_ui_manager_remove_action_group (uimanager, priv->action_group);
 
-static void
-totem_disc_recorder_plugin_init (TotemDiscRecorderPlugin *pi)
-{
+	priv->totem = NULL;
 }
-
diff --git a/src/plugins/chapters/totem-chapters.c b/src/plugins/chapters/totem-chapters.c
index 882f4ee..9802812 100644
--- a/src/plugins/chapters/totem-chapters.c
+++ b/src/plugins/chapters/totem-chapters.c
@@ -63,6 +63,8 @@
 #define ICON_SCALE_RATIO 2
 
 typedef struct {
+	TotemObject	*totem;
+	TotemEditChapter *edit_chapter;
 	GtkWidget	*tree;
 	GtkWidget	*add_button,
 			*remove_button,
@@ -84,12 +86,7 @@ typedef struct {
 	guint		autoload_handle_id;
 } TotemChaptersPluginPrivate;
 
-typedef struct {
-	PeasExtensionBase		parent;
-	TotemObject			*totem;
-	TotemEditChapter		*edit_chapter;
-	TotemChaptersPluginPrivate	*priv;
-} TotemChaptersPlugin;
+TOTEM_PLUGIN_REGISTER (TOTEM_TYPE_CHAPTERS_PLUGIN, TotemChaptersPlugin, totem_chapters_plugin)
 
 enum {
 	CHAPTERS_PIXBUF_COLUMN = 0,
@@ -133,27 +130,6 @@ void popup_goto_action_cb (GtkAction *action, TotemChaptersPlugin *plugin);
 void load_button_clicked_cb (GtkButton *button, TotemChaptersPlugin *plugin);
 void continue_button_clicked_cb (GtkButton *button, TotemChaptersPlugin *plugin);
 
-TOTEM_PLUGIN_REGISTER (TOTEM_TYPE_CHAPTERS_PLUGIN, TotemChaptersPlugin, totem_chapters_plugin)
-
-static void
-totem_chapters_plugin_class_init (TotemChaptersPluginClass *klass)
-{
-	GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
-	g_type_class_add_private (klass, sizeof (TotemChaptersPluginPrivate));
-
-	object_class->set_property = set_property;
-	object_class->get_property = get_property;
-
-	g_object_class_override_property (object_class, PROP_OBJECT, "object");
-}
-
-static void
-totem_chapters_plugin_init (TotemChaptersPlugin *plugin)
-{
-	plugin->priv = TOTEM_CHAPTERS_PLUGIN_GET_PRIVATE (plugin);
-}
-
 static GdkPixbuf *
 get_chapter_pixbuf (GdkPixbuf *src)
 {
@@ -351,7 +327,7 @@ totem_file_opened_result_cb (gpointer	data,
 			g_free (adata);
 			return;
 		} else
-			totem_action_error (plugin->totem, _("Error while reading file with chapters"),
+			totem_action_error (plugin->priv->totem, _("Error while reading file with chapters"),
 					    adata->error);
 	}
 
@@ -412,8 +388,8 @@ totem_file_closed_cb (TotemObject		*totem,
 
 	gtk_tree_store_clear (store);
 
-	if (G_UNLIKELY (plugin->edit_chapter != NULL))
-		gtk_widget_destroy (GTK_WIDGET (plugin->edit_chapter));
+	if (G_UNLIKELY (plugin->priv->edit_chapter != NULL))
+		gtk_widget_destroy (GTK_WIDGET (plugin->priv->edit_chapter));
 
 	if (G_UNLIKELY (plugin->priv->last_frame != NULL))
 		g_object_unref (G_OBJECT (plugin->priv->last_frame));
@@ -438,13 +414,13 @@ chapter_edit_dialog_response_cb (GtkDialog		*dialog,
 	g_return_if_fail (TOTEM_IS_CHAPTERS_PLUGIN (plugin));
 
 	if (response != GTK_RESPONSE_OK) {
-		gtk_widget_destroy (GTK_WIDGET (plugin->edit_chapter));
+		gtk_widget_destroy (GTK_WIDGET (plugin->priv->edit_chapter));
 
 		if (plugin->priv->last_frame != NULL)
 			g_object_unref (G_OBJECT (plugin->priv->last_frame));
 
 		if (plugin->priv->was_played)
-			totem_action_play (plugin->totem);
+			totem_action_play (plugin->priv->totem);
 		return;
 	}
 
@@ -459,10 +435,10 @@ chapter_edit_dialog_response_cb (GtkDialog		*dialog,
 		g_object_unref (G_OBJECT (plugin->priv->last_frame));
 
 	g_free (title);
-	gtk_widget_destroy (GTK_WIDGET (plugin->edit_chapter));
+	gtk_widget_destroy (GTK_WIDGET (plugin->priv->edit_chapter));
 
 	if (plugin->priv->was_played)
-		totem_action_play (plugin->totem);
+		totem_action_play (plugin->priv->totem);
 }
 
 static void
@@ -554,46 +530,46 @@ show_chapter_edit_dialog (TotemChaptersPlugin	*plugin)
 
 	g_return_if_fail (TOTEM_IS_CHAPTERS_PLUGIN (plugin));
 
-	if (G_UNLIKELY (plugin->edit_chapter != NULL)) {
-		gtk_window_present (GTK_WINDOW (plugin->edit_chapter));
+	if (G_UNLIKELY (plugin->priv->edit_chapter != NULL)) {
+		gtk_window_present (GTK_WINDOW (plugin->priv->edit_chapter));
 		return;
 	}
 
-	main_window = totem_get_main_window (plugin->totem);
-	plugin->priv->was_played = totem_is_playing (plugin->totem);
-	totem_action_pause (plugin->totem);
+	main_window = totem_get_main_window (plugin->priv->totem);
+	plugin->priv->was_played = totem_is_playing (plugin->priv->totem);
+	totem_action_pause (plugin->priv->totem);
 
 	/* adding a new one, check if it's time available */
-	g_object_get (G_OBJECT (plugin->totem), "current-time", &_time, NULL);
+	g_object_get (G_OBJECT (plugin->priv->totem), "current-time", &_time, NULL);
 	if (G_UNLIKELY (!check_available_time (plugin, _time))) {
 		totem_interface_error_blocking (_("Chapter with the same time already exists"),
 						_("Try another name or remove an existing chapter"),
 						main_window);
 		g_object_unref (main_window);
 		if (plugin->priv->was_played)
-			totem_action_play (plugin->totem);
+			totem_action_play (plugin->priv->totem);
 		return;
 	}
 	plugin->priv->last_time = _time;
 
 	/* capture frame */
-	bvw = BACON_VIDEO_WIDGET (totem_get_video_widget (plugin->totem));
+	bvw = BACON_VIDEO_WIDGET (totem_get_video_widget (plugin->priv->totem));
 	plugin->priv->last_frame = bacon_video_widget_get_current_frame (bvw);
 	g_object_add_weak_pointer (G_OBJECT (plugin->priv->last_frame), (gpointer *) &plugin->priv->last_frame);
 	g_object_unref (bvw);
 
 	/* create chapter-edit dialog */
-	plugin->edit_chapter = TOTEM_EDIT_CHAPTER (totem_edit_chapter_new ());
-	g_object_add_weak_pointer (G_OBJECT (plugin->edit_chapter), (gpointer *) &(plugin->edit_chapter));
+	plugin->priv->edit_chapter = TOTEM_EDIT_CHAPTER (totem_edit_chapter_new ());
+	g_object_add_weak_pointer (G_OBJECT (plugin->priv->edit_chapter), (gpointer *) &(plugin->priv->edit_chapter));
 
-	g_signal_connect (G_OBJECT (plugin->edit_chapter), "delete-event",
+	g_signal_connect (G_OBJECT (plugin->priv->edit_chapter), "delete-event",
 			  G_CALLBACK (gtk_widget_destroy), NULL);
-	g_signal_connect (G_OBJECT (plugin->edit_chapter), "response",
+	g_signal_connect (G_OBJECT (plugin->priv->edit_chapter), "response",
 			  G_CALLBACK (chapter_edit_dialog_response_cb), plugin);
 
-	gtk_window_set_transient_for (GTK_WINDOW (plugin->edit_chapter),
+	gtk_window_set_transient_for (GTK_WINDOW (plugin->priv->edit_chapter),
 				      main_window);
-	gtk_widget_show (GTK_WIDGET (plugin->edit_chapter));
+	gtk_widget_show (GTK_WIDGET (plugin->priv->edit_chapter));
 
 	g_object_unref (main_window);
 }
@@ -740,7 +716,7 @@ save_chapters_result_cb (gpointer	data,
 	plugin = TOTEM_CHAPTERS_PLUGIN (adata->user_data);
 
 	if (G_UNLIKELY (!adata->successful && !g_cancellable_is_cancelled (adata->cancellable))) {
-		totem_action_error (plugin->totem, _("Error while writing file with chapters"),
+		totem_action_error (plugin->priv->totem, _("Error while writing file with chapters"),
 				    adata->error);
 		gtk_widget_set_sensitive (plugin->priv->save_button, TRUE);
 	}
@@ -865,7 +841,7 @@ save_button_clicked_cb (GtkButton		*button,
 				   (gpointer *) &(plugin->priv->cancellable[1]));
 
 	if (G_UNLIKELY (totem_cmml_write_file_async (data) < 0)) {
-		totem_action_error (plugin->totem, _("Error occurred while saving chapters"),
+		totem_action_error (plugin->priv->totem, _("Error occurred while saving chapters"),
 				    _("Please check you rights and free space"));
 		g_free (data);
 		g_object_unref (plugin->priv->cancellable);
@@ -889,7 +865,7 @@ tree_view_row_activated_cb (GtkTreeView			*tree_view,
 	g_return_if_fail (path != NULL);
 
 	store = gtk_tree_view_get_model (tree_view);
-	seekable = totem_is_seekable (plugin->totem);
+	seekable = totem_is_seekable (plugin->priv->totem);
 	if (!seekable) {
 		g_warning ("chapters: unable to seek stream!");
 		return;
@@ -898,7 +874,7 @@ tree_view_row_activated_cb (GtkTreeView			*tree_view,
 	gtk_tree_model_get_iter (store, &iter, path);
 	gtk_tree_model_get (store, &iter, CHAPTERS_TIME_PRIV_COLUMN, &_time, -1);
 
-	totem_action_seek_time (plugin->totem, _time, TRUE);
+	totem_action_seek_time (plugin->priv->totem, _time, TRUE);
 }
 
 gboolean
@@ -995,11 +971,11 @@ load_button_clicked_cb (GtkButton		*button,
 
 	g_return_if_fail (TOTEM_IS_CHAPTERS_PLUGIN (plugin));
 
-	plugin->priv->was_played = totem_is_playing (plugin->totem);
-	totem_action_pause (plugin->totem);
+	plugin->priv->was_played = totem_is_playing (plugin->priv->totem);
+	totem_action_pause (plugin->priv->totem);
 
-	mrl = totem_get_current_mrl (plugin->totem);
-	main_window = totem_get_main_window (plugin->totem);
+	mrl = totem_get_current_mrl (plugin->priv->totem);
+	main_window = totem_get_main_window (plugin->priv->totem);
 	dialog = gtk_file_chooser_dialog_new (_("Open Chapters File"), main_window, GTK_FILE_CHOOSER_ACTION_OPEN,
 					      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 					      GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
@@ -1038,7 +1014,7 @@ load_button_clicked_cb (GtkButton		*button,
 	}
 
 	if (plugin->priv->was_played)
-		totem_action_play (plugin->totem);
+		totem_action_play (plugin->priv->totem);
 
 	gtk_widget_destroy (dialog);
 	g_object_unref (main_window);
@@ -1132,12 +1108,12 @@ impl_activate (PeasActivatable *plugin)
 							   "markup", CHAPTERS_TITLE_COLUMN, NULL);
 	gtk_tree_view_append_column (GTK_TREE_VIEW (cplugin->priv->tree), column);
 
-	cplugin->totem = g_object_ref (totem);
+	cplugin->priv->totem = g_object_ref (totem);
 	/* for read operation */
 	cplugin->priv->cancellable[0] = NULL;
 	/* for write operation */
 	cplugin->priv->cancellable[1] = NULL;
-	cplugin->edit_chapter = NULL;
+	cplugin->priv->edit_chapter = NULL;
 	cplugin->priv->last_frame = NULL;
 	cplugin->priv->cmml_mrl = NULL;
 	cplugin->priv->last_time = 0;
@@ -1179,9 +1155,9 @@ impl_activate (PeasActivatable *plugin)
 			  G_CALLBACK (chapter_selection_changed_cb),
 			  plugin);
 
-	mrl = totem_get_current_mrl (cplugin->totem);
+	mrl = totem_get_current_mrl (cplugin->priv->totem);
 	if (mrl != NULL)
-		totem_file_opened_async_cb (cplugin->totem, mrl, cplugin);
+		totem_file_opened_async_cb (cplugin->priv->totem, mrl, cplugin);
 
 	g_object_unref (builder);
 	g_free (mrl);
@@ -1212,8 +1188,8 @@ impl_deactivate (PeasActivatable *plugin)
 	if (G_UNLIKELY (cplugin->priv->last_frame != NULL))
 		g_object_unref (G_OBJECT (cplugin->priv->last_frame));
 
-	if (G_UNLIKELY (cplugin->edit_chapter != NULL))
-		gtk_widget_destroy (GTK_WIDGET (cplugin->edit_chapter));
+	if (G_UNLIKELY (cplugin->priv->edit_chapter != NULL))
+		gtk_widget_destroy (GTK_WIDGET (cplugin->priv->edit_chapter));
 
 	if (G_LIKELY (cplugin->priv->action_group != NULL))
 		g_object_unref (cplugin->priv->action_group);
@@ -1228,7 +1204,7 @@ impl_deactivate (PeasActivatable *plugin)
 		g_cancellable_cancel (cplugin->priv->cancellable[1]);
 
 
-	g_object_unref (cplugin->totem);
+	g_object_unref (cplugin->priv->totem);
 	g_free (cplugin->priv->cmml_mrl);
 
 	totem_remove_sidebar_page (totem, "chapters");
diff --git a/src/plugins/galago/totem-galago.c b/src/plugins/galago/totem-galago.c
index 3b74b8d..9cd942f 100644
--- a/src/plugins/galago/totem-galago.c
+++ b/src/plugins/galago/totem-galago.c
@@ -48,33 +48,15 @@
 #define TOTEM_GALAGO_PLUGIN_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), TOTEM_TYPE_GALAGO_PLUGIN, TotemGalagoPluginClass))
 
 typedef struct {
-	PeasExtensionBase parent;
-
 	guint		handler_id_fullscreen;
 	guint		handler_id_playing;
 	gboolean	idle; /* Whether we're idle */
 	GalagoPerson	*me; /* Me! */
-} TotemGalagoPlugin;
+} TotemGalagoPluginPrivate;
 
 TOTEM_PLUGIN_REGISTER (TOTEM_TYPE_GALAGO_PLUGIN, TotemGalagoPlugin, totem_galago_plugin);
 
 static void
-totem_galago_plugin_class_init (TotemGalagoPluginClass *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
-totem_galago_plugin_init (TotemGalagoPlugin *plugin)
-{
-}
-
-static void
 totem_galago_set_idleness (TotemGalagoPlugin *plugin, gboolean idle)
 {
 	GList *account;
@@ -83,11 +65,11 @@ totem_galago_set_idleness (TotemGalagoPlugin *plugin, gboolean idle)
 	if (galago_is_connected () == FALSE)
 		return;
 
-	if (plugin->idle == idle)
+	if (plugin->priv->idle == idle)
 		return;
 
-	plugin->idle = idle;
-	for (account = galago_person_get_accounts (plugin->me, TRUE); account != NULL; account = g_list_next (account)) {
+	plugin->priv->idle = idle;
+	for (account = galago_person_get_accounts (plugin->priv->me, TRUE); account != NULL; account = g_list_next (account)) {
 		presence = galago_account_get_presence ((GalagoAccount *)account->data, TRUE);
 		if (presence != NULL)
 			galago_presence_set_idle (presence, idle, time (NULL));
@@ -126,7 +108,7 @@ impl_activate (PeasActivatable *plugin)
 	}
 
 	/* Get "me" and list accounts */
-	pi->me = galago_get_me (GALAGO_REMOTE, TRUE);
+	pi->priv->me = galago_get_me (GALAGO_REMOTE, TRUE);
 
 	g_object_get (plugin, "object", &totem, NULL);
 
@@ -139,11 +121,11 @@ impl_activate (PeasActivatable *plugin)
 		return;
 	}
 
-	pi->handler_id_fullscreen = g_signal_connect (G_OBJECT (totem),
+	pi->priv->handler_id_fullscreen = g_signal_connect (G_OBJECT (totem),
 				"notify::fullscreen",
 				G_CALLBACK (property_notify_cb),
 				pi);
-	pi->handler_id_playing = g_signal_connect (G_OBJECT (totem),
+	pi->priv->handler_id_playing = g_signal_connect (G_OBJECT (totem),
 				"notify::playing",
 				G_CALLBACK (property_notify_cb),
 				pi);
@@ -166,15 +148,15 @@ impl_deactivate (PeasActivatable *plugin)
 
 	g_object_get (plugin, "object", &totem, NULL);
 
-	g_signal_handler_disconnect (G_OBJECT (totem), pi->handler_id_fullscreen);
-	g_signal_handler_disconnect (G_OBJECT (totem), pi->handler_id_playing);
+	g_signal_handler_disconnect (G_OBJECT (totem), pi->priv->handler_id_fullscreen);
+	g_signal_handler_disconnect (G_OBJECT (totem), pi->priv->handler_id_playing);
 
 	g_object_unref (totem);
 
 	totem_galago_set_idleness (pi, FALSE);
 
-	if (pi->me != NULL)
-		g_object_unref (pi->me);
+	if (pi->priv->me != NULL)
+		g_object_unref (pi->priv->me);
 
 	galago_uninit ();
 }
diff --git a/src/plugins/gromit/totem-gromit.c b/src/plugins/gromit/totem-gromit.c
index 4fd851e..d1233e2 100644
--- a/src/plugins/gromit/totem-gromit.c
+++ b/src/plugins/gromit/totem-gromit.c
@@ -54,16 +54,13 @@
 #define TOTEM_IS_GROMIT_PLUGIN_CLASS(k)		(G_TYPE_CHECK_CLASS_TYPE ((k), TOTEM_TYPE_GROMIT_PLUGIN))
 #define TOTEM_GROMIT_PLUGIN_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), TOTEM_TYPE_GROMIT_PLUGIN, TotemGromitPluginClass))
 
-typedef struct
-{
-	PeasExtensionBase parent;
-
+typedef struct {
 	char *path;
 	int id;
 	GPid pid;
 
 	gulong handler_id;
-} TotemGromitPlugin;
+} TotemGromitPluginPrivate;
 
 #define INTERVAL 10 /* seconds */
 
@@ -92,22 +89,6 @@ static const char *visibility_cmd[] =	{ NULL, "-v", NULL };
 TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_GROMIT_PLUGIN, TotemGromitPlugin, totem_gromit_plugin)
 
 static void
-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;
-
-	g_object_class_override_property (object_class, PROP_OBJECT, "object");
-}
-
-static void
-totem_gromit_plugin_init (TotemGromitPlugin *plugin)
-{
-}
-
-static void
 totem_gromit_ensure_config_file (void)
 {
 	char *path;
@@ -131,13 +112,13 @@ totem_gromit_ensure_config_file (void)
 static gboolean
 totem_gromit_available (TotemGromitPlugin *plugin)
 {
-	plugin->path = g_find_program_in_path ("gromit");
+	plugin->priv->path = g_find_program_in_path ("gromit");
 
-	if (plugin->path == NULL) {
+	if (plugin->priv->path == NULL) {
 		return FALSE;
 	}
 
-	start_cmd[0] = toggle_cmd[0] = clear_cmd[0] = visibility_cmd[0] = plugin->path;
+	start_cmd[0] = toggle_cmd[0] = clear_cmd[0] = visibility_cmd[0] = plugin->priv->path;
 	totem_gromit_ensure_config_file ();
 
 	return TRUE;
@@ -154,16 +135,16 @@ static void
 totem_gromit_exit (TotemGromitPlugin *plugin)
 {
 	/* Nothing to do */
-	if (plugin->pid == -1) {
-		if (plugin->id != -1) {
-			g_source_remove (plugin->id);
-			plugin->id = -1;
+	if (plugin->priv->pid == -1) {
+		if (plugin->priv->id != -1) {
+			g_source_remove (plugin->priv->id);
+			plugin->priv->id = -1;
 		}
 		return;
 	}
 
-	kill ((pid_t) plugin->pid, SIGKILL);
-	plugin->pid = -1;
+	kill ((pid_t) plugin->priv->pid, SIGKILL);
+	plugin->priv->pid = -1;
 }
 
 static gboolean
@@ -171,7 +152,7 @@ totem_gromit_timeout_cb (gpointer data)
 {
 	TotemGromitPlugin *plugin = TOTEM_GROMIT_PLUGIN (data);
 
-	plugin->id = -1;
+	plugin->priv->id = -1;
 	totem_gromit_exit (plugin);
 	return FALSE;
 }
@@ -180,21 +161,21 @@ static void
 totem_gromit_toggle (TotemGromitPlugin *plugin)
 {
 	/* Not started */
-	if (plugin->pid == -1) {
+	if (plugin->priv->pid == -1) {
 		if (g_spawn_async (NULL,
 				(char **)start_cmd, NULL, 0, NULL, NULL,
-				&plugin->pid, NULL) == FALSE) {
+				&plugin->priv->pid, NULL) == FALSE) {
 			g_printerr ("Couldn't start gromit");
 			return;
 		}
-	} else if (plugin->id == -1) { /* Started but disabled */
-		g_source_remove (plugin->id);
-		plugin->id = -1;
+	} else if (plugin->priv->id == -1) { /* Started but disabled */
+		g_source_remove (plugin->priv->id);
+		plugin->priv->id = -1;
 		launch (toggle_cmd);
 	} else {
 		/* Started and visible */
-		g_source_remove (plugin->id);
-		plugin->id = -1;
+		g_source_remove (plugin->priv->id);
+		plugin->priv->id = -1;
 		launch (toggle_cmd);
 	}
 }
@@ -209,7 +190,7 @@ totem_gromit_clear (TotemGromitPlugin *plugin, gboolean now)
 
 	launch (visibility_cmd);
 	launch (clear_cmd);
-	plugin->id = g_timeout_add_seconds (INTERVAL, totem_gromit_timeout_cb, plugin);
+	plugin->priv->id = g_timeout_add_seconds (INTERVAL, totem_gromit_timeout_cb, plugin);
 }
 
 static gboolean
@@ -240,8 +221,8 @@ impl_activate (PeasActivatable *plugin)
 	TotemGromitPlugin *pi = TOTEM_GROMIT_PLUGIN (plugin);
 	GtkWindow *window;
 
-	pi->id = -1;
-	pi->pid = -1;
+	pi->priv->id = -1;
+	pi->priv->pid = -1;
 
 	if (!totem_gromit_available (pi)) {
 		//FIXME
@@ -254,7 +235,7 @@ impl_activate (PeasActivatable *plugin)
 	}
 
 	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", 
+	pi->priv->handler_id = g_signal_connect (G_OBJECT(window), "key-press-event", 
 			G_CALLBACK (on_window_key_press_event), plugin);
 	g_object_unref (window);
 }
@@ -265,16 +246,16 @@ impl_deactivate (PeasActivatable *plugin)
 	TotemGromitPlugin *pi = TOTEM_GROMIT_PLUGIN (plugin);
 	GtkWindow *window;
 
-	if (pi->handler_id != 0) {
+	if (pi->priv->handler_id != 0) {
 		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_signal_handler_disconnect (G_OBJECT(window), pi->priv->handler_id);
+		pi->priv->handler_id = 0;
 		g_object_unref (window);
 	}
 
 	totem_gromit_clear (pi, TRUE);
 
-	g_free (pi->path);
-	pi->path = NULL;
+	g_free (pi->priv->path);
+	pi->priv->path = NULL;
 }
 
diff --git a/src/plugins/lirc/totem-lirc.c b/src/plugins/lirc/totem-lirc.c
index fb47fd2..58b7299 100644
--- a/src/plugins/lirc/totem-lirc.c
+++ b/src/plugins/lirc/totem-lirc.c
@@ -51,15 +51,12 @@
 #define TOTEM_IS_LIRC_PLUGIN_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), TOTEM_TYPE_LIRC_PLUGIN))
 #define TOTEM_LIRC_PLUGIN_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), TOTEM_TYPE_LIRC_PLUGIN, TotemLircPluginClass))
 
-typedef struct
-{
-	PeasExtensionBase parent;
-
+typedef struct {
 	GIOChannel *lirc_channel;
 	struct lirc_config *lirc_config;
 
 	TotemObject *totem;
-} TotemLircPlugin;
+} TotemLircPluginPrivate;
 
 /* strings that we recognize as commands from lirc */
 #define TOTEM_IR_COMMAND_PLAY "play"
@@ -93,22 +90,6 @@ typedef struct
 
 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
-totem_lirc_plugin_init (TotemLircPlugin *plugin)
-{
-}
-
 static char *
 totem_lirc_get_url (const char *str)
 {
@@ -212,7 +193,7 @@ totem_lirc_read_code (GIOChannel *source, GIOCondition condition, TotemLircPlugi
 	}
 
 	do {
-		ok = lirc_code2char (pi->lirc_config, code, &str);
+		ok = lirc_code2char (pi->priv->lirc_config, code, &str);
 
 		if (ok != 0) {
 			/* Couldn't convert lirc code to string. */
@@ -229,12 +210,12 @@ totem_lirc_read_code (GIOChannel *source, GIOCondition condition, TotemLircPlugi
 			if (setting >= 0) {
 				gboolean value;
 
-				value = totem_action_remote_get_setting (pi->totem, setting);
-				totem_action_remote_set_setting (pi->totem, setting, !value);
+				value = totem_action_remote_get_setting (pi->priv->totem, setting);
+				totem_action_remote_set_setting (pi->priv->totem, setting, !value);
 			}
 		} else {
 			cmd = totem_lirc_to_command (str, &url);
-			totem_action_remote (pi->totem, cmd, url);
+			totem_action_remote (pi->priv->totem, cmd, url);
 		}
 		g_free (url);
 	} while (TRUE);
@@ -251,7 +232,7 @@ impl_activate (PeasActivatable *plugin)
 	char *path;
 	int fd;
 
-	pi->totem = g_object_ref (g_object_get_data (G_OBJECT (plugin), "object"));
+	pi->priv->totem = g_object_ref (g_object_get_data (G_OBJECT (plugin), "object"));
 
 	fd = lirc_init ((char*) "Totem", 0);
 	if (fd < 0) {
@@ -265,7 +246,7 @@ impl_activate (PeasActivatable *plugin)
 
 	/* Load the default Totem setup */
 	path = totem_plugin_find_file ("lirc", "totem_lirc_default");
-	if (path == NULL || lirc_readconfig (path, &pi->lirc_config, NULL) == -1) {
+	if (path == NULL || lirc_readconfig (path, &pi->priv->lirc_config, NULL) == -1) {
 		g_free (path);
 		//FIXME
 #if 0
@@ -278,12 +259,12 @@ impl_activate (PeasActivatable *plugin)
 	g_free (path);
 
 	/* Load the user config, doesn't matter if it's not there */
-	lirc_readconfig (NULL, &pi->lirc_config, NULL);
+	lirc_readconfig (NULL, &pi->priv->lirc_config, NULL);
 
-	pi->lirc_channel = g_io_channel_unix_new (fd);
-	g_io_channel_set_encoding (pi->lirc_channel, NULL, NULL);
-	g_io_channel_set_buffered (pi->lirc_channel, FALSE);
-	g_io_add_watch (pi->lirc_channel, G_IO_IN | G_IO_ERR | G_IO_HUP,
+	pi->priv->lirc_channel = g_io_channel_unix_new (fd);
+	g_io_channel_set_encoding (pi->priv->lirc_channel, NULL, NULL);
+	g_io_channel_set_buffered (pi->priv->lirc_channel, FALSE);
+	g_io_add_watch (pi->priv->lirc_channel, G_IO_IN | G_IO_ERR | G_IO_HUP,
 			(GIOFunc) totem_lirc_read_code, pi);
 }
 
@@ -293,26 +274,26 @@ impl_deactivate (PeasActivatable *plugin)
 	TotemLircPlugin *pi = TOTEM_LIRC_PLUGIN (plugin);
 	GError *error = NULL;
 
-	if (pi->lirc_channel) {
-		g_io_channel_shutdown (pi->lirc_channel, FALSE, &error);
+	if (pi->priv->lirc_channel) {
+		g_io_channel_shutdown (pi->priv->lirc_channel, FALSE, &error);
 		if (error != NULL) {
 			g_warning ("Couldn't destroy lirc connection: %s",
 				   error->message);
 			g_error_free (error);
 		}
-		pi->lirc_channel = NULL;
+		pi->priv->lirc_channel = NULL;
 	}
 
-	if (pi->lirc_config) {
-		lirc_freeconfig (pi->lirc_config);
-		pi->lirc_config = NULL;
+	if (pi->priv->lirc_config) {
+		lirc_freeconfig (pi->priv->lirc_config);
+		pi->priv->lirc_config = NULL;
 
 		lirc_deinit ();
 	}
 
-	if (pi->totem) {
-		g_object_unref (pi->totem);
-		pi->totem = NULL;
+	if (pi->priv->totem) {
+		g_object_unref (pi->priv->totem);
+		pi->priv->totem = 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 02b41ae..0a74888 100644
--- a/src/plugins/media-player-keys/totem-media-player-keys.c
+++ b/src/plugins/media-player-keys/totem-media-player-keys.c
@@ -48,36 +48,16 @@
 #define TOTEM_IS_MEDIA_PLAYER_KEYS_PLUGIN_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), TOTEM_TYPE_MEDIA_PLAYER_KEYS_PLUGIN))
 #define TOTEM_MEDIA_PLAYER_KEYS_PLUGIN_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), TOTEM_TYPE_MEDIA_PLAYER_KEYS_PLUGIN, TotemMediaPlayerKeysPluginClass))
 
-typedef struct
-{
-	PeasExtensionBase parent;
-
+typedef struct {
 	DBusGProxy    *media_player_keys_proxy;
-
 	guint          handler_id;
-} TotemMediaPlayerKeysPlugin;
+} TotemMediaPlayerKeysPluginPrivate;
 
 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->set_property = set_property;
-	object_class->get_property = get_property;
-
-	g_object_class_override_property (object_class, PROP_OBJECT, "object");
-}
-
-static void
-totem_media_player_keys_plugin_init (TotemMediaPlayerKeysPlugin *plugin)
-{
-}
-
-static void
 on_media_player_key_pressed (DBusGProxy *proxy, const gchar *application, const gchar *key, TotemObject *totem)
 {
 	if (strcmp ("Totem", application) == 0) {
@@ -95,8 +75,8 @@ on_media_player_key_pressed (DBusGProxy *proxy, const gchar *application, const
 static gboolean
 on_window_focus_in_event (GtkWidget *window, GdkEventFocus *event, TotemMediaPlayerKeysPlugin *pi)
 {
-	if (pi->media_player_keys_proxy != NULL) {
-		dbus_g_proxy_call (pi->media_player_keys_proxy,
+	if (pi->priv->media_player_keys_proxy != NULL) {
+		dbus_g_proxy_call (pi->priv->media_player_keys_proxy,
 				   "GrabMediaPlayerKeys", NULL,
 				   G_TYPE_STRING, "Totem", G_TYPE_UINT, 0, G_TYPE_INVALID,
 				   G_TYPE_INVALID);
@@ -109,7 +89,7 @@ static void
 proxy_destroy (DBusGProxy *proxy,
 		  TotemMediaPlayerKeysPlugin* plugin)
 {
-	plugin->media_player_keys_proxy = NULL;
+	plugin->priv->media_player_keys_proxy = NULL;
 }
 
 static void
@@ -129,13 +109,13 @@ impl_activate (PeasActivatable *plugin)
 
 	/* Try the gnome-settings-daemon version,
 	 * then the gnome-control-center version of things */
-	pi->media_player_keys_proxy = dbus_g_proxy_new_for_name_owner (connection,
+	pi->priv->media_player_keys_proxy = dbus_g_proxy_new_for_name_owner (connection,
 								       "org.gnome.SettingsDaemon",
 								       "/org/gnome/SettingsDaemon/MediaKeys",
 								       "org.gnome.SettingsDaemon.MediaKeys",
 								       NULL);
-	if (pi->media_player_keys_proxy == NULL) {
-		pi->media_player_keys_proxy = dbus_g_proxy_new_for_name_owner (connection,
+	if (pi->priv->media_player_keys_proxy == NULL) {
+		pi->priv->media_player_keys_proxy = dbus_g_proxy_new_for_name_owner (connection,
 									       "org.gnome.SettingsDaemon",
 									       "/org/gnome/SettingsDaemon",
 									       "org.gnome.SettingsDaemon",
@@ -156,13 +136,13 @@ impl_activate (PeasActivatable *plugin)
 #endif
 		return;
 	} else {
-		g_signal_connect_object (pi->media_player_keys_proxy,
+		g_signal_connect_object (pi->priv->media_player_keys_proxy,
 					 "destroy",
 					 G_CALLBACK (proxy_destroy),
 					 pi, 0);
 	}
 
-	dbus_g_proxy_call (pi->media_player_keys_proxy,
+	dbus_g_proxy_call (pi->priv->media_player_keys_proxy,
 			   "GrabMediaPlayerKeys", NULL,
 			   G_TYPE_STRING, "Totem", G_TYPE_UINT, 0, G_TYPE_INVALID,
 			   G_TYPE_INVALID);
@@ -171,13 +151,13 @@ impl_activate (PeasActivatable *plugin)
 
 	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",
+	dbus_g_proxy_add_signal (pi->priv->media_player_keys_proxy, "MediaPlayerKeyPressed",
 			G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID);
-	dbus_g_proxy_connect_signal (pi->media_player_keys_proxy, "MediaPlayerKeyPressed",
+	dbus_g_proxy_connect_signal (pi->priv->media_player_keys_proxy, "MediaPlayerKeyPressed",
 			G_CALLBACK (on_media_player_key_pressed), totem, NULL);
 
 	window = totem_get_main_window (totem);
-	pi->handler_id = g_signal_connect (G_OBJECT (window), "focus-in-event",
+	pi->priv->handler_id = g_signal_connect (G_OBJECT (window), "focus-in-event",
 			G_CALLBACK (on_window_focus_in_event), pi);
 
 	g_object_unref (G_OBJECT (window));
@@ -189,15 +169,15 @@ impl_deactivate (PeasActivatable *plugin)
 	TotemMediaPlayerKeysPlugin *pi = TOTEM_MEDIA_PLAYER_KEYS_PLUGIN (plugin);
 	GtkWindow *window;
 
-	if (pi->media_player_keys_proxy != NULL) {
-		dbus_g_proxy_call (pi->media_player_keys_proxy,
+	if (pi->priv->media_player_keys_proxy != NULL) {
+		dbus_g_proxy_call (pi->priv->media_player_keys_proxy,
 				   "ReleaseMediaPlayerKeys", NULL,
 				   G_TYPE_STRING, "Totem", G_TYPE_INVALID, G_TYPE_INVALID);
-		g_object_unref (pi->media_player_keys_proxy);
-		pi->media_player_keys_proxy = NULL;
+		g_object_unref (pi->priv->media_player_keys_proxy);
+		pi->priv->media_player_keys_proxy = NULL;
 	}
 
-	if (pi->handler_id != 0) {
+	if (pi->priv->handler_id != 0) {
 		TotemObject *totem;
 
 		totem = g_object_get_data (G_OBJECT (plugin), "object");
@@ -205,7 +185,7 @@ impl_deactivate (PeasActivatable *plugin)
 		if (window == NULL)
 			return;
 
-		g_signal_handler_disconnect (G_OBJECT (window), pi->handler_id);
+		g_signal_handler_disconnect (G_OBJECT (window), pi->priv->handler_id);
 
 		g_object_unref (window);
 	}
diff --git a/src/plugins/mythtv/totem-mythtv.c b/src/plugins/mythtv/totem-mythtv.c
index 14d059a..5baafd3 100644
--- a/src/plugins/mythtv/totem-mythtv.c
+++ b/src/plugins/mythtv/totem-mythtv.c
@@ -68,10 +68,7 @@ enum {
 	NUM_COLS
 };
 
-typedef struct
-{
-	PeasExtensionBase parent;
-
+typedef struct {
 	GList *lst_b_info;
 	GMythUPnP *upnp;
 
@@ -79,7 +76,7 @@ typedef struct
 
 	GtkWidget *sidebar_recordings;
 	GtkWidget *sidebar_livetv;
-} TotemMythtvPlugin;
+} TotemMythtvPluginPrivate;
 
 TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_MYTHTV_PLUGIN, TotemMythtvPlugin, totem_mythtv_plugin)
 
@@ -171,7 +168,7 @@ create_treeview (TotemMythtvPlugin *plugin)
 						    G_TYPE_STRING));
 
 	treeview = GTK_WIDGET (g_object_new (TOTEM_TYPE_VIDEO_LIST,
-					     "totem", plugin->totem,
+					     "totem", plugin->priv->totem,
 					     "mrl-column", URI_COL,
 					     "tooltip-column", DESCRIPTION_COL,
 					     NULL));
@@ -220,7 +217,7 @@ totem_mythtv_list_recordings (TotemMythtvPlugin *tm,
 	gmyth_scheduler_disconnect (scheduler);
 	g_object_unref (scheduler);
 
-	model = g_object_get_data (G_OBJECT (tm->sidebar_recordings), "model");
+	model = g_object_get_data (G_OBJECT (tm->priv->sidebar_recordings), "model");
 
 	for (l = list; l != NULL; l = l->next) {
 		RecordedInfo *recorded_info = (RecordedInfo *) l->data;
@@ -294,7 +291,7 @@ totem_mythtv_list_livetv (TotemMythtvPlugin *tm,
 	gmyth_epg_disconnect (epg);
 	g_object_unref (epg);
 
-	model = g_object_get_data (G_OBJECT (tm->sidebar_livetv), "model");
+	model = g_object_get_data (G_OBJECT (tm->priv->sidebar_livetv), "model");
 	clist = g_list_sort (clist, (GCompareFunc) sort_channels);
 
 	for (ch = clist; ch != NULL; ch = ch->next) {
@@ -325,23 +322,12 @@ totem_mythtv_list_livetv (TotemMythtvPlugin *tm,
 }
 
 static void
-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;
-
-	g_object_class_override_property (object_class, PROP_OBJECT, "object");
-}
-
-static void
 device_found_cb (GMythUPnP *upnp,
 		 GMythBackendInfo *b_info,
 		 TotemMythtvPlugin *plugin)
 {
-	if (!g_list_find (plugin->lst_b_info, b_info)) {
-		plugin->lst_b_info = g_list_append (plugin->lst_b_info,
+	if (!g_list_find (plugin->priv->lst_b_info, b_info)) {
+		plugin->priv->lst_b_info = g_list_append (plugin->priv->lst_b_info,
 				g_object_ref (b_info));
 		totem_mythtv_list_recordings (plugin, b_info);
 		totem_mythtv_list_livetv (plugin, b_info);
@@ -356,10 +342,10 @@ device_lost_cb (GMythUPnP *upnp,
 	GList *elem;
 	GMythBackendInfo *b_info;
 
-	elem = g_list_find (plugin->lst_b_info, info);
+	elem = g_list_find (plugin->priv->lst_b_info, info);
 	if (elem && elem->data) {
 		b_info = elem->data;
-		plugin->lst_b_info = g_list_remove (plugin->lst_b_info,
+		plugin->priv->lst_b_info = g_list_remove (plugin->priv->lst_b_info,
 				b_info);
 		g_object_unref (b_info);
 	}
@@ -373,40 +359,40 @@ totem_mythtv_update_binfo (TotemMythtvPlugin *plugin)
 	GList *w;
 
 	/* Clear old b_info */
-	if (plugin->lst_b_info != NULL) {
-		g_list_foreach (plugin->lst_b_info, (GFunc) g_object_unref, NULL);
-		g_list_free (plugin->lst_b_info);
-		plugin->lst_b_info = NULL;
+	if (plugin->priv->lst_b_info != NULL) {
+		g_list_foreach (plugin->priv->lst_b_info, (GFunc) g_object_unref, NULL);
+		g_list_free (plugin->priv->lst_b_info);
+		plugin->priv->lst_b_info = NULL;
 	}
 
 
 	/* Using GMythUPnP to search for avaliable servers */
-	if (plugin->upnp == NULL) {
-		plugin->upnp = gmyth_upnp_get_instance ();
-		g_signal_connect (G_OBJECT (plugin->upnp),
+	if (plugin->priv->upnp == NULL) {
+		plugin->priv->upnp = gmyth_upnp_get_instance ();
+		g_signal_connect (G_OBJECT (plugin->priv->upnp),
 						  "device-found",
 						  G_CALLBACK (device_found_cb),
 						  plugin);
-		plugin->upnp = gmyth_upnp_get_instance ();
-		g_signal_connect (G_OBJECT (plugin->upnp),
+		plugin->priv->upnp = gmyth_upnp_get_instance ();
+		g_signal_connect (G_OBJECT (plugin->priv->upnp),
 						  "device-lost",
 						  G_CALLBACK (device_lost_cb),
 						  plugin);
 	}
 
 	/* Load current servers */
-	lst = gmyth_upnp_get_devices (plugin->upnp);
+	lst = gmyth_upnp_get_devices (plugin->priv->upnp);
 	for (w = lst; w != NULL; w = w->next) {
 		GMythBackendInfo *b_info;
 
 		b_info = (GMythBackendInfo *) w->data;
-		plugin->lst_b_info = g_list_append (plugin->lst_b_info,
+		plugin->priv->lst_b_info = g_list_append (plugin->priv->lst_b_info,
 				b_info);
 		totem_mythtv_list_recordings (plugin, b_info);
 		totem_mythtv_list_livetv (plugin, b_info);
 	}
 	g_list_free (lst);
-	gmyth_upnp_search (plugin->upnp);
+	gmyth_upnp_search (plugin->priv->upnp);
 }
 
 static void
@@ -415,26 +401,21 @@ refresh_cb (GtkWidget *button, TotemMythtvPlugin *tm)
 	GtkTreeModel *model;
 
 	gtk_widget_set_sensitive (button, FALSE);
-	totem_gdk_window_set_waiting_cursor (gtk_widget_get_window (tm->sidebar_recordings));
-	totem_gdk_window_set_waiting_cursor (gtk_widget_get_window (tm->sidebar_livetv));
+	totem_gdk_window_set_waiting_cursor (gtk_widget_get_window (tm->priv->sidebar_recordings));
+	totem_gdk_window_set_waiting_cursor (gtk_widget_get_window (tm->priv->sidebar_livetv));
 
-	model = g_object_get_data (G_OBJECT (tm->sidebar_recordings), "model");
+	model = g_object_get_data (G_OBJECT (tm->priv->sidebar_recordings), "model");
 	gtk_list_store_clear (GTK_LIST_STORE (model));
-	model = g_object_get_data (G_OBJECT (tm->sidebar_livetv), "model");
+	model = g_object_get_data (G_OBJECT (tm->priv->sidebar_livetv), "model");
 	gtk_list_store_clear (GTK_LIST_STORE (model));
 
 	totem_mythtv_update_binfo (tm);
 
-	gdk_window_set_cursor (gtk_widget_get_window (tm->sidebar_recordings), NULL);
-	gdk_window_set_cursor (gtk_widget_get_window (tm->sidebar_livetv), NULL);
+	gdk_window_set_cursor (gtk_widget_get_window (tm->priv->sidebar_recordings), NULL);
+	gdk_window_set_cursor (gtk_widget_get_window (tm->priv->sidebar_livetv), NULL);
 	gtk_widget_set_sensitive (button, TRUE);
 }
 
-static void
-totem_mythtv_plugin_init (TotemMythtvPlugin *plugin)
-{
-}
-
 static GtkWidget *
 add_sidebar (TotemMythtvPlugin *tm, const char *name, const char *label)
 {
@@ -454,7 +435,7 @@ add_sidebar (TotemMythtvPlugin *tm, const char *name, const char *label)
 	gtk_container_add (GTK_CONTAINER (box), scrolled);
 	gtk_box_pack_end (GTK_BOX (box), button, FALSE, FALSE, 0);
 	gtk_widget_show_all (box);
-	totem_add_sidebar_page (tm->totem, name, label, box);
+	totem_add_sidebar_page (tm->priv->totem, name, label, box);
 
 	g_object_set_data (G_OBJECT (box), "treeview", treeview);
 	g_object_set_data (G_OBJECT (box), "model",
@@ -468,10 +449,10 @@ impl_activate (PeasActivatable *plugin)
 {
 	TotemMythtvPlugin *tm = TOTEM_MYTHTV_PLUGIN(plugin);
 
-	tm->totem = g_object_ref (g_object_get_data (G_OBJECT (plugin), "object"));
+	tm->priv->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"));
+	tm->priv->sidebar_recordings = add_sidebar (tm, "mythtv-recordings", _("MythTV Recordings"));
+	tm->priv->sidebar_livetv = add_sidebar (tm, "mythtv-livetv", _("MythTV LiveTV"));
 
 	totem_mythtv_update_binfo (TOTEM_MYTHTV_PLUGIN(plugin));
 
@@ -489,26 +470,26 @@ impl_deactivate	(PeasActivatable *plugin)
 {
 	TotemMythtvPlugin *tm = TOTEM_MYTHTV_PLUGIN(plugin);
 
-	totem_remove_sidebar_page (tm->totem, MYTHTV_SIDEBAR_RECORDINGS);
-	totem_remove_sidebar_page (tm->totem, MYTHTV_SIDEBAR_LIVETV);
+	totem_remove_sidebar_page (tm->priv->totem, MYTHTV_SIDEBAR_RECORDINGS);
+	totem_remove_sidebar_page (tm->priv->totem, MYTHTV_SIDEBAR_LIVETV);
 
-	if (tm->lst_b_info != NULL) {
-		g_list_foreach (tm->lst_b_info, (GFunc ) g_object_unref, NULL);
-		g_list_free (tm->lst_b_info);
-		tm->lst_b_info = NULL;
+	if (tm->priv->lst_b_info != NULL) {
+		g_list_foreach (tm->priv->lst_b_info, (GFunc ) g_object_unref, NULL);
+		g_list_free (tm->priv->lst_b_info);
+		tm->priv->lst_b_info = NULL;
 	}
-	if (tm->upnp != NULL) {
-		g_object_unref (tm->upnp);
-		tm->upnp = NULL;
+	if (tm->priv->upnp != NULL) {
+		g_object_unref (tm->priv->upnp);
+		tm->priv->upnp = NULL;
 	}
-	if (tm->sidebar_recordings != NULL) {
-		gtk_widget_destroy (tm->sidebar_recordings);
-		tm->sidebar_recordings = NULL;
+	if (tm->priv->sidebar_recordings != NULL) {
+		gtk_widget_destroy (tm->priv->sidebar_recordings);
+		tm->priv->sidebar_recordings = NULL;
 	}
-	if (tm->sidebar_livetv != NULL) {
-		gtk_widget_destroy (tm->sidebar_livetv);
-		tm->sidebar_livetv = NULL;
+	if (tm->priv->sidebar_livetv != NULL) {
+		gtk_widget_destroy (tm->priv->sidebar_livetv);
+		tm->priv->sidebar_livetv = NULL;
 	}
-	g_object_unref (tm->totem);
+	g_object_unref (tm->priv->totem);
 }
 
diff --git a/src/plugins/ontop/totem-ontop.c b/src/plugins/ontop/totem-ontop.c
index cb3f972..a0f448f 100644
--- a/src/plugins/ontop/totem-ontop.c
+++ b/src/plugins/ontop/totem-ontop.c
@@ -54,34 +54,9 @@ typedef struct
 	TotemObject *totem;
 } TotemOntopPluginPrivate;
 
-typedef struct
-{
-	PeasExtensionBase parent;
-	TotemOntopPluginPrivate *priv;
-} TotemOntopPlugin;
-
 TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_ONTOP_PLUGIN, TotemOntopPlugin, totem_ontop_plugin)
 
 static void
-totem_ontop_plugin_class_init (TotemOntopPluginClass *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 (TotemOntopPluginPrivate));
-}
-
-static void
-totem_ontop_plugin_init (TotemOntopPlugin *plugin)
-{
-	plugin->priv = G_TYPE_INSTANCE_GET_PRIVATE (plugin, TOTEM_TYPE_ONTOP_PLUGIN, TotemOntopPluginPrivate);
-}
-
-static void
 update_from_state (TotemOntopPluginPrivate *priv)
 {
 	GValue has_video = { 0, };
diff --git a/src/plugins/properties/totem-movie-properties.c b/src/plugins/properties/totem-movie-properties.c
index b0015e0..29b3973 100644
--- a/src/plugins/properties/totem-movie-properties.c
+++ b/src/plugins/properties/totem-movie-properties.c
@@ -47,35 +47,16 @@
 #define TOTEM_IS_MOVIE_PROPERTIES_PLUGIN_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), TOTEM_TYPE_MOVIE_PROPERTIES_PLUGIN))
 #define TOTEM_MOVIE_PROPERTIES_PLUGIN_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), TOTEM_TYPE_MOVIE_PROPERTIES_PLUGIN, TotemMoviePropertiesPluginClass))
 
-typedef struct
-{
-	PeasExtensionBase parent;
-
+typedef struct {
 	GtkWidget    *props;
 	guint         handler_id_stream_length;
-} TotemMoviePropertiesPlugin;
+} TotemMoviePropertiesPluginPrivate;
 
 TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_MOVIE_PROPERTIES_PLUGIN,
 		      TotemMoviePropertiesPlugin,
 		      totem_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
-totem_movie_properties_plugin_init (TotemMoviePropertiesPlugin *plugin)
-{
-}
-
-static void
 stream_length_notify_cb (TotemObject *totem,
 			 GParamSpec *arg1,
 			 TotemMoviePropertiesPlugin *plugin)
@@ -87,7 +68,7 @@ stream_length_notify_cb (TotemObject *totem,
 		      NULL);
 
 	bacon_video_widget_properties_from_time
-		(BACON_VIDEO_WIDGET_PROPERTIES (plugin->props),
+		(BACON_VIDEO_WIDGET_PROPERTIES (plugin->priv->props),
 		 stream_length);
 }
 
@@ -100,9 +81,9 @@ totem_movie_properties_plugin_file_opened (TotemObject *totem,
 
 	bvw = totem_get_video_widget (totem);
 	bacon_video_widget_properties_update
-		(BACON_VIDEO_WIDGET_PROPERTIES (plugin->props), bvw);
+		(BACON_VIDEO_WIDGET_PROPERTIES (plugin->priv->props), bvw);
 	g_object_unref (bvw);
-	gtk_widget_set_sensitive (plugin->props, TRUE);
+	gtk_widget_set_sensitive (plugin->priv->props, TRUE);
 }
 
 static void
@@ -111,8 +92,8 @@ totem_movie_properties_plugin_file_closed (TotemObject *totem,
 {
         /* Reset the properties and wait for the signal*/
         bacon_video_widget_properties_reset
-		(BACON_VIDEO_WIDGET_PROPERTIES (plugin->props));
-	gtk_widget_set_sensitive (plugin->props, FALSE);
+		(BACON_VIDEO_WIDGET_PROPERTIES (plugin->priv->props));
+	gtk_widget_set_sensitive (plugin->priv->props, FALSE);
 }
 
 static void
@@ -127,7 +108,7 @@ totem_movie_properties_plugin_metadata_updated (TotemObject *totem,
 
 	bvw = totem_get_video_widget (totem);
 	bacon_video_widget_properties_update
-		(BACON_VIDEO_WIDGET_PROPERTIES (plugin->props), bvw);
+		(BACON_VIDEO_WIDGET_PROPERTIES (plugin->priv->props), bvw);
 	g_object_unref (bvw);
 }
 
@@ -140,13 +121,13 @@ impl_activate (PeasActivatable *plugin)
 	pi = TOTEM_MOVIE_PROPERTIES_PLUGIN (plugin);
 	totem = g_object_get_data (G_OBJECT (plugin), "object");
 
-	pi->props = bacon_video_widget_properties_new ();
-	gtk_widget_show (pi->props);
+	pi->priv->props = bacon_video_widget_properties_new ();
+	gtk_widget_show (pi->priv->props);
 	totem_add_sidebar_page (totem,
 				"properties",
 				_("Properties"),
-				pi->props);
-	gtk_widget_set_sensitive (pi->props, FALSE);
+				pi->priv->props);
+	gtk_widget_set_sensitive (pi->priv->props, FALSE);
 
 	g_signal_connect (G_OBJECT (totem),
 			  "file-opened",
@@ -160,7 +141,7 @@ impl_activate (PeasActivatable *plugin)
 			  "metadata-updated",
 			  G_CALLBACK (totem_movie_properties_plugin_metadata_updated),
 			  plugin);
-	pi->handler_id_stream_length = g_signal_connect (G_OBJECT (totem),
+	pi->priv->handler_id_stream_length = g_signal_connect (G_OBJECT (totem),
 							 "notify::stream-length",
 							 G_CALLBACK (stream_length_notify_cb),
 							 plugin);
@@ -175,7 +156,7 @@ impl_deactivate (PeasActivatable *plugin)
 	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_handler_disconnect (G_OBJECT (totem), pi->priv->handler_id_stream_length);
 	g_signal_handlers_disconnect_by_func (G_OBJECT (totem),
 					      totem_movie_properties_plugin_metadata_updated,
 					      plugin);
@@ -185,7 +166,7 @@ impl_deactivate (PeasActivatable *plugin)
 	g_signal_handlers_disconnect_by_func (G_OBJECT (totem),
 					      totem_movie_properties_plugin_file_closed,
 					      plugin);
-	pi->handler_id_stream_length = 0;
+	pi->priv->handler_id_stream_length = 0;
 	totem_remove_sidebar_page (totem, "properties");
 }
 
diff --git a/src/plugins/publish/totem-publish.c b/src/plugins/publish/totem-publish.c
index 8068ec7..6049f6c 100644
--- a/src/plugins/publish/totem-publish.c
+++ b/src/plugins/publish/totem-publish.c
@@ -67,10 +67,7 @@ enum
 	LAST_COLUMN
 };
 
-typedef struct
-{
-	PeasExtensionBase parent;
-
+typedef struct {
 	TotemObject       *totem;
 	GSettings         *gsettings;
 	GtkWidget         *settings;
@@ -86,7 +83,9 @@ typedef struct
 
 	gulong item_added_id;
 	gulong item_removed_id;
-} TotemPublishPlugin;
+} TotemPublishPluginPrivate;
+
+TOTEM_PLUGIN_REGISTER_CONFIGURABLE (TOTEM_TYPE_PUBLISH_PLUGIN, TotemPublishPlugin, totem_publish_plugin);
 
 void totem_publish_plugin_service_name_entry_changed_cb	   (GtkEntry        *entry,
 							    TotemPublishPlugin *self);
@@ -101,7 +100,6 @@ void totem_publish_plugin_neighbours_list_row_activated_cb (GtkTreeView       *v
 							    gpointer           data);
 
 G_LOCK_DEFINE_STATIC(totem_publish_plugin_lock);
-TOTEM_PLUGIN_REGISTER_CONFIGURABLE (TOTEM_TYPE_PUBLISH_PLUGIN, TotemPublishPlugin, totem_publish_plugin);
 
 static void
 totem_publish_plugin_name_changed_cb (GSettings *settings, const gchar *key, TotemPublishPlugin *self)
@@ -112,7 +110,7 @@ totem_publish_plugin_name_changed_cb (GSettings *settings, const gchar *key, Tot
 	name = epc_publisher_expand_name (pattern, NULL);
 	g_free (pattern);
 
-	epc_publisher_set_service_name (self->publisher, name);
+	epc_publisher_set_service_name (self->priv->publisher, name);
 
 	g_free (name);
 }
@@ -120,13 +118,13 @@ totem_publish_plugin_name_changed_cb (GSettings *settings, const gchar *key, Tot
 void
 totem_publish_plugin_service_name_entry_changed_cb (GtkEntry *entry, TotemPublishPlugin *self)
 {
-	g_settings_set_string (self->gsettings, "name-format", gtk_entry_get_text (entry));
+	g_settings_set_string (self->priv->gsettings, "name-format", gtk_entry_get_text (entry));
 }
 
 void
 totem_publish_plugin_encryption_button_toggled_cb (GtkToggleButton *button, TotemPublishPlugin *self)
 {
-	g_settings_set_string (self->gsettings, "protocol", gtk_toggle_button_get_active (button) ? "https" : "http");
+	g_settings_set_string (self->priv->gsettings, "protocol", gtk_toggle_button_get_active (button) ? "https" : "http");
 }
 
 static void
@@ -140,9 +138,9 @@ totem_publish_plugin_protocol_changed_cb (GSettings *settings, const gchar *key,
 	protocol = epc_protocol_from_name (protocol_name, EPC_PROTOCOL_HTTPS);
 	g_free (protocol_name);
 
-	epc_publisher_quit (self->publisher);
-	epc_publisher_set_protocol (self->publisher, protocol);
-	epc_publisher_run_async (self->publisher, &error);
+	epc_publisher_quit (self->priv->publisher);
+	epc_publisher_set_protocol (self->priv->publisher, protocol);
+	epc_publisher_run_async (self->priv->publisher, &error);
 
 	if (error) {
 		g_warning ("%s: %s", G_STRFUNC, error->message);
@@ -171,9 +169,9 @@ totem_publish_plugin_playlist_cb (EpcPublisher *publisher,
 
 	g_string_append_printf (buffer,
 				"[playlist]\nNumberOfEntries=%d\n",
-				g_slist_length (self->playlist));
+				g_slist_length (self->priv->playlist));
 
-	for (iter = self->playlist, i = 1; iter; iter = iter->next, ++i) {
+	for (iter = self->priv->playlist, i = 1; iter; iter = iter->next, ++i) {
 		gchar *file_key = iter->data;
 		gchar *uri;
 
@@ -257,7 +255,7 @@ totem_publish_plugin_rebuild_playlist_cb (TotemPlaylist *playlist,
 {
 	TotemPublishPlugin *self = TOTEM_PUBLISH_PLUGIN (data);
 	gchar *key = totem_publish_plugin_build_key (filename);
-	self->playlist = g_slist_prepend (self->playlist, key);
+	self->priv->playlist = g_slist_prepend (self->priv->playlist, key);
 }
 
 static void
@@ -268,15 +266,15 @@ totem_publish_plugin_playlist_changed_cb (TotemPlaylist *playlist,
 
 	G_LOCK (totem_publish_plugin_lock);
 
-	g_slist_foreach (self->playlist, (GFunc) g_free, NULL);
-	g_slist_free (self->playlist);
-	self->playlist = NULL;
+	g_slist_foreach (self->priv->playlist, (GFunc) g_free, NULL);
+	g_slist_free (self->priv->playlist);
+	self->priv->playlist = NULL;
 
 	totem_playlist_foreach (playlist,
 				totem_publish_plugin_rebuild_playlist_cb,
 				self);
 
-	self->playlist = g_slist_reverse (self->playlist);
+	self->priv->playlist = g_slist_reverse (self->priv->playlist);
 
 	G_UNLOCK (totem_publish_plugin_lock);
 }
@@ -290,7 +288,7 @@ totem_publish_plugin_playlist_item_added_cb (TotemPlaylist *playlist,
 	TotemPublishPlugin *self = TOTEM_PUBLISH_PLUGIN (data);
 	gchar *key = totem_publish_plugin_build_key (filename);
 
-	epc_publisher_add_handler (self->publisher, key,
+	epc_publisher_add_handler (self->priv->publisher, key,
 				   totem_publish_plugin_media_cb,
 				   g_strdup (url), g_free);
 
@@ -306,7 +304,7 @@ totem_publish_plugin_playlist_item_removed_cb (TotemPlaylist *playlist,
 {
 	TotemPublishPlugin *self = TOTEM_PUBLISH_PLUGIN (data);
 	gchar *key = totem_publish_plugin_build_key (filename);
-	epc_publisher_remove (self->publisher, key);
+	epc_publisher_remove (self->priv->publisher, key);
 	g_free (key);
 }
 
@@ -317,8 +315,8 @@ totem_publish_plugin_service_found_cb (TotemPublishPlugin *self,
 {
 	GtkTreeIter iter;
 
-	gtk_list_store_append (self->neighbours, &iter);
-	gtk_list_store_set (self->neighbours, &iter, NAME_COLUMN, name,
+	gtk_list_store_append (self->priv->neighbours, &iter);
+	gtk_list_store_set (self->priv->neighbours, &iter, NAME_COLUMN, name,
 						     INFO_COLUMN, info,
 						     -1);
 }
@@ -328,7 +326,7 @@ totem_publish_plugin_service_removed_cb (TotemPublishPlugin *self,
 					 const gchar        *name,
 					 const gchar        *type)
 {
-	GtkTreeModel *model = GTK_TREE_MODEL (self->neighbours);
+	GtkTreeModel *model = GTK_TREE_MODEL (self->priv->neighbours);
 	GtkTreeIter iter;
 
 	if (gtk_tree_model_get_iter_first (model, &iter)) {
@@ -349,7 +347,7 @@ totem_publish_plugin_service_removed_cb (TotemPublishPlugin *self,
 			path = path_iter->data;
 
 			if (gtk_tree_model_get_iter (model, &iter, path))
-				gtk_list_store_remove (self->neighbours, &iter);
+				gtk_list_store_remove (self->priv->neighbours, &iter);
 
 			gtk_tree_path_free (path);
 		}
@@ -362,13 +360,13 @@ static void
 totem_publish_plugin_scanning_done_cb (TotemPublishPlugin *self,
 				       const gchar        *type)
 {
-	if (self->scanning_id) {
-		g_source_remove (self->scanning_id);
-		self->scanning_id = 0;
+	if (self->priv->scanning_id) {
+		g_source_remove (self->priv->scanning_id);
+		self->priv->scanning_id = 0;
 	}
 
-	if (self->scanning)
-		gtk_widget_hide (self->scanning);
+	if (self->priv->scanning)
+		gtk_widget_hide (self->priv->scanning);
 }
 
 static void
@@ -392,8 +390,8 @@ totem_publish_plugin_load_playlist (TotemPublishPlugin   *self,
 		if (error)
 			goto out;
 
-		ev_sidebar_set_current_page (EV_SIDEBAR (self->totem->sidebar), "playlist");
-		totem_playlist_clear (self->totem->playlist);
+		ev_sidebar_set_current_page (EV_SIDEBAR (self->priv->totem->sidebar), "playlist");
+		totem_playlist_clear (self->priv->totem->playlist);
 
 		for (i = 0; i < n_entries; ++i) {
 			gchar *key, *mrl, *title;
@@ -407,7 +405,7 @@ totem_publish_plugin_load_playlist (TotemPublishPlugin   *self,
 			g_free (key);
 
 			if (mrl)
-				totem_playlist_add_mrl (self->totem->playlist, mrl, title, FALSE, NULL, NULL, NULL);
+				totem_playlist_add_mrl (self->priv->totem->playlist, mrl, title, FALSE, NULL, NULL, NULL);
 
 			g_free (title);
 			g_free (mrl);
@@ -436,8 +434,8 @@ totem_publish_plugin_neighbours_list_row_activated_cb (GtkTreeView       *view,
 	EpcServiceInfo *info = NULL;
 	GtkTreeIter iter;
 
-	if (gtk_tree_model_get_iter (GTK_TREE_MODEL (self->neighbours), &iter, path)) {
-		gtk_tree_model_get (GTK_TREE_MODEL (self->neighbours),
+	if (gtk_tree_model_get_iter (GTK_TREE_MODEL (self->priv->neighbours), &iter, path)) {
+		gtk_tree_model_get (GTK_TREE_MODEL (self->priv->neighbours),
 				    &iter, INFO_COLUMN, &info, -1);
 		totem_publish_plugin_load_playlist (self, info);
 		epc_service_info_unref (info);
@@ -459,23 +457,23 @@ totem_publish_plugin_create_neigbours_page (TotemPublishPlugin *self, GtkBuilder
 	page = GTK_WIDGET (gtk_builder_get_object (builder, "neighbours-page"));
 	list = GTK_WIDGET (gtk_builder_get_object (builder, "neighbours-list"));
 
-	self->scanning = GTK_WIDGET (gtk_builder_get_object (builder, "neighbours-scanning"));
-	self->scanning_id = g_timeout_add (100, totem_publish_plugin_scanning_cb, self->scanning);
+	self->priv->scanning = GTK_WIDGET (gtk_builder_get_object (builder, "neighbours-scanning"));
+	self->priv->scanning_id = g_timeout_add (100, totem_publish_plugin_scanning_cb, self->priv->scanning);
 
-	g_signal_connect_swapped (self->monitor, "service-found",
+	g_signal_connect_swapped (self->priv->monitor, "service-found",
 				  G_CALLBACK (totem_publish_plugin_service_found_cb),
 				  self);
-	g_signal_connect_swapped (self->monitor, "service-removed",
+	g_signal_connect_swapped (self->priv->monitor, "service-removed",
 				  G_CALLBACK (totem_publish_plugin_service_removed_cb),
 				  self);
-	g_signal_connect_swapped (self->monitor, "scanning-done",
+	g_signal_connect_swapped (self->priv->monitor, "scanning-done",
 				  G_CALLBACK (totem_publish_plugin_scanning_done_cb),
 				  self);
 
-	self->neighbours = gtk_list_store_new (LAST_COLUMN, G_TYPE_STRING, EPC_TYPE_SERVICE_INFO);
+	self->priv->neighbours = gtk_list_store_new (LAST_COLUMN, G_TYPE_STRING, EPC_TYPE_SERVICE_INFO);
 
 	gtk_tree_view_set_model (GTK_TREE_VIEW (list),
-				 GTK_TREE_MODEL (self->neighbours));
+				 GTK_TREE_MODEL (self->priv->neighbours));
 
 	gtk_tree_view_append_column (GTK_TREE_VIEW (list),
 		gtk_tree_view_column_new_with_attributes (
@@ -492,6 +490,7 @@ static void
 impl_activate (PeasActivatable *plugin)
 {
 	TotemPublishPlugin *self = TOTEM_PUBLISH_PLUGIN (plugin);
+	TotemPublishPluginPrivate *priv = self->priv;
 	EpcProtocol protocol = EPC_PROTOCOL_HTTPS;
 	GtkWindow *window;
 	GtkBuilder *builder;
@@ -502,35 +501,35 @@ impl_activate (PeasActivatable *plugin)
 	gchar *service_pattern;
 	gchar *service_name;
 
-	g_return_if_fail (NULL == self->publisher);
-	g_return_if_fail (NULL == self->totem);
+	g_return_if_fail (NULL == priv->publisher);
+	g_return_if_fail (NULL == priv->totem);
 
 	G_LOCK (totem_publish_plugin_lock);
 
-	self->totem = g_object_ref (g_object_get_data (G_OBJECT (plugin), "object"));
+	priv->totem = g_object_ref (g_object_get_data (G_OBJECT (plugin), "object"));
 
-	window = totem_get_main_window (self->totem);
+	window = totem_get_main_window (priv->totem);
 	builder = totem_plugin_load_interface ("publish", "publish-plugin.ui", TRUE, window, self);
 	epc_progress_window_install (window);
 	g_object_unref (window);
 
-	self->gsettings = g_settings_new (TOTEM_PUBLISH_SCHEMA);
+	priv->gsettings = g_settings_new (TOTEM_PUBLISH_SCHEMA);
 
-	protocol_name = g_settings_get_string (self->gsettings, "protocol");
-	service_pattern = g_settings_get_string (self->gsettings, "name-format");
+	protocol_name = g_settings_get_string (priv->gsettings, "protocol");
+	service_pattern = g_settings_get_string (priv->gsettings, "name-format");
 
 	if (*protocol_name == '\0') {
 		protocol_name = g_strdup ("http");
-		g_settings_set_string (self->gsettings, "protocol", protocol_name);
+		g_settings_set_string (priv->gsettings, "protocol", protocol_name);
 	}
 
 	if (*service_pattern == '\0') {
 		service_pattern = g_strdup ("%a of %u on %h");
-		g_settings_set_string (self->gsettings, "name-format", service_pattern);
+		g_settings_set_string (priv->gsettings, "name-format", service_pattern);
 	}
 
-	g_signal_connect (self->gsettings, "changed::name", (GCallback) totem_publish_plugin_name_changed_cb, self);
-	g_signal_connect (self->gsettings, "changed::protocol", (GCallback) totem_publish_plugin_protocol_changed_cb, self);
+	g_signal_connect (priv->gsettings, "changed::name", (GCallback) totem_publish_plugin_name_changed_cb, self);
+	g_signal_connect (priv->gsettings, "changed::protocol", (GCallback) totem_publish_plugin_protocol_changed_cb, self);
 
 	protocol = epc_protocol_from_name (protocol_name, EPC_PROTOCOL_HTTPS);
 	service_name = epc_publisher_expand_name (service_pattern, &internal_error);
@@ -541,40 +540,40 @@ impl_activate (PeasActivatable *plugin)
 		g_clear_error (&internal_error);
 	}
 
-	self->monitor = epc_service_monitor_new ("totem", NULL, EPC_PROTOCOL_UNKNOWN);
-	epc_service_monitor_set_skip_our_own (self->monitor, TRUE);
+	priv->monitor = epc_service_monitor_new ("totem", NULL, EPC_PROTOCOL_UNKNOWN);
+	epc_service_monitor_set_skip_our_own (priv->monitor, TRUE);
 
 	/* Translators: computers on the local network which are publishing their playlists over the network */
-	ev_sidebar_add_page (EV_SIDEBAR (self->totem->sidebar), "neighbours", _("Neighbors"),
+	ev_sidebar_add_page (EV_SIDEBAR (priv->totem->sidebar), "neighbours", _("Neighbors"),
 			     totem_publish_plugin_create_neigbours_page (self, builder));
 	g_object_unref (builder);
 
-	self->publisher = epc_publisher_new (service_name, "totem", NULL);
-	epc_publisher_set_protocol (self->publisher, protocol);
+	priv->publisher = epc_publisher_new (service_name, "totem", NULL);
+	epc_publisher_set_protocol (priv->publisher, protocol);
 
 	g_free (protocol_name);
 	g_free (service_name);
 
-	epc_publisher_add_handler (self->publisher, "playlist.pls",
+	epc_publisher_add_handler (priv->publisher, "playlist.pls",
 				   totem_publish_plugin_playlist_cb,
 				   self, NULL);
-	epc_publisher_add_bookmark (self->publisher, "playlist.pls", NULL);
+	epc_publisher_add_bookmark (priv->publisher, "playlist.pls", NULL);
 
-	self->item_added_id = g_signal_connect (self->totem->playlist, "changed",
+	priv->item_added_id = g_signal_connect (priv->totem->playlist, "changed",
 		G_CALLBACK (totem_publish_plugin_playlist_changed_cb), self);
-	self->item_added_id = g_signal_connect (self->totem->playlist, "item-added",
+	priv->item_added_id = g_signal_connect (priv->totem->playlist, "item-added",
 		G_CALLBACK (totem_publish_plugin_playlist_item_added_cb), self);
-	self->item_removed_id = g_signal_connect (self->totem->playlist, "item-removed",
+	priv->item_removed_id = g_signal_connect (priv->totem->playlist, "item-removed",
 		G_CALLBACK (totem_publish_plugin_playlist_item_removed_cb), self);
 
 	G_UNLOCK (totem_publish_plugin_lock);
 
-	totem_playlist_foreach (self->totem->playlist,
+	totem_playlist_foreach (priv->totem->playlist,
 				totem_publish_plugin_playlist_item_added_cb, self);
 
-	totem_publish_plugin_playlist_changed_cb (self->totem->playlist, self);
+	totem_publish_plugin_playlist_changed_cb (priv->totem->playlist, self);
 
-	epc_publisher_run_async (self->publisher, NULL);
+	epc_publisher_run_async (priv->publisher, NULL);
 
 	return;
 }
@@ -583,64 +582,65 @@ static void
 impl_deactivate (PeasActivatable *plugin)
 {
 	TotemPublishPlugin *self = TOTEM_PUBLISH_PLUGIN (plugin);
+	TotemPublishPluginPrivate *priv = self->priv;
 	TotemPlaylist *playlist = NULL;
 
 	G_LOCK (totem_publish_plugin_lock);
 
-	if (self->totem)
-		playlist = self->totem->playlist;
+	if (priv->totem)
+		playlist = priv->totem->playlist;
 
-	if (self->scanning_id) {
-		g_source_remove (self->scanning_id);
-		self->scanning_id = 0;
+	if (priv->scanning_id) {
+		g_source_remove (priv->scanning_id);
+		priv->scanning_id = 0;
 	}
 
-	if (playlist && self->item_added_id) {
-		g_signal_handler_disconnect (playlist, self->item_added_id);
-		self->item_added_id = 0;
+	if (playlist && priv->item_added_id) {
+		g_signal_handler_disconnect (playlist, priv->item_added_id);
+		priv->item_added_id = 0;
 	}
 
-	if (playlist && self->item_removed_id) {
-		g_signal_handler_disconnect (playlist, self->item_removed_id);
-		self->item_removed_id = 0;
+	if (playlist && priv->item_removed_id) {
+		g_signal_handler_disconnect (playlist, priv->item_removed_id);
+		priv->item_removed_id = 0;
 	}
 
-	if (self->monitor) {
-		g_object_unref (self->monitor);
-		self->monitor = NULL;
+	if (priv->monitor) {
+		g_object_unref (priv->monitor);
+		priv->monitor = NULL;
 	}
 
-	if (self->publisher) {
-		epc_publisher_quit (self->publisher);
-		g_object_unref (self->publisher);
-		self->publisher = NULL;
+	if (priv->publisher) {
+		epc_publisher_quit (priv->publisher);
+		g_object_unref (priv->publisher);
+		priv->publisher = NULL;
 	}
 
-	if (self->gsettings != NULL)
-		g_object_unref (self->gsettings);
-	self->gsettings = NULL;
+	if (priv->gsettings != NULL)
+		g_object_unref (priv->gsettings);
+	priv->gsettings = NULL;
 
-	if (self->totem) {
-		ev_sidebar_remove_page (EV_SIDEBAR (self->totem->sidebar), "neighbours");
+	if (priv->totem) {
+		ev_sidebar_remove_page (EV_SIDEBAR (priv->totem->sidebar), "neighbours");
 
-		g_object_unref (self->totem);
-		self->totem = NULL;
+		g_object_unref (priv->totem);
+		priv->totem = NULL;
 	}
 
-	if (self->settings) {
-		gtk_widget_destroy (self->settings);
-		self->settings = NULL;
+	if (priv->settings) {
+		gtk_widget_destroy (priv->settings);
+		priv->settings = NULL;
 	}
 
-	if (self->playlist) {
-		g_slist_foreach (self->playlist, (GFunc) g_free, NULL);
-		g_slist_free (self->playlist);
-		self->playlist = NULL;
+	if (priv->playlist) {
+		g_slist_foreach (priv->playlist, (GFunc) g_free, NULL);
+		g_slist_free (priv->playlist);
+		priv->playlist = NULL;
 	}
 
 	G_UNLOCK (totem_publish_plugin_lock);
 
-	self->scanning = NULL;
+	priv->scanning = NULL;
 }
 
 static GtkWidget *
@@ -674,20 +674,3 @@ impl_create_configure_widget (PeasGtkConfigurable *configurable)
 
 	return widget;
 }
-
-static void
-totem_publish_plugin_init (TotemPublishPlugin *self)
-{
-}
-
-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;
-
-	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 0342ce3..ae47f8b 100644
--- a/src/plugins/screensaver/totem-screensaver.c
+++ b/src/plugins/screensaver/totem-screensaver.c
@@ -47,9 +47,7 @@
 #define TOTEM_IS_SCREENSAVER_PLUGIN_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), TOTEM_TYPE_SCREENSAVER_PLUGIN))
 #define TOTEM_SCREENSAVER_PLUGIN_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), TOTEM_TYPE_SCREENSAVER_PLUGIN, TotemScreensaverPluginClass))
 
-typedef struct
-{
-	PeasExtensionBase parent;
+typedef struct {
 	TotemObject *totem;
 	BaconVideoWidget *bvw;
 	GSettings *settings;
@@ -57,29 +55,13 @@ typedef struct
 	TotemScrsaver *scr;
 	guint          handler_id_playing;
 	guint          handler_id_metadata;
-} TotemScreensaverPlugin;
+} TotemScreensaverPluginPrivate;
 
 TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_SCREENSAVER_PLUGIN,
 		      TotemScreensaverPlugin,
 		      totem_screensaver_plugin)
 
 static void
-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;
-
-	g_object_class_override_property (object_class, PROP_OBJECT, "object");
-}
-
-static void
-totem_screensaver_plugin_init (TotemScreensaverPlugin *plugin)
-{
-}
-
-static void
 totem_screensaver_update_from_state (TotemObject *totem,
 				     TotemScreensaverPlugin *pi)
 {
@@ -88,15 +70,15 @@ totem_screensaver_update_from_state (TotemObject *totem,
 
 	bvw = BACON_VIDEO_WIDGET (totem_get_video_widget ((Totem *)(totem)));
 
-	lock_screensaver_on_audio = g_settings_get_boolean (pi->settings, "lock-screensaver-on-audio");
+	lock_screensaver_on_audio = g_settings_get_boolean (pi->priv->settings, "lock-screensaver-on-audio");
 	can_get_frames = bacon_video_widget_can_get_frames (bvw, NULL);
 
 	if (totem_is_playing (totem) != FALSE && can_get_frames)
-		totem_scrsaver_disable (pi->scr);
+		totem_scrsaver_disable (pi->priv->scr);
 	else if (totem_is_playing (totem) != FALSE && !lock_screensaver_on_audio)
-		totem_scrsaver_disable (pi->scr);
+		totem_scrsaver_disable (pi->priv->scr);
 	else
-		totem_scrsaver_enable (pi->scr);
+		totem_scrsaver_enable (pi->priv->scr);
 }
 
 static void
@@ -110,13 +92,13 @@ property_notify_cb (TotemObject *totem,
 static void
 got_metadata_cb (BaconVideoWidget *bvw, TotemScreensaverPlugin *pi)
 {
-	totem_screensaver_update_from_state (pi->totem, pi);
+	totem_screensaver_update_from_state (pi->priv->totem, pi);
 }
 
 static void
 lock_screensaver_on_audio_changed_cb (GSettings *settings, const gchar *key, TotemScreensaverPlugin *pi)
 {
-	totem_screensaver_update_from_state (pi->totem, pi);
+	totem_screensaver_update_from_state (pi->priv->totem, pi);
 }
 
 static void
@@ -125,27 +107,27 @@ impl_activate (PeasActivatable *plugin)
 	TotemScreensaverPlugin *pi = TOTEM_SCREENSAVER_PLUGIN (plugin);
 	TotemObject *totem;
 
-	pi->scr = totem_scrsaver_new ();
-	g_object_set (pi->scr,
+	pi->priv->scr = totem_scrsaver_new ();
+	g_object_set (pi->priv->scr,
 	              "reason", _("Playing a movie"),
 	              NULL);
 
 	totem = g_object_get_data (G_OBJECT (plugin), "object");
-	pi->bvw = BACON_VIDEO_WIDGET (totem_get_video_widget (totem));
+	pi->priv->bvw = BACON_VIDEO_WIDGET (totem_get_video_widget (totem));
 
-	pi->settings = g_settings_new (TOTEM_GSETTINGS_SCHEMA);
-	g_signal_connect (pi->settings, "changed::lock-screensaver-on-audio", (GCallback) lock_screensaver_on_audio_changed_cb, plugin);
+	pi->priv->settings = g_settings_new (TOTEM_GSETTINGS_SCHEMA);
+	g_signal_connect (pi->priv->settings, "changed::lock-screensaver-on-audio", (GCallback) lock_screensaver_on_audio_changed_cb, plugin);
 
-	pi->handler_id_playing = g_signal_connect (G_OBJECT (totem),
+	pi->priv->handler_id_playing = g_signal_connect (G_OBJECT (totem),
 						   "notify::playing",
 						   G_CALLBACK (property_notify_cb),
 						   pi);
-	pi->handler_id_metadata = g_signal_connect (G_OBJECT (pi->bvw),
+	pi->priv->handler_id_metadata = g_signal_connect (G_OBJECT (pi->priv->bvw),
 						    "got-metadata",
 						    G_CALLBACK (got_metadata_cb),
 						    pi);
 
-	pi->totem = g_object_ref (totem);
+	pi->priv->totem = g_object_ref (totem);
 
 	/* Force setting the current status */
 	totem_screensaver_update_from_state (totem, pi);
@@ -156,24 +138,24 @@ impl_deactivate	(PeasActivatable *plugin)
 {
 	TotemScreensaverPlugin *pi = TOTEM_SCREENSAVER_PLUGIN (plugin);
 
-	g_object_unref (pi->settings);
+	g_object_unref (pi->priv->settings);
 
-	if (pi->handler_id_playing != 0) {
+	if (pi->priv->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;
+		g_signal_handler_disconnect (G_OBJECT (totem), pi->priv->handler_id_playing);
+		pi->priv->handler_id_playing = 0;
 	}
-	if (pi->handler_id_metadata != 0) {
-		g_signal_handler_disconnect (G_OBJECT (pi->bvw), pi->handler_id_metadata);
-		pi->handler_id_metadata = 0;
+	if (pi->priv->handler_id_metadata != 0) {
+		g_signal_handler_disconnect (G_OBJECT (pi->priv->bvw), pi->priv->handler_id_metadata);
+		pi->priv->handler_id_metadata = 0;
 	}
 
-	g_object_unref (pi->totem);
-	g_object_unref (pi->bvw);
+	g_object_unref (pi->priv->totem);
+	g_object_unref (pi->priv->bvw);
 
-	totem_scrsaver_enable (pi->scr);
+	totem_scrsaver_enable (pi->priv->scr);
 
-	g_object_unref (pi->scr);
+	g_object_unref (pi->priv->scr);
 }
 
diff --git a/src/plugins/screenshot/totem-gallery.c b/src/plugins/screenshot/totem-gallery.c
index c05b7c2..6b2b510 100644
--- a/src/plugins/screenshot/totem-gallery.c
+++ b/src/plugins/screenshot/totem-gallery.c
@@ -64,7 +64,7 @@ totem_gallery_init (TotemGallery *self)
 }
 
 TotemGallery *
-totem_gallery_new (Totem *totem, TotemScreenshotPlugin *plugin)
+totem_gallery_new (Totem *totem)
 {
 	TotemGallery *gallery;
 	GtkWidget *container;
diff --git a/src/plugins/screenshot/totem-gallery.h b/src/plugins/screenshot/totem-gallery.h
index 7ebcb71..69d27b3 100644
--- a/src/plugins/screenshot/totem-gallery.h
+++ b/src/plugins/screenshot/totem-gallery.h
@@ -32,7 +32,6 @@
 #include <glib-object.h>
 #include <gtk/gtk.h>
 
-#include "totem-screenshot-plugin.h"
 #include "totem.h"
 
 G_BEGIN_DECLS
@@ -56,7 +55,7 @@ typedef struct {
 } TotemGalleryClass;
 
 GType totem_gallery_get_type (void);
-TotemGallery *totem_gallery_new (Totem *totem, TotemScreenshotPlugin *plugin);
+TotemGallery *totem_gallery_new (Totem *totem);
 
 G_END_DECLS
 
diff --git a/src/plugins/screenshot/totem-screenshot-plugin.c b/src/plugins/screenshot/totem-screenshot-plugin.c
index 311e759..a945c72 100644
--- a/src/plugins/screenshot/totem-screenshot-plugin.c
+++ b/src/plugins/screenshot/totem-screenshot-plugin.c
@@ -44,7 +44,14 @@
 #include "totem-uri.h"
 #include "backend/bacon-video-widget.h"
 
-struct TotemScreenshotPluginPrivate {
+#define TOTEM_TYPE_SCREENSHOT_PLUGIN		(totem_screenshot_plugin_get_type ())
+#define TOTEM_SCREENSHOT_PLUGIN(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), TOTEM_TYPE_SCREENSHOT_PLUGIN, TotemScreenshotPlugin))
+#define TOTEM_SCREENSHOT_PLUGIN_CLASS(k)	(G_TYPE_CHECK_CLASS_CAST((k), TOTEM_TYPE_SCREENSHOT_PLUGIN, TotemScreenshotPluginClass))
+#define TOTEM_IS_SCREENSHOT_PLUGIN(o)		(G_TYPE_CHECK_INSTANCE_TYPE ((o), TOTEM_TYPE_SCREENSHOT_PLUGIN))
+#define TOTEM_IS_SCREENSHOT_PLUGIN_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), TOTEM_TYPE_SCREENSHOT_PLUGIN))
+#define TOTEM_SCREENSHOT_PLUGIN_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), TOTEM_TYPE_SCREENSHOT_PLUGIN, TotemScreenshotPluginClass))
+
+typedef struct {
 	Totem *totem;
 	BaconVideoWidget *bvw;
 
@@ -57,33 +64,13 @@ struct TotemScreenshotPluginPrivate {
 
 	guint ui_merge_id;
 	GtkActionGroup *action_group;
-};
+} TotemScreenshotPluginPrivate;
 
 TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_SCREENSHOT_PLUGIN,
 		      TotemScreenshotPlugin,
 		      totem_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));
-}
-
-static void
-totem_screenshot_plugin_init (TotemScreenshotPlugin *plugin)
-{
-	plugin->priv = G_TYPE_INSTANCE_GET_PRIVATE (plugin,
-						    TOTEM_TYPE_SCREENSHOT_PLUGIN,
-						    TotemScreenshotPluginPrivate);
-}
-
-static void
 take_screenshot_action_cb (GtkAction *action, TotemScreenshotPlugin *self)
 {
 	TotemScreenshotPluginPrivate *priv = self->priv;
@@ -109,7 +96,7 @@ take_screenshot_action_cb (GtkAction *action, TotemScreenshotPlugin *self)
 		return;
 	}
 
-	dialog = totem_screenshot_new (priv->totem, self, pixbuf);
+	dialog = totem_screenshot_new (priv->totem, pixbuf);
 
 	gtk_dialog_run (GTK_DIALOG (dialog));
 	gtk_widget_destroy (dialog);
@@ -134,7 +121,7 @@ take_gallery_action_cb (GtkAction *action, TotemScreenshotPlugin *self)
 	if (bacon_video_widget_get_logo_mode (self->priv->bvw) != FALSE)
 		return;
 
-	dialog = GTK_DIALOG (totem_gallery_new (totem, self));
+	dialog = GTK_DIALOG (totem_gallery_new (totem));
 
 	g_signal_connect (dialog, "response",
 			  G_CALLBACK (take_gallery_response_cb), self);
diff --git a/src/plugins/screenshot/totem-screenshot-plugin.h b/src/plugins/screenshot/totem-screenshot-plugin.h
index d125b1e..20d7048 100644
--- a/src/plugins/screenshot/totem-screenshot-plugin.h
+++ b/src/plugins/screenshot/totem-screenshot-plugin.h
@@ -36,20 +36,6 @@
 
 G_BEGIN_DECLS
 
-#define TOTEM_TYPE_SCREENSHOT_PLUGIN		(totem_screenshot_plugin_get_type ())
-#define TOTEM_SCREENSHOT_PLUGIN(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), TOTEM_TYPE_SCREENSHOT_PLUGIN, TotemScreenshotPlugin))
-#define TOTEM_SCREENSHOT_PLUGIN_CLASS(k)	(G_TYPE_CHECK_CLASS_CAST((k), TOTEM_TYPE_SCREENSHOT_PLUGIN, TotemScreenshotPluginClass))
-#define TOTEM_IS_SCREENSHOT_PLUGIN(o)		(G_TYPE_CHECK_INSTANCE_TYPE ((o), TOTEM_TYPE_SCREENSHOT_PLUGIN))
-#define TOTEM_IS_SCREENSHOT_PLUGIN_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), TOTEM_TYPE_SCREENSHOT_PLUGIN))
-#define TOTEM_SCREENSHOT_PLUGIN_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), TOTEM_TYPE_SCREENSHOT_PLUGIN, TotemScreenshotPluginClass))
-
-typedef struct TotemScreenshotPluginPrivate	TotemScreenshotPluginPrivate;
-
-typedef struct {
-	PeasExtensionBase parent;
-	TotemScreenshotPluginPrivate *priv;
-} TotemScreenshotPlugin;
-
 gchar *totem_screenshot_plugin_setup_file_chooser (const char *filename_format, const char *movie_name) G_GNUC_WARN_UNUSED_RESULT;
 void totem_screenshot_plugin_update_file_chooser (const char *filename);
 
diff --git a/src/plugins/screenshot/totem-screenshot.c b/src/plugins/screenshot/totem-screenshot.c
index 4cdf0f2..b4cb1e4 100644
--- a/src/plugins/screenshot/totem-screenshot.c
+++ b/src/plugins/screenshot/totem-screenshot.c
@@ -146,7 +146,7 @@ totem_screenshot_init (TotemScreenshot *screenshot)
 }
 
 GtkWidget *
-totem_screenshot_new (Totem *totem, TotemScreenshotPlugin *screenshot_plugin, GdkPixbuf *screen_image)
+totem_screenshot_new (Totem *totem, GdkPixbuf *screen_image)
 {
 	TotemScreenshot *screenshot;
 	GtkContainer *content_area;
diff --git a/src/plugins/screenshot/totem-screenshot.h b/src/plugins/screenshot/totem-screenshot.h
index 651c95e..4032f12 100644
--- a/src/plugins/screenshot/totem-screenshot.h
+++ b/src/plugins/screenshot/totem-screenshot.h
@@ -30,7 +30,8 @@
 #define TOTEM_SCREENSHOT_H
 
 #include <gtk/gtk.h>
-#include "totem-screenshot-plugin.h"
+
+#include "totem.h"
 
 G_BEGIN_DECLS
 
@@ -54,7 +55,7 @@ struct TotemScreenshotClass {
 };
 
 GType totem_screenshot_get_type (void) G_GNUC_CONST;
-GtkWidget *totem_screenshot_new (Totem *totem, TotemScreenshotPlugin *screenshot_plugin, GdkPixbuf *screen_image) G_GNUC_WARN_UNUSED_RESULT;
+GtkWidget *totem_screenshot_new (Totem *totem, GdkPixbuf *screen_image) G_GNUC_WARN_UNUSED_RESULT;
 
 G_END_DECLS
 
diff --git a/src/plugins/sidebar-test/totem-sidebar-test.c b/src/plugins/sidebar-test/totem-sidebar-test.c
index ba9dad1..a3df67e 100644
--- a/src/plugins/sidebar-test/totem-sidebar-test.c
+++ b/src/plugins/sidebar-test/totem-sidebar-test.c
@@ -43,30 +43,13 @@
 #define TOTEM_IS_SIDEBAR_TEST_PLUGIN_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), TOTEM_TYPE_SIDEBAR_TEST_PLUGIN))
 #define TOTEM_SIDEBAR_TEST_PLUGIN_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), TOTEM_TYPE_SIDEBAR_TEST_PLUGIN, TotemSidebarTestPluginClass))
 
-typedef struct
-{
-	PeasExtensionBase parent;
-} TotemSidebarTestPlugin;
+typedef struct {
+	gpointer unused;
+} TotemSidebarTestPluginPrivate;
 
 TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_SIDEBAR_TEST_PLUGIN, TotemSidebarTestPlugin, totem_sidebar_test_plugin)
 
 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
-totem_sidebar_test_plugin_init (TotemSidebarTestPlugin *plugin)
-{
-}
-
-static void
 impl_activate (PeasActivatable *plugin)
 {
 	GtkWidget *label;
diff --git a/src/plugins/skipto/totem-skipto-plugin.c b/src/plugins/skipto/totem-skipto-plugin.c
index c17c3d3..df18e1b 100644
--- a/src/plugins/skipto/totem-skipto-plugin.c
+++ b/src/plugins/skipto/totem-skipto-plugin.c
@@ -46,6 +46,7 @@
 #define TOTEM_SKIPTO_PLUGIN_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), TOTEM_TYPE_SKIPTO_PLUGIN, TotemSkiptoPluginClass))
 
 typedef struct {
+	TotemObject	*totem;
 	TotemSkipto	*st;
 	guint		handler_id_stream_length;
 	guint		handler_id_seekable;
@@ -54,35 +55,9 @@ typedef struct {
 	GtkActionGroup	*action_group;
 } TotemSkiptoPluginPrivate;
 
-typedef struct {
-	PeasExtensionBase parent;
-
-	TotemObject *totem;
-	TotemSkiptoPluginPrivate *priv;
-} TotemSkiptoPlugin;
-
 TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_SKIPTO_PLUGIN, TotemSkiptoPlugin, totem_skipto_plugin)
 
 static void
-totem_skipto_plugin_class_init (TotemSkiptoPluginClass *klass)
-{
-	GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
-	object_class->set_property = set_property;
-	object_class->get_property = get_property;
-
-	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)
-{
-	plugin->priv = G_TYPE_INSTANCE_GET_PRIVATE (plugin,
-						    TOTEM_TYPE_SKIPTO_PLUGIN,
-						    TotemSkiptoPluginPrivate);
-}
-
-static void
 destroy_dialog (TotemSkiptoPlugin *plugin)
 {
 	TotemSkiptoPluginPrivate *priv = plugin->priv;
@@ -137,7 +112,7 @@ skip_to_response_callback (GtkDialog *dialog, gint response, TotemSkiptoPlugin *
 
 	gtk_widget_hide (GTK_WIDGET (dialog));
 
-	totem_action_seek_time (plugin->totem,
+	totem_action_seek_time (plugin->priv->totem,
 				totem_skipto_get_range (plugin->priv->st),
 				TRUE);
 	destroy_dialog (plugin);
@@ -148,26 +123,26 @@ run_skip_to_dialog (TotemSkiptoPlugin *plugin)
 {
 	TotemSkiptoPluginPrivate *priv = plugin->priv;
 
-	if (totem_is_seekable (plugin->totem) == FALSE)
+	if (totem_is_seekable (priv->totem) == FALSE)
 		return;
 
 	if (priv->st != NULL) {
 		gtk_window_present (GTK_WINDOW (priv->st));
 		totem_skipto_set_current (priv->st, totem_get_current_time
-					  (plugin->totem));
+					  (priv->totem));
 		return;
 	}
 
-	priv->st = TOTEM_SKIPTO (totem_skipto_new (plugin->totem));
+	priv->st = TOTEM_SKIPTO (totem_skipto_new (priv->totem));
 	g_signal_connect (G_OBJECT (priv->st), "delete-event",
 			  G_CALLBACK (gtk_widget_destroy), NULL);
 	g_signal_connect (G_OBJECT (priv->st), "response",
 			  G_CALLBACK (skip_to_response_callback), plugin);
 	g_object_add_weak_pointer (G_OBJECT (priv->st),
 				   (gpointer *)&(priv->st));
-	totem_skipto_update_from_state (plugin->totem, plugin);
+	totem_skipto_update_from_state (priv->totem, plugin);
 	totem_skipto_set_current (priv->st,
-				  totem_get_current_time (plugin->totem));
+				  totem_get_current_time (priv->totem));
 }
 
 static void
@@ -207,18 +182,18 @@ impl_activate (PeasActivatable *plugin)
 		{ "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 = g_object_get_data (G_OBJECT (plugin), "object");
-	priv->handler_id_stream_length = g_signal_connect (G_OBJECT (pi->totem),
+	priv->totem = g_object_get_data (G_OBJECT (plugin), "object");
+	priv->handler_id_stream_length = g_signal_connect (G_OBJECT (priv->totem),
 				"notify::stream-length",
 				G_CALLBACK (property_notify_cb),
 				pi);
-	priv->handler_id_seekable = g_signal_connect (G_OBJECT (pi->totem),
+	priv->handler_id_seekable = g_signal_connect (G_OBJECT (priv->totem),
 				"notify::seekable",
 				G_CALLBACK (property_notify_cb),
 				pi);
 
 	/* Key press handler */
-	window = totem_get_main_window (pi->totem);
+	window = totem_get_main_window (priv->totem);
 	priv->handler_id_key_press = g_signal_connect (G_OBJECT(window),
 				"key-press-event",
 				G_CALLBACK (on_window_key_press_event),
@@ -231,7 +206,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 (pi->totem);
+	manager = totem_get_ui_manager (priv->totem);
 
 	gtk_ui_manager_insert_action_group (manager, priv->action_group, -1);
 	g_object_unref (priv->action_group);
@@ -241,7 +216,7 @@ impl_activate (PeasActivatable *plugin)
 			       "/ui/tmw-menubar/go/skip-forward", "skip-to",
 			       "skip-to", GTK_UI_MANAGER_AUTO, TRUE);
 
-	totem_skipto_update_from_state (pi->totem, pi);
+	totem_skipto_update_from_state (priv->totem, pi);
 }
 
 static void
diff --git a/src/plugins/thumbnail/totem-thumbnail.c b/src/plugins/thumbnail/totem-thumbnail.c
index a0aa0ab..3015520 100644
--- a/src/plugins/thumbnail/totem-thumbnail.c
+++ b/src/plugins/thumbnail/totem-thumbnail.c
@@ -54,36 +54,9 @@ typedef struct
 	TotemObject *totem;
 } TotemThumbnailPluginPrivate;
 
-typedef struct
-{
-	PeasExtensionBase parent;
-	TotemThumbnailPluginPrivate *priv;
-} TotemThumbnailPlugin;
-
 TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_THUMBNAIL_PLUGIN, TotemThumbnailPlugin, totem_thumbnail_plugin)
 
 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));
-}
-
-static void
-totem_thumbnail_plugin_init (TotemThumbnailPlugin *plugin)
-{
-	plugin->priv = G_TYPE_INSTANCE_GET_PRIVATE (plugin,
-						    TOTEM_TYPE_THUMBNAIL_PLUGIN,
-						    TotemThumbnailPluginPrivate);
-}
-
-static void
 set_icon_to_default (TotemObject *totem)
 {
 	GtkWindow *window = NULL;
diff --git a/src/plugins/totem-plugin.h b/src/plugins/totem-plugin.h
index c8c2079..d8663d9 100644
--- a/src/plugins/totem-plugin.h
+++ b/src/plugins/totem-plugin.h
@@ -52,6 +52,10 @@ G_BEGIN_DECLS
 	typedef struct {							\
 		PeasExtensionBaseClass parent_class;				\
 	} TypeName##Class;							\
+	typedef struct {							\
+		PeasExtensionBase parent;					\
+		TypeName##Private *priv;					\
+	} TypeName;								\
 	GType type_name##_get_type (void) G_GNUC_CONST;				\
 	static void impl_activate (PeasActivatable *plugin);			\
 	static void impl_deactivate (PeasActivatable *plugin);			\
@@ -107,8 +111,24 @@ G_BEGIN_DECLS
 		}								\
 	}									\
 	static void								\
-	type_name##_class_finalize (TypeName##Class *klass)		\
+	type_name##_class_init (TypeName##Class *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 (TypeName##Private));	\
+	}									\
+	static void								\
+	type_name##_class_finalize (TypeName##Class *klass)			\
+	{									\
+	}									\
+	static void								\
+	type_name##_init (TypeName *plugin)					\
 	{									\
+		plugin->priv = G_TYPE_INSTANCE_GET_PRIVATE (plugin, TYPE_NAME, TypeName##Private); \
 	}									\
 	G_MODULE_EXPORT void							\
 	peas_register_types (PeasObjectModule *module)				\
diff --git a/src/plugins/tracker/totem-tracker.c b/src/plugins/tracker/totem-tracker.c
index 9ca4dbe..2a7c219 100644
--- a/src/plugins/tracker/totem-tracker.c
+++ b/src/plugins/tracker/totem-tracker.c
@@ -46,30 +46,13 @@
 #define TOTEM_IS_TRACKER_PLUGIN_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), TOTEM_TYPE_TRACKER_PLUGIN))
 #define TOTEM_TRACKER_PLUGIN_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), TOTEM_TYPE_TRACKER_PLUGIN, TotemTrackerPluginClass))
 
-typedef struct
-{
-	PeasExtensionBase parent;
-} TotemTrackerPlugin;
+typedef struct {
+	gpointer unused;
+} TotemTrackerPluginPrivate;
 
 TOTEM_PLUGIN_REGISTER (TOTEM_TYPE_TRACKER_PLUGIN, TotemTrackerPlugin, totem_tracker_plugin);
 
 static void
-totem_tracker_plugin_class_init (TotemTrackerPluginClass *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
-totem_tracker_plugin_init (TotemTrackerPlugin *plugin)
-{
-}
-
-static void
 impl_activate (PeasActivatable *plugin)
 {
 	GtkWidget *widget;
diff --git a/src/plugins/youtube/totem-youtube.c b/src/plugins/youtube/totem-youtube.c
index bdb368f..30b1014 100644
--- a/src/plugins/youtube/totem-youtube.c
+++ b/src/plugins/youtube/totem-youtube.c
@@ -63,7 +63,6 @@ enum {
 #define TOTEM_YOUTUBE_PLUGIN_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), TOTEM_TYPE_YOUTUBE_PLUGIN, TotemYouTubePluginClass))
 
 typedef struct {
-	PeasExtensionBase parent;
 	Totem *totem;
 	GDataYouTubeService *service;
 	SoupSession *session;
@@ -86,7 +85,9 @@ typedef struct {
 	GtkListStore *list_store[NUM_TREE_VIEWS];
 	GtkTreeView *tree_view[NUM_TREE_VIEWS];
 	GtkWidget *cancel_button;
-} TotemYouTubePlugin;
+} TotemYouTubePluginPrivate;
+
+TOTEM_PLUGIN_REGISTER (TOTEM_TYPE_YOUTUBE_PLUGIN, TotemYouTubePlugin, totem_youtube_plugin);
 
 /* GtkBuilder callbacks */
 void notebook_switch_page_cb (GtkNotebook *notebook, gpointer *page, guint page_num, TotemYouTubePlugin *self);
@@ -99,24 +100,6 @@ void open_in_web_browser_activate_cb (GtkAction *action, TotemYouTubePlugin *sel
 void value_changed_cb (GtkAdjustment *adjustment, TotemYouTubePlugin *self);
 gboolean starting_video_cb (TotemVideoList *video_list, GtkTreePath *path, TotemYouTubePlugin *self);
 
-TOTEM_PLUGIN_REGISTER (TOTEM_TYPE_YOUTUBE_PLUGIN, TotemYouTubePlugin, totem_youtube_plugin);
-
-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
-totem_youtube_plugin_init (TotemYouTubePlugin *plugin)
-{
-}
-
 /* ----------------------------------------------------------------------------------------------------------------- */
 /* Copied from http://bugzilla.gnome.org/show_bug.cgi?id=575900 while waiting for them to be committed to gdk-pixbuf */
 
@@ -271,6 +254,7 @@ totem_gdk_pixbuf_new_from_stream_finish (GAsyncResult  *async_result,
 static void
 set_up_tree_view (TotemYouTubePlugin *self, GtkBuilder *builder, guint key)
 {
+	TotemYouTubePluginPrivate *priv = self->priv;
 	GtkUIManager *ui_manager;
 	GtkActionGroup *action_group;
 	GtkAction *action, *menu_item;
@@ -290,17 +274,17 @@ set_up_tree_view (TotemYouTubePlugin *self, GtkBuilder *builder, guint key)
 	if (key == SEARCH_TREE_VIEW) {
 		tree_view = GTK_WIDGET (gtk_builder_get_object (builder, "yt_treeview_search"));
 		vscroll = gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (gtk_builder_get_object (builder, "yt_scrolled_window_search")));
-		self->list_store[key] = GTK_LIST_STORE (gtk_builder_get_object (builder, "yt_list_store_search"));
-		self->tree_view[key] = GTK_TREE_VIEW (tree_view);
-		self->progress_bar[key] = GTK_PROGRESS_BAR (gtk_builder_get_object (builder, "yt_progress_bar_search"));
+		priv->list_store[key] = GTK_LIST_STORE (gtk_builder_get_object (builder, "yt_list_store_search"));
+		priv->tree_view[key] = GTK_TREE_VIEW (tree_view);
+		priv->progress_bar[key] = GTK_PROGRESS_BAR (gtk_builder_get_object (builder, "yt_progress_bar_search"));
 	} else {
 		tree_view = GTK_WIDGET (gtk_builder_get_object (builder, "yt_treeview_related"));
 		vscroll = gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (gtk_builder_get_object (builder, "yt_scrolled_window_related")));
-		self->list_store[key] = GTK_LIST_STORE (gtk_builder_get_object (builder, "yt_list_store_related"));
-		self->tree_view[key] = GTK_TREE_VIEW (tree_view);
-		self->progress_bar[key] = GTK_PROGRESS_BAR (gtk_builder_get_object (builder, "yt_progress_bar_related"));
+		priv->list_store[key] = GTK_LIST_STORE (gtk_builder_get_object (builder, "yt_list_store_related"));
+		priv->tree_view[key] = GTK_TREE_VIEW (tree_view);
+		priv->progress_bar[key] = GTK_PROGRESS_BAR (gtk_builder_get_object (builder, "yt_progress_bar_related"));
 	}
-	g_object_set (tree_view, "totem", self->totem, NULL);
+	g_object_set (tree_view, "totem", priv->totem, NULL);
 	g_signal_connect (vscroll, "button-press-event", G_CALLBACK (button_press_event_cb), self);
 	g_signal_connect (vscroll, "button-release-event", G_CALLBACK (button_release_event_cb), self);
 
@@ -323,42 +307,43 @@ set_up_tree_view (TotemYouTubePlugin *self, GtkBuilder *builder, guint key)
 	g_signal_connect (menu_item, "activate", G_CALLBACK (open_in_web_browser_activate_cb), self);
 
 	/* Connect to more scroll events */
-	self->vadjust[key] = gtk_tree_view_get_vadjustment (GTK_TREE_VIEW (tree_view));
-	g_signal_connect (self->vadjust[key], "value-changed", G_CALLBACK (value_changed_cb), self);
+	priv->vadjust[key] = gtk_tree_view_get_vadjustment (GTK_TREE_VIEW (tree_view));
+	g_signal_connect (priv->vadjust[key], "value-changed", G_CALLBACK (value_changed_cb), self);
 
-	self->cancel_button = GTK_WIDGET (gtk_builder_get_object (builder, "yt_cancel_button"));
+	priv->cancel_button = GTK_WIDGET (gtk_builder_get_object (builder, "yt_cancel_button"));
 }
 
 static void
 impl_activate (PeasActivatable *plugin)
 {
 	TotemYouTubePlugin *self = TOTEM_YOUTUBE_PLUGIN (plugin);
+	TotemYouTubePluginPrivate *priv = self->priv;
 	GtkWindow *main_window;
 	GtkBuilder *builder;
 	guint i;
 
-	self->totem = g_object_ref (g_object_get_data (G_OBJECT (plugin), "object"));
-	self->bvw = BACON_VIDEO_WIDGET (totem_get_video_widget (self->totem));
+	priv->totem = g_object_ref (g_object_get_data (G_OBJECT (plugin), "object"));
+	priv->bvw = BACON_VIDEO_WIDGET (totem_get_video_widget (priv->totem));
 
 	/* Set up the interface */
-	main_window = totem_get_main_window (self->totem);
+	main_window = totem_get_main_window (priv->totem);
 	builder = totem_plugin_load_interface ("youtube", "youtube.ui", TRUE, main_window, self);
 	g_object_unref (main_window);
 
-	self->search_entry = GTK_ENTRY (gtk_builder_get_object (builder, "yt_search_entry"));
-	self->search_button = GTK_BUTTON (gtk_builder_get_object (builder, "yt_search_button"));
-	self->notebook = GTK_NOTEBOOK (gtk_builder_get_object (builder, "yt_notebook"));
+	priv->search_entry = GTK_ENTRY (gtk_builder_get_object (builder, "yt_search_entry"));
+	priv->search_button = GTK_BUTTON (gtk_builder_get_object (builder, "yt_search_button"));
+	priv->notebook = GTK_NOTEBOOK (gtk_builder_get_object (builder, "yt_notebook"));
 
 	/* Set up the tree view pages */
 	for (i = 0; i < NUM_TREE_VIEWS; i++)
 		set_up_tree_view (self, builder, i);
-	self->current_tree_view = SEARCH_TREE_VIEW;
+	priv->current_tree_view = SEARCH_TREE_VIEW;
 
-	self->vbox = GTK_WIDGET (gtk_builder_get_object (builder, "yt_vbox"));
-	gtk_widget_show_all (self->vbox);
+	priv->vbox = GTK_WIDGET (gtk_builder_get_object (builder, "yt_vbox"));
+	gtk_widget_show_all (priv->vbox);
 
 	/* Add the sidebar page */
-	totem_add_sidebar_page (self->totem, "youtube", _("YouTube"), self->vbox);
+	totem_add_sidebar_page (priv->totem, "youtube", _("YouTube"), priv->vbox);
 	g_object_unref (builder);
 }
 
@@ -367,28 +352,29 @@ impl_deactivate (PeasActivatable *plugin)
 {
 	guint i;
 	TotemYouTubePlugin *self = TOTEM_YOUTUBE_PLUGIN (plugin);
+	TotemYouTubePluginPrivate *priv = self->priv;
 
-	totem_remove_sidebar_page (self->totem, "youtube");
+	totem_remove_sidebar_page (priv->totem, "youtube");
 
 	for (i = 0; i < NUM_TREE_VIEWS; i++) {
 		/* Cancel any queries which are still underway */
-		if (self->cancellable[i] != NULL)
-			g_cancellable_cancel (self->cancellable[i]);
+		if (priv->cancellable[i] != NULL)
+			g_cancellable_cancel (priv->cancellable[i]);
 
-		if (self->query[i] != NULL)
-			g_object_unref (self->query[i]);
+		if (priv->query[i] != NULL)
+			g_object_unref (priv->query[i]);
 	}
 
-	if (self->playing_video != NULL)
-		g_object_unref (self->playing_video);
-	if (self->service != NULL)
-		g_object_unref (self->service);
-	if (self->session != NULL)
-		g_object_unref (self->session);
-	g_object_unref (self->bvw);
-	g_object_unref (self->totem);
-	if (self->regex != NULL)
-		g_regex_unref (self->regex);
+	if (priv->playing_video != NULL)
+		g_object_unref (priv->playing_video);
+	if (priv->service != NULL)
+		g_object_unref (priv->service);
+	if (priv->session != NULL)
+		g_object_unref (priv->session);
+	g_object_unref (priv->bvw);
+	g_object_unref (priv->totem);
+	if (priv->regex != NULL)
+		g_regex_unref (priv->regex);
 }
 
 typedef struct {
@@ -401,12 +387,12 @@ progress_bar_pulse_cb (ProgressBarData *data)
 {
 	TotemYouTubePlugin *self = data->plugin;
 
-	if (self->progress_bar_increment[data->tree_view] != 0.0) {
+	if (self->priv->progress_bar_increment[data->tree_view] != 0.0) {
 		g_slice_free (ProgressBarData, data);
 		return FALSE; /* The first entry has been retrieved */
 	}
 
-	gtk_progress_bar_pulse (self->progress_bar[data->tree_view]);
+	gtk_progress_bar_pulse (self->priv->progress_bar[data->tree_view]);
 	return TRUE;
 }
 
@@ -418,7 +404,7 @@ set_progress_bar_text (TotemYouTubePlugin *self, const gchar *text, guint tree_v
 
 	/* Set the cursor to a watch */
 	cursor = gdk_cursor_new (GDK_WATCH);
-	gdk_window_set_cursor (gtk_widget_get_window (self->vbox), cursor);
+	gdk_window_set_cursor (gtk_widget_get_window (self->priv->vbox), cursor);
 	gdk_cursor_unref (cursor);
 
 	/* Call the pulse method */
@@ -426,30 +412,31 @@ set_progress_bar_text (TotemYouTubePlugin *self, const gchar *text, guint tree_v
 	data->plugin = self;
 	data->tree_view = tree_view;
 
-	gtk_progress_bar_set_text (self->progress_bar[tree_view], text);
-	gtk_progress_bar_set_fraction (self->progress_bar[tree_view], 0.0);
-	self->progress_bar_increment[tree_view] = 0.0;
+	gtk_progress_bar_set_text (self->priv->progress_bar[tree_view], text);
+	gtk_progress_bar_set_fraction (self->priv->progress_bar[tree_view], 0.0);
+	self->priv->progress_bar_increment[tree_view] = 0.0;
 	g_timeout_add (PULSE_INTERVAL, (GSourceFunc) progress_bar_pulse_cb, data);
 }
 
 static void
 increment_progress_bar_fraction (TotemYouTubePlugin *self, guint tree_view)
 {
-	gdouble new_value = MIN (gtk_progress_bar_get_fraction (self->progress_bar[tree_view]) + self->progress_bar_increment[tree_view], 1.0);
+	TotemYouTubePluginPrivate *priv = self->priv;
+	gdouble new_value = MIN (gtk_progress_bar_get_fraction (priv->progress_bar[tree_view]) + priv->progress_bar_increment[tree_view], 1.0);
 
-	g_debug ("Incrementing progress bar by %f (new value: %f)", self->progress_bar_increment[tree_view], new_value);
-	gtk_progress_bar_set_fraction (self->progress_bar[tree_view], new_value);
+	g_debug ("Incrementing progress bar by %f (new value: %f)", priv->progress_bar_increment[tree_view], new_value);
+	gtk_progress_bar_set_fraction (priv->progress_bar[tree_view], new_value);
 
 	/* Change the text if the operation's been cancelled */
-	if (self->cancellable[tree_view] == NULL || g_cancellable_is_cancelled (self->cancellable[tree_view]) == TRUE)
-		gtk_progress_bar_set_text (self->progress_bar[tree_view], _("Cancelling queryâ?¦"));
+	if (priv->cancellable[tree_view] == NULL || g_cancellable_is_cancelled (priv->cancellable[tree_view]) == TRUE)
+		gtk_progress_bar_set_text (priv->progress_bar[tree_view], _("Cancelling queryâ?¦"));
 
 	/* Update the UI */
-	if (gtk_progress_bar_get_fraction (self->progress_bar[tree_view]) == 1.0) {
+	if (gtk_progress_bar_get_fraction (priv->progress_bar[tree_view]) == 1.0) {
 		/* The entire search process (including loading thumbnails and t params) is finished, so update the progress bar */
-		gdk_window_set_cursor (gtk_widget_get_window (self->vbox), NULL);
-		gtk_progress_bar_set_text (self->progress_bar[tree_view], "");
-		gtk_progress_bar_set_fraction (self->progress_bar[tree_view], 0.0);
+		gdk_window_set_cursor (gtk_widget_get_window (priv->vbox), NULL);
+		gtk_progress_bar_set_text (priv->progress_bar[tree_view], "");
+		gtk_progress_bar_set_fraction (priv->progress_bar[tree_view], 0.0);
 	}
 }
 
@@ -502,7 +489,7 @@ resolve_t_param_cb (SoupSession *session, SoupMessage *message, TParamData *data
 			goto free_data;
 
 		/* Couldn't load the page contents; error */
-		window = totem_get_main_window (data->plugin->totem);
+		window = totem_get_main_window (self->priv->totem);
 		totem_interface_error (_("Error Looking Up Video URI"), message->response_body->data, window);
 		g_object_unref (window);
 		goto free_data;
@@ -514,7 +501,7 @@ resolve_t_param_cb (SoupSession *session, SoupMessage *message, TParamData *data
 	video_id = gdata_youtube_video_get_video_id (GDATA_YOUTUBE_VIDEO (data->entry));
 
 	/* Check for the fmt_url_map parameter */
-	g_regex_match (self->regex, contents, 0, &match_info);
+	g_regex_match (self->priv->regex, contents, 0, &match_info);
 	if (g_match_info_matches (match_info) == TRUE) {
 		gchar *fmt_url_map_escaped, *fmt_url_map;
 		gchar **mappings, **i;
@@ -564,7 +551,7 @@ resolve_t_param_cb (SoupSession *session, SoupMessage *message, TParamData *data
 		g_strfreev (mappings);
 
 		/* Starting with the highest connection speed we support, look for video URIs matching our connection speed. */
-		connection_speed = MIN (bacon_video_widget_get_connection_speed (self->bvw), (gint) G_N_ELEMENTS (fmt_preferences) - 1);
+		connection_speed = MIN (bacon_video_widget_get_connection_speed (self->priv->bvw), (gint) G_N_ELEMENTS (fmt_preferences) - 1);
 		for (; connection_speed >= 0; connection_speed--) {
 			guint idx = (guint) connection_speed;
 			video_uri = g_strdup (g_hash_table_lookup (fmt_table, GUINT_TO_POINTER (fmt_preferences [idx])));
@@ -599,8 +586,8 @@ resolve_t_param_cb (SoupSession *session, SoupMessage *message, TParamData *data
 	g_match_info_free (match_info);
 
 	/* Update the tree view with the new MRL */
-	if (gtk_tree_model_get_iter (GTK_TREE_MODEL (self->list_store[data->tree_view]), &iter, data->path) == TRUE) {
-		gtk_list_store_set (self->list_store[data->tree_view], &iter, 2, video_uri, -1);
+	if (gtk_tree_model_get_iter (GTK_TREE_MODEL (self->priv->list_store[data->tree_view]), &iter, data->path) == TRUE) {
+		gtk_list_store_set (self->priv->list_store[data->tree_view], &iter, 2, video_uri, -1);
 		g_debug ("Updated list store with new video URI (\"%s\") for entry %s", video_uri, video_id);
 	}
 
@@ -621,7 +608,7 @@ static void
 resolve_t_param_cancelled_cb (GCancellable *cancellable, TParamData *data)
 {
 	/* This will cause resolve_t_param_cb() to be called, which will free the data */
-	soup_session_cancel_message (data->plugin->session, data->message, SOUP_STATUS_CANCELLED);
+	soup_session_cancel_message (data->plugin->priv->session, data->message, SOUP_STATUS_CANCELLED);
 }
 
 static void
@@ -637,7 +624,7 @@ resolve_t_param (TotemYouTubePlugin *self, GDataEntry *entry, GtkTreeIter *iter,
 	data = g_slice_new (TParamData);
 	data->plugin = g_object_ref (self);
 	data->entry = g_object_ref (entry);
-	data->path = gtk_tree_model_get_path (GTK_TREE_MODEL (self->list_store[tree_view]), iter);
+	data->path = gtk_tree_model_get_path (GTK_TREE_MODEL (self->priv->list_store[tree_view]), iter);
 	data->tree_view = tree_view;
 	data->cancellable = g_object_ref (cancellable);
 
@@ -645,7 +632,7 @@ resolve_t_param (TotemYouTubePlugin *self, GDataEntry *entry, GtkTreeIter *iter,
 	data->cancelled_id = g_cancellable_connect (cancellable, (GCallback) resolve_t_param_cancelled_cb, data, NULL);
 
 	/* Send the message. Consumes a reference to data->message after resolve_t_param_cb() finishes */
-	soup_session_queue_message (self->session, data->message, (SoupSessionCallback) resolve_t_param_cb, data);
+	soup_session_queue_message (self->priv->session, data->message, (SoupSessionCallback) resolve_t_param_cb, data);
 }
 
 typedef struct {
@@ -682,8 +669,8 @@ thumbnail_loaded_cb (GObject *source_object, GAsyncResult *result, ThumbnailData
 	g_debug ("Finished creating thumbnail from stream");
 
 	/* Update the tree view */
-	if (gtk_tree_model_get_iter (GTK_TREE_MODEL (self->list_store[data->tree_view]), &iter, data->path) == TRUE) {
-		gtk_list_store_set (self->list_store[data->tree_view], &iter, 0, thumbnail, -1);
+	if (gtk_tree_model_get_iter (GTK_TREE_MODEL (self->priv->list_store[data->tree_view]), &iter, data->path) == TRUE) {
+		gtk_list_store_set (self->priv->list_store[data->tree_view], &iter, 0, thumbnail, -1);
 		g_debug ("Updated list store with new thumbnail");
 	}
 
@@ -757,10 +744,10 @@ query_finished_cb (GObject *source_object, GAsyncResult *result, QueryData *data
 
 	g_debug ("Search finished!");
 
-	feed = gdata_service_query_finish (GDATA_SERVICE (self->service), result, &error);
+	feed = gdata_service_query_finish (GDATA_SERVICE (self->priv->service), result, &error);
 
 	/* Stop the progress bar; a little hacky, but it works */
-	self->progress_bar_increment[data->tree_view] = 1.0;
+	self->priv->progress_bar_increment[data->tree_view] = 1.0;
 	increment_progress_bar_fraction (self, data->tree_view);
 
 	if (feed != NULL) {
@@ -783,7 +770,7 @@ query_finished_cb (GObject *source_object, GAsyncResult *result, QueryData *data
 	}
 
 	/* Error! */
-	window = totem_get_main_window (data->plugin->totem);
+	window = totem_get_main_window (self->priv->totem);
 	if (g_error_matches (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR) == TRUE) {
 		/* Hide the ugly technical message libgdata gives behind a nice one telling them it's out of date (which it likely is
 		 * if we're receiving a protocol error). */
@@ -819,8 +806,8 @@ query_progress_cb (GDataEntry *entry, guint entry_key, guint entry_count, QueryD
 	title = gdata_entry_get_title (entry);
 	id = gdata_youtube_video_get_video_id (GDATA_YOUTUBE_VIDEO (entry));
 
-	gtk_list_store_append (self->list_store[data->tree_view], &iter);
-	gtk_list_store_set (self->list_store[data->tree_view], &iter,
+	gtk_list_store_append (self->priv->list_store[data->tree_view], &iter);
+	gtk_list_store_set (self->priv->list_store[data->tree_view], &iter,
 	                    0, NULL, /* the thumbnail will be downloaded asynchronously and added to the tree view later */
 	                    1, title,
 	                    2, NULL, /* the video URI will be resolved asynchronously and added to the tree view later */
@@ -830,10 +817,11 @@ query_progress_cb (GDataEntry *entry, guint entry_key, guint entry_count, QueryD
 
 	/* Update the progress bar; we have three steps for each entry in the results: the entry, its thumbnail, and its t parameter */
 	g_assert (entry_count > 0);
-	progress_bar = self->progress_bar[data->tree_view];
-	self->progress_bar_increment[data->tree_view] = 1.0 / (entry_count * 3.0);
-	g_debug ("Setting progress_bar_increment to 1.0 / (%u * 3.0) = %f", entry_count, self->progress_bar_increment[data->tree_view]);
-	gtk_progress_bar_set_fraction (progress_bar, gtk_progress_bar_get_fraction (progress_bar) + self->progress_bar_increment[data->tree_view]);
+	progress_bar = self->priv->progress_bar[data->tree_view];
+	self->priv->progress_bar_increment[data->tree_view] = 1.0 / (entry_count * 3.0);
+	g_debug ("Setting progress_bar_increment to 1.0 / (%u * 3.0) = %f", entry_count, self->priv->progress_bar_increment[data->tree_view]);
+	gtk_progress_bar_set_fraction (progress_bar,
+	                               gtk_progress_bar_get_fraction (progress_bar) + self->priv->progress_bar_increment[data->tree_view]);
 
 	/* Resolve the t parameter for the video, which is required before it can be played */
 	/* This will be cancelled if the main query is cancelled, in query_finished_cb() */
@@ -870,7 +858,7 @@ query_progress_cb (GDataEntry *entry, guint entry_key, guint entry_count, QueryD
 
 		t_data = g_slice_new (ThumbnailData);
 		t_data->plugin = g_object_ref (self);
-		t_data->path = gtk_tree_model_get_path (GTK_TREE_MODEL (self->list_store[data->tree_view]), &iter);
+		t_data->path = gtk_tree_model_get_path (GTK_TREE_MODEL (self->priv->list_store[data->tree_view]), &iter);
 		t_data->tree_view = data->tree_view;
 
 		/* We can use the same cancellable for reading the file and making a pixbuf out of it, as they're consecutive operations */
@@ -886,20 +874,20 @@ query_progress_cb (GDataEntry *entry, guint entry_key, guint entry_count, QueryD
 	}
 }
 
-/* Called when self->cancellable[tree_view] is destroyed (for either tree view) */
+/* Called when self->priv->cancellable[tree_view] is destroyed (for either tree view) */
 static void
 cancellable_notify_cb (TotemYouTubePlugin *self, GCancellable *old_cancellable)
 {
 	guint i;
 
 	/* Disable the "Cancel" button, if it applies to the current tree view */
-	if (self->cancellable[self->current_tree_view] == old_cancellable)
-		gtk_widget_set_sensitive (self->cancel_button, FALSE);
+	if (self->priv->cancellable[self->priv->current_tree_view] == old_cancellable)
+		gtk_widget_set_sensitive (self->priv->cancel_button, FALSE);
 
 	/* NULLify the cancellable */
 	for (i = 0; i < NUM_TREE_VIEWS; i++) {
-		if (self->cancellable[i] == old_cancellable)
-			self->cancellable[i] = NULL;
+		if (self->priv->cancellable[i] == old_cancellable)
+			self->priv->cancellable[i] = NULL;
 	}
 }
 
@@ -907,16 +895,16 @@ static void
 set_current_operation (TotemYouTubePlugin *self, guint tree_view, GCancellable *cancellable)
 {
 	/* Cancel previous searches on this tree view */
-	if (self->cancellable[tree_view] != NULL)
-		g_cancellable_cancel (self->cancellable[tree_view]);
+	if (self->priv->cancellable[tree_view] != NULL)
+		g_cancellable_cancel (self->priv->cancellable[tree_view]);
 
 	/* Make this the current cancellable action for the given tab */
 	g_object_weak_ref (G_OBJECT (cancellable), (GWeakNotify) cancellable_notify_cb, self);
-	self->cancellable[tree_view] = cancellable;
+	self->priv->cancellable[tree_view] = cancellable;
 
 	/* Enable the "Cancel" button if it applies to the current tree view */
-	if (self->current_tree_view == tree_view)
-		gtk_widget_set_sensitive (self->cancel_button, TRUE);
+	if (self->priv->current_tree_view == tree_view)
+		gtk_widget_set_sensitive (self->priv->cancel_button, TRUE);
 }
 
 static void
@@ -937,15 +925,15 @@ execute_query (TotemYouTubePlugin *self, guint tree_view, gboolean clear_tree_vi
 
 	/* Clear the tree views */
 	if (clear_tree_view == TRUE)
-		gtk_list_store_clear (self->list_store[tree_view]);
+		gtk_list_store_clear (self->priv->list_store[tree_view]);
 
 	if (tree_view == SEARCH_TREE_VIEW) {
-		gdata_youtube_service_query_videos_async (self->service, self->query[tree_view], data->query_cancellable,
+		gdata_youtube_service_query_videos_async (self->priv->service, self->priv->query[tree_view], data->query_cancellable,
 		                                          (GDataQueryProgressCallback) query_progress_cb, data,
 		                                          (GAsyncReadyCallback) query_finished_cb, data);
 	} else {
-		gdata_youtube_service_query_related_async (self->service, self->playing_video, self->query[tree_view], data->query_cancellable,
-		                                           (GDataQueryProgressCallback) query_progress_cb, data,
+		gdata_youtube_service_query_related_async (self->priv->service, self->priv->playing_video, self->priv->query[tree_view],
+		                                           data->query_cancellable, (GDataQueryProgressCallback) query_progress_cb, data,
 		                                           (GAsyncReadyCallback) query_finished_cb, data);
 	}
 }
@@ -953,52 +941,53 @@ execute_query (TotemYouTubePlugin *self, guint tree_view, gboolean clear_tree_vi
 void
 search_button_clicked_cb (GtkButton *button, TotemYouTubePlugin *self)
 {
+	TotemYouTubePluginPrivate *priv = self->priv;
 	const gchar *search_terms;
 
-	search_terms = gtk_entry_get_text (self->search_entry);
+	search_terms = gtk_entry_get_text (priv->search_entry);
 	g_debug ("Searching for \"%s\"", search_terms);
 
 	/* Focus the "Search" page */
-	gtk_notebook_set_current_page (self->notebook, SEARCH_TREE_VIEW);
+	gtk_notebook_set_current_page (priv->notebook, SEARCH_TREE_VIEW);
 
 	/* Update the UI */
 	set_progress_bar_text (self, _("Fetching search resultsâ?¦"), SEARCH_TREE_VIEW);
 
 	/* Clear details pertaining to related videos, since we're doing a new search */
-	gtk_list_store_clear (self->list_store[RELATED_TREE_VIEW]);
-	if (self->playing_video != NULL)
-		g_object_unref (self->playing_video);
-	self->playing_video = NULL;
+	gtk_list_store_clear (priv->list_store[RELATED_TREE_VIEW]);
+	if (priv->playing_video != NULL)
+		g_object_unref (priv->playing_video);
+	priv->playing_video = NULL;
 
 	/* If this is the first query, set up some stuff which we didn't do before to save memory */
-	if (self->query[SEARCH_TREE_VIEW] == NULL) {
+	if (priv->query[SEARCH_TREE_VIEW] == NULL) {
 		/* If this is the first query, compile the regex used to resolve the t param. Doing this here rather than when
 		 * activating the plugin means we don't waste cycles if the plugin's never used. It also means we don't waste
 		 * cycles repeatedly creating new regexes for each video whose t param we resolve. */
 		/* We're looking for a line of the form:
 		 * var swfHTML = (isIE) ? "<object...econds=194&t=vjVQa1PpcFP36LLlIaDqZIG1w6e30b-7WVBgsQLLA3s%3D&rv.6.id=OzLjC6Pm... */
-		self->regex = g_regex_new ("swfHTML = .*&fmt_url_map=([^&]+)&", G_REGEX_OPTIMIZE, 0, NULL);
-		g_assert (self->regex != NULL);
+		priv->regex = g_regex_new ("swfHTML = .*&fmt_url_map=([^&]+)&", G_REGEX_OPTIMIZE, 0, NULL);
+		g_assert (priv->regex != NULL);
 
 		/* Set up the GData service (needed for the tree views' queries) */
-		self->service = gdata_youtube_service_new (DEVELOPER_KEY, CLIENT_ID);
+		priv->service = gdata_youtube_service_new (DEVELOPER_KEY, CLIENT_ID);
 
 		/* Set up network timeouts, if they're supported by our version of libgdata.
 		 * This will return from queries with %GDATA_SERVICE_ERROR_NETWORK_ERROR if network operations take longer than 30 seconds. */
 #ifdef HAVE_LIBGDATA_0_7
-		gdata_service_set_timeout (GDATA_SERVICE (self->service), 30);
+		gdata_service_set_timeout (GDATA_SERVICE (priv->service), 30);
 #endif /* HAVE_LIBGDATA_0_7 */
 
 		/* Set up the queries */
-		self->query[SEARCH_TREE_VIEW] = gdata_query_new_with_limits (NULL, 0, MAX_RESULTS);
-		self->query[RELATED_TREE_VIEW] = gdata_query_new_with_limits (NULL, 0, MAX_RESULTS);
+		priv->query[SEARCH_TREE_VIEW] = gdata_query_new_with_limits (NULL, 0, MAX_RESULTS);
+		priv->query[RELATED_TREE_VIEW] = gdata_query_new_with_limits (NULL, 0, MAX_RESULTS);
 
 		/* Lazily create the SoupSession used in resolve_t_param() */
-		self->session = soup_session_async_new ();
+		priv->session = soup_session_async_new ();
 	}
 
 	/* Do the query */
-	gdata_query_set_q (self->query[SEARCH_TREE_VIEW], search_terms);
+	gdata_query_set_q (priv->query[SEARCH_TREE_VIEW], search_terms);
 	execute_query (self, SEARCH_TREE_VIEW, TRUE);
 }
 
@@ -1007,30 +996,30 @@ cancel_button_clicked_cb (GtkButton *button, TotemYouTubePlugin *self)
 {
 	/* It's possible for the operation to finish (and consequently the cancellable to disappear) while the GtkButton is deciding whether the
 	 * user is actually pressing it (in its timeout). */
-	if (self->cancellable[self->current_tree_view] == NULL)
+	if (self->priv->cancellable[self->priv->current_tree_view] == NULL)
 		return;
 
 	g_debug ("Cancelling search");
-	g_cancellable_cancel (self->cancellable[self->current_tree_view]);
+	g_cancellable_cancel (self->priv->cancellable[self->priv->current_tree_view]);
 }
 
 void
 search_entry_activate_cb (GtkEntry *entry, TotemYouTubePlugin *self)
 {
-	search_button_clicked_cb (self->search_button, self);
+	search_button_clicked_cb (self->priv->search_button, self);
 }
 
 static void
 load_related_videos (TotemYouTubePlugin *self)
 {
-	g_assert (self->playing_video != NULL);
-	g_debug ("Loading related videos for %s", gdata_youtube_video_get_video_id (self->playing_video));
+	g_assert (self->priv->playing_video != NULL);
+	g_debug ("Loading related videos for %s", gdata_youtube_video_get_video_id (self->priv->playing_video));
 
 	/* Update the UI */
 	set_progress_bar_text (self, _("Fetching related videosâ?¦"), RELATED_TREE_VIEW);
 
 	/* Clear the existing results and do the query */
-	gtk_list_store_clear (self->list_store[RELATED_TREE_VIEW]);
+	gtk_list_store_clear (self->priv->list_store[RELATED_TREE_VIEW]);
 	execute_query (self, RELATED_TREE_VIEW, FALSE);
 }
 
@@ -1038,15 +1027,15 @@ void
 notebook_switch_page_cb (GtkNotebook *notebook, gpointer *page, guint page_num, TotemYouTubePlugin *self)
 {
 	/* Change the tree view */
-	self->current_tree_view = page_num;
+	self->priv->current_tree_view = page_num;
 
 	/* Sort out the "Cancel" button's sensitivity */
-	gtk_widget_set_sensitive (self->cancel_button, (self->cancellable[page_num] != NULL) ? TRUE : FALSE);
+	gtk_widget_set_sensitive (self->priv->cancel_button, (self->priv->cancellable[page_num] != NULL) ? TRUE : FALSE);
 
 	/* If we're changing to the "Related Videos" tree view and have played a video, load
 	 * the related videos for that video; but only if the related tree view's empty first */
-	if (page_num == RELATED_TREE_VIEW && self->playing_video != NULL &&
-	    gtk_tree_model_iter_n_children (GTK_TREE_MODEL (self->list_store[RELATED_TREE_VIEW]), NULL) == 0) {
+	if (page_num == RELATED_TREE_VIEW && self->priv->playing_video != NULL &&
+	    gtk_tree_model_iter_n_children (GTK_TREE_MODEL (self->priv->list_store[RELATED_TREE_VIEW]), NULL) == 0) {
 		load_related_videos (self);
 	}
 }
@@ -1058,7 +1047,7 @@ open_in_web_browser_activate_cb (GtkAction *action, TotemYouTubePlugin *self)
 	GtkTreeModel *model;
 	GList *paths, *path;
 
-	selection = gtk_tree_view_get_selection (self->tree_view[self->current_tree_view]);
+	selection = gtk_tree_view_get_selection (self->priv->tree_view[self->priv->current_tree_view]);
 	paths = gtk_tree_selection_get_selected_rows (selection, &model);
 
 	for (path = paths; path != NULL; path = path->next) {
@@ -1076,9 +1065,9 @@ open_in_web_browser_activate_cb (GtkAction *action, TotemYouTubePlugin *self)
 		g_object_unref (video);
 
 		/* Display the page */
-		if (gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (self->bvw)), gdata_link_get_uri (page_link),
+		if (gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (self->priv->bvw)), gdata_link_get_uri (page_link),
 		                  GDK_CURRENT_TIME, &error) == FALSE) {
-			GtkWindow *window = totem_get_main_window (self->totem);
+			GtkWindow *window = totem_get_main_window (self->priv->totem);
 			totem_interface_error (_("Error Opening Video in Web Browser"), error->message, window);
 			g_object_unref (window);
 			g_error_free (error);
@@ -1092,31 +1081,31 @@ open_in_web_browser_activate_cb (GtkAction *action, TotemYouTubePlugin *self)
 void
 value_changed_cb (GtkAdjustment *adjustment, TotemYouTubePlugin *self)
 {
-	if (self->button_down == FALSE &&
-	    gtk_tree_model_iter_n_children (GTK_TREE_MODEL (self->list_store[self->current_tree_view]), NULL) >= MAX_RESULTS &&
+	if (self->priv->button_down == FALSE &&
+	    gtk_tree_model_iter_n_children (GTK_TREE_MODEL (self->priv->list_store[self->priv->current_tree_view]), NULL) >= MAX_RESULTS &&
 	    (gtk_adjustment_get_value (adjustment) + gtk_adjustment_get_page_size (adjustment)) / gtk_adjustment_get_upper (adjustment) > 0.8) {
 		/* Only load more results if we're not already querying */
-		if (self->cancellable[self->current_tree_view] != NULL)
+		if (self->priv->cancellable[self->priv->current_tree_view] != NULL)
 			return;
 
-		set_progress_bar_text (self, _("Fetching more videosâ?¦"), self->current_tree_view);
-		gdata_query_next_page (self->query[self->current_tree_view]);
-		execute_query (self, self->current_tree_view, FALSE);
+		set_progress_bar_text (self, _("Fetching more videosâ?¦"), self->priv->current_tree_view);
+		gdata_query_next_page (self->priv->query[self->priv->current_tree_view]);
+		execute_query (self, self->priv->current_tree_view, FALSE);
 	}
 }
 
 gboolean
 button_press_event_cb (GtkWidget *widget, GdkEventButton *event, TotemYouTubePlugin *self)
 {
-	self->button_down = TRUE;
+	self->priv->button_down = TRUE;
 	return FALSE;
 }
 
 gboolean
 button_release_event_cb (GtkWidget *widget, GdkEventButton *event, TotemYouTubePlugin *self)
 {
-	self->button_down = FALSE;
-	value_changed_cb (self->vadjust[self->current_tree_view], self);
+	self->priv->button_down = FALSE;
+	value_changed_cb (self->priv->vadjust[self->priv->current_tree_view], self);
 	return FALSE;
 }
 
@@ -1127,16 +1116,16 @@ starting_video_cb (TotemVideoList *video_list, GtkTreePath *path, TotemYouTubePl
 	GDataYouTubeVideo *video_entry;
 
 	/* Store the current entry */
-	if (gtk_tree_model_get_iter (GTK_TREE_MODEL (self->list_store[self->current_tree_view]), &iter, path) == FALSE)
+	if (gtk_tree_model_get_iter (GTK_TREE_MODEL (self->priv->list_store[self->priv->current_tree_view]), &iter, path) == FALSE)
 		return FALSE;
-	gtk_tree_model_get (GTK_TREE_MODEL (self->list_store[self->current_tree_view]), &iter, 3, &video_entry, -1);
+	gtk_tree_model_get (GTK_TREE_MODEL (self->priv->list_store[self->priv->current_tree_view]), &iter, 3, &video_entry, -1);
 
-	if (self->playing_video != NULL)
-		g_object_unref (self->playing_video);
-	self->playing_video = g_object_ref (video_entry);
+	if (self->priv->playing_video != NULL)
+		g_object_unref (self->priv->playing_video);
+	self->priv->playing_video = g_object_ref (video_entry);
 
 	/* If we're currently viewing the related videos page, load the new related videos */
-	if (self->current_tree_view == RELATED_TREE_VIEW)
+	if (self->priv->current_tree_view == RELATED_TREE_VIEW)
 		load_related_videos (self);
 
 	return TRUE;



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