Commit Graph

1673 Commits

Author SHA1 Message Date
nick black
431d4a449d
use tty_emit() in place of term_emit() for tty-specific escapes #773 2020-07-19 02:19:19 -04:00
nick black
d46ca758a0 highcontrast: stash fgstate for later reapplication #748 2020-07-18 20:27:13 -04:00
nick black
9bd0b42a0e normal: fix ncvisual_rotate() abort reported as FAILED #802 2020-07-18 20:27:13 -04:00
nick black
f8c47b0681 normal: fix plane rotation quit reported as FAILED #802 2020-07-18 20:27:13 -04:00
nick black
e0155c7d56 CELL_ALPHA_HIGHCONTRAST unit tests #748 2020-07-18 20:27:13 -04:00
Nick Black
82676cd395 linuxconjammer/linuxconsole PoCs: compile on freebsd 2020-07-16 14:33:42 -04:00
nick black
86a75531c6
Support newlines in ncplane_putnstr() when scrolling #793 2020-07-15 18:37:54 -04:00
nick black
b5cfc3e1ca linux console: full quadblitter power #201 2020-07-13 23:23:27 -04:00
nick black
575c366960 linux console: we've got some hats now, motherfuckers #201 2020-07-13 23:23:27 -04:00
nick black
21d28e7234 linux console: shim in single quad block glyphs #201 2020-07-13 23:23:27 -04:00
nick black
eaa1c28756 linux console: shim in half blocks #201 2020-07-13 23:23:27 -04:00
nick black
a009eb946c linux console: prep table for shims #201 2020-07-13 23:23:27 -04:00
Nick Black
50ce76bad8
Add kernel unicode-to-font mappings dynamically for line-drawing characters (#794)
Part 1 of a two-part revolution in Linux console graphics. Map all the line-drawing Unicode characters to similar glyphs. This means all our nice corners freely translate into rigid corners etc in the console, rather than hateful default characters (usually black diamonds). The demo and all widgets now look correct when drawing lines and boxes. Next, we'll add the actual glyphs for the block-drawing characters, and we'll have the finest graphics ever seen on a text-mode Linux console. #201
2020-07-13 18:04:43 -04:00
nick black
ff569d7114
terminfo: chop off $<N> syntax #769 2020-07-13 05:54:59 -04:00
nick black
1c95241948
fileroller/procroller: check widget destructor for error #793 2020-07-13 05:26:29 -04:00
nick black
b0990c1389
dumbass 2020-07-13 01:52:53 -04:00
Nick Black
dbc83c41b3
linuxconsole PoC (#791)
* use ioctl(KDGETMODE) to detect Linux console
* diagnostic on KDGETMODE
* add logdebug()
* unit test for notcurses_drop_planes(), add ncplane_putnstr_aligned()
* linuxconsole PoC
* linuxconsole: dump unicode->font table
* linuxconsole: explode glyphs
* linuxconsole: show 7 glyphs per 'line'
* linuxconjammer: shim console font with half blocks
* signals: handler for SIGTERM
* man pages: update notcurses_init() for options
* add NCOPTION_NO_FONT_CHANGES #201
2020-07-13 01:21:41 -04:00
nick black
992eaea8d0
tetris: swap colors on level change 2020-07-12 08:29:51 -04:00
nick black
894c6d15f6
tetris: start on level 1 2020-07-12 03:12:42 -04:00
nick black
20864949fa
ncneofetch: check for swapped cursor coordinates #765 2020-07-11 01:38:23 -04:00
nick black
5cf912feb6
ncplane_printf_stainable() and _vfprintf_stainable() #754 2020-07-10 23:58:37 -04:00
nick black
4a97c139e6
add ncplane_putstr_stainable() #754 2020-07-10 23:43:47 -04:00
nick black
a6b002fa77 add ncdirect box-drawing functions #753 2020-07-10 18:41:25 -04:00
nick black
96c6dc8e16 add ncdirect_canopen_images() and ncdirect_canutf8() #753 2020-07-10 18:41:25 -04:00
nick black
c783244185 ncdirect_hline_interp(), ncdirect_vline_interp(), dirlines PoC #753 2020-07-10 18:41:25 -04:00
nick black
750f88b70a split direct into its own header 2020-07-10 18:41:25 -04:00
nick black
b617587ade
demo_nanosleep_abstime_ns: silence compiler warning 2020-07-10 13:18:55 -04:00
nick black
9ff805e754
demo_nanosleep_abstime_ns: fix test sense, swallow input #782 2020-07-10 12:38:21 -04:00
nick black
4b893164e1
ncplane_stain(): only stain valid EGCs #777 2020-07-10 11:58:46 -04:00
nick black
5512158fc5
postpaint(): no need to replace nul with space #777 2020-07-10 11:15:23 -04:00
nick black
ea183c0d66
fdthread: stop being an asshole and NUL terminate the input #778 2020-07-09 03:27:06 -04:00
nick black
3ef1a3a07d
add notcurses_version_components() 2020-07-09 02:17:55 -04:00
Nick Black
162f9910c2
Tons of work on ncreel (#776)
Tons of work on ncreel (#627, #749, #694)
Improve reel demo: get input wired up once more, avoid the FPS demo at bottom, print pointer and line count in each tablet, use new ncreel API. Improve notcurses-ncreel explorer: kill memory leaks (#694), draw tablets better, use new ncreel API. Fix bug in ncreel core where cruft could be left on the screen, via a very gross brute force algorithm. I'll likely come back and make this a bit less ghastly in the future #749. Remove weird one-off input system from ncreel, residue from outcurses. Make some of the normalizing changes speced out in #627

* ncreel: give each tablet an index, and print it #749
* reel: eliminate FIXME + param to insert_tabler() #749
* ncreel: label tablets with their adress to correlate against debugging logs #749
* more terminal environment variable notes
* TERMS.md: add Sakura, st
* ncreel: move legend out of reel proper
* ncreel_options: dump min/max_supported_rows/cols #627
* ncreel: remove weird one-off input layer #627
* ncreel: add ncreel_offer_input()
* reel demo: call demo_getc()
* reel demo: rig up input to demo main
* ncreel: drop ncreel_del_focused(), properly bind tablets
* reel demo: don't free up necessary plane
* ncreel: don't pull absolute locations of tablets
* ncreel: place tablets correctly in boundrel
* reel demo: add back support for left/right
* reel demo: restore thread movement
* ncreel: remove a great deal of complexity
* reel demo: stay out of FPS graph's way
* ncreel: give each tablet an index, and print it #749
* reel: eliminate FIXME + param to insert_tabler() #749
* ncreel: label tablets with their adress to correlate against debugging logs #749
* ncreel: move legend out of reel proper
* ncreel_options: dump min/max_supported_rows/cols #627
* ncreel: remove weird one-off input layer #627
* ncreel: add ncreel_offer_input()
* reel demo: call demo_getc()
* reel demo: rig up input to demo main
* ncreel: drop ncreel_del_focused(), properly bind tablets
* reel demo: don't free up necessary plane
* ncreel: don't pull absolute locations of tablets
* ncreel: place tablets correctly in boundrel
* reel demo: add back support for left/right
* reel demo: restore thread movement
* ncreel: remove a great deal of complexity
* reel demo: stay out of FPS graph's way
* reel: tighten up reel following redraw
* reel: fix upper-left corner of topless perimeter
* ncreel: print linecount, return clipped value
* reel: draw focused tablet relative to reel
* reel: brute force decruftification, how embarrassing #749
2020-07-09 02:02:23 -04:00
nick black
479dd00739
ncreel: purge {tblr}off fields; these are ncplane properties #627 2020-07-06 15:59:29 -04:00
nick black
8a9a0c35e0
remove debugging cruft 2020-07-06 01:54:13 -04:00
nick black
da765ebdaa
mojibake: don't stomp right side of boxes 2020-07-05 13:39:48 -04:00
nick black
f2af24648d
mojibake: add all remaining emoji collations #770 2020-07-05 11:01:55 -04:00
nick black
2c37f2c4ba
mojibake: second third of the emoji collations #770 2020-07-05 10:52:51 -04:00
nick black
fd83cc8639
mojibake: add all unicode 13 emoji via CLDR order #770 2020-07-05 10:34:07 -04:00
nick black
b6330d142b
add notcurses_render_file() #491 2020-07-05 07:14:07 -04:00
nick black
b26bd14d11
demo: make HUD text opaque #771 2020-07-05 01:51:12 -04:00
nick black
5a9e0c6f05
rendering: lack of term capability is not error #768
If we don't have setaf/setab, then we're not going to set color.
OK, fine. Don't regard it as an error during
notcurses_rasterization(), just don't emit the escape. This is
necessary to run on terminals like vt100, which in turn is
necessary to run unit tests properly on Redhat's koji.
Also, use notcurses_canfade() to avoid just breaking during
fades in intro and trans demos.
2020-07-05 01:04:44 -04:00
nick black
2d87aff90e
subprocfd: fix memory leak on error path 2020-07-04 22:39:36 -04:00
nick black
7744c6aae5
highcon: keep text in original position #762 2020-07-04 07:13:08 -04:00
nick black
efcf0583c9
ncmetric: fix µ for ASCII mode #764 2020-07-04 02:39:29 -04:00
Nick Black
e201c9994d lookup_blitset: properly pass utf8 test #763 2020-07-04 01:23:07 -04:00
Nick Black
c88c51c4d3 cell_load: check for negative cols result, propagate #761 2020-07-04 00:45:41 -04:00
Nick Black
ecc7bb25cc selector: draw indicators in ASCII mode #761 2020-07-04 00:11:34 -04:00
nick black
6b1b8d1695 ncplane_puttext: unit tests for scrolling #719 2020-07-03 22:50:34 -04:00
nick black
84746f1f31
OTHERS: add termbox, termion, pancurses 2020-07-03 22:42:34 -04:00
nick black
718abd648a ncdirect_render_image: add alignment #759 2020-07-03 21:24:00 -04:00
nick black
2fa8de9813 ncdirect: silence ffmpeg #759 2020-07-03 21:24:00 -04:00
nick black
46b8c8c913 ncdirect_render_image(): get it working for all geometries #759 2020-07-03 21:24:00 -04:00
nick black
eba7106067 ncdirect_clear: use ->clearscr, kill off bogon ->clear #759 2020-07-03 21:24:00 -04:00
nick black
4c3cb44100 ncdirect_render_image: fix NCSCALE_NONE #759 2020-07-03 21:24:00 -04:00
nick black
b829398538 ncdirect_render_image: accept ncalign_e parameter #759 2020-07-03 21:24:00 -04:00
nick black
46d75c072a ncdirect_render_image(): don't take current x into account #759 2020-07-03 21:24:00 -04:00
nick black
74b44506b6 vizdirect: use all three scaling types #759 2020-07-03 21:24:00 -04:00
nick black
b698efb953
ncdirect: prefer provided fp, iff it's a tty #752 2020-07-03 16:41:10 -04:00
nick black
e5c9168523
notcurses_init(): dup() ttyfd so we can always close() it 2020-07-03 16:40:53 -04:00
nick black
f7fc665c13
Acquire and use ttyfd properly in ncdirect #752
When we don't have an actual terminal in ncdirect, return
placeholder 80x24 for ncdirect_dim_y()/ncdirect_dim_x(), but
don't go querying e.g. a redirected file for its dimensions.
Similarly, only request info about cursor position from a true
TTY (we're otherwise likely to hang, or at best get meaningless
data). Rewrite 'direct' PoC to use ncdirect_dim_*().
Add tty_emit(). Closes #752.
2020-07-03 15:28:28 -04:00
Nick Black
415d4b813f
Tight work on unit testing, controlling tty vs output fd (#758)
* Some things go to the FILE* we're provided. Some can only go to a controlling terminal. Check to see if the FILE we're given is a TTY. If not, open up /dev/tty #752.
* term_emit(): fflush() can return EAGAIN. Loop on it to eliminate a rare error on shutdown that particularly affected unit tests (where we start and shut down Notcurses many times in a row).
* sgr poc: check return value of setlocale()
* drone: run all unit tests
* CMake: add some tests using PoCs
* ncneofetch: print even small palettes
2020-07-02 18:03:52 -04:00
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
2020-07-02 17:34:30 -04:00
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().
2020-07-02 00:10:59 -04:00
nick black
31c584e2e6 ncneofetch: work no matter y offset, done! #750 2020-07-01 20:30:06 -04:00
nick black
8fedec050c ncneofetch: draw infoplane with notcurses + margin_t #750 2020-07-01 20:30:06 -04:00
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
2020-07-01 20:30:06 -04:00
nick black
cda4253a0a ncneofetch: sem_post() on error path 2020-07-01 20:30:06 -04:00
nick black
a8db078689 ncneofetch: default background on palette 2020-07-01 20:30:06 -04:00
nick black
9ae1c6b3df ncdirect_render_image: fix arguments to rgba_blitter_low #751 2020-07-01 20:30:06 -04:00
nick black
4e04c3ae8f ncneofetch: fill out first line of infoplane 2020-07-01 20:30:06 -04:00
nick black
45fbbdb4ef ncneofetch: align output #750 2020-07-01 20:30:06 -04:00
nick black
33cb21d917 ncdirect_printf_aligned() added #750 2020-07-01 20:30:06 -04:00
nick black
4889e9b391 ncneofetch: scale 2020-07-01 20:30:06 -04:00
nick black
60619fc4b9 ncneofetch: move back to NCSCALE_SCALE #750 2020-07-01 20:30:06 -04:00
nick black
7eb70dad71 ncneofetch: display() in direct mode #750 2020-07-01 20:30:06 -04:00
nick black
7a022a4c76 ncneofetch: show palette via direct mode #750 2020-07-01 20:30:06 -04:00
nick black
452fdc671d
intro: move legend into main plane 2020-07-01 03:24:15 -04:00
nick black
4863c7e3df
ncdirect_image_render: restore NCBLIT_2x2 #751 2020-07-01 01:14:42 -04:00
nick black
0586adbe24
ffmpeg: disable debugging cruft erp 2020-06-30 00:43:18 -04:00
nick black
8a2f86ea16 vizdirect: use DFSG-safe media only #725 2020-06-30 00:18:02 -04:00
nick black
fd064b0f2a ncvisual_render_image(): working! #725 2020-06-30 00:18:02 -04:00
nick black
40d0efcece ncdirect_render_image(): just about working #725 2020-06-30 00:18:02 -04:00
nick black
277cbc9c16 ncdirect_render_image(): getting closer #725 2020-06-30 00:18:02 -04:00
nick black
3bb789eb74 refactoring to prep for ncdirect_visual 2020-06-30 00:18:02 -04:00
nick black
229079696d ncvisual refactoring to support ncdirect 2020-06-30 00:18:02 -04:00
nick black
052e10ebe1
subproc: fix up USING_PIDFD definition 2020-06-29 00:20:42 -04:00
nick black
b9dc9a7f1c
subprocs: simplify __linux__ check 2020-06-28 23:49:45 -04:00
nick black
dda6d2f596
subproc: check for __NR_clone3 2020-06-28 22:19:41 -04:00
nick black
8310b687ac
demo: enable FPS plot by default #744 2020-06-28 21:09:26 -04:00
nick black
ae1b45efbf
plot: make legend glyph-transparent #744 2020-06-28 21:07:06 -04:00
nick black
9a5a4a65ca demo: enable HUD by default #743 2020-06-28 20:50:35 -04:00
nick black
8da3e6f968 HUD: fully glyph-transparent, looks great #743 2020-06-28 20:47:42 -04:00
nick black
ba1c9868e5 HUD: glyph-transparent inter-column gap #743 2020-06-28 20:39:02 -04:00
nick black
64857e12ac HUD: glyph transparency on frame count #743 2020-06-28 20:34:12 -04:00
nick black
96575fb402 hud: glyph-transparent right side 2020-06-28 20:22:02 -04:00
nick black
1cbf98cb6c
notcurses_init: allow US-ASCII, used by FreeBSD 2020-06-28 18:56:40 -04:00
nick black
3d6585e445
Trigger clone3()+waitid() path off definition of P_PIDFD #733 2020-06-28 17:38:51 -04:00
Nick Black
d5dca33e00 ncneofetch: don't print (null) for distro_pretty 2020-06-28 06:43:29 -04:00
Nick Black
d52ced823c make Wide unit tests sensitive to local irregularities #741 2020-06-28 06:40:00 -04:00
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.
2020-06-28 05:56:38 -04:00
nick black
6303e803f6
outro: don't obfuscate globe with acai plane 2020-06-28 05:55:04 -04:00
nick black
9fe48f8539 procroller/fileroller: enable scrolling on standard plane 2020-06-28 05:50:42 -04:00
nick black
6f6826238e
mojibake: improve topside a tad 2020-06-28 04:04:07 -04:00
nick black
5513707d8d
allglyph: don't print UTF-16 surrogate characters #740 2020-06-28 03:54:30 -04:00
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.
2020-06-28 01:53:42 -04:00
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.
2020-06-28 01:45:18 -04:00
nick black
cdd96af8df
trans: put the legend on top to avoid FPS plot 2020-06-28 01:44:23 -04:00
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.
2020-06-25 14:09:15 -04:00
nick black
03618c70b3
more sys/poll.h -> poll.h for musl #733 2020-06-25 01:12:11 -04:00
nick black
d9535f9962
musl: sys/poll, sys/fcntl -> poll, fcntl #733 2020-06-24 18:21:18 -04:00
nick black
0a0f9faa7f
add .xcf for normal.png 2020-06-23 16:02:38 -04:00
nick black
feaa20c586
normal: use fractalheight.png at end 2020-06-23 15:58:38 -04:00
nick black
ef10b8ced2
mojibake: order planes by unicode spec 2020-06-23 08:47:28 -04:00
nick black
87a488da9f
mojibake: add unicode 5.2 / emoji 1.0 glyphs 2020-06-23 08:37:32 -04:00
nick black
1d71aa4830
ncneofetch: display palette just above image 2020-06-23 07:36:40 -04:00
nick black
0c6f160493
eagle: always zoom to target area #732 2020-06-23 04:00:06 -04:00
nick black
f99f64d3d7 mojibake: add unicode1/emoji1 2020-06-23 03:43:26 -04:00
nick black
1d7b6a7732 mojibake: add unicode 7 / emoji 2 2020-06-23 03:43:26 -04:00
nick black
f0d2847939 mojibake: finish unicode13 block 2020-06-23 03:43:26 -04:00
nick black
bca52922dd mojibake: first row of unicode 13 table 2020-06-23 03:43:26 -04:00
nick black
32180235bd mojibake: better title coloring 2020-06-23 03:43:26 -04:00
nick black
70aefd451c mojibake: accommodate kitty 2020-06-23 03:43:26 -04:00
nick black
8654a4554a mojibake: reorganize so everything fits 2020-06-23 03:43:26 -04:00
nick black
46570d46b9 mojibake: color glyphs 2020-06-23 03:43:26 -04:00
nick black
770c0c0fc5 mojibake demo: scroll planes up 2020-06-23 03:43:26 -04:00
nick black
e4885327e0 mojibake: clean up planes 2020-06-23 03:43:26 -04:00
nick black
54bfa96b00 mojiake: unicode 6.0 emoji 2020-06-23 03:43:26 -04:00
nick black
44eab55212 mojibake title 2020-06-23 03:43:26 -04:00
nick black
1dfcb826a6 skeleton of mojibake demo #689 2020-06-23 03:43:26 -04:00
nick black
c7c0909c17
ncneofetch: don't read from NULL cpuinfo FILE 2020-06-21 02:53:40 -04:00
nick black
a48ccfacf3
ncneofetch: include LANG/UID 2020-06-19 16:09:32 -04:00
nick black
97a996927f
ncdirect_render_image: return NCERR_UNIMPLEMENTED #725 2020-06-19 15:24:26 -04:00
nick black
4a3d436e5b
drone: update builders 2020-06-19 14:10:18 -04:00
nick black
641f0cb894
brailleblitter: full EGC selection, blending #649 2020-06-19 13:25:34 -04:00
nick black
79d3ae67e4
add notcurses_cantruecolor() 2020-06-18 11:04:29 -04:00
nick black
5a466ade18
ncneofetch: get cpu info #550 2020-06-18 10:29:00 -04:00
nick black
89b2106075
ncneofetch: don't call out to lsb_release, cuts 95% of running time lol #550 2020-06-18 10:20:32 -04:00
nick black
189841d992
ncneofetch: thread the logo load+draw #550 2020-06-18 10:02:02 -04:00
nick black
9f69e4d998
ncneofetch: show x resolution when possible #550 2020-06-18 09:45:28 -04:00
nick black
e45c2c9ac3
demo: speed things up a bit, our ass is dragging 2020-06-18 09:45:14 -04:00
nick black
292f0d9294
ncneofetch: get desktop manager + shell #550 2020-06-18 05:40:32 -04:00
nick black
37ba3a0bd4
ncneofetch: metricize ram #550 2020-06-18 05:14:13 -04:00
nick black
1fa9d9be2c
yield demo: adapt to new ncvisual_geom #727 2020-06-18 04:15:46 -04:00
nick black
699407a14a
eagle demo: don't STRETCH for geom() call 2020-06-18 04:07:09 -04:00
nick black
29fe68f93a
ncvisual_geom(): handle NULL vopts case #727 2020-06-18 03:40:30 -04:00
nick black
10d74d5051
ncvisual_geom(): handle NULL ncvisual case #727 2020-06-18 03:36:55 -04:00
Nick Black
16c086b41a CMake: don't define killer options on FreeBSD 2020-06-18 02:57:57 -04:00
nick black
355021de56
ncneofetch: print ram/processes #550 2020-06-18 01:34:07 -04:00
nick black
b8c5f51040 ncneofetch: fedora support #550 2020-06-18 00:48:46 -04:00