// 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;
	using static GLib.AbiStructExtension;

#region Autogenerated code
	public partial class Font : GLib.Object {

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

		protected Font() : base(IntPtr.Zero)
		{
			CreateNativeObject (Array.Empty<string> (), Array.Empty<GLib.Value> ());
		}

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

		public Pango.FontDescription Describe() {
			IntPtr raw_ret = pango_font_describe(Handle);
			Pango.FontDescription ret = raw_ret == IntPtr.Zero ? null : (Pango.FontDescription) GLib.Opaque.GetOpaque (raw_ret, typeof (Pango.FontDescription), true);
			return ret;
		}

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

		public Pango.FontDescription DescribeWithAbsoluteSize() {
			IntPtr raw_ret = pango_font_describe_with_absolute_size(Handle);
			Pango.FontDescription ret = raw_ret == IntPtr.Zero ? null : (Pango.FontDescription) GLib.Opaque.GetOpaque (raw_ret, typeof (Pango.FontDescription), false);
			return ret;
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_pango_font_find_shaper(IntPtr raw, IntPtr language, uint ch);
		static d_pango_font_find_shaper pango_font_find_shaper = FuncLoader.LoadFunction<d_pango_font_find_shaper>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Pango), "pango_font_find_shaper"));

		public Pango.EngineShape FindShaper(Pango.Language language, uint ch) {
			IntPtr raw_ret = pango_font_find_shaper(Handle, language == null ? IntPtr.Zero : language.Handle, ch);
			Pango.EngineShape ret = raw_ret == IntPtr.Zero ? null : (Pango.EngineShape) GLib.Opaque.GetOpaque (raw_ret, typeof (Pango.EngineShape), false);
			return ret;
		}

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

		public Pango.Coverage GetCoverage(Pango.Language language) {
			IntPtr raw_ret = pango_font_get_coverage(Handle, language == null ? IntPtr.Zero : language.Handle);
			Pango.Coverage ret = raw_ret == IntPtr.Zero ? null : (Pango.Coverage) GLib.Opaque.GetOpaque (raw_ret, typeof (Pango.Coverage), false);
			return ret;
		}

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

		public Pango.FontMap FontMap { 
			get {
				IntPtr raw_ret = pango_font_get_font_map(Handle);
				Pango.FontMap ret = GLib.Object.GetObject(raw_ret) as Pango.FontMap;
				return ret;
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_pango_font_get_glyph_extents(IntPtr raw, uint glyph, IntPtr ink_rect, IntPtr logical_rect);
		static d_pango_font_get_glyph_extents pango_font_get_glyph_extents = FuncLoader.LoadFunction<d_pango_font_get_glyph_extents>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Pango), "pango_font_get_glyph_extents"));

		public void GetGlyphExtents(uint glyph, Pango.Rectangle ink_rect, Pango.Rectangle logical_rect) {
			IntPtr native_ink_rect = GLib.Marshaller.StructureToPtrAlloc (ink_rect);
			IntPtr native_logical_rect = GLib.Marshaller.StructureToPtrAlloc (logical_rect);
			pango_font_get_glyph_extents(Handle, glyph, native_ink_rect, native_logical_rect);
			Marshal.FreeHGlobal (native_ink_rect);
			Marshal.FreeHGlobal (native_logical_rect);
		}

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

		public Pango.FontMetrics GetMetrics(Pango.Language language) {
			IntPtr raw_ret = pango_font_get_metrics(Handle, language == null ? IntPtr.Zero : language.Handle);
			Pango.FontMetrics ret = raw_ret == IntPtr.Zero ? null : (Pango.FontMetrics) GLib.Opaque.GetOpaque (raw_ret, typeof (Pango.FontMetrics), false);
			return ret;
		}

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

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

#endregion
	}
}
