📄 metconst.h
字号:
/*************************************************************************/
/* */
/* Copyright (c) 1997 - 1999 Accelerated Technology, Inc. */
/* */
/* PROPRIETARY RIGHTS of Accelerated Technology are involved in the */
/* subject matter of this material. All manufacturing, reproduction, */
/* use, and sales rights pertaining to this subject matter are governed */
/* by the license agreement. The recipient of this software implicitly */
/* accepts the terms of the license. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* FILE NAME VERSION */
/* */
/* metconst.h 1.9 */
/* */
/* COMPONENT */
/* */
/* All */
/* */
/* DESCRIPTION */
/* */
/* This file contains the MetaWINDOW Structure Definitions. */
/* */
/* AUTHOR */
/* */
/* Robert G. Burrill, Accelerated Technology, Inc. */
/* */
/* DATA STRUCTURES */
/* */
/* None */
/* */
/* FUNCTIONS */
/* */
/* None */
/* */
/* DEPENDENCIES */
/* */
/* None */
/* */
/* HISTORY */
/* */
/* NAME DATE REMARKS */
/* */
/* */
/*************************************************************************/
typedef struct _point{ /* Point Data Structure */
short X; /* X coordinate */
short Y; /* Y coordinate */
} point;
typedef struct _lineS{ /* Line Data Structure */
point lStart; /* start point */
point lEnd; /* end point */
short flStat; /* first/last status */
} lineS;
typedef struct _rect{ /* Rectangle Data Structure */
short Xmin; /* minimum X */
short Ymin; /* minimum Y */
short Xmax; /* maximum X */
short Ymax; /* maximum Y */
} rect;
typedef struct _polyHead{ /* Polygon "header" structure */
word polyBgn; /* beginning index */
word polyEnd; /* ending index */
rect polyRect; /* boundry limits */
} polyHead;
typedef struct _palData{ /* Palette Data Struture */
word palRed; /* value for red gun */
word palGreen; /* value for green gun */
word palBlue; /* value for blue gun */
} palData;
typedef struct _imageHdr{ /*Image Header Data Structure */
short imWidth; /* Image pixel width (X) */
short imHeight; /* Image pixel height (Y) */
byte imAlign; /* Image alignment */
byte imFlags; /* Image flags */
short imBytes; /* Image bytes per row */
short imBits; /* Image bits per pixel */
short imPlanes; /* Image planes per pixel */
} imageHdr;
typedef struct _image{ /*Image Data Structure */
short imWidth; /* Image pixel width (X) */
short imHeight; /* Image pixel height (Y) */
byte imAlign; /* Image alignment */
byte imFlags; /* Image flags */
short imBytes; /* Image bytes per row */
short imBits; /* Image bits per pixel */
short imPlanes; /* Image planes per pixel */
byte imData[2048]; /* Image buffer */
} image;
/* imFlags - Bit Field Definitions */
#define imSpansSeg 0x01 /* 1 = imData spans 64K segment(s), 0 = doesn't */
#define im565 0x02 /* hicolor format 0 = 5:5:5, 1 = 5:6:5 */
typedef struct _pattern{ /* Pattern Image definition */
short patWidth; /* 8, 16 (or 32) */
short patHeight; /* 8, 16 or 32 */
byte patAlign; /* must be zero */
byte patFlags; /* pattern flags */
short patBytes; /* pattern bytes per row */
short patBits; /* value of 1,2,4 or 8 */
short patPlanes; /* value of 1 thru 32 */
byte patData[32]; /* pattern data bytes */
} pattern;
/* patFlags - Bit Field Definitions */
#define patBitSeq 0x80 /* Bit sequence - LtoR(0)/RtoL(1) */
typedef struct _patList{ /* Pattern List structure */
pattern *patPtr[32]; /* pointers to pattern images */
byte patAlignX[32]; /* pattern X alignments */
byte patAlignY[32]; /* pattern Y alignments */
} patList;
typedef struct _dashRcd{ /* Dash Info Data Record */
short dashSize; /* # of elements in dashList */
short dashRsvd; /* (reserved for future use) */
byte *dashList; /* ptr to list of on/off counts */
} dashRcd;
#define dashOnOff 0
#define dashDouble 1
typedef struct _region{ /* Region Data Structure */
long rgnAlloc; /* Space allocated for this record */
long rgnSize; /* Space used in this record */
short rgnFlags; /* Region Flags */
short rgnRsvd; /* (alignment/reserved for future use) */
rect rgnRect; /* Bounding limits of the region */
rect *rgnList; /* Ptr to first entry in list of Y|X-banded */
rect *rgnListEnd; /* Ptr to last entry in list of Y|X-banded */
} region;
#define rgnBOS -32768 /* Beginning-of-Scan delimiter (for
scanning backwards) */
#define rgnEOS 32767 /* End-of-Scan delimiter */
/* Region Flags */
#define rfRect 0x0001 /* region is rectangular(0)/non-
rectangular(1) */
#define rfNull 0x8000 /* region is non-empty(0)/empty(1) */
/* cap status codes */
#define NoSkip 0 /* draw the entire line */
#define SkipLast 1 /* don't draw the last point of the line */
#define SkipFirst -1 /* don't draw the first point of the line */
typedef struct _segPts /* (Poly-) Segment structure */
{short sX1; /* start X */
short sY1; /* start Y */
short sX2; /* end X */
short sY2; /* end Y */
short sCap; /* cap style */
} segPts;
#define convex 0
#define nonconvex 1
#define cmplx 2
#define coordModeOrigin 0
#define coordModePrevious 1
typedef struct _event{ /* Event record structure */
short evntTime; /* system time stamp */
byte evntType; /* type of event */
byte evntSource; /* source of event */
/* these can be defined by the particular device to be whatever */
short evntChar; /* KB Ascii char, where needed */
short evntScan; /* KB Scan code, where applicable */
short evntState; /* KB State info */
short evntButtons; /* mouse button status */
/* ----- */
short evntX; /* event xy position */
short evntY;
short evntUsr[2]; /* User defined (not used internally) */
} event;
typedef struct _mouseRcd{ /* Input device record */
event mrEvent; /* an event element */
short mrEventMask; /* this devices event types mask */
short mrFlags; /* device flags (opened signature) */
rect mrLimits; /* limit rectangle */
point mrScale; /* x,y scaling factors */
long mrInputMgr; /* vector to input manager */
long mrCallBack; /* call back to system event handler */
byte mrUsr[32]; /* used by input managers */
} mouseRcd;
/* bit field for evntType and event mask operations */
#define mPASS 0xff /* post any activity */
#define mPOS 0x01 /* post/is input device movement */
#define mPRESS 0x02 /* post/is button pressed */
#define mREL 0x04 /* post/is button release */
#define mKEYDN 0x08 /* post/is key down */
#define mKEYUP 0x10 /* post/is key up */
/* Flags signature */
#define mrOpenedSig 'MO'
/* Input manager function codes */
#define IMOPEN 0
#define IMCLOSE 1
#define IMLIMIT 2
#define IMSCALE 3
#define IMPOSN 4
#define IMQUERY 5
typedef struct _fixed{ /* Fixed point (integer.fraction) ***********/
short fr; /* whole number (int) portion */
short wh; /* fractional portion */
} fixed;
typedef struct _fxPoint{ /* Fixed Point Data Structure */
short fxX; /* fixed X coordinate */
short fxY; /* fixed Y coordinate */
} fxPoint;
typedef struct _fxLine{ /* Fixed Line Data Structure */
short fxP1; /* point 1 */
short fxP2; /* point 2 */
} fxLine;
/* EGA and VGA port Equates */
#define crtAddr 0xD4
#define miscAddr 0xC2
#define pelWrite 0xC8
#define graf1Addr 0xCC
#define graf2Addr 0xCA
#define grafAddr 0xCE
#define attrREAD 0xDA
#define attrWRITE 0xC0
#define seqAddr 0xC4
#define inStatus1 0xDA
#define egaSqncr 0x3C4
#define egaSqncrLo 0xC4
#define sMapMask 0x02
#define egaCntlr 0x3CE
#define egaCntlrLo 0xCE
#define gSetReset 0x00
#define gEnableSR 0x01
#define gColorCompare 0x02
#define gDataRot 0x03
#define egaREP 0x0000
#define egaAND 0x0800
#define egaOR 0x1000
#define egaXOR 0x1800
#define gReadMap 0x04
#define gMode 0x05
#define egaWrite0 0x0000
#define egaWrite1 0x0100
#define egaWrite2 0x0200
#define egaWrite3 0x0300
#define egaRead0 0x0000
#define egaRead1 0x0800
#define gColorDontCare 0x07
#define gBitMask 0x08
/* OS dependent defines - DOS */
#define VIDINT 0x10
#define DOSINT 0x21
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -