/* grLib.H */ /* Copyright (c) Genus Microprogramming, Inc. 1988-92 All Rights Reserved. */ /**************************************************************************** Function declarations for GX Graphics v2.00, for C. Microsoft C version 6.0 Programmer: Chris Howard 03/02/90 Luhit Young 03/01/91 Gregg Burman 02/26/92 *****************************************************************************/ /* Supported GX display types */ #define grMINDISP gxMINDISP /* Don't use gxMAXDISP, since */ #define grMAXDISP gxVESA_105 /* it may not be supported */ /* Line styles */ #define grLSOLID 0xFFFF /* Solid */ #define grLHUGEDASH 0xFFF0 /* Huge dashes */ #define grLBIGDASH 0xFF00 /* Big dashes */ #define grLMEDDASH 0xF0F0 /* Medium dashes */ #define grLSMALLDASH 0xCCCC /* Small dashes */ #define grLWIDEDOT 0x8888 /* Wide dots */ #define grLCLOSEDOT 0xAAAA /* Close dots */ #define grLDASHDOT 0xFAFA /* Dash dot */ #define grLCENTER 0xFDBF /* Center line */ /* Fill flags */ #define grOUTLINE 1 /* Outline */ #define grFILL 2 /* Fill interior */ /* Fill styles */ #define grFMIN 0 /* Minimum fill */ #define grFSOLID 0 /* Solid */ #define grFLINE 1 /* lines */ #define grFSLASH 2 /* /// */ #define grFTHSLASH 3 /* ///, thick */ #define grFBKSLASH 4 /* \\\ */ #define grFTHBKSLASH 5 /* \\\, thick */ #define grFHATCH 6 /* XXX */ #define grFTHHATCH 7 /* XXX, thick */ #define grFINTER 8 /* lines, interleaved */ #define grFWIDEDOT 9 /* dots, wide */ #define grFCLOSEDOT 10 /* dots, close */ #define grFUSER 11 /* user-defined */ #define grFMAX 11 /* Maximum fill */ /* Transparency types */ #define grTRANS gxTRUE /* Transparent */ #define grOPAQUE gxFALSE /* Opaque */ /* Clipping flags */ #define grCLIP gxTRUE /* Enable clipping */ #define grNOCLIP gxFALSE /* Disable clipping */ /* Mouse cursors */ #define grCMIN 0 /* Minimum cursor */ #define grCARROW 0 /* Left arrow */ #define grCCHECK 1 /* Check mark */ #define grCPLUS 2 /* Plus */ #define grCBOX 3 /* Box */ #define grCRTHAND 4 /* Right hand */ #define grCUPHAND 5 /* Up hand */ #define grCSTOP 6 /* Stop hand */ #define grCQUEST 7 /* Question mark */ #define grCTIME 8 /* Time */ #define grCUSER 9 /* User cursor */ #define grCMAX 9 /* Maximum cursor */ /* Mouse flags */ #define grSHOW gxTRUE /* Show cursor */ #define grHIDE gxFALSE /* Hide cursor */ #define grTRACK gxTRUE /* Track cursor */ #define grNOTRACK gxFALSE /* No tracking */ #define grPROTECT gxTRUE /* Enable protected region */ #define grNOPROTECT gxFALSE /* Disable protected region */ #define grLBUTTON 1 /* Left button */ #define grMBUTTON 4 /* Middle button */ #define grRBUTTON 2 /* Right button */ /* Colors */ #define grBLACK gxBLACK /* Black = 00H */ #define grBLUE gxBLUE /* Blue = 01H */ #define grGREEN gxGREEN /* Green = 02H */ #define grCYAN gxCYAN /* Cyan = 03H */ #define grRED gxRED /* Red = 04H */ #define grMAGENTA gxMAGENTA /* Magenta = 05H */ #define grBROWN gxBROWN /* Brown = 06H */ #define grGRAY gxGRAY /* Light Gray = 07H */ #define grDARKGRAY gxDARKGRAY /* Dark Gray = 038H */ #define grLIGHTBLUE gxLIGHTBLUE /* Light Blue = 039H */ #define grLIGHTGREEN gxLIGHTGREEN /* Light Green = 03AH */ #define grLIGHTCYAN gxLIGHTCYAN /* Light Cyan = 03BH */ #define grLIGHTRED gxLIGHTRED /* Light Red = 03CH */ #define grLIGHTMAGENTA gxLIGHTMAGENTA /* Light Magenta = 03DH */ #define grYELLOW gxYELLOW /* Yellow = 03EH */ #define grWHITE gxWHITE /* White = 03FH */ /* Text styles */ #define grTXT8X14 2 /* 8X14 font */ #define grTXT8X8 3 /* 8X8 font */ #define grTXT8X16 6 /* 8X16 font */ /* Text justification */ #define grTLEFT 1 /* Left */ #define grTCENTER 2 /* Center */ #define grTRIGHT 4 /* Right */ #define grTTOP 1 /* Top */ #define grTBOTTOM 4 /* Bottom */ /* World coordinate system y axis orientation */ #define grSCREEN 0 /* Y increases down */ #define grWORLD 1 /* Y increases up */ /* Event queue constants */ #define grENOEVENTS 0x0000 /* No events que'd */ #define grEMOUSEMOVE 0x0001 /* Mouse movement */ #define grELPRESS 0x0002 /* Left button presses */ #define grELRELEASE 0x0004 /* Left button releases */ #define grERPRESS 0x0008 /* Right button presses */ #define grERRELEASE 0x0010 /* Right button releases */ #define grEKEYBOARD 0x8000 /* Keystrokes generate events */ #define grEALLMOUSE 0x001F /* Movement, presses & releases*/ #define grEALLEVENTS 0x801F /* All mouse and kbd events */ /* Error Codes */ #define grSUCCESS gxSUCCESS /* Successful */ #define grERR_BADFONT -4000 /* Bad font type */ #define grERR_BADFILL -4001 /* Bad fill style */ #define grERR_NODRIVER -4002 /* No mouse driver found */ #define grERR_NOMOUSE -4003 /* No mouse found */ #define grERR_BADCURSOR -4004 /* Bad cursor style */ #define grERR_BADJUST -4005 /* Bad justification */ #define grERR_EQEMPTY -4020 /* Event queue empty */ #define grERR_EQFULL -4021 /* Event queue full */ #define grERR_EQBADINDEX -4022 /* Event Q index out of range */ #define grERR_EQACTIVE -4023 /* Event Queue active */ /* State Structure */ typedef struct grstate { int vflag; /* Virtual drawing flag */ int vbtype; /* Virtual bitmap type */ long vhptr; /* Current virtual header */ int page; /* Page */ int pageofs; /* Page offset */ int color; /* Foreground color */ int bkcolor; /* Background color */ int firstpt; /* First point plot flag */ int cpx; /* Current position (x,y) */ int cpy; /* */ int op; /* Logical operation */ int clip; /* Clipping flag */ int clipx1; /* Clipping region: (x1,y1) */ int clipy1; /* */ int clipx2; /* to (x2,y2) */ int clipy2; /* */ int fstyle; /* Fill style */ int fcolor; /* Fill color */ int ftrans; /* Fill transparency */ int lstyle; /* Line style */ int lthick; /* Line thickness */ int viewrox; /* Viewport origin: (ox,oy) */ int viewroy; /* (relative to viewport) */ int viewpox; /* Viewport origin: (ox,oy) */ int viewpoy; /* (physical screen coord) */ int viewx1; /* Viewport region: (x1,y1) */ int viewy1; /* */ int viewx2; /* to (x2,y2) */ int viewy2; /* */ int world; /* World flag */ int worldx1; /* World region: (x1,y1) */ int worldy1; /* */ int worldx2; /* to (x2,y2) */ int worldy2; /* */ long worldsx; /* World scaling (* 10000) */ long worldsy; /* */ int worldyo; /* World system y axis orient. */ int tstyle; /* Text style */ int ttrans; /* Text transparency */ int thjust; /* Text justification */ int tvjust; /* */ } GRSTATE; typedef GRSTATE far * GRSTATEPTR; /* Event Structure */ typedef struct grevent { int mask; /* Event mask */ char ascii; /* ASCII code of keystroke */ char scan; /* Scan code of keystroke */ int state; /* KBD Shift/Mouse Button state*/ int curx; /* X coord of Mouse cursor */ int cury; /* Y coord of Mouse cursor */ long stime; /* System timer tick timestamp */ } GREVENT; typedef GREVENT far * GREVENTPTR; /* Functions */ #ifdef __cplusplus extern "C" { #endif /* grCA.asm */ extern int far pascal grClearArea (int,int,int,int); /* grCL.asm */ extern int far pascal grSetClipping (int); extern int far pascal grGetClipping (void); extern int far pascal grSetClipRegion (int,int,int,int); extern int far pascal grGetClipRegion (int far *,int far *,int far *,int far *); extern int far pascal grClipPoint (int,int); extern int far pascal grClipLine (int far *,int far *,int far *,int far *); extern int far pascal grClipRect (int far *,int far *,int far *,int far *); /* grDA.asm */ extern int far pascal grDrawArc (int,int,int,int,int,int); extern int far pascal grGetArcEnds (int far *,int far *,int far *,int far *); extern int far pascal grDrawPieSlice (int,int,int,int,int,int,int); /* grDE.asm */ extern int far pascal grDrawCircle (int,int,int,int); extern int far pascal grDrawEllipse (int,int,int,int,int); /* grDL.asm */ extern int far pascal grMoveTo (int,int); extern int far pascal grMoveRel (int,int); extern int far pascal grLineTo (int,int); extern int far pascal grLineRel (int,int); extern int far pascal grDrawLine (int,int,int,int); /* grDM.asm */ extern int far pascal grInitMouse (void); extern int far pascal grStopMouse (void); extern int far pascal grTrackMouse (int); extern int far pascal grDisplayMouse (int); extern int far pascal grGetMouseMotion (int far *,int far *); extern int far pascal grGetMouseButtons (void); extern int far pascal grGetMousePresses (int,int far *,int far *,int far *); extern int far pascal grGetMouseReleases (int,int far *,int far *,int far *); extern int far pascal grGetMouseBounds (int far *,int far *,int far *,int far *); extern int far pascal grSetMouseBounds (int,int,int,int); extern int far pascal grGetMousePos (int far *,int far *); extern int far pascal grSetMousePos (int,int); extern int far pascal grGetMouseStyle (int far *,int far *); extern int far pascal grSetMouseStyle (int,int); extern int far pascal grGetMouseMask (int,int far *,int far *,int far *,int far *); extern int far pascal grSetMouseMask (int,int,int,int far *,int far *); extern int far pascal grSetMouseMode (int); extern int far pascal grProtectMouse (int); extern int far pascal grSetMouseProtect (int,int,int,int); extern int far pascal grGetMouseProtect (int far *,int far *,int far *,int far *); /* grDP.asm */ extern int far pascal grDrawPoly (int far *,int,int); /* grDR.asm */ extern int far pascal grDrawSquare (int,int,int,int); extern int far pascal grDrawRect (int,int,int,int,int); /* grEQ.asm */ extern int far pascal grGetEventMask (void); extern int far pascal grSetEventMask (int); extern int far pascal grWaitEvent (GREVENT far *); extern int far pascal grGetEvent (GREVENT far *); extern int far pascal grSetEvent (GREVENT far *); extern int far pascal grPeekEvent (GREVENT far *,int); extern int far pascal grSetEventBuffer (char far *,int); extern int far pascal grGetEventStatus (int far *,int far *); extern int far pascal grClearEvents (void); /* grFF.asm */ extern int far pascal grFloodFill (int,int,int); extern int far pascal grFloodSpill (int,int); /* grGA.asm */ extern int far pascal grGetActivePage (void); extern int far pascal grSetActivePage (int); extern int far pascal grGetAspect (void); extern int far pascal grSetAspect (int); extern int far pascal grGetFillStyle (int far *,int far *,int far *); extern int far pascal grSetFillStyle (int,int,int); extern int far pascal grGetFillPattern (int,char far *); extern int far pascal grSetFillPattern (int,char far *); extern int far pascal grGetLineStyle (int far *,int far *); extern int far pascal grSetLineStyle (int,int); extern int far pascal grGetOp (void); extern int far pascal grSetOp (int); extern int far pascal grGetBkColor (void); extern int far pascal grSetBkColor (int); extern int far pascal grGetColor (void); extern int far pascal grSetColor (int); extern int far pascal grGetState (GRSTATE far *); extern int far pascal grSetState (GRSTATE far *); extern int far pascal grDefaultState (void); extern int far pascal grGetCP (int far *,int far *); extern int far pascal grMaxX (void); extern int far pascal grMaxY (void); extern int far pascal grMaxColor (void); /* grGP.asm */ extern int far pascal grGetPixel (int,int); /* grOT.asm */ extern int far pascal grGetTextStyle (int far *,int far *); extern int far pascal grSetTextStyle (int,int); extern int far pascal grGetTextJustify (int far *,int far *); extern int far pascal grSetTextJustify (int,int); extern int far pascal grOutText (char far *); /* grPP.asm */ extern int far pascal grPutPixel (int,int,int); /* grSV.asm */ extern int far pascal grGetVersion (int far *,int far *); extern int far pascal grGetActiveVirtual (GXHEADER far * far *); extern int far pascal grSetActiveVirtual (GXHEADER far *); extern int far pascal grGetVirtual (void); extern int far pascal grSetVirtual (int); /* grVP.asm */ extern int far pascal grGetViewPort (int far *,int far *,int far *,int far *); extern int far pascal grSetViewPort (int,int,int,int); extern int far pascal grClearViewPort (void); extern int far pascal grGetWorld (void); extern int far pascal grSetWorld (int); extern int far pascal grGetViewWorld (int far *,int far *,int far *,int far *); extern int far pascal grSetViewWorld (int,int,int,int); extern int far pascal grGetViewOrigin (int far *,int far *); extern int far pascal grSetViewOrigin (int,int); extern int far pascal grWorldLocalX (int); extern int far pascal grWorldLocalY (int); extern int far pascal grLocalWorldX (int); extern int far pascal grLocalWorldY (int); extern int far pascal grGetWorldOrientation(void); extern int far pascal grSetWorldOrientation(int); #ifdef __cplusplus } #endif