On 27/08/2009 23:07, Abdelrazak Younes wrote:
On 27/08/2009 22:08, Tommaso Cucinotta wrote:
On a related note, I just wanted to "complete" (but not commit) the
patch by:
-) renaming the LyXView::view() method to LyXView::currentBufferView()
[ or LyXView::selectedBufferView() might constitute an alternative ]
Why not documentBufferView() ?
Sorry, I meant bufferView(), but currentBufferView() looks fine too.
I would also get rid of LyXView::buffer() and
LyXView::documentBuffer(). Those can easily be accessed via
bufferView()->buffer() and documentBufferView()->buffer(). Actually I
have a patch that does just that that I didn't commit because I forgot
to turn off QtCreator tab and whitespace handling...
-) renaming the LyXView::currentMainWorkArea() method to
LyXView::currentDocumentWorkArea()
OK. On a related comment, the class Buffer could probaly be renamed to
Document and BufferView to DocumentView but I am not sure...
(somebody suggested that the "main" keyword here is misleading, and I
share this viewpoint, as it confuses with the "master" concept).
I agree but this is an interim solution. 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.
Abdel.