home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-05-28 | 92.2 KB | 2,304 lines |
- ::::_ARC
- #include \<graph.h>
- short _FAR _arc( short x1, short y1,
- short x2, short y2,
- short x3, short y3,
- short x4, short y4 );
-
- short _FAR _arc_w( double x1, double y1,
- double x2, double y2,
- double x3, double y3,
- double x4, double y4 );
-
- short _FAR _arc_wxy( struct _wxycoord _FAR *p1,
- struct _wxycoord _FAR *p2,
- struct _wxycoord _FAR *p3,
- struct _wxycoord _FAR *p4 );
-
- The _arc functions draw elliptical arcs. The _arc function uses the
- view coordinate system. The _arc_w and _arc_wxy functions use the
- window coordinate system.
-
- The center of the arc is the center of the rectangle established by
- the points (x1,y1) and (x2,y2). The arc is a segment of the ellipse
- drawn within this bounding rectangle. The arc starts at the point on
- this ellipse that intersects the vector from the centre of the ellipse
- to the point (x3,y3). The arc ends at the point on this ellipse that
- intersects the vector from the centre of the ellipse to the point
- (x4,y4). The arc is drawn in a counter-clockwise direction with the
- current plot action using the current color and the current line
- style.
-
- When the coordinates (x1,y1) and (x2,y2) establish a line or a point
- (this happens when one or more of the x-coordinates or y-coordinates
- are equal), nothing is drawn.
-
- The current output position for graphics output is set to be the point
- at the end of the arc that was drawn.
- ::::_ARC_W
- ->_ARC
- ::::_ARC_WXY
- ->_ARC
- ::::_CLEARSCREEN
- #include \<graph.h>
- void _FAR _clearscreen( short area );
-
- The _clearscreen function clears the indicated "area" and fills it
- with the background color. The "area" argument must be one of the
- following values:
-
- _GCLEARSCREEN area is entire screen
- _GVIEWPORT area is current viewport or clip region
- _GWINDOW area is current text window
- ::::_DISPLAYCURSOR
- #include \<graph.h>
- short _FAR _displaycursor( short mode );
-
- The _displaycursor function is used to establish whether the text
- cursor is to be displayed when graphics functions complete. On entry
- to a graphics function, the text cursor is turned off. When the
- function completes, the "mode" setting determines whether the cursor
- is turned back on. The "mode" argument can have one of the following
- values:
-
- _GCURSORON the cursor will be displayed
- _GCURSOROFF the cursor will not be displayed
- ::::_ELLIPSE
- #include \<graph.h>
- short _FAR _ellipse( short fill, short x1, short y1,
- short x2, short y2 );
-
- short _FAR _ellipse_w( short fill, double x1, double y1,
- double x2, double y2 );
-
- short _FAR _ellipse_wxy( short fill,
- struct _wxycoord _FAR *p1,
- struct _wxycoord _FAR *p2 );
-
- The _ellipse functions draw ellipses. The _ellipse function uses the
- view coordinate system. The _ellipse_w and _ellipse_wxy functions use
- the window coordinate system.
-
- The center of the ellipse is the center of the rectangle established
- by the points (x1,y1) and (x2,y2).
-
- The argument "fill" determines whether the ellipse is filled in or has
- only its outline drawn. The argument can have one of two values:
-
- _GFILLINTERIOR fill the interior by writing pixels with the current
- plot action using the current color and the current
- fill mask
- _GBORDER leave the interior unchanged; draw the outline of the
- figure with the current plot action using the current
- color and line style
-
- When the coordinates (x1,y1) and (x2,y2) establish a line or a point
- (this happens when one or more of the x-coordinates or y-coordinates
- are equal), nothing is drawn.
- ::::_ELLIPSE_W
- ->_ELLIPSE
- ::::_ELLIPSE_WXY
- ->_ELLIPSE
- ::::_FLOODFILL
- #include \<graph.h>
- short _FAR _floodfill( short x, short y,
- short stop_color );
-
- short _FAR _floodfill_w( double x, double y,
- short stop_color );
-
- The _floodfill functions fill an area of the screen. The _floodfill
- function uses the view coordinate system. The _floodfill_w function
- uses the window coordinate system.
-
- The filling starts at the point (x,y) and continues in all directions:
- when a pixel is filled, the neighbouring pixels (horizontally and
- vertically) are then considered for filling. Filling is done using
- the current color and fill mask. No filling will occur if the point
- (x,y) lies outside the clipping region.
-
- If the argument "stop_color" is a valid pixel value, filling will
- occur in each direction until a pixel is encountered with a pixel
- value of "stop_color". The filled area will be the area around (x,y),
- bordered by "stop_color". No filling will occur if the point (x,y) has
- the pixel value "stop_color".
-
- If "stop_color" has the value (-1), filling occurs until a pixel is
- encountered with a pixel value different from the pixel value of the
- starting point (x,y). No filling will occur if the pixel value of the
- point (x,y) is the current color.
- ::::_FLOODFILL_W
- ->_FLOODFILL
- ::::_GETACTIVEPAGE
- #include \<graph.h>
- short _FAR _getactivepage( void );
-
- The _getactivepage function returns the number of the currently
- selected active graphics page.
-
- Only some combinations of video modes and hardware allow multiple
- pages of graphics to exist. When multiple pages are supported, the
- active page may differ from the visual page. The graphics information
- in the visual page determines what is displayed upon the screen.
- Animation may be accomplished by alternating the visual page. A
- graphics page can be constructed without affecting the screen by
- setting the active page to be different than the visual page.
-
- The number of available video pages can be determined by using the
- _getvideoconfig function. The default video page is 0.
- ::::_GETARCINFO
- #include \<graph.h>
- short _FAR _getarcinfo( struct xycoord _FAR *start_pt,
- struct xycoord _FAR *end_pt,
- struct xycoord _FAR *inside_pt );
-
- The _getarcinfo function returns information about the arc most
- recently drawn by the _arc or _pie functions. The arguments
- "start_pt" and "end_pt" are set to contain the endpoints of the arc.
- The argument "inside_pt" will contain the coordinates of a point
- within the pie. The points are all specified in the view coordinate
- system.
-
- The endpoints of the arc can be used to connect other lines to the
- arc. The interior point can be used to fill the pie.
- ::::_GETBKCOLOR
- #include \<graph.h>
- long _FAR _getbkcolor( void );
-
- The _getbkcolor function returns the current background color. In
- text modes, the background color controls the area behind each
- individual character. In graphics modes, the background refers to the
- entire screen. The default background color is 0.
- ::::_GETCLIPRGN
- #include \<graph.h>
- void _FAR _getcliprgn( short _FAR *x1, short _FAR *y1,
- short _FAR *x2, short _FAR *y2 );
-
- The _getcliprgn function returns the location of the current clipping
- region. A clipping region is defined with the _setcliprgn or
- _setviewport functions. By default, the clipping region is the entire
- screen.
-
- The current clipping region is a rectangular area of the screen to
- which graphics output is restricted. The top left corner of the
- clipping region is placed in the arguments (x1,y1). The bottom right
- corner of the clipping region is placed in (x2,y2).
- ::::_GETCOLOR
- #include \<graph.h>
- short _FAR _getcolor( void );
-
- The _getcolor function returns the pixel value for the current color.
- This is the color used for displaying graphics output. The default
- color value is one less than the maximum number of colors in the
- current video mode.
- ::::_GETCURRENTPOSITION
- #include \<graph.h>
- struct xycoord _FAR _getcurrentposition( void );
-
- struct _wxycoord _FAR _getcurrentposition_w( void );
-
- The _getcurrentposition functions return the current output position
- for graphics. The _getcurrentposition function returns the point in
- view coordinates. The _getcurrentposition_w function returns the
- point in window coordinates.
-
- The current position defaults to the origin, (0,0), when a new video
- mode is selected. It is changed by successful calls to the _arc,
- _moveto and _lineto functions as well as the _setviewport function.
-
- Note that the output position for graphics output differs from that
- for text output. The output position for text output can be set by
- use of the _settextposition function.
- ::::_GETCURRENTPOSITION_W
- ->_GETCURRENTPOSITION
- ::::_GETFILLMASK
- #include \<graph.h>
- unsigned char _FAR * _FAR
- _getfillmask( unsigned char _FAR *mask );
-
- The _getfillmask function copies the current fill mask into the area
- located by the argument "mask". The fill mask is used by the _ellipse,
- _floodfill, _pie, _polygon and _rectangle functions that fill an area
- of the screen.
-
- The fill mask is an eight-byte array which is interpreted as a square
- pattern (8 by 8) of 64 bits. Each bit in the mask corresponds to a
- pixel. When a region is filled, each point in the region is mapped
- onto the fill mask. When a bit from the mask is one, the pixel value
- of the corresponding point is set using the current plotting action
- with the current color; when the bit is zero, the pixel value of that
- point is not affected.
-
- When the fill mask is not set, a fill operation will set all points in
- the fill region to have a pixel value of the current color.
- ::::_GETFONTINFO
- #include \<graph.h>
- short _FAR _getfontinfo( struct _fontinfo _FAR *info );
-
- The _getfontinfo function returns information about the currently
- selected font. Fonts are selected with the _setfont function. The
- font information is returned in the _fontinfo structure indicated by
- the argument "info". The structure contains the following fields:
-
- type 1 for a vector font, 0 for a bit-mapped font
- ascent distance from top of character to baseline in pixels
- pixwidth character width in pixels (0 for a proportional font)
- pixheight character height in pixels
- avgwidth average character width in pixels
- filename name of the file containing the current font
- facename name of the current font
- ::::_GETGTEXTEXTENT
- #include \<graph.h>
- short _FAR _getgtextextent( char _FAR *text );
-
- The _getgtextextent function returns the length in pixels of the
- argument "text" as it would be displayed in the current font by the
- function _outgtext. Note that the text is not displayed on the
- screen, only its length is determined.
- ::::_GETGTEXTVECTOR
- #include \<graph.h>
- struct xycoord _FAR _getgtextvector( void );
-
- The _getgtextvector function returns the current value of the text
- orientation vector. This is the direction used when text is displayed
- by the _outgtext function.
- ::::_GETIMAGE
- #include \<graph.h>
- void _FAR _getimage( short x1, short y1,
- short x2, short y2,
- char _HUGE *image );
-
- void _FAR _getimage_w( double x1, double y1,
- double x2, double y2,
- char _HUGE *image );
-
- void _FAR _getimage_wxy( struct _wxycoord _FAR *p1,
- struct _wxycoord _FAR *p2,
- char _HUGE *image );
-
- The _getimage functions store a copy of an area of the screen into the
- buffer indicated by the "image" argument. The _getimage function uses
- the view coordinate system. The _getimage_w and _getimage_wxy
- functions use the window coordinate system.
-
- The screen image is the rectangular area defined by the points (x1,y1)
- and (x2,y2). The buffer "image" must be large enough to contain the
- image (the size of the image can be determined by using the _imagesize
- function). The image may be displayed upon the screen at some later
- time by using the _putimage functions.
- ::::_GETIMAGE_W
- ->_GETIMAGE
- ::::_GETIMAGE_WXY
- ->_GETIMAGE
- ::::_GETLINESTYLE
- #include \<graph.h>
- unsigned short _FAR _getlinestyle( void );
-
- The _getlinestyle function returns the current line-style mask.
-
- The line-style mask determines the style by which lines and arcs are
- drawn. The mask is treated as an array of 16 bits. As a line is
- drawn, a pixel at a time, the bits in this array are cyclically
- tested. When a bit in the array is 1, the pixel value for the current
- point is set using the current color according to the current plotting
- action; otherwise, the pixel value for the point is left unchanged. A
- solid line would result from a value of 0xFFFF and a dashed line would
- result from a value of 0xF0F0
-
- The default line style mask is 0xFFFF.
- ::::_GETPHYSCOORD
- #include \<graph.h>
- struct xycoord _FAR _getphyscoord( short x, short y );
-
- The _getphyscoord function returns the physical coordinates of the
- position with view coordinates (x,y). View coordinates are defined by
- the _setvieworg and _setviewport functions.
- ::::_GETPIXEL
- #include \<graph.h>
- short _FAR _getpixel( short x, short y );
-
- short _FAR _getpixel_w( double x, double y );
-
- The _getpixel functions return the pixel value for the point with
- coordinates (x,y). The _getpixel function uses the view coordinate
- system. The _getpixel_w function uses the window coordinate system.
- ::::_GETPIXEL_W
- ->_GETPIXEL
- ::::_GETPLOTACTION
- #include \<graph.h>
- short _FAR _getplotaction( void );
-
- The _getplotaction function returns the current plotting action.
-
- The drawing functions cause pixels to be set with a pixel value. By
- default, the value to be set is obtained by replacing the original
- pixel value with the supplied pixel value. Alternatively, the
- replaced value may be computed as a function of the original and the
- supplied pixel values.
-
- The plotting action can have one of the following values:
-
- _GPSET replace the original screen pixel value with the
- supplied pixel value
- _GAND replace the original screen pixel value with the
- bitwise and of the original pixel value and the
- supplied pixel value
- _GOR replace the original screen pixel value with the
- bitwise or of the original pixel value and the supplied
- pixel value
- _GXOR replace the original screen pixel value with the
- bitwise exclusive-or of the original pixel value and
- the supplied pixel value. Performing this operation
- twice will restore the original screen contents,
- providing an efficient method to produce animated
- effects.
- ::::_GETTEXTCOLOR
- #include \<graph.h>
- short _FAR _gettextcolor( void );
-
- The _gettextcolor function returns the pixel value of the current text
- color. This is the color used for displaying text with the _outtext
- and _outmem functions. The default text color value is set to 7
- whenever a new video mode is selected.
- ::::_GETTEXTCURSOR
- #include \<graph.h>
- short _FAR _gettextcursor( void );
-
- The _gettextcursor function returns the current cursor attribute, or
- shape. The cursor shape is set with the _settextcursor function. See
- the _settextcursor function for a description of the value returned by
- the _gettextcursor function.
- ::::_GETTEXTEXTENT
- #include \<graph.h>
- void _FAR _gettextextent( short x, short y,
- char _FAR *text,
- struct xycoord _FAR *concat,
- struct xycoord _FAR *extent );
-
- The _gettextextent function simulates the effect of using the _grtext
- function to display the text string "text" at the position (x,y),
- using the current text settings. The concatenation point is returned
- in the argument "concat". The text extent parallelogram is returned in
- the array "extent".
-
- The concatenation point is the position to use to output text after
- the given string. The text extent parallelogram outlines the area
- where the text string would be displayed. The four points are
- returned in counter-clockwise order, starting at the upper-left
- corner.
- ::::_GETTEXTPOSITION
- #include \<graph.h>
- struct rccoord _FAR _gettextposition( void );
-
- The _gettextposition function returns the current output position for
- text. This position is in terms of characters, not pixels.
-
- The current position defaults to the top left corner of the screen,
- (1,1), when a new video mode is selected. It is changed by successful
- calls to the _outtext, _outmem, _settextposition and _settextwindow
- functions.
-
- Note that the output position for graphics output differs from that
- for text output. The output position for graphics output can be set
- by use of the _moveto function.
- ::::_GETTEXTSETTINGS
- #include \<graph.h>
- struct textsettings _FAR * _FAR _gettextsettings
- ( struct textsettings _FAR *settings );
-
- The _gettextsettings function returns information about the current
- text settings used when text is displayed by the _grtext function.
- The information is stored in the textsettings structure indicated by
- the argument "settings". The structure contains the following fields
- (all are short fields):
-
- basevectorx x-component of the current base vector
- basevectory y-component of the current base vector
- path current text path
- height current text height (in pixels)
- width current text width (in pixels)
- spacing current text spacing (in pixels)
- horizalign horizontal component of the current text alignment
- vertalign vertical component of the current text alignment
- ::::_GETTEXTWINDOW
- #include \<graph.h>
- void _FAR _gettextwindow(
- short _FAR *row1, short _FAR *col1,
- short _FAR *row2, short _FAR *col2 );
-
- The _gettextwindow function returns the location of the current text
- window. A text window is defined with the _settextwindow function.
- By default, the text window is the entire screen.
-
- The current text window is a rectangular area of the screen. Text
- display is restricted to be within this window. The top left corner
- of the text window is placed in the arguments (row1,col1). The bottom
- right corner of the text window is placed in (row2,col2).
- ::::_GETVIDEOCONFIG
- #include \<graph.h>
- struct videoconfig _FAR * _FAR _getvideoconfig
- ( struct videoconfig _FAR *config );
-
- The _getvideoconfig function returns information about the current
- video mode and the hardware configuration. The information is
- returned in the videoconfig structure indicated by the argument
- "config". The structure contains the following fields (all are short
- fields):
-
- numxpixels number of pixels in x-axis
- numypixels number of pixels in y-axis
- numtextcols number of text columns
- numtextrows number of text rows
- numcolors number of actual colors
- bitsperpixel number of bits in a pixel value
- numvideopages number of video pages
- mode current video mode
- adapter adapter type
- monitor monitor type
- memory number of kilobytes (1024 characters) of video memory
-
- The adapter field will contain one of the following values:
-
- _NODISPLAY no display adapter attached
- _UNKNOWN unknown adapter/monitor type
- _MDPA Monochrome Display/Printer Adapter
- _CGA Color Graphics Adapter
- _HERCULES Hercules Monochrome Adapter
- _MCGA Multi-Color Graphics Array
- _EGA Enhanced Graphics Adapter
- _VGA Video Graphics Array
- _SVGA SuperVGA Adapter
-
- The monitor field will contain one of the following values:
-
- _MONO regular monochrome
- _COLOR regular color
- _ENHANCED enhanced color
- _ANALOGMONO analog monochrome
- _ANALOGCOLOR analog color
-
- The amount of memory reported by _getvideoconfig will not always be
- correct for SuperVGA adapters. Since it is not always possible to
- determine the amount of memory, _getvideoconfig will always report
- 256K, the minimum amount.
- ::::_GETVIEWCOORD
- #include \<graph.h>
- struct xycoord _FAR _getviewcoord( short x, short y );
-
- struct xycoord _FAR _getviewcoord_w( double x, double y );
-
- struct xycoord _FAR _getviewcoord_wxy(
- struct _wxycoord _FAR *p );
-
- The _getviewcoord functions translate a point from one coordinate
- system to viewport coordinates. The _getviewcoord function translates
- the point (x,y) from physical coordinates. The _getviewcoord_w and
- _getviewcoord_wxy functions translate the point from the window
- coordinate system.
-
- Viewport coordinates are defined by the _setvieworg and _setviewport
- functions. Window coordinates are defined by the _setwindow function.
-
- Note: In previous versions of the software, the _getviewcoord
- function was called _getlogcoord.
- ::::_GETVIEWCOORD_W
- ->_GETVIEWCOORD
- ::::_GETVIEWCOORD_WXY
- ->_GETVIEWCOORD
- ::::_GETVISUALPAGE
- #include \<graph.h>
- short _FAR _getvisualpage( void );
-
- The _getvisualpage function returns the number of the currently
- selected visual graphics page.
-
- Only some combinations of video modes and hardware allow multiple
- pages of graphics to exist. When multiple pages are supported, the
- active page may differ from the visual page. The graphics information
- in the visual page determines what is displayed upon the screen.
- Animation may be accomplished by alternating the visual page. A
- graphics page can be constructed without affecting the screen by
- setting the active page to be different than the visual page.
-
- The number of available video pages can be determined by using the
- _getvideoconfig function. The default video page is 0.
- ::::_GETWINDOWCOORD
- #include \<graph.h>
- struct _wxycoord _FAR _getwindowcoord( short x, short y );
-
- The _getwindowcoord function returns the window coordinates of the
- position with view coordinates (x,y). Window coordinates are defined
- by the _setwindow function.
- ::::_GRSTATUS
- #include \<graph.h>
- short _FAR _grstatus( void );
-
- The _grstatus function returns the status of the most recently called
- graphics library function. The function can be called after any
- graphics function to determine if any errors or warnings occurred.
- The function returns 0 if the previous function was successful.
- Values less than 0 indicate an error occurred; values greater than 0
- indicate a warning condition.
-
- The following values can be returned:
-
- Constant Value Explanation
-
- _GROK 0 no error
- _GRERROR -1 graphics error
- _GRMODENOTSUPPORTED -2 video mode not supported
- _GRNOTINPROPERMODE -3 function n/a in this mode
- _GRINVALIDPARAMETER -4 invalid parameter(s)
- _GRINSUFFICIENTMEMORY -5 out of memory
- _GRFONTFILENOTFOUND -6 can't open font file
- _GRINVALIDFONTFILE -7 font file has invalid format
- _GRNOOUTPUT 1 nothing was done
- _GRCLIPPED 2 output clipped
- ::::_GRTEXT
- #include \<graph.h>
- short _FAR _grtext( short x, short y,
- char _FAR *text );
-
- short _FAR _grtext_w( double x, double y,
- char _FAR *text );
-
- The _grtext functions display a character string. The _grtext
- function uses the view coordinate system. The _grtext_w function uses
- the window coordinate system.
-
- The character string "text" is displayed at the point (x,y). The
- string must be terminated by a null character ('\0'). The text is
- displayed in the current color using the current text settings.
-
- The graphics library can display text in three different ways.
-
- 1. The _outtext and _outmem functions use the system BIOS, and can be
- displayed in any video mode. However, this variety of text can be
- displayed in only one size.
-
- 2. The _grtext function displays text as a sequence of line segments,
- and can be drawn in different sizes, with different orientations
- and alignments.
-
- 3. The _outgtext function displays text in the currently selected
- font. Both bit-mapped and vector fonts are supported; the size
- and type of text depends on the fonts that are available.
-
- ::::_GRTEXT_W
- ->_GRTEXT
- ::::_IMAGESIZE
- #include \<graph.h>
- long _FAR _imagesize( short x1, short y1,
- short x2, short y2 );
-
- long _FAR _imagesize_w( double x1, double y1,
- double x2, double y2 );
-
- long _FAR _imagesize_wxy( struct _wxycoord _FAR *p1,
- struct _wxycoord _FAR *p2 );
-
- The _imagesize functions compute the number of bytes required to store
- a screen image. The _imagesize function uses the view coordinate
- system. The _imagesize_w and _imagesize_wxy functions use the window
- coordinate system.
-
- The screen image is the rectangular area defined by the points (x1,y1)
- and (x2,y2). The storage area used by the _getimage functions must be
- at least this large (in bytes).
- ::::_IMAGESIZE_W
- ->_IMAGESIZE
- ::::_IMAGESIZE_WXY
- ->_IMAGESIZE
- ::::_LINETO
- #include \<graph.h>
- short _FAR _lineto( short x, short y );
-
- short _FAR _lineto_w( double x, double y );
-
- The _lineto functions draw straight lines. The _lineto function uses
- the view coordinate system. The _lineto_w function uses the window
- coordinate system.
-
- The line is drawn from the current position to the point at the
- coordinates (x,y). The point (x,y) becomes the new current position.
- The line is drawn with the current plotting action using the current
- line style and the current color.
- ::::_LINETO_W
- ->_LINETO
- ::::_MOVETO
- #include \<graph.h>
- struct xycoord _FAR _moveto( short x, short y );
-
- struct _wxycoord _FAR _moveto_w( double x, double y );
-
- The _moveto functions set the current output position for graphics.
- The _moveto function uses the view coordinate system. The _moveto_w
- function uses the window coordinate system.
-
- The current output position is set to be the point at the coordinates
- (x,y). Nothing is drawn by the function. The _lineto function uses
- the current output position as the starting point when a line is
- drawn.
-
- Note that the output position for graphics output differs from that
- for text output. The output position for text output can be set by
- use of the _settextposition function.
- ::::_MOVETO_W
- ->_MOVETO
- ::::_OUTGTEXT
- #include \<graph.h>
- void _FAR _outgtext( char _FAR *text );
-
- The _outgtext function displays the character string indicated by the
- argument "text". The string must be terminated by a null character
- ('\0').
-
- The string is displayed starting at the current position (see the
- _moveto function) in the current color and in the currently selected
- font (see the _setfont function). The current position is updated to
- follow the displayed text.
-
- When no font has been previously selected with _setfont, a default
- font will be used. The default font is an 8-by-8 bit-mapped font.
-
- The graphics library can display text in three different ways.
-
- 1. The _outtext and _outmem functions use the system BIOS, and can be
- displayed in any video mode. However, this variety of text can be
- displayed in only one size.
-
- 2. The _grtext function displays text as a sequence of line segments,
- and can be drawn in different sizes, with different orientations
- and alignments.
-
- 3. The _outgtext function displays text in the currently selected
- font. Both bit-mapped and vector fonts are supported; the size
- and type of text depends on the fonts that are available.
-
- ::::_OUTMEM
- #include \<graph.h>
- void _FAR _outmem( char _FAR *text, short length );
-
- The _outmem function displays the character string indicated by the
- argument "text". The argument "length" specifies the number of
- characters to be displayed. Unlike the _outtext function, _outmem
- will display the graphical representation of characters such as ASCII
- 10 and 0, instead of interpreting them as control characters.
-
- The text is displayed using the current text color (see the
- _settextcolor function), starting at the current text position (see
- the _settextposition function). The text position is updated to
- follow the end of the displayed text.
-
- The graphics library can display text in three different ways.
-
- 1. The _outtext and _outmem functions use the system BIOS, and can be
- displayed in any video mode. However, this variety of text can be
- displayed in only one size.
-
- 2. The _grtext function displays text as a sequence of line segments,
- and can be drawn in different sizes, with different orientations
- and alignments.
-
- 3. The _outgtext function displays text in the currently selected
- font. Both bit-mapped and vector fonts are supported; the size
- and type of text depends on the fonts that are available.
-
- ::::_OUTTEXT
- #include \<graph.h>
- void _FAR _outtext( char _FAR *text );
-
- The _outtext function displays the character string indicated by the
- argument "text". The string must be terminated by a null character
- ('\0'). When a line-feed character ('\n') is encountered in the
- string, the characters following will be displayed on the next row of
- the screen.
-
- The text is displayed using the current text color (see the
- _settextcolor function), starting at the current text position (see
- the _settextposition function). The text position is updated to
- follow the end of the displayed text.
-
- The graphics library can display text in three different ways.
-
- 1. The _outtext and _outmem functions use the system BIOS, and can be
- displayed in any video mode. However, this variety of text can be
- displayed in only one size.
-
- 2. The _grtext function displays text as a sequence of line segments,
- and can be drawn in different sizes, with different orientations
- and alignments.
-
- 3. The _outgtext function displays text in the currently selected
- font. Both bit-mapped and vector fonts are supported; the size
- and type of text depends on the fonts that are available.
-
- ::::_PG_ANALYZECHART
- #include \<pgchart.h>
- short _FAR _pg_analyzechart( chartenv _FAR *env,
- char _FAR * _FAR *cat,
- float _FAR *values, short n );
-
- short _FAR _pg_analyzechartms( chartenv _FAR *env,
- char _FAR * _FAR *cat,
- float _FAR *values,
- short nseries,
- short n, short dim,
- char _FAR * _FAR *labels );
-
- The _pg_analyzechart functions analyze either a single-series or a
- multi-series bar, column or line chart. These functions calculate
- default values for chart elements without actually displaying the
- chart.
-
- The _pg_analyzechart function analyzes a single-series bar, column or
- line chart. The chart environment structure "env" is filled with
- default values based on the type of chart and the values of the "cat"
- and "values" arguments. The arguments are the same as for the
- _pg_chart function.
-
- The _pg_analyzechart_w function analyzes a multi-series bar, column or
- line chart. The chart environment structure "env" is filled with
- default values based on the type of chart and the values of the "cat",
- "values" and "labels" arguments. The arguments are the same as for
- the _pg_chartms function.
- ::::_PG_ANALYZECHARTMS
- ->_PG_ANALYZECHART
- ::::_PG_ANALYZEPIE
- #include \<pgchart.h>
- short _FAR _pg_analyzepie( chartenv _FAR *env,
- char _FAR * _FAR *cat,
- float _FAR *values,
- short _FAR *explode, short n );
-
- The _pg_analyzepie function analyzes a pie chart. This function
- calculates default values for chart elements without actually
- displaying the chart.
-
- The chart environment structure "env" is filled with default values
- based on the values of the "cat", "values" and "explode" arguments.
- The arguments are the same as for the _pg_chartpie function.
- ::::_PG_ANALYZESCATTER
- #include \<pgchart.h>
- short _FAR _pg_analyzescatter( chartenv _FAR *env,
- float _FAR *x,
- float _FAR *y, short n );
-
- short _FAR _pg_analyzescatterms(
- chartenv _FAR *env,
- float _FAR *x, float _FAR *y,
- short nseries, short n, short dim,
- char _FAR * _FAR *labels );
-
- The _pg_analyzescatter functions analyze either a single-series or a
- multi-series scatter chart. These functions calculate default values
- for chart elements without actually displaying the chart.
-
- The _pg_analyzescatter function analyzes a single-series scatter
- chart. The chart environment structure "env" is filled with default
- values based on the values of the "x" and "y" arguments. The
- arguments are the same as for the _pg_chartscatter function.
-
- The _pg_analyzescatter_w function analyzes a multi-series scatter
- chart. The chart environment structure "env" is filled with default
- values based on the values of the "x", "y" and "labels" arguments.
- The arguments are the same as for the _pg_chartscatterms function.
- ::::_PG_ANALYZESCATTERMS
- ->_PG_ANALYZESCATTER
- ::::_PG_CHART
- #include \<pgchart.h>
- short _FAR _pg_chart( chartenv _FAR *env,
- char _FAR * _FAR *cat,
- float _FAR *values, short n );
-
- short _FAR _pg_chartms( chartenv _FAR *env,
- char _FAR * _FAR *cat,
- float _FAR *values, short nseries,
- short n, short dim,
- char _FAR * _FAR *labels );
-
- The _pg_chart functions display either a single-series or a
- multi-series bar, column or line chart. The type of chart displayed
- and other chart options are contained in the "env" argument. The
- argument "cat" is an array of strings. These strings describe the
- categories against which the data in the "values" array is charted.
-
- The _pg_chart function displays a bar, column or line chart from the
- single series of data contained in the "values" array. The argument
- "n" specifies the number of values to chart.
-
- The _pg_chart_w function displays a multi-series bar, column or line
- chart. The argument "nseries" specifies the number of series of data
- to chart. The argument "values" is assumed to be a two-dimensional
- array defined as follows:
-
- float values[ nseries ][ dim ];
-
- The number of values used from each series is given by the argument
- "n", where "n" is less than or equal to "dim". The argument "labels"
- is an array of strings. These strings describe each of the series and
- are used in the chart legend.
- ::::_PG_CHARTMS
- ->_PG_CHART
- ::::_PG_CHARTPIE
- #include \<pgchart.h>
- short _FAR _pg_chartpie( chartenv _FAR *env,
- char _FAR * _FAR *cat,
- float _FAR *values,
- short _FAR *explode, short n );
-
- The _pg_chartpie function displays a pie chart. The chart is
- displayed using the options specified in the "env" argument.
-
- The pie chart is created from the data contained in the "values"
- array. The argument "n" specifies the number of values to chart.
-
- The argument "cat" is an array of strings. These strings describe
- each of the pie slices and are used in the chart legend. The argument
- "explode" is an array of values corresponding to each of the pie
- slices. For each non-zero element in the array, the corresponding pie
- slice is drawn "exploded", or slightly offset from the rest of the
- pie.
- ::::_PG_CHARTSCATTER
- #include \<pgchart.h>
- short _FAR _pg_chartscatter( chartenv _FAR *env,
- float _FAR *x,
- float _FAR *y, short n );
-
- short _FAR _pg_chartscatterms( chartenv _FAR *env,
- float _FAR *x,
- float _FAR *y,
- short nseries,
- short n, short dim,
- char _FAR * _FAR *labels );
-
- The _pg_chartscatter functions display either a single-series or a
- multi-series scatter chart. The chart is displayed using the options
- specified in the "env" argument.
-
- The _pg_chartscatter function displays a scatter chart from the single
- series of data contained in the arrays "x" and "y". The argument "n"
- specifies the number of values to chart.
-
- The _pg_chartscatter_w function displays a multi-series scatter chart.
- The argument "nseries" specifies the number of series of data to
- chart. The arguments "x" and "y" are assumed to be two-dimensional
- arrays defined as follows:
-
- float x[ nseries ][ dim ];
-
- The number of values used from each series is given by the argument
- "n", where "n" is less than or equal to "dim". The argument "labels"
- is an array of strings. These strings describe each of the series and
- are used in the chart legend.
- ::::_PG_CHARTSCATTERMS
- ->_PG_CHARTSCATTER
- ::::_PG_DEFAULTCHART
- #include \<pgchart.h>
- short _FAR _pg_defaultchart( chartenv _FAR *env,
- short type, short style );
-
- The _pg_defaultchart function initializes the chart structure "env" to
- contain default values before a chart is drawn. All values in the
- chart structure are initialized, including blanking of all titles.
- The chart type in the structure is initialized to the value "type",
- and the chart style is initialized to "style".
-
- The argument "type" can have one of the following values:
-
- _PG_BARCHART Bar chart (horizontal bars)
- _PG_COLUMNCHART Column chart (vertical bars)
- _PG_LINECHART Line chart
- _PG_SCATTERCHART Scatter chart
- _PG_PIECHART Pie chart
-
- Each type of chart can be drawn in one of two styles. For each chart
- type the argument "style" can have one of the following values:
-
- Type Style 1 Style 2
-
- Bar _PG_PLAINBARS _PG_STACKEDBARS
- Column _PG_PLAINBARS _PG_STACKEDBARS
- Line _PG_POINTANDLINE _PG_POINTONLY
- Scatter _PG_POINTANDLINE _PG_POINTONLY
- Pie _PG_PERCENT _PG_NOPERCENT
-
- For single-series bar and column charts, the chart style is ignored.
- The "plain" (clustered) and "stacked" styles only apply when there is
- more than one series of data. The "percent" style for pie charts
- causes percentages to be displayed beside each of the pie slices.
- ::::_PG_GETCHARDEF
- #include \<pgchart.h>
- short _FAR _pg_getchardef( short ch,
- unsigned char _FAR *def );
-
- The _pg_getchardef function retrieves the current bit-map definition
- for the character "ch". The bit-map is placed in the array "def". The
- current font must be an 8-by-8 bit-mapped font.
- ::::_PG_GETPALETTE
- #include \<pgchart.h>
- short _FAR _pg_getpalette( paletteentry _FAR *pal );
-
- The _pg_getpalette function retrieves the internal palette of the
- presentation graphics system. The palette controls the colors, line
- styles, fill patterns and plot characters used to display each series
- of data in a chart.
-
- The argument "pal" is an array of palette structures that will contain
- the palette. Each element of the palette is a structure containing
- the following fields:
-
- color color used to display series
- style line style used for line and scatter charts
- fill fill pattern used to fill interior of bar and pie
- sections
- plotchar character plotted on line and scatter charts
- ::::_PG_GETSTYLESET
- #include \<pgchart.h>
- void _FAR _pg_getstyleset( unsigned short _FAR *style );
-
- The _pg_getstyleset function retrieves the internal style-set of the
- presentation graphics system. The style-set is a set of line styles
- used for drawing window borders and grid-lines. The argument "style"
- is an array that will contain the style-set.
- ::::_PG_HLABELCHART
- #include \<pgchart.h>
- short _FAR _pg_hlabelchart( chartenv _FAR *env,
- short x, short y,
- short color,
- char _FAR *label );
-
- The _pg_hlabelchart function displays the text string "label" on the
- chart described by the "env" chart structure. The string is displayed
- horizontally starting at the point (x,y), relative to the upper left
- corner of the chart. The "color" specifies the palette color used to
- display the string.
- ::::_PG_INITCHART
- #include \<pgchart.h>
- short _FAR _pg_initchart( void );
-
- The _pg_initchart function initializes the presentation graphics
- system. This includes initializing the internal palette and style-set
- used when drawing charts. This function must be called before any of
- the other presentation graphics functions.
-
- The initialization of the presentation graphics system requires that a
- valid graphics mode has been selected. For this reason the
- _setvideomode function must be called before _pg_initchart is called.
- If a font has been selected (with the _setfont function), that font
- will be used when text is displayed in a chart. Font selection should
- also be done before initializing the presentation graphics system.
- ::::_PG_RESETPALETTE
- #include \<pgchart.h>
- short _FAR _pg_resetpalette( void );
-
- The _pg_resetpalette function resets the internal palette of the
- presentation graphics system to default values. The palette controls
- the colors, line styles, fill patterns and plot characters used to
- display each series of data in a chart. The default palette chosen is
- dependent on the current video mode.
- ::::_PG_RESETSTYLESET
- #include \<pgchart.h>
- void _FAR _pg_resetstyleset( void );
-
- The _pg_resetstyleset function resets the internal style-set of the
- presentation graphics system to default values. The style-set is a
- set of line styles used for drawing window borders and grid-lines.
- ::::_PG_SETCHARDEF
- #include \<pgchart.h>
- short _FAR _pg_setchardef( short ch,
- unsigned char _FAR *def );
-
- The _pg_setchardef function sets the current bit-map definition for
- the character "ch". The bit-map is contained in the array "def". The
- current font must be an 8-by-8 bit-mapped font.
- ::::_PG_SETPALETTE
- #include \<pgchart.h>
- short _FAR _pg_setpalette( paletteentry _FAR *pal );
-
- The _pg_setpalette function sets the internal palette of the
- presentation graphics system. The palette controls the colors, line
- styles, fill patterns and plot characters used to display each series
- of data in a chart.
-
- The argument "pal" is an array of palette structures containing the
- new palette. Each element of the palette is a structure containing
- the following fields:
-
- color color used to display series
- style line style used for line and scatter charts
- fill fill pattern used to fill interior of bar and pie
- sections
- plotchar character plotted on line and scatter charts
- ::::_PG_SETSTYLESET
- #include \<pgchart.h>
- void _FAR _pg_setstyleset( unsigned short _FAR *style );
-
- The _pg_setstyleset function retrieves the internal style-set of the
- presentation graphics system. The style-set is a set of line styles
- used for drawing window borders and grid-lines. The argument "style"
- is an array containing the new style-set.
- ::::_PG_VLABELCHART
- #include \<pgchart.h>
- short _FAR _pg_vlabelchart( chartenv _FAR *env,
- short x, short y,
- short color,
- char _FAR *label );
-
- The _pg_vlabelchart function displays the text string "label" on the
- chart described by the "env" chart structure. The string is displayed
- vertically starting at the point (x,y), relative to the upper left
- corner of the chart. The "color" specifies the palette color used to
- display the string.
- ::::_PIE
- #include \<graph.h>
- short _FAR _pie( short fill, short x1, short y1,
- short x2, short y2,
- short x3, short y3,
- short x4, short y4 );
-
- short _FAR _pie_w( short fill, double x1, double y1,
- double x2, double y2,
- double x3, double y3,
- double x4, double y4 );
-
- short _FAR _pie_wxy( short fill,
- struct _wxycoord _FAR *p1,
- struct _wxycoord _FAR *p2,
- struct _wxycoord _FAR *p3,
- struct _wxycoord _FAR *p4 );
-
- The _pie functions draw pie-shaped wedges. The _pie function uses the
- view coordinate system. The _pie_w and _pie_wxy functions use the
- window coordinate system.
-
- The pie wedges are drawn by drawing an elliptical arc (in the way
- described for the _arc functions) and then joining the center of the
- rectangle that contains the ellipse to the two endpoints of the arc.
-
- The elliptical arc is drawn with its center at the center of the
- rectangle established by the points (x1,y1) and (x2,y2). The arc is a
- segment of the ellipse drawn within this bounding rectangle. The arc
- starts at the point on this ellipse that intersects the vector from
- the centre of the ellipse to the point (x3,y3). The arc ends at the
- point on this ellipse that intersects the vector from the centre of
- the ellipse to the point (x4,y4). The arc is drawn in a
- counter-clockwise direction with the current plot action using the
- current color and the current line style.
-
- When the coordinates (x1,y1) and (x2,y2) establish a line or a point
- (this happens when one or more of the x-coordinates or y-coordinates
- are equal), nothing is drawn.
-
- The argument "fill" determines whether the figure is filled in or has
- only its outline drawn. The argument can have one of two values:
-
- _GFILLINTERIOR fill the interior by writing pixels with the current
- plot action using the current color and the current
- fill mask
- _GBORDER leave the interior unchanged; draw the outline of the
- figure with the current plot action using the current
- color and line style
- ::::_PIE_W
- ->_PIE
- ::::_PIE_WXY
- ->_PIE
- ::::_POLYGON
- #include \<graph.h>
- short _FAR _polygon( short fill, short numpts,
- struct xycoord _FAR *points );
-
- short _FAR _polygon_w( short fill, short numpts,
- double _FAR *points );
-
- short _FAR _polygon_wxy( short fill, short numpts,
- struct _wxycoord _FAR *points );
-
- The _polygon functions draw polygons. The _polygon function uses the
- view coordinate system. The _polygon_w and _polygon_wxy functions use
- the window coordinate system.
-
- The polygon is defined as containing "numpts" points whose coordinates
- are given in the array "points".
-
- The argument "fill" determines whether the polygon is filled in or has
- only its outline drawn. The argument can have one of two values:
-
- _GFILLINTERIOR fill the interior by writing pixels with the current
- plot action using the current color and the current
- fill mask
- _GBORDER leave the interior unchanged; draw the outline of the
- figure with the current plot action using the current
- color and line style
- ::::_POLYGON_W
- ->_POLYGON
- ::::_POLYGON_WXY
- ->_POLYGON
- ::::_PUTIMAGE
- #include \<graph.h>
- void _FAR _putimage( short x, short y,
- char _HUGE *image, short mode );
-
- void _FAR _putimage_w( double x, double y,
- char _HUGE *image, short mode );
-
- The _putimage functions display the screen image indicated by the
- argument "image". The _putimage function uses the view coordinate
- system. The _putimage_w function uses the window coordinate system.
-
- The image is displayed upon the screen with its top left corner
- located at the point with coordinates (x,y). The image was previously
- saved using the _getimage functions. The image is displayed in a
- rectangle whose size is the size of the rectangular image saved by the
- _getimage functions.
-
- The image can be displayed in a number of ways, depending upon the
- value of the "mode" argument. This argument can have the following
- values:
-
- _GPSET replace the rectangle on the screen by the saved image
- _GPRESET replace the rectangle on the screen with the pixel
- values of the saved image inverted; this produces a
- negative image
- _GAND produce a new image on the screen by ANDing together
- the pixel values from the screen with those from the
- saved image
- _GOR produce a new image on the screen by ORing together the
- pixel values from the screen with those from the saved
- image
- _GXOR produce a new image on the screen by exclusive ORing
- together the pixel values from the screen with those
- from the saved image; the original screen is restored
- by two successive calls to the _putimage function with
- this value, providing an efficient method to produce
- animated effects
- ::::_PUTIMAGE_W
- ->_PUTIMAGE
- ::::_RECTANGLE
- #include \<graph.h>
- short _FAR _rectangle( short fill,
- short x1, short y1,
- short x2, short y2 );
-
- short _FAR _rectangle_w( short fill,
- double x1, double y1,
- double x2, double y2 );
-
- short _FAR _rectangle_wxy( short fill,
- struct _wxycoord _FAR *p1,
- struct _wxycoord _FAR *p2 );
-
- The _rectangle functions draw rectangles. The _rectangle function
- uses the view coordinate system. The _rectangle_w and _rectangle_wxy
- functions use the window coordinate system.
-
- The rectangle is defined with opposite corners established by the
- points (x1,y1) and (x2,y2).
-
- The argument "fill" determines whether the rectangle is filled in or
- has only its outline drawn. The argument can have one of two values:
-
- _GFILLINTERIOR fill the interior by writing pixels with the current
- plot action using the current color and the current
- fill mask
- _GBORDER leave the interior unchanged; draw the outline of the
- figure with the current plot action using the current
- color and line style
- ::::_RECTANGLE_W
- ->_RECTANGLE
- ::::_RECTANGLE_WXY
- ->_RECTANGLE
- ::::_REGISTERFONTS
- #include \<graph.h>
- short _FAR _registerfonts( char _FAR *path );
-
- The _registerfonts function initializes the font graphics system.
- Fonts must be registered, and a font selected, before text can be
- displayed with the _outgtext function.
-
- The argument "path" specifies the location of the font files. This
- argument is a DOS file specification, and can contain drive and
- directory components and may contain wildcard characters. The
- _registerfonts function opens each of the font files specified and
- reads the font information. Memory is allocated to store the
- characteristics of the font. These font characteristics are used by
- the _setfont function when selecting a font.
- ::::_REMAPALLPALETTE
- #include \<graph.h>
- short _FAR _remapallpalette( long _FAR *colors );
-
- The _remapallpalette function sets (or remaps) all of the colors in
- the palette. The color values in the palette are replaced by the
- array of color values given by the argument "colors". This function is
- supported in all video modes, but only works with EGA, MCGA and VGA
- adapters.
-
- The array "colors" must contain at least as many elements as there are
- supported colors. The newly mapped palette will cause the complete
- screen to change color wherever there is a pixel value of a changed
- color in the palette.
-
- The representation of colors depends upon the hardware being used.
- The number of colors in the palette can be determined by using the
- _getvideoconfig function.
- ::::_REMAPPALETTE
- #include \<graph.h>
- long _FAR _remappalette( short pixval, long color );
-
- The _remappalette function sets (or remaps) the palette color "pixval"
- to be the color "color". This function is supported in all video
- modes, but only works with EGA, MCGA and VGA adapters.
-
- The argument "pixval" is an index in the color palette of the current
- video mode. The argument "color" specifies the actual color displayed
- on the screen by pixels with pixel value "pixval". Color values are
- selected by specifying the red, green and blue intensities that make
- up the color. Each intensity can be in the range from 0 to 63,
- resulting in 262144 possible different colors. A given color value
- can be conveniently specified as a value of type long. The color
- value is of the form 0x00bbggrr, where bb is the blue intensity, gg is
- the green intensity and rr is the red intensity of the selected color.
- The file graph.h defines constants containing the color intensities of
- each of the 16 default colors.
-
- The _remappalette function takes effect immediately. All pixels on
- the complete screen which have a pixel value equal to the value of
- "pixval" will now have the color indicated by the argument "color".
- ::::_SCROLLTEXTWINDOW
- #include \<graph.h>
- void _FAR _scrolltextwindow( short rows );
-
- The _scrolltextwindow function scrolls the lines in the current text
- window. A text window is defined with the _settextwindow function.
- By default, the text window is the entire screen.
-
- The argument "rows" specifies the number of rows to scroll. A
- positive value means to scroll the text window up or towards the top
- of the screen. A negative value means to scroll the text window down
- or towards the bottom of the screen. Specifying a number of rows
- greater than the height of the text window is equivalent to clearing
- the text window with the _clearscreen function.
-
- Two constants are defined that can be used with the _scrolltextwindow
- function:
-
- _GSCROLLUP the contents of the text window are scrolled up
- (towards the top of the screen) by one row
- _GSCROLLDOWN the contents of the text window are scrolled down
- (towards the bottom of the screen) by one row
- ::::_SELECTPALETTE
- #include \<graph.h>
- short _FAR _selectpalette( short palnum );
-
- The _selectpalette function selects the palette indicated by the
- argument "palnum" from the color palettes available. This function is
- only supported by the video modes _MRES4COLOR and _MRESNOCOLOR.
-
- Mode _MRES4COLOR supports four palettes of four colors. In each
- palette, color 0, the background color, can be any of the 16 possible
- colors. The color values associated with the other three pixel
- values, (1, 2 and 3), are determined by the selected palette.
-
- The following table outlines the available color palettes:
-
- Palette Pixel Values
- Number 1 2 3
-
- 0 green red brown
- 1 cyan magenta white
- 2 light green light red yellow
- 3 light cyan light magenta bright white
- ::::_SETACTIVEPAGE
- #include \<graph.h>
- short _FAR _setactivepage( short pagenum );
-
- The _setactivepage function selects the page (in memory) to which
- graphics output is written. The page to be selected is given by the
- "pagenum" argument.
-
- Only some combinations of video modes and hardware allow multiple
- pages of graphics to exist. When multiple pages are supported, the
- active page may differ from the visual page. The graphics information
- in the visual page determines what is displayed upon the screen.
- Animation may be accomplished by alternating the visual page. A
- graphics page can be constructed without affecting the screen by
- setting the active page to be different than the visual page.
-
- The number of available video pages can be determined by using the
- _getvideoconfig function. The default video page is 0.
- ::::_SETBKCOLOR
- #include \<graph.h>
- long _FAR _setbkcolor( long color );
-
- The _setbkcolor function sets the current background color to be that
- of the "color" argument. In text modes, the background color controls
- the area behind each individual character. In graphics modes, the
- background refers to the entire screen. The default background color
- is 0.
-
- When the current video mode is a graphics mode, any pixels with a zero
- pixel value will change to the color of the "color" argument. When
- the current video mode is a text mode, nothing will immediately
- change; only subsequent output is affected.
- ::::_SETCHARSIZE
- #include \<graph.h>
- void _FAR _setcharsize( short height, short width );
-
- void _FAR _setcharsize_w( double height, double width );
-
- The _setcharsize functions set the character height and width to the
- values specified by the arguments "height" and "width". For the
- _setcharsize function, the arguments "height" and "width" represent a
- number of pixels. For the _setcharsize_w function, the arguments
- "height" and "width" represent lengths along the y-axis and x-axis in
- the window coordinate system.
-
- These sizes are used when displaying text with the _grtext function.
- The default character sizes are dependent on the graphics mode
- selected, and can be determined by the _gettextsettings function.
- ::::_SETCHARSIZE_W
- ->_SETCHARSIZE
- ::::_SETCHARSPACING
- #include \<graph.h>
- void _FAR _setcharspacing( short space );
-
- void _FAR _setcharspacing_w( double space );
-
- The _setcharspacing functions set the current character spacing to
- have the value of the argument "space". For the _setcharspacing
- function, "space" represents a number of pixels. For the
- _setcharspacing_w function, "space" represents a length along the
- x-axis in the window coordinate system.
-
- The character spacing specifies the additional space to leave between
- characters when a text string is displayed with the _grtext function.
- A negative value can be specified to cause the characters to be drawn
- closer together. The default value of the character spacing is 0.
- ::::_SETCHARSPACING_W
- ->_SETCHARSPACING
- ::::_SETCLIPRGN
- #include \<graph.h>
- void _FAR _setcliprgn( short x1, short y1,
- short x2, short y2 );
-
- The _setcliprgn function restricts the display of graphics output to
- the clipping region. This region is a rectangle whose opposite
- corners are established by the physical points (x1,y1) and (x2,y2).
-
- The _setcliprgn function does not affect text output using the
- _outtext and _outmem functions. To control the location of text
- output, see the _settextwindow function.
- ::::_SETCOLOR
- #include \<graph.h>
- short _FAR _setcolor( short pixval );
-
- The _setcolor function sets the pixel value for the current color to
- be that indicated by the "pixval" argument. The current color is only
- used by the functions that produce graphics output; text output with
- _outtext uses the current text color (see the _settextcolor function).
- The default color value is one less than the maximum number of colors
- in the current video mode.
- ::::_SETFILLMASK
- #include \<graph.h>
- void _FAR _setfillmask( char _FAR *mask );
-
- The _setfillmask function sets the current fill mask to the value of
- the argument "mask". When the value of the "mask" argument is NULL,
- there will be no fill mask set.
-
- The fill mask is an eight-byte array which is interpreted as a square
- pattern (8 by 8) of 64 bits. Each bit in the mask corresponds to a
- pixel. When a region is filled, each point in the region is mapped
- onto the fill mask. When a bit from the mask is one, the pixel value
- of the corresponding point is set using the current plotting action
- with the current color; when the bit is zero, the pixel value of that
- point is not affected.
-
- When the fill mask is not set, a fill operation will set all points in
- the fill region to have a pixel value of the current color. By
- default, no fill mask is set.
- ::::_SETFONT
- #include \<graph.h>
- short _FAR _setfont( char _FAR *opt );
-
- The _setfont function selects a font from the list of registered fonts
- (see the _registerfonts function). The font selected becomes the
- current font and is used whenever text is displayed with the _outgtext
- function. The function will fail if no fonts have been registered, or
- if a font cannot be found that matches the given characteristics.
-
- The argument "opt" is a string of characters specifying the
- characteristics of the desired font. These characteristics determine
- which font is selected. The options may be separated by blanks and
- are not case-sensitive. Any number of options may be specified and in
- any order. The available options are:
-
- hX character height X (in pixels)
- wX character width X (in pixels)
- f choose a fixed-width font
- p choose a proportional-width font
- r choose a raster (bit-mapped) font
- v choose a vector font
- b choose the font that best matches the options
- nX choose font number X (the number of fonts is returned
- by the _registerfonts function)
- t'facename' choose a font with specified facename
-
- The facename option is specified as a "t" followed by a facename
- enclosed in single quotes. The available facenames are:
-
- Courier fixed-width raster font with serifs
- Helv proportional-width raster font without serifs
- Tms Rmn proportional-width raster font with serifs
- Script proportional-width vector font that appears similar to
- hand-writing
- Modern proportional-width vector font without serifs
- Roman proportional-width vector font with serifs
-
- When "nX" is specified to select a particular font, the other options
- are ignored.
-
- If the best fit option ("b") is specified, _setfont will always be
- able to select a font. The font chosen will be the one that best
- matches the options specified. The following precedence is given to
- the options when selecting a font:
-
- 1. Pixel height (higher precedence is given to heights less than the
- specified height)
-
- 2. Facename
-
- 3. Pixel width
-
- 4. Font type (fixed or proportional)
-
- When a pixel height or width does not match exactly and a vector font
- has been selected, the font will be stretched appropriately to match
- the given size.
- ::::_SETGTEXTVECTOR
- #include \<graph.h>
- struct xycoord _FAR _setgtextvector( short x, short y );
-
- The _setgtextvector function sets the orientation for text output used
- by the _outgtext function to the vector specified by the arguments
- (x,y). Each of the arguments can have a value of -1, 0 or 1, allowing
- for text to be displayed at any multiple of a 45-degree angle. The
- default text orientation, for normal left-to-right text, is the vector
- (1,0).
- ::::_SETLINESTYLE
- #include \<graph.h>
- void _FAR _setlinestyle( unsigned short style );
-
- The _setlinestyle function sets the current line-style mask to the
- value of the "style" argument.
-
- The line-style mask determines the style by which lines and arcs are
- drawn. The mask is treated as an array of 16 bits. As a line is
- drawn, a pixel at a time, the bits in this array are cyclically
- tested. When a bit in the array is 1, the pixel value for the current
- point is set using the current color according to the current plotting
- action; otherwise, the pixel value for the point is left unchanged. A
- solid line would result from a value of 0xFFFF and a dashed line would
- result from a value of 0xF0F0
-
- The default line style mask is 0xFFFF.
- ::::_SETPIXEL
- #include \<graph.h>
- short _FAR _setpixel( short x, short y );
-
- short _FAR _setpixel_w( double x, double y );
-
- The _setpixel function sets the pixel value of the point (x,y) using
- the current plotting action with the current color. The _setpixel
- function uses the view coordinate system. The _setpixel_w function
- uses the window coordinate system.
-
- A pixel value is associated with each point. The values range from 0
- to the number of colors (less one) that can be represented in the
- palette for the current video mode. The color displayed at the point
- is the color in the palette corresponding to the pixel number. For
- example, a pixel value of 3 causes the fourth color in the palette to
- be displayed at the point in question.
- ::::_SETPIXEL_W
- ->_SETPIXEL
- ::::_SETPLOTACTION
- #include \<graph.h>
- short _FAR _setplotaction( short action );
-
- The _setplotaction function sets the current plotting action to the
- value of the "action" argument.
-
- The drawing functions cause pixels to be set with a pixel value. By
- default, the value to be set is obtained by replacing the original
- pixel value with the supplied pixel value. Alternatively, the
- replaced value may be computed as a function of the original and the
- supplied pixel values.
-
- The plotting action can have one of the following values:
-
- _GPSET replace the original screen pixel value with the
- supplied pixel value
- _GAND replace the original screen pixel value with the
- bitwise and of the original pixel value and the
- supplied pixel value
- _GOR replace the original screen pixel value with the
- bitwise or of the original pixel value and the supplied
- pixel value
- _GXOR replace the original screen pixel value with the
- bitwise exclusive-or of the original pixel value and
- the supplied pixel value. Performing this operation
- twice will restore the original screen contents,
- providing an efficient method to produce animated
- effects.
- ::::_SETTEXTALIGN
- #include \<graph.h>
- void _FAR _settextalign( short horiz, short vert );
-
- The _settextalign function sets the current text alignment to the
- values specified by the arguments "horiz" and "vert". When text is
- displayed with the _grtext function, it is aligned (justified)
- horizontally and vertically about the given point according to the
- current text alignment settings.
-
- The horizontal component of the alignment can have one of the
- following values:
-
- _NORMAL use the default horizontal alignment for the current
- setting of the text path
- _LEFT the text string is left justified at the given point
- _CENTER the text string is centred horizontally about the given
- point
- _RIGHT the text string is right justified at the given point
-
- The vertical component of the alignment can have one of the following
- values:
-
- _NORMAL use the default vertical alignment for the current
- setting of the text path
- _TOP the top of the text string is aligned at the given
- point
- _CAP the cap line of the text string is aligned at the given
- point
- _HALF the text string is centred vertically about the given
- point
- _BASE the base line of the text string is aligned at the
- given point
- _BOTTOM the bottom of the text string is aligned at the given
- point
-
- The default is to use _LEFT alignment for the horizontal component
- unless the text path is _PATH_LEFT, in which case _RIGHT alignment is
- used. The default value for the vertical component is _TOP unless the
- text path is _PATH_UP, in which case _BOTTOM alignment is used.
- ::::_SETTEXTCOLOR
- #include \<graph.h>
- short _FAR _settextcolor( short pixval );
-
- The _settextcolor function sets the current text color to be the color
- indicated by the pixel value of the "pixval" argument. This is the
- color value used for displaying text with the _outtext and _outmem
- functions. Use the _setcolor function to change the color of graphics
- output. The default text color value is set to 7 whenever a new video
- mode is selected.
-
- The pixel value "pixval" is a number in the range 0-31. Colors in the
- range 0-15 are displayed normally. In text modes, blinking colors are
- specified by adding 16 to the normal color values. The following
- table specifies the default colors in color text modes.
-
- Pixel Color Pixel Color
- value value
-
- 0 Black 8 Gray
- 1 Blue 9 Light Blue
- 2 Green 10 Light Green
- 3 Cyan 11 Light Cyan
- 4 Red 12 Light Red
- 5 Magenta 13 Light Magenta
- 6 Brown 14 Yellow
- 7 White 15 Bright White
- ::::_SETTEXTCURSOR
- #include \<graph.h>
- short _FAR _settextcursor( short cursor );
-
- The _settextcursor function sets the attribute, or shape, of the
- cursor in text modes. The cursor shape is set using the BIOS Set
- Cursor Size function. The argument "cursor" specifies the new cursor
- shape. The cursor shape is selected by specifying the top and bottom
- rows in the character matrix. The high byte of "cursor" specifies the
- top row of the cursor; the low byte specifies the bottom row.
-
- Some typical values for "cursor" are:
-
- Cursor Shape
-
- 0x0607 normal underline cursor
- 0x0007 full block cursor
- 0x0407 half-height block cursor
- 0x2000 no cursor
- ::::_SETTEXTORIENT
- #include \<graph.h>
- void _FAR _settextorient( short vecx, short vecy );
-
- The _settextorient function sets the current text orientation to the
- vector specified by the arguments (vecx,vecy). The text orientation
- specifies the direction of the base-line vector when a text string is
- displayed with the _grtext function. The default text orientation,
- for normal left-to-right text, is the vector (1,0).
- ::::_SETTEXTPATH
- #include \<graph.h>
- void _FAR _settextpath( short path );
-
- The _settextpath function sets the current text path to have the value
- of the "path" argument. The text path specifies the writing direction
- of the text displayed by the _grtext function. The argument can have
- one of the following values:
-
- _PATH_RIGHT subsequent characters are drawn to the right of the
- previous character
- _PATH_LEFT subsequent characters are drawn to the left of the
- previous character
- _PATH_UP subsequent characters are drawn above the previous
- character
- _PATH_DOWN subsequent characters are drawn below the previous
- character
-
- The default value of the text path is _PATH_RIGHT.
- ::::_SETTEXTPOSITION
- #include \<graph.h>
- struct rccoord _FAR _settextposition( short row,
- short col );
-
- The _settextposition function sets the current output position for
- text to be (row,col) where this position is in terms of characters,
- not pixels.
-
- The text position is relative to the current text window. It defaults
- to the top left corner of the screen, (1,1), when a new video mode is
- selected, or when a new text window is set. The position is updated
- as text is drawn with the _outtext and _outmem functions.
-
- Note that the output position for graphics output differs from that
- for text output. The output position for graphics output can be set
- by use of the _moveto function.
- ::::_SETTEXTROWS
- #include \<graph.h>
- short _FAR _settextrows( short rows );
-
- The _settextrows function selects the number of rows of text displayed
- on the screen. The number of rows is specified by the argument
- "rows". Computers equipped with EGA, MCGA and VGA adapters can support
- different numbers of text rows. The number of rows that can be
- selected depends on the current video mode and the type of monitor
- attached.
-
- If the argument "rows" has the value "_MAXTEXTROWS", the maximum
- number of text rows will be selected for the current video mode and
- hardware configuration. In text modes the maximum number of rows is
- 43 for EGA adapters, and 50 for MCGA and VGA adapters. Some graphics
- modes will support 43 rows for EGA adapters and 60 rows for MCGA and
- VGA adapters.
- ::::_SETTEXTWINDOW
- #include \<graph.h>
- void _FAR _settextwindow( short row1, short col1,
- short row2, short col2 );
-
- The _settextwindow function sets the text window to be the rectangle
- with a top left corner at (row1,col1) and a bottom right corner at
- (row2,col2). These coordinates are in terms of characters not pixels.
-
- The initial text output position is (1,1). Subsequent text positions
- are reported (by the _gettextposition function) and set (by the
- _outtext, _outmem and _settextposition functions) relative to this
- rectangle.
-
- Text is displayed from the current output position for text proceeding
- along the current row and then downwards. When the window is full,
- the lines scroll upwards one line and then text is displayed on the
- last line of the window.
- ::::_SETVIDEOMODE
- #include \<graph.h>
- short _FAR _setvideomode( short mode );
-
- The _setvideomode function sets the video mode according to the value
- of the "mode" argument. The value of "mode" can be one of the
- following:
-
- Mode Type Size Colors Adapter
-
- _MAXRESMODE (graphics mode with highest resolution)
- _MAXCOLORMODE (graphics mode with most colors)
- _DEFAULTMODE (restores screen to original mode)
- _TEXTBW40 M,T 40 x 25 16 MDPA,HGC,VGA,SVGA
- _TEXTC40 C,T 40 x 25 16 CGA,EGA,MCGA,VGA,SVGA
- _TEXTBW80 M,T 80 x 25 16 MDPA,HGC,VGA,SVGA
- _TEXTC80 C,T 80 x 25 16 CGA,EGA,MCGA,VGA,SVGA
- _MRES4COLOR C,G 320 x 200 4 CGA,EGA,MCGA,VGA,SVGA
- _MRESNOCOLOR C,G 320 x 200 4 CGA,EGA,MCGA,VGA,SVGA
- _HRESBW C,G 640 x 200 2 CGA,EGA,MCGA,VGA,SVGA
- _TEXTMONO M,T 80 x 25 16 MDPA,HGC,VGA,SVGA
- _HERCMONO M,G 720 x 350 2 HGC
- _MRES16COLOR C,G 320 x 200 16 EGA,VGA,SVGA
- _HRES16COLOR C,G 640 x 200 16 EGA,VGA,SVGA
- _ERESNOCOLOR M,G 640 x 350 4 EGA,VGA,SVGA
- _ERESCOLOR C,G 640 x 350 4/16 EGA,VGA,SVGA
- _VRES2COLOR C,G 640 x 480 2 MCGA,VGA,SVGA
- _VRES16COLOR C,G 640 x 480 16 VGA,SVGA
- _MRES256COLOR C,G 320 x 200 256 MCGA,VGA,SVGA
- _URES256COLOR C,G 640 x 400 256 SVGA
- _VRES256COLOR C,G 640 x 480 256 SVGA
- _SVRES16COLOR C,G 800 x 600 16 SVGA
- _SVRES256COLOR C,G 800 x 600 256 SVGA
- _XRES16COLOR C,G 1024 x 768 16 SVGA
- _XRES256COLOR C,G 1024 x 768 256 SVGA
-
- In the preceding table, the Type column contains the following
- letters:
-
- M indicates monochrome; multiple colors are shades of grey
- C indicates color
- G indicates graphics mode; size is in pixels
- T indicates text mode; size is in columns and rows of
- characters
-
- The Adapter column contains the following codes:
-
- MDPA IBM Monochrome Display/Printer Adapter
- CGA IBM Color Graphics Adapter
- EGA IBM Enhanced Graphics Adapter
- VGA IBM Video Graphics Array
- MCGA IBM Multi-Color Graphics Array
- HGC Hercules Graphics Adapter
- SVGA SuperVGA adapters
-
- The modes _MAXRESMODE and _MAXCOLORMODE will select from among the
- video modes supported by the current graphics adapter the one that has
- the highest resolution or the greatest number of colors. The video
- mode will be selected from the standard modes, not including the
- SuperVGA modes.
-
- Selecting a new video mode resets the current output positions for
- graphics and text to be the top left corner of the screen. The
- background color is reset to black and the default color value is set
- to be one less than the number of colors in the selected mode.
- ::::_SETVIDEOMODEROWS
- #include \<graph.h>
- short _FAR _setvideomoderows( short mode, short rows );
-
- The _setvideomoderows function selects a video mode and the number of
- rows of text displayed on the screen. The video mode is specified by
- the argument "mode" and is selected with the _setvideomode function.
- The number of rows is specified by the argument "rows" and is selected
- with the _settextrows function.
-
- Computers equipped with EGA, MCGA and VGA adapters can support
- different numbers of text rows. The number of rows that can be
- selected depends on the video mode and the type of monitor attached.
- ::::_SETVIEWORG
- #include \<graph.h>
- struct xycoord _FAR _setvieworg( short x, short y );
-
- The _setvieworg function sets the origin of the view coordinate
- system, (0,0), to be located at the physical point (x,y). This causes
- subsequently drawn images to be translated by the amount (x,y).
-
- Note: In previous versions of the software, the _setvieworg function
- was called _setlogorg.
- ::::_SETVIEWPORT
- #include \<graph.h>
- void _FAR _setviewport( short x1, short y1,
- short x2, short y2 );
-
- The _setviewport function restricts the display of graphics output to
- the clipping region and then sets the origin of the view coordinate
- system to be the top left corner of the region. This region is a
- rectangle whose opposite corners are established by the physical
- points (x1,y1) and (x2,y2).
-
- The _setviewport function does not affect text output using the
- _outtext and _outmem functions. To control the location of text
- output, see the _settextwindow function.
- ::::_SETVISUALPAGE
- #include \<graph.h>
- short _FAR _setvisualpage( short pagenum );
-
- The _setvisualpage function selects the page (in memory) from which
- graphics output is displayed. The page to be selected is given by the
- "pagenum" argument.
-
- Only some combinations of video modes and hardware allow multiple
- pages of graphics to exist. When multiple pages are supported, the
- active page may differ from the visual page. The graphics information
- in the visual page determines what is displayed upon the screen.
- Animation may be accomplished by alternating the visual page. A
- graphics page can be constructed without affecting the screen by
- setting the active page to be different than the visual page.
-
- The number of available video pages can be determined by using the
- _getvideoconfig function. The default video page is 0.
- ::::_SETWINDOW
- #include \<graph.h>
- short _FAR _setwindow( short invert,
- double x1, double y1,
- double x2, double y2 );
-
- The _setwindow function defines a window for the window coordinate
- system. Window coordinates are specified as a user-defined range of
- values. This allows for consistent pictures regardless of the video
- mode.
-
- The window is defined as the region with opposite corners established
- by the points (x1,y1) and (x2,y2). The argument "invert" specifies
- the direction of the y-axis. If the value is non-zero, the y values
- increase from the bottom of the screen to the top, otherwise, the y
- values increase as you move down the screen.
-
- The window defined by the _setwindow function is displayed in the
- current viewport. A viewport is defined by the _setviewport function.
-
- By default, the window coordinate system is defined with the point
- (0.0,0.0) located at the lower left corner of the screen, and the
- point (1.0,1.0) at the upper right corner.
- ::::_UNREGISTERFONTS
- #include \<graph.h>
- void _FAR _unregisterfonts( void );
-
- The _unregisterfonts function frees the memory previously allocated by
- the _registerfonts function. The currently selected font is also
- unloaded.
-
- Attempting to use the _setfont function after calling _unregisterfonts
- will result in an error.
- ::::_WRAPON
- #include \<graph.h>
- short _FAR _wrapon( short wrap );
-
- The _wrapon function is used to control the display of text when the
- text output reaches the right side of the text window. This is text
- displayed with the _outtext and _outmem functions. The "wrap"
- argument can take one of the following values:
-
- _GWRAPON causes lines to wrap at the window border
- _GWRAPOFF causes lines to be truncated at the window border
- ::::ANALYZE
- Analyze Functions
- ═════════════════
-
- These functions calculate default values for chart elements without
- actually displaying the chart. The functions ending with ms analyze
- multi-series charts; the others analyze single-series charts.
-
- The following functions are defined:
-
- <_pg_analyzechart> analyze a bar, column or line chart
- <_pg_analyzechartms> analyze a multi-series bar, column or line
- chart
- <_pg_analyzepie> analyze a pie chart
- <_pg_analyzescatter> analyze a scatter chart
- <_pg_analyzescatterms> analyze a multi-series scatter chart
- ::::ATTRIBUTE
- Attribute Functions
- ═══════════════════
-
- These functions control the display of graphical images such as lines
- and circles. Lines and figures are drawn using the current color (see
- the _setcolor function), the current line style (see the _setlinestyle
- function), the current fill mask (see the _setfillmask function), and
- the current plotting action (see the _setplotaction function).
-
- The following functions are defined:
-
- <_getarcinfo> get the endpoints of the most recently drawn
- arc
- <_getbkcolor> get the background color
- <_getcolor> get the current color
- <_getfillmask> get the current fill mask
- <_getlinestyle> get the current line style
- <_getplotaction> get the current plotting action
- <_remapallpalette> assign colors for all pixel values
- <_remappalette> assign color for one pixel value
- <_selectpalette> select a palette
- <_setbkcolor> set the background color
- <_setcolor> set the current color
- <_setfillmask> set the current fill mask
- <_setlinestyle> set the current line style
- <_setplotaction> set the current plotting action
- ::::COORDINATE_SYSTEM
- Coordinate System Functions
- ═══════════════════════════
-
- These functions deal with coordinate systems and mapping coordinates
- from one system to another. The WATCOM C Graphics Library supports
- three coordinate systems:
-
- 1. Physical coordinates
-
- 2. View coordinates
-
- 3. Window coordinates
-
- Physical coordinates match the physical dimensions of the screen. The
- physical origin, denoted (0,0), is located at the top left corner of
- the screen. A pixel to the right of the origin has a positive
- x-coordinate and a pixel below the origin will have a positive
- y-coordinate. The x- and y-coordinates will never be negative values.
-
- The view coordinate system can be defined upon the physical coordinate
- system by moving the origin from the top left corner of the screen to
- any physical coordinate (see the _setvieworg function). In the view
- coordinate system, negative x- and y-coordinates are allowed. The
- scale of the view and physical coordinate systems is identical (both
- are in terms of pixels).
-
- The window coordinate system is defined in terms of a range of
- user-specified values (see the _setwindow function). These values are
- scaled to map onto the physical coordinates of the screen. This
- allows for consistent pictures regardless of the resolution (number of
- pixels) of the screen.
-
- The following functions are defined:
-
- <_getcliprgn> get the boundary of the current clipping
- region
- <_getphyscoord> get the physical coordinates of a point in
- view coordinates
- <_getviewcoord> get the view coordinates of a point in
- physical coordinates
- <_getviewcoord_w> get the view coordinates of a point in window
- coordinates
- <_getviewcoord_wxy> get the view coordinates of a point in window
- coordinates
- <_getwindowcoord> get the window coordinates of a point in view
- coordinates
- <_setcliprgn> set the boundary of the clipping region
- <_setvieworg> set the position to be used as the origin of
- the view coordinate system
- <_setviewport> set the boundary of the clipping region and
- the origin of the view coordinate system
- <_setwindow> define the boundary of the window coordinate
- system
- ::::DISPLAY
- Display Functions
- ═════════════════
-
- These functions are for the initialization of the presentation
- graphics system and the displaying of charts. The _pg_initchart
- function initializes the system and should be the first presentation
- graphics function called. The single-series functions display a
- single set of data on a chart; the multi-series functions (those
- ending with ms) display several sets of data on the same chart.
-
- The following functions are defined:
-
- <_pg_chart> display a bar, column or line chart
- <_pg_chartms> display a multi-series bar, column or line
- chart
- <_pg_chartpie> display a pie chart
- <_pg_chartscatter> display a scatter chart
- <_pg_chartscatterms> display a multi-series scatter chart
- <_pg_defaultchart> initialize the chart environment for a
- specific chart type
- <_pg_initchart> initialize the presentation graphics system
- ::::DRAWING
- Drawing Functions
- ═════════════════
-
- These functions display graphical images such as lines and ellipses.
- Functions exist to draw straight lines (see the _lineto functions),
- rectangles (see the _rectangle functions), polygons (see the _polygon
- functions), ellipses (see the _ellipse functions), elliptical arcs
- (see the _arc functions) and pie-shaped wedges from ellipses (see the
- _pie functions).
-
- These figures are drawn using the attributes described in the previous
- section. The functions ending with _w or _wxy use the window
- coordinate system; the others use the view coordinate system.
-
- The following functions are defined:
-
- <_arc> draw an arc
- <_arc_w> draw an arc using window coordinates
- <_arc_wxy> draw an arc using window coordinates
- <_clearscreen> clear the screen and fill with the background
- color
- <_ellipse> draw an ellipse
- <_ellipse_w> draw an ellipse using window coordinates
- <_ellipse_wxy> draw an ellipse using window coordinates
- <_floodfill> fill an area of the screen with the current
- color
- <_floodfill_w> fill an area of the screen in window
- coordinates with the current color
- <_getcurrentposition> get the coordinates of the current output
- position
- <_getcurrentposition_w> get the window coordinates of the current
- output position
- <_getpixel> get the color of the pixel at the specified
- position
- <_getpixel_w> get the color of the pixel at the specified
- position in window coordinates
- <_lineto> draw a line from the current position to a
- specified position
- <_lineto_w> draw a line from the current position to a
- specified position in window coordinates
- <_moveto> set the current output position
- <_moveto_w> set the current output position using window
- coordinates
- <_pie> draw a wedge of a "pie"
- <_pie_w> draw a wedge of a "pie" using window
- coordinates
- <_pie_wxy> draw a wedge of a "pie" using window
- coordinates
- <_polygon> draw a polygon
- <_polygon_w> draw a polygon using window coordinates
- <_polygon_wxy> draw a polygon using window coordinates
- <_rectangle> draw a rectangle
- <_rectangle_w> draw a rectangle using window coordinates
- <_rectangle_wxy> draw a rectangle using window coordinates
- <_setpixel> set the color of the pixel at the specified
- position
- <_setpixel_w> set the color of the pixel at the specified
- position in window coordinates
- ::::ENVIRONMENT
- Environment Functions
- ═════════════════════
-
- These functions deal with the hardware environment. The
- _getvideoconfig function returns information about the current video
- mode and the hardware configuration. The _setvideomode function
- selects a new video mode.
-
- Some video modes support multiple pages of screen memory. The visual
- page (the one displayed on the screen) may be different than the
- active page (the one to which objects are being written).
-
- The following functions are defined:
-
- <_getactivepage> get the number of the current active graphics
- page
- <_getvideoconfig> get information about the graphics
- configuration
- <_getvisualpage> get the number of the current visual graphics
- page
- <_grstatus> get the status of the most recently called
- graphics library function
- <_setactivepage> set the active graphics page (the page to
- which graphics objects are drawn)
- <_settextrows> set the number of rows of text displayed on
- the screen
- <_setvideomode> select the video mode to be used
- <_setvideomoderows> select the video mode and the number of text
- rows to be used
- <_setvisualpage> set the visual graphics page (the page
- displayed on the screen)
- ::::FONT_MANIPULATION
- Font Manipulation Functions
- ═══════════════════════════
-
- These functions are for the display of fonts compatible with Microsoft
- Windows. Fonts are contained in files with an extension of ".FON".
- Before font based text can be displayed, the fonts must be registered
- with the _registerfonts function, and a font must be selected with the
- _setfont function.
-
- The following functions are defined:
-
- <_getfontinfo> get information about the currently selected
- font
- <_getgtextextent> get the length in pixels of a text string
- <_getgtextvector> get the current value of the font text
- orientation vector
- <_outgtext> display a string of text in the current font
- <_registerfonts> initialize the font graphics system
- <_setfont> select a font from among the registered fonts
- <_setgtextvector> set the font text orientation vector
- <_unregisterfonts> frees memory allocated by the font graphics
- system
- ::::GRAPHICS
- Graphics Functions
- ══════════════════
-
- The WATCOM C Graphics Library consists of a large number of functions.
- These functions are used to display graphical images such as lines and
- circles upon the computer screen. Functions are also provided for
- displaying text along with the graphics output.
-
- Support is provided for both color and monochrome screens which are
- connected to the computer using any of the following graphics
- adapters:
-
- IBM Monochrome Display/Printer Adapter (MDPA)
- IBM Color Graphics Adapter (CGA)
- IBM Enhanced Graphics Adapter (EGA)
- IBM Multi-Color Graphics Array (MCGA)
- IBM Video Graphics Array (VGA)
- Hercules Monochrome Adapter
- SuperVGA adapters (SVGA) supplied by various manufacturers
-
- The functions in the WATCOM C Graphics Library can be organized into a
- number of classes:
-
- <Environment> These functions deal with the hardware
- environment.
- <Coordinate_System> These functions deal with coordinate systems
- and mapping coordinates from one system to
- another.
- <Attribute> These functions control the display of
- graphical images.
- <Drawing> These functions display graphical images such
- as lines and ellipses.
- <Text> These functions deal with displaying text in
- both graphics and text modes.
- <Graphics_Text> These functions deal with displaying graphics
- text.
- <Image_Manipulation> These functions store and retrieve screen
- images.
- <Font_Manipulation> These functions deal with displaying font
- based text.
- <Presentation_Graphics> These functions deal with displaying
- presentation graphics elements such as bar
- charts and pie charts.
- ::::GRAPHICS_TEXT
- Graphics Text Functions
- ═══════════════════════
-
- These functions deal with displaying graphics text. Graphics text is
- displayed as a sequence of line segments, and can be drawn in
- different sizes (see the _setcharsize function), with different
- orientations (see the _settextorient function) and alignments (see the
- _settextalign function). The functions ending with _w use the window
- coordinate system; the others use the view coordinate system.
-
- The following functions are defined:
-
- <_gettextextent> get the bounding rectangle for a graphics
- text string
- <_gettextsettings> get information about the current settings
- used to display graphics text
- <_grtext> display graphics text
- <_grtext_w> display graphics text using window
- coordinates
- <_setcharsize> set the character size used to display
- graphics text
- <_setcharsize_w> set the character size in window coordinates
- used to display graphics text
- <_setcharspacing> set the character spacing used to display
- graphics text
- <_setcharspacing_w> set the character spacing in window
- coordinates used to display graphics text
- <_settextalign> set the alignment used to display graphics
- text
- <_settextorient> set the orientation used to display graphics
- text
- <_settextpath> set the path used to display graphics text
- ::::IMAGE_MANIPULATION
- Image Manipulation Functions
- ════════════════════════════
-
- These functions are used to transfer screen images. The _getimage
- function transfers a rectangular image from the screen into memory.
- The _putimage function transfers an image from memory back onto the
- screen. The functions ending with _w or _wxy use the window
- coordinate system; the others use the view coordinate system.
-
- The following functions are defined:
-
- <_getimage> store an image of an area of the screen into
- memory
- <_getimage_w> store an image of an area of the screen in
- window coordinates into memory
- <_getimage_wxy> store an image of an area of the screen in
- window coordinates into memory
- <_imagesize> get the size of a screen area
- <_imagesize_w> get the size of a screen area in window
- coordinates
- <_imagesize_wxy> get the size of a screen area in window
- coordinates
- <_putimage> display an image from memory on the screen
- <_putimage_w> display an image from memory on the screen
- using window coordinates
- ::::PRESENTATION_GRAPHICS
- Presentation Graphics Functions
- ═══════════════════════════════
-
- These functions provide a system for displaying and manipulating
- presentation graphics elements such as bar charts and pie charts. The
- presentation graphics functions can be further divided into three
- classes:
-
- <Display> These functions are for the initialization of
- the presentation graphics system and the
- displaying of charts.
- <Analyze> These functions calculate default values for
- chart elements without actually displaying
- the chart.
- <Utility> These functions provide additional support to
- control the appearance of presentation
- graphics elements.
- ::::TEXT
- Text Functions
- ══════════════
-
- These functions deal with displaying text in both graphics and text
- modes. This type of text output uses the system BIOS functions and
- can be displayed in only one size.
-
- This text is displayed using the _outtext and _outmem functions. The
- output position for text follows the last text that was displayed or
- can be reset (see the _settextposition function). Text windows can be
- created (see the _settextwindow function) in which the text will
- scroll. Text is displayed with the current text color (see the
- _settextcolor function).
-
- The following functions are defined:
-
- <_clearscreen> clear the screen and fill with the background
- color
- <_displaycursor> determine whether the cursor is to be
- displayed after a graphics function completes
- execution
- <_getbkcolor> get the background color
- <_gettextcolor> get the color used to display text
- <_gettextcursor> get the shape of the text cursor
- <_gettextposition> get the current output position for text
- <_gettextwindow> get the boundary of the current text window
- <_outmem> display a text string of a specified length
- <_outtext> display a text string
- <_scrolltextwindow> scroll the contents of the text window
- <_setbkcolor> set the background color
- <_settextcolor> set the color used to display text
- <_settextcursor> set the shape of the text cursor
- <_settextposition> set the output position for text
- <_settextwindow> set the boundary of the region used to
- display text
- <_wrapon> permit or disallow wrap-around of text in a
- text window
- ::::UTILITY
- Utility Functions
- ═════════════════
-
- These functions provide additional support to control the appearance
- of presentation graphics elements.
-
- The following functions are defined:
-
- <_pg_getchardef> get bit-map definition for a specific
- character
- <_pg_getpalette> get presentation graphics palette (colors,
- line styles, fill patterns and plot
- characters)
- <_pg_getstyleset> get presentation graphics style-set (line
- styles for window borders and grid lines)
- <_pg_hlabelchart> display text horizontally on a chart
- <_pg_resetpalette> reset presentation graphics palette to
- default values
- <_pg_resetstyleset> reset presentation graphics style-set to
- default values
- <_pg_setchardef> set bit-map definition for a specific
- character
- <_pg_setpalette> set presentation graphics palette (colors,
- line styles, fill patterns and plot
- characters)
- <_pg_setstyleset> set presentation graphics style-set (line
- styles for window borders and grid lines)
- <_pg_vlabelchart> display text vertically on a chart
-