Commit Graph

1661 Commits (8cfd1677c47d8e2eda0b0d1b0fc21cad419e42d9)

Author SHA1 Message Date
nick black 2370329077
loop on fflush()->EAGAIN
sometimes when we call fflush(ttyfp), we get EAGAIN. we can
loop on this and force the flush. without it, we (fairly rarely)
get errors on shutdown, sometimes manifesting as unit test
failures (especially in the rust wrappers). #742
4 years ago
nick black 6b5fd0d009
ncdirect_render_image(): handle newlines properly
in ncdirect_render_image(), we want to emit newlines if and
only if we did not hit the right border. we want to emit
cuds (cursor downs) if and only if we've hit the bottom
border. this resolves all mysteries of blank lines, eliminating
a FIXME. it also fixes ncneofetch's image display on very
wide terminals. closes #756. also removes the display semaphore
in ncneofetch, using a more natural pthread_join().
4 years ago
nick black 31c584e2e6 ncneofetch: work no matter y offset, done! #750 4 years ago
nick black 8fedec050c ncneofetch: draw infoplane with notcurses + margin_t #750 4 years ago
nick black 93ff1d7789 ncdirect: open an fd for the controlling terminal
Use ctermid(3) to identify the controlling terminal device.
When one exists, open(2) it up, and retain this file descriptor
across the life of the ncdirect context. Allow a failure, since
not everything requires such an fd. This will be used for tty-
specific activity such as ioctl()s and escape sequences
involving terminal replies (such as get absolute cursor
position). #752
4 years ago
nick black cda4253a0a ncneofetch: sem_post() on error path 4 years ago
nick black a8db078689 ncneofetch: default background on palette 4 years ago
nick black 9ae1c6b3df ncdirect_render_image: fix arguments to rgba_blitter_low #751 4 years ago
nick black 4e04c3ae8f ncneofetch: fill out first line of infoplane 4 years ago
nick black 45fbbdb4ef ncneofetch: align output #750 4 years ago
nick black 33cb21d917 ncdirect_printf_aligned() added #750 4 years ago
nick black 4889e9b391 ncneofetch: scale 4 years ago
nick black 60619fc4b9 ncneofetch: move back to NCSCALE_SCALE #750 4 years ago
nick black 7eb70dad71 ncneofetch: display() in direct mode #750 4 years ago
nick black 7a022a4c76 ncneofetch: show palette via direct mode #750 4 years ago
nick black 452fdc671d
intro: move legend into main plane 4 years ago
nick black 4863c7e3df
ncdirect_image_render: restore NCBLIT_2x2 #751 4 years ago
nick black 0586adbe24
ffmpeg: disable debugging cruft erp 4 years ago
nick black 8a2f86ea16 vizdirect: use DFSG-safe media only #725 4 years ago
nick black fd064b0f2a ncvisual_render_image(): working! #725 4 years ago
nick black 40d0efcece ncdirect_render_image(): just about working #725 4 years ago
nick black 277cbc9c16 ncdirect_render_image(): getting closer #725 4 years ago
nick black 3bb789eb74 refactoring to prep for ncdirect_visual 4 years ago
nick black 229079696d ncvisual refactoring to support ncdirect 4 years ago
nick black 052e10ebe1
subproc: fix up USING_PIDFD definition 4 years ago
nick black b9dc9a7f1c
subprocs: simplify __linux__ check 4 years ago
nick black dda6d2f596
subproc: check for __NR_clone3 4 years ago
nick black 8310b687ac
demo: enable FPS plot by default #744 4 years ago
nick black ae1b45efbf
plot: make legend glyph-transparent #744 4 years ago
nick black 9a5a4a65ca demo: enable HUD by default #743 4 years ago
nick black 8da3e6f968 HUD: fully glyph-transparent, looks great #743 4 years ago
nick black ba1c9868e5 HUD: glyph-transparent inter-column gap #743 4 years ago
nick black 64857e12ac HUD: glyph transparency on frame count #743 4 years ago
nick black 96575fb402 hud: glyph-transparent right side 4 years ago
nick black 1cbf98cb6c
notcurses_init: allow US-ASCII, used by FreeBSD 4 years ago
nick black 3d6585e445
Trigger clone3()+waitid() path off definition of P_PIDFD #733 4 years ago
Nick Black d5dca33e00 ncneofetch: don't print (null) for distro_pretty 4 years ago
Nick Black d52ced823c make Wide unit tests sensitive to local irregularities #741 4 years ago
nick black 5815a65fb5
ncsubproc: properly catch exit on non-pidfd path
When we don't have a pidfd available on which to poll(2) (this
is true of Linux pre-5.3, and FreeBSD), we can't rely on a
child death breaking our poll loop. Instead, in this case launch
a second thread, which just sits on a blocking waitpid(2). If
it gets an exit, it calls the completion callback, triggering
the teardown. Closes #728, and ought lets us run the test suite
on FreeBSD.
4 years ago
nick black 6303e803f6
outro: don't obfuscate globe with acai plane 4 years ago
nick black 9fe48f8539 procroller/fileroller: enable scrolling on standard plane 4 years ago
nick black 6f6826238e
mojibake: improve topside a tad 4 years ago
nick black 5513707d8d
allglyph: don't print UTF-16 surrogate characters #740 4 years ago
nick black 354152b48b
Redefine CELL_ALPHA_ in their natural forms
CELL_ALPHA_OPAQUE et al were defined as 0..3, meaning
CELL_ALPHA_SHIFT had to be used to compare them to their
channel representations. Instead, define them in said
representation outright, eliminating the need to shift while
retaining arithmetic properties, and zero initialization for
CELL_ALPHA_OPAQUE. Eliminate CELL_ALPHA_SHIFT #738.
4 years ago
nick black 3985085d04
terminfo: capability is "rev" not "reverse"
While I'm at it, comment up all these properties,
and eliminate double lookup of smkx.
4 years ago
nick black cdd96af8df
trans: put the legend on top to avoid FPS plot 4 years ago
nick black 78c2cef7e9
Use NCBLIT_2x2 by default with NCSCALE_STRETCH
We're not using NCBLIT_2x2 by default because it warps the
aspect ratio. If we're using NCSCALE_STRETCH, though, we've
(1) already indicated that aspect ratio isn't terribly
important to us and (2) are trying to maximize the space.
Since NCBLIT_2x2 is best for large images anyway, make it
the default when NCSCALE_STRECTH is being used.

Remove all explicit uses of NCBLIT_2x2 when NCSCALE_STRETCH
is being used in notcurses-demo.
4 years ago
nick black 03618c70b3
more sys/poll.h -> poll.h for musl #733 4 years ago
nick black d9535f9962
musl: sys/poll, sys/fcntl -> poll, fcntl #733 4 years ago
nick black 0a0f9faa7f
add .xcf for normal.png 4 years ago
nick black feaa20c586
normal: use fractalheight.png at end 4 years ago
nick black ef10b8ced2
mojibake: order planes by unicode spec 4 years ago
nick black 87a488da9f
mojibake: add unicode 5.2 / emoji 1.0 glyphs 4 years ago
nick black 1d71aa4830
ncneofetch: display palette just above image 4 years ago
nick black 0c6f160493
eagle: always zoom to target area #732 4 years ago
nick black f99f64d3d7 mojibake: add unicode1/emoji1 4 years ago
nick black 1d7b6a7732 mojibake: add unicode 7 / emoji 2 4 years ago
nick black f0d2847939 mojibake: finish unicode13 block 4 years ago
nick black bca52922dd mojibake: first row of unicode 13 table 4 years ago
nick black 32180235bd mojibake: better title coloring 4 years ago
nick black 70aefd451c mojibake: accommodate kitty 4 years ago
nick black 8654a4554a mojibake: reorganize so everything fits 4 years ago
nick black 46570d46b9 mojibake: color glyphs 4 years ago
nick black 770c0c0fc5 mojibake demo: scroll planes up 4 years ago
nick black e4885327e0 mojibake: clean up planes 4 years ago
nick black 54bfa96b00 mojiake: unicode 6.0 emoji 4 years ago
nick black 44eab55212 mojibake title 4 years ago
nick black 1dfcb826a6 skeleton of mojibake demo #689 4 years ago
nick black c7c0909c17
ncneofetch: don't read from NULL cpuinfo FILE 4 years ago
nick black a48ccfacf3
ncneofetch: include LANG/UID 4 years ago
nick black 97a996927f
ncdirect_render_image: return NCERR_UNIMPLEMENTED #725 4 years ago
nick black 4a3d436e5b
drone: update builders 4 years ago
nick black 641f0cb894
brailleblitter: full EGC selection, blending #649 4 years ago
nick black 79d3ae67e4
add notcurses_cantruecolor() 4 years ago
nick black 5a466ade18
ncneofetch: get cpu info #550 4 years ago
nick black 89b2106075
ncneofetch: don't call out to lsb_release, cuts 95% of running time lol #550 4 years ago
nick black 189841d992
ncneofetch: thread the logo load+draw #550 4 years ago
nick black 9f69e4d998
ncneofetch: show x resolution when possible #550 4 years ago
nick black e45c2c9ac3
demo: speed things up a bit, our ass is dragging 4 years ago
nick black 292f0d9294
ncneofetch: get desktop manager + shell #550 4 years ago
nick black 37ba3a0bd4
ncneofetch: metricize ram #550 4 years ago
nick black 1fa9d9be2c
yield demo: adapt to new ncvisual_geom #727 4 years ago
nick black 699407a14a
eagle demo: don't STRETCH for geom() call 4 years ago
nick black 29fe68f93a
ncvisual_geom(): handle NULL vopts case #727 4 years ago
nick black 10d74d5051
ncvisual_geom(): handle NULL ncvisual case #727 4 years ago
Nick Black 16c086b41a CMake: don't define killer options on FreeBSD 4 years ago
nick black 355021de56
ncneofetch: print ram/processes #550 4 years ago
nick black b8c5f51040 ncneofetch: fedora support #550 4 years ago
nick black 611b96ba46
ncneofetch: draw palette #550 4 years ago
nick black ecfd1bd422
ncneofetch: print kernel/distro version #550 4 years ago
nick black 4db4a85704
ncneofetch: stylize infoplane #550 4 years ago
nick black a29d10855e
ncneofetch: vertically center logo 4 years ago
nick black d084513172
ncvisual_geom: account for scaling #726 4 years ago
nick black 85cef91ad9
ncneofetch: user/hostname on unix, put 'em in title #550 4 years ago
nick black 356f5e66fa
ncneofetch: place info plane at bottom center 4 years ago
nick black 7ca5a7e82c
ncneofetch: create info plane #550 4 years ago
nick black 39ec0b4749 ncneofetch: uname(2) to get kernel name for dispatch #550 4 years ago
nick black 3df44a05f7 Add link to 'glyph hell' 4 years ago
nick black 6538fb9c08 ncneofetch: parse lsb_release -i #550 4 years ago
nick black ffab8b5294 lay groundwork for ncneofetch #550 4 years ago
nick black c286a8ae9b
ncvisual_stream(): fix oiio for eager decode #721 4 years ago
nick black 6ff0bec2fa
ncplane_puttext: more unit tests, check for spcae before width #691 4 years ago
nick black d7b04217f9
dragon/view demos: don't disturb menu bar 4 years ago
nick black cfe764bd57
ncplane_puttext() unit test + fix #691 4 years ago
nick black 97517d0473
ncplane_puttext: another test, another bug #691 4 years ago
nick black d1f8b9237d
ncplane_puttext: new unit test, fix breakage #691 4 years ago
nick black 2c8e4b78db
ncplane_box/ncplane_destroy: use logerror() #520 4 years ago
nick black 9cf018c628
diagnostics for ncplane_resize()/ncplane_cursor_move_yx() #520 4 years ago
nick black 2be041b1f4
Beef up ncplane_puttext() tests, fix a problem #691 4 years ago
nick black 1f9855b243
ncplane_content: add diagnostics #520 4 years ago
nick black 3f114f4305
ncplane_puttext(): allow NULL for sbytes 4 years ago
nick black 59bf168e55
quadblitter: emit ▌, not ▋, you fool #667 4 years ago
nick black 222c52e10c
view: use quadblitter 4 years ago
nick black 64b07fcd0b
outro: use quadblitter, reset vopts 4 years ago
nick black cadd0ae283 quadblitter: fix arguments to channel_rgb() #667 4 years ago
nick black 7c1e9fe3d2
ffmpeg: properly scale #714 4 years ago
Nick Black 0084dbaa6d
qrcode generalization #699 (#713)
Add convenience function ncplane_home(). Add an ncblitter_e param
to ncplane_qrcode(), and split int maxversion into value-result
int* ymax and int* xmax. Write the actual sizes of the resulting
visual into these parameters. Update the qrcode demo. Add the
qrcode PoC. Update demos to ncplane_home(), where possible.

ncplane_qrcode() now takes an ncblitter_e and two value-result int*s
in the place of a single value int. The final size of the displayed qrcode
is written to *ymax and *xmax. If the code can't fit within the specified
dimensions, an error is returned. Standard rules for pluggable blitters
apply regarding fallback etc. #699
4 years ago
nick black 22dc5014cc
notcurses_rasterize: update comment about damagemap 4 years ago
nick black ee73df3059
dragon: reset static done flag, erp 4 years ago
Nick Black 068b1c952a
Dragon demo #708 (#710)
* define dragon curve demo #708
* demo: distinguish abort from fail, color-wise
* dragon: ncvisual-based #708
4 years ago
nick black 909040eade
christ nick get your head in the game 4 years ago
nick black ed824fe0d2
eep! #709 4 years ago
nick black 5bbd183db4
rotate_channels: handle top half block #707 4 years ago
nick black 03c748476b
normal: speed up rotation out #599 4 years ago
nick black 4f8f16df8d
qrcode: really remove getrandom() for freebsd < 12 4 years ago
nick black 3e23ca524f normal: improve coloring 4 years ago
nick black b119cec29e
normal: finally move to pi/4 rotations #599 4 years ago
nick black dc49bb943b
demo: destory about screen before restarting #706 4 years ago
nick black e74e7860c5
demo: explicitly set menu/about colors #705 4 years ago
nick black a069745c49
notcurses-ncreel: remove unused field 'id' 4 years ago
nick black 3936d1b528
adapt callers of ncvisual_geom() 4 years ago
nick black 70183ee283
Rewrite plot tests using C interface #703
The Plot unit tests were reaching directly into the objects,
which meant the implementations couldn't include anything
we didn't want public. This was annoying, so I've changed it.
This required adding ncdplot_sample() and ncuplot_sample(),
which we should have had anyway.
4 years ago
nick black 185742fd08
Rendering now does tripartite fallback to basecell
Each plane has a "base cell", which like all other cells is
initialized to the null glyph, opaque default foreground color,
and opaque default background color. Prior to this change, at
each cell of a plane, we decided whether to use that cell (the
"viscell") or the base cell depending on whether the viscell had
a non-null glyph. We now evaluate each component independently.
If the viscell has a null glyph, we use the base cell's glyph.
If the viscell has a default foreground, we use the base's fg.
If the viscell has a default background, we use the base's bg.
This was done because (a) it seems more intuitive (if I set a cell
to red, I expect red, not red iff there's a glyph in that cell
for this plane), and (b) because otherwise it was impossible to
do a multicolor overlay without blowing away underlying glyphs
(since without a glyph, you always reduced to the same base cell,
which could have only one fore- and background per render).

Existing code will need to change any instances where cells
lacking glyphs are colored, and those colors are not desired.
Since any such coloring had no effect before, it seems unlikely
that any ought exist (this did bring to light an instance in
the "qrcode" demo where we were staining overmuch of the plane).

This closes #395, the last big open worry regarding our API.
4 years ago
nick black 4391c661be
don't pull logging into plot #703 4 years ago
nick black f98acad7f6
add NCPLOT_OPTIONS_DETECTMAXONLY #610 4 years ago
nick black 2b89b0850c
jungle/normal: improve behavior under ASCII mode #696 4 years ago
nick black a10ba4dac6
highgradient: degrade to gradient #700 #696 4 years ago
nick black 20322fe805
demo improvements for ASCII mode (#696)
* eagle: use new ncvisual_geom() to properly zoom
* qrcode: skip for now (#699)
* luigi: draw with spaces, not full blocks
4 years ago
nick black af46077775
ncvisual_geom: take degradation into account #697
In order to properly determine the scaling of an ncvisual to
be rendered, ncvisual_geom() needs know the blitting method.
For this reason, it took an ncblitter_e argument. It also,
however, needs handle degradation, which means knowing whether
NCVISUAL_OPTIONS_NODEGRADE is in use. It thus really wants the
struct ncvisual_options. Pass and accept it. Closes #697, and
fixes the "yield" demo in ASCII mode (#696).
4 years ago
nick black 827c2f2013
ncplot: don't print spaces #695 4 years ago
nick black 0e1617811f
eagle: require UTF8 for now #697 #696 4 years ago
nick black 09f3f9097d
input: extract most of main() into input_demo() 4 years ago
nick black 1cd3ffc89a
outro: transparent legend at borrom #687 4 years ago
nick black 1ffd871784
blocks poc: handle std coredump-free #645 4 years ago
nick black a3369d77a9
outro: plug memory leak post-fade 4 years ago
nick black c8caa23090
brailleblitter: honor transparency #649 4 years ago
Nick Black 28431914a8
First go at ncplane_puttext() (#690)
Very simple take at ncplane_puttext(), a new function for linebroken text. Also some very basic unit tests. I doubt this works very well yet, but it handles the simplest cases #682. Added nclog(), internal function for logging. #520
4 years ago
nick black 7736e4a7dc all: don't put legend so far away from plane 4 years ago
nick black 841c0a4b8f
quadblitter: respect transparency #686 4 years ago
nick black 10cbaedc77
visual: implement NC_SCALE on both paths #683 4 years ago
nick black f1da9406f9
view: plug small memory leak 4 years ago
nick black 7e6ec274bb
view: clear standard plane between renders #685 4 years ago
nick black 6e7996f1a8
notcurses_init: properly check flags for unknowns 4 years ago
nick black b2dcc50606
notcurses_options: fold bools into flags 4 years ago
nick black e2b43092c3
outro: fade in samoa while fading out changes #652 4 years ago
nick black 700d59dbad
yield demo: don't stain menu 4 years ago
nick black 71f6b7b02e
USAGE: pixel -> ncpixel 4 years ago
nick black 465f4694b8
rename pixel -> ncpixel 4 years ago
nick black 9f97b7b969
demo HUD: unify blur 4 years ago
nick black 77362a50f4
yield demo looks hot, hot, hot! 4 years ago
nick black 990f401427
ncvisual_set_yx() 4 years ago
nick black d863220e23
add pixels PoC 4 years ago
nick black fb13b148e9
add Pixel API 4 years ago
nick black 2c417ddb0c
yield demo: punch up with polyfills 4 years ago
nick black cb521e3de7
allglyph: always have room for the legend 4 years ago
nick black 633ef1f76c
add beginnings of yield demo 4 years ago
nick black 787e66a4c8
fallin': use NCBLIT_2x2 4 years ago
nick black 595a697146
notcurses-view: space now pauses #603 4 years ago
nick black 050b44628a
punch up luigi and purpdrank with NCBLIT_2x2 4 years ago
nick black b172d2b97e
NCVISUAL_OPTION_MAYDEGRADE -> NCVISUAL_OPTION_NODEGRADE, doc 'em 4 years ago
nick black deda0ff681
mention notcurses_reader.3 in notcurses.3 4 years ago
nick black cd2cc6f340
allglyph: add a counter showing the current glyph 4 years ago
nick black 84ae45ef39
remove all libsixel crap #200 4 years ago
nick black 9a0f0c66fe
ncblit: accept an ncvisual_options #680 4 years ago
nick black 358c9a5c73
normal: grab a square region to avoid flickering #678 4 years ago
nick black d73c12be6f
ncvisual_from_plane: argument inversion error #678 4 years ago
nick black 5a1b1146d3
jungle demo: eliminate plot bleedthrough 4 years ago
nick black b72a386aa3
ncplane_dup(): adjust for marginalia #679 4 years ago
nick black e268301a42
demo: reset standard plane base char for each demo #675 4 years ago
nick black deb3c8bfcb
outro: kill rendering turds #675 4 years ago
nick black e1d34c4f43
ncplane_highgradient: only pass a single channel #676 4 years ago
Nick Black de23139111
Open some whoopass on ncvisual rotation (#677)
Whip the ol' llama's ass (fix ncvisual rotation)

* notcurses: flush cursor change requests #673
* rotator: verify ncplane_rgba and ncblit_rgba
* ncblit: rename, accept ncblitter_e #674
* rotator: render from rgba
* rotator: get to rotation
* rotator: add a pi/4 turn at the end
* normal: reuse incoming plane for rendering #672
* rotator poc: rotate a fullplane gradient #672
* normal demo: place visual correctly
* rotator: verify ncplane_rgba and ncblit_rgba
* ncblit: rename, accept ncblitter_e #674
* rotator: render from rgba
* rotator: add a pi/4 turn at the end
* normal: reuse incoming plane for rendering #672
* rotator poc: rotate a fullplane gradient #672
* normal demo: place visual correctly
* rotator poc: throw some red into gradient
* rotator poc: done #662
* oiio: ncvisual_resize() needs set ibuf pointer #662
* normal: only need erase at top of loop
* visual poc: shorter delay
* normal demo: center rendered visual
* comment ncvisual_resize() call
* ncvisual_rotate: call ncvisual_details_seed()
* ffmpeg ncvisual: fix rotation #662
4 years ago
nick black dbe779365b ncplane_rgba(): correct order sampling colors #672 4 years ago
nick black 12fce6ddb7 notcurses: flush cursor change requests #673 4 years ago
nick black df8d4951e6
oiio: new streamer api 4 years ago
nick black 1b0a4cb41a normal demo: fill in all lines 4 years ago
nick black e92b46421a
quadblitter: pick closer inductance pixel #667 4 years ago
nick black 0b06fa5cd4
quadblitter: trilerp on induction #667 4 years ago
nick black a8beaf8e56
notcurses-view: switch between blitters with 0--8 #671 4 years ago
nick black c0f820db94
notcurses-view: select blitter with numbers #671 4 years ago
nick black 75f458d69a
ncplane_yx: results are relative to bound plane 4 years ago
nick black 6d5e027be9
notcurses-demo: compactify usage message #669 4 years ago
nick black bc6305b08e
notcurses_debug: handle bound planes 4 years ago
nick black d41c6d3627
notcurses-ncreel: add </>/* operators 4 years ago
nick black b65437a53f
O(1) plane bondage #670
Make ncplane_reparent() O(1).
Make ncplane_delete() O(1)
O(1) link severance for planes bound to deleted plane.
Allglyph demo requires UTF8.
4 years ago
nick black e99abeae01 ncplane_destroy: remove plane from bound list 4 years ago
nick black 1c05994a05
normal: plug memory leaks on exit paths #624 4 years ago
nick black e32e4d9744
egcpool_stash: exit on strdup() failure #624 4 years ago
nick black 96a47de845
merge cell unit tests 4 years ago
nick black 7d41d30043
allglyphs: colorize 4 years ago