itevar.h revision 1.14 1 1.14 tsutsui /* $NetBSD: itevar.h,v 1.14 2011/06/05 16:25:12 tsutsui 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.14 tsutsui device_t 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.13 dsl int (*itexx_ioctl)(struct ite_softc *, u_long,
97 1.13 dsl void *, int, struct lwp *);
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.10 chs ITE_ATTACHED = 0x40, /* ite is attached */
108 1.1 leo };
109 1.1 leo
110 1.1 leo enum ite_replrules {
111 1.1 leo RR_CLEAR = 0,
112 1.1 leo RR_COPY = 0x3,
113 1.1 leo RR_XOR = 0x6,
114 1.1 leo RR_COYINVERTED = 0xC
115 1.1 leo };
116 1.1 leo
117 1.1 leo enum ite_scrolldir {
118 1.1 leo SCROLL_UP = 1,
119 1.1 leo SCROLL_DOWN,
120 1.1 leo SCROLL_LEFT,
121 1.1 leo SCROLL_RIGHT,
122 1.1 leo };
123 1.1 leo
124 1.1 leo enum ite_cursact {
125 1.1 leo DRAW_CURSOR = 5,
126 1.1 leo ERASE_CURSOR,
127 1.1 leo MOVE_CURSOR,
128 1.1 leo START_CURSOROPT,
129 1.1 leo END_CURSOROPT
130 1.1 leo };
131 1.1 leo
132 1.1 leo enum ite_special_keycodes {
133 1.1 leo KBD_LEFT_SHIFT = 0x2a,
134 1.1 leo KBD_RIGHT_SHIFT = 0x36,
135 1.1 leo KBD_CAPS_LOCK = 0x3a,
136 1.1 leo KBD_CTRL = 0x1d,
137 1.1 leo KBD_ALT = 0x38
138 1.1 leo };
139 1.1 leo
140 1.1 leo enum ite_modifiers {
141 1.1 leo KBD_MOD_LSHIFT = 0x01,
142 1.1 leo KBD_MOD_RSHIFT = 0x02,
143 1.1 leo KBD_MOD_CTRL = 0x04,
144 1.1 leo KBD_MOD_ALT = 0x08,
145 1.1 leo KBD_MOD_CAPS = 0x10,
146 1.1 leo KBD_MOD_SHIFT = (KBD_MOD_LSHIFT | KBD_MOD_RSHIFT)
147 1.1 leo };
148 1.1 leo
149 1.1 leo enum caller {
150 1.1 leo ITEFILT_TTY,
151 1.1 leo ITEFILT_CONSOLE,
152 1.1 leo ITEFILT_REPEATER
153 1.1 leo };
154 1.1 leo
155 1.1 leo enum emul_level {
156 1.1 leo EMUL_VT100 = 1,
157 1.1 leo EMUL_VT300_8,
158 1.1 leo EMUL_VT300_7
159 1.1 leo };
160 1.1 leo
161 1.1 leo enum ite_max_getsize { ITEBURST = 64 };
162 1.1 leo
163 1.1 leo enum tab_size { TABSIZE = 8 };
164 1.1 leo #define TABEND(u) (ite_tty[u]->t_windsize.ws_col - TABSIZE) /* XXX */
165 1.1 leo
166 1.1 leo #define set_attr(ip, attr) ((ip)->attribute |= (attr))
167 1.1 leo #define clr_attr(ip, attr) ((ip)->attribute &= ~(attr))
168 1.1 leo #define attrloc(ip, y, x) 0
169 1.1 leo #define attrclr(ip, sy, sx, h, w)
170 1.1 leo #define attrmov(ip, sy, sx, dy, dx, h, w)
171 1.1 leo #define attrtest(ip, attr) 0
172 1.1 leo #define attrset(ip, attr)
173 1.1 leo
174 1.5 leo #ifdef _KERNEL
175 1.7 leo
176 1.7 leo extern int ite_default_x;
177 1.7 leo extern int ite_default_y;
178 1.7 leo extern int ite_default_width;
179 1.7 leo extern int ite_default_depth;
180 1.7 leo extern int ite_default_height;
181 1.7 leo
182 1.5 leo
183 1.1 leo struct proc;
184 1.1 leo struct consdev;
185 1.1 leo struct termios;
186 1.1 leo
187 1.1 leo /* console related function */
188 1.13 dsl void ite_cnprobe(struct consdev *);
189 1.13 dsl void ite_cninit(struct consdev *);
190 1.13 dsl int ite_cngetc(dev_t);
191 1.13 dsl void ite_cnputc(dev_t, int);
192 1.13 dsl void ite_cnfinish(struct ite_softc *);
193 1.1 leo
194 1.1 leo /* standard ite device entry points. */
195 1.13 dsl void iteinit(dev_t);
196 1.5 leo
197 1.1 leo /* ite functions */
198 1.13 dsl void ite_on(dev_t, int);
199 1.13 dsl void ite_off(dev_t, int);
200 1.13 dsl void ite_reinit(dev_t);
201 1.13 dsl int ite_param(struct tty *, struct termios *);
202 1.13 dsl void ite_reset(struct ite_softc *);
203 1.13 dsl int ite_cnfilter(u_int, enum caller);
204 1.13 dsl void ite_filter(u_int ,enum caller);
205 1.5 leo
206 1.5 leo /* ite_cc functions */
207 1.13 dsl int grfcc_cnprobe(void);
208 1.13 dsl void grfcc_iteinit(struct grf_softc *);
209 1.5 leo #endif /* _KERNEL */
210 1.1 leo
211 1.1 leo #endif /* _ITEVAR_H */
212