Commit Graph

584 Commits (b56f5989bdc9167606706e21166b77e0e9d6fae5)

Author SHA1 Message Date
nick black eb72a4612d
qprefix/bprefix: use uintmax_t for decimal 4 years ago
nick black 168ec1e71d
Update USAGE for streaming API changes #604 4 years ago
nick black 289b018612 view-demo: cleanup, opaque 4 years ago
nick black 78e30831dd move timespec 4 years ago
nick black 1c2f92b3bc
ncmetric: replace u with µ, define *COLUMNS #540 4 years ago
nick black 9a80750316
notcurses_canopen: split into images/videos #598 4 years ago
nick black 0f5333f103
subtle ncplane bugfixes
ncplane_dup(): properly set target plane attributes/channels
ncplane_move_below_unsafe(): speedup, at most one traversal
ncplane_rgba(): accept null glyph
ncvisual_from_plane(): dup the plane, own it in ncvisual
normal: spin the visual
4 years ago
nick black 7dae248a41 box demo: work in ASCII encoding #325 4 years ago
nick black 25baa10f72 special-case double/rounded boxes in ASCII #325 4 years ago
nick black 9f16034d02 add notcurses_debug() #594 4 years ago
nick black a440382fb5 demo: use NCPLOT_OPTIONS_EXPOENTIALD #470 4 years ago
nick black fbed12cd80
ncreel_options: add flag field #590 4 years ago
nick black 66bafd59b3
subproc, fdplane, plot, selector, mselector: flag words #590 4 years ago
nick black eaaa36f0c8
ncreader: ncplane as first arg #590 4 years ago
nick black 9446840b97
ncmenu: move to flag field #590 4 years ago
nick black fec423264f
selector: undo switch to notcurses from ncplane 4 years ago
nick black d89d8c52e9
notcurses_options: add flags field 4 years ago
nick black 95ba340fba
ncplane_erase: fix bug in basecell preservation 4 years ago
nick black d2c968b948
notcurses_init(): interpret NULL as /dev/tty #571 4 years ago
nick black 5b0d773fb5 modernize some PoC c++ according to clang-tidy 4 years ago
nick black a859a3d652 notcurses_multiselector(3): fix up _selected 4 years ago
nick black 989ca7ff9a selector->ncselector, multiselector -> ncmultiselector #580 4 years ago
nick black 26db8a66b7 ncplane_set_attr()/ncplane_set_channels() 4 years ago
nick black f0357ef6cb ncplane_contents(): declarations #582 4 years ago
nick black 48de25821c ncreader man page #403 4 years ago
nick black 312e42add2 ncreader: C++ wrapper 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 064da8acb9 ncreader_destroy() / ncreader_plane() 4 years ago
nick black 5e1d8ccf75 ncreader introduced 4 years ago
nick black 7337280e17
ncplane_at_yx(): const ncplane argument 4 years ago
nick black 5bdfc0183f
ncvisual_from_plane() #559 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 0135a6b54d rotation: ncvisual, not ncplane #515 4 years ago
Marek Habersack e23d5baea4 [C++] Sync API changes
Added:

  * class FDPlane (`ncfdplane*`)
  * class Subproc (`ncsubproc*`)
  * NotCurses: get_inputready_fd (`notcurses_inputready_fd`)
  * Plane: qrcode (`ncplane_qrcode`)
  * class PlotBase: templated base class for Plot variations
  * class PlotU: `uint64_t` instantiation of PlotBase (aliased to previous
    `Plot` class for source compatibility), `ncuplot*`
  * class PlotD: `double` instantiation of PlotBase, `ncdplot*`
4 years ago
nick black c0b2a64102
implement+doc notcurses_inputready_fd() #513 4 years ago
nick black c8322e6cb1
ncfdplane: on non-following planes, break out on 0 read 4 years ago
nick black b34fa9be41
python: proper ncfdplane/ncsubproc decls 4 years ago
nick black 84107c547d
view: support -m argument for margins #551 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 6ffbef3d74 cmake: openimageio discovery #453 4 years ago
nick black ad0685aa1b switch to nc_err_e #532 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 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
Marek Habersack 3ea7bbba18 [C++] Restore NotCurses::render semantics
Go back to returning `bool`, it was an oversight in 64eeb95f
4 years ago
nick black dba42f9eef
ncplane_at_yx_cell(): plug memory leak on success path 4 years ago
Nick Black 1c7796a2b0
ncdirect_cursor_yx, ncdirect_cursor_pop, ncdirect_cursor_push #401 (#492)
* ncdirect_cursor_{push, pop, yx} declarations #401
* direct PoC: invoke ncdirect_cursor_yx() #401
* direct PoC: move to top of screen #401
* OTHERS.md: mention blessings
* ncdirect_cursor_yx working #401
* CHANGELOG: mention ncdirect_cursor_*() #401
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 43c8b9fdb6 ncpp: drop USE_FFMPEG guards #488 4 years ago
nick black a0669974ff
ncplane_putstr_yx(): don't map 0 to -1 #485 4 years ago
Marek Habersack 64eeb95f1e [C++] Optionally enable throwing exceptions on errors
Nick prefers error handling based on exceptions in all cases, while I
prefer to save exception handling for truly exceptional situations -
function parameter validation and class constructor. However, there's no
need to not support both approaches, to be chosen at the discretion of
the developer.

NCPP follows RAII and all classes throw exceptions from their
constructors in case they cannot initialize properly. Likewise,
functions taking pointers that are required validate them and throw
exceptions whenever the requirement isn't met.

This commit goes one step further in that it enables optional validation
of notcurses function return values and throwing an
exception (`ncpp::call_error`) should the function signal an error. This
is disabled by default but it can be enabled by defining the
`NCPP_EXCEPTIONS_PLEASE` macro (preferably on the command line or
before *each* inclusion of any NCPP headers).

Out of necessity, this breaks the ABI (plus I found a handful of minor
issues in the code), but I think it's worth having this support in
place.
4 years ago
Marek Habersack 28976dfef2 [C++] Sync API changes
Been a while, but here goes, sync to the latest API changes.

Added:

  * Direct:   cursor_{up,left,right,down} (`ncdirect_cursor_{up,left,right,down}`)
  * Plane: constructors to use `ncplane_bound`
  * Plane: reparent (`ncplane_reparent`)
  * Plot: definition of `default_options`

Changed:

  * Plane (breaking): the `*gradient*` functions now return `int`
  * Plane (breaking): `polyfill` returns `int`
  * Plane (breaking): `stain` returns `int`
  * Plane (breaking): `blit_bgrx` takes `const void*` for `data`
  * Plane (breaking): `blit_rgba` takes `const void*` for `data`
  * Plot: `plot_optons` -> `ncplot_options`
  * Plot (breaking): `{add,set}_sample` now return `bool`
4 years ago
nick black b04a37c433
plots: always start from the right #457 4 years ago
nick black 2c2da61c72
ncdirect: add relative move functions #419 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 eccb24a391 c++ plot shouldn't allow negative samples #447 4 years ago
nick black 9dc81f0b64 c++ wrappers for ncplot #441 4 years ago
nick black 77dd998b05
ncplot uses exclusively non-negative samples #447 4 years ago
nick black 5c44416426
export ncplane_putstr_yx() as static inline 4 years ago
nick black 4a6ab358ba inline ncplane_putsimple_yx() 4 years ago
nick black fcd7e19e4c Add ncplane_set_scrolling() #323 4 years ago
nick black 4917603478
ncplot: swap NCPLOT_2x1 and NCPLOT_1x1x4 4 years ago
nick black 2a7ccffec6 ncplot: add labelaxisd, use it in keyplot #438 4 years ago
nick black c0f8d9b444
eliminate detectdomain, infer it from maxy==miny #439 4 years ago
nick black 68b4ba1706 plots: implement remaining vertical grid types #136 4 years ago
nick black 5f3eb3dc24 keyplot: add third plot, this one with half blocks #433 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 4926186b5a ncplot: check input parameters for validity #430 4 years ago
nick black b3e874a179 ncplot: fold minx, maxx into rangex 4 years ago
nick black 09d8912d4e notcurses-keyplot #430 4 years ago
nick black 5e27499194 add notcurses-keyplot #430 4 years ago
nick black d541cda306 independent variable 4 years ago
nick black 4afda7a625 float some geometry concepts 4 years ago
nick black 5aedb3491d ncplot_plane(), ncplot_destroy() 4 years ago
nick black f29a5a7bd9 declare ncplot_create() 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 8651486ad7
Don't say DirectColor when TrueColor is meant 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 91f907a184
gradient_sized (C++): fix parameter name 4 years ago
Nick Black f9c54761f5
Basic mandelbrot for `n`ormal demo #145 (#424)
normal: working mandelbrot, very basic #145
4 years ago
Nick Black de9158bd7b
More tetris work for book #421 (#423)
* tetris: use NES gravities
* tetris: use NES grav multiplier of 50ms
* tetris: implement move down #421
* README: mention notcurses-tetris #421
* tetris: use double box for boundary #421
* tetris: extract background.h
* tetris: break up into chunks suitable for book
* tetris: do the rotations
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
Marek Habersack 73b13e0fd5 [C++] There can be only one stdplane
Fixes: https://github.com/dankamongmen/notcurses/issues/409

Standard planes can be duplicated but the copy must not be treated as a
standard plane. There can be only one :)

Make it so.
4 years ago
nick black 8113ce72c1 fix dumb error in ncplane_below() description 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
Marek Habersack ad93c03851 [C++] API sync
Added:

  * Plane: mergedown (`ncplane_mergedown`)
4 years ago
Nick Black 52bdbc6724
ncplane_translate() accept NULL dest as standard plane #408 (#411)
* tetris man page
* tetris basic skeleton
* tetris: Ticker()
* README: fix up some obsolete terminology
* tetris: draw the game board
* tetris: add NewPiece()
* tetris: draw tetriminos
* tetris: check for stuck piece, move it down
* Accept NULL dst in ncplane_translate() #408
4 years ago
nick black 7e71ad8e11 implement ncplane_mergedown() #361 4 years ago
nick black 38f4255dc0 Define ncplane_mergedown() #361
ncplane_mergedown() is similar to the "Merge down" operation
in the GIMP. It writes to the destination plane the result
of rendering the source and destination frames per se.
4 years ago
nick black 8312b88e3c NotCurses::stop(): match original semantics 4 years ago
nick black 66bb614ab3 NotCurses::stop(): propogate out notcurses_stop() return value 4 years ago
Marek Habersack 3e78dd7d1f [C++] API sync
New classes:

   * MultiSelector (`ncmultiselector_*`)

Added:

   * Direct: cursor_{enable,disable}
   * Plane: high_gradient (`ncplane_highgradient`)
   * Plane: high_gradient_sized (`ncplane_highgradient_sized`)
   * Plane: rotate_cw (`ncplane_rotate_cw`)
   * Plane: rotate_ccw (`ncplane_rotate_ccw`)

Updated:

   * NotCurses: added all the margin initializers to the default options
4 years ago
nick black ba90c70a47
ncplane_cursor_yx() takes const first argument 4 years ago
nick black 1b4333861a
add ncdirect_{en,dis}able_cursor() #402 4 years ago
Nick Black c056a0a026
Subregion renders #293 (#404)
Add four new fields to notcurses_options: margin_{tblr}, which requests margins to the top, right, bottom, and left. Render only within those margins, leaving the screen otherwise untouched (well, cleared if using the alternate screen). #293
4 years ago
nick black be089747a7 ncmultiselector_selected() #322 4 years ago
nick black 638be8feb7 multiselector options/items #322 4 years ago
nick black a46393b035 ncmultiselect: get space rigged up #322 4 years ago
nick black 4abe078eae ncmultiselector #322 4 years ago
nick black 635d6e5751 ncmultiselect demo 4 years ago
nick black 6060248968 ncmultiselector_options structure #322 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 333f7c1192
define ncplane_rotate_cw/ccw() 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 c6f27f1bee
notcurses_resize() update docs #367 4 years ago
nick black c87a9ed5dd
Gradients: set alpha, better prechecks #389
Gradients can't use palette-indexed color, so don't allow it
in either the foreground or background of any channels. All
channels must have the same alpha setting, which will be matched
in the gradient. #389
4 years ago
Marek Habersack 3467a0adef [C++] API sync
Added:

  * NCKey: `ScrollUp`, `ScrollDown` and `Return`
  * Plane: is_mouse_event (`ncplane_mouseevent_p`)
4 years ago
nick black 87cac84db2
remove obsolete FIXME 4 years ago
nick black a09bdc4ade
Add seqnum field to ncinput #374 4 years ago
nick black ddd33fea31
ncdirect_move() doc, readme, python, c++ #382 4 years ago
nick black a626178b16
ncdirect: cursor movement / geom detection #382 4 years ago
nick black 40428fd05e
Cell: non-OPAQUE always sets non-default bit 4 years ago
nick black bdd0917ea4
selector: transparent where we aren't 4 years ago
nick black bf60c51b3d
nckey: aliases NCKEY_ENTER, SCROLL_* 4 years ago
Marek Habersack 945c3a5f4f [C++] API sync
Added:
 * Cell: get_addrword (`cell.attrword`)
 * Cell: get_channels (`cell.channels`)
 * NotCurses: get_stdplane overloads (`notcurses_stddim_yx`)
 * Plane: putc (support for `ncplane_putsimple_stainable`,
   `ncplane_putegc_stainable`, `ncplane_putwegc_stainable`)
 * Plane: format (`ncplane_format`)
 * Plane: stain (`ncplane_stain`)
 * Plane: translate (`ncplane_translate`)
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 5e38da9ea3
implement ncplane_stain() #347 4 years ago
nick black 002e8be574
implement ncplane_format() #347 4 years ago
nick black 2780734efd
add ncplane_translate() 4 years ago
nick black f9d98dd05c
notcurses_stdplane_dimyx() #365 4 years ago
nick black 35d850f008
Implement + test ncplane_putegc_stainable() #352 4 years ago
Nick Black e5d6685c92
No locks, more lox #290 (#358)
* README/CMake: only require doctest 2.3.5

* man pages: remove talk of locking #290

* Remove locking from notcurses core #290

* Purge locking from notcurses core #290
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
Marek Habersack e429724287 [C++] API sync + some (breaking) changes
Added:

 * Plane: gradient (`ncplane_gradient`)
 * Plane: gradient_sized (`ncplane_gradient_sized`)
 * NotCurses: drop_planes (`ncplane_drop_planes`)
 * NcReel: constructor which takes `Plane&`
 * Visual: constructors which take `Plane const*`, `Plane&` and `Plane const&`)
 * ncpp_build: a nonsensical "demo" which exists purely to test whether
   the C++ builds and does absolutely nothing interesting.

Broke:
 * All exceptions throw temporary objects instead of allocated
   instances. Less typing in `catch` :P (and more conventional)
4 years ago
Jakub Wilk f08d51c5e7 fix typos 4 years ago
nick black c6520ab84c add notcurses_drop_planes, use from demo #346 4 years ago
nick black 8ecb4ba6a8 declare gradient functions #340 4 years ago
Marek Habersack fc264677f5 Sync C++ wrapper with the latest API changes
New classes:

 * Direct (`ncdirect_*`)
 * Menu (`ncmenu_*`)
 * Selector (`ncselector_*`)

Updates:

 * Plane: added copy constructors (mapped to `ncplane_dup`)
 * Plane: added `perimeter` (`ncplane_perimeter`)
 * Plane: added `polyfill` (`ncplane_polyfill`)
 * Plane: added `blit_bgrx` (`ncblit_bgrx`)
 * Plane: added `blit_rgba` (`ncblit_rgba`)
4 years ago
nick black 124004c87c add nplane_polyfill_yx() #340 4 years ago
nick black ce3e5d112e add ncdirect_clear() #343 4 years ago
nick black 6d629025e3 add ncdirect_fg_default() and ncdirect_bg_default() 4 years ago
nick black bfc28b0071 comment up ncdirect a bit better 4 years ago
nick black dc21f2cb09 introduce ncplot_options 4 years ago
nick black 52b4fb223a get down some thoughts on plots #136 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 b0c72607c4
ncmenu_offer_input(), use it in demo/pocmenu #333 4 years ago
nick black 7d1c977ba8
comment for nctablet_userptr() 4 years ago
nick black aacec297b2
ncmenu: declare ncmenu_offer_input() 4 years ago
nick black 74b9690cf3
ncmenu: remove dumb restrictions/special casing 4 years ago
nick black 3cdac5ce28 high-contrast text, simple linear average model #181 4 years ago
nick black 1ed6000193 ncstats: add plane count, fix fbbytes accounting 4 years ago
nick black d05abe8626 use channels_set_bchannel() 4 years ago
nick black 62488eaf10
blit->ncblit #324 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 09ff64e19f
ncdirect_style_*() #321 4 years ago
nick black bb7b92ea4a
ncdirect_styles_*() declarations #321 4 years ago
nick black 5cd3a4c41d
ncdirect_dim_y()/x() 4 years ago
nick black 2a9f3c5ab3
ncmenu_selected(), update docs #179 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 5cf1bba5f5
menu: unit test with section #179 4 years ago
nick black ee6eb1a37b
ncmenu: support iteration within a section 4 years ago
nick black fa88f9b525
ncmenu: nextsection/prevsection 4 years ago
nick black 4586dd7e19 ncmenu: properly place unrolled menu #179 4 years ago
nick black 31a07dab33
menu: extend across width of screen #179 4 years ago
nick black fdc541c6e5 copy over menu elements #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 6e642f1749 more menu work #179 4 years ago
nick black 2cf3835ddd Add menu_options struct #179 4 years ago
nick black 25ce448889
rgba_blit()/bgrx_blit() #311 4 years ago
nick black c1664170fd
selector: bgchannels only inside the body #302 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 85f042c644
add selector to README #302 4 years ago
nick black d30df23f43
selector: support non-zero default idx #302 5 years ago
nick black 09d2e35372 C++ wrappers: kill Visual::destroy_plane() #299
ncvisual_destroy() already calls ncplane_destroy() when
appropriate. There's never a need for the C++ wrappers
to explicitly free the Visual's underlying Plane. With
this change, valgrind no longer complains upon exiting
notcurses-view(1).
5 years ago
nick black a57f0f234c
selector styling 5 years ago
nick black 3991b3e53a
selector: implement maxdisplay. unit tests! 5 years ago
nick black ac2b951fa9
ncselector_selected(), unit tests 5 years ago
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.
5 years ago
Marek Habersack cd6d1e16d1 Properly clean up when NotCurses instance is destructed
We need to set `_instance` to `nullptr` or we'll leave a dangling
pointer.
5 years ago
nick black 1fd0563093
Direct mode with its own type #77
Introduce the new type 'ncdirect', a stripped-down 'notcurses'
suitable for inline modification of regular output. Used the new
type because otherwise there were going to be if(directmode) checks
everywhere. Direct mode encompasses only colorizing and styling.
Add new man page notcurses_directmode(3). Add new section to README.
Add new PoC using direct mode RGB. Update demo table summary to use
direct mode.
5 years ago
nick black 3d4e157af6 direct-mode coloring #77 5 years ago
nick black 2ea10d4b28 Remove clear_screen_start option
As it turns out, we can't portably load the initial terminal contents
(there are some hacks of various EXTREME nature, but none of them are
worth it for the rather limited benefit). The O(1)-time damage
inference requires knowledge of what was previously present to
inibit unnecessary draws. We would then need some special cell value
indicating "not yet written to" to distinguish a purposeful null
cell from an initial cell. Again, we could do this, but for what value?

Finally, the idea of clearing new area on SIGWINCH was always flawed,
as we can't do that from a signal handler.

With the advent of direct mode #77, the reason for this largely goes
away in any case.
5 years ago
nick black 55699c6a3c
render summary: autoscale all times 5 years ago
Marek Habersack 75a90461dd Add C++ bindings 5 years ago
nick black be3a53f3cf
input: function key defs through kf59 5 years ago
nick black 507c3e1d00
expunge wayward fragment of comment 5 years ago
nick black 4ece4a9075
demo: skip demos which we don't have support for 5 years ago
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
5 years ago
nick black 3e9347a339
palette color: unit test for alpha clear 5 years ago
nick black b02acd8631
Curry a void* to fader callbacks #284 5 years ago
nick black 1b01494c79 implement ncplane_greyscale() #280 5 years ago
nick black 08f6fa0e79 implement ncplane_dup() 5 years ago
nick black 209d4f41f4 palette: add necessary predicates #230 5 years ago
nick black 0e70304596 palette indexing: set up attributes #230 5 years ago
nick black 6365fc0917 encode palette index into channels/attr #230 5 years ago
nick black 684bcdcc8c introduce palette256 #230 5 years ago
nick black 67b5a20758 implement ncplane_putwc_yx() 5 years ago
nick black dd7f8eff4b
ncvisual_stream: add timescale param 5 years ago
nick black 23b5078ed1
pulsing text declarations 5 years ago
nick black 56a54b5441
break apart render/rasterize #155 5 years ago
nick black 2ebc3e2bfe blend: conditionally blend in alpha 5 years ago
nick black 3faffaa847 channels_blend() : don't blend in wide status #260 5 years ago
nick black 922c639355 cell: add clipped 5 years ago
nick black 0f60af347d add clipped set functions 5 years ago
nick black 306045116f API: always call complex from static simple 5 years ago
nick black acef43c759
avcodec_parameters_to_context() #215 5 years ago
Nick Black f5c6297902
Chun Li demo (#251)
* chun li demo
* ncvisual_decode: allow multiple renders of the same frame
* add -H to notcurses-demo man page
* update section 1 man page versions
5 years ago
nick black 5dd90f3735 add ncplane_dim_[yx] quick accessors 5 years ago
Nick Black f6975d11d5
Docs/API sweep for 1.0.0 #244 #249 (#250)
* sync up some docs #244
* sync README and man page
* notcurses_output() man page work
* pull attr/channels from output functions #244
* witherworm: clean up explicit moves #244
* still more man page work
* notcurses_lines, last of the man pages i think
* panelreel man page #244
* debian: ruby-ronn->pandoc
* debian: full multiarch compliance
* debian: symbols file
* pandoc: fix syntax for lexgrog
* fm6.mkv: strip audio
* pandoc: fix up apropos man syntax #249
* ncurses_lines man page
5 years ago
nick black 2ada135fc2
add ncplane_resize_simple() 5 years ago
nick black 0de1856e38 accept a loglevel for libav 5 years ago
Nick Black 2fbc94e41c
Higher planes obliterate bisected wide glyphs #158 (#243)
* higher planes stomp wide glyphs
* broken unit test
* develop out widestomp PoC
* fix notcurses_at_yx()
* fix up dig_visible_cell() return value
* refuse wide glyph on last column #242
* set adjacent cell wide when rendering #158
* xray: eliminate weird color flicker
* witherworm: don't eat wide glyphs
* unit test for boxed glyph
* uniblock: no need to emit so many U+200Es
* witherworm: remove wide glyph hack
5 years ago
nick black 35aa7f6e85
move cell_egc_copy() to internal.h 5 years ago
nick black e81e58035e
notcurses_at_yx() added 5 years ago
nick black 2ea4f77875
introduce ncplane_aligned() #237 5 years ago
nick black ed980f1059 pull _get from all accessors 5 years ago
nick black 014afa348b rename ncplane default -> base #236 5 years ago
nick black c21a04137c curry a void* through ncvisual_stream #113 5 years ago
nick black db8b99d594
notcurses_render: simplify using new alpha rules 5 years ago
nick black 924d80f0d5
don't blend default colors #235 5 years ago
nick black 46b1b8e622
notcurses_stats man page #213 5 years ago
nick black 663e7e2eef
setting default also sets opaque #235 5 years ago
nick black daad1c7ea3
more man pages (#213) 5 years ago
nick black 7c5a13e7ac
notcurses_init(3) man page #213 5 years ago
nick black 21c3861804
s/bannner/banner/g, heh 5 years ago
nick black e9890eefc0 general foreground elision #131 5 years ago
nick black 5b322add56 glyph-based background spec elision #131
When we emit a glyph that has no background pixels (i.e.
the U+2588 FULL BLOCK glyph), there's no need to emit a
background color change.

Eagle demo currently has hand-coded elision. Results from
80x70 runs using the `-c` parameter:

No optimization: 12.63MiB
Hand-optimized: 12.48MiB
New scheme, no hand-coded optimization: 12.45MiB

w00t!
5 years ago
nick black 132793211c
capabilities testing for fade/ffmpeg 5 years ago
nick black f1453d106e freebsd: fix attribute ordering 5 years ago
nick black bd034c983a input: handle modifiers+mouse (alt, shift, ctrl) #226 5 years ago
nick black fb0e03fe89 UMOK: fadecb for faders #162 5 years ago
Nick Black 63ada9289c
Implement CELL_ALPHA_BLEND, improve transparency semantics #191 (#219)
* channels_blend() introduced
* implement CELL_ALPHA_BLEND #191
* maxcolor demo: slidingpanel
* much improved transparency semantics #191
* maxcolor: show all transparencies #191
5 years ago
nick black cb2bf16a73 support building sans ffmpeg #153 5 years ago
nick black 452e1d302e
output API enhancements #210 #209
Allow -1 in move specification to remain where we are on that
axis (#210), necessary for context-sensitive aligned output.
Add _aligned forms to printf and vprintf. Invert various output
functions so that simpler form is static inline wrapper around
more complicated form, rather than complicated form being a
static inline composition, facilitating atomic move+output. All
output forms now have a simple form (no alignment, placement at
cursor), an _aligned() form, and a _yx() form.
5 years ago
nick black f742676aee Mouse support using button event tracking #165
Request and parse up mouse messages. We handle up to 11 mouse
buttons, 3 modifiers (currently thrown away), motion while
holding down a button, and loss/gain of focus. I've added twelve
new NCKEYs: one for each button, and one for release. In addition,
I've introduced the 'ncinput' struct, which encodes the nckey plus
extra data. The only extra data thus far is coordinates for mouse
events. It is not necessary to provide a ncinput to all input
functions; NULL can be provided if the caller doesn't care about
details. All demos are updated. notcurses-input has been updated
to decode full information of returned ncinputs.

The primary resource for this work was Dickey at al's "XTerm Control
Sequences", https://invisible-island.net/xterm/ctlseqs/ctlseqs.html.
5 years ago
nick black aceda89261 input: add NCKEY_MOUSEEVENT, match against CSI prefix #165 5 years ago
nick black fc17a104b4
notcurses_options: clear screen on start 5 years ago
nick black ab47ab8976
notcurses_mouse_on()/_off() #165 5 years ago
Nick Black 3ad2124246
Partial visual renders #170 (#193)
* ncvisual_render() accept four bounding dims #175
* ncvisual_render(): partial renders #175
5 years ago
Nick Black 0e0925a84e
Planereel exploration app, panelreel logic fixes (#188)
* planereels tester #180
* suppress_banner in all tests
* tabletcb: start passing back tablet
* properly initialize fbbytes stat
* panelreel: logic fixes #178
* install all testing data
5 years ago
nick black 3f326ee0a8 fix up ncplane_set_{bf}g 5 years ago
nick black 6a9d6fa122
add ncplane_printf_yx() 5 years ago
nick black 5bec85746d
allow banners to be suppressed 5 years ago