mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-23 10:55:30 +00:00
1f4ff5bb86
* glib/EnumWrapper.cs: New class which holds an enum int. * glib/Value.cs: Add support for glib enum types. We needed to use EnumWrapper for this because otherwise the int operator wouldn't know which glib function to use. * generator/BoxedGen.cs, ClassBase.cs, Ctor.cs, EnumGen.cs, InterfaceGen.cs, Method.cs, ObjectGen.cs, Signal.cs, StructGen.cs: Create more doc stubs. * generator/Property.cs: Generate enum values correctly. * generator/Ctor.cs: Refactor generation to honor metadata-specified collision preference. * parser/Gtk.metadata: Added constructor collision preferences to all known clashes. * parse/Gdk.metadata: Added (for Pixbuf clashes). svn path=/trunk/gtk-sharp/; revision=5437
27 lines
473 B
C#
27 lines
473 B
C#
// EnumWrapper.cs - Class to hold arbitrary glib enums
|
|
//
|
|
// Author: Rachel Hestilow <hestilow@ximian.com>
|
|
//
|
|
// (c) 2002 Rachel Hestilow
|
|
|
|
namespace GLib {
|
|
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
// <summary> Enum wrapping class </summary>
|
|
// <remarks> </remarks>
|
|
public class EnumWrapper {
|
|
int val;
|
|
|
|
public EnumWrapper (int val) {
|
|
this.val = val;
|
|
}
|
|
|
|
public static explicit operator int (EnumWrapper wrap) {
|
|
return wrap.val;
|
|
}
|
|
}
|
|
}
|
|
|