// 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 TreePath : GLib.Opaque {

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

		public void AppendIndex(int index_) {
			gtk_tree_path_append_index(Handle, index_);
		}

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

		public int Compare(Gtk.TreePath b) {
			int raw_ret = gtk_tree_path_compare(Handle, b == null ? IntPtr.Zero : b.Handle);
			int ret = raw_ret;
			return ret;
		}

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

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

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

		public void Down() {
			gtk_tree_path_down(Handle);
		}

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

		public int Depth { 
			get {
				int raw_ret = gtk_tree_path_get_depth(Handle);
				int ret = raw_ret;
				return ret;
			}
		}

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

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

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

		public bool IsAncestor(Gtk.TreePath descendant) {
			bool raw_ret = gtk_tree_path_is_ancestor(Handle, descendant == null ? IntPtr.Zero : descendant.Handle);
			bool ret = raw_ret;
			return ret;
		}

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

		public bool IsDescendant(Gtk.TreePath ancestor) {
			bool raw_ret = gtk_tree_path_is_descendant(Handle, ancestor == null ? IntPtr.Zero : ancestor.Handle);
			bool ret = raw_ret;
			return ret;
		}

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

		public void Next() {
			gtk_tree_path_next(Handle);
		}

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

		public void PrependIndex(int index_) {
			gtk_tree_path_prepend_index(Handle, index_);
		}

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

		public bool Prev() {
			bool raw_ret = gtk_tree_path_prev(Handle);
			bool ret = raw_ret;
			return ret;
		}

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

		public override string ToString() {
			IntPtr raw_ret = gtk_tree_path_to_string(Handle);
			string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
			return ret;
		}

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

		public bool Up() {
			bool raw_ret = gtk_tree_path_up(Handle);
			bool ret = raw_ret;
			return ret;
		}

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

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

		public TreePath () 
		{
			Raw = gtk_tree_path_new();
		}

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

		public static TreePath NewFirst()
		{
			TreePath result = new TreePath (gtk_tree_path_new_first());
			return result;
		}

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

		public TreePath (string path) 
		{
			IntPtr native_path = GLib.Marshaller.StringToPtrGStrdup (path);
			Raw = gtk_tree_path_new_from_string(native_path);
			GLib.Marshaller.Free (native_path);
		}

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

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

		[Obsolete("Gtk.TreePath is now freed automatically")]
		public void Free () {}

		class FinalizerInfo {
			IntPtr handle;
			public uint timeoutHandlerId;

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

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

		~TreePath ()
		{
			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
	}
}
