c++: deprecate ncplane_new() #1115

This commit is contained in:
nick black 2020-11-13 21:39:16 -05:00 committed by Nick Black
parent a3d9f78612
commit 886835a8b4

View File

@ -69,14 +69,21 @@ namespace ncpp
explicit Plane (int rows, int cols, int yoff, int xoff, void *opaque = nullptr, NotCurses *ncinst = nullptr) explicit Plane (int rows, int cols, int yoff, int xoff, void *opaque = nullptr, NotCurses *ncinst = nullptr)
: Root (ncinst) : Root (ncinst)
{ {
plane = ncplane_new ( struct ncplane_options nopts = {
.y = yoff,
.horiz = {
.x = xoff,
},
.rows = rows,
.cols = cols,
.userptr = opaque,
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
};
plane = ncplane_create (
notcurses_stdplane(get_notcurses ()), notcurses_stdplane(get_notcurses ()),
rows, &nopts
cols,
yoff,
xoff,
opaque,
nullptr
); );
if (plane == nullptr) if (plane == nullptr)
@ -1165,14 +1172,21 @@ namespace ncpp
private: private:
ncplane* create_plane (const Plane &n, int rows, int cols, int yoff, int xoff, void *opaque) ncplane* create_plane (const Plane &n, int rows, int cols, int yoff, int xoff, void *opaque)
{ {
ncplane *ret = ncplane_new ( struct ncplane_options nopts = {
.y = yoff,
.horiz = {
.x = xoff,
},
.rows = rows,
.cols = cols,
.userptr = opaque,
.name = nullptr,
.resizecb = nullptr,
.flags = 0,
};
ncplane *ret = ncplane_create (
n.plane, n.plane,
rows, &nopts
cols,
yoff,
xoff,
opaque,
nullptr
); );
if (ret == nullptr) if (ret == nullptr)