// 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 Adjustment : GLib.InitiallyUnowned {

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

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

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

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

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

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

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

		[GLib.Property ("lower")]
		public double Lower {
			get  {
				double raw_ret = gtk_adjustment_get_lower(Handle);
				double ret = raw_ret;
				return ret;
			}
			set  {
				gtk_adjustment_set_lower(Handle, value);
			}
		}

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

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

		[GLib.Property ("upper")]
		public double Upper {
			get  {
				double raw_ret = gtk_adjustment_get_upper(Handle);
				double ret = raw_ret;
				return ret;
			}
			set  {
				gtk_adjustment_set_upper(Handle, value);
			}
		}

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

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

		[GLib.Property ("step-increment")]
		public double StepIncrement {
			get  {
				double raw_ret = gtk_adjustment_get_step_increment(Handle);
				double ret = raw_ret;
				return ret;
			}
			set  {
				gtk_adjustment_set_step_increment(Handle, value);
			}
		}

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

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

		[GLib.Property ("page-increment")]
		public double PageIncrement {
			get  {
				double raw_ret = gtk_adjustment_get_page_increment(Handle);
				double ret = raw_ret;
				return ret;
			}
			set  {
				gtk_adjustment_set_page_increment(Handle, value);
			}
		}

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

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

		[GLib.Property ("page-size")]
		public double PageSize {
			get  {
				double raw_ret = gtk_adjustment_get_page_size(Handle);
				double ret = raw_ret;
				return ret;
			}
			set  {
				gtk_adjustment_set_page_size(Handle, value);
			}
		}

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

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

		static ChangedNativeDelegate Changed_cb_delegate;
		static ChangedNativeDelegate ChangedVMCallback {
			get {
				if (Changed_cb_delegate == null)
					Changed_cb_delegate = new ChangedNativeDelegate (Changed_cb);
				return Changed_cb_delegate;
			}
		}

		static void OverrideChanged (GLib.GType gtype)
		{
			OverrideChanged (gtype, ChangedVMCallback);
		}

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

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

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

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.Adjustment), ConnectionMethod="OverrideChanged")]
		protected virtual void OnChanged ()
		{
			InternalChanged ();
		}

		private void InternalChanged ()
		{
			ChangedNativeDelegate unmanaged = class_abi.BaseOverride<ChangedNativeDelegate>(this.LookupGType(), "changed");
			if (unmanaged == null) return;

			unmanaged (this.Handle);
		}

		static ValueChangedNativeDelegate ValueChanged_cb_delegate;
		static ValueChangedNativeDelegate ValueChangedVMCallback {
			get {
				if (ValueChanged_cb_delegate == null)
					ValueChanged_cb_delegate = new ValueChangedNativeDelegate (ValueChanged_cb);
				return ValueChanged_cb_delegate;
			}
		}

		static void OverrideValueChanged (GLib.GType gtype)
		{
			OverrideValueChanged (gtype, ValueChangedVMCallback);
		}

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

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

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

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.Adjustment), ConnectionMethod="OverrideValueChanged")]
		protected virtual void OnValueChanged ()
		{
			InternalValueChanged ();
		}

		private void InternalValueChanged ()
		{
			ValueChangedNativeDelegate unmanaged = class_abi.BaseOverride<ValueChangedNativeDelegate>(this.LookupGType(), "value_changed");
			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("changed"
							, GLib.Object.class_abi.Fields
							, (uint) sizeof( IntPtr ) // changed
							, null
							, "value_changed"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("value_changed"
							, -1
							, (uint) sizeof( IntPtr ) // value_changed
							, "changed"
							, "_gtk_reserved1"
							, (uint) sizeof(IntPtr)
							, 0
							),
						new GLib.AbiField("_gtk_reserved1"
							, -1
							, (uint) sizeof( IntPtr ) // _gtk_reserved1
							, "value_changed"
							, "_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 void d_gtk_adjustment_changed(IntPtr raw);
		static d_gtk_adjustment_changed gtk_adjustment_changed = FuncLoader.LoadFunction<d_gtk_adjustment_changed>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_adjustment_changed"));

		[Obsolete]
		public void Change() {
			gtk_adjustment_changed(Handle);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_adjustment_clamp_page(IntPtr raw, double lower, double upper);
		static d_gtk_adjustment_clamp_page gtk_adjustment_clamp_page = FuncLoader.LoadFunction<d_gtk_adjustment_clamp_page>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_adjustment_clamp_page"));

		public void ClampPage(double lower, double upper) {
			gtk_adjustment_clamp_page(Handle, lower, upper);
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void d_gtk_adjustment_configure(IntPtr raw, double value, double lower, double upper, double step_increment, double page_increment, double page_size);
		static d_gtk_adjustment_configure gtk_adjustment_configure = FuncLoader.LoadFunction<d_gtk_adjustment_configure>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gtk), "gtk_adjustment_configure"));

		public void Configure(double value, double lower, double upper, double step_increment, double page_increment, double page_size) {
			gtk_adjustment_configure(Handle, value, lower, upper, step_increment, page_increment, page_size);
		}

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

		public double MinimumIncrement { 
			get {
				double raw_ret = gtk_adjustment_get_minimum_increment(Handle);
				double ret = raw_ret;
				return ret;
			}
		}

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

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

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

		[Obsolete]
		public void ChangeValue() {
			gtk_adjustment_value_changed(Handle);
		}


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

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}
