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
nick black
4e7d918732
Merge branch 'master' of github.com:dankamongmen/notcurses
5 years ago
nick black
0432a8a444
poc/zalgo: center output
5 years ago
nick black
84ef40143e
tetris: eliminate compiler warning
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
nick black
c3feca6ded
ncplane_polyfill: reject null glyph + test #418
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
fbd222b04a
notcurses_init(): mention setlocale in error
...
If notcurses_init() fails due to a bad encoding, it's
probably because someone didn't call setlocale(3).
Make a suggestion in the error message. Resolves #414 .
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
bb2c469168
Merge branch 'master' of github.com:dankamongmen/notcurses
5 years ago
nick black
12b601e02b
fallin': always push back NULLed out subwindows
...
I noticed while running benchmarks against ranges of widths that
we failed on certain widths. I traced this down to a repeatable
failure when run with the -c flag at the 104x52 resolution. At this
geometry and PRNG seed, we NULLed out the first subwindow of fallin',
but didn't recompress the window array. On the next loop we thus used
it again, and segfaulted out. This fixes that up. We now pass 100% of
the benchmarks, whereas we were failing about 3% before #407 .
5 years ago
nick black
bc3473da8a
demo: print unnecessary comma in JSON
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
d5d827f38e
adjust ncplane_yx() for margins
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
982d729c69
switch to CLOCK_MONOTONIC from _RAW
5 years ago
nick black
d77aa78a0e
s/CLOCK_MONOTONIC_RAW/CLOCK_MONOTONIC/g
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
nick black
667ac14549
ncmultiselector: draw properly
5 years ago
nick black
a9c64a8c8b
yummy covid-19
5 years ago
nick black
078feca8e6
ncmultiselector links up
5 years ago
nick black
635d6e5751
ncmultiselect demo
5 years ago
nick black
583906368c
add internal safe home_cursor()
5 years ago
nick black
eead4c1414
notcurses_highgradient() added #398
5 years ago
nick black
d7ea87e129
notcurses_refresh(): properly initialize rvec #380
5 years ago
nick black
83b325de05
notcurses_refresh(): drop double write #380
5 years ago
nick black
e1b729c6a3
Kill warn_unused_result warning in reel demo
5 years ago
nick black
d44759fd25
kill compiler warning on write(2)
5 years ago
nick black
e2459ac1a4
purge old rotate implementation #351
5 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
5 years ago
nick black
333f7c1192
define ncplane_rotate_cw/ccw()
5 years ago
nick black
b8608c15c9
ncdirect_init(): reset style #393
5 years ago
nick black
c355e26d0f
add zalgo poc
5 years ago
nick black
696873894e
ncmenu_offer_input: return true on match
5 years ago
nick black
163565dddd
handle_mouse(): drop unused variables
5 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 .
5 years ago
nick black
6966632821
demo: hook up menu mouse support #309
5 years ago
nick black
6690bc6bb9
Unroll/roll up menus based on mouse #306
5 years ago
nick black
c6a3f93691
ncmenu: check mouse clicks for presence #306
5 years ago
nick black
a325a6d4b0
remove unnecessary c++ Visual() error check #378
5 years ago
nick black
e7d0ce72dd
view: catch exception on Visual constructor #378
5 years ago
nick black
5a8107b788
ncdirect: preserve colors on sgr #391
5 years ago
nick black
bb579d0d05
notcurses_directmode()->ncdirect_init()
5 years ago
nick black
314eba5530
reel: don't quit on NCKEY_RESIZE #390
5 years ago
nick black
c0f25b2ba0
Fix up reel-demo input issues #390
5 years ago
nick black
43a8fcf195
augh! fix hidden alignment problem
5 years ago
nick black
e679816731
demo: set up input eventfd #390
...
When we process input in the demo, write a packet to an
eventfd we set up in input_dispatcher(). This way,
demo components can poll() on that. #390
5 years ago
nick black
e6bbcd2e70
Selector: properly place scroll arrows #388
...
When the selector body was being sized by the header
or footer (as opposed to option+desc length), our scroll
arrows are misplaced. They now land properly. Mouse
clicks are properly placed now, and screenshots have been
updated in the guide.
5 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
5 years ago
nick black
1030409096
move fill/stain routines into fill.c
5 years ago
nick black
5d8da395b9
demo: Fix JSON output for multiple runs #387
5 years ago
nick black
0dc5456035
Emit JSON on -J arg to demo #387
...
Accept -J as a parameter requiring an option to notcurses-demo(1).
Update the man page and usage message to reflect this. Open the
specified file for binary writing with truncation at option parsing
time; fail out if we can't open it. At the end of the demo, write
the results out as JSON, using full precision for all values #387 .
5 years ago
nick black
87cac84db2
remove obsolete FIXME
5 years ago
nick black
b7a028569c
gradient: support default/palette #376
5 years ago
nick black
5b4c6c14e3
gradient: implement + test 1d fills
5 years ago
nick black
b6438e415d
poc/geom: three new stupid unicode tricks
5 years ago
nick black
2c98013150
python: fix up seqnum reference
5 years ago
nick black
519f77dd7f
notcurses_refresh: resynthesize unoptimized stream #380
5 years ago
nick black
fddff356a4
ncdirect_clear(): don't deref null clear
5 years ago
nick black
a09bdc4ade
Add seqnum field to ncinput #374
5 years ago
nick black
a626178b16
ncdirect: cursor movement / geom detection #382
5 years ago
nick black
91f59b763d
don't deadlock in demo when cancelled
5 years ago
nick black
0e3be34d2c
demo: hook up Ctrl+L to refresh #379
5 years ago
nick black
9db4bdd599
ncselector: move to mouse press #305
5 years ago
nick black
2b0efddb27
poc/menu: make menu items visible
5 years ago
nick black
773b85e81e
poc/menu: kill brown-bagger, add backgrounds #383
5 years ago
nick black
c9a0964034
menu: check for mousepress #306
5 years ago
nick black
bdd0917ea4
selector: transparent where we aren't
5 years ago
nick black
5980c9ae66
sliders: always an even width, for centering 2-digit IDs
5 years ago
nick black
9206329ea7
uniblock: annihilate RTL glitches, finally #259
5 years ago
nick black
78595399a1
demo: properly color vertbar in summary line
5 years ago
nick black
339185dd6f
demo: handle_input() deadline check #377
5 years ago
nick black
58b67a56af
demo: still show elapsed time when aborting
5 years ago
nick black
a88683fe3c
sliders: stainable numbers
5 years ago
nick black
a9298e89e3
selector: scroll with mouse #305
5 years ago
nick black
9b0603bb32
Implement + test ncplane_mouseevent_p() #305
5 years ago
nick black
c02e6311c7
sliders: use notcurses_stddim_yx()
5 years ago
nick black
f452583094
DFSG build: don't try to load lamepatents.gif
5 years ago
Nick Black
745e742a12
Fix gradient engine #368 ( #372 )
...
Simplify and correct the gradient engine, resolving all test breakage.
5 years ago
nick black
3f6b9c3c62
input: interpret ht as tab
5 years ago
nick black
c8068cb72d
render: don't need to double convert 0->0x20
5 years ago
nick black
5e38da9ea3
implement ncplane_stain() #347
5 years ago
nick black
002e8be574
implement ncplane_format() #347
5 years ago
nick black
2780734efd
add ncplane_translate()
5 years ago
nick black
126145e417
demo: convert to new notcurses_stddim_yx() where appropriate #365
5 years ago
nick black
f9d98dd05c
notcurses_stdplane_dimyx() #365
5 years ago
nick black
88c49df1b1
v1.2.1
...
DSFG demo can't have luigi
s/1.2.0/1.2.1/g
5 years ago
nick black
35d850f008
Implement + test ncplane_putegc_stainable() #352
5 years ago
nick black
3eb7a882bc
demo: give frame count another column
5 years ago
nick black
cff477776c
intro: don't keep rotating bar during fade
5 years ago
nick black
e9818fe8e8
pydemo: extract demo from main module
5 years ago
nick black
83e73fb429
install notcurses-pydemo #359
5 years ago
nick black
02f27b3520
colloquy: license declaration
5 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
5 years ago
nick black
887d4f1f79
switch subtitles to HIGHCONTRAST, big improvement! =D
5 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
5 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)
5 years ago
nick black
f5eda4b773
intro: constrain horizontal size of center panel for new logo
5 years ago
nick black
1130938d4f
remove poc/jungle.c
5 years ago
nick black
03756d05a4
demo: throw border around HUD, make HUD more transparent
5 years ago
nick black
636f1ec09b
demo: on restart, maintain HUD if up
5 years ago
nick black
7120d428e8
boxdemo: finally do something worth doing
5 years ago
nick black
865241ee7c
intro: always reset cursor on entrance
5 years ago
nick black
def5dd49e2
intro: throw up a nice gradient
5 years ago
nick black
2114cc2eda
demo: rewrite handloop with ncplane_gradient()
5 years ago
nick black
7addd06341
more gradient work, more unit tests #340
5 years ago
nick black
61fe5f5b7e
gradient + unit test #340
5 years ago
nick black
75ef60b249
demo: lighten ABORTED/ERROR
5 years ago
nick black
936ff4304b
whiteout: reliable abortion detection
5 years ago
nick black
86668ab6d5
whiteout-demo: propagate abortion result
5 years ago
nick black
272c5bdc57
demo: fix ncmenu null deref + uninitialized ignore_failures
5 years ago
nick black
fb58fade85
improve notcurses_init() warning color
5 years ago
nick black
c6520ab84c
add notcurses_drop_planes, use from demo #346
5 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`)
5 years ago
nick black
082f35c7f7
purge debugging cruft
5 years ago
nick black
124004c87c
add nplane_polyfill_yx() #340
5 years ago
nick black
ce3e5d112e
add ncdirect_clear() #343
5 years ago
nick black
6d629025e3
add ncdirect_fg_default() and ncdirect_bg_default()
5 years ago
nick black
60fe544a33
notcurses: color up warning diagnostics
5 years ago
nick black
9923b69296
demo: remove H option, no longer necessary
5 years ago
nick black
d21c16a6f5
demo: translucent about panel #331
5 years ago
nick black
07b54aab58
demo: add 'q'uit to menu #331
5 years ago
nick black
11ca32a1e8
demo: hook up restart demos/ctrl+r #338
5 years ago
nick black
87acdbeb68
keep about splash on top #338
5 years ago
nick black
8beb5d66fd
demo: hook up Ctrl+'u' for about screen #338
5 years ago
nick black
d8c42d4d1e
ncmenu_selected() fills in an ncinput #333
5 years ago
nick black
bd046db71e
demo: handle NCKEY_ENTER in menu
5 years ago
nick black
07681dca38
interrogate_terminfo: check for am capability
5 years ago
nick black
ee90b51e14
Map ^J and ^M to NCKEY_ENTER...for now #303
5 years ago
nick black
bfd3d173d9
poc/visual: refer to DFSG media
5 years ago
nick black
8249bac3e9
demo: translucent menu, always display HUD close button
5 years ago
nick black
0d9b4f1aa1
demos: don't step all over top line
5 years ago
nick black
b637ee9bf9
render: lock in highcontrast at the end
5 years ago
nick black
048b17952e
notcurses_ncinput(3): add NOTE about shift key
5 years ago
nick black
bae60a98e7
demo: all demos can be interrupted via demo_render()
5 years ago
nick black
e71c9284ef
man pages: address some syntax issues
5 years ago
nick black
ed0d5e6ae3
uniblock: spelling
5 years ago
nick black
ae62e046b0
python: add shebangs
5 years ago
nick black
80f11b2d0d
add pydemo to test installed package
5 years ago
nick black
204181b706
ncselector_offer_input() and rewrite pocselector #333
5 years ago
nick black
b0c72607c4
ncmenu_offer_input(), use it in demo/pocmenu #333
5 years ago
nick black
79661633f0
ncmenu: knock out unterminated short descs
5 years ago
nick black
aacec297b2
ncmenu: declare ncmenu_offer_input()
5 years ago
nick black
093b4aa730
highcon: make text orderly
5 years ago
nick black
74b9690cf3
ncmenu: remove dumb restrictions/special casing
5 years ago
nick black
d6ea7f9b6c
CELL_ALPHA_HIGHCONTRAST: evaluate against final background
5 years ago
nick black
5086bbf1fc
demo: less pronounced menu color
5 years ago
nick black
ab8417e488
demo: handle remaining menu inputs
5 years ago
nick black
d3c26320ef
demo: don't draw sections transparently #336
5 years ago
nick black
92cb0b9abf
demo: handle menu navigation
5 years ago
nick black
2dde1d4af7
demo: hold arrow keys back for menu
5 years ago
nick black
b56e597bb8
uniblock: adapt to ncmenu
5 years ago
nick black
1fc5afbe8d
uniblock: adapt for demo menu
5 years ago
nick black
006ee00142
boxdemo: adapt to menu
5 years ago
nick black
501fe166e4
trans: adapt to ncmenu #332
5 years ago
nick black
d55f1b78d8
xray: adapt to menu
5 years ago
nick black
328426c3e7
demo: adapt intro to menu
5 years ago
nick black
28bfa4d854
ncmenu: right-align selected sections #332
5 years ago
nick black
71dbfd74f7
ncmenu: step around alignment NULL #332
5 years ago
nick black
3bbb752554
ncmenu: unrolled body needs be transparent #329
5 years ago
nick black
25e2f59f4b
ncmenu: searching for cause of discoloration #329
5 years ago
nick black
cdcc275e07
HUD: always display a close button in upper right
5 years ago
nick black
80e449cf79
demo: fix up ignore option
5 years ago
nick black
5c67591294
python: match new blend signatures
5 years ago
nick black
5b20651836
demo: add menu, but disable for now
5 years ago
nick black
3cdac5ce28
high-contrast text, simple linear average model #181
5 years ago
nick black
1ed6000193
ncstats: add plane count, fix fbbytes accounting
5 years ago
nick black
6798233afe
highcontrast demo: turn on motto
5 years ago
nick black
290bd983ac
highcontrast demo: tighten up minimize() #181
5 years ago
nick black
f5fd95287e
highcontrast: kill nonsense line
5 years ago
nick black
f688f9b9c3
highcontrast demo cycle #181
5 years ago
nick black
8e29b5ba0f
add highcon demo #181
5 years ago
nick black
05997f9988
notcurses-demo: accept -i to continue on demo failure
5 years ago
nick black
dfe4a99446
ncplane_putegc_yx: set sbytes on error path
5 years ago
nick black
85e377e652
Accept US-ASCII/C encoding, with warning.
5 years ago
nick black
62488eaf10
blit->ncblit #324
5 years ago
nick black
74775b97ec
enmetric->ncmetric #324
5 years ago
nick black
89f516dcaa
tablet->nctablet, add ncreel to python #324
5 years ago
nick black
c519c95fff
panelreel -> ncreel #324
5 years ago
nick black
b38985e99c
demo: print default data dir in usage()
5 years ago
nick black
01bc543399
tag demos requiring ffmpeg
5 years ago
nick black
0bff959eed
demo: don't allow HUD to drive rendering
5 years ago
nick black
14f03f781a
add some missing locking #290
5 years ago
nick black
09ff64e19f
ncdirect_style_*() #321
5 years ago
nick black
bb7b92ea4a
ncdirect_styles_*() declarations #321
5 years ago
nick black
6bf812a306
demo: elide nonfree demos in DFSG build #316
5 years ago
nick black
832451a966
notcurses-view: erase base plane each frame #314
...
On a resize, notcurses-view left cruft in the middle of the
top line due to the frame/time being moved. An erase is awfully
heavyweight here, in the abstract, but it gets the job done
simply, and doesn't seem to have much performance impact.
5 years ago
nick black
ab3a91c5d0
python for ncdirect
5 years ago
nick black
8ac16b734f
keep ncmenu on top #179
5 years ago
nick black
2a9f3c5ab3
ncmenu_selected(), update docs #179
5 years ago
nick black
4d613217b3
ncmenu: only allow one at a time
5 years ago
nick black
10a269c963
ncmenu: reject double menu
5 years ago
nick black
039a390877
ncmenu: print item shortcut aligned right #179
5 years ago