128328Ssos/*- 2229784Suqs * Copyright (c) 1991-1997 S��ren Schmidt 328328Ssos * All rights reserved. 428328Ssos * 528328Ssos * Redistribution and use in source and binary forms, with or without 628328Ssos * modification, are permitted provided that the following conditions 728328Ssos * are met: 828328Ssos * 1. Redistributions of source code must retain the above copyright 928328Ssos * notice, this list of conditions and the following disclaimer 1028328Ssos * in this position and unchanged. 1128328Ssos * 2. Redistributions in binary form must reproduce the above copyright 1228328Ssos * notice, this list of conditions and the following disclaimer in the 1328328Ssos * documentation and/or other materials provided with the distribution. 1428328Ssos * 3. The name of the author may not be used to endorse or promote products 1597748Sschweikh * derived from this software without specific prior written permission 1628328Ssos * 1728328Ssos * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1828328Ssos * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1928328Ssos * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2028328Ssos * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 2128328Ssos * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2228328Ssos * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2328328Ssos * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2428328Ssos * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2528328Ssos * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2628328Ssos * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2728328Ssos * 2850476Speter * $FreeBSD$ 2928328Ssos */ 3028328Ssos 3171519Ssobomax#ifndef _VGL_H_ 3271519Ssobomax#define _VGL_H_ 3371519Ssobomax 3428328Ssos#include <stdlib.h> 3528328Ssos#include <unistd.h> 3628328Ssos#include <string.h> 3728328Ssos#include <machine/cpufunc.h> 3828328Ssos 3928328Ssostypedef unsigned char byte; 4028328Ssostypedef struct { 4128328Ssos byte Type; 4228328Ssos int Xsize, Ysize; 4353013Syokota int VXsize, VYsize; 4453013Syokota int Xorigin, Yorigin; 4528328Ssos byte *Bitmap; 4670991Snsouch int PixelBytes; 4728328Ssos} VGLBitmap; 4828328Ssos 4953013Syokota#define VGLBITMAP_INITIALIZER(t, x, y, bits) \ 5053052Syokota { (t), (x), (y), (x), (y), 0, 0, (bits) } 5153013Syokota 5228328Ssos/* 5328328Ssos * Defined Type's 5428328Ssos */ 5528328Ssos#define MEMBUF 0 5628328Ssos#define VIDBUF4 1 5728328Ssos#define VIDBUF8 2 5828328Ssos#define VIDBUF8X 3 5953013Syokota#define VIDBUF8S 4 6053013Syokota#define VIDBUF4S 5 6170991Snsouch#define VIDBUF16 6 /* Direct Color linear buffer */ 6270991Snsouch#define VIDBUF24 7 /* Direct Color linear buffer */ 6370991Snsouch#define VIDBUF32 8 /* Direct Color linear buffer */ 6470991Snsouch#define VIDBUF16S 9 /* Direct Color segmented buffer */ 6570991Snsouch#define VIDBUF24S 10 /* Direct Color segmented buffer */ 6670991Snsouch#define VIDBUF32S 11 /* Direct Color segmented buffer */ 6728328Ssos#define NOBUF 255 6828328Ssos 6928328Ssostypedef struct VGLText { 7028328Ssos byte Width, Height; 7128328Ssos byte *BitmapArray; 7228328Ssos} VGLText; 7328328Ssos 7428328Ssostypedef struct VGLObject { 7528328Ssos int Id; 7628328Ssos int Type; 7728328Ssos int Status; 7828328Ssos int Xpos, Ypos; 7928328Ssos int Xhot, Yhot; 8028328Ssos VGLBitmap *Image; 8128328Ssos VGLBitmap *Mask; 8228328Ssos int (*CallBackFunction)(); 8328328Ssos} VGLObject; 8428328Ssos 8528328Ssos#define MOUSE_IMG_SIZE 16 8628328Ssos#define VGL_MOUSEHIDE 0 8728328Ssos#define VGL_MOUSESHOW 1 8828328Ssos#define VGL_MOUSEFREEZE 0 8928328Ssos#define VGL_MOUSEUNFREEZE 1 9028328Ssos#define VGL_DIR_RIGHT 0 9128328Ssos#define VGL_DIR_UP 1 9228328Ssos#define VGL_DIR_LEFT 2 9328328Ssos#define VGL_DIR_DOWN 3 9430044Ssos#define VGL_RAWKEYS 1 9530044Ssos#define VGL_CODEKEYS 2 9630044Ssos#define VGL_XLATEKEYS 3 9728328Ssos 9853013Syokotaextern video_adapter_info_t VGLAdpInfo; 9953013Syokotaextern video_info_t VGLModeInfo; 10053013Syokotaextern VGLBitmap *VGLDisplay; 10153013Syokotaextern byte *VGLBuf; 10228328Ssos 10328328Ssos/* 10428328Ssos * Prototypes 10528328Ssos */ 10628328Ssos/* bitmap.c */ 10728328Ssosint __VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, VGLBitmap *dst, int dstx, int dsty, int width, int hight); 10828328Ssosint VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, VGLBitmap *dst, int dstx, int dsty, int width, int hight); 10953013SyokotaVGLBitmap *VGLBitmapCreate(int type, int xsize, int ysize, byte *bits); 11053013Syokotavoid VGLBitmapDestroy(VGLBitmap *object); 11153013Syokotaint VGLBitmapAllocateBits(VGLBitmap *object); 11230044Ssos/* keyboard.c */ 11330044Ssosint VGLKeyboardInit(int mode); 11430044Ssosvoid VGLKeyboardEnd(void); 11530044Ssosint VGLKeyboardGetCh(void); 11628328Ssos/* main.c */ 11728328Ssosvoid VGLEnd(void); 11828328Ssosint VGLInit(int mode); 11928328Ssosvoid VGLCheckSwitch(void); 12053013Syokotaint VGLSetVScreenSize(VGLBitmap *object, int VXsize, int VYsize); 12153013Syokotaint VGLPanScreen(VGLBitmap *object, int x, int y); 12253013Syokotaint VGLSetSegment(unsigned int offset); 12328328Ssos/* mouse.c */ 12428328Ssosvoid VGLMousePointerShow(void); 12528328Ssosvoid VGLMousePointerHide(void); 12628328Ssosvoid VGLMouseMode(int mode); 12728328Ssosvoid VGLMouseAction(int dummy); 12828328Ssosvoid VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask); 12928328Ssosvoid VGLMouseSetStdImage(void); 13028328Ssosint VGLMouseInit(int mode); 13128328Ssosint VGLMouseStatus(int *x, int *y, char *buttons); 13228328Ssosint VGLMouseFreeze(int x, int y, int width, int hight, byte color); 13328328Ssosvoid VGLMouseUnFreeze(void); 13428328Ssos/* simple.c */ 13570991Snsouchvoid VGLSetXY(VGLBitmap *object, int x, int y, u_long color); 13670991Snsouchu_long VGLGetXY(VGLBitmap *object, int x, int y); 13770991Snsouchvoid VGLLine(VGLBitmap *object, int x1, int y1, int x2, int y2, u_long color); 13870991Snsouchvoid VGLBox(VGLBitmap *object, int x1, int y1, int x2, int y2, u_long color); 13970991Snsouchvoid VGLFilledBox(VGLBitmap *object, int x1, int y1, int x2, int y2, u_long color); 14070991Snsouchvoid VGLEllipse(VGLBitmap *object, int xc, int yc, int a, int b, u_long color); 14170991Snsouchvoid VGLFilledEllipse(VGLBitmap *object, int xc, int yc, int a, int b, u_long color); 14270991Snsouchvoid VGLClear(VGLBitmap *object, u_long color); 14328328Ssosvoid VGLRestorePalette(void); 14428328Ssosvoid VGLSavePalette(void); 14528328Ssosvoid VGLSetPalette(byte *red, byte *green, byte *blue); 14628328Ssosvoid VGLSetPaletteIndex(byte color, byte red, byte green, byte blue); 14728328Ssosvoid VGLSetBorder(byte color); 14828328Ssosvoid VGLBlankDisplay(int blank); 14928328Ssos/* text.c */ 15028328Ssosint VGLTextSetFontFile(char *filename); 15128328Ssosvoid VGLBitmapPutChar(VGLBitmap *Object, int x, int y, byte ch, byte fgcol, byte bgcol, int fill, int dir); 15228328Ssosvoid VGLBitmapString(VGLBitmap *Object, int x, int y, char *str, byte fgcol, byte bgcol, int fill, int dir); 15371519Ssobomax 15471519Ssobomax#endif /* !_VGL_H_ */ 155