Le 28/08/2009 08:40, Abdelrazak Younes a écrit :
Vincent van Ravesteijn wrote:
Most of all, I don't like the randomness with which this is done. All
LFUNs handled in LyXFunc should relate to the documentBuffer(). Now
some LFUNs are corrected and others are not. At least the following
should all be related to the documentBuffer():

We could use a new lfun flag (no idea for a name, sorry) to specify this.

The idea if we stay with current architecture is that
LyXFunc::dispatch() set the local variable 'buf' to documentBuffer() at
the top of the method and to currentBuffer() otherwise.

For example.

The real solution IMHO is to get rid of LyXFunc dispatch and let the
Qt based classes handle the whole thing. Basically that means:

1) GuiApplication::dispatch(): handles what it can or delegate to
GuiView::dispatch() onto the current window that has the focus.
2) GuiView::dispatch(): handles what it can or delegate selectively
to either the current document workarea or the current embedded
workarea that has the focus depending on the LFUN.
3) GuiWorkArea::dispatch() will then it handles what it can or
delegate to BufferView::dispatch().
4) BufferView::dispatch() will then it handles what it can or
delegate to Inset::dispatch() if this is involving the current or to
Buffer::dispatch() if this is a pure Buffer LFUN.

I agree, but I think this is more or less how the design was intended
to be, or not ?

I think this is mostyl what we have (or what we would have by moving a few lines of code from LyXFunc to other places). There is no need to kill LyXFunc::dispatch to obtain what you describe.

No, JMarc always resisted going that path... He wants
LyXFunc::dispatch() to be the central thing while I want each class to
take care of its children.

The idea is that LyXFunc::dispatch can do a lot of cleanup and repetitive work that would have to be duplicated (with bugs) otherwise.

> The current approach is the main reason for a
LyXView virtual interface, which will go away with my proposed approach.

I do not see this virtual interface causing problems, and actually I do not see why its existence is related to this problem.

JMarc

Reply via email to