[ncplanes] remove ncplane_set_[bf]channel() #2571

This commit is contained in:
nick black 2022-01-23 17:46:04 -05:00
parent 4e0428dfcc
commit e33cb62de9
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
6 changed files with 2 additions and 27 deletions

View File

@ -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

View File

@ -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){

View File

@ -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);

View File

@ -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

View File

@ -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);
}

View File

@ -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);