Lars, I'm not sure if you're still doing this, but I have had a little go. Attached is a reduced controllers directory with my attempts to date.
Things done so far: * Make Connections classes to connect/disconnect the dialog from the Dialogs signals. Controllers will have a ConnectionBase member variable rather than derive from some ControlConnections class. Allows me to nuke ControlDialog.tmpl and immediately reduces the Controller inheritance tree by two levels of inheritance. ControlAboutlyx is now passed a boost::function<void> & show, to which it binds its show() method. It therefore doesn't need to know anything about class Dialogs. We can possibly enhance this by passing the boost::function<void> & to the ControlBase c-tor, but one thing at a time. I'll try and factor out as much of the ControlInset class as possible into a non-template ControlInsetBase or something. It should be possible to remove most of #include "ControlInset.h" #include "ButtonControllerBase.h" #include "ViewBase.h" #include "buffer.h" #include "debug.h" #include "frontends/LyXView.h" #include "support/LAssert.h" #include <boost/bind.hpp> from the .tmpl file. Ditto for ButtonController.tmpl. I'm not even sure that we can't nuke it entirely. Basically, I think that my gut feeling was correct; we can make most things member variables rather than derive a great long inheritance tree. Angus
controllers.tar.gz
Description: GNU Zip compressed data