mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
add notcurses_canbraille() capability test
This commit is contained in:
parent
7e4e3b71f8
commit
6b126f4049
3
NEWS.md
3
NEWS.md
@ -1,6 +1,9 @@
|
|||||||
This document attempts to list user-visible changes and any major internal
|
This document attempts to list user-visible changes and any major internal
|
||||||
rearrangements of Notcurses.
|
rearrangements of Notcurses.
|
||||||
|
|
||||||
|
* 2.1.9 (not yet released)
|
||||||
|
* Add `notcurses_canbraille()` capability predicate.
|
||||||
|
|
||||||
* 2.1.8 (2021-02-03):
|
* 2.1.8 (2021-02-03):
|
||||||
* The `notcurses-tetris` binary has been renamed `nctetris`.
|
* The `notcurses-tetris` binary has been renamed `nctetris`.
|
||||||
* The new function `channel_set_palindex()` has been added.
|
* The new function `channel_set_palindex()` has been added.
|
||||||
|
6
USAGE.md
6
USAGE.md
@ -300,6 +300,12 @@ bool notcurses_canutf8(const struct notcurses* nc);
|
|||||||
|
|
||||||
// Can we blit to Sixel? This requires being built against libsixel.
|
// Can we blit to Sixel? This requires being built against libsixel.
|
||||||
bool notcurses_cansixel(const struct notcurses* nc);
|
bool notcurses_cansixel(const struct notcurses* nc);
|
||||||
|
|
||||||
|
// Can we draw sextants? This requires Unicode 13.
|
||||||
|
bool notcurses_cansextants(const struct notcurses* nc);
|
||||||
|
|
||||||
|
// Can we draw Braille? The Linux console cannot.
|
||||||
|
bool notcurses_canbraille(const struct notcurses* nc);
|
||||||
```
|
```
|
||||||
|
|
||||||
## Direct mode
|
## Direct mode
|
||||||
|
@ -28,6 +28,8 @@ notcurses_capabilities - runtime capability detection
|
|||||||
|
|
||||||
**bool notcurses_cansextant(const struct notcurses* ***nc***);**
|
**bool notcurses_cansextant(const struct notcurses* ***nc***);**
|
||||||
|
|
||||||
|
**bool notcurses_canbraille(const struct notcurses* ***nc***);**
|
||||||
|
|
||||||
**bool notcurses_cansixel(const struct notcurses* ***nc***);**
|
**bool notcurses_cansixel(const struct notcurses* ***nc***);**
|
||||||
|
|
||||||
# DESCRIPTION
|
# DESCRIPTION
|
||||||
@ -64,7 +66,8 @@ UTF-8 encoding, and the locale was successfully loaded.
|
|||||||
that the terminal can properly render Unicode 13 sextants.
|
that the terminal can properly render Unicode 13 sextants.
|
||||||
|
|
||||||
**notcurses_cansixel** returns **true** if the terminal advertises
|
**notcurses_cansixel** returns **true** if the terminal advertises
|
||||||
support for Sixel.
|
support for Sixel. **notcurses_canbraille** returns **true** if Braille
|
||||||
|
is expected to work on the terminal.
|
||||||
|
|
||||||
# BUGS
|
# BUGS
|
||||||
|
|
||||||
|
@ -1228,6 +1228,9 @@ API bool notcurses_canutf8(const struct notcurses* nc);
|
|||||||
// Can we reliably use Unicode 13 sextants?
|
// Can we reliably use Unicode 13 sextants?
|
||||||
API bool notcurses_cansextant(const struct notcurses* nc);
|
API bool notcurses_cansextant(const struct notcurses* nc);
|
||||||
|
|
||||||
|
// Can we reliably use Unicode Braille?
|
||||||
|
API bool notcurses_canbraille(const struct notcurses* nc);
|
||||||
|
|
||||||
// Can we blit to Sixel?
|
// Can we blit to Sixel?
|
||||||
API bool notcurses_cansixel(const struct notcurses* nc);
|
API bool notcurses_cansixel(const struct notcurses* nc);
|
||||||
|
|
||||||
|
@ -2053,6 +2053,10 @@ bool notcurses_cansextant(const notcurses* nc){
|
|||||||
return nc->tcache.sextants && nc->tcache.utf8;
|
return nc->tcache.sextants && nc->tcache.utf8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool notcurses_canbraille(const notcurses* nc){
|
||||||
|
return nc->tcache.braille && nc->tcache.utf8;
|
||||||
|
}
|
||||||
|
|
||||||
bool notcurses_canfade(const notcurses* nc){
|
bool notcurses_canfade(const notcurses* nc){
|
||||||
return nc->tcache.CCCflag || nc->tcache.RGBflag;
|
return nc->tcache.CCCflag || nc->tcache.RGBflag;
|
||||||
}
|
}
|
||||||
|
@ -146,6 +146,9 @@ TEST_CASE("Plot") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SUBCASE("BraillePlot") {
|
SUBCASE("BraillePlot") {
|
||||||
|
if(!notcurses_canbraille(nc_)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
ncplane_options nopts = {
|
ncplane_options nopts = {
|
||||||
.y = 1, .x = 1, .rows = 6, .cols = 50,
|
.y = 1, .x = 1, .rows = 6, .cols = 50,
|
||||||
.userptr = nullptr, .name = "plot", .resizecb = nullptr, .flags = 0,
|
.userptr = nullptr, .name = "plot", .resizecb = nullptr, .flags = 0,
|
||||||
@ -250,6 +253,9 @@ TEST_CASE("Plot") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SUBCASE("BraillePlot1Row") {
|
SUBCASE("BraillePlot1Row") {
|
||||||
|
if(!notcurses_canbraille(nc_)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
ncplane_options nopts = {
|
ncplane_options nopts = {
|
||||||
.y = 1, .x = 1, .rows = 1, .cols = 25,
|
.y = 1, .x = 1, .rows = 1, .cols = 25,
|
||||||
.userptr = nullptr, .name = "plot", .resizecb = nullptr, .flags = 0,
|
.userptr = nullptr, .name = "plot", .resizecb = nullptr, .flags = 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user