// 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 UserMessage : GLib.InitiallyUnowned {

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_webkit_user_message_new(IntPtr name, IntPtr parameters);
		static d_webkit_user_message_new webkit_user_message_new = FuncLoader.LoadFunction<d_webkit_user_message_new>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_user_message_new"));

		public UserMessage (string name, GLib.Variant parameters) : base (IntPtr.Zero)
		{
			if (GetType () != typeof (UserMessage)) {
				var vals = new List<GLib.Value> ();
				var names = new List<string> ();
				names.Add ("name");
				vals.Add (new GLib.Value (name));
				names.Add ("parameters");
				vals.Add (new GLib.Value (parameters));
				CreateNativeObject (names.ToArray (), vals.ToArray ());
				return;
			}
			IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
			Raw = webkit_user_message_new(native_name, parameters == null ? IntPtr.Zero : parameters.Handle);
			GLib.Marshaller.Free (native_name);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_webkit_user_message_new_with_fd_list(IntPtr name, IntPtr parameters, IntPtr fd_list);
		static d_webkit_user_message_new_with_fd_list webkit_user_message_new_with_fd_list = FuncLoader.LoadFunction<d_webkit_user_message_new_with_fd_list>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Webkit), "webkit_user_message_new_with_fd_list"));

		public UserMessage (string name, GLib.Variant parameters, GLib.UnixFDList fd_list) : base (IntPtr.Zero)
		{
			if (GetType () != typeof (UserMessage)) {
				var vals = new List<GLib.Value> ();
				var names = new List<string> ();
				names.Add ("name");
				vals.Add (new GLib.Value (name));
				names.Add ("parameters");
				vals.Add (new GLib.Value (parameters));
				if (fd_list != null) {
					names.Add ("fd_list");
					vals.Add (new GLib.Value (fd_list));
				}
				CreateNativeObject (names.ToArray (), vals.ToArray ());
				return;
			}
			IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
			Raw = webkit_user_message_new_with_fd_list(native_name, parameters == null ? IntPtr.Zero : parameters.Handle, fd_list == null ? IntPtr.Zero : fd_list.Handle);
			GLib.Marshaller.Free (native_name);
		}

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

		[GLib.Property ("fd-list")]
		public GLib.UnixFDList FdList {
			get  {
				IntPtr raw_ret = webkit_user_message_get_fd_list(Handle);
				GLib.UnixFDList ret = GLib.Object.GetObject(raw_ret) as GLib.UnixFDList;
				return ret;
			}
		}

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

		[GLib.Property ("name")]
		public string Name {
			get  {
				IntPtr raw_ret = webkit_user_message_get_name(Handle);
				string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
				return ret;
			}
		}

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

		[GLib.Property ("parameters")]
		public GLib.Variant Parameters {
			get  {
				IntPtr raw_ret = webkit_user_message_get_parameters(Handle);
				GLib.Variant ret = new GLib.Variant(raw_ret);
				return ret;
			}
		}


		// 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("_webkit_reserved0"
							, GLib.Object.class_abi.Fields
							, (uint) sizeof( IntPtr ) // _webkit_reserved0
							, null
							, "_webkit_reserved1"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_webkit_reserved1"
							, -1
							, (uint) sizeof( IntPtr ) // _webkit_reserved1
							, "_webkit_reserved0"
							, "_webkit_reserved2"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_webkit_reserved2"
							, -1
							, (uint) sizeof( IntPtr ) // _webkit_reserved2
							, "_webkit_reserved1"
							, "_webkit_reserved3"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_webkit_reserved3"
							, -1
							, (uint) sizeof( IntPtr ) // _webkit_reserved3
							, "_webkit_reserved2"
							, null
							, (uint) sizeof(IntPtr)
							, 0
							),
					});

				return _class_abi;
			}
		}


		// End of the ABI representation.

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

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

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

		public void SendReply(WebKit.UserMessage reply) {
			webkit_user_message_send_reply(Handle, reply == null ? IntPtr.Zero : reply.Handle);
		}


		static UserMessage ()
		{
			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
	}
}
