itevar.h revision 1.8.8.2 1 1.8.8.2 nathanw /* $NetBSD: itevar.h,v 1.8.8.2 2002/09/17 21:13:46 nathanw Exp $ */
2 1.8.8.2 nathanw
3 1.8.8.2 nathanw /*
4 1.8.8.2 nathanw * Copyright (c) 1995 Leo Weppelman (Atari modifications)
5 1.8.8.2 nathanw * Copyright (c) 1994 Christian E. Hopps
6 1.8.8.2 nathanw * All rights reserved.
7 1.8.8.2 nathanw *
8 1.8.8.2 nathanw * Redistribution and use in source and binary forms, with or without
9 1.8.8.2 nathanw * modification, are permitted provided that the following conditions
10 1.8.8.2 nathanw * are met:
11 1.8.8.2 nathanw * 1. Redistributions of source code must retain the above copyright
12 1.8.8.2 nathanw * notice, this list of conditions and the following disclaimer.
13 1.8.8.2 nathanw * 2. Redistributions in binary form must reproduce the above copyright
14 1.8.8.2 nathanw * notice, this list of conditions and the following disclaimer in the
15 1.8.8.2 nathanw * documentation and/or other materials provided with the distribution.
16 1.8.8.2 nathanw * 3. All advertising materials mentioning features or use of this software
17 1.8.8.2 nathanw * must display the following acknowledgement:
18 1.8.8.2 nathanw * This product includes software developed by Christian E. Hopps.
19 1.8.8.2 nathanw * 4. The name of the author may not be used to endorse or promote products
20 1.8.8.2 nathanw * derived from this software without specific prior written permission
21 1.8.8.2 nathanw *
22 1.8.8.2 nathanw * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 1.8.8.2 nathanw * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 1.8.8.2 nathanw * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 1.8.8.2 nathanw * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 1.8.8.2 nathanw * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 1.8.8.2 nathanw * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 1.8.8.2 nathanw * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 1.8.8.2 nathanw * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 1.8.8.2 nathanw * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 1.8.8.2 nathanw * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 1.8.8.2 nathanw */
33 1.8.8.2 nathanw
34 1.8.8.2 nathanw #ifndef _ITEVAR_H
35 1.8.8.2 nathanw #define _ITEVAR_H
36 1.8.8.2 nathanw
37 1.8.8.2 nathanw #include <atari/dev/font.h>
38 1.8.8.2 nathanw
39 1.8.8.2 nathanw enum ite_arraymaxs {
40 1.8.8.2 nathanw MAX_ARGSIZE = 256,
41 1.8.8.2 nathanw MAX_TABS = 256,
42 1.8.8.2 nathanw };
43 1.8.8.2 nathanw
44 1.8.8.2 nathanw enum ite_attr {
45 1.8.8.2 nathanw ATTR_NOR = 0,
46 1.8.8.2 nathanw ATTR_INV = 1,
47 1.8.8.2 nathanw ATTR_UL = 2,
48 1.8.8.2 nathanw ATTR_BOLD = 4,
49 1.8.8.2 nathanw ATTR_BLINK = 8,
50 1.8.8.2 nathanw ATTR_ALL = 16-1,
51 1.8.8.2 nathanw
52 1.8.8.2 nathanw ATTR_KEYPAD = 0x80 /* XXX */
53 1.8.8.2 nathanw };
54 1.8.8.2 nathanw
55 1.8.8.2 nathanw struct ite_softc {
56 1.8.8.2 nathanw struct device device; /* _Must_ be first */
57 1.8.8.2 nathanw char argbuf[MAX_ARGSIZE];
58 1.8.8.2 nathanw struct grf_softc *grf; /* XXX */
59 1.8.8.2 nathanw char *ap;
60 1.8.8.2 nathanw struct tty *tp;
61 1.8.8.2 nathanw void *priv;
62 1.8.8.2 nathanw font_info font;
63 1.8.8.2 nathanw u_char *tabs;
64 1.8.8.2 nathanw struct kbdmap *kbdmap;
65 1.8.8.2 nathanw int flags;
66 1.8.8.2 nathanw short cursorx;
67 1.8.8.2 nathanw short cursory;
68 1.8.8.2 nathanw short rows;
69 1.8.8.2 nathanw short cols;
70 1.8.8.2 nathanw u_char *cursor;
71 1.8.8.2 nathanw char imode;
72 1.8.8.2 nathanw u_char escape;
73 1.8.8.2 nathanw u_char cursor_opt;
74 1.8.8.2 nathanw u_char key_repeat;
75 1.8.8.2 nathanw char GL;
76 1.8.8.2 nathanw char GR;
77 1.8.8.2 nathanw char G0;
78 1.8.8.2 nathanw char G1;
79 1.8.8.2 nathanw char G2;
80 1.8.8.2 nathanw char G3;
81 1.8.8.2 nathanw char linefeed_newline;
82 1.8.8.2 nathanw char auto_wrap;
83 1.8.8.2 nathanw char cursor_appmode;
84 1.8.8.2 nathanw char keypad_appmode;
85 1.8.8.2 nathanw short top_margin;
86 1.8.8.2 nathanw short bottom_margin;
87 1.8.8.2 nathanw short inside_margins;
88 1.8.8.2 nathanw short eightbit_C1;
89 1.8.8.2 nathanw short emul_level;
90 1.8.8.2 nathanw enum ite_attr attribute;
91 1.8.8.2 nathanw enum ite_attr save_attribute;
92 1.8.8.2 nathanw int curx;
93 1.8.8.2 nathanw int save_curx;
94 1.8.8.2 nathanw int cury;
95 1.8.8.2 nathanw int save_cury;
96 1.8.8.2 nathanw int (*itexx_ioctl) __P((struct ite_softc *, u_long,
97 1.8.8.2 nathanw caddr_t, int, struct proc *));
98 1.8.8.2 nathanw };
99 1.8.8.2 nathanw
100 1.8.8.2 nathanw enum ite_flags {
101 1.8.8.2 nathanw ITE_ALIVE = 0x1, /* grf layer is configed */
102 1.8.8.2 nathanw ITE_ISCONS = 0x2, /* ite is acting console. */
103 1.8.8.2 nathanw ITE_INITED = 0x4, /* ite has been inited. */
104 1.8.8.2 nathanw ITE_ISOPEN = 0x8, /* ite has been opened */
105 1.8.8.2 nathanw ITE_INGRF = 0x10, /* ite is in graphics mode */
106 1.8.8.2 nathanw ITE_ACTIVE = 0x20, /* ite is an active terminal */
107 1.8.8.2 nathanw };
108 1.8.8.2 nathanw
109 1.8.8.2 nathanw enum ite_replrules {
110 1.8.8.2 nathanw RR_CLEAR = 0,
111 1.8.8.2 nathanw RR_COPY = 0x3,
112 1.8.8.2 nathanw RR_XOR = 0x6,
113 1.8.8.2 nathanw RR_COYINVERTED = 0xC
114 1.8.8.2 nathanw };
115 1.8.8.2 nathanw
116 1.8.8.2 nathanw enum ite_scrolldir {
117 1.8.8.2 nathanw SCROLL_UP = 1,
118 1.8.8.2 nathanw SCROLL_DOWN,
119 1.8.8.2 nathanw SCROLL_LEFT,
120 1.8.8.2 nathanw SCROLL_RIGHT,
121 1.8.8.2 nathanw };
122 1.8.8.2 nathanw
123 1.8.8.2 nathanw enum ite_cursact {
124 1.8.8.2 nathanw DRAW_CURSOR = 5,
125 1.8.8.2 nathanw ERASE_CURSOR,
126 1.8.8.2 nathanw MOVE_CURSOR,
127 1.8.8.2 nathanw START_CURSOROPT,
128 1.8.8.2 nathanw END_CURSOROPT
129 1.8.8.2 nathanw };
130 1.8.8.2 nathanw
131 1.8.8.2 nathanw enum ite_special_keycodes {
132 1.8.8.2 nathanw KBD_LEFT_SHIFT = 0x2a,
133 1.8.8.2 nathanw KBD_RIGHT_SHIFT = 0x36,
134 1.8.8.2 nathanw KBD_CAPS_LOCK = 0x3a,
135 1.8.8.2 nathanw KBD_CTRL = 0x1d,
136 1.8.8.2 nathanw KBD_ALT = 0x38
137 1.8.8.2 nathanw };
138 1.8.8.2 nathanw
139 1.8.8.2 nathanw enum ite_modifiers {
140 1.8.8.2 nathanw KBD_MOD_LSHIFT = 0x01,
141 1.8.8.2 nathanw KBD_MOD_RSHIFT = 0x02,
142 1.8.8.2 nathanw KBD_MOD_CTRL = 0x04,
143 1.8.8.2 nathanw KBD_MOD_ALT = 0x08,
144 1.8.8.2 nathanw KBD_MOD_CAPS = 0x10,
145 1.8.8.2 nathanw KBD_MOD_SHIFT = (KBD_MOD_LSHIFT | KBD_MOD_RSHIFT)
146 1.8.8.2 nathanw };
147 1.8.8.2 nathanw
148 1.8.8.2 nathanw enum caller {
149 1.8.8.2 nathanw ITEFILT_TTY,
150 1.8.8.2 nathanw ITEFILT_CONSOLE,
151 1.8.8.2 nathanw ITEFILT_REPEATER
152 1.8.8.2 nathanw };
153 1.8.8.2 nathanw
154 1.8.8.2 nathanw enum emul_level {
155 1.8.8.2 nathanw EMUL_VT100 = 1,
156 1.8.8.2 nathanw EMUL_VT300_8,
157 1.8.8.2 nathanw EMUL_VT300_7
158 1.8.8.2 nathanw };
159 1.8.8.2 nathanw
160 1.8.8.2 nathanw enum ite_max_getsize { ITEBURST = 64 };
161 1.8.8.2 nathanw
162 1.8.8.2 nathanw enum tab_size { TABSIZE = 8 };
163 1.8.8.2 nathanw #define TABEND(u) (ite_tty[u]->t_windsize.ws_col - TABSIZE) /* XXX */
164 1.8.8.2 nathanw
165 1.8.8.2 nathanw #define set_attr(ip, attr) ((ip)->attribute |= (attr))
166 1.8.8.2 nathanw #define clr_attr(ip, attr) ((ip)->attribute &= ~(attr))
167 1.8.8.2 nathanw #define attrloc(ip, y, x) 0
168 1.8.8.2 nathanw #define attrclr(ip, sy, sx, h, w)
169 1.8.8.2 nathanw #define attrmov(ip, sy, sx, dy, dx, h, w)
170 1.8.8.2 nathanw #define attrtest(ip, attr) 0
171 1.8.8.2 nathanw #define attrset(ip, attr)
172 1.8.8.2 nathanw
173 1.8.8.2 nathanw #ifdef _KERNEL
174 1.8.8.2 nathanw
175 1.8.8.2 nathanw extern int ite_default_x;
176 1.8.8.2 nathanw extern int ite_default_y;
177 1.8.8.2 nathanw extern int ite_default_width;
178 1.8.8.2 nathanw extern int ite_default_depth;
179 1.8.8.2 nathanw extern int ite_default_height;
180 1.8.8.2 nathanw
181 1.8.8.2 nathanw
182 1.8.8.2 nathanw struct proc;
183 1.8.8.2 nathanw struct consdev;
184 1.8.8.2 nathanw struct termios;
185 1.8.8.2 nathanw
186 1.8.8.2 nathanw /* console related function */
187 1.8.8.2 nathanw void ite_cnprobe __P((struct consdev *));
188 1.8.8.2 nathanw void ite_cninit __P((struct consdev *));
189 1.8.8.2 nathanw int ite_cngetc __P((dev_t));
190 1.8.8.2 nathanw void ite_cnputc __P((dev_t, int));
191 1.8.8.2 nathanw void ite_cnfinish __P((struct ite_softc *));
192 1.8.8.2 nathanw
193 1.8.8.2 nathanw /* standard ite device entry points. */
194 1.8.8.2 nathanw void iteinit __P((dev_t));
195 1.8.8.2 nathanw
196 1.8.8.2 nathanw /* ite functions */
197 1.8.8.2 nathanw int ite_on __P((dev_t, int));
198 1.8.8.2 nathanw void ite_off __P((dev_t, int));
199 1.8.8.2 nathanw void ite_reinit __P((dev_t));
200 1.8.8.2 nathanw int ite_param __P((struct tty *, struct termios *));
201 1.8.8.2 nathanw void ite_reset __P((struct ite_softc *));
202 1.8.8.2 nathanw int ite_cnfilter __P((u_int, enum caller));
203 1.8.8.2 nathanw void ite_filter __P((u_int ,enum caller));
204 1.8.8.2 nathanw
205 1.8.8.2 nathanw /* ite_cc functions */
206 1.8.8.2 nathanw int grfcc_cnprobe __P((void));
207 1.8.8.2 nathanw void grfcc_iteinit __P((struct grf_softc *));
208 1.8.8.2 nathanw #endif /* _KERNEL */
209 1.8.8.2 nathanw
210 1.8.8.2 nathanw #endif /* _ITEVAR_H */
211