home *** CD-ROM | disk | FTP | other *** search
- /*
- os2decl.h
-
- % Declarations for OS2 driver
-
- 11/11/88 by Ted.
-
- OWL
- Copyright (c) 1988, 1989 by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 12/12/88 ted Merged CheckKey and CheckMouse into CheckEvent.
- 2/07/89 ted Added timeout wait arg to hCheckEvent function.
- 4/09/89 ted Converted for static digdata.
- 5/09/89 ted Renamed from os2disp.h
- */
- /* -------------------------------------------------------------------------- */
- #define THREADSTACKSIZE 512
-
- typedef struct {
- dispinfo_struct info;
- struct pmap_struct dmspace; /* pointed to by info->dispmap */
- byte attrmap[256]; /* attribute map table */
-
- VIOMODEINFO oldmode; /* pre-init video mode to restore from */
- unsigned oldcursx; /* pre-init cursor position */
- unsigned oldcursy;
- cursortype curctype; /* current hardware cursor type */
- opcoord fontlines;
-
- boolean dosbox;
-
- /* os2 mouse event vars (more are in the os2minfo struct below) */
- int mousehide; /* hide/show nesting level counter */
-
- int pnest; /* re-entrancy protection semaphore */
- TID ptid; /* re-entrancy protection thread id */
-
- HVIO hvio;
- HKBD hkbd;
-
- unsigned key;
- unsigned evstash;
-
- DEFINEMUXSEMLIST(kmsemlist, 2)
- byte kstack[THREADSTACKSIZE]; /* Stack for thread */
-
- pchdata_struct *h; /* non-display hardware dig data for dosbox events */
- } os2data_struct;
-
- extern os2data_struct os2datastruc;
- #define os2data (&os2datastruc)
-
- extern pchdata_struct os2hdatastruc;
- #define os2hdata (&(os2hdatastruc))
-
- typedef struct os2minfo_struct {
- HMOU hmou;
- moupos_struct moupos;
- moupos_struct oldpos;
- byte mstack[THREADSTACKSIZE]; /* Stack for thread */
-
- boolean hide;
- NOPTRRECT mouserect;
- byte hstack[THREADSTACKSIZE]; /* Stack for thread */
-
- } *os2minfo_type;
-
- typedef unsigned long RAMSEM;
-
- /* -------------------------------------------------------------------------- */
- /* DISPLAY MODE FUNCTIONS */
- /* os2vio.c */
- extern dmode_func (os2_ModeText);
- /* -------------------------------------------------------------------------- */
-
- /* os2open.c */
- extern boolean DIGPRIV os2_OpenDIG(_arg2(dig_struct *digp, VIOMODEINFO *mode));
- extern dig_CloseDIG_func (os2_CloseDIG);
- extern void DIGPRIV os2_vsetcursortype(_arg1(cursortype));
-
- /* os2hard.c */
- extern void DIGPRIV os2_hOpen(_arg1(dig_struct *digp));
-
- extern void DIGPRIV os2_dohide(_arg1(void));
- extern void DIGPRIV os2_doshow(_arg1(void));
- /* -------------------------------------------------------------------------- */
- #define os2_inuse() (os2data->info.devname[0] != '\0')
-
- #define os2_initmode() os2_vsetcursortype(CURSOR_NONE)
-
- #define os2_attrfg4bit(attr) (os2data->attrmap[attr] & 0x0F)
- #define os2_attrbg4bit(attr) (os2data->attrmap[attr] >> 4)
- /* -------------------------------------------------------------------------- */
- #define os2_vidseg() (os2data->info.dispmap->onboard)
- #define os2_bwidth() (os2data->info.dispmap->bytewidth)
- #define os2_pixbits() (os2data->info.dispmap->pixbits)
- #define os2_nplanes() (os2data->info.dispmap->nplanes)
- #define os2_dispmap() (os2data->info.dispmap)
- #define os2_ileave() (os2data->info.ileave)
- #define os2_ilsize() (os2data->info.ilsize)
-
- #define os2_setmouse(ismous) (os2data->ismouse = ismous)
- #define os2_mouse() (os2data->ismouse)
- #define os2_setmouseleft(left) (os2data->mouseleft = left)
- #define os2_mouseleft() (os2data->mouseleft)
- #define os2_setmousetop(top) (os2data->mousetop = top)
- #define os2_mousetop() (os2data->mousetop)
-
- #define OS2_ATTRSIZE sizeof(byte)
-
- #define VIO_MONOADDR 0x000B8000L
- #define VIO_CGAADDR 0x000B0000L
- #define VIO_EGAADDR 0x000A0000L
- /* -------------------------------------------------------------------------- */
-