mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
add ncdirect_canget_cursor() #1790
This commit is contained in:
parent
b50bab7880
commit
c9a338e0fd
3
NEWS.md
3
NEWS.md
@ -20,6 +20,9 @@ rearrangements of Notcurses.
|
||||
* `ncplane_as_rgba()`/`ncvisual_from_plane()` now support `NCBLIT_BRAILLE`.
|
||||
* `CELL_ALPHA_*` macros are now `NCALPHA_*`. The former will remain
|
||||
`#define`d until ABI3.
|
||||
* Filled out the complete set of `ncdirect_can*()` capability functions,
|
||||
which now match the `notcurses_can*()` API. Added
|
||||
`ncdirect_canget_cursor()` to check if the cursor can be located.
|
||||
|
||||
* 2.3.4 (2021-06-12)
|
||||
* Added the flag `NCVISUAL_OPTION_NOINTERPOLATE` to use non-interpolative
|
||||
|
@ -74,12 +74,6 @@ notcurses_direct - minimal notcurses instances for styling text
|
||||
|
||||
**const char* ncdirect_detected_terminal(const struct ncdirect* ***n***);**
|
||||
|
||||
**bool ncdirect_canopen_images(const struct ncdirect* ***n***);**
|
||||
|
||||
**bool ncdirect_canutf8(const struct ncdirect* ***n***);**
|
||||
|
||||
**int ncdirect_check_pixel_support(struct ncdirect* ***n***);**
|
||||
|
||||
**int ncdirect_hline_interp(struct ncdirect* ***n***, const char* ***egc***, int ***len***, uint64_t ***h1***, uint64_t ***h2***);**
|
||||
|
||||
**int ncdirect_vline_interp(struct ncdirect* ***n***, const char* ***egc***, int ***len***, uint64_t ***h1***, uint64_t ***h2***);**
|
||||
@ -94,6 +88,30 @@ notcurses_direct - minimal notcurses instances for styling text
|
||||
|
||||
**char* ncdirect_readline(struct ncdirect* ***n***, const char* ***prompt***);**
|
||||
|
||||
**bool ncdirect_cantruecolor(const struct ncdirect* ***nc***);**
|
||||
|
||||
**bool ncdirect_canchangecolor(const struct ncdirect* ***nc***);**
|
||||
|
||||
**bool ncdirect_canfade(const struct ncdirect* ***nc***);**
|
||||
|
||||
**bool ncdirect_canopen_images(const struct ncdirect* ***nc***);**
|
||||
|
||||
**bool ncdirect_canopen_videos(const struct ncdirect* ***nc***);**
|
||||
|
||||
**bool ncdirect_canutf8(const struct ncdirect* ***nc***);**
|
||||
|
||||
**int ncdirect_check_pixel_support(const struct ncdirect* ***nc***);**
|
||||
|
||||
**bool ncdirect_canhalfblock(const struct ncdirect* ***nc***);**
|
||||
|
||||
**bool ncdirect_canquadrant(const struct ncdirect* ***nc***);**
|
||||
|
||||
**bool ncdirect_cansextant(const struct ncdirect* ***nc***);**
|
||||
|
||||
**bool ncdirect_canbraille(const struct ncdirect* ***nc***);**
|
||||
|
||||
**bool ncdirect_canget_cursor(const struct ncdirect* ***nc***);**
|
||||
|
||||
```c
|
||||
typedef struct ncvgeom {
|
||||
int pixy, pixx; // true pixel geometry of ncvisual data
|
||||
|
@ -480,6 +480,10 @@ ncdirect_canbraille(const struct ncdirect* nc){
|
||||
return ncdirect_canutf8(nc) && ncdirect_capabilities(nc)->braille;
|
||||
}
|
||||
|
||||
// Is there support for acquiring the cursor's current position? Requires the
|
||||
// u7 terminfo capability, and that we are connected to an actual terminal.
|
||||
bool ncdirect_canget_cursor(const struct ncdirect* nc);
|
||||
|
||||
#undef ALLOC
|
||||
#undef API
|
||||
|
||||
|
@ -1393,3 +1393,13 @@ const char* ncdirect_detected_terminal(const ncdirect* nc){
|
||||
const nccapabilities* ncdirect_capabilities(const ncdirect* n){
|
||||
return &n->tcache.caps;
|
||||
}
|
||||
|
||||
bool ncdirect_canget_cursor(const ncdirect* n){
|
||||
if(get_escape(&n->tcache, ESCAPE_DSRCPR) == NULL){
|
||||
return false;
|
||||
}
|
||||
if(n->ctermfd < 0){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user