context: // 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;
  
  #region Autogenerated code
  	public partial class Renderer : GLib.Object {
  
  		public Renderer (IntPtr raw) : base(raw) {}
  
  		protected Renderer() : base(IntPtr.Zero)
  		{
  			CreateNativeObject (new string [0], new GLib.Value [0]);
  		}
  
  		[DllImport("libpango-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr pango_renderer_get_matrix(IntPtr raw);
  
  		[DllImport("libpango-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern void pango_renderer_set_matrix(IntPtr raw, IntPtr value);
  
  		public Pango.Matrix Matrix {
  			get  {
  				IntPtr raw_ret = pango_renderer_get_matrix(Handle);
  				Pango.Matrix ret = Pango.Matrix.New (raw_ret);
  				return ret;
  			}
  			set  {
  				IntPtr native_value = GLib.Marshaller.StructureToPtrAlloc (value);
  				pango_renderer_set_matrix(Handle, native_value);
  				value = Pango.Matrix.New (native_value);
  				Marshal.FreeHGlobal (native_value);
  			}
  		}
  
  		static DrawGlyphsNativeDelegate DrawGlyphs_cb_delegate;
  		static DrawGlyphsNativeDelegate DrawGlyphsVMCallback {
  			get {
  				if (DrawGlyphs_cb_delegate == null)
  					DrawGlyphs_cb_delegate = new DrawGlyphsNativeDelegate (DrawGlyphs_cb);
  				return DrawGlyphs_cb_delegate;
  			}
  		}
  
  		static void OverrideDrawGlyphs (GLib.GType gtype)
  		{
  			OverrideDrawGlyphs (gtype, DrawGlyphsVMCallback);
  		}
  
  		static void OverrideDrawGlyphs (GLib.GType gtype, DrawGlyphsNativeDelegate callback)
  		{
  			PangoRendererClass class_iface = GetClassStruct (gtype, false);
  			class_iface.DrawGlyphs = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void DrawGlyphsNativeDelegate (IntPtr inst, IntPtr font, IntPtr glyphs, int x, int y);
  
  		static void DrawGlyphs_cb (IntPtr inst, IntPtr font, IntPtr glyphs, int x, int y)
  		{
  			try {
  				Renderer __obj = GLib.Object.GetObject (inst, false) as Renderer;
  				__obj.OnDrawGlyphs (GLib.Object.GetObject(font) as Pango.Font, glyphs == IntPtr.Zero ? null : (Pango.GlyphString) GLib.Opaque.GetOpaque (glyphs, typeof (Pango.GlyphString), false), x, y);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Pango.Renderer), ConnectionMethod="OverrideDrawGlyphs")]
  		protected virtual void OnDrawGlyphs (Pango.Font font, Pango.GlyphString glyphs, int x, int y)
  		{
  			InternalDrawGlyphs (font, glyphs, x, y);
  		}
  
  		private void InternalDrawGlyphs (Pango.Font font, Pango.GlyphString glyphs, int x, int y)
  		{
  			DrawGlyphsNativeDelegate unmanaged = GetClassStruct (this.LookupGType ().GetThresholdType (), true).DrawGlyphs;
  			if (unmanaged == null) return;
  
  			unmanaged (this.Handle, font == null ? IntPtr.Zero : font.Handle, glyphs == null ? IntPtr.Zero : glyphs.Handle, x, y);
  		}
  
  		static DrawRectangleNativeDelegate DrawRectangle_cb_delegate;
  		static DrawRectangleNativeDelegate DrawRectangleVMCallback {
  			get {
  				if (DrawRectangle_cb_delegate == null)
  					DrawRectangle_cb_delegate = new DrawRectangleNativeDelegate (DrawRectangle_cb);
  				return DrawRectangle_cb_delegate;
  			}
  		}
  
  		static void OverrideDrawRectangle (GLib.GType gtype)
  		{
  			OverrideDrawRectangle (gtype, DrawRectangleVMCallback);
  		}
  
  		static void OverrideDrawRectangle (GLib.GType gtype, DrawRectangleNativeDelegate callback)
  		{
  			PangoRendererClass class_iface = GetClassStruct (gtype, false);
  			class_iface.DrawRectangle = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void DrawRectangleNativeDelegate (IntPtr inst, int part, int x, int y, int width, int height);
  
  		static void DrawRectangle_cb (IntPtr inst, int part, int x, int y, int width, int height)
  		{
  			try {
  				Renderer __obj = GLib.Object.GetObject (inst, false) as Renderer;
  				__obj.OnDrawRectangle ((Pango.RenderPart) part, x, y, width, height);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Pango.Renderer), ConnectionMethod="OverrideDrawRectangle")]
  		protected virtual void OnDrawRectangle (Pango.RenderPart part, int x, int y, int width, int height)
  		{
  			InternalDrawRectangle (part, x, y, width, height);
  		}
  
  		private void InternalDrawRectangle (Pango.RenderPart part, int x, int y, int width, int height)
  		{
  			DrawRectangleNativeDelegate unmanaged = GetClassStruct (this.LookupGType ().GetThresholdType (), true).DrawRectangle;
  			if (unmanaged == null) return;
  
  			unmanaged (this.Handle, (int) part, x, y, width, height);
  		}
  
  		static DrawErrorUnderlineNativeDelegate DrawErrorUnderline_cb_delegate;
  		static DrawErrorUnderlineNativeDelegate DrawErrorUnderlineVMCallback {
  			get {
  				if (DrawErrorUnderline_cb_delegate == null)
  					DrawErrorUnderline_cb_delegate = new DrawErrorUnderlineNativeDelegate (DrawErrorUnderline_cb);
  				return DrawErrorUnderline_cb_delegate;
  			}
  		}
  
  		static void OverrideDrawErrorUnderline (GLib.GType gtype)
  		{
  			OverrideDrawErrorUnderline (gtype, DrawErrorUnderlineVMCallback);
  		}
  
  		static void OverrideDrawErrorUnderline (GLib.GType gtype, DrawErrorUnderlineNativeDelegate callback)
  		{
  			PangoRendererClass class_iface = GetClassStruct (gtype, false);
  			class_iface.DrawErrorUnderline = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void DrawErrorUnderlineNativeDelegate (IntPtr inst, int x, int y, int width, int height);
  
  		static void DrawErrorUnderline_cb (IntPtr inst, int x, int y, int width, int height)
  		{
  			try {
  				Renderer __obj = GLib.Object.GetObject (inst, false) as Renderer;
  				__obj.OnDrawErrorUnderline (x, y, width, height);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Pango.Renderer), ConnectionMethod="OverrideDrawErrorUnderline")]
  		protected virtual void OnDrawErrorUnderline (int x, int y, int width, int height)
  		{
  			InternalDrawErrorUnderline (x, y, width, height);
  		}
  
  		private void InternalDrawErrorUnderline (int x, int y, int width, int height)
  		{
  			DrawErrorUnderlineNativeDelegate unmanaged = GetClassStruct (this.LookupGType ().GetThresholdType (), true).DrawErrorUnderline;
  			if (unmanaged == null) return;
  
  			unmanaged (this.Handle, x, y, width, height);
  		}
  
  		static DrawShapeNativeDelegate DrawShape_cb_delegate;
  		static DrawShapeNativeDelegate DrawShapeVMCallback {
  			get {
  				if (DrawShape_cb_delegate == null)
  					DrawShape_cb_delegate = new DrawShapeNativeDelegate (DrawShape_cb);
  				return DrawShape_cb_delegate;
  			}
  		}
  
  		static void OverrideDrawShape (GLib.GType gtype)
  		{
  			OverrideDrawShape (gtype, DrawShapeVMCallback);
  		}
  
  		static void OverrideDrawShape (GLib.GType gtype, DrawShapeNativeDelegate callback)
  		{
  			PangoRendererClass class_iface = GetClassStruct (gtype, false);
  			class_iface.DrawShape = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void DrawShapeNativeDelegate (IntPtr inst, IntPtr attr, int x, int y);
  
  		static void DrawShape_cb (IntPtr inst, IntPtr attr, int x, int y)
  		{
  			try {
  				Renderer __obj = GLib.Object.GetObject (inst, false) as Renderer;
  				__obj.OnDrawShape (Pango.Attribute.GetAttribute (attr), x, y);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Pango.Renderer), ConnectionMethod="OverrideDrawShape")]
  		protected virtual void OnDrawShape (Pango.Attribute attr, int x, int y)
  		{
  			InternalDrawShape (attr, x, y);
  		}
  
  		private void InternalDrawShape (Pango.Attribute attr, int x, int y)
  		{
  			DrawShapeNativeDelegate unmanaged = GetClassStruct (this.LookupGType ().GetThresholdType (), true).DrawShape;
  			if (unmanaged == null) return;
  
  			unmanaged (this.Handle, attr.Handle, x, y);
  		}
  
  		static DrawTrapezoidNativeDelegate DrawTrapezoid_cb_delegate;
  		static DrawTrapezoidNativeDelegate DrawTrapezoidVMCallback {
  			get {
  				if (DrawTrapezoid_cb_delegate == null)
  					DrawTrapezoid_cb_delegate = new DrawTrapezoidNativeDelegate (DrawTrapezoid_cb);
  				return DrawTrapezoid_cb_delegate;
  			}
  		}
  
  		static void OverrideDrawTrapezoid (GLib.GType gtype)
  		{
  			OverrideDrawTrapezoid (gtype, DrawTrapezoidVMCallback);
  		}
  
  		static void OverrideDrawTrapezoid (GLib.GType gtype, DrawTrapezoidNativeDelegate callback)
  		{
  			PangoRendererClass class_iface = GetClassStruct (gtype, false);
  			class_iface.DrawTrapezoid = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void DrawTrapezoidNativeDelegate (IntPtr inst, int part, double y1_, double x11, double x21, double y2, double x12, double x22);
  
  		static void DrawTrapezoid_cb (IntPtr inst, int part, double y1_, double x11, double x21, double y2, double x12, double x22)
  		{
  			try {
  				Renderer __obj = GLib.Object.GetObject (inst, false) as Renderer;
  				__obj.OnDrawTrapezoid ((Pango.RenderPart) part, y1_, x11, x21, y2, x12, x22);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Pango.Renderer), ConnectionMethod="OverrideDrawTrapezoid")]
  		protected virtual void OnDrawTrapezoid (Pango.RenderPart part, double y1_, double x11, double x21, double y2, double x12, double x22)
  		{
  			InternalDrawTrapezoid (part, y1_, x11, x21, y2, x12, x22);
  		}
  
  		private void InternalDrawTrapezoid (Pango.RenderPart part, double y1_, double x11, double x21, double y2, double x12, double x22)
  		{
  			DrawTrapezoidNativeDelegate unmanaged = GetClassStruct (this.LookupGType ().GetThresholdType (), true).DrawTrapezoid;
  			if (unmanaged == null) return;
  
  			unmanaged (this.Handle, (int) part, y1_, x11, x21, y2, x12, x22);
  		}
  
  		static DrawGlyphNativeDelegate DrawGlyph_cb_delegate;
  		static DrawGlyphNativeDelegate DrawGlyphVMCallback {
  			get {
  				if (DrawGlyph_cb_delegate == null)
  					DrawGlyph_cb_delegate = new DrawGlyphNativeDelegate (DrawGlyph_cb);
  				return DrawGlyph_cb_delegate;
  			}
  		}
  
  		static void OverrideDrawGlyph (GLib.GType gtype)
  		{
  			OverrideDrawGlyph (gtype, DrawGlyphVMCallback);
  		}
  
  		static void OverrideDrawGlyph (GLib.GType gtype, DrawGlyphNativeDelegate callback)
  		{
  			PangoRendererClass class_iface = GetClassStruct (gtype, false);
  			class_iface.DrawGlyph = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void DrawGlyphNativeDelegate (IntPtr inst, IntPtr font, uint glyph, double x, double y);
  
  		static void DrawGlyph_cb (IntPtr inst, IntPtr font, uint glyph, double x, double y)
  		{
  			try {
  				Renderer __obj = GLib.Object.GetObject (inst, false) as Renderer;
  				__obj.OnDrawGlyph (GLib.Object.GetObject(font) as Pango.Font, glyph, x, y);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Pango.Renderer), ConnectionMethod="OverrideDrawGlyph")]
  		protected virtual void OnDrawGlyph (Pango.Font font, uint glyph, double x, double y)
  		{
  			InternalDrawGlyph (font, glyph, x, y);
  		}
  
  		private void InternalDrawGlyph (Pango.Font font, uint glyph, double x, double y)
  		{
  			DrawGlyphNativeDelegate unmanaged = GetClassStruct (this.LookupGType ().GetThresholdType (), true).DrawGlyph;
  			if (unmanaged == null) return;
  
  			unmanaged (this.Handle, font == null ? IntPtr.Zero : font.Handle, glyph, x, y);
  		}
  
  		static PartChangedNativeDelegate PartChanged_cb_delegate;
  		static PartChangedNativeDelegate PartChangedVMCallback {
  			get {
  				if (PartChanged_cb_delegate == null)
  					PartChanged_cb_delegate = new PartChangedNativeDelegate (PartChanged_cb);
  				return PartChanged_cb_delegate;
  			}
  		}
  
  		static void OverridePartChanged (GLib.GType gtype)
  		{
  			OverridePartChanged (gtype, PartChangedVMCallback);
  		}
  
  		static void OverridePartChanged (GLib.GType gtype, PartChangedNativeDelegate callback)
  		{
  			PangoRendererClass class_iface = GetClassStruct (gtype, false);
  			class_iface.PartChanged = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void PartChangedNativeDelegate (IntPtr inst, int part);
  
  		static void PartChanged_cb (IntPtr inst, int part)
  		{
  			try {
  				Renderer __obj = GLib.Object.GetObject (inst, false) as Renderer;
  
gt: 				__obj.OnPartChanged ((Pango.RenderPart) part);