Commit Graph

298 Commits

Author SHA1 Message Date
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