summaryrefslogtreecommitdiff
path: root/misc/dt/patches/patch-ad
diff options
context:
space:
mode:
authorfredb <fredb@pkgsrc.org>2002-02-11 18:30:21 +0000
committerfredb <fredb@pkgsrc.org>2002-02-11 18:30:21 +0000
commitf5134e1564e12674b1f2f944755e2055e18bdcf8 (patch)
treea9f9da864111257c2019435ffdc3416691acc043 /misc/dt/patches/patch-ad
parenta4a82e30d9e5dac46032d5b63bc9de449229449d (diff)
downloadpkgsrc-f5134e1564e12674b1f2f944755e2055e18bdcf8.tar.gz
Programs that follow Digital's recommendations will follow ESC(0 -- to
load the DEC Special Graphics (VT line draw) characters into graphics set GS0 -- with lock shift 0, aka LS0, aka SO, aka ^0 -- to then enable GS0. Since GS0 is the default, the full procedure is really only necessary when displaying line draw and alphanumeric characters on the same line. With the last patch to enable line draw characters, ESC(0 was always taken to mean ASCII SI (shift in), and ^0 was always taken to to mean SO (shift out), so for programs that did the right thing (e.g. "pstree"), "dt" was simply setting, then unsetting, the alternate character set attribute, causing the desired line draw characters never to be displayed. To deal with that, introduce a layer of abstraction, such that ESC(0 and friends now only set per-VT variables, rather than directly set the attribute. Initialize these variables so that SO and SI, taken alone, will do the expected thing, and extend the state machine so that a changed GS0 will become active at the next carriage return, or immediately if an LS0 was already seen on that line (all very much like a real VT). Bump version to dt-1.1.7nb2.
Diffstat (limited to 'misc/dt/patches/patch-ad')
-rw-r--r--misc/dt/patches/patch-ad130
1 files changed, 112 insertions, 18 deletions
diff --git a/misc/dt/patches/patch-ad b/misc/dt/patches/patch-ad
index 1291486cf5a..41f564b5bd6 100644
--- a/misc/dt/patches/patch-ad
+++ b/misc/dt/patches/patch-ad
@@ -1,37 +1,131 @@
-$NetBSD: patch-ad,v 1.1 2002/02/10 22:49:55 fredb Exp $
+$NetBSD: patch-ad,v 1.2 2002/02/11 18:30:23 fredb Exp $
--- vt.c.orig Fri May 24 10:13:52 1996
-+++ vt.c Thu Feb 7 09:12:59 2002
++++ vt.c
@@ -748,6 +748,9 @@
register int line, i;
if (v->state == ESnormal && ch >= ' ' && ch < 256) {
-+ if ( (v->attr & T_G0) && ch >= 'a' && ch <= 'z')
++ if ( (v->attr & T_LINEDRAW) && ch >= 'a' && ch <= 'z')
+ ch -= 95;
+
if (v->hanging_cursor) {
v->x = 0;
movecursordown(v);
-@@ -800,8 +803,10 @@
+@@ -796,13 +799,38 @@
+ v->hanging_cursor = 0; /* XXX Is this right? */
+ return;
+ case 13:
++ /*
++ * This is a hack! Do what I mean: after setting GS0,
++ * activate GS0 for next line, but don't just activate
++ * GS0 for every new line.
++ */
++ if (v->gset0changed) {
++ if (v->gset0 == S_ASCII)
++ v->attr &= ~T_LINEDRAW;
++ else
++ v->attr |= T_LINEDRAW;
++ v->gset0changed = 0;
++ v->gset0mapped = 0;
++ }
+ v->x = 0; /* Carriage return (^M) */
v->hanging_cursor = 0;
return;
case 14:
-+ v->attr |= T_G0;
- return; /* Alternate font (^N) */
+- return; /* Alternate font (^N) */
++ if (v->gset1 == S_ASCII)
++ v->attr &= ~T_LINEDRAW;
++ else
++ v->attr |= T_LINEDRAW;
++ return; /* Lock Shift 1 (^N) */
++ v->gset0changed = 0;
++ v->gset0mapped = 0;
case 15:
-+ v->attr &= ~T_G0;
- return; /* Normal font (^O) */
+- return; /* Normal font (^O) */
++ if (v->gset0 == S_ASCII)
++ v->attr &= ~T_LINEDRAW;
++ else
++ v->attr |= T_LINEDRAW;
++ v->gset0changed = 1; /* to clear map bit at EOL */
++ v->gset0mapped = 1;
++ return; /* Lock Shift 0 (^O) */
case 24: /* (^X) */
case 26:
-@@ -1071,9 +1076,11 @@
+ v->state = ESnormal; /* (^Z) */
+@@ -1070,36 +1098,38 @@
+ break;
case ESsetG0:
if (ch == '0') {
- /* Set graphics character set */
-+ v->attr |= T_G0;
- } else
- if (ch == 'B') {
- /* Set normal character set */
-+ v->attr &= ~T_G0;
- } else
- if (ch == 'U') {
- /* Set null character set */
+- /* Set graphics character set */
+- } else
+- if (ch == 'B') {
+- /* Set normal character set */
+- } else
+- if (ch == 'U') {
+- /* Set null character set */
+- } else
+- if (ch == 'K') {
+- /* Set user-defined character
+- * set */
+- }
+- /* If currently G0, then make active set */
++ v->gset0 = S_LINEDRAW;
++ if (v->gset0mapped)
++ /*
++ * Activate immediately. We'll still mark it
++ * changed, so the mapped bit will get cleared
++ * for the next line.
++ */
++ v->attr |= T_LINEDRAW;
++ v->gset0changed = 1;
++ } else if (ch == 'B') {
++ v->gset0 = S_ASCII;
++ if (v->gset0mapped)
++ /*
++ * Activate immediately. We'll still mark it
++ * changed, so the mapped bit will get cleared
++ * for the next line.
++ */
++ v->attr &= ~T_LINEDRAW;
++ v->gset0changed = 1;
++ }
+ v->state = ESnormal;
+ break;
++ /*
++ * Not very useful. Typically, G1 would be changed to one
++ * of the other character sets, which we don't support.
++ */
+ case ESsetG1:
+ if (ch == '0') {
+- /* Set graphics character set */
+- } else
+- if (ch == 'B') {
+- /* Set normal character set */
+- } else
+- if (ch == 'U') {
+- /* Set null character set */
+- } else
+- if (ch == 'K') {
+- /* Set user-defined character
+- * set */
+- }
+- /* If currently G1, then make active set */
++ v->gset1 = S_LINEDRAW;
++ } else if (ch == 'B') {
++ v->gset1 = S_ASCII;
++ }
+ v->state = ESnormal;
+ break;
+ default:
+@@ -1187,6 +1217,10 @@
+ v->tab_stop[3] = 0x01010101;
+ v->tab_stop[4] = 0x01010101;
+ v->copying = 0;
++ v->gset0 = S_ASCII;
++ v->gset0changed = 0;
++ v->gset0mapped = 0;
++ v->gset1 = S_LINEDRAW;
+ }
+ }
+