jim@uw-beaver.UUCP (07/05/83)
I have modified TrmTERM.c in the recently posted Maryland window package to support graphics mode on a Heath/Zenith h-19. A cleaner way to do this would have been to add graphics to termcap or write a TrmH19.c, but I was feeling lazy so I just hacked it in. *** TrmTERM.c_o Thu Mar 10 19:49:32 1983 --- TrmTERM.c Fri Jun 10 15:20:20 1983 *************** *** 21,26 * - Secured the cost algorithms from buffer overflow (16-Jul-82) * - Does not use standout if 'sg#' is nonzero. * Modified by Chris Torek (ACT): added %m cursor motion code */ /* --- 21,27 ----- * - Secured the cost algorithms from buffer overflow (16-Jul-82) * - Does not use standout if 'sg#' is nonzero. * Modified by Chris Torek (ACT): added %m cursor motion code + * Modified by Jim Rees at UW for frames on h19 (ugly!) */ #define H19 /* For special gross h19 hacks */ *************** *** 23,28 * Modified by Chris Torek (ACT): added %m cursor motion code */ /* * Notes on things not normally in TERMCAP: * :rn: indicates that \r acts like \r\n --- 24,31 ----- * Modified by Jim Rees at UW for frames on h19 (ugly!) */ + #define H19 /* For special gross h19 hacks */ + /* * Notes on things not normally in TERMCAP: * :rn: indicates that \r acts like \r\n *************** *** 45,50 static int curX, curY; char *tgetstr (), *getenv (); char *UP, *BC, PC; --- 48,56 ----- static int curX, curY; + #ifdef H19 + static int CurGraph; + #endif H19 char *tgetstr (), *getenv (); char *UP, *BC, PC; *************** *** 187,192 putchar (' '); putchar (*BC); } if (HZflag && *start == '~') putchar ('`'), ++start; else putchar (*start++); if (CurMode == m_insert && ICPDstr) --- 193,199 ----- putchar (' '); putchar (*BC); } + #ifndef H19 if (HZflag && *start == '~') putchar ('`'), ++start; else putchar (*start++); #else H19 *************** *** 189,194 } if (HZflag && *start == '~') putchar ('`'), ++start; else putchar (*start++); if (CurMode == m_insert && ICPDstr) tputs(ICPDstr, W_tt.t_width-curX, dumpchar); curX++; --- 196,217 ----- #ifndef H19 if (HZflag && *start == '~') putchar ('`'), ++start; else putchar (*start++); + #else H19 + if (*start & 0x80) { + if (CurGraph == 0) { + printf ("\033F"); + CurGraph = 1; + } + putchar (*start++ & 0x7f); + } + else { + if (CurGraph && *start != ' ') { + printf ("\033G"); + CurGraph = 0; + } + putchar (*start++); + } + #endif H19 if (CurMode == m_insert && ICPDstr) tputs(ICPDstr, W_tt.t_width-curX, dumpchar); curX++; *************** *** 507,512 ULINEOFF |= WINVERSE; HLOFF |= WULINE; } return 0; }; --- 530,550 ----- ULINEOFF |= WINVERSE; HLOFF |= WULINE; } + #ifdef H19 + /* + * Special gross hack for h19 by Jim Rees + */ + if (!strcmp(getenv("TERM"), "h19")) { + W_tt.t_frames[0] = 'f' | 0x80; /* ulc */ + W_tt.t_frames[1] = + W_tt.t_frames[6] = 'a' | 0x80; /* top, bottom */ + W_tt.t_frames[2] = 'c' | 0x80; /* urc */ + W_tt.t_frames[3] = + W_tt.t_frames[4] = '`' | 0x80; /* left, right */ + W_tt.t_frames[5] = 'e' | 0x80; /* llc */ + W_tt.t_frames[7] = 'd' | 0x80; /* lrc */ + } + #endif H19 return 0; }; *************** *** 527,532 if (TIstr) tputs(TIstr, 0, dumpchar); if (VSstr) tputs(VSstr, 0, dumpchar); tputs(ESstr, 0, dumpchar); /* Also homes cursor: */ curX = curY = 1; CurMode = m_insert; DesMode = m_overwrite; --- 565,573 ----- if (TIstr) tputs(TIstr, 0, dumpchar); if (VSstr) tputs(VSstr, 0, dumpchar); tputs(ESstr, 0, dumpchar); /* Also homes cursor: */ + #ifdef H19 + CurGraph = 0; + #endif H19 curX = curY = 1; CurMode = m_insert; DesMode = m_overwrite; *************** *** 545,550 static wipeline (z,p) register p; { clearmodes (); if (ELstr) tputs (ELstr, W_tt.t_width-curX, dumpchar); else { register i = p - curX + 1/*, oldX = curX*/; --- 586,597 ----- static wipeline (z,p) register p; { clearmodes (); + #ifdef H19 + if (CurGraph) { + printf ("\033G"); + CurGraph = 0; + } + #endif H19 if (ELstr) tputs (ELstr, W_tt.t_width-curX, dumpchar); else { register i = p - curX + 1/*, oldX = curX*/;
jim@uw-beaver.UUCP (07/05/83)
Relay-Version:version B 2.10 5/3/83; site wjh12.UUCP Posting-Version:version B 2.10 5/3/83; site uw-beaver Path:wjh12!genrad!decvax!harpo!eagle!mhuxt!mhuxi!mhuxa!houxm!hogpc!houti!ariel!vax135!cornell!uw-beaver!jim Message-ID:<696@uw-beaver> Date:Tue, 5-Jul-83 16:05:06 EDT Organization:U of Washington Computer Science I have modified TrmTERM.c in the recently posted Maryland window package to support graphics mode on a Heath/Zenith h-19. A cleaner way to do this would have been to add graphics to termcap or write a TrmH19.c, but I was feeling lazy so I just hacked it in. *** TrmTERM.c_o Thu Mar 10 19:49:32 1983 --- TrmTERM.c Fri Jun 10 15:20:20 1983 *************** *** 21,26 * - Secured the cost algorithms from buffer overflow (16-Jul-82) * - Does not use standout if 'sg#' is nonzero. * Modified by Chris Torek (ACT): added %m cursor motion code */ /* --- 21,27 ----- * - Secured the cost algorithms from buffer overflow (16-Jul-82) * - Does not use standout if 'sg#' is nonzero. * Modified by Chris Torek (ACT): added %m cursor motion code + * Modified by Jim Rees at UW for frames on h19 (ugly!) */ #define H19 /* For special gross h19 hacks */ *************** *** 23,28 * Modified by Chris Torek (ACT): added %m cursor motion code */ /* * Notes on things not normally in TERMCAP: * :rn: indicates that \r acts like \r\n --- 24,31 ----- * Modified by Jim Rees at UW for frames on h19 (ugly!) */ + #define H19 /* For special gross h19 hacks */ + /* * Notes on things not normally in TERMCAP: * :rn: indicates that \r acts like \r\n *************** *** 45,50 static int curX, curY; char *tgetstr (), *getenv (); char *UP, *BC, PC; --- 48,56 ----- static int curX, curY; + #ifdef H19 + static int CurGraph; + #endif H19 char *tgetstr (), *getenv (); char *UP, *BC, PC; *************** *** 187,192 putchar (' '); putchar (*BC); } if (HZflag && *start == '~') putchar ('`'), ++start; else putchar (*start++); if (CurMode == m_insert && ICPDstr) --- 193,199 ----- putchar (' '); putchar (*BC); } + #ifndef H19 if (HZflag && *start == '~') putchar ('`'), ++start; else putchar (*start++); #else H19 *************** *** 189,194 } if (HZflag && *start == '~') putchar ('`'), ++start; else putchar (*start++); if (CurMode == m_insert && ICPDstr) tputs(ICPDstr, W_tt.t_width-curX, dumpchar); curX++; --- 196,217 ----- #ifndef H19 if (HZflag && *start == '~') putchar ('`'), ++start; else putchar (*start++); + #else H19 + if (*start & 0x80) { + if (CurGraph == 0) { + printf ("\033F"); + CurGraph = 1; + } + putchar (*start++ & 0x7f); + } + else { + if (CurGraph && *start != ' ') { + printf ("\033G"); + CurGraph = 0; + } + putchar (*start++); + } + #endif H19 if (CurMode == m_insert && ICPDstr) tputs(ICPDstr, W_tt.t_width-curX, dumpchar); curX++; *************** *** 507,512 ULINEOFF |= WINVERSE; HLOFF |= WULINE; } return 0; }; --- 530,550 ----- ULINEOFF |= WINVERSE; HLOFF |= WULINE; } + #ifdef H19 + /* + * Special gross hack for h19 by Jim Rees + */ + if (!strcmp(getenv("TERM"), "h19")) { + W_tt.t_frames[0] = 'f' | 0x80; /* ulc */ + W_tt.t_frames[1] = + W_tt.t_frames[6] = 'a' | 0x80; /* top, bottom */ + W_tt.t_frames[2] = 'c' | 0x80; /* urc */ + W_tt.t_frames[3] = + W_tt.t_frames[4] = '`' | 0x80; /* left, right */ + W_tt.t_frames[5] = 'e' | 0x80; /* llc */ + W_tt.t_frames[7] = 'd' | 0x80; /* lrc */ + } + #endif H19 return 0; }; *************** *** 527,532 if (TIstr) tputs(TIstr, 0, dumpchar); if (VSstr) tputs(VSstr, 0, dumpchar); tputs(ESstr, 0, dumpchar); /* Also homes cursor: */ curX = curY = 1; CurMode = m_insert; DesMode = m_overwrite; --- 565,573 ----- if (TIstr) tputs(TIstr, 0, dumpchar); if (VSstr) tputs(VSstr, 0, dumpchar); tputs(ESstr, 0, dumpchar); /* Also homes cursor: */ + #ifdef H19 + CurGraph = 0; + #endif H19 curX = curY = 1; CurMode = m_insert; DesMode = m_overwrite; *************** *** 545,550 static wipeline (z,p) register p; { clearmodes (); if (ELstr) tputs (ELstr, W_tt.t_width-curX, dumpchar); else { register i = p - curX + 1/*, oldX = curX*/; --- 586,597 ----- static wipeline (z,p) register p; { clearmodes (); + #ifdef H19 + if (CurGraph) { + printf ("\033G"); + CurGraph = 0; + } + #endif H19 if (ELstr) tputs (ELstr, W_tt.t_width-curX, dumpchar); else { register i = p - curX + 1/*, oldX = curX*/;