mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
add ncdirect_ascii_box(), use it in DefaultBox unit test
This commit is contained in:
parent
4ca1036da9
commit
0b72bec79d
3
NEWS.md
3
NEWS.md
@ -1,6 +1,9 @@
|
||||
This document attempts to list user-visible changes and any major internal
|
||||
rearrangements of Notcurses.
|
||||
|
||||
* 2.3.4 (not yet released)
|
||||
* Added `ncdirect_ascii_box()`.
|
||||
|
||||
* 2.3.3 (2021-06-12)
|
||||
* Added the flag `NCVISUAL_OPTION_NOINTERPOLATE` to use non-interpolative
|
||||
scaling in `ncvisual_render()`. `ncvisual_render()` without a multimedia
|
||||
|
@ -288,6 +288,13 @@ ncdirect_heavy_box(struct ncdirect* n, uint64_t ul, uint64_t ur,
|
||||
return ncdirect_box(n, ul, ur, ll, lr, NCBOXHEAVYW, ylen, xlen, ctlword);
|
||||
}
|
||||
|
||||
__attribute__ ((nonnull (1))) static inline int
|
||||
ncdirect_ascii_box(struct ncdirect* n, uint64_t ul, uint64_t ur,
|
||||
uint64_t ll, uint64_t lr,
|
||||
int ylen, int xlen, unsigned ctlword){
|
||||
return ncdirect_box(n, ul, ur, ll, lr, NCBOXASCIIW, ylen, xlen, ctlword);
|
||||
}
|
||||
|
||||
// ncdirect_box() with the rounded box-drawing characters
|
||||
API int ncdirect_rounded_box(struct ncdirect* n, uint64_t ul, uint64_t ur,
|
||||
uint64_t ll, uint64_t lr,
|
||||
|
@ -10,11 +10,13 @@ extern "C" {
|
||||
#define NCBOXHEAVY "┏┓┗┛━┃"
|
||||
#define NCBOXROUND "╭╮╰╯─│"
|
||||
#define NCBOXDOUBLE "╔╗╚╝═║"
|
||||
#define NCBOXASCII "/\\\\/-|"
|
||||
// argh
|
||||
#define NCBOXLIGHTW L"┌┐└┘─│"
|
||||
#define NCBOXHEAVYW L"┏┓┗┛━┃"
|
||||
#define NCBOXROUNDW L"╭╮╰╯─│"
|
||||
#define NCBOXDOUBLEW L"╔╗╚╝═║"
|
||||
#define NCBOXASCIIW L"/\\\\/-|"
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
@ -2327,7 +2327,7 @@ API int nccells_rounded_box(struct ncplane* n, uint32_t styles, uint64_t channel
|
||||
static inline int
|
||||
nccells_ascii_box(struct ncplane* n, uint32_t attr, uint64_t channels,
|
||||
nccell* ul, nccell* ur, nccell* ll, nccell* lr, nccell* hl, nccell* vl){
|
||||
return nccells_load_box(n, attr, channels, ul, ur, ll, lr, hl, vl, "/\\\\/-|");
|
||||
return nccells_load_box(n, attr, channels, ul, ur, ll, lr, hl, vl, NCBOXASCII);
|
||||
}
|
||||
|
||||
static inline int
|
||||
|
@ -58,7 +58,7 @@ TEST_CASE("Direct") {
|
||||
ncchannels_set_bg_default(&chans);
|
||||
ncdirect_set_bg_rgb8(nc_, 0x88, 0x88, 0x88);
|
||||
printf("test background\n");
|
||||
CHECK(0 == ncdirect_rounded_box(nc_, chans, chans, chans, chans, 8, 8, 0));
|
||||
CHECK(0 == ncdirect_ascii_box(nc_, chans, chans, chans, chans, 8, 8, 0));
|
||||
}
|
||||
|
||||
#ifndef NOTCURSES_USE_MULTIMEDIA
|
||||
|
Loading…
x
Reference in New Issue
Block a user