mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
run sgr-full and sgr-direct in test suite #1138
This commit is contained in:
parent
f82ad10667
commit
b7ea4e2359
@ -538,6 +538,14 @@ add_test(
|
|||||||
NAME ncpp_build_exceptions
|
NAME ncpp_build_exceptions
|
||||||
COMMAND ncpp_build_exceptions
|
COMMAND ncpp_build_exceptions
|
||||||
)
|
)
|
||||||
|
add_test(
|
||||||
|
NAME sgr-full
|
||||||
|
COMMAND sgr-full
|
||||||
|
)
|
||||||
|
add_test(
|
||||||
|
NAME sgr-direct
|
||||||
|
COMMAND sgr-direct
|
||||||
|
)
|
||||||
add_test(
|
add_test(
|
||||||
NAME rgb
|
NAME rgb
|
||||||
COMMAND rgb
|
COMMAND rgb
|
||||||
|
2
USAGE.md
2
USAGE.md
@ -1696,7 +1696,7 @@ int cell_duplicate(struct ncplane* n, cell* targ, const cell* c);
|
|||||||
// Release resources held by the cell 'c'.
|
// Release resources held by the cell 'c'.
|
||||||
void cell_release(struct ncplane* n, cell* c);
|
void cell_release(struct ncplane* n, cell* c);
|
||||||
|
|
||||||
#define NCSTYLE_MASK 0xfffful
|
#define NCSTYLE_MASK 0x03fful
|
||||||
#define NCSTYLE_STANDOUT 0x0080ul
|
#define NCSTYLE_STANDOUT 0x0080ul
|
||||||
#define NCSTYLE_UNDERLINE 0x0040ul
|
#define NCSTYLE_UNDERLINE 0x0040ul
|
||||||
#define NCSTYLE_REVERSE 0x0020ul
|
#define NCSTYLE_REVERSE 0x0020ul
|
||||||
|
@ -605,7 +605,7 @@ API int cell_duplicate(struct ncplane* n, cell* targ, const cell* c);
|
|||||||
// Release resources held by the cell 'c'.
|
// Release resources held by the cell 'c'.
|
||||||
API void cell_release(struct ncplane* n, cell* c);
|
API void cell_release(struct ncplane* n, cell* c);
|
||||||
|
|
||||||
#define NCSTYLE_MASK 0xffffu
|
#define NCSTYLE_MASK 0x03ffu
|
||||||
#define NCSTYLE_STANDOUT 0x0080u
|
#define NCSTYLE_STANDOUT 0x0080u
|
||||||
#define NCSTYLE_UNDERLINE 0x0040u
|
#define NCSTYLE_UNDERLINE 0x0040u
|
||||||
#define NCSTYLE_REVERSE 0x0020u
|
#define NCSTYLE_REVERSE 0x0020u
|
||||||
|
@ -3,13 +3,17 @@
|
|||||||
#include <notcurses/notcurses.h>
|
#include <notcurses/notcurses.h>
|
||||||
|
|
||||||
int main(void){
|
int main(void){
|
||||||
struct notcurses* nc = notcurses_init(NULL, NULL);
|
struct notcurses_options nopts = {
|
||||||
|
.flags = NCOPTION_NO_ALTERNATE_SCREEN,
|
||||||
|
};
|
||||||
|
struct notcurses* nc = notcurses_init(&nopts, NULL);
|
||||||
if(nc == NULL){
|
if(nc == NULL){
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
int dimy, dimx;
|
int dimy, dimx;
|
||||||
struct ncplane* n = notcurses_stddim_yx(nc, &dimy, &dimx);
|
struct ncplane* n = notcurses_stddim_yx(nc, &dimy, &dimx);
|
||||||
int y = 0;
|
int y = 0;
|
||||||
|
// FIXME do full permutations?
|
||||||
ncplane_set_styles(n, NCSTYLE_NONE);
|
ncplane_set_styles(n, NCSTYLE_NONE);
|
||||||
ncplane_putstr_yx(n, y++, 0, "a ═ none");
|
ncplane_putstr_yx(n, y++, 0, "a ═ none");
|
||||||
ncplane_set_styles(n, NCSTYLE_ITALIC);
|
ncplane_set_styles(n, NCSTYLE_ITALIC);
|
||||||
@ -23,7 +27,7 @@ int main(void){
|
|||||||
ncplane_set_styles(n, NCSTYLE_BLINK);
|
ncplane_set_styles(n, NCSTYLE_BLINK);
|
||||||
ncplane_putstr_yx(n, y++, 0, "a ═ blink");
|
ncplane_putstr_yx(n, y++, 0, "a ═ blink");
|
||||||
ncplane_set_styles(n, NCSTYLE_STRUCK);
|
ncplane_set_styles(n, NCSTYLE_STRUCK);
|
||||||
ncplane_putstr_yx(n, y++, 0, "a ═ strikethrough");
|
ncplane_putstr_yx(n, y++, 0, "a ═ struck");
|
||||||
ncplane_set_styles(n, NCSTYLE_ITALIC | NCSTYLE_BOLD);
|
ncplane_set_styles(n, NCSTYLE_ITALIC | NCSTYLE_BOLD);
|
||||||
ncplane_putstr_yx(n, y++, 0, "a ═ italic bold");
|
ncplane_putstr_yx(n, y++, 0, "a ═ italic bold");
|
||||||
ncplane_set_styles(n, NCSTYLE_ITALIC | NCSTYLE_REVERSE);
|
ncplane_set_styles(n, NCSTYLE_ITALIC | NCSTYLE_REVERSE);
|
||||||
@ -48,11 +52,14 @@ int main(void){
|
|||||||
ncplane_putstr_yx(n, y++, 0, "a ═ bold underline");
|
ncplane_putstr_yx(n, y++, 0, "a ═ bold underline");
|
||||||
ncplane_set_styles(n, NCSTYLE_BOLD | NCSTYLE_BLINK);
|
ncplane_set_styles(n, NCSTYLE_BOLD | NCSTYLE_BLINK);
|
||||||
ncplane_putstr_yx(n, y++, 0, "a ═ bold blink");
|
ncplane_putstr_yx(n, y++, 0, "a ═ bold blink");
|
||||||
ncplane_putstr_yx(n, y++, 0, "sleeping for 15s...");
|
ncplane_set_styles(n, NCSTYLE_BOLD | NCSTYLE_REVERSE | NCSTYLE_UNDERLINE |
|
||||||
|
NCSTYLE_BLINK | NCSTYLE_ITALIC | NCSTYLE_STRUCK);
|
||||||
|
ncplane_putstr_yx(n, y++, 0, "a ═ whoomp! there it is");
|
||||||
|
|
||||||
|
ncplane_set_styles(n, NCSTYLE_NONE);
|
||||||
if(notcurses_render(nc)){
|
if(notcurses_render(nc)){
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
sleep(15);
|
|
||||||
if(notcurses_stop(nc)){
|
if(notcurses_stop(nc)){
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user