[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]
Referential text
- To: Benjamin Fallenstein <b.fallenstein@xxxxxx>
- Subject: Referential text
- From: Tuomas Lukka <lukka@xxxxxxxxxx>
- Date: Thu, 19 Oct 2000 01:28:18 +0300 (EETDST)
- Cc: Tuomas Lukka <lukka@xxxxxxxxxx>, zzdev@xxxxxxxxxx
- In-reply-to: <39E9EE5A.A88D67D5@xxxxxx>
On Sun, 15 Oct 2000, Benjamin Fallenstein wrote:
>
> By the way, I'd say we should call the whole thing a "Texter," because
> it's useful beyond the scope of languages: e.g., you could have a texter
> which shows the content of a cursor's accursed cell in the cursor cargo
> cell -- that's something I'd like to have in the Flowing Clang
> structural debugger (when viewing the stack frames).
I've started really thinking about making referential text in cells easy.
As people on this list should know, referential text is about storing the
text typed in in the permascroll and only referring to that in the actual
cells.
After thinking about this for a while, I realized that what we really need
is to put that model into the ZZCell or ZZDimSpace implementation, and
provide an API with calls like
/** Insert a string of typed-in text referentially.
* A Span in the current cell's space is automatically constructed,
etc.
* This is at this level because we *may* want to fudge things later
if
* the user corrects typing errors before saving. However, that's a
bit tricky
* so we won't try it yet.
* <p>
* Calling this function on a cell that only has text content makes
the whole
* current text content referential as well.
*/
public void insertRefText(String txt, int offs) { }
/** Insert a referential span of text.
* <p>
* Calling this function on a cell that only has text content makes
the whole
* current text content referential as well.
*/
public void insertRefSpan(Span sp, int offs) { }
/** Delete a span of text from this cell.
*/
public void deleteText(int start) {}
/** Delete a span of text from this cell.
*/
public void deleteText(int start, int end) {}
/** Obtain the referential contents of this cell.
*/
public Span[] getSpans() { return null; }
public Span[] getSpans(int start) { return null; }
public Span[] getSpans(int start, int end) { return null; }
Actually, this could well be part of the "Texter". That way, using strings
as markers in the structure would remain pretty fast and simple.
The referential text facility has one drawback: one more
dimension-connection lookup at LEAST per cell's text obtained. For cells
which *are* referential, much more, but we can actually cache much of that
later if we weel like it.
I think I'll start this now. The interface will be called ZZText.
Tuomas