home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c221 / 5.ddi / MWHC.005 / 11 < prev    next >
Encoding:
Text File  |  1992-01-07  |  6.0 KB  |  199 lines

  1. /*
  2.  *   graph.h -- non-ANSI 
  3.  *
  4.  *   Graphics utility functions for Microsoft compatibility.
  5.  *
  6.  *           Copyright (c) 1990, MetaWare Incorporated
  7.  */
  8.  
  9. #ifndef _GRAPH_H
  10. #define _GRAPH_H
  11.  
  12. extern char * _cgets(char *);
  13. #ifndef _GRAPH_T_DEFINED
  14. /* structures used in the library */
  15.  
  16. /* Define Non-ANSI structure names if no compiling in ANSI mode */
  17. #ifdef __HIGHC__
  18. #define _xycoord xycoord
  19. #define _rccoord rccoord
  20. #define _videoconfig videoconfig
  21. #endif
  22.  
  23. /* The structures xycoord, rccoord, and videoconfig have been changed to
  24.    _xycoord, _rccoord, and _videoconfig for ANSI conformance.  If you are
  25.    compiling in ANSI mode you will not be able to use the Microsoft names
  26.    which do not include a prepended _.  When compiling in Non-ANSI mode
  27.    the defines above will allow for complete Microsoft name compatiblity. */
  28.  
  29. struct _xycoord
  30.     {
  31.     short xcoord; /* x coordinate */
  32.     short ycoord; /* y coordinate */
  33.     } ;
  34.  
  35. struct _rccoord
  36.     {
  37.     short row; /* x coordinate */
  38.     short col; /* y coordinate */
  39.     } ;
  40.  
  41. struct _videoconfig
  42.     {
  43.     short numxpixels;    /* number of pixels in the x direction */
  44.     short numypixels;    /* number of pixels in the y direction */
  45.     short numtextcols;    /* number of text columns available */
  46.     short numtextrows;    /* number of text rows available */
  47.     short numcolors;    /* number of actual colors available */
  48.     short bitsperpixel;    /* number of bits per pixel */
  49.     short numvideopages;    /* number of available video pages */
  50.     short mode;        /* these are not supported for use */
  51.     short adapter; 
  52.     short monitor;
  53.     short memory;
  54.     } ;
  55.  
  56. #define _GRAPH_T_DEFINED
  57. #endif
  58.  
  59. /* function prototypes */
  60. extern short    _arc(short, short, short, short, short, short, short, short);
  61. extern void    _clearscreen(short);
  62. extern short    _ellipse(short, short, short, short, short);
  63. extern short    _displaycursor(short toggle);
  64. extern short    _floodfill(short x, short y, short boundary);
  65. extern short    _getbkcolor(void);
  66. extern short    _getcolor(void);
  67. extern struct
  68.       _xycoord _getcurrentposition(void);
  69. extern char  *_getfillmask(char *);
  70. extern void    _getimage(short, short, short, short, char *);
  71. extern unsigned short
  72.         _getlinestyle(void);
  73. extern struct
  74.       _xycoord _getlogcoord(short, short);
  75. extern struct
  76.       _xycoord _getphyscoord(short, short);
  77. extern short    _getpixel(short, short);
  78. extern short    _gettextcolor();
  79. extern struct
  80.     _rccoord _gettextposition();
  81. extern struct
  82.     _videoconfig *_getvideoconfig(struct _videoconfig *buffer);
  83. extern long    _imagesize(short, short, short, short);
  84. extern short    _lineto(short, short);
  85. extern struct
  86.       _xycoord _moveto(short, short);
  87. extern void    _outtext(char *text);
  88. extern short    _pie(short, short, short, short, short, short, short, short, short);
  89. extern void   _putimage(short, short, char *, short);
  90. extern short  _rectangle(short, short, short, short, short);
  91. extern short  _setactivepage(short);
  92. extern short     _setbkcolor(short); 
  93. extern void    _setcolor(short);
  94. extern void   _setcliprgn(short, short, short, short);
  95. extern void     _setfillmask(char *);
  96. extern void   _setlinestyle(unsigned short linestyle);
  97. extern struct
  98.       _xycoord _setlogorg(short, short);
  99. extern short _setpixel(short x, short y);
  100. extern short    _settextcolor(short color);
  101. extern struct
  102.     _rccoord _settextposition(short, short);
  103. extern void    _settextwindow(short xt, short yt, short xb, short yb);
  104. extern short    _setvideomode(short);
  105. extern void   _setviewport(short, short, short, short);
  106. extern short  _setvisualpage(short);
  107. extern short    _wrapon(short wrap);
  108. extern short     _selectpalette(short number);
  109. extern short _remapallpalette(long *color);
  110. extern long _remappalette(short pixel, long color);
  111.  
  112.  
  113. /*arguments to _clearscreen() */
  114. #define _GCLEARSCREEN    0
  115. #define _GVIEWPORT        1
  116. #define _GWINDOW        2
  117.  
  118. /* arguments for _displaycursor() */
  119. #define _GCURSOROFF        0
  120. #define _GCURSORON        1
  121.  
  122. /* arguments to _ellipse, _pie(), and _rectangle() */
  123. #define _GBORDER        2
  124. #define _GFILLINTERIOR    3
  125.  
  126. /* videoconfig adapter constants */
  127. #define _MDPA       0x0001      /* Monochrome Display Adapter (MDPA) */
  128. #define _CGA        0x0002      /* Color Graphics Adapter     (CGA) */
  129. #define _EGA        0x0004      /* Enhanced Graphics Adapter  (EGA) */
  130. #define _VGA        0x0008      /* Video Graphics Array       (VGA) */
  131. #define _MCGA       0x0010      /* MultiColor Graphics Array  (MCGA) */
  132. #define _HGC        0x0020      /* Hercules Graphics Card     (HGC) */
  133.  
  134. #define _MONO       0x0001      /* Monochrome */
  135. #define _COLOR      0x0002      /* Color */
  136. #define _ENHCOLOR   0x0004      /* Enhanced Color */
  137. #define _ANALOG     0x0018      /* Analog */
  138.  
  139. /* mode argument to _setvideomode() */
  140. #define _DEFAULTMODE        -1
  141. #define _TEXTBW40        0
  142. #define _TEXTC40        1
  143. #define _TEXTBW80        2
  144. #define _TEXTC80        3
  145. #define _MRES4COLOR        4
  146. #define _MRESNOCOLOR        5
  147. #define _HRESBW            6
  148. #define _TEXTMONO        7
  149. #define _HERCMONO        8
  150. #define _MRES16COLOR        13
  151. #define _HRES16COLOR        14
  152. #define _ERESNOCOLOR        15
  153. #define _ERESCOLOR        16
  154. #define _VRES2COLOR        17
  155. #define _VRES16COLOR        18
  156. #define _MRES256COLOR        19
  157.  
  158.  
  159. /* argument for _putimage() */
  160. #define _GOR            0
  161. #define _GAND            1
  162. #define _GPRESET        2
  163. #define _GPSET        3
  164. #define _GXOR            4
  165.  
  166. /* arguments for _wrapon() */
  167. #define _GWRAPOFF        0
  168. #define _GWRAPON        1
  169.  
  170. /* color constants setcolor, setbkcolor */
  171. #define _BLACK          0
  172. #define _BLUE           1
  173. #define _GREEN          2
  174. #define _CYAN           3
  175. #define _RED            4
  176. #define _MAGENTA        5
  177. #define _BROWN          6
  178. #define _WHITE          7
  179. #define _GRAY           8
  180. #define _LIGHTBLUE      9
  181. #define _LIGHTGREEN     10
  182. #define _LIGHTCYAN      11
  183. #define _LIGHTRED       12
  184. #define _LIGHTMAGENTA   13
  185. #define _LIGHTYELLOW    14
  186. #define _BRIGHTWHITE    15
  187.  
  188. #define _MODEFOFF       0L
  189. #define _MODEFOFFTOON   1L
  190. #define _MODEFOFFTOHI   2L
  191. #define _MODEFONTOOFF   3L
  192. #define _MODEFON        4L
  193. #define _MODEFONTOHI    5L
  194. #define _MODEFHITOOFF   6L
  195. #define _MODEFHITOON    7L
  196. #define _MODEFHI        8L
  197.  
  198. #endif /* _GRAPH_H */
  199.