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
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.
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.
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.
Amendments on October 25, 2024
jcs made amendment
40
over 2 years ago
jcs made amendment
39
over 2 years ago
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
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
Amendments on October 22, 2024
Implement TVResize
Track last space globally so we can move back beyond chunk boundaries
jcs made amendment
32
over 2 years ago
Amendments on October 21, 2024
jcs made amendment
31
over 2 years ago
jcs made amendment
30
over 2 years ago
jcs made amendment
29
over 2 years ago
jcs made amendment
28
over 2 years ago
Amendments on October 18, 2024
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
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
22
over 2 years ago
Amendments on October 16, 2024
jcs made amendment
21
over 2 years ago