// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.

namespace Gtk {

	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Runtime.InteropServices;
	using static GLib.AbiStructExtension;

#region Autogenerated code
	public partial class AccelMap : GLib.Object {

		public AccelMap (IntPtr raw) : base(raw) {}

		protected AccelMap() : base(IntPtr.Zero)
		{
			CreateNativeObject (Array.Empty<string> (), Array.Empty<GLib.Value> ());
		}

		[GLib.Signal("changed")]
		public event Gtk.MapChangedHandler MapChanged {
			add {
				this.AddSignalHandler ("changed", value, typeof (Gtk.MapChangedArgs));
			}
			remove {
				this.RemoveSignalHandler ("changed", value);
			}
		}

		static MapChangedNativeDelegate MapChanged_cb_delegate;
		static MapChangedNativeDelegate MapChangedVMCallback {
			get {
				if (MapChanged_cb_delegate == null)
					MapChanged_cb_delegate = new MapChangedNativeDelegate (MapChanged_cb);
				return MapChanged_cb_delegate;
			}
		}

		static void OverrideMapChanged (GLib.GType gtype)
		{
			OverrideMapChanged (gtype, MapChangedVMCallback);
		}

		static void OverrideMapChanged (GLib.GType gtype, MapChangedNativeDelegate callback)
		{
			OverrideVirtualMethod (gtype, "changed", callback);
		}
		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void MapChangedNativeDelegate (IntPtr inst, IntPtr accel_path, uint accel_key, int accel_mods);

		static void MapChanged_cb (IntPtr inst, IntPtr accel_path, uint accel_key, int accel_mods)
		{
			try {
				AccelMap __obj = GLib.Object.GetObject (inst, false) as AccelMap;
				__obj.OnMapChanged (GLib.Marshaller.PtrToStringGFree(accel_path), accel_key, (Gdk.ModifierType) accel_mods);
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.AccelMap), ConnectionMethod="OverrideMapChanged")]
		protected virtual void OnMapChanged (string accel_path, uint accel_key, Gdk.ModifierType accel_mods)
		{
			InternalMapChanged (accel_path, accel_key, accel_mods);
		}

		private void InternalMapChanged (string accel_path, uint accel_key, Gdk.ModifierType accel_mods)
		{
			GLib.Value ret = GLib.Value.Empty;
			GLib.ValueArray inst_and_params = new GLib.ValueArray (4);
			GLib.Value[] vals = new GLib.Value [4];
			vals [0] = new GLib.Value (this);
			inst_and_params.Append (vals [0]);
			vals [1] = new GLib.Value (accel_path);
			inst_and_params.Append (vals [1]);
			vals [2] = new GLib.Value (accel_key);
			inst_and_params.Append (vals [2]);
			vals [3] = new GLib.Value (accel_mods);
			inst_and_params.Append (vals [3]);
			g_signal_chain_from_overridden (inst_and_params.ArrayPtr, ref ret);
			foreach (GLib.Value v in vals)
				v.Dispose ();
		}


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _class_abi = null;
		static public unsafe new GLib.AbiStruct class_abi {
			get {
				if (_class_abi == null)
					_class_abi = new GLib.AbiStruct (GLib.Object.class_abi.Fields);

				return _class_abi;
			}
		}


		// End of the ABI representation.

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_accel_map_add_entry(IntPtr accel_path, uint accel_key, int accel_mods);
		static d_gtk_accel_map_add_entry gtk_accel_map_add_entry = FuncLoader.LoadFunction<d_gtk_accel_map_add_entry>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_accel_map_add_entry"));

		public static void AddEntry(string accel_path, uint accel_key, Gdk.ModifierType accel_mods) {
			IntPtr native_accel_path = GLib.Marshaller.StringToPtrGStrdup (accel_path);
			gtk_accel_map_add_entry(native_accel_path, accel_key, (int) accel_mods);
			GLib.Marshaller.Free (native_accel_path);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_accel_map_add_filter(IntPtr filter_pattern);
		static d_gtk_accel_map_add_filter gtk_accel_map_add_filter = FuncLoader.LoadFunction<d_gtk_accel_map_add_filter>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_accel_map_add_filter"));

		public static void AddFilter(string filter_pattern) {
			IntPtr native_filter_pattern = GLib.Marshaller.StringToPtrGStrdup (filter_pattern);
			gtk_accel_map_add_filter(native_filter_pattern);
			GLib.Marshaller.Free (native_filter_pattern);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_gtk_accel_map_change_entry(IntPtr accel_path, uint accel_key, int accel_mods, bool replace);
		static d_gtk_accel_map_change_entry gtk_accel_map_change_entry = FuncLoader.LoadFunction<d_gtk_accel_map_change_entry>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_accel_map_change_entry"));

		public static bool ChangeEntry(string accel_path, uint accel_key, Gdk.ModifierType accel_mods, bool replace) {
			IntPtr native_accel_path = GLib.Marshaller.StringToPtrGStrdup (accel_path);
			bool raw_ret = gtk_accel_map_change_entry(native_accel_path, accel_key, (int) accel_mods, replace);
			bool ret = raw_ret;
			GLib.Marshaller.Free (native_accel_path);
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_accel_map_foreach(IntPtr data, GtkSharp.AccelMapForeachNative foreach_func);
		static d_gtk_accel_map_foreach gtk_accel_map_foreach = FuncLoader.LoadFunction<d_gtk_accel_map_foreach>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_accel_map_foreach"));

		public static void Foreach(IntPtr data, Gtk.AccelMapForeach foreach_func) {
			GtkSharp.AccelMapForeachWrapper foreach_func_wrapper = new GtkSharp.AccelMapForeachWrapper (foreach_func);
			gtk_accel_map_foreach(data, foreach_func_wrapper.NativeDelegate);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_accel_map_foreach_unfiltered(IntPtr data, GtkSharp.AccelMapForeachNative foreach_func);
		static d_gtk_accel_map_foreach_unfiltered gtk_accel_map_foreach_unfiltered = FuncLoader.LoadFunction<d_gtk_accel_map_foreach_unfiltered>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_accel_map_foreach_unfiltered"));

		public static void ForeachUnfiltered(IntPtr data, Gtk.AccelMapForeach foreach_func) {
			GtkSharp.AccelMapForeachWrapper foreach_func_wrapper = new GtkSharp.AccelMapForeachWrapper (foreach_func);
			gtk_accel_map_foreach_unfiltered(data, foreach_func_wrapper.NativeDelegate);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_accel_map_get();
		static d_gtk_accel_map_get gtk_accel_map_get = FuncLoader.LoadFunction<d_gtk_accel_map_get>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_accel_map_get"));

		public static Gtk.AccelMap Get() {
			IntPtr raw_ret = gtk_accel_map_get();
			Gtk.AccelMap ret = GLib.Object.GetObject(raw_ret) as Gtk.AccelMap;
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_accel_map_get_type();
		static d_gtk_accel_map_get_type gtk_accel_map_get_type = FuncLoader.LoadFunction<d_gtk_accel_map_get_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_accel_map_get_type"));

		public static new GLib.GType GType { 
			get {
				IntPtr raw_ret = gtk_accel_map_get_type();
				GLib.GType ret = new GLib.GType(raw_ret);
				return ret;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_accel_map_load(IntPtr file_name);
		static d_gtk_accel_map_load gtk_accel_map_load = FuncLoader.LoadFunction<d_gtk_accel_map_load>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_accel_map_load"));

		public static void Load(string file_name) {
			IntPtr native_file_name = GLib.Marshaller.StringToPtrGStrdup (file_name);
			gtk_accel_map_load(native_file_name);
			GLib.Marshaller.Free (native_file_name);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_accel_map_load_fd(int fd);
		static d_gtk_accel_map_load_fd gtk_accel_map_load_fd = FuncLoader.LoadFunction<d_gtk_accel_map_load_fd>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_accel_map_load_fd"));

		public static void LoadFd(int fd) {
			gtk_accel_map_load_fd(fd);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_accel_map_lock_path(IntPtr accel_path);
		static d_gtk_accel_map_lock_path gtk_accel_map_lock_path = FuncLoader.LoadFunction<d_gtk_accel_map_lock_path>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_accel_map_lock_path"));

		public static void LockPath(string accel_path) {
			IntPtr native_accel_path = GLib.Marshaller.StringToPtrGStrdup (accel_path);
			gtk_accel_map_lock_path(native_accel_path);
			GLib.Marshaller.Free (native_accel_path);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_gtk_accel_map_lookup_entry(IntPtr accel_path, IntPtr key);
		static d_gtk_accel_map_lookup_entry gtk_accel_map_lookup_entry = FuncLoader.LoadFunction<d_gtk_accel_map_lookup_entry>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_accel_map_lookup_entry"));

		public static bool LookupEntry(string accel_path, out Gtk.AccelKey key) {
			IntPtr native_accel_path = GLib.Marshaller.StringToPtrGStrdup (accel_path);
			IntPtr native_key = Marshal.AllocHGlobal (Marshal.SizeOf<Gtk.AccelKey>());
			bool raw_ret = gtk_accel_map_lookup_entry(native_accel_path, native_key);
			bool ret = raw_ret;
			GLib.Marshaller.Free (native_accel_path);
			key = Gtk.AccelKey.New (native_key);
			Marshal.FreeHGlobal (native_key);
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_accel_map_save(IntPtr file_name);
		static d_gtk_accel_map_save gtk_accel_map_save = FuncLoader.LoadFunction<d_gtk_accel_map_save>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_accel_map_save"));

		public static void Save(string file_name) {
			IntPtr native_file_name = GLib.Marshaller.StringToPtrGStrdup (file_name);
			gtk_accel_map_save(native_file_name);
			GLib.Marshaller.Free (native_file_name);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_accel_map_save_fd(int fd);
		static d_gtk_accel_map_save_fd gtk_accel_map_save_fd = FuncLoader.LoadFunction<d_gtk_accel_map_save_fd>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_accel_map_save_fd"));

		public static void SaveFd(int fd) {
			gtk_accel_map_save_fd(fd);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_accel_map_unlock_path(IntPtr accel_path);
		static d_gtk_accel_map_unlock_path gtk_accel_map_unlock_path = FuncLoader.LoadFunction<d_gtk_accel_map_unlock_path>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_accel_map_unlock_path"));

		public static void UnlockPath(string accel_path) {
			IntPtr native_accel_path = GLib.Marshaller.StringToPtrGStrdup (accel_path);
			gtk_accel_map_unlock_path(native_accel_path);
			GLib.Marshaller.Free (native_accel_path);
		}


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _abi_info = null;
		static public unsafe new GLib.AbiStruct abi_info {
			get {
				if (_abi_info == null)
					_abi_info = new GLib.AbiStruct (GLib.Object.abi_info.Fields);

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}
