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 without 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.
37 #include <machine/cpufunc.h>
39 typedef unsigned char byte;
49 #define VGLBITMAP_INITIALIZER(t, x, y, bits) \
50 { (t), (x), (y), (x), (y), 0, 0, (bits) }
61 #define VIDBUF16 6 /* Direct Color linear buffer */
62 #define VIDBUF24 7 /* Direct Color linear buffer */
63 #define VIDBUF32 8 /* Direct Color linear buffer */
64 #define VIDBUF16S 9 /* Direct Color segmented buffer */
65 #define VIDBUF24S 10 /* Direct Color segmented buffer */
66 #define VIDBUF32S 11 /* Direct Color segmented buffer */
69 typedef struct VGLText {
74 typedef struct VGLObject {
82 int (*CallBackFunction)();
85 #define MOUSE_IMG_SIZE 16
86 #define VGL_MOUSEHIDE 0
87 #define VGL_MOUSESHOW 1
88 #define VGL_MOUSEFREEZE 0
89 #define VGL_MOUSEUNFREEZE 1
90 #define VGL_DIR_RIGHT 0
92 #define VGL_DIR_LEFT 2
93 #define VGL_DIR_DOWN 3
95 #define VGL_CODEKEYS 2
96 #define VGL_XLATEKEYS 3
98 extern video_adapter_info_t VGLAdpInfo;
99 extern video_info_t VGLModeInfo;
100 extern VGLBitmap *VGLDisplay;
107 int __VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, VGLBitmap *dst, int dstx, int dsty, int width, int hight);
108 int VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, VGLBitmap *dst, int dstx, int dsty, int width, int hight);
109 VGLBitmap *VGLBitmapCreate(int type, int xsize, int ysize, byte *bits);
110 void VGLBitmapDestroy(VGLBitmap *object);
111 int VGLBitmapAllocateBits(VGLBitmap *object);
113 int VGLKeyboardInit(int mode);
114 void VGLKeyboardEnd(void);
115 int VGLKeyboardGetCh(void);
118 int VGLInit(int mode);
119 void VGLCheckSwitch(void);
120 int VGLSetVScreenSize(VGLBitmap *object, int VXsize, int VYsize);
121 int VGLPanScreen(VGLBitmap *object, int x, int y);
122 int VGLSetSegment(unsigned int offset);
124 void VGLMousePointerShow(void);
125 void VGLMousePointerHide(void);
126 void VGLMouseMode(int mode);
127 void VGLMouseAction(int dummy);
128 void VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask);
129 void VGLMouseSetStdImage(void);
130 int VGLMouseInit(int mode);
131 int VGLMouseStatus(int *x, int *y, char *buttons);
132 int VGLMouseFreeze(int x, int y, int width, int hight, byte color);
133 void VGLMouseUnFreeze(void);
135 void VGLSetXY(VGLBitmap *object, int x, int y, u_long color);
136 u_long VGLGetXY(VGLBitmap *object, int x, int y);
137 void VGLLine(VGLBitmap *object, int x1, int y1, int x2, int y2, u_long color);
138 void VGLBox(VGLBitmap *object, int x1, int y1, int x2, int y2, u_long color);
139 void VGLFilledBox(VGLBitmap *object, int x1, int y1, int x2, int y2, u_long color);
140 void VGLEllipse(VGLBitmap *object, int xc, int yc, int a, int b, u_long color);
141 void VGLFilledEllipse(VGLBitmap *object, int xc, int yc, int a, int b, u_long color);
142 void VGLClear(VGLBitmap *object, u_long color);
143 void VGLRestorePalette(void);
144 void VGLSavePalette(void);
145 void VGLSetPalette(byte *red, byte *green, byte *blue);
146 void VGLSetPaletteIndex(byte color, byte red, byte green, byte blue);
147 void VGLSetBorder(byte color);
148 void VGLBlankDisplay(int blank);
150 int VGLTextSetFontFile(char *filename);
151 void VGLBitmapPutChar(VGLBitmap *Object, int x, int y, byte ch, byte fgcol, byte bgcol, int fill, int dir);
152 void VGLBitmapString(VGLBitmap *Object, int x, int y, char *str, byte fgcol, byte bgcol, int fill, int dir);
154 #endif /* !_VGL_H_ */