// 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 HSV : Gtk.Widget {

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

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

		[Obsolete]
		public HSV () : base (IntPtr.Zero)
		{
			if (GetType () != typeof (HSV)) {
				CreateNativeObject (Array.Empty<string> (), Array.Empty<GLib.Value> ());
				return;
			}
			Raw = gtk_hsv_new();
		}

		[GLib.Signal("changed")]
		public event System.EventHandler Changed {
			add {
				this.AddSignalHandler ("changed", value);
			}
			remove {
				this.RemoveSignalHandler ("changed", value);
			}
		}

		[GLib.Signal("move")]
		public event Gtk.MoveHandler Move {
			add {
				this.AddSignalHandler ("move", value, typeof (Gtk.MoveArgs));
			}
			remove {
				this.RemoveSignalHandler ("move", value);
			}
		}

		static ChangedNativeDelegate Changed_cb_delegate;
		static ChangedNativeDelegate ChangedVMCallback {
			get {
				if (Changed_cb_delegate == null)
					Changed_cb_delegate = new ChangedNativeDelegate (Changed_cb);
				return Changed_cb_delegate;
			}
		}

		static void OverrideChanged (GLib.GType gtype)
		{
			OverrideChanged (gtype, ChangedVMCallback);
		}

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void ChangedNativeDelegate (IntPtr inst);

		static void Changed_cb (IntPtr inst)
		{
			try {
				HSV __obj = GLib.Object.GetObject (inst, false) as HSV;
				__obj.OnChanged ();
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.HSV), ConnectionMethod="OverrideChanged")]
		protected virtual void OnChanged ()
		{
			InternalChanged ();
		}

		private void InternalChanged ()
		{
			ChangedNativeDelegate unmanaged = class_abi.BaseOverride<ChangedNativeDelegate>(this.LookupGType(), "changed");
			if (unmanaged == null) return;

			unmanaged (this.Handle);
		}

		static MoveNativeDelegate Move_cb_delegate;
		static MoveNativeDelegate MoveVMCallback {
			get {
				if (Move_cb_delegate == null)
					Move_cb_delegate = new MoveNativeDelegate (Move_cb);
				return Move_cb_delegate;
			}
		}

		static void OverrideMove (GLib.GType gtype)
		{
			OverrideMove (gtype, MoveVMCallback);
		}

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void MoveNativeDelegate (IntPtr inst, int type);

		static void Move_cb (IntPtr inst, int type)
		{
			try {
				HSV __obj = GLib.Object.GetObject (inst, false) as HSV;
				__obj.OnMove ((Gtk.DirectionType) type);
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.HSV), ConnectionMethod="OverrideMove")]
		protected virtual void OnMove (Gtk.DirectionType type)
		{
			InternalMove (type);
		}

		private void InternalMove (Gtk.DirectionType type)
		{
			MoveNativeDelegate unmanaged = class_abi.BaseOverride<MoveNativeDelegate>(this.LookupGType(), "move");
			if (unmanaged == null) return;

			unmanaged (this.Handle, (int) type);
		}


		// 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("changed"
							, Gtk.Widget.class_abi.Fields
							, (uint) sizeof( IntPtr ) // changed
							, null
							, "move"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("move"
							, -1
							, (uint) sizeof( IntPtr ) // move
							, "changed"
							, "_gtk_reserved1"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved1"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved1
							, "move"
							, "_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 void d_gtk_hsv_get_color(IntPtr raw, out double h, out double s, out double v);
		static d_gtk_hsv_get_color gtk_hsv_get_color = FuncLoader.LoadFunction<d_gtk_hsv_get_color>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_hsv_get_color"));

		[Obsolete]
		public void GetColor(out double h, out double s, out double v) {
			gtk_hsv_get_color(Handle, out h, out s, out v);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_hsv_get_metrics(IntPtr raw, out int size, out int ring_width);
		static d_gtk_hsv_get_metrics gtk_hsv_get_metrics = FuncLoader.LoadFunction<d_gtk_hsv_get_metrics>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_hsv_get_metrics"));

		[Obsolete]
		public void GetMetrics(out int size, out int ring_width) {
			gtk_hsv_get_metrics(Handle, out size, out ring_width);
		}

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

		[Obsolete]
		public static new GLib.GType GType { 
			get {
				IntPtr raw_ret = gtk_hsv_get_type();
				GLib.GType ret = new GLib.GType(raw_ret);
				return ret;
			}
		}

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

		[Obsolete]
		public bool IsAdjusting { 
			get {
				bool raw_ret = gtk_hsv_is_adjusting(Handle);
				bool ret = raw_ret;
				return ret;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_hsv_set_color(IntPtr raw, double h, double s, double v);
		static d_gtk_hsv_set_color gtk_hsv_set_color = FuncLoader.LoadFunction<d_gtk_hsv_set_color>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_hsv_set_color"));

		[Obsolete]
		public void SetColor(double h, double s, double v) {
			gtk_hsv_set_color(Handle, h, s, v);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_hsv_set_metrics(IntPtr raw, int size, int ring_width);
		static d_gtk_hsv_set_metrics gtk_hsv_set_metrics = FuncLoader.LoadFunction<d_gtk_hsv_set_metrics>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_hsv_set_metrics"));

		[Obsolete]
		public void SetMetrics(int size, int ring_width) {
			gtk_hsv_set_metrics(Handle, size, ring_width);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_hsv_to_rgb(double h, double s, double v, out double r, out double g, out double b);
		static d_gtk_hsv_to_rgb gtk_hsv_to_rgb = FuncLoader.LoadFunction<d_gtk_hsv_to_rgb>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_hsv_to_rgb"));

		public static void ToRgb(double h, double s, double v, out double r, out double g, out double b) {
			gtk_hsv_to_rgb(h, s, v, out r, out g, out b);
		}


		// 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.Widget.abi_info.Fields
							, (uint) sizeof( IntPtr ) // priv
							, null
							, null
							, (uint) sizeof(IntPtr)
							, 0
							),
					});

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}
