/* txLib.H */ /* Copyright (c) Genus Microprogramming, Inc. 1988-92 All Rights Reserved. */ /**************************************************************************** Function declarations for GX Text v2.02, for C. Microsoft C version 6.x Programmer: Chris Howard 06/01/89 Luhit Young 10/01/92 *****************************************************************************/ /* TX ID's */ #define txTHID 0xCA10 /* TX virtual header ID value */ /* Supported GX Display types */ #define txMINDISP gxMINDISP #define txMAXDISP gxVESA_105 /* Logical Operations */ #define txSET 0 /* SET pixel value directly */ #define txAND 1 /* AND pixel value with data */ #define txOR 2 /* OR pixel value with data */ #define txXOR 3 /* XOR pixel value with data */ /* Alignment */ #define txLEFT 0x01 /* Left */ #define txCENTER 0x02 /* Center */ #define txRIGHT 0x04 /* Right */ #define txBOTTOM 0x01 /* Bottom */ #define txBASE 0x02 /* Base */ #define txMIDDLE 0x04 /* Middle */ #define txTOP 0x08 /* Top */ /* Faces */ #define txNORMAL 0x00 /* Normal */ #define txBOLD 0x01 /* Bolding */ #define txITALIC 0x02 /* Italics */ #define txUNDER 0x04 /* Underlining */ #define txFIXED 0x10 /* Fixed spacing */ #define txTRANS 0x20 /* Transparent */ /* ROM fonts */ #define txTXT8X14 2 /* 8X14 font (NOTE: These constants */ #define txTXT8X8 3 /* 8X8 font match the chargen */ #define txTXT8X16 6 /* 8X16 font numbers for INT 10H */ /* function 11H sub 30H) */ /* Rotation */ #define tx000 0 /* 0 degrees, going right */ #define tx090 1 /* 90 degrees, going up */ #define tx180 2 /* 180 degrees, going left */ #define tx270 3 /* 270 degrees, going down */ /* Clipping */ #define txCLIP gxTRUE /* Enable clipping */ #define txNOCLIP gxFALSE /* Disable clipping */ /* Font Formats */ #define txGEMFONT 0 /* Sizes */ #define txCOTLEN 514 #define txWIDLEN 512 /* Exit status for txGetString */ #define txKEYENTER 13 /* Enter */ #define txKEYESC 27 /* Escape */ #define txKEYF1 59 /* F1 */ #define txKEYF2 60 /* F2 */ #define txKEYF3 61 /* F3 */ #define txKEYF4 62 /* F4 */ #define txKEYF5 63 /* F5 */ #define txKEYF6 64 /* F6 */ #define txKEYF7 65 /* F7 */ #define txKEYF8 66 /* F8 */ #define txKEYF9 67 /* F9 */ #define txKEYF10 68 /* F10 */ #define txKEYUP 72 /* Up arrow */ #define txKEYPGUP 73 /* PgUp */ #define txKEYDOWN 80 /* Down arrow */ #define txKEYPGDN 81 /* PgDn */ /* Error Codes */ #define txSUCCESS gxSUCCESS /* Successful */ #define txERR_NOTGEM -1000 /* Not a GEM font file */ #define txERR_NOTTX -1001 /* Not a TXHEADER variable */ #define txERR_BADCHAR -1002 /* Bad character */ #define txERR_BADDIR -1003 /* Dir must be 0,90,180,270 */ #define txERR_BADMASK -1004 /* Invalid mask (txGetString) */ #define txERR_LONGSTR -1005 /* String too long */ /* Text Header */ typedef struct txheader { unsigned txvid; /* TXHEADER ID (0CA10H) */ unsigned txtype; /* GEM font */ unsigned txminch; /* Minimum char in font */ unsigned txmaxch; /* Maximum char in font */ unsigned txfheight; /* Font height */ unsigned txfwidth; /* Sum of all chars */ unsigned txascent; /* Font ascent from baseline */ unsigned txdescent; /* Font descent from baseline */ unsigned txalign; /* Alignment */ unsigned txfcolor; /* Foreground */ unsigned txbcolor; /* Background */ unsigned txdir; /* Direction */ unsigned txface; /* Text face */ unsigned txop; /* Logical Operation */ unsigned txupos; /* Underline position */ unsigned txspace; /* Text spacing (fixed) */ unsigned txinter; /* Intercharacter spacing */ unsigned txmaxwidth; /* Max char width */ char reserved[136]; /* Reserved for TX header */ } TXHEADER; typedef TXHEADER *TXHEADERPTR; /* GEM Font Header */ typedef struct gemheader { int fid; /* Font ID */ int psize; /* Point size */ char fntname[32]; /* Font name */ int minch; /* Minimum character */ int maxch; /* Maximum character */ int topline; /* Top line distance */ int ascent; /* Ascent distance */ int halfline; /* Half line distance */ int descent; /* Descent distance */ int botline; /* Bottom line distance */ int maxwidth; /* Maximum character width */ int cellsize; /* Maximum cell size */ int leftofs; /* Left offset */ int rightofs; /* Right offset */ int thicken; /* Thicken pixels, for bolding */ int ulwidth; /* Underline width */ int lightmask; /* Lightening and */ int skewmask; /* Skew masks */ int flags; /* Font flags */ long hotptr; /* Horiz Offset Table pointer */ long cotptr; /* Char Offset Table pointer */ long bufptr; /* Data Buffer pointer */ int fwidth; /* Sum of all character widths */ int fheight; /* Number of character rows */ } GEMHEADER; typedef GEMHEADER *GEMHEADERPTR; /* Functions */ #ifdef __cplusplus extern "C" { #endif /* txCL */ extern int far pascal txSetClipping(int); extern int far pascal txGetClipping(void); extern int far pascal txSetClipRegion(int,int,int,int); extern int far pascal txGetClipRegion(int far *,int far *,int far *,int far *); /* txFF */ extern int far pascal txFileFont(int,char far *,TXHEADER far *); extern int far pascal txRomFont(int,int,TXHEADER far *); /* txFH */ extern int far pascal txGetFileHeader(char far *,GEMHEADER far *); /* txGC */ extern int far pascal txGetColor(int far *,int far *); extern int far pascal txGetAlign(int far *,int far *); extern int far pascal txGetFace(void); extern int far pascal txGetSpace(void); extern int far pascal txGetInter(void); extern int far pascal txGetUnder(void); extern int far pascal txGetOp(void); extern int far pascal txGetRange(int far *,int far *); extern int far pascal txGetPos(int far *,int far *); extern int far pascal txGetCell(int far *,int far *); /* txGH */ extern int far pascal txGetLibHeader(GXLIB far *,char far *,GEMHEADER far *); /* txGS */ extern int far pascal txGetString(char far *,char far *,int,int,char,char); /* txLF */ extern int far pascal txLibFont(int,GXLIB far *,char far *,TXHEADER far *); extern int far pascal txFreeFont(TXHEADER far *); /* txPS */ extern int far pascal txSetGrid(int,int); extern int far pascal txPutChar(char,int,int); extern int far pascal txPutString(char far *,int,int); /* txRF */ extern int far pascal txRotateFont(TXHEADER far *,int,int,TXHEADER far *); /* txSA */ extern int far pascal txSetActivePage(int); extern int far pascal txGetActivePage(void); /* txSD */ extern int far pascal txGetVersion(int far *, int far *); /* txSC */ extern int far pascal txSetColor(int,int); extern int far pascal txSetAlign(int,int); extern int far pascal txSetFace(int); extern int far pascal txSetSpace(int); extern int far pascal txSetInter(int); extern int far pascal txSetUnder(int); extern int far pascal txSetOp(int); /* txSF */ extern int far pascal txSetFont(TXHEADER far *); extern int far pascal txGetFont(TXHEADER far * far *); /* txSL */ extern int far pascal txStrLen(char far *); extern int far pascal txStrWidth(char far *); extern int far pascal txChrWidth(char); extern int far pascal txChrHeight(void); /* txSV */ extern int far pascal txSetActiveVirtual(GXHEADER far *); extern int far pascal txGetActiveVirtual(GXHEADER far * far *); extern int far pascal txSetVirtual(int); extern int far pascal txGetVirtual(void); /* txVP */ extern int far pascal txSetViewPort(int,int,int,int); extern int far pascal txGetViewPort(int far *,int far *,int far *,int far *); /* txVS */ extern long far pascal txLibVirtualSize(GXLIB far *,char far *); extern long far pascal txFileVirtualSize(char far *); /* txWS */ extern int far pascal txWrapString(char far *,int far *,int far *); #ifdef __cplusplus } #endif