2 *graph.h - declare constants and functions for graphics library
4 * Copyright (c) 1987-1988, Microsoft Corporation. All rights reserved.
7 * This file declares the graphics library functions and
8 * the manifest constants that are used with them.
10 *******************************************************************************/
12 /* user-visible declarations for Quick-C Graphics Library */
14 #ifndef _GRAPH_T_DEFINED
16 /* structure for _getvideoconfig() as visible to user */
18 short numxpixels; /* number of pixels on X axis */
19 short numypixels; /* number of pixels on Y axis */
20 short numtextcols; /* number of text columns available */
21 short numtextrows; /* number of text rows available */
22 short numcolors; /* number of actual colors */
23 short bitsperpixel; /* number of bits per pixel */
24 short numvideopages; /* number of available video pages */
25 short mode; /* current video mode */
26 short adapter; /* active display adapter */
27 short monitor; /* active display monitor */
28 short memory; /* adapter video memory in K bytes */
31 /* return value of _setlogorg(), etc. */
37 /* structure for text position */
43 #define _GRAPH_T_DEFINED
48 /* SETUP AND CONFIGURATION */
50 short far cdecl _setvideomode(short);
52 /* arguments to _setvideomode() */
53 #define _DEFAULTMODE -1 /* restore screen to original mode */
54 #define _TEXTBW40 0 /* 40 x 25 text, 16 grey */
55 #define _TEXTC40 1 /* 40 x 25 text, 16/8 color */
56 #define _TEXTBW80 2 /* 80 x 25 text, 16 grey */
57 #define _TEXTC80 3 /* 80 x 25 text, 16/8 color */
58 #define _MRES4COLOR 4 /* 320 x 200, 4 color */
59 #define _MRESNOCOLOR 5 /* 320 x 200, 4 grey */
60 #define _HRESBW 6 /* 640 x 200, BW */
61 #define _TEXTMONO 7 /* 80 x 25 text, BW */
62 #define _HERCMONO 8 /* 720 x 348, BW for HGC */
63 #define _MRES16COLOR 13 /* 320 x 200, 16 color */
64 #define _HRES16COLOR 14 /* 640 x 200, 16 color */
65 #define _ERESNOCOLOR 15 /* 640 x 350, BW */
66 #define _ERESCOLOR 16 /* 640 x 350, 4 or 16 color */
67 #define _VRES2COLOR 17 /* 640 x 480, BW */
68 #define _VRES16COLOR 18 /* 640 x 480, 16 color */
69 #define _MRES256COLOR 19 /* 320 x 200, 256 color */
71 short far cdecl _setactivepage(short);
72 short far cdecl _setvisualpage(short);
74 /* videoconfig adapter values */
75 /* these manifest constants can be used to determine the type of monitor in */
76 /* use, using either simple comparisons or the bitwise-AND operator (&) */
77 #define _MDPA 0x0001 /* Monochrome Display Adapter (MDPA) */
78 #define _CGA 0x0002 /* Color Graphics Adapter (CGA) */
79 #define _EGA 0x0004 /* Enhanced Graphics Adapter (EGA) */
80 #define _VGA 0x0008 /* Video Graphics Array (VGA) */
81 #define _MCGA 0x0010 /* MultiColor Graphics Array (MCGA) */
82 #define _HGC 0x0020 /* Hercules Graphics Card (HGC) */
84 /* videoconfig monitor values */
85 /* these manifest constants can be used to determine the type of the active */
86 /* adapter, using either simple comparisons or the bitwise-AND operator (&) */
87 #define _MONO 0x0001 /* Monochrome */
88 #define _COLOR 0x0002 /* Color (or Enhanced emulating color) */
89 #define _ENHCOLOR 0x0004 /* Enhanced Color */
90 #define _ANALOG 0x0018 /* Analog */
92 struct videoconfig far * far cdecl _getvideoconfig(struct videoconfig far *);
95 /* COORDINATE SYSTEMS */
97 struct xycoord far cdecl _setlogorg(short, short);
98 struct xycoord far cdecl _getlogcoord(short, short);
99 struct xycoord far cdecl _getphyscoord(short, short);
101 void far cdecl _setcliprgn(short, short, short, short);
102 void far cdecl _setviewport(short, short, short, short);
105 /* OUTPUT ROUTINES */
107 /* control parameters for Rectangle, Ellipse and Pie */
108 #define _GBORDER 2 /* draw outline only */
109 #define _GFILLINTERIOR 3 /* fill using current fill mask */
111 #define _GCLEARSCREEN 0
115 void far cdecl _clearscreen(short);
117 struct xycoord far cdecl _moveto(short, short);
118 struct xycoord far cdecl _getcurrentposition(void);
120 short far cdecl _lineto(short, short);
121 short far cdecl _rectangle(short, short, short, short, short);
122 short far cdecl _ellipse(short, short, short, short, short);
123 short far cdecl _arc(short, short, short, short, short, short, short, short);
124 short far cdecl _pie(short, short, short, short, short, short, short, short, short);
126 short far cdecl _setpixel(short, short);
127 short far cdecl _getpixel(short, short);
128 short far cdecl _floodfill(short, short, short);
131 /* PEN COLOR, LINE STYLE, FILL PATTERN */
133 short far cdecl _setcolor(short);
134 short far cdecl _getcolor(void);
136 void far cdecl _setlinestyle(unsigned short);
137 unsigned short far cdecl _getlinestyle(void);
139 void far cdecl _setfillmask(unsigned char far *);
140 unsigned char far * far cdecl _getfillmask(unsigned char far *);
142 /* COLOR SELECTION */
144 long far cdecl _setbkcolor(long);
145 long far cdecl _getbkcolor(void);
147 long far cdecl _remappalette(short, long);
148 short far cdecl _remapallpalette(long far *);
149 short far cdecl _selectpalette(short);
153 #define _GCURSOROFF 0
159 void far cdecl _settextwindow(short, short, short, short);
160 void far cdecl _outtext(char far *);
161 short far cdecl _wrapon(short);
162 short far cdecl _displaycursor(short);
164 struct rccoord far cdecl _settextposition(short, short);
165 struct rccoord far cdecl _gettextposition(void);
167 short far cdecl _settextcolor(short);
168 short far cdecl _gettextcolor(void);
173 void far cdecl _getimage(short, short, short, short, char far *);
174 void far cdecl _putimage(short, short, char far *, short);
175 long far cdecl _imagesize(short, short, short, short);
177 /* "action verbs" for _putimage() */
184 /* universal color values: */
185 #define _BLACK 0x000000L
186 #define _BLUE 0x2a0000L
187 #define _GREEN 0x002a00L
188 #define _CYAN 0x2a2a00L
189 #define _RED 0x00002aL
190 #define _MAGENTA 0x2a002aL
191 #define _BROWN 0x00152aL
192 #define _WHITE 0x2a2a2aL
193 #define _GRAY 0x151515L
194 #define _LIGHTBLUE 0x3F1515L
195 #define _LIGHTGREEN 0x153f15L
196 #define _LIGHTCYAN 0x3f3f15L
197 #define _LIGHTRED 0x15153fL
198 #define _LIGHTMAGENTA 0x3f153fL
199 #define _LIGHTYELLOW 0x153f3fL
200 #define _BRIGHTWHITE 0x3f3f3fL
202 /* mono mode F color values: */
204 #define _MODEFOFFTOON 1L
205 #define _MODEFOFFTOHI 2L
206 #define _MODEFONTOOFF 3L
208 #define _MODEFONTOHI 5L
209 #define _MODEFHITOOFF 6L
210 #define _MODEFHITOON 7L
213 /* mono mode 7 color values: */