16activate_channels(
ncdirect* nc, uint64_t channels){
17 if(ncchannels_fg_default_p(channels)){
21 }
else if(ncchannels_fg_palindex_p(channels)){
28 if(ncchannels_bg_default_p(channels)){
32 }
else if(ncchannels_bg_palindex_p(channels)){
43 if(activate_channels(nc, channels)){
46 return ncfputs(utf8, nc->
ttyfp);
52 int bytes = utf8_egc_len(utf8, &cols);
59 if(activate_channels(nc, channels)){
62 if(fprintf(nc->
ttyfp,
"%.*s", bytes, utf8) < 0){
70 logerror(
"requested negative move %d\n", num);
78 return term_emit(tiparm(cuu, num), nc->
ttyfp,
false);
85 logerror(
"requested negative move %d\n", num);
93 return term_emit(tiparm(cub, num), nc->
ttyfp,
false);
100 logerror(
"requested negative move %d\n", num);
108 return term_emit(tiparm(cuf, num), nc->
ttyfp,
false);
119 logerror(
"requested negative move %d\n", num);
127 if(ncfputc(
'\v', nc->
ttyfp) == EOF){
137 return emit_scrolls(&nc->
tcache, num, f);
143 return term_emit(clearscr, nc->
ttyfp,
true);
177 return term_emit(cnorm, nc->
ttyfp,
true);
185 return term_emit(cinvis, nc->
ttyfp,
true);
191cursor_yx_get(
ncdirect*
n,
const char* u7,
unsigned*
y,
unsigned*
x){
196 unsigned fakey, fakex;
204 logerror(
"couldn't get cursor position");
207 loginfo(
"cursor at y=%u x=%u\n", *
y, *
x);
217 const char* hpa = get_escape(&
n->tcache,
ESCAPE_HPA);
218 const char* vpa = get_escape(&
n->tcache,
ESCAPE_VPA);
219 const char* u7 = get_escape(&
n->tcache,
ESCAPE_U7);
222 return term_emit(tiparm(hpa,
x),
n->ttyfp,
false);
223 }
else if(
n->tcache.ttyfd >= 0 && u7){
225 if(cursor_yx_get(
n, u7, &yprime,
NULL)){
234 return term_emit(tiparm(vpa,
y),
n->ttyfp,
false);
235 }
else if(
n->tcache.ttyfd >= 0 && u7){
237 if(cursor_yx_get(
n, u7,
NULL, &xprime)){
245 const char* cup = get_escape(&
n->tcache,
ESCAPE_CUP);
247 return term_emit(tiparm(cup,
y,
x),
n->ttyfp,
false);
248 }
else if(vpa && hpa){
249 if(term_emit(tiparm(hpa,
x),
n->ttyfp,
false) == 0 &&
250 term_emit(tiparm(vpa,
y),
n->ttyfp,
false) == 0){
377 if(
n->tcache.ttyfd < 0){
380 const char* u7 = get_escape(&
n->tcache,
ESCAPE_U7);
382 fprintf(stderr,
"Terminal doesn't support cursor reporting\n");
392 return cursor_yx_get(
n, u7,
y,
x);
396 const char* sc = get_escape(&
n->tcache,
ESCAPE_SC);
398 return term_emit(sc,
n->ttyfp,
false);
404 const char* rc = get_escape(&
n->tcache,
ESCAPE_RC);
406 return term_emit(rc,
n->ttyfp,
false);
421 return (cols -
c) / 2;
442 if(toty - dimy < *
y){
443 int scrolls = *
y - 1;
455 if(emit_scrolls(&
n->tcache, scrolls, f) < 0){
459 if(sprite_draw(&
n->tcache,
NULL, np->
sprite, f, *
y, xoff) < 0){
462 if(sprite_commit(&
n->tcache, f, np->
sprite,
true)){
470 if(ncdirect_bg_default_p(nc)){
475 if(fbuf_emit(f, esc) < 0){
479 if(fbuf_emit(f, esc) < 0){
482 if(!ncdirect_fg_default_p(nc)){
488 ncchannels_set_bg_default(&nc->
channels);
494 if(ncdirect_fg_default_p(nc)){
499 if(fbuf_emit(f, esc) < 0){
503 if(fbuf_emit(f, esc) < 0){
506 if(!ncdirect_bg_default_p(nc)){
512 ncchannels_set_fg_default(&nc->
channels);
522 const bool fgdefault = ncdirect_fg_default_p(
n);
523 const bool bgdefault = ncdirect_bg_default_p(
n);
524 const uint32_t fgrgb = ncchannels_fg_rgb(
n->channels);
525 const uint32_t bgrgb = ncchannels_bg_rgb(
n->channels);
526 for(
unsigned y = 0 ;
y < dimy ; ++
y){
527 for(
unsigned x = 0 ;
x < dimx ; ++
x){
535 ncdirect_set_fg_default_f(
n, f);
540 ncdirect_set_bg_default_f(
n, f);
545 size_t egclen = strlen(
egc);
546 if(fbuf_putn(f, egclen == 0 ?
" " :
egc, egclen == 0 ? 1 : egclen) < 0){
556 ncdirect_set_fg_default_f(
n, f);
557 ncdirect_set_bg_default_f(
n, f);
558 if(fbuf_printf(f,
"\n%*.*s", xoff, xoff,
"") < 0){
562 if(ncdirect_cursor_down_f(
n, 1, f)){
569 ncdirect_set_fg_default_f(
n, f);
574 ncdirect_set_bg_default_f(
n, f);
595 if(ncdirect_dump_sprixel(
n, np, xoff, &
y, &f)){
599 if(fbuf_finalize(&f,
n->ttyfp)){
602 if(
n->tcache.pixel_draw_late){
603 if(
n->tcache.pixel_draw_late(&
n->tcache, np->
sprite,
y, xoff) < 0){
607 int targy =
y + ncplane_dim_y(np);
616 if(ncdirect_dump_cellplane(
n, np, &f, xoff)){
620 if(fbuf_finalize(&f,
n->ttyfp)){
628 int lenx = ncplane_dim_x(ncdv);
629 int xoff = ncdirect_align(
n, align, lenx);
630 int r = ncdirect_dump_plane(
n, ncdv, xoff);
644 const struct blitset* bset = rgba_blitter_low(&
n->tcache,
vopts->scaling,
654 unsigned disprows, dispcols, outy;
657 dispcols = dimx * encoding_x_scale(&
n->tcache, bset);
658 disprows = dimy * encoding_y_scale(&
n->tcache, bset) - 1;
661 dispcols = dimx *
n->tcache.cellpxx;
662 disprows = dimy *
n->tcache.cellpxy;
663 clamp_to_sixelmax(&
n->tcache, &disprows, &dispcols, &outy,
vopts->scaling);
666 scale_visual(
ncv, &disprows, &dispcols);
669 clamp_to_sixelmax(&
n->tcache, &disprows, &dispcols, &outy,
vopts->scaling);
673 disprows =
ncv->pixy;
674 dispcols =
ncv->pixx;
676 clamp_to_sixelmax(&
n->tcache, &disprows, &dispcols, &outy,
vopts->scaling);
682 while((outy +
n->tcache.cellpxy - 1) /
n->tcache.cellpxy > dimy){
683 outy -=
n->tcache.sprixel_scale_height;
692 .rows = outy / encoding_y_scale(&
n->tcache, bset),
693 .cols = dispcols / encoding_x_scale(&
n->tcache, bset),
700 nopts.
rows = outy /
n->tcache.cellpxy + !!(outy %
n->tcache.cellpxy);
701 nopts.
cols = dispcols /
n->tcache.cellpxx + !!(dispcols %
n->tcache.cellpxx);
703 if(ymax && nopts.
rows > ymax){
706 if(xmax && nopts.
cols > xmax){
713 if((ncdv->
tam = create_tam(ncplane_dim_y(ncdv), ncplane_dim_x(ncdv))) ==
NULL){
742 if(ymax < 0 || xmax < 0){
750 const struct blitset* bset = rgba_blitter_low(&
n->tcache, scale,
true, blitfxn);
756 vopts.scaling = scale;
786 if(ncchannels_set_fg_palindex(&nc->
channels, pidx) < 0){
789 return term_emit(tiparm(setaf, pidx), nc->
ttyfp,
false);
797 if(ncchannels_set_bg_palindex(&nc->
channels, pidx) < 0){
800 return term_emit(tiparm(setab, pidx), nc->
ttyfp,
false);
813 const int x = ncdirect_align(
n, align,
len);
835ncdirect_stop_minimal(
void* vnc,
void** altstack){
839 if(fbuf_init_small(&f) == 0){
841 ret |= fbuf_finalize(&f, stdout);
863 del_curterm(cur_term);
873 logwarn(
"Passed unsupported flags 0x%016" PRIx64
"\n", flags);
884 memset(ret, 0,
sizeof(*ret));
894 const char* encoding = nl_langinfo(CODESET);
896 if(encoding && encoding_is_utf8(encoding)){
901 true, ncdirect_stop_minimal)){
920 0, &cursor_y, &cursor_x, &ret->
stats, 0, 0, 0, 0,
958 ret |= ncdirect_stop_minimal(nc, &altstack);
983 const char* u7 = get_escape(&
n->tcache,
ESCAPE_U7);
985 logerror(
"can't readline without u7");
992 if(fprintf(
n->ttyfp,
"%s",
prompt) < 0){
1001 if(cursor_yx_get(
n, u7, &
y, &xstart)){
1007 int wspace = BUFSIZ /
sizeof(*str);
1008 if((str = malloc(wspace *
sizeof(*str))) ==
NULL){
1013 str[wused++] = L
'\0';
1016 unsigned oldx = xstart;
1017 while((
id = ncdirect_get_blocking(
n, &ni)) != (uint32_t)-1){
1023 if(fputc(
'\n',
n->ttyfp) < 0){
1034 char* ustr = ncwcsrtombs(str);
1039 str[wused - 2] = L
'\0';
1051 }
else if(
id ==
'A' && ncinput_ctrl_p(&ni)){
1053 }
else if(
id ==
'E' && ncinput_ctrl_p(&ni)){
1055 }
else if(nckey_synthesized_p(ni.
id)){
1058 if(wspace - 1 < wused){
1060 wchar_t* tmp = realloc(str, wspace *
sizeof(*str));
1067 if(wpos < wused - 1){
1068 memmove(str + wpos + 1, str + wpos, (wused - wpos) *
sizeof(*str));
1073 str[wused - 1] = id;
1076 str[wused - 1] = L
'\0';
1080 if(cursor_yx_get(
n, u7, &
y, &
x)){
1095 }
else if(wpos > wused - 1){
1099 const char* el = get_escape(&
n->tcache,
ESCAPE_EL);
1100 for(
int i = bline ; i >= tline ; --i){
1104 if(term_emit(el,
n->ttyfp,
false)){
1108 if(fprintf(
n->ttyfp,
"%ls", str) < 0){
1112 int linear = xstart + wpos;
1113 int ylin = linear / dimx;
1114 int xlin = linear % dimx;
1119 if(fflush(
n->ttyfp)){
1128ncdirect_style_emit(
ncdirect*
n,
unsigned stylebits,
fbuf* f){
1129 unsigned normalized = 0;
1130 int r = coerce_styles(f, &
n->tcache, &
n->stylemask, stylebits, &normalized);
1136 if(!ncdirect_fg_default_p(
n)){
1137 if(!ncdirect_fg_palindex_p(
n)){
1138 uint32_t fg = ncchannels_fg_rgb(
n->channels);
1139 ncchannels_set_fg_default(&
n->channels);
1142 uint32_t fg = ncchannels_fg_palindex(
n->channels);
1143 ncchannels_set_fg_default(&
n->channels);
1147 if(!ncdirect_bg_default_p(
n)){
1148 if(!ncdirect_bg_palindex_p(
n)){
1149 uint32_t bg = ncchannels_bg_rgb(
n->channels);
1150 ncchannels_set_bg_default(&
n->channels);
1153 uint32_t bg = ncchannels_bg_palindex(
n->channels);
1154 ncchannels_set_bg_default(&
n->channels);
1163 if((stylebits &
n->tcache.supported_styles) < stylebits){
1166 uint32_t stylemask =
n->stylemask | stylebits;
1168 if(fbuf_init_small(&f)){
1171 if(ncdirect_style_emit(
n, stylemask, &f)){
1175 if(fbuf_finalize(&f,
n->ttyfp)){
1182 return n->stylemask;
1187 uint32_t stylemask =
n->stylemask & ~stylebits;
1189 if(fbuf_init_small(&f)){
1192 if(ncdirect_style_emit(
n, stylemask, &f)){
1196 if(fbuf_finalize(&f,
n->ttyfp)){
1204 if((stylebits &
n->tcache.supported_styles) < stylebits){
1207 uint32_t stylemask = stylebits;
1209 if(fbuf_init_small(&f)){
1212 if(ncdirect_style_emit(
n, stylemask, &f)){
1216 if(fbuf_finalize(&f,
n->ttyfp)){
1227 if(ncdirect_fg_default_p(nc)){
1232 if(term_emit(esc, nc->
ttyfp,
false)){
1236 if(term_emit(esc, nc->
ttyfp,
false)){
1239 if(!ncdirect_bg_default_p(nc)){
1245 ncchannels_set_fg_default(&nc->
channels);
1250 if(ncdirect_bg_default_p(nc)){
1255 if(term_emit(esc, nc->
ttyfp,
false)){
1259 if(term_emit(esc, nc->
ttyfp,
false)){
1262 if(!ncdirect_fg_default_p(nc)){
1268 ncchannels_set_bg_default(&nc->
channels);
1273 uint64_t c1, uint64_t c2){
1278 unsigned ur, ug, ub;
1279 int r1, g1, b1, r2, g2, b2;
1280 int br1, bg1, bb1, br2, bg2, bb2;
1281 ncchannels_fg_rgb8(c1, &
ur, &ug, &ub);
1282 r1 =
ur; g1 = ug; b1 = ub;
1283 ncchannels_fg_rgb8(c2, &
ur, &ug, &ub);
1284 r2 =
ur; g2 = ug; b2 = ub;
1285 ncchannels_bg_rgb8(c1, &
ur, &ug, &ub);
1286 br1 =
ur; bg1 = ug; bb1 = ub;
1287 ncchannels_bg_rgb8(c2, &
ur, &ug, &ub);
1288 br2 =
ur; bg2 = ug; bb2 = ub;
1289 int deltr = r2 - r1;
1290 int deltg = g2 - g1;
1291 int deltb = b2 - b1;
1292 int deltbr = br2 - br1;
1293 int deltbg = bg2 - bg1;
1294 int deltbb = bb2 - bb1;
1296 bool fgdef =
false, bgdef =
false;
1297 if(ncchannels_fg_default_p(c1) && ncchannels_fg_default_p(c2)){
1303 if(ncchannels_bg_default_p(c1) && ncchannels_bg_default_p(c2)){
1309 for(ret = 0 ; ret <
len ; ++ret){
1310 int r = (deltr * (int)ret) / (int)
len + r1;
1311 int g = (deltg * (int)ret) / (int)
len + g1;
1312 int b = (deltb * (int)ret) / (int)
len + b1;
1313 int br = (deltbr * (int)ret) / (int)
len + br1;
1314 int bg = (deltbg * (int)ret) / (int)
len + bg1;
1315 int bb = (deltbb * (int)ret) / (int)
len + bb1;
1317 ncdirect_set_fg_rgb8(
n,
r, g, b);
1320 ncdirect_set_bg_rgb8(
n, br, bg, bb);
1322 if(fprintf(
n->ttyfp,
"%s",
egc) < 0){
1331 uint64_t c1, uint64_t c2){
1336 unsigned ur, ug, ub;
1337 int r1, g1, b1, r2, g2, b2;
1338 int br1, bg1, bb1, br2, bg2, bb2;
1339 ncchannels_fg_rgb8(c1, &
ur, &ug, &ub);
1340 r1 =
ur; g1 = ug; b1 = ub;
1341 ncchannels_fg_rgb8(c2, &
ur, &ug, &ub);
1342 r2 =
ur; g2 = ug; b2 = ub;
1343 ncchannels_bg_rgb8(c1, &
ur, &ug, &ub);
1344 br1 =
ur; bg1 = ug; bb1 = ub;
1345 ncchannels_bg_rgb8(c2, &
ur, &ug, &ub);
1346 br2 =
ur; bg2 = ug; bb2 = ub;
1347 int deltr = (r2 - r1) / ((
int)
len + 1);
1348 int deltg = (g2 - g1) / ((
int)
len + 1);
1349 int deltb = (b2 - b1) / ((
int)
len + 1);
1350 int deltbr = (br2 - br1) / ((
int)
len + 1);
1351 int deltbg = (bg2 - bg1) / ((
int)
len + 1);
1352 int deltbb = (bb2 - bb1) / ((
int)
len + 1);
1354 bool fgdef =
false, bgdef =
false;
1355 if(ncchannels_fg_default_p(c1) && ncchannels_fg_default_p(c2)){
1361 if(ncchannels_bg_default_p(c1) && ncchannels_bg_default_p(c2)){
1367 for(ret = 0 ; ret <
len ; ++ret){
1374 uint64_t channels = 0;
1376 ncchannels_set_fg_rgb8(&channels, r1, g1, b1);
1379 ncchannels_set_bg_rgb8(&channels, br1, bg1, bb1);
1396 uint64_t
ll, uint64_t
lr,
const wchar_t* wchars,
1401 char hl[MB_LEN_MAX + 1];
1402 char vl[MB_LEN_MAX + 1];
1406 if(edges >= box_corner_needs(
ctlword)){
1407 if(activate_channels(
n,
ul)){
1410 if(fprintf(
n->ttyfp,
"%lc", wchars[0]) < 0){
1411 logerror(
"error emitting %lc\n", wchars[0]);
1419 if((bytes = wcrtomb(hl, wchars[4], &ps)) == (
size_t)-1){
1420 logerror(
"error converting %lc\n", wchars[4]);
1424 memset(&ps, 0,
sizeof(ps));
1425 if((bytes = wcrtomb(vl, wchars[5], &ps)) == (
size_t)-1){
1426 logerror(
"error converting %lc\n", wchars[5]);
1440 if(edges >= box_corner_needs(
ctlword)){
1441 if(activate_channels(
n,
ur)){
1444 if(fprintf(
n->ttyfp,
"%lc", wchars[1]) < 0){
1475 if(edges >= box_corner_needs(
ctlword)){
1476 if(activate_channels(
n,
ll)){
1479 if(fprintf(
n->ttyfp,
"%lc", wchars[2]) < 0){
1495 if(edges >= box_corner_needs(
ctlword)){
1496 if(activate_channels(
n,
lr)){
1499 if(fprintf(
n->ttyfp,
"%lc", wchars[3]) < 0){
1507 uint64_t
ll, uint64_t
lr,
1513 uint64_t
ll, uint64_t
lr,
1520 return n->tcache.caps.utf8;
1524 return ncflush(nc->
ttyfp);
1528 if(
n->tcache.pixel_draw ||
n->tcache.pixel_draw_late){
1542 unsigned y = 0,
x = 0;
1563 thisid =
v->sprite->id;
1570 if(
n->tcache.pixel_remove){
1572 fbuf_init_small(&f);
1573 if(
n->tcache.pixel_remove(lastid, &f)){
1578 if(fbuf_finalize(&f,
n->ttyfp) < 0){
1593 const char* filename){
1602 return ncdirect_render_visual(
n, frame,
vopts);
1608 unsigned disppxy, disppxx, outy, outx;
1611 &disppxy, &disppxx, &outy, &outx,
1616 return term_supported_styles(&nc->
tcache);
1624 return &
n->tcache.caps;
1631 if(
n->tcache.ttyfd < 0){
int ncdirect_render_image(ncdirect *n, const char *file, ncalign_e align, ncblitter_e blitfxn, ncscale_e scale)
unsigned ncdirect_palette_size(const ncdirect *nc)
uint16_t ncdirect_styles(const ncdirect *n)
int ncdirect_rounded_box(ncdirect *n, uint64_t ul, uint64_t ur, uint64_t ll, uint64_t lr, unsigned ylen, unsigned xlen, unsigned ctlword)
int ncdirect_off_styles(ncdirect *n, unsigned stylebits)
int ncdirect_set_fg_palindex(ncdirect *nc, int pidx)
int ncdirect_set_bg_palindex(ncdirect *nc, int pidx)
ncdirectv * ncdirect_render_frame(ncdirect *n, const char *file, ncblitter_e blitfxn, ncscale_e scale, int ymax, int xmax)
unsigned ncdirect_dim_x(ncdirect *nc)
int ncdirect_check_pixel_support(const ncdirect *n)
ncdirect * ncdirect_core_init(const char *termtype, FILE *outfp, uint64_t flags)
int ncdirect_cursor_right(ncdirect *nc, int num)
int ncdirect_cursor_down(ncdirect *nc, int num)
int ncdirectf_geom(ncdirect *n, ncdirectf *frame, const struct ncvisual_options *vopts, ncvgeom *geom)
void ncdirectf_free(ncdirectf *frame)
int ncdirect_set_fg_default(ncdirect *nc)
int ncdirect_putegc(ncdirect *nc, uint64_t channels, const char *utf8, int *sbytes)
bool ncdirect_canget_cursor(const ncdirect *n)
ncdirectf * ncdirectf_from_file(ncdirect *n __attribute__((unused)), const char *filename)
int ncdirect_set_styles(ncdirect *n, unsigned stylebits)
uint16_t ncdirect_supported_styles(const ncdirect *nc)
int ncdirect_hline_interp(ncdirect *n, const char *egc, unsigned len, uint64_t c1, uint64_t c2)
int ncdirect_putstr(ncdirect *nc, uint64_t channels, const char *utf8)
unsigned ncdirect_dim_y(ncdirect *nc)
int ncdirect_cursor_up(ncdirect *nc, int num)
int ncdirect_cursor_yx(ncdirect *n, unsigned *y, unsigned *x)
int ncdirect_cursor_push(ncdirect *n)
ncdirectv * ncdirectf_render(ncdirect *n, ncdirectf *frame, const struct ncvisual_options *vopts)
int ncdirect_cursor_disable(ncdirect *nc)
const nccapabilities * ncdirect_capabilities(const ncdirect *n)
int ncdirect_set_bg_default(ncdirect *nc)
int ncdirect_stop(ncdirect *nc)
char * ncdirect_readline(ncdirect *n, const char *prompt)
int ncdirect_vprintf_aligned(ncdirect *n, int y, ncalign_e align, const char *fmt, va_list ap)
int ncdirect_cursor_move_yx(ncdirect *n, int y, int x)
int ncdirect_clear(ncdirect *nc)
int ncdirect_cursor_enable(ncdirect *nc)
int ncdirect_cursor_left(ncdirect *nc, int num)
int ncdirect_flush(const ncdirect *nc)
int ncdirect_printf_aligned(ncdirect *n, int y, ncalign_e align, const char *fmt,...)
int ncdirect_raster_frame(ncdirect *n, ncdirectv *ncdv, ncalign_e align)
int ncdirect_vline_interp(ncdirect *n, const char *egc, unsigned len, uint64_t c1, uint64_t c2)
int ncdirect_on_styles(ncdirect *n, unsigned stylebits)
int ncdirect_box(ncdirect *n, uint64_t ul, uint64_t ur, uint64_t ll, uint64_t lr, const wchar_t *wchars, unsigned ylen, unsigned xlen, unsigned ctlword)
int ncdirect_stream(ncdirect *n, const char *filename, ncstreamcb streamer, struct ncvisual_options *vopts, void *curry)
char * ncdirect_detected_terminal(const ncdirect *nc)
int ncdirect_double_box(ncdirect *n, uint64_t ul, uint64_t ur, uint64_t ll, uint64_t lr, unsigned ylen, unsigned xlen, unsigned ctlword)
bool ncdirect_canutf8(const ncdirect *n)
int ncdirect_cursor_pop(ncdirect *n)
API int API int API int uint64_t uint64_t uint64_t uint64_t lr
#define NCDIRECT_OPTION_INHIBIT_SETLOCALE
#define NCDIRECT_OPTION_INHIBIT_CBREAK
#define NCDIRECT_OPTION_DRAIN_INPUT
#define NCDIRECT_OPTION_NO_QUIT_SIGHANDLERS
#define NCDIRECT_OPTION_VERBOSE
API int API int API int uint64_t uint64_t uint64_t uint64_t unsigned unsigned unsigned ctlword
API int API int API int uint64_t uint64_t uint64_t ll
API int API int API int uint64_t uint64_t uint64_t uint64_t unsigned unsigned xlen
API int API int API int uint64_t uint64_t uint64_t uint64_t unsigned ylen
#define NCDIRECT_OPTION_VERY_VERBOSE
API int API int API int uint64_t ul
API int API int API int uint64_t uint64_t ur
__attribute__((nonnull(1, 2))) static inline int egcpool_stash(egcpool *pool
const char va_start(va, fmt)
int get_cursor_location(inputctx *ictx, const char *u7, unsigned *y, unsigned *x)
int ncdirect_set_bg_rgb_f(ncdirect *nc, unsigned rgb, fbuf *f)
ncplane * ncplane_new_internal(notcurses *nc, ncplane *n, const ncplane_options *nopts)
int update_term_dimensions(unsigned *rows, unsigned *cols, tinfo *tcache, int margin_b, unsigned *cgeo_changed, unsigned *pgeo_changed) __attribute__((nonnull(3
int ncdirect_set_fg_rgb_f(ncdirect *nc, unsigned rgb, fbuf *f)
int putenv_term(const char *termname) __attribute__((nonnull(1)))
int ncvisual_init(int loglevel)
void free_plane(ncplane *p)
int set_loglevel_from_env(ncloglevel_e *loglevel) __attribute__((nonnull(1)))
int ncvisual_blit_internal(const struct ncvisual *ncv, int rows, int cols, ncplane *n, const struct blitset *bset, const blitterargs *bargs)
int reset_term_attributes(const tinfo *ti, fbuf *f)
void ncmetric_use_utf8(void)
sprixel * sprixel_alloc(ncplane *n, int dimy, int dimx)
int ncvisual_geom_inner(const tinfo *ti, const struct ncvisual *n, const struct ncvisual_options *vopts, ncvgeom *geom, const struct blitset **bset, unsigned *disppxy, unsigned *disppxx, unsigned *outy, unsigned *outx, int *placey, int *placex)
ALLOC char * ncplane_vprintf_prep(const char *format, va_list ap)
#define logerror(fmt,...)
char * ncplane_at_yx(const ncplane *n, int y, int x, uint16_t *stylemask, uint64_t *channels)
int ncstrwidth(const char *egcs, int *validbytes, int *validwidth)
void ncplane_dim_yx(const ncplane *n, unsigned *rows, unsigned *cols)
const struct ncplane_options struct ncvisual * ncv
const struct ncplane_options struct ncvisual struct ncvisual_options * vopts
#define NCALPHA_TRANSPARENT
#define NCVISUAL_OPTION_ADDALPHA
struct ncvisual_options v
int(* ncstreamcb)(struct ncvisual *, struct ncvisual_options *, const struct timespec *, void *)
API int API int const nccell unsigned len
#define NCVISUAL_OPTION_HORALIGNED
#define NCVISUAL_OPTION_NODEGRADE
int ncdirect_set_bg_rgb(ncdirect *nc, unsigned rgb)
int ncdirect_set_fg_rgb(ncdirect *nc, unsigned rgb)
struct blitterargs::@3::@5 pixel
struct termios * tpreserved
void free_terminfo_cache(tinfo *ti)
int interrogate_terminfo(tinfo *ti, FILE *out, unsigned utf8, unsigned noaltscreen, unsigned nocbreak, unsigned nonewfonts, int *cursor_y, int *cursor_x, ncsharedstats *stats, int lmargin, int tmargin, int rmargin, int bmargin, unsigned draininput)
char * termdesc_longterm(const tinfo *ti)
int setup_signals(void *vnc, bool no_quit_sigs, bool no_winch_sigs, int(*handler)(void *, void **))
int drop_signals(void *nc, void **altstack)
int ncvisual_decode(ncvisual *nc)
ncvisual * ncvisual_from_file(const char *filename)
void ncvisual_destroy(ncvisual *ncv)