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