// 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 LevelBar : Gtk.Widget, Gtk.IOrientable {

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

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

		public LevelBar () : base (IntPtr.Zero)
		{
			if (GetType () != typeof (LevelBar)) {
				CreateNativeObject (Array.Empty<string> (), Array.Empty<GLib.Value> ());
				return;
			}
			Raw = gtk_level_bar_new();
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr d_gtk_level_bar_new_for_interval(double min_value, double max_value);
		static d_gtk_level_bar_new_for_interval gtk_level_bar_new_for_interval = FuncLoader.LoadFunction<d_gtk_level_bar_new_for_interval>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_level_bar_new_for_interval"));

		public LevelBar (double min_value, double max_value) : base (IntPtr.Zero)
		{
			if (GetType () != typeof (LevelBar)) {
				var vals = new List<GLib.Value> ();
				var names = new List<string> ();
				names.Add ("min_value");
				vals.Add (new GLib.Value (min_value));
				names.Add ("max_value");
				vals.Add (new GLib.Value (max_value));
				CreateNativeObject (names.ToArray (), vals.ToArray ());
				return;
			}
			Raw = gtk_level_bar_new_for_interval(min_value, max_value);
		}

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

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

		[GLib.Property ("value")]
		public double Value {
			get  {
				double raw_ret = gtk_level_bar_get_value(Handle);
				double ret = raw_ret;
				return ret;
			}
			set  {
				gtk_level_bar_set_value(Handle, value);
			}
		}

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

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

		[GLib.Property ("min-value")]
		public double MinValue {
			get  {
				double raw_ret = gtk_level_bar_get_min_value(Handle);
				double ret = raw_ret;
				return ret;
			}
			set  {
				gtk_level_bar_set_min_value(Handle, value);
			}
		}

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

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

		[GLib.Property ("max-value")]
		public double MaxValue {
			get  {
				double raw_ret = gtk_level_bar_get_max_value(Handle);
				double ret = raw_ret;
				return ret;
			}
			set  {
				gtk_level_bar_set_max_value(Handle, value);
			}
		}

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

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

		[GLib.Property ("mode")]
		public Gtk.LevelBarMode Mode {
			get  {
				int raw_ret = gtk_level_bar_get_mode(Handle);
				Gtk.LevelBarMode ret = (Gtk.LevelBarMode) raw_ret;
				return ret;
			}
			set  {
				gtk_level_bar_set_mode(Handle, (int) value);
			}
		}

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

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

		[GLib.Property ("inverted")]
		public bool Inverted {
			get  {
				bool raw_ret = gtk_level_bar_get_inverted(Handle);
				bool ret = raw_ret;
				return ret;
			}
			set  {
				gtk_level_bar_set_inverted(Handle, value);
			}
		}

		[Obsolete]
		public int MinBlockHeight {
			get {
				var val = (int)StyleGetProperty("min-block-height");
				return val;
			}
		}

		[Obsolete]
		public int MinBlockWidth {
			get {
				var val = (int)StyleGetProperty("min-block-width");
				return val;
			}
		}

		[GLib.Signal("offset-changed")]
		public event Gtk.OffsetChangedHandler OffsetChanged {
			add {
				this.AddSignalHandler ("offset-changed", value, typeof (Gtk.OffsetChangedArgs));
			}
			remove {
				this.RemoveSignalHandler ("offset-changed", value);
			}
		}

		static OffsetChangedNativeDelegate OffsetChanged_cb_delegate;
		static OffsetChangedNativeDelegate OffsetChangedVMCallback {
			get {
				if (OffsetChanged_cb_delegate == null)
					OffsetChanged_cb_delegate = new OffsetChangedNativeDelegate (OffsetChanged_cb);
				return OffsetChanged_cb_delegate;
			}
		}

		static void OverrideOffsetChanged (GLib.GType gtype)
		{
			OverrideOffsetChanged (gtype, OffsetChangedVMCallback);
		}

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void OffsetChangedNativeDelegate (IntPtr inst, IntPtr name);

		static void OffsetChanged_cb (IntPtr inst, IntPtr name)
		{
			try {
				LevelBar __obj = GLib.Object.GetObject (inst, false) as LevelBar;
				__obj.OnOffsetChanged (GLib.Marshaller.Utf8PtrToString (name));
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.LevelBar), ConnectionMethod="OverrideOffsetChanged")]
		protected virtual void OnOffsetChanged (string name)
		{
			InternalOffsetChanged (name);
		}

		private void InternalOffsetChanged (string name)
		{
			OffsetChangedNativeDelegate unmanaged = class_abi.BaseOverride<OffsetChangedNativeDelegate>(this.LookupGType(), "offset_changed");
			if (unmanaged == null) return;

			IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
			unmanaged (this.Handle, native_name);
			GLib.Marshaller.Free (native_name);
		}


		// 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("offset_changed"
							, Gtk.Widget.class_abi.Fields
							, (uint) sizeof( IntPtr ) // offset_changed
							, null
							, "padding"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("padding"
							, -1
							, (uint) sizeof( IntPtr ) * 16 // padding
							, "offset_changed"
							, null
							, (uint) sizeof(IntPtr)
							, 0
							),
					});

				return _class_abi;
			}
		}


		// End of the ABI representation.

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_level_bar_add_offset_value(IntPtr raw, IntPtr name, double value);
		static d_gtk_level_bar_add_offset_value gtk_level_bar_add_offset_value = FuncLoader.LoadFunction<d_gtk_level_bar_add_offset_value>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_level_bar_add_offset_value"));

		public void AddOffsetValue(string name, double value) {
			IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
			gtk_level_bar_add_offset_value(Handle, native_name, value);
			GLib.Marshaller.Free (native_name);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool d_gtk_level_bar_get_offset_value(IntPtr raw, IntPtr name, out double value);
		static d_gtk_level_bar_get_offset_value gtk_level_bar_get_offset_value = FuncLoader.LoadFunction<d_gtk_level_bar_get_offset_value>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_level_bar_get_offset_value"));

		public bool GetOffsetValue(string name, out double value) {
			IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
			bool raw_ret = gtk_level_bar_get_offset_value(Handle, native_name, out value);
			bool ret = raw_ret;
			GLib.Marshaller.Free (native_name);
			return ret;
		}

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

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

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

		public void RemoveOffsetValue(string name) {
			IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
			gtk_level_bar_remove_offset_value(Handle, native_name);
			GLib.Marshaller.Free (native_name);
		}

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

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

		[GLib.Property ("orientation")]
		public Gtk.Orientation Orientation {
			get  {
				int raw_ret = gtk_orientable_get_orientation(Handle);
				Gtk.Orientation ret = (Gtk.Orientation) raw_ret;
				return ret;
			}
			set  {
				gtk_orientable_set_orientation(Handle, (int) value);
			}
		}


		// 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.Widget.abi_info.Fields
							, (uint) sizeof( IntPtr ) // priv
							, null
							, null
							, (uint) sizeof(IntPtr)
							, 0
							),
					});

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}
