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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_target_list_add(IntPtr raw, IntPtr target, uint flags, uint info);
		static d_gtk_target_list_add gtk_target_list_add = FuncLoader.LoadFunction<d_gtk_target_list_add>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_target_list_add"));

		public void Add(Gdk.Atom target, uint flags, uint info) {
			gtk_target_list_add(Handle, target == null ? IntPtr.Zero : target.Handle, flags, info);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_target_list_add_image_targets(IntPtr raw, uint info, bool writable);
		static d_gtk_target_list_add_image_targets gtk_target_list_add_image_targets = FuncLoader.LoadFunction<d_gtk_target_list_add_image_targets>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_target_list_add_image_targets"));

		public void AddImageTargets(uint info, bool writable) {
			gtk_target_list_add_image_targets(Handle, info, writable);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_target_list_add_rich_text_targets(IntPtr raw, uint info, bool deserializable, IntPtr buffer);
		static d_gtk_target_list_add_rich_text_targets gtk_target_list_add_rich_text_targets = FuncLoader.LoadFunction<d_gtk_target_list_add_rich_text_targets>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_target_list_add_rich_text_targets"));

		public void AddRichTextTargets(uint info, bool deserializable, Gtk.TextBuffer buffer) {
			gtk_target_list_add_rich_text_targets(Handle, info, deserializable, buffer == null ? IntPtr.Zero : buffer.Handle);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_target_list_add_table(IntPtr raw, Gtk.TargetEntry[] targets, uint n_targets);
		static d_gtk_target_list_add_table gtk_target_list_add_table = FuncLoader.LoadFunction<d_gtk_target_list_add_table>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_target_list_add_table"));

		public void AddTable(Gtk.TargetEntry[] targets) {
			gtk_target_list_add_table(Handle, targets, (uint) (targets == null ? 0 : targets.Length));
		}

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

		public void AddTextTargets(uint info) {
			gtk_target_list_add_text_targets(Handle, info);
		}

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

		public void AddUriTargets(uint info) {
			gtk_target_list_add_uri_targets(Handle, info);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_gtk_target_list_find(IntPtr raw, IntPtr target, out uint info);
		static d_gtk_target_list_find gtk_target_list_find = FuncLoader.LoadFunction<d_gtk_target_list_find>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_target_list_find"));

		public bool Find(Gdk.Atom target, out uint info) {
			bool raw_ret = gtk_target_list_find(Handle, target == null ? IntPtr.Zero : target.Handle, out info);
			bool ret = raw_ret;
			return ret;
		}

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

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

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

		public void Remove(Gdk.Atom target) {
			gtk_target_list_remove(Handle, target == null ? IntPtr.Zero : target.Handle);
		}

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

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

		protected override void Ref (IntPtr raw)
		{
			if (!Owned) {
				gtk_target_list_ref (raw);
				Owned = true;
			}
		}

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

		protected override void Unref (IntPtr raw)
		{
			if (Owned) {
				gtk_target_list_unref (raw);
				Owned = false;
			}
		}

		class FinalizerInfo {
			IntPtr handle;
			public uint timeoutHandlerId;

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

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

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