On Sat, Jan 05, 2002 at 12:44:23AM +0100, Lars Gullik Bjønnes wrote:
> There is still one huge obstacle (I have removed the next/prev from
> Paragraph and changed Row to store an iterator): make the cursor store
> a iterator and not a pointer to a paragraph.

I think the outside world could adapt mathed's notion of a 'cursor' at
some point of time. The 'mathcursor' is basically a triple of two
'mathiterators' and a 'bool', the iterators represent the position of the
selection anchor and the actual cursor, the bool says whether the selection
is active.

Now the 'complicated' part is a 'mathiterator' (see
src/mathed/math_iterator.[Ch] for complete description ;-)). This is
basically a vector of tripels (inset *, cell in inset, position in cell).

Maybe an example: Suppose we have  $a+\frac{b}{\sqrt{cd}}$ and the cursor
is between 'c' and 'd'. Than the cursor iterator would look like

  (&hull,
   0 /* hull has only one 'cell', we count from */
   2 /* position left of frac: 0 is 'a', 1 is '+', 2 is the frac */ )

  (&frac,
   0 /* frac has two cells, 0 is denominator, 1 is numerator */
   1 /* we are 'left of the d')

Navigation is pretty easy using this representation (and there is no need
for inset locking etc...)


Andre'

-- 
André Pönitz .............................................. [EMAIL PROTECTED]

Reply via email to