2007-04-28 Mike Kestner <mkestner@novell.com>

* generator/NativeCallbackSignature.cs :
	* generator/Signal.cs : don't use ref IntPtr in native callback sigs
	for struct parameters.  Use IntPtr and StructureToPtr.  Fixes the 
	layout issues in MD introduced by the structure marshaling rework.

svn path=/trunk/gtk-sharp/; revision=76433
This commit is contained in:
Mike Kestner 2007-04-28 16:42:10 +00:00
parent f89698d3b3
commit 54bc72e0a3
3 changed files with 13 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2007-04-28 Mike Kestner <mkestner@novell.com>
* generator/NativeCallbackSignature.cs :
* generator/Signal.cs : don't use ref IntPtr in native callback sigs
for struct parameters. Use IntPtr and StructureToPtr. Fixes the
layout issues in MD introduced by the structure marshaling rework.
2007-04-24 Aaron Bockover <abockover@novell.com>
* gtk/Widget.custom (StyleGetProperty): return null if

View File

@ -45,7 +45,7 @@ namespace GtkSharp.Generation {
parms [i] = "";
if (p.CType == "GError**")
parms [i] += "out ";
else if (p.PassAs != "")
else if (p.PassAs != "" && !(p.Generatable is StructBase))
parms [i] += p.PassAs + " ";
parms [i] += p.NativeCallbackType + " " + p.Name;
}

View File

@ -98,9 +98,10 @@ namespace GtkSharp.Generation {
if (i > 0)
result += ", ";
if (parms[i].PassAs != "")
result += parms[i].PassAs + " ";
result += (parms[i].NativeCallbackType + " arg" + i);
Parameter p = parms [i];
if (p.PassAs != "" && !(p.Generatable is StructBase))
result += p.PassAs + " ";
result += (p.NativeCallbackType + " arg" + i);
}
result += ", IntPtr gch";
@ -229,7 +230,7 @@ namespace GtkSharp.Generation {
} else
sw.WriteLine("\t\t\t\targs.Args[" + (idx - 1) + "] = " + p.FromNative ("arg" + idx) + ";");
}
if (igen is StructBase)
if (igen is StructBase && p.PassAs == "ref")
finish += "\t\t\t\tif (arg" + idx + " != IntPtr.Zero) System.Runtime.InteropServices.Marshal.StructureToPtr (args.Args[" + (idx-1) + "], arg" + idx + ", false);\n";
else if (p.PassAs != "")
finish += "\t\t\t\targ" + idx + " = " + igen.ToNativeReturn ("((" + p.CSType + ")args.Args[" + (idx - 1) + "])") + ";\n";