home *** CD-ROM | disk | FTP | other *** search
- /*
- * graph.h -- non-ANSI
- *
- * Graphics utility functions for Microsoft compatibility.
- *
- * Copyright (c) 1990, MetaWare Incorporated
- */
-
- #ifndef _GRAPH_H
- #define _GRAPH_H
-
- extern char * _cgets(char *);
- #ifndef _GRAPH_T_DEFINED
- /* structures used in the library */
-
- /* Define Non-ANSI structure names if no compiling in ANSI mode */
- #ifdef __HIGHC__
- #define _xycoord xycoord
- #define _rccoord rccoord
- #define _videoconfig videoconfig
- #endif
-
- /* The structures xycoord, rccoord, and videoconfig have been changed to
- _xycoord, _rccoord, and _videoconfig for ANSI conformance. If you are
- compiling in ANSI mode you will not be able to use the Microsoft names
- which do not include a prepended _. When compiling in Non-ANSI mode
- the defines above will allow for complete Microsoft name compatiblity. */
-
- struct _xycoord
- {
- short xcoord; /* x coordinate */
- short ycoord; /* y coordinate */
- } ;
-
- struct _rccoord
- {
- short row; /* x coordinate */
- short col; /* y coordinate */
- } ;
-
- struct _videoconfig
- {
- short numxpixels; /* number of pixels in the x direction */
- short numypixels; /* number of pixels in the y direction */
- short numtextcols; /* number of text columns available */
- short numtextrows; /* number of text rows available */
- short numcolors; /* number of actual colors available */
- short bitsperpixel; /* number of bits per pixel */
- short numvideopages; /* number of available video pages */
- short mode; /* these are not supported for use */
- short adapter;
- short monitor;
- short memory;
- } ;
-
- #define _GRAPH_T_DEFINED
- #endif
-
- /* function prototypes */
- extern short _arc(short, short, short, short, short, short, short, short);
- extern void _clearscreen(short);
- extern short _ellipse(short, short, short, short, short);
- extern short _displaycursor(short toggle);
- extern short _floodfill(short x, short y, short boundary);
- extern short _getbkcolor(void);
- extern short _getcolor(void);
- extern struct
- _xycoord _getcurrentposition(void);
- extern char *_getfillmask(char *);
- extern void _getimage(short, short, short, short, char *);
- extern unsigned short
- _getlinestyle(void);
- extern struct
- _xycoord _getlogcoord(short, short);
- extern struct
- _xycoord _getphyscoord(short, short);
- extern short _getpixel(short, short);
- extern short _gettextcolor();
- extern struct
- _rccoord _gettextposition();
- extern struct
- _videoconfig *_getvideoconfig(struct _videoconfig *buffer);
- extern long _imagesize(short, short, short, short);
- extern short _lineto(short, short);
- extern struct
- _xycoord _moveto(short, short);
- extern void _outtext(char *text);
- extern short _pie(short, short, short, short, short, short, short, short, short);
- extern void _putimage(short, short, char *, short);
- extern short _rectangle(short, short, short, short, short);
- extern short _setactivepage(short);
- extern short _setbkcolor(short);
- extern void _setcolor(short);
- extern void _setcliprgn(short, short, short, short);
- extern void _setfillmask(char *);
- extern void _setlinestyle(unsigned short linestyle);
- extern struct
- _xycoord _setlogorg(short, short);
- extern short _setpixel(short x, short y);
- extern short _settextcolor(short color);
- extern struct
- _rccoord _settextposition(short, short);
- extern void _settextwindow(short xt, short yt, short xb, short yb);
- extern short _setvideomode(short);
- extern void _setviewport(short, short, short, short);
- extern short _setvisualpage(short);
- extern short _wrapon(short wrap);
- extern short _selectpalette(short number);
- extern short _remapallpalette(long *color);
- extern long _remappalette(short pixel, long color);
-
-
- /*arguments to _clearscreen() */
- #define _GCLEARSCREEN 0
- #define _GVIEWPORT 1
- #define _GWINDOW 2
-
- /* arguments for _displaycursor() */
- #define _GCURSOROFF 0
- #define _GCURSORON 1
-
- /* arguments to _ellipse, _pie(), and _rectangle() */
- #define _GBORDER 2
- #define _GFILLINTERIOR 3
-
- /* videoconfig adapter constants */
- #define _MDPA 0x0001 /* Monochrome Display Adapter (MDPA) */
- #define _CGA 0x0002 /* Color Graphics Adapter (CGA) */
- #define _EGA 0x0004 /* Enhanced Graphics Adapter (EGA) */
- #define _VGA 0x0008 /* Video Graphics Array (VGA) */
- #define _MCGA 0x0010 /* MultiColor Graphics Array (MCGA) */
- #define _HGC 0x0020 /* Hercules Graphics Card (HGC) */
-
- #define _MONO 0x0001 /* Monochrome */
- #define _COLOR 0x0002 /* Color */
- #define _ENHCOLOR 0x0004 /* Enhanced Color */
- #define _ANALOG 0x0018 /* Analog */
-
- /* mode argument to _setvideomode() */
- #define _DEFAULTMODE -1
- #define _TEXTBW40 0
- #define _TEXTC40 1
- #define _TEXTBW80 2
- #define _TEXTC80 3
- #define _MRES4COLOR 4
- #define _MRESNOCOLOR 5
- #define _HRESBW 6
- #define _TEXTMONO 7
- #define _HERCMONO 8
- #define _MRES16COLOR 13
- #define _HRES16COLOR 14
- #define _ERESNOCOLOR 15
- #define _ERESCOLOR 16
- #define _VRES2COLOR 17
- #define _VRES16COLOR 18
- #define _MRES256COLOR 19
-
-
- /* argument for _putimage() */
- #define _GOR 0
- #define _GAND 1
- #define _GPRESET 2
- #define _GPSET 3
- #define _GXOR 4
-
- /* arguments for _wrapon() */
- #define _GWRAPOFF 0
- #define _GWRAPON 1
-
- /* color constants setcolor, setbkcolor */
- #define _BLACK 0
- #define _BLUE 1
- #define _GREEN 2
- #define _CYAN 3
- #define _RED 4
- #define _MAGENTA 5
- #define _BROWN 6
- #define _WHITE 7
- #define _GRAY 8
- #define _LIGHTBLUE 9
- #define _LIGHTGREEN 10
- #define _LIGHTCYAN 11
- #define _LIGHTRED 12
- #define _LIGHTMAGENTA 13
- #define _LIGHTYELLOW 14
- #define _BRIGHTWHITE 15
-
- #define _MODEFOFF 0L
- #define _MODEFOFFTOON 1L
- #define _MODEFOFFTOHI 2L
- #define _MODEFONTOOFF 3L
- #define _MODEFON 4L
- #define _MODEFONTOHI 5L
- #define _MODEFHITOOFF 6L
- #define _MODEFHITOON 7L
- #define _MODEFHI 8L
-
- #endif /* _GRAPH_H */
-