2009-05-06 Mike Kestner <mkestner@novell.com>

* generator/ReturnValue.cs: null-term array marshaling for vms.
	* generator/VirtualMethod.cs: use ToNative return type in native 
	callbacks.
	[Fixes #501294] Patch by Sebastian Dröge.

svn path=/trunk/gtk-sharp/; revision=133670
This commit is contained in:
Mike Kestner 2009-05-06 16:20:35 +00:00
parent 8c8138e17e
commit 2d8692338d
3 changed files with 11 additions and 6 deletions

View file

@ -1,3 +1,10 @@
2009-05-06 Mike Kestner <mkestner@novell.com>
* generator/ReturnValue.cs: null-term array marshaling for vms.
* generator/VirtualMethod.cs: use ToNative return type in native
callbacks.
[Fixes #501294] Patch by Sebastian Dröge.
2009-05-06 Mike Kestner <mkestner@novell.com>
* generator/FieldBase.cs: mangle compound typenames for glue.

View file

@ -110,9 +110,7 @@ namespace GtkSharp.Generation {
get {
if (IGen == null)
return String.Empty;
else if (is_null_term)
return "IntPtr"; //FIXME
return IGen.ToNativeReturnType + (is_array ? "[]" : String.Empty);
return IGen.ToNativeReturnType + (is_array || is_null_term ? "[]" : String.Empty);
}
}
@ -144,7 +142,7 @@ namespace GtkSharp.Generation {
string args = ", typeof (" + ElementType + "), " + (owned ? "true" : "false") + ", " + (elements_owned ? "true" : "false");
var = "new " + IGen.QualifiedName + "(" + var + args + ")";
} else if (is_null_term)
return String.Format ("GLib.Marshaller.StringArrayToNullTermPtr ({0})", var);
return String.Format ("GLib.Marshaller.StringArrayToNullTermPointer ({0})", var);
if (IGen is IManualMarshaler)
return (IGen as IManualMarshaler).AllocNative (var);

View file

@ -74,9 +74,9 @@ namespace GtkSharp.Generation {
native_signature += parms.ImportSignature;
sw.WriteLine ("\t\t[GLib.CDeclCallback]");
sw.WriteLine ("\t\tdelegate {0} {1}NativeDelegate ({2});", retval.MarshalType, this.Name, native_signature);
sw.WriteLine ("\t\tdelegate {0} {1}NativeDelegate ({2});", retval.ToNativeType, this.Name, native_signature);
sw.WriteLine ();
sw.WriteLine ("\t\tstatic {0} {1}_cb ({2})", retval.MarshalType, this.Name, native_signature);
sw.WriteLine ("\t\tstatic {0} {1}_cb ({2})", retval.ToNativeType, this.Name, native_signature);
sw.WriteLine ("\t\t{");
string unconditional = call.Unconditional ("\t\t\t");
if (unconditional.Length > 0)