// 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
	[StructLayout(LayoutKind.Sequential)]
	public partial struct StockItem : IEquatable<StockItem> {

		public string StockId;
		public string Label;
		public Gdk.ModifierType Modifier;
		public uint Keyval;
		public string TranslationDomain;

		public static Gtk.StockItem Zero = new Gtk.StockItem ();

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

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

		[Obsolete]
		public Gtk.StockItem Copy() {
			IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf<Gtk.StockItem>());
			System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
			IntPtr raw_ret = gtk_stock_item_copy(this_as_native);
			Gtk.StockItem ret = Gtk.StockItem.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_gtk_stock_item_free(IntPtr raw);
		static d_gtk_stock_item_free gtk_stock_item_free = FuncLoader.LoadFunction<d_gtk_stock_item_free>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_stock_item_free"));

		[Obsolete]
		public void Free() {
			IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf<Gtk.StockItem>());
			System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
			gtk_stock_item_free(this_as_native);
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
		}

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

		public bool Equals (StockItem other)
		{
			return true && StockId.Equals (other.StockId) && Label.Equals (other.Label) && Modifier.Equals (other.Modifier) && Keyval.Equals (other.Keyval) && TranslationDomain.Equals (other.TranslationDomain);
		}

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

		public override int GetHashCode ()
		{
			return this.GetType ().FullName.GetHashCode () ^ StockId.GetHashCode () ^ Label.GetHashCode () ^ Modifier.GetHashCode () ^ Keyval.GetHashCode () ^ TranslationDomain.GetHashCode ();
		}

		private static GLib.GType GType {
			get { return GLib.GType.Pointer; }
		}
#endregion
	}
}
