home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 1.ddi / INCLUDE.ZIP / _GRAPH.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-07  |  11.4 KB  |  315 lines

  1. /*------------------------------------------------------------------------
  2.  * filename - _graph.h
  3.  *
  4.  *    Internal version of "graphics.h" (the only difference being
  5.  *    that all functions here are declared "huge").
  6.  *
  7.  *-----------------------------------------------------------------------*/
  8.  
  9. /*[]------------------------------------------------------------[]*/
  10. /*|                                                              |*/
  11. /*|     Turbo C Run Time Library - Version 3.0                   |*/
  12. /*|                                                              |*/
  13. /*|                                                              |*/
  14. /*|     Copyright (c) 1987, 1990 by Borland International        |*/
  15. /*|     All Rights Reserved.                                     |*/
  16. /*|                                                              |*/
  17. /*[]------------------------------------------------------------[]*/
  18.  
  19. #if __STDC__
  20. #define _Cdecl
  21. #else
  22. #define _Cdecl    cdecl
  23. #endif
  24.  
  25. enum graphics_errors {        /* graphresult error return codes */
  26.     grOk          =   0,
  27.     grNoInitGraph      =  -1,
  28.     grNotDetected      =  -2,
  29.     grFileNotFound      =  -3,
  30.     grInvalidDriver      =  -4,
  31.     grNoLoadMem      =  -5,
  32.     grNoScanMem      =  -6,
  33.     grNoFloodMem      =  -7,
  34.     grFontNotFound      =  -8,
  35.     grNoFontMem      =  -9,
  36.     grInvalidMode      = -10,
  37.     grError          = -11,   /* generic error */
  38.     grIOerror      = -12,
  39.     grInvalidFont      = -13,
  40.     grInvalidFontNum  = -14,
  41.     grInvalidDeviceNum = -15
  42. };
  43.  
  44. enum graphics_drivers {        /* define graphics drivers */
  45.     DETECT,            /* requests autodetection */
  46.     CGA, MCGA, EGA, EGA64, EGAMONO, IBM8514,    /* 1 - 6 */
  47.     HERCMONO, ATT400, VGA, PC3270            /* 7 - 10 */
  48. };
  49.  
  50. enum graphics_modes {        /* graphics modes for each driver */
  51.     CGAC0      = 0,  /* 320x200 color palette 0: LightGreen, LightRed, Yellow; 1 page */
  52.     CGAC1      = 1,  /* 320x200 color palette 1: LightCyan, LightMagenta, White; 1 page */
  53.     CGAC2      = 2,  /* 320x200 color palette 2: Green, Red, Brown; 1 page */
  54.     CGAC3      = 3,  /* 320x200 color palette 3: Cyan, Magenta, LightGray; 1 page */
  55.     CGAHI      = 4,  /* 640x200 1 page                        */
  56.     MCGAC0     = 0,  /* 320x200 color palette 0: LightGreen, LightRed, Yellow; 1 page */
  57.     MCGAC1     = 1,  /* 320x200 color palette 1: LightCyan, LightMagenta, White; 1 page */
  58.     MCGAC2     = 2,  /* 320x200 color palette 2: Green, Red, Brown; 1 page */
  59.     MCGAC3     = 3,  /* 320x200 color palette 3: Cyan, Magenta, LightGray; 1 page */
  60.     MCGAMED    = 4,  /* 640x200 1 page                        */
  61.     MCGAHI     = 5,  /* 640x480 1 page                        */
  62.     EGALO      = 0,  /* 640x200 16 color 4 pages                */
  63.     EGAHI      = 1,  /* 640x350 16 color 2 pages                */
  64.     EGA64LO    = 0,  /* 640x200 16 color 1 page                    */
  65.     EGA64HI    = 1,  /* 640x350 4 color     1 page                    */
  66.     EGAMONOHI  = 3,  /* 640x350 64K on card, 1 page - 256K on card, 4 pages */
  67.     HERCMONOHI = 0,  /* 720x348 2 pages                        */
  68.     ATT400C0   = 0,  /* 320x200 color palette 0: LightGreen, LightRed, Yellow; 1 page */
  69.     ATT400C1   = 1,  /* 320x200 color palette 1: LightCyan, LightMagenta, White; 1 page */
  70.     ATT400C2   = 2,  /* 320x200 color palette 2: Green, Red, Brown; 1 page */
  71.     ATT400C3   = 3,  /* 320x200 color palette 3: Cyan, Magenta, LightGray; 1 page */
  72.     ATT400MED  = 4,  /* 640x200 1 page                        */
  73.     ATT400HI   = 5,  /* 640x400 1 page                        */
  74.     VGALO      = 0,  /* 640x200 16 color 4 pages                */
  75.     VGAMED     = 1,  /* 640x350 16 color 2 pages                */
  76.     VGAHI      = 2,  /* 640x480 16 color 1 page                    */
  77.     PC3270HI   = 0,  /* 720x350 1 page                        */
  78.     IBM8514LO  = 0,  /* 640x480 256 colors                    */
  79.     IBM8514HI  = 1   /*1024x768 256 colors                    */
  80. };
  81.  
  82. /* Colors for setpalette and setallpalette */
  83.  
  84. #define    BLACK        0    /* dark colors */
  85. #define    BLUE        1
  86. #define    GREEN        2
  87. #define    CYAN        3
  88. #define    RED        4
  89. #define    MAGENTA        5
  90. #define    BROWN        6
  91. #define    LIGHTGRAY    7
  92. #define    DARKGRAY    8    /* light colors */
  93. #define    LIGHTBLUE    9
  94. #define    LIGHTGREEN    10
  95. #define    LIGHTCYAN    11
  96. #define    LIGHTRED    12
  97. #define    LIGHTMAGENTA    13
  98. #define    YELLOW        14
  99. #define    WHITE        15
  100.  
  101. #define    EGA_BLACK          0    /* dark colors */
  102. #define    EGA_BLUE           1
  103. #define    EGA_GREEN          2
  104. #define    EGA_CYAN           3
  105. #define    EGA_RED            4
  106. #define    EGA_MAGENTA        5
  107. #define    EGA_BROWN          20
  108. #define    EGA_LIGHTGRAY        7
  109. #define    EGA_DARKGRAY        56    /* light colors */
  110. #define    EGA_LIGHTBLUE        57
  111. #define    EGA_LIGHTGREEN        58
  112. #define    EGA_LIGHTCYAN        59
  113. #define    EGA_LIGHTRED        60
  114. #define    EGA_LIGHTMAGENTA    61
  115. #define    EGA_YELLOW        62
  116. #define    EGA_WHITE        63
  117.  
  118. enum line_styles {        /* Line styles for get/setlinestyle */
  119.     SOLID_LINE   = 0,
  120.     DOTTED_LINE  = 1,
  121.     CENTER_LINE  = 2,
  122.     DASHED_LINE  = 3,
  123.     USERBIT_LINE = 4,    /* User defined line style */
  124. };
  125.  
  126. enum line_widths {        /* Line widths for get/setlinestyle */
  127.     NORM_WIDTH  = 1,
  128.     THICK_WIDTH = 3,
  129. };
  130.  
  131. enum font_names {
  132.     DEFAULT_FONT    = 0,    /* 8x8 bit mapped font */
  133.     TRIPLEX_FONT    = 1,    /* "Stroked" fonts */
  134.     SMALL_FONT    = 2,
  135.     SANS_SERIF_FONT    = 3,
  136.     GOTHIC_FONT    = 4
  137. };
  138.  
  139. #define HORIZ_DIR    0    /* left to right */
  140. #define    VERT_DIR    1    /* bottom to top */
  141.  
  142. #define    USER_CHAR_SIZE    0    /* user-defined char size */
  143.  
  144. enum fill_patterns {        /* Fill patterns for get/setfillstyle */
  145.     EMPTY_FILL,        /* fills area in background color */
  146.     SOLID_FILL,        /* fills area in solid fill color */
  147.     LINE_FILL,        /* --- fill */
  148.     LTSLASH_FILL,        /* /// fill */
  149.     SLASH_FILL,        /* /// fill with thick lines */
  150.     BKSLASH_FILL,        /* \\\ fill with thick lines */
  151.     LTBKSLASH_FILL,        /* \\\ fill */
  152.     HATCH_FILL,        /* light hatch fill */
  153.     XHATCH_FILL,        /* heavy cross hatch fill */
  154.     INTERLEAVE_FILL,    /* interleaving line fill */
  155.     WIDE_DOT_FILL,        /* Widely spaced dot fill */
  156.     CLOSE_DOT_FILL,        /* Closely spaced dot fill */
  157.     USER_FILL        /* user defined fill */
  158. };
  159.  
  160. enum putimage_ops {        /* BitBlt operators for putimage */
  161.     COPY_PUT,        /* MOV */
  162.     XOR_PUT,        /* XOR */
  163.     OR_PUT,            /* OR  */
  164.     AND_PUT,        /* AND */
  165.     NOT_PUT            /* NOT */
  166. };
  167.  
  168. enum text_just {        /* Horizontal and vertical justification
  169.                    for settextjustify */
  170.     LEFT_TEXT    = 0,
  171.     CENTER_TEXT    = 1,
  172.     RIGHT_TEXT    = 2,
  173.  
  174.     BOTTOM_TEXT    = 0,
  175.      /* CENTER_TEXT    = 1,  already defined above */
  176.     TOP_TEXT    = 2
  177. };
  178.  
  179.  
  180. #define MAXCOLORS 15
  181.  
  182. struct palettetype {
  183.     unsigned char size;
  184.       signed char colors[MAXCOLORS+1];
  185. };
  186.  
  187. struct linesettingstype {
  188.     int linestyle;
  189.     unsigned upattern;
  190.     int thickness;
  191. };
  192.  
  193. struct textsettingstype {
  194.     int font;
  195.     int direction;
  196.     int charsize;
  197.     int horiz;
  198.     int vert;
  199. };
  200.  
  201. struct fillsettingstype {
  202.     int pattern;
  203.     int color;
  204. };
  205.  
  206. struct pointtype {
  207.     int x, y;
  208. };
  209.  
  210. struct viewporttype {
  211.     int left, top, right, bottom;
  212.     int clip;
  213. };
  214.  
  215. struct arccoordstype {
  216.     int x, y;
  217.     int xstart, ystart, xend, yend;
  218. };
  219.  
  220. typedef unsigned char fillpatterntype[8];
  221.  
  222. #ifdef __cplusplus
  223. extern "C" {
  224. #endif
  225. void       huge _Cdecl arc(int __x, int __y, int __stangle, int __endangle,
  226.                int __radius);
  227. void       huge _Cdecl bar(int __left, int __top, int __right, int __bottom);
  228. void       huge _Cdecl bar3d(int __left, int __top, int __right, int __bottom,
  229.                  int __depth, int __topflag);
  230. void       huge _Cdecl circle(int __x, int __y, int __radius);
  231. void       huge _Cdecl cleardevice(void);
  232. void       huge _Cdecl clearviewport(void);
  233. void       huge _Cdecl closegraph(void);
  234. void       huge _Cdecl detectgraph(int far *__graphdriver,int far *__graphmode);
  235. void       huge _Cdecl drawpoly(int __numpoints, int far *__polypoints);
  236. void       huge _Cdecl ellipse(int __x, int __y, int __stangle, int __endangle,
  237.                    int __xradius, int __yradius);
  238. void       huge _Cdecl fillpoly(int __numpoints, int far *__polypoints);
  239. void       huge _Cdecl floodfill(int __x, int __y, int __border);
  240. void       huge _Cdecl getarccoords(struct arccoordstype far *__arccoords);
  241. void       huge _Cdecl getaspectratio(int far *__xasp, int far *__yasp);
  242. int       huge _Cdecl getbkcolor(void);
  243. int       huge _Cdecl getcolor(void);
  244. void       huge _Cdecl getfillpattern(char far *__pattern);
  245. void       huge _Cdecl getfillsettings(struct fillsettingstype far *__fillinfo);
  246. int       huge _Cdecl getgraphmode(void);
  247. void       huge _Cdecl getimage(int __left, int __top, int __right, int __bottom,
  248.                     void far *__bitmap);
  249. void       huge _Cdecl getlinesettings(struct linesettingstype far *__lineinfo);
  250. int       huge _Cdecl getmaxcolor(void);
  251. int       huge _Cdecl getmaxx(void);
  252. int       huge _Cdecl getmaxy(void);
  253. void       huge _Cdecl getmoderange(int __graphdriver, int far *__lomode,
  254.                     int far *__himode);
  255. unsigned   huge _Cdecl getpixel(int __x, int __y);
  256. void       huge _Cdecl getpalette(struct palettetype far *__palette);
  257. void       huge _Cdecl gettextsettings(struct textsettingstype far *__textinfo);
  258. void       huge _Cdecl getviewsettings(struct viewporttype far *__viewport);
  259. int       huge _Cdecl getx(void);
  260. int       huge _Cdecl gety(void);
  261. void       huge _Cdecl graphdefaults(void);
  262. char far * huge _Cdecl grapherrormsg(int __errorcode);
  263. void       far  _Cdecl _graphexit(int __status);
  264. void       far  _Cdecl _graphfreemem(void far *__ptr, unsigned __size);
  265. void far * far  _Cdecl _graphgetmem(unsigned __size);
  266. int       huge _Cdecl graphresult(void);
  267. unsigned   huge _Cdecl imagesize(int __left, int __top, int __right, int __bottom);
  268. void       huge _Cdecl initgraph(int  far *__graphdriver,
  269.                  int  far *__graphmode,
  270.                  char far *__pathtodriver);
  271. void       huge _Cdecl line(int __x1, int __y1, int __x2, int __y2);
  272. void       huge _Cdecl linerel(int __dx, int __dy);
  273. void       huge _Cdecl lineto(int __x, int __y);
  274. void       huge _Cdecl moverel(int __dx, int __dy);
  275. void       huge _Cdecl moveto(int __x, int __y);
  276. void       huge _Cdecl outtext(char far *__textstring);
  277. void       huge _Cdecl outtextxy(int __x, int __y, char far *__textstring);
  278. void       huge _Cdecl pieslice(int __x, int __y, int __stangle, int __endangle,
  279.                     int __radius);
  280. void       huge _Cdecl putimage(int __left, int __top, void far *__bitmap, int __op);
  281. void       huge _Cdecl putpixel(int __x, int __y, int __color);
  282. void       huge _Cdecl rectangle(int __left, int __top, int __right, int __bottom);
  283. void       huge _Cdecl restorecrtmode(void);
  284. void       huge _Cdecl setactivepage(int __page);
  285. void       huge _Cdecl setallpalette(struct palettetype far *__palette);
  286. void       huge _Cdecl setbkcolor(int __color);
  287. void       huge _Cdecl setcolor(int __color);
  288. void       huge _Cdecl setfillpattern(char far *__upattern, int __color);
  289. void       huge _Cdecl setfillstyle(int __pattern, int __color);
  290. unsigned   huge _Cdecl setgraphbufsize(unsigned __bufsize);
  291. void       huge _Cdecl setgraphmode(int __mode);
  292. void       huge _Cdecl setlinestyle(int __linestyle,
  293.                     unsigned __upattern,
  294.                     int __thickness);
  295. void       huge _Cdecl setpalette(int __colornum, int __color);
  296. void       huge _Cdecl setrgbpalette(int __colornum,
  297.                      int __red, int __green, int __blue);
  298. void       huge _Cdecl settextjustify(int __horiz, int __vert);
  299. void       huge _Cdecl settextstyle(int __font, int __direction, int __charsize);
  300. void       huge _Cdecl setusercharsize(int __multx, int __divx,
  301.                        int __multy, int __divy);
  302. void       huge _Cdecl setviewport(int __left, int __top, int __right, int __bottom,
  303.                    int __clip);
  304. void       huge _Cdecl setvisualpage(int __page);
  305. int        huge _Cdecl textheight(char far *__textstring);
  306. int        huge _Cdecl textwidth(char far *__textstring);
  307.  
  308. void            _Cdecl registerbgidriver(void (*driver)(void));
  309. int       huge _Cdecl registerfarbgidriver(void far *__driver);
  310. void            _Cdecl registerbgifont(void (*font)(void));
  311. int       huge _Cdecl registerfarbgifont(void far *__font);
  312. #ifdef __cplusplus
  313. }
  314. #endif
  315.