Annotation of Gnu-Mach/chips/screen.h, revision 1.1

1.1     ! root        1: /* 
        !             2:  * Mach Operating System
        !             3:  * Copyright (c) 1991,1990,1989 Carnegie Mellon University
        !             4:  * All Rights Reserved.
        !             5:  * 
        !             6:  * Permission to use, copy, modify and distribute this software and its
        !             7:  * documentation is hereby granted, provided that both the copyright
        !             8:  * notice and this permission notice appear in all copies of the
        !             9:  * software, derivative works or modified versions, and any portions
        !            10:  * thereof, and that both notices appear in supporting documentation.
        !            11:  * 
        !            12:  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
        !            13:  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
        !            14:  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
        !            15:  * 
        !            16:  * Carnegie Mellon requests users of this software to return to
        !            17:  * 
        !            18:  *  Software Distribution Coordinator  or  [email protected]
        !            19:  *  School of Computer Science
        !            20:  *  Carnegie Mellon University
        !            21:  *  Pittsburgh PA 15213-3890
        !            22:  * 
        !            23:  * any improvements or extensions that they make and grant Carnegie Mellon
        !            24:  * the rights to redistribute these changes.
        !            25:  */
        !            26: /*
        !            27:  *     File: screen.h
        !            28:  *     Author: Alessandro Forin, Carnegie Mellon University
        !            29:  *     Date:   9/90
        !            30:  *
        !            31:  *     Definitions for the Generic Screen Driver.
        !            32:  */
        !            33: 
        !            34: /*
        !            35:  * Most of these structures are defined so that the
        !            36:  * resulting structure mapped to user space appears
        !            37:  * to be compatible with the one used by the DEC X
        !            38:  * servers (pm_info..). Keep it that way and the
        !            39:  * X servers will keep on running.
        !            40:  */
        !            41: 
        !            42: /*
        !            43:  * Generic structures and defines
        !            44:  */
        !            45: 
        !            46: /* colors */
        !            47: typedef struct {
        !            48:        unsigned short  red;
        !            49:        unsigned short  green;
        !            50:        unsigned short  blue;
        !            51: } color_map_t;
        !            52: 
        !            53: typedef struct {
        !            54:        short           unused;
        !            55:        unsigned short  index;
        !            56:        color_map_t     value;
        !            57: } color_map_entry_t;
        !            58: 
        !            59: typedef struct {
        !            60:        unsigned int    Bg_rgb[3];
        !            61:        unsigned int    Fg_rgb[3];
        !            62: } cursor_color_t;
        !            63: 
        !            64: /* generic input event */
        !            65: typedef struct {
        !            66:         short          x;              /* x position */
        !            67:         short          y;              /* y position */
        !            68:         unsigned int    time;          /* 1 millisecond units */
        !            69: 
        !            70:         unsigned char   type;          /* button up/down/raw or motion */
        !            71: #      define  EVT_BUTTON_UP           0
        !            72: #      define  EVT_BUTTON_DOWN         1
        !            73: #      define  EVT_BUTTON_RAW          2
        !            74: #      define  EVT_PTR_MOTION          3
        !            75: 
        !            76:         unsigned char   key;           /* the key (button only) */
        !            77: #      define  KEY_LEFT_BUTTON         1
        !            78: #      define  KEY_MIDDLE_BUTTON       2
        !            79: #      define  KEY_RIGHT_BUTTON        3
        !            80: #      define  KEY_TBL_LEFT_BUTTON     0
        !            81: #      define  KEY_TBL_FRONT_BUTTON    1
        !            82: #      define  KEY_TBL_RIGHT_BUTTON    2
        !            83: #      define  KEY_TBL_BACK_BUTTON     3
        !            84: 
        !            85:         unsigned char   index;         /* which instance of device */
        !            86: 
        !            87:         unsigned char   device;                /* which device */
        !            88: #      define  DEV_NULL                0
        !            89: #      define  DEV_MOUSE               1
        !            90: #      define  DEV_KEYBD               2
        !            91: #      define  DEV_TABLET              3
        !            92: #      define  DEV_AUX                 4
        !            93: #      define  DEV_CONSOLE             5
        !            94: #      define  DEV_KNOB                8
        !            95: #      define  DEV_JOYSTICK            9
        !            96: 
        !            97: } screen_event_t;
        !            98: 
        !            99: /* timed coordinate info */
        !           100: typedef struct {
        !           101:        unsigned int    time;
        !           102:        short           x, y;
        !           103: } screen_timed_point_t;
        !           104: 
        !           105: /* queue of input events, and ring of mouse motions track */
        !           106: typedef struct {
        !           107:        screen_event_t  *events;
        !           108:        unsigned int    q_size;
        !           109:         unsigned int    q_head;
        !           110:         unsigned int    q_tail;
        !           111:        unsigned        long    timestamp;
        !           112:        screen_timed_point_t    *track;
        !           113:        unsigned int    t_size;
        !           114:        unsigned int    t_next;
        !           115: } screen_evque_t;
        !           116: 
        !           117: /* mouse/cursor position */
        !           118: typedef struct {
        !           119:         short x;
        !           120:         short y;
        !           121: } screen_point_t;
        !           122: 
        !           123: /* mouse motion bounding boxes */
        !           124: typedef struct {
        !           125:         short bottom;
        !           126:         short right;
        !           127:         short left;
        !           128:         short top;
        !           129: } screen_rect_t;
        !           130: 
        !           131: /*
        !           132:  * Here it is, each field is marked as
        !           133:  *
        !           134:  * Kset        : kernel sets it unconditionally
        !           135:  * Kuse : kernel uses it, safely
        !           136:  * Kdep : kernel might depend on it
        !           137:  */
        !           138: typedef struct {
        !           139:   screen_evque_t       evque;          /* Kset, Kuse */
        !           140:   short                        mouse_buttons;  /* Kset */
        !           141:   screen_point_t       xx3     /*tablet*/;
        !           142:   short                        xx4     /*tswitches*/;
        !           143:   screen_point_t       cursor;         /* Kset */
        !           144:   short                        row;            /* Kdep */
        !           145:   short                        col;            /* Kdep */
        !           146:   short                        max_row;        /* Kdep */
        !           147:   short                        max_col;        /* Kdep */
        !           148:   short                        max_x;          /* Kset */
        !           149:   short                        max_y;          /* Kset */
        !           150:   short                        max_cur_x;      /* Kdep */
        !           151:   short                        max_cur_y;      /* Kdep */
        !           152:   int                  version;        /* Kset */
        !           153:   union {
        !           154:     struct {
        !           155:        unsigned char * bitmap;         /* Kset */
        !           156:        short *         x16     /*scanmap*/;
        !           157:        short *         x17     /*cursorbits*/;
        !           158:        short *         x18     /*pmaddr*/;
        !           159:        unsigned char * planemask;      /* Kset */
        !           160:     } pm;
        !           161:     struct {
        !           162:        int             x15     /* flags */;
        !           163:        int *           gram    /* Kset */;
        !           164:        int *           rb_addr /* Kset */;
        !           165:        int             rb_phys /* Kset */;
        !           166:        int             rb_size /* Kset */;
        !           167:     } gx;
        !           168:   } dev_dep_1;
        !           169:   screen_point_t       mouse_loc;      /* Kdep */
        !           170:   screen_rect_t                mouse_box;      /* Kdep */
        !           171:   short                        mouse_threshold;/* Kuse */
        !           172:   short                        mouse_scale;    /* Kuse */
        !           173:   short                        min_cur_x;      /* Kdep */
        !           174:   short                        min_cur_y;      /* Kdep */
        !           175:   union {
        !           176:     struct {
        !           177:        int             x26     /*dev_type*/;
        !           178:        char *          x27     /*framebuffer*/;
        !           179:        char *          x28     /*volatile struct bt459 *bt459*/;
        !           180:        int             x29     /*slot*/;
        !           181:        char            cursor_sprite[1024];/* Kset */
        !           182:        unsigned char   Bg_color[3];    /* Kset */
        !           183:        unsigned char   Fg_color[3];    /* Kset */
        !           184:        int             tablet_scale_x; /* Kuse */
        !           185:        int             tablet_scale_y; /* Kuse */
        !           186:     } pm;
        !           187:     struct {
        !           188:        char *          gxo             /* Kset */;
        !           189:        char            stamp_width     /* Kset */;
        !           190:        char            stamp_height    /* Kset */;
        !           191:        char            nplanes         /* Kset */;
        !           192:        char            x27_4   /* n10_present */;
        !           193:        char            x28_1   /* dplanes */;
        !           194:        char            zplanes         /* Kset */;
        !           195:        char            zzplanes        /* Kset */;
        !           196:        unsigned char   cursor_sprite[1024]     /* Kuse */;
        !           197:        char            x285_0          /* padding for next, which was int */;
        !           198:        unsigned char   Fg_color[4]     /* Kuse */;
        !           199:        unsigned char   Bg_color[4]     /* Kuse */;
        !           200:        unsigned short  cmap_index      /* Kuse */;
        !           201:        unsigned short  cmap_count      /* Kuse */;
        !           202:        unsigned int    colormap[256]   /* Kuse */;
        !           203:        int *           stic_dma_rb     /* Kset */;
        !           204:        int *           stic_reg        /* Kset */;
        !           205:        int             ptpt_phys       /* Kdep */;
        !           206:        int             ptpt_size       /* Kdep */;
        !           207:        int *           ptpt_pgin       /* Kset */;
        !           208:     } gx;
        !           209:   } dev_dep_2;
        !           210:   short                frame_scanline_width;   /* in pixels, Kset */
        !           211:   short                frame_height;           /* in scanlines, Kset */
        !           212:   /*
        !           213:    * Event queues are allocated right after that
        !           214:    */
        !           215: #define        MAX_EVENTS      64
        !           216: #define        MAX_TRACK       100
        !           217:   screen_event_t       event_queue[MAX_EVENTS]; /* Kset */
        !           218:   screen_timed_point_t point_track[MAX_TRACK];  /* Kset */
        !           219:   /*
        !           220:    * Some like it hot
        !           221:    */
        !           222:   unsigned int         event_id;
        !           223:   int                  interrupt_info;
        !           224: } user_info_t;
        !           225: 
        !           226: 
        !           227: /*
        !           228:  * Screen get_status codes and arguments
        !           229:  */
        !           230: #include <sys/ioctl.h>
        !           231: 
        !           232:        /* Get size (and offset) of mapped info */
        !           233: #define        SCREEN_GET_OFFSETS      _IOR('q', 6, unsigned **)
        !           234: 
        !           235:        /* Get screen status flags */
        !           236: #define SCREEN_STATUS_FLAGS    _IOR('q', 22, int *)
        !           237: #      define  MONO_SCREEN     0x01
        !           238: #      define  COLOR_SCREEN    0x02
        !           239: #      define  SCREEN_BEING_UPDATED 0x04
        !           240: 
        !           241: /*
        !           242:  * Screen set_status codes and arguments
        !           243:  */
        !           244: 
        !           245:        /* start/stop screen saver, control fading interval */
        !           246: #define        SCREEN_FADE             _IOW('q', 114, int)     /* fade screen */
        !           247: #      define  NO_FADE         -1
        !           248: 
        !           249:        /* Turn video on/off manually */
        !           250: #define SCREEN_ON              _IO('q', 10)
        !           251: #define        SCREEN_OFF              _IO('q', 11)
        !           252: 
        !           253:        /* Fixup pointers inside mapped info structure */
        !           254: #define        SCREEN_ADJ_MAPPED_INFO  _IOR('q', 1, user_info_t *)
        !           255: 
        !           256:        /* Initialize anything that needs to, hw-wise */
        !           257: #define SCREEN_INIT            _IO('q', 4)
        !           258: 
        !           259:        /* Position cursor to a specific spot */
        !           260: #define SCREEN_SET_CURSOR      _IOW('q', 2, screen_point_t)
        !           261: 
        !           262:        /* Load Bg/Fg colors for cursor */
        !           263: #define        SCREEN_SET_CURSOR_COLOR _IOW('q', 3, cursor_color_t)
        !           264: 
        !           265:        /* Load cursor sprite, small cursor form */
        !           266: typedef unsigned short cursor_sprite_t[32];
        !           267: 
        !           268: #define        SCREEN_LOAD_CURSOR      _IOW('q', 7, cursor_sprite_t)
        !           269: 
        !           270:        /* Load cursor sprite, large 64x64 cursor form */
        !           271: typedef char cursor_sprite_long_t[1024];
        !           272: 
        !           273: #define        SCREEN_LOAD_CURSOR_LONG _IOW('q', 13, cursor_sprite_long_t)
        !           274: 
        !           275:        /* Modify a given entry in the color map (VDAC) */
        !           276: #define        SCREEN_SET_CMAP_ENTRY   _IOW('q', 12, color_map_entry_t)
        !           277: 
        !           278:        /* Return some other information about hardware (optional) */
        !           279: typedef struct {
        !           280:        int     frame_width;
        !           281:        int     frame_height;
        !           282:        int     frame_visible_width;
        !           283:        int     frame_visible_height;
        !           284: } screen_hw_info_t;
        !           285: #define        SCREEN_HARDWARE_INFO    _IOR('q', 23, screen_hw_info_t)
        !           286: 
        !           287:        /* Screen-dependent, unspecified (and despised) */
        !           288: #define        SCREEN_HARDWARE_DEP     _IO('q', 24)
        !           289: 

unix.superglobalmegacorp.com

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