added link to original repository

This commit is contained in:
2026-01-09 05:44:50 +05:00
parent bd23c66607
commit a60172ef9a

View File

@@ -1,14 +1,14 @@
## about # tim
Fork of https://codeberg.org/chuvok/tim.h
tim->h is a portable library to create simple terminal applications ## about
tim is a portable library to create simple terminal applications
Demo video: https://asciinema.org/a/zn3p0dsVCOQOzwY1S9gDfyaxQ Demo video: https://asciinema.org/a/zn3p0dsVCOQOzwY1S9gDfyaxQ
## quick start ## quick start
See [example/hello.c](./example/hello.c) See [example/hello.c](./example/hello.c)
## layout ## layout
The terminal's columns (x) and rows (y) are addressed by their coordinates, The terminal's columns (x) and rows (y) are addressed by their coordinates,
the origin is in the top left corner. the origin is in the top left corner.
@@ -44,7 +44,6 @@ take the full available space from parent.
The layout automatically adopts to terminal window resize events. The layout automatically adopts to terminal window resize events.
## colors ## colors
Most elements have a uint64 color argument which holds up to eight colors. Most elements have a uint64 color argument which holds up to eight colors.
Typically byte 0 is the text color and byte 1 is the background color. Typically byte 0 is the text color and byte 1 is the background color.
@@ -59,7 +58,6 @@ xterm-256 color chart
https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg
## events ## events
tim_run blocks until it observes an event. Mouse and key events are always tim_run blocks until it observes an event. Mouse and key events are always
immediately followed by a draw event in order to make changes visible. immediately followed by a draw event in order to make changes visible.
@@ -76,7 +74,6 @@ The current event is stored in tim->event.
VOID_EVENT | consumed event VOID_EVENT | consumed event
## elements ## elements
frame (x, y, w, h, color) frame (x, y, w, h, color)
Draw an empty frame and fill area. Draw an empty frame and fill area.
@@ -137,7 +134,6 @@ radio (str, state, v, x, y, w, color) -> bool
color radio, background, text color radio, background, text
## functions ## functions
tim_run (fps) -> bool tim_run (fps) -> bool
Process events and render frame. Blocks until input is received or the Process events and render frame. Blocks until input is received or the
@@ -166,12 +162,10 @@ tim_time_usec () -> int64
time or leap seconds. time or leap seconds.
## useful links ## useful links
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
https://learn.microsoft.com/en-us/windows/console/ https://learn.microsoft.com/en-us/windows/console/
## bugs ## bugs
- Double buffering is still new, set ENABLE_DBUF to 0 if you see glitches - Double buffering is still new, set ENABLE_DBUF to 0 if you see glitches
- Double width characters like 彁 are not fully supported. Terminals do not - Double width characters like 彁 are not fully supported. Terminals do not
handle these consistently and there is no portable way to reliably handle these consistently and there is no portable way to reliably
@@ -182,7 +176,6 @@ https://learn.microsoft.com/en-us/windows/console/
- Windows cmd.exe resize events may be delayed - Windows cmd.exe resize events may be delayed
## compatibility ## compatibility
emulator | support | remarks emulator | support | remarks
------------------|---------|---------------------------------- ------------------|---------|----------------------------------
Alacritty | ? | Alacritty | ? |
@@ -211,7 +204,6 @@ https://learn.microsoft.com/en-us/windows/console/
Zutty | full | Zutty | full |
## license ## license
MIT License MIT License
Copyright (c) MMXXIV Chu'vok <chuvok@maeppi.e4ward.com> Copyright (c) MMXXIV Chu'vok <chuvok@maeppi.e4ward.com>