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

namespace Pango {

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

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

		private IntPtr _glyph_item;

		public Pango.GlyphItem glyph_item {
			get { return Pango.GlyphItem.New (_glyph_item); }
		}
		public string Text;
		public int StartGlyph;
		public int StartIndex;
		public int StartChar;
		public int EndGlyph;
		public int EndIndex;
		public int EndChar;

		public static Pango.GlyphItemIter Zero = new Pango.GlyphItemIter ();

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_pango_glyph_item_iter_get_type();
		static d_pango_glyph_item_iter_get_type pango_glyph_item_iter_get_type = FuncLoader.LoadFunction<d_pango_glyph_item_iter_get_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Pango), "pango_glyph_item_iter_get_type"));

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_pango_glyph_item_iter_init_end(IntPtr raw, IntPtr glyph_item, IntPtr text);
		static d_pango_glyph_item_iter_init_end pango_glyph_item_iter_init_end = FuncLoader.LoadFunction<d_pango_glyph_item_iter_init_end>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Pango), "pango_glyph_item_iter_init_end"));

		public bool InitEnd(Pango.GlyphItem glyph_item, string text) {
			IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf<Pango.GlyphItemIter>());
			System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
			IntPtr native_glyph_item = GLib.Marshaller.StructureToPtrAlloc (glyph_item);
			IntPtr native_text = GLib.Marshaller.StringToPtrGStrdup (text);
			bool raw_ret = pango_glyph_item_iter_init_end(this_as_native, native_glyph_item, native_text);
			bool ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			Marshal.FreeHGlobal (native_glyph_item);
			GLib.Marshaller.Free (native_text);
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_pango_glyph_item_iter_init_start(IntPtr raw, IntPtr glyph_item, IntPtr text);
		static d_pango_glyph_item_iter_init_start pango_glyph_item_iter_init_start = FuncLoader.LoadFunction<d_pango_glyph_item_iter_init_start>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Pango), "pango_glyph_item_iter_init_start"));

		public bool InitStart(Pango.GlyphItem glyph_item, string text) {
			IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf<Pango.GlyphItemIter>());
			System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
			IntPtr native_glyph_item = GLib.Marshaller.StructureToPtrAlloc (glyph_item);
			IntPtr native_text = GLib.Marshaller.StringToPtrGStrdup (text);
			bool raw_ret = pango_glyph_item_iter_init_start(this_as_native, native_glyph_item, native_text);
			bool ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			Marshal.FreeHGlobal (native_glyph_item);
			GLib.Marshaller.Free (native_text);
			return ret;
		}

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

		public bool NextCluster() {
			IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf<Pango.GlyphItemIter>());
			System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
			bool raw_ret = pango_glyph_item_iter_next_cluster(this_as_native);
			bool ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

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

		public bool PrevCluster() {
			IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf<Pango.GlyphItemIter>());
			System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
			bool raw_ret = pango_glyph_item_iter_prev_cluster(this_as_native);
			bool ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

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

		public bool Equals (GlyphItemIter other)
		{
			return true && glyph_item.Equals (other.glyph_item) && Text.Equals (other.Text) && StartGlyph.Equals (other.StartGlyph) && StartIndex.Equals (other.StartIndex) && StartChar.Equals (other.StartChar) && EndGlyph.Equals (other.EndGlyph) && EndIndex.Equals (other.EndIndex) && EndChar.Equals (other.EndChar);
		}

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

		public override int GetHashCode ()
		{
			return this.GetType ().FullName.GetHashCode () ^ glyph_item.GetHashCode () ^ Text.GetHashCode () ^ StartGlyph.GetHashCode () ^ StartIndex.GetHashCode () ^ StartChar.GetHashCode () ^ EndGlyph.GetHashCode () ^ EndIndex.GetHashCode () ^ EndChar.GetHashCode ();
		}

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

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