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

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

		[Obsolete]
		public void AddSource(Gtk.IconSource source) {
			gtk_icon_set_add_source(Handle, source == null ? IntPtr.Zero : source.Handle);
		}

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

		[Obsolete]
		public Gtk.IconSet Copy() {
			IntPtr raw_ret = gtk_icon_set_copy(Handle);
			Gtk.IconSet ret = raw_ret == IntPtr.Zero ? null : (Gtk.IconSet) GLib.Opaque.GetOpaque (raw_ret, typeof (Gtk.IconSet), true);
			return ret;
		}

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

		[Obsolete]
		public static GLib.GType GType { 
			get {
				IntPtr raw_ret = gtk_icon_set_get_type();
				GLib.GType ret = new GLib.GType(raw_ret);
				return ret;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_icon_set_render_icon(IntPtr raw, IntPtr style, int direction, int state, int size, IntPtr widget, IntPtr detail);
		static d_gtk_icon_set_render_icon gtk_icon_set_render_icon = FuncLoader.LoadFunction<d_gtk_icon_set_render_icon>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_icon_set_render_icon"));

		[Obsolete]
		public Gdk.Pixbuf RenderIcon(Gtk.Style style, Gtk.TextDirection direction, Gtk.StateType state, Gtk.IconSize size, Gtk.Widget widget, string detail) {
			IntPtr native_detail = GLib.Marshaller.StringToPtrGStrdup (detail);
			IntPtr raw_ret = gtk_icon_set_render_icon(Handle, style == null ? IntPtr.Zero : style.Handle, (int) direction, (int) state, (int) size, widget == null ? IntPtr.Zero : widget.Handle, native_detail);
			Gdk.Pixbuf ret = GLib.Object.GetObject(raw_ret) as Gdk.Pixbuf;
			GLib.Marshaller.Free (native_detail);
			return ret;
		}

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

		[Obsolete]
		public Gdk.Pixbuf RenderIconPixbuf(Gtk.StyleContext context, Gtk.IconSize size) {
			IntPtr raw_ret = gtk_icon_set_render_icon_pixbuf(Handle, context == null ? IntPtr.Zero : context.Handle, (int) size);
			Gdk.Pixbuf ret = GLib.Object.GetObject(raw_ret) as Gdk.Pixbuf;
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_icon_set_render_icon_surface(IntPtr raw, IntPtr context, int size, int scale, IntPtr for_window);
		static d_gtk_icon_set_render_icon_surface gtk_icon_set_render_icon_surface = FuncLoader.LoadFunction<d_gtk_icon_set_render_icon_surface>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_icon_set_render_icon_surface"));

		[Obsolete]
		public Cairo.Surface RenderIconSurface(Gtk.StyleContext context, Gtk.IconSize size, int scale, Gdk.Window for_window) {
			IntPtr raw_ret = gtk_icon_set_render_icon_surface(Handle, context == null ? IntPtr.Zero : context.Handle, (int) size, scale, for_window == null ? IntPtr.Zero : for_window.Handle);
			Cairo.Surface ret = Cairo.Surface.Lookup (raw_ret, true);
			return ret;
		}

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

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

		[Obsolete]
		public IconSet () 
		{
			Raw = gtk_icon_set_new();
		}

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

		[Obsolete]
		public IconSet (Gdk.Pixbuf pixbuf) 
		{
			Raw = gtk_icon_set_new_from_pixbuf(pixbuf == null ? IntPtr.Zero : pixbuf.Handle);
		}

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

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

		[Obsolete("Gtk.IconSet is now refcounted automatically")]
		public IconSet Ref () { return this; }

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

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

		[Obsolete("Gtk.IconSet is now refcounted automatically")]
		public void Unref () {}

		class FinalizerInfo {
			IntPtr handle;
			public uint timeoutHandlerId;

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

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

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