📄 graph.h
字号:
/***
*graph.h - declare constants, functions, and macros for graphics library
*
* Copyright (c) 1987 - 1990, Microsoft Corporation. All rights reserved.
*
*Purpose:
* This file declares the graphics library functions and the
* structures and manifest constants that are used with them.
*
***************************************************************************/
/* force word packing to avoid possible -Zp override */
#pragma pack(2)
/* user-visible declarations for Quick-C Graphics Library */
#ifndef _VIDEOCONFIG_DEFINED
/* structure for _getvideoconfig() as visible to user */
struct videoconfig {
short numxpixels; /* number of pixels on X axis */
short numypixels; /* number of pixels on Y axis */
short numtextcols; /* number of text columns available */
short numtextrows; /* number of text rows available */
short numcolors; /* number of actual colors */
short bitsperpixel; /* number of bits per pixel */
short numvideopages; /* number of available video pages */
short mode; /* current video mode */
short adapter; /* active display adapter */
short monitor; /* active display monitor */
short memory; /* adapter video memory in K bytes */
};
#define _VIDEOCONFIG_DEFINED
#endif
#ifndef _XYCOORD_DEFINED
/* return value of _setvieworg(), etc. */
struct xycoord {
short xcoord;
short ycoord;
};
#define _XYCOORD_DEFINED
#endif
/* structure for text position */
#ifndef _RCCOORD_DEFINED
struct rccoord {
short row;
short col;
};
#define _RCCOORD_DEFINED
#endif
/* ERROR HANDLING */
short _far _cdecl _grstatus(void);
/* Error Status Information returned by _grstatus() */
/* successful */
#define _GROK 0
/* errors */
#define _GRERROR (-1)
#define _GRMODENOTSUPPORTED (-2)
#define _GRNOTINPROPERMODE (-3)
#define _GRINVALIDPARAMETER (-4)
#define _GRFONTFILENOTFOUND (-5)
#define _GRINVALIDFONTFILE (-6)
#define _GRCORRUPTEDFONTFILE (-7)
#define _GRINSUFFICIENTMEMORY (-8)
#define _GRINVALIDIMAGEBUFFER (-9)
/* warnings */
#define _GRNOOUTPUT 1
#define _GRCLIPPED 2
#define _GRPARAMETERALTERED 3
/* SETUP AND CONFIGURATION */
short _far _cdecl _setvideomode(short);
short _far _cdecl _setvideomoderows(short,short); /* return rows; 0 if error */
/* arguments to _setvideomode() */
#define _MAXRESMODE (-3) /* graphics mode with highest resolution */
#define _MAXCOLORMODE (-2) /* graphics mode with most colors */
#define _DEFAULTMODE (-1) /* restore screen to original mode */
#define _TEXTBW40 0 /* 40-column text, 16 grey */
#define _TEXTC40 1 /* 40-column text, 16/8 color */
#define _TEXTBW80 2 /* 80-column text, 16 grey */
#define _TEXTC80 3 /* 80-column text, 16/8 color */
#define _MRES4COLOR 4 /* 320 x 200, 4 color */
#define _MRESNOCOLOR 5 /* 320 x 200, 4 grey */
#define _HRESBW 6 /* 640 x 200, BW */
#define _TEXTMONO 7 /* 80-column text, BW */
#define _HERCMONO 8 /* 720 x 348, BW for HGC */
#define _MRES16COLOR 13 /* 320 x 200, 16 color */
#define _HRES16COLOR 14 /* 640 x 200, 16 color */
#define _ERESNOCOLOR 15 /* 640 x 350, BW */
#define _ERESCOLOR 16 /* 640 x 350, 4 or 16 color */
#define _VRES2COLOR 17 /* 640 x 480, BW */
#define _VRES16COLOR 18 /* 640 x 480, 16 color */
#define _MRES256COLOR 19 /* 320 x 200, 256 color */
#define _ORESCOLOR 64 /* 640 x 400, 1 of 16 colors (Olivetti) */
short _far _cdecl _setactivepage(short);
short _far _cdecl _setvisualpage(short);
short _far _cdecl _getactivepage(void);
short _far _cdecl _getvisualpage(void);
/* videoconfig adapter values */
/* these manifest constants can be used to determine the type of the active */
/* adapter, using either simple comparisons or the bitwise-AND operator (&) */
#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 _OCGA 0x0042 /* Olivetti Color Graphics Adapter (OCGA) */
#define _OEGA 0x0044 /* Olivetti Enhanced Graphics Adapter (OEGA) */
#define _OVGA 0x0048 /* Olivetti Video Graphics Array (OVGA) */
/* videoconfig monitor values */
/* these manifest constants can be used to determine the type of monitor in */
/* use, using either simple comparisons or the bitwise-AND operator (&) */
#define _MONO 0x0001 /* Monochrome */
#define _COLOR 0x0002 /* Color (or Enhanced emulating color) */
#define _ENHCOLOR 0x0004 /* Enhanced Color */
#define _ANALOGMONO 0x0008 /* Analog Monochrome only */
#define _ANALOGCOLOR 0x0010 /* Analog Color only */
#define _ANALOG 0x0018 /* Analog Monochrome and Color modes */
struct videoconfig _far * _far _cdecl _getvideoconfig(struct videoconfig _far *);
/* COORDINATE SYSTEMS */
struct xycoord _far _cdecl _setvieworg(short, short);
#define _setlogorg _setvieworg /* obsolescent */
struct xycoord _far _cdecl _getviewcoord(short, short);
#define _getlogcoord _getviewcoord /* obsolescent */
struct xycoord _far _cdecl _getphyscoord(short, short);
void _far _cdecl _setcliprgn(short, short, short, short);
void _far _cdecl _setviewport(short, short, short, short);
/* OUTPUT ROUTINES */
/* control parameters for _ellipse, _rectangle, _pie and _polygon */
#define _GBORDER 2 /* draw outline only */
#define _GFILLINTERIOR 3 /* fill using current fill mask */
/* parameters for _clearscreen */
#define _GCLEARSCREEN 0
#define _GVIEWPORT 1
#define _GWINDOW 2
void _far _cdecl _clearscreen(short);
struct xycoord _far _cdecl _moveto(short, short);
struct xycoord _far _cdecl _getcurrentposition(void);
short _far _cdecl _lineto(short, short);
short _far _cdecl _rectangle(short, short, short, short, short);
short _far _cdecl _polygon(short, const struct xycoord _far *, short);
short _far _cdecl _arc(short, short, short, short, short, short, short, short);
short _far _cdecl _ellipse(short, short, short, short, short);
short _far _cdecl _pie(short, short, short, short, short, short, short, short, short);
short _far _cdecl _getarcinfo(struct xycoord _far *, struct xycoord _far *, struct xycoord _far *);
short _far _cdecl _setpixel(short, short);
short _far _cdecl _getpixel(short, short);
short _far _cdecl _floodfill(short, short, short);
/* PEN COLOR, LINE STYLE, WRITE MODE, FILL PATTERN */
short _far _cdecl _setcolor(short);
short _far _cdecl _getcolor(void);
void _far _cdecl _setlinestyle(unsigned short);
unsigned short _far _cdecl _getlinestyle(void);
short _far _cdecl _setwritemode(short);
short _far _cdecl _getwritemode(void);
void _far _cdecl _setfillmask(const unsigned char _far *);
unsigned char _far * _far _cdecl _getfillmask(unsigned char _far *);
/* COLOR SELECTION */
long _far _cdecl _setbkcolor(long);
long _far _cdecl _getbkcolor(void);
long _far _cdecl _remappalette(short, long);
short _far _cdecl _remapallpalette(const long _far *);
short _far _cdecl _selectpalette(short);
/* TEXT */
/* parameters for _displaycursor */
#define _GCURSOROFF 0
#define _GCURSORON 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -