static void scteken_putchar(void *arg, const teken_pos_t *tp, teken_char_t c, const teken_attr_t *a) { scr_stat *scp = arg; u_char *map; u_char ch; vm_offset_t p; int cursor, attr; attr = scteken_attr(a) << 8; #ifdef TEKEN_UTF8 scteken_get_cp437(&c, &attr); #endif /* TEKEN_UTF8 */ ch = c; map = scp->sc->scr_map; cursor = tp->tp_row * scp->xsize + tp->tp_col; p = sc_vtb_pointer(&scp->vtb, cursor); sc_vtb_putchar(&scp->vtb, p, map[ch], attr); mark_for_update(scp, cursor); /* * XXX: Why do we need this? Only marking `cursor' should be * enough. Without this line, we get artifacts. */ mark_for_update(scp, imin(cursor + 1, scp->xsize * scp->ysize - 1)); }
static void scteken_fill(void *arg, const teken_rect_t *r, teken_char_t c, const teken_attr_t *a) { scr_stat *scp = arg; u_char *map; u_char ch; unsigned int width; int attr, row; attr = scteken_attr(a) << 8; #ifdef TEKEN_UTF8 scteken_get_cp437(&c, &attr); #endif /* TEKEN_UTF8 */ ch = c; map = scp->sc->scr_map; if (r->tr_begin.tp_col == 0 && r->tr_end.tp_col == scp->xsize) { /* Single contiguous region to fill. */ sc_vtb_erase(&scp->vtb, r->tr_begin.tp_row * scp->xsize, (r->tr_end.tp_row - r->tr_begin.tp_row) * scp->xsize, map[ch], attr); } else { /* Fill display line by line. */ width = r->tr_end.tp_col - r->tr_begin.tp_col; for (row = r->tr_begin.tp_row; row < r->tr_end.tp_row; row++) { sc_vtb_erase(&scp->vtb, r->tr_begin.tp_row * scp->xsize + r->tr_begin.tp_col, width, map[ch], attr); } } /* Mark begin and end positions to be refreshed. */ mark_for_update(scp, r->tr_begin.tp_row * scp->xsize + r->tr_begin.tp_col); mark_for_update(scp, (r->tr_end.tp_row - 1) * scp->xsize + (r->tr_end.tp_col - 1)); sc_remove_cutmarking(scp); }
static void scteken_putchar(void *arg, const teken_pos_t *tp, teken_char_t c, const teken_attr_t *a) { scr_stat *scp = arg; u_char *map; u_char ch; vm_offset_t p; int cursor, attr; /* * No support for printing right hand sides for CJK fullwidth * characters. Simply print a space and assume that the left * hand side describes the entire character. */ attr = scteken_attr(a) << 8; if (a->ta_format & TF_CJK_RIGHT) c = ' '; #ifdef TEKEN_UTF8 scteken_get_cp437(&c, &attr); #endif /* TEKEN_UTF8 */ ch = c; map = scp->sc->scr_map; cursor = tp->tp_row * scp->xsize + tp->tp_col; p = sc_vtb_pointer(&scp->vtb, cursor); sc_vtb_putchar(&scp->vtb, p, map[ch], attr); mark_for_update(scp, cursor); /* * XXX: Why do we need this? Only marking `cursor' should be * enough. Without this line, we get artifacts. */ mark_for_update(scp, imin(cursor + 1, scp->xsize * scp->ysize - 1)); }