From 95fc33f785a4539db41d2baacc780bd0fa12f101 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Mon, 24 Feb 2003 06:39:30 +0000 Subject: [PATCH] 2003-02-24 Mike Kestner * generator/ObjectGen.cs : gen GLib.Value ctor, not uint * glib/Object.cs : use GLib.Type in RegisterGType and make the g_object_new ctor use GLib.Type. * glib/Type.cs : new thin wrapper for GValue type * glib/*.cs : s/Type/System.Type svn path=/trunk/gtk-sharp/; revision=11920 --- ChangeLog | 8 ++++++++ generator/ObjectGen.cs | 2 +- glib/List.cs | 2 +- glib/ListBase.cs | 4 ++-- glib/Object.cs | 12 ++++++------ glib/SList.cs | 2 +- glib/SignalCallback.cs | 4 ++-- 7 files changed, 21 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index fbc169455..fc0b4a801 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-02-24 Mike Kestner + + * generator/ObjectGen.cs : gen GLib.Value ctor, not uint + * glib/Object.cs : use GLib.Type in RegisterGType and + make the g_object_new ctor use GLib.Type. + * glib/Type.cs : new thin wrapper for GValue type + * glib/*.cs : s/Type/System.Type + 2003-02-23 Mike Kestner * generator/GenBase.cs : quote the custom filenames in diff --git a/generator/ObjectGen.cs b/generator/ObjectGen.cs index 0f229f88e..d85a75b46 100644 --- a/generator/ObjectGen.cs +++ b/generator/ObjectGen.cs @@ -193,7 +193,7 @@ namespace GtkSharp.Generation { sw.WriteLine("\t\t\tDispose();"); sw.WriteLine("\t\t}"); sw.WriteLine(); - sw.WriteLine("\t\tprotected " + Name + "(uint gtype) : base(gtype) {}"); + sw.WriteLine("\t\tprotected " + Name + "(GLib.Type gtype) : base(gtype) {}"); sw.WriteLine("\t\tpublic " + Name + "(IntPtr raw) : base(raw) {}"); sw.WriteLine(); diff --git a/glib/List.cs b/glib/List.cs index b6d3a018b..154dffcfe 100644 --- a/glib/List.cs +++ b/glib/List.cs @@ -80,7 +80,7 @@ namespace GLib { { } - public List (IntPtr raw, Type element_type) : base (raw, element_type) + public List (IntPtr raw, System.Type element_type) : base (raw, element_type) { } } diff --git a/glib/ListBase.cs b/glib/ListBase.cs index b60dcd1e9..6f185f57c 100644 --- a/glib/ListBase.cs +++ b/glib/ListBase.cs @@ -23,7 +23,7 @@ namespace GLib { private IntPtr list_ptr = IntPtr.Zero; private int length = -1; private bool managed = false; - protected Type element_type = null; + protected System.Type element_type = null; abstract internal IntPtr GetData (IntPtr current); abstract internal IntPtr Next (IntPtr current); @@ -36,7 +36,7 @@ namespace GLib { { } - internal ListBase (IntPtr list, Type element_type) + internal ListBase (IntPtr list, System.Type element_type) { list_ptr = list; this.element_type = element_type; diff --git a/glib/Object.cs b/glib/Object.cs index 0bd4b3287..b0dd4bd04 100644 --- a/glib/Object.cs +++ b/glib/Object.cs @@ -141,18 +141,18 @@ namespace GLib { [DllImport("gtksharpglue")] static extern uint gtksharp_register_type (string name, uint parent_type); - public static uint RegisterGType (Type t) + public static GLib.Type RegisterGType (System.Type t) { - Type parent = t.BaseType; + System.Type parent = t.BaseType; PropertyInfo pi = parent.GetProperty ("GType", BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.Public); if (pi == null) { Console.WriteLine ("null PropertyInfo"); - return 0; + return null; } uint parent_gtype = (uint) pi.GetValue (null, null); string name = t.Namespace + t.Name; GtkSharp.ObjectManager.RegisterType (name, t.Namespace + t.Name, t.Assembly.GetName().Name); - return gtksharp_register_type (name, parent_gtype); + return new GLib.Type (gtksharp_register_type (name, parent_gtype)); } /// @@ -183,9 +183,9 @@ namespace GLib { [DllImport("libgobject-2.0-0.dll")] static extern IntPtr g_object_new (uint gtype, IntPtr dummy); - public Object (uint gtype) + public Object (GLib.Type gtype) { - Raw = g_object_new (gtype, IntPtr.Zero); + Raw = g_object_new (gtype.Value, IntPtr.Zero); } /// diff --git a/glib/SList.cs b/glib/SList.cs index f1d4d8c76..460a1adf8 100644 --- a/glib/SList.cs +++ b/glib/SList.cs @@ -80,7 +80,7 @@ namespace GLib { { } - public SList (IntPtr raw, Type element_type) : base (raw, element_type) + public SList (IntPtr raw, System.Type element_type) : base (raw, element_type) { } } diff --git a/glib/SignalCallback.cs b/glib/SignalCallback.cs index c54045a75..6e1b2b3f7 100644 --- a/glib/SignalCallback.cs +++ b/glib/SignalCallback.cs @@ -30,7 +30,7 @@ namespace GtkSharp { protected GLib.Object _obj; protected Delegate _handler; protected int _key; - protected Type _argstype; + protected System.Type _argstype; /// /// SignalCallback Constructor @@ -40,7 +40,7 @@ namespace GtkSharp { /// Initializes instance data. /// - public SignalCallback (GLib.Object obj, Delegate eh, Type argstype) + public SignalCallback (GLib.Object obj, Delegate eh, System.Type argstype) { _key = _NextKey++; _obj = obj;