2005-01-28 Mike Kestner <mkestner@novell.com>
* generator/ReturnValue.cs : use ToNativeReturnType for ToNativeType instead of MarshalType. * generator/Signal.cs : deal with boxed return values. beef up return handling in the default handler generation code. * generator/SignalHandler.cs : use ToNative return types for native callbacks. Remove redundant casting/conversion in callback impl. [Fixes #71899] svn path=/trunk/gtk-sharp/; revision=39724
This commit is contained in:
parent
de70fff09f
commit
8364dd2be1
4 changed files with 19 additions and 7 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,11 +1,19 @@
|
|||
2005-01-28 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* generator/ReturnValue.cs : use ToNativeReturnType for ToNativeType
|
||||
instead of MarshalType.
|
||||
* generator/Signal.cs : deal with boxed return values. beef up return
|
||||
handling in the default handler generation code.
|
||||
* generator/SignalHandler.cs : use ToNative return types for native
|
||||
callbacks. Remove redundant casting/conversion in callback impl.
|
||||
[Fixes #71899]
|
||||
|
||||
2005-01-28 Dan Winship <danw@novell.com>
|
||||
|
||||
* glib/Object.cs (AddNotification, RemoveNotification): methods to
|
||||
subscribe to the "notify" signal (with property details). [#71684]
|
||||
|
||||
* glib/GLibSharp.voidObjectIntPtrSignal.cs: autogenerated, for
|
||||
notifications
|
||||
|
||||
* glib/NotifyHandler.cs: sort of autogenerated
|
||||
|
||||
2005-01-28 Mike Kestner <mkestner@novell.com>
|
||||
|
|
|
@ -71,7 +71,7 @@ namespace GtkSharp.Generation {
|
|||
|
||||
public string ToNativeType {
|
||||
get {
|
||||
return SymbolTable.Table.GetMarshalType (CType) + (IsArray ? "[]" : String.Empty);
|
||||
return SymbolTable.Table.GetToNativeReturnType (CType) + (IsArray ? "[]" : String.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -130,6 +130,8 @@ namespace GtkSharp.Generation {
|
|||
|
||||
if (igen is ObjectGen)
|
||||
return "GLib.GType.Object";
|
||||
if (igen is BoxedGen)
|
||||
return retval.CSType + ".GType";
|
||||
|
||||
switch (retval.CSType) {
|
||||
case "bool":
|
||||
|
@ -237,9 +239,11 @@ namespace GtkSharp.Generation {
|
|||
sw.WriteLine ("\t\t{");
|
||||
sw.WriteLine ("\t\t\t{0} obj = GLib.Object.GetObject ({1}, false) as {0};", implementor != null ? implementor.Name : container_type.Name, parms[0].Name);
|
||||
sw.Write (call.Setup ("\t\t\t"));
|
||||
sw.Write ("\t\t\t{0}", IsVoid ? "" : "return ");
|
||||
sw.Write ("\t\t\t{0}", IsVoid ? "" : retval.CSType == retval.ToNativeType ? "return " : retval.CSType + " raw_ret = ");
|
||||
sw.WriteLine ("obj.{0} ({1});", "On" + Name, call.ToString ());
|
||||
sw.Write (call.Finish ("\t\t\t"));
|
||||
if (!IsVoid && retval.CSType != retval.ToNativeType)
|
||||
sw.WriteLine ("\t\t\treturn {0};", SymbolTable.Table.ToNativeReturn (retval.CType, "raw_ret"));
|
||||
sw.WriteLine ("\t\t}\n");
|
||||
string cname = "\"" + elem.GetAttribute("cname") + "\"";
|
||||
sw.WriteLine ("\t\tprivate static void Override" + Name + " (GLib.GType gtype)");
|
||||
|
|
|
@ -120,14 +120,14 @@ namespace GtkSharp.Generation {
|
|||
sw.WriteLine("\tusing System;");
|
||||
sw.WriteLine("\tusing System.Runtime.InteropServices;");
|
||||
sw.WriteLine();
|
||||
sw.Write("\tinternal delegate " + retval.MarshalType + " ");
|
||||
sw.Write("\tinternal delegate " + retval.ToNativeType + " ");
|
||||
sw.WriteLine(DelegateName + "(" + ISig + ", int key);");
|
||||
sw.WriteLine();
|
||||
sw.WriteLine("\tinternal class " + Name + " : GLib.SignalCallback {");
|
||||
sw.WriteLine();
|
||||
sw.WriteLine("\t\tprivate static " + DelegateName + " _Delegate;");
|
||||
sw.WriteLine();
|
||||
sw.Write("\t\tprivate static " + retval.MarshalType + " ");
|
||||
sw.Write("\t\tprivate static " + retval.ToNativeType + " ");
|
||||
sw.WriteLine(CallbackName + "(" + ISig + ", int key)");
|
||||
sw.WriteLine("\t\t{");
|
||||
sw.WriteLine("\t\t\tif (!_Instances.Contains(key))");
|
||||
|
@ -179,7 +179,7 @@ namespace GtkSharp.Generation {
|
|||
else
|
||||
sw.WriteLine ("\t\t\t\tthrow new Exception(\"args.RetVal unset in callback\");");
|
||||
|
||||
sw.WriteLine("\t\t\treturn (" + retval.MarshalType + ") " + table.ToNativeReturn (retval.CType, "((" + retval.CSType + ")args.RetVal)") + ";");
|
||||
sw.WriteLine("\t\t\treturn " + table.ToNativeReturn (retval.CType, "((" + retval.CSType + ")args.RetVal)") + ";");
|
||||
}
|
||||
sw.WriteLine("\t\t}");
|
||||
sw.WriteLine();
|
||||
|
|
Loading…
Reference in a new issue