Commit Graph

515 Commits

Author SHA1 Message Date
nick black
5b0d773fb5 modernize some PoC c++ according to clang-tidy 2020-05-08 21:42:04 -04:00
nick black
a859a3d652 notcurses_multiselector(3): fix up _selected 2020-05-08 21:42:04 -04:00
nick black
989ca7ff9a selector->ncselector, multiselector -> ncmultiselector #580 2020-05-08 21:42:04 -04:00
nick black
26db8a66b7 ncplane_set_attr()/ncplane_set_channels() 2020-05-08 21:42:04 -04:00
nick black
f0357ef6cb ncplane_contents(): declarations #582 2020-05-08 21:42:04 -04:00
nick black
48de25821c ncreader man page #403 2020-05-08 21:42:04 -04:00
nick black
312e42add2 ncreader: C++ wrapper 2020-05-08 21:42:04 -04:00
nick black
d174431187 ncreader_create: accept const options #403 2020-05-08 21:42:04 -04:00
nick black
7683973ee4 ncreader_options, bad options tests #403 2020-05-08 21:42:04 -04:00
nick black
4819c0e1c3 selector/multiselect: accept notcurses 2020-05-08 21:42:04 -04:00
nick black
064da8acb9 ncreader_destroy() / ncreader_plane() 2020-05-08 21:42:04 -04:00
nick black
5e1d8ccf75 ncreader introduced 2020-05-08 21:42:04 -04:00
nick black
7337280e17
ncplane_at_yx(): const ncplane argument 2020-05-06 22:21:22 -04:00
nick black
5bdfc0183f
ncvisual_from_plane() #559 2020-05-06 21:40:24 -04:00
nick black
94fcada67c
ncvisual_rotate: unify _cw/_ccw, take radians 2020-05-06 05:49:22 -04:00
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.
2020-05-06 01:02:46 -04:00
nick black
39548acc3a rename ncvisual_open_plane->ncvisual_from_file() #560 2020-05-06 01:02:46 -04:00
nick black
0135a6b54d rotation: ncvisual, not ncplane #515 2020-05-06 01:02:46 -04:00
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*`
2020-05-04 05:39:01 -04:00
nick black
c0b2a64102
implement+doc notcurses_inputready_fd() #513 2020-05-02 12:56:39 -04:00
nick black
c8322e6cb1
ncfdplane: on non-following planes, break out on 0 read 2020-05-02 11:57:38 -04:00
nick black
b34fa9be41
python: proper ncfdplane/ncsubproc decls 2020-05-02 11:01:43 -04:00
nick black
84107c547d
view: support -m argument for margins #551 2020-04-29 03:24:11 -04:00
nick black
0b4ada19b1 Remove AVFrame from API #532 2020-04-24 04:17:56 -04:00
nick black
21822f98e7 fix up averr->ncerr #532 2020-04-24 04:17:56 -04:00
nick black
6ffbef3d74 cmake: openimageio discovery #453 2020-04-24 04:17:56 -04:00
nick black
ad0685aa1b switch to nc_err_e #532 2020-04-24 04:17:56 -04:00
Nick Black
0e73b9d3d5
Floating-point ncplot, genericize ncplot (#531)
* compile ncplot as c++ generic #446
* add floating-point plots #446
2020-04-23 03:52:07 -04:00
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
2020-04-20 23:26:41 -04:00
Marek Habersack
3ea7bbba18 [C++] Restore NotCurses::render semantics
Go back to returning `bool`, it was an oversight in 64eeb95f
2020-04-18 15:21:24 -04:00
nick black
dba42f9eef
ncplane_at_yx_cell(): plug memory leak on success path 2020-04-18 08:15:24 -04:00
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
2020-04-18 07:11:33 -04:00
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
2020-04-18 00:09:14 -04:00
nick black
d274af34b9 ncplot: define 2x2 and 4x2 sets #461 2020-04-16 11:41:20 -04:00
nick black
43c8b9fdb6 ncpp: drop USE_FFMPEG guards #488 2020-04-15 22:20:34 -04:00
nick black
a0669974ff
ncplane_putstr_yx(): don't map 0 to -1 #485 2020-04-15 12:32:27 -04:00
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.
2020-04-15 12:10:14 -04:00
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`
2020-04-11 20:44:25 -04:00
nick black
b04a37c433
plots: always start from the right #457 2020-04-08 21:26:15 -04:00
nick black
2c2da61c72
ncdirect: add relative move functions #419 2020-04-08 09:07:49 -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
eccb24a391 c++ plot shouldn't allow negative samples #447 2020-04-07 23:43:12 -04:00
nick black
9dc81f0b64 c++ wrappers for ncplot #441 2020-04-07 23:43:12 -04:00
nick black
77dd998b05
ncplot uses exclusively non-negative samples #447 2020-04-06 02:39:56 -04:00
nick black
5c44416426
export ncplane_putstr_yx() as static inline 2020-04-06 01:15:20 -04:00
nick black
4a6ab358ba inline ncplane_putsimple_yx() 2020-04-05 23:54:38 -04:00
nick black
fcd7e19e4c Add ncplane_set_scrolling() #323 2020-04-05 23:54:38 -04:00
nick black
4917603478
ncplot: swap NCPLOT_2x1 and NCPLOT_1x1x4 2020-04-04 13:00:27 -04:00
nick black
2a7ccffec6 ncplot: add labelaxisd, use it in keyplot #438 2020-04-04 12:32:19 -04:00
nick black
c0f8d9b444
eliminate detectdomain, infer it from maxy==miny #439 2020-04-04 08:56:31 -04:00
nick black
68b4ba1706 plots: implement remaining vertical grid types #136 2020-04-03 08:27:08 -04:00
nick black
5f3eb3dc24 keyplot: add third plot, this one with half blocks #433 2020-04-03 08:27:08 -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
4926186b5a ncplot: check input parameters for validity #430 2020-04-03 05:51:02 -04:00
nick black
b3e874a179 ncplot: fold minx, maxx into rangex 2020-04-03 05:51:02 -04:00
nick black
09d8912d4e notcurses-keyplot #430 2020-04-03 05:51:02 -04:00
nick black
5e27499194 add notcurses-keyplot #430 2020-04-03 05:51:02 -04:00
nick black
d541cda306 independent variable 2020-04-03 05:51:02 -04:00
nick black
4afda7a625 float some geometry concepts 2020-04-03 05:51:02 -04:00
nick black
5aedb3491d ncplot_plane(), ncplot_destroy() 2020-04-03 05:51:02 -04:00
nick black
f29a5a7bd9 declare ncplot_create() 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
8651486ad7
Don't say DirectColor when TrueColor is meant 2020-03-27 12:58: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
91f907a184
gradient_sized (C++): fix parameter name 2020-03-26 18:19:01 -04:00
Nick Black
f9c54761f5
Basic mandelbrot for normal demo #145 (#424)
normal: working mandelbrot, very basic #145
2020-03-25 07:19:56 -04:00
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
2020-03-25 04:06:38 -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
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.
2020-03-24 16:33:58 -04:00
nick black
8113ce72c1 fix dumb error in ncplane_below() description 2020-03-23 12:46:35 -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
Marek Habersack
ad93c03851 [C++] API sync
Added:

  * Plane: mergedown (`ncplane_mergedown`)
2020-03-22 17:40:47 -04:00
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
2020-03-22 17:33:08 -04:00
nick black
7e71ad8e11 implement ncplane_mergedown() #361 2020-03-21 05:09:31 -04:00
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.
2020-03-21 05:09:31 -04:00
nick black
8312b88e3c NotCurses::stop(): match original semantics 2020-03-15 01:21:55 -04:00
nick black
66bb614ab3 NotCurses::stop(): propogate out notcurses_stop() return value 2020-03-15 01:19:04 -04:00
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
2020-03-14 21:49:32 -04:00
nick black
ba90c70a47
ncplane_cursor_yx() takes const first argument 2020-03-14 21:15:37 -04:00
nick black
1b4333861a
add ncdirect_{en,dis}able_cursor() #402 2020-03-13 09:52:00 -04:00
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
2020-03-13 05:07:33 -04:00
nick black
be089747a7 ncmultiselector_selected() #322 2020-03-09 15:31:16 -04:00
nick black
638be8feb7 multiselector options/items #322 2020-03-09 15:31:16 -04:00
nick black
a46393b035 ncmultiselect: get space rigged up #322 2020-03-09 15:31:16 -04:00
nick black
4abe078eae ncmultiselector #322 2020-03-09 15:31:16 -04:00
nick black
635d6e5751 ncmultiselect demo 2020-03-09 15:31:16 -04:00
nick black
6060248968 ncmultiselector_options structure #322 2020-03-09 15:31:16 -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
333f7c1192
define ncplane_rotate_cw/ccw() 2020-03-05 18:07:20 -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
c6f27f1bee
notcurses_resize() update docs #367 2020-02-29 23:05:51 -05:00
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
2020-02-29 16:35:57 -05:00
Marek Habersack
3467a0adef [C++] API sync
Added:

  * NCKey: `ScrollUp`, `ScrollDown` and `Return`
  * Plane: is_mouse_event (`ncplane_mouseevent_p`)
2020-02-27 11:48:36 -05:00
nick black
87cac84db2
remove obsolete FIXME 2020-02-25 02:36:51 -05:00
nick black
a09bdc4ade
Add seqnum field to ncinput #374 2020-02-24 18:11:39 -05:00
nick black
ddd33fea31
ncdirect_move() doc, readme, python, c++ #382 2020-02-24 16:56:51 -05:00
nick black
a626178b16
ncdirect: cursor movement / geom detection #382 2020-02-24 16:30:51 -05:00
nick black
40428fd05e
Cell: non-OPAQUE always sets non-default bit 2020-02-23 12:11:28 -05:00
nick black
bdd0917ea4
selector: transparent where we aren't 2020-02-23 09:38:58 -05:00
nick black
bf60c51b3d
nckey: aliases NCKEY_ENTER, SCROLL_* 2020-02-23 04:00:52 -05:00
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`)
2020-02-23 02:57:01 -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
5e38da9ea3
implement ncplane_stain() #347 2020-02-21 07:00:53 -05:00
nick black
002e8be574
implement ncplane_format() #347 2020-02-21 06:52:57 -05:00
nick black
2780734efd
add ncplane_translate() 2020-02-21 06:26:57 -05:00
nick black
f9d98dd05c
notcurses_stdplane_dimyx() #365 2020-02-20 23:40:13 -05:00
nick black
35d850f008
Implement + test ncplane_putegc_stainable() #352 2020-02-20 04:41:56 -05:00
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
2020-02-18 20:03:20 -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
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)
2020-02-18 12:30:13 -05:00
Jakub Wilk
f08d51c5e7 fix typos 2020-02-18 08:03:59 -05:00
nick black
c6520ab84c add notcurses_drop_planes, use from demo #346 2020-02-16 11:21:21 -05:00
nick black
8ecb4ba6a8 declare gradient functions #340 2020-02-16 11:21:21 -05:00
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`)
2020-02-16 06:01:02 -05:00
nick black
124004c87c add nplane_polyfill_yx() #340 2020-02-14 05:38:08 -05:00
nick black
ce3e5d112e add ncdirect_clear() #343 2020-02-14 05:38:08 -05:00
nick black
6d629025e3 add ncdirect_fg_default() and ncdirect_bg_default() 2020-02-14 05:38:08 -05:00
nick black
bfc28b0071 comment up ncdirect a bit better 2020-02-14 05:38:08 -05:00
nick black
dc21f2cb09 introduce ncplot_options 2020-02-14 05:38:08 -05:00
nick black
52b4fb223a get down some thoughts on plots #136 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
b0c72607c4
ncmenu_offer_input(), use it in demo/pocmenu #333 2020-02-10 20:22:23 -05:00
nick black
7d1c977ba8
comment for nctablet_userptr() 2020-02-10 16:54:12 -05:00
nick black
aacec297b2
ncmenu: declare ncmenu_offer_input() 2020-02-10 15:41:25 -05:00
nick black
74b9690cf3
ncmenu: remove dumb restrictions/special casing 2020-02-10 15:18:28 -05:00
nick black
3cdac5ce28 high-contrast text, simple linear average model #181 2020-02-07 09:19:08 -05:00
nick black
1ed6000193 ncstats: add plane count, fix fbbytes accounting 2020-02-07 09:19:08 -05:00
nick black
d05abe8626 use channels_set_bchannel() 2020-02-07 09:19:08 -05:00
nick black
62488eaf10
blit->ncblit #324 2020-02-05 20:40:36 -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
09ff64e19f
ncdirect_style_*() #321 2020-02-05 02:52:45 -05:00
nick black
bb7b92ea4a
ncdirect_styles_*() declarations #321 2020-02-05 02:27:41 -05:00
nick black
5cd3a4c41d
ncdirect_dim_y()/x() 2020-02-04 03:04:38 -05:00
nick black
2a9f3c5ab3
ncmenu_selected(), update docs #179 2020-02-04 01:05: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
5cf1bba5f5
menu: unit test with section #179 2020-02-03 12:46:40 -05:00
nick black
ee6eb1a37b
ncmenu: support iteration within a section 2020-02-03 01:07:58 -05:00
nick black
fa88f9b525
ncmenu: nextsection/prevsection 2020-02-02 19:02:52 -05:00
nick black
4586dd7e19 ncmenu: properly place unrolled menu #179 2020-02-02 12:57:32 -05:00
nick black
31a07dab33
menu: extend across width of screen #179 2020-02-02 06:02:57 -05:00
nick black
fdc541c6e5 copy over menu elements #179 2020-02-02 05:13:40 -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
6e642f1749 more menu work #179 2020-02-02 05:13:40 -05:00
nick black
2cf3835ddd Add menu_options struct #179 2020-02-02 05:13:40 -05:00
nick black
25ce448889
rgba_blit()/bgrx_blit() #311 2020-02-02 02:20:01 -05:00
nick black
c1664170fd
selector: bgchannels only inside the body #302 2020-01-31 21:25:21 -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
85f042c644
add selector to README #302 2020-01-31 17:33:47 -05:00
nick black
d30df23f43
selector: support non-zero default idx #302 2020-01-30 22:42:25 -05:00
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).
2020-01-30 22:17:07 -05:00
nick black
a57f0f234c
selector styling 2020-01-30 22:16:03 -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
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.
2020-01-27 02:18:05 -05:00
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.
2020-01-25 01:13:04 -05:00
nick black
3d4e157af6 direct-mode coloring #77 2020-01-24 04:06:41 -05:00
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.
2020-01-24 04:06:41 -05:00
nick black
55699c6a3c
render summary: autoscale all times 2020-01-22 08:28:56 -05:00
Marek Habersack
75a90461dd Add C++ bindings 2020-01-22 06:47:43 -05:00
nick black
be3a53f3cf
input: function key defs through kf59 2020-01-20 00:00:09 -05:00
nick black
507c3e1d00
expunge wayward fragment of comment 2020-01-19 15:15:42 -05:00
nick black
4ece4a9075
demo: skip demos which we don't have support for 2020-01-19 06:09:59 -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
1b01494c79 implement ncplane_greyscale() #280 2020-01-17 08:35:28 -05:00
nick black
08f6fa0e79 implement ncplane_dup() 2020-01-17 08:35:28 -05:00
nick black
209d4f41f4 palette: add necessary predicates #230 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
6365fc0917 encode palette index into channels/attr #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
67b5a20758 implement ncplane_putwc_yx() 2020-01-15 04:50:54 -05:00
nick black
dd7f8eff4b
ncvisual_stream: add timescale param 2020-01-14 15:50:17 -05:00
nick black
23b5078ed1
pulsing text declarations 2020-01-14 01:09:26 -05:00
nick black
56a54b5441
break apart render/rasterize #155 2020-01-12 23:01:03 -05:00
nick black
2ebc3e2bfe blend: conditionally blend in alpha 2020-01-12 07:46:38 -05:00
nick black
3faffaa847 channels_blend() : don't blend in wide status #260 2020-01-12 07:46:38 -05:00
nick black
922c639355 cell: add clipped 2020-01-12 07:46:38 -05:00
nick black
0f60af347d add clipped set functions 2020-01-12 07:46:38 -05:00
nick black
306045116f API: always call complex from static simple 2020-01-07 16:15:27 -05:00
nick black
acef43c759
avcodec_parameters_to_context() #215 2020-01-07 09:30:50 -05:00
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
2020-01-04 07:21:54 -05:00
nick black
5dd90f3735 add ncplane_dim_[yx] quick accessors 2020-01-04 04:34:29 -05:00
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
2020-01-04 02:37:55 -05:00
nick black
2ada135fc2
add ncplane_resize_simple() 2020-01-03 21:37:06 -05:00
nick black
0de1856e38 accept a loglevel for libav 2020-01-03 05:51:27 -05:00
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
2020-01-01 06:41:19 -05:00