#include #ifdef __cplusplus extern "C" { #endif #ifndef qdraw #define qdraw 1 #define qc_min(a,b) (((a) > (b)) ? (b) : (a)) #define qc_max(a,b) (((a) < (b)) ? (b) : (a)) #define qc_abs(a) (((a) >= 0) ? (a) : -(a)) #define qc_sign(x) ((x) > 0 ? 1 : ((x) == 0 ? 0 : (-1))) #ifndef MK_FP #define MK_FP( seg,ofs ) (void far * ) (( seg << 16 ) +( ofs )) #endif #ifndef M_PI #define M_PI 3.14159265358979323846 #define M_PI_2 1.57079632679489661923 #define M_PI_4 0.785398163397448309616 #define M_1_PI 0.318309886183790671538 #define M_2_PI 0.636619772367581343076 #define M_1_SQRTPI 0.564189583547756286948 #define M_2_SQRTPI 1.12837916709551257390 #endif #ifndef LEFT_TEXT #define LEFT_TEXT 0 #define CENTER_TEXT 1 #define RIGHT_TEXT 2 #define BOTTOM_TEXT 0 #define TOP_TEXT 2 #define HORIZDIR 0 #define VERTDIR 1 #endif typedef unsigned int usi; #ifndef _FONTINFO_DEFINED /* structure for _getfontinfo() */ struct _fontinfo { int type; /* b0 set = vector,clear = bit map */ int ascent; /* pix dist from top to baseline */ int pixwidth; /* character width in pixels, 0=prop */ int pixheight; /* character height in pixels */ int avgwidth; /* average character width in pixels */ char filename[81]; /* file name including path */ char facename[32]; /* font name */ }; #define _FONTINFO_DEFINED #endif #ifndef _GBORDER #define _GBORDER 2 /* draw outline only */ #define _GFILLINTERIOR 3 /* fill using current fill mask */ #define _GCLEARSCREEN 0 #define _GVIEWPORT 1 #define _GWINDOW 2 #endif /* The following C structure defines a Device Status Block. */ typedef struct { unsigned char stat; /* Current device status. */ unsigned char devtype; /* Device Type Identifier. */ unsigned int xres; /* Device Full Resolution in X */ unsigned int yres; /* Device Full Resolution in Y */ unsigned int xefres; /* Device Effective X Resolution*/ unsigned int yefres; /* Device Effective Y Resolution*/ unsigned int xinch; /* Device X Size in inches*1000 */ unsigned int yinch; /* Device Y Size in inches*1000 */ unsigned int aspec; /* Aspect Ratio * 10000 */ unsigned char chsizx; /* Standard char size X */ unsigned char chsizy; /* Standard char size Y */ unsigned char fcolors; /* Number of foreground colors */ unsigned char bcolors; /* Number of background colors */ } STATUS; typedef struct { unsigned drivernumber; unsigned drivermode; unsigned storagemode; /* storage mode for bitmap */ unsigned planes; /* planes per bit for bitmap */ unsigned intleave; /* interleave factor */ unsigned defaultbgc; /* default background color, usually 0, except for HP PJ where it is white */ unsigned drcolormap; } QC_STATUS; typedef unsigned char far *VMBRPNTR; typedef struct { VMBRPNTR far *vbitmap; /* pointer to virtual bitmap */ unsigned int pxres; /* Resolution in X */ unsigned int pyres; /* Resolution in Y */ unsigned int pstartx; /* Starting index for X */ unsigned int pstarty; /* Starting index for Y */ unsigned int vbmrows; /* # row bytes */ unsigned int vbmcols; /* # row columns */ unsigned int vbmmode; unsigned int bitspercolor; /* # bits per color */ unsigned int pixperbyte; /* # pixels per byte */ unsigned int intrlev; /* interleave factor */ unsigned long vbmsize; /* virtual bitmap size */ unsigned char pmcolors; /* Number of foreground colors */ unsigned char bcolors; /* Number of background colors */ unsigned char pmode; /* output printer mode */ unsigned char porient; /* output orientation, 0 = portrait */ } VBMTYPE; typedef struct { unsigned a_prnport; /* alternative output port */ unsigned a_orient; /* orientation 0=portrait, 1 = landscape */ unsigned a_formfeed; /* formfeed 0=no feed, 1 = feed */ unsigned a_quietmode; /* 0 = display messages, 1 no display */ char a_filename[32]; /* filename for output file */ unsigned a_usecolormap; /* flag to use user colormap */ unsigned a_colormap[16]; /* color map */ unsigned a_comport[5]; /* comport parameters */ unsigned a_sizeoverrides[2]; } AUXSTATTYPE; typedef struct { unsigned int grcmd; /* BGI command */ unsigned int p1,p2,p3,p4,p5; /* parameters */ unsigned int m_strlen; /* length of string */ unsigned char m_string[256]; /* string for default text output */ } METATYPE; enum GRCMDS {M_NULL, M_MOVE, M_DRAW, M_VECT, M_BAR, M_PATBAR, M_SETPIXEL, M_TEXT, M_COLOR, M_FILLSTYLE, M_LINESTYLE, M_TEXTSTYLE, M_PALETTE, M_VIEWPORT, M_CLIP, M_CIRCLE, M_ARC, M_PIE, M_ARC2, M_PIE2}; unsigned v_defbitmap(VBMTYPE *vbm, int x, int y, int startx, int starty, unsigned colors, unsigned intrlev, unsigned bgcolor, unsigned orient, unsigned storage); void v_freebitmap(VBMTYPE * vbm); void v_setpixel(VBMTYPE * vbm, int x, int y, unsigned color); void v_drawline(int x1, int y1, int x2, int y2, unsigned color, unsigned patnum); void sl_setpixel(int x, int y); void v_moveto(int x, int y); void sl_drawline(int x1, int y1, int x2, int y2); void v_lineto(int x, int y); void v_rectangle(int x1, int y1, int x2, int y2); void v_bar(int x1, int y1, int x2, int y2, int rectcolor, int fillcolor, unsigned char *fillpattern); void v_outgraphstring(int x, int y, char far *s, int c, int textdir, int tsiz); void sl_lineto(int x, int y); void v_line(int x1, int y1, int x2, int y2); void _getaspectratio_(int *x, int *y); double a2r(int a); void tc_circle(int x, int y, int r); void tc_arc(int x, int y, int start, int stop, int r, double a); void tc_pie(int x, int y, int start, int stop, int r, double a); void fillpolygon( struct xycoord far *points, int numpoints); void outlinepolygon( struct xycoord far *points, int numpoints); void tc_settextjustify(int x, int y); void tc_settextstyle(int font, int orient, int size); void v_justifystring(char *s); void tc_outtext( char far *s); void mc_tc_arc( int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int *xc, int *yc, int *astart, int *astop, int *r, double *asp ); int mc_pie( int control, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4 ); int mc_arc(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4); void qcsettextofs(int tofs); struct xycoord _getcurrentposition_( void ); struct videoconfig far *_getvideoconfig_( struct videoconfig far *config ); void _setviewport_(int x1, int y1, int x2, int y2); /* MSC */ void _clearscreen_(int p); void _setcliprgn_(int x1, int y1, int x2, int y2); struct xycoord _setgtextvector_(int x, int y); void mc_justifystring(char *s); void _outgtext_( char far *text ); void _outtext_( char far *text ); void _setlinewidth_( unsigned int lw ); void _setlinestyle_( unsigned int mask ); void _setfillmask_( unsigned char far *mask ); int _getcolor_( void ); int _rectangle_( int control, int x1, int y1, int x2, int y2 ); int _pie_( int control, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4 ); void _pie2_(int x, int y, int start, int stop, int r ); void _arc2_(int x, int y, int start, int stop, int r ); int _registerfonts_( char far *pathname ); int _getfontinfo_( struct _fontinfo far *fontbuffer ); int _getfontpoints_(int fontnum, int sizenum); int _getfontsizenum_(int fontnum, int fontpnts); void _settextstyle_(int font, int orient, int size); int _setfont_( char far *options); int _getgtextextent_( char far *text ); void _gettextstyle_(int *font, int *orient, int *size, int *hjust, int *vjust); int _setvideomode_( int mode ); int _setcolor_( int c); int _setpixel_(int x, int y); struct xycoord _moveto_(int x, int y); int _lineto_(int x, int y); int _line_(int x1, int y1, int x2, int y2); void _circle_(int x, int y, int r); int _arc_(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4); unsigned sendto_metafile(unsigned h, unsigned cmd,int v1, int v2, int v3, int v4, int v5, char far *s); unsigned readfrom_metafile(unsigned h, unsigned far *cmd,int far *v1, int far *v2, int far *v3, int far *v4,int far *v5, char far *s); unsigned metacmd_dispatcher(unsigned h); unsigned readauxstatfile(void); void printcomparams(unsigned comport, unsigned baud, unsigned parity, unsigned wordlen, unsigned stopbits, unsigned handshake); void logonscreen(void); void install( int mode ); void init( void ); void clear( void ); void post( void ); void copystatblocks(void); void makemodename(unsigned dn, unsigned dm); unsigned printer_dispatcher(VBMTYPE *vbm, unsigned prnport, unsigned dn, unsigned dm, unsigned ff); int getprnmode(void); #endif #ifdef __cplusplus } #endif