Commit Graph

701 Commits

Author SHA1 Message Date
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