# HG changeset patch
# Node ID 3135682211c7
# Parent  8da39ba2bd13
diff --git a/gplugin/reference/genie.md b/gplugin/reference/genie.md
--- a/gplugin/reference/genie.md
+++ b/gplugin/reference/genie.md
@@ -8,38 +8,41 @@
 
 ### Example Genie Plugin
 
-Like all plugins in GPlugin, Genie plugins must also implement the
-`gplugin_query`, `gplugin_load`, and `gplugin_unload` functions.
+Due to the way `GPlugin.PluginInfo` info works, you must subclass it and set
+your values in the new constructor. It is recommended that you define this
+class in a namespace to avoid collisions with other plugins.
 
-Due to the way `GPlugin.PluginInfo` info works, you must subclass it and set
-your values in the new constructor.
+Like all plugins in GPlugin, Genie plugins must also implement the
+`gplugin_query`, `gplugin_load`, and `gplugin_unload` functions. These
+functions must be in the global namespace.
 
 The following is a basic Genie plugin.
 
 ```genie
 uses GPlugin
 
-class BasicPluginInfo : GPlugin.PluginInfo
-	construct()
-		authors : array of string = {"author1"}
+namespace BasicPlugin
+	class Info : GPlugin.PluginInfo
+		construct()
+			authors : array of string = {"author1"}
 
-		Object(
-			id: "gplugin/genie-basic-plugin",
-			abi_version: 0x01020304,
-			name: "basic plugin",
-			authors: authors,
-			category: "test",
-			version: "version",
-			license_id: "license",
-			summary: "summary",
-			website: "website",
-			description: "description"
-		)
+			Object(
+				id: "gplugin/genie-basic-plugin",
+				abi_version: 0x01020304,
+				name: "basic plugin",
+				authors: authors,
+				category: "test",
+				version: "version",
+				license_id: "license",
+				summary: "summary",
+				website: "website",
+				description: "description"
+			)
 
 def gplugin_query(out error : Error) : GPlugin.PluginInfo
 	error = null
 
-	return new BasicPluginInfo()
+	return new BasicPlugin.Info()
 
 def gplugin_load(plugin : GPlugin.Plugin, out error : Error) : bool
 	error = null
diff --git a/gplugin/reference/vala.md b/gplugin/reference/vala.md
--- a/gplugin/reference/vala.md
+++ b/gplugin/reference/vala.md
@@ -8,19 +8,23 @@
 
 ### Example Vala Plugin
 
-Like all plugins in GPlugin, Vala plugins must also implement the
-`gplugin_query`, `gplugin_load`, and `gplugin_unload` functions.
+Due to the way `GPlugin.PluginInfo` info works, you must subclass it and set
+your values in the new constructor. It is recommended that you define this
+class in a namespace to avoid collisions with other plugins.
 
-Due to the way `GPlugin.PluginInfo` info works, you must subclass it and set
-your values in the new constructor.
+Like all plugins in GPlugin, Vala plugins must also implement the
+`gplugin_query`, `gplugin_load`, and `gplugin_unload` functions. These
+functions must be in the global namespace.
 
 The following is a basic Vala plugin.
 
 ```vala
 using GPlugin;
 
-public class BasicPluginInfo : GPlugin.PluginInfo {
-	public BasicPluginInfo() {
+namespace BasicPlugin {
+
+public class Info : GPlugin.PluginInfo {
+	public Info() {
 		string[] authors = {"author1"};
 
 		Object(
@@ -38,10 +42,12 @@
 	}
 }
 
+}
+
 public GPlugin.PluginInfo gplugin_query(out Error error) {
 	error = null;
 
-	return new BasicPluginInfo();
+	return new BasicPlugin.Info();
 }
 
 public bool gplugin_load(GPlugin.Plugin plugin, out Error error) {
diff --git a/vala/tests/genie-plugins/basic.gs b/vala/tests/genie-plugins/basic.gs
--- a/vala/tests/genie-plugins/basic.gs
+++ b/vala/tests/genie-plugins/basic.gs
@@ -16,27 +16,28 @@
  */
 uses GPlugin
 
-class BasicPluginInfo : GPlugin.PluginInfo
-	construct()
-		authors : array of string = {"author1"}
+namespace GenieBasicPlugin
+	class Info : GPlugin.PluginInfo
+		construct()
+			authors : array of string = {"author1"}
 
-		Object(
-			id: "gplugin/genie-basic-plugin",
-			abi_version: 0x01020304,
-			name: "basic plugin",
-			authors: authors,
-			category: "test",
-			version: "version",
-			license_id: "license",
-			summary: "summary",
-			website: "website",
-			description: "description"
-		)
+			Object(
+				id: "gplugin/genie-basic-plugin",
+				abi_version: 0x01020304,
+				name: "basic plugin",
+				authors: authors,
+				category: "test",
+				version: "version",
+				license_id: "license",
+				summary: "summary",
+				website: "website",
+				description: "description"
+			)
 
 def gplugin_query(out error : Error) : GPlugin.PluginInfo
 	error = null
 
-	return new BasicPluginInfo()
+	return new GenieBasicPlugin.Info()
 
 def gplugin_load(plugin : GPlugin.Plugin, out error : Error) : bool
 	if not(plugin isa GPlugin.Plugin)
diff --git a/vala/tests/genie-plugins/dependent.gs b/vala/tests/genie-plugins/dependent.gs
--- a/vala/tests/genie-plugins/dependent.gs
+++ b/vala/tests/genie-plugins/dependent.gs
@@ -16,19 +16,20 @@
  */
 uses GPlugin;
 
-class DependentPluginInfo : GPlugin.PluginInfo
-	construct()
-		dependencies : array of string = {"dependency1", "dependency2"}
+namespace GenieDependentPlugin
+	class Info : GPlugin.PluginInfo
+		construct()
+			dependencies : array of string = {"dependency1", "dependency2"}
 
-		Object(
-			id: "gplugin/genie-dependent-plugin",
-			dependencies: dependencies
-		)
+			Object(
+				id: "gplugin/genie-dependent-plugin",
+				dependencies: dependencies
+			)
 
 def gplugin_query(out error : Error) : GPlugin.PluginInfo
 	error = null
 
-	return new DependentPluginInfo()
+	return new GenieDependentPlugin.Info()
 
 def gplugin_load(plugin : GPlugin.Plugin, out error : Error) : bool
 	error = null
diff --git a/vala/tests/genie-plugins/load-exception.gs b/vala/tests/genie-plugins/load-exception.gs
--- a/vala/tests/genie-plugins/load-exception.gs
+++ b/vala/tests/genie-plugins/load-exception.gs
@@ -16,16 +16,17 @@
  */
 uses GPlugin
 
-class LoadExceptionPluginInfo : GPlugin.PluginInfo
-	construct ()
-		Object(
-			id: "gplugin/genie-load-exception"
-		)
+namespace GenieLoadExceptionPlugin
+	class Info : GPlugin.PluginInfo
+		construct ()
+			Object(
+				id: "gplugin/genie-load-exception"
+			)
 
 def gplugin_query(out error : Error) : GPlugin.PluginInfo
 	error = null
 
-	return new LoadExceptionPluginInfo()
+	return new GenieLoadExceptionPlugin.Info()
 
 def gplugin_load(plugin : GPlugin.Plugin, out error : Error) : bool
 	error = new Error(Quark.from_string("gplugin"), 0, "explode")
diff --git a/vala/tests/genie-plugins/load-failed.gs b/vala/tests/genie-plugins/load-failed.gs
--- a/vala/tests/genie-plugins/load-failed.gs
+++ b/vala/tests/genie-plugins/load-failed.gs
@@ -16,16 +16,17 @@
  */
 uses GPlugin
 
-class LoadFailedPluginInfo : GPlugin.PluginInfo
-	construct ()
-		Object(
-			id: "gplugin/genie-load-failed"
-		)
+namespace LoadFailedPlugin
+	class Info : GPlugin.PluginInfo
+		construct ()
+			Object(
+				id: "gplugin/genie-load-failed"
+			)
 
 def gplugin_query(out error : Error) : GPlugin.PluginInfo
 	error = null
 
-	return new LoadFailedPluginInfo()
+	return new LoadFailedPlugin.Info()
 
 def gplugin_load(plugin : GPlugin.Plugin, out error : Error) : bool
 	error = null
diff --git a/vala/tests/genie-plugins/unload-failed.gs b/vala/tests/genie-plugins/unload-failed.gs
--- a/vala/tests/genie-plugins/unload-failed.gs
+++ b/vala/tests/genie-plugins/unload-failed.gs
@@ -16,16 +16,17 @@
  */
 uses GPlugin
 
-class UnloadFailedPluginInfo : GPlugin.PluginInfo
-	construct()
-		Object(
-			id: "gplugin/genie-unload-failed"
-		)
+namespace UnloadFailedPlugin
+	class Info : GPlugin.PluginInfo
+		construct()
+			Object(
+				id: "gplugin/genie-unload-failed"
+			)
 
 def gplugin_query(out error : Error) : GPlugin.PluginInfo
 	error = null
 
-	return new UnloadFailedPluginInfo()
+	return new UnloadFailedPlugin.Info()
 
 def gplugin_load(plugin : GPlugin.Plugin, out error : Error) : bool
 	error = null
diff --git a/vala/tests/genie-plugins/unload-shutdown.gs b/vala/tests/genie-plugins/unload-shutdown.gs
--- a/vala/tests/genie-plugins/unload-shutdown.gs
+++ b/vala/tests/genie-plugins/unload-shutdown.gs
@@ -17,11 +17,12 @@
 uses GLib
 uses GPlugin
 
-class UnloadShutdownPluginInfo : GPlugin.PluginInfo
-	construct()
-		Object(
-			id: "gplugin/genie-unload-shutdown"
-		)
+namespace UnloadShutdownPlugin
+	class Info : GPlugin.PluginInfo
+		construct()
+			Object(
+				id: "gplugin/genie-unload-shutdown"
+			)
 
 exception UnloadError
 	ShutdownNotSet
@@ -29,7 +30,7 @@
 def gplugin_query(out error : Error) : GPlugin.PluginInfo
 	error = null
 
-	return new UnloadShutdownPluginInfo()
+	return new UnloadShutdownPlugin.Info()
 
 def gplugin_load(plugin : GPlugin.Plugin, out error : Error) : bool
 	error = null
diff --git a/vala/tests/plugins/basic.vala b/vala/tests/plugins/basic.vala
--- a/vala/tests/plugins/basic.vala
+++ b/vala/tests/plugins/basic.vala
@@ -16,8 +16,10 @@
  */
 using GPlugin;
 
-public class BasicPluginInfo : GPlugin.PluginInfo {
-	public BasicPluginInfo() {
+namespace ValaBasicPlugin {
+
+public class Info : GPlugin.PluginInfo {
+	public Info() {
 		string[] authors = {"author1"};
 
 		Object(
@@ -35,10 +37,12 @@
 	}
 }
 
+}
+
 public GPlugin.PluginInfo gplugin_query(out Error error) {
 	error = null;
 
-	return new BasicPluginInfo();
+	return new ValaBasicPlugin.Info();
 }
 
 public bool gplugin_load(GPlugin.Plugin plugin, out Error error) {
diff --git a/vala/tests/plugins/dependent.vala b/vala/tests/plugins/dependent.vala
--- a/vala/tests/plugins/dependent.vala
+++ b/vala/tests/plugins/dependent.vala
@@ -16,8 +16,10 @@
  */
 using GPlugin;
 
-public class DependentPluginInfo : GPlugin.PluginInfo {
-	public DependentPluginInfo() {
+namespace ValaDependentPlugin {
+
+public class Info : GPlugin.PluginInfo {
+	public Info() {
 		string[] dependencies = {"dependency1", "dependency2"};
 
 		Object(
@@ -27,10 +29,12 @@
 	}
 }
 
+}
+
 public GPlugin.PluginInfo gplugin_query(out Error error) {
 	error = null;
 
-	return new DependentPluginInfo();
+	return new ValaDependentPlugin.Info();
 }
 
 public bool gplugin_load(GPlugin.Plugin plugin, out Error error) {
diff --git a/vala/tests/plugins/load-exception.vala b/vala/tests/plugins/load-exception.vala
--- a/vala/tests/plugins/load-exception.vala
+++ b/vala/tests/plugins/load-exception.vala
@@ -16,18 +16,22 @@
  */
 using GPlugin;
 
-public class LoadExceptionPluginInfo : GPlugin.PluginInfo {
-	public LoadExceptionPluginInfo() {
+namespace ValaLoadExceptionPlugin {
+
+public class Info : GPlugin.PluginInfo {
+	public Info() {
 		Object(
 			id: "gplugin/vala-load-exception"
 		);
 	}
 }
 
+}
+
 public GPlugin.PluginInfo gplugin_query(out Error error) {
 	error = null;
 
-	return new LoadExceptionPluginInfo();
+	return new ValaLoadExceptionPlugin.Info();
 }
 
 public bool gplugin_load(GPlugin.Plugin plugin, out Error error) {
diff --git a/vala/tests/plugins/load-failed.vala b/vala/tests/plugins/load-failed.vala
--- a/vala/tests/plugins/load-failed.vala
+++ b/vala/tests/plugins/load-failed.vala
@@ -16,18 +16,22 @@
  */
 using GPlugin;
 
-public class LoadFailedPluginInfo : GPlugin.PluginInfo {
-	public LoadFailedPluginInfo() {
+namespace ValaLoadFailedPlugin {
+
+public class Info : GPlugin.PluginInfo {
+	public Info() {
 		Object(
 			id: "gplugin/vala-load-failed"
 		);
 	}
 }
 
+}
+
 public GPlugin.PluginInfo gplugin_query(out Error error) {
 	error = null;
 
-	return new LoadFailedPluginInfo();
+	return new ValaLoadFailedPlugin.Info();
 }
 
 public bool gplugin_load(GPlugin.Plugin plugin, out Error error) {
diff --git a/vala/tests/plugins/unload-failed.vala b/vala/tests/plugins/unload-failed.vala
--- a/vala/tests/plugins/unload-failed.vala
+++ b/vala/tests/plugins/unload-failed.vala
@@ -16,18 +16,22 @@
  */
 using GPlugin;
 
-public class UnloadFailedPluginInfo : GPlugin.PluginInfo {
-	public UnloadFailedPluginInfo() {
+namespace ValaUnloadFailed {
+
+public class Info : GPlugin.PluginInfo {
+	public Info() {
 		Object(
 			id: "gplugin/vala-unload-failed"
 		);
 	}
 }
 
+}
+
 public GPlugin.PluginInfo gplugin_query(out Error error) {
 	error = null;
 
-	return new UnloadFailedPluginInfo();
+	return new ValaUnloadFailed.Info();
 }
 
 public bool gplugin_load(GPlugin.Plugin plugin, out Error error) {
diff --git a/vala/tests/plugins/unload-shutdown.vala b/vala/tests/plugins/unload-shutdown.vala
--- a/vala/tests/plugins/unload-shutdown.vala
+++ b/vala/tests/plugins/unload-shutdown.vala
@@ -16,18 +16,22 @@
  */
 using GPlugin;
 
-public class UnloadShutdownPluginInfo : GPlugin.PluginInfo {
-	public UnloadShutdownPluginInfo() {
+namespace ValaShutdownPlugin {
+
+public class Info : GPlugin.PluginInfo {
+	public Info() {
 		Object(
 			id: "gplugin/vala-unload-shutdown"
 		);
 	}
 }
 
+}
+
 public GPlugin.PluginInfo gplugin_query(out Error error) {
 	error = null;
 
-	return new UnloadShutdownPluginInfo();
+	return new ValaShutdownPlugin.Info();
 }
 
 public bool gplugin_load(GPlugin.Plugin plugin, out Error error) {
