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

namespace Poppler {

	using System;
	using System.Collections;
	using System.Runtime.InteropServices;

#region Autogenerated code
	[StructLayout(LayoutKind.Sequential)]
	public struct LinkMapping {

		public Poppler.Rectangle Area;
		private IntPtr _action;
		public Poppler.Action Action {
			get {
				return GLib.Object.GetObject(_action) as Poppler.Action;
			}
			set {
				_action = value == null ? IntPtr.Zero : value.Handle;
			}
		}

		public static Poppler.LinkMapping Zero = new Poppler.LinkMapping ();

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

		[DllImport("poppler-glib")]
		static extern IntPtr poppler_link_mapping_new();

		public static LinkMapping New()
		{
			LinkMapping result = LinkMapping.New (poppler_link_mapping_new());
			return result;
		}

		[DllImport("poppler-glib")]
		static extern IntPtr poppler_link_mapping_copy(IntPtr raw);

		public Poppler.LinkMapping Copy() {
			IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
			System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
			IntPtr raw_ret = poppler_link_mapping_copy(this_as_native);
			Poppler.LinkMapping ret = Poppler.LinkMapping.New (raw_ret);
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

		[DllImport("poppler-glib")]
		static extern void poppler_link_mapping_free(IntPtr raw);

		public void Free() {
			IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
			System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
			poppler_link_mapping_free(this_as_native);
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
		}

		[DllImport("poppler-glib")]
		static extern IntPtr poppler_link_mapping_get_type();

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

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

#endregion
	}
}
