Annotation of 43BSDReno/sys/hpdev/itevar.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1988 University of Utah.
                      3:  * Copyright (c) 1990 The Regents of the University of California.
                      4:  * All rights reserved.
                      5:  *
                      6:  * This code is derived from software contributed to Berkeley by
                      7:  * the Systems Programming Group of the University of Utah Computer
                      8:  * Science Department.
                      9:  *
                     10:  * Redistribution is only permitted until one year after the first shipment
                     11:  * of 4.4BSD by the Regents.  Otherwise, redistribution and use in source and
                     12:  * binary forms are permitted provided that: (1) source distributions retain
                     13:  * this entire copyright notice and comment, and (2) distributions including
                     14:  * binaries display the following acknowledgement:  This product includes
                     15:  * software developed by the University of California, Berkeley and its
                     16:  * contributors'' in the documentation or other materials provided with the
                     17:  * distribution and in all advertising materials mentioning features or use
                     18:  * of this software.  Neither the name of the University nor the names of
                     19:  * its contributors may be used to endorse or promote products derived from
                     20:  * this software without specific prior written permission.
                     21:  * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
                     22:  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
                     23:  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
                     24:  *
                     25:  * from: Utah $Hdr: itevar.h 1.13 89/02/27$
                     26:  *
                     27:  *     @(#)itevar.h    7.1 (Berkeley) 5/8/90
                     28:  */
                     29: 
                     30: #define UNIT(dev)       minor(dev)
                     31: 
                     32: struct itesw {
                     33:        int     (*ite_init)();
                     34:        int     (*ite_deinit)();
                     35:        int     (*ite_clear)();
                     36:        int     (*ite_putc)();
                     37:        int     (*ite_cursor)();
                     38:        int     (*ite_scroll)();
                     39: };
                     40: 
                     41: struct ite_softc {
                     42:        int     flags;
                     43:        int     type;
                     44:        caddr_t regbase, fbbase;
                     45:        short   curx, cury;
                     46:        short   cursorx, cursory;
                     47:        short   cblankx, cblanky;
                     48:        short   rows, cols;
                     49:        short   cpl;
                     50:        short   dheight, dwidth;
                     51:        short   fbheight, fbwidth;
                     52:        short   ftheight, ftwidth;
                     53:        short   fontx, fonty;
                     54:        short   attribute;
                     55:        u_char  *attrbuf;
                     56:        short   planemask;
                     57:        short   pos;
                     58:        char    imode, escape, fpd, hold;
                     59: };
                     60: 
                     61: /* Flags */
                     62: #define ITE_ALIVE      0x01    /* hardware exists */
                     63: #define ITE_INITED     0x02    /* device has been initialized */
                     64: #define ITE_CONSOLE    0x04    /* device can be console */
                     65: #define ITE_ISCONS     0x08    /* device is console */
                     66: #define ITE_ACTIVE     0x10    /* device is being used as ITE */
                     67: #define ITE_INGRF      0x20    /* device in use as non-ITE */
                     68: 
                     69: /* Types - indices into itesw */
                     70: #define        ITE_TOPCAT      0
                     71: #define        ITE_GATORBOX    1
                     72: #define        ITE_RENAISSANCE 2
                     73: #define ITE_DAVINCI    3
                     74: 
                     75: #define attrloc(ip, y, x) \
                     76:        (ip->attrbuf + ((y) * ip->cols) + (x))
                     77: 
                     78: #define attrclr(ip, sy, sx, h, w) \
                     79:        bzero(ip->attrbuf + ((sy) * ip->cols) + (sx), (h) * (w))
                     80:   
                     81: #define attrmov(ip, sy, sx, dy, dx, h, w) \
                     82:        bcopy(ip->attrbuf + ((sy) * ip->cols) + (sx), \
                     83:              ip->attrbuf + ((dy) * ip->cols) + (dx), \
                     84:              (h) * (w))
                     85: 
                     86: #define attrtest(ip, attr) \
                     87:        ((* (u_char *) attrloc(ip, ip->cury, ip->curx)) & attr)
                     88: 
                     89: #define attrset(ip, attr) \
                     90:        ((* (u_char *) attrloc(ip, ip->cury, ip->curx)) = attr)
                     91:   
                     92: /*
                     93:  * X and Y location of character 'c' in the framebuffer, in pixels.
                     94:  */
                     95: #define        charX(ip,c)     \
                     96:        (((c) % (ip)->cpl) * (ip)->ftwidth + (ip)->fontx)
                     97: 
                     98: #define        charY(ip,c)     \
                     99:        (((c) / (ip)->cpl) * (ip)->ftheight + (ip)->fonty)
                    100: 
                    101: /* Character attributes */
                    102: #define ATTR_NOR        0x0             /* normal */
                    103: #define        ATTR_INV        0x1             /* inverse */
                    104: #define        ATTR_UL         0x2             /* underline */
                    105: #define ATTR_ALL       (ATTR_INV | ATTR_UL)
                    106: 
                    107: /* Keyboard attributes */
                    108: #define ATTR_KPAD      0x4             /* keypad transmit */
                    109:   
                    110: /* Replacement Rules */
                    111: #define RR_CLEAR               0x0
                    112: #define RR_COPY                        0x3
                    113: #define RR_XOR                 0x6
                    114: #define RR_COPYINVERTED        0xc
                    115: 
                    116: #define SCROLL_UP      0x01
                    117: #define SCROLL_DOWN    0x02
                    118: #define SCROLL_LEFT    0x03
                    119: #define SCROLL_RIGHT   0x04
                    120: #define DRAW_CURSOR    0x05
                    121: #define ERASE_CURSOR    0x06
                    122: #define MOVE_CURSOR    0x07
                    123: 
                    124: #define KBD_SSHIFT     4               /* bits to shift status */
                    125: #define        KBD_CHARMASK    0x7F
                    126: 
                    127: /* keyboard status */
                    128: #define        KBD_SMASK       0xF             /* service request status mask */
                    129: #define        KBD_CTRLSHIFT   0x8             /* key + CTRL + SHIFT */
                    130: #define        KBD_CTRL        0x9             /* key + CTRL */
                    131: #define        KBD_SHIFT       0xA             /* key + SHIFT */
                    132: #define        KBD_KEY         0xB             /* key only */
                    133: 
                    134: #define KBD_CAPSLOCK    0x18
                    135: 
                    136: #define KBD_EXT_LEFT_DOWN     0x12
                    137: #define KBD_EXT_LEFT_UP       0x92
                    138: #define KBD_EXT_RIGHT_DOWN    0x13
                    139: #define KBD_EXT_RIGHT_UP      0x93
                    140: 
                    141: #define        TABSIZE         8
                    142: #define        TABEND(u)       (ite_tty[u].t_winsize.ws_col - TABSIZE)
                    143: 
                    144: #ifdef KERNEL
                    145: extern struct ite_softc ite_softc[];
                    146: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.