]> _ Git - termbox2.git/log
termbox2.git
2 years agocomments
Adam Saponara [Sun, 18 Sep 2022 22:59:33 +0000 (18:59 -0400)]
comments

2 years agosupport default colors in non-`TB_OUTPUT_NORMAL` modes (#41)
Adam Saponara [Sun, 18 Sep 2022 22:05:50 +0000 (18:05 -0400)]
support default colors in non-`TB_OUTPUT_NORMAL` modes (#41)

`TB_DEFAULT` is now defined as a bitwise attribute similar to
`TB_BOLD`. previously it was defined as 0 which made it impossible to
use default colors in non-`TB_OUTPUT_NORMAL` modes.

for convenience and limited back-compat, 0 is still interpreted as
`TB_DEFAULT` in `TB_OUTPUT_NORMAL`, `TB_OUTPUT_216`, and
`TB_OUTPUT_GRAYSCALE`, though `TB_DEFAULT` may be used as well.

in `TB_OUTPUT_256` and `TB_OUTPUT_TRUECOLOR`, 0 is black, so
`TB_DEFAULT` and `TB_TRUECOLOR_DEFAULT` respectively must be used if
a default color is desired.

2 years agoadd tb_version
Adam Saponara [Sun, 18 Sep 2022 19:19:34 +0000 (15:19 -0400)]
add tb_version

2 years agoprevent compile-time option mismatch when used as library
Adam Saponara [Thu, 4 Aug 2022 05:37:58 +0000 (01:37 -0400)]
prevent compile-time option mismatch when used as library

2 years agoadd soname and install rules
Adam Saponara [Tue, 2 Aug 2022 02:43:37 +0000 (22:43 -0400)]
add soname and install rules

3 years agoadd examples in other languages
Adam Saponara [Tue, 5 Jul 2022 04:42:16 +0000 (00:42 -0400)]
add examples in other languages

3 years agoadd .gitignore
Adam Saponara [Mon, 27 Jun 2022 01:01:22 +0000 (21:01 -0400)]
add .gitignore

3 years agofactor out ffi creation
Adam Saponara [Sun, 26 Jun 2022 20:06:30 +0000 (16:06 -0400)]
factor out ffi creation

3 years agoadd TODO about resize errors
Adam Saponara [Sat, 25 Jun 2022 03:37:05 +0000 (23:37 -0400)]
add TODO about resize errors

3 years agodocument optimistic nature of tb_set_output_mode (#37)
Adam Saponara [Sat, 25 Jun 2022 03:27:44 +0000 (23:27 -0400)]
document optimistic nature of tb_set_output_mode (#37)

3 years agomake resize immediate
Adam Saponara [Tue, 21 Jun 2022 23:39:56 +0000 (19:39 -0400)]
make resize immediate

3 years agoadd demo image
Adam Saponara [Sat, 18 Jun 2022 04:39:58 +0000 (00:39 -0400)]
add demo image

3 years agoswitch back to select() as poll() is broken on implementations like mac OS
git-bruh [Wed, 15 Jun 2022 11:12:23 +0000 (16:42 +0530)]
switch back to select() as poll() is broken on implementations like mac OS

3 years agoconvert test_mod from xvkdb- to memfd-based test (was flaky)
Adam Saponara [Sat, 4 Jun 2022 22:43:54 +0000 (18:43 -0400)]
convert test_mod from xvkdb- to memfd-based test (was flaky)

3 years agoRun tests for non-truecolor and non-egc builds.
Adam Saponara [Sat, 4 Jun 2022 21:27:20 +0000 (17:27 -0400)]
Run tests for non-truecolor and non-egc builds.

This patch introduces a few new things:

* Build artifact termbox.ffi.h for easier FFI header file parsing. As a result, no more `__ffi_strip` bs, but probably more complex overall. The other idea I had would have been uglier. I think the test coverage is worth it.

* Functions `tb_has_truecolor` and `tb_has_egc` for determining support for those features at runtime.

* Test container uses `debian:11-slim` image instead of `debian:10-slim`.

* Test container uses PHP 8 instead of PHP 7.

* Test container now accepts `cflags` build argument.

* Tests can now be skipped via `$test->skip()`.

* Test suite covers 3 different builds: normal, non-truecolor, non-egc.

3 years agoadd a few missing if_err_return and fmt
Adam Saponara [Fri, 3 Jun 2022 23:51:52 +0000 (19:51 -0400)]
add a few missing if_err_return and fmt

3 years agofix non-truecolor (#26)
Adam Saponara [Fri, 3 Jun 2022 23:50:48 +0000 (19:50 -0400)]
fix non-truecolor (#26)

3 years agoadd `TB_BLINK` and `TB_TRUECOLOR_*` attributes (#16)
Adam Saponara [Wed, 1 Jun 2022 02:05:14 +0000 (22:05 -0400)]
add `TB_BLINK` and `TB_TRUECOLOR_*` attributes (#16)

3 years agoupdate docs concerning style attributes (#24)
Adam Saponara [Tue, 31 May 2022 01:35:18 +0000 (21:35 -0400)]
update docs concerning style attributes (#24)

in particular, document the hidden feature of applying `TB_BOLD` as a
background attribute, which emits `TB_CAP_BLINK`.

3 years agoClarify what 0x08-0x0f in TB_OUTPUT_256 means, a bit
Mitchell Rosen [Mon, 2 May 2022 19:58:29 +0000 (15:58 -0400)]
Clarify what 0x08-0x0f in TB_OUTPUT_256 means, a bit

3 years agoupdate docs for TB_INPUT_MOUSE (#20)
Adam Saponara [Mon, 2 May 2022 17:04:57 +0000 (13:04 -0400)]
update docs for TB_INPUT_MOUSE (#20)

3 years ago[0..216] -> [0..215]
Mitchell Rosen [Mon, 2 May 2022 02:35:25 +0000 (22:35 -0400)]
[0..216] -> [0..215]

3 years agoupdate readme with examples (#19)
Adam Saponara [Sun, 27 Feb 2022 22:41:37 +0000 (17:41 -0500)]
update readme with examples (#19)

3 years agoadd build rule for static lib
Adam Saponara [Sun, 27 Feb 2022 22:41:06 +0000 (17:41 -0500)]
add build rule for static lib

3 years agodefine required feature test macros
Adam Saponara [Sun, 27 Feb 2022 22:40:31 +0000 (17:40 -0500)]
define required feature test macros

3 years agoActually fix non-truecolor build
git-bruh [Wed, 26 Jan 2022 07:23:57 +0000 (12:53 +0530)]
Actually fix non-truecolor build

3 years agofix build without truecolor
git-bruh [Tue, 25 Jan 2022 08:56:15 +0000 (14:26 +0530)]
fix build without truecolor

3 years agosave errno in resize handler, deinit signal handler in tb_shutdown()
git-bruh [Mon, 10 Jan 2022 11:32:26 +0000 (17:02 +0530)]
save errno in resize handler, deinit signal handler in tb_shutdown()

3 years agoprevent emitting attrs in true-color mode
Adam Saponara [Tue, 25 Jan 2022 03:59:07 +0000 (22:59 -0500)]
prevent emitting attrs in true-color mode

3 years agofix some warnings
Adam Saponara [Mon, 10 Jan 2022 02:56:59 +0000 (21:56 -0500)]
fix some warnings

3 years agofmt termbox.h
Adam Saponara [Mon, 10 Jan 2022 02:56:39 +0000 (21:56 -0500)]
fmt termbox.h

3 years agoadd mouse support
Wolf Gupta [Mon, 10 Jan 2022 02:43:35 +0000 (08:13 +0530)]
add mouse support

3 years agoadd test for f715214
Adam Saponara [Fri, 7 Jan 2022 00:31:58 +0000 (19:31 -0500)]
add test for f715214

3 years agofix `#define` regex in tests
Adam Saponara [Fri, 7 Jan 2022 00:10:36 +0000 (19:10 -0500)]
fix `#define` regex in tests

3 years agoinclude tb_init_rwfd in api
Adam Saponara [Thu, 6 Jan 2022 06:36:10 +0000 (01:36 -0500)]
include tb_init_rwfd in api

3 years agofix bug in `extract_esc_cap`.
Adam Saponara [Thu, 6 Jan 2022 06:06:30 +0000 (01:06 -0500)]
fix bug in `extract_esc_cap`.

previously we were able to read past the actual end of the
input buffer (`global.in.buf`). we would not segfault due
to how bytebufs are implemented, but we could erroneously
re-process segments of input. in practice i think this
could only occur with an instantaneous burst of tty input
greater than the read buffer in `wait_event` (64 bytes). i
noticed this by accidentally mouse-wheeling very fast in
xfce4-terminal which, in my setup, sends a bunch of
up-arrow events (`\x1bOA`) all at once, in which case
termbox was pseduo-randomly emitting "O" and "A" events.

3 years agoadd test for tb_strerror
Adam Saponara [Thu, 6 Jan 2022 05:15:14 +0000 (00:15 -0500)]
add test for tb_strerror

3 years agorecompile in container before running tests
Adam Saponara [Thu, 6 Jan 2022 03:30:37 +0000 (22:30 -0500)]
recompile in container before running tests

3 years agoadd tb_strerror (#11)
Wolf Gupta [Thu, 6 Jan 2022 03:28:45 +0000 (08:58 +0530)]
add tb_strerror (#11)

3 years agouse github actions for ci
Adam Saponara [Fri, 31 Dec 2021 06:43:30 +0000 (01:43 -0500)]
use github actions for ci

3 years agoadd and apply `.clang-format`
git-bruh [Mon, 27 Dec 2021 02:04:27 +0000 (21:04 -0500)]
add and apply `.clang-format`

3 years agoexpose internal fds for external polling
git-bruh [Wed, 15 Dec 2021 11:12:01 +0000 (16:42 +0530)]
expose internal fds for external polling

3 years agoupdate inline docs (#4).
Adam Saponara [Fri, 10 Dec 2021 02:07:38 +0000 (21:07 -0500)]
update inline docs (#4).

specifically document return code TB_ERR_SELECT on
tb_peek/poll_event.

3 years agoadd regression test for #3
Adam Saponara [Sun, 28 Nov 2021 18:55:10 +0000 (13:55 -0500)]
add regression test for #3

3 years agoprevent segfault in `tb_deinit` when TERM is invalid
git-bruh [Sun, 28 Nov 2021 18:54:02 +0000 (13:54 -0500)]
prevent segfault in `tb_deinit` when TERM is invalid

3 years agoadd test case for `tb_printf_ex`
Adam Saponara [Sun, 28 Nov 2021 18:24:07 +0000 (13:24 -0500)]
add test case for `tb_printf_ex`

3 years agoadd `tb_print_ex` and `tb_printf_ex`.
git-bruh [Sun, 28 Nov 2021 18:21:04 +0000 (13:21 -0500)]
add `tb_print_ex` and `tb_printf_ex`.

these functions have an optional `out_w` param that
receives the printed width of the string if specified.

3 years agoadd readme
Adam Saponara [Sun, 24 Oct 2021 00:48:05 +0000 (20:48 -0400)]
add readme

3 years agoreplace linear cap search with trie.
Adam Saponara [Sun, 19 Sep 2021 01:07:56 +0000 (21:07 -0400)]
replace linear cap search with trie.

for every input, termbox used to iterate over termcaps one
at a time, `strncmp`ing it to the input buffer. the benefit
of this approach was that it had a very simple
implementation. the downside was that it was inefficient,
increasingly so as we added more caps such as modified
arrow keys.

the trie makes it easy to detect when there are overlaps in
termcaps. the obvious one is `TB_KEY_ESC` versus all other
escape codes. in the future we can modify function
`extract_esc_cap` to, e.g., potentially return `TB_KEY_ESC`
in `TB_INPUT_ALT` mode if no further input is available
after a certain amount of time.

3 years agoadd license header
Adam Saponara [Sun, 19 Sep 2021 01:05:52 +0000 (21:05 -0400)]
add license header

3 years agoadd cap kcbt (TB_KEY_BACK_TAB)
Adam Saponara [Sun, 19 Sep 2021 01:05:17 +0000 (21:05 -0400)]
add cap kcbt (TB_KEY_BACK_TAB)

3 years agotermbox rewrite (wip)
Adam Saponara [Tue, 7 Sep 2021 01:53:45 +0000 (21:53 -0400)]
termbox rewrite (wip)