diff --git a/NEWS.md b/NEWS.md index 6448e7de3..018bd6f94 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ This document attempts to list user-visible changes and any major internal rearrangements of Notcurses. * 3.0.6 (not yet released) + * Remove the unsafe `ncplane_set_bchannel()` and `ncplane_set_fchannel()`. * 3.0.5 (2022-01-21) * The Hyper and Super modifiers are now supported. CapsLock and NumLock diff --git a/USAGE.md b/USAGE.md index 5a0d53031..f254146fc 100644 --- a/USAGE.md +++ b/USAGE.md @@ -1807,10 +1807,6 @@ all implemented in terms of the lower-level [Channels API](#channels). uint64_t ncplane_channels(const struct ncplane* n); uint16_t ncplane_attr(const struct ncplane* n); -// Set an entire 32-bit channel of the plane 'n' -int ncplane_set_fchannel(struct ncplane* n, uint32_t channel); -int ncplane_set_bchannel(struct ncplane* n, uint32_t channel); - // Extract the 32-bit working background channel from an ncplane. static inline unsigned ncplane_bchannel(const struct ncplane* nc){ diff --git a/include/ncpp/Plane.hh b/include/ncpp/Plane.hh index bc0a88682..48b36ed9b 100644 --- a/include/ncpp/Plane.hh +++ b/include/ncpp/Plane.hh @@ -843,16 +843,6 @@ namespace ncpp return ncplane_fg_alpha (plane); } - uint64_t set_fchannel (uint32_t channel) const noexcept - { - return ncplane_set_fchannel (plane, channel); - } - - uint64_t set_bchannel (uint32_t channel) const noexcept - { - return ncplane_set_bchannel (plane, channel); - } - void set_channels (uint64_t channels) const noexcept { ncplane_set_channels (plane, channels); diff --git a/include/notcurses/notcurses.h b/include/notcurses/notcurses.h index 9fdb6cd24..1cb18d7ce 100644 --- a/include/notcurses/notcurses.h +++ b/include/notcurses/notcurses.h @@ -2903,10 +2903,6 @@ ncplane_bg_rgb8(const struct ncplane* n, unsigned* r, unsigned* g, unsigned* b){ return ncchannels_bg_rgb8(ncplane_channels(n), r, g, b); } -// Set an entire 32-bit channel of the plane -API uint64_t ncplane_set_fchannel(struct ncplane* n, uint32_t channel); -API uint64_t ncplane_set_bchannel(struct ncplane* n, uint32_t channel); - // Set the current fore/background color using RGB specifications. If the // terminal does not support directly-specified 3x8b cells (24-bit "TrueColor", // indicated by the "RGB" terminfo capability), the provided values will be diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 206123a8c..1c889a025 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -1471,14 +1471,6 @@ void ncplane_set_fg_default(ncplane* n){ ncchannels_set_fg_default(&n->channels); } -uint64_t ncplane_set_fchannel(ncplane* n, uint32_t channel){ - return ncchannels_set_fchannel(&n->channels, channel); -} - -uint64_t ncplane_set_bchannel(ncplane* n, uint32_t channel){ - return ncchannels_set_bchannel(&n->channels, channel); -} - void ncplane_set_bg_default(ncplane* n){ ncchannels_set_bg_default(&n->channels); } diff --git a/src/man/main.c b/src/man/main.c index 3d995cbea..4998980c2 100644 --- a/src/man/main.c +++ b/src/man/main.c @@ -315,7 +315,7 @@ putpara(struct ncplane* p, const char* text){ static int draw_domnode(struct ncplane* p, const pagedom* dom, const pagenode* n, unsigned* wrotetext, unsigned* insubsec){ - ncplane_set_fchannel(p, n->ttype->channel); + ncplane_set_fg_rgb(p, ncchannel_rgb(n->ttype->channel)); size_t b = 0; unsigned y; ncplane_cursor_yx(p, &y, NULL);