mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-09 00:13:20 +02:00
2009-05-13 Sebastian Dröge <sebastian.droege@collabora.co.uk>
* glib/Value.cs: Add support for ValueArrays inside GLib.Values. * glib/ValueArray.cs: Add GType property to get the ValueArray GType. [Fixes #503048] svn path=/trunk/gtk-sharp/; revision=134073
This commit is contained in:
parent
bccd244a70
commit
a979e2211b
@ -1,3 +1,9 @@
|
|||||||
|
2009-05-13 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||||
|
|
||||||
|
* glib/Value.cs: Add support for ValueArrays inside GLib.Values.
|
||||||
|
* glib/ValueArray.cs: Add GType property to get the ValueArray GType.
|
||||||
|
[Fixes #503048]
|
||||||
|
|
||||||
2009-05-12 Mike Kestner <mkestner@novell.com>
|
2009-05-12 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
* glib/Value.cs: explicit exception for unknown props.
|
* glib/Value.cs: explicit exception for unknown props.
|
||||||
|
@ -138,6 +138,11 @@ namespace GLib {
|
|||||||
GLib.Marshaller.Free (native_val);
|
GLib.Marshaller.Free (native_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Value (ValueArray val) : this (ValueArray.GType)
|
||||||
|
{
|
||||||
|
g_value_set_boxed (ref this, val.Handle);
|
||||||
|
}
|
||||||
|
|
||||||
public Value (IntPtr val) : this (GType.Pointer)
|
public Value (IntPtr val) : this (GType.Pointer)
|
||||||
{
|
{
|
||||||
g_value_set_pointer (ref this, val);
|
g_value_set_pointer (ref this, val);
|
||||||
@ -297,6 +302,11 @@ namespace GLib {
|
|||||||
return str == IntPtr.Zero ? null : GLib.Marshaller.Utf8PtrToString (str);
|
return str == IntPtr.Zero ? null : GLib.Marshaller.Utf8PtrToString (str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static explicit operator ValueArray (Value val)
|
||||||
|
{
|
||||||
|
return new ValueArray (g_value_get_boxed (ref val));
|
||||||
|
}
|
||||||
|
|
||||||
public static explicit operator IntPtr (Value val)
|
public static explicit operator IntPtr (Value val)
|
||||||
{
|
{
|
||||||
return g_value_get_pointer (ref val);
|
return g_value_get_pointer (ref val);
|
||||||
@ -429,6 +439,8 @@ namespace GLib {
|
|||||||
return (IntPtr) this;
|
return (IntPtr) this;
|
||||||
else if (type == GType.Param.Val)
|
else if (type == GType.Param.Val)
|
||||||
return g_value_get_param (ref this);
|
return g_value_get_param (ref this);
|
||||||
|
else if (type == ValueArray.GType.Val)
|
||||||
|
return new ValueArray (g_value_get_boxed (ref this));
|
||||||
else if (type == ManagedValue.GType.Val)
|
else if (type == ManagedValue.GType.Val)
|
||||||
return ManagedValue.ObjectForWrapper (g_value_get_boxed (ref this));
|
return ManagedValue.ObjectForWrapper (g_value_get_boxed (ref this));
|
||||||
else if (GType.Is (type, GType.Object))
|
else if (GType.Is (type, GType.Object))
|
||||||
@ -482,6 +494,8 @@ namespace GLib {
|
|||||||
g_value_set_pointer (ref this, buf);
|
g_value_set_pointer (ref this, buf);
|
||||||
} else if (type == GType.Param.Val) {
|
} else if (type == GType.Param.Val) {
|
||||||
g_value_set_param (ref this, (IntPtr) value);
|
g_value_set_param (ref this, (IntPtr) value);
|
||||||
|
} else if (type == ValueArray.GType.Val) {
|
||||||
|
g_value_set_boxed (ref this, ((ValueArray) value).Handle);
|
||||||
} else if (type == ManagedValue.GType.Val) {
|
} else if (type == ManagedValue.GType.Val) {
|
||||||
IntPtr wrapper = ManagedValue.WrapObject (value);
|
IntPtr wrapper = ManagedValue.WrapObject (value);
|
||||||
g_value_set_boxed (ref this, wrapper);
|
g_value_set_boxed (ref this, wrapper);
|
||||||
|
@ -235,5 +235,14 @@ namespace GLib {
|
|||||||
{
|
{
|
||||||
return new ValueArray (g_value_array_copy (Handle));
|
return new ValueArray (g_value_array_copy (Handle));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DllImport ("libgobject-2.0-0.dll")]
|
||||||
|
static extern IntPtr g_value_array_get_type ();
|
||||||
|
|
||||||
|
public static GLib.GType GType {
|
||||||
|
get {
|
||||||
|
return new GLib.GType (g_value_array_get_type ());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user