Support gulong and glong GValues

Fixes bug #595377.
This commit is contained in:
Sebastian Dröge 2009-09-17 06:43:05 +02:00
parent fcaff7062a
commit 405ff9c849

View file

@ -440,6 +440,10 @@ namespace Gst.GLib {
return (long) this;
else if (type == GType.UInt64.Val)
return (ulong) this;
else if (type == GType.Long.Val)
return g_value_get_long (ref this).ToInt64 ();
else if (type == GType.ULong.Val)
return g_value_get_ulong (ref this).ToUInt64 ();
else if (GType.Is (type, GType.Enum) ||
GType.Is (type, GType.Flags))
return ToEnum ();
@ -483,6 +487,10 @@ namespace Gst.GLib {
g_value_set_int64 (ref this, (long) value);
else if (type == GType.UInt64.Val)
g_value_set_uint64 (ref this, (ulong) value);
else if (type == GType.Long.Val)
g_value_set_long (ref this, new IntPtr (((IConvertible)value).ToInt64 (null)));
else if (type == GType.ULong.Val)
g_value_set_ulong (ref this, new UIntPtr (((IConvertible)value).ToUInt64 (null)));
else if (GType.Is (type, GType.Enum))
g_value_set_enum (ref this, (int)value);
else if (GType.Is (type, GType.Flags))
@ -602,6 +610,12 @@ namespace Gst.GLib {
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void g_value_set_uint64 (ref Value val, ulong data);
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void g_value_set_long (ref Value val, IntPtr data);
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void g_value_set_ulong (ref Value val, UIntPtr data);
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void g_value_set_object (ref Value val, IntPtr data);
@ -649,6 +663,12 @@ namespace Gst.GLib {
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern ulong g_value_get_uint64 (ref Value val);
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_value_get_long (ref Value val);
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern UIntPtr g_value_get_ulong (ref Value val);
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_value_get_object (ref Value val);