context: // 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 Style : GLib.Object {
  
  		public Style (IntPtr raw) : base(raw) {}
  
  		[DllImport("libgtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern IntPtr gtk_style_new();
  
  		public Style () : base (IntPtr.Zero)
  		{
  			if (GetType () != typeof (Style)) {
  				CreateNativeObject (new string [0], new GLib.Value[0]);
  				return;
  			}
  			Raw = gtk_style_new();
  		}
  
  		[GLib.Property ("context")]
  		public Gtk.StyleContext Context {
  			get {
  				GLib.Value val = GetProperty ("context");
  				Gtk.StyleContext ret = (Gtk.StyleContext) val;
  				val.Dispose ();
  				return ret;
  			}
  		}
  
  		[DllImport ("gtksharpglue-3")]
  		extern static uint gtksharp_gtk_style_get_black_offset ();
  
  		static uint black_offset = gtksharp_gtk_style_get_black_offset ();
  		public Gdk.Color Black {
  			get {
  				unsafe {
  					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + black_offset);
  					return Gdk.Color.New ((*raw_ptr));
  				}
  			}
  		}
  
  		[DllImport ("gtksharpglue-3")]
  		extern static uint gtksharp_gtk_style_get_white_offset ();
  
  		static uint white_offset = gtksharp_gtk_style_get_white_offset ();
  		public Gdk.Color White {
  			get {
  				unsafe {
  					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + white_offset);
  					return Gdk.Color.New ((*raw_ptr));
  				}
  			}
  		}
  
  		[DllImport ("gtksharpglue-3")]
  		extern static uint gtksharp_gtk_style_get_font_desc_offset ();
  
  		static uint font_desc_offset = gtksharp_gtk_style_get_font_desc_offset ();
  		public Pango.FontDescription FontDesc {
  			get {
  				unsafe {
  					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + font_desc_offset);
  					return (*raw_ptr) == IntPtr.Zero ? null : (Pango.FontDescription) GLib.Opaque.GetOpaque ((*raw_ptr), typeof (Pango.FontDescription), false);
  				}
  			}
  		}
  
  		[DllImport ("gtksharpglue-3")]
  		extern static uint gtksharp_gtk_style_get_xthickness_offset ();
  
  		static uint xthickness_offset = gtksharp_gtk_style_get_xthickness_offset ();
  		public int Xthickness {
  			get {
  				unsafe {
  					int* raw_ptr = (int*)(((byte*)Handle) + xthickness_offset);
  					return (*raw_ptr);
  				}
  			}
  		}
  
  		[DllImport ("gtksharpglue-3")]
  		extern static uint gtksharp_gtk_style_get_ythickness_offset ();
  
  		static uint ythickness_offset = gtksharp_gtk_style_get_ythickness_offset ();
  		public int Ythickness {
  			get {
  				unsafe {
  					int* raw_ptr = (int*)(((byte*)Handle) + ythickness_offset);
  					return (*raw_ptr);
  				}
  			}
  		}
  
  		[GLib.Signal("unrealize")]
  		public event System.EventHandler Unrealize {
  			add {
  				this.AddSignalHandler ("unrealize", value);
  			}
  			remove {
  				this.RemoveSignalHandler ("unrealize", value);
  			}
  		}
  
  		[GLib.Signal("realize")]
  		public event System.EventHandler Realize {
  			add {
  				this.AddSignalHandler ("realize", value);
  			}
  			remove {
  				this.RemoveSignalHandler ("realize", value);
  			}
  		}
  
  		static RealizeNativeDelegate Realize_cb_delegate;
  		static RealizeNativeDelegate RealizeVMCallback {
  			get {
  				if (Realize_cb_delegate == null)
  					Realize_cb_delegate = new RealizeNativeDelegate (Realize_cb);
  				return Realize_cb_delegate;
  			}
  		}
  
  		static void OverrideRealize (GLib.GType gtype)
  		{
  			OverrideRealize (gtype, RealizeVMCallback);
  		}
  
  		static void OverrideRealize (GLib.GType gtype, RealizeNativeDelegate callback)
  		{
  			GtkStyleClass class_iface = GetClassStruct (gtype, false);
  			class_iface.Realize = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void RealizeNativeDelegate (IntPtr inst);
  
  		static void Realize_cb (IntPtr inst)
  		{
  			try {
  				Style __obj = GLib.Object.GetObject (inst, false) as Style;
  				__obj.OnRealize ();
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Gtk.Style), ConnectionMethod="OverrideRealize")]
  		protected virtual void OnRealize ()
  		{
  			InternalRealize ();
  		}
  
  		private void InternalRealize ()
  		{
  			RealizeNativeDelegate unmanaged = GetClassStruct (this.LookupGType ().GetThresholdType (), true).Realize;
  			if (unmanaged == null) return;
  
  			unmanaged (this.Handle);
  		}
  
  		static UnrealizeNativeDelegate Unrealize_cb_delegate;
  		static UnrealizeNativeDelegate UnrealizeVMCallback {
  			get {
  				if (Unrealize_cb_delegate == null)
  					Unrealize_cb_delegate = new UnrealizeNativeDelegate (Unrealize_cb);
  				return Unrealize_cb_delegate;
  			}
  		}
  
  		static void OverrideUnrealize (GLib.GType gtype)
  		{
  			OverrideUnrealize (gtype, UnrealizeVMCallback);
  		}
  
  		static void OverrideUnrealize (GLib.GType gtype, UnrealizeNativeDelegate callback)
  		{
  			GtkStyleClass class_iface = GetClassStruct (gtype, false);
  			class_iface.Unrealize = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void UnrealizeNativeDelegate (IntPtr inst);
  
  		static void Unrealize_cb (IntPtr inst)
  		{
  			try {
  				Style __obj = GLib.Object.GetObject (inst, false) as Style;
  				__obj.OnUnrealize ();
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Gtk.Style), ConnectionMethod="OverrideUnrealize")]
  		protected virtual void OnUnrealize ()
  		{
  			InternalUnrealize ();
  		}
  
  		private void InternalUnrealize ()
  		{
  			UnrealizeNativeDelegate unmanaged = GetClassStruct (this.LookupGType ().GetThresholdType (), true).Unrealize;
  			if (unmanaged == null) return;
  
  			unmanaged (this.Handle);
  		}
  
  		static CopyNativeDelegate Copy_cb_delegate;
  		static CopyNativeDelegate CopyVMCallback {
  			get {
  				if (Copy_cb_delegate == null)
  					Copy_cb_delegate = new CopyNativeDelegate (Copy_cb);
  				return Copy_cb_delegate;
  			}
  		}
  
  		static void OverrideCopy (GLib.GType gtype)
  		{
  			OverrideCopy (gtype, CopyVMCallback);
  		}
  
  		static void OverrideCopy (GLib.GType gtype, CopyNativeDelegate callback)
  		{
  			GtkStyleClass class_iface = GetClassStruct (gtype, false);
  			class_iface.Copy = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void CopyNativeDelegate (IntPtr inst, IntPtr src);
  
  		static void Copy_cb (IntPtr inst, IntPtr src)
  		{
  			try {
  				Style __obj = GLib.Object.GetObject (inst, false) as Style;
  				__obj.OnCopy (GLib.Object.GetObject(src) as Gtk.Style);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Gtk.Style), ConnectionMethod="OverrideCopy")]
  		protected virtual void OnCopy (Gtk.Style src)
  		{
  			InternalCopy (src);
  		}
  
  		private void InternalCopy (Gtk.Style src)
  		{
  			CopyNativeDelegate unmanaged = GetClassStruct (this.LookupGType ().GetThresholdType (), true).Copy;
  			if (unmanaged == null) return;
  
  			unmanaged (this.Handle, src == null ? IntPtr.Zero : src.Handle);
  		}
  
  		static CloneNativeDelegate Clone_cb_delegate;
  		static CloneNativeDelegate CloneVMCallback {
  			get {
  				if (Clone_cb_delegate == null)
  					Clone_cb_delegate = new CloneNativeDelegate (Clone_cb);
  				return Clone_cb_delegate;
  			}
  		}
  
  		static void OverrideClone (GLib.GType gtype)
  		{
  			OverrideClone (gtype, CloneVMCallback);
  		}
  
  		static void OverrideClone (GLib.GType gtype, CloneNativeDelegate callback)
  		{
  			GtkStyleClass class_iface = GetClassStruct (gtype, false);
  			class_iface.Clone = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate IntPtr CloneNativeDelegate (IntPtr inst);
  
  		static IntPtr Clone_cb (IntPtr inst)
  		{
  			try {
  				Style __obj = GLib.Object.GetObject (inst, false) as Style;
  				Gtk.Style __result;
  				__result = __obj.OnClone ();
  				return __result == null ? IntPtr.Zero : __result.Handle;
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, true);
  				// NOTREACHED: above call does not return.
  				throw e;
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Gtk.Style), ConnectionMethod="OverrideClone")]
  		protected virtual Gtk.Style OnClone ()
  		{
  			return InternalClone ();
  		}
  
  		private Gtk.Style InternalClone ()
  		{
  			CloneNativeDelegate unmanaged = GetClassStruct (this.LookupGType ().GetThresholdType (), true).Clone;
  			if (unmanaged == null) return null;
  
  			IntPtr __result = unmanaged (this.Handle);
  			return GLib.Object.GetObject(__result) as Gtk.Style;
  		}
  
  		static InitFromRcNativeDelegate InitFromRc_cb_delegate;
  		static InitFromRcNativeDelegate InitFromRcVMCallback {
  			get {
  				if (InitFromRc_cb_delegate == null)
  					InitFromRc_cb_delegate = new InitFromRcNativeDelegate (InitFromRc_cb);
  				return InitFromRc_cb_delegate;
  			}
  		}
  
  		static void OverrideInitFromRc (GLib.GType gtype)
  		{
  			OverrideInitFromRc (gtype, InitFromRcVMCallback);
  		}
  
  		static void OverrideInitFromRc (GLib.GType gtype, InitFromRcNativeDelegate callback)
  		{
  			GtkStyleClass class_iface = GetClassStruct (gtype, false);
  			class_iface.InitFromRc = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void InitFromRcNativeDelegate (IntPtr inst, IntPtr rc_style);
  
  		static void InitFromRc_cb (IntPtr inst, IntPtr rc_style)
  		{
  			try {
  				Style __obj = GLib.Object.GetObject (inst, false) as Style;
  				__obj.OnInitFromRc (GLib.Object.GetObject(rc_style) as Gtk.RcStyle);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Gtk.Style), ConnectionMethod="OverrideInitFromRc")]
  		protected virtual void OnInitFromRc (Gtk.RcStyle rc_style)
  		{
  			InternalInitFromRc (rc_style);
  		}
  
  		private void InternalInitFromRc (Gtk.RcStyle rc_style)
  		{
  			InitFromRcNativeDelegate unmanaged = GetClassStruct (this.LookupGType ().GetThresholdType (), true).InitFromRc;
  			if (unmanaged == null) return;
  
  			unmanaged (this.Handle, rc_style == null ? IntPtr.Zero : rc_style.Handle);
  		}
  
  		static SetBackgroundNativeDelegate SetBackground_cb_delegate;
  		static SetBackgroundNativeDelegate SetBackgroundVMCallback {
  			get {
  				if (SetBackground_cb_delegate == null)
  					SetBackground_cb_delegate = new SetBackgroundNativeDelegate (SetBackground_cb);
  				return SetBackground_cb_delegate;
  			}
  		}
  
  		static void OverrideSetBackground (GLib.GType gtype)
  		{
  			OverrideSetBackground (gtype, SetBackgroundVMCallback);
  		}
  
  		static void OverrideSetBackground (GLib.GType gtype, SetBackgroundNativeDelegate callback)
  		{
  			GtkStyleClass class_iface = GetClassStruct (gtype, false);
  			class_iface.SetBackground = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void SetBackgroundNativeDelegate (IntPtr inst, IntPtr window, int state_type);
  
  		static void SetBackground_cb (IntPtr inst, IntPtr window, int state_type)
  		{
  			try {
  				Style __obj = GLib.Object.GetObject (inst, false) as Style;
  				__obj.OnSetBackground (GLib.Object.GetObject(window) as Gdk.Window, (Gtk.StateType) state_type);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Gtk.Style), ConnectionMethod="OverrideSetBackground")]
  		protected virtual void OnSetBackground (Gdk.Window window, Gtk.StateType state_type)
  		{
  			InternalSetBackground (window, state_type);
  		}
  
  		private void InternalSetBackground (Gdk.Window window, Gtk.StateType state_type)
  		{
  			SetBackgroundNativeDelegate unmanaged = GetClassStruct (this.LookupGType ().GetThresholdType (), true).SetBackground;
  			if (unmanaged == null) return;
  
  			unmanaged (this.Handle, window == null ? IntPtr.Zero : window.Handle, (int) state_type);
  		}
  
  		static RenderIconNativeDelegate RenderIcon_cb_delegate;
  		static RenderIconNativeDelegate RenderIconVMCallback {
  			get {
  				if (RenderIcon_cb_delegate == null)
  					RenderIcon_cb_delegate = new RenderIconNativeDelegate (RenderIcon_cb);
  				return RenderIcon_cb_delegate;
  			}
  		}
  
  		static void OverrideRenderIcon (GLib.GType gtype)
  		{
  			OverrideRenderIcon (gtype, RenderIconVMCallback);
  		}
  
  		static void OverrideRenderIcon (GLib.GType gtype, RenderIconNativeDelegate callback)
  		{
  			GtkStyleClass class_iface = GetClassStruct (gtype, false);
  			class_iface.RenderIcon = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate IntPtr RenderIconNativeDelegate (IntPtr inst, IntPtr source, int direction, int state, int size, IntPtr widget, IntPtr detail);
  
  		static IntPtr RenderIcon_cb (IntPtr inst, IntPtr source, int direction, int state, int size, IntPtr widget, IntPtr detail)
  		{
  			try {
  				Style __obj = GLib.Object.GetObject (inst, false) as Style;
  				Gdk.Pixbuf __result;
  				__result = __obj.OnRenderIcon (source == IntPtr.Zero ? null : (Gtk.IconSource) GLib.Opaque.GetOpaque (source, typeof (Gtk.IconSource), false), (Gtk.TextDirection) direction, (Gtk.StateType) state, (Gtk.IconSize) size, GLib.Object.GetObject(widget) as Gtk.Widget, GLib.Marshaller.Utf8PtrToString (detail));
  				return __result == null ? IntPtr.Zero : __result.Handle;
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, true);
  				// NOTREACHED: above call does not return.
  				throw e;
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Gtk.Style), ConnectionMethod="OverrideRenderIcon")]
  		protected virtual Gdk.Pixbuf OnRenderIcon (Gtk.IconSource source, Gtk.TextDirection direction, Gtk.StateType state, Gtk.IconSize size, Gtk.Widget widget, string detail)
  		{
  			return InternalRenderIcon (source, direction, state, size, widget, detail);
  		}
  
  		private Gdk.Pixbuf InternalRenderIcon (Gtk.IconSource source, Gtk.TextDirection direction, Gtk.StateType state, Gtk.IconSize size, Gtk.Widget widget, string detail)
  		{
  			RenderIconNativeDelegate unmanaged = GetClassStruct (this.LookupGType ().GetThresholdType (), true).RenderIcon;
  			if (unmanaged == null) return null;
  
  			IntPtr native_detail = GLib.Marshaller.StringToPtrGStrdup (detail);
  			IntPtr __result = unmanaged (this.Handle, source == null ? IntPtr.Zero : source.Handle, (int) direction, (int) state, (int) size, widget == null ? IntPtr.Zero : widget.Handle, native_detail);
  			GLib.Marshaller.Free (native_detail);
  			return GLib.Object.GetObject(__result) as Gdk.Pixbuf;
  		}
  
  		static DrawHlineNativeDelegate DrawHline_cb_delegate;
  		static DrawHlineNativeDelegate DrawHlineVMCallback {
  			get {
  				if (DrawHline_cb_delegate == null)
  					DrawHline_cb_delegate = new DrawHlineNativeDelegate (DrawHline_cb);
  				return DrawHline_cb_delegate;
  			}
  		}
  
  		static void OverrideDrawHline (GLib.GType gtype)
  		{
  			OverrideDrawHline (gtype, DrawHlineVMCallback);
  		}
  
  		static void OverrideDrawHline (GLib.GType gtype, DrawHlineNativeDelegate callback)
  		{
  			GtkStyleClass class_iface = GetClassStruct (gtype, false);
  			class_iface.DrawHline = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void DrawHlineNativeDelegate (IntPtr inst, IntPtr cr, int state_type, IntPtr widget, IntPtr detail, int x1, int x2, int y);
  
  		static void DrawHline_cb (IntPtr inst, IntPtr cr, int state_type, IntPtr widget, IntPtr detail, int x1, int x2, int y)
  		{
  			Cairo.Context mycr = null;
  
  			try {
  				Style __obj = GLib.Object.GetObject (inst, false) as Style;
  				mycr = new Cairo.Context (cr, false);
  				__obj.OnDrawHline (mycr, (Gtk.StateType) state_type, GLib.Object.GetObject(widget) as Gtk.Widget, GLib.Marshaller.Utf8PtrToString (detail), x1, x2, y);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			} finally {
  				var disposable_cr = mycr as IDisposable;
  				if (disposable_cr != null)
  					disposable_cr.Dispose ();
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Gtk.Style), ConnectionMethod="OverrideDrawHline")]
  		protected virtual void OnDrawHline (Cairo.Context cr, Gtk.StateType state_type, Gtk.Widget widget, string detail, int x1, int x2, int y)
  		{
  			InternalDrawHline (cr, state_type, widget, detail, x1, x2, y);
  		}
  
  		private void InternalDrawHline (Cairo.Context cr, Gtk.StateType state_type, Gtk.Widget widget, string detail, int x1, int x2, int y)
  		{
  			DrawHlineNativeDelegate unmanaged = GetClassStruct (this.LookupGType ().GetThresholdType (), true).DrawHline;
  			if (unmanaged == null) return;
  
  			IntPtr native_detail = GLib.Marshaller.StringToPtrGStrdup (detail);
  			unmanaged (this.Handle, cr == null ? IntPtr.Zero : cr.Handle, (int) state_type, widget == null ? IntPtr.Zero : widget.Handle, native_detail, x1, x2, y);
  			GLib.Marshaller.Free (native_detail);
  		}
  
  		static DrawVlineNativeDelegate DrawVline_cb_delegate;
  		static DrawVlineNativeDelegate DrawVlineVMCallback {
  			get {
  				if (DrawVline_cb_delegate == null)
  					DrawVline_cb_delegate = new DrawVlineNativeDelegate (DrawVline_cb);
  				return DrawVline_cb_delegate;
  			}
  		}
  
  		static void OverrideDrawVline (GLib.GType gtype)
  		{
  			OverrideDrawVline (gtype, DrawVlineVMCallback);
  		}
  
  		static void OverrideDrawVline (GLib.GType gtype, DrawVlineNativeDelegate callback)
  		{
  			GtkStyleClass class_iface = GetClassStruct (gtype, false);
  			class_iface.DrawVline = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void DrawVlineNativeDelegate (IntPtr inst, IntPtr cr, int state_type, IntPtr widget, IntPtr detail, int y1_, int y2_, int x);
  
  		static void DrawVline_cb (IntPtr inst, IntPtr cr, int state_type, IntPtr widget, IntPtr detail, int y1_, int y2_, int x)
  		{
  			Cairo.Context mycr = null;
  
  			try {
  				Style __obj = GLib.Object.GetObject (inst, false) as Style;
  				mycr = new Cairo.Context (cr, false);
  				__obj.OnDrawVline (mycr, (Gtk.StateType) state_type, GLib.Object.GetObject(widget) as Gtk.Widget, GLib.Marshaller.Utf8PtrToString (detail), y1_, y2_, x);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			} finally {
  				var disposable_cr = mycr as IDisposable;
  				if (disposable_cr != null)
  					disposable_cr.Dispose ();
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Gtk.Style), ConnectionMethod="OverrideDrawVline")]
  		protected virtual void OnDrawVline (Cairo.Context cr, Gtk.StateType state_type, Gtk.Widget widget, string detail, int y1_, int y2_, int x)
  		{
  			InternalDrawVline (cr, state_type, widget, detail, y1_, y2_, x);
  		}
  
  		private void InternalDrawVline (Cairo.Context cr, Gtk.StateType state_type, Gtk.Widget widget, string detail, int y1_, int y2_, int x)
  		{
  			DrawVlineNativeDelegate unmanaged = GetClassStruct (this.LookupGType ().GetThresholdType (), true).DrawVline;
  			if (unmanaged == null) return;
  
  			IntPtr native_detail = GLib.Marshaller.StringToPtrGStrdup (detail);
  			unmanaged (this.Handle, cr == null ? IntPtr.Zero : cr.Handle, (int) state_type, widget == null ? IntPtr.Zero : widget.Handle, native_detail, y1_, y2_, x);
  			GLib.Marshaller.Free (native_detail);
  		}
  
  		static DrawShadowNativeDelegate DrawShadow_cb_delegate;
  		static DrawShadowNativeDelegate DrawShadowVMCallback {
  			get {
  				if (DrawShadow_cb_delegate == null)
  					DrawShadow_cb_delegate = new DrawShadowNativeDelegate (DrawShadow_cb);
  				return DrawShadow_cb_delegate;
  			}
  		}
  
  		static void OverrideDrawShadow (GLib.GType gtype)
  		{
  			OverrideDrawShadow (gtype, DrawShadowVMCallback);
  		}
  
  		static void OverrideDrawShadow (GLib.GType gtype, DrawShadowNativeDelegate callback)
  		{
  			GtkStyleClass class_iface = GetClassStruct (gtype, false);
  			class_iface.DrawShadow = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void DrawShadowNativeDelegate (IntPtr inst, IntPtr cr, int state_type, int shadow_type, IntPtr widget, IntPtr detail, int x, int y, int width, int height);
  
  		static void DrawShadow_cb (IntPtr inst, IntPtr cr, int state_type, int shadow_type, IntPtr widget, IntPtr detail, int x, int y, int width, int height)
  		{
  			Cairo.Context mycr = null;
  
  			try {
  				Style __obj = GLib.Object.GetObject (inst, false) as Style;
  				mycr = new Cairo.Context (cr, false);
  				__obj.OnDrawShadow (mycr, (Gtk.StateType) state_type, (Gtk.ShadowType) shadow_type, GLib.Object.GetObject(widget) as Gtk.Widget, GLib.Marshaller.Utf8PtrToString (detail), x, y, width, height);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			} finally {
  				var disposable_cr = mycr as IDisposable;
  				if (disposable_cr != null)
  					disposable_cr.Dispose ();
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Gtk.Style), ConnectionMethod="OverrideDrawShadow")]
  		protected virtual void OnDrawShadow (Cairo.Context cr, Gtk.StateType state_type, Gtk.ShadowType shadow_type, Gtk.Widget widget, string detail, int x, int y, int width, int height)
  		{
  			InternalDrawShadow (cr, state_type, shadow_type, widget, detail, x, y, width, height);
  		}
  
  		private void InternalDrawShadow (Cairo.Context cr, Gtk.StateType state_type, Gtk.ShadowType shadow_type, Gtk.Widget widget, string detail, int x, int y, int width, int height)
  		{
  			DrawShadowNativeDelegate unmanaged = GetClassStruct (this.LookupGType ().GetThresholdType (), true).DrawShadow;
  			if (unmanaged == null) return;
  
  			IntPtr native_detail = GLib.Marshaller.StringToPtrGStrdup (detail);
  			unmanaged (this.Handle, cr == null ? IntPtr.Zero : cr.Handle, (int) state_type, (int) shadow_type, widget == null ? IntPtr.Zero : widget.Handle, native_detail, x, y, width, height);
  			GLib.Marshaller.Free (native_detail);
  		}
  
  		static DrawArrowNativeDelegate DrawArrow_cb_delegate;
  		static DrawArrowNativeDelegate DrawArrowVMCallback {
  			get {
  				if (DrawArrow_cb_delegate == null)
  					DrawArrow_cb_delegate = new DrawArrowNativeDelegate (DrawArrow_cb);
  				return DrawArrow_cb_delegate;
  			}
  		}
  
  		static void OverrideDrawArrow (GLib.GType gtype)
  		{
  			OverrideDrawArrow (gtype, DrawArrowVMCallback);
  		}
  
  		static void OverrideDrawArrow (GLib.GType gtype, DrawArrowNativeDelegate callback)
  		{
  			GtkStyleClass class_iface = GetClassStruct (gtype, false);
  			class_iface.DrawArrow = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void DrawArrowNativeDelegate (IntPtr inst, IntPtr cr, int state_type, int shadow_type, IntPtr widget, IntPtr detail, int arrow_type, bool fill, int x, int y, int width, int height);
  
  		static void DrawArrow_cb (IntPtr inst, IntPtr cr, int state_type, int shadow_type, IntPtr widget, IntPtr detail, int arrow_type, bool fill, int x, int y, int width, int height)
  		{
  			Cairo.Context mycr = null;
  
  			try {
  				Style __obj = GLib.Object.GetObject (inst, false) as Style;
  				mycr = new Cairo.Context (cr, false);
  				__obj.OnDrawArrow (mycr, (Gtk.StateType) state_type, (Gtk.ShadowType) shadow_type, GLib.Object.GetObject(widget) as Gtk.Widget, GLib.Marshaller.Utf8PtrToString (detail), (Gtk.ArrowType) arrow_type, fill, x, y, width, height);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			} finally {
  				var disposable_cr = mycr as IDisposable;
  				if (disposable_cr != null)
  					disposable_cr.Dispose ();
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Gtk.Style), ConnectionMethod="OverrideDrawArrow")]
  		protected virtual void OnDrawArrow (Cairo.Context cr, Gtk.StateType state_type, Gtk.ShadowType shadow_type, Gtk.Widget widget, string detail, Gtk.ArrowType arrow_type, bool fill, int x, int y, int width, int height)
  		{
  			InternalDrawArrow (cr, state_type, shadow_type, widget, detail, arrow_type, fill, x, y, width, height);
  		}
  
  		private void InternalDrawArrow (Cairo.Context cr, Gtk.StateType state_type, Gtk.ShadowType shadow_type, Gtk.Widget widget, string detail, Gtk.ArrowType arrow_type, bool fill, int x, int y, int width, int height)
  		{
  			DrawArrowNativeDelegate unmanaged = GetClassStruct (this.LookupGType ().GetThresholdType (), true).DrawArrow;
  			if (unmanaged == null) return;
  
  			IntPtr native_detail = GLib.Marshaller.StringToPtrGStrdup (detail);
  			unmanaged (this.Handle, cr == null ? IntPtr.Zero : cr.Handle, (int) state_type, (int) shadow_type, widget == null ? IntPtr.Zero : widget.Handle, native_detail, (int) arrow_type, fill, x, y, width, height);
  			GLib.Marshaller.Free (native_detail);
  		}
  
  		static DrawDiamondNativeDelegate DrawDiamond_cb_delegate;
  		static DrawDiamondNativeDelegate DrawDiamondVMCallback {
  			get {
  				if (DrawDiamond_cb_delegate == null)
  					DrawDiamond_cb_delegate = new DrawDiamondNativeDelegate (DrawDiamond_cb);
  				return DrawDiamond_cb_delegate;
  			}
  		}
  
  		static void OverrideDrawDiamond (GLib.GType gtype)
  		{
  			OverrideDrawDiamond (gtype, DrawDiamondVMCallback);
  		}
  
  		static void OverrideDrawDiamond (GLib.GType gtype, DrawDiamondNativeDelegate callback)
  		{
  			GtkStyleClass class_iface = GetClassStruct (gtype, false);
  			class_iface.DrawDiamond = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void DrawDiamondNativeDelegate (IntPtr inst, IntPtr cr, int state_type, int shadow_type, IntPtr widget, IntPtr detail, int x, int y, int width, int height);
  
  		static void DrawDiamond_cb (IntPtr inst, IntPtr cr, int state_type, int shadow_type, IntPtr widget, IntPtr detail, int x, int y, int width, int height)
  		{
  			Cairo.Context mycr = null;
  
  			try {
  				Style __obj = GLib.Object.GetObject (inst, false) as Style;
  				mycr = new Cairo.Context (cr, false);
  				__obj.OnDrawDiamond (mycr, (Gtk.StateType) state_type, (Gtk.ShadowType) shadow_type, GLib.Object.GetObject(widget) as Gtk.Widget, GLib.Marshaller.Utf8PtrToString (detail), x, y, width, height);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			} finally {
  				var disposable_cr = mycr as IDisposable;
  				if (disposable_cr != null)
  					disposable_cr.Dispose ();
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Gtk.Style), ConnectionMethod="OverrideDrawDiamond")]
  		protected virtual void OnDrawDiamond (Cairo.Context cr, Gtk.StateType state_type, Gtk.ShadowType shadow_type, Gtk.Widget widget, string detail, int x, int y, int width, int height)
  		{
  			InternalDrawDiamond (cr, state_type, shadow_type, widget, detail, x, y, width, height);
  		}
  
  		private void InternalDrawDiamond (Cairo.Context cr, Gtk.StateType state_type, Gtk.ShadowType shadow_type, Gtk.Widget widget, string detail, int x, int y, int width, int height)
  		{
  			DrawDiamondNativeDelegate unmanaged = GetClassStruct (this.LookupGType ().GetThresholdType (), true).DrawDiamond;
  			if (unmanaged == null) return;
  
  			IntPtr native_detail = GLib.Marshaller.StringToPtrGStrdup (detail);
  			unmanaged (this.Handle, cr == null ? IntPtr.Zero : cr.Handle, (int) state_type, (int) shadow_type, widget == null ? IntPtr.Zero : widget.Handle, native_detail, x, y, width, height);
  			GLib.Marshaller.Free (native_detail);
  		}
  
  		static DrawBoxNativeDelegate DrawBox_cb_delegate;
  		static DrawBoxNativeDelegate DrawBoxVMCallback {
  			get {
  				if (DrawBox_cb_delegate == null)
  					DrawBox_cb_delegate = new DrawBoxNativeDelegate (DrawBox_cb);
  				return DrawBox_cb_delegate;
  			}
  		}
  
  		static void OverrideDrawBox (GLib.GType gtype)
  		{
  			OverrideDrawBox (gtype, DrawBoxVMCallback);
  		}
  
  		static void OverrideDrawBox (GLib.GType gtype, DrawBoxNativeDelegate callback)
  		{
  			GtkStyleClass class_iface = GetClassStruct (gtype, false);
  			class_iface.DrawBox = callback;
  			OverrideClassStruct (gtype, class_iface);
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate void DrawBoxNativeDelegate (IntPtr inst, IntPtr cr, int state_type, int shadow_type, IntPtr widget, IntPtr detail, int x, int y, int width, int height);
  
  		static void DrawBox_cb (IntPtr inst, IntPtr cr, int state_type, int shadow_type, IntPtr widget, IntPtr detail, int x, int y, int width, int height)
  		{
  			Cairo.Context mycr = null;
  
  			try {
  				Style __obj = GLib.Object.GetObject (inst, false) as Style;
  				mycr = new Cairo.Context (cr, false);
  				__obj.OnDrawBox (mycr, (Gtk.StateType) state_type, (Gtk.ShadowType) shadow_type, GLib.Object.GetObject(widget) as Gtk.Widget, GLib.Marshaller.Utf8PtrToString (detail), x, y, width, height);
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, false);
  			} finally {
  				var disposable_cr = mycr as IDisposable;
  
gt: 				if (disposable_cr != null)