// 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;

#region Autogenerated code
	[StructLayout(LayoutKind.Sequential)]
	public partial struct UserContentFilter : IEquatable<UserContentFilter> {


		public static WebKit.UserContentFilter Zero = new WebKit.UserContentFilter ();

		public static WebKit.UserContentFilter New(IntPtr raw) {
			if (raw == IntPtr.Zero)
				return WebKit.UserContentFilter.Zero;
			return (WebKit.UserContentFilter) Marshal.PtrToStructure (raw, typeof (WebKit.UserContentFilter));
		}

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

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

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

		public string Identifier { 
			get {
				IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf<WebKit.UserContentFilter>());
				System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
				IntPtr raw_ret = webkit_user_content_filter_get_identifier(this_as_native);
				string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
				ReadNative (this_as_native, ref this);
				System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
				return ret;
			}
		}

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

		public WebKit.UserContentFilter Ref() {
			IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf<WebKit.UserContentFilter>());
			System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
			IntPtr raw_ret = webkit_user_content_filter_ref(this_as_native);
			WebKit.UserContentFilter ret = WebKit.UserContentFilter.New (raw_ret);
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

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

		public void Unref() {
			IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf<WebKit.UserContentFilter>());
			System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
			webkit_user_content_filter_unref(this_as_native);
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
		}

		static void ReadNative (IntPtr native, ref WebKit.UserContentFilter target)
		{
			target = New (native);
		}

		public bool Equals (UserContentFilter other)
		{
			return true;
		}

		public override bool Equals (object other)
		{
			return other is UserContentFilter && Equals ((UserContentFilter) other);
		}

		public override int GetHashCode ()
		{
			return this.GetType ().FullName.GetHashCode ();
		}

		public static explicit operator GLib.Value (WebKit.UserContentFilter boxed)
		{
			GLib.Value val = GLib.Value.Empty;
			val.Init (WebKit.UserContentFilter.GType);
			val.Val = boxed;
			return val;
		}

		public static explicit operator WebKit.UserContentFilter (GLib.Value val)
		{
			return (WebKit.UserContentFilter) val.Val;
		}
#endregion
	}
}
