mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-09 00:13:20 +02:00
![Rachel Hestilow](/assets/img/avatar_default.png)
* glib/GException.cs: Added. * generator/Ctor.cs, Method.cs: Tag function as unsafe if it throws an exception. Call parms.HandleException. * generator/Paramaters.cs: Add property ThrowsException (based on a trailing GError**). If ThrowsException, mask GError in the signature, initialize a GError in Initialize, and add new method HandleException to throw an exception if error != null. * generator/SymbolTable.cs: Add gdk-pixbuf DLL, and GError type. * gdk.imaging, gdk.imaging/Makefile.in, gdk.imaging/makefile.win32: Added. * configure.in, Makefile, makefile.win32: Build gdk.imaging. * gtk/Makefile.in, gtk/makefile.win32: Link against gdk.imaging. * parser/gapi2xml.pl: Support namespace renaming. * parser/build.pl: Build gdk-pixbuf as gdk.imaging. svn path=/trunk/gtk-sharp/; revision=5281
41 lines
766 B
C#
41 lines
766 B
C#
// GException.cs : GError handling
|
|
//
|
|
// Authors: Rachel Hestilow <hestilow@ximian.com>
|
|
//
|
|
// (c) 2002 Rachel Hestilow
|
|
|
|
namespace GLib {
|
|
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public unsafe struct GError
|
|
{
|
|
[MarshalAs (UnmanagedType.U4)]
|
|
public uint domain;
|
|
[MarshalAs (UnmanagedType.I4)]
|
|
public int code;
|
|
[MarshalAs (UnmanagedType.LPStr)]
|
|
public string message;
|
|
}
|
|
|
|
public unsafe class GException : Exception
|
|
{
|
|
GError *errptr;
|
|
|
|
unsafe public GException (GError *errptr) : base (errptr->message)
|
|
{
|
|
this.errptr = errptr;
|
|
}
|
|
|
|
[DllImport("glib-2.0")]
|
|
unsafe static extern void g_clear_error (GError **errptr);
|
|
~GException ()
|
|
{
|
|
unsafe { g_clear_error (&errptr); }
|
|
}
|
|
}
|
|
}
|
|
|