// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.

namespace Gst.App {

	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Runtime.InteropServices;

#region Autogenerated code
	[StructLayout(LayoutKind.Sequential)]
	public partial struct AppSinkSimpleCallbacks : IEquatable<AppSinkSimpleCallbacks> {


		public static Gst.App.AppSinkSimpleCallbacks Zero = new Gst.App.AppSinkSimpleCallbacks ();

		public static Gst.App.AppSinkSimpleCallbacks New(IntPtr raw) {
			if (raw == IntPtr.Zero)
				return Gst.App.AppSinkSimpleCallbacks.Zero;
			return (Gst.App.AppSinkSimpleCallbacks) Marshal.PtrToStructure (raw, typeof (Gst.App.AppSinkSimpleCallbacks));
		}

		[DllImport("gstapp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_app_sink_simple_callbacks_new();

		public static AppSinkSimpleCallbacks New()
		{
			AppSinkSimpleCallbacks result = AppSinkSimpleCallbacks.New (gst_app_sink_simple_callbacks_new());
			return result;
		}

		[DllImport("gstapp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_app_sink_simple_callbacks_get_type();

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

		[DllImport("gstapp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_app_sink_simple_callbacks_ref(IntPtr raw);

		public Gst.App.AppSinkSimpleCallbacks Ref() {
			IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
			System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
			IntPtr raw_ret = gst_app_sink_simple_callbacks_ref(this_as_native);
			Gst.App.AppSinkSimpleCallbacks ret = Gst.App.AppSinkSimpleCallbacks.New (raw_ret);
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

		[DllImport("gstapp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_app_sink_simple_callbacks_set_eos(IntPtr raw, Gst.AppSharp.AppSinkEosCallbackNative eos_cb, IntPtr user_data, GLib.DestroyNotify destroy_notify);

		public Gst.App.AppSinkEosCallback Eos { 
			set {
				IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
				System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
				Gst.AppSharp.AppSinkEosCallbackWrapper value_wrapper = new Gst.AppSharp.AppSinkEosCallbackWrapper (value);
				IntPtr user_data;
				GLib.DestroyNotify destroy_notify;
				if (value == null) {
					user_data = IntPtr.Zero;
					destroy_notify = null;
				} else {
					user_data = (IntPtr) GCHandle.Alloc (value_wrapper);
					destroy_notify = GLib.DestroyHelper.NotifyHandler;
				}
				gst_app_sink_simple_callbacks_set_eos(this_as_native, value_wrapper.NativeDelegate, user_data, destroy_notify);
				ReadNative (this_as_native, ref this);
				System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			}
		}

		[DllImport("gstapp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_app_sink_simple_callbacks_set_new_event(IntPtr raw, Gst.AppSharp.AppSinkNewEventCallbackNative new_event_cb, IntPtr user_data, GLib.DestroyNotify destroy_notify);

		public Gst.App.AppSinkNewEventCallback NewEvent { 
			set {
				IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
				System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
				Gst.AppSharp.AppSinkNewEventCallbackWrapper value_wrapper = new Gst.AppSharp.AppSinkNewEventCallbackWrapper (value);
				IntPtr user_data;
				GLib.DestroyNotify destroy_notify;
				if (value == null) {
					user_data = IntPtr.Zero;
					destroy_notify = null;
				} else {
					user_data = (IntPtr) GCHandle.Alloc (value_wrapper);
					destroy_notify = GLib.DestroyHelper.NotifyHandler;
				}
				gst_app_sink_simple_callbacks_set_new_event(this_as_native, value_wrapper.NativeDelegate, user_data, destroy_notify);
				ReadNative (this_as_native, ref this);
				System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			}
		}

		[DllImport("gstapp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_app_sink_simple_callbacks_set_new_preroll(IntPtr raw, Gst.AppSharp.AppSinkNewPrerollCallbackNative new_preroll_cb, IntPtr user_data, GLib.DestroyNotify destroy_notify);

		public Gst.App.AppSinkNewPrerollCallback NewPreroll { 
			set {
				IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
				System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
				Gst.AppSharp.AppSinkNewPrerollCallbackWrapper value_wrapper = new Gst.AppSharp.AppSinkNewPrerollCallbackWrapper (value);
				IntPtr user_data;
				GLib.DestroyNotify destroy_notify;
				if (value == null) {
					user_data = IntPtr.Zero;
					destroy_notify = null;
				} else {
					user_data = (IntPtr) GCHandle.Alloc (value_wrapper);
					destroy_notify = GLib.DestroyHelper.NotifyHandler;
				}
				gst_app_sink_simple_callbacks_set_new_preroll(this_as_native, value_wrapper.NativeDelegate, user_data, destroy_notify);
				ReadNative (this_as_native, ref this);
				System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			}
		}

		[DllImport("gstapp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_app_sink_simple_callbacks_set_new_sample(IntPtr raw, Gst.AppSharp.AppSinkNewSampleCallbackNative new_sample_cb, IntPtr user_data, GLib.DestroyNotify destroy_notify);

		public Gst.App.AppSinkNewSampleCallback NewSample { 
			set {
				IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
				System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
				Gst.AppSharp.AppSinkNewSampleCallbackWrapper value_wrapper = new Gst.AppSharp.AppSinkNewSampleCallbackWrapper (value);
				IntPtr user_data;
				GLib.DestroyNotify destroy_notify;
				if (value == null) {
					user_data = IntPtr.Zero;
					destroy_notify = null;
				} else {
					user_data = (IntPtr) GCHandle.Alloc (value_wrapper);
					destroy_notify = GLib.DestroyHelper.NotifyHandler;
				}
				gst_app_sink_simple_callbacks_set_new_sample(this_as_native, value_wrapper.NativeDelegate, user_data, destroy_notify);
				ReadNative (this_as_native, ref this);
				System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			}
		}

		[DllImport("gstapp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_app_sink_simple_callbacks_set_propose_allocation(IntPtr raw, Gst.AppSharp.AppSinkProposeAllocationCallbackNative propose_allocation_cb, IntPtr user_data, GLib.DestroyNotify destroy_notify);

		public Gst.App.AppSinkProposeAllocationCallback ProposeAllocation { 
			set {
				IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
				System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
				Gst.AppSharp.AppSinkProposeAllocationCallbackWrapper value_wrapper = new Gst.AppSharp.AppSinkProposeAllocationCallbackWrapper (value);
				IntPtr user_data;
				GLib.DestroyNotify destroy_notify;
				if (value == null) {
					user_data = IntPtr.Zero;
					destroy_notify = null;
				} else {
					user_data = (IntPtr) GCHandle.Alloc (value_wrapper);
					destroy_notify = GLib.DestroyHelper.NotifyHandler;
				}
				gst_app_sink_simple_callbacks_set_propose_allocation(this_as_native, value_wrapper.NativeDelegate, user_data, destroy_notify);
				ReadNative (this_as_native, ref this);
				System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			}
		}

		[DllImport("gstapp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_app_sink_simple_callbacks_unref(IntPtr raw);

		public void Unref() {
			IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
			System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
			gst_app_sink_simple_callbacks_unref(this_as_native);
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
		}

		static void ReadNative (IntPtr native, ref Gst.App.AppSinkSimpleCallbacks target)
		{
			target = New (native);
		}

		public bool Equals (AppSinkSimpleCallbacks other)
		{
			return true;
		}

		public override bool Equals (object other)
		{
			return other is AppSinkSimpleCallbacks && Equals ((AppSinkSimpleCallbacks) other);
		}

		public override int GetHashCode ()
		{
			return this.GetType ().FullName.GetHashCode ();
		}

		public static explicit operator GLib.Value (Gst.App.AppSinkSimpleCallbacks boxed)
		{
			GLib.Value val = GLib.Value.Empty;
			val.Init (Gst.App.AppSinkSimpleCallbacks.GType);
			val.Val = boxed;
			return val;
		}

		public static explicit operator Gst.App.AppSinkSimpleCallbacks (GLib.Value val)
		{
			return (Gst.App.AppSinkSimpleCallbacks) val.Val;
		}
#endregion
	}
}
