home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c496 / 2.img / GRAPHHLP.WPK / GRAPHICS.HLP
Encoding:
Text File  |  1991-08-20  |  59.1 KB  |  1,450 lines

  1. ::::_ARC
  2. #include \<graph.h>
  3. short _FAR _arc( short x1, short y1,
  4.          short x2, short y2,
  5.          short x3, short y3,
  6.          short x4, short y4 );
  7.  
  8. short _FAR _arc_w( double x1, double y1,
  9.            double x2, double y2,
  10.            double x3, double y3,
  11.            double x4, double y4 );
  12.  
  13. short _FAR _arc_wxy( struct _wxycoord _FAR *p1,
  14.              struct _wxycoord _FAR *p2,
  15.              struct _wxycoord _FAR *p3,
  16.              struct _wxycoord _FAR *p4 );
  17.  
  18. The _arc functions draw elliptical arcs.    The _arc function uses the
  19. view  coordinate  system.   The _arc_w and _arc_wxy  functions use the
  20. window coordinate system.
  21.  
  22. The center of the arc is the center of the  rectangle  established  by
  23. the points (x1,y1) and (x2,y2).    The arc is a segment of the ellipse
  24. drawn within this bounding rectangle.    The arc starts at the point on
  25. this ellipse that intersects the vector from the centre of the ellipse
  26. to the point (x3,y3).    The arc ends at the point on this ellipse that
  27. intersects  the  vector  from  the centre of the  ellipse to the point
  28. (x4,y4).    The arc is drawn in a counter-clockwise direction with the
  29. current  plot  action  using the  current  color and the  current line
  30. style.
  31.  
  32. When the  coordinates  (x1,y1) and (x2,y2) establish a line or a point
  33. (this  happens    when one or more of the x-coordinates or y-coordinates
  34. are equal), nothing is drawn.
  35.  
  36. The current output position for graphics output is set to be the point
  37. at the end of the arc that was drawn.
  38. ::::_CLEARSCREEN
  39. #include \<graph.h>
  40. void _FAR _clearscreen( short area );
  41.  
  42. The  _clearscreen  function  clears the indicated  "area" and fills it
  43. with the  background  color.   The "area"  argument must be one of the
  44. following values:
  45.  
  46. _GCLEARSCREEN        area is entire screen
  47.  
  48. _GVIEWPORT        area is current viewport or clip region
  49.  
  50. _GWINDOW        area is current text window
  51. ::::_DISPLAYCURSOR
  52. #include \<graph.h>
  53. short _FAR _displaycursor( short mode );
  54.  
  55. The  _displaycursor  function  is  used to establish  whether the text
  56. cursor is to be displayed when graphics functions complete.   On entry
  57. to a  graphics    function,  the text  cursor is turned  off.   When the
  58. function  completes, the "mode" setting  determines whether the cursor
  59. is turned back on.   The "mode" argument can have one of the following
  60. values:
  61.  
  62. _GCURSORON        the cursor will be displayed
  63.  
  64. _GCURSOROFF        the cursor will not be displayed
  65. ::::_ELLIPSE
  66. #include \<graph.h>
  67. short _FAR _ellipse( short fill, short x1, short y1,
  68.                  short x2, short y2 );
  69.  
  70. short _FAR _ellipse_w( short fill, double x1, double y1,
  71.                    double x2, double y2 );
  72.  
  73. short _FAR _ellipse_wxy( short fill,
  74.              struct _wxycoord _FAR *p1,
  75.              struct _wxycoord _FAR *p2 );
  76.  
  77. The _ellipse functions draw ellipses.    The _ellipse function uses the
  78. view coordinate system.  The _ellipse_w and _ellipse_wxy functions use
  79. the window coordinate system.
  80.  
  81. The center of the  ellipse is the center of the  rectangle established
  82. by the points (x1,y1) and (x2,y2).
  83.  
  84. The argument "fill" determines whether the ellipse is filled in or has
  85. only its outline drawn.  The argument can have one of two values:
  86.  
  87. _GFILLINTERIOR        fill  the  interior  by  writing  pixels  with the
  88.             current  plot  action using the current  color and
  89.             the current fill mask
  90.  
  91. _GBORDER        leave the interior    unchanged; draw the outline of
  92.             the figure    with the current plot action using the
  93.             current color and line style
  94.  
  95. When the  coordinates  (x1,y1) and (x2,y2) establish a line or a point
  96. (this  happens    when one or more of the x-coordinates or y-coordinates
  97. are equal), nothing is drawn.
  98. ::::_FLOODFILL
  99. #include \<graph.h>
  100. short _FAR _floodfill( short x, short y,
  101.                short stop_color );
  102.  
  103. short _FAR _floodfill_w( double x, double y,
  104.              short stop_color );
  105.  
  106. The _floodfill functions fill an area of the screen.    The _floodfill
  107. function uses the view coordinate system.    The _floodfill_w function
  108. uses the window coordinate system.
  109.  
  110. The filling starts at the point (x,y) and continues in all directions:
  111. when a    pixel is filled, the  neighbouring  pixels  (horizontally  and
  112. vertically)  are then  considered for filling.     Filling is done using
  113. the current color and fill mask.    No filling will occur if the point
  114. (x,y) lies outside the clipping region.
  115.  
  116. If the    argument  "stop_color"    is a  valid pixel value,  filling will
  117. occur  in each    direction  until a pixel is  encountered  with a pixel
  118. value of  "stop_color". The filled area will be the area around (x,y),
  119. bordered by "stop_color". No filling will occur if the point (x,y) has
  120. the pixel value "stop_color".
  121.  
  122. If  "stop_color"  has the value  (-1), filling occurs until a pixel is
  123. encountered  with a pixel  value different from the pixel value of the
  124. starting point (x,y).  No filling will occur if the pixel value of the
  125. point (x,y) is the current color.
  126. ::::_GETACTIVEPAGE
  127. #include \<graph.h>
  128. short _FAR _getactivepage( void );
  129.  
  130. The  _getactivepage  function  returns    the  number  of the  currently
  131. selected active graphics page.
  132.  
  133. Only  some  combinations  of video modes and hardware  allow  multiple
  134. pages of graphics to exist.   When  multiple  pages are supported, the
  135. active page may differ from the visual page.  The graphics information
  136. in the visual  page  determines  what is  displayed  upon the  screen.
  137. Animation  may be  accomplished  by  alternating  the visual page.   A
  138. graphics  page    can be    constructed  without  affecting  the screen by
  139. setting the active page to be different than the visual page.
  140.  
  141. The number of  available  video  pages can be  determined by using the
  142. _getvideoconfig function.  The default video page is 0.
  143. ::::_GETARCINFO
  144. #include \<graph.h>
  145. short _FAR _getarcinfo( struct xycoord _FAR *start_pt,
  146.             struct xycoord _FAR *end_pt,
  147.             struct xycoord _FAR *inside_pt );
  148.  
  149. The  _getarcinfo  function  returns  information  about  the  arc most
  150. recently  drawn  by  the  _arc    or  _pie  functions.    The  arguments
  151. "start_pt"  and  "end_pt" are set to contain the endpoints of the arc.
  152. The  argument  "inside_pt"  will  contain the  coordinates  of a point
  153. within the pie.    The points are all specified in the view coordinate
  154. system.
  155.  
  156. The  endpoints    of the arc can be used to  connect  other lines to the
  157. arc.  The interior point can be used to fill the pie.
  158. ::::_GETBKCOLOR
  159. #include \<graph.h>
  160. long _FAR _getbkcolor( void );
  161.  
  162. The  _getbkcolor  function  returns the current background color.   In
  163. text  modes,  the  background  color  controls    the  area  behind each
  164. individual character.  In graphics modes, the background refers to the
  165. entire screen.    The default background color is 0.
  166. ::::_GETCLIPRGN
  167. #include \<graph.h>
  168. void _FAR _getcliprgn( short _FAR *x1, short _FAR *y1,
  169.                short _FAR *x2, short _FAR *y2 );
  170.  
  171. The  _getcliprgn function returns the location of the current clipping
  172. region.    A  clipping    region    is  defined  with the  _setcliprgn  or
  173. _setviewport functions.  By default, the clipping region is the entire
  174. screen.
  175.  
  176. The  current  clipping    region is a  rectangular area of the screen to
  177. which  graphics  output  is  restricted.   The top left  corner of the
  178. clipping region is placed in the arguments (x1,y1).   The bottom right
  179. corner of the clipping region is placed in (x2,y2).
  180. ::::_GETCOLOR
  181. #include \<graph.h>
  182. short _FAR _getcolor( void );
  183.  
  184. The  _getcolor function returns the pixel value for the current color.
  185. This is the color used for  displaying    graphics output.   The default
  186. color  value  is one  less  than the  maximum  number of colors in the
  187. current video mode.
  188. ::::_GETCURRENTPOSITION
  189. #include \<graph.h>
  190. struct xycoord _FAR _getcurrentposition( void );
  191.  
  192. struct _wxycoord _FAR _getcurrentposition_w( void );
  193.  
  194. The  _getcurrentposition  functions return the current output position
  195. for graphics.     The _getcurrentposition function returns the point in
  196. view  coordinates.   The  _getcurrentposition_w  function  returns the
  197. point in window coordinates.
  198.  
  199. The  current  position defaults to the origin, (0,0), when a new video
  200. mode  is  selected.   It is changed by    successful  calls to the _arc,
  201. _moveto and _lineto functions as well as the _setviewport function.
  202.  
  203. Note that the output  position for graphics  output  differs from that
  204. for text  output.   The output    position for text output can be set by
  205. use of the _settextposition function.
  206. ::::_GETFILLMASK
  207. #include \<graph.h>
  208. unsigned char _FAR * _FAR
  209.     _getfillmask( unsigned char _FAR *mask );
  210.  
  211. The  _getfillmask  function copies the current fill mask into the area
  212. located by the argument "mask". The fill mask is used by the _ellipse,
  213. _floodfill,  _pie, _polygon and _rectangle functions that fill an area
  214. of the screen.
  215.  
  216. The fill mask is an  eight-byte array which is interpreted as a square
  217. pattern  (8 by 8) of 64 bits.    Each bit in the mask  corresponds to a
  218. pixel.     When a  region is filled,  each point in the region is mapped
  219. onto the fill mask.   When a bit from the mask is one, the pixel value
  220. of the    corresponding  point is set using the current  plotting action
  221. with the  current color; when the bit is zero, the pixel value of that
  222. point is not affected.
  223.  
  224. When the fill mask is not set, a fill operation will set all points in
  225. the fill region to have a pixel value of the current color.
  226. ::::_GETIMAGE
  227. #include \<graph.h>
  228. void _FAR _getimage( short x1, short y1,
  229.              short x2, short y2,
  230.              char _HUGE *image );
  231.  
  232. void _FAR _getimage_w( double x1, double y1,
  233.                double x2, double y2,
  234.                char _HUGE *image );
  235.  
  236. void _FAR _getimage_wxy( struct _wxycoord _FAR *p1,
  237.              struct _wxycoord _FAR *p2,
  238.              char _HUGE *image );
  239.  
  240. The _getimage functions store a copy of an area of the screen into the
  241. buffer indicated by the "image" argument.  The _getimage function uses
  242. the  view  coordinate  system.      The  _getimage_w  and  _getimage_wxy
  243. functions use the window coordinate system.
  244.  
  245. The screen image is the rectangular area defined by the points (x1,y1)
  246. and (x2,y2).    The buffer "image" must be large enough to contain the
  247. image (the size of the image can be determined by using the _imagesize
  248. function).    The image may be displayed upon the screen at some later
  249. time by using the _putimage functions.
  250. ::::_GETLINESTYLE
  251. #include \<graph.h>
  252. unsigned short _FAR _getlinestyle( void );
  253.  
  254. The _getlinestyle function returns the current line-style mask.
  255.  
  256. The  line-style  mask determines the style by which lines and arcs are
  257. drawn.     The  mask is  treated    as an array of 16 bits.   As a line is
  258. drawn,    a  pixel  at a time,  the bits in this    array  are  cyclically
  259. tested.  When a bit in the array is 1, the pixel value for the current
  260. point is set using the current color according to the current plotting
  261. action; otherwise, the pixel value for the point is left unchanged.  A
  262. solid line would result from a value of 0xFFFF and a dashed line would
  263. result from a value of 0xF0F0.
  264.  
  265. The default line style mask is 0xFFFF.
  266. ::::_GETPHYSCOORD
  267. #include \<graph.h>
  268. struct xycoord _FAR _getphyscoord( short x, short y );
  269.  
  270. The  _getphyscoord  function  returns the physical  coordinates of the
  271. position with view coordinates (x,y).  View coordinates are defined by
  272. the _setvieworg and _setviewport functions.
  273. ::::_GETPIXEL
  274. #include \<graph.h>
  275. short _FAR _getpixel( short x, short y );
  276.  
  277. short _FAR _getpixel_w( double x, double y );
  278.  
  279. The  _getpixel    functions  return  the    pixel value for the point with
  280. coordinates  (x,y).   The  _getpixel function uses the view coordinate
  281. system.  The _getpixel_w function uses the window coordinate system.
  282. ::::_GETPLOTACTION
  283. #include \<graph.h>
  284. short _FAR _getplotaction( void );
  285.  
  286. The _getplotaction function returns the current plotting action.
  287.  
  288. The drawing functions cause pixels to be set with a pixel value.    By
  289. default,  the value to be set is  obtained  by    replacing the original
  290. pixel  value  with the    supplied  pixel  value.    Alternatively,  the
  291. replaced  value may be    computed as a function of the original and the
  292. supplied pixel values.
  293.  
  294. The plotting action can have one of the following values:
  295.  
  296. _GPSET            replace  the original  screen pixel value with the
  297.             supplied pixel value
  298.  
  299. _GAND            replace  the original  screen pixel value with the
  300.             bitwise  and of the  original  pixel value and the
  301.             supplied pixel value
  302.  
  303. _GOR            replace  the original  screen pixel value with the
  304.             bitwise  or of the    original  pixel  value and the
  305.             supplied pixel value
  306.  
  307. _GXOR            replace  the original  screen pixel value with the
  308.             bitwise  exclusive-or  of the original pixel value
  309.             and  the supplied  pixel value.   Performing  this
  310.             operation  twice will restore the original    screen
  311.             contents, providing an efficient method to produce
  312.             animated effects.
  313. ::::_GETTEXTCOLOR
  314. #include \<graph.h>
  315. short _FAR _gettextcolor( void );
  316.  
  317. The _gettextcolor function returns the pixel value of the current text
  318. color.      This is the color used for displaying text with the _outtext
  319. and  _outmem  functions.   The    default  text color  value is set to 7
  320. whenever a new video mode is selected.
  321. ::::_GETTEXTCURSOR
  322. #include \<graph.h>
  323. short _FAR _gettextcursor( void );
  324.  
  325. The  _gettextcursor  function returns the current cursor attribute, or
  326. shape.    The cursor shape is set with the _settextcursor function.  See
  327. the _settextcursor function for a description of the value returned by
  328. the _gettextcursor function.
  329. ::::_GETTEXTEXTENT
  330. #include \<graph.h>
  331. void _FAR _gettextextent( short x, short y,
  332.               char _FAR *text,
  333.               struct xycoord _FAR *concat,
  334.               struct xycoord _FAR *extent );
  335.  
  336. The  _gettextextent function simulates the effect of using the _grtext
  337. function  to display  the text    string    "text" at the  position (x,y),
  338. using the current text settings.   The concatenation point is returned
  339. in the argument "concat". The text extent parallelogram is returned in
  340. the array "extent".
  341.  
  342. The  concatenation  point is the  position to use to output text after
  343. the given  string.   The text extent  parallelogram  outlines the area
  344. where  the  text  string  would be  displayed.      The four  points are
  345. returned  in  counter-clockwise  order,  starting  at  the  upper-left
  346. corner.
  347. ::::_GETTEXTPOSITION
  348. #include \<graph.h>
  349. struct rccoord _FAR _gettextposition( void );
  350.  
  351. The  _gettextposition function returns the current output position for
  352. text.  This position is in terms of characters, not pixels.
  353.  
  354. The  current  position    defaults to the top left corner of the screen,
  355. (1,1), when a new video mode is selected.  It is changed by successful
  356. calls to the _outtext,    _outmem,  _settextposition  and _settextwindow
  357. functions.
  358.  
  359. Note that the output  position for graphics  output  differs from that
  360. for text output.    The output position for graphics output can be set
  361. by use of the _moveto function.
  362. ::::_GETTEXTSETTINGS
  363. #include \<graph.h>
  364. struct textsettings _FAR * _FAR _gettextsettings
  365.     ( struct textsettings _FAR *settings );
  366.  
  367. The  _gettextsettings  function returns  information about the current
  368. text  settings    used when text is  displayed  by the _grtext function.
  369. The  information is stored in the  textsettings structure indicated by
  370. the argument  "settings".  The structure contains the following fields
  371. (all are short fields):
  372.  
  373. basevectorx        x-component of the current base vector
  374.  
  375. basevectory        y-component of the current base vector
  376.  
  377. path            current text path
  378.  
  379. height            current text height (in pixels)
  380.  
  381. width            current text width (in pixels)
  382.  
  383. spacing         current text spacing (in pixels)
  384.  
  385. horizalign        horizontal component of the current text alignment
  386.  
  387. vertalign        vertical component of the current text alignment
  388. ::::_GETTEXTWINDOW
  389. #include \<graph.h>
  390. void _FAR _gettextwindow(
  391.         short _FAR *row1, short _FAR *col1,
  392.         short _FAR *row2, short _FAR *col2 );
  393.  
  394. The  _gettextwindow  function returns the location of the current text
  395. window.   A text window is defined with the  _settextwindow  function.
  396. By default, the text window is the entire screen.
  397.  
  398. The  current  text  window is a rectangular area of the screen.   Text
  399. display is restricted to be within this window.    The top left corner
  400. of the text window is placed in the arguments (row1,col1).  The bottom
  401. right corner of the text window is placed in (row2,col2).
  402. ::::_GETVIDEOCONFIG
  403. #include \<graph.h>
  404. struct videoconfig _FAR * _FAR _getvideoconfig
  405.     ( struct videoconfig _FAR *config );
  406.  
  407. The  _getvideoconfig  function returns    information  about the current
  408. video  mode  and the  hardware    configuration.      The  information  is
  409. returned  in  the  videoconfig    structure  indicated  by the  argument
  410. "config".  The    structure contains the following fields (all are short
  411. fields):
  412.  
  413. numxpixels        number of pixels in x-axis
  414.  
  415. numypixels        number of pixels in y-axis
  416.  
  417. numtextcols        number of text columns
  418.  
  419. numtextrows        number of text rows
  420.  
  421. numcolors        number of actual colors
  422.  
  423. bitsperpixel        number of bits in a pixel value
  424.  
  425. numvideopages        number of video pages
  426.  
  427. mode            current video mode
  428.  
  429. adapter         adapter type
  430.  
  431. monitor         monitor type
  432.  
  433. memory            number  of kilobytes  (1024  characters)  of video
  434.             memory
  435. ::::_GETVIEWCOORD
  436. #include \<graph.h>
  437. struct xycoord _FAR _getviewcoord( short x, short y );
  438.  
  439. struct xycoord _FAR _getviewcoord_w( double x, double y );
  440.  
  441. struct xycoord _FAR _getviewcoord_wxy(
  442.             struct _wxycoord _FAR *p );
  443.  
  444. The  _getviewcoord  functions  translate  a point  from one coordinate
  445. system to viewport coordinates.  The _getviewcoord function translates
  446. the point (x,y) from physical  coordinates.   The  _getviewcoord_w and
  447. _getviewcoord_wxy  functions  translate  the  point  from  the    window
  448. coordinate system.
  449.  
  450. Viewport  coordinates  are defined by the _setvieworg and _setviewport
  451. functions.  Window coordinates are defined by the _setwindow function.
  452.  
  453. Note:     In  previous  versions  of the  software,  the  _getviewcoord
  454. function was called _getlogcoord.
  455. ::::_GETVISUALPAGE
  456. #include \<graph.h>
  457. short _FAR _getvisualpage( void );
  458.  
  459. The  _getvisualpage  function  returns    the  number  of the  currently
  460. selected visual graphics page.
  461.  
  462. Only  some  combinations  of video modes and hardware  allow  multiple
  463. pages of graphics to exist.   When  multiple  pages are supported, the
  464. active page may differ from the visual page.  The graphics information
  465. in the visual  page  determines  what is  displayed  upon the  screen.
  466. Animation  may be  accomplished  by  alternating  the visual page.   A
  467. graphics  page    can be    constructed  without  affecting  the screen by
  468. setting the active page to be different than the visual page.
  469.  
  470. The number of  available  video  pages can be  determined by using the
  471. _getvideoconfig function.  The default video page is 0.
  472. ::::_GETWINDOWCOORD
  473. #include \<graph.h>
  474. struct _wxycoord _FAR _getwindowcoord( short x, short y );
  475.  
  476. The  _getwindowcoord  function    returns the window  coordinates of the
  477. position with view coordinates (x,y).    Window coordinates are defined
  478. by the _setwindow function.
  479. ::::_GRSTATUS
  480. #include \<graph.h>
  481. short _FAR _grstatus( void );
  482.  
  483. The  _grstatus function returns the status of the most recently called
  484. graphics  library  function.   The  function  can be  called after any
  485. graphics  function  to    determine if any errors or warnings  occurred.
  486. The  function  returns    0 if the  previous  function  was  successful.
  487. Values    less than 0 indicate  an error occurred; values greater than 0
  488. indicate a warning condition.
  489.  
  490. The following values can be returned:
  491.  
  492.     Constant          Value  Explanation
  493.  
  494.     _GROK            0     no error
  495.     _GRERROR           -1     graphics error
  496.     _GRMODENOTSUPPORTED    -2     video mode not supported
  497.     _GRNOTINPROPERMODE       -3     function n/a in this mode
  498.     _GRINVALIDPARAMETER    -4     invalid parameter(s)
  499.     _GRINSUFFICIENTMEMORY  -5     out of memory
  500.     _GRNOOUTPUT         1     nothing was done
  501.     _GRCLIPPED            2     output clipped
  502. ::::_GRTEXT
  503. #include \<graph.h>
  504. short _FAR _grtext( short x, short y,
  505.             char _FAR *text );
  506.  
  507. short _FAR _grtext_w( double x, double y,
  508.               char _FAR *text );
  509.  
  510. The  _grtext  functions  display  a  character    string.    The _grtext
  511. function uses the view coordinate system.  The _grtext_w function uses
  512. the window coordinate system.
  513.  
  514. The character string "text" is displayed at the point (x,y).  The text
  515. is displayed in the current color using the current text settings.
  516.  
  517. Graphics  text    differs  from  the  text  displayed  by  the  _outtext
  518. function.   Characters    are  drawn  as a  sequence  of line  segments.
  519. Graphics  text    can  be  drawn    in  different  sizes,  with  different
  520. orientations and alignments.    The text displayed by the _outtext and
  521. _outmem  functions  uses the system BIOS, and can be displayed in only
  522. one size.
  523. ::::_IMAGESIZE
  524. #include \<graph.h>
  525. long _FAR _imagesize( short x1, short y1,
  526.               short x2, short y2 );
  527.  
  528. long _FAR _imagesize_w( double x1, double y1,
  529.             double x2, double y2 );
  530.  
  531. long _FAR _imagesize_wxy( struct _wxycoord _FAR *p1,
  532.               struct _wxycoord _FAR *p2 );
  533.  
  534. The _imagesize functions compute the number of bytes required to store
  535. a screen  image.   The    _imagesize  function  uses the view coordinate
  536. system.   The _imagesize_w and _imagesize_wxy functions use the window
  537. coordinate system.
  538.  
  539. The screen image is the rectangular area defined by the points (x1,y1)
  540. and (x2,y2).  The storage area used by the _getimage functions must be
  541. at least this large (in bytes).
  542. ::::_LINETO
  543. #include \<graph.h>
  544. short _FAR _lineto( short x, short y );
  545.  
  546. short _FAR _lineto_w( double x, double y );
  547.  
  548. The _lineto functions draw straight lines.   The _lineto function uses
  549. the view  coordinate  system.    The _lineto_w function uses the window
  550. coordinate system.
  551.  
  552. The  line  is  drawn  from the    current  position  to the point at the
  553. coordinates (x,y).   The point (x,y) becomes the new current position.
  554. The line is drawn with the  current  plotting action using the current
  555. line style and the current color.
  556. ::::_MOVETO
  557. #include \<graph.h>
  558. struct xycoord _FAR _moveto( short x, short y );
  559.  
  560. struct _wxycoord _FAR _moveto_w( double x, double y );
  561.  
  562. The _moveto  functions    set the current  output position for graphics.
  563. The _moveto function uses the view coordinate system.     The _moveto_w
  564. function uses the window coordinate system.
  565.  
  566. The  current output position is set to be the point at the coordinates
  567. (x,y).      Nothing is drawn by the function.  The _lineto function uses
  568. the  current  output  position    as the    starting  point when a line is
  569. drawn.
  570.  
  571. Note that the output  position for graphics  output  differs from that
  572. for text  output.   The output    position for text output can be set by
  573. use of the _settextposition function.
  574. ::::_OUTMEM
  575. #include \<graph.h>
  576. void _FAR _outmem( char _FAR *text, short length );
  577.  
  578. The _outmem  function  displays the character  string indicated by the
  579. argument  "text".  The    argument  "length"  specifies  the  number  of
  580. characters  to be displayed.   Unlike the _outtext  function,  _outmem
  581. will display the graphical  representation of characters such as ASCII
  582. 10 and 0, instead of interpreting them as control characters.
  583.  
  584. The  text  is    displayed  using  the  current    text  color  (see  the
  585. _settextcolor  function),  starting  at the current text position (see
  586. the  _settextposition  function).   The text  position    is  updated to
  587. follow the end of the displayed text.
  588.  
  589. The  text  displayed  by the _outtext and _outmem  functions  uses the
  590. system BIOS, and can be displayed in any video mode.   Another form of
  591. text  is  available  with  the _grtext    function.    Graphics  text is
  592. displayed  as a  sequence  of  line  segments,    and  can be  drawn  in
  593. different sizes, with different orientations and alignments.
  594. ::::_OUTTEXT
  595. #include \<graph.h>
  596. void _FAR _outtext( char _FAR *text );
  597.  
  598. The _outtext  function    displays the character string indicated by the
  599. argument  "text".  The string  must be    terminated by a null character
  600. ('\0').   When a  line-feed  character    ('\n') is  encountered    in the
  601. string,  the characters following will be displayed on the next row of
  602. the screen.
  603.  
  604. The  text  is    displayed  using  the  current    text  color  (see  the
  605. _settextcolor  function),  starting  at the current text position (see
  606. the  _settextposition  function).   The text  position    is  updated to
  607. follow the end of the displayed text.
  608.  
  609. The  text  displayed  by the _outtext and _outmem  functions  uses the
  610. system BIOS, and can be displayed in any video mode.   Another form of
  611. text  is  available  with  the _grtext    function.    Graphics  text is
  612. displayed  as a  sequence  of  line  segments,    and  can be  drawn  in
  613. different sizes, with different orientations and alignments.
  614. ::::_PIE
  615. #include \<graph.h>
  616. short _FAR _pie( short fill, short x1, short y1,
  617.                  short x2, short y2,
  618.                  short x3, short y3,
  619.                  short x4, short y4 );
  620.  
  621. short _FAR _pie_w( short fill, double x1, double y1,
  622.                    double x2, double y2,
  623.                    double x3, double y3,
  624.                    double x4, double y4 );
  625.  
  626. short _FAR _pie_wxy( short fill,
  627.              struct _wxycoord _FAR *p1,
  628.              struct _wxycoord _FAR *p2,
  629.              struct _wxycoord _FAR *p3,
  630.              struct _wxycoord _FAR *p4 );
  631.  
  632. The _pie functions draw pie-shaped wedges.  The _pie function uses the
  633. view  coordinate  system.   The _pie_w and _pie_wxy  functions use the
  634. window coordinate system.
  635.  
  636. The  pie  wedges  are drawn by drawing an  elliptical  arc (in the way
  637. described  for the _arc  functions) and then joining the center of the
  638. rectangle that contains the ellipse to the two endpoints of the arc.
  639.  
  640. The  elliptical  arc is  drawn    with  its  center at the center of the
  641. rectangle established by the points (x1,y1) and (x2,y2).  The arc is a
  642. segment of the ellipse drawn within this bounding rectangle.   The arc
  643. starts at the point on this  ellipse  that  intersects the vector from
  644. the centre of the ellipse to the point (x3,y3).    The arc ends at the
  645. point on this  ellipse    that  intersects the vector from the centre of
  646. the   ellipse    to  the  point    (x4,y4).    The  arc  is  drawn  in  a
  647. counter-clockwise  direction  with the    current  plot action using the
  648. current color and the current line style.
  649.  
  650. When the  coordinates  (x1,y1) and (x2,y2) establish a line or a point
  651. (this  happens    when one or more of the x-coordinates or y-coordinates
  652. are equal), nothing is drawn.
  653.  
  654. The argument  "fill" determines whether the figure is filled in or has
  655. only its outline drawn.  The argument can have one of two values:
  656.  
  657. _GFILLINTERIOR        fill  the  interior  by  writing  pixels  with the
  658.             current  plot  action using the current  color and
  659.             the current fill mask
  660.  
  661. _GBORDER        leave the interior    unchanged; draw the outline of
  662.             the figure    with the current plot action using the
  663.             current color and line style
  664. ::::_POLYGON
  665. #include \<graph.h>
  666. short _FAR _polygon( short fill, short numpts,
  667.              struct xycoord _FAR *points );
  668.  
  669. short _FAR _polygon_w( short fill, short numpts,
  670.                double _FAR *points );
  671.  
  672. short _FAR _polygon_wxy( short fill, short numpts,
  673.              struct _wxycoord _FAR *points );
  674.  
  675. The _polygon functions draw polygons.    The _polygon function uses the
  676. view coordinate system.  The _polygon_w and _polygon_wxy functions use
  677. the window coordinate system.
  678.  
  679. The polygon is defined as containing "numpts" points whose coordinates
  680. are given in the array "points".
  681.  
  682. The argument "fill" determines whether the polygon is filled in or has
  683. only its outline drawn.  The argument can have one of two values:
  684.  
  685. _GFILLINTERIOR        fill  the  interior  by  writing  pixels  with the
  686.             current  plot  action using the current  color and
  687.             the current fill mask
  688.  
  689. _GBORDER        leave the interior    unchanged; draw the outline of
  690.             the figure    with the current plot action using the
  691.             current color and line style
  692. ::::_PUTIMAGE
  693. #include \<graph.h>
  694. void _FAR _putimage( short x, short y,
  695.              char _HUGE *image, short mode );
  696.  
  697. void _FAR _putimage_w( double x, double y,
  698.                char _HUGE *image, short mode );
  699.  
  700. The  _putimage    functions  display  the screen image  indicated by the
  701. argument  "image".  The  _putimage  function uses the view  coordinate
  702. system.  The _putimage_w function uses the window coordinate system.
  703.  
  704. The  image  is    displayed  upon  the screen  with its top left    corner
  705. located at the point with coordinates (x,y).  The image was previously
  706. saved  using  the  _getimage  functions.   The image is displayed in a
  707. rectangle whose size is the size of the rectangular image saved by the
  708. _getimage functions.
  709.  
  710. The image can be  displayed  in a number of ways,  depending  upon the
  711. value of the "mode"  argument.     This  argument can have the following
  712. values:
  713.  
  714. _GPSET            replace  the  rectangle on the screen by the saved
  715.             image
  716.  
  717. _GPRESET        replace the rectangle on the screen with the pixel
  718.             values of the saved image  inverted; this produces
  719.             a negative image
  720.  
  721. _GAND            produce  a    new  image  on the  screen  by    ANDing
  722.             together  the pixel  values  from the screen  with
  723.             those from the saved image
  724.  
  725. _GOR            produce  a    new  image  on    the  screen  by  ORing
  726.             together  the pixel  values  from the screen  with
  727.             those from the saved image
  728.  
  729. _GXOR            produce  a new  image on the  screen  by exclusive
  730.             ORing  together  the pixel    values from the screen
  731.             with  those  from  the saved  image; the  original
  732.             screen is  restored by two successive calls to the
  733.             _putimage  function with this value,  providing an
  734.             efficient method to produce animated effects
  735. ::::_RECTANGLE
  736. #include \<graph.h>
  737. short _FAR _rectangle( short fill,
  738.                short x1, short y1,
  739.                short x2, short y2 );
  740.  
  741. short _FAR _rectangle_w( short fill,
  742.              double x1, double y1,
  743.              double x2, double y2 );
  744.  
  745. short _FAR _rectangle_wxy( short fill,
  746.                struct _wxycoord _FAR *p1,
  747.                struct _wxycoord _FAR *p2 );
  748.  
  749. The  _rectangle  functions draw rectangles.   The _rectangle  function
  750. uses the view coordinate system.   The _rectangle_w and _rectangle_wxy
  751. functions use the window coordinate system.
  752.  
  753. The  rectangle is defined with    opposite  corners  established    by the
  754. points (x1,y1) and (x2,y2).
  755.  
  756. The argument  "fill"  determines whether the rectangle is filled in or
  757. has only its outline drawn.  The argument can have one of two values:
  758.  
  759. _GFILLINTERIOR        fill  the  interior  by  writing  pixels  with the
  760.             current  plot  action using the current  color and
  761.             the current fill mask
  762.  
  763. _GBORDER        leave the interior    unchanged; draw the outline of
  764.             the figure    with the current plot action using the
  765.             current color and line style
  766. ::::_REMAPALLPALETTE
  767. #include \<graph.h>
  768. short _FAR _remapallpalette( long _FAR *colors );
  769.  
  770. The  _remapallpalette  function  sets (or remaps) all of the colors in
  771. the  palette.    The color  values in the  palette  are replaced by the
  772. array of color values given by the argument "colors". This function is
  773. supported  in all  video  modes, but only works with EGA, MCGA and VGA
  774. adapters.
  775.  
  776. The array "colors" must contain at least as many elements as there are
  777. supported colors.    The newly mapped palette will cause the screen to
  778. change color wherever there is a pixel value of a changed color in the
  779. palette.
  780.  
  781. The  representation  of colors    depends upon the hardware  being used.
  782. The number of colors in the  palette  can be  determined  by using the
  783. _getvideoconfig function.
  784. ::::_REMAPPALETTE
  785. #include \<graph.h>
  786. long _FAR _remappalette( short pixval, long color );
  787.  
  788. The _remappalette function sets (or remaps) the palette color "pixval"
  789. to be the color  "color".  This  function  is  supported  in all video
  790. modes, but only works with EGA, MCGA and VGA adapters.
  791.  
  792. The  argument "pixval" is an index in the color palette of the current
  793. video mode.  The argument "color" specifies the actual color displayed
  794. on the screen by pixels  with pixel  value  "pixval". Color values are
  795. selected by  specifying  the red, green and blue intensities that make
  796. up  the  color.   Each    intensity  can be in the  range  from 0 to 63,
  797. resulting in 262144  possible  different colors.   A given color value
  798. can be    conveniently  specified  as a  value of type long.   The color
  799. value is of the form 0x00bbggrr, where bb is the blue intensity, gg is
  800. the green intensity and rr is the red intensity of the selected color.
  801. The file graph.h defines constants containing the color intensities of
  802. each of the 16 default colors.
  803.  
  804. The  _remappalette  function takes effect immediately.     All pixels on
  805. the screen  which have a pixel    value  equal to the value of  "pixval"
  806. will now have the color indicated by the argument "color".
  807. ::::_SCROLLTEXTWINDOW
  808. #include \<graph.h>
  809. void _FAR _scrolltextwindow( short rows );
  810.  
  811. The  _scrolltextwindow    function scrolls the lines in the current text
  812. window.   A text window is defined with the  _settextwindow  function.
  813. By default, the text window is the entire screen.
  814.  
  815. The  argument  "rows"  specifies  the  number  of rows to scroll.    A
  816. positive  value  means to scroll the text window up or towards the top
  817. of the screen.     A negative value means to scroll the text window down
  818. or  towards  the bottom of the    screen.   Specifying  a number of rows
  819. greater  than the height of the text  window is equivalent to clearing
  820. the text window with the _clearscreen function.
  821.  
  822. Two  constants are defined that can be used with the _scrolltextwindow
  823. function:
  824.  
  825. _GSCROLLUP        the  contents  of the text    window are scrolled up
  826.             (towards the top of the screen) by one row
  827.  
  828. _GSCROLLDOWN        the  contents of the text window are scrolled down
  829.             (towards the bottom of the screen) by one row
  830. ::::_SELECTPALETTE
  831. #include \<graph.h>
  832. short _FAR _selectpalette( short palnum );
  833.  
  834. The  _selectpalette  function  selects    the  palette  indicated by the
  835. argument "palnum" from the color palettes available.  This function is
  836. only supported by the video modes _MRES4COLOR and _MRESNOCOLOR.
  837.  
  838. Mode  _MRES4COLOR  supports  four  palettes  of four colors.   In each
  839. palette,  color 0, the background color, can be any of the 16 possible
  840. colors.   The  color  values  associated  with    the  other three pixel
  841. values, (1, 2 and 3), are determined by the selected palette.
  842.  
  843. The following table outlines the available color palettes:
  844.  
  845.     Palette         Pixel Values
  846.     Number    1           2           3
  847.  
  848.        0     green         red         brown
  849.        1     cyan         magenta         white
  850.        2     light green     light red         yellow
  851.        3     light cyan      light magenta   bright white
  852. ::::_SETACTIVEPAGE
  853. #include \<graph.h>
  854. short _FAR _setactivepage( short pagenum );
  855.  
  856. The  _setactivepage  function  selects    the  page (in memory) to which
  857. graphics output is written.    The page to be selected is given by the
  858. "pagenum" argument.
  859.  
  860. Only  some  combinations  of video modes and hardware  allow  multiple
  861. pages of graphics to exist.   When  multiple  pages are supported, the
  862. active page may differ from the visual page.  The graphics information
  863. in the visual  page  determines  what is  displayed  upon the  screen.
  864. Animation  may be  accomplished  by  alternating  the visual page.   A
  865. graphics  page    can be    constructed  without  affecting  the screen by
  866. setting the active page to be different than the visual page.
  867.  
  868. The number of  available  video  pages can be  determined by using the
  869. _getvideoconfig function.  The default video page is 0.
  870. ::::_SETBKCOLOR
  871. #include \<graph.h>
  872. long _FAR _setbkcolor( long color );
  873.  
  874. The  _setbkcolor function sets the current background color to be that
  875. of the "color" argument.  In text modes, the background color controls
  876. the area behind each  individual  character.   In graphics  modes, the
  877. background refers to the entire screen.   The default background color
  878. is 0.
  879.  
  880. When the current video mode is a graphics mode, any pixels with a zero
  881. pixel  value will  change to the color of the "color" argument.   When
  882. the  current  video  mode  is a text mode,  nothing  will  immediately
  883. change; only subsequent output is affected.
  884. ::::_SETCHARSIZE
  885. #include \<graph.h>
  886. void _FAR _setcharsize( short height, short width );
  887.  
  888. void _FAR _setcharsize_w( double height, double width );
  889.  
  890. The  _setcharsize  functions set the character height and width to the
  891. values    specified  by the  arguments  "height"    and  "width".  For the
  892. _setcharsize  function, the arguments "height" and "width" represent a
  893. number    of  pixels.   For the  _setcharsize_w  function, the arguments
  894. "height" and "width"  represent lengths along the y-axis and x-axis in
  895. the window coordinate system.
  896.  
  897. These sizes are used when  displaying  text with the _grtext function.
  898. The  default  character  sizes    are  dependent    on the    graphics  mode
  899. selected, and can be determined by the _gettextsettings function.
  900. ::::_SETCHARSPACING
  901. #include \<graph.h>
  902. void _FAR _setcharspacing( short space );
  903.  
  904. void _FAR _setcharspacing_w( double space );
  905.  
  906. The  _setcharspacing  functions set the current  character  spacing to
  907. have  the  value  of the  argument  "space".  For the  _setcharspacing
  908. function,   "space"   represents   a   number  of  pixels.    For  the
  909. _setcharspacing_w  function,  "space"  represents  a length  along the
  910. x-axis in the window coordinate system.
  911.  
  912. The character  spacing specifies the additional space to leave between
  913. characters  when a text string is displayed with the _grtext function.
  914. A negative  value can be specified to cause the characters to be drawn
  915. closer together.  The default value of the character spacing is 0.
  916. ::::_SETCLIPRGN
  917. #include \<graph.h>
  918. void _FAR _setcliprgn( short x1, short y1,
  919.                short x2, short y2 );
  920.  
  921. The  _setcliprgn  function restricts the display of graphics output to
  922. the  clipping  region.     This  region  is a rectangle  whose  opposite
  923. corners are established by the physical points (x1,y1) and (x2,y2).
  924.  
  925. The  _setcliprgn  function  does  not  affect  text  output  using the
  926. _outtext  and  _outmem    functions.   To  control  the location of text
  927. output, see the _settextwindow function.
  928. ::::_SETCOLOR
  929. #include \<graph.h>
  930. short _FAR _setcolor( short pixval );
  931.  
  932. The  _setcolor    function sets the pixel value for the current color to
  933. be that indicated by the "pixval" argument.  The current color is only
  934. used by the  functions    that produce graphics output; text output with
  935. _outtext uses the current text color (see the _settextcolor function).
  936. The  default color value is one less than the maximum number of colors
  937. in the current video mode.
  938. ::::_SETFILLMASK
  939. #include \<graph.h>
  940. void _FAR _setfillmask( char _FAR *mask );
  941.  
  942. The  _setfillmask  function sets the current fill mask to the value of
  943. the  argument  "mask".    When the value of the "mask" argument is NULL,
  944. there will be no fill mask set.
  945.  
  946. The fill mask is an  eight-byte array which is interpreted as a square
  947. pattern  (8 by 8) of 64 bits.    Each bit in the mask  corresponds to a
  948. pixel.     When a  region is filled,  each point in the region is mapped
  949. onto the fill mask.   When a bit from the mask is one, the pixel value
  950. of the    corresponding  point is set using the current  plotting action
  951. with the  current color; when the bit is zero, the pixel value of that
  952. point is not affected.
  953.  
  954. When the fill mask is not set, a fill operation will set all points in
  955. the  fill  region  to have a pixel  value of the  current  color.   By
  956. default, no fill mask is set.
  957. ::::_SETLINESTYLE
  958. #include \<graph.h>
  959. void _FAR _setlinestyle( unsigned short style );
  960.  
  961. The  _setlinestyle  function sets the current  line-style  mask to the
  962. value of the "style" argument.
  963.  
  964. The  line-style  mask determines the style by which lines and arcs are
  965. drawn.     The  mask is  treated    as an array of 16 bits.   As a line is
  966. drawn,    a  pixel  at a time,  the bits in this    array  are  cyclically
  967. tested.  When a bit in the array is 1, the pixel value for the current
  968. point is set using the current color according to the current plotting
  969. action; otherwise, the pixel value for the point is left unchanged.  A
  970. solid line would result from a value of 0xFFFF and a dashed line would
  971. result from a value of 0xF0F0.
  972.  
  973. The default line style mask is 0xFFFF.
  974. ::::_SETPIXEL
  975. #include \<graph.h>
  976. short _FAR _setpixel( short x, short y );
  977.  
  978. short _FAR _setpixel_w( double x, double y );
  979.  
  980. The  _setpixel    function sets the pixel value of the point (x,y) using
  981. the current  plotting  action with the current    color.     The _setpixel
  982. function uses the view    coordinate  system.   The _setpixel_w function
  983. uses the window coordinate system.
  984.  
  985. A pixel value is associated with each point.   The values range from 0
  986. to the    number    of colors  (less one) that can be  represented    in the
  987. palette for the current video mode.   The color displayed at the point
  988. is the color in the  palette  corresponding to the pixel number.   For
  989. example,  a pixel value of 3 causes the fourth color in the palette to
  990. be displayed at the point in question.
  991. ::::_SETPLOTACTION
  992. #include \<graph.h>
  993. short _FAR _setplotaction( short action );
  994.  
  995. The  _setplotaction  function sets the current    plotting action to the
  996. value of the "action" argument.
  997.  
  998. The drawing functions cause pixels to be set with a pixel value.    By
  999. default,  the value to be set is  obtained  by    replacing the original
  1000. pixel  value  with the    supplied  pixel  value.    Alternatively,  the
  1001. replaced  value may be    computed as a function of the original and the
  1002. supplied pixel values.
  1003.  
  1004. The plotting action can have one of the following values:
  1005.  
  1006. _GPSET            replace  the original  screen pixel value with the
  1007.             supplied pixel value
  1008.  
  1009. _GAND            replace  the original  screen pixel value with the
  1010.             bitwise  and of the  original  pixel value and the
  1011.             supplied pixel value
  1012.  
  1013. _GOR            replace  the original  screen pixel value with the
  1014.             bitwise  or of the    original  pixel  value and the
  1015.             supplied pixel value
  1016.  
  1017. _GXOR            replace  the original  screen pixel value with the
  1018.             bitwise  exclusive-or  of the original pixel value
  1019.             and  the supplied  pixel value.   Performing  this
  1020.             operation  twice will restore the original    screen
  1021.             contents, providing an efficient method to produce
  1022.             animated effects.
  1023. ::::_SETTEXTALIGN
  1024. #include \<graph.h>
  1025. void _FAR _settextalign( short horiz, short vert );
  1026.  
  1027. The  _settextalign  function  sets  the current text  alignment to the
  1028. values    specified  by the  arguments  "horiz" and "vert". When text is
  1029. displayed  with  the  _grtext  function,  it  is  aligned  (justified)
  1030. horizontally  and  vertically  about the given point  according to the
  1031. current text alignment settings.
  1032.  
  1033. The  horizontal  component  of    the  alignment    can  have  one    of the
  1034. following values:
  1035.  
  1036. _NORMAL         use  the  default  horizontal  alignment  for  the
  1037.             current setting of the text path
  1038.  
  1039. _LEFT            the  text  string is left  justified  at the given
  1040.             point
  1041.  
  1042. _CENTER         the text string is centred    horizontally about the
  1043.             given point
  1044.  
  1045. _RIGHT            the text  string is right  justified  at the given
  1046.             point
  1047.  
  1048. The  vertical component of the alignment can have one of the following
  1049. values:
  1050.  
  1051. _NORMAL         use the default vertical alignment for the current
  1052.             setting of the text path
  1053.  
  1054. _TOP            the top of the text string is aligned at the given
  1055.             point
  1056.  
  1057. _CAP            the cap line of the text  string is aligned at the
  1058.             given point
  1059.  
  1060. _HALF            the  text string is centred  vertically  about the
  1061.             given point
  1062.  
  1063. _BASE            the base line of the text string is aligned at the
  1064.             given point
  1065.  
  1066. _BOTTOM         the  bottom  of the text  string is aligned at the
  1067.             given point
  1068.  
  1069. The default is to use _LEFT  alignment    for the  horizontal  component
  1070. unless the text path is  _PATH_LEFT, in which case _RIGHT alignment is
  1071. used.  The default value for the vertical component is _TOP unless the
  1072. text path is _PATH_UP, in which case _BOTTOM alignment is used.
  1073. ::::_SETTEXTCOLOR
  1074. #include \<graph.h>
  1075. short _FAR _settextcolor( short pixval );
  1076.  
  1077. The _settextcolor function sets the current text color to be the color
  1078. indicated  by the pixel  value of the "pixval" argument.   This is the
  1079. color  value  used for    displaying  text with the _outtext and _outmem
  1080. functions.  Use the _setcolor function to change the color of graphics
  1081. output.  The default text color value is set to 7 whenever a new video
  1082. mode is selected.
  1083.  
  1084. The pixel value "pixval" is a number in the range 0-31.  Colors in the
  1085. range 0-15 are displayed normally.  In text modes, blinking colors are
  1086. specified  by adding 16 to the normal  color  values.    The  following
  1087. table specifies the default colors in color text modes.
  1088.  
  1089.     Pixel      Color        Pixel      Color
  1090.     value            value
  1091.  
  1092.       0       Black          8       Gray
  1093.       1       Blue          9       Light Blue
  1094.       2       Green         10       Light Green
  1095.       3       Cyan         11       Light Cyan
  1096.       4       Red         12       Light Red
  1097.       5       Magenta         13       Light Magenta
  1098.       6       Brown         14       Yellow
  1099.       7       White         15       Bright White
  1100. ::::_SETTEXTCURSOR
  1101. #include \<graph.h>
  1102. short _FAR _settextcursor( short cursor );
  1103.  
  1104. The  _settextcursor  function  sets  the  attribute,  or shape, of the
  1105. cursor    in text  modes.   The  cursor  shape is set using the BIOS Set
  1106. Cursor Size function.    The argument "cursor" specifies the new cursor
  1107. shape.     The cursor shape is selected by specifying the top and bottom
  1108. rows in the character matrix.  The high byte of "cursor" specifies the
  1109. top row of the cursor; the low byte specifies the bottom row.
  1110.  
  1111. Some typical values for "cursor" are:
  1112.  
  1113.     Cursor        Shape
  1114.  
  1115.     0x0607        normal underline cursor
  1116.     0x0007        full block cursor
  1117.     0x0407        half-height block cursor
  1118.     0x2000        no cursor
  1119. ::::_SETTEXTORIENT
  1120. #include \<graph.h>
  1121. void _FAR _settextorient( short vecx, short vecy );
  1122.  
  1123. The  _settextorient  function sets the current text orientation to the
  1124. vector specified by the arguments (vecx,vecy).      The text orientation
  1125. specifies  the direction of the base-line vector when a text string is
  1126. displayed  with the _grtext  function.     The default text orientation,
  1127. for normal left-to-right text, is the vector (1,0).
  1128. ::::_SETTEXTPATH
  1129. #include \<graph.h>
  1130. void _FAR _settextpath( short path );
  1131.  
  1132. The _settextpath function sets the current text path to have the value
  1133. of the "path" argument.  The text path specifies the writing direction
  1134. of the text displayed by the _grtext function.     The argument can have
  1135. one of the following values:
  1136.  
  1137. _PATH_RIGHT        subsequent    characters  are  drawn to the right of
  1138.             the previous character
  1139.  
  1140. _PATH_LEFT        subsequent characters are drawn to the left of the
  1141.             previous character
  1142.  
  1143. _PATH_UP        subsequent characters are drawn above the previous
  1144.             character
  1145.  
  1146. _PATH_DOWN        subsequent characters are drawn below the previous
  1147.             character
  1148.  
  1149. The default value of the text path is _PATH_RIGHT.
  1150. ::::_SETTEXTPOSITION
  1151. #include \<graph.h>
  1152. struct rccoord _FAR _settextposition( short row,
  1153.                       short col );
  1154.  
  1155. The  _settextposition  function  sets the current output  position for
  1156. text to be  (row,col)  where this  position is in terms of characters,
  1157. not pixels.
  1158.  
  1159. The text position is relative to the current text window.  It defaults
  1160. to the top left  corner of the screen, (1,1), when a new video mode is
  1161. selected, or when a new text window is set.    The position is updated
  1162. as text is drawn with the _outtext and _outmem functions.
  1163.  
  1164. Note that the output  position for graphics  output  differs from that
  1165. for text output.    The output position for graphics output can be set
  1166. by use of the _moveto function.
  1167. ::::_SETTEXTROWS
  1168. #include \<graph.h>
  1169. short _FAR _settextrows( short rows );
  1170.  
  1171. The _settextrows function selects the number of rows of text displayed
  1172. on the    screen.   The  number  of rows is  specified  by the  argument
  1173. "rows". Computers equipped with EGA, MCGA and VGA adapters can support
  1174. different  numbers  of    text  rows.   The  number  of rows that can be
  1175. selected  depends  on the  current  video mode and the type of monitor
  1176. attached.
  1177.  
  1178. If the    argument  "rows"  has  the value  "_MAXTEXTROWS,"  the maximum
  1179. number of text rows will be  selected  for the    current video mode and
  1180. hardware configuration.    In text modes the maximum number of rows is
  1181. 43 for EGA adapters, and 50 for MCGA and VGA adapters.     Some graphics
  1182. modes  will  support 43 rows for EGA adapters and 60 rows for MCGA and
  1183. VGA adapters.
  1184. ::::_SETTEXTWINDOW
  1185. #include \<graph.h>
  1186. void _FAR _settextwindow( short row1, short col1,
  1187.               short row2, short col2 );
  1188.  
  1189. The  _settextwindow  function sets the text window to be the rectangle
  1190. with a top left  corner at  (row1,col1)  and a bottom  right corner at
  1191. (row2,col2).  These coordinates are in terms of characters not pixels.
  1192.  
  1193. The initial text output position is (1,1).   Subsequent text positions
  1194. are  reported  (by  the  _gettextposition  function)  and  set (by the
  1195. _outtext,  _outmem and    _settextposition  functions)  relative to this
  1196. rectangle.
  1197.  
  1198. Text is displayed from the current output position for text proceeding
  1199. along the  current  row and then downwards.   When the window is full,
  1200. the lines  scroll  upwards  one line and then text is displayed on the
  1201. last line of the window.
  1202. ::::_SETVIDEOMODE
  1203. #include \<graph.h>
  1204. short _FAR _setvideomode( short mode );
  1205.  
  1206. The  _setvideomode function sets the video mode according to the value
  1207. of  the  "mode"  argument.    The  value of  "mode"  can be one of the
  1208. following:
  1209.  
  1210.    Mode       Type      Size      Colors  Adapter
  1211.  
  1212.    _MAXRESMODE     (graphics mode with highest resolution)
  1213.    _MAXCOLORMODE (graphics mode with most colors)
  1214.    _DEFAULTMODE  (restores screen to original mode)
  1215.    _TEXTBW40      M,T     40 x 25    16      MDPA,HGC,VGA
  1216.    _TEXTC40      C,T     40 x 25    16      CGA,EGA,MCGA,VGA
  1217.    _TEXTBW80      M,T     80 x 25    16      MDPA,HGC,VGA
  1218.    _TEXTC80      C,T     80 x 25    16      CGA,EGA,MCGA,VGA
  1219.    _MRES4COLOR      C,G    320 x 200    4      CGA,EGA,MCGA,VGA
  1220.    _MRESNOCOLOR   C,G    320 x 200    4      CGA,EGA,MCGA,VGA
  1221.    _HRESBW      C,G    640 x 200    2      CGA,EGA,MCGA,VGA
  1222.    _TEXTMONO      M,T     80 x 25    16      MDPA,HGC,VGA
  1223.    _HERCMONO      M,G    720 x 350    2      HGC
  1224.    _MRES16COLOR   C,G    320 x 200   16      EGA,VGA
  1225.    _HRES16COLOR   C,G    640 x 200   16      EGA,VGA
  1226.    _ERESNOCOLOR   M,G    640 x 350    4      EGA,VGA
  1227.    _ERESCOLOR      C,G    640 x 350  4/16   EGA,VGA
  1228.    _VRES2COLOR      C,G    640 x 480    2      MCGA,VGA
  1229.    _VRES16COLOR   C,G    640 x 480   16      VGA
  1230.    _MRES256COLOR  C,G    320 x 200  256      MCGA,VGA
  1231.    _URES256COLOR  C,G    640 x 400  256      SVGA
  1232.    _VRES256COLOR  C,G    640 x 480  256      SVGA
  1233.    _SVRES16COLOR  C,G    800 x 600   16      SVGA
  1234.    _SVRES256COLOR C,G    800 x 600  256      SVGA
  1235.    _XRES16COLOR   C,G  1024 x 768   16      SVGA
  1236.    _XRES256COLOR  C,G  1024 x 768  256      SVGA
  1237.  
  1238. In the    preceding  table,  the    Type  column  contains    the  following
  1239. letters:
  1240.  
  1241. M      indicates monochrome; multiple colors are shades of grey
  1242.  
  1243. C      indicates color
  1244.  
  1245. G      indicates graphics mode; size is in pixels
  1246.  
  1247. T      indicates  text  mode;  size    is  in    columns  and  rows  of
  1248.       characters
  1249.  
  1250. The Adapter column contains the following codes:
  1251.  
  1252. MDPA      IBM Monochrome Display/Printer Adapter
  1253.  
  1254. CGA      IBM Color Graphics Adapter
  1255.  
  1256. EGA      IBM Enhanced Graphics Adapter
  1257.  
  1258. VGA      IBM Video Graphics Array
  1259.  
  1260. MCGA      IBM Multi-Color Graphics Array
  1261.  
  1262. HGC      Hercules Graphics Adapter
  1263.  
  1264. SVGA      SuperVGA adapters
  1265.  
  1266. The mode  selected  must be  supported    by the hardware present on the
  1267. computer.
  1268.  
  1269. Selecting  a new video mode resets the current    output    positions  for
  1270. graphics  and  text  to be the top left  corner  of the  screen.   The
  1271. background  color is reset to black and the default color value is set
  1272. to be one less than the number of colors in the selected mode.
  1273. ::::_SETVIDEOMODEROWS
  1274. #include \<graph.h>
  1275. short _FAR _setvideomoderows( short mode, short rows );
  1276.  
  1277. The  _setvideomoderows function selects a video mode and the number of
  1278. rows of text displayed on the screen.    The video mode is specified by
  1279. the argument  "mode" and is selected  with the _setvideomode function.
  1280. The number of rows is specified by the argument "rows" and is selected
  1281. with the _settextrows function.
  1282.  
  1283. Computers  equipped  with  EGA,  MCGA  and  VGA  adapters  can support
  1284. different  numbers  of    text  rows.   The  number  of rows that can be
  1285. selected depends on the video mode and the type of monitor attached.
  1286. ::::_SETVIEWORG
  1287. #include \<graph.h>
  1288. struct xycoord _FAR _setvieworg( short x, short y );
  1289.  
  1290. The  _setvieworg  function  sets  the  origin  of the view  coordinate
  1291. system, (0,0), to be located at the physical point (x,y).  This causes
  1292. subsequently drawn images to be translated by the amount (x,y).
  1293.  
  1294. Note:    In previous versions of the software, the _setvieworg function
  1295. was called _setlogorg.
  1296. ::::_SETVIEWPORT
  1297. #include \<graph.h>
  1298. void _FAR _setviewport( short x1, short y1,
  1299.             short x2, short y2 );
  1300.  
  1301. The  _setviewport function restricts the display of graphics output to
  1302. the  clipping  region and then sets the origin of the view  coordinate
  1303. system    to be the top left  corner  of the  region.   This region is a
  1304. rectangle  whose  opposite  corners  are  established  by the physical
  1305. points (x1,y1) and (x2,y2).
  1306.  
  1307. The  _setviewport  function  does  not    affect    text  output using the
  1308. _outtext  and  _outmem    functions.   To  control  the location of text
  1309. output, see the _settextwindow function.
  1310. ::::_SETVISUALPAGE
  1311. #include \<graph.h>
  1312. short _FAR _setvisualpage( short pagenum );
  1313.  
  1314. The  _setvisualpage  function  selects the page (in memory) from which
  1315. graphics output is displayed.  The page to be selected is given by the
  1316. "pagenum" argument.
  1317.  
  1318. Only  some  combinations  of video modes and hardware  allow  multiple
  1319. pages of graphics to exist.   When  multiple  pages are supported, the
  1320. active page may differ from the visual page.  The graphics information
  1321. in the visual  page  determines  what is  displayed  upon the  screen.
  1322. Animation  may be  accomplished  by  alternating  the visual page.   A
  1323. graphics  page    can be    constructed  without  affecting  the screen by
  1324. setting the active page to be different than the visual page.
  1325.  
  1326. The number of  available  video  pages can be  determined by using the
  1327. _getvideoconfig function.  The default video page is 0.
  1328. ::::_SETWINDOW
  1329. #include \<graph.h>
  1330. short _FAR _setwindow( short invert,
  1331.                double x1, double y1,
  1332.                double x2, double y2 );
  1333.  
  1334. The  _setwindow  function  defines a window for the window  coordinate
  1335. system.    Window coordinates are specified as a user-defined range of
  1336. values.    This allows for consistent pictures regardless of the video
  1337. mode.
  1338.  
  1339. The window is defined as the region with  opposite corners established
  1340. by the points  (x1,y1) and (x2,y2).   The argument  "invert" specifies
  1341. the direction of the y-axis.    If the value is non-zero, the y values
  1342. increase  from the bottom of the screen to the top,  otherwise,  the y
  1343. values increase as you move down the screen.
  1344.  
  1345. The  window  defined  by the  _setwindow  function is displayed in the
  1346. current viewport.  A viewport is defined by the _setviewport function.
  1347.  
  1348. By  default,  the window  coordinate  system is defined with the point
  1349. (0.0,0.0)  located  at the lower left  corner of the  screen,  and the
  1350. point (1.0,1.0) at the upper right corner.
  1351. ::::_WRAPON
  1352. #include \<graph.h>
  1353. short _FAR _wrapon( short wrap );
  1354.  
  1355. The  _wrapon  function is used to control the display of text when the
  1356. text output reaches the right side of the text window.      This is text
  1357. displayed  with  the  _outtext    and  _outmem  functions.    The "wrap"
  1358. argument can take one of the following values:
  1359.  
  1360. _GWRAPON        causes lines to wrap at the window border
  1361.  
  1362. _GWRAPOFF        causes lines to be truncated at the window border
  1363. ::::GRAPHICS
  1364.               Graphics Functions
  1365.               ══════════════════
  1366.  
  1367. The graphics functions are used to display graphical images such as
  1368. lines and circles upon the screen.  Text can also be displayed with
  1369. the graphics output.  Support is provided for both color and
  1370. monochrome screens which are connected to the computer using any of
  1371. the following graphics adapters:
  1372.  
  1373.     IBM Monochrome Display/Printer Adapter (MDPA)
  1374.     IBM Color Graphics Adapter (CGA)
  1375.     IBM Enhanced Graphics Adapter (EGA)
  1376.     IBM Multi-Color Graphics Array (MCGA)
  1377.     IBM Video Graphics Array (VGA)
  1378.     Hercules Monochrome Adapter
  1379.     SuperVGA adapters (SVGA) supplied by various manufacturers
  1380.  
  1381. The graphics functions are:
  1382.  
  1383. <_arc>            draws an elliptical arc
  1384. <_clearscreen>        clears the indicated "area" and fills it
  1385. <_displaycursor>    specifies whether the cursor is displayed
  1386. <_ellipse>        draws an ellipse
  1387. <_floodfill>        fills an area of the screen
  1388. <_getactivepage>    returns the active graphics page
  1389. <_getarcinfo>        returns the endpoints of the most recent arc
  1390. <_getbkcolor>        returns the current background color
  1391. <_getcliprgn>        returns the boundary of the clipping region
  1392. <_getcolor>        returns the pixel value for the current color
  1393. <_getcurrentposition>    returns the current output position
  1394. <_getfillmask>        returns the current fill mask
  1395. <_getimage>        places screen image into memory
  1396. <_getlinestyle>     returns the current line-style mask
  1397. <_getphyscoord>     returns physical coordinates
  1398. <_getpixel>        returns the pixel value for a point
  1399. <_getplotaction>    returns the current plotting action
  1400. <_gettextcolor>     returns pixel value of the current text color
  1401. <_gettextcursor>    returns the shape of the text cursor
  1402. <_gettextextent>    simulates the effect of using _grtext function
  1403. <_gettextposition>    returns the current output position for text
  1404. <_gettextsettings>    returns the current text settings
  1405. <_gettextwindow>    returns the boundary of the text window
  1406. <_getvideoconfig>    returns the current video environment
  1407. <_getviewcoord>     returns the view coordinates of a point
  1408. <_getvisualpage>    returns the visual graphics page
  1409. <_getwindowcoord>    returns the window coordinates of a point
  1410. <_grstatus>        returns the status of the last function
  1411. <_grtext>        displays a character string
  1412. <_imagesize>        computes number of bytes required for an image
  1413. <_lineto>        draws a straight line
  1414. <_moveto>        sets the current output position
  1415. <_outmem>        displays a text string of a specified length
  1416. <_outtext>        displays a text string
  1417. <_pie>            draws a pie-shaped wedge
  1418. <_polygon>        draws a polygon
  1419. <_putimage>        displays an image from memory on the screen
  1420. <_rectangle>        draws a rectangle
  1421. <_remapallpalette>    sets (or remaps) all the colors in a palette
  1422. <_remappalette>     sets (or remaps) a palette color
  1423. <_scrolltextwindow>    scrolls the contents of the text window
  1424. <_selectpalette>    selects a palette
  1425. <_setactivepage>    selects the active graphics page
  1426. <_setbkcolor>        sets the current background color
  1427. <_setcharsize>        sets the character height and width
  1428. <_setcharspacing>    sets the current character spacing
  1429. <_setcliprgn>        restricts the display of graphics output
  1430. <_setcolor>        sets the pixel value for the current color
  1431. <_setfillmask>        sets the current fill mask
  1432. <_setlinestyle>     sets the current line-style mask
  1433. <_setpixel>        sets the pixel value of a point
  1434. <_setplotaction>    sets the current plotting action
  1435. <_settextalign>     sets the current text alignment
  1436. <_settextcolor>     sets the current text color
  1437. <_settextcursor>    sets the shape of the text cursor
  1438. <_settextorient>    sets the current text orientation
  1439. <_settextpath>        sets the current text path
  1440. <_settextposition>    sets the current output position for text
  1441. <_settextrows>        sets the number of screen rows
  1442. <_settextwindow>    sets the text window
  1443. <_setvideomode>     sets the video mode
  1444. <_setvideomoderows>    sets the video mode and number of screen rows
  1445. <_setvieworg>        sets the origin of the view coordinate system
  1446. <_setviewport>        restricts the display of graphics output
  1447. <_setvisualpage>    selects the visual graphics page
  1448. <_setwindow>        sets the range of the window coordinates
  1449. <_wrapon>        controls text wrapping at edge of window
  1450.