2004-05-17 Mike Kestner <mkestner@ximian.com>

* generator/SignalHandler.cs : fix some broken/redundant generation in
	the Object/Struct wrapping for sig params.
	* glib/Object.cs : internalize/protect lots of API that shouldn't need
	to be used by non-subclass/non-glib code. Return GType.Object as GType.
	* glib/Value.cs : use internal GLib.Object.NativeType prop.
	* sample/TestDnd.cs : use ToString instead of TypeName.

svn path=/trunk/gtk-sharp/; revision=27530
This commit is contained in:
Mike Kestner 2004-05-17 17:52:00 +00:00
parent bcb922a320
commit ffe268c415
5 changed files with 20 additions and 18 deletions

View file

@ -1,3 +1,12 @@
2004-05-17 Mike Kestner <mkestner@ximian.com>
* generator/SignalHandler.cs : fix some broken/redundant generation in
the Object/Struct wrapping for sig params.
* glib/Object.cs : internalize/protect lots of API that shouldn't need
to be used by non-subclass/non-glib code. Return GType.Object as GType.
* glib/Value.cs : use internal GLib.Object.NativeType prop.
* sample/TestDnd.cs : use ToString instead of TypeName.
2004-05-14 Todd Berman <tberman@sevenl.net>
* glib/Object.cs: make static GLib.Object.LookupGType protected for now.

View file

@ -146,14 +146,7 @@ namespace GtkSharp.Generation {
sw.WriteLine("\t\t\tif (arg{0} == IntPtr.Zero)", idx);
sw.WriteLine("\t\t\t\targs.Args[{0}] = null;", idx - 1);
sw.WriteLine("\t\t\telse {");
if (wrapper != null && wrapper is ObjectGen)
sw.WriteLine("\t\t\t\targs.Args[" + (idx-1) + "] = GLib.Object.GetObject(arg" + idx + ", false);");
else
sw.WriteLine("\t\t\t\targs.Args[" + (idx-1) + "] = " + table.FromNative (ctype, "arg" + idx) + ";");
if ((wrapper != null && (wrapper is OpaqueGen)) || table.IsManuallyWrapped (ctype)) {
sw.WriteLine("\t\t\t\tif (args.Args[" + (idx-1) + "] == null)");
sw.WriteLine("\t\t\t\t\targs.Args[{0}] = new {1}(arg{2});", idx-1, table.GetCSType (ctype), idx);
}
sw.WriteLine("\t\t\t}");
} else {
sw.WriteLine("\t\t\targs.Args[" + (idx-1) + "] = " + table.FromNative (ctype, "arg" + idx) + ";");

View file

@ -125,7 +125,7 @@ namespace GLib {
[DllImport("glibsharpglue")]
static extern IntPtr gtksharp_register_type (string name, IntPtr parent_type);
public static GType RegisterGType (System.Type t)
protected static GType RegisterGType (System.Type t)
{
GType parent_gtype = LookupGType (t.BaseType);
string name = t.FullName.Replace(".", "_");
@ -139,7 +139,7 @@ namespace GLib {
static Hashtable g_types = new Hashtable ();
public GType LookupGType ()
protected GType LookupGType ()
{
return LookupGType (GetType ());
}
@ -156,7 +156,7 @@ namespace GLib {
return RegisterGType (t);
}
public Object (IntPtr raw)
protected Object (IntPtr raw)
{
Raw = raw;
}
@ -190,22 +190,22 @@ namespace GLib {
[DllImport("glibsharpglue")]
private static extern IntPtr gtksharp_get_type_id (IntPtr obj);
public static GLib.GType GType {
protected static GLib.GType GType {
get {
return GType.Invalid;
return GType.Object;
}
}
[DllImport("glibsharpglue")]
static extern IntPtr gtksharp_get_type_name (IntPtr raw);
public string TypeName {
protected string TypeName {
get {
return Marshal.PtrToStringAnsi (gtksharp_get_type_name (Raw));
}
}
public GLib.GType NativeType {
internal GLib.GType NativeType {
get {
if (_obj == IntPtr.Zero)
return GType.Invalid;
@ -310,7 +310,7 @@ namespace GLib {
[DllImport("glibsharpglue")]
static extern int gtksharp_object_get_ref_count (IntPtr obj);
public int RefCount {
protected int RefCount {
get {
return gtksharp_object_get_ref_count (Handle);
}

View file

@ -162,7 +162,7 @@ namespace GLib {
{
type = IntPtr.Zero;
pad_1 = pad_2 = 0;
gtksharp_value_create_from_type_and_property (ref this, obj.LookupGType ().Val, prop_name);
gtksharp_value_create_from_type_and_property (ref this, obj.NativeType.Val, prop_name);
if (wrap.flags)
g_value_set_flags (ref this, (uint) (int) wrap);
else

View file

@ -302,7 +302,7 @@ public class TestDnd {
}
Widget source_widget = Gtk.Drag.GetSourceWidget (args.Context);
Console.WriteLine ("motion, source {0}", source_widget == null ? "null" : source_widget.TypeName);
Console.WriteLine ("motion, source {0}", source_widget == null ? "null" : source_widget.ToString ());
Atom [] targets = args.Context.Targets;
foreach (Atom a in targets)