// 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 GestureLongPress : Gtk.GestureSingle {

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

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

		public GestureLongPress (Gtk.Widget widget) : base (IntPtr.Zero)
		{
			if (GetType () != typeof (GestureLongPress)) {
				var vals = new List<GLib.Value> ();
				var names = new List<string> ();
				if (widget != null) {
					names.Add ("widget");
					vals.Add (new GLib.Value (widget));
				}
				CreateNativeObject (names.ToArray (), vals.ToArray ());
				return;
			}
			Raw = gtk_gesture_long_press_new(widget == null ? IntPtr.Zero : widget.Handle);
		}

		[GLib.Property ("delay-factor")]
		public double DelayFactor {
			get {
				GLib.Value val = GetProperty ("delay-factor");
				double ret = (double) val;
				val.Dispose ();
				return ret;
			}
			set {
				GLib.Value val = new GLib.Value(value);
				SetProperty("delay-factor", val);
				val.Dispose ();
			}
		}

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

		[GLib.Signal("pressed")]
		public event Gtk.PressedHandler Pressed {
			add {
				this.AddSignalHandler ("pressed", value, typeof (Gtk.PressedArgs));
			}
			remove {
				this.RemoveSignalHandler ("pressed", value);
			}
		}

		static PressedNativeDelegate Pressed_cb_delegate;
		static PressedNativeDelegate PressedVMCallback {
			get {
				if (Pressed_cb_delegate == null)
					Pressed_cb_delegate = new PressedNativeDelegate (Pressed_cb);
				return Pressed_cb_delegate;
			}
		}

		static void OverridePressed (GLib.GType gtype)
		{
			OverridePressed (gtype, PressedVMCallback);
		}

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void PressedNativeDelegate (IntPtr inst, double x, double y);

		static void Pressed_cb (IntPtr inst, double x, double y)
		{
			try {
				GestureLongPress __obj = GLib.Object.GetObject (inst, false) as GestureLongPress;
				__obj.OnPressed (x, y);
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.GestureLongPress), ConnectionMethod="OverridePressed")]
		protected virtual void OnPressed (double x, double y)
		{
			InternalPressed (x, y);
		}

		private void InternalPressed (double x, double y)
		{
			PressedNativeDelegate unmanaged = class_abi.BaseOverride<PressedNativeDelegate>(this.LookupGType(), "pressed");
			if (unmanaged == null) return;

			unmanaged (this.Handle, x, y);
		}

		static CancelledNativeDelegate Cancelled_cb_delegate;
		static CancelledNativeDelegate CancelledVMCallback {
			get {
				if (Cancelled_cb_delegate == null)
					Cancelled_cb_delegate = new CancelledNativeDelegate (Cancelled_cb);
				return Cancelled_cb_delegate;
			}
		}

		static void OverrideCancelled (GLib.GType gtype)
		{
			OverrideCancelled (gtype, CancelledVMCallback);
		}

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

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

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

		[GLib.DefaultSignalHandler(Type=typeof(Gtk.GestureLongPress), ConnectionMethod="OverrideCancelled")]
		protected virtual void OnCancelled ()
		{
			InternalCancelled ();
		}

		private void InternalCancelled ()
		{
			CancelledNativeDelegate unmanaged = class_abi.BaseOverride<CancelledNativeDelegate>(this.LookupGType(), "cancelled");
			if (unmanaged == null) return;

			unmanaged (this.Handle);
		}

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

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

#endregion
	}
}
