// 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 ColorSelection : Gtk.Box {

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

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

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

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

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

		[Obsolete]
		[GLib.Property ("has-opacity-control")]
		public bool HasOpacityControl {
			get  {
				bool raw_ret = gtk_color_selection_get_has_opacity_control(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set  {
				gtk_color_selection_set_has_opacity_control(Handle, value);
			}
		}

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

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

		[Obsolete]
		[GLib.Property ("has-palette")]
		public bool HasPalette {
			get  {
				bool raw_ret = gtk_color_selection_get_has_palette(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set  {
				gtk_color_selection_set_has_palette(Handle, value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_color_selection_get_current_color(IntPtr raw, IntPtr color);
		static d_gtk_color_selection_get_current_color gtk_color_selection_get_current_color = FuncLoader.LoadFunction<d_gtk_color_selection_get_current_color>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_color_selection_get_current_color"));

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_color_selection_set_current_color(IntPtr raw, IntPtr value);
		static d_gtk_color_selection_set_current_color gtk_color_selection_set_current_color = FuncLoader.LoadFunction<d_gtk_color_selection_set_current_color>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_color_selection_set_current_color"));

		[Obsolete]
		[GLib.Property ("current-color")]
		public Gdk.Color CurrentColor {
			get  {
				Gdk.Color color;
				IntPtr native_color = Marshal.AllocHGlobal (Marshal.SizeOf<Gdk.Color>());
				gtk_color_selection_get_current_color(Handle, native_color);
				color = Gdk.Color.New (native_color);
				Marshal.FreeHGlobal (native_color);
				return color;
			}
			set  {
				IntPtr native_value = GLib.Marshaller.StructureToPtrAlloc (value);
				gtk_color_selection_set_current_color(Handle, native_value);
				Marshal.FreeHGlobal (native_value);
			}
		}

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_color_selection_set_current_alpha(IntPtr raw, ushort alpha);
		static d_gtk_color_selection_set_current_alpha gtk_color_selection_set_current_alpha = FuncLoader.LoadFunction<d_gtk_color_selection_set_current_alpha>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_color_selection_set_current_alpha"));

		[Obsolete]
		[GLib.Property ("current-alpha")]
		public ushort CurrentAlpha {
			get  {
				ushort raw_ret = gtk_color_selection_get_current_alpha(Handle);
				ushort ret = raw_ret;
				return ret;
			}
			set  {
				gtk_color_selection_set_current_alpha(Handle, value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_color_selection_set_current_rgba(IntPtr raw, IntPtr value);
		static d_gtk_color_selection_set_current_rgba gtk_color_selection_set_current_rgba = FuncLoader.LoadFunction<d_gtk_color_selection_set_current_rgba>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_color_selection_set_current_rgba"));

		[Obsolete]
		[GLib.Property ("current-rgba")]
		public Gdk.RGBA CurrentRgba {
			get {
				GLib.Value val = GetProperty ("current-rgba");
				Gdk.RGBA ret = (Gdk.RGBA) val;
				val.Dispose ();
				return ret;
			}
			set  {
				IntPtr native_value = GLib.Marshaller.StructureToPtrAlloc (value);
				gtk_color_selection_set_current_rgba(Handle, native_value);
				Marshal.FreeHGlobal (native_value);
			}
		}

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

		static ColorChangedNativeDelegate ColorChanged_cb_delegate;
		static ColorChangedNativeDelegate ColorChangedVMCallback {
			get {
				if (ColorChanged_cb_delegate == null)
					ColorChanged_cb_delegate = new ColorChangedNativeDelegate (ColorChanged_cb);
				return ColorChanged_cb_delegate;
			}
		}

		static void OverrideColorChanged (GLib.GType gtype)
		{
			OverrideColorChanged (gtype, ColorChangedVMCallback);
		}

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

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

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

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.ColorSelection), ConnectionMethod="OverrideColorChanged")]
		protected virtual void OnColorChanged ()
		{
			InternalColorChanged ();
		}

		private void InternalColorChanged ()
		{
			ColorChangedNativeDelegate unmanaged = class_abi.BaseOverride<ColorChangedNativeDelegate>(this.LookupGType(), "color_changed");
			if (unmanaged == null) return;

			unmanaged (this.Handle);
		}


		// 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("color_changed"
							, Gtk.Box.class_abi.Fields
							, (uint) sizeof( IntPtr ) // color_changed
							, null
							, "_gtk_reserved1"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved1"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved1
							, "color_changed"
							, "_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_color_selection_get_current_rgba(IntPtr raw, IntPtr rgba);
		static d_gtk_color_selection_get_current_rgba gtk_color_selection_get_current_rgba = FuncLoader.LoadFunction<d_gtk_color_selection_get_current_rgba>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_color_selection_get_current_rgba"));

		[Obsolete]
		public void GetCurrentRgba(Gdk.RGBA rgba) {
			IntPtr native_rgba = GLib.Marshaller.StructureToPtrAlloc (rgba);
			gtk_color_selection_get_current_rgba(Handle, native_rgba);
			Marshal.FreeHGlobal (native_rgba);
		}

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_color_selection_set_previous_alpha(IntPtr raw, ushort alpha);
		static d_gtk_color_selection_set_previous_alpha gtk_color_selection_set_previous_alpha = FuncLoader.LoadFunction<d_gtk_color_selection_set_previous_alpha>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_color_selection_set_previous_alpha"));

		[Obsolete]
		public ushort PreviousAlpha { 
			get {
				ushort raw_ret = gtk_color_selection_get_previous_alpha(Handle);
				ushort ret = raw_ret;
				return ret;
			}
			set {
				gtk_color_selection_set_previous_alpha(Handle, value);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_color_selection_get_previous_rgba(IntPtr raw, IntPtr rgba);
		static d_gtk_color_selection_get_previous_rgba gtk_color_selection_get_previous_rgba = FuncLoader.LoadFunction<d_gtk_color_selection_get_previous_rgba>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_color_selection_get_previous_rgba"));

		[Obsolete]
		public void GetPreviousRgba(Gdk.RGBA rgba) {
			IntPtr native_rgba = GLib.Marshaller.StructureToPtrAlloc (rgba);
			gtk_color_selection_get_previous_rgba(Handle, native_rgba);
			Marshal.FreeHGlobal (native_rgba);
		}

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

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

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

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_color_selection_set_previous_rgba(IntPtr raw, IntPtr rgba);
		static d_gtk_color_selection_set_previous_rgba gtk_color_selection_set_previous_rgba = FuncLoader.LoadFunction<d_gtk_color_selection_set_previous_rgba>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_color_selection_set_previous_rgba"));

		[Obsolete]
		public void SetPreviousRgba(Gdk.RGBA rgba) {
			IntPtr native_rgba = GLib.Marshaller.StructureToPtrAlloc (rgba);
			gtk_color_selection_set_previous_rgba(Handle, native_rgba);
			Marshal.FreeHGlobal (native_rgba);
		}


		// 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("private_data"
							, Gtk.Box.abi_info.Fields
							, (uint) sizeof( IntPtr ) // private_data
							, null
							, null
							, (uint) sizeof(IntPtr)
							, 0
							),
					});

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}
