summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Jennings <mej@kainx.org>2004-01-20 02:04:04 +0000
committerMichael Jennings <mej@kainx.org>2004-01-20 02:04:04 +0000
commit020ab11571a4776839d658c46b1f21f78ff9c49a (patch)
tree4ca946672626a9ff00b0aff43946b4f787d88839
parent8e26d978240646dd282ddb5faabf6322a0fb5cf2 (diff)
downloadeterm-020ab11571a4776839d658c46b1f21f78ff9c49a.tar.gz
Mon Jan 19 21:02:30 2004 Michael Jennings (mej)
Patch from David Lloyd <dmlloyd@tds.net> for overstrike support. SVN revision: 8577
-rw-r--r--ChangeLog4
-rw-r--r--src/screen.c29
-rw-r--r--src/screen.h6
-rw-r--r--src/term.c14
4 files changed, 46 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 924be67..196765c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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."
----------------------------------------------------------------------
+Mon Jan 19 21:02:30 2004 Michael Jennings (mej)
+
+Patch from David Lloyd <dmlloyd@tds.net> for overstrike support.
+----------------------------------------------------------------------
diff --git a/src/screen.c b/src/screen.c
index 3e2d1ab..5062f49 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -757,7 +757,7 @@ scr_add_lines(const unsigned char *str, int nlines, int len)
if (screen.row == screen.bscroll) {
scroll_text(screen.tscroll, screen.bscroll, 1, 0);
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)) {
screen.row++;
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;
/* blank_line(screen.text[j], screen.rend[j], TermWin.ncol,
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)) {
screen.row++;
row = screen.row + TermWin.saveLines;
@@ -1004,9 +1004,9 @@ scr_erase_line(int mode)
default:
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 {
- 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 */
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;
else {
if (GET_BGCOLOR(rstyle) == bgColor) {
@@ -1076,7 +1076,7 @@ scr_erase_screen(int mode)
}
}
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);
}
}
@@ -2059,6 +2059,15 @@ scr_refresh(int type)
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) {
#ifndef NO_CURSORCOLOR
if (PixColors[cursorColor] != PixColors[bgColor]) {
@@ -3338,6 +3347,14 @@ debug_colors(void)
fprintf(stderr, "blink ");
if (rstyle & RS_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, "): ");
color = GET_FGCOLOR(rstyle);
diff --git a/src/screen.h b/src/screen.h
index 0a9fc96..063caff 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -115,11 +115,15 @@ enum {
#define RS_multiMask (RS_multi0|RS_multi1) /* multibyte mask */
#endif
#define RS_fgMask 0x00001F00u /* 32 colors */
+#define RS_Overscore 0x00002000u /* overscore */
+#define RS_Italic 0x00004000u /* italic */
#define RS_Bold 0x00008000u /* bold */
#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_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 */
#define GET_FGCOLOR(r) (((r) & RS_fgMask)>>8)
diff --git a/src/term.c b/src/term.c
index bf33859..c28138f 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1597,23 +1597,37 @@ process_sgr_mode(unsigned int nargs, int arg[])
case 1:
scr_rendition(1, RS_Bold);
break;
+ case 2:
+ scr_rendition(1, RS_Dim);
+ break;
+ case 3:
+ scr_rendition(1, RS_Italic);
+ break;
case 4:
scr_rendition(1, RS_Uline);
break;
case 5:
scr_rendition(1, RS_Blink);
break;
+ case 6:
+ scr_rendition(1, RS_Overscore);
+ break;
case 7:
scr_rendition(1, RS_RVid);
break;
+ case 8:
+ scr_rendition(1, RS_Conceal);
+ break;
case 22:
scr_rendition(0, RS_Bold);
+ scr_rendition(0, RS_Dim);
break;
case 24:
scr_rendition(0, RS_Uline);
break;
case 25:
scr_rendition(0, RS_Blink);
+ scr_rendition(0, RS_Overscore);
break;
case 27:
scr_rendition(0, RS_RVid);