2 * SPDX-License-Identifier: BSD-3-Clause
4 * Copyright (c) 1991-1997 Søren Schmidt
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer
12 * in this position and unchanged.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 #include <machine/cpufunc.h>
41 typedef unsigned char byte;
51 #define VGLBITMAP_INITIALIZER(t, x, y, bits) \
52 { (t), (x), (y), (x), (y), 0, 0, (bits) }
63 #define VIDBUF16 6 /* Direct Color linear buffer */
64 #define VIDBUF24 7 /* Direct Color linear buffer */
65 #define VIDBUF32 8 /* Direct Color linear buffer */
66 #define VIDBUF16S 9 /* Direct Color segmented buffer */
67 #define VIDBUF24S 10 /* Direct Color segmented buffer */
68 #define VIDBUF32S 11 /* Direct Color segmented buffer */
71 typedef struct VGLText {
76 typedef struct VGLObject {
84 int (*CallBackFunction)();
87 #define MOUSE_IMG_SIZE 16
88 #define VGL_MOUSEHIDE 0
89 #define VGL_MOUSESHOW 1
90 #define VGL_MOUSEFREEZE 0
91 #define VGL_MOUSEUNFREEZE 1
92 #define VGL_DIR_RIGHT 0
94 #define VGL_DIR_LEFT 2
95 #define VGL_DIR_DOWN 3
97 #define VGL_CODEKEYS 2
98 #define VGL_XLATEKEYS 3
100 extern video_adapter_info_t VGLAdpInfo;
101 extern video_info_t VGLModeInfo;
102 extern VGLBitmap *VGLDisplay;
109 int __VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, VGLBitmap *dst, int dstx, int dsty, int width, int hight);
110 int VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, VGLBitmap *dst, int dstx, int dsty, int width, int hight);
111 VGLBitmap *VGLBitmapCreate(int type, int xsize, int ysize, byte *bits);
112 void VGLBitmapDestroy(VGLBitmap *object);
113 int VGLBitmapAllocateBits(VGLBitmap *object);
115 int VGLKeyboardInit(int mode);
116 void VGLKeyboardEnd(void);
117 int VGLKeyboardGetCh(void);
120 int VGLInit(int mode);
121 void VGLCheckSwitch(void);
122 int VGLSetVScreenSize(VGLBitmap *object, int VXsize, int VYsize);
123 int VGLPanScreen(VGLBitmap *object, int x, int y);
124 int VGLSetSegment(unsigned int offset);
126 void VGLMousePointerShow(void);
127 void VGLMousePointerHide(void);
128 void VGLMouseMode(int mode);
129 void VGLMouseAction(int dummy);
130 void VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask);
131 void VGLMouseSetStdImage(void);
132 int VGLMouseInit(int mode);
133 int VGLMouseStatus(int *x, int *y, char *buttons);
134 int VGLMouseFreeze(int x, int y, int width, int hight, byte color);
135 void VGLMouseUnFreeze(void);
137 void VGLSetXY(VGLBitmap *object, int x, int y, u_long color);
138 u_long VGLGetXY(VGLBitmap *object, int x, int y);
139 void VGLLine(VGLBitmap *object, int x1, int y1, int x2, int y2, u_long color);
140 void VGLBox(VGLBitmap *object, int x1, int y1, int x2, int y2, u_long color);
141 void VGLFilledBox(VGLBitmap *object, int x1, int y1, int x2, int y2, u_long color);
142 void VGLEllipse(VGLBitmap *object, int xc, int yc, int a, int b, u_long color);
143 void VGLFilledEllipse(VGLBitmap *object, int xc, int yc, int a, int b, u_long color);
144 void VGLClear(VGLBitmap *object, u_long color);
145 void VGLRestorePalette(void);
146 void VGLSavePalette(void);
147 void VGLSetPalette(byte *red, byte *green, byte *blue);
148 void VGLSetPaletteIndex(byte color, byte red, byte green, byte blue);
149 void VGLSetBorder(byte color);
150 void VGLBlankDisplay(int blank);
152 int VGLTextSetFontFile(char *filename);
153 void VGLBitmapPutChar(VGLBitmap *Object, int x, int y, byte ch, byte fgcol, byte bgcol, int fill, int dir);
154 void VGLBitmapString(VGLBitmap *Object, int x, int y, char *str, byte fgcol, byte bgcol, int fill, int dir);
156 #endif /* !_VGL_H_ */