2004-12-03 Jorge Garcia <jgarcia@ac.upc.es>
* glib/Type.cs: add Int64 and UInt64 support. * glib/TypeConverter.cs: add Int64 and UInt64 support. * glib/Value.cs: add Int64 and UInt64 support. svn path=/trunk/gtk-sharp/; revision=37049
This commit is contained in:
parent
5f9a153c7f
commit
3d6cb09562
4 changed files with 55 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
2004-12-03 Jorge Garcia <jgarcia@ac.upc.es>
|
||||
|
||||
* glib/Type.cs: add Int64 and UInt64 support.
|
||||
* glib/TypeConverter.cs: add Int64 and UInt64 support.
|
||||
* glib/Value.cs: add Int64 and UInt64 support.
|
||||
|
||||
2004-12-03 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* gtk/Dialog.custom : correct return value for AddButton overload.
|
||||
|
|
|
@ -39,6 +39,9 @@ namespace GLib {
|
|||
public static readonly GType String = new GType ((IntPtr) TypeFundamentals.TypeString);
|
||||
public static readonly GType Boolean = new GType ((IntPtr) TypeFundamentals.TypeBoolean);
|
||||
public static readonly GType Int = new GType ((IntPtr) TypeFundamentals.TypeInt);
|
||||
public static readonly GType Int64 = new GType ((IntPtr) TypeFundamentals.TypeInt64);
|
||||
public static readonly GType UInt64 = new GType ((IntPtr) TypeFundamentals.TypeUInt64);
|
||||
|
||||
public static readonly GType Double = new GType ((IntPtr) TypeFundamentals.TypeDouble);
|
||||
public static readonly GType Float = new GType ((IntPtr) TypeFundamentals.TypeFloat);
|
||||
public static readonly GType Char = new GType ((IntPtr) TypeFundamentals.TypeChar);
|
||||
|
|
|
@ -36,6 +36,10 @@ namespace GLib {
|
|||
return GType.Boolean;
|
||||
if (type.Equals (typeof (int)))
|
||||
return GType.Int;
|
||||
if (type.Equals (typeof (long)))
|
||||
return GType.Int64;
|
||||
if (type.Equals (typeof (ulong)))
|
||||
return GType.UInt64;
|
||||
if (type.Equals (typeof (double)))
|
||||
return GType.Double;
|
||||
if (type.Equals (typeof (float)))
|
||||
|
|
|
@ -126,6 +126,23 @@ namespace GLib {
|
|||
g_value_set_int (ref this, val);
|
||||
}
|
||||
|
||||
[DllImport("libgobject-2.0-0.dll")]
|
||||
static extern void g_value_set_int64 (ref Value val, long data);
|
||||
|
||||
public Value (long val) : this (GType.Int64)
|
||||
{
|
||||
g_value_set_int64 (ref this, val);
|
||||
}
|
||||
|
||||
[DllImport("libgobject-2.0-0.dll")]
|
||||
static extern void g_value_set_uint64 (ref Value val, ulong data);
|
||||
|
||||
public Value (ulong val) : this (GType.UInt64)
|
||||
{
|
||||
g_value_set_uint64 (ref this, val);
|
||||
}
|
||||
|
||||
|
||||
[DllImport("libgobject-2.0-0.dll")]
|
||||
static extern void g_value_set_object (ref Value val, IntPtr data);
|
||||
|
||||
|
@ -253,6 +270,23 @@ namespace GLib {
|
|||
return g_value_get_int (ref val);
|
||||
}
|
||||
|
||||
[DllImport("libgobject-2.0-0.dll")]
|
||||
static extern long g_value_get_int64 (ref Value val);
|
||||
|
||||
public static explicit operator long (Value val)
|
||||
{
|
||||
return g_value_get_int64 (ref val);
|
||||
}
|
||||
|
||||
[DllImport("libgobject-2.0-0.dll")]
|
||||
static extern ulong g_value_get_uint64 (ref Value val);
|
||||
|
||||
public static explicit operator ulong (Value val)
|
||||
{
|
||||
return g_value_get_uint64 (ref val);
|
||||
}
|
||||
|
||||
|
||||
[DllImport("libgobject-2.0-0.dll")]
|
||||
static extern IntPtr g_value_get_object (ref Value val);
|
||||
|
||||
|
@ -334,6 +368,10 @@ namespace GLib {
|
|||
return (bool) this;
|
||||
else if (type == GType.Int)
|
||||
return (int) this;
|
||||
else if (type == GType.Int64)
|
||||
return (long) this;
|
||||
else if (type == GType.UInt64)
|
||||
return (ulong) this;
|
||||
else if (type == GType.Double)
|
||||
return (double) this;
|
||||
else if (type == GType.Float)
|
||||
|
@ -358,6 +396,10 @@ namespace GLib {
|
|||
g_value_set_boolean (ref this, (bool) value);
|
||||
else if (type == GType.Int)
|
||||
g_value_set_int (ref this, (int) value);
|
||||
else if (type == GType.Int64)
|
||||
g_value_set_int64 (ref this, (long) value);
|
||||
else if (type == GType.UInt64)
|
||||
g_value_set_uint64 (ref this, (ulong) value);
|
||||
else if (type == GType.Double)
|
||||
g_value_set_double (ref this, (double) value);
|
||||
else if (type == GType.Float)
|
||||
|
|
Loading…
Reference in a new issue