cell_extract() -> nccell_extract()

This commit is contained in:
nick black 2021-04-14 10:30:22 -04:00
parent da2a897544
commit 32500239ac
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
4 changed files with 11 additions and 5 deletions

View File

@ -6,7 +6,7 @@ rearrangements of Notcurses.
function `nccell_extended_gcluster()`, which the former now wraps.
It will be removed in ABI3. The same treatment has been applied to
`cell_load_egc32()`, `cell_load_char()`, `cellcmp()`, `cell_init()`,
`cell_load()`, and `cell_prime()`.
`cell_extract()`, `cell_load()`, and `cell_prime()`.
* 2.2.6 (2021-04-12)
* `ncplane_rgba()` has been deprecated in favor of the new function

View File

@ -1198,7 +1198,7 @@ namespace ncpp
char* extract (Cell const& cell, uint16_t *stylemask = nullptr, uint64_t *channels = nullptr)
{
return cell_extract (plane, cell, stylemask, channels);
return nccell_extract (plane, cell, stylemask, channels);
}
// FIXME these can except if fed a sprixel, right (returns NULL)?

View File

@ -828,8 +828,8 @@ cell_strdup(const struct ncplane* n, const nccell* c){
// Extract the three elements of a nccell.
static inline char*
cell_extract(const struct ncplane* n, const nccell* c,
uint16_t* stylemask, uint64_t* channels){
nccell_extract(const struct ncplane* n, const nccell* c,
uint16_t* stylemask, uint64_t* channels){
if(stylemask){
*stylemask = c->stylemask;
}
@ -839,6 +839,12 @@ cell_extract(const struct ncplane* n, const nccell* c,
return nccell_strdup(n, c);
}
__attribute__ ((deprecated)) static inline char*
cell_extract(const struct ncplane* n, const nccell* c,
uint16_t* stylemask, uint64_t* channels){
return nccell_extract(n, c, stylemask, channels);
}
// Returns true if the two nccells are distinct EGCs, attributes, or channels.
// The actual egcpool index needn't be the same--indeed, the planes needn't even
// be the same. Only the expanded EGC must be equal. The EGC must be bit-equal;

View File

@ -154,7 +154,7 @@ char* ncplane_at_cursor(ncplane* n, uint16_t* stylemask, uint64_t* channels){
char* ncplane_at_yx(const ncplane* n, int y, int x, uint16_t* stylemask, uint64_t* channels){
if(y < n->leny && x < n->lenx){
if(y >= 0 && x >= 0){
return cell_extract(n, &n->fb[nfbcellidx(n, y, x)], stylemask, channels);
return nccell_extract(n, &n->fb[nfbcellidx(n, y, x)], stylemask, channels);
}
}
return NULL;