Commit Graph

226 Commits (3d75f674655e0e1637e12932e203336cb5777a5a)

Author SHA1 Message Date
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