2009-01-05 Andrés G. Aragoneses <aaragoneses@novell.com>

* GType.cs: convert GType.Is to a non-static function.
        * Value.cs: track API.
        [Last cosmetic bit from #448009]


svn path=/trunk/gtk-sharp/; revision=122505
This commit is contained in:
Andrés G. Aragoneses 2009-01-06 03:36:56 +00:00
parent f5e7bbb7b0
commit 1f40330573
3 changed files with 18 additions and 12 deletions

View File

@ -1,3 +1,9 @@
2009-01-05 Andrés G. Aragoneses <aaragoneses@novell.com>
* GType.cs: convert GType.Is to a non-static function.
* Value.cs: track API.
[Last cosmetic bit from #448009]
2009-01-05 Stephane Delcroix <sdelcroix@novell.com> 2009-01-05 Stephane Delcroix <sdelcroix@novell.com>
* bootstrap-2.14: * bootstrap-2.14:

View File

@ -334,14 +334,14 @@ namespace GLib {
return Marshal.ReadIntPtr (klass); return Marshal.ReadIntPtr (klass);
} }
internal static bool Is (IntPtr type, GType is_a_type) internal bool IsA (IntPtr type)
{ {
return g_type_is_a (type, is_a_type.Val); return g_type_is_a (type, Val);
} }
public bool IsInstance (IntPtr raw) public bool IsInstance (IntPtr raw)
{ {
return GType.Is (ValFromInstancePtr (raw), this); return IsA (ValFromInstancePtr (raw));
} }
[DllImport("libgobject-2.0-0.dll")] [DllImport("libgobject-2.0-0.dll")]

View File

@ -351,8 +351,8 @@ namespace GLib {
return (long) this; return (long) this;
else if (type == GType.UInt64.Val) else if (type == GType.UInt64.Val)
return (ulong) this; return (ulong) this;
else if (GType.Is (type, GType.Enum) || else if (GType.Enum.IsA (type) ||
GType.Is (type, GType.Flags)) GType.Flags.IsA (type))
return (Enum) this; return (Enum) this;
else if (type == GType.Float.Val) else if (type == GType.Float.Val)
return (float) this; return (float) this;
@ -366,9 +366,9 @@ namespace GLib {
return g_value_get_param (ref this); return g_value_get_param (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.Object.IsA (type))
return (GLib.Object) this; return (GLib.Object) this;
else if (GType.Is (type, GType.Boxed)) else if (GType.Boxed.IsA (type))
return ToBoxed (); return ToBoxed ();
else if (type == IntPtr.Zero) else if (type == IntPtr.Zero)
return null; return null;
@ -390,9 +390,9 @@ namespace GLib {
g_value_set_int64 (ref this, (long) value); g_value_set_int64 (ref this, (long) value);
else if (type == GType.UInt64.Val) else if (type == GType.UInt64.Val)
g_value_set_uint64 (ref this, (ulong) value); g_value_set_uint64 (ref this, (ulong) value);
else if (GType.Is (type, GType.Enum)) else if (GType.Enum.IsA (type))
g_value_set_enum (ref this, (int)value); g_value_set_enum (ref this, (int)value);
else if (GType.Is (type, GType.Flags)) else if (GType.Flags.IsA (type))
g_value_set_flags (ref this, (uint)(int)value); g_value_set_flags (ref this, (uint)(int)value);
else if (type == GType.Float.Val) else if (type == GType.Float.Val)
g_value_set_float (ref this, (float) value); g_value_set_float (ref this, (float) value);
@ -419,12 +419,12 @@ namespace GLib {
IntPtr wrapper = ManagedValue.WrapObject (value); IntPtr wrapper = ManagedValue.WrapObject (value);
g_value_set_boxed (ref this, wrapper); g_value_set_boxed (ref this, wrapper);
ManagedValue.ReleaseWrapper (wrapper); ManagedValue.ReleaseWrapper (wrapper);
} else if (GType.Is (type, GType.Object)) } else if (GType.Object.IsA (type))
if(value is GLib.Object) if(value is GLib.Object)
g_value_set_object (ref this, (value as GLib.Object).Handle); g_value_set_object (ref this, (value as GLib.Object).Handle);
else else
g_value_set_object (ref this, (value as GLib.GInterfaceAdapter).Handle); g_value_set_object (ref this, (value as GLib.GInterfaceAdapter).Handle);
else if (GType.Is (type, GType.Boxed)) { else if (GType.Boxed.IsA (type)) {
if (value is IWrapper) { if (value is IWrapper) {
g_value_set_boxed (ref this, ((IWrapper)value).Handle); g_value_set_boxed (ref this, ((IWrapper)value).Handle);
return; return;
@ -439,7 +439,7 @@ namespace GLib {
internal void Update (object val) internal void Update (object val)
{ {
if (GType.Is (type, GType.Boxed) && !(val is IWrapper)) if (GType.Boxed.IsA (type) && !(val is IWrapper))
Marshal.StructureToPtr (val, g_value_get_boxed (ref this), false); Marshal.StructureToPtr (val, g_value_get_boxed (ref this), false);
} }