add notcurses_stddim_yx_const()

pull/1075/head
nick black 4 years ago
parent fe7eededa8
commit 0b825c619e
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -9,6 +9,7 @@ rearrangements of Notcurses.
* Add `ncinput_equal_p()` for comparison of `ncinput` structure data.
* `ncmenu_offer_input()` now recognizes the shortcuts for registered
sections, and will unroll the appropriate section when given input.
* Added `notcurses_stddim_yx_const()` (`notcurses_stddim_yx()` `const` form).
* 2.0.0 (2020-10-12) "Stankonia"
* **API STABILITY!** The API expressed in 2.0.0 will be maintained throughout

@ -207,6 +207,14 @@ notcurses_stddim_yx(struct notcurses* nc, int* restrict y, int* restrict x){
ncplane_dim_yx(s, y, x); // accepts NULL
return s;
}
static inline const struct ncplane*
notcurses_stddim_yx_const(const struct notcurses* nc, int* restrict y, int* restrict x){
const struct ncplane* s = notcurses_stdplane_const(nc); // can't fail
ncplane_dim_yx(s, y, x); // accepts NULL
return s;
}
```
A reference to the standard plane *is* persistent across a screen resize, as are

@ -16,6 +16,8 @@ notcurses_stdplane - acquire the standard ncplane
**static inline struct ncplane* notcurses_stddim_yx(struct notcurses* nc, int* restrict y, int* restrict x);**
**static inline const struct ncplane* notcurses_stddim_yx_const(const struct notcurses* nc, int* restrict y, int* restrict x);**
# DESCRIPTION
**notcurses_stdplane** returns a handle to the standard ncplane for the context

@ -991,6 +991,13 @@ notcurses_stddim_yx(struct notcurses* nc, int* RESTRICT y, int* RESTRICT x){
return s;
}
static inline const struct ncplane*
notcurses_stddim_yx_const(const struct notcurses* nc, int* RESTRICT y, int* RESTRICT x){
const struct ncplane* s = notcurses_stdplane_const(nc); // can't fail
ncplane_dim_yx(s, y, x); // accepts NULL
return s;
}
static inline int
ncplane_dim_y(const struct ncplane* n){
int dimy;

Loading…
Cancel
Save