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.
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.
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
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
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().
CMake:
Simplify cmake target+version config generation and make it actually
work. With the changes it is now possible to detect and use
`Notcurses` in the following way:
find_package(Notcurses REQUIRED)
...
target_link_libraries(myapp PRIVATE notcurses::notcurses)
Also, added the same CMake configuration for `Notcurses++`, to be used
in the following way:
find_package(Notcurses REQUIRED
find_package(Notcurses++ REQUIRED)
...
target_link_libraries(myapp PRIVATE notcurses++::notcurses++)
Docs:
`notcurses_cell(3)`: `cell_styles_{on,off} -> cell_{on,off}_styles`
and `cell_load_simple` -> `cell_load_char`
C++ API:
* Plane: added constructors taking `ncplane_options const&` instead of
the multitude of individual parameters
* Plane: drop `struct` when `ncplane_options` is used.
* Plane: added `strdup` (`cell_strdup`)
* Plane: added `extract` (`cell_extract`)
Added:
* Pile: new class derived from Plane, which implements all the
`ncpile_*` calls
* Plane: `get_parent` (`ncplane_parent`)
* Plane: protected constructor for use by `Pile` (or other derived
classes which cannot provide a valid `ncplane*` when invoking parent
constructor.
* Plane: `set_plane` for use by the derived classes above.
Changed:
* Plane: `to_ncplane` is a `const` method now.
Fixes: https://github.com/dankamongmen/notcurses/issues/1009
Whenever a widget is created with its `*_create` function it currently
claims full ownership of the passed panel, including its destruction.
However, the C++ wrapper around the panel is not aware of this and will
attempt to destroy the native panel in the destructor, leading to
segfaults.
Fix this by introduction of a `Widget` class which contains the logic to
properly modify the `Panel` instance to not double-destroy the native
panel. The solution is a bit fragile since the `Panel` instance is left
intact (we can't free it for the user) in a state that's safe for the
C++ wrapper, but calling any C function via the wrapper **will** pass a
`NULL` pointer in the panel argument - therefore the C functions MUST be
proofed against this. The proofing belongs in the C backend code since
this protects also C and other language binding users from such abuse.
The Widget class will first verify that the passed `Plane` instance
hasn't already been "disowned" and will throw an exception to the effect
if it was. Next, it will proceed to take over ownership of the native
panel instance and mark the passed `Panel` as "invalid" (i.e. not owning
any native panel instance anymore)
The above changes require modification of `Panel` instances and so all
the widget constructors taking `const*` or `const&` have been removed
from widget classes.