Skip to content

Commit

Permalink
kill ncplane_new() #1777
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Oct 11, 2021
1 parent 0a83c18 commit 635ad55
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 51 deletions.
2 changes: 1 addition & 1 deletion doc/man/man3/notcurses.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Following initialization, a single ncplane exists, the "standard plane" (see
**notcurses_stdplane(3)**). This plane cannot be destroyed nor manually resized,
and is always exactly as large as the screen (if run without a TTY, the "screen"
is assumed to be 80x24 cells). Further ncplanes can be created with
**ncplane_new(3)**. A total z-ordering always exists on the set of ncplanes,
**ncplane_create(3)**. A total z-ordering always exists on the set of ncplanes,
and new ncplanes are placed at the top of the z-buffer. Ncplanes can be larger,
smaller, or the same size as the physical screen, and can be placed anywhere
relative to it (including entirely off-screen). Ncplanes are made up of
Expand Down
3 changes: 0 additions & 3 deletions doc/man/man3/notcurses_plane.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,6 @@ All other functions cannot fail (and return **void**).
# NOTES
**ncplane_new** is defined as a deprecated wrapper around **ncplane_create**.
It should not be used in new code.
# BUGS
**ncplane_at_yx** doesn't yet account for bitmap-based graphics (see
Expand Down
19 changes: 0 additions & 19 deletions include/notcurses/notcurses.h
Original file line number Diff line number Diff line change
Expand Up @@ -4090,32 +4090,13 @@ __attribute__ ((deprecated)) API int cell_duplicate(struct ncplane* n, nccell* t

__attribute__ ((deprecated)) API void cell_release(struct ncplane* n, nccell* c);

// This function will be removed in ABI3 in favor of ncplane_create().
// It persists in ABI2 only for backwards compatibility.
API ALLOC struct ncplane* ncplane_new(struct ncplane* n, int rows, int cols, int y, int x, void* opaque, const char* name)
__attribute__ ((deprecated));

API void ncplane_styles_set(struct ncplane* n, unsigned stylebits)
__attribute__ ((deprecated));
API void ncplane_styles_on(struct ncplane* n, unsigned stylebits)
__attribute__ ((deprecated));
API void ncplane_styles_off(struct ncplane* n, unsigned stylebits)
__attribute__ ((deprecated));

__attribute__ ((deprecated)) API int
cells_rounded_box(struct ncplane* n, uint32_t styles, uint64_t channels,
nccell* ul, nccell* ur, nccell* ll,
nccell* lr, nccell* hl, nccell* vl);

__attribute__ ((deprecated)) API int
cells_double_box(struct ncplane* n, uint32_t styles, uint64_t channels,
nccell* ul, nccell* ur, nccell* ll,
nccell* lr, nccell* hl, nccell* vl);

// Deprecated form of nctablet_plane().
API struct ncplane* nctablet_ncplane(struct nctablet* t)
__attribute__ ((deprecated));

#undef API
#undef ALLOC

Expand Down
24 changes: 0 additions & 24 deletions src/lib/notcurses.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,20 +583,6 @@ 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){
ncplane_options nopts = {
.y = y,
.x = x,
.rows = rows,
.cols = cols,
.userptr = opaque,
.name = name,
.resizecb = NULL,
.flags = 0,
};
return ncplane_create(n, &nopts);
}

void ncplane_home(ncplane* n){
n->x = 0;
n->y = 0;
Expand Down Expand Up @@ -2994,11 +2980,6 @@ int nccells_double_box(ncplane* n, uint32_t attr, uint64_t channels,
return nccells_ascii_box(n, attr, channels, ul, ur, ll, lr, hl, vl);
}

int cells_double_box(ncplane* n, uint32_t attr, uint64_t channels,
nccell* ul, nccell* ur, nccell* ll, nccell* lr, nccell* hl, nccell* vl){
return nccells_double_box(n, attr, channels, ul, ur, ll, lr, hl, vl);
}

int nccells_rounded_box(ncplane* n, uint32_t attr, uint64_t channels,
nccell* ul, nccell* ur, nccell* ll, nccell* lr, nccell* hl, nccell* vl){
if(notcurses_canutf8(ncplane_notcurses(n))){
Expand All @@ -3007,11 +2988,6 @@ int nccells_rounded_box(ncplane* n, uint32_t attr, uint64_t channels,
return nccells_ascii_box(n, attr, channels, ul, ur, ll, lr, hl, vl);
}

int cells_rounded_box(ncplane* n, uint32_t attr, uint64_t channels,
nccell* ul, nccell* ur, nccell* ll, nccell* lr, nccell* hl, nccell* vl){
return nccells_rounded_box(n, attr, channels, ul, ur, ll, lr, hl, vl);
}

// find the center coordinate of a plane, preferring the top/left in the
// case of an even number of rows/columns (in such a case, there will be one
// more cell to the bottom/right of the center than the top/left). the
Expand Down
4 changes: 0 additions & 4 deletions src/lib/reel.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,10 +749,6 @@ ncplane* nctablet_plane(nctablet* t){
return t->cbp;
}

ncplane* nctablet_ncplane(nctablet* t){ // deprecated
return nctablet_plane(t);
}

ncplane* ncreel_plane(ncreel* nr){
return nr->p;
}
Expand Down

0 comments on commit 635ad55

Please sign in to comment.