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