Angus Leeming <[EMAIL PROTECTED]> writes:
| QUESTION 1. Would it not make more sense if the public
| methods returned references? This is probably true of most
| of the methods in LyXFunc that currently return pointers to
| data.
What then to return if you have no BufferViews (of we could just
prohibit that)?
| class BufferView {
| public:
| bool available() const {
| if (buffer_ && text) return true;
| return false;
| }
| LyXText * text;
| private:
| Buffer * buffer_;
| }
|
| The BufferView methods contain lots of tests
| if( buffer )...
|
| I'm trying to understand this. Can a BufferView exist
| without a Buffer?
There is no buffer when you have LyX without a document loaded.
(The Buffer is the document,
| right?)
yes.
| Clearly it can in this code, but in the ideal,
| perfectly coded world?
So when I delete the last loaded document/buffer lyx should just
create an empty one?
| LyXText * text is that bit of the document that is shown in
| the BufferView?
yes, and more. It holds the complete "typeset" docment on a per-line
basis and is used for io to the buffer and as a cache to make drawing
of the screen go faster. (and should be separated into several classes
...)
|
| So, BufferView::available() returns true if a document is
| open and the window has more than zero size?
window?
it return true when a buffer is loaded and a text has been created for
that buffer. (also note the TextCache when you dig into this code)
Lgb