Commit Graph

410 Commits (489ad88954bec815a400d3a62e15734397c628cb)

Author SHA1 Message Date
nick black 6edc6f098f
streamline unit test common initialization 4 years ago
nick black dcaf29323c
plane_rotate: fix unit tests 4 years ago
nick black 30f049d2e6
metric: don't allow scales that cause overflow #611 4 years ago
nick black c01d0b227f
ncmetric unit tests for small values #607 4 years ago
nick black b7a9b11f0c
test::reset_terminal(): properly check tigetstr() 4 years ago
nick black 25fee034cb
ncplot: print EGC before breaking on small glyph #605 4 years ago
nick black 1c2f92b3bc
ncmetric: replace u with µ, define *COLUMNS #540 4 years ago
Nick Black f602c440a6
ncvisual_rotate() for arbitrary radians (#600)
* normal/visual: need dup stdplane for rotate
* add ncplane_center(), unit tests
* ncplane_center_abs(): add, unit tests
* ncvisual_bounding_box() for #599
* ncvisual_rotate(): works via bounding box #599
* normal demo: comment out broken section
* rotate: resize underlying plane as needed #599
* ncvisual_rotate: support negative rads #599
4 years ago
nick black 9a80750316
notcurses_canopen: split into images/videos #598 4 years ago
nick black 999c6c0742
geometry unit tests: shut down nc in finalizer 4 years ago
nick black 99d05f67e7 add ncplane_center(), unit tests 4 years ago
nick black 0bab14f654 tester: enable Visual tests #325 4 years ago
nick black d9bb9b03af notcurses-tester: run passing tests in C locale #325 4 years ago
nick black 646b8ba4a5
rotate unit test: don't depend on size 4 years ago
nick black fbed12cd80
ncreel_options: add flag field #590 4 years ago
nick black eaaa36f0c8
ncreader: ncplane as first arg #590 4 years ago
nick black fec423264f
selector: undo switch to notcurses from ncplane 4 years ago
nick black 5a3e0625a4
enmetric unit tests: kill duplicated fesetround() 4 years ago
nick black 1c394dc103 modernize c++ according to clang-tidy-11 4 years ago
nick black e2a94817e7 tests: lots of NULL->nullptr 4 years ago
nick black 989ca7ff9a selector->ncselector, multiselector -> ncmultiselector #580 4 years ago
nick black 4e94d942b0 reader unit test visualization #403 4 years ago
nick black d174431187 ncreader_create: accept const options #403 4 years ago
nick black 7683973ee4 ncreader_options, bad options tests #403 4 years ago
nick black 4819c0e1c3 selector/multiselect: accept notcurses 4 years ago
nick black c0c76342a8
rotate test: relax ncvisual_render() checks 4 years ago
nick black cbf46402f8
tests: portable find_data() 4 years ago
nick black ed548ab590
tests: apply clang modernizations 4 years ago
nick black a571f4daaa
tests/wide.cpp: use modern range loop 4 years ago
nick black 173af7b3c6
unit test upper left of rotated visual #569 4 years ago
nick black f84435f708
unit test ncplane_rgba() #569 #559 4 years ago
nick black 43a685be1e
ncsubproc: update unit tests for exit propagation #554 4 years ago
nick black 94fcada67c
ncvisual_rotate: unify _cw/_ccw, take radians 4 years ago
nick black f63325db60 Lots of ncvisual work
Unify ffmpeg/oiio/null implementations, where possible. This effectively
required placing all three in the same file, which meant they're all now
C++. Update FFmpeg implemenation to be C++-usable. Implement
ncvisual_rotate_cw() and ncvisual_rotate_ccw() #515. Move most of tetris
over to Visual from Plane #558. Add bgra_to_rgba(), necessary for
creating ncvisual from BGRA memory. Implement ncvisual_from_rgba()
and ncvisual_from_bgra() #557. Add unit tests on ncvisual rotation.
4 years ago
nick black 39548acc3a rename ncvisual_open_plane->ncvisual_from_file() #560 4 years ago
nick black cd2cbd0d88
export enforce_utf8() via internal.h #451 4 years ago
nick black c8322e6cb1
ncfdplane: on non-following planes, break out on 0 read 4 years ago
nick black a23efbb463
rigourize ncsubproc destruction
We need support three distinct paths for destruction of
ncsubprocs: (1) external call to ncsubproc_destroy() while
the subprocess is running, (2) external call to
ncsubproc_destroy() after the subprocess has terminated, and
(3) internal call to ncsubproc_destroy() without any external
call. To do this properly, we always waitid() on the subprocess
in our ncsubproc thread, and do not cancel said thread. This
guarantees that the subprocess has been reaped if the thread
has exited. We throw a pidfd_send_signal() into the thread
prior to the waitid(), because this is safe with pidfds. The
thread reclaims no resources otherwise. ncsubproc_destroy(),
instead, reclaims them, after joining the ncsubproc thread.
It sends SIGKILL before the join, which is once again safe
thanks to pidfds. Resolves #552.
4 years ago
nick black c9088ff37b
subproc unit test rename 4 years ago
nick black e156bd42be
plot: match delete, not free, with new 4 years ago
nick black 5210e410f4
visual unit test: use notcursesI.avi, which OIIO can decode #547 4 years ago
nick black 294e8fd90a
subproc tests: pass outofline_cancelled through as curry 4 years ago
nick black 36bfa45d6c
notcurses-tester: fix double-free 4 years ago
nick black 595dd20950
cells unit test: downgrade problematic unicode to WARN #517 4 years ago
Nick Black 9a075ae5d0
Support image decoding with OpenImageIO #453 (#534)
* fedora: dep on OpenImageIO, and use it
* fedora: dep on libqrcodegen-devel
* fedora: BuildRequires OpenEXR-devel
* tight check on USE_MULTIMEDIA
* CMake: enable notcurses-view for ffmpeg OR oiio
* notcurses-view: don't reach into libav
* oiio: ncvisual_render() #453
* oiio: need our own properly-offset ncvisual_plane()
* `visual` poc: accept optional command line argument
* oiio: work for 3-channel images #453
* oiio: destroy ncvisual's plane if we own it #453
* notcurses_visual.3: s/FFmpeg/multimedia/g
4 years ago
nick black 0b4ada19b1 Remove AVFrame from API #532 4 years ago
nick black 21822f98e7 fix up averr->ncerr #532 4 years ago
nick black ad0685aa1b switch to nc_err_e #532 4 years ago
nick black d81b3ef0cf start factoring out FFMpeg for OIIO plug #453 4 years ago
Nick Black 0e73b9d3d5
Floating-point ncplot, genericize ncplot (#531)
* compile ncplot as c++ generic #446
* add floating-point plots #446
4 years ago
nick black 5a017574f6
ncsubproc tests: don't rely on /etc/ files 4 years ago
nick black 34629688d9
interpret NULL second argument to *_init() as stdout 4 years ago
nick black 3e853f6635
ncsubproc: map new pipe onto stdio #310 4 years ago
nick black 04f90fa1ea
ncsubproc: launch processes, make pipes
link to LWN article in History section of README.md.
4 years ago
nick black 6304bc73e3
tester: better terminal restoration #240 4 years ago
Nick Black fe8034b5e0
ncfdplane, fileroller PoC, ncfdplane unit tests, qrcodes #24 #514 (#524)
* first draft of ncsubproc spec
* qrcode first draft #24
* demo: add qrcode demo skeleton, entries #24
* qrcode demo #24
* fedora python build changes from @dcantrell
* ncplane_qrcode() works #24
* add some flash to the qrcode demo #24
* drone: use newest builders
* fix up rgb PoC
* drop jungle demo to 100Hz target
* add fd.c
* ncfd skeletons
* more ncfdplane #514
* ncfdp i/o loop
* ncfp: improve uinit test, write core
* firm up ncfdplane #514
* fileroller PoC #514
* ncplane: allow '\n' in stream when scrolling #523
4 years ago
nick black 483470f777
tester: restore terminal on early exit #240 4 years ago
nick black 4823098316
Hurd: uint64_t is ULL, fix up printf format/constants #519 4 years ago
nick black 9e28e14001
move enforce_utf8() into main 4 years ago
nick black 0a6f5d1a9f
enforce_utf8() for wide tests, duh 4 years ago
nick black 11600b6820
ensure UTF8 for metric tests 4 years ago
Nick Black c6a9997554
Normalize ncplane_at_* / ncplane_set_base() (#479)
* ncplane_at_* and ncplane_at_cursor_*

We had notcurses_at_yx() expanding into three distinct parts of
the cell structure, and ncplane_at_yx() / ncplane_at_cursor()
writing directly to a cell. It was annoying to remember which
was which. The latter two now have a signature matching
notcurses_at_yx(), while the old functionality has been moved
to ncplane_at_yx_cell() and ncplane_at_cursor_yx(). #476
4 years ago
nick black d274af34b9 ncplot: define 2x2 and 4x2 sets #461 4 years ago
nick black 355ea6d3d7
Allow EGCpools up to 1GB #425 4 years ago
nick black a4e1d68786
Add ExhaustPool unit test #482 4 years ago
nick black 327c9cba78 Scrolling! all unit tests work #443 4 years ago
nick black b385feef8f zero out newly-scrolled lines #443 4 years ago
nick black 646bcf3db2 finish out ScrollingOffBottom test #443 4 years ago
nick black 40fd887012 New unit test for scrolling ScrollingOffBottom #443 4 years ago
nick black ad9828e808 add ScrollingBoxen unit test 4 years ago
nick black d98f89c167
check channels in WidePlaneAtopNarrow test #475 4 years ago
nick black 87136c37d3
flesh out two more Wide+Narrow tests #475 4 years ago
nick black 05cdd1514b pull in PlaneStompsWideGlyph from render.cc 4 years ago
nick black 1c41705d99 flesh out NarrowPlaneAtopWide unit test #475 4 years ago
nick black 295ae0a8d0
extract wide glyph unit tests into their own file #475 4 years ago
nick black b0fc654444 Check that cell is not wide right in render #362 4 years ago
nick black b0aa6b9a7f simplify wide handling in putc_yx #362 4 years ago
nick black e6a80ab98d Strip down OverWide unit test 4 years ago
nick black d26b111f35 new unit test Ncplane::OverWide #362 4 years ago
nick black e005940acf
ncplot: fix unit tests following #457 (#464) 4 years ago
Nick Black c2a645e9af
Rust wrapper work (#454)
* packaging: s/libtinfo/Terminfo/g
* rust: add stddim_yx()
* rust: check for valid init in unit tests
* rust: serialize up tests
* constify notcurses_term_dim_yx()
* rust: add dim wrappers
* remove notcurses_resize() from public API #367
* call notcurses_resize() from notcurses_refresh() #367
4 years ago
nick black a7f17040ce another scrolling unit test 4 years ago
nick black 601e84df83 another scrolling unit test #323 4 years ago
nick black 0f12bcdb4c add 2 scrolling unit tests, both currently fail #323 4 years ago
nick black c0f8d9b444
eliminate detectdomain, infer it from maxy==miny #439 4 years ago
nick black 6b74ea7718 plot: fix off-by-one on wide window shift, asdd unit test 4 years ago
nick black fc2dc68619 AugmentCycle2 Unit Test #430 4 years ago
nick black a3f7dd486b plot: AugmentSample5 test case 4 years ago
nick black 5bccf6b446 ncplot: implement x windowing #430 4 years ago
nick black b3cda0d09f notcurses-keyplot: throw a perimeter around base plane 4 years ago
nick black d2fe768c30 plot unit tests #430 4 years ago
nick black e87fbb3003 Throw up an ncplot unit test 4 years ago
nick black a45d888601
All fill-type functions return cells changed
Fill-type functions used to return 0 for success, and -1
on failure. They now return the number of cells written
on success, similarly to ncvisual_render(). Resolves #427.
4 years ago
nick black a3323fb22c
Enforce UTF8 where necessary in unit tests #428
Certain unit tests required UTF8 encoding on the output
terminal to work (#428). This includes anything which does
any kind of fill. Add enforce_utf8() checks to all such
tests that were missing them. Unit tests once again pass in
a pure ASCII environment.
4 years ago
nick black a77774f4dc
notcurses_at_yx(): value-result u32+u64, not cell
Resolves #410. notcurses_at_yx() accepted a cell*, but the
gcluster of this cell was always set to 0. The EGC is instead
a heap-allocated copy, returned as the primary return value.
This is due to the absence of an egcpool to bind against.
Existing callers can be converted thus:

* instead of passing cell 'c', pass &(c)->attrword, &(c)->channels
* either initialize 'c' with CELL_TRIVIAL_INITIALIZER, or set its
   gcluster field to 0 following the call

I've updated all calls from tests/demos, updated the docs, and
updated the C++ and Python wrappers.
4 years ago
nick black 73b61f6a69 Add bound planes (#71) plus docs/tests
Add ncplane_bound(3). This allows a new plane N to be created in the
*bound* state relative to another ncplane B. If B moves, N moves the
same amount. If N is moved, the coordinates are taken relative to B
as opposed to the standard plane. If B is destroyed, N is destroyed.
Each plane can have many planes bound to it, but can only be bound to
a single plane. Add ncplane_reparent(3). This allows a plane to be
detached from any plane to which it is bound, and optionally rebound
to a new plane. The standard plane cannot be reparented.
Documentation and unit tests have been added for both.
4 years ago
nick black ae1421db15
ncvisual_render() API change/documentation #422
ncvisual_render() now returns the number of cells emitted
rather than just 0/-1. -1 is still returned on failure.
Rather than 0 for length meaning "all possible length", it
now means 0, and -1 means "all possible length". All demos,
tests, and PoCs have been updated. #422
4 years ago
Nick Black 2b7b384e91
Most of notcurses-tetris, mergedown fixes (#420)
* ncplane_mergedown() fix for small planes #417
* tetris game needed for the book
4 years ago
nick black c3feca6ded ncplane_polyfill: reject null glyph + test #418 4 years ago
nick black 7e71ad8e11 implement ncplane_mergedown() #361 4 years ago
nick black eead4c1414
notcurses_highgradient() added #398 4 years ago
Nick Black 4e58747709
ncplane_rotate_cw() and ncplane_rotate_ccw() (#396)
Introduce limited plane rotation capability. We currently support clockwise and counterclockwise rotation of planes. Square and rectangular geometries are both supported, but there must be an even number of columns. The atomic unit of rotation is a 2x1 "square" (this assumes .5 cell aspect ratio). We can only rotate those glyphs which have rotated equivalents, and not even all of those. We currently handle only:

* null glyph
* space
* upper half block
* lower half block
* full block

I've added unit tests as well. This functionality is used by our Tetris example in the book
4 years ago
nick black 3498956370
ncplane_mouseevent_p()->ncplane_translate_abs()
ncplane_mouseevent_p() is retired--it was poorly named, and
ncplane_translate_abs() does what it does, plus more, plus
more generally (it works on any y, x, not necessarily an
ncinput). update c++ wrappers #394.
4 years ago
nick black bb579d0d05
notcurses_directmode()->ncdirect_init() 4 years ago
nick black 5b4c6c14e3
gradient: implement + test 1d fills 4 years ago
nick black 40428fd05e
Cell: non-OPAQUE always sets non-default bit 4 years ago
nick black 9b0603bb32
Implement + test ncplane_mouseevent_p() #305 4 years ago
Nick Black 745e742a12
Fix gradient engine #368 (#372)
Simplify and correct the gradient engine, resolving all test breakage.
4 years ago
nick black 002e8be574
implement ncplane_format() #347 4 years ago
nick black 35d850f008
Implement + test ncplane_putegc_stainable() #352 4 years ago
Nick Black e6637e81cc
Prep for serious rusting #101 (#354)
* CMake: add USE_PANDOC, USE_DOXYGEN options #101
* README: mention rust
* start integrating rust into build #101
* CMake: add USE_NETWORK option for cargo
* Debian: build-dep on doxygen
* rust: colloquy checks in Cargo.lock
* extract NCKEY defines into their own include
* colloquy: use clap to parse CLI args
* CMake: unify option namespace
* Python: update include path
* Rust: fix up --frozen workings for -DUSE_NETWORK=off
* CMake: abstract out colloquy a little
* Sync direct.hh to the New Way
4 years ago
nick black 39d5063518
Yank out our copy of doctest, use system copy 4 years ago
nick black 438ee1257b
remove doctest, rely on system 4 years ago
nick black 2114cc2eda demo: rewrite handloop with ncplane_gradient() 4 years ago
nick black 7addd06341 more gradient work, more unit tests #340 4 years ago
nick black 61fe5f5b7e gradient + unit test #340 4 years ago
nick black c6520ab84c add notcurses_drop_planes, use from demo #346 4 years ago
nick black 124004c87c add nplane_polyfill_yx() #340 4 years ago
nick black 9fc53e811f
ncplane_perimeter() plus unit test 4 years ago
nick black d8c42d4d1e
ncmenu_selected() fills in an ncinput #333 4 years ago
nick black 08bef99244
Debian: remove comments from watch file 4 years ago
nick black 74b9690cf3
ncmenu: remove dumb restrictions/special casing 4 years ago
nick black 71dbfd74f7 ncmenu: step around alignment NULL #332 4 years ago
nick black b7a92e0321
notcurses-tester(1) man page #326 4 years ago
nick black 0a6fddb549
blend test: fix uninitialized var 4 years ago
nick black 01d160f40b
menu test: work with older Clang 4 years ago
nick black 8d7e6482dd
test: use utf-8 rather than unicode literal 4 years ago
nick black 736717f58b
DFSG: unit test using only free multimedia #326 4 years ago
nick black 3cdac5ce28 high-contrast text, simple linear average model #181 4 years ago
nick black 85e377e652
Accept US-ASCII/C encoding, with warning. 4 years ago
nick black 74775b97ec
enmetric->ncmetric #324 4 years ago
nick black 89f516dcaa
tablet->nctablet, add ncreel to python #324 4 years ago
nick black c519c95fff
panelreel -> ncreel #324 4 years ago
nick black b284901d18
prep for 1.1.6 4 years ago
nick black 4d613217b3
ncmenu: only allow one at a time 4 years ago
nick black 10a269c963
ncmenu: reject double menu 4 years ago
nick black 039a390877
ncmenu: print item shortcut aligned right #179 4 years ago
nick black 79a92fcfb1
ncmenu: highlight shortcut keys for menu items 4 years ago
nick black 3821b66bc7
menu: highlight (bold+uline) section shortcuts 4 years ago
nick black 17c21a2c7b
menu unit test for long menu 4 years ago
nick black 5cd4fc9a1f
menu: reject empty sections #179 4 years ago
nick black 5cf1bba5f5
menu: unit test with section #179 4 years ago
nick black 31a07dab33
menu: extend across width of screen #179 4 years ago
nick black 54c57b3487 s/CELL_STYLE/NCSTYLE/ throughout 4 years ago
nick black 8984422f1e basics of menu #179 4 years ago
nick black fad612bd2f
Use column width in selector calculations #302 4 years ago
nick black 5982707f9e
add mbswidth() function, unit tests, docs 4 years ago
nick black be133b0105
unit tests for scrolling selector 5 years ago
nick black 3991b3e53a
selector: implement maxdisplay. unit tests! 5 years ago
nick black ac2b951fa9
ncselector_selected(), unit tests 5 years ago