ncpile_create() not NCPLANE_OPTION_NEWPILE #1078

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

@ -10,11 +10,10 @@ rearrangements of Notcurses.
or more `ncplane`s, with a bindtree and a z-axis. Different piles can be
mutated or rendered concurrently. There is no new user-visible type: a
`struct notcurses` can be treated as a single pile.
* To create a new pile, pass a `NULL` `n` argument to `ncplane_create()`.
The returned plane will be the top, bottom, and root of a new plane.
Alternatively, use `ncplane_reparent()` or `ncplane_reparent_family()`
with a `NULL` destination.
* To create a new pile from a new plane, use the new function
`ncpile_create()`. The returned plane will be the top, bottom, and root
of a new plane. Alternatively, use `ncplane_reparent()` or
`ncplane_reparent_family()` with the source equal to the destination.
* 2.0.7 (2020-11-21)
* The `horiz` union of `ncplane_options` has been discarded; the `int x`

@ -631,6 +631,7 @@ In addition to its framebuffer--a rectilinear matrix of cells
* a configured user curry (a `void*`),
* its position relative to the visible plane,
* its z-index, and
* an optional resize callback,
* a name (used only for debugging).
If opaque, a `cell` on a higher `ncplane` completely obstructs a corresponding

@ -27,6 +27,8 @@ typedef struct ncplane_options {
**struct ncplane* ncplane_create(struct ncplane* ***n***, const ncplane_options* ***nopts***);**
**struct ncplane* ncpile_create(struct notcurses* ***n***, const ncplane_options* ***nopts***);**
**struct ncplane* notcurses_top(struct notcurses* ***n***);**
**struct ncplane* notcurses_bottom(struct notcurses* ***n***);**
@ -255,8 +257,8 @@ bound to themselves). Multiple threads can concurrently operate on distinct
piles, even changing one while rendering another.
Each plane is part of one and only one pile. By default, a plane is part of the
same pile containing that plane to which it is bound. If the **n** argument
provided to **ncplane_create** is **NULL**, the returned plane becomes the root
same pile containing that plane to which it is bound. If **ncpile_create** is
used in the place of **ncplane_create**, the returned plane becomes the root
plane, top, and bottom of a new pile. As a root plane, it is bound to itself. A
new pile can also be created by reparenting a plane to itself, though if the
plane is already a root plane, this is a no-op.

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

@ -1026,11 +1026,6 @@ 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
@ -1040,7 +1035,6 @@ 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
@ -1050,9 +1044,14 @@ typedef struct ncplane_options {
// retrieved (and reset) later. A 'name' can be set, used in debugging.
API struct ncplane* ncplane_create(struct ncplane* n, const ncplane_options* nopts);
// Same as ncplane_create(), but creates a new pile. The returned plane will
// be the top, bottom, and root of this new pile.
API struct ncplane* ncpile_create(struct notcurses* nc, const ncplane_options* nopts);
// This function will be removed in 3.0 in favor of ncplane_create().
// It persists in 2.0 only for backwards compatibility.
API struct ncplane* ncplane_new(struct ncplane* n, int rows, int cols, int y, int x, void* opaque, const char* name);
API struct ncplane* ncplane_new(struct ncplane* n, int rows, int cols, int y, int x, void* opaque, const char* name)
__attribute__ ((deprecated));
// Suitable for use as a 'resizecb'. This will realign the plane 'n' against its
// parent, using the alignment specified at ncplane_create()-time.

@ -451,7 +451,6 @@ 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){

@ -303,7 +303,7 @@ void free_plane(ncplane* p){
// create a new ncpile. only call with pilelock held.
static ncpile*
ncpile_create(notcurses* nc){
make_ncpile(notcurses* nc){
ncpile* ret = malloc(sizeof(*ret));
if(ret){
ret->nc = nc;
@ -362,7 +362,7 @@ ncplane* ncplane_new_internal(notcurses* nc, ncplane* n,
p->blist = NULL;
p->name = strdup(nopts->name ? nopts->name : "");
p->align = NCALIGN_UNALIGNED;
if(nopts->flags & NCPLANE_OPTION_NEWPILE){
if(!n){ // new root/standard plane
assert(!(nopts->flags & NCPLANE_OPTION_HORALIGNED));
p->absy = nopts->y;
p->absx = nopts->x;
@ -370,7 +370,7 @@ ncplane* ncplane_new_internal(notcurses* nc, ncplane* n,
p->bprev = NULL;
p->boundto = p;
p->align = NCALIGN_UNALIGNED;
}else{ // new root/standard plane
}else{ // bound to preexisting pile
if(nopts->flags & NCPLANE_OPTION_HORALIGNED){
p->absx = ncplane_align(n, nopts->x, nopts->cols);
p->align = nopts->x;
@ -409,7 +409,7 @@ ncplane* ncplane_new_internal(notcurses* nc, ncplane* n,
nc->stats.fbbytes += fbsize;
++nc->stats.planes;
}else{ // new pile
p->pile = ncpile_create(nc);
p->pile = make_ncpile(nc);
p->pile->top = p;
p->pile->bottom = p;
p->below = NULL;
@ -432,7 +432,6 @@ create_initial_ncplane(notcurses* nc, int dimy, int dimx){
.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);
}
@ -445,19 +444,12 @@ 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_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(n ? ncplane_notcurses(n) : nopts->nc, n, nopts);
return ncplane_new_internal(ncplane_notcurses(n), n, nopts);
}
ncplane* ncpile_create(notcurses* nc, const struct ncplane_options* nopts){
return ncplane_new_internal(nc, NULL, nopts);
}
struct ncplane* ncplane_new(struct ncplane* n, int rows, int cols, int y, int x, void* opaque, const char* name){
@ -470,7 +462,6 @@ 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);
}

@ -427,7 +427,6 @@ 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,7 +220,6 @@ 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,
nullptr, "subt", nullptr, 0,
};
marsh->subtitle_plane = ncplane_create(notcurses_stdplane(nc), &nopts);
uint64_t channels = 0;

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

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

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

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

@ -21,7 +21,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -46,7 +45,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -71,7 +69,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -97,7 +94,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -124,7 +120,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -151,7 +146,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -178,7 +172,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -206,7 +199,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -235,7 +227,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -264,7 +255,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -291,7 +281,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -318,7 +307,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -345,7 +333,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -372,7 +359,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -399,7 +385,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -426,7 +411,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -454,7 +438,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -483,7 +466,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -510,7 +492,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -545,7 +526,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -580,7 +560,6 @@ TEST_CASE("TextLayout") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
auto sp = ncplane_create(n_, &nopts);
REQUIRE(sp);
@ -618,7 +597,6 @@ 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, nullptr, 0,
};
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, nullptr, 0,
};
struct ncplane* ncp = ncplane_create(n_, &nopts);
REQUIRE(ncp);
@ -427,10 +427,9 @@ TEST_CASE("NCPlane") {
.x = 0,
.rows = y,
.cols = x,
nullptr, nullptr, nullptr,
NCPLANE_OPTION_NEWPILE, nc_,
nullptr, nullptr, nullptr, 0,
};
struct ncplane* ncp = ncplane_create(nullptr, &nopts);
struct ncplane* ncp = ncpile_create(nc_, &nopts);
REQUIRE(ncp);
int px, py;
ncplane_dim_yx(ncp, &py, &px);
@ -459,7 +458,7 @@ TEST_CASE("NCPlane") {
.x = x,
.rows = maxy,
.cols = maxx,
nullptr, nullptr, nullptr, 0, nullptr,
nullptr, nullptr, nullptr, 0,
};
struct ncplane* newp = ncplane_create(n_, &nopts);
REQUIRE(newp);
@ -505,7 +504,7 @@ TEST_CASE("NCPlane") {
.x = x,
.rows = maxy,
.cols = maxx,
nullptr, nullptr, nullptr, 0, nullptr,
nullptr, nullptr, nullptr, 0,
};
struct ncplane* newp = ncplane_create(n_, &nopts);
REQUIRE(newp);
@ -747,7 +746,7 @@ TEST_CASE("NCPlane") {
.x = ncols - 3,
.rows = 2,
.cols = 2,
nullptr, nullptr, nullptr, 0, nullptr,
nullptr, nullptr, nullptr, 0,
};
struct ncplane* ncp = ncplane_create(n_, &nopts);
REQUIRE(ncp);
@ -769,7 +768,7 @@ TEST_CASE("NCPlane") {
.x = x,
.rows = 2,
.cols = 2,
nullptr, nullptr, nullptr, 0, nullptr,
nullptr, nullptr, nullptr, 0,
};
struct ncplane* ncp = ncplane_create(n_, &nopts);
REQUIRE(ncp);
@ -823,7 +822,7 @@ TEST_CASE("NCPlane") {
.x = 1,
.rows = 2,
.cols = 2,
nullptr, nullptr, nullptr, 0, nullptr,
nullptr, nullptr, nullptr, 0,
};
struct ncplane* n = ncplane_create(n_, &nopts);
REQUIRE(n);
@ -852,7 +851,7 @@ TEST_CASE("NCPlane") {
.x = 1,
.rows = 2,
.cols = 2,
nullptr, nullptr, nullptr, 0, nullptr,
nullptr, nullptr, nullptr, 0,
};
struct ncplane* ndom = ncplane_create(n_, &nopts);
REQUIRE(ndom);
@ -875,7 +874,7 @@ TEST_CASE("NCPlane") {
.x = 1,
.rows = 2,
.cols = 2,
nullptr, nullptr, nullptr, 0, nullptr,
nullptr, nullptr, nullptr, 0,
};
struct ncplane* ndom = ncplane_create(n_, &nopts);
REQUIRE(ndom);
@ -898,7 +897,7 @@ TEST_CASE("NCPlane") {
.x = 1,
.rows = 2,
.cols = 2,
nullptr, nullptr, nullptr, 0, nullptr,
nullptr, nullptr, nullptr, 0,
};
struct ncplane* ndom = ncplane_create(n_, &nopts);
REQUIRE(ndom);
@ -925,7 +924,7 @@ TEST_CASE("NCPlane") {
.x = 1,
.rows = 2,
.cols = 2,
nullptr, nullptr, nullptr, 0, nullptr,
nullptr, nullptr, nullptr, 0,
};
struct ncplane* ndom = ncplane_create(n_, &nopts);
REQUIRE(ndom);

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

@ -23,7 +23,6 @@ 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,7 +299,6 @@ 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, nullptr, 0,
};
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, nullptr, 0,
};
struct ncplane* testn = ncplane_create(n_, &nopts);
REQUIRE(nullptr != testn);

@ -59,7 +59,6 @@ TEST_CASE("Rotate") {
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
.nc = nullptr,
};
struct ncplane* testn = ncplane_create(n_, &nopts);
uint64_t channels = 0;
@ -94,7 +93,6 @@ 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));
@ -113,7 +111,6 @@ 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));
@ -132,7 +129,6 @@ 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));
@ -151,7 +147,6 @@ 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, nullptr, 0,
};
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, nullptr, 0,
};
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, nullptr, 0,
};
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, nullptr, 0,
};
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, nullptr, 0,
};
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, nullptr, 0,
};
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, nullptr, 0,
};
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, nullptr, 0,
};
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, nullptr, 0,
};
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, nullptr, 0,
};
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, nullptr, 0,
};
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, nullptr, 0,
};
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, nullptr, 0,
};
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, nullptr, 0,
};
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, nullptr, 0,
};
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, nullptr, 0,
};
struct ncplane* n = ncplane_create(n_, &nopts);
struct ncselector* ncs = ncselector_create(n, &opts);

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

Loading…
Cancel
Save