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

namespace WebKit {

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

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

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

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

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

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

		[GLib.Property ("rgba")]
		public Gdk.RGBA Rgba {
			get  {
				Gdk.RGBA rgba;
				IntPtr native_rgba = Marshal.AllocHGlobal (Marshal.SizeOf<Gdk.RGBA>());
				webkit_color_chooser_request_get_rgba(Handle, native_rgba);
				rgba = Gdk.RGBA.New (native_rgba);
				Marshal.FreeHGlobal (native_rgba);
				return rgba;
			}
			set  {
				IntPtr native_value = GLib.Marshaller.StructureToPtrAlloc (value);
				webkit_color_chooser_request_set_rgba(Handle, native_value);
				Marshal.FreeHGlobal (native_value);
			}
		}

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

		static FinishedNativeDelegate Finished_cb_delegate;
		static FinishedNativeDelegate FinishedVMCallback {
			get {
				if (Finished_cb_delegate == null)
					Finished_cb_delegate = new FinishedNativeDelegate (Finished_cb);
				return Finished_cb_delegate;
			}
		}

		static void OverrideFinished (GLib.GType gtype)
		{
			OverrideFinished (gtype, FinishedVMCallback);
		}

		static void OverrideFinished (GLib.GType gtype, FinishedNativeDelegate callback)
		{
			OverrideVirtualMethod (gtype, "finished", callback);
		}
		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void FinishedNativeDelegate (IntPtr inst);

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

		[GLib.DefaultSignalHandler(Type=typeof(WebKit.ColorChooserRequest), ConnectionMethod="OverrideFinished")]
		protected virtual void OnFinished ()
		{
			InternalFinished ();
		}

		private void InternalFinished ()
		{
			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 ();
		}


		// 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 IntPtr d_webkit_color_chooser_request_get_type();
		static d_webkit_color_chooser_request_get_type webkit_color_chooser_request_get_type = FuncLoader.LoadFunction<d_webkit_color_chooser_request_get_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_color_chooser_request_get_type"));

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_webkit_color_chooser_request_cancel(IntPtr raw);
		static d_webkit_color_chooser_request_cancel webkit_color_chooser_request_cancel = FuncLoader.LoadFunction<d_webkit_color_chooser_request_cancel>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_color_chooser_request_cancel"));

		public void Cancel() {
			webkit_color_chooser_request_cancel(Handle);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_webkit_color_chooser_request_finish(IntPtr raw);
		static d_webkit_color_chooser_request_finish webkit_color_chooser_request_finish = FuncLoader.LoadFunction<d_webkit_color_chooser_request_finish>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_color_chooser_request_finish"));

		public void Finish() {
			webkit_color_chooser_request_finish(Handle);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_webkit_color_chooser_request_get_element_rectangle(IntPtr raw, IntPtr rect);
		static d_webkit_color_chooser_request_get_element_rectangle webkit_color_chooser_request_get_element_rectangle = FuncLoader.LoadFunction<d_webkit_color_chooser_request_get_element_rectangle>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_color_chooser_request_get_element_rectangle"));

		public Gdk.Rectangle ElementRectangle { 
			get {
				Gdk.Rectangle rect;
				IntPtr native_rect = Marshal.AllocHGlobal (Marshal.SizeOf<Gdk.Rectangle>());
				webkit_color_chooser_request_get_element_rectangle(Handle, native_rect);
				rect = (Gdk.Rectangle) Marshal.PtrToStructure (native_rect, typeof (Gdk.Rectangle));
				Marshal.FreeHGlobal (native_rect);
				return rect;
			}
		}


		static ColorChooserRequest ()
		{
			GtkSharp.WebkitGtkSharp.ObjectManager.Initialize ();
		}

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

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}
