Commit Graph

1673 Commits

Author SHA1 Message Date
nick black
58cc6927ac 256-color cube is not ansi, don't muddy the waters 2019-12-16 21:31:18 -05:00
nick black
65858b4495 unit test 256-index quantizing #4 2019-12-16 21:31:18 -05:00
nick black
a916d929db
RGBtoANSI: fixup lower grey onversions, looks reasonable now #4 2019-12-15 23:13:13 -05:00
nick black
cfccd0c39c
RGBtoANSI unit test, fix up bases 2019-12-15 21:33:26 -05:00
nick black
8b664a14ef
move RGBtoANSI into internal header 2019-12-15 21:13:56 -05:00
nick black
041e6438e3
quantize to ansi256, atrociously #4 2019-12-15 20:53:10 -05:00
nick black
f9ac7a7737
image in README 2019-12-15 17:17:20 -05:00
Nick Black
2de07f8a48
Per-line damage map, ~50% increase in FPS on notcurses-demo (#144)
Implement a fairly conservative, line-granularity, two-level damage map. One on the overall notcurses object is dirtied by planar moves, creations, deletions, and resizes. One on each ncplane is dirtied by glyph output, media rendering, fades, and erasure. #83 This has some definite false positives: a hidden plane which moves will damage a bunch of lines unnecessarily. For now, don't do things like that :D.

Extra byte per line per plane, shouldn't be a problem.

Two new stats for cell elisions and emissions

Allow keypress to interrupt view-demo

ncvisual_stream() now allows a callback per frame

Allow ncvisual_open() to create its own, perfectly-sized, ncplane #128

Typical performance prior to this PR:

4655 renders, 18.3s total (0.000305s min, 0.196s max, 0.0039s avg 253.9 fps)
401046.505KB total (9.688KB min, 139.697KB max, 86.15KB avg)
Emits/elides: def 1082115/116196 fg 10547624/7236460 bg 10602717/6208644
 Elide rates: 9.70% 40.69% 36.93%
4680 renders, 18.4s total (0.000285s min, 0.15s max, 0.0039s avg 255.0 fps)
403078.188KB total (9.688KB min, 139.697KB max, 86.13KB avg)
Emits/elides: def 1088994/116196 fg 10604983/7267750 bg 10655426/6237472
 Elide rates: 9.64% 40.66% 36.92%
4699 renders, 17.8s total (0.000227s min, 0.192s max, 0.0038s avg 263.8 fps)
403266.907KB total (9.688KB min, 139.697KB max, 85.82KB avg)
Emits/elides: def 1086511/116196 fg 10601709/7359116 bg 10661910/6326744
 Elide rates: 9.66% 40.97% 37.24%

After this PR:

5625 renders, 15s total (9.36e-05s min, 0.187s max, 0.0027s avg 375.2 fps)
168365.640KB total (0.930KB min, 139.600KB max, 29.93KB avg)
Emits/elides: def 310575/116196 fg 4486002/4473416 bg 4116835/4630666
 Elide rates: 27.23% 49.93% 52.94%
Cells emitted; 9928000 elided: 12572000 (55.88%)
5642 renders, 14.2s total (9.17e-05s min, 0.154s max, 0.0025s avg 397.0 fps)
168669.009KB total (0.605KB min, 139.600KB max, 29.90KB avg)
Emits/elides: def 310819/116196 fg 4499833/4482134 bg 4118562/4652470
 Elide rates: 27.21% 49.90% 53.04%
Cells emitted; 9962160 elided: 12605840 (55.86%)
5650 renders, 14.3s total (0.000118s min, 0.143s max, 0.0025s avg 395.7 fps)
169461.884KB total (0.860KB min, 139.600KB max, 29.99KB avg)
Emits/elides: def 305431/116196 fg 4515396/4456376 bg 4149967/4613668
 Elide rates: 27.56% 49.67% 52.65%
Cells emitted; 9945200 elided: 12654800 (55.99%)

on netcurses-demo, we're eliding about half of the total cells via this damage map. that's pretty fucking sweet! FPS increase of about 50% -- I'll take that any day of the fuckin' week, boyo. w00t!

https://www.youtube.com/watch?v=XbGs_qK2PQA
2019-12-15 13:46:47 -05:00
nick black
ce9eeecc3b
render: eliminate grotesque stupidity
We were doing an entire copy of the framebuffer every fucking
render for no good reason whatsoever. Found this while working
on #83, but let's get it in master immediately. JFC. I suck.

Before (delay factor of 0.5):

[schwarzgerat](0) $ time ./notcurses-demo -d.5
Term: xterm with direct-color indexing
1737 renders, 24.8s total (0.00131s min, 0.362s max, 0.014s avg 70.1 fps)
230217.182KB total (12.696KB min, 223.310KB max, 132.54KB avg)
Emits/elides: def 1074878/126257 fg 6615070/3023957 bg 5519815/3130192
 Elide rates: 10.51% 31.37% 36.19%

real	0m47.653s
user	0m8.977s
sys	0m1.414s
[schwarzgerat](0) $

After (same delay factor of 0.5)

[schwarzgerat](0) $ time ./notcurses-demo -d.5
Term: xterm with direct-color indexing
1741 renders, 23.2s total (0.00125s min, 0.351s max, 0.013s avg 75.0 fps)
231551.089KB total (12.696KB min, 223.310KB max, 133.00KB avg)
Emits/elides: def 1065445/126257 fg 6655295/3006679 bg 5566155/3115184
 Elide rates: 10.59% 31.12% 35.88%

real	0m46.140s
user	0m8.932s
sys	0m1.350s
[schwarzgerat](0) $

Now *there's* the loss we saw during #139 work, thinking we'd get it
back in #143. Good. Huzzah! But also fuck!
2019-12-15 12:23:38 -05:00
nick black
8bd4607e9b
Merge branch 'master' of github.com:dankamongmen/notcurses 2019-12-15 05:22:19 -05:00
nick black
f374682134
panelreel: add tablet curry accessors 2019-12-15 05:22:12 -05:00
nick black
4ea62e3c67
input: handle function keys through f30 2019-12-15 02:18:54 -05:00
nick black
364db519bb
stop shifting style bits stupidly 2019-12-15 02:06:18 -05:00
nick black
5deb896696
panelreel-demo: two tablets to start with 2019-12-14 20:21:26 -05:00
nick black
3b2f72538e
decode more special keys in notcurses-input #134 2019-12-14 18:37:09 -05:00
nick black
c9b6f84dec
fix up default elision in alpha channels #143 2019-12-14 17:59:39 -05:00
Nick Black
8bd8055f72
Distinct fg/bg alpha channels #139 (#141)
* improved alpha macros
* demo: use new alpha macros
* add ncplane_set_*_alpha()
* explicitly set fg for uniblock
* outro: background is a space #139
* distinct alpha channels for fg/bg #139
* rename 'background' cell to 'default' #142
* doc palette fades
2019-12-14 17:34:10 -05:00
Nick Black
ff463d464e
Channels API sanity #119 (#138)
* orthogonalize channel/channels/cells APIs #119
* sync README.md with new ncplane channels api #119
2019-12-14 05:33:34 -05:00
nick black
54eb41cf3a
panelreel-demo: done after demodelay * 5 #135 2019-12-13 20:25:48 -05:00
nick black
88163325fa
widecolor: proceed without keypress #135 2019-12-13 20:10:39 -05:00
nick black
d500bf166e
block_on_input(): allow a NULL sigmask 2019-12-13 20:09:16 -05:00
nick black
f407d7b114
ncplane_box: control corner drawing, stop emitting extra vlines #133 2019-12-13 19:45:34 -05:00
nick black
71a2660b57
fatal_handler: grab ABRT as well 2019-12-13 19:18:24 -05:00
nick black
e6d35978d4
add notcurses_refresh() declaration 2019-12-13 18:02:35 -05:00
nick black
18a33a0328
handle still more key sequences #134 2019-12-13 17:18:54 -05:00
nick black
0e3b2d7516
print framebuffer size using metric info units 2019-12-13 17:12:10 -05:00
nick black
e1fb283018
input: handle more sequences #134 2019-12-13 16:54:09 -05:00
nick black
6e49bbce45
panelreel: don't treat putc() return as bool #132 2019-12-13 15:28:11 -05:00
nick black
a9c21526a7
add history 2019-12-13 13:00:29 -05:00
nick black
489ca06fe6
Merge branch 'master' of github.com:dankamongmen/notcurses 2019-12-12 16:23:45 -05:00
nick black
c2c017831f
add ncplane_get_channels() 2019-12-12 16:23:05 -05:00
nick black
7c72b0ce83
emoji unit test 2019-12-12 16:14:01 -05:00
nick black
e71fa57e54
add 'rgb' PoC, fix setlocale() mention 2019-12-12 08:13:14 -05:00
nick black
a55d877281
add FIXME regarding sgr and ncv 2019-12-12 08:03:55 -05:00
nick black
1821867e35
move outfp out of notcurses_options #130 2019-12-12 07:59:48 -05:00
nick black
21c4a9a2eb
demos: use ncalign_center throughout 2019-12-12 07:45:54 -05:00
nick black
7d2b0938e5
uniblock-demo: vastly improved via hook->fade 2019-12-12 07:35:32 -05:00
nick black
d20da07fe0
widecolor: maintain a single background in message 2019-12-12 07:23:23 -05:00
nick black
8de3696268
add ncplane_putwstr_aligned(), update docs #102 2019-12-12 07:07:04 -05:00
nick black
de595380b6
ncplane_putstr_aligned(), use it in intro #102 2019-12-12 07:01:05 -05:00
nick black
c0b10a8f32
enable sgr/sgr0 #73 2019-12-12 06:21:16 -05:00
nick black
1ccb747e72
sgr: support disabling ALTCHARSET 2019-12-12 05:06:07 -05:00
nick black
3a79cbf469
proof of concept support. sgr binary 2019-12-12 04:52:59 -05:00
nick black
64462a11ac
for real tho 2019-12-10 16:21:32 -05:00
nick black
208077b95c
enmetric unit tests 2019-12-10 16:21:18 -05:00
nick black
c7c52f21d5
luigi: just use the three frames in a loop 2019-12-10 12:20:44 -05:00
nick black
206db6dedd
sgr unit tests 2019-12-10 08:50:32 -05:00
nick black
624ab35b8f
close bracket in output #121 2019-12-10 07:29:03 -05:00
nick black
e45df10dca
input: handle unicode #121 2019-12-10 07:28:02 -05:00
nick black
6c14a47368
input: pass through decoded utf8 #121 2019-12-10 07:25:38 -05:00
nick black
ad4c8ac58a
luigi: set sprite background so we can elide more 2019-12-10 07:03:29 -05:00
nick black
7eafdd6772
fix up unit testing sanity 2019-12-10 06:59:35 -05:00
Nick Black
0d2c43603b
Luigi in Mega Man world (#127)
* uniblock-demo: reset background to black
* warning about quantization
* some luigi love
* update cell documentation
* add unit test for move of stdplane
* MoveToLowerRight unit test
* ncplane_move_yx(): error to move stdscr
* better box permutations test
* luigi in megaman2 world
* stats: don't print 'em if we haven't got 'em
2019-12-10 06:02:49 -05:00
nick black
fdc4325929 widecolor: make message its own plane #110 2019-12-08 17:56:03 -05:00
nick black
66fa8854f3 outro effects 2019-12-08 17:56:03 -05:00
nick black
5e5abd7cbd extract outro 2019-12-08 17:56:03 -05:00
nick black
3a6551ab4d
uniblock-demo: scroll the blocks right-to-left #104 2019-12-08 16:48:58 -05:00
nick black
93231c26eb input: use SPUA-B for special keys #118 2019-12-08 15:32:57 -05:00
nick black
949e531038
notcurses-input: colorize output 2019-12-08 14:35:29 -05:00
nick black
e77c584815
fadeout: handle background #111 2019-12-08 14:19:59 -05:00
nick black
065d44001c
change demo order 2019-12-08 14:05:48 -05:00
nick black
ea10d80eec
remove duplicate macro define 2019-12-08 13:50:59 -05:00
nick black
0c5c696084
boxdemo: center target grid 2019-12-08 13:43:37 -05:00
Nick Black
38a10d9065
Transparency via alpha channels (#122)
* outro: bevel message window's corners
* egcspool: use full 25 bits available for 32MB pools
* render: remove unused inheritance mask
* interfaces + unit tests for 2-bit alpha
* notcurses_*g_alpha() acccessors
* cell alpha + unit tests
* panelreel: support a background channel
* notcurses: transparency via alpha channel
* remove unused CELL_ALPHA_MASK
2019-12-08 13:00:19 -05:00
nick black
15c13898ea
don't require civis if retaining cursor 2019-12-07 22:26:35 -05:00
nick black
7566af57e3
introduce ncplane_set_[fb]g 2019-12-07 17:55:23 -05:00
nick black
79253caf31
render: reorder assignment to work around -Wclobbered 2019-12-07 17:29:17 -05:00
nick black
98b323e9a0
demo: only print 'unknown demo' msg when appropriate 2019-12-07 17:12:47 -05:00
nick black
8afcd04446
sync cell/ncplane fg/bg API naming 2019-12-06 22:45:08 -05:00
nick black
78ec605cc6
render: revert cleartoeol, as it leads to flicker 2019-12-06 16:31:00 -05:00
nick black
3d2c2265e0
render: work around wide chars at the far boundary 2019-12-06 16:29:17 -05:00
nick black
3bd43c871d
widecolor: maintain color across resizes 2019-12-06 16:23:31 -05:00
nick black
0392aa34ea
notcurses: get el terminfo capability 2019-12-06 15:46:56 -05:00
nick black
ee4c3d217b
widecolor: detect and inhibit wide spaces 2019-12-06 15:46:28 -05:00
nick black
df93b67b4e
fix up subject of libav test 2019-12-06 14:41:49 -05:00
nick black
6248714cd0
widecolor: oh what fun 2019-12-06 04:31:37 -05:00
nick black
065f8170ef
Merge branch 'master' of github.com:dankamongmen/notcurses 2019-12-05 17:38:39 -05:00
nick black
cb5b0e2968
א guy #110 2019-12-05 17:38:36 -05:00
nick black
bf12ea3c59
panelreel-demo: no general border 2019-12-05 14:48:59 -05:00
nick black
52f5bd1612
widecolors: allow all characters 2019-12-05 14:48:47 -05:00
nick black
638cc5903b
fix up usage message 2019-12-05 09:50:10 -05:00
nick black
541f9304df
widecolor-demo: move snake more quickly #110 2019-12-05 08:52:30 -05:00
nick black
6c5bd5d263
outro: fade background, but not foreground 2019-12-05 08:04:24 -05:00
nick black
3cda04e6ab
panelreel-demo: black background on border 2019-12-05 04:23:29 -05:00
nick black
bacc69380a
uniblock: restore backgrounds 2019-12-05 04:18:43 -05:00
nick black
3c93030177
notcurses_*_default_prep() 2019-12-05 03:54:41 -05:00
nick black
56cad83a4b
widecolor-demo: improve background colors 2019-12-05 03:53:51 -05:00
nick black
64543919ef
preserve default background color during interpolation #115 2019-12-05 03:53:26 -05:00
nick black
774f8e5a23
summary: fix minima trackers 2019-12-05 02:01:49 -05:00
nick black
6e73e3b72f
widecolor-demo: friendly snake 🐍 #110 2019-12-05 01:16:02 -05:00
nick black
be6aa8a3fc
notcurses_render(): guard critical section with pthread_cancel_push() 2019-12-05 01:09:45 -05:00
nick black
7e5e6bc545
slider-demo: force more squarish appearance 2019-12-05 00:43:09 -05:00
nick black
ac845b28a4
handle function keys, insert, end/home, etc #78 2019-12-05 00:24:08 -05:00
nick black
af7ca02f36 Decode input escape sequences to special keys #78
Add the necessary input buffer, non-blocking reads, escape trie,
and unit tests to support extended keys, including arrow keys.
Update notcurses-input to print Unicode Control Glyphs instead of
a blank space for control chars.
2019-12-04 23:46:24 -05:00
nick black
cbbc18c3a3 build and destroy input sequence trie #78 2019-12-04 23:46:24 -05:00
nick black
37b0e416c0 get everything prepped for reliable keyboard escapes #78 2019-12-04 23:46:24 -05:00
nick black
04e067c202 Add all handled signals to ppoll() set
This addresses an issue where callers of notcurses_getc_blocking()
wouldn't exit on SIGINT etc. until another keystroke was received.
The exit is now immediate, and the proper exit code is propagated.
2019-12-04 23:46:24 -05:00
nick black
6f2c45a0ef extract input layer into its own file 2019-12-04 23:46:24 -05:00
nick black
29f55049f4 input buffer 2019-12-04 23:46:24 -05:00
Nick Black
c0a1ee0f31
Spruce up slider demo, fix up uniblock demo #66 #72 (#112)
Slider demo: paint chunks in a pattern, then shuffle them up #72
Right-to-left unit tests #66
Fix up damage to uniblock demo using cup explicit cursor move #66
2019-12-04 10:00:23 -05:00
nick black
f6b422f668
widecolor demo: bottom handle with stats 2019-12-04 05:35:21 -05:00
nick black
c5db91e247
widecolor-demo: fix up summary box 2019-12-04 05:10:48 -05:00
nick black
01a03424f9 box gradients #42 2019-12-04 04:50:26 -05:00
nick black
ae711b7e75 h/vline gradient unit tests #42 2019-12-04 04:50:26 -05:00
nick black
bdc841e46e ncplane_box: support box mask ctlword #42 2019-12-04 04:50:26 -05:00
nick black
a55e02836b ncplane_box: accept ctlword (#42) 2019-12-04 04:50:26 -05:00
nick black
eb53f420b1 handle resizes gracefully when rendering/fading #105 2019-12-04 00:13:42 -05:00
nick black
c5ecc28ca1 remove resize check from demo core #105 2019-12-04 00:13:42 -05:00
Nick Black
6f9b1e0379
Locking #82 (#106)
* remove unused simple_gcluster_p()
* detail statistics
* add byte statistics on rendering
* lock around notcurses_render() #82
* lock nc in notcurses_putc() #82
* lock ncplane_styles() and friends #82
2019-12-03 23:34:08 -05:00
nick black
82c5b96f92
remove obsolete assert from panelreels #91 2019-12-03 21:56:50 -05:00
nick black
d8e3cc9675
lol, whoops, don't render twice each call :D 2019-12-03 21:39:45 -05:00
nick black
08d4765dc4
enforce utf-8 encoding via nl_langinfo check #89 2019-12-03 20:26:54 -05:00
nick black
f0e81ea814
widecolors: make everything a bit more visible on small screens 2019-12-03 19:16:05 -05:00
Nick Black
8e8cb92c54
Improved cell API #97 (#103)
* cell/ncplane: simplify box API (#97)
* widecolor: use new box api (#97)
* uniblock: use new box API #97
* intro: use new box api #97
* panelreel: use new box api
* boxdemo: use new box API #97
* sliding: use new box API #97
* maxcolor: use new box api #97
* factor out notcurses_channel_prep() #97
* maxcolor: use new channel API #97
* sliding: use new channel API #97
* intro: use new channel API #97
* new output functions with no need for a cell
* add ncplane_putegc() and ncplane_putsimple(). the former takes an EGC, the latter a simple char less than 0x80. (#97)
* cell_prime: directly load all parts of a cell with immediates
* widecolor: use new output API #97
* boxdemo: properly initialize cells
* slider: total time cap of 5 * delaydemo
* maxcolor: use new output API #97
2019-12-03 18:40:41 -05:00
nick black
e21594b4e9
ncplane_*_box_cells() -> cells_*_box() #97 2019-12-03 14:29:48 -05:00
nick black
ccbdfcd499
summarize emission/elision rates on exit 2019-12-03 14:19:46 -05:00
nick black
5554b3fccb
persist elision/emission stats, expose them in API 2019-12-03 14:08:26 -05:00
nick black
d09029f7f4
use -std=c11 not -std=gnu11 2019-12-03 13:31:04 -05:00
nick black
f83987711c
silence -Wmaybe-uninitialized through ...whitespace? :/ 2019-12-03 12:26:45 -05:00
nick black
35badf8ae7
panelreel: fix some NULL dereferences
ncurses getbegy() and friends, as it turns out, check for
a NULL input and return -1. we've been blindly passing
NULL in a few places on the ncurses side--with its own
problems--but that rapidly led to crashes here.
2019-12-03 03:21:51 -05:00
nick black
c70bc7b2a4
slider-demo: work atop a background 2019-12-02 07:20:47 -05:00
nick black
415e238b3d transparent planes #10 2019-12-02 05:49:13 -05:00
nick black
2aadd096c0 lookin' good atl 2019-12-02 05:49:13 -05:00
nick black
738c590bfd
fix up outro 2019-12-02 05:48:46 -05:00
nick black
be5ce9051d
outro 2019-12-02 05:42:10 -05:00
nick black
957af8151e view-demo: add video element 2019-12-02 03:44:11 -05:00
nick black
94e52d4acc respect default mode in fadein #40 2019-12-02 03:44:11 -05:00
nick black
0e4080456c fade unit tests #40 2019-12-02 03:44:11 -05:00
nick black
966239747c add ncplane_fadein() #40 2019-12-02 03:44:11 -05:00
nick black
4426ef0574 first go at ncplane_fadeout() #40 2019-12-02 03:44:11 -05:00
nick black
055f49b5fd sliding-demo: animate moves #72 2019-12-02 03:44:11 -05:00
nick black
570b42b78b sliders-demo: factor out move_square() #72 2019-12-02 03:44:11 -05:00
Nick Black
9f4fa94209
Use halfblocks to double vertical resolution of media (#98)
halfblocks vertical, w00t #88
2019-12-02 01:55:25 -05:00
nick black
383895e404
notcurses-view: much more accurate timing 2019-12-02 00:25:08 -05:00
nick black
b882fe4e40
poll() on write() EAGAIN 2019-12-01 23:56:24 -05:00
nick black
1dc254396b
comment back out debugging cruft 2019-12-01 23:40:18 -05:00
nick black
296663717c
uniblock: erase screen each time 2019-12-01 23:37:58 -05:00
nick black
b59d9c633f video works all the way now :D #94 2019-12-01 22:58:35 -05:00
nick black
56e637d006 motherfucking video #94 2019-12-01 22:58:35 -05:00
nick black
19e1b3ac94
widecolor-demo: fix up right bar of handle 2019-12-01 21:14:41 -05:00
nick black
78e1a06661
view-demo: do both a jpeg and png test 2019-12-01 21:03:03 -05:00
Nick Black
8b0634527d
Correctly copy in shrink + SIGWINCH (#80) (#93)
* notcurses_resize(): properly set new lenx/leny #80
* ppoll() for SIGWINCH #80
* widecolor-demo: keystroke-driven
2019-12-01 20:26:25 -05:00
Nick Black
0b967ae528
More panelreels work #52 (#92)
* setup_signals: handle SIGSEGV with restore

* wresize(): fix keep parameter to ncplane_resize() #52

* ncplane_resize: set new lenx/leny on keep #80

* hrmrmm

* ncplane_resize(): fix numerous confusions

* panelreel-demo: don't allow us to go off the left edge

* panelreel: place tablets correctly #52

* panelreel: set background on focused element
2019-12-01 19:31:00 -05:00
Nick Black
426f632300
Panelreels port #52 (#90)
Port of panelreels, unit tests, and panelreel-demo from outcurses #52.
Doesn't completely work yet, but is surprisingly close!
2019-12-01 17:48:38 -05:00
nick black
a9f54ed483 add viewdemo #86 2019-12-01 15:29:59 -05:00
nick black
860fb43e3f ncvisual_render(): respect alpha channel 2019-12-01 15:29:59 -05:00
nick black
3ede80f47f libav: keep the alpha channel, AV_PIX_FMT_RGBA 2019-12-01 15:29:59 -05:00
nick black
7600b9ed54 libav: come correct #86 2019-12-01 15:29:59 -05:00
nick black
634c54776f libav: set up oframe beyond scale #86 2019-12-01 15:29:59 -05:00
nick black
3906357e4e that's an image! #86 2019-12-01 15:29:59 -05:00
nick black
28fac736bb notcurses-view: stop() before printing error
implement ncvisual_render()
2019-12-01 15:29:59 -05:00
nick black
d106ebf0d3 libav: check for AVERROR_EOF #86 2019-12-01 15:29:59 -05:00
nick black
531340a145 libav: return averr to caller #86 2019-12-01 15:29:59 -05:00
nick black
fd79c86880 av: get height/width #86 2019-12-01 15:29:59 -05:00
nick black
40ed1f1896 print_frame_summary(), let's figure out what the fuck we're doing #86 2019-12-01 15:29:59 -05:00
nick black
684d9f66fe egcpool: fix corruption #59 2019-12-01 02:22:13 -05:00
nick black
3b5aee09a9 widechar-demo: spacing 2019-12-01 02:22:13 -05:00
nick black
8e96c2d78e ncplane backgrounds: render and use i nsliding-demo #69 2019-12-01 02:22:13 -05:00
nick black
c2f377d599 ncplane_background()/ncplane_set_background() #69 2019-12-01 02:22:13 -05:00
Nick Black
a7d50b557d
ncplane_at_cursor (#76), CCCflag, nonblocking stdin (#78) (#84)
* put stdin into nonblocking mode, retry on short write to stdout #78
* wrap getc_blocking() around a poll #78
* get CCCflag from terminfo. stop clearing the screen in render/startup
* implement ncplane_at_cursor() #76
* ncplane_at_cursor() unit test for simples #76
* PlaneAtCursorComplex unit test #76
* PlaneAtCursorInsane() unit test #76
* nplane_at_cursor: return number of bytes, not just 0/-1
* uniblock-demo: add a bunch of pages from Unicode 12
* demo: make -d delay multiplier a float
* egcpool: check offset against poolsize in check_validity()
* notcurses_init(): set smkx/rmkx to NULL with pass_through_esc
* PlaneAtCursorAttrs unit test #76
* add ncplane_styles() accessor
2019-11-30 22:53:24 -05:00
nick black
020f712e40
ncplane_create: NULL out userptr on creation 2019-11-30 10:37:45 -05:00
nick black
9fe6c152a9 enhance SetStyles unit test 2019-11-29 05:55:41 -05:00
nick black
5e35e05151 render: don't send unnecessary color change sequences #47 2019-11-29 05:55:41 -05:00
nick black
4cc0ce037d read terminfo entries for keypad #78 2019-11-29 05:55:41 -05:00
nick black
6a5c21cacd demo: accept -f, open argument for renderfp 2019-11-29 05:55:41 -05:00
nick black
b3c6f9232a add renderfp option to render to a file 2019-11-29 05:55:41 -05:00
nick black
8c6d0495ee
input: decode special keys, call notcurses_resize() #79 2019-11-29 03:56:53 -05:00
nick black
e391bfbb81
input: add pass_through_esc option, otherwise run smkx #78 2019-11-29 03:26:37 -05:00
nick black
cb60c11f09
input: factor out handle_getc(), export cell_simple_p() #8 2019-11-29 01:53:36 -05:00
nick black
51a86ece7b
input: print keypresses #8 2019-11-29 01:22:38 -05:00
nick black
c76735cb2a
notcurses_getc(): read from stdin 2019-11-29 01:17:35 -05:00
nick black
a037cdfe5a
add new notcurses-input binary #8 2019-11-29 00:20:30 -05:00
nick black
ad7a517ec8
notcurses_render(): propagate result of write(2) 2019-11-28 22:15:28 -05:00
Nick Black
7f9ac490b0
ncplane_resize(), slider demo (#64) (#74)
* sliding: bounding box around puzzle
* slider: make moves, deleting planes #61
* implement z-index move functions
* demo: allow demos to be chosen via command-line option
* allow default bg/fg to be explicitly chosen
* ncplane_resize() unit test #64
* useful links
* slider: use random colors
* use find_above() in ncplace_destroy()
* ncplane_resize() work #64
2019-11-28 22:08:26 -05:00
nick black
374403fdeb
sliding: color up pieces 2019-11-28 16:36:22 -05:00
nick black
fe14403f9e
ncplane_double_box_cells(), used in sliding-demo #67 2019-11-28 16:27:15 -05:00
nick black
ad183a6322
shuffle: color and label pieces #67 2019-11-28 16:19:08 -05:00
nick black
e81377cf05 render: slow but simple z-depth algorithm #1 2019-11-28 15:58:53 -05:00
nick black
a1c7bef894 sliding: draw into ncplanes #67 2019-11-28 15:58:53 -05:00
nick black
222c532c77 demo: introduce -d delay param, use everywhere 2019-11-28 15:58:53 -05:00
nick black
c7cf4b1c9b sliding puzzle demo for planes #26 2019-11-28 15:58:53 -05:00
nick black
0b25c49f9c render: set styles #11 2019-11-28 15:58:53 -05:00
nick black
f65d168d83 notcurses_render(): call term_setstyles() for sgr stuff #11 2019-11-28 15:58:53 -05:00
nick black
bc662e92bb notcurses_render(): add term_setstyle() #11 2019-11-28 15:58:53 -05:00
nick black
2dde60c27a
ncplane_destroy(): pull it out of the zbuffer #26 2019-11-28 12:12:15 -05:00
nick black
38ef2148bb widecolor: throw a box around summary 2019-11-28 11:43:49 -05:00
nick black
d5cc65715e ncplane userptr routines + unit tests #26 2019-11-28 11:43:49 -05:00
nick black
bd5596cc15 kill obsolete FIXME 2019-11-28 11:43:49 -05:00
nick black
71a127463a
ncplane_create() 2019-11-27 21:29:28 -05:00
nick black
9a41257669 libavutil/libswscale versions in intro 2019-11-27 18:32:46 -05:00
nick black
b1029fc191 av: pass down through libswscale #61 2019-11-27 18:32:46 -05:00
nick black
8dfd050ab7 add ncplane_destroy() #26 2019-11-27 18:32:46 -05:00
nick black
5dfb07183c libav: throw an swscaler in the mix #61 2019-11-27 18:32:46 -05:00
nick black
f948904f7b libavutil linkage #61 2019-11-27 18:32:46 -05:00
nick black
45697d54f9 libav: pass AVFrame back through #61 2019-11-27 18:32:46 -05:00
nick black
9ed5a8b6c7 decode AVPacket into AVFrame #61 2019-11-27 18:32:46 -05:00
nick black
cf557ff500 ncurses-view #61 2019-11-27 18:32:46 -05:00
nick black
4b2bf26ee2 ncvisual_destroy() implemented 2019-11-27 18:32:46 -05:00
nick black
dc6ce9ba90 shrink leading box 2019-11-27 18:32:46 -05:00
nick black
7bc58fe603 consistency check assert in egcpool #59 2019-11-27 18:32:46 -05:00
nick black
2080e0bff3 unit tests for exercised egcpool #59 2019-11-27 18:32:46 -05:00
Nick Black
ba648dbd74
What a miserable evening tracking #57 (#60)
* widecolor-demo: don't emit spaces
* notcurses_init: newline before splash
* boxdemo: ncplane_erase() on entry #58
* uniblock-demo: print even wide chars #49
2019-11-27 10:43:03 -05:00
nick black
ed6ec5e854
unicodeblocks: disable RtL blocks for now 2019-11-27 04:42:51 -05:00
nick black
164d2e1cc0
notcurses_render(): count multicols against running total #57 2019-11-27 02:36:20 -05:00
nick black
ee2e16736c
signal handlers for INT, QUIT, WINCH #27 2019-11-27 02:08:35 -05:00
nick black
f14ee490f2
CMake: visibility=hidden by default #56 2019-11-27 01:02:05 -05:00
nick black
360a3f8600
print versions in startup 2019-11-26 22:50:30 -05:00
nick black
c4fb15524d
ncurses_render(): fflush stdout following writes #46 2019-11-26 22:27:37 -05:00
nick black
a0bb876549 render: if either fg or bg are default, send 'op' first #48 2019-11-26 21:50:50 -05:00
nick black
3bd67740cc ncplane_putstr(): copy attrword and channels directly #48 2019-11-26 21:50:50 -05:00
nick black
f514fe234c switch demos to ncplane_rounded_box_cells() 2019-11-26 21:50:50 -05:00
nick black
ccb3c137b3 add ncplane_box_sized() and ncplane_rounded_box_cells() 2019-11-26 21:50:50 -05:00
nick black
98d6f12002 visual_open: round out libav loading #35 2019-11-26 20:23:40 -05:00
nick black
3dee9bba7c need avframe 2019-11-26 20:23:40 -05:00
nick black
66432c37e1 libav: extract frame from AVFormatContext 2019-11-26 20:23:40 -05:00
nick black
f20e8fde4b add notcurses_image_open() #23 2019-11-26 20:23:40 -05:00
nick black
f1e7b4a8e5 demo: properly center wave on front page #50 2019-11-26 07:52:41 -05:00
nick black
02a3b25ae0 get 'smso' capability for STANDOUT 2019-11-26 07:52:41 -05:00
nick black
01550af92b
pass number of columns to advance_cursor() #6 2019-11-26 07:16:15 -05:00
nick black
7aaa0fcce1
track wide char as reported by wcwidth(), add unit test #6 2019-11-26 07:14:44 -05:00
nick black
b91d867b29 sleep longer post-block now that we're so fast :) #41 2019-11-26 06:34:03 -05:00
nick black
750518c091 uniblock: only render at end of a block #41 2019-11-26 06:34:03 -05:00
nick black
762689b276 support default colors #31 2019-11-26 06:34:03 -05:00
nick black
37933c6978 uniblock demo: no newline in output #34 2019-11-26 05:32:40 -05:00
nick black
784cbea637 kill obsolete FIXME 2019-11-26 05:32:40 -05:00
nick black
d7ab44363c uniblocks: a few more blocks, and a hint of green 2019-11-26 05:32:40 -05:00
nick black
73c9fb7767 unicodeblocks-demo: list blocks we want, with descriptions 2019-11-26 05:32:40 -05:00
nick black
c685524229 move wave above text in intro 2019-11-26 05:32:40 -05:00
nick black
f91c80b008
unicodeblocks demo: only print chars where wcwidth() == 1 #34 2019-11-26 01:44:13 -05:00
nick black
6b877f89a9
retain stdscr across a resize #28 2019-11-26 00:04:31 -05:00
nick black
fb07becc16
griddemo: use double-thick box draws for middle grid 2019-11-25 23:20:13 -05:00
nick black
8f840d8f91
demo: turn on box in intro 2019-11-25 21:34:47 -05:00
nick black
816cde0591
ncplane_box: explicitly move for last row 2019-11-25 21:34:26 -05:00
nick black
f67a97edfb
correctly handle ASCII + combining chars, add unit tests #36 2019-11-25 21:11:27 -05:00
nick black
64e998849a
sync widecolor demo stuff to outcurses 2019-11-25 20:28:36 -05:00
nick black
24b3fe7da0 ncplane_box: check dimensions before drawing #37 2019-11-25 19:52:11 -05:00
nick black
190b38dc97 purge widecolor of RtL and LtR direction changes #25 2019-11-25 19:38:35 -05:00
nick black
5220836798 completely reset egcpool in egcpool_dump() 2019-11-25 19:38:35 -05:00
nick black
32a55b2ee3 1 << 24u, not 1 << 23u, stupid 2019-11-25 19:38:35 -05:00
nick black
26c584050c maxcolor demo: get it working 2019-11-25 19:38:35 -05:00
nick black
2f43da2d16 boxdemo: concentric boxes 2019-11-25 19:38:35 -05:00
nick black
5f053ab220 run maxcolor demo 2019-11-25 19:38:35 -05:00
nick black
894f52ce6c enter maxcolor demo 2019-11-25 19:38:35 -05:00
nick black
4a402a9843
only 30 blocks, that's quite enough 2019-11-25 18:07:09 -05:00
nick black
9744ca0d4c egcpool: copy in nonspacing characters of an EGC #32 2019-11-25 13:40:43 -05:00
nick black
095d9035fb notcurses_options: provide retain_cursor bool #29 2019-11-25 13:40:43 -05:00
nick black
8fcb2923fa print our stats after restoring terminal 2019-11-25 13:40:43 -05:00
nick black
faa52a22b4 inhibit render printing in media res 2019-11-25 09:55:55 -05:00
nick black
7eb136ae78 render stats #12 2019-11-25 09:55:55 -05:00
nick black
e1034c5612 don't need timer just a clock 2019-11-25 09:55:55 -05:00
nick black
49e33bc6ff use civis capability to hide cursor #29 2019-11-25 09:55:55 -05:00
nick black
ba495faca9 add timespec utility functions 2019-11-25 09:55:55 -05:00
nick black
c89d8134fa launch unicodeblocks demo 2019-11-25 09:55:55 -05:00
nick black
8d7a63b853 print boxfilling chars in first demo 2019-11-25 09:55:55 -05:00
nick black
04d11a3521 reorder a bit of widecolor test 2019-11-25 09:55:55 -05:00
nick black
7fcb9d295c demo: get everything showing up 2019-11-25 09:55:55 -05:00
nick black
e6a009ee3a
erase in griddemo #22 2019-11-25 02:22:15 -05:00
nick black
a90638aa5c
widecolor_demo: get fg/bg working 2019-11-25 01:45:08 -05:00
nick black
979f6828ed
erase in grid demo 2019-11-24 22:00:35 -05:00
nick black
319e9cc25a
widecolor: don't require a plane 2019-11-24 21:59:47 -05:00
nick black
92b5d23185
widecolor: don't require a plane 2019-11-24 21:59:43 -05:00
nick black
3c3c3335fc
always set styling in cell_duplicate #16 2019-11-24 21:59:21 -05:00
nick black
b665592ce1
reenable all demos 2019-11-24 21:54:00 -05:00
nick black
5e61f536e8
gridinverse, gridswitch demos #16 2019-11-24 21:18:02 -05:00
nick black
7173f628ee
griddemo: inverse 2019-11-24 21:10:54 -05:00
nick black
3d5ba40352
grid demo 2019-11-24 21:01:25 -05:00
nick black
414b2694ba boxdemo: inject some color #9 2019-11-24 18:38:27 -05:00
nick black
ba08a6142e demo: call boxdemo 2019-11-24 18:38:27 -05:00
nick black
48555507e6 boxdemo 2019-11-24 18:38:27 -05:00
nick black
27e90d9204 cell: implement fg/bgdefault bits 2019-11-24 18:38:27 -05:00
nick black
d400c79870 implement ncplane_box() and unit test #9 2019-11-24 18:38:27 -05:00
nick black
2b467c99af implement ncplane_vline() + unit test #9 2019-11-24 18:38:27 -05:00
nick black
e050770fde implement ncplane_hline() + unit test 2019-11-24 18:38:27 -05:00
nick black
0c262a3a6d implement ncplane_erase() #9 2019-11-24 18:38:27 -05:00
nick black
8ff52f5ebc
laughable implementation of ncplane_vprintf #9 2019-11-24 16:19:24 -05:00
nick black
ca5c37fab9 widepanel: dump content 2019-11-24 16:11:35 -05:00
nick black
e5b426eb55 ncplane: don't putc/getc past plane 2019-11-24 16:11:35 -05:00
nick black
586142057f egcpool: don't split egc's across ringbuffer bounds 2019-11-24 16:11:35 -05:00
nick black
db842e5305 ncplane: leave cursor at lower right 2019-11-24 16:11:35 -05:00
nick black
1e65adb75a widecolor: adapt to new ncplane_putc() 2019-11-24 16:11:35 -05:00
nick black
ad321a9516 demo: adapt to new ncplane_putc() 2019-11-24 16:11:35 -05:00
nick black
2b8993a53d fix up cell_load() #17 2019-11-24 16:11:35 -05:00
nick black
32394dd892 egcpool: preserve incoming EGC on realloc 2019-11-24 16:11:35 -05:00
nick black
a997fb2dc0 reenable widecolor demo from outcurses 2019-11-24 16:11:35 -05:00
nick black
52e83dfcc2
Get UTF8 rendering properly #14 2019-11-24 14:00:48 -05:00
Nick Black
b93bcebf0b
Extended grapheme clusters (#15)
Introduce egcpool for attached storage
Hook up style support
Switch entirely to UTF-8 char from wchar_t (#14)
Pull out next EGC in cell_load (#14)
2019-11-24 12:36:46 -05:00
nick black
9c9f1f4462
demo: getopt(), allow inhibition of alternate screen with -k 2019-11-23 20:52:14 -05:00
nick black
13931aee60
implement ncplane_getc() #9 2019-11-23 20:45:53 -05:00
nick black
f9b88c5079
implement notcurses_palette_size() 2019-11-23 20:39:22 -05:00
nick black
a509cb6320
someone set us up the bomb 2019-11-23 19:24:29 -05:00
nick black
e4f041f522
start moving to utf-8 from wchar_t #14 2019-11-23 18:34:06 -05:00
nick black
8856f67822
ncplane: background directcolor works 2019-11-23 12:39:54 -05:00
nick black
fd04c55d16
implement ncplane_putwstr #9 2019-11-23 12:28:42 -05:00
nick black
2f9821ce39
notcurses: interrogate terminfo for styles 2019-11-23 10:42:46 -05:00
Nick Black
7e92c8bb82
documentation and declarations (#13)
ncplane: flesh out API
ncplane: line and erase APIs
README.md: document differences from ncurses
notcurses_init(): print long term name
CMake: link librt into notcurses
cell: move functionality out to header
2019-11-23 09:05:32 -05:00
nick black
a8721df75a
ncplane: flesh out API 2019-11-22 22:47:12 -05:00
nick black
f42c3bf0f1
ncurses_render: don't resend unchanged colors 2019-11-21 10:56:17 -05:00
nick black
05f99e16ef
term_fg_rgb8: properly form directrgb escape 2019-11-21 10:56:12 -05:00
nick black
f07652f24b don't try to destroy nullptr ncplane in tests 2019-11-21 08:51:57 -05:00
nick black
9a5d893ce7 demo: setlocale(), blit some characters like a boss 2019-11-21 08:51:57 -05:00
nick black
b94e428277 ncplane: add ncplane_putwc() 2019-11-21 08:51:57 -05:00
nick black
d6aef3d2e6 notcurses_render: blit wchar_t arrays #5 2019-11-21 08:51:57 -05:00
nick black
c8d11459ec notcurses_render: set colors naively #5 2019-11-21 08:51:57 -05:00
nick black
691d3d97b8 some ncplane unit tests 2019-11-21 08:51:57 -05:00
nick black
a916c66052 introduce z-buffer of ncplanes 2019-11-21 08:51:57 -05:00
nick black
d3f9329737 notcurses_options: allow outfd to be specified 2019-11-21 08:51:57 -05:00
nick black
54ed3e108e introduce notcurses_options struct #3 2019-11-21 08:51:57 -05:00
nick black
787c27a812
demo: always reset the terminal on error 2019-11-19 06:44:28 -05:00
nick black
0f6e19dd92
notcurses_setrgb(): plug into direct mode when RGB flag is set 2019-11-19 06:26:44 -05:00
nick black
8fe936ca4c
ftairs! we have discovered ftairs! 2019-11-19 05:33:38 -05:00
nick black
908e9e120c
Don't require smcup/rmcup, and emit them only if supported #3 2019-11-18 12:16:26 -05:00
nick black
f88a26f55f
introduce notcurses_render() 2019-11-18 00:05:32 -05:00
nick black
4c01423289
allocate up the plane of cchars 2019-11-17 22:23:29 -05:00
nick black
17bc714c4d
define cell struct 2019-11-17 22:02:43 -05:00
nick black
ce42950314
check for RGB terminfo flag, check against colors 2019-11-17 16:12:00 -05:00
nick black
f88e211c26
disable ECHO and ICANON 2019-11-17 13:40:06 -05:00
nick black
abebd8d18e
preserve and restore termattr via termios 2019-11-17 13:36:57 -05:00
nick black
24da35a93b
load smcap/rmcap and emit them 2019-11-17 13:29:18 -05:00
nick black
b6ee41b355
link in tinfo, call setupterm() 2019-11-17 12:55:12 -05:00
nick black
4a406a8d8a
notcurses_init: stash away ttyfd 2019-11-17 10:36:58 -05:00
nick black
c1f4219dc1
notcurses_term_dimensions() + unit test 2019-11-17 10:25:40 -05:00
nick black
1fcae27627
just the basics 2019-11-17 09:53:59 -05:00
nick black
70df86ba17
version string, notcurses_version() 2019-11-17 05:04:41 -05:00