lyx  

Re: making sense of buffer/file structure

Lars Gullik Bjønnes
Wed, 7 Oct 1998 05:44:12 -0400

  >> Richard E Hawkins Esq writes:

  REHE> lars wrote,
  >> >> Richard E Hawkins Esq writes:

  REHE> Is there somewhere where the file/buffer structure is actually
  REHE> explained?

  REHE> if so, i haven't found it. If I have this straight:

  >> You have to decide if you are looking at 0.12 or 0.13, they are
  >> beginning to be quite different.

  REHE> for the moment, .12, as I need to use it right away :)

  REHE> The top level is the buffer structure. This includes element
  REHE> text[] it also includes several LyxParagraph structures.
 
  >> not true in 0.13, there it is BufferView that is the controlling
  >> class. (actually this is true in 0.12 too)

  REHE> so the only implemented BufferView is the one that displays on
  REHE> the screen, and it has as an element a BufferList of Buffers?

No, the bufferlist is independant. The bufferview has a pointer to one
of the buffers in buffelist.
 
  REHE> While structure.text is of type LyXText, the same charactares
  REHE> are available as *char in the LyxParagraphs, but these might
  REHE> not actually be characters, which can be checked by
  REHE> IsLetter(), IsInset(), and the like.

  >> true, this is going to change. To give characters special
  >> meenings is error prone.

  REHE> OK, but for now, this is what I look for?

yes.

  REHE> So if I change things in buffer.text, it will auutomatically
  REHE> be reflected in the paragraphs, unless I add new paragrph
  REHE> breaks, which I do have to deal with.
  >>
  REHE> So i can do my replacing by stepping through the buffer
  REHE> positions, and replacing text in the buffer. Or should I be
  REHE> stepping through paragraphs to do this, until i run out of
  REHE> paragraphs?
  >>
  REHE> Or am I as confused as i think i am?
  >>  Can you imgainge how confused we are :-)

  REHE> :)

  >> look at the search & replace code that should give a few hints on
  >> how to do this.

  REHE> thanks, these help. I've noticed some of the functions in
  REHE> lyxfr1.C note that they should be part of LyXText; should i
  REHE> start moving them when i need them elsewhere?

No, not unless you do this in 0.13

        Lgb