xref: /csrg-svn/usr.bin/window/tth29.c (revision 33514)
118757Sedward /*
2*33514Sbostic  * Copyright (c) 1983 Regents of the University of California.
3*33514Sbostic  * All rights reserved.
4*33514Sbostic  *
5*33514Sbostic  * Redistribution and use in source and binary forms are permitted
6*33514Sbostic  * provided that this notice is preserved and that due credit is given
7*33514Sbostic  * to the University of California at Berkeley. The name of the University
8*33514Sbostic  * may not be used to endorse or promote products derived from this
9*33514Sbostic  * software without specific prior written permission. This software
10*33514Sbostic  * is provided ``as is'' without express or implied warranty.
1118757Sedward  */
1218757Sedward 
13*33514Sbostic #ifndef lint
14*33514Sbostic static char sccsid[] = "@(#)tth29.c	3.5 (Berkeley) 02/21/88";
15*33514Sbostic #endif /* not lint */
16*33514Sbostic 
1717411Sedward #include "ww.h"
1817411Sedward #include "tt.h"
1917411Sedward 
2017411Sedward /*
2129712Sedward  * H29 Driver
2229712Sedward  *
2329712Sedward  * WWM_USR mode is alternate character set.
2429712Sedward  *
2517411Sedward kC|h29|heath-29|z29|zenith-29:\
2617411Sedward 	:am:bc=\ED:bt=\E-:cr=^M:do=^J:nl=^J:bl=^G:\
2717411Sedward 	:al=\EL:le=^H:bs:cd=\EJ:ce=\EK:cl=\EE:cm=\EY%+ %+ :co#80:dc=\EN:\
2817411Sedward 	:dl=1*\EM:do=\EB:ei=\EO:ho=\EH:im=\E@:li#24:mi:nd=\EC:as=\EF:ae=\EG:\
2917411Sedward 	:ms:ta=^I:pt:sr=\EI:se=\Eq:so=\Ep:up=\EA:vs=\Ex4:ve=\Ey4:\
3017411Sedward 	:kb=^H:ku=\EA:kd=\EB:kl=\ED:kr=\EC:kh=\EH:kn#1:k0=\E~:l0=HOME:\
3117411Sedward 	:k1=\ES:k2=\ET:k3=\EU:k4=\EV:k5=\EW:k6=\EP:k7=\EQ:k8=\ER:k9=\E01:\
3217411Sedward 	:es:hs:ts=\Ej\Ex5\Ex1\EY8%+ \Eo:fs=\Ek\Ey5:ds=\Ey1:us=\Es8:ue=\Es0:
3329712Sedward  *
3429712Sedward  */
3517411Sedward 
3617411Sedward #define pc(c)	ttputc('c')
3717411Sedward #define esc()	pc(\033)
3817411Sedward 
3917411Sedward h29_setmodes(new)
4017411Sedward register new;
4117411Sedward {
4217411Sedward 	register modes = '0';
4317411Sedward 
4417411Sedward 	if (new & WWM_REV)
4529712Sedward 		modes += 0x01;
4617411Sedward 	if (new & WWM_BLK)
4729712Sedward 		modes += 0x02;
4829712Sedward 	if (new & WWM_DIM)
4929712Sedward 		modes += 0x04;
5017411Sedward 	if (new & WWM_UL)
5129712Sedward 		modes += 0x08;
5229712Sedward 	if (new & WWM_USR)
5329712Sedward 		modes += 0x10;
5417411Sedward 	esc();
5517411Sedward 	pc(s);
5617411Sedward 	ttputc(modes);
5717411Sedward 	if (new & WWM_GRP) {
5817411Sedward 		if ((tt.tt_modes & WWM_GRP) == 0)
5917411Sedward 			esc(), pc(F);
6017411Sedward 	} else
6117411Sedward 		if (tt.tt_modes & WWM_GRP)
6217411Sedward 			esc(), pc(G);
6317411Sedward 	tt.tt_modes = new;
6417411Sedward }
6517411Sedward 
6617411Sedward tt_h29()
6717411Sedward {
6817411Sedward 	if (tt_h19() < 0)
6917411Sedward 		return -1;
7024289Sedward 	tt.tt_setmodes = h29_setmodes;
7129712Sedward 	tt.tt_availmodes |= WWM_BLK|WWM_UL|WWM_DIM|WWM_USR;
7217411Sedward 	return 0;
7317411Sedward }
74