home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QBasic & Borland Pascal & C
/
Delphi5.iso
/
C
/
Samples
/
CSAPE32.ARJ
/
INCLUDE
/
OS2DECL.H
< prev
next >
Wrap
C/C++ Source or Header
|
1990-05-15
|
4KB
|
124 lines
/*
os2decl.h
% Declarations for OS2 driver
11/11/88 by Ted.
OWL 1.2
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
2/28/90 ted Added hdatasize elem, removed unusable os2data mouse macros.
2/29/90 ted Added private os2hdata struct.
3/09/90 ted Changed os2minfo struct: has mousehide, no more hthread.
3/10/90 ted Added shift os2data element for new GetShift scheme.
4/05/90 jmd ansi-fied
5/14/90 jmd made evstash an int
*/
/* -------------------------------------------------------------------------- */
#define THREADSTACKSIZE 512
typedef struct _os2data {
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 pnest; /* re-entrancy protection semaphore */
TID ptid; /* re-entrancy protection thread id */
HVIO hvio;
HKBD hkbd;
unsigned key;
unsigned shift;
int evstash;
DEFINEMUXSEMLIST(kmsemlist, 2)
byte kstack[THREADSTACKSIZE]; /* Stack for thread */
VOID *h; /* non-display hardware dig data */
SIZE_T hdatasize; /* size of hardware data block */
} os2data_struct;
extern os2data_struct os2datastruc;
#define os2data (&os2datastruc)
typedef struct _os2hdata {
int ismouse;
boolean soundon;
} os2hdata_struct;
extern os2hdata_struct os2hdatastruc;
#define os2hdata (&(os2hdatastruc))
typedef struct os2minfo_struct {
HMOU hmou;
moupos_struct moupos;
moupos_struct oldpos;
byte mstack[THREADSTACKSIZE]; /* Stack for thread */
NOPTRRECT mouserect;
int mousehide; /* hide/show nesting level counter */
boolean hid;
} *os2minfo_type;
typedef unsigned long RAMSEM;
/* -------------------------------------------------------------------------- */
/* DISPLAY MODE FUNCTIONS */
/* os2vio.c */
extern dmode_func (os2_ModeText);
/* -------------------------------------------------------------------------- */
/* OS2HARD.C */
extern void DIGPRIV os2_hOpen(dig_struct *digp);
extern void DIGPRIV os2_dohide(void);
extern void DIGPRIV os2_doshow(void);
/* OS2OPEN.C */
extern dig_CloseDIG_func (os2_CloseDIG);
extern boolean DIGPRIV os2_OpenDIG(dig_struct *digp, VIOMODEINFO *mode);
extern void DIGPRIV os2_vsetcursortype(cursortype ctype);
/* -------------------------------------------------------------------------- */
#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_ATTRSIZE sizeof(byte)
#define VIO_MONOADDR 0x000B8000L
#define VIO_CGAADDR 0x000B0000L
#define VIO_EGAADDR 0x000A0000L
/* -------------------------------------------------------------------------- */