hook up piles #1078

pull/1134/head
nick black 4 years ago committed by Nick Black
parent de082c7ba2
commit 3ad9a40426

@ -78,6 +78,7 @@ namespace ncpp
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
plane = ncplane_create (
notcurses_stdplane(get_notcurses ()),
@ -1203,6 +1204,7 @@ namespace ncpp
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
ncplane *ret = ncplane_create (
n.plane,
@ -1227,7 +1229,8 @@ namespace ncpp
opaque,
nullptr,
nullptr,
0
0,
nullptr,
};
ncplane *ret = ncplane_create (
n.plane,

@ -1026,6 +1026,11 @@ API char* notcurses_at_yx(struct notcurses* nc, int yoff, int xoff,
// Horizontal alignment relative to the parent plane. Use 'align' instead of 'x'.
#define NCPLANE_OPTION_HORALIGNED 0x0001ull
// Create a new pile with the newly-created plane at its root. The 'n' argument
// ought be NULL, though this is not enforced. When this flag is provided, the
// 'nc' field of the ncplane_options struct must be a valid notcurses context.
#define NCPLANE_OPTION_NEWPILE 0x0002ull
typedef struct ncplane_options {
int y; // vertical placement relative to parent plane
int x; // horizontal placement relative to parent plane
@ -1035,6 +1040,7 @@ typedef struct ncplane_options {
const char* name; // name (used only for debugging), may be NULL
int (*resizecb)(struct ncplane*); // callback when parent is resized
uint64_t flags; // closure over NCPLANE_OPTION_*
struct notcurses* nc; // only needs to be set with NCPLANE_OPTION_NEWPILE
} ncplane_options;
// Create a new ncplane bound to plane 'n', at the offset 'y'x'x' (relative to

@ -451,6 +451,7 @@ int ncdirect_render_image(ncdirect* n, const char* file, ncalign_e align,
.name = "direct",
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
struct ncplane* faken = ncplane_new_internal(nullptr, nullptr, &nopts);
if(faken == nullptr){

@ -362,7 +362,15 @@ ncplane* ncplane_new_internal(notcurses* nc, ncplane* n,
p->blist = NULL;
p->name = strdup(nopts->name ? nopts->name : "");
p->align = NCALIGN_UNALIGNED;
if( (p->boundto = n) ){
if(nopts->flags & NCPLANE_OPTION_NEWPILE){
assert(!(nopts->flags & NCPLANE_OPTION_HORALIGNED));
p->absy = nopts->y;
p->absx = nopts->x;
p->bnext = NULL;
p->bprev = NULL;
p->boundto = p;
p->align = NCALIGN_UNALIGNED;
}else{ // new root/standard plane
if(nopts->flags & NCPLANE_OPTION_HORALIGNED){
p->absx = ncplane_align(n, nopts->x, nopts->cols);
p->align = nopts->x;
@ -377,16 +385,7 @@ ncplane* ncplane_new_internal(notcurses* nc, ncplane* n,
}
p->bprev = &n->blist;
*p->bprev = p;
}else{ // new root plane, new pile
assert(0 == nopts->y);
assert(0 == nopts->x);
p->absx = (nc ? nc->margin_l : 0);
p->absy = (nc ? nc->margin_t : 0);
p->bnext = NULL;
p->bprev = NULL;
p->boundto = p;
p->absx = nopts->x;
p->align = NCALIGN_UNALIGNED;
p->boundto = n;
}
p->resizecb = nopts->resizecb;
p->stylemask = 0;
@ -424,14 +423,16 @@ ncplane* ncplane_new_internal(notcurses* nc, ncplane* n,
// create an ncplane of the specified dimensions, but do not yet place it in
// the z-buffer. clear out all cells. this is for a wholly new context.
// FIXME set up using resizecb rather than special-purpose from SIGWINCH
static ncplane*
create_initial_ncplane(notcurses* nc, int dimy, int dimx){
ncplane_options nopts = {
.y = 0,
.x = 0,
.y = nc->margin_t,
.x = nc->margin_l,
.rows = dimy - (nc->margin_t + nc->margin_b),
.cols = dimx - (nc->margin_l + nc->margin_r),
.name = "std",
.flags = NCPLANE_OPTION_NEWPILE,
};
return nc->stdplane = ncplane_new_internal(nc, NULL, &nopts);
}
@ -444,12 +445,19 @@ const ncplane* notcurses_stdplane_const(const notcurses* nc){
return nc->stdplane;
}
// if n is NULL, nopts must supply nc together with NCPLANE_OPTIONS_NEWPILE
ncplane* ncplane_create(ncplane* n, const ncplane_options* nopts){
if((nopts->flags & NCPLANE_OPTION_HORALIGNED) && !n){
logerror(ncplane_notcurses(n), "Can't align a root plane");
return NULL;
if(nopts->flags & NCPLANE_OPTION_NEWPILE){
if(nopts->flags & NCPLANE_OPTION_HORALIGNED){
logerror(ncplane_notcurses(n), "Can't align a root plane");
return NULL;
}
}else{
if(!n){
return NULL; // can't log, no n nor nc :/
}
}
return ncplane_new_internal(ncplane_notcurses(n), n, nopts);
return ncplane_new_internal(n ? ncplane_notcurses(n) : nopts->nc, n, nopts);
}
struct ncplane* ncplane_new(struct ncplane* n, int rows, int cols, int y, int x, void* opaque, const char* name){
@ -462,6 +470,7 @@ struct ncplane* ncplane_new(struct ncplane* n, int rows, int cols, int y, int x,
.name = name,
.resizecb = NULL,
.flags = 0,
.nc = NULL,
};
return ncplane_create(n, &nopts);
}
@ -818,12 +827,22 @@ init_banner(const notcurses* nc){
printf("\n notcurses %s by nick black et al", notcurses_version());
term_fg_palindex(nc, stdout, nc->tcache.colors <= 256 ? 12 % nc->tcache.colors : 0x2080e0);
printf("\n %d rows %d cols (%sB) %zuB cells %d colors%s\n"
" compiled with gcc-%s\n"
" compiled with gcc-%s, %s-endian\n"
" terminfo from %s\n",
nc->stdplane->leny, nc->stdplane->lenx,
bprefix(nc->stats.fbbytes, 1, prefixbuf, 0), sizeof(cell),
nc->tcache.colors, nc->tcache.RGBflag ? "+RGB" : "",
__VERSION__, curses_version());
__VERSION__,
#ifdef __BYTE_ORDER__
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
"little"
#else
"big"
#endif
#else
#error "No __BYTE_ORDER__ definition"
#endif
, curses_version());
#ifdef USE_FFMPEG
printf(" avformat %u.%u.%u avutil %u.%u.%u swscale %u.%u.%u\n",
LIBAVFORMAT_VERSION_MAJOR, LIBAVFORMAT_VERSION_MINOR, LIBAVFORMAT_VERSION_MICRO,

@ -427,6 +427,7 @@ auto ncvisual_render(notcurses* nc, ncvisual* ncv,
.name = "vis",
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
if((n = ncplane_create(notcurses_stdplane(nc), &nopts)) == nullptr){
return nullptr;

@ -220,6 +220,7 @@ int main(int argc, char** argv){
.name = "reel",
.resizecb = resize_reel,
.flags = NCPLANE_OPTION_HORALIGNED,
.nc = nullptr,
};
n = ncplane_create(nstd, &nopts);
if(!n){

@ -89,7 +89,7 @@ auto perframe(struct ncvisual* ncv, struct ncvisual_options* vopts,
.x = 0,
.rows = 1,
.cols = dimx,
nullptr, "subt", nullptr, 0,
nullptr, "subt", nullptr, 0, nullptr,
};
marsh->subtitle_plane = ncplane_create(notcurses_stdplane(nc), &nopts);
uint64_t channels = 0;

@ -26,6 +26,7 @@ TEST_CASE("Blitting") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto ncp = ncplane_create(n_, &nopts);
REQUIRE(nullptr != ncp);
@ -74,6 +75,7 @@ TEST_CASE("Blitting") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto ncp = ncplane_create(n_, &nopts);
REQUIRE(nullptr != ncp);

@ -161,6 +161,7 @@ TEST_CASE("Cell") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto np = ncplane_create(n_, &nopts);
REQUIRE(nullptr != np);
@ -200,6 +201,7 @@ TEST_CASE("Cell") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto np = ncplane_create(n_, &nopts);
REQUIRE(nullptr != np);
@ -239,6 +241,7 @@ TEST_CASE("Cell") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto np = ncplane_create(n_, &nopts);
REQUIRE(nullptr != np);
@ -278,6 +281,7 @@ TEST_CASE("Cell") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto np = ncplane_create(n_, &nopts);
REQUIRE(nullptr != np);
@ -318,6 +322,7 @@ TEST_CASE("Cell") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto np = ncplane_create(n_, &nopts);
REQUIRE(nullptr != np);

@ -43,6 +43,7 @@ TEST_CASE("Fills") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
struct ncplane* pfn = ncplane_create(n_, &nopts);
REQUIRE(nullptr != pfn);
@ -75,6 +76,7 @@ TEST_CASE("Fills") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
struct ncplane* pfn = ncplane_create(n_, &nopts);
REQUIRE(nullptr != pfn);
@ -94,6 +96,7 @@ TEST_CASE("Fills") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
struct ncplane* pfn = ncplane_create(n_, &nopts);
REQUIRE(nullptr != pfn);
@ -365,6 +368,7 @@ TEST_CASE("Fills") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
struct ncplane* p1 = ncplane_create(n_, &nopts);
REQUIRE(p1);
@ -409,6 +413,7 @@ TEST_CASE("Fills") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto p1 = ncplane_create(n_, &nopts);
REQUIRE(p1);
@ -463,6 +468,7 @@ TEST_CASE("Fills") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
struct ncplane* p1 = ncplane_create(n_, &nopts);
REQUIRE(p1);
@ -481,6 +487,7 @@ TEST_CASE("Fills") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto p2 = ncplane_create(n_, &n2opts);
REQUIRE(p2);
@ -522,6 +529,7 @@ TEST_CASE("Fills") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
struct ncplane* p1 = ncplane_create(n_, &nopts);
REQUIRE(p1);
@ -540,6 +548,7 @@ TEST_CASE("Fills") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto p2 = ncplane_create(n_, &n2opts);
REQUIRE(p2);

@ -33,6 +33,7 @@ TEST_CASE("Geometry") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto n = ncplane_create(n_, &nopts);
REQUIRE(n);
@ -79,6 +80,7 @@ TEST_CASE("Geometry") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto n = ncplane_create(n_, &nopts);
REQUIRE(n);

@ -21,6 +21,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -45,6 +46,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -69,6 +71,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -94,6 +97,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -120,6 +124,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -146,6 +151,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -172,6 +178,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -199,6 +206,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -227,6 +235,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -255,6 +264,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -281,6 +291,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -307,6 +318,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -333,6 +345,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -359,6 +372,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -385,6 +399,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -411,6 +426,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -438,6 +454,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -466,6 +483,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -492,6 +510,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -526,6 +545,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -560,6 +580,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -597,6 +618,7 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);

@ -379,7 +379,7 @@ TEST_CASE("NCPlane") {
.rows = y,
.cols = x,
.userptr = sentinel,
nullptr, nullptr, 0,
nullptr, nullptr, 0, nullptr,
};
struct ncplane* ncp = ncplane_create(n_, &nopts);
REQUIRE(ncp);
@ -402,7 +402,7 @@ TEST_CASE("NCPlane") {
.x = 0,
.rows = y,
.cols = x,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* ncp = ncplane_create(n_, &nopts);
REQUIRE(ncp);
@ -417,6 +417,39 @@ TEST_CASE("NCPlane") {
CHECK(0 == ncplane_destroy(ncp));
}
// create a new plane, the same size as the terminal, and verify that it
// occupies the same dimensions as the standard plane, but on another pile.
SUBCASE("NewPileSameSize") {
int x, y;
notcurses_term_dim_yx(nc_, &y, &x);
struct ncplane_options nopts = {
.y = 0,
.x = 0,
.rows = y,
.cols = x,
nullptr, nullptr, nullptr,
NCPLANE_OPTION_NEWPILE, nc_,
};
struct ncplane* ncp = ncplane_create(nullptr, &nopts);
REQUIRE(ncp);
int px, py;
ncplane_dim_yx(ncp, &py, &px);
CHECK(y == py);
CHECK(x == px);
int sx, sy;
ncplane_dim_yx(n_, &sy, &sx);
CHECK(sy == py);
CHECK(sx == px);
// ensure that the new plane is not on our zaxis
CHECK(notcurses_top(nc_) == n_);
CHECK(notcurses_bottom(nc_) == n_);
// ensure the new plane has null above and below, and is bound to itself
CHECK(ncplane_above(ncp) == nullptr);
CHECK(ncplane_below(ncp) == nullptr);
CHECK(ncplane_parent_const(ncp) == ncp);
CHECK(0 == ncplane_destroy(ncp));
}
SUBCASE("ShrinkPlane") {
int maxx, maxy;
int x = 0, y = 0;
@ -426,7 +459,7 @@ TEST_CASE("NCPlane") {
.x = x,
.rows = maxy,
.cols = maxx,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* newp = ncplane_create(n_, &nopts);
REQUIRE(newp);
@ -472,7 +505,7 @@ TEST_CASE("NCPlane") {
.x = x,
.rows = maxy,
.cols = maxx,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* newp = ncplane_create(n_, &nopts);
REQUIRE(newp);
@ -714,7 +747,7 @@ TEST_CASE("NCPlane") {
.x = ncols - 3,
.rows = 2,
.cols = 2,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* ncp = ncplane_create(n_, &nopts);
REQUIRE(ncp);
@ -736,7 +769,7 @@ TEST_CASE("NCPlane") {
.x = x,
.rows = 2,
.cols = 2,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* ncp = ncplane_create(n_, &nopts);
REQUIRE(ncp);
@ -790,7 +823,7 @@ TEST_CASE("NCPlane") {
.x = 1,
.rows = 2,
.cols = 2,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* n = ncplane_create(n_, &nopts);
REQUIRE(n);
@ -819,7 +852,7 @@ TEST_CASE("NCPlane") {
.x = 1,
.rows = 2,
.cols = 2,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* ndom = ncplane_create(n_, &nopts);
REQUIRE(ndom);
@ -842,7 +875,7 @@ TEST_CASE("NCPlane") {
.x = 1,
.rows = 2,
.cols = 2,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* ndom = ncplane_create(n_, &nopts);
REQUIRE(ndom);
@ -865,7 +898,7 @@ TEST_CASE("NCPlane") {
.x = 1,
.rows = 2,
.cols = 2,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* ndom = ncplane_create(n_, &nopts);
REQUIRE(ndom);
@ -892,7 +925,7 @@ TEST_CASE("NCPlane") {
.x = 1,
.rows = 2,
.cols = 2,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* ndom = ncplane_create(n_, &nopts);
REQUIRE(ndom);

@ -80,6 +80,7 @@ TEST_CASE("NotcursesBase") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
planes[idx] = ncplane_create(notcurses_stdplane(nc_), &nopts);
REQUIRE(planes[idx]);

@ -23,6 +23,7 @@ TEST_CASE("Readers") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto ncp = ncplane_create(notcurses_stdplane(nc_), &nopts);
uint64_t echannels = CHANNELS_RGB_INITIALIZER(0xff, 0x44, 0xff, 0, 0, 0);

@ -299,6 +299,7 @@ TEST_CASE("Reels") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto ncp = ncplane_create(n_, &nopts);
REQUIRE(nullptr != ncp);

@ -28,7 +28,7 @@ TEST_CASE("Resize") {
.x = 0,
.rows = y,
.cols = x,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* testn = ncplane_create(n_, &nopts);
REQUIRE(nullptr != testn);
@ -52,7 +52,7 @@ TEST_CASE("Resize") {
.x = 0,
.rows = y,
.cols = x,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* testn = ncplane_create(n_, &nopts);
REQUIRE(nullptr != testn);

@ -59,6 +59,7 @@ TEST_CASE("Rotate") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
struct ncplane* testn = ncplane_create(n_, &nopts);
uint64_t channels = 0;
@ -93,6 +94,7 @@ TEST_CASE("Rotate") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
struct ncplane* testn = ncplane_create(n_, &nopts);
REQUIRE(0 < ncplane_gradient_sized(testn, " ", 0, ul, ur, ll, lr, 8, 16));
@ -111,6 +113,7 @@ TEST_CASE("Rotate") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
struct ncplane* testn = ncplane_create(n_, &nopts);
REQUIRE(0 < ncplane_gradient_sized(testn, " ", 0, ul, ur, ll, lr, 8, 32));
@ -129,6 +132,7 @@ TEST_CASE("Rotate") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
struct ncplane* testn = ncplane_create(n_, &nopts);
REQUIRE(0 < ncplane_gradient_sized(testn, " ", 0, ul, ur, ll, lr, 8, 16));
@ -147,6 +151,7 @@ TEST_CASE("Rotate") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
struct ncplane* testn = ncplane_create(n_, &nopts);
REQUIRE(0 < ncplane_gradient_sized(testn, " ", 0, ul, ur, ll, lr, 8, 32));

@ -24,7 +24,7 @@ TEST_CASE("Scrolling") {
.x = 1,
.rows = 2,
.cols = 20,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* n = ncplane_create(n_, &nopts);
REQUIRE(n);
@ -53,7 +53,7 @@ TEST_CASE("Scrolling") {
.x = 1,
.rows = 2,
.cols = 20,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* n = ncplane_create(n_, &nopts);
REQUIRE(n);
@ -74,7 +74,7 @@ TEST_CASE("Scrolling") {
.x = 1,
.rows = 2,
.cols = 20,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* n = ncplane_create(n_, &nopts);
REQUIRE(n);
@ -101,7 +101,7 @@ TEST_CASE("Scrolling") {
.x = 1,
.rows = 2,
.cols = 20,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* n = ncplane_create(n_, &nopts);
REQUIRE(n);
@ -140,7 +140,7 @@ TEST_CASE("Scrolling") {
.x = 1,
.rows = 4,
.cols = 20,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* n = ncplane_create(n_, &nopts);
REQUIRE(n);
@ -164,7 +164,7 @@ TEST_CASE("Scrolling") {
.x = 1,
.rows = 2,
.cols = 20,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* n = ncplane_create(n_, &nopts);
REQUIRE(n);
@ -224,7 +224,7 @@ TEST_CASE("Scrolling") {
.x = 1,
.rows = 2,
.cols = 20,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* n = ncplane_create(n_, &nopts);
REQUIRE(n);

@ -18,7 +18,7 @@ TEST_CASE("Selectors") {
.x = 0,
.rows = 1,
.cols = 1,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* n = ncplane_create(n_, &nopts);
struct ncselector* ncs = ncselector_create(n, &opts);
@ -42,7 +42,7 @@ TEST_CASE("Selectors") {
.x = 0,
.rows = 1,
.cols = 1,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* n = ncplane_create(n_, &nopts);
struct ncselector* ncs = ncselector_create(n, &opts);
@ -65,7 +65,7 @@ TEST_CASE("Selectors") {
.x = 0,
.rows = 1,
.cols = 1,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* n = ncplane_create(n_, &nopts);
struct ncselector* ncs = ncselector_create(n, &opts);
@ -88,7 +88,7 @@ TEST_CASE("Selectors") {
.x = 0,
.rows = 1,
.cols = 1,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* n = ncplane_create(n_, &nopts);
struct ncselector* ncs = ncselector_create(n, &opts);
@ -117,7 +117,7 @@ TEST_CASE("Selectors") {
.x = 0,
.rows = 1,
.cols = 1,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* n = ncplane_create(n_, &nopts);
struct ncselector* ncs = ncselector_create(n, &opts);
@ -139,7 +139,7 @@ TEST_CASE("Selectors") {
.x = 0,
.rows = 1,
.cols = 1,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* n = ncplane_create(n_, &nopts);
struct ncselector* ncs = ncselector_create(n, &opts);
@ -170,7 +170,7 @@ TEST_CASE("Selectors") {
.x = 0,
.rows = 1,
.cols = 1,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* n = ncplane_create(n_, &nopts);
struct ncselector* ncs = ncselector_create(n, &opts);
@ -216,7 +216,7 @@ TEST_CASE("Selectors") {
.x = 0,
.rows = 1,
.cols = 1,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* n = ncplane_create(n_, &nopts);
struct ncselector* ncs = ncselector_create(n, &opts);
@ -267,7 +267,7 @@ TEST_CASE("Selectors") {
.x = 0,
.rows = 1,
.cols = 1,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* n = ncplane_create(n_, &nopts);
struct ncselector* ncs = ncselector_create(n, &opts);

@ -231,6 +231,7 @@ TEST_CASE("Wide") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
struct ncplane* ncp = ncplane_create(n_, &nopts);
REQUIRE(ncp);
@ -355,6 +356,7 @@ TEST_CASE("Wide") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
struct ncplane* n = ncplane_create(n_, &nopts);
REQUIRE(n);
@ -402,6 +404,7 @@ TEST_CASE("Wide") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
struct ncplane* p = ncplane_create(n_, &nopts);
REQUIRE(nullptr != p);
@ -451,6 +454,7 @@ TEST_CASE("Wide") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
struct ncplane* topp = ncplane_create(n_, &nopts);
REQUIRE(nullptr != topp);
@ -635,6 +639,7 @@ TEST_CASE("Wide") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
struct ncplane* topp = ncplane_create(n_, &nopts);
REQUIRE(nullptr != topp);
@ -790,6 +795,7 @@ TEST_CASE("Wide") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
struct ncplane* topp = ncplane_create(n_, &nopts);
REQUIRE(nullptr != topp);
@ -984,6 +990,7 @@ TEST_CASE("Wide") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto high = ncplane_create(n_, &nopts);
REQUIRE(nullptr != high);

@ -31,7 +31,7 @@ TEST_CASE("ZAxis") {
.x = 0,
.rows = 2,
.cols = 2,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* np = ncplane_create(n_, &nopts);
REQUIRE(np);
@ -48,7 +48,7 @@ TEST_CASE("ZAxis") {
.x = 0,
.rows = 2,
.cols = 2,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* np = ncplane_create(n_, &nopts);
REQUIRE(np);
@ -65,7 +65,7 @@ TEST_CASE("ZAxis") {
.x = 0,
.rows = 2,
.cols = 2,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* np = ncplane_create(n_, &nopts);
REQUIRE(np);
@ -88,7 +88,7 @@ TEST_CASE("ZAxis") {
.x = 0,
.rows = 2,
.cols = 2,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* np = ncplane_create(n_, &nopts);
REQUIRE(np);
@ -120,7 +120,7 @@ TEST_CASE("ZAxis") {
.x = 0,
.rows = 2,
.cols = 2,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
struct ncplane* n2 = ncplane_create(n_, &nopts);
REQUIRE(1 == cell_load(n2, &c, "y"));
@ -151,7 +151,7 @@ TEST_CASE("ZAxis") {
.x = 1,
.rows = 1,
.cols = 1,
nullptr, nullptr, nullptr, 0,
nullptr, nullptr, nullptr, 0, nullptr,
};
auto p = ncplane_create(n_, &nopts);
REQUIRE(nullptr != p);

Loading…
Cancel
Save