uniblock: restore backgrounds

This commit is contained in:
nick black 2019-12-05 04:18:43 -05:00
parent 3c93030177
commit bacc69380a
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
4 changed files with 5 additions and 25 deletions

View File

@ -207,11 +207,6 @@ notcurses_getc_blocking(struct notcurses* n, cell* c, ncspecial_key* nkey){
return notcurses_getc(n, c, nkey, NULL, &sigmask);
}
// Add this escape sequence to the trie, resolving to the specified specialkey.
// Exported mainly for the benefit of unit tests.
API int notcurses_add_input_escape(struct notcurses* nc, const char* esc,
ncspecial_key special);
// Refresh our idea of the terminal's dimensions, reshaping the standard plane
// if necessary. Without a call to this function following a terminal resize
// (as signaled via SIGWINCH), notcurses_render() might not function properly.

View File

@ -104,24 +104,25 @@ int unicodeblocks_demo(struct notcurses* nc){
if(ncplane_printf(n, "Unicode points %05x%05x", blockstart, blockstart + BLOCKSIZE) <= 0){
return -1;
}
int xstart = (maxx - CHUNKSIZE * 2) / 2;
int xstart = (maxx - (CHUNKSIZE * 2 + 2)) / 2;
if(ncplane_cursor_move_yx(n, 3, xstart)){
return -1;
}
++xstart;
cell ul = CELL_TRIVIAL_INITIALIZER, ur = CELL_TRIVIAL_INITIALIZER;
cell ll = CELL_TRIVIAL_INITIALIZER, lr = CELL_TRIVIAL_INITIALIZER;
cell hl = CELL_TRIVIAL_INITIALIZER, vl = CELL_TRIVIAL_INITIALIZER;
cells_rounded_box(n, 0, 0, &ul, &ur, &ll, &lr, &hl, &vl);
cell_set_bg(&hl, 0, 0, 0);
cell_set_bg(&vl, 0, 0, 0);
if(ncplane_rounded_box_sized(n, 0, 0, BLOCKSIZE / CHUNKSIZE + 2, (CHUNKSIZE * 2) + 2, 0)){
if(ncplane_box_sized(n, &ul, &ur, &ll, &lr, &hl, &vl,
BLOCKSIZE / CHUNKSIZE + 2,
(CHUNKSIZE * 2) + 2, 0)){
return -1;
}
cell_release(n, &ul); cell_release(n, &ur); cell_release(n, &hl);
cell_release(n, &ll); cell_release(n, &lr); cell_release(n, &vl);
for(chunk = 0 ; chunk < BLOCKSIZE / CHUNKSIZE ; ++chunk){
if(ncplane_cursor_move_yx(n, 4 + chunk, xstart)){
if(ncplane_cursor_move_yx(n, 4 + chunk, xstart + 1)){
return -1;
}
int z;

View File

@ -17,15 +17,6 @@ view_video_demo(struct notcurses* nc){
return -1;
}
ncvisual_destroy(ncv);
ncv = ncplane_visual_open(ncp, "../tests/atliens.mkv", &averr);
if(!ncv){
return -1;
}
if(ncvisual_stream(nc, ncv, &averr)){
ncvisual_destroy(ncv);
return -1;
}
ncvisual_destroy(ncv);
return 0;
}

View File

@ -104,10 +104,3 @@ TEST_F(NotcursesTest, TileScreenWithPlanes) {
delete[] planes;
ASSERT_EQ(0, notcurses_render(nc_));
}
// build a trie up from terminfo(5)-style escape sequences
TEST_F(NotcursesTest, InputEscapesTrie) {
const char* khome = "\x1bOH";
ASSERT_EQ(0, notcurses_add_input_escape(nc_, khome, NCKEY_HOME));
// FIXME need be able to lookup
}