glib: Handle GValue containing GType

This commit is contained in:
Thibault Saunier 2018-01-29 15:27:51 -03:00 committed by Harry
parent 57ea279ceb
commit dd8f3f994e

View File

@ -254,6 +254,12 @@ namespace GLib {
return g_value_get_double (ref val);
}
public static explicit operator GLib.GType (Value val)
{
return g_value_get_gtype (ref val);
}
public static explicit operator string (Value val)
{
IntPtr str = g_value_get_string (ref val);
@ -705,6 +711,9 @@ namespace GLib {
delegate float d_g_value_get_float(ref Value val);
static d_g_value_get_float g_value_get_float = FuncLoader.LoadFunction<d_g_value_get_float>(FuncLoader.GetProcAddress(GLibrary.Load(Library.GObject), "g_value_get_float"));
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
delegate IntPtr d_g_value_get_gtype(ref Value val);
static d_g_value_get_type g_value_get_gtype = FuncLoader.LoadFunction<d_g_value_get_variant>(FuncLoader.GetProcAddress(GLibrary.Load(Library.GObject), "g_value_get_gtype"));
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
delegate int d_g_value_get_int(ref Value val);
static d_g_value_get_int g_value_get_int = FuncLoader.LoadFunction<d_g_value_get_int>(FuncLoader.GetProcAddress(GLibrary.Load(Library.GObject), "g_value_get_int"));
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]