On Fri, Sep 08, 2006 at 09:33:27AM +0200, Abdelrazak Younes wrote: > Andre Poenitz wrote: > >On Thu, Sep 07, 2006 at 09:39:13AM +0200, Abdelrazak Younes wrote: > >>>Shouldn't there be a lyxkernel.dll and the frontend using this? > >>The frontend virtual interface yes. The qt4 frontend will just be an > >>implementation of this interface and could entirely be in a single dll. > >>This way the lyx-executable would not even have to link to Qt4, only the > >>qt4 frontend dll. > > > >I am not sure there needs to be a virtual frontend interface at all. > > If we want to support multiple frontends with a seemingly consistent > behaviour, I'm afraid that's the only way to go for now.
Not at all. If the kernel is not aware of any frontend (and that's possible, in theory), it makes no difference whther it's not aware on a single one ortwo of them. I'd even argue that this would be the better solution even from a GUII point of view. > Besides, the virtual interface is accompanied with methods that allow > to encapsulate code that should be common to all frontends (WorkArea, > Clipboard). Surely frontends can share code. This could be a common base class, but it could be something else. The clipboard e.g. could live in a separate singleton, and I am not sure there's enough really frontend independent workspace code to rectify a common base class. > >In theory, ther kernel could be completely ignorant of any frontend > >and just signal internal changes. > > In theory yes ;-) At least we should head to this behaviour. Indeed. > >A frontend would directly call into the kernel to make things happen > >and adjust afterwards by listening to the signals. > > > >IMO a common frontend base is a design mistake that puts things > >downside up: The kernel tells the frontend to draw and listen to > >events from the frontend. No good. > > FWIW, I agree on the principle. In practice, I see this virtual > interface as a temporary measure to clean up the code progressively. > During my cleanup activities I deleted a lot of virtual interfaces > because they were not needed any more. At the end, the virtual > interface would just be a mean to have consistent behaviour across > frontends and to share code. It's also a nice way to separate real GUI > programming (as in model and view) and controllers. I am fine with this approach (modulo the necessity of the common base, but I have no really strong feelings there), and I am very happy that someone does some real work in this area. Andre' --