2009-11-23 Christian Hoff <christian_hoff@gmx.net>

* generator/Signal.cs: Return a GInterfaceAdapter in the signalargs's
	accessor properties instead of trying to return the implementor as stored in
	the arguments array.

svn path=/trunk/gtk-sharp/; revision=146744
This commit is contained in:
Christian Hoff 2009-11-23 17:19:46 +00:00
parent 95a430c74d
commit 88a7a7305c
2 changed files with 14 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2009-11-23 Christian Hoff <christian_hoff@gmx.net>
* generator/Signal.cs: Return a GInterfaceAdapter in the signalargs's
accessor properties instead of trying to return the implementor as stored in
the arguments array.
2009-11-01 Mike Kestner <mkestner@novell.com>
* glib/Value.cs: avoid cast exceptions passing ints as objects on

View File

@ -271,12 +271,18 @@ namespace GtkSharp.Generation {
sw.WriteLine ("\t\tpublic " + parms[i].CSType + " " + parms[i].StudlyName + "{");
if (parms[i].PassAs != "out") {
sw.WriteLine ("\t\t\tget {");
sw.WriteLine ("\t\t\t\treturn (" + parms[i].CSType + ") Args[" + i + "];");
if (SymbolTable.Table.IsInterface (parms [i].CType))
sw.WriteLine ("\t\t\t\treturn {0}Adapter.GetObject (Args [{1}] as GLib.Object);", parms [i].CSType, i);
else
sw.WriteLine ("\t\t\t\treturn ({0}) Args [{1}];", parms [i].CSType, i);
sw.WriteLine ("\t\t\t}");
}
if (parms[i].PassAs != "") {
sw.WriteLine ("\t\t\tset {");
sw.WriteLine ("\t\t\t\tArgs[" + i + "] = (" + parms[i].CSType + ")value;");
if (SymbolTable.Table.IsInterface (parms [i].CType))
sw.WriteLine ("\t\t\t\tArgs [{0}] = value is {1}Adapter ? (value as {1}Adapter).Implementor : value;", i, parms [i].CSType);
else
sw.WriteLine ("\t\t\t\tArgs[" + i + "] = (" + parms[i].CSType + ")value;");
sw.WriteLine ("\t\t\t}");
}
sw.WriteLine ("\t\t}");