Commit Graph

771 Commits

Author SHA1 Message Date
nick black
6ce1daee74 [nccell] add comment about pixel gclusters #1401 2021-03-16 00:32:45 -04:00
nick black
645b61e9dc [pixel] pass celldimy through blitterargs #1401 2021-03-16 00:32:45 -04:00
nick black
b18682e86c [pixels] rewrite cell_pixels_p() for 0x02 #1401 2021-03-16 00:32:45 -04:00
nick black
9728e79396 [ncplayer] obey margins in direct mode #1411 2021-03-14 22:48:47 -04:00
nick black
7bc3800e27 [direct] accept limits for prep_image() #1411 2021-03-14 22:48:47 -04:00
nick black
d99b16a1ba ncpp: error_guard<int> in get_dim_x/y() #1413 2021-03-14 22:48:47 -04:00
nick black
04ad933a4b
ncplayer: don't try to drive four/eight #1406 2021-03-14 03:49:18 -04:00
nick black
9534bfdefd
ncplane_reparent: nonnull annotations 2021-03-11 22:38:06 -05:00
nick black
b9382231e2
c++: pass self on reparenting, not nullptr 2021-03-11 22:37:54 -05:00
nick black
268a720225
Keep hardcursurpos bool across rasterizations
Move hardcursorpos into the renderstate carried
across rasterizations. This eliminates undesirable vertical
movement following pixel image emission #1400.
2021-03-11 20:46:54 -05:00
nick black
6693e5f386
pass tcache down through visual blit stack #1095 2021-03-07 19:30:43 -05:00
nick black
7b61395ec4 sixel: set egc width properly based off tcache #1380 2021-03-02 08:12:37 -05:00
nick black
7592d0c4a3 rendered mode: properly scale pixel graphics #1380 2021-03-02 08:12:37 -05:00
nick black
0ffbba3365 restore stashed stats for closing banner #1374 2021-02-27 19:03:42 -05:00
nick black
100a89291b hide cell_{b,f}channel(), cell_set_{b,f}channel() 2021-02-27 19:03:42 -05:00
nick black
53c52e30ff remove c++/rust channel wholesalers 2021-02-27 19:03:42 -05:00
nick black
6c7c9be6d2 require explicit check for pixel support
Add `notcurses_check_pixel_support()` and
`ncdirect_check_pixel_support()` per #1367. Removes
NCOPTION_VERIFY_SIXEL, again per #1367. Adds
`free_terminfo_cache()`, and calls it from both
`notcurses_stop_minimal()` and `ncdirect_stop()`.
Update all documentation. Closes #1371 and #1367.
2021-02-27 19:03:42 -05:00
nick black
40746e76e6 s/nonehi/hires/g 2021-02-27 19:03:42 -05:00
nick black
391fef3a3f cell pixel defines / inlines #200 2021-02-27 19:03:42 -05:00
nick black
036d0a8697 s/NCBLIT_SIXEL/NCBLIT_PIXEL/g #1095 2021-02-27 19:03:42 -05:00
nick black
aa4da3f335
nctree: drop bchannels from options 2021-02-24 23:33:53 -05:00
Nick Black
e30b12a480
nctree (#1361)
The nctree widget, PoC, and unitt rs #1164.
2021-02-23 14:38:06 -05:00
nick black
2221120543 add SIGILL to documented fatal signals #1357 2021-02-21 23:22:37 -05:00
nick black
8a7ff8a317 signals: restore them on exit #1357 2021-02-21 23:22:37 -05:00
nick black
925870bd7a
update some definitions in USAGE.md 2021-02-19 12:41:43 -05:00
nick black
4951ea3d88
update comment on notcurses_lex_scalemode() 2021-02-19 12:36:25 -05:00
nick black
d845e979c2
tighten up CELL_BG_ALPHA_MASK 2021-02-19 12:15:44 -05:00
nick black
2741b049cb
don't expose nctree in 2.2.2 2021-02-18 07:04:03 -05:00
nick black
1df9d85f28
Lock accesses to notcurses_stats #1139
notcurses_stats() and notcurses_stats_reset() now take the
new statlock member, as do stat modifications from render,
raster, writeout, resize, plane creation, and plane
destruction. Add nonnull attributes to stats API. Initialize
and destroy statlock as part of notcurses struct. Update
documentation. Free pilelock on error paths. Closes #1139.
2021-02-18 01:37:30 -05:00
nick black
bb14694000 add nctree movement api #1164 2021-02-15 13:23:41 -05:00
nick black
3eb42d6c0c implment nctree_create()/free() #1164 2021-02-15 13:23:41 -05:00
nick black
7a698310b6 ncinput is not opaque 2021-02-15 13:23:41 -05:00
nick black
2348546932 nctree API cut 1 #1164 2021-02-15 13:23:41 -05:00
nick black
e88875c4a7 nctree: add nctreecb to options #1164 2021-02-15 13:23:41 -05:00
nick black
7e56c8e1c2 nctree_options definition #1164 2021-02-15 13:23:41 -05:00
nick black
1b1e0b88be
ncplane_qrcode: drop blitter argument, update docs 2021-02-15 03:34:14 -05:00
nick black
e63ca5f704 use ALLOC in ncdirect.h 2021-02-10 04:29:06 -05:00
nick black
602531ff33 include warn_unused_result in ALLOC 2021-02-10 04:29:06 -05:00
nick black
1b61786694 apply ((alloc)) attributes to API 2021-02-10 04:29:06 -05:00
Marek Habersack
d32bef358d [C++] API sync
After a long delay, apologies :)

Added:
  * NotCurses: `can_sextant` (`notcurses_cansextant`)
  * Notcurses: `linesigs_enable` (`notcurses_linesigs_enable`)
  * Notcurses: `linesigs_disable` (`notcurses_linesigs_disable`)
  * Pile: `top_with` (`ncpile_top`)
  * Pile: `bottom_with` (`ncpile_bottom`)
  * Plane: `resize_maximize` (`ncplane_resize_maximize`)
  * Plane: `get_abs_x` (`ncplane_abs_x`)
  * Plane: `get_abs_y` (`ncplane_abs_y`)
  * Plane: `get_abs_yx` (`ncplane_abs_yx`)
  * Plane: `load_egc32` (`cell_load_egc32`)
  * Plane: `is_descendant_of` (`ncplane_descendant_p`)
  * Progbar: new class, wraps `ncprogbar_*`

Changed:
  * Plane (ABI break): `at_cursor` overloads now return `int` where
    before they returned `bool` because the underlying Notcurses API
    only signalled the operation status with the return value while now
    it returns actual information.
2021-02-07 23:10:24 -05:00
nick black
6b126f4049
add notcurses_canbraille() capability test 2021-02-07 18:31:31 -05:00
nick black
b3569b6aef
Initialize Readline on demand
Eliminate NCDIRECT_OPTION_NO_READLINE (it was only introduced in
Notcurses 2.1.6). Add a new function, ncdirect_readline(). Upon
first call to this function, initialize libreadline. Destroy
libreadline in ncdirect_stop() iff we initialized it. Add
hilodirect guessing game PoC from #1325. Rename
notcurses_directmode.3 to notcurses_direct.3. Closes #1326.
2021-02-03 00:18:10 -05:00
nick black
43dd0440f7
add raster timing stats #1324 2021-02-02 21:59:29 -05:00
nick black
2491b693ba
Add missing channel_set_palindex()
Implement channels_set_fg_palindex() and channels_set_bg_palindex()
in terms of channel_set_palindex(). Add missing entries to
notcurses_channels.3 man page. Use uint32_t in place of unsigned
when dealing with channels in notcurses.h.
2021-02-02 20:36:59 -05:00
nick black
b112b93901 use byteswap.h on GNU/Hurd #1320 2021-02-02 00:57:58 -05:00
nick black
cb58f45dd3 Write blit quadrants to channel
Reclaim the "blitted" and "full foreground" bits in the
channels. Instead, we now write four bits, encoding the
four quadrants we might occupy as the result of a blit.
These four imply the previous two, leaving us with four
free bits remaining in the channels. This opens a clear
path to O(1)-time, zero-space blitter stacking #1068.
w00t!
2021-02-02 00:57:58 -05:00
nick black
f37ebba78d Add CELL_BLITTEDMASK to track ncvisual cells
For properly stacking transparent blittings (#1068), we
need tag those cells which both (1) originated in an
ncvisual operation and (2) have some transparency. For
the three affected blitters (halfblock, quadrant, and
sexblitter), call cell_set_blitted().
2021-02-02 00:57:58 -05:00
nick black
6bd288f056 Workable split of library
Rather than trying to force things in via library constructors
and weak symbols and --whole-archive and pkg-config tricks, just
add new functions ncdirect_core_init() and notcurses_core_init().
libnotcurses has ncdirect_init() and notcurses_init(), which pass
through to these. apps linking against notcurses-core ought use
the _core_ variants directly. This gets exactly the linkage we
want, everywhere. Convert many PoCs to _core_ variants. #1301

Signed-off-by: nick black <dankamongmen@gmail.com>
2021-01-19 23:09:22 -05:00
nick black
1108ebb5b6
Fix up some subtle pile issues
ncplane_destroy() needs to call ncplane_reparent_family(), not
ncplane_reparent() as it was doing (closes #1291). ->absy and
->absx actually are absolute; return them directly for an O(1)
ncplane_abs_yx() (down from O(N), huzzah). Add some unit tests
related to destroying and reparenting (#1286). Add ncplane_abs_y()
and ncplane_abs_x(), document them, etc.
2021-01-15 00:32:55 -05:00
nick black
1c0a623b8b
document new function ncplane_abs_yx() #1286 2021-01-14 23:06:43 -05:00
nick black
68b340e3c8
ncdirect: prep readline for use #1120 2021-01-08 07:28:24 -05:00
nick black
15386d57ce
nontrivial stacking unit test #1068 2021-01-08 04:59:24 -05:00
nick black
7e05d0438a
notcurses_init.3: fix up some syntax 2021-01-03 21:18:52 -05:00
nick black
54b44513c4
Wide EGC tweaks
Don't bias the nccell width by 1, or 0-length EGCs become
255 columns. We weren't actually using the width to drive
much anything until now, so this wasn't a problem, but it
is exposed as an error once we got rid of CELL_WIDE_ASIAN
and start looping through the actual egc column width.
Closes #1278, closes #1277
2021-01-03 17:42:28 -05:00
nick black
6d6416064e
ncdirect: set up fatal signal handlers #1271 2021-01-03 02:36:58 -05:00
nick black
998cf02f34
add NCDIRECT_NO_QUIT_SIGHANDLERS #1271 2021-01-02 23:18:28 -05:00
nick black
555a3262b1
add channel_palindex and friends 2021-01-02 21:23:38 -05:00
nick black
af07822d35 Document base cell better
Improve the documentation for ncplane_set_base_cell() and
ncplane_set_base(). Go by render.c's authority (all three
channels are independently checked for transparency, and
replaced with the base cell if so--egc, fg, and bg). Add a
BASE CELL section to notcurses_plane.3. Check for, and reject,
an nccell which is secondary among a multicolumn EGC.

Closes #1238.
2021-01-02 13:28:15 -05:00
nick black
e522429dfb
direct: reorder declarations to please freebsd 2020-12-30 10:58:02 -05:00
nick black
7e20a25482
ncdirect_*_palindex -> ncdirect_set_*_palindex #1261 2020-12-28 13:57:13 -05:00
nick black
f1253560ad
ncdirect: set_ on rgb functions #1261 2020-12-28 13:52:58 -05:00
nick black
76d8e2dfce
ncdirect_{fg, bg}_default() -> ncdirect_set_{fg, bg}_default() #1261 2020-12-28 13:38:05 -05:00
nick black
58bc9bd3bc
fix up writeout stats, report in shutdown banner 2020-12-28 04:50:20 -05:00
nick black
638dde7657
remove unnecessary args from ncdirect_raster_frame() #1248 2020-12-28 02:41:22 -05:00
nick black
1d8fcbb5e4
ncdirect: styles{set, on, off} -> _styles #1247 2020-12-28 02:21:37 -05:00
nick black
dd1cdc40d5 add NCSCALE_NONE_HIRES, NCSCALE_SCALE_HIRES #1250 2020-12-25 23:28:50 -05:00
nick black
4d8efcab82
Progress towards NCBLIT_3x2 by default
Add a new member 'sextants' to the terminfo cache (both
notcurses and ncvisual contain one of these, and both
initialize it the same way -- interrogate_terminfo()).
Add a new function, 'notcurses_media_defblitter()', and
deprecate 'ncvisual_default_blitter()' (the latter didn't
receive enough information to return NCBLIT_3x2). Update
all callers. Add new *internal* function rgba_default_blitter(),
so this logic can be freely changed in the future. If
sextants are available, and we're scaling, return NCBLIT_3x2.
Once we detect sextant availability, we'll have sexblitter
as a default -- stay tuned! #1114
2020-12-25 17:05:31 -05:00
nick black
248dd1fff2
add dynamic linesig control #1228 2020-12-20 20:16:08 -05:00
joseLuís
45c01c95af update align doc comments #1234 2020-12-19 18:03:32 +01:00
nick black
0b633fbdad
ncplane_at_yx_cell/at_cursor_cell: return bytes of egc 2020-12-18 19:11:05 -05:00
nick black
5cd3cdaf70
direct: s/ncplane/ncdirectv/g 2020-12-18 15:29:51 -05:00
Nick Black
730e9f69ec
Multithreaded ncls (#1232)
Thread out ncls to perform the media decode in different threads, in parallel. Only the display needs be locked. On a directory of 200 files on my 39070X, this speeds ncls from ~5s to ~1s. On 75 files, we go from ~.5s to ~.2s. On a single file, we lose about 5%. To facilitate this, ncdirect_render_image() has been split into two helpers, ncdirect_render_frame() and ncdirect_raster_frame().
2020-12-18 15:28:24 -05:00
nick black
bf3e3eb0b5
ncplane_at_cursor_cell: rewrite with ncplane_at_yx_cell() 2020-12-18 01:39:44 -05:00
nick black
28b1a80433
ncplane_at_yx_cell: work directly with cell_duplicate() #1231 2020-12-18 01:19:28 -05:00
nick black
405b456428
disambiguate comment on ncdirect #1227 2020-12-17 20:38:43 -05:00
Nick Black
1bdd2d0555
Progress bar polishing (#1219)
Progress bars now support four 32-bit channels in ncprogbar_options, and uses them to color a gradient. The redraw procedure has been changed from O(n) to O(1). ASCII progress bars have been repaired. Closes #1213.
2020-12-16 16:48:10 -05:00
nick black
1bbbdd9dc0
annotate many functions with ((nonnull)) 2020-12-14 22:24:37 -05:00
nick black
827d758c19 properly color progbar #1202 2020-12-13 09:12:08 -05:00
nick black
d56ea8b5e7 progbar: remove egcs options 2020-12-13 09:12:08 -05:00
nick black
82ffac8eed remove ncprogbar locking options #1202 2020-12-13 09:12:08 -05:00
nick black
e37540c76e ncprogbar: implement core draw loop #1202 2020-12-13 09:12:08 -05:00
nick black
1d74979718 progbar core / poc #1202 2020-12-13 09:12:08 -05:00
nick black
6bff720122 initial API + documentation for ncprogbar #1202 2020-12-13 09:12:08 -05:00
nick black
33862979da
scan-build: remove dead stores 2020-12-13 02:43:49 -05:00
nick black
fd2acde1b1 rename cell->nccell, keep alias #1200 2020-12-13 00:49:37 -05:00
Nick Black
6106dea18a
track+use width for polycolumn EGCs #1203 (#1205)
Some EGCs are more than 2 columns (wcwidth() never returns more than 2, so far as i can tell, but when multiple characters combine, we use the sum). An example would be ကြေ (Myanmar) which occupies three columns over the course of three characters. Track the width (biased by 1) in cell->width, taking over 8 bits from cell->reserved. Use this width in rasterization. Closes #1203.
2020-12-12 22:25:08 -05:00
nick black
edf55d8cc1
notcurses_rasterize: adapt to piles 2020-12-10 07:00:16 -05:00
nick black
a3220b8a73
add ncplane_descendant_p(), unit test it #1192 2020-12-09 00:18:47 -05:00
nick black
e60a7aa463
add stat for notcurses_refresh() 2020-12-06 13:45:35 -05:00
nick black
e6209ff5fc
with apologies to salman rushdie 2020-12-06 07:09:06 -05:00
nick black
14fa544433
add NCPLOT_OPTION_PRINTSAMPLE #1183 2020-12-06 06:33:54 -05:00
José Luis Cruz
a69aa1d157 split out the UI ASCII art doc comments; fix #1180 2020-12-06 01:25:39 -05:00
nick black
58b47bf953
unit test for cell_load_egc32() #1176 2020-12-05 02:36:55 -05:00
nick black
0999e0ad3b add gcluster endianness comments 2020-12-05 00:39:37 -05:00
nick black
0645fb3931
run cell_load_char()/egc32() through cell_load() #1176 2020-12-04 03:06:51 -05:00
nick black
6fb5c1e512 Fill out some API holes, improve some comments
- Disambiguate the docs for ncplane_erase()
- Add ncpile_top(), ncpile_bottom()
- Refuse attempts to modify the standard plane's resizecb
- Copy alignment and resizecb in ncplane_dup()
- Add cell_load_egc32()
2020-12-03 01:02:16 -05:00
nick black
186b3a2a5e kill ifdefs via explitict initialization 2020-12-02 12:57:17 -05:00
igo95862
87d1ba17e6 Made CELL_TRIVIAL_INITIALIZER compatable between C and C++ 2020-12-02 12:17:30 -05:00
igo95862
5e60e84fdf Under ISO C the empty initializer is {0} not { } 2020-12-02 12:17:30 -05:00
nick black
dcde23e74c apply htole() where needed #1130 2020-11-28 23:55:17 -05:00