vgl.h revision 30044
128328Ssos/*-
228328Ssos * 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
1528328Ssos *    derived from this software withough 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 *
2830044Ssos *  $Id: vgl.h,v 1.1 1997/08/17 21:09:35 sos Exp $
2928328Ssos */
3028328Ssos
3128328Ssos#include <stdlib.h>
3228328Ssos#include <unistd.h>
3328328Ssos#include <string.h>
3428328Ssos#include <machine/cpufunc.h>
3528328Ssos
3628328Ssostypedef unsigned char byte;
3728328Ssostypedef struct {
3828328Ssos  byte 	Type;
3928328Ssos  int  	Xsize, Ysize;
4028328Ssos  byte 	*Bitmap;
4128328Ssos} VGLBitmap;
4228328Ssos
4328328Ssos/*
4428328Ssos * Defined Type's
4528328Ssos */
4628328Ssos#define MEMBUF		0
4728328Ssos#define VIDBUF4		1
4828328Ssos#define VIDBUF8		2
4928328Ssos#define VIDBUF8X	3
5028328Ssos#define NOBUF		255
5128328Ssos
5228328Ssostypedef struct VGLText {
5328328Ssos  byte	Width, Height;
5428328Ssos  byte	*BitmapArray;
5528328Ssos} VGLText;
5628328Ssos
5728328Ssostypedef struct VGLObject {
5828328Ssos  int	  	Id;
5928328Ssos  int	  	Type;
6028328Ssos  int	  	Status;
6128328Ssos  int	  	Xpos, Ypos;
6228328Ssos  int	  	Xhot, Yhot;
6328328Ssos  VGLBitmap 	*Image;
6428328Ssos  VGLBitmap 	*Mask;
6528328Ssos  int		(*CallBackFunction)();
6628328Ssos} VGLObject;
6728328Ssos
6828328Ssos#define MOUSE_IMG_SIZE		16
6928328Ssos#define VGL_MOUSEHIDE		0
7028328Ssos#define VGL_MOUSESHOW		1
7128328Ssos#define VGL_MOUSEFREEZE		0
7228328Ssos#define VGL_MOUSEUNFREEZE	1
7328328Ssos#define VGL_DIR_RIGHT		0
7428328Ssos#define VGL_DIR_UP		1
7528328Ssos#define VGL_DIR_LEFT		2
7628328Ssos#define VGL_DIR_DOWN		3
7730044Ssos#define VGL_RAWKEYS		1
7830044Ssos#define VGL_CODEKEYS		2
7930044Ssos#define VGL_XLATEKEYS		3
8028328Ssos
8128328Ssosextern VGLBitmap 	*VGLDisplay;
8228328Ssos
8328328Ssos/*
8428328Ssos * Prototypes
8528328Ssos */
8628328Ssos/* bitmap.c */
8728328Ssosint __VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, VGLBitmap *dst, int dstx, int dsty, int width, int hight);
8828328Ssosint VGLBitmapCopy(VGLBitmap *src, int srcx, int srcy, VGLBitmap *dst, int dstx, int dsty, int width, int hight);
8930044Ssos/* keyboard.c */
9030044Ssosint VGLKeyboardInit(int mode);
9130044Ssosvoid VGLKeyboardEnd(void);
9230044Ssosint VGLKeyboardGetCh(void);
9328328Ssos/* main.c */
9428328Ssosvoid VGLEnd(void);
9528328Ssosint VGLInit(int mode);
9628328Ssosvoid VGLCheckSwitch(void);
9728328Ssos/* mouse.c */
9828328Ssosvoid VGLMousePointerShow(void);
9928328Ssosvoid VGLMousePointerHide(void);
10028328Ssosvoid VGLMouseMode(int mode);
10128328Ssosvoid VGLMouseAction(int dummy);
10228328Ssosvoid VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask);
10328328Ssosvoid VGLMouseSetStdImage(void);
10428328Ssosint VGLMouseInit(int mode);
10528328Ssosint VGLMouseStatus(int *x, int *y, char *buttons);
10628328Ssosint VGLMouseFreeze(int x, int y, int width, int hight, byte color);
10728328Ssosvoid VGLMouseUnFreeze(void);
10828328Ssos/* simple.c */
10928328Ssosvoid VGLSetXY(VGLBitmap *object, int x, int y, byte color);
11028328Ssosbyte VGLGetXY(VGLBitmap *object, int x, int y);
11128328Ssosvoid VGLLine(VGLBitmap *object, int x1, int y1, int x2, int y2, byte color);
11228328Ssosvoid VGLBox(VGLBitmap *object, int x1, int y1, int x2, int y2, byte color);
11328328Ssosvoid VGLFilledBox(VGLBitmap *object, int x1, int y1, int x2, int y2, byte color);
11428328Ssosvoid VGLEllipse(VGLBitmap *object, int xc, int yc, int a, int b, byte color);
11528328Ssosvoid VGLFilledEllipse(VGLBitmap *object, int xc, int yc, int a, int b, byte color);
11628328Ssosvoid VGLClear(VGLBitmap *object, byte color);
11728328Ssosvoid VGLRestorePalette(void);
11828328Ssosvoid VGLSavePalette(void);
11928328Ssosvoid VGLSetPalette(byte *red, byte *green, byte *blue);
12028328Ssosvoid VGLSetPaletteIndex(byte color, byte red, byte green, byte blue);
12128328Ssosvoid VGLSetBorder(byte color);
12228328Ssosvoid VGLBlankDisplay(int blank);
12328328Ssos/* text.c */
12428328Ssosint VGLTextSetFontFile(char *filename);
12528328Ssosvoid VGLBitmapPutChar(VGLBitmap *Object, int x, int y, byte ch, byte fgcol, byte bgcol, int fill, int dir);
12628328Ssosvoid VGLBitmapString(VGLBitmap *Object, int x, int y, char *str, byte fgcol, byte bgcol, int fill, int dir);
127