|
|
@ -579,9 +579,44 @@ ncfputc(char c, FILE* out){
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
|
|
|
enter_pixel_mode(notcurses* nc, FILE* out){
|
|
|
|
|
|
|
|
if(!nc->rstate.pixelmode){
|
|
|
|
|
|
|
|
if(term_emit("\ePq", out, false)){
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
nc->rstate.pixelmode = true;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
|
|
|
leave_pixel_mode(notcurses* nc, FILE* out){
|
|
|
|
|
|
|
|
if(term_emit("\e\\", out, false)){
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
nc->rstate.pixelmode = false;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// write the nccell's UTF-8 extended grapheme cluster to the provided FILE*.
|
|
|
|
// write the nccell's UTF-8 extended grapheme cluster to the provided FILE*.
|
|
|
|
static int
|
|
|
|
static int
|
|
|
|
term_putc(FILE* out, const egcpool* e, const nccell* c){
|
|
|
|
term_putc(notcurses* nc, FILE* out, const egcpool* e, const nccell* c){
|
|
|
|
|
|
|
|
if(cell_pixels_p(c)){
|
|
|
|
|
|
|
|
if(!nc->rstate.pixelmode){
|
|
|
|
|
|
|
|
if(enter_pixel_mode(nc, out)){
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(ncfputs(egcpool_extended_gcluster(e, c), out) == EOF){
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
if(nc->rstate.pixelmode){
|
|
|
|
|
|
|
|
if(leave_pixel_mode(nc, out)){
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
if(cell_simple_p(c)){
|
|
|
|
if(cell_simple_p(c)){
|
|
|
|
//fprintf(stderr, "[%.4s] %08x\n", (const char*)&c->gcluster, c->gcluster); }
|
|
|
|
//fprintf(stderr, "[%.4s] %08x\n", (const char*)&c->gcluster, c->gcluster); }
|
|
|
|
// we must not have any 'cntrl' characters at this point
|
|
|
|
// we must not have any 'cntrl' characters at this point
|
|
|
@ -597,6 +632,7 @@ term_putc(FILE* out, const egcpool* e, const nccell* c){
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1027,7 +1063,7 @@ notcurses_rasterize_inner(notcurses* nc, const ncpile* p, FILE* out){
|
|
|
|
nc->rstate.bgpalelidable = false;
|
|
|
|
nc->rstate.bgpalelidable = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//fprintf(stderr, "RAST %08x [%s] to %d/%d cols: %u %016lx\n", srccell->gcluster, pool_extended_gcluster(&nc->pool, srccell), y, x, srccell->width, srccell->channels);
|
|
|
|
//fprintf(stderr, "RAST %08x [%s] to %d/%d cols: %u %016lx\n", srccell->gcluster, pool_extended_gcluster(&nc->pool, srccell), y, x, srccell->width, srccell->channels);
|
|
|
|
if(term_putc(out, &nc->pool, srccell)){
|
|
|
|
if(term_putc(nc, out, &nc->pool, srccell)){
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
++nc->rstate.x;
|
|
|
|
++nc->rstate.x;
|
|
|
|