GNOME Bugzilla – Bug 154520
can't inherit from inhibited interface
Last modified: 2004-12-22 21:47:04 UTC
Try and inherit from Bonobo::Unknown when it is included as it should be. The bug comes from the fact that only un-inhibited interfaces have all the scope, base list, and other data structures set up correctly. Even though that information is available from the inhibited IDL_tree nodes. I've made a start at creating an Interface representation that doesn't rely on construction from an un-inhibited IDL_tree interface. But the problem is the getItem() method. Most types have the same flaw as interface. So I pretty much have to fix all of them to fix anything.
Bryan, thanks for your email (posted below). I've identified this as a bug in the way inhibited interfaces are handled. I know how to fix it but the problem is it involves a whole lot of little changes. Hopefully I'll snare some time for this soon. I've made a start but it doesn't help much. In the mean time the you should be able to get by with -D'ing all the __xxx_COMPILATION guards that are inhibit'ing interfaces. Bryans email: I'm trying to generate some orbit classes to wrap evolution-data- server's API and it relies heavily on bonobo. I've been trying to generate the cpp source with orbitcpp like this: orbit-idl-2 --headerguardprefix=EVOLUTION_CALMM_ - I /usr/share/idl/evolution-data-server-1.0 -I /usr/share/idl/bonobo-2.0 -I /usr/share/idl/bonobo-activation-2.0 /usr/share/idl/evolution-data- server-1.0/Evolution-DataServer-Calendar.idl orbit-idl-2 -lcpp -D__GNOME_Evolution_Calendar_CalView_COMPILATION - I /usr/include/libbonobomm-2.6/bonobomm/ -I /usr/share/idl/evolution- data-server-1.0 -I /usr/share/idl/bonobo-2.0 -I /usr/share/idl/bonobo- activation-2.0 /usr/share/idl/evolution-data-server-1.0/Evolution- DataServer-Calendar.idl but I get this error: /usr/share/idl/bonobo- activation-2.0/Bonobo_Unknown.idl:28: unknown identifier ::Bonobo::Unknown I know ::Bonobo::Unknown is defined in libbonobomm, but I'm not sure how to tell orbitcpp that. Thanks in advance!
What is an "inhibited interface"?
Any interface that is inhibit'ed by a pragma or an only-top command line option. The idl parser doesn't tell us about them when it parses them. But it does pass us an IDL_tree with all the info needed when they are referenced later. In the problematic code Bonobo::Unknown is inhibited. #pragma inhibit push module Bonobo { interface Unknown { }; }; #pragram inhibit pop module GNOME { module Evolution { module Calendar { // Bonobo::Unknown seems to be undefined because we haven't set up the C++ // data-structures. But everything we need to know is there in IDL_tree. interface CalView : Bonobo::Unknown { }; }; }; };
I've reworked enough classes that we should be able support interfaces within an inhibit block properly. Although, I've hit a temporary snag which because IDLSequence doesn't work properly without active typedefs. See bug 155258. Once that is out of the way I should be able to debug the changes made to get this far.
Hope you're still with me Bryan. I have hacked away at the idl compiler back end such that it can now handle inheritance from inhibited interfaces. The changes are pretty substantial and wide ranging (why I've been too lazy to do it until now). As such there are a few bugs to sort out. In particular the generated code is no longer able to be compiled. That should be relatively easy to fix in comparison.
Bryan, I've fixed enough things that Evolution-DataServer-Calendar.idl can be parsed by orbitcpp. I haven't tried compiling the code that is generated. I hope you haven't lost interest in this because I would appreciate some testing from you.
I just got my laptop (my only linux box) back from the shop, so I'll be testing this in the next few days.
Ok, I've tried compiling the generated source for Evolution-DataServer-Calendar.idl. Naturally, it's not working at the moment. I've fixed a few things but I stopped at a problem with the Calendar namespace at the bottom of GNOME::Evolution::Calendar getting dropped at in some places. Not sure what is going on but it should be easy to fix (until the next problem crops up), but it'll take a few days before I can spend some time on this.
The problem with the namespace getting dropped is fixed. The next problem is duplicate entries are appearing in the skeleton code. Maybe have it sorted tommorrow sometime.
Finally! Orbitcpp copes with Evolution-DataServer-Calendar.idl and it even generates output that compiles. I've had to do a lot of hacking to get this to come together so I don't know if the generated code will run properly. Hope so. You may notice that the tests don't build at the moment. The code that handles Unions needs to be brought in line with the recent changes. This doesn't impact on the Evolution-DataServer-Calendar.idl but does impact on Bonobo (so don't try rebuilding Bonobo just yet).
I fixed the Union problem I mentioned above (along with some other stuff). So Bonobo builds and so do the tests. If you are still interested in the Evolution-DataServer-Calendar.idl stuff, I'd appreciate confirmation that it builds for you (it does for me).