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

#region Autogenerated code
	public partial class PaperSize : GLib.Opaque {

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

		public Gtk.PaperSize Copy() {
			IntPtr raw_ret = gtk_paper_size_copy(Handle);
			Gtk.PaperSize ret = raw_ret == IntPtr.Zero ? null : (Gtk.PaperSize) GLib.Opaque.GetOpaque (raw_ret, typeof (Gtk.PaperSize), true);
			return ret;
		}

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

		public static string Default { 
			get {
				IntPtr raw_ret = gtk_paper_size_get_default();
				string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
				return ret;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate double d_gtk_paper_size_get_default_bottom_margin(IntPtr raw, int unit);
		static d_gtk_paper_size_get_default_bottom_margin gtk_paper_size_get_default_bottom_margin = FuncLoader.LoadFunction<d_gtk_paper_size_get_default_bottom_margin>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_paper_size_get_default_bottom_margin"));

		public double GetDefaultBottomMargin(Gtk.Unit unit) {
			double raw_ret = gtk_paper_size_get_default_bottom_margin(Handle, (int) unit);
			double ret = raw_ret;
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate double d_gtk_paper_size_get_default_left_margin(IntPtr raw, int unit);
		static d_gtk_paper_size_get_default_left_margin gtk_paper_size_get_default_left_margin = FuncLoader.LoadFunction<d_gtk_paper_size_get_default_left_margin>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_paper_size_get_default_left_margin"));

		public double GetDefaultLeftMargin(Gtk.Unit unit) {
			double raw_ret = gtk_paper_size_get_default_left_margin(Handle, (int) unit);
			double ret = raw_ret;
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate double d_gtk_paper_size_get_default_right_margin(IntPtr raw, int unit);
		static d_gtk_paper_size_get_default_right_margin gtk_paper_size_get_default_right_margin = FuncLoader.LoadFunction<d_gtk_paper_size_get_default_right_margin>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_paper_size_get_default_right_margin"));

		public double GetDefaultRightMargin(Gtk.Unit unit) {
			double raw_ret = gtk_paper_size_get_default_right_margin(Handle, (int) unit);
			double ret = raw_ret;
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate double d_gtk_paper_size_get_default_top_margin(IntPtr raw, int unit);
		static d_gtk_paper_size_get_default_top_margin gtk_paper_size_get_default_top_margin = FuncLoader.LoadFunction<d_gtk_paper_size_get_default_top_margin>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_paper_size_get_default_top_margin"));

		public double GetDefaultTopMargin(Gtk.Unit unit) {
			double raw_ret = gtk_paper_size_get_default_top_margin(Handle, (int) unit);
			double ret = raw_ret;
			return ret;
		}

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

		public string DisplayName { 
			get {
				IntPtr raw_ret = gtk_paper_size_get_display_name(Handle);
				string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
				return ret;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate double d_gtk_paper_size_get_height(IntPtr raw, int unit);
		static d_gtk_paper_size_get_height gtk_paper_size_get_height = FuncLoader.LoadFunction<d_gtk_paper_size_get_height>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_paper_size_get_height"));

		public double GetHeight(Gtk.Unit unit) {
			double raw_ret = gtk_paper_size_get_height(Handle, (int) unit);
			double ret = raw_ret;
			return ret;
		}

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

		public string Name { 
			get {
				IntPtr raw_ret = gtk_paper_size_get_name(Handle);
				string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
				return ret;
			}
		}

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

		public static Gtk.PaperSize[] GetPaperSizes(bool include_custom) {
			IntPtr raw_ret = gtk_paper_size_get_paper_sizes(include_custom);
			Gtk.PaperSize[] ret = GLib.Marshaller.ListPtrToArray<Gtk.PaperSize, Gtk.PaperSize> (raw_ret, true, true);
			return ret;
		}

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

		public string PpdName { 
			get {
				IntPtr raw_ret = gtk_paper_size_get_ppd_name(Handle);
				string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
				return ret;
			}
		}

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

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate double d_gtk_paper_size_get_width(IntPtr raw, int unit);
		static d_gtk_paper_size_get_width gtk_paper_size_get_width = FuncLoader.LoadFunction<d_gtk_paper_size_get_width>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_paper_size_get_width"));

		public double GetWidth(Gtk.Unit unit) {
			double raw_ret = gtk_paper_size_get_width(Handle, (int) unit);
			double ret = raw_ret;
			return ret;
		}

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

		public bool IsCustom { 
			get {
				bool raw_ret = gtk_paper_size_is_custom(Handle);
				bool ret = raw_ret;
				return ret;
			}
		}

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

		public bool IsEqual(Gtk.PaperSize size2) {
			bool raw_ret = gtk_paper_size_is_equal(Handle, size2 == null ? IntPtr.Zero : size2.Handle);
			bool ret = raw_ret;
			return ret;
		}

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

		public bool IsIpp { 
			get {
				bool raw_ret = gtk_paper_size_is_ipp(Handle);
				bool ret = raw_ret;
				return ret;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_paper_size_set_size(IntPtr raw, double width, double height, int unit);
		static d_gtk_paper_size_set_size gtk_paper_size_set_size = FuncLoader.LoadFunction<d_gtk_paper_size_set_size>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_paper_size_set_size"));

		public void SetSize(double width, double height, Gtk.Unit unit) {
			gtk_paper_size_set_size(Handle, width, height, (int) unit);
		}

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

		public GLib.Variant ToGvariant() {
			IntPtr raw_ret = gtk_paper_size_to_gvariant(Handle);
			GLib.Variant ret = new GLib.Variant(raw_ret);
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_paper_size_to_key_file(IntPtr raw, IntPtr key_file, IntPtr group_name);
		static d_gtk_paper_size_to_key_file gtk_paper_size_to_key_file = FuncLoader.LoadFunction<d_gtk_paper_size_to_key_file>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_paper_size_to_key_file"));

		public void ToKeyFile(GLib.KeyFile key_file, string group_name) {
			IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
			gtk_paper_size_to_key_file(Handle, key_file == null ? IntPtr.Zero : key_file.Handle, native_group_name);
			GLib.Marshaller.Free (native_group_name);
		}

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

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

		public PaperSize (string name) 
		{
			IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
			Raw = gtk_paper_size_new(native_name);
			GLib.Marshaller.Free (native_name);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_paper_size_new_custom(IntPtr name, IntPtr display_name, double width, double height, int unit);
		static d_gtk_paper_size_new_custom gtk_paper_size_new_custom = FuncLoader.LoadFunction<d_gtk_paper_size_new_custom>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_paper_size_new_custom"));

		public PaperSize (string name, string display_name, double width, double height, Gtk.Unit unit) 
		{
			IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
			IntPtr native_display_name = GLib.Marshaller.StringToPtrGStrdup (display_name);
			Raw = gtk_paper_size_new_custom(native_name, native_display_name, width, height, (int) unit);
			GLib.Marshaller.Free (native_name);
			GLib.Marshaller.Free (native_display_name);
		}

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

		public PaperSize (GLib.Variant variant) 
		{
			Raw = gtk_paper_size_new_from_gvariant(variant == null ? IntPtr.Zero : variant.Handle);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_paper_size_new_from_ipp(IntPtr ipp_name, double width, double height);
		static d_gtk_paper_size_new_from_ipp gtk_paper_size_new_from_ipp = FuncLoader.LoadFunction<d_gtk_paper_size_new_from_ipp>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_paper_size_new_from_ipp"));

		public PaperSize (string ipp_name, double width, double height) 
		{
			IntPtr native_ipp_name = GLib.Marshaller.StringToPtrGStrdup (ipp_name);
			Raw = gtk_paper_size_new_from_ipp(native_ipp_name, width, height);
			GLib.Marshaller.Free (native_ipp_name);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_paper_size_new_from_key_file(IntPtr key_file, IntPtr group_name, out IntPtr error);
		static d_gtk_paper_size_new_from_key_file gtk_paper_size_new_from_key_file = FuncLoader.LoadFunction<d_gtk_paper_size_new_from_key_file>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_paper_size_new_from_key_file"));

		public unsafe PaperSize (GLib.KeyFile key_file, string group_name) 
		{
			IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
			IntPtr error = IntPtr.Zero;
			Raw = gtk_paper_size_new_from_key_file(key_file == null ? IntPtr.Zero : key_file.Handle, native_group_name, out error);
			GLib.Marshaller.Free (native_group_name);
			if (error != IntPtr.Zero) throw new GLib.GException (error);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_paper_size_new_from_ppd(IntPtr ppd_name, IntPtr ppd_display_name, double width, double height);
		static d_gtk_paper_size_new_from_ppd gtk_paper_size_new_from_ppd = FuncLoader.LoadFunction<d_gtk_paper_size_new_from_ppd>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_paper_size_new_from_ppd"));

		public PaperSize (string ppd_name, string ppd_display_name, double width, double height) 
		{
			IntPtr native_ppd_name = GLib.Marshaller.StringToPtrGStrdup (ppd_name);
			IntPtr native_ppd_display_name = GLib.Marshaller.StringToPtrGStrdup (ppd_display_name);
			Raw = gtk_paper_size_new_from_ppd(native_ppd_name, native_ppd_display_name, width, height);
			GLib.Marshaller.Free (native_ppd_name);
			GLib.Marshaller.Free (native_ppd_display_name);
		}

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

		protected override void Free (IntPtr raw)
		{
			gtk_paper_size_free (raw);
		}

		class FinalizerInfo {
			IntPtr handle;
			public uint timeoutHandlerId;

			public FinalizerInfo (IntPtr handle)
			{
				this.handle = handle;
			}

			public bool Handler ()
			{
				gtk_paper_size_free (handle);
				GLib.Timeout.Remove(timeoutHandlerId);
				return false;
			}
		}

		~PaperSize ()
		{
			if (!Owned)
				return;
			FinalizerInfo info = new FinalizerInfo (Handle);
			info.timeoutHandlerId = GLib.Timeout.Add (50, new GLib.TimeoutHandler (info.Handler));
		}


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _abi_info = null;
		static public unsafe GLib.AbiStruct abi_info {
			get {
				if (_abi_info == null)
					_abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{ 
					});

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}
