2 * Copyright (c) 1991-1997 Søren Schmidt
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer
10 * in this position and unchanged.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. The name of the author may not be used to endorse or promote products
15 * derived from this software withough specific prior written permission
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #include <machine/cpufunc.h>
36 typedef unsigned char byte;
52 typedef struct VGLText {
57 typedef struct VGLObject {
65 int (*CallBackFunction)();
68 #define MOUSE_IMG_SIZE 16
69 #define VGL_MOUSEHIDE 0
70 #define VGL_MOUSESHOW 1
71 #define VGL_MOUSEFREEZE 0
72 #define VGL_MOUSEUNFREEZE 1
73 #define VGL_DIR_RIGHT 0
75 #define VGL_DIR_LEFT 2
76 #define VGL_DIR_DOWN 3
78 #define VGL_CODEKEYS 2
79 #define VGL_XLATEKEYS 3
81 extern VGLBitmap *VGLDisplay;
87 int __VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, VGLBitmap *dst, int dstx, int dsty, int width, int hight);
88 int VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, VGLBitmap *dst, int dstx, int dsty, int width, int hight);
90 int VGLKeyboardInit(int mode);
91 void VGLKeyboardEnd(void);
92 int VGLKeyboardGetCh(void);
95 int VGLInit(int mode);
96 void VGLCheckSwitch(void);
98 void VGLMousePointerShow(void);
99 void VGLMousePointerHide(void);
100 void VGLMouseMode(int mode);
101 void VGLMouseAction(int dummy);
102 void VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask);
103 void VGLMouseSetStdImage(void);
104 int VGLMouseInit(int mode);
105 int VGLMouseStatus(int *x, int *y, char *buttons);
106 int VGLMouseFreeze(int x, int y, int width, int hight, byte color);
107 void VGLMouseUnFreeze(void);
109 void VGLSetXY(VGLBitmap *object, int x, int y, byte color);
110 byte VGLGetXY(VGLBitmap *object, int x, int y);
111 void VGLLine(VGLBitmap *object, int x1, int y1, int x2, int y2, byte color);
112 void VGLBox(VGLBitmap *object, int x1, int y1, int x2, int y2, byte color);
113 void VGLFilledBox(VGLBitmap *object, int x1, int y1, int x2, int y2, byte color);
114 void VGLEllipse(VGLBitmap *object, int xc, int yc, int a, int b, byte color);
115 void VGLFilledEllipse(VGLBitmap *object, int xc, int yc, int a, int b, byte color);
116 void VGLClear(VGLBitmap *object, byte color);
117 void VGLRestorePalette(void);
118 void VGLSavePalette(void);
119 void VGLSetPalette(byte *red, byte *green, byte *blue);
120 void VGLSetPaletteIndex(byte color, byte red, byte green, byte blue);
121 void VGLSetBorder(byte color);
122 void VGLBlankDisplay(int blank);
124 int VGLTextSetFontFile(char *filename);
125 void VGLBitmapPutChar(VGLBitmap *Object, int x, int y, byte ch, byte fgcol, byte bgcol, int fill, int dir);
126 void VGLBitmapString(VGLBitmap *Object, int x, int y, char *str, byte fgcol, byte bgcol, int fill, int dir);