From 1f403305739f6feaaaf0a3524f0dc2937b960c9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= Date: Tue, 6 Jan 2009 03:36:56 +0000 Subject: [PATCH] =?UTF-8?q?2009-01-05=20=20Andr=C3=A9s=20G.=20Aragoneses?= =?UTF-8?q?=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- ChangeLog | 6 ++++++ glib/GType.cs | 6 +++--- glib/Value.cs | 18 +++++++++--------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 99fc51bc0..c0ebbf586 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-01-05 Andrés G. Aragoneses + + * GType.cs: convert GType.Is to a non-static function. + * Value.cs: track API. + [Last cosmetic bit from #448009] + 2009-01-05 Stephane Delcroix * bootstrap-2.14: diff --git a/glib/GType.cs b/glib/GType.cs index dcc76fed0..4daf74baf 100755 --- a/glib/GType.cs +++ b/glib/GType.cs @@ -334,14 +334,14 @@ namespace GLib { 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) { - return GType.Is (ValFromInstancePtr (raw), this); + return IsA (ValFromInstancePtr (raw)); } [DllImport("libgobject-2.0-0.dll")] diff --git a/glib/Value.cs b/glib/Value.cs index d8954b856..0f18383a2 100755 --- a/glib/Value.cs +++ b/glib/Value.cs @@ -351,8 +351,8 @@ namespace GLib { return (long) this; else if (type == GType.UInt64.Val) return (ulong) this; - else if (GType.Is (type, GType.Enum) || - GType.Is (type, GType.Flags)) + else if (GType.Enum.IsA (type) || + GType.Flags.IsA (type)) return (Enum) this; else if (type == GType.Float.Val) return (float) this; @@ -366,9 +366,9 @@ namespace GLib { return g_value_get_param (ref this); else if (type == ManagedValue.GType.Val) 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; - else if (GType.Is (type, GType.Boxed)) + else if (GType.Boxed.IsA (type)) return ToBoxed (); else if (type == IntPtr.Zero) return null; @@ -390,9 +390,9 @@ namespace 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 (GType.Is (type, GType.Enum)) + else if (GType.Enum.IsA (type)) 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); else if (type == GType.Float.Val) g_value_set_float (ref this, (float) value); @@ -419,12 +419,12 @@ namespace GLib { IntPtr wrapper = ManagedValue.WrapObject (value); g_value_set_boxed (ref this, wrapper); ManagedValue.ReleaseWrapper (wrapper); - } else if (GType.Is (type, GType.Object)) + } else if (GType.Object.IsA (type)) if(value is GLib.Object) g_value_set_object (ref this, (value as GLib.Object).Handle); else 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) { g_value_set_boxed (ref this, ((IWrapper)value).Handle); return; @@ -439,7 +439,7 @@ namespace GLib { 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); }