mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
nctablet_ncplane() -> nctablet_plane()
This commit is contained in:
parent
ec85dd1c3b
commit
20bf1ae2d4
1
NEWS.md
1
NEWS.md
@ -3,6 +3,7 @@ rearrangements of Notcurses.
|
||||
|
||||
* 1.7.5 (not yet released)
|
||||
* `ncreel_destroy()` now returns `void` rather than `int`.
|
||||
* `nctablet_ncplane()` has been renamed `nctablet_plane()`.
|
||||
|
||||
* 1.7.4 (2020-09-20)
|
||||
* All `_rgb_clipped()` functions have been renamed `_rgb8_clipped()`, to
|
||||
|
4
USAGE.md
4
USAGE.md
@ -2045,8 +2045,8 @@ void ncreel_destroy(struct ncreel* nr);
|
||||
// Returns a pointer to a user pointer associated with this nctablet.
|
||||
void* nctablet_userptr(struct nctablet* t);
|
||||
|
||||
// Access the ncplane associated with this nctablet, if one exists.
|
||||
struct ncplane* nctablet_ncplane(struct nctablet* t);
|
||||
// Access the ncplane associated with nctablet 't', if one exists.
|
||||
struct ncplane* nctablet_plane(struct nctablet* t);
|
||||
```
|
||||
|
||||
### ncreel examples
|
||||
|
@ -58,7 +58,7 @@ typedef struct ncreel_options {
|
||||
|
||||
**void* nctablet_userptr(struct nctablet* t);**
|
||||
|
||||
**struct ncplane* nctablet_ncplane(struct nctablet* t);**
|
||||
**struct ncplane* nctablet_plane(struct nctablet* t);**
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
|
@ -2540,8 +2540,8 @@ API void ncreel_destroy(struct ncreel* nr);
|
||||
// Returns a pointer to a user pointer associated with this nctablet.
|
||||
API void* nctablet_userptr(struct nctablet* t);
|
||||
|
||||
// Access the ncplane associated with this nctablet, if one exists.
|
||||
API struct ncplane* nctablet_ncplane(struct nctablet* t);
|
||||
// Access the ncplane associated with nctablet 't', if one exists.
|
||||
API struct ncplane* nctablet_plane(struct nctablet* t);
|
||||
|
||||
// The number of columns is one fewer, as the STRLEN expressions must leave
|
||||
// an extra byte open in case 'µ' (U+00B5, 0xC2 0xB5) shows up. PREFIXCOLUMNS
|
||||
|
@ -339,7 +339,7 @@ struct nctablet* ncreel_next(struct ncreel* pr);
|
||||
struct nctablet* ncreel_prev(struct ncreel* pr);
|
||||
void ncreel_destroy(struct ncreel* pr);
|
||||
void* nctablet_userptr(struct nctablet* t);
|
||||
struct ncplane* nctablet_ncplane(struct nctablet* t);
|
||||
struct ncplane* nctablet_plane(struct nctablet* t);
|
||||
int ncplane_polyfill_yx(struct ncplane* n, int y, int x, const cell* c);
|
||||
int ncplane_gradient(struct ncplane* n, const char* egc, uint32_t styles, uint64_t ul, uint64_t ur, uint64_t ll, uint64_t lr, int ystop, int xstop);
|
||||
int ncplane_highgradient(struct ncplane* n, uint32_t ul, uint32_t ur, uint32_t ll, uint32_t lr, int ystop, int xstop);
|
||||
|
@ -88,7 +88,7 @@ tabletdraw(struct ncplane* w, int maxy, tabletctx* tctx, unsigned rgb){
|
||||
|
||||
static int
|
||||
drawcb(struct nctablet* t, bool drawfromtop){
|
||||
struct ncplane* p = nctablet_ncplane(t);
|
||||
struct ncplane* p = nctablet_plane(t);
|
||||
tabletctx* tctx = nctablet_userptr(t);
|
||||
if(tctx == NULL){
|
||||
return -1;
|
||||
@ -137,9 +137,9 @@ tablet_thread(void* vtabletctx){
|
||||
}
|
||||
pthread_mutex_unlock(&tctx->lock);
|
||||
pthread_mutex_lock(&renderlock);
|
||||
if(nctablet_ncplane(tctx->t)){
|
||||
if(nctablet_plane(tctx->t)){
|
||||
ncreel_redraw(tctx->pr);
|
||||
struct ncplane* tplane = nctablet_ncplane(tctx->t);
|
||||
struct ncplane* tplane = nctablet_plane(tctx->t);
|
||||
if(tplane){
|
||||
demo_render(ncplane_notcurses(tplane));
|
||||
}
|
||||
|
@ -710,7 +710,7 @@ validate_ncreel_opts(ncplane* n, const ncreel_options* ropts){
|
||||
return true;
|
||||
}
|
||||
|
||||
ncplane* nctablet_ncplane(nctablet* t){
|
||||
ncplane* nctablet_plane(nctablet* t){
|
||||
return t->cbp;
|
||||
}
|
||||
|
||||
|
@ -32,5 +32,5 @@ void NcTablet::unmap_tablet (NcTablet *p) noexcept
|
||||
|
||||
Plane* NcTablet::get_plane () const noexcept
|
||||
{
|
||||
return Plane::map_plane (nctablet_ncplane (_tablet));
|
||||
return Plane::map_plane (nctablet_plane (_tablet));
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ auto ncreel_validate(const ncreel* n) -> bool {
|
||||
}
|
||||
|
||||
auto panelcb(struct nctablet* t, bool toptobottom) -> int {
|
||||
CHECK(nctablet_ncplane(t));
|
||||
CHECK(nctablet_plane(t));
|
||||
CHECK(!nctablet_userptr(t));
|
||||
CHECK(toptobottom);
|
||||
// FIXME verify geometry is as expected
|
||||
@ -272,7 +272,7 @@ TEST_CASE("Reels") {
|
||||
for(size_t n = 0 ; n < sizeof(order) / sizeof(*order) ; ++n){
|
||||
CHECK_LE(0, order[n]);
|
||||
int y;
|
||||
ncplane_yx(ncplane_parent(nctablet_ncplane(tabs[n])), &y, nullptr);
|
||||
ncplane_yx(ncplane_parent(nctablet_plane(tabs[n])), &y, nullptr);
|
||||
CHECK(y == expectedy);
|
||||
expectedy += 7;
|
||||
}
|
||||
@ -284,7 +284,7 @@ TEST_CASE("Reels") {
|
||||
for(size_t n = 0 ; n < sizeof(order) / sizeof(*order) ; ++n){
|
||||
CHECK_LE(1, order[n]);
|
||||
int y;
|
||||
ncplane_yx(ncplane_parent(nctablet_ncplane(tabs[n])), &y, nullptr);
|
||||
ncplane_yx(ncplane_parent(nctablet_plane(tabs[n])), &y, nullptr);
|
||||
CHECK(y == expectedy);
|
||||
expectedy += 7;
|
||||
}
|
||||
@ -296,7 +296,7 @@ TEST_CASE("Reels") {
|
||||
for(size_t n = 0 ; n < sizeof(order) / sizeof(*order) ; ++n){
|
||||
CHECK_LE(2, order[n]);
|
||||
int y;
|
||||
ncplane_yx(ncplane_parent(nctablet_ncplane(tabs[n])), &y, nullptr);
|
||||
ncplane_yx(ncplane_parent(nctablet_plane(tabs[n])), &y, nullptr);
|
||||
CHECK(y == expectedy);
|
||||
expectedy += 7;
|
||||
}
|
||||
@ -308,7 +308,7 @@ TEST_CASE("Reels") {
|
||||
for(size_t n = 0 ; n < sizeof(order) / sizeof(*order) ; ++n){
|
||||
CHECK_LE(3, order[n]);
|
||||
int y;
|
||||
ncplane_yx(ncplane_parent(nctablet_ncplane(tabs[n])), &y, nullptr);
|
||||
ncplane_yx(ncplane_parent(nctablet_plane(tabs[n])), &y, nullptr);
|
||||
CHECK(y == expectedy);
|
||||
expectedy += 7;
|
||||
}
|
||||
@ -320,7 +320,7 @@ TEST_CASE("Reels") {
|
||||
for(size_t n = 0 ; n < sizeof(order) / sizeof(*order) ; ++n){
|
||||
CHECK_LE(4, order[n]);
|
||||
int y;
|
||||
ncplane_yx(ncplane_parent(nctablet_ncplane(tabs[n])), &y, nullptr);
|
||||
ncplane_yx(ncplane_parent(nctablet_plane(tabs[n])), &y, nullptr);
|
||||
CHECK(y == expectedy);
|
||||
expectedy += 7;
|
||||
}
|
||||
@ -350,7 +350,7 @@ TEST_CASE("Reels") {
|
||||
for(size_t n = 0 ; n < sizeof(order) / sizeof(*order) ; ++n){
|
||||
CHECK_LE(-1, order[n]);
|
||||
int y;
|
||||
ncplane_yx(ncplane_parent(nctablet_ncplane(tabs[n])), &y, nullptr);
|
||||
ncplane_yx(ncplane_parent(nctablet_plane(tabs[n])), &y, nullptr);
|
||||
CHECK(y == expectedy);
|
||||
expectedy += 5;
|
||||
}
|
||||
@ -362,7 +362,7 @@ TEST_CASE("Reels") {
|
||||
for(size_t n = 0 ; n < sizeof(order) / sizeof(*order) ; ++n){
|
||||
CHECK_LE(1, order[n]);
|
||||
int y;
|
||||
ncplane_yx(ncplane_parent(nctablet_ncplane(tabs[n])), &y, nullptr);
|
||||
ncplane_yx(ncplane_parent(nctablet_plane(tabs[n])), &y, nullptr);
|
||||
CHECK(y == expectedy);
|
||||
expectedy += 5;
|
||||
}
|
||||
@ -374,7 +374,7 @@ TEST_CASE("Reels") {
|
||||
for(size_t n = 0 ; n < sizeof(order) / sizeof(*order) ; ++n){
|
||||
CHECK_LE(2, order[n]);
|
||||
int y;
|
||||
ncplane_yx(ncplane_parent(nctablet_ncplane(tabs[n])), &y, nullptr);
|
||||
ncplane_yx(ncplane_parent(nctablet_plane(tabs[n])), &y, nullptr);
|
||||
CHECK(y == expectedy);
|
||||
expectedy += 5;
|
||||
}
|
||||
@ -386,7 +386,7 @@ TEST_CASE("Reels") {
|
||||
for(size_t n = 0 ; n < sizeof(order) / sizeof(*order) ; ++n){
|
||||
CHECK_LE(3, order[n]);
|
||||
int y;
|
||||
ncplane_yx(ncplane_parent(nctablet_ncplane(tabs[n])), &y, nullptr);
|
||||
ncplane_yx(ncplane_parent(nctablet_plane(tabs[n])), &y, nullptr);
|
||||
CHECK(y == expectedy);
|
||||
expectedy += 5;
|
||||
}
|
||||
@ -398,7 +398,7 @@ TEST_CASE("Reels") {
|
||||
for(size_t n = 0 ; n < sizeof(order) / sizeof(*order) ; ++n){
|
||||
CHECK_LE(4, order[n]);
|
||||
int y;
|
||||
ncplane_yx(ncplane_parent(nctablet_ncplane(tabs[n])), &y, nullptr);
|
||||
ncplane_yx(ncplane_parent(nctablet_plane(tabs[n])), &y, nullptr);
|
||||
CHECK(y == expectedy);
|
||||
expectedy += 5;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user