Create USAGE.md to serve as a friendly guide for usage.
Move the libxev and zig-aio event loops to serve as an example of how to
implement a custom event loop in USAGE.md. Remove dependency on these
libraries and all associated examples and source code.
The motivation for this change is to provide a simpler library. The
power to create a custom event loop will always be kept, however the
support burden of maintaining three event loops is not where I want to
focus my energy. The code is small enough that it's easy enough to be
copy/pasted into a project or provided as a third-party library.
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
- 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.
- 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.
- Added the `header_align` and `col_align` to `TableContext` along with the corresponding `HorizontalAlignment` and `ColumnAlignment` Types.
- Updated the `table.zig` example.
- 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.
- 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.
- 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.
- 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.
- 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
- 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).
- 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.
- 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.
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.
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?