/*=====[ The TesSeRact(TM) CXL User Interface Development System ]======* | Copyright (c) 1987-1990, Innovative Data Concepts. All Rights Reserved | | This Library is part of IDC's TesSeRact Development Tools product | line. For information about other IDC products, call 1-215-884-3373. *----------------------------------------------------------------------* | : Public definitions and prototypes for TCXL video | functions. Windowing functions are defined in , which | includes this file. *----------------------------------------------------------------------* | PGS : $Id: tcxlvid.h 5.51 90/10/01 00:00:00 MLM Release Locker: MLM $ | $Log: tcxlvid.h $ | Revision 5.51 90/10/01 00:00:00 MLM | TCXL 5.51 | *======================================================================*/ #ifndef _TCXLvid_ # define _TCXLvid_ 1 /* only once! */ # ifndef _TCXLdef_ # include /* standard definitions */ # endif # ifndef _TCXLatr_ # include /* attribute definitions */ # endif #define V_NONE 0x00 /*- adapter types returned by VidType() --*/ #define V_MDA 0x01 #define V_EGAMONO 0x02 #define V_MCGAMONO 0x03 #define V_VGAMONO 0x04 #define V_HGC 0x05 #define V_HGCPLUS 0x06 #define V_INCOLOR 0x07 #define V_CGA 0x08 #define V_EGA 0x09 #define V_MCGA 0x0A #define V_VGA 0x0B /*- VidParm() video parameter settings ---*/ #define VP_DMA 0x00 /* direct screen writes */ #define VP_CGA 0x01 /* direct screen writes, no CGA snow */ #define VP_BIO 0x02 /* BIOS screen writes */ #define VP_MON 0x03 /* monochrome attribute translate on */ #define VP_COL 0x04 /* monochrome attribute translate off */ /*- video flag bits ----------------------*/ #define VF_MON 0x01 /* monochrome */ #define VF_MAP 0x02 /* map to mono */ #define VF_CGA 0x04 /* suppress CGA snow */ #define VF_BIO 0x08 /* use video BIOS */ #define VF_DQV 0x10 /* DesqView/Windows installed */ /*- Ultravision Flags --------------------*/ #define VU_RES 0x80 /* Ultravision is resident */ #define VU_ACT 0x40 /* Ultravision is active */ /*- Ultravision Card Codes ---------------*/ #define VU_GEC 0x00 /* Generic EGA w/ Color monitor */ #define VU_GEM 0x04 /* Generic EGA w/ Monochrome monitor */ #define VU_GVV 0x05 /* Generic VGA w/ VGA monitor */ #define VU_PVV 0x06 /* Paradise VGA w/VGA monitor */ #define VU_HVV 0x07 /* Super VGA w/VGA monitor */ #define VU_BEE 0x0A /* UV EGA Booster w/EGA monitor */ #define VU_NEE 0x0B /* NEC GB-1 w/EGA monitor */ #define VU_SEE 0x0C /* Genoa SuperEGA w/EGA monitor */ #define VU_AEE 0x0D /* Alt EGA Booster w/EGA monitor */ #define VU_AEM 0x0E /* Alt EGA Booster w/Monochrome monitor */ #define VU_GVA 0x19 /* Generic VGA w/Autosync monitor */ #define VU_PVA 0x1A /* Paradise VGA w/Autosync monitor */ #define VU_HVA 0x1B /* Super VGA w/Autosync monitor */ #define VU_BEA 0x14 /* UV EGA Booster w/Autosync monitor */ #define VU_NEA 0x15 /* NEC GB-1 w/Autosync monitor */ #define VU_SEA 0x16 /* Genoa SuperEGA w/Autosync monitor */ #define VU_AEA 0x17 /* Alt EGA Booster w/Autosync monitor */ /*- Ultravision Video Modes --------------*/ #define VU_A25 0x11 /* 80x25 */ #define VU_A43 0x12 /* 80x43 on EGA, 80x50 on VGA */ #define VU_A34 0x13 /* 80x34 on EGA, 80x36 on VGA */ #define VU_A60 0x14 /* 80x60 on EGA, 80x63 on VGA */ #define VU_B25 0x19 /* 94x25 */ #define VU_B43 0x1A /* 94x43 on EGA, 94x50 on VGA */ #define VU_B36 0x1B /* 94x36 */ #define VU_B63 0x1C /* 94x63 */ #define VU_C25 0x21 /* 108x25 */ #define VU_C43 0x22 /* 108x43 on EGA, 108x50 on VGA */ #define VU_C34 0x23 /* 108x34 on EGA, 108x36 on VGA */ #define VU_C60 0x24 /* 108x60 on EGA, 108x63 on VGA */ #define VU_D25 0x31 /* 120x25 */ #define VU_D43 0x32 /* 120x43 on EGA, 120x50 on VGA */ #define VU_D36 0x39 /* 120x36 */ #define VU_D63 0x3A /* 120x63 */ #define VU_E25 0x33 /* 132x25 */ #define VU_E44 0x34 /* 132x44, 132x50 on SuperVGA only */ #define VU_E36 0x3B /* 132x36 */ #define VU_E60 0x3C /* 132x60 */ /*------------------[ Data objects and access macros ]------------------*/ TYP union Vcel VcelT, *VcelP; /* object, pointer types */ TYP struct Vctl VctlT; TYP union Vcse VcseT, *VcseP; TYP union Vpos VposT, *VposP; union Vcel /*-[ Video cell object ]------*/ { WrdT cwrd; /* 00 : overlay word */ struct /* */ { ChrT chr; /* 00 : character */ AtrT atr; /* 01 : attribute */ } c; /* */ }; /* 02 ]-----------------------*/ #define VcelW(x) ((x).cwrd) #define VcelC(x) ((x).c.chr) #define VcelA(x) ((x).c.atr) union Vcse /*-[ Video cursor object ]----*/ { WrdT cwrd; /* 00 : overlay word */ struct /* */ { BytT end; /* 00 : stop line */ BytT beg; /* 01 : start line */ } c; /* */ }; /* 02 ]-----------------------*/ #define VcseW(x) ((x).cwrd) #define VcseE(x) ((x).c.end) #define VcseB(x) ((x).c.beg) union Vpos /*-[ Video position object ]--*/ { WrdT pwrd; /* 00 : overlay word */ struct /* */ { BytT col; /* 00 : column */ BytT row; /* 01 : row */ } p; /* */ }; /* 02 ]-----------------------*/ #define VposW(x) ((x).pwrd) #define VposC(x) ((x).p.col) #define VposR(x) ((x).p.row) struct Vctl /*-[ Video-control object ]---------*/ { WrdT vseg; /* 00|00 : buffer segment */ BytT vhdw; /* 02|02 : adapter type */ BytT vmod; /* 03|03 : display-mode */ BytT vflg; /* 04|04 : flag byte */ BytT vpag; /* 05|05 : display-page */ IntT vwid; /* 06|06 : columns wide */ IntT vdep; /* 08|08 : rows deep */ VcseT vcur; /* 0A|0A : cursor-save */ BytT vuvf; /* 0C|0C : Ultravision Flags */ BytT vuvc; /* 0D|0D : Ultravision Card Code */ BytT vuvm; /* 0E|0E : Ultravision Text Mode */ BytT vfut; /* 0F|0F : Reserved for future use */ }; /* 10|10 ]--------------------------*/ GBL VctlT CDC _VidCtl; /*- Global video-control object ----------*/ #define VidSeg (_VidCtl.vseg) /* buffer segment */ #define VidHdw (_VidCtl.vhdw) /* adapter type */ #define VidMod (_VidCtl.vmod) /* display mode */ #define VidFlg (_VidCtl.vflg) /* flags */ #define VidMon (0 != (VidFlg & VF_MON)) /* monochrome */ #define VidMap (0 != (VidFlg & VF_MAP)) /* map to mono */ #define VidCga (0 != (VidFlg & VF_CGA)) /* CGA snow */ #define VidBio (0 != (VidFlg & VF_BIO)) /* use BIOS */ #define VidDqv (0 != (VidFlg & VF_DQV)) /* DesQview */ #define VidPag (_VidCtl.vpag) /* display page */ #define VidWid (_VidCtl.vwid) /* columns wide */ #define VidDep (_VidCtl.vdep) /* rows deep */ #define VidCur (_VidCtl.vcur) /* cursor save */ #define VidUvf (_VidCtl.vuvf) /* UV flags */ #define VuvRes (0 != (VidUvf & VU_RES)) /* resident */ #define VuvAct (0 != (VidUvf & VU_ACT)) /* active */ #define VidUvc (_VidCtl.vuvc) /* UV card code */ #define VidUvm (_VidCtl.vuvm) /* UV text mode */ /*------------------------[ function prototypes ]-----------------------*/ #ifdef __cplusplus /* no mangling, please */ extern "C" { #endif IntT PAS VatrInv(IntT a); /* invert attr */ IntT CTYP VatrMap(IntT a); /* map attr to mono */ VOID CTYP VatrRev(IntT n); /* reverse attrs */ VOID CTYP VatrSet(IntT a, IntT n); /* set attrs */ ChrP CTYP VatrTxt(IntT a); /* text description of attr */ IntT Vattrib(IntT f, IntT b, /* construct attr */ IntT i, IntT h); VOID CTYP Vclear(IntT a); /* clear screen to attr */ VOID VclrBox(VposT s, VposT e); /* clear box on screen */ VOID CTYP VclrEol(NOARG); /* clear cursor to EOL */ VOID CTYP VclrScr(NOARG); /* clear screen */ VOID VcurGet(VposT v); /* get cursor position */ IntT CTYP VcurHid(IntT s); /* hide/show cursor, return state*/ VOID VcurPut(VposT v); /* put cursor */ VOID CTYP VcurSet(IntT s); /* set large/small cursor */ VOID VcurSiz(VcseT c); /* size cursor */ VOID VdrwBox(VposT s, VposT e, /* draw box on screen */ IntT b, IntT a); VOID VfilBox(VposT s, VposT e, /* fill box on screen */ IntT c, IntT a); VOID Vgetw(IntT r, IntT c, /* get VcelT at r,c */ VcelT x); VOID PAS Vgotoxy(IntT r, IntT c); /* put cursor at row,col */ VOID CTYP VidInit(NOARG); /* initialize video */ IntT PAS VidMode(IntT m); /* get/set display mode */ WrdT VidOfs(IntT r, IntT c); /* calc screen offset */ IntT CTYP VidParm(IntT p); /* set video parameter */ VOID CTYP VidTerm(NOARG); /* terminate video */ IntT CTYP VidType(NOARG); /* get adapter type */ IntT CTYP VlodBox(ChrP f); /* load box image from disk */ IntT CTYP VlodScr(ChrP f); /* load screen image from disk */ VOID VposGet(IntT r, IntT c); /* get cursor position as */ VOID CTYP Vprintc(IntT r, IntT c, /* put char/attr at */ IntT a, IntT x); VOID CTYP Vprints(IntT r, IntT c, /* put string/attr at */ IntT a, ChrP s); VOID PAS VputSpa(IntT n); /* Put spaces */ VOID CTYP Vputc(IntT r, IntT c, /* put char/attr at r,c */ IntT x, IntT a); VOID Vputw(IntT r, IntT c, /* put VcelT at r,c */ VcelT x); VOID CTYP Vrestore(VcelP b); /* restore screen from buffer */ IntT VsavBox(VposT s, VposT e, /* save box image to disk */ ChrP f); VcelP CTYP Vsave(NOARG); /* save screen to buffer */ IntT CTYP VsavScr(ChrP f); /* save screen image to disk */ VOID Vscroll(IntT d, VposT s, /* scroll box on screen */ VposT e, IntT n, IntT a); IntT CTYP VsetLin(IntT n); /* set screen lines */ WrdT PAS VcurGt_(NOARG); /*- internals -------------------*/ VOID PAS VcurPt_(WrdT v); WrdT PAS VcurSz_(WrdT c); VOID CTYP VdrwBx_(WrdT s, WrdT e, IntT b, IntT a); VOID CTYP VfilBx_(WrdT s, WrdT e, IntT c, IntT a); WrdT CTYP Vgetw_(IntT r, IntT c); VOID CTYP Vputw_(IntT r, IntT c, WrdT x); IntT CTYP VsavBx_(WrdT s, WrdT e, ChrP f); VOID PAS Vscrol_(IntT d, WrdT s, WrdT e, IntT n, IntT a); #define Vattrib(f,b,i,h) ((b<<4)|(f)|(i<<3)|(h<<7)) #define VclrBox(s,e) (VfilBox((s),(e),' ',(Vgetw_(VposR(s),VposC(s))>>8))) #define VcurGet(v) (VposW(v)=VcurGt_()) #define VcurPut(v) (VcurPt_(VposW(v))) #define VcurSiz(c) (VcseW(c)=VcurSz_(VcseW(c))) #define VdrwBox(s,e,b,a) (VdrwBx_(VposW(s),VposW(e),(b),(a))) #define VfilBox(s,e,c,a) (VfilBx_(VposW(s),VposW(e),(c),(a))) #define Vgetw(r,c,x) (VcelW(x)=Vgetw_((r),(c))) #define VidOfs(r,c) ((((r)*VidWid)+(c))<<1) #define VposGet(r,c) ((c)=MsInt(VcurGt_()); (r)=((c)>>8); (c)&=0xFF) #define Vputw(r,c,x) (Vputw_((r),(c), VcelW(x))) #define VsavBox(s,e,f) (VsavBx_(VposW(s),VposW(e),(f))) #define Vscroll(d,s,e,n,a) (Vscrol_((d),VposW(s),VposW(e),(n),(a))) #ifdef __cplusplus } #endif #endif /* _TCXLvid_ : End of TCXLvid.h */