Ryujinx-GtkSharp/glib/Mutex.cs
Stephan Sundermann 9abde602ec glib: add GDate, GDateTime
Add GDate and GDateTime classes to glib, and map
them in the generator's SymbolTable.

(The types TimeZone and TimeVal are also added because
the Date* types depend on them, but there is no need
to map them in the generator.)

Also move the TODOs of other auto-generated classes
to a single TODO in the Makefile
2013-10-09 18:30:10 +02:00

109 lines
3.8 KiB
C#

// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.
namespace GLib {
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
#region Autogenerated code
[StructLayout(LayoutKind.Explicit)]
public partial struct Mutex : IEquatable<Mutex> {
[FieldOffset(0)]
private IntPtr _p;
[FieldOffset(0)]
[MarshalAs (UnmanagedType.ByValArray, SizeConst=2)]
public uint[] I;
public static GLib.Mutex Zero = new GLib.Mutex ();
public static GLib.Mutex New(IntPtr raw) {
if (raw == IntPtr.Zero)
return GLib.Mutex.Zero;
return (GLib.Mutex) Marshal.PtrToStructure (raw, typeof (GLib.Mutex));
}
[DllImport("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void g_mutex_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);
g_mutex_clear(this_as_native);
ReadNative (this_as_native, ref this);
System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
}
[DllImport("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void g_mutex_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);
g_mutex_init(this_as_native);
ReadNative (this_as_native, ref this);
System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
}
[DllImport("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void g_mutex_lock(IntPtr raw);
public void Lock() {
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);
g_mutex_lock(this_as_native);
ReadNative (this_as_native, ref this);
System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
}
[DllImport("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern bool g_mutex_trylock(IntPtr raw);
public bool Trylock() {
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);
bool raw_ret = g_mutex_trylock(this_as_native);
bool ret = raw_ret;
ReadNative (this_as_native, ref this);
System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
return ret;
}
[DllImport("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void g_mutex_unlock(IntPtr raw);
public void Unlock() {
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);
g_mutex_unlock(this_as_native);
ReadNative (this_as_native, ref this);
System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
}
static void ReadNative (IntPtr native, ref GLib.Mutex target)
{
target = New (native);
}
public bool Equals (Mutex other)
{
return true && _p.Equals (other._p) && I.Equals (other.I);
}
public override bool Equals (object other)
{
return other is Mutex && Equals ((Mutex) other);
}
public override int GetHashCode ()
{
return this.GetType().FullName.GetHashCode() ^ _p.GetHashCode () ^ I.GetHashCode ();
}
#endregion
}
}