Home | History | Annotate | Line # | Download | only in dev
itevar.h revision 1.14.58.1
      1  1.14.58.1   martin /*	$NetBSD: itevar.h,v 1.14.58.1 2022/09/11 18:10:23 martin 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			G0;
     76        1.1      leo 	char			G1;
     77        1.1      leo 	char			G2;
     78        1.1      leo 	char			G3;
     79  1.14.58.1   martin 	char			*GL;
     80  1.14.58.1   martin 	char			*GR;
     81  1.14.58.1   martin 	char			sc_G0;
     82  1.14.58.1   martin 	char			sc_G1;
     83  1.14.58.1   martin 	char			sc_G2;
     84  1.14.58.1   martin 	char			sc_G3;
     85  1.14.58.1   martin 	char			*sc_GL;
     86  1.14.58.1   martin 	char			*sc_GR;
     87        1.1      leo 	char			linefeed_newline;
     88        1.1      leo 	char			auto_wrap;
     89        1.1      leo 	char			cursor_appmode;
     90        1.1      leo 	char			keypad_appmode;
     91        1.1      leo 	short			top_margin;
     92        1.1      leo 	short			bottom_margin;
     93        1.1      leo 	short			inside_margins;
     94        1.1      leo 	short 			eightbit_C1;
     95        1.1      leo 	short			emul_level;
     96        1.1      leo 	enum 	ite_attr	attribute;
     97        1.1      leo 	enum 	ite_attr	save_attribute;
     98        1.1      leo 	int			curx;
     99        1.1      leo 	int			save_curx;
    100        1.1      leo 	int			cury;
    101        1.1      leo 	int			save_cury;
    102       1.13      dsl 	int			(*itexx_ioctl)(struct ite_softc *, u_long,
    103       1.13      dsl 						void *, int, struct lwp *);
    104        1.1      leo };
    105        1.1      leo 
    106        1.1      leo enum ite_flags {
    107        1.1      leo 	ITE_ALIVE  = 0x1,		/* grf layer is configed	*/
    108        1.1      leo 	ITE_ISCONS = 0x2,		/* ite is acting console.	*/
    109        1.1      leo 	ITE_INITED = 0x4,		/* ite has been inited.		*/
    110        1.1      leo 	ITE_ISOPEN = 0x8,		/* ite has been opened		*/
    111        1.1      leo 	ITE_INGRF  = 0x10,		/* ite is in graphics mode	*/
    112        1.1      leo 	ITE_ACTIVE = 0x20,		/* ite is an active terminal	*/
    113       1.10      chs 	ITE_ATTACHED = 0x40,		/* ite is attached		*/
    114        1.1      leo };
    115        1.1      leo 
    116        1.1      leo enum ite_replrules {
    117        1.1      leo 	RR_CLEAR = 0,
    118        1.1      leo 	RR_COPY = 0x3,
    119        1.1      leo 	RR_XOR = 0x6,
    120        1.1      leo 	RR_COYINVERTED = 0xC
    121        1.1      leo };
    122        1.1      leo 
    123        1.1      leo enum ite_scrolldir {
    124        1.1      leo 	SCROLL_UP = 1,
    125        1.1      leo 	SCROLL_DOWN,
    126        1.1      leo 	SCROLL_LEFT,
    127        1.1      leo 	SCROLL_RIGHT,
    128        1.1      leo };
    129        1.1      leo 
    130        1.1      leo enum ite_cursact {
    131        1.1      leo 	DRAW_CURSOR = 5,
    132        1.1      leo 	ERASE_CURSOR,
    133        1.1      leo 	MOVE_CURSOR,
    134        1.1      leo 	START_CURSOROPT,
    135        1.1      leo 	END_CURSOROPT
    136        1.1      leo };
    137        1.1      leo 
    138        1.1      leo enum ite_special_keycodes {
    139        1.1      leo 	KBD_LEFT_SHIFT  = 0x2a,
    140        1.1      leo 	KBD_RIGHT_SHIFT = 0x36,
    141        1.1      leo 	KBD_CAPS_LOCK   = 0x3a,
    142        1.1      leo 	KBD_CTRL        = 0x1d,
    143        1.1      leo 	KBD_ALT         = 0x38
    144        1.1      leo };
    145        1.1      leo 
    146        1.1      leo enum ite_modifiers {
    147        1.1      leo 	KBD_MOD_LSHIFT  = 0x01,
    148        1.1      leo 	KBD_MOD_RSHIFT  = 0x02,
    149        1.1      leo 	KBD_MOD_CTRL    = 0x04,
    150        1.1      leo 	KBD_MOD_ALT     = 0x08,
    151        1.1      leo 	KBD_MOD_CAPS    = 0x10,
    152        1.1      leo 	KBD_MOD_SHIFT   = (KBD_MOD_LSHIFT | KBD_MOD_RSHIFT)
    153        1.1      leo };
    154        1.1      leo 
    155        1.1      leo enum caller {
    156        1.1      leo 	ITEFILT_TTY,
    157        1.1      leo 	ITEFILT_CONSOLE,
    158        1.1      leo 	ITEFILT_REPEATER
    159        1.1      leo };
    160        1.1      leo 
    161        1.1      leo enum emul_level {
    162        1.1      leo 	EMUL_VT100 = 1,
    163        1.1      leo 	EMUL_VT300_8,
    164        1.1      leo 	EMUL_VT300_7
    165        1.1      leo };
    166        1.1      leo 
    167        1.1      leo enum ite_max_getsize { ITEBURST = 64 };
    168        1.1      leo 
    169        1.1      leo enum tab_size { TABSIZE = 8 };
    170        1.1      leo #define TABEND(u) (ite_tty[u]->t_windsize.ws_col - TABSIZE) /* XXX */
    171        1.1      leo 
    172        1.1      leo #define set_attr(ip, attr)	((ip)->attribute |= (attr))
    173        1.1      leo #define clr_attr(ip, attr)	((ip)->attribute &= ~(attr))
    174        1.1      leo #define attrloc(ip, y, x) 0
    175        1.1      leo #define attrclr(ip, sy, sx, h, w)
    176        1.1      leo #define attrmov(ip, sy, sx, dy, dx, h, w)
    177        1.1      leo #define attrtest(ip, attr) 0
    178        1.1      leo #define attrset(ip, attr)
    179        1.1      leo 
    180        1.5      leo #ifdef _KERNEL
    181        1.7      leo 
    182  1.14.58.1   martin /* character set */
    183  1.14.58.1   martin #define CSET_ASCII	0	/* US-ASCII */
    184  1.14.58.1   martin #define CSET_DECGRAPH	1	/* DEC special graphics characters */
    185  1.14.58.1   martin 
    186        1.7      leo extern int ite_default_x;
    187        1.7      leo extern int ite_default_y;
    188        1.7      leo extern int ite_default_width;
    189        1.7      leo extern int ite_default_depth;
    190        1.7      leo extern int ite_default_height;
    191        1.7      leo 
    192        1.5      leo 
    193        1.1      leo struct proc;
    194        1.1      leo struct consdev;
    195        1.1      leo struct termios;
    196        1.1      leo 
    197        1.1      leo /* console related function */
    198       1.13      dsl void	ite_cnprobe(struct consdev *);
    199       1.13      dsl void	ite_cninit(struct consdev *);
    200       1.13      dsl int	ite_cngetc(dev_t);
    201       1.13      dsl void	ite_cnputc(dev_t, int);
    202       1.13      dsl void	ite_cnfinish(struct ite_softc *);
    203        1.1      leo 
    204        1.1      leo /* standard ite device entry points. */
    205       1.13      dsl void	iteinit(dev_t);
    206        1.5      leo 
    207        1.1      leo /* ite functions */
    208       1.13      dsl void	ite_on(dev_t, int);
    209       1.13      dsl void	ite_off(dev_t, int);
    210       1.13      dsl void	ite_reinit(dev_t);
    211       1.13      dsl int	ite_param(struct tty *, struct termios *);
    212       1.13      dsl void	ite_reset(struct ite_softc *);
    213       1.13      dsl int	ite_cnfilter(u_int, enum caller);
    214       1.13      dsl void	ite_filter(u_int ,enum caller);
    215        1.5      leo 
    216        1.5      leo /* ite_cc functions */
    217       1.13      dsl int	grfcc_cnprobe(void);
    218       1.13      dsl void	grfcc_iteinit(struct grf_softc *);
    219        1.5      leo #endif /* _KERNEL */
    220        1.1      leo 
    221        1.1      leo #endif /* _ITEVAR_H */
    222