xref: /dragonfly/usr.bin/window/tth29.c (revision 86d7f5d3)
1 /*	@(#)tth29.c	8.1 (Berkeley) 6/6/93	*/
2 /*	$NetBSD: tth29.c,v 1.6 2003/08/07 11:17:31 agc Exp $	*/
3 
4 /*
5  * Copyright (c) 1983, 1993
6  *	The Regents of the University of California.  All rights reserved.
7  *
8  * This code is derived from software contributed to Berkeley by
9  * Edward Wang at The University of California, Berkeley.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright
17  *    notice, this list of conditions and the following disclaimer in the
18  *    documentation and/or other materials provided with the distribution.
19  * 3. Neither the name of the University nor the names of its contributors
20  *    may be used to endorse or promote products derived from this software
21  *    without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33  * SUCH DAMAGE.
34  */
35 
36 #include "ww.h"
37 #include "tt.h"
38 #include "char.h"
39 
40 /*
41  * H29 Driver
42  *
43  * WWM_USR mode is alternate character set.
44  *
45 kC|h29|heath-29|z29|zenith-29:\
46 	:am:bc=\ED:bt=\E-:cr=^M:do=^J:nl=^J:bl=^G:\
47 	:al=\EL:le=^H:bs:cd=\EJ:ce=\EK:cl=\EE:cm=\EY%+ %+ :co#80:dc=\EN:\
48 	:dl=1*\EM:do=\EB:ei=\EO:ho=\EH:im=\E@:li#24:mi:nd=\EC:as=\EF:ae=\EG:\
49 	:ms:ta=^I:pt:sr=\EI:se=\Eq:so=\Ep:up=\EA:vs=\Ex4:ve=\Ey4:\
50 	:kb=^H:ku=\EA:kd=\EB:kl=\ED:kr=\EC:kh=\EH:kn#1:k0=\E~:l0=HOME:\
51 	:k1=\ES:k2=\ET:k3=\EU:k4=\EV:k5=\EW:k6=\EP:k7=\EQ:k8=\ER:k9=\E01:\
52 	:es:hs:ts=\Ej\Ex5\Ex1\EY8%+ \Eo:fs=\Ek\Ey5:ds=\Ey1:us=\Es8:ue=\Es0:
53  *
54  */
55 
56 void	h29_setmodes(int);
57 
58 void
h29_setmodes(int new)59 h29_setmodes(int new)
60 {
61 	int modes = '0';
62 
63 	if (new & WWM_REV)
64 		modes += 0x01;
65 	if (new & WWM_BLK)
66 		modes += 0x02;
67 	if (new & WWM_DIM)
68 		modes += 0x04;
69 	if (new & WWM_UL)
70 		modes += 0x08;
71 	if (new & WWM_USR)
72 		modes += 0x10;
73 	ttesc('s');
74 	ttputc(modes);
75 	if (new & WWM_GRP) {
76 		if ((tt.tt_modes & WWM_GRP) == 0)
77 			ttesc('F');
78 	} else
79 		if (tt.tt_modes & WWM_GRP)
80 			ttesc('G');
81 	tt.tt_modes = new;
82 }
83 
84 int
tt_h29(void)85 tt_h29(void)
86 {
87 	if (tt_h19() < 0)
88 		return -1;
89 	tt.tt_setmodes = h29_setmodes;
90 	tt.tt_availmodes |= WWM_BLK|WWM_UL|WWM_DIM|WWM_USR;
91 	return 0;
92 }
93