Mon Jan 19 21:02:30 2004 Michael Jennings (mej)
Patch from David Lloyd <dmlloyd@tds.net> for overstrike support. SVN revision: 8577
This commit is contained in:
parent
8e26d97824
commit
020ab11571
|
@ -5164,3 +5164,7 @@ Sun Jan 11 17:09:07 2004 Michael Jennings (mej)
|
||||||
|
|
||||||
It's too bad you can't just say, "Copyright 1997-2999."
|
It's too bad you can't just say, "Copyright 1997-2999."
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
Mon Jan 19 21:02:30 2004 Michael Jennings (mej)
|
||||||
|
|
||||||
|
Patch from David Lloyd <dmlloyd@tds.net> for overstrike support.
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
|
29
src/screen.c
29
src/screen.c
|
@ -757,7 +757,7 @@ scr_add_lines(const unsigned char *str, int nlines, int len)
|
||||||
if (screen.row == screen.bscroll) {
|
if (screen.row == screen.bscroll) {
|
||||||
scroll_text(screen.tscroll, screen.bscroll, 1, 0);
|
scroll_text(screen.tscroll, screen.bscroll, 1, 0);
|
||||||
j = screen.bscroll + TermWin.saveLines;
|
j = screen.bscroll + TermWin.saveLines;
|
||||||
blank_screen_mem(screen.text, screen.rend, j, rstyle & ~RS_Uline);
|
blank_screen_mem(screen.text, screen.rend, j, rstyle & ~(RS_Uline|RS_Overscore));
|
||||||
} else if (screen.row < (TERM_WINDOW_GET_REPORTED_ROWS() - 1)) {
|
} else if (screen.row < (TERM_WINDOW_GET_REPORTED_ROWS() - 1)) {
|
||||||
screen.row++;
|
screen.row++;
|
||||||
row = screen.row + TermWin.saveLines;
|
row = screen.row + TermWin.saveLines;
|
||||||
|
@ -786,7 +786,7 @@ scr_add_lines(const unsigned char *str, int nlines, int len)
|
||||||
j = screen.bscroll + TermWin.saveLines;
|
j = screen.bscroll + TermWin.saveLines;
|
||||||
/* blank_line(screen.text[j], screen.rend[j], TermWin.ncol,
|
/* blank_line(screen.text[j], screen.rend[j], TermWin.ncol,
|
||||||
rstyle); Bug fix from John Ellison - need to reset rstyle */
|
rstyle); Bug fix from John Ellison - need to reset rstyle */
|
||||||
blank_screen_mem(screen.text, screen.rend, j, rstyle & ~RS_Uline);
|
blank_screen_mem(screen.text, screen.rend, j, rstyle & ~(RS_Uline|RS_Overscore));
|
||||||
} else if (screen.row < (TERM_WINDOW_GET_REPORTED_ROWS() - 1)) {
|
} else if (screen.row < (TERM_WINDOW_GET_REPORTED_ROWS() - 1)) {
|
||||||
screen.row++;
|
screen.row++;
|
||||||
row = screen.row + TermWin.saveLines;
|
row = screen.row + TermWin.saveLines;
|
||||||
|
@ -1004,9 +1004,9 @@ scr_erase_line(int mode)
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
blank_line(&(screen.text[row][col]), &(screen.rend[row][col]), num, rstyle & ~RS_Uline);
|
blank_line(&(screen.text[row][col]), &(screen.rend[row][col]), num, rstyle & ~(RS_Uline|RS_Overscore));
|
||||||
} else {
|
} else {
|
||||||
blank_screen_mem(screen.text, screen.rend, row, rstyle & ~RS_Uline);
|
blank_screen_mem(screen.text, screen.rend, row, rstyle & ~(RS_Uline|RS_Overscore));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1059,7 +1059,7 @@ scr_erase_screen(int mode)
|
||||||
}
|
}
|
||||||
if (row >= 0 && row <= TERM_WINDOW_GET_REPORTED_ROWS()) { /* check OOB */
|
if (row >= 0 && row <= TERM_WINDOW_GET_REPORTED_ROWS()) { /* check OOB */
|
||||||
UPPER_BOUND(num, (TERM_WINDOW_GET_REPORTED_ROWS() - row));
|
UPPER_BOUND(num, (TERM_WINDOW_GET_REPORTED_ROWS() - row));
|
||||||
if (rstyle & RS_RVid || rstyle & RS_Uline)
|
if (rstyle & RS_RVid || rstyle & RS_Uline || rstyle & RS_Overscore)
|
||||||
ren = -1;
|
ren = -1;
|
||||||
else {
|
else {
|
||||||
if (GET_BGCOLOR(rstyle) == bgColor) {
|
if (GET_BGCOLOR(rstyle) == bgColor) {
|
||||||
|
@ -1076,7 +1076,7 @@ scr_erase_screen(int mode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (; num--; row++) {
|
for (; num--; row++) {
|
||||||
blank_screen_mem(screen.text, screen.rend, row + row_offset, rstyle & ~(RS_RVid | RS_Uline));
|
blank_screen_mem(screen.text, screen.rend, row + row_offset, rstyle & ~(RS_RVid | RS_Uline | RS_Overscore));
|
||||||
blank_screen_mem(drawn_text, drawn_rend, row, ren);
|
blank_screen_mem(drawn_text, drawn_rend, row, ren);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2059,6 +2059,15 @@ scr_refresh(int type)
|
||||||
UPDATE_BOX(xpixel, ypixel - 1, xpixel + Width2Pixel(wlen) - 1, ypixel - 1);
|
UPDATE_BOX(xpixel, ypixel - 1, xpixel + Width2Pixel(wlen) - 1, ypixel - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (rend & RS_Overscore) {
|
||||||
|
if (ascent > 1) {
|
||||||
|
XDrawLine(Xdisplay, draw_buffer, TermWin.gc, xpixel, ypixel - ascent, xpixel + Width2Pixel(wlen) - 1, ypixel - ascent);
|
||||||
|
UPDATE_BOX(xpixel, ypixel + 1, xpixel + Width2Pixel(wlen) - 1, ypixel + 1);
|
||||||
|
} else {
|
||||||
|
XDrawLine(Xdisplay, draw_buffer, TermWin.gc, xpixel, ypixel - 1, xpixel + Width2Pixel(wlen) - 1, ypixel - 1);
|
||||||
|
UPDATE_BOX(xpixel, ypixel - 1, xpixel + Width2Pixel(wlen) - 1, ypixel - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (is_cursor == 1) {
|
if (is_cursor == 1) {
|
||||||
#ifndef NO_CURSORCOLOR
|
#ifndef NO_CURSORCOLOR
|
||||||
if (PixColors[cursorColor] != PixColors[bgColor]) {
|
if (PixColors[cursorColor] != PixColors[bgColor]) {
|
||||||
|
@ -3338,6 +3347,14 @@ debug_colors(void)
|
||||||
fprintf(stderr, "blink ");
|
fprintf(stderr, "blink ");
|
||||||
if (rstyle & RS_Uline)
|
if (rstyle & RS_Uline)
|
||||||
fprintf(stderr, "uline ");
|
fprintf(stderr, "uline ");
|
||||||
|
if (rstyle & RS_Overscore)
|
||||||
|
fprintf(stderr, "overscore ");
|
||||||
|
if (rstyle & RS_Italic)
|
||||||
|
fprintf(stderr, "italic ");
|
||||||
|
if (rstyle & RS_Dim)
|
||||||
|
fprintf(stderr, "dim ");
|
||||||
|
if (rstyle & RS_Conceal)
|
||||||
|
fprintf(stderr, "conceal ");
|
||||||
fprintf(stderr, "): ");
|
fprintf(stderr, "): ");
|
||||||
|
|
||||||
color = GET_FGCOLOR(rstyle);
|
color = GET_FGCOLOR(rstyle);
|
||||||
|
|
|
@ -115,11 +115,15 @@ enum {
|
||||||
#define RS_multiMask (RS_multi0|RS_multi1) /* multibyte mask */
|
#define RS_multiMask (RS_multi0|RS_multi1) /* multibyte mask */
|
||||||
#endif
|
#endif
|
||||||
#define RS_fgMask 0x00001F00u /* 32 colors */
|
#define RS_fgMask 0x00001F00u /* 32 colors */
|
||||||
|
#define RS_Overscore 0x00002000u /* overscore */
|
||||||
|
#define RS_Italic 0x00004000u /* italic */
|
||||||
#define RS_Bold 0x00008000u /* bold */
|
#define RS_Bold 0x00008000u /* bold */
|
||||||
#define RS_bgMask 0x001F0000u /* 32 colors */
|
#define RS_bgMask 0x001F0000u /* 32 colors */
|
||||||
|
#define RS_Dim 0x00200000u /* dim (apply alpha) */
|
||||||
|
#define RS_Conceal 0x00400000u /* conceal */
|
||||||
#define RS_Blink 0x00800000u /* blink */
|
#define RS_Blink 0x00800000u /* blink */
|
||||||
|
|
||||||
#define RS_attrMask (0xFF000000u|RS_Bold|RS_Blink)
|
#define RS_attrMask (0xFF000000u|RS_Overscore|RS_Italic|RS_Bold|RS_Dim|RS_Conceal|RS_Blink)
|
||||||
|
|
||||||
/* how to build & extract colors and attributes */
|
/* how to build & extract colors and attributes */
|
||||||
#define GET_FGCOLOR(r) (((r) & RS_fgMask)>>8)
|
#define GET_FGCOLOR(r) (((r) & RS_fgMask)>>8)
|
||||||
|
|
14
src/term.c
14
src/term.c
|
@ -1597,23 +1597,37 @@ process_sgr_mode(unsigned int nargs, int arg[])
|
||||||
case 1:
|
case 1:
|
||||||
scr_rendition(1, RS_Bold);
|
scr_rendition(1, RS_Bold);
|
||||||
break;
|
break;
|
||||||
|
case 2:
|
||||||
|
scr_rendition(1, RS_Dim);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
scr_rendition(1, RS_Italic);
|
||||||
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
scr_rendition(1, RS_Uline);
|
scr_rendition(1, RS_Uline);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
scr_rendition(1, RS_Blink);
|
scr_rendition(1, RS_Blink);
|
||||||
break;
|
break;
|
||||||
|
case 6:
|
||||||
|
scr_rendition(1, RS_Overscore);
|
||||||
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
scr_rendition(1, RS_RVid);
|
scr_rendition(1, RS_RVid);
|
||||||
break;
|
break;
|
||||||
|
case 8:
|
||||||
|
scr_rendition(1, RS_Conceal);
|
||||||
|
break;
|
||||||
case 22:
|
case 22:
|
||||||
scr_rendition(0, RS_Bold);
|
scr_rendition(0, RS_Bold);
|
||||||
|
scr_rendition(0, RS_Dim);
|
||||||
break;
|
break;
|
||||||
case 24:
|
case 24:
|
||||||
scr_rendition(0, RS_Uline);
|
scr_rendition(0, RS_Uline);
|
||||||
break;
|
break;
|
||||||
case 25:
|
case 25:
|
||||||
scr_rendition(0, RS_Blink);
|
scr_rendition(0, RS_Blink);
|
||||||
|
scr_rendition(0, RS_Overscore);
|
||||||
break;
|
break;
|
||||||
case 27:
|
case 27:
|
||||||
scr_rendition(0, RS_RVid);
|
scr_rendition(0, RS_RVid);
|
||||||
|
|
Loading…
Reference in New Issue