// 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 AppSrcSimpleCallbacks : IEquatable<AppSrcSimpleCallbacks> {


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

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

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

		public static AppSrcSimpleCallbacks New()
		{
			AppSrcSimpleCallbacks result = AppSrcSimpleCallbacks.New (gst_app_src_simple_callbacks_new());
			return result;
		}

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

		public static GLib.GType GType { 
			get {
				IntPtr raw_ret = gst_app_src_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_src_simple_callbacks_ref(IntPtr raw);

		public Gst.App.AppSrcSimpleCallbacks 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_src_simple_callbacks_ref(this_as_native);
			Gst.App.AppSrcSimpleCallbacks ret = Gst.App.AppSrcSimpleCallbacks.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_src_simple_callbacks_set_enough_data(IntPtr raw, Gst.AppSharp.AppSrcEnoughDataCallbackNative enough_data_cb, IntPtr user_data, GLib.DestroyNotify destroy_notify);

		public Gst.App.AppSrcEnoughDataCallback EnoughData { 
			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.AppSrcEnoughDataCallbackWrapper value_wrapper = new Gst.AppSharp.AppSrcEnoughDataCallbackWrapper (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_src_simple_callbacks_set_enough_data(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_src_simple_callbacks_set_need_data(IntPtr raw, Gst.AppSharp.AppSrcNeedDataCallbackNative need_data_cb, IntPtr user_data, GLib.DestroyNotify destroy_notify);

		public Gst.App.AppSrcNeedDataCallback NeedData { 
			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.AppSrcNeedDataCallbackWrapper value_wrapper = new Gst.AppSharp.AppSrcNeedDataCallbackWrapper (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_src_simple_callbacks_set_need_data(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_src_simple_callbacks_set_seek_data(IntPtr raw, Gst.AppSharp.AppSrcSeekDataCallbackNative seek_data_cb, IntPtr user_data, GLib.DestroyNotify destroy_notify);

		public Gst.App.AppSrcSeekDataCallback SeekData { 
			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.AppSrcSeekDataCallbackWrapper value_wrapper = new Gst.AppSharp.AppSrcSeekDataCallbackWrapper (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_src_simple_callbacks_set_seek_data(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_src_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_src_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.AppSrcSimpleCallbacks target)
		{
			target = New (native);
		}

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

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

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

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

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