// 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 CellRendererAccel : Gtk.CellRendererText {

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

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

		public CellRendererAccel () : base (IntPtr.Zero)
		{
			if (GetType () != typeof (CellRendererAccel)) {
				CreateNativeObject (Array.Empty<string> (), Array.Empty<GLib.Value> ());
				return;
			}
			Raw = gtk_cell_renderer_accel_new();
		}

		[GLib.Property ("accel-key")]
		public uint AccelKey {
			get {
				GLib.Value val = GetProperty ("accel-key");
				uint ret = (uint) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("accel-key", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("accel-mods")]
		public Gdk.ModifierType AccelMods {
			get {
				GLib.Value val = GetProperty ("accel-mods");
				Gdk.ModifierType ret = (Gdk.ModifierType) (Enum) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value((Enum) value);
				SetProperty("accel-mods", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("keycode")]
		public uint Keycode {
			get {
				GLib.Value val = GetProperty ("keycode");
				uint ret = (uint) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("keycode", val);
				val.Dispose ();
			}
		}

		[GLib.Property ("accel-mode")]
		public Gtk.CellRendererAccelMode AccelMode {
			get {
				GLib.Value val = GetProperty ("accel-mode");
				Gtk.CellRendererAccelMode ret = (Gtk.CellRendererAccelMode) (Enum) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value((Enum) value);
				SetProperty("accel-mode", val);
				val.Dispose ();
			}
		}

		[GLib.Signal("accel-cleared")]
		public event Gtk.AccelClearedHandler AccelCleared {
			add {
				this.AddSignalHandler ("accel-cleared", value, typeof (Gtk.AccelClearedArgs));
			}
			remove {
				this.RemoveSignalHandler ("accel-cleared", value);
			}
		}

		[GLib.Signal("accel-edited")]
		public event Gtk.AccelEditedHandler AccelEdited {
			add {
				this.AddSignalHandler ("accel-edited", value, typeof (Gtk.AccelEditedArgs));
			}
			remove {
				this.RemoveSignalHandler ("accel-edited", value);
			}
		}

		static AccelEditedNativeDelegate AccelEdited_cb_delegate;
		static AccelEditedNativeDelegate AccelEditedVMCallback {
			get {
				if (AccelEdited_cb_delegate == null)
					AccelEdited_cb_delegate = new AccelEditedNativeDelegate (AccelEdited_cb);
				return AccelEdited_cb_delegate;
			}
		}

		static void OverrideAccelEdited (GLib.GType gtype)
		{
			OverrideAccelEdited (gtype, AccelEditedVMCallback);
		}

		static void OverrideAccelEdited (GLib.GType gtype, AccelEditedNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("accel_edited"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void AccelEditedNativeDelegate (IntPtr inst, IntPtr path_string, uint accel_key, int accel_mods, uint hardware_keycode);

		static void AccelEdited_cb (IntPtr inst, IntPtr path_string, uint accel_key, int accel_mods, uint hardware_keycode)
		{
			try {
				CellRendererAccel __obj = GLib.Object.GetObject (inst, false) as CellRendererAccel;
				__obj.OnAccelEdited (GLib.Marshaller.Utf8PtrToString (path_string), accel_key, (Gdk.ModifierType) accel_mods, hardware_keycode);
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.CellRendererAccel), ConnectionMethod="OverrideAccelEdited")]
		protected virtual void OnAccelEdited (string path_string, uint accel_key, Gdk.ModifierType accel_mods, uint hardware_keycode)
		{
			InternalAccelEdited (path_string, accel_key, accel_mods, hardware_keycode);
		}

		private void InternalAccelEdited (string path_string, uint accel_key, Gdk.ModifierType accel_mods, uint hardware_keycode)
		{
			AccelEditedNativeDelegate unmanaged = class_abi.BaseOverride<AccelEditedNativeDelegate>(this.LookupGType(), "accel_edited");
			if (unmanaged == null) return;

			IntPtr native_path_string = GLib.Marshaller.StringToPtrGStrdup (path_string);
			unmanaged (this.Handle, native_path_string, accel_key, (int) accel_mods, hardware_keycode);
			GLib.Marshaller.Free (native_path_string);
		}

		static AccelClearedNativeDelegate AccelCleared_cb_delegate;
		static AccelClearedNativeDelegate AccelClearedVMCallback {
			get {
				if (AccelCleared_cb_delegate == null)
					AccelCleared_cb_delegate = new AccelClearedNativeDelegate (AccelCleared_cb);
				return AccelCleared_cb_delegate;
			}
		}

		static void OverrideAccelCleared (GLib.GType gtype)
		{
			OverrideAccelCleared (gtype, AccelClearedVMCallback);
		}

		static void OverrideAccelCleared (GLib.GType gtype, AccelClearedNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("accel_cleared"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void AccelClearedNativeDelegate (IntPtr inst, IntPtr path_string);

		static void AccelCleared_cb (IntPtr inst, IntPtr path_string)
		{
			try {
				CellRendererAccel __obj = GLib.Object.GetObject (inst, false) as CellRendererAccel;
				__obj.OnAccelCleared (GLib.Marshaller.Utf8PtrToString (path_string));
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.CellRendererAccel), ConnectionMethod="OverrideAccelCleared")]
		protected virtual void OnAccelCleared (string path_string)
		{
			InternalAccelCleared (path_string);
		}

		private void InternalAccelCleared (string path_string)
		{
			AccelClearedNativeDelegate unmanaged = class_abi.BaseOverride<AccelClearedNativeDelegate>(this.LookupGType(), "accel_cleared");
			if (unmanaged == null) return;

			IntPtr native_path_string = GLib.Marshaller.StringToPtrGStrdup (path_string);
			unmanaged (this.Handle, native_path_string);
			GLib.Marshaller.Free (native_path_string);
		}


		// 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 (new List<GLib.AbiField>{ 
						new GLib.AbiField("accel_edited"
							, Gtk.CellRendererText.class_abi.Fields
							, (uint) sizeof( IntPtr ) // accel_edited
							, null
							, "accel_cleared"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("accel_cleared"
							, -1
							, (uint) sizeof( IntPtr ) // accel_cleared
							, "accel_edited"
							, "_gtk_reserved0"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved0"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved0
							, "accel_cleared"
							, "_gtk_reserved1"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved1"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved1
							, "_gtk_reserved0"
							, "_gtk_reserved2"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved2"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved2
							, "_gtk_reserved1"
							, "_gtk_reserved3"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved3"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved3
							, "_gtk_reserved2"
							, "_gtk_reserved4"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved4"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved4
							, "_gtk_reserved3"
							, null
							, (uint) sizeof(IntPtr)
							, 0
							),
					});

				return _class_abi;
			}
		}


		// End of the ABI representation.

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

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


		// 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 (new List<GLib.AbiField>{ 
						new GLib.AbiField("priv"
							, Gtk.CellRendererText.abi_info.Fields
							, (uint) sizeof( IntPtr ) // priv
							, null
							, null
							, (uint) sizeof(IntPtr)
							, 0
							),
					});

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}
