From 886835a8b4e17450ba93265e5ad67bb9aa877d88 Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 13 Nov 2020 21:39:16 -0500 Subject: [PATCH] c++: deprecate ncplane_new() #1115 --- include/ncpp/Plane.hh | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/include/ncpp/Plane.hh b/include/ncpp/Plane.hh index 1272fedd4..70c4f99a4 100644 --- a/include/ncpp/Plane.hh +++ b/include/ncpp/Plane.hh @@ -69,14 +69,21 @@ namespace ncpp explicit Plane (int rows, int cols, int yoff, int xoff, void *opaque = nullptr, NotCurses *ncinst = nullptr) : 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 ()), - rows, - cols, - yoff, - xoff, - opaque, - nullptr + &nopts ); if (plane == nullptr) @@ -1165,14 +1172,21 @@ namespace ncpp private: 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, - rows, - cols, - yoff, - xoff, - opaque, - nullptr + &nopts ); if (ret == nullptr)