|
|
3 недель назад | |
|---|---|---|
| .. | ||
| Makefile | 3 недель назад | |
| README.md | 3 недель назад | |
| SUMMARY.md | 3 недель назад | |
| demo | 3 недель назад | |
| demo.mod | 3 недель назад | |
| ttysize.mod | 3 недель назад | |
| tv.def | 3 недель назад | |
| tv.mod | 3 недель назад | |
| tv.o | 3 недель назад | |
| tvtty.def | 3 недель назад | |
A character-cell UI toolkit written in ISO GNU Modula-2 (gm2 -fiso) that
runs in a terminal (xterm and friends). It is a small, self-contained
Turbo-Vision-like library: a retained view tree with clipping and z-order,
a diffed ANSI cell screen, keyboard and mouse decoding (xterm SGR mouse
reports), widgets, and modal dialogs.
Everything is Modula-2 except tvtty.def, the tiny libc binding used to put
the terminal in raw mode and to query its size (termios, ioctl, read,
write). There is no C source and no graphics dependency.
| file | role |
|---|---|
tvtty.def |
libc binding (raw mode, winsize, read/write) |
tv.def / tv.mod |
the toolkit: screen, view tree, widgets, events |
demo.mod |
demo application |
ttysize.mod |
diagnostic: checks the tty binding |
gm2 -fiso -c tvtty.def
gm2 -fiso -I. -c tv.mod
gm2 -fiso -I. tv.o demo.mod -o demo
./demo
or simply make. Run it from a real terminal; Esc exits.
X close box, draggable by the title
bar with the mouse.Tab/Shift-Tab and up/down cycle widgets; the focused
input gets the hardware cursor.Message), used by the demo's OK button.Dialog with arbitrary controls; form validation.SIGWINCH-driven relayout (today the app polls the size).()
(PROCEDURE Cols() : INTEGER;), otherwise the .def fails to parse when
compiled through the .mod.^ (v^.rect); there is no implicit dereference.BEGIN ... END block is not a statement, so it cannot appear
directly in a CASE alternative - use a helper procedure.INTEGER index compared with HIGH(array) (a CARDINAL) must be
converted: i <= VAL(INTEGER, HIGH(a)).struct termios/struct winsize are accessed through an opaque
byte buffer with fixed Linux offsets (see tv.mod).