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

namespace Gst {

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

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

		private IntPtr _pointer;
		[MarshalAs (UnmanagedType.ByValArray, SizeConst=8)]
		private byte[] Padding;

		public static Gst.IdStr Zero = new Gst.IdStr ();

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

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

		public static IdStr New()
		{
			IdStr result = IdStr.New (gst_id_str_new());
			return result;
		}

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

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

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

		public string AsStr() {
			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_id_str_as_str(this_as_native);
			string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			return ret;
		}

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

		public void Clear() {
			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_id_str_clear(this_as_native);
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
		}

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

		public void CopyInto(Gst.IdStr s) {
			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 native_s = GLib.Marshaller.StructureToPtrAlloc (s);
			gst_id_str_copy_into(this_as_native, native_s);
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			Marshal.FreeHGlobal (native_s);
		}

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

		public ulong Len { 
			get {
				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);
				UIntPtr raw_ret = gst_id_str_get_len(this_as_native);
				ulong ret = (ulong) raw_ret;
				ReadNative (this_as_native, ref this);
				System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
				return ret;
			}
		}

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

		public void Init() {
			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_id_str_init(this_as_native);
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_id_str_is_equal(IntPtr raw, IntPtr s2);

		public bool IsEqual(Gst.IdStr s2) {
			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 native_s2 = GLib.Marshaller.StructureToPtrAlloc (s2);
			bool raw_ret = gst_id_str_is_equal(this_as_native, native_s2);
			bool ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			Marshal.FreeHGlobal (native_s2);
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_id_str_is_equal_to_str(IntPtr raw, IntPtr s2);

		public bool IsEqualToStr(string s2) {
			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 native_s2 = GLib.Marshaller.StringToPtrGStrdup (s2);
			bool raw_ret = gst_id_str_is_equal_to_str(this_as_native, native_s2);
			bool ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			GLib.Marshaller.Free (native_s2);
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_id_str_is_equal_to_str_with_len(IntPtr raw, IntPtr s2, UIntPtr len);

		public bool IsEqualToStrWithLen(string s2) {
			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 native_s2 = GLib.Marshaller.StringToPtrGStrdup (s2);
			bool raw_ret = gst_id_str_is_equal_to_str_with_len(this_as_native, native_s2, new UIntPtr ((ulong) System.Text.Encoding.UTF8.GetByteCount (s2)));
			bool ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			GLib.Marshaller.Free (native_s2);
			return ret;
		}

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

		public void Move(Gst.IdStr s) {
			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 native_s = GLib.Marshaller.StructureToPtrAlloc (s);
			gst_id_str_move(this_as_native, native_s);
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			Marshal.FreeHGlobal (native_s);
		}

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

		public void Set(string value) {
			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 native_value = GLib.Marshaller.StringToPtrGStrdup (value);
			gst_id_str_set(this_as_native, native_value);
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			GLib.Marshaller.Free (native_value);
		}

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

		public string StaticStr { 
			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);
				IntPtr native_value = GLib.Marshaller.StringToPtrGStrdup (value);
				gst_id_str_set_static_str(this_as_native, native_value);
				ReadNative (this_as_native, ref this);
				System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
				GLib.Marshaller.Free (native_value);
			}
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_id_str_set_static_str_with_len(IntPtr raw, IntPtr value, UIntPtr len);

		public string StaticStrWithLen { 
			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);
				IntPtr native_value = GLib.Marshaller.StringToPtrGStrdup (value);
				gst_id_str_set_static_str_with_len(this_as_native, native_value, new UIntPtr ((ulong) System.Text.Encoding.UTF8.GetByteCount (value)));
				ReadNative (this_as_native, ref this);
				System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
				GLib.Marshaller.Free (native_value);
			}
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_id_str_set_with_len(IntPtr raw, IntPtr value, UIntPtr len);

		public string WithLen { 
			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);
				IntPtr native_value = GLib.Marshaller.StringToPtrGStrdup (value);
				gst_id_str_set_with_len(this_as_native, native_value, new UIntPtr ((ulong) System.Text.Encoding.UTF8.GetByteCount (value)));
				ReadNative (this_as_native, ref this);
				System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
				GLib.Marshaller.Free (native_value);
			}
		}

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

		public bool Equals (IdStr other)
		{
			return true && _pointer.Equals (other._pointer);
		}

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

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

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

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