On Tue, Mar 11, 2003 at 08:52:23AM +0000, John Levon wrote:
> On Tue, Mar 11, 2003 at 09:42:10AM +0100, Lars Gullik Bj?nnes wrote:
> 
> > | Iteration through the whole doc happens only if the cursor is set bey
> > | mouseclick or similar.
> > 
> > Not even then, since we then can find a row close to the click, at in
> > worst case start from the row at top of screen.
> 
> And how do you convert from the Row * into an iterator ?

You don't have raw Row * anymore.

The base concept is that of a "document iterator". A document iterator
contains all necessary decisions to get from the logical root of the
document (e.g. a Buffer *) to a concrete position in the doc, by including
the relevant Paragraph * (or better ParagraphIterator), maybe a Row *, the
position in the par, relevant Inset *, nested Inset * and positions etc.

So a "document iterator" is a pretty fat beast, but using it for iteration
is fast, as "previous/next position" can be done in O(1) time.

The cursor is just a thin wrapper around a document iterator. A selection
is just a thin wrapper around two document iterators etc.

You never pass around raw Row * anymore, just full document iterators.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)

Reply via email to