Commit Graph

532 Commits (99abcb5f0754fd946f3ed97beb08d4b26693d8e2)

Author SHA1 Message Date
nick black 0cee9bdb5c ReelsGap unit test #901 4 years ago
nick black de3737e8e1
ZAxis test: remaining fixup #906 4 years ago
nick black 3fbdab3020
pool_load_direct: zilch out entirety of gcluster #906 4 years ago
nick black 4e0296f222
zaxis unit tests: fix for inlined egcs #906 4 years ago
nick black c24ca8ab56
introduce ntole() #906 4 years ago
nick black 227738a8e5
SubprocAndFds tests: tighten up locking 4 years ago
nick black 4dd1d6a4c8 Annihilate nc_err_e and all infrastructure #948 4 years ago
nick black ea681ed4ec
libunistring: beef up unit test #906 4 years ago
nick black af80914efe
add libunistring unit tests #906 4 years ago
nick black 15b923c8cf adapt ncplane_mergedown() #779 4 years ago
nick black 14d6129007 take-no-prisoners overhaul of ncplane_puttext() #829 4 years ago
nick black df3dc7f8e7 LayoutNewlinesAtBorders unit test #829 4 years ago
nick black adab5ba382 LayoutNewlines unit test #829 4 years ago
nick black 97f3676588
layout unit tests: fill out checks #829 4 years ago
Nick Black 359ad1d36d
Generalized mergedown #779 (#932)
* Rename ncplane_mergedown -> ncplane_mergedown_simple()
* New ncplane_mergedown(), fully general projection of src to dst
4 years ago
nick black ed0d9d8a8e Wide unit tests; test other side 4 years ago
nick black 01249a0546 HigherGlyphAbides unit test 4 years ago
nick black bc0016b827 BigMult unit test, fix ncmetric bogon #929 4 years ago
nick black 0f2bb4efc6
wide tests: remove netinet/in.h 4 years ago
nick black 666bdb5fda
ncreel unit tests: call ncreel_destroy() 4 years ago
nick black 16ff667325 blissful endianness-opacity
not caring about endianness is the opiate of the masses.
happy, happy masses. remove endianness.h and all its baleful
influence by explicitly breaking up the cell structure. #892
4 years ago
nick black 7811663223 inlined EGCs + styling unit tests #830 4 years ago
nick black 55baa55541 wide tests: kill one last allocation 4 years ago
nick black 7f8631b35c wide tests: death to cowardly copying 4 years ago
nick black 3bc15c2824 inlined egcs: straightline cell_duplicate() 4 years ago
nick black 2656cad07a cell_duplicate_far() fix length issue 4 years ago
nick black 7ac3f68f4e cell_load: fix CELL_WIDEASIAN_MASK bug 4 years ago
nick black 1605416585 more egc-inline test fixes 4 years ago
nick black a0fc540286 fix up fill tests 4 years ago
Nick Black c3508d524b
ncplane_puttext() work for longer lines (#880)
* The zoo demo made manifest that we had some serious problems handling sequences of longer lines in ncplane_puttext(). This remedies most of the problems, though it's not yet perfect. #871
* Guard notcurses* for NULL in log*() #878 #879
* Fix memory leak in ncdirect_dump_plane()
4 years ago
nick black f0f3b9f45f
ThreeCycleDownNoTabletBorders unit test #818 4 years ago
Nick Black 11d6a4eb89
New reel layout algorithm #818 (#870)
New reel layout algorithm based on trimming and sifting. Fixes the original issue of #818, though I'm not marking that bug fixed until I've resolved the little issues remaining with this one.
Back off CMake version dependency, see if we can get by with 3.11.4 for EPEL8 #851
Simplify tablet drawing tremendously by separating tablet border and data planes. Callbacks no longer need worry about the borders; they can simply fill the plane they're handed. #833
Improve notcurses_debug() a bit
Add ncplane_new_named() and friends to expose plane naming to the user.
Add internal ncplane_genocide() to kill a plane and all its bound descendents
New industrial-strength ncreel unit testing
notcurses-ncreel now accepts -ln for log level n
Add ncplane_parent() and ncplane_parent_const()
4 years ago
nick black 4f5be0b100
tests: treat TERM=unknown like unset TERM #865 4 years ago
nick black 4ecee49777
selector unit test fixups for itemcount #831 4 years ago
nick black bac02bccd0
selector/multiselect: kill itemcount options field #831 4 years ago
nick black 384232efd1
layout tests: enforce utf8 where necessary 4 years ago
nick black 51a2817a8e
notcurses-tester: print LANG on startup 4 years ago
nick black b9ad7b9bd5 add LayoutTransPlanarWide unit test #815 4 years ago
nick black 357cba3843 ncplane_puttext: all unit tests work #815 4 years ago
nick black 243cbd6a92 fix LayoutFillsPlaneNoSpaces problems #815 4 years ago
nick black 1664e64617 add LayoutCrossBoundaryWide unit test #815 4 years ago
nick black 4adde41b05 Get LayoutFillsPlaneNoSpaces test working #815 4 years ago
nick black 8ee7b3652c Exceptions tests: use flags + loglevel 4 years ago
nick black bae1cedd6b Ncpp tests: supply NCOPTION_SUPPRESS_BANNERS | NCOPTION_INHIBIT_SETLOCALE 4 years ago
nick black a70cbb894c get complete widechar ncplane_puttext() working #815 4 years ago
nick black 380ebc7e6e add wide ncplane_puttext unit tests #815 4 years ago
nick black 604747c8f2 notcurses_puttext: use libunistring for wordbreaking #772 4 years ago
nick black 255b404842
ncplane_puttext(): start long words early
If we're fed a word that in and of itself is wider than
the text layout area, and it is not the first word on the
row on which it starts, go ahead and start it there, as
opposed to breaking the line. #720

Also, remove sgr from test suite, as it's not a notcurses
application.
4 years ago
nick black 97571e86af ncplane_putegc_yx() copies directly as opposed to going through putc() #797 4 years ago
nick black d46ca758a0 highcontrast: stash fgstate for later reapplication #748 4 years ago
nick black d9bfb52225 highcontrast: unit test for #748 4 years ago
nick black e0155c7d56 CELL_ALPHA_HIGHCONTRAST unit tests #748 4 years ago
Nick Black dbc83c41b3
linuxconsole PoC (#791)
* use ioctl(KDGETMODE) to detect Linux console
* diagnostic on KDGETMODE
* add logdebug()
* unit test for notcurses_drop_planes(), add ncplane_putnstr_aligned()
* linuxconsole PoC
* linuxconsole: dump unicode->font table
* linuxconsole: explode glyphs
* linuxconsole: show 7 glyphs per 'line'
* linuxconjammer: shim console font with half blocks
* signals: handler for SIGTERM
* man pages: update notcurses_init() for options
* add NCOPTION_NO_FONT_CHANGES #201
4 years ago
nick black 3a7dabd2c8
notcurses-tester: use -l6 4 years ago
nick black 20178290fc
Fill out some more C++ unit tests, basic ones #538 4 years ago
nick black 750f88b70a split direct into its own header 4 years ago
nick black 5512158fc5
postpaint(): no need to replace nul with space #777 4 years ago
nick black a97297192d
Exceptions unit test: drop bad stops 4 years ago
nick black 5e207f4158
unit test for merging down fills 4 years ago
nick black 460ba7683d
Exceptions: reenable CHECK_THROWS_AS specifier #538 4 years ago
nick black 3457ffb59f
FdsAndSubprocs test: use ncplane_putnstr(s) #778 4 years ago
Nick Black 162f9910c2
Tons of work on ncreel (#776)
Tons of work on ncreel (#627, #749, #694)
Improve reel demo: get input wired up once more, avoid the FPS demo at bottom, print pointer and line count in each tablet, use new ncreel API. Improve notcurses-ncreel explorer: kill memory leaks (#694), draw tablets better, use new ncreel API. Fix bug in ncreel core where cruft could be left on the screen, via a very gross brute force algorithm. I'll likely come back and make this a bit less ghastly in the future #749. Remove weird one-off input system from ncreel, residue from outcurses. Make some of the normalizing changes speced out in #627

* ncreel: give each tablet an index, and print it #749
* reel: eliminate FIXME + param to insert_tabler() #749
* ncreel: label tablets with their adress to correlate against debugging logs #749
* more terminal environment variable notes
* TERMS.md: add Sakura, st
* ncreel: move legend out of reel proper
* ncreel_options: dump min/max_supported_rows/cols #627
* ncreel: remove weird one-off input layer #627
* ncreel: add ncreel_offer_input()
* reel demo: call demo_getc()
* reel demo: rig up input to demo main
* ncreel: drop ncreel_del_focused(), properly bind tablets
* reel demo: don't free up necessary plane
* ncreel: don't pull absolute locations of tablets
* ncreel: place tablets correctly in boundrel
* reel demo: add back support for left/right
* reel demo: restore thread movement
* ncreel: remove a great deal of complexity
* reel demo: stay out of FPS graph's way
* ncreel: give each tablet an index, and print it #749
* reel: eliminate FIXME + param to insert_tabler() #749
* ncreel: label tablets with their adress to correlate against debugging logs #749
* ncreel: move legend out of reel proper
* ncreel_options: dump min/max_supported_rows/cols #627
* ncreel: remove weird one-off input layer #627
* ncreel: add ncreel_offer_input()
* reel demo: call demo_getc()
* reel demo: rig up input to demo main
* ncreel: drop ncreel_del_focused(), properly bind tablets
* reel demo: don't free up necessary plane
* ncreel: don't pull absolute locations of tablets
* ncreel: place tablets correctly in boundrel
* reel demo: add back support for left/right
* reel demo: restore thread movement
* ncreel: remove a great deal of complexity
* reel demo: stay out of FPS graph's way
* reel: tighten up reel following redraw
* reel: fix upper-left corner of topless perimeter
* ncreel: print linecount, return clipped value
* reel: draw focused tablet relative to reel
* reel: brute force decruftification, how embarrassing #749
4 years ago
nick black 8f22a0a486
NegativePowersOfTen unit test: fix for ASCII 4 years ago
nick black 853f286e70
tester: don't pass NCOPTION_NO_QUIT_SIGHANDLERS 4 years ago
nick black 6b1b8d1695 ncplane_puttext: unit tests for scrolling #719 4 years ago
nick black 84746f1f31
OTHERS: add termbox, termion, pancurses 4 years ago
Nick Black 415d4b813f
Tight work on unit testing, controlling tty vs output fd (#758)
* Some things go to the FILE* we're provided. Some can only go to a controlling terminal. Check to see if the FILE we're given is a TTY. If not, open up /dev/tty #752.
* term_emit(): fflush() can return EAGAIN. Loop on it to eliminate a rare error on shutdown that particularly affected unit tests (where we start and shut down Notcurses many times in a row).
* sgr poc: check return value of setlocale()
* drone: run all unit tests
* CMake: add some tests using PoCs
* ncneofetch: print even small palettes
4 years ago
nick black c0f12f4623
tester: pass INHIBIT_SETLOCALE|NO_ALTERNATE_SCREEN 4 years ago
nick black dd2b36ce0a
drone: set TERM on debian 4 years ago
nick black 33667df40e
drone: set TERM for fedora 4 years ago
Nick Black d5dca33e00 ncneofetch: don't print (null) for distro_pretty 4 years ago
Nick Black d52ced823c make Wide unit tests sensitive to local irregularities #741 4 years ago
nick black f927af00f2
tester: pass NCOPTION_NO_QUIT_SIGHANDLERS 4 years ago
nick black 354152b48b
Redefine CELL_ALPHA_ in their natural forms
CELL_ALPHA_OPAQUE et al were defined as 0..3, meaning
CELL_ALPHA_SHIFT had to be used to compare them to their
channel representations. Instead, define them in said
representation outright, eliminating the need to shift while
retaining arithmetic properties, and zero initialization for
CELL_ALPHA_OPAQUE. Eliminate CELL_ALPHA_SHIFT #738.
4 years ago
nick black 7ca5a7e82c
ncneofetch: create info plane #550 4 years ago
nick black 5b99ebc9fc
ncplane_puttext(): four more unit tests #691 4 years ago
nick black 6ff0bec2fa
ncplane_puttext: more unit tests, check for spcae before width #691 4 years ago
nick black cfe764bd57
ncplane_puttext() unit test + fix #691 4 years ago
nick black 97517d0473
ncplane_puttext: another test, another bug #691 4 years ago
nick black d1f8b9237d
ncplane_puttext: new unit test, fix breakage #691 4 years ago
nick black 2be041b1f4
Beef up ncplane_puttext() tests, fix a problem #691 4 years ago
nick black b49d1ad838
rewrite all unit tests to use testing_notcurses() #718 4 years ago
nick black a46dcc5fe4
tester: introduce testing_notcurses() #718 4 years ago
nick black 64c4a4be53
unit tests: require utf8 for quadblitter 4 years ago
nick black 8ff0d92ad7
testing-checklist: add LANG=C, needed for debuilder 4 years ago
nick black 59bf168e55
quadblitter: emit ▌, not ▋, you fool #667 4 years ago
nick black d710bb24b2 unit test for quadblitter #667 4 years ago
nick black d69d369304 fill out NCBLIT_2x1 Dualblitter unit test #667 4 years ago
nick black ab4243d9be quadblitter/dualblitter unit test bases 4 years ago
Nick Black 0084dbaa6d
qrcode generalization #699 (#713)
Add convenience function ncplane_home(). Add an ncblitter_e param
to ncplane_qrcode(), and split int maxversion into value-result
int* ymax and int* xmax. Write the actual sizes of the resulting
visual into these parameters. Update the qrcode demo. Add the
qrcode PoC. Update demos to ncplane_home(), where possible.

ncplane_qrcode() now takes an ncblitter_e and two value-result int*s
in the place of a single value int. The final size of the displayed qrcode
is written to *ymax and *xmax. If the code can't fit within the specified
dimensions, an error is returned. Standard rules for pluggable blitters
apply regarding fallback etc. #699
4 years ago
nick black 3936d1b528
adapt callers of ncvisual_geom() 4 years ago
nick black 70183ee283
Rewrite plot tests using C interface #703
The Plot unit tests were reaching directly into the objects,
which meant the implementations couldn't include anything
we didn't want public. This was annoying, so I've changed it.
This required adding ncdplot_sample() and ncuplot_sample(),
which we should have had anyway.
4 years ago
Nick Black 28431914a8
First go at ncplane_puttext() (#690)
Very simple take at ncplane_puttext(), a new function for linebroken text. Also some very basic unit tests. I doubt this works very well yet, but it handles the simplest cases #682. Added nclog(), internal function for logging. #520
4 years ago
nick black b2dcc50606
notcurses_options: fold bools into flags 4 years ago
nick black 2c417ddb0c
yield demo: punch up with polyfills 4 years ago
nick black b648868361
PolyfillOnGlyph unit test fix 4 years ago
nick black 633ef1f76c
add beginnings of yield demo 4 years ago
nick black d73c12be6f
ncvisual_from_plane: argument inversion error #678 4 years ago
nick black 75f458d69a
ncplane_yx: results are relative to bound plane 4 years ago
nick black 96a47de845
merge cell unit tests 4 years ago
nick black a863daf4f6
cell tests: accept short widths for wide chars #229 4 years ago
nick black 0cda775900
metric: use FE_TONEAREST instead of TOWARDZERO #615 4 years ago
nick black 4f5c8ef3d7 eagle/outro support for non-multimedia builds 4 years ago
nick black 2d3fef115e ncfadectx_setup(): remove timespec param #659 4 years ago
nick black fd2bb53f83 fade: more unit tests, verify abort on callback #659 4 years ago
nick black 3deeecdf2e fade: finish out proposed API, basic unit tests #659 4 years ago
nick black 3ff083b73f Fade API: move control of delays into callback 4 years ago
nick black 8793fcd876 c++ Visual: add from_plane constructor, test #654 4 years ago
nick black 6a9bbad91e
Visual C++ constructor test #538 4 years ago
nick black 0331ae4c4c
introduce NCVISUAL_OPTION_BLEND #652 4 years ago
nick black 33318254b2
absorb first ncvisual_decode into ncvisual_from_file() #655 4 years ago
nick black 89ffb6658e
CMake: improvements to testing usability
Replace USE_TESTS with BUILD_TESTING variable already exported by CTest.
Use the CMake 3.17 CMAKE_CTEST_ARGUMENTS to pass "-V" to ctest. #651
4 years ago
nick black 0766007a77
tester: kill off inhibit_alternate_screen #651 4 years ago
nick black e88bc5c04b
Metric tests: observe local customs #650 4 years ago
Nick Black ebcba82d4b
Fully general ncvisual layer (#647)
This represents an essentially complete rewrite of ncvisual and associated code. It had two major goals:

Improve the ncvisual API based off lessons learned, pursuant to the upcoming API freeze. In particular, I wanted to:

decouple ncvisuals from ncplanes. It should be possible to render a ncvisual to multiple planes, with different scaling each time. It should be possible to create an ncvisual without a plane, etc.
normalize the various ways of constructing an ncvisual -- file, memory, plane, etc.
Support multiple blitters, from 7-bit ASCII to Sixel. This required writing the blitters in several cases, and they're not yet in their final implementations (but the API is fine)
I have not yet unified Plots and Visuals, and might not, given that the Plot code works fine. We could at this point implement Plots in terms of Visuals, though -- the blitter backend range has been unified. Sixel is not yet implemented, though it is listed.

There is a new POC tool, blitter. It renders its arguments using all possible blitter+scaling combinations. Another new POC, resize, displays its argument, then resizes it to the screen size and displays that, explicitly making use of ncvisual_resize() rather than a scaling parameter to ncvisual_render().

This also eliminates some memory leaks and bugs we were seeing in trunk, and brings in Sixel scaffolding.

The C++ wrapper will also need patching back up; I cut most of it down while wrestling with this crap, urk.

Closes #638, #562, and #622.
4 years ago
nick black 8971bda0c2 ncpp: stop() resets _instance, add unit test #538 4 years ago
nick black 8e649ebe46 ncpp: test NotCurses construction/stop 4 years ago
nick black 7af027b895
ncpp unit tests: check get_instance exception #538 4 years ago
nick black f120ab883f
tests: collapse RGB conversions into one TEST_CASE 4 years ago
nick black 37a4114f42
O(1) z-axis moves #623
Replace the singly-linked z-axis with a doubly-linked list,
and reimplement all z-axis moves as O(1) functions.
Eliminate ncplane_move_{above/below}_unsafe(), as there are no
longer unsafe moves.
4 years ago
nick black 8f78a8fdc0 fade tests: don't use CLOCK_MONOTONIC_RAW 4 years ago
nick black 3a7ee4b757
direct mode unit tests: allow init failure 4 years ago
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