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

#region Autogenerated code
	public partial class Accessible : Atk.Object {

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

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

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

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

		[GLib.Property ("widget")]
		public Gtk.Widget Widget {
			get  {
				IntPtr raw_ret = gtk_accessible_get_widget(Handle);
				Gtk.Widget ret = GLib.Object.GetObject(raw_ret) as Gtk.Widget;
				return ret;
			}
			set  {
				gtk_accessible_set_widget(Handle, value == null ? IntPtr.Zero : value.Handle);
			}
		}

		static ConnectWidgetDestroyedNativeDelegate ConnectWidgetDestroyed_cb_delegate;
		static ConnectWidgetDestroyedNativeDelegate ConnectWidgetDestroyedVMCallback {
			get {
				if (ConnectWidgetDestroyed_cb_delegate == null)
					ConnectWidgetDestroyed_cb_delegate = new ConnectWidgetDestroyedNativeDelegate (ConnectWidgetDestroyed_cb);
				return ConnectWidgetDestroyed_cb_delegate;
			}
		}

		static void OverrideConnectWidgetDestroyed (GLib.GType gtype)
		{
			OverrideConnectWidgetDestroyed (gtype, ConnectWidgetDestroyedVMCallback);
		}

		static void OverrideConnectWidgetDestroyed (GLib.GType gtype, ConnectWidgetDestroyedNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("connect_widget_destroyed"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void ConnectWidgetDestroyedNativeDelegate (IntPtr inst);

		static void ConnectWidgetDestroyed_cb (IntPtr inst)
		{
			try {
				Accessible __obj = GLib.Object.GetObject (inst, false) as Accessible;
				__obj.OnConnectWidgetDestroyed ();
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.Accessible), ConnectionMethod="OverrideConnectWidgetDestroyed")]
		protected virtual void OnConnectWidgetDestroyed ()
		{
			InternalConnectWidgetDestroyed ();
		}

		private void InternalConnectWidgetDestroyed ()
		{
			ConnectWidgetDestroyedNativeDelegate unmanaged = class_abi.BaseOverride<ConnectWidgetDestroyedNativeDelegate>(this.LookupGType(), "connect_widget_destroyed");
			if (unmanaged == null) return;

			unmanaged (this.Handle);
		}

		static WidgetSetNativeDelegate WidgetSet_cb_delegate;
		static WidgetSetNativeDelegate WidgetSetVMCallback {
			get {
				if (WidgetSet_cb_delegate == null)
					WidgetSet_cb_delegate = new WidgetSetNativeDelegate (WidgetSet_cb);
				return WidgetSet_cb_delegate;
			}
		}

		static void OverrideWidgetSet (GLib.GType gtype)
		{
			OverrideWidgetSet (gtype, WidgetSetVMCallback);
		}

		static void OverrideWidgetSet (GLib.GType gtype, WidgetSetNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("widget_set"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void WidgetSetNativeDelegate (IntPtr inst);

		static void WidgetSet_cb (IntPtr inst)
		{
			try {
				Accessible __obj = GLib.Object.GetObject (inst, false) as Accessible;
				__obj.OnWidgetSet ();
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.Accessible), ConnectionMethod="OverrideWidgetSet")]
		protected virtual void OnWidgetSet ()
		{
			InternalWidgetSet ();
		}

		private void InternalWidgetSet ()
		{
			WidgetSetNativeDelegate unmanaged = class_abi.BaseOverride<WidgetSetNativeDelegate>(this.LookupGType(), "widget_set");
			if (unmanaged == null) return;

			unmanaged (this.Handle);
		}

		static WidgetUnsetNativeDelegate WidgetUnset_cb_delegate;
		static WidgetUnsetNativeDelegate WidgetUnsetVMCallback {
			get {
				if (WidgetUnset_cb_delegate == null)
					WidgetUnset_cb_delegate = new WidgetUnsetNativeDelegate (WidgetUnset_cb);
				return WidgetUnset_cb_delegate;
			}
		}

		static void OverrideWidgetUnset (GLib.GType gtype)
		{
			OverrideWidgetUnset (gtype, WidgetUnsetVMCallback);
		}

		static void OverrideWidgetUnset (GLib.GType gtype, WidgetUnsetNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("widget_unset"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void WidgetUnsetNativeDelegate (IntPtr inst);

		static void WidgetUnset_cb (IntPtr inst)
		{
			try {
				Accessible __obj = GLib.Object.GetObject (inst, false) as Accessible;
				__obj.OnWidgetUnset ();
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.Accessible), ConnectionMethod="OverrideWidgetUnset")]
		protected virtual void OnWidgetUnset ()
		{
			InternalWidgetUnset ();
		}

		private void InternalWidgetUnset ()
		{
			WidgetUnsetNativeDelegate unmanaged = class_abi.BaseOverride<WidgetUnsetNativeDelegate>(this.LookupGType(), "widget_unset");
			if (unmanaged == null) return;

			unmanaged (this.Handle);
		}


		// 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 (new List<GLib.AbiField>{ 
						new GLib.AbiField("connect_widget_destroyed"
							, Atk.Object.class_abi.Fields
							, (uint) sizeof( IntPtr ) // connect_widget_destroyed
							, null
							, "widget_set"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("widget_set"
							, -1
							, (uint) sizeof( IntPtr ) // widget_set
							, "connect_widget_destroyed"
							, "widget_unset"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("widget_unset"
							, -1
							, (uint) sizeof( IntPtr ) // widget_unset
							, "widget_set"
							, "_gtk_reserved3"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved3"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved3
							, "widget_unset"
							, "_gtk_reserved4"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved4"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved4
							, "_gtk_reserved3"
							, null
							, (uint) sizeof(IntPtr)
							, 0
							),
					});

				return _class_abi;
			}
		}


		// End of the ABI representation.

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

		[Obsolete]
		public void ConnectWidgetDestroyed() {
			gtk_accessible_connect_widget_destroyed(Handle);
		}

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

		public static new GLib.GType GType { 
			get {
				IntPtr raw_ret = gtk_accessible_get_type();
				GLib.GType ret = new GLib.GType(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 (new List<GLib.AbiField>{ 
						new GLib.AbiField("priv"
							, Atk.Object.abi_info.Fields
							, (uint) sizeof( IntPtr ) // priv
							, null
							, null
							, (uint) sizeof(IntPtr)
							, 0
							),
					});

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}
