Commit Graph

298 Commits

Author SHA1 Message Date
nick black
d274af34b9 ncplot: define 2x2 and 4x2 sets #461 2020-04-16 11:41:20 -04:00
nick black
355ea6d3d7
Allow EGCpools up to 1GB #425 2020-04-15 23:49:10 -04:00
nick black
a4e1d68786
Add ExhaustPool unit test #482 2020-04-15 16:36:17 -04:00
nick black
327c9cba78 Scrolling! all unit tests work #443 2020-04-15 11:37:57 -04:00
nick black
b385feef8f zero out newly-scrolled lines #443 2020-04-15 11:37:57 -04:00
nick black
646bcf3db2 finish out ScrollingOffBottom test #443 2020-04-15 11:37:57 -04:00
nick black
40fd887012 New unit test for scrolling ScrollingOffBottom #443 2020-04-15 11:37:57 -04:00
nick black
ad9828e808 add ScrollingBoxen unit test 2020-04-15 11:37:57 -04:00
nick black
d98f89c167
check channels in WidePlaneAtopNarrow test #475 2020-04-14 10:50:53 -04:00
nick black
87136c37d3
flesh out two more Wide+Narrow tests #475 2020-04-14 10:39:38 -04:00
nick black
05cdd1514b pull in PlaneStompsWideGlyph from render.cc 2020-04-14 05:17:16 -04:00
nick black
1c41705d99 flesh out NarrowPlaneAtopWide unit test #475 2020-04-14 05:17:16 -04:00
nick black
295ae0a8d0
extract wide glyph unit tests into their own file #475 2020-04-13 23:12:10 -04:00
nick black
b0fc654444 Check that cell is not wide right in render #362 2020-04-12 07:07:02 -04:00
nick black
b0aa6b9a7f simplify wide handling in putc_yx #362 2020-04-12 07:07:02 -04:00
nick black
e6a80ab98d Strip down OverWide unit test 2020-04-12 07:07:02 -04:00
nick black
d26b111f35 new unit test Ncplane::OverWide #362 2020-04-12 07:07:02 -04:00
nick black
e005940acf
ncplot: fix unit tests following #457 (#464) 2020-04-10 11:22:26 -04:00
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
2020-04-08 05:39:41 -04:00
nick black
a7f17040ce another scrolling unit test 2020-04-05 23:54:38 -04:00
nick black
601e84df83 another scrolling unit test #323 2020-04-05 23:54:38 -04:00
nick black
0f12bcdb4c add 2 scrolling unit tests, both currently fail #323 2020-04-05 23:54:38 -04:00
nick black
c0f8d9b444
eliminate detectdomain, infer it from maxy==miny #439 2020-04-04 08:56:31 -04:00
nick black
6b74ea7718 plot: fix off-by-one on wide window shift, asdd unit test 2020-04-03 08:27:08 -04:00
nick black
fc2dc68619 AugmentCycle2 Unit Test #430 2020-04-03 05:51:02 -04:00
nick black
a3f7dd486b plot: AugmentSample5 test case 2020-04-03 05:51:02 -04:00
nick black
5bccf6b446 ncplot: implement x windowing #430 2020-04-03 05:51:02 -04:00
nick black
b3cda0d09f notcurses-keyplot: throw a perimeter around base plane 2020-04-03 05:51:02 -04:00
nick black
d2fe768c30 plot unit tests #430 2020-04-03 05:51:02 -04:00
nick black
e87fbb3003 Throw up an ncplot unit test 2020-04-03 05:51:02 -04:00
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.
2020-03-29 05:26:56 -04:00
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.
2020-03-29 04:46:30 -04:00
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.
2020-03-27 03:49:13 -04:00
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.
2020-03-27 03:13:30 -04:00
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
2020-03-24 18:43:10 -04:00
Nick Black
2b7b384e91
Most of notcurses-tetris, mergedown fixes (#420)
* ncplane_mergedown() fix for small planes #417
* tetris game needed for the book
2020-03-23 01:12:09 -04:00
nick black
c3feca6ded ncplane_polyfill: reject null glyph + test #418 2020-03-22 23:10:13 -04:00
nick black
7e71ad8e11 implement ncplane_mergedown() #361 2020-03-21 05:09:31 -04:00
nick black
eead4c1414
notcurses_highgradient() added #398 2020-03-08 04:05:55 -04:00
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
2020-03-07 18:36:49 -05:00
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.
2020-03-03 00:59:44 -05:00
nick black
bb579d0d05
notcurses_directmode()->ncdirect_init() 2020-03-02 20:19:16 -05:00
nick black
5b4c6c14e3
gradient: implement + test 1d fills 2020-02-24 22:54:21 -05:00
nick black
40428fd05e
Cell: non-OPAQUE always sets non-default bit 2020-02-23 12:11:28 -05:00
nick black
9b0603bb32
Implement + test ncplane_mouseevent_p() #305 2020-02-23 03:50:17 -05:00
Nick Black
745e742a12
Fix gradient engine #368 (#372)
Simplify and correct the gradient engine, resolving all test breakage.
2020-02-22 21:00:03 -05:00
nick black
002e8be574
implement ncplane_format() #347 2020-02-21 06:52:57 -05:00
nick black
35d850f008
Implement + test ncplane_putegc_stainable() #352 2020-02-20 04:41:56 -05:00
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
2020-02-18 12:36:16 -05:00
nick black
39d5063518
Yank out our copy of doctest, use system copy 2020-02-17 21:04:54 -05:00
nick black
438ee1257b
remove doctest, rely on system 2020-02-17 17:36:27 -05:00
nick black
2114cc2eda demo: rewrite handloop with ncplane_gradient() 2020-02-16 11:21:21 -05:00
nick black
7addd06341 more gradient work, more unit tests #340 2020-02-16 11:21:21 -05:00
nick black
61fe5f5b7e gradient + unit test #340 2020-02-16 11:21:21 -05:00
nick black
c6520ab84c add notcurses_drop_planes, use from demo #346 2020-02-16 11:21:21 -05:00
nick black
124004c87c add nplane_polyfill_yx() #340 2020-02-14 05:38:08 -05:00
nick black
9fc53e811f
ncplane_perimeter() plus unit test 2020-02-12 12:29:28 -05:00
nick black
d8c42d4d1e
ncmenu_selected() fills in an ncinput #333 2020-02-12 09:11:28 -05:00
nick black
08bef99244
Debian: remove comments from watch file 2020-02-11 18:35:37 -05:00
nick black
74b9690cf3
ncmenu: remove dumb restrictions/special casing 2020-02-10 15:18:28 -05:00
nick black
71dbfd74f7 ncmenu: step around alignment NULL #332 2020-02-09 06:30:17 -05:00
nick black
b7a92e0321
notcurses-tester(1) man page #326 2020-02-08 22:58:46 -05:00
nick black
0a6fddb549
blend test: fix uninitialized var 2020-02-08 22:29:19 -05:00
nick black
01d160f40b
menu test: work with older Clang 2020-02-08 22:24:31 -05:00
nick black
8d7e6482dd
test: use utf-8 rather than unicode literal 2020-02-08 21:38:44 -05:00
nick black
736717f58b
DFSG: unit test using only free multimedia #326 2020-02-07 11:21:19 -05:00
nick black
3cdac5ce28 high-contrast text, simple linear average model #181 2020-02-07 09:19:08 -05:00
nick black
85e377e652
Accept US-ASCII/C encoding, with warning. 2020-02-06 22:05:48 -05:00
nick black
74775b97ec
enmetric->ncmetric #324 2020-02-05 20:18:11 -05:00
nick black
89f516dcaa
tablet->nctablet, add ncreel to python #324 2020-02-05 20:04:56 -05:00
nick black
c519c95fff
panelreel -> ncreel #324 2020-02-05 17:29:42 -05:00
nick black
b284901d18
prep for 1.1.6 2020-02-05 04:08:42 -05:00
nick black
4d613217b3
ncmenu: only allow one at a time 2020-02-04 00:17:51 -05:00
nick black
10a269c963
ncmenu: reject double menu 2020-02-04 00:08:03 -05:00
nick black
039a390877
ncmenu: print item shortcut aligned right #179 2020-02-03 23:55:19 -05:00
nick black
79a92fcfb1
ncmenu: highlight shortcut keys for menu items 2020-02-03 22:14:29 -05:00
nick black
3821b66bc7
menu: highlight (bold+uline) section shortcuts 2020-02-03 21:32:04 -05:00
nick black
17c21a2c7b
menu unit test for long menu 2020-02-03 15:20:40 -05:00
nick black
5cd4fc9a1f
menu: reject empty sections #179 2020-02-03 13:08:45 -05:00
nick black
5cf1bba5f5
menu: unit test with section #179 2020-02-03 12:46:40 -05:00
nick black
31a07dab33
menu: extend across width of screen #179 2020-02-02 06:02:57 -05:00
nick black
54c57b3487 s/CELL_STYLE/NCSTYLE/ throughout 2020-02-02 05:13:40 -05:00
nick black
8984422f1e basics of menu #179 2020-02-02 05:13:40 -05:00
nick black
fad612bd2f
Use column width in selector calculations #302 2020-01-31 19:51:14 -05:00
nick black
5982707f9e
add mbswidth() function, unit tests, docs 2020-01-31 19:00:51 -05:00
nick black
be133b0105
unit tests for scrolling selector 2020-01-30 19:57:39 -05:00
nick black
3991b3e53a
selector: implement maxdisplay. unit tests! 2020-01-30 19:37:21 -05:00
nick black
ac2b951fa9
ncselector_selected(), unit tests 2020-01-30 16:40:02 -05:00
Nick Black
da0283ac25
Selector widget #166, subtitles #95 (#301)
Get rid of annoying empty line in notcurses-view (and ncvisuals at offsets in general)
Implement most of the Selector widget. Need to add styling and scrolling still. #166
Reenable ubuntu focal build
Subtitles! We decode them, and display them in notcurses-view. If ncvisual_simple_streamer() is provided an extra ncplane, it will use it to display subtitles. #95
We now build Python by default, as things are working much better.
ncplane_set_base() now takes channel, attrword, and EGC, so you can usually avoid having to set up and release a cell. ncplane_set_base_cell() takes over duty from ncplane_set_base() for ease of conversion.
notcurses-demo and notcurses-view now both accept a 0 for delay multiplier, meaning 'go as fast as you possibly can'. Very small multipliers (e.g. 0.00001) no longer cause floating point exceptions.
fading routines no longer cause floating point exceptions on very small timescales.
2020-01-30 08:55:01 -05:00
nick black
ec5e857a6c
palette256: fix up unit tests 2020-01-19 04:04:13 -05:00
Nick Black
3d612aebcb
ruins color cycling demo #253 (#287)
* palette_set: update pal256 damage map #230
* drone: use newest builders
* palette: send oc on exit for color reset #285
* palette_new: copy existing palette in #230
* Python: use checkRGB everywhere
* more palette unit testing
* add ncplane_set_*_palindex()
* render fg palindex #230
* palette index color is out of 1000
* jungle demo works #253
2020-01-18 20:42:29 -05:00
nick black
3e9347a339
palette color: unit test for alpha clear 2020-01-17 11:49:21 -05:00
nick black
b02acd8631
Curry a void* to fader callbacks #284 2020-01-17 09:30:53 -05:00
nick black
08f6fa0e79 implement ncplane_dup() 2020-01-17 08:35:28 -05:00
nick black
38b2b3d075 render: fix bad reference in final pass 2020-01-17 08:35:28 -05:00
nick black
0e70304596 palette indexing: set up attributes #230 2020-01-17 08:35:28 -05:00
nick black
dfcdd10cb5 more palette support/testing #230 2020-01-17 08:35:28 -05:00
nick black
684bcdcc8c introduce palette256 #230 2020-01-17 08:35:28 -05:00
Nick Black
7ec022d067
Painter's algorithm #255 (#274)
* notcursesI.avi 30 -> 60fps
* painter's algorithm works #255
2020-01-14 03:51:11 -05:00
nick black
7c687faea0
pulsing text + unit test + docs #163 2020-01-14 01:09:37 -05:00