1 /*- 2 * Copyright (c) 1992 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Ralph Campbell and Rick Macklem. 7 * 8 * %sccs.include.redist.c% 9 * 10 * @(#)fbreg.h 7.1 (Berkeley) 11/15/92 11 */ 12 13 /* 14 * Data for fb.c generic frame buffer routines that are called by the 15 * various frame buffer drivers. 16 */ 17 struct fbuaccess { 18 PM_Info scrInfo; 19 pmEvent events[PM_MAXEVQ]; 20 pmTimeCoord tcs[MOTION_BUFFER_SIZE]; 21 }; 22 23 struct pmax_fb { 24 int GraphicsOpen; /* Open yet? */ 25 int initialized; /* Set up yet? */ 26 int isMono; /* Monochrome fb? */ 27 int row, col; /* Screen pos for glass tty */ 28 struct fbuaccess *fbu; /* X event stuff */ 29 char *fr_addr; /* Frame buffer address */ 30 void (*posCursor)(); /* Position cursor func */ 31 void (*KBDPutc)(); /* Send char to keyboard func */ 32 dev_t kbddev; /* Device for KBDPutc */ 33 struct selinfo selp; /* Select structure */ 34 }; 35 36 /* 37 * Definitions for the Keyboard and mouse. 38 */ 39 /* 40 * Special key values. 41 */ 42 #define KEY_R_SHIFT 0xab 43 #define KEY_SHIFT 0xae 44 #define KEY_CONTROL 0xaf 45 #define KEY_R_ALT 0xb2 46 #define KEY_UP 0xb3 47 #define KEY_REPEAT 0xb4 48 #define KEY_F1 0x56 49 #define KEY_COMMAND KEY_F1 50 51 /* 52 * Lk201/301 keyboard 53 */ 54 #define LK_UPDOWN 0x86 /* bits for setting lk201 modes */ 55 #define LK_AUTODOWN 0x82 56 #define LK_DOWN 0x80 57 #define LK_DEFAULTS 0xd3 /* reset mode settings */ 58 #define LK_AR_ENABLE 0xe3 /* global auto repeat enable */ 59 #define LK_CL_ENABLE 0x1b /* keyclick enable */ 60 #define LK_KBD_ENABLE 0x8b /* keyboard enable */ 61 #define LK_BELL_ENABLE 0x23 /* the bell */ 62 #define LK_LED_ENABLE 0x13 /* light led */ 63 #define LK_LED_DISABLE 0x11 /* turn off led */ 64 #define LK_RING_BELL 0xa7 /* ring keyboard bell */ 65 #define LED_1 0x81 /* led bits */ 66 #define LED_2 0x82 67 #define LED_3 0x84 68 #define LED_4 0x88 69 #define LED_ALL 0x8f 70 #define LK_HELP 0x7c /* help key */ 71 #define LK_DO 0x7d /* do key */ 72 #define LK_KDOWN_ERROR 0x3d /* key down on powerup error */ 73 #define LK_POWER_ERROR 0x3e /* keyboard failure on pwrup tst*/ 74 #define LK_OUTPUT_ERROR 0xb5 /* keystrokes lost during inhbt */ 75 #define LK_INPUT_ERROR 0xb6 /* garbage command to keyboard */ 76 #define LK_LOWEST 0x56 /* lowest significant keycode */ 77 78 /* max volume is 0, lowest is 0x7 */ 79 #define LK_PARAM_VOLUME(v) (0x80|((v)&0x7)) 80 81 /* mode command details */ 82 #define LK_CMD_MODE(m,div) ((m)|((div)<<3)) 83 84 /* 85 * Command characters for the mouse. 86 */ 87 #define MOUSE_SELF_TEST 'T' 88 #define MOUSE_INCREMENTAL 'R' 89 90 /* 91 * Mouse output bits. 92 * 93 * MOUSE_START_FRAME Start of report frame bit. 94 * MOUSE_X_SIGN Sign bit for X. 95 * MOUSE_Y_SIGN Sign bit for Y. 96 * MOUSE_X_OFFSET X offset to start cursor at. 97 * MOUSE_Y_OFFSET Y offset to start cursor at. 98 */ 99 #define MOUSE_START_FRAME 0x80 100 #define MOUSE_X_SIGN 0x10 101 #define MOUSE_Y_SIGN 0x08 102 103 /* 104 * Definitions for mouse buttons 105 */ 106 #define EVENT_LEFT_BUTTON 0x01 107 #define EVENT_MIDDLE_BUTTON 0x02 108 #define EVENT_RIGHT_BUTTON 0x03 109 #define RIGHT_BUTTON 0x01 110 #define MIDDLE_BUTTON 0x02 111 #define LEFT_BUTTON 0x04 112 113 /* 114 * Mouse report structure definition 115 */ 116 typedef struct { 117 char state; /* buttons and sign bits */ 118 short dx; /* delta X since last change */ 119 short dy; /* delta Y since last change */ 120 char byteCount; /* mouse report byte count */ 121 } MouseReport; 122 123 /* 124 * Macro to translate from a time struct to milliseconds. 125 */ 126 #define TO_MS(tv) ((tv.tv_sec * 1000) + (tv.tv_usec / 1000)) 127