AmendHub

jcs

/

textview

/

amendments

/

textview.h

Amendments on November 8, 2024

*: Stop using the canvas, it's slowing us down

It looks smoother but slower, so if we just speed things up we won't
need it
jcs made amendment 45 over 2 years ago

TVAppendLine: Add, reduce unnecessary redrawing in TVUpdateScrollbar

A common pattern is to TVAppend a line from a buffer but then have
to insert manual \r line breaks to skip over \n breaks in a buffer.
To avoid having to TVAppend(line) and TVAppend('\r'), move TVAppend
to TVAppendLocked and take a terminating character, and make
TVAppend pass 0.
Now a caller can just do TVAppendLine in a single call and not have
to waste time with all the setup and recalculation in TVAppend just
to append one linebreak.
Also do checking in TVUpdateScrollbar to ignore redrawing if the
scroll "elevator" won't be moving, such as when it's pegged to the
top or bottom.
jcs made amendment 44 over 2 years ago

Amendments on October 29, 2024

TVGetText: Add function to read all text slabs into a single buffer

Since users can't access the text directly like a TextEdit control,
provide this so all of the text can be copied somewhere.
jcs made amendment 42 over 2 years ago

TVGetOffset: Return a long to be able to return -1, fix TVClear

We weren't clearing first_chunk and last_chunk when clearing so the
next drawing might have gone into lala land.
Also use an initial slab id of 1 to avoid the not-0-offset hackery.
jcs made amendment 41 over 2 years ago

Amendments on October 25, 2024

Allow turning off re-calculation in TVAppend, add stubs for select/copy

For applications doing lots of small appends, it may be useful to
just do one TVCalcLines after adding a chunk of data
jcs made amendment 38 over 2 years ago

Add toggle for line wrapping and a configurable tab stop

When tab stop is non-zero, tab characters are rendered as spaces to
that tab stop which only really makes sense right now for fixed-width
fonts
jcs made amendment 36 over 2 years ago

Amendments on October 22, 2024

Implement TVResize

Track last space globally so we can move back beyond chunk boundaries
jcs made amendment 33 over 2 years ago

Amendments on October 21, 2024


Amendments on October 18, 2024

Implement TVGetOffset for callers to map clicks to text

jcs made amendment 27 over 2 years ago

Fix some bugs, use Boolean instead of bool to avoid carrying stdint.h

Fix SET_CHUNKPTR_OFFSET mask
Properly draw multiple chunks on one line
Update cur_style properly
canvas is a pointer now so pass it to ClosePort properly
Don't modify view on creation to match bounds like TextEdit does
jcs made amendment 26 over 2 years ago

Minor cleanup

jcs made amendment 25 over 2 years ago

Amendments on October 17, 2024

Better error propagation, shorter DrawText loop, fix canvas disappearing

THINK Reference has a note in the OpenPort documentation that says
to not use a Handle for the GrafPort because it could move addresses
between being opened and closed and get lost. Since we were putting
it in the main TVRec which is a Handle and could move, our canvas
could get lost, which is why it was disappearing under heavy memory
pressure and drawing seemed to have no effect.
jcs made amendment 23 over 2 years ago

Bring scrolling up to date

jcs made amendment 22 over 2 years ago

Amendments on October 16, 2024

Move top/bottom tracking from chunk to line, fix autoscroll

jcs made amendment 21 over 2 years ago