From 1c188508d4324feb82007d29a3825953dd962cb4 Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 4 Dec 2020 17:41:29 -0500 Subject: [PATCH] add a 1x1 run to widestomp PoC --- src/poc/widestomp.cpp | 60 ++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/src/poc/widestomp.cpp b/src/poc/widestomp.cpp index 5cdd358a0..9a1a74057 100644 --- a/src/poc/widestomp.cpp +++ b/src/poc/widestomp.cpp @@ -49,36 +49,44 @@ auto main() -> int { NotCurses nc(nopts); std::shared_ptr n(nc.get_stdplane()); - // first, a 2x1 with "AB" - auto nn = std::make_shared(1, 2, 1, 16); - nn->set_fg_rgb8(0xc0, 0x80, 0xc0); - nn->set_bg_rgb8(0x20, 0x00, 0x20); - nn->set_base("", 0, CHANNELS_RGB_INITIALIZER(0xc0, 0x80, 0xc0, 0x20, 0, 0x20)); - nn->putstr("AB"); - - n->set_fg_rgb8(0x80, 0xc0, 0x80); - n->set_bg_rgb8(0x00, 0x40, 0x00); - n->putstr("\xe5\xbd\xa2\xe5\x85\xa8"); - n->putstr(1, 0, "\xe5\xbd\xa2\xe5\x85\xa8"); - n->putstr(2, 0, "\xe5\xbd\xa2\xe5\x85\xa8"); - n->putstr(3, 0, "\xe5\xbd\xa2\xe5\x85\xa8"); - n->putstr(4, 0, "abcdef"); - n->putstr(5, 0, "abcdef"); - n->putstr(6, 0, "abcdef"); - n->putstr(7, 0, "abcdef"); - nc.render(); - sleep(1); - - stomper(nc, nn); - if(nn->putstr(0, 0, "\xe5\xbd\xa1") <= 0){ - return EXIT_FAILURE; + { + // first, a 2x1 with "AB" + auto nn = std::make_shared(1, 2, 1, 16); + nn->set_fg_rgb8(0xc0, 0x80, 0xc0); + nn->set_bg_rgb8(0x20, 0x00, 0x20); + nn->set_base("", 0, CHANNELS_RGB_INITIALIZER(0xc0, 0x80, 0xc0, 0x20, 0, 0x20)); + nn->putstr("AB"); + + n->set_fg_rgb8(0x80, 0xc0, 0x80); + n->set_bg_rgb8(0x00, 0x40, 0x00); + n->putstr("\xe5\xbd\xa2\xe5\x85\xa8"); + n->putstr(1, 0, "\xe5\xbd\xa2\xe5\x85\xa8"); + n->putstr(2, 0, "\xe5\xbd\xa2\xe5\x85\xa8"); + n->putstr(3, 0, "\xe5\xbd\xa2\xe5\x85\xa8"); + n->putstr(4, 0, "abcdef"); + n->putstr(5, 0, "abcdef"); + n->putstr(6, 0, "abcdef"); + n->putstr(7, 0, "abcdef"); + nc.render(); + sleep(1); + + stomper(nc, nn); + if(nn->putstr(0, 0, "\xe5\xbd\xa1") <= 0){ + return EXIT_FAILURE; + } + stomper(nc, nn); + nn->erase(); + if(nn->putstr(0, 0, "r") <= 0){ + return EXIT_FAILURE; + } + stomper(nc, nn); } - stomper(nc, nn); - nn->erase(); + + // now a 1x1 "*" + auto nn = std::make_shared(1, 1, 1, 16); if(nn->putstr(0, 0, "r") <= 0){ return EXIT_FAILURE; } stomper(nc, nn); - return EXIT_SUCCESS; }