Commit graph

471 commits

Author SHA1 Message Date
00JCIV00
999b0f4f00 widgets(table): implemented optional active row contents callback & context
- Added `active_content_fn` as an optional callback function that can be provided to `TableContext` to vertically expand the active row with additional info.
- Added `active_ctx` and `active_y_off` to support the `active_content_fn`.
- Updated the Table Widget example with
2024-08-13 07:42:14 -05:00
00JCIV00
a99fd3c29f widgets(table): implemented customizable column widths
- Added the `WidthStyle` union to the Table Widget. This allows users to choose from 4 different options for Column Widths.
- Updated the Table Example with demos of the various styles (via comments).
2024-08-13 07:42:14 -05:00
00JCIV00
bbbfbaffbb widgets(table): implemented selectable rows
- Implemented `TableContext.sel_rows`, allowing users to specify which rows have been 'selected' (similar to ctrl+clicking items in a GUI file browser).
- Changed previous 'selected' verbiage to 'active' in all cases.
2024-08-13 07:42:14 -05:00
00JCIV00
5972da8ee3 examples(table): updated the table example w/ latest vaxis changes
- Added `loop.init()` to regain dynamic resizing. (Thanks @rockorager!)
- Used the TTY's Buffered Writer where applicable.
- Updated `win.initChild()` to `win.child()` in all cases.
- Improved ArenaAllocator usage.
2024-08-13 07:42:14 -05:00
00JCIV00
9487916406 widgets(table): add support for Slices and MultiArrayLists
- Updated the Table Widget to support Slices and MultiArrayLists (in addtion to ArrayLists) for the `data_list` parameter of `drawTable()`.
2024-08-13 07:42:14 -05:00
Tim Culverhouse
707c050a76 widgets(text_input): add realLength fn
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-08-12 21:18:12 -05:00
Tim Culverhouse
453203553e widgets(text_input): expose api
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-08-12 21:10:45 -05:00
Tim Culverhouse
62ccf824cf widgets(text_input): impl word motion and deletes
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-08-12 21:07:09 -05:00
Tim Culverhouse
4fbbebbf0c widgets(text_input): use internal GapBuffer impl
Use a tiny GapBuffer implementation internal to the library.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-08-12 20:19:23 -05:00
CJ van den Berg
7190fde166 feat: add functions to set the default terminal background/foreground
And reset to default on cleanup.
2024-08-12 17:25:40 -05:00
Tim Culverhouse
a8baf9ce37 feat: add prettyPrint
Add a prettyPrint function which dumps the current screen to the tty,
not saving any state. This is useful for pretty printing text to stdout
in a streaming fashion
2024-08-06 12:10:03 -05:00
Tim Culverhouse
22516a971c image: reverse order of transmitLocalImagePath args
Width *then* height
2024-08-05 10:16:52 -05:00
Tim Culverhouse
0064229635 image: implement local filesystem transmission
Implement transmission over a local filesystem, by file, temp file, or
shared mem.
2024-08-05 07:58:04 -05:00
Tim Culverhouse
ec09912fa8 window(fill): bounds check end condition for fill
Fixes #65
2024-08-02 07:30:02 -05:00
glyh
9cbcc92b4c fix memleak with transmitted image 2024-08-01 21:17:23 -05:00
Tim Culverhouse
2f46eb9172 examples(table): add intrusive init on Loop 2024-07-30 18:24:37 -05:00
Tristan Partin
e44c578649 Add home and end keybinds for the TextInput widget
readline accepts these an analogs for ctrl+z and ctrl+e.

Signed-off-by: Tristan Partin <tristan@partin.io>
2024-07-30 14:03:09 -05:00
Tim Culverhouse
138604313e update readme 2024-07-30 13:53:13 -05:00
Tim Culverhouse
d36ab043ca render: reset osc8 link on reposition
Reset the link state on reposition so we properly write a new OSC8 tag
2024-07-29 19:09:31 -05:00
CJ van den Berg
5b7f2c3d5d fix: panic invalid enum value on left or right scroll 2024-07-28 15:49:43 -05:00
Tim Culverhouse
f0eaa3c831 resize: properly handle state reset on primary screen
When drawing on the primary screen The internal state of the cursor
location was not being updated. This resulted in an invalid state and a
messed up screen

Fixes: https://github.com/rockorager/libvaxis/issues/63
2024-07-21 21:17:00 -05:00
Tim Culverhouse
81a6b373a0 image: add transmitPreEncodedImage method
Add a method that allows users of the library to pre-encode an image
using whichever base64 encoder they want (ie a simd encoder).
2024-07-20 15:51:03 -05:00
Tim Culverhouse
22fab6f38b image: fix image scaling s/win.height/win.width 2024-07-20 14:03:24 -05:00
InKryption
53374f4f09 Remove incorrect pointer capture 2024-07-20 09:49:14 -05:00
Tim Culverhouse
2882264fa3 image: fix transmission of rgb and rgba
We must send image dimensions for these particular formats
2024-07-19 14:20:09 -05:00
Tim Culverhouse
9f8ef6270b re-export zigimg 2024-07-19 13:43:11 -05:00
Tim Culverhouse
2b5b58b255 image: allow transmitting zigimg Images directly
And with other transmission formats
2024-07-19 13:34:49 -05:00
Tim Culverhouse
20bbb25727 loop: null event continues inner loop 2024-07-19 11:44:09 -05:00
Tim Culverhouse
0e06467a61 mouse: don't translateMouse if we have 0 sized screen 2024-07-19 09:48:39 -05:00
Tim Culverhouse
1b9fcb1fa2 readme: add starter repo 2024-07-19 09:12:45 -05:00
Tim Culverhouse
c3ba0bbb16 loop: fix another loop continuuation 2024-07-19 07:43:44 -05:00
Tim Culverhouse
37941e59f5 loop: continue read_loop on null event 2024-07-19 07:41:14 -05:00
Tim Culverhouse
b513fff3b4 loop: fix capture for key_release 2024-07-19 07:07:50 -05:00
Tim Culverhouse
25b145a569 deps: reference commit for GapBuffer.zig 2024-07-18 07:36:19 -05:00
Jari Vetoniemi
56757fadcc aio: update aio, add LoopWithModules
AFAIK zig lacks a way of overriding module dependencies of dependencies.
LoopWithModules lets you use aio backend with vaxis using aio and coro
modules that are not included by vaxis, when this function is used
`include_aio` is not neccessary.
2024-07-16 10:42:57 -05:00
Tim Culverhouse
40e51ad054 fix(underline): use correct style value in switch 2024-07-09 13:05:37 -05:00
Tim Culverhouse
dff7681c30 widgets(terminal): set working_directory at spawn
Fixes #49.

If a user has passed an initial working directory, set that as the
set that as the terminal's working directory when we spawn the widget.
2024-07-05 07:37:16 -05:00
ippsav
09a4de63e5 fix: missing tty.deinit calls 2024-07-05 04:52:33 -07:00
CJ van den Berg
72d96638a4 fix(Parser): prevent index out of bounds error in skipUntilST 2024-07-03 17:30:21 -07:00
CJ van den Berg
b82f4e14b4 feat(windows): parse escape seqences in windows input stream 2024-07-03 17:30:21 -07:00
Rylee Lyman
ca85cbf3b2 fix: use u64 for render_dur so that *Vaxis becomes align(8)
on macOS, `@alignOf(std.c.max_align_t)` is 8, while `@alignOf(i128)`
is 16. since we moved to using `std.time.Timer`, render duration
should always be an unsigned quantity.

this change is motivated by my seamstress project, which wants to use
a Vaxis struct (well, something with a Vaxis struct as a field) as a
Lua userdata. it turns out that Lua won't allocate at an alignment
greater than `@alignOf(std.c.max_align_t)` even if you ask it to.
2024-07-03 04:23:12 -07:00
Tim Culverhouse
2605613019 vaxis: conditionally rely on terminal wrap to reposition cursor
If the text was printed with a wrap, and we can determine this from the
`print` method in Window, then we rely on the terminal for wrapping.
This can help with primary screen text reflowing on resize
2024-07-02 11:27:46 -05:00
Tim Culverhouse
1a52178c1f log: prefix all log scopes with "vaxis" 2024-07-02 08:05:57 -05:00
CJ van den Berg
1e5d39d9b1 fix(windows): unbreak escape sequence handling 2024-07-01 11:55:46 -07:00
CJ van den Berg
c4b5372253 fix(windows): unbreak shifted characters 2024-07-01 11:55:46 -07:00
CJ van den Berg
99942da4e1 fix(windows): fix parsing of UTF-16 codepoints in eventFromRecord 2024-07-01 11:55:46 -07:00
Tim Culverhouse
49ed160268 loop: prevent stopping a stopped loop 2024-07-01 11:17:44 -05:00
Tim Culverhouse
b68864c3ba parser: return early if ss3 contains an escape
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-06-30 16:40:22 -05:00
Tim Culverhouse
763d2a14a3 fix: correct param order for mode 2048 response 2024-06-30 11:53:16 -05:00
Tim Culverhouse
edaeb17f3d feat: implement mode 2048 in band resize reports
Implement mode 2048 for in-band window resize reports.

Reference: https://gist.github.com/rockorager/e695fb2924d36b2bcf1fff4a3704bd83
2024-06-30 11:45:43 -05:00