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

namespace GLib {

	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Runtime.InteropServices;
	using static GLib.AbiStructExtension;

#region Autogenerated code
	public partial class Emblem : GLib.Object, GLib.IIcon {

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_g_emblem_new(IntPtr icon);
		static d_g_emblem_new g_emblem_new = FuncLoader.LoadFunction<d_g_emblem_new>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_emblem_new"));

		public Emblem (GLib.IIcon icon) : base (IntPtr.Zero)
		{
			if (GetType () != typeof (Emblem)) {
				var vals = new List<GLib.Value> ();
				var names = new List<string> ();
				if (icon != null) {
					names.Add ("icon");
					vals.Add (new GLib.Value (icon));
				}
				CreateNativeObject (names.ToArray (), vals.ToArray ());
				return;
			}
			Raw = g_emblem_new(icon == null ? IntPtr.Zero : ((icon is GLib.Object) ? (icon as GLib.Object).Handle : (icon as GLib.IconAdapter).Handle));
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_g_emblem_new_with_origin(IntPtr icon, int origin);
		static d_g_emblem_new_with_origin g_emblem_new_with_origin = FuncLoader.LoadFunction<d_g_emblem_new_with_origin>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_emblem_new_with_origin"));

		public Emblem (GLib.IIcon icon, GLib.EmblemOrigin origin) : base (IntPtr.Zero)
		{
			if (GetType () != typeof (Emblem)) {
				var vals = new List<GLib.Value> ();
				var names = new List<string> ();
				if (icon != null) {
					names.Add ("icon");
					vals.Add (new GLib.Value (icon));
				}
				names.Add ("origin");
				vals.Add (new GLib.Value (origin));
				CreateNativeObject (names.ToArray (), vals.ToArray ());
				return;
			}
			Raw = g_emblem_new_with_origin(icon == null ? IntPtr.Zero : ((icon is GLib.Object) ? (icon as GLib.Object).Handle : (icon as GLib.IconAdapter).Handle), (int) origin);
		}

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

		[GLib.Property ("origin")]
		public GLib.EmblemOrigin Origin {
			get  {
				int raw_ret = g_emblem_get_origin(Handle);
				GLib.EmblemOrigin ret = (GLib.EmblemOrigin) raw_ret;
				return ret;
			}
		}

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

		[GLib.Property ("icon")]
		public GLib.IIcon Icon {
			get  {
				IntPtr raw_ret = g_emblem_get_icon(Handle);
				GLib.IIcon ret = GLib.IconAdapter.GetObject (raw_ret, false);
				return ret;
			}
		}


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _class_abi = null;
		static public unsafe new GLib.AbiStruct class_abi {
			get {
				if (_class_abi == null)
					_class_abi = new GLib.AbiStruct (GLib.Object.class_abi.Fields);

				return _class_abi;
			}
		}


		// End of the ABI representation.

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_g_emblem_get_type();
		static d_g_emblem_get_type g_emblem_get_type = FuncLoader.LoadFunction<d_g_emblem_get_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_emblem_get_type"));

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_g_icon_equal(IntPtr raw, IntPtr icon2);
		static d_g_icon_equal g_icon_equal = FuncLoader.LoadFunction<d_g_icon_equal>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_icon_equal"));

		public bool Equal(GLib.IIcon icon2) {
			bool raw_ret = g_icon_equal(Handle, icon2 == null ? IntPtr.Zero : ((icon2 is GLib.Object) ? (icon2 as GLib.Object).Handle : (icon2 as GLib.IconAdapter).Handle));
			bool ret = raw_ret;
			return ret;
		}

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

		public GLib.Variant Serialize() {
			IntPtr raw_ret = g_icon_serialize(Handle);
			GLib.Variant ret = new GLib.Variant(raw_ret);
			return ret;
		}

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

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


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _abi_info = null;
		static public unsafe new GLib.AbiStruct abi_info {
			get {
				if (_abi_info == null)
					_abi_info = new GLib.AbiStruct (GLib.Object.abi_info.Fields);

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}
