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