mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
c++: deprecate ncplane_new() #1115
This commit is contained in:
parent
a3d9f78612
commit
886835a8b4
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user