On Sun, 18 Dec 2005, Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum wrote:
I see. So if the auto-generator is used, it would insert e.g. GTK_FILE_CHOOSER_DIALOG(x) instead of GTK_FILE_CHOOSER(x), because all it knows is that it has seen "class GTK2.FileChooserDialog;". I suppose to fix this we can introduce a new keyword "interface" to the auto-generator, so you can say "interface GTK2.FileChooser;" in the .inc file.
Yes, exactly.
Of course, the best way would be to make the interfaces into real Pike classes, so you could use multiple inheritance instead of includes. This would also allow you to use "GTK2.FileChooser" as an abstract type in your Pike applications. Hmm. Let me see what I can whip up.
I originally tried to use multiple inheritance, but the auto-generator (build_pgtk.pike) isn't written with multiple inheritance in mind. It checks for circular dependencies and stuff, and trying to hack it to allow multiple inheritance was turning into a major undertaking. Just creating the .inc file structure was a compromise.
Multiple inheritance would be great, and an interface keyword would be a good second choice..