home *** CD-ROM | disk | FTP | other *** search
- /*
- dispdecl.h
-
- % Declarations for display manager
-
- 5/16/88 by Ted.
-
- OWL 1.1
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 8/24/88 ted merged driver and mode in to one stub function pointer.
- 11/22/88 ted Added CheckMouse and ReadEvent functions
- 12/07/88 ted Put init function into dControl structure.
- 12/12/88 ted Merged CheckKey and CheckMouse into CheckEvent.
- 1/18/89 Ted changed call to PlotText for simplified interface.
- 2/04/89 ted Added pmap control dig element and codes.
- 2/07/89 Ted added timeout wait arg to hCheckEvent function.
- 5/09/89 ted Changed Alloc/Free terms to Open/Close.
- 6/17/89 ted Added evcheck flag to dig.
- 6/28/89 ted Removed display id info element.
- 6/28/89 ted Added DC_GETCOLMAP, DC_CLAIMCOLOR, DC_RELEASECOLOR. Removed
- colmap from info structure to hide it in DIG.
- 6/28/89 ted Changed mmwidth/height to x/ypixperm in info structure.
- 6/28/89 ted Made dControl and pControl return int instead of void.
- 6/29/89 ted Modified fontreq struct and added mouseshape struct.
- 7/12/89 ted Converted '_func' prototypes from typedef to macro.
- 8/08/89 ted Added bmap-to-pmap messages.
- 8/08/89 ted Moved fontreq_struct out to ofontdesc_struct in oboxdecl.h.
- 8/30/89 ted Added HC_CLEAREVENTS message.
- */
- /* -------------------------------------------------------------------------- */
- typedef enum {
- DTYPE_MONOCHROME,
- DTYPE_GREYSCALE,
- DTYPE_MAPCOLOR,
- DTYPE_TRUECOLOR
- } disptype;
- #ifdef LC /* for lattice compiler enum bug */
- # define disptype int
- #endif
-
- /* DIG device/mode open function prototype */
- #define dmode_func(fname) boolean fname(_arg1(struct dig__struct *digp))
- typedef dmode_func ((*dmode_fptr));
-
- /* Curstype declarations */
-
- typedef enum {
- CURSOR_NONE,
- CURSOR_BLOCK,
- CURSOR_HALF,
- CURSOR_THIN,
- CURSOR_DASH,
- CURSOR_NORMAL
- } cursortype;
- #ifdef LC /* for lattice compiler enum bug */
- # define cursortype int
- #endif
-
- /*** Text attributes. ***/
-
- #define ATTR_INVISIBLE ((byte) 0x00)
- #define ATTR_NORMAL ((byte) 0x07)
- #define ATTR_REVERSE ((byte) 0x70)
- #define ATTR_UNDERLINE ((byte) 0x01)
- #define ATTR_BLINKING ((byte) 0x87)
- #define ATTR_BOLD ((byte) 0x0F)
-
- #define BO_LSBYTFIRST ((byte) 0)
- #define BO_MSBYTFIRST ((byte) 1)
- /* -------------------------------------------------------------------------- */
- /* The display device info structure */
-
- #define DEVNAMELEN 22
-
- typedef struct {
- char devname[DEVNAMELEN]; /* Text for device's name */
- int mode; /* Device Display Mode */
- unsigned xpixperm; /* Pixels per meter on display device in x direction */
- unsigned ypixperm; /* Pixels per meter on display device in y direction */
-
- pmap_type dispmap; /* Pixmap describing display memory */
- unsigned dispaddr; /* address of display buffer(if any) */
- odim bytewidth; /* number of bytes in a line of display. */
- unsigned ileave; /* display memory interleave factor */
- odim ilsize; /* interleave block size */
- byte nplanes; /* number of bitplanes in image. */
- byte pixbits; /* number of bits per pixel in a plane. */
-
- long ncolors; /* Number of possible pixel values */
- disptype colortype; /* type of display (e.g. Monochrome, Truecolor, etc.) */
- ocolmap_type defcolmap; /* Pointer to copy of device default color map */
-
- byte hardcursor; /* Flag for hardware cursor used by this driver */
- byte byteorder; /* Code for the processor's byte order in a word */
-
- struct ofont_struct def_font; /* default system font */
- } dispinfo_struct;
-
- /* dig_dControl Messages */
-
- typedef enum {
- DC_GETINFO,
- DC_INITMODE,
- DC_RESTOREMODE,
- DC_SETATTRCOLS,
- DC_GETATTRFG,
- DC_GETATTRBG,
- DC_SETCOLMAP,
- DC_GETCOLMAP,
- DC_CLAIMCOLOR,
- DC_RELEASECOLOR,
- DC_OPENFONT,
- DC_CLOSEFONT,
- DC_READCHARATTR, /* only for cmwin isave */
- DC_CACHE, /* Hides mouse cursor also */
- DC_FLUSH
- } dig_dcmsg;
- #ifdef LC /* for lattice compiler enum bug */
- # define dig_dcmsg int
- #endif
-
- /* dig_pControl Messages */
-
- typedef enum {
- PC_OPENPMAP,
- PC_CLOSEPMAP,
- PC_CLEARPMAP,
- PC_COPYPMAP,
- PC_PMAPTOBMAP,
- PC_BMAPTOPMAP,
- PC_SAVEPMAP,
- PC_LOADPMAP
- } dig_pcmsg;
- #ifdef LC /* for lattice compiler enum bug */
- # define dig_pcmsg int
- #endif
-
- /* dig_hControl Messages */
-
- typedef enum {
- HC_OPEN,
- HC_CLOSE,
- HC_INITMOUSE, /* Inits mouse box to dimensions of display */
- HC_DEINITMOUSE,
- HC_ISMOUSEON,
- HC_SETMOUSEBOX,
- HC_SETMOUSESHAPE,
- HC_GETMOUSESHAPE,
- HC_SETSOUNDON,
- HC_SETSOUNDOFF,
- HC_GETSOUNDON,
- HC_CLEAREVENTS,
- HC_PROTECT,
- HC_UNPROTECT
- } dig_hcmsg;
- #ifdef LC /* for lattice compiler enum bug */
- # define dig_hcmsg int
- #endif
-
- /* Window paint data structure */
-
- typedef struct {
- obj_type win;
- opbox *relboxp; /* box for tile relative to window */
- VOID *emsgdata; /* message indata (needed for scrolling) */
- } ptd_struct;
-
- /* -------------------------------------------------------------------------- */
- /* Hardware Dependent Code function types */
-
- #define dig_CloseDIG_func(fname) void fname(_arg1(struct dig__struct *digp))
- #define dig_dControl_func(fname) int fname(_arg3(dig_dcmsg msg, VOID *indata, VOID *outdata))
-
- #define dig_pPlotText_func(fname) void fname(_arg7(ptd_struct *ptd, opcoord x, opcoord y, char *charbuf, char rchar, byte rattr, int slen))
- #define dig_pDrawCursor_func(fname) void fname(_arg2(ptd_struct *ptd, cursortype ctype))
- #define dig_pClear_func(fname) void fname(_arg2(ptd_struct *ptd, opixval color))
- #define dig_pScrollBoxVt_func(fname) void fname(_arg2(ptd_struct *ptd, opcoord n))
- #define dig_pScrollBoxHz_func(fname) void fname(_arg2(ptd_struct *ptd, opcoord n))
-
- #define dig_pDrawPixmap_func(fname) void fname(_arg3(ptd_struct *ptd, pmap_type pmap, opbox *pmboxp))
- #define dig_pReadPixmap_func(fname) void fname(_arg3(ptd_struct *ptd, pmap_type pmap, opbox *pmboxp))
- #define dig_pControl_func(fname) int fname(_arg3(dig_pcmsg msg, VOID *indata, VOID *outdata))
-
- #define dig_hCheckEvent_func(fname) unsigned fname(_arg1(unsigned wait))
- #define dig_hReadEvent_func(fname) unsigned fname(_arg1(moupos_struct *mouposp))
- #define dig_hGetShift_func(fname) unsigned fname(_arg1(void))
- #define dig_hTimer_func(fname) unsigned fname(_arg1(void))
- #define dig_hPause_func(fname) void fname(_arg1(unsigned duration))
- #define dig_hSound_func(fname) void fname(_arg2(unsigned pitch, unsigned duration))
- #define dig_hControl_func(fname) int fname(_arg3(dig_hcmsg msg, VOID *indata, VOID *outdata))
- /* -------------------------------------------------------------------------- */
- /* Device Interface Group function structure */
-
- typedef struct dig__struct {
- dig_CloseDIG_func ((*CloseDIG)); /* Clean up device interface */
- dig_dControl_func ((*dControl)); /* miscellaneous display control */
-
- dig_pDrawCursor_func ((*pDrawCursor)); /* set text cursor position */
- dig_pPlotText_func ((*pPlotText)); /* draw text */
- dig_pClear_func ((*pClear)); /* clear screen */
- dig_pScrollBoxVt_func ((*pScrollBoxVt)); /* scroll vertical */
- dig_pScrollBoxHz_func ((*pScrollBoxHz)); /* scroll horizontal */
-
- dig_pDrawPixmap_func ((*pDrawPixmap)); /* draw a region */
- dig_pReadPixmap_func ((*pReadPixmap)); /* read a region */
- dig_pControl_func ((*pControl)); /* pixel map control */
-
- dig_hCheckEvent_func ((*hCheckEvent)); /* check for keystroke ready */
- dig_hReadEvent_func ((*hReadEvent)); /* read key/mouse event */
- dig_hGetShift_func ((*hGetShift)); /* get keyboard shift state */
- dig_hTimer_func ((*hTimer)); /* system timer */
- dig_hPause_func ((*hPause)); /* system timer delay */
- dig_hSound_func ((*hSound)); /* sound generator */
-
- dig_hControl_func ((*hControl)); /* miscellaneous hardware control */
-
- VOID *data; /* generic data pointer for dig data */
- SIZE_T datasize; /* size of dig data block */
-
- unsigned vtscroll:1; /* specifies whether vertical scrolling is supported */
- unsigned hzscroll:1; /* specifies whether horizontal scrolling is supported */
- unsigned textfree:1; /* specifies whether text position is restricted */
- unsigned evcheck:1; /* specifies whether hard_CheckEvent works or not */
- int type; /* dig type : specifies supported features */
- int version; /* implementation version for the given type */
- } dig_struct;
-
- typedef struct disp_struct {
- dispinfo_struct *info;
- dig_struct dig; /* structure of device group function ptrs */
-
- unsigned mouse_timeout;
- opcoord mouse_distout;
- } *disp_type;
-
- typedef struct {
- struct disp_struct disp;
- struct wmgr_struct wmgr;
- int id; /* id for which dmgr is the current one */
- } dmgr_struct;
-
- /* -------------------------------------------------------------------------- */
- /* Message in and outdata structures */
-
- typedef ofontdesc_struct fontreq_struct;
-
- typedef struct {
- ptd_struct *ptd;
- opcoord x;
- opcoord y;
- char *charbuf;
- byte *attrbuf;
- int slen;
- } ptarg_struct; /* Used for ReadCharAttr dControl method */
-
- typedef struct {
- byte attr;
- opixval bg;
- opixval fg;
- } setattr_struct;
-
- typedef struct {
- bmap_type image;
- bmap_type mask;
- opcoord xhot;
- opcoord yhot;
- unsigned short tsmask, tcmask; /* Text mode char/attribute pairs */
- } mouseshape_struct;
- /* -------------------------------------------------------------------------- */
-
-