Commit graph

109 commits

Author SHA1 Message Date
Tim Culverhouse
313096c277 window: make print infallible
Print and PrintSegment are now infallible due to gwidth also being
infallible. The previous error was only error.OutOfMemory if a temporary
buffer was too small to encode text in gwidth. This has been removed in
favor or a for loop
2024-10-14 19:24:48 -05:00
Tim Culverhouse
6d95ab65e6 example(main): fix initChild call 2024-10-14 19:16:25 -05:00
Tim Culverhouse
e3062d62b6 view: move to widgets 2024-10-04 20:13:54 -05:00
Tim Culverhouse
eee2e12644 fixup! examples(view): update view example 2024-10-04 20:13:54 -05:00
Tim Culverhouse
f3c81292b1 examples(view): update view example 2024-10-04 20:13:54 -05:00
00JCIV00
94e28654f9 fix(view): zig fmt on fixes 2024-10-04 20:13:54 -05:00
00JCIV00
0dbd72ef99 fix(view): fixed several items from PR #82 review
- Removed Window allocation in `init()`.
- Changed `max_width` and `max_height` to `width` and `height` in `Config`.
- Removed `x_pixel` and `y_pixel` from `Config`.
- Changed the `win` parameter of `toWin()` to Type `Window`.
- Fixed a typo in `fill()` so that it's no longer a recursion trap.
- Updated the example w/ corresponding fixes.
2024-10-04 20:13:54 -05:00
00JCIV00
ac9839c71d widgets(table): implemented header and column borders
- Added the `header_border` and `col_border` to `TableContext`. Note, row borders don't work as well due to borders taking up an entire cell.
- Updated the `table.zig` example.
2024-10-04 20:13:54 -05:00
00JCIV00
46ecd65c0c widgets(table): implemented header and column alignment
- Added the `header_align` and `col_align` to `TableContext` along with the corresponding `HorizontalAlignment` and `ColumnAlignment` Types.
- Updated the `table.zig` example.
2024-10-04 20:13:54 -05:00
00JCIV00
ad12308a1c view: zig formatted 2024-10-04 20:13:54 -05:00
00JCIV00
28f5734840 view: added 'child()' to View and improved example comments 2024-10-04 20:13:54 -05:00
00JCIV00
d2c9f6337d example(view): made the example more feauture complete and user friendly
- Set up swapable Views for a Small and Large map.
- Created a "Controls" Window at the top of the TUI.
- Added better documentation for how Views work.
2024-10-04 20:13:54 -05:00
00JCIV00
94bec1ec2a view: implemented an easy mechanism for vertical and horizontal scrolling
- Implemented View as an easy way to use the existing Screen and Window APIs for rendering Cells that don't fit within a Window. Basically, a user renders the oversized Cell content to a View, then renders a part of that View to a Window.
- Created the `view.zig` example.
2024-10-04 20:13:54 -05:00
00JCIV00
c89b75ebe3 widgets(table): added ability to reorder and duplicate columns
- Changed the behavior of `ColumnIndexes.by_idx` (used f/ `TableContext.col_indexes`) to allow valid field indexes in any order. Indexes can also be removed or added multiple times to affect the table generation accordingly.
2024-09-12 21:07:41 -05:00
00JCIV00
2580a8fc12 widgets(table): improved type and bounds checks
- Improved the Type checks for MultiArrayList child Types.
- Improved the bounds checking for printing rows.
2024-09-12 21:07:41 -05:00
00JCIV00
dbeef72630 widgets(table): implemented customizable foreground colors
- Added `active_fg` and `selected_fg` to allow changing the Foreground Color of Active and Selected rows (and Headers) respectively.
2024-09-12 21:07:41 -05:00
00JCIV00
500488f728 widgets(table): implemented more header and column options
- Added the `HeaderNames` Type and `header_names` field to `TableContext` to let users choose between automatically getting header names from fields or setting custom names.
- Removed the `headers` parameter from `drawTable()`.
- Added the `ColumnIndexes` Type and `col_indexes` field to `TableContext` to let users choose which columns/fields they actually want to display.
2024-08-15 19:37:16 -05:00
Tim Culverhouse
54e15764c4 example(table): fix text_input api 2024-08-13 07:42:14 -05:00
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
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
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
20bbb25727 loop: null event continues inner loop 2024-07-19 11:44:09 -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
ippsav
09a4de63e5 fix: missing tty.deinit calls 2024-07-05 04:52:33 -07:00
Jari Vetoniemi
9b78bb8a78 aio: update to latest, windows, code reuse
Update to latest aio, which has minor changes such as the thread pool
argument and special aio.ReadTty operation.

In future the aio.ReadTty might have option to translate to vt escape
sequences, but for vaxis it will use the direct mode.

I was not really able to test the windows at all actually as wine did
not seem to play nice with any vaxis example, but it compiles and ...
runs?
2024-06-30 08:44:04 -07:00
Jari Vetoniemi
b84f9e58a6 vaxis: add aio event loop and example
disabled by default, aio/coro might not be that mature yet.
however, appreciated if people give it a go and report issues.
2024-06-27 08:32:21 -07:00
Tim Culverhouse
0c91840b32 widgets(terminal): implement OSC 7 for pwd reporting 2024-06-19 09:23:11 -05:00
Tim Culverhouse
7005bb237c widgets(terminal): add initial_working_directory option 2024-06-19 07:11:02 -05:00
Tim Culverhouse
6043f0569a widgets(terminal): remove error logs
And use a buffered writer in the example
2024-06-18 18:41:48 -05:00
Rylee Lyman
f25a9b9660 fix: deinit TTY to avoid stair-stepped output 2024-06-13 12:34:03 -07:00
Rylee Lyman
f57ba4b477 fix: add ThreadPool for key events on macOS 2024-06-13 07:40:24 -07:00
Tim Culverhouse
f230f0c30a widgets(terminal): send a redraw event 2024-06-12 19:29:19 -05:00
Tim Culverhouse
46e7fd8fc6 widgets: remove neovim widget
The neovim widget was great. But we have a full virtual terminal widget
now, which doesn't bring in extra dependencies.
2024-06-11 20:35:10 -05:00
Tim Culverhouse
9c723bb645 examples(vt): use shell environment for command 2024-06-11 19:09:55 -05:00
Tim Culverhouse
6d4c180e31 widgets(terminal): implement legacy key encoding 2024-06-11 14:00:37 -05:00
Tim Culverhouse
9f2af4d5ee widgets(terminal): implement even more csi sequences 2024-06-10 14:18:55 -05:00
Tim Culverhouse
21f2a48a80 examples: update terminal example 2024-06-10 14:18:32 -05:00
Tim Culverhouse
f21559cc51 widgets(terminal): begin terminal widget 2024-06-10 14:18:32 -05:00
Tim Culverhouse
3c29f18251 examples(text_input): use all kitty flags 2024-06-05 12:37:27 -05:00
Tim Culverhouse
ef028bfe72 examples: remove pause_tui 2024-06-03 08:19:40 -05:00
Tim Culverhouse
7014a38a9c readme: add gif 2024-06-02 07:19:28 -05:00
Tim Culverhouse
00afc7c130 examples(xev): don't render in the eventCallback 2024-05-30 12:05:18 -05:00
Tim Culverhouse
d294428b74 examples(xev): duplicate functionality of vaxis example
The xev example is now a complete replication of the vaxis example, but
using xev as the event loop
2024-05-30 11:10:03 -05:00
Tim Culverhouse
335ea9f2d0 xev: fix todos 2024-05-30 10:06:28 -05:00
Tim Culverhouse
bbd9184e00 loop: add an xev loop implementation
This loop adds an xev.File wrapper called TtyWatcher which delivers
events to the users callback. Note that this implementation does not
handle any of the writes. Writes are always safe in the main thread, so
we let users decide how they will schedule those (buffered writers, xev
writes, etc)
2024-05-30 09:43:48 -05:00