// 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 Expander : Gtk.Bin {

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

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

		public static Expander New(string label)
		{
			IntPtr native_label = GLib.Marshaller.StringToPtrGStrdup (label);
			Expander result = new Expander (gtk_expander_new(native_label));
			GLib.Marshaller.Free (native_label);
			return result;
		}

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

		public Expander (string label) : base (IntPtr.Zero)
		{
			if (GetType () != typeof (Expander)) {
				var vals = new List<GLib.Value> ();
				var names = new List<string> ();
				names.Add ("label");
				vals.Add (new GLib.Value (label));
				CreateNativeObject (names.ToArray (), vals.ToArray ());
				return;
			}
			IntPtr native_label = GLib.Marshaller.StringToPtrGStrdup (label);
			Raw = gtk_expander_new_with_mnemonic(native_label);
			GLib.Marshaller.Free (native_label);
		}

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

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

		[GLib.Property ("expanded")]
		public bool Expanded {
			get  {
				bool raw_ret = gtk_expander_get_expanded(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set  {
				gtk_expander_set_expanded(Handle, value);
			}
		}

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

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

		[GLib.Property ("label")]
		public string Label {
			get  {
				IntPtr raw_ret = gtk_expander_get_label(Handle);
				string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
				return ret;
			}
			set  {
				IntPtr native_value = GLib.Marshaller.StringToPtrGStrdup (value);
				gtk_expander_set_label(Handle, native_value);
				GLib.Marshaller.Free (native_value);
			}
		}

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

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

		[GLib.Property ("use-underline")]
		public bool UseUnderline {
			get  {
				bool raw_ret = gtk_expander_get_use_underline(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set  {
				gtk_expander_set_use_underline(Handle, value);
			}
		}

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

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

		[GLib.Property ("use-markup")]
		public bool UseMarkup {
			get  {
				bool raw_ret = gtk_expander_get_use_markup(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set  {
				gtk_expander_set_use_markup(Handle, value);
			}
		}

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

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

		[GLib.Property ("spacing")]
		public int Spacing {
			get  {
				int raw_ret = gtk_expander_get_spacing(Handle);
				int ret = raw_ret;
				return ret;
			}
			set  {
				gtk_expander_set_spacing(Handle, value);
			}
		}

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

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

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

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

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

		[GLib.Property ("label-fill")]
		public bool LabelFill {
			get  {
				bool raw_ret = gtk_expander_get_label_fill(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set  {
				gtk_expander_set_label_fill(Handle, value);
			}
		}

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

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

		[GLib.Property ("resize-toplevel")]
		public bool ResizeToplevel {
			get  {
				bool raw_ret = gtk_expander_get_resize_toplevel(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set  {
				gtk_expander_set_resize_toplevel(Handle, value);
			}
		}

		[Obsolete]
		public int ExpanderSize {
			get {
				var val = (int)StyleGetProperty("expander-size");
				return val;
			}
		}

		[Obsolete]
		public int ExpanderSpacing {
			get {
				var val = (int)StyleGetProperty("expander-spacing");
				return val;
			}
		}

		[GLib.Signal("activate")]
		public event System.EventHandler Activated {
			add {
				this.AddSignalHandler ("activate", value);
			}
			remove {
				this.RemoveSignalHandler ("activate", value);
			}
		}

		static ActivatedNativeDelegate Activated_cb_delegate;
		static ActivatedNativeDelegate ActivatedVMCallback {
			get {
				if (Activated_cb_delegate == null)
					Activated_cb_delegate = new ActivatedNativeDelegate (Activated_cb);
				return Activated_cb_delegate;
			}
		}

		static void OverrideActivated (GLib.GType gtype)
		{
			OverrideActivated (gtype, ActivatedVMCallback);
		}

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

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

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

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.Expander), ConnectionMethod="OverrideActivated")]
		protected virtual void OnActivated ()
		{
			InternalActivated ();
		}

		private void InternalActivated ()
		{
			ActivatedNativeDelegate unmanaged = class_abi.BaseOverride<ActivatedNativeDelegate>(this.LookupGType(), "activate");
			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("activate"
							, Gtk.Bin.class_abi.Fields
							, (uint) sizeof( IntPtr ) // activate
							, null
							, "_gtk_reserved1"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved1"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved1
							, "activate"
							, "_gtk_reserved2"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved2"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved2
							, "_gtk_reserved1"
							, "_gtk_reserved3"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved3"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved3
							, "_gtk_reserved2"
							, "_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 IntPtr d_gtk_expander_get_type();
		static d_gtk_expander_get_type gtk_expander_get_type = FuncLoader.LoadFunction<d_gtk_expander_get_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_expander_get_type"));

		public static new GLib.GType GType { 
			get {
				IntPtr raw_ret = gtk_expander_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"
							, Gtk.Bin.abi_info.Fields
							, (uint) sizeof( IntPtr ) // priv
							, null
							, null
							, (uint) sizeof(IntPtr)
							, 0
							),
					});

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}
