context: // This file was generated by the Gtk# code generator.
  // Any changes made will be lost if regenerated.
  
  namespace Ethos {
  
  	using System;
  	using System.Collections;
  	using System.Runtime.InteropServices;
  
  #region Autogenerated code
  	public class Manager : GLib.Object {
  
  		[Obsolete]
  		protected Manager(GLib.GType gtype) : base(gtype) {}
  		public Manager(IntPtr raw) : base(raw) {}
  
  		[DllImport("ethos-sharp.dll")]
  		static extern IntPtr ethos_manager_new();
  
  		public Manager () : base (IntPtr.Zero)
  		{
  			if (GetType () != typeof (Manager)) {
  				CreateNativeObject (new string [0], new GLib.Value[0]);
  				return;
  			}
  			Raw = ethos_manager_new();
  		}
  
  		[DllImport("ethos-sharp.dll")]
  		static extern IntPtr ethos_manager_new_full(IntPtr app_name, IntPtr plugin_dirs);
  
  		public Manager (string app_name, string plugin_dirs) : base (IntPtr.Zero)
  		{
  			if (GetType () != typeof (Manager)) {
  				throw new InvalidOperationException ("Can't override this constructor.");
  			}
  			IntPtr native_app_name = GLib.Marshaller.StringToPtrGStrdup (app_name);
  			IntPtr native_plugin_dirs = GLib.Marshaller.StringToPtrGStrdup (plugin_dirs);
  			Raw = ethos_manager_new_full(native_app_name, native_plugin_dirs);
  			GLib.Marshaller.Free (native_app_name);
  			GLib.Marshaller.Free (native_plugin_dirs);
  		}
  
  		[GLib.CDeclCallback]
  		delegate void PluginLoadedVMDelegate (IntPtr manager, IntPtr plugin_info);
  
  		static PluginLoadedVMDelegate PluginLoadedVMCallback;
  
  		static void pluginloaded_cb (IntPtr manager, IntPtr plugin_info)
  		{
  			try {
  				Manager manager_managed = GLib.Object.GetObject (manager, false) as Manager;
  				manager_managed.OnPluginLoaded (GLib.Object.GetObject(plugin_info) as Ethos.PluginInfo);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			}
  		}
  
  		private static void OverridePluginLoaded (GLib.GType gtype)
  		{
  			if (PluginLoadedVMCallback == null)
  				PluginLoadedVMCallback = new PluginLoadedVMDelegate (pluginloaded_cb);
  			OverrideVirtualMethod (gtype, "plugin-loaded", PluginLoadedVMCallback);
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Ethos.Manager), ConnectionMethod="OverridePluginLoaded")]
  		protected virtual void OnPluginLoaded (Ethos.PluginInfo plugin_info)
  		{
  			GLib.Value ret = GLib.Value.Empty;
  			GLib.ValueArray inst_and_params = new GLib.ValueArray (2);
  			GLib.Value[] vals = new GLib.Value [2];
  			vals [0] = new GLib.Value (this);
  			inst_and_params.Append (vals [0]);
  			vals [1] = new GLib.Value (plugin_info);
  			inst_and_params.Append (vals [1]);
  			g_signal_chain_from_overridden (inst_and_params.ArrayPtr, ref ret);
  			foreach (GLib.Value v in vals)
  				v.Dispose ();
  		}
  
  		[GLib.Signal("plugin-loaded")]
  		public event Ethos.PluginLoadedHandler PluginLoaded {
  			add {
  				GLib.Signal sig = GLib.Signal.Lookup (this, "plugin-loaded", typeof (Ethos.PluginLoadedArgs));
  				sig.AddDelegate (value);
  			}
  			remove {
  				GLib.Signal sig = GLib.Signal.Lookup (this, "plugin-loaded", typeof (Ethos.PluginLoadedArgs));
  				sig.RemoveDelegate (value);
  			}
  		}
  
  		[GLib.CDeclCallback]
  		delegate void InitializedVMDelegate (IntPtr manager);
  
  		static InitializedVMDelegate InitializedVMCallback;
  
  		static void initialized_cb (IntPtr manager)
  		{
  			try {
  				Manager manager_managed = GLib.Object.GetObject (manager, false) as Manager;
  				manager_managed.OnInitialized ();
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			}
  		}
  
  		private static void OverrideInitialized (GLib.GType gtype)
  		{
  			if (InitializedVMCallback == null)
  				InitializedVMCallback = new InitializedVMDelegate (initialized_cb);
  			OverrideVirtualMethod (gtype, "initialized", InitializedVMCallback);
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Ethos.Manager), ConnectionMethod="OverrideInitialized")]
  		protected virtual void OnInitialized ()
  		{
  			GLib.Value ret = GLib.Value.Empty;
  			GLib.ValueArray inst_and_params = new GLib.ValueArray (1);
  			GLib.Value[] vals = new GLib.Value [1];
  			vals [0] = new GLib.Value (this);
  			inst_and_params.Append (vals [0]);
  			g_signal_chain_from_overridden (inst_and_params.ArrayPtr, ref ret);
  			foreach (GLib.Value v in vals)
  				v.Dispose ();
  		}
  
  		[GLib.Signal("initialized")]
  		public event System.EventHandler Initialized {
  			add {
  				GLib.Signal sig = GLib.Signal.Lookup (this, "initialized");
  				sig.AddDelegate (value);
  			}
  			remove {
  				GLib.Signal sig = GLib.Signal.Lookup (this, "initialized");
  				sig.RemoveDelegate (value);
  			}
  		}
  
  		[GLib.CDeclCallback]
  		delegate void PluginUnloadedVMDelegate (IntPtr manager, IntPtr plugin_info);
  
  		static PluginUnloadedVMDelegate PluginUnloadedVMCallback;
  
  		static void pluginunloaded_cb (IntPtr manager, IntPtr plugin_info)
  		{
  			try {
  				Manager manager_managed = GLib.Object.GetObject (manager, false) as Manager;
  				manager_managed.OnPluginUnloaded (GLib.Object.GetObject(plugin_info) as Ethos.PluginInfo);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			}
  		}
  
  		private static void OverridePluginUnloaded (GLib.GType gtype)
  		{
  			if (PluginUnloadedVMCallback == null)
  				PluginUnloadedVMCallback = new PluginUnloadedVMDelegate (pluginunloaded_cb);
  			OverrideVirtualMethod (gtype, "plugin-unloaded", PluginUnloadedVMCallback);
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Ethos.Manager), ConnectionMethod="OverridePluginUnloaded")]
  		protected virtual void OnPluginUnloaded (Ethos.PluginInfo plugin_info)
  		{
  			GLib.Value ret = GLib.Value.Empty;
  			GLib.ValueArray inst_and_params = new GLib.ValueArray (2);
  			GLib.Value[] vals = new GLib.Value [2];
  			vals [0] = new GLib.Value (this);
  			inst_and_params.Append (vals [0]);
  			vals [1] = new GLib.Value (plugin_info);
  			inst_and_params.Append (vals [1]);
  			g_signal_chain_from_overridden (inst_and_params.ArrayPtr, ref ret);
  			foreach (GLib.Value v in vals)
  				v.Dispose ();
  		}
  
  		[GLib.Signal("plugin-unloaded")]
  		public event Ethos.PluginUnloadedHandler PluginUnloaded {
  			add {
  				GLib.Signal sig = GLib.Signal.Lookup (this, "plugin-unloaded", typeof (Ethos.PluginUnloadedArgs));
  				sig.AddDelegate (value);
  			}
  			remove {
  				GLib.Signal sig = GLib.Signal.Lookup (this, "plugin-unloaded", typeof (Ethos.PluginUnloadedArgs));
  				sig.RemoveDelegate (value);
  			}
  		}
  
  		[DllImport("ethos-sharp.dll")]
  		static extern void ethos_manager_unload(IntPtr raw);
  
  		public void Unload() {
  			ethos_manager_unload(Handle);
  		}
  
  		[DllImport("ethos-sharp.dll")]
  		static extern void ethos_manager_initialize(IntPtr raw);
  
  		public void Initialize() {
  			ethos_manager_initialize(Handle);
  		}
  
  		[DllImport("ethos-sharp.dll")]
  		static extern IntPtr ethos_manager_get_plugin_info(IntPtr raw);
  
  		public GLib.List PluginInfo { 
  			get {
  				IntPtr raw_ret = ethos_manager_get_plugin_info(Handle);
  				GLib.List ret = new GLib.List(raw_ret);
  				return ret;
  			}
  		}
  
  		[DllImport("ethos-sharp.dll")]
  		static extern IntPtr ethos_manager_get_plugin(IntPtr raw, IntPtr plugin_info);
  
  		public Ethos.Plugin GetPlugin(Ethos.PluginInfo plugin_info) {
  			IntPtr raw_ret = ethos_manager_get_plugin(Handle, plugin_info == null ? IntPtr.Zero : plugin_info.Handle);
  			Ethos.Plugin ret = GLib.Object.GetObject(raw_ret) as Ethos.Plugin;
  			return ret;
  		}
  
  		[DllImport("ethos-sharp.dll")]
  		static extern unsafe bool ethos_manager_load_plugin(IntPtr raw, IntPtr plugin_info, out IntPtr error);
  
  		public unsafe bool LoadPlugin(Ethos.PluginInfo plugin_info) {
  			IntPtr error = IntPtr.Zero;
  			bool raw_ret = ethos_manager_load_plugin(Handle, plugin_info == null ? IntPtr.Zero : plugin_info.Handle, out error);
  			bool ret = raw_ret;
  			if (error != IntPtr.Zero) throw new GLib.GException (error);
  			return ret;
  		}
  
  		[DllImport("ethos-sharp.dll")]
  		static extern unsafe bool ethos_manager_unload_plugin(IntPtr raw, IntPtr plugin_info, out IntPtr error);
  
  		public unsafe bool UnloadPlugin(Ethos.PluginInfo plugin_info) {
  			IntPtr error = IntPtr.Zero;
  			bool raw_ret = ethos_manager_unload_plugin(Handle, plugin_info == null ? IntPtr.Zero : plugin_info.Handle, out error);
  			bool ret = raw_ret;
  			if (error != IntPtr.Zero) throw new GLib.GException (error);
  			return ret;
  		}
  
  		[DllImport("ethos-sharp.dll")]
  		static extern IntPtr ethos_manager_get_app_name(IntPtr raw);
  
  		[DllImport("ethos-sharp.dll")]
  		static extern void ethos_manager_set_app_name(IntPtr raw, IntPtr app_name);
  
  		public string AppName { 
  			get {
  				IntPtr raw_ret = ethos_manager_get_app_name(Handle);
  				string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
  				return ret;
  			}
  			set {
  				IntPtr native_value = GLib.Marshaller.StringToPtrGStrdup (value);
  				ethos_manager_set_app_name(Handle, native_value);
  				GLib.Marshaller.Free (native_value);
  			}
  		}
  
  		[DllImport("ethos-sharp.dll")]
  		static extern IntPtr ethos_manager_get_plugin_dirs(IntPtr raw);
  
  		[DllImport("ethos-sharp.dll")]
  		static extern void ethos_manager_set_plugin_dirs(IntPtr raw, IntPtr plugin_dirs);
  
  		public string PluginDirs { 
  			get {
  				IntPtr raw_ret = ethos_manager_get_plugin_dirs(Handle);
  				string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
  				return ret;
  			}
  			set {
  				IntPtr native_value = GLib.Marshaller.StringToPtrGStrdup (value);
  				ethos_manager_set_plugin_dirs(Handle, native_value);
  				GLib.Marshaller.Free (native_value);
  			}
  		}
  
  		[DllImport("ethos-sharp.dll")]
  		static extern IntPtr ethos_manager_get_plugin_loaders(IntPtr raw);
  
  		public GLib.List PluginLoaders { 
  			get {
  
gt: 				IntPtr raw_ret = ethos_manager_get_plugin_loaders(Handle);