Commit Graph

328 Commits (a7d9220f210faa68fe31cdd7e1e18cc03618c2ba)

Author SHA1 Message Date
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`
5 years ago
nick black b04a37c433
plots: always start from the right #457 5 years ago
nick black 2c2da61c72
ncdirect: add relative move functions #419 5 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
5 years ago
nick black eccb24a391 c++ plot shouldn't allow negative samples #447 5 years ago
nick black 9dc81f0b64 c++ wrappers for ncplot #441 5 years ago
nick black 77dd998b05
ncplot uses exclusively non-negative samples #447 5 years ago
nick black 5c44416426
export ncplane_putstr_yx() as static inline 5 years ago
nick black 4a6ab358ba inline ncplane_putsimple_yx() 5 years ago
nick black fcd7e19e4c Add ncplane_set_scrolling() #323 5 years ago
nick black 4917603478
ncplot: swap NCPLOT_2x1 and NCPLOT_1x1x4 5 years ago
nick black 2a7ccffec6 ncplot: add labelaxisd, use it in keyplot #438 5 years ago
nick black c0f8d9b444
eliminate detectdomain, infer it from maxy==miny #439 5 years ago
nick black 68b4ba1706 plots: implement remaining vertical grid types #136 5 years ago
nick black 5f3eb3dc24 keyplot: add third plot, this one with half blocks #433 5 years ago
nick black a3f7dd486b plot: AugmentSample5 test case 5 years ago
nick black 5bccf6b446 ncplot: implement x windowing #430 5 years ago
nick black 4926186b5a ncplot: check input parameters for validity #430 5 years ago
nick black b3e874a179 ncplot: fold minx, maxx into rangex 5 years ago
nick black 09d8912d4e notcurses-keyplot #430 5 years ago
nick black 5e27499194 add notcurses-keyplot #430 5 years ago
nick black d541cda306 independent variable 5 years ago
nick black 4afda7a625 float some geometry concepts 5 years ago
nick black 5aedb3491d ncplot_plane(), ncplot_destroy() 5 years ago
nick black f29a5a7bd9 declare ncplot_create() 5 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.
5 years ago
nick black 8651486ad7
Don't say DirectColor when TrueColor is meant 5 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.
5 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.
5 years ago
nick black 91f907a184
gradient_sized (C++): fix parameter name 5 years ago
Nick Black f9c54761f5
Basic mandelbrot for `n`ormal demo #145 (#424)
normal: working mandelbrot, very basic #145
5 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
5 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
5 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.
5 years ago
nick black 8113ce72c1 fix dumb error in ncplane_below() description 5 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
5 years ago
Marek Habersack ad93c03851 [C++] API sync
Added:

  * Plane: mergedown (`ncplane_mergedown`)
5 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
5 years ago
nick black 7e71ad8e11 implement ncplane_mergedown() #361 5 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.
5 years ago
nick black 8312b88e3c NotCurses::stop(): match original semantics 5 years ago
nick black 66bb614ab3 NotCurses::stop(): propogate out notcurses_stop() return value 5 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
5 years ago
nick black ba90c70a47
ncplane_cursor_yx() takes const first argument 5 years ago
nick black 1b4333861a
add ncdirect_{en,dis}able_cursor() #402 5 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
5 years ago
nick black be089747a7 ncmultiselector_selected() #322 5 years ago
nick black 638be8feb7 multiselector options/items #322 5 years ago
nick black a46393b035 ncmultiselect: get space rigged up #322 5 years ago
nick black 4abe078eae ncmultiselector #322 5 years ago