diff --git a/ChangeLog b/ChangeLog index 78ac85b66..e930b3729 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-11-23 Christian Hoff + + * 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 * glib/Value.cs: avoid cast exceptions passing ints as objects on diff --git a/generator/Signal.cs b/generator/Signal.cs index bd6937b0b..fa499bcfa 100644 --- a/generator/Signal.cs +++ b/generator/Signal.cs @@ -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}");