
*
	Graphics.edf

	Graphics library procedures and structures

	History:
		??????			TM  Added Conditionals, Updated to include all
							Graphics Manual Calls.
		101584			CFM  Added erc equates, misc literals from internal.
		8785			CFM  Updated for newest calls, brought together all
							versions.
		071389			MDE  Added ObjDescWLfas to allow storing DWORDS in
					      POINTER fields (on disk only)
*

* General literals *
DECLARE
	barSignature					LITERALLY '0',
	pieSignature					LITERALLY '1',
	lineSignature					LITERALLY '2',
	lineAlphaSignature					LITERALLY '3',
	lPicObject					LITERALLY '257',
	lVDMObject					LITERALLY '263';
	

* display list entry literals *
	* (NOTE: THESE VALUES ARE USED IN PLM CASE STATEMENTS,
											DO NOT CHANGE THEIR VALUES *
DECLARE
	entryMove					LITERALLY '0',
	entryDraw					LITERALLY '1',
	entrySetVectorMode					LITERALLY '2',
	entrySetLineType					LITERALLY '3',
	entryTextString					LITERALLY '4',
	entrySetFont					LITERALLY '5',
	entrySetLorg					LITERALLY '6',
	entrySetCSize					LITERALLY '7',
	entrySetColor					LITERALLY '8',
	entryFillRectangle					LITERALLY '9',
	entryFillPolygon					LITERALLY '10',
	entryEraseRectangle					LITERALLY '11',
	entryNOP 					LITERALLY '12',
	entryPolyline					LITERALLY '13',
	entrySetCScale					LITERALLY '14',
	entryExtend					LITERALLY '15',
	lnEntries					LITERALLY '16';
 

* Application data literals (BGP) *
DECLARE
	mainMessage					LITERALLY '0',
	objMessage					LITERALLY '1',
	scaleMessage					LITERALLY '2',
	textMessage					LITERALLY '3',
	zoomMessage					LITERALLY '4',
	patternMessage					LITERALLY '5',
	autoSortMessage					LITERALLY '6',
	barMessage					LITERALLY '7',
	lineMessage					LITERALLY '8',
	mainMessageAws					LITERALLY '9',
	paletteMessage					LITERALLY '10',
	paletteModMessage					LITERALLY '11',
	hardcopyMessage					LITERALLY '12';


* erc literals *
DECLARE
	ercNoGraphicsAvailable							LITERALLY '7600',
	ercGraphicsNotInitialized							LITERALLY '7601',
	ercInternalGraphicsError							LITERALLY '7602',
	ercRasterOpsNotAvailable							LITERALLY '7603',
	ercNotSupported							LITERALLY '7603',
	ercBadFillAlgorithm 							LITERALLY '7604',

	ercPictureNotOpen							LITERALLY '7610',
	ercPictureAlreadyOpen							LITERALLY '7611',
	ercPictureIsReadOnly							LITERALLY '7612',
	ercBadPictureSignature							LITERALLY '7613',
	ercBadPictureFile							LITERALLY '7614',

	ercObjectNotOpen							LITERALLY '7620',
	ercObjectAlreadyOpen							LITERALLY '7621',
	ercBadObjectSpec							LITERALLY '7622',
	ercMustCloseObject							LITERALLY '7623',
	ercObjectNotTemporary							LITERALLY '7624',
	ercOpenObjectTemporary							LITERALLY '7625',
	ercObjectIsReadOnly							LITERALLY '7626',
	ercObjectNotWriteMode							LITERALLY '7627',
	ercEndOfObjects							LITERALLY '7628',
	ercCantOpenTempObject							LITERALLY '7629',
	ercBadObjectBounds 							LITERALLY '7630',

	ercNoLabelOpen							LITERALLY '7640',
	ercEndOfLabelList							LITERALLY '7641',
	ercBadFontName							LITERALLY '7642',
	ercBadLorg							LITERALLY '7643',
	ercCharOutOfBounds							LITERALLY '7644',
	ercBadLabel						    	LITERALLY '7645',
	ercBadParameters							LITERALLY '7646',
	ercBadTransformationParameter LITERALLY '7647',
	ercBadPolygon							LITERALLY '7648',
	ercInsufficientMemory 							LITERALLY '7649',
	ercInterruptedOnKey							LITERALLY '7650',

	ercBadIcon							LITERALLY '7654',

	ercPictureStatusWarning							LITERALLY '7667',
	ercInvalidPlane							LITERALLY '7668',
	ercInvalidOpcode							LITERALLY '7669',

	ercFormatAndDataInconsistent							 LITERALLY '7670',
	ercTooManyBarLegends							LITERALLY '7671',
	ercTooManyValsPerLegend							LITERALLY '7672',
	ercTooManyPieSegments							LITERALLY '7673',
	ercTooManyLineLegends							LITERALLY '7674',
	ercNegativeNumberInPie							LITERALLY '7675',
	ercBadPaletteSignature							LITERALLY '7676',
	ercOnlyOneValueForLine							LITERALLY '7677',
	ercBadMsgType							LITERALLY '7678',

	ercBadPrinterSpecification							LITERALLY '7690',
	ercBadFontSpecification							LITERALLY '7691',
	ercStandardFontNotSpecified							LITERALLY '7692',
	ercBadOutputDevice							LITERALLY '7693',
	ercOddVDMParameterCount							LITERALLY '7694',
	ercInvalidVDMOpcode							LITERALLY '7695',
	ercBadVDMCount							LITERALLY '7696';


* Literals tied to Procedure calls *

* SetDrawingMode types *
DECLARE
	modeSet				LITERALLY '0',
	modeClear				LITERALLY '1',
	modeComplement				LITERALLY '2',
	modeReplace				LITERALLY '3';


* SetLineType types *
Declare
	LineSolid				LITERALLY '0',
	LineDashDash				LITERALLY '1',
	LineDash				LITERALLY '2',
	LineDot				LITERALLY '3',
	LineBlank				LITERALLY '4',
	LineBlankBlank				LITERALLY '5',
	DashedLine				LITERALLY '6',
	DottedLine				LITERALLY '7',
	BlankLine				LITERALLY '8',
	lnLineTypes				LITERALLY '9';


* Fill Types *
DECLARE
	lFilled 					LITERALLY '0',
	lNoFill					LITERALLY '1',
	lWideHatch 					LITERALLY '2',
	lWideDoubleHatch					LITERALLY '3',
	lNarrowHatch					LITERALLY '4',
	lNarrowDoubleHatch					LITERALLY '5',
	lEmpty					LITERALLY '6',
	lHalfTone					LITERALLY '7',
	lAltHalfTone					LITERALLY '8',
	lQuarterTone					LITERALLY '9',
	lAltQuarterTone					LITERALLY '10',
	lSmallWeave					LITERALLY '11',
	lColorToneStart					LITERALLY '12',
	lColorTone0					LITERALLY '12',
	lColorTone1					LITERALLY '13',
	lColorTone2					LITERALLY '14',
	lColorTone3					LITERALLY '15',
	lColorTone4					LITERALLY '16',
	lColorTone5					LITERALLY '17',
	lColorTone6					LITERALLY '18',
	lColorTone7					LITERALLY '19',
	lColorTone8					LITERALLY '20',
	lColorTone9					LITERALLY '21',
	lColorTone10					LITERALLY '22',
	lColorTone11					LITERALLY '23',
	lColorTone12					LITERALLY '24',
	lColorTone13					LITERALLY '25',
	lColorTone14					LITERALLY '26',
	lColorTone15					LITERALLY '27',
	lExtraHatch					LITERALLY '28',
	lExtraDoubleHatch					LITERALLY '29',
	lPlotterHatch					LITERALLY '30',
	lPlotterDoubleHatch					LITERALLY '31',
	lnFillTypes					LITERALLY '32';


* RasterOp combine forms *
DECLARE
	rSrcIsSrc			LITERALLY '0',
	rSrcIsPat			LITERALLY '1',
	rSrcOrPat			LITERALLY '3',
	rDstIsSrc			LITERALLY '0',
	rDstAndSrc			LITERALLY '1',
	rDstOrSrc			LITERALLY '2',
	rDstXorSrc			LITERALLY '3';


* Raster planes *
DECLARE
	RasPlane0			LITERALLY '1',
	RasPlane1			LITERALLY '2',
	RasPlane2			LITERALLY '4',
	RasPlaneAll			LITERALLY '8';


* SetOutputDevice legal devices *
DECLARE
	deviceScreen					LITERALLY '0',
	devicePlotter					LITERALLY '1',
	devicePrinter					LITERALLY '2',
	deviceNull					LITERALLY '3';


* SetPlotterMaterial types *
Declare
	PaperPlotMaterial LITERALLY '0',
	TransPlotMaterial LITERALLY '1';


* Cursor directions *
Declare
	DirUp			LITERALLY '0',
	DirDown			LITERALLY '1',
	DirRight			LITERALLY '2',
	DirLeft			LITERALLY '3';


* IWS SetCommandScreen and SetVisibleScreen types *
Declare
	IWSFirstPlane				LITERALLY '0',
	IWSSecondPlane				LITERALLY '1';

* viewport value types *
DECLARE
	lNDC				LITERALLY '0',
	lMillimeters				LITERALLY '1',
	lDeviceUnits				LITERALLY '2';


* Graphics Structures *

$SAVE NOLIST
$IF RasterInfo OR GetRasterInfo
$RESTORE

DECLARE
	rasterInfoType					LITERALLY 'STRUCTURE(
		pPlane0					POINTER,
		pPlane1					POINTER,
		pPlane2					POINTER,
		wBytesPerLine					WORD,
		xWidth					WORD,
		yHeight					WORD)';

$SAVE NOLIST
$ENDIF

$IF LabelEntry
$RESTORE

DECLARE sLabelEntryOvh LITERALLY '52';
DECLARE LabelEntryTypeA LITERALLY '
	x WORD,
	y WORD,
	sChars WORD,
	xLow WORD,
	yLow WORD,
	xHigh WORD,
	yHigh WORD,
	bLorg BYTE,
	bPen BYTE,
	userID BYTE,
	fPositionSet BYTE';

DECLARE LabelEntryTypeB LITERALLY '
	cbFontName BYTE,
	rgbFontName (12) BYTE,
	bUserFlag BYTE,
	bEditFlag BYTE,
	dxCScale DWORD,
	dyCScale DWORD,
	fFixedScale BYTE,
	iTheta WORD,
	rgbReserved (3) BYTE,
	pExtensions POINTER,
	cbLabel BYTE,
	rgbLabel (1) BYTE';

DECLARE LabelEntryType LITERALLY
 'STRUCTURE (LabelEntryTypeA, LabelEntryTypeB)';

DECLARE sUserLabelEntryOvh LITERALLY '66';

DECLARE UserLabelEntryTypeA LITERALLY '
	x QUAD,
	y QUAD,
	xLow QUAD,
	yLow QUAD,
	xHigh QUAD,
	yHigh QUAD,
	sChars QUAD,
	bLorg BYTE,
	bPen BYTE,
 	userID BYTE,
	fPositionSet BYTE';

DECLARE UserLabelEntryTypeB LITERALLY '
	cbFontName BYTE,
	rgbFontName (12) BYTE,
	bUserFlag BYTE,
	bEditFlag BYTE,
	rHeight QUAD,
	rExpFac QUAD,
	fFixedScale BYTE,
	iTheta WORD,
	rgbR (3) BYTE,
	pE POINTER,
	cbLabel BYTE,
	rgbLabel (1) BYTE';

DECLARE UserLabelEntryType LITERALLY
 'STRUCTURE (UserLabelEntryTypeA, UserLabelEntryTypeB)';

$SAVE NOLIST
$ENDIF

DECLARE
	sObjDescriptor				LITERALLY '139',
	sRestFromSx				LITERALLY '90';

DECLARE ObjDescriptorType1stHalf LITERALLY '
	sbObjName						(13) BYTE,
	lfapVectorList						POINTER,
	qsVectorMemoryUsed						DWORD,
	qsVectorMemoryMax						DWORD,
	lfapLabelList						POINTER,
	sLabelMemoryUsed						WORD,
	sLabelMemoryMax						WORD';

DECLARE ObjDescriptorType2ndHalf LITERALLY '
	lfapUserData						POINTER,
	sUDMemoryUsed						WORD,
	sUDMemoryMax						WORD,
	lfapFormatData						POINTER,
	sFormatMemoryUsed						WORD,
	sFormatMemoryMax						WORD';

DECLARE ObjDescriptorType3rdHalf LITERALLY '
	sx						QUAD,
	sy						QUAD,
	tx						QUAD,
	ty						QUAD,
	sxFast						WORD,
	syFast						WORD,
	sxFastReal						QUAD,
	syFastReal						QUAD';

DECLARE ObjDescriptorType4thHalf LITERALLY '
	txFast						WORD,
	tyFast						WORD,
	txFastReal						QUAD,
	tyFastReal						QUAD,
	fSxFastIsOne						BYTE,
	fSyFastIsOne						BYTE,
	xClipWindowLow						WORD,
	yClipWindowLow						WORD,
	xClipWindowHigh						WORD,
	yClipWindowHigh						WORD';

DECLARE ObjDescriptorType5thHalf LITERALLY '
	xClipWindowLowReal						QUAD,
	yClipWindowLowReal						QUAD,
	xClipWindowHighReal						QUAD,
	yClipWindowHighReal						QUAD,
	xLowState						BYTE,
	yLowState						BYTE,
	xHighState						BYTE,
	yHighState						BYTE';

DECLARE ObjDescriptorType6thHalf LITERALLY '
	rgbReserved						(16) BYTE,
	pExtensions						POINTER';

DECLARE ObjDescriptorType LITERALLY 'STRUCTURE(
	ObjDescriptorType1stHalf, ObjDescriptorType2ndHalf,
	ObjDescriptorType3rdHalf, ObjDescriptorType4thHalf,
	ObjDescriptorType5thHalf, ObjDescriptorType6thHalf)';


DECLARE ObjDescWLfasType1stHalf LITERALLY '
	sbObjName						(13) BYTE,
	lfaVectorList						LfaType,
	qsVectorMemoryUsed						DWORD,
	qsVectorMemoryMax						DWORD,
	lfaLabelList						LfaType,
	sLabelMemoryUsed						WORD,
	sLabelMemoryMax						WORD';

DECLARE ObjDescWLfasType2ndHalf LITERALLY '
	lfaUserData						LfaType,
	sUDMemoryUsed						WORD,
	sUDMemoryMax						WORD,
	lfaFormatData						LfaType,
	sFormatMemoryUsed						WORD,
	sFormatMemoryMax						WORD';

DECLARE ObjDescWLfasType LITERALLY 'STRUCTURE(
	ObjDescWLfasType1stHalf, ObjDescWLfasType2ndHalf,
	ObjDescriptorType3rdHalf, ObjDescriptorType4thHalf,
	ObjDescriptorType5thHalf, ObjDescriptorType6thHalf)';


DECLARE
	cbPictureOvh 					LITERALLY '36',
	lolfaRasterImage					LITERALLY '24',
	lolfaExtension					LITERALLY '32',
	cbFontListOvh					LITERALLY '25';

* rgObjDescriptors is really ObjDescriptorType *
DECLARE PictureFileHeaderType1stHalf LITERALLY '
	TSSignature						WORD,
	sMemoryUsed						WORD,
	sMemoryMax						WORD,
	nObjects						WORD,
	lfapFontList						POINTER,
	sFontListMemoryUsed						WORD,
	sFontListMemoryMax						WORD,
	rgbPalette						(8) BYTE';

DECLARE PictureFileHeaderType2ndHalf LITERALLY '
	lfaRasterImage						POINTER,
	dsRasterImage						DWORD,
	lfaExtensions						DWORD,
	rgObjDescriptors						(1) BYTE';

DECLARE PictureFileHeaderType LITERALLY 'STRUCTURE(
	PictureFileHeaderType1stHalf, PictureFileHeaderType2ndHalf)';


DECLARE
	sFontListEntry					LITERALLY '25';

DECLARE
	FontListEntryType					LITERALLY 'STRUCTURE(
		pIndex					POINTER,
		pCoord					POINTER,
		cbName					BYTE,
		rgbName					(12) BYTE,
		pExtensions					POINTER)';


* Polyline header *
DECLARE
	PolylineHeaderType					LITERALLY 'STRUCTURE(
		wIdentifier					WORD,
		nPoints					WORD,
		bPen					BYTE,
		bLineType					BYTE,
		bFillPattern					BYTE,
		bEdit					BYTE)',
	lcwPolylineHeader					LITERALLY '4';


* Extend entry type *
DECLARE
	ExtendEntryType					LITERALLY 'STRUCTURE(
		wIdentifier					WORD,
		pExtension					POINTER,
		sExtension					WORD)',
	lsExtendEntry						LITERALLY '8';


*    DEVICE INDEPENDENT SECTION    *

* Initialization and miscellaneous procedures *

$IF InitGraphics
$RESTORE
InitGraphics: procedure erctype external;
end InitGraphics;
$SAVE NOLIST
$ENDIF

$IF gfx_Initialize
$RESTORE
gfx_Initialize: procedure (pHeap, cparaHeap) erctype external;
	declare pHeap pointer, cParaHeap word;
end gfx_Initialize;
$SAVE NOLIST
$ENDIF

$IF SetOutputType
$RESTORE
SetOutputType: procedure (iOutputType) erctype external;
	declare iOutputType integer;
end SetOutputType;
$SAVE NOLIST
$ENDIF

$IF SetPlotterDevice
$RESTORE
SetPlotterDevice: procedure (pbDevName, cbDevName) erctype external;
	declare
		 pbDevName pointer
		,cbDevName word;
end SetPlotterDevice;
$SAVE NOLIST
$ENDIF

$IF SetPlotterMaterial
$RESTORE
SetPlotterMaterial: procedure (iMaterial) erctype external;
	declare
		iMaterial word;
end SetPlotterMaterial;
$SAVE NOLIST
$ENDIF

$IF SetUserCoordinates
$RESTORE
SetUserCoordinates: procedure (rXMin, rYMin, rXMax, rYMax) erctype external;
	declare (rXMin, rYMin, rXMax, rYMax) quad;
end SetUserCoordinates;
$SAVE NOLIST
$ENDIF

$IF SetLimits
$RESTORE
SetLimits: procedure (rXMin, rYMin, rXMax, rYMax) erctype external;
	declare (rXMin, rYMin, rXMax, rYMax) quad;
end SetLimits;
$SAVE NOLIST
$ENDIF

$IF gfx_GetObjectFonts
$RESTORE
gfx_GetObjectFonts: procedure (pbValidFontList, sValidFontListMax,
								pnValidFonts,
								pbForeignFontList, sForeignFontListMax,
								pnForeignFonts)
					erctype external;
DECLARE
	pbValidFontList					POINTER,
	sValidFontListMax					DWORD,
	pnValidFonts					POINTER,
	pbForeignFontList					POINTER,
	sForeignFontListMax					DWORD,
	pnForeignFonts					POINTER;
end gfx_GetObjectFonts;
$SAVE NOLIST
$ENDIF

$IF gfx_GetObjectBounds
$RESTORE
gfx_GetObjectBounds: procedure (pwXMin, pwYMin, pwXMax, pwYMax) erctype external;
	declare (pwXMin, pwYMin, pwXMax, pwYMax) POINTER;
end gfx_GetObjectBounds;
$SAVE NOLIST
$ENDIF

$IF gfx_GetDObjectBounds
$RESTORE
gfx_GetDObjectBounds: procedure (pdiXMin, pdiYMin, pdiXMax, pdiYMax) erctype external;
	declare (pdiXMin, pdiYMin, pdiXMax, pdiYMax) POINTER;
end gfx_GetDObjectBounds;
$SAVE NOLIST
$ENDIF

$IF GetObjectBounds
$RESTORE
GetObjectBounds: procedure (prXMin, prYMin, prXMax, prYMax) erctype external;
	declare (prXMin, prYMin, prXMax, prYMax) POINTER;
end GetObjectBounds;
$SAVE NOLIST
$ENDIF

$IF GetPictureBounds
$RESTORE
GetPictureBounds: procedure (prXMin, prYMin, prXMax, prYMax) erctype external;
	declare (prXMin, prYMin, prXMax, prYMax) POINTER;
end GetPictureBounds;
$SAVE NOLIST
$ENDIF

$IF SetOutputDevice
$RESTORE
SetOutputDevice: procedure (wDevice) erctype external;
	declare wDevice word;
end SetOutputDevice;
$SAVE NOLIST
$ENDIF

$IF gfx_SetMultiPass
$RESTORE
gfx_SetMultiPass: procedure (fMultiPass) erctype external;
	declare fMultiPass Flag;
end gfx_SetMultiPass;
$SAVE NOLIST
$ENDIF

$IF ClearViewPort
$RESTORE
ClearViewPort: procedure erctype external;
end ClearViewPort;
$SAVE NOLIST
$ENDIF


* Font Primitives *

$IF GetFontName
$RESTORE
GetFontName: procedure (iFont, pPbFontName, pCbFontName) erctype external;
	declare
		 iFont word
		,pPbFontName pointer
		,pCbFontName pointer;
end GetFontName;
$SAVE NOLIST
$ENDIF

$IF GetFontNumber
$RESTORE
GetFontNumber: procedure (pbFontName, cbFontName, piFontRet) erctype external;
	declare
		 pbFontName pointer
		,cbFontName word
		,piFontRet pointer;
end GetFontNumber;
$SAVE NOLIST
$ENDIF

$IF GetNumberOfFonts
$RESTORE
GetNumberOfFonts: procedure (pnFontsRet) erctype external;
	declare
		pnFontsRet pointer;
end GetNumberOfFonts;
$SAVE NOLIST
$ENDIF

$IF GetUserFontName
$RESTORE
GetUserFontName: procedure (iFont, pPbFontName, pCbFontName) erctype external;
	declare
		 iFont word
		,pPbFontName pointer
		,pCbFontName pointer;
end GetUserFontName;
$SAVE NOLIST
$ENDIF

$IF SetUserFont
$RESTORE
SetUserFont: PROCEDURE (pbFontName, cbFontName) erctype external;
	declare
		 pbFontName pointer
		,cbFontName word;
end SetUserFont;
$SAVE NOLIST
$ENDIF

$IF gfx_QueryFontSize
$RESTORE
gfx_QueryFontSize: procedure (pbFontName, cbFontName,
								pdSizeRet, pfResidentRet) erctype external;
declare
	pbFontName				pointer,
	cbFontName				word,
	pdSizeRet				pointer,
	pfResidentRet				pointer;
end gfx_QueryFontSize;
$SAVE NOLIST
$ENDIF


* Picture Primitives (Byte Stream) *

$IF OpenPicture
$RESTORE
OpenPicture: procedure (pbPictureName, cbPictureName, pbPassword,
						cbPassword, wMode, pMemory, sMemory) erctype
						external;
	declare pbPictureName pointer,
			cbPictureName word,
			pbPassword pointer,
			cbPassword word,
			wMode word,
			pMemory pointer,
			sMemory word;
end OpenPicture;
$SAVE NOLIST
$ENDIF

$IF ReadPicFile
$RESTORE
ReadPicFile: procedure (pBSRead, lfaRead, dlfaRead, wMode,
						pMemory, sMemory) erctype
						external;
	declare
			pBSRead pointer,
			lfaRead lfaType,
			dlfaRead lfaType,
			wMode word,
			pMemory pointer,
			sMemory word;
end ReadPicFile;
$SAVE NOLIST
$ENDIF

$IF WriteFormatFile
$RESTORE
WriteFormatFile: procedure (pbName, cbName) erctype external;
	declare pbName pointer,
			cbName word;
end WriteFormatFile;
$SAVE NOLIST
$ENDIF

$IF WritePicture
$RESTORE
WritePicture: procedure (pbPictureName, cbPictureName) erctype external;
	declare pbPictureName pointer,
			cbPictureName word;
end WritePicture;
$SAVE NOLIST
$ENDIF

$IF WritePicFile
$RESTORE
WritePicFile: procedure (pBSWrite, plfaWrite, pdlfaWrite) erctype external;
DECLARE
	pBSWrite				POINTER,
	plfaWrite				POINTER,
	pdlfaWrite				POINTER;
end WritePicFile;
$SAVE NOLIST
$ENDIF

$IF WriteVDM
$RESTORE
WriteVDM: procedure (pBSWrite, plfaWrite, pdlfaWrite) erctype external;
DECLARE
	pBSWrite				POINTER,
	plfaWrite				POINTER,
	pdlfaWrite				POINTER;
end WriteVDM;
$SAVE NOLIST
$ENDIF

$IF ClosePicture
$RESTORE
ClosePicture: procedure (fSave) erctype external;
	declare fSave byte;
end ClosePicture;
$SAVE NOLIST
$ENDIF

$IF AddPicture
$RESTORE
AddPicture: procedure (pbPictureName, cbPictureName, fOverwritePalette)
erctype external;
	declare pbPictureName pointer,
			cbPictureName word,
			fOverwritePalette byte;
end AddPicture;
$SAVE NOLIST
$ENDIF

$IF AddPicFile
$RESTORE
AddPicFile: procedure (pBSRead, lfaRead, fOverwritePalette)
erctype external;
DECLARE
	pBSRead					POINTER,
	lfaRead					lfaType,
	fOverwritePalette					BYTE;
end AddPicFile;
$SAVE NOLIST
$ENDIF

$IF DisplayPicture
$RESTORE
DisplayPicture: procedure(fInterruptOnKey) erctype external;
	declare fInterruptOnKey flag;
end DisplayPicture;
$SAVE NOLIST
$ENDIF

$IF gfx_DisplayObjectList
$RESTORE
gfx_DisplayObjectList: procedure(fInterruptOnKey, nObjects) erctype
						external;
	declare fInterruptOnKey flag, nObjects word;
end gfx_DisplayObjectList;
$SAVE NOLIST
$ENDIF

$IF GetNumberOfObjects
$RESTORE
GetNumberOfObjects: procedure (pNObjectsRet) erctype external;
	declare pNObjectsRet pointer;
end GetNumberOfObjects;
$SAVE NOLIST
$ENDIF

$IF gfx_GetObjectNumber
$RESTORE
gfx_GetObjectNumber: procedure (pnObjectRet) erctype external;
	declare pnObjectRet pointer;
end gfx_GetObjectNumber;
$SAVE NOLIST
$ENDIF

$IF gfx_GetPictureStatus
$RESTORE
gfx_GetPictureStatus: procedure (pwStatusRet) erctype external;

declare
	pwStatusRet				pointer,
	lCantFill				LITERALLY '1',
	lMissingFont				LITERALLY '2';
end gfx_GetPictureStatus;
$SAVE NOLIST
$ENDIF

$IF gfx_SetPicObjectType
$RESTORE
gfx_SetPicObjectType: PROCEDURE (prgbInputFile, cbInputFile) ErcType
						EXTERNAL;
DECLARE
	prgbInputFile				POINTER,			* points to filename of file to set *
	cbInputFile				WORD;			* length of filename *
end gfx_SetPicObjectType;
$SAVE NOLIST
$ENDIF

$IF gfx_SetCgmObjectType
$RESTORE
gfx_SetCgmObjectType: PROCEDURE (prgbInputFile, cbInputFile) ErcType
						EXTERNAL;
DECLARE
	prgbInputFile				POINTER,			* points to filename of file to set *
	cbInputFile				WORD;			* length of filename *
end gfx_SetCgmObjectType;
$SAVE NOLIST
$ENDIF


* Picture Primitives (File Handle) *

$IF gfx_ReadPic
$RESTORE
gfx_ReadPic: procedure (fhRead, lfaRead, dlfaRead, pHeap, sParaHeap, wMode)
				erctype external;
	declare
			fhRead word,
			lfaRead lfaType,
			dlfaRead dword,
			pHeap pointer,
			sParaHeap word,
			wMode word;
end gfx_ReadPic;
$SAVE NOLIST
$ENDIF

$IF gfx_CreatePic
$RESTORE
gfx_CreatePic: procedure (pHeap, sParaHeap)erctype external;
	declare
			pHeap pointer,
			sParaHeap word;
end gfx_CreatePic;
$SAVE NOLIST
$ENDIF

$IF gfx_ClearPic
$RESTORE
gfx_ClearPic: procedure erctype external;
end gfx_ClearPic;
$SAVE NOLIST
$ENDIF

$IF gfx_SetPicMode
$RESTORE
gfx_SetPicMode: procedure (mode) erctype external;
	declare mode word;
end gfx_SetPicMode;
$SAVE NOLIST
$ENDIF

$IF gfx_AddPic
$RESTORE
gfx_AddPic: procedure (fhRead, lfaRead, dlfaRead, fOverwritePalette)
erctype external;
DECLARE
	fhRead					WORD,
	lfaRead					lfaType,
	dlfaRead					dword,
	fOverwritePalette					BYTE;
end gfx_AddPic;
$SAVE NOLIST
$ENDIF

$IF gfx_AddPicWithExt
$RESTORE
gfx_AddPicWithExt: procedure (fhRead, lfaRead, dlfaRead, fOverwritePalette,
							pExt, sExtMax, psExtRet) erctype external;
DECLARE
	fhRead					WORD,
	lfaRead					lfaType,
	dlfaRead					dword,
	fOverwritePalette					BYTE,
	pExt					POINTER,
	sExtMax					WORD,
	psExtRet					POINTER;
end gfx_AddPicWithExt;
$SAVE NOLIST
$ENDIF

$IF gfx_GetPicExt
$RESTORE
gfx_GetPicExt: procedure (fhRead, lfaRead, dlfaRead,
							pExt, sExtMax, psExtRet) erctype external;
DECLARE
	fhRead					WORD,
	lfaRead					lfaType,
	dlfaRead					dword,
	pExt					POINTER,
	sExtMax					WORD,
	psExtRet					POINTER;
end gfx_GetPicExt;
$SAVE NOLIST
$ENDIF

$IF gfx_SetRasterImage
$RESTORE
gfx_SetRasterImage: procedure (fhWrite, lfaWrite, dlfaWrite, lfaRas,
												dlfaRas) erctype external;
DECLARE
	fhWrite				WORD,
	lfaWrite				lfaType,
	dlfaWrite				DWORD,
	lfaRas				lfaType,
	dlfaRas				DWORD;
end gfx_SetRasterImage;
$SAVE NOLIST
$ENDIF

$IF gfx_GetRasterImage
$RESTORE
gfx_GetRasterImage: procedure (fhRead, lfaRead, dlfaRead, plfaRas,
												pdlfaRas) erctype external;
DECLARE
	fhRead				WORD,
	lfaRead				lfaType,
	dlfaRead				DWORD,
	plfaRas				POINTER,
	pdlfaRas				POINTER;
end gfx_GetRasterImage;
$SAVE NOLIST
$ENDIF

$IF gfx_WritePic
$RESTORE
gfx_WritePic: procedure (fhWrite, plfaWrite, pdlfaWrite) erctype external;
DECLARE
	fhWrite				WORD,
	plfaWrite				POINTER,
	pdlfaWrite				POINTER;
end gfx_WritePic;
$SAVE NOLIST
$ENDIF

$IF gfx_WritePicObjectList
$RESTORE
gfx_WritePicObjectList: procedure (fhWrite, plfaWrite, pdlfaWrite,
								nObjects, pExt, sExt) erctype external;
DECLARE
	fhWrite				WORD,
	plfaWrite				POINTER,
	pdlfaWrite				POINTER,
	nObjects				WORD,
	pExt				POINTER,
	sExt				WORD;
end gfx_WritePicObjectList;
$SAVE NOLIST
$ENDIF

$IF gfx_WriteCGM
$RESTORE
gfx_WriteCGM: procedure (fhWrite, plfaWrite, pdlfaWrite) erctype external;
DECLARE
	fhWrite				WORD,
	plfaWrite				POINTER,
	pdlfaWrite				POINTER;
end gfx_WriteCGM;
$SAVE NOLIST
$ENDIF

$IF gfx_WriteCGMObjectList
$RESTORE
gfx_WriteCGMObjectList: procedure (fhWrite, plfaWrite, pdlfaWrite,
												nObjects) erctype external;
DECLARE
	fhWrite				WORD,
	plfaWrite				POINTER,
	pdlfaWrite				POINTER,
	nObjects				WORD;
end gfx_WriteCGMObjectList;
$SAVE NOLIST
$ENDIF


* Drawing Primitives (Integer VDC) *

$IF Gfx_GenEllipse
$RESTORE
Gfx_GenEllipse: procedure (wxCenter, wyCenter, x1, y1, x2, y2, nPoints, pMem) erctype external;
	declare (wxCenter, wyCenter, x1, y1, x2, y2, nPoints) WORD,
			pMem pointer;
end Gfx_GenEllipse;
$SAVE NOLIST
$ENDIF

$IF Gfx_GenArc
$RESTORE
Gfx_GenArc: procedure (wxCenter, wyCenter, x1, y1, x2, y2, 
			wThetaStart, wThetaEnd, nPoints, pPointsRet) erctype external;
	declare (wxCenter, wyCenter, x1, y1, x2, y2, 
				wThetaStart, wThetaEnd, nPoints) WORD,
			pPointsRet pointer;
end Gfx_GenArc;
$SAVE NOLIST
$ENDIF

$IF Gfx_ResolvePolyline
$RESTORE
Gfx_ResolvePolyline: PROCEDURE(pPoints, pnPoints, wResolution) ercType
					EXTERNAL;
DECLARE
	pPoints					POINTER,
	pnPoints					POINTER,
	wResolution					WORD;
END Gfx_ResolvePolyline;
$SAVE NOLIST
$ENDIF

$IF Gfx_PointDeviceToNDC
$RESTORE
Gfx_PointDeviceToNDC: PROCEDURE(pwx, pwy) EXTERNAL;
DECLARE
	pwx					POINTER,
	pwy					POINTER;
END Gfx_PointDeviceToNDC;
$SAVE NOLIST
$ENDIF

$IF Gfx_ListDeviceToNDC
$RESTORE
Gfx_ListDeviceToNDC: PROCEDURE(pPoints, nPoints) EXTERNAL;
DECLARE
	pPoints					POINTER,
	nPoints					WORD;
END Gfx_ListDeviceToNDC;
$SAVE NOLIST
$ENDIF

$IF Gfx_DisplayPoly
$RESTORE
Gfx_DisplayPoly: PROCEDURE(pPoly, cbPoly) ercType EXTERNAL;
DECLARE
	pPoly					POINTER,
	cbPoly					WORD;
END Gfx_DisplayPoly;
$SAVE NOLIST
$ENDIF

$IF Gfx_FillPolygon
$RESTORE
Gfx_FillPolygon: PROCEDURE(pPoints, nPoints, bFillType) ercType EXTERNAL;
DECLARE
	pPoints			POINTER,
	nPoints			WORD,
	bFillType			BYTE;
END Gfx_FillPolygon;
$SAVE NOLIST
$ENDIF

$IF Gfx_DrawPolyline
$RESTORE
Gfx_DrawPolyline: PROCEDURE(pPoints, nPoints, fClose) ercType EXTERNAL;
DECLARE
	pPoints			POINTER,
	nPoints			WORD,
	fClose			FLAG;
END Gfx_DrawPolyline;
$SAVE NOLIST
$ENDIF

$IF gfx_DrawLine
$RESTORE
gfx_DrawLine: procedure (wX1, wY1, wX2, wY2) ercType external;
	declare
		 wX1 word
		,wY1 word
		,wX2 word
		,wY2 word;
end gfx_DrawLine;
$SAVE NOLIST
$ENDIF

$IF gfx_DrawClippedLine
$RESTORE
gfx_DrawClippedLine: procedure (wX1, wY1, wX2, wY2) ercType external;
	declare
		 wX1 word
		,wY1 word
		,wX2 word
		,wY2 word;
end gfx_DrawClippedLine;
$SAVE NOLIST
$ENDIF

$IF gfx_Clip
$RESTORE
gfx_Clip: procedure (pwX1, pwY1, pwX2, pwY2) FLAG external;
	declare
		 pwX1 pointer
		,pwY1 pointer
		,pwX2 pointer
		,pwY2 pointer;
end gfx_Clip;
$SAVE NOLIST
$ENDIF

$IF gfx_ClipToRegion
$RESTORE
gfx_ClipToRegion: procedure (pwX1, pwY1, pwX2, pwY2) FLAG external;
declare
	pwX1		pointer,
	pwY1		pointer,
	pwX2		pointer,
	pwY2		pointer;
end gfx_ClipToRegion;
$SAVE NOLIST
$ENDIF

$IF gfx_SetClippingRegion
$RESTORE
gfx_SetClippingRegion: procedure (wxLow, wyLow, wxHigh, wyHigh) ercType
						external;
declare
	wxLow		word,
	wyLow		word,
	wxHigh		word,
	wyHigh		word;
end gfx_SetClippingRegion;
$SAVE NOLIST
$ENDIF


* Drawing Primitives (Real) *

$IF Move
$RESTORE
Move: procedure (rX, rY) erctype external;
	declare (rX, rY) quad;
end Move;
$SAVE NOLIST
$ENDIF

$IF DrawArc
$RESTORE
DrawArc: procedure (rXCenter, rYCenter, rsRadius, rAng1, rAng2)
	erctype external;
	declare
		 rXCenter quad
		,rYCenter quad
		,rsRadius quad
		,rAng1 quad
		,rAng2 quad;
end DrawArc;
$SAVE NOLIST
$ENDIF

$IF MoveRelative
$RESTORE
MoveRelative: procedure (rDeltaX, rDeltaY) erctype external;
	declare (rDeltaX, rDeltaY) quad;
end MoveRelative;
$SAVE NOLIST
$ENDIF

$IF Draw
$RESTORE
Draw: procedure (rX, rY) erctype external;
	declare (rX, rY) quad;
end Draw;
$SAVE NOLIST
$ENDIF

$IF DrawRelative
$RESTORE
DrawRelative: procedure (rDeltaX, rDeltaY) erctype external;
	declare (rDeltaX, rDeltaY) quad;
end DrawRelative;
$SAVE NOLIST
$ENDIF

$IF DrawLine
$RESTORE
DrawLine: procedure (rX1, rY1, rX2, rY2) erctype external;
	declare (rX1, rY1, rX2, rY2) quad;
end DrawLine;
$SAVE NOLIST
$ENDIF

$IF DrawCircle
$RESTORE
DrawCircle: procedure (rXCenter, rYCenter, rSRadius) erctype external;
	declare (rXCenter, rYCenter,rsRadius) quad;
end DrawCircle;
$SAVE NOLIST
$ENDIF

$IF FillRectangle
$RESTORE
FillRectangle: procedure (rXMin, rYMin, rXMax, rYMax, bFillType)
 erctype external;
	declare (rXMin, rYMin, rXMax, rYMax) quad,
	bFillType				BYTE;
end FillRectangle;
$SAVE NOLIST
$ENDIF

$IF FillPolygon
$RESTORE
FillPolygon: procedure (prgqXPoints, prgqYPoints, nPoints, bFillType)
erctype external;
DECLARE 
	prgqXPoints		POINTER
,prgqYPoints		POINTER
,nPoints						WORD
,bFillType				BYTE
;
END FillPolygon;
$SAVE NOLIST
$ENDIF	

$IF FillPolygonSub
$RESTORE
FillPolygonSub: PROCEDURE(pRgX, pRgY, cCoordinates, bFillType, fRectangle) ErcType EXTERNAL;
DECLARE
  pRgX POINTER
 ,pRgY POINTER
 ,cCoordinates WORD
 ,bFillType BYTE
 ,fRectangle BYTE
 ;
END FillPolygonSub;
$SAVE NOLIST
$ENDIF	


* Text primitive procedures *

$IF WriteTextString
$RESTORE
WriteTextString: procedure (pbString, cbString) erctype external;
	declare pbString pointer,
			cbString word;
end WriteTextString;
$SAVE NOLIST
$ENDIF

$IF SetCharacterSize
$RESTORE
SetCharacterSize: procedure (rsChars) erctype external;
	declare rsChars quad;
end SetCharacterSize;
$SAVE NOLIST
$ENDIF

$IF SetCharacterHeightAndExpansion
$RESTORE
SetCharacterHeightAndExpansion: procedure (rHeight, rExpFac) erctype
									external;
declare
	rHeight QUAD,
	rExpFac QUAD;
end SetCharacterHeightAndExpansion;
$SAVE NOLIST
$ENDIF

$IF SetFont
$RESTORE
SetFont: procedure (pbFontName, cbFontName) erctype external;
	declare pbFontName pointer,
			cbFontName word;
end SetFont;
$SAVE NOLIST
$ENDIF

$IF SetLabelOrigin
$RESTORE
SetLabelOrigin: procedure (bLorg) erctype external;
	declare bLorg byte;
end SetLabelOrigin;
$SAVE NOLIST
$ENDIF

$IF SetLabelPosition
$RESTORE
SetLabelPosition: procedure external;
end SetLabelPosition;
$SAVE NOLIST
$ENDIF


* Primitive Attribute Procedures *

$IF SetDrawingMode
$RESTORE
SetDrawingMode: procedure (iMode) erctype external;
	declare iMode word;
end SetDrawingMode;
$SAVE NOLIST
$ENDIF

$IF GetPictureColors
$RESTORE
GetPictureColors: procedure (pRgbPaletteRet) external;
	declare pRgbPaletteRet pointer;
end GetPictureColors;
$SAVE NOLIST
$ENDIF

$IF SetCurrentPalette
$RESTORE
SetCurrentPalette: procedure (pRgbPalette) erctype external;
	declare pRgbPalette pointer;
end SetCurrentPalette;
$SAVE NOLIST
$ENDIF

$IF SetLineType
$RESTORE
SetLineType: procedure (iLineType) erctype external;
	declare iLineType word;
end SetLineType;
$SAVE NOLIST
$ENDIF

$IF SetColor
$RESTORE
SetColor: procedure (iColor) erctype external;
	declare iColor word;
end SetColor;
$SAVE NOLIST
$ENDIF


* Object Procedures *

$IF SetVectorRecording
$RESTORE
SetVectorRecording: procedure (fOn) erctype external;
	declare fOn FlagType;
end SetVectorRecording;
$SAVE NOLIST
$ENDIF

$IF gfx_SetPickedVectorDrawing
$RESTORE
gfx_SetPickedVectorDrawing: procedure (fOn) erctype external;
	declare fOn FlagType;
end gfx_SetPickedVectorDrawing;
$SAVE NOLIST
$ENDIF

$IF OpenTempObject
$RESTORE
OpenTempObject: procedure (rXMin, rYMin, rXMax, rYMax) erctype external;
	declare (rXMin, rYMin, rXMax, rYMax) quad;
end OpenTempObject;
$SAVE NOLIST
$ENDIF

$IF CloseTempObject
$RESTORE
CloseTempObject: procedure erctype external;
end CloseTempObject;
$SAVE NOLIST
$ENDIF

$IF AddObject
$RESTORE
AddObject: procedure (pbObjectName, cbObjectName, rXMin, rYMin, rXMax,
					  rYMax) erctype external;
	declare pbObjectName pointer,
			cbObjectName word,
			(rXMin, rYMin, rXMax, rYMax) quad;
end AddObject;
$SAVE NOLIST
$ENDIF

$IF CloseObject
$RESTORE
CloseObject: procedure erctype external;
end CloseObject;
$SAVE NOLIST
$ENDIF

$IF InsertObject
$RESTORE
InsertObject: procedure (nObject) erctype external;
	declare nObject word;
end InsertObject;
$SAVE NOLIST
$ENDIF

$IF ClearVectors
$RESTORE
ClearVectors: procedure erctype external;
end ClearVectors;
$SAVE NOLIST
$ENDIF

$IF ClearLabels
$RESTORE
ClearLabels: procedure erctype external;
end ClearLabels;
$SAVE NOLIST
$ENDIF

$IF RemoveCurrentObject
$RESTORE
RemoveCurrentObject: procedure erctype external;
end RemoveCurrentObject;
$SAVE NOLIST
$ENDIF

$IF DisplayCurrentObject
$RESTORE
DisplayCurrentObject: procedure erctype external;
end DisplayCurrentObject;
$SAVE NOLIST
$ENDIF

$IF SetFirstObject
$RESTORE
SetFirstObject: procedure erctype external;
end SetFirstObject;
$SAVE NOLIST
$ENDIF

$IF SetNextObject
$RESTORE
SetNextObject: procedure erctype external;
end SetNextObject;
$SAVE NOLIST
$ENDIF


* Object Transformation Procedures (Integer VDC) *

$IF gfx_SetTranslate
$RESTORE
gfx_SetTranslate: procedure (wxT, wyT) erctype external;
	declare (wxT, wyT) word;
end gfx_SetTranslate;
$SAVE NOLIST
$ENDIF

$IF gfx_ChangeTranslate
$RESTORE
gfx_ChangeTranslate: procedure (ixT, iyT) erctype external;
	declare (ixT, iyT) word;
end gfx_ChangeTranslate;
$SAVE NOLIST
$ENDIF

$IF gfx_SetScale
$RESTORE
gfx_SetScale: procedure (dxS, dyS) erctype external;
	declare (dxS, dyS) dword;
end gfx_SetScale;
$SAVE NOLIST
$ENDIF

$IF gfx_ChangeScale
$RESTORE
gfx_ChangeScale: procedure (dxS, dyS) erctype external;
	declare (dxS, dyS) dword;
end gfx_ChangeScale;
$SAVE NOLIST
$ENDIF

$IF gfx_SetScaleAndTranslate
$RESTORE
gfx_SetScaleAndTranslate: procedure (dxS, dyS, wTx, wTy) erctype external;
declare
	(dxS, dyS)			dword,
	(wTx, wTy)			word;
end gfx_SetScaleAndTranslate;
$SAVE NOLIST
$ENDIF

$IF gfx_RotatePolyline
$RESTORE
gfx_RotatePolyline: procedure (pPoints, nPoints, pPointsRet, iTheta,
								ixStart, iyStart) erctype external;
declare
	pPoints			pointer,
	nPoints			word,
	pPointsRet			pointer,
	(iTheta, ixStart, iyStart)							word;
end gfx_RotatePolyline;
$SAVE NOLIST
$ENDIF

$IF gfx_RotateDPolyline
$RESTORE
gfx_RotateDPolyline: procedure (pPoints, nPoints, pPointsRet, iTheta,
								ixStart, iyStart) erctype external;
declare
	pPoints			pointer,
	nPoints			word,
	pPointsRet			pointer,
	(iTheta, ixStart, iyStart)							word;
end gfx_RotateDPolyline;
$SAVE NOLIST
$ENDIF


* Object Transformation Procedures (Real) *

$IF SetTranslate
$RESTORE
SetTranslate: procedure (rXTranslate, rYTranslate) erctype external;
	declare (rXTranslate, rYTranslate) quad;
end SetTranslate;
$SAVE NOLIST
$ENDIF

$IF SetTranslateRelative
$RESTORE
SetTranslateRelative: procedure (rXTranslateRelative, rYTranslateRelative)
					 erctype external;
	declare (rXTranslateRelative, rYTranslateRelative) quad;
end SetTranslateRelative;
$SAVE NOLIST
$ENDIF

$IF SetScale
$RESTORE
SetScale: procedure (rXScale, rYScale) erctype external;
	declare (rXScale, rYScale) quad;
end SetScale;
$SAVE NOLIST
$ENDIF

$IF SetScaleRelative
$RESTORE
SetScaleRelative: procedure (rXScaleRelative, rYScaleRelative) 
				erctype external;
	declare (rXScaleRelative, rYScaleRelative) quad;
end SetScaleRelative;
$SAVE NOLIST
$ENDIF

$IF GetTransformationData
$RESTORE
GetTransformationData: procedure (pTransformRet) erctype external;
	declare pTransformRet pointer;
end GetTransformationData;
$SAVE NOLIST
$ENDIF


* Viewing Procedures (Integer VDC) *

$IF gfx_SetViewPort
$RESTORE
gfx_SetViewPort: procedure (wxLow, wyLow, wxHigh, wyHigh,
					eCoordType, fPreserveAspect, eHorizAlign, eVertAlign)
				erctype external;
declare
	(wxLow, wyLow, wxHigh, wyHigh) word,
	eCoordType				WORD,
	fPreserveAspect				FLAG,
	eHorizAlign				WORD,
	eVertAlign				WORD;
end gfx_SetViewPort;
$SAVE NOLIST
$ENDIF

$IF gfx_SetWindow
$RESTORE
gfx_SetWindow: procedure (wxLow, wyLow, wxHigh, wyHigh) erctype external;
	declare (wxLow, wyLow, wxHigh, wyHigh) word;
end gfx_SetWindow;
$SAVE NOLIST
$ENDIF

$IF gfx_MoveWindow
$RESTORE
gfx_MoveWindow: procedure (ixLow, iyLow, ixHigh, iyHigh) erctype external;
	declare (ixLow, iyLow, ixHigh, iyHigh) word;
end gfx_MoveWindow;
$SAVE NOLIST
$ENDIF


* Viewing Procedures (Real) *

$IF SetViewPort
$RESTORE
SetViewPort: procedure (rXMin, rYMin, rXMax, rYMax) erctype external;
	declare (rXMin, rYMin, rXMax, rYMax) quad;
end SetViewPort;
$SAVE NOLIST
$ENDIF

$IF SetWindow
$RESTORE
SetWindow: procedure (rXMin, rYMin, rXMax, rYMax) erctype external;
	declare (rXMin, rYMin, rXMax, rYMax) quad;
end SetWindow;
$SAVE NOLIST
$ENDIF

$IF GetWindowData
$RESTORE
GetWindowData: procedure (pWindowDataRet) erctype external;
	declare pWindowDataRet pointer;
end GetWindowData;
$SAVE NOLIST
$ENDIF


* Label Procedures *

$IF AddLabel
$RESTORE
AddLabel: procedure (rX, rY, pbString, cbString, rSChars, bLorg,
						  bPen, bUserId, pbFontName, cbFontName) erctype
						  external;
	declare (rX,rY) quad,
			pbString pointer,
			cbString word,
			rSChars quad,
			bLorg byte,
			bPen byte,
			bUserId byte,
			pbFontName pointer,
			cbFontName word;
end AddLabel;
$SAVE NOLIST
$ENDIF

$IF AddScaledLabel
$RESTORE
AddScaledLabel: procedure (rX, rY, pbString, cbString, rHeight, rExpFac,
							bLorg, bPen, bUserId, pbFontName, cbFontName, 
							iTheta)
					erctype external;
	declare (rX,rY) quad,
			pbString pointer,
			cbString word,
			rHeight quad,
			rExpFac quad,
			bLorg byte,
			bPen byte,
			bUserId byte,
			pbFontName pointer,
			cbFontName word,
			iTheta word;
end AddScaledLabel;
$SAVE NOLIST
$ENDIF

$IF DrawLabel
$RESTORE
DrawLabel: procedure (pUserLabelEntry, wMode) erctype external;
declare
  pUserLabelEntry  pointer,
	 wMode            word;
end DrawLabel;
$SAVE NOLIST
$ENDIF

$IF SetFirstLabel
$RESTORE
SetFirstLabel: procedure (pLabelret, sLabelRet) erctype external;
	declare
		 pLabelRet pointer
		,sLabelRet word;
end SetFirstLabel;
$SAVE NOLIST
$ENDIF

$IF SetFirstLabelEntry
$RESTORE
SetFirstLabelEntry: procedure erctype external;
end SetFirstLabelEntry;
$SAVE NOLIST
$ENDIF

$IF ModifyLabel
$RESTORE
ModifyLabel: procedure (pModifiedLabel) erctype external;
	declare pModifiedLabel pointer;
end ModifyLabel;
$SAVE NOLIST
$ENDIF

$IF ModifyScaledLabel
$RESTORE
ModifyScaledLabel: procedure (pModifiedLabel) erctype external;
	declare pModifiedLabel pointer;
end ModifyScaledLabel;
$SAVE NOLIST
$ENDIF

$IF DeleteCurrentLabel
$RESTORE
DeleteCurrentLabel: procedure erctype external;
end DeleteCurrentLabel;
$SAVE NOLIST
$ENDIF

$IF GetLabelData
$RESTORE
GetLabelData: procedure (pLabelRet) erctype external;
	declare pLabelRet pointer;
end GetLabelData;
$SAVE NOLIST
$ENDIF

$IF GetScaledLabelData
$RESTORE
GetScaledLabelData: procedure (pLabelRet) erctype external;
	declare pLabelRet pointer;
end GetScaledLabelData;
$SAVE NOLIST
$ENDIF

$IF SetNextLabel
$RESTORE
SetNextLabel: procedure (pLabelRet, sLabelRet) erctype external;
	declare pLabelRet pointer,
			sLabelRet word;
end SetNextLabel;
$SAVE NOLIST
$ENDIF

$IF SetNextLabelEntry
$RESTORE
SetNextLabelEntry: procedure erctype external;
end SetNextLabelEntry;
$SAVE NOLIST
$ENDIF

$IF GetCurrentLabel
$RESTORE
GetCurrentLabel: procedure (pLabelRet, sLabelRet) erctype external;
	declare pLabelRet pointer,
			sLabelRet word;
end GetCurrentLabel;
$SAVE NOLIST
$ENDIF

$IF SetLabelUserFlag
$RESTORE
SetLabelUserFlag: procedure (bFlag) erctype external;
	declare bFlag byte;
end SetLabelUserFlag;
$SAVE NOLIST
$ENDIF

$IF GetLabelUserFlag
$RESTORE
GetLabelUserFlag: procedure (pbFlagRet) erctype external;
	declare pbFlagRet pointer;
end GetLabelUserFlag;
$SAVE NOLIST
$ENDIF

$IF SetLabelEditFlag
$RESTORE
SetLabelEditFlag: procedure (bFlag) erctype external;
	declare bFlag byte;
end SetLabelEditFlag;
$SAVE NOLIST
$ENDIF

$IF GetLabelEditFlag
$RESTORE
GetLabelEditFlag: procedure (pbFlagRet) erctype external;
	declare pbFlagRet pointer;
end GetLabelEditFlag;
$SAVE NOLIST
$ENDIF

$IF SetLabelDrawing
$RESTORE
SetLabelDrawing: procedure (fOn) erctype external;
	declare fOn flagtype;
end SetLabelDrawing;
$SAVE NOLIST
$ENDIF

$IF HeightFromRSChars
$RESTORE
HeightFromRSChars: procedure (rsChars) quad external;
	declare rsChars quad;
end HeightFromRSChars;
$SAVE NOLIST
$ENDIF

$IF RSCharsFromHeight
$RESTORE
RSCharsFromHeight: procedure (rHeight) quad external;
	declare rHeight quad;
end RSCharsFromHeight;
$SAVE NOLIST
$ENDIF


* User Written Procedures *

$IF LoadPaper
$RESTORE
LoadPaper: procedure (fPaper) erctype external;
	declare
		fPaper Byte;
end LoadPaper;
$SAVE NOLIST
$ENDIF

$IF ReadInterruptKey
$RESTORE
ReadInterruptKey: procedure erctype external;
end ReadInterruptKey;
$SAVE NOLIST
$ENDIF

$IF SetPen
$RESTORE
SetPen: procedure (piColor, pfChangePen) erctype external;
	declare
		 picolor pointer
		,pfChangePen pointer;
end SetPen;
$SAVE NOLIST
$ENDIF


* Cursor Primitives *
$IF gfx_CursorsOn
$RESTORE
gfx_CursorsOn: procedure external; 
end gfx_CursorsOn;
$SAVE NOLIST
$ENDIF

$IF gfx_CursorsOff
$RESTORE
gfx_CursorsOff: procedure external; 
end gfx_CursorsOff;
$SAVE NOLIST
$ENDIF

$IF TurnOnCursor
$RESTORE
TurnOnCursor: procedure erctype external; 
end TurnOnCursor;
$SAVE NOLIST
$ENDIF

$IF TurnOffCursor
$RESTORE
TurnOffCursor: procedure erctype external; 
end TurnOffCursor;
$SAVE NOLIST
$ENDIF

$IF SetNDCCursorPosition
$RESTORE
SetNDCCursorPosition: procedure (rX, rY, bDir) erctype external;
	declare (rX, rY) quad,
			bDir byte;
end SetNDCCursorPosition;
$SAVE NOLIST
$ENDIF

$IF SetObjectCursorPosition
$RESTORE
SetObjectCursorPosition: procedure (rX, rY, wDir) erctype external;
	declare (rX, rY) quad,
			wDir word;
end SetObjectCursorPosition;
$SAVE NOLIST
$ENDIF

$IF SetWorldCursorPosition
$RESTORE
SetWorldCursorPosition: procedure (rX, rY, wDir) erctype external;
	declare (rX, rY) quad,
			wDir word;
end SetWorldCursorPosition;
$SAVE NOLIST
$ENDIF

$IF GetCursorPosition
$RESTORE
GetCursorPosition: procedure (pCursorStatusRet) erctype external;
	declare pCursorStatusRet pointer;
end GetCursorPosition;
$SAVE NOLIST
$ENDIF


*     DEVICE DEPENDENT PROCEDURES    *

* Control Procedures *

$IF ClearScreen
$RESTORE
ClearScreen: PROCEDURE erctype EXTERNAL;
END ClearScreen;
$SAVE NOLIST
$ENDIF

$IF InitScreenGraphics
$RESTORE
InitScreenGraphics: procedure erctype external;
end InitScreenGraphics;
$SAVE NOLIST
$ENDIF

$IF SetCommandScreen
$RESTORE
SetCommandScreen: procedure (iScreen) erctype external;
	declare iScreen word;
end SetCommandScreen;
$SAVE NOLIST
$ENDIF

$IF SetVisibleScreen
$RESTORE
SetVisibleScreen: procedure (iScreen) erctype external;
	declare iScreen word;
end SetVisibleScreen;
$SAVE NOLIST
$ENDIF

$IF TurnOffGraphics
$RESTORE
TurnOffGraphics: procedure erctype external;
end TurnOffGraphics;
$SAVE NOLIST
$ENDIF

$IF TurnOnGraphics
$RESTORE
TurnOnGraphics: procedure erctype external;
end TurnOnGraphics;
$SAVE NOLIST
$ENDIF


* Vector and Arc Manipulation Procedures *

$IF ClearScreenRectangle
$RESTORE
ClearScreenRectangle: procedure (wXStart, wYStart, wWidth, wHeight) erctype
					external;
	declare
		 wXStart word
		,wYStart word
		,wWidth word
		,wHeight word;
end ClearScreenRectangle;
$SAVE NOLIST
$ENDIF

$IF ClearPixelScreenRectangle
$RESTORE
ClearPixelScreenRectangle: procedure (wXStart, wYStart, wWidth, wHeight)
					erctype external;
	declare
		 wXStart word
		,wYStart word
		,wWidth word
		,wHeight word;
end ClearPixelScreenRectangle;
$SAVE NOLIST
$ENDIF

$IF DrawScreenArc
$RESTORE
DrawScreenArc: procedure (wX, wY, wDir, wD, wD2, wDC, wDM) erctype external;
	declare
		 wX word
		,wY word
		,wDir word
		,wD word
		,wD2 word
		,wDC word
		,wDM word;
end DrawScreenArc;
$SAVE NOLIST
$ENDIF

$IF gfx_DrawScreenLine
$RESTORE
gfx_DrawScreenLine: procedure (wX1, wY1, wX2, wY2) erctype external;
	declare
		 wX1 word
		,wY1 word
		,wX2 word
		,wY2 word;
end gfx_DrawScreenLine;
$SAVE NOLIST
$ENDIF

$IF DrawScreenLine
$RESTORE
DrawScreenLine: procedure (wX1, wY1, wX2, wY2) erctype external;
	declare
		 wX1 word
		,wY1 word
		,wX2 word
		,wY2 word;
end DrawScreenLine;
$SAVE NOLIST
$ENDIF

$IF FillScreenRectangle
$RESTORE
FillScreenRectangle: procedure (wX1, wY1, wX2, wY2, bFillType) erctype
						external;
	declare
		 wX1 word
		,wY1 word
		,wX2 word
		,wY2 word
		,bFillType byte;
end FillScreenRectangle;
$SAVE NOLIST
$ENDIF

$IF FillPixelScreenRectangle
$RESTORE
FillPixelScreenRectangle: procedure (wX1, wY1, wX2, wY2, bFillType) erctype
						external;
	declare
		 wX1 word
		,wY1 word
		,wX2 word
		,wY2 word
		,bFillType byte;
end FillPixelScreenRectangle;
$SAVE NOLIST
$ENDIF

$IF FillScreenPolygon
$RESTORE
FillScreenPolygon: PROCEDURE(pRgX, pRgY, nVectors, bFillType,
								pMemory, sMemory) ErcType EXTERNAL;
DECLARE
	pRgX 			POINTER,
	pRgY			POINTER,
	nVectors			WORD,
	bFillType			BYTE,
	pMemory			POINTER,
	sMemory			WORD;
END FillScreenPolygon;

$SAVE NOLIST
$ENDIF

$IF FillPixelScreenPolygon
$RESTORE
FillPixelScreenPolygon: PROCEDURE(pRgX, pRgY, nVectors, bFillType,
								pMemory, sMemory) ErcType EXTERNAL;
DECLARE
	pRgX 			POINTER,
	pRgY			POINTER,
	nVectors			WORD,
	bFillType			BYTE,
	pMemory			POINTER,
	sMemory			WORD;
END FillPixelScreenPolygon;

$SAVE NOLIST
$ENDIF

$IF LoadSoftPattern
$RESTORE
LoadSoftPattern: procedure (iPattern, wPattern) erctype external;
	declare
		 iPattern word
		,wPattern word;
end LoadSoftPattern;
$SAVE NOLIST
$ENDIF

$IF SetScreenDrawingMode
$RESTORE
SetScreenDrawingMode: PROCEDURE(iMode) erctype EXTERNAL;
	DECLARE iMode WORD;
END SetScreenDrawingMode;
$SAVE NOLIST
$ENDIF

$IF SetScreenLineType
$RESTORE
SetScreenLineType: PROCEDURE(iLineType) erctype EXTERNAL;
	DECLARE iLineType WORD;
END SetScreenLineType;
$SAVE NOLIST
$ENDIF

$IF SetScreenColor
$RESTORE
SetScreenColor: PROCEDURE(iColor) erctype EXTERNAL;
	DECLARE iColor WORD;
END SetScreenColor;
$SAVE NOLIST
$ENDIF


* Bit Manipulation Procedures *

$IF DoRasterOp
$RESTORE
DoRasterOp: procedure (wXSource, wYSource, wXDestination, wYDestination,
						wWidth, wHeigth, wSourceOperation,
						wDestinationOperation) erctype external;
	declare
		 wXSource word
		,wYSource word
		,wXDestination word
		,wYDestination word
		,wWidth word
		,wHeigth word
		,wSourceOperation word
		,wDestinationOperation word;
end DoRasterOp;
$SAVE NOLIST
$ENDIF

$IF SetRasterDestination
$RESTORE
SetRasterDestination: procedure (pBitMap, cbLineBitMap, fOnGraphicsBoard)
erctype	external;
	declare
		 pBitMap pointer
		,cbLineBitMap word
		,fOnGraphicsBoard byte;
end SetRasterDestination;
$SAVE NOLIST
$ENDIF

$IF SetRasterDestinationPlane
$RESTORE
SetRasterDestinationPlane: procedure (wDestinationMask) erctype external;
	declare
	 wDestinationMask word;
end SetRasterDestinationPlane;
$SAVE NOLIST
$ENDIF

$IF SetDrawDestinationPlane
$RESTORE
SetDrawDestinationPlane: procedure (wDestinationMask) erctype external;
	declare
	 wDestinationMask word;
end SetDrawDestinationPlane;
$SAVE NOLIST
$ENDIF

$IF SetRasterPattern
$RESTORE
SetRasterPattern: procedure (pRgwPat, fOnGraphicsBoard) erctype external;
	declare
	 pRgwPat pointer
	,fOnGraphicsBoard byte;
end SetRasterPattern;
$SAVE NOLIST
$ENDIF

$IF SetRasterSourcePlane
$RESTORE
SetRasterSourcePlane: procedure (wSourceMask) erctype external;
	declare
	 wSourceMask word;
end SetRasterSourcePlane;
$SAVE NOLIST
$ENDIF

$IF SetRasterSource
$RESTORE
SetRasterSource: procedure (pBitMap, cbLineBitMap, fOnGraphicsBoard) erctype external;
	declare
		 pBitMap pointer
		,cbLineBitMap word
		,fOnGraphicsBoard word;
end SetRasterSource;
$SAVE NOLIST
$ENDIF

$IF GetRasterInfo
$RESTORE
GetRasterInfo: procedure (pRasterInfo) erctype external;
	Declare
	 pRasterInfo pointer;
end GetRasterInfo;
$SAVE NOLIST
$ENDIF

$IF DoRasterOpText
$RESTORE
DoRasterOpText: procedure (prgCh, cch, wXStart, wYStart, wXLim) erctype
							external;
	Declare
		 prgCh pointer
		,cch word
		,wXStart word
		,wYStart word
		,wXLim word;
end DoRasterOpText;
$SAVE NOLIST
$ENDIF

$IF SetRasterFont
$RESTORE
SetRasterFont: procedure (pFont, fOnGraphicsBoard) erctype external;
	declare
		 pFont pointer
		,fOnGraphicsBoard byte;
end SetRasterFont;
$SAVE NOLIST
$ENDIF


* Color Procedures *

$IF LoadColor
$RESTORE
LoadColor: procedure (iMapper, iColor, bColor) erctype external;
	declare
		 iMapper word
		,iColor word
		,bColor byte;
end LoadColor;
$SAVE NOLIST
$ENDIF

$IF LoadColorMapper
$RESTORE
LoadColorMapper: procedure (iMapper, pColors) erctype external;
	declare
		 iMapper word
		,pColors pointer;
end LoadColorMapper;
$SAVE NOLIST
$ENDIF

$IF SetColorMapper
$RESTORE
SetColorMapper: procedure (iMapper) erctype external;
	declare iMapper word;
end SetColorMapper;
$SAVE NOLIST
$ENDIF

$IF LoadColorStyleRam
$RESTORE
LoadColorStyleRam: procedure (pAttrs) erctype external;
	declare pAttrs pointer;
end LoadColorStyleRam;
$SAVE NOLIST
$ENDIF

$IF LoadStyleRamEntry
$RESTORE
LoadStyleRamEntry: procedure (iEntry, bVal) erctype external;
	declare
		 iEntry word
		,bVal byte;
end LoadStyleRamEntry;
$SAVE NOLIST
$ENDIF

$IF SetStyleRam
$RESTORE
SetStyleRam: procedure (fGraphics) erctype external;
	declare fGraphics byte;
end SetStyleRam;
$SAVE NOLIST
$ENDIF


* Misc. *

$If EncodIGG
$Restore
EncodIGG: Procedure (osdRet, wInteger) External;
Declare
	osdRet		Word,
	wInteger	Word;
End EncodIGG;
$Save Nolist
$Endif

$If EncodRGG
$Restore
EncodRGG: Procedure (osdRet, qReal) External;
Declare
	osdRet		Word,
	qReal  	Quad;
End EncodRGG;
$Save Nolist
$Endif

$If UserToNDC
$Restore
UserToNDC: Procedure (x, y, pwX, pwY)  External;
Declare
	x		Quad,
	y		Quad,
	pwX		Pointer,
	pwY		Pointer;
End UserToNDC;
$Save Nolist
$Endif

$If PointNdcToDevice
$Restore
PointNdcToDevice: Procedure (pwX, pwY) External;
Declare
	pwX		Pointer,
	pwY		Pointer;
End PointNdcToDevice;
$Save Nolist
$EndIf

$IF InsertVectorEntry
$Restore
InsertVectorEntry: Procedure (pb, cb, diList) ErcType External;
Declare
	pb		Pointer,
	cb		Word,
	diList		Dword;
END InsertVectorEntry;
$Save Nolist
$EndIf

$IF GetPVectorEntry
$Restore
GetPVectorEntry: Procedure (diList, ppEntryRet) ErcType External;
Declare
	diList		Dword,
	ppEntryRet				Pointer;
END GetPVectorEntry;
$Save Nolist
$EndIf

$IF gfx_QueryVectorList
$Restore
gfx_QueryVectorList: Procedure (psListRet) ErcType External;
Declare
	psListRet				Pointer;
END gfx_QueryVectorList;
$Save Nolist
$EndIf

$IF gfx_QueryLabelList
$Restore
gfx_QueryLabelList: Procedure (psListRet) ErcType External;
Declare
	psListRet				Pointer;
END gfx_QueryLabelList;
$Save Nolist
$EndIf

$IF SetDocumentName
$Restore
SetDocumentName: Procedure (pb, cb) ErcType External;
Declare
	pb		Pointer,
	cb		Word;
END SetDocumentName;
$Save Nolist
$EndIf

$IF gfx_SetPageDimensions
$Restore
gfx_SetPageDimensions: Procedure (xLow, yLow, xHigh, yHigh, bAspect) 
	ErcType External;
Declare
	(xLow, yLow, xHigh, yHigh				)			Word,
	bAspect					BYTE;
END gfx_SetPageDimensions;
$Save Nolist
$EndIf

$IF gfx_SetCGMLevel
$Restore
gfx_SetCGMLevel: Procedure (wLevel) ErcType External;
Declare
	wLevel		Word;
END gfx_SetCGMLevel;
$Save Nolist
$EndIf

$IF QueryFreeSpace
$Restore
QueryFreeSpace: Procedure (pFreeBytes) External;
Declare
	pFreeBytes			Pointer;
END QueryFreeSpace;
$Save Nolist
$EndIf

$RESTORE
