mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
add smxx/rmxx to esctable #1525
This commit is contained in:
parent
857d5e5958
commit
567a1796a5
@ -860,7 +860,8 @@ int ncdirect_on_styles(ncdirect* n, unsigned stylebits){
|
||||
return 0;
|
||||
}
|
||||
if(term_setstyle(n->ttyfp, n->stylemask, stylemask, NCSTYLE_STRUCK,
|
||||
n->tcache.struck, n->tcache.struckoff)){
|
||||
get_escape(&n->tcache, ESCAPE_SMXX),
|
||||
get_escape(&n->tcache, ESCAPE_RMXX))){
|
||||
return -1;
|
||||
}
|
||||
n->stylemask = stylemask;
|
||||
@ -883,7 +884,8 @@ int ncdirect_off_styles(ncdirect* n, unsigned stylebits){
|
||||
return -1;
|
||||
}
|
||||
if(term_setstyle(n->ttyfp, n->stylemask, stylemask, NCSTYLE_STRUCK,
|
||||
n->tcache.struck, n->tcache.struckoff)){
|
||||
get_escape(&n->tcache, ESCAPE_SMXX),
|
||||
get_escape(&n->tcache, ESCAPE_RMXX))){
|
||||
return -1;
|
||||
}
|
||||
n->stylemask = stylemask;
|
||||
@ -910,7 +912,8 @@ int ncdirect_set_styles(ncdirect* n, unsigned stylebits){
|
||||
return -1;
|
||||
}
|
||||
if(term_setstyle(n->ttyfp, n->stylemask, stylemask, NCSTYLE_STRUCK,
|
||||
n->tcache.struck, n->tcache.struckoff)){
|
||||
get_escape(&n->tcache, ESCAPE_SMXX),
|
||||
get_escape(&n->tcache, ESCAPE_RMXX))){
|
||||
return -1;
|
||||
}
|
||||
n->stylemask = stylemask;
|
||||
|
@ -641,7 +641,8 @@ term_setstyles(FILE* out, notcurses* nc, const nccell* c){
|
||||
get_escape(&nc->tcache, ESCAPE_SITM),
|
||||
get_escape(&nc->tcache, ESCAPE_RITM));
|
||||
ret |= term_setstyle(out, nc->rstate.curattr, cellattr, NCSTYLE_STRUCK,
|
||||
nc->tcache.struck, nc->tcache.struckoff);
|
||||
get_escape(&nc->tcache, ESCAPE_SMXX),
|
||||
get_escape(&nc->tcache, ESCAPE_RMXX));
|
||||
nc->rstate.curattr = cellattr;
|
||||
if(normalized){
|
||||
nc->rstate.fgdefelidable = true;
|
||||
|
@ -229,6 +229,8 @@ int interrogate_terminfo(tinfo* ti, int fd, const char* termname,
|
||||
{ ESCAPE_CUB, "cub", },
|
||||
{ ESCAPE_SMKX, "smkx", },
|
||||
{ ESCAPE_RMKX, "rmkx", },
|
||||
{ ESCAPE_SMXX, "smxx", },
|
||||
{ ESCAPE_RMXX, "rmxx", },
|
||||
{ ESCAPE_MAX, NULL, },
|
||||
};
|
||||
size_t tablelen = 0;
|
||||
@ -288,12 +290,16 @@ int interrogate_terminfo(tinfo* ti, int fd, const char* termname,
|
||||
{ NCSTYLE_BLINK, "blink", A_BLINK },
|
||||
{ NCSTYLE_DIM, "dim", A_DIM },
|
||||
{ NCSTYLE_ITALIC, "sitm", A_ITALIC },
|
||||
{ NCSTYLE_INVIS, "invis", A_INVIS },
|
||||
{ NCSTYLE_PROTECT, "prot", A_PROTECT },
|
||||
{ NCSTYLE_STRUCK, "smxx", 0 },
|
||||
{ 0, NULL, 0 }
|
||||
};
|
||||
int nocolor_stylemask = tigetnum("ncv");
|
||||
for(typeof(*styles)* s = styles ; s->s ; ++s){
|
||||
if(nocolor_stylemask > 0){
|
||||
if(nocolor_stylemask & s->ncvbit){
|
||||
ti->supported_styles &= ~s->ncvbit;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -309,8 +315,6 @@ int interrogate_terminfo(tinfo* ti, int fd, const char* termname,
|
||||
ti->escindices[ESCAPE_RITM] = 0;
|
||||
}
|
||||
terminfostr(&ti->getm, "getm"); // get mouse events
|
||||
terminfostr(&ti->struck, "smxx"); // strikeout
|
||||
terminfostr(&ti->struckoff, "rmxx"); // cancel strikeout
|
||||
// if the keypad neen't be explicitly enabled, smkx is not present
|
||||
const char* smkx = get_escape(ti, ESCAPE_SMKX);
|
||||
if(smkx && fd >= 0){
|
||||
|
@ -48,6 +48,8 @@ typedef enum {
|
||||
ESCAPE_RMKX, // "rmkx" keypad_local
|
||||
ESCAPE_SMCUP, // "smcup" enter alternate screen
|
||||
ESCAPE_RMCUP, // "rmcup" leave alternate screen
|
||||
ESCAPE_SMXX, // "smxx" start struckout
|
||||
ESCAPE_RMXX, // "rmxx" end struckout
|
||||
ESCAPE_MAX
|
||||
} escape_e;
|
||||
|
||||
@ -61,8 +63,6 @@ typedef struct tinfo {
|
||||
char* esctable; // packed table of escape sequences
|
||||
unsigned colors;// number of colors terminfo reported usable for this screen
|
||||
char* home; // home cursor
|
||||
char* struck; // NCSTYLE_STRUCK
|
||||
char* struckoff;// NCSTYLE_STRUCK (disable)
|
||||
char* initc; // set a palette entry's RGB value
|
||||
char* clearscr; // erase screen and home cursor
|
||||
char* sc; // push the cursor location onto the stack
|
||||
|
Loading…
x
Reference in New Issue
Block a user