diff --git a/ChangeLog b/ChangeLog index 62d2f0283..a37a5e101 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-10-24 Mike Kestner + + * generator/InterfaceGen.cs: generate an Implementor prop on the + adapters to obtain the underlying object. + 2007-10-22 Mike Kestner * configure.in.in: add a win64 check and a compiler define for diff --git a/generator/InterfaceGen.cs b/generator/InterfaceGen.cs index 9340813e0..2838501e1 100644 --- a/generator/InterfaceGen.cs +++ b/generator/InterfaceGen.cs @@ -198,16 +198,12 @@ namespace GtkSharp.Generation { sw.WriteLine (); } - void GenerateCastOperators (StreamWriter sw) + void GenerateImplementorProp (StreamWriter sw) { - sw.WriteLine ("\t\tpublic static implicit operator {0}Adapter ({0}Implementor implementor)", Name); - sw.WriteLine ("\t\t{"); - sw.WriteLine ("\t\t\treturn new {0}Adapter (implementor);", Name); - sw.WriteLine ("\t\t}"); - sw.WriteLine (); - sw.WriteLine ("\t\tpublic static implicit operator {0}Implementor ({0}Adapter adapter)", Name); - sw.WriteLine ("\t\t{"); - sw.WriteLine ("\t\t\treturn adapter.implementor;"); + sw.WriteLine ("\t\tpublic " + Name + "Implementor Implementor {"); + sw.WriteLine ("\t\t\tget {"); + sw.WriteLine ("\t\t\t\treturn implementor;"); + sw.WriteLine ("\t\t\t}"); sw.WriteLine ("\t\t}"); sw.WriteLine (); } @@ -233,6 +229,7 @@ namespace GtkSharp.Generation { GenerateGType (sw); GenerateHandleProp (sw); GenerateGetObject (sw); + GenerateImplementorProp (sw); GenProperties (gen_info, null);