Commit graph

39 commits

Author SHA1 Message Date
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
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
96387d43e6 build: change neovim default to true
Commit ec98c7cd3d fixed the default value to match the description,
however this resulted in the docs failing to build since the files are
needed in the default build case.

Update the default and description to true.
2024-06-11 20:29:18 -05:00
Frederico Winter
ec98c7cd3d changed the default value of the nvim option to correspond to it's default description 2024-06-11 18:27:00 -07:00
Tim Culverhouse
f21559cc51 widgets(terminal): begin terminal widget 2024-06-10 14:18:32 -05:00
CJ van den Berg
d21940bdbd build: make most dependencies optional 2024-06-05 07:31:46 -07: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
Tim Culverhouse
288b8cac75 build: remove some examples 2024-05-29 13:16:35 -05:00
Tim Culverhouse
0fa082033e examples: add readline example 2024-05-24 11:00:35 -05:00
Tim Culverhouse
409e17b883 examples: add vaxis example 2024-05-24 08:04:54 -05:00
Tim Culverhouse
9f015b7f49 docs: refactor docs build step 2024-05-14 12:53:29 -05:00
Tim Culverhouse
ed1867cf39 examples(nvim): update example api
The nvim widget needs work, but at least you can run the example
2024-05-02 20:13:45 -05:00
Tim Culverhouse
a0db41f87c render: add cli renderer
Add a renderer for applications running on the primary screen. This
renderer uses relative cursor positioning, and works with all the same
primitives as the alternate screen.

Fix a bug where repositioning was never turned back to false. This was a
nasty one with huge perf implications.

Set internal cells to a space and default on init. This prevents us from
writing them. As a result, we now issue a hardware clear on resize.
2024-05-02 12:50:33 -05:00
Tim Culverhouse
8a71cd4c85 zg: complete replacement of ziglyph with zg 2024-04-29 14:00:08 -05:00
Tim Culverhouse
9fec6f122b core: replace ziglyph.GraphemeIterator with zg version
ziglyph is being replaced by zg. Replace all calls to ziglyph grapheme
iterator with the zg version
2024-04-29 13:03:01 -05:00
Tim Culverhouse
cde945f2ef build: use std.Build.path 2024-04-19 16:22:46 -08:00
Tim Culverhouse
606272f471 widgets: add initial nvim implementation 2024-04-16 16:06:14 -08:00
Daylin Morgan
b5c2d80f57 build: add build flag for example 2024-04-11 10:39:01 -05:00
Tim Culverhouse
40f80bef0c build: change example to examples/text_input
Will add more example runs later
2024-04-10 14:40:22 -05:00
Tim Culverhouse
da988cc8d9 readme: add link to docs page 2024-03-29 09:37:07 -05:00
Tim Culverhouse
910fac9cc2 docs: fix doc build step 2024-03-29 09:20:42 -05:00
Tim Culverhouse
a505d67276 core: close read thread via DSR
Request a device status report to trigger a read. Wait for the thread to
join in the main loop to ensure that the read thread has fully closed.
This should prevent the need for polling and a quit_fd, and a separate
mechanism on macos.
2024-03-19 13:41:01 -05:00
Rylee Alanza Lyman
0798182012
feat: adds gap_buffer.zig for TextInput (#6)
Use a gap buffer for the `TextInput` widget instead of an `ArrayList`.
2024-03-12 06:38:23 -05:00
Rylee Lyman
c65dab952c fix: use select on macOS
the man page for macOS `poll(2)` says, under "bugs", that polling
devices does not work, and indeed, although the current implementation
based on poll(2) does produce output, it does not appear to actually
be polling for this reason; instead the wait is blocking on the `read`
call, causing the macOS user to need to input another character to
exit.

this change introduces a wrapper over macOS's implementation of
`select`, modeled after `std.io.poll` as `select.zig`. it is a compile
error to use `select.zig` when `builtin.os.tag.isDarwin()` is false. a
lightly altered version of `Tty.zig` accompanies this change. it's
certainly possible to incorporate the two into one file; i didn't just
to leave the other one in its original state.

with this change, writing to the pipe correctly exits.

additionally, on macOS, `Thread.setName` must be called from the
thread whose name you wish to set, so I have just commented out that
line.
2024-03-09 06:45:36 -06:00
Tim Culverhouse
c662de4df0 lib: export Segment, PrintOptions, and ziglyph
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-03-01 12:28:48 -06:00
00JCIV00
e87d64a2b3 Added the table.zig example
- Created a basic user management example for the Table widget.
2024-02-26 19:27:56 -06:00
00JCIV00
4069c83092 docs: add build step for autodoc
Add build step to generate autodocs and add github workflow for
publishing
2024-02-26 17:09:29 -06:00
Tim Culverhouse
6418570819 update for zig-0.12.0-2809
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-02-18 12:20:47 -06:00
Jora Troosh
4a463cfa3a
refactor: make code more idiomatic
- Added standard .gitattributes file for Zig projects.
- Reworked build.zig a little, hopefully it's a bit clearer. Also, now zig build will run all steps.
- outer: while in examples was redundant since there's only one loop to break from. switch expressions don't allow breaking from them, so breaking is only for loops, i.e. while and for.
- When returning a struct instance from a function, the compiler infers the return type from function signature, so instead of return MyType{...}; , it's more idiomatic to write return .{...};.
- Logging adds a new line by default, so you don't usually need to write \n like here: log.debug("event: {}\r\n", .{event});.
2024-02-11 12:59:33 -06:00
Tim Culverhouse
a733860a21 add pathological example as a terminal perf test 2024-02-09 12:27:22 -06:00
Tim Culverhouse
f3cf7bcfcd mouse: implement mouse parsing and events
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-01-31 12:50:00 -06:00
Tim Culverhouse
cc75fe6272 image: implement transmitting images
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-01-30 13:30:36 -06:00
Tim Culverhouse
c99dffaecf WIP: images
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-01-25 13:32:22 -06:00
Tim Culverhouse
5148d20f52 widgets: create an initial text_input and border widget
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-01-21 19:12:46 -06:00
Tim Culverhouse
0f12881c17 parser: handle non-ascii input
But not full on graphemes, yet

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-01-21 16:11:51 -06:00
Tim Culverhouse
c3964fec43 rename project libvaxis
This is so similar to my vaxis project for go that we'll retain the name
here as well. The two can keep similar APIs and feature sets, but are
used in different languages. Maybe someday libvaxis will export a C api
for even broader use

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-01-19 10:13:32 -06:00
Tim Culverhouse
d22b2a89f3 chore: refactor build
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-01-18 20:17:26 -06:00
Tim Culverhouse
11b7b86913 core: functional App structure
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-01-18 19:02:59 -06:00
Tim Culverhouse
b9564b7db8 initial commit
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2024-01-17 21:58:03 -06:00