diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-09-17 06:43:05 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-09-17 06:43:05 +0200 |
commit | 405ff9c84950e41f379f154d5dbce4df96fc3cbd (patch) | |
tree | 9746234192f186ee64b623dc7f15ab7542582c3c | |
parent | fcaff7062a53ff2eedc1140824f015de3da44b94 (diff) |
Support gulong and glong GValues
Fixes bug #595377.
-rwxr-xr-x | gstreamer-sharp/glib-sharp/Value.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gstreamer-sharp/glib-sharp/Value.cs b/gstreamer-sharp/glib-sharp/Value.cs index daf9b5c..8d24814 100755 --- a/gstreamer-sharp/glib-sharp/Value.cs +++ b/gstreamer-sharp/glib-sharp/Value.cs @@ -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)) @@ -603,6 +611,12 @@ namespace Gst.GLib { 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); [DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] @@ -650,6 +664,12 @@ namespace Gst.GLib { 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); [DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] |