//////////////////////////////////////////////////////////////////////////////////////////
//  MiniCadCallBacks.h
//	
//	Copyright © Diehl Graphsoft, Inc  1993-1998.
//	All Rights Reserved.
//	
//	Declares most of the types specific to the SDK.
//	Includes the file which declares the entire set of SDK functions.
//
//////////////////////////////////////////////////////////////////////////////////////////



#ifndef _MINICADCALLBACKS_
#define _MINICADCALLBACKS_

#pragma once

#if _WIN_EXTERNAL_
#include <Windows.h>
#endif


#if (!_WIN_EXTERNAL_ && !_GSWINSDK_) && !defined(__FILES__)
	struct FSSpec;	// For MiniCadCallBacks.Defs.h
#endif

#include "Objs.TDType.h"

#if _MINICAD_ && !defined(_OBJS_BLANKTYPE_H_)
	// Need the definition of 'MCObjectHandle' from "Objs.BlankType.h".
	#include "Objs.BlankType.h"
#endif

#include "MiniCadHookIntf.h"
#include "MCCoordTypes.h"
#include "CallbackParamTypes.h"
#include "MiniCadCallbacks.X.h"

class TToolHandler;
struct ICoreToolAccess;


#if _MINICAD_
	// These are here so that code can be copied from externals
	// into the application without modification.
	#define GSCalledRoutineSetup(cbp)
	#define GSExternalSetup(cbp)
	#define	GSExternalSetdown(val)
#endif



void GS_API SetupGlobalCBP(CallBackPtr cbp);



//////////////////////////////////////////////////////////////////////////////////////////
// Notification types


typedef long StatusID;
typedef void (*StatusProcPtr)(StatusID, long);


//////////////////////////////////////////////////////////////////////////////////////////
// Part codes for TrackTool

const short cursOnNothing		= 1;
const short cursOnObject		= 2;
const short cursOnHandle		= 3;
const short cursOnSpecialPart	= 6;	// Dimension, symbol in wall, etc.


//////////////////////////////////////////////////////////////////////////////////////////
// Undo Method Selectors

const short kUndoNone				=  0;
const short kUndoReplaceSelection	= 17;
const short kUndoSwapObjects		= 21;
const short kUndoCustom				= 26;
const short kUndoOnlyViewChange		= 30;
//const short kUndoEndEvent			= 50;  // obsolete [MAF 6/29/98]



//////////////////////////////////////////////////////////////////////////////////////////
// DXF import or export.

enum EDXFError {
	kDXFErr_UnknownError 					= -1,
	kDXFErr_NoError							= 0, 
	kDXFErr_Cancelled						= 1, 
	kDXFErr_BadInput						= 2, 
	kDXFErr_DocumentNotEmpty				= 3,
	kDXFErr_OutOfMemory						= 4,
	kDXFErr_InvalidOrExtremeUnitsOrScale	= 5,
	kDXFErr_InitADFailed					= 6
};

const short /*DXFColorIndex*/	kUnmappedDXFColor	= -1;
const short /*Mils*/ 			kUnmappedLineWeight = -1;

// Constants for standard DXF colors (DXFColorIndex == short). OpenDWG constant to the right.
// kDXFColorByBlock should not be used in export unless you know what you are doing.
const short kDXFColorByBlock		= 0;	// AD_COLOR_BYBLOCK
const short kDXFRed					= 1;	// AD_COLOR_RED
const short kDXFYellow				= 2;	// AD_COLOR_YELLOW
const short kDXFGreen				= 3;	// AD_COLOR_GREEN
const short kDXFCyan				= 4;	// AD_COLOR_CYAN
const short kDXFBlue				= 5;	// AD_COLOR_BLUE
const short kDXFMagenta				= 6;	// AD_COLOR_MAGENTA
const short kDXFBlackOrWhite		= 7;	// AD_COLOR_WHITE
const short kDXFDarkGray			= 8;
const short kDXFLightGray			= 9;	
const short kDXFColorByLayer		= 256;	// AD_COLOR_BYLAYER

// Constants for default compression
// Should stay in sync with items in 'MENU' 455
const short kPrefDefaultRenderCompressionJPEG	= 1;
const short kPrefDefaultRenderCompressionPNG	= 2;

//////////////////////////////////////////////////////////////////////////////////////////
// Layer and class options 
// Internal: ELayerOptionsFlag Short2LayerOptionsFlag(short val); etc.

enum ELayerOptions {
	kLayersActive					= 1,
	kLayersGrayOthers				= 2,
	kLayersShowOthers				= 3,
	kLayersShowSnapOthers			= 4,
	kLayersShowSnapModifyOthers		= 5,
	kLayersGraySnapOthers			= 6,
};

enum EClassOptions {
	kClassesActive					= 1,
	kClassesGrayOthers				= 2,
	kClassesShowOthers				= 3,
	kClassesShowSnapOthers			= 4,
	kClassesShowSnapModifyOthers	= 5,
	kClassesGraySnapOthers			= 6,	
};


//////////////////////////////////////////////////////////////////////////////////////////
// Wall Join Options - used with GS_WallJoin

typedef short JoinModifierType;

const JoinModifierType kTWallJoin 		= 1; 
const JoinModifierType kLWallJoin 		= 2;
const JoinModifierType kXWallJoin 		= 3;
const JoinModifierType kAutoWallJoin 	= 4; // ignores input points and automatically determines the kind of join (T or L or X)
const JoinModifierType kAutoLWallJoin 	= 5; // ignores input points and automatically creates L join using the longest portion of the walls




//////////////////////////////////////////////////////////////////////////////////////////
// Constants for selectors for GetProgramVariable and SetProgramVariable

// XXX_JDW_MISC - i might have seen a duplicate enum somewhere...
enum EAngularUnits {
	kDegrees	= 0,
	kRadians	= 1,
	kGradians	= 2
};

// The values below indicate menu index.
enum EDXFBlockAttributeHandling	{
	kBAH_MinimumLegalValue		= 1,
	kBAH_PreserveLookAndLinks	= 1,
	kBAH_PreserveLook			= 2, 
	kBAH_LinkVisible			= 3, 
	kBAH_LinkAll				= 4,
	kBAH_Hide					= 5,
	kBAH_MaximumLegalValue		= 5
};

enum EDXF2D3DImportHandling {
	k23D_MinimumLegalValue	= 1,
	k23D_All2D				= 1,
	k23D_2Dand3D			= 2, 
	k23D_All3D				= 3,
	k23D_MaximumLegalValue	= 3
};

enum EDXFUnits
// These are the values AutoCAD 2000 defines for units for scaling of inserted blocks.
{
	kDU_MinimumLegalValue	= 0,
	kDU_Unitless			= 0,	// valid coming in from AutoCAD file; not valid to set; but currently used to mean "custom"
	kDU_Inches				= 1,
	kDU_Feet				= 2,
	kDU_Miles				= 3,
	kDU_Millimeters			= 4,
	kDU_Centimeters			= 5,
	kDU_Meters				= 6,
	kDU_Kilometers			= 7,
	kDU_Microinches			= 8,
	kDU_Mils				= 9,
	kDU_Yards				= 10,
	kDU_Angstroms			= 11,
	kDU_Nanometers			= 12,
	kDU_Microns				= 13,
	kDU_Decimeters			= 14,
	kDU_Dekameters			= 15,
	kDU_Hectometers			= 16,
	kDU_Gigameters			= 17,
	kDU_AstronomicalUnits	= 18,
	kDU_LightYears			= 19,
	kDU_Parsecs				= 20,
	kDU_MaximumLegalValue	= 20
};

enum EDXFPlotUnits { 
	kDPU_MinimumLegalValue	= -1,
	kDPU_ByLayout			= -1,	// defined by us as flag
	kDPU_Inches				= 0, 	// defined by AutoCAD
	kDPU_Millimeters		= 1, 	//
	kDPU_Pixels				= 2,	//
	kDPU_MaximumLegalValue	= 2
};

enum EDXFExternalRefsHandling {
	kERH_MinimumLegalValue	= 0,
	kBindExternalRefs		= 0,
	kIgnoreExternalRefs		= 1,
	kCreateVWRefs			= 2,
	kUseLayerImport			= 3,
	kERH_MaximumLegalValue	= 3
};

//////////////////////////////////////////////////////////////////////////////////////////
// Parametric state event sending flags
// Note! You can OR those flags

typedef short TParametricStateFlags;

const TParametricStateFlags kParametricStateEvent_NoStateEvents 		= 0; 
const TParametricStateFlags kParametricStateEvent_ResetStatesEvent		= 1;
const TParametricStateFlags kParametricStateEvent_InternalStatesEvent	= 2;

//////////////////////////////////////////////////////////////////////////////////////////
// Selectors for GetProgramVariable and SetProgramVariable
enum {

	// -------------------------------------------------------------------------
	// Boolean selectors - All public for VS use
	varClickDrag          =  0,	
	varOffsetDups         =  1,
	varFullCursor         =  2,
	varShowHints          =  3,
	varFloatDatum         =  4,
	varSnapToLoci         =  5,
	varShowRulers         =  6,
	varShowScrollBars     =  7,
	varNoFillText         =  8,
	varZoomLineThick      =  9,
	varBWOnly             = 10,
	varUseLayerColor      = 11,
	varTimeLog            = 12,
	varAdjustTextFlip     = 13,
	varShowOthersInGroup  = 14,
	varShow3DAxisLabels   = 15,
	varBlackBackground    = 16,
	varEightSelHandles    = 17,
	varUseSounds          = 18,
	varShowUndoWarnings   = 19,
	varOpaqueHints        = 20,
	varStopVSOnWarnings	  = 21,
	varLeftPaletteMargin  = 22,
	varRightPaletteMargin = 23,
	varSaveReminder		  = 24,
	varShowConstraints	  = 25,          
	varCombineUndoViews	  = 26,     // Sint8        
	varShowAlertsOnModeBar= 27,
	varAssociateDims	  = 28,
	varSpellCheckCapitalizedWords = 29,
	varSpellCheckWordsInAllCaps   = 30,
	varSpellCheckMixedCaseWords   = 31,
	varSpellCheckWordsWithNumbers = 32,
	varWallAutoJoin      = 33,
	varShowPageBreaks    = 34,
	varShowGrid          = 35,
	varPrintGrid         = 36,
	varSnapToGrid        = 37,
	varSnapToObject      = 38,
	varSaveByTime		 = 39,
	varSaveConfirm		 = 40,
	varSaveToBackup		 = 41,
	varExtendedAutoscroll = 42,
	varPaletteDocking	 = 43,
	varCreateDimsInDimClass = 44,
	varOpenGLNavigation	 = 45,
	varUseVectorCaching	 = 46,
	varSketchHiddenLine  = 47,
	varSnapToEdgePoints  = 48,
	varShowPageBoundary  = 49,
	

	// -------------------------------------------------------------------------
	// Numeric selectors
	
	varLineWeightUnit     = 50,     // short - Public for VS
	varLineWeightArray    = 51,     // 6 bytes - For internal use only
	var3DResponse         = 52,     // byte   (1-detailed ... 5-responsive) - Public for VS
	varCustomConstrainAng = 53,     // double - Public for VS
	varSnapRad            = 54,     // short - Public for VS
	var2DConvertRes       = 55,     // short - Public for VS
	var3DConvertRes       = 56,     // short - Public for VS
	varTextSize           = 57,     // double (page inches) - Public for VS
	varTextStyle          = 58,     // byte (bit field: bold=1, italic=2, underline=4, outline=8, shadow=16) - Public for VS
	varMaxUndos           = 59,     // short - Public for VS
	varSaveInterval		  = 60,		// short  (number of minutes) - Public for VS
	varDisplayLightObjs	  = 61,		// short  (0-always, 1-wireframe only, 2-never) - Public for VS
	varRetainQD3DModel	  = 62,		// short  (1-never .. 5-always) - Public for VS
	varRotTextDisplay	  = 63,		// short  (0-box, 1-normal, 2-highest quality) - Public for VS
	varDisplayBitMaps	  = 64,		// short  (0-box, 1-low res, 2-full res) - Public for VS
	varDimSlashThick	  = 65,		// byte   (mils) - Public for VS
	varHiddenLineDashStyle= 66,		// byte   (dash style index) - Public for VS
	varHiddenLineShade	  = 67,		// short  (1-darkest .. 4-lightest) - Public for VS
	varPageOriginX        = 68,     // double - For internal use only
	varPageOriginY        = 69,     // double - For internal use only
	varPhotographicScale  = 70,     // double - Public for VS
	varDimStandard        = 71,     // short - Public for VS
	varDefacetAngle		  = 72,		// double (0-90, for hidden line render) - Public for VS
	varGridAngle          = 73,     // double - Public for VS
	varMoveObjArrow		  = 74,		// short (1-arrow, 2-cmd+arrow, 3-shift+arrow, 4-shift+cmd+arrow) - Public for VS
	varNudgeObjArrow	  = 75,		// short (1-arrow, 2-cmd+arrow, 3-shift+arrow, 4-shift+cmd+arrow) - Public for VS
	varPanArrow		  	  = 76,		// short (1-arrow, 2-cmd+arrow, 3-shift+arrow, 4-shift+cmd+arrow) - Public for VS
	varSwitchActLCArrow	  = 77,		// short (1-arrow, 2-cmd+arrow, 3-shift+arrow, 4-shift+cmd+arrow) - Public for VS
	varGridX			  = 78,		// double, - For internal use only
	varGridY			  = 79,		// double, - For internal use only
	varPageOriginXInCurrUnits = 80,	// double, current units - Public for VS
	varPageOriginYInCurrUnits = 81, // double, current uniits - Public for VS
	varTextJustification  = 82,		// short (1-left, 2-center, 3-right) - Public for VS
	varTextVerticalAlignment = 83,	// short (1-TopBox, 2-TopBaseline, 3-CenterBox, 4-BottomBaseline, 5-BottomBox) - Public for VS
	varTextVerticalSpacing   = 84,	// short (0-CustomLeading, 2-Single, 3-ThreeHalves, 4-Double) - Public for VS
	varTextLeading		     = 85,		// double - Public for VS - Public for VS
	varDefaultCompression    = 86,		// byte (1-JPEG, 2-PNG)  - Public for VS
	varLineWeightArrayCount  = 87,		// byte - Public for VS
	varSoundVolume			 = 88,		// short - Public for VS
	varCustomMoveDistance	 = 89,	// double, the custom distance to move objects, see varUseCustomMoveDistance above - Public for VS
	 
	// -------------------------------------------------------------------------
	varSheetIndividualZoomPan = 90,			// Boolean (whether sheet layers have their own zoom pan) - For internal use only
	varDisplay3DLoci = 91,					// short  (0-always, 1-wireframe only, 2-never) - Public for VS
	varPlanRotated = 92,					// Boolean read only (whether the plan view is rotated) - Public for VS
	varPlanRotationAngle = 93,				// Real : What is the current Plan rotation angle. - Public for VS
	varStackLayers = 94,					// Boolean read-write (gets/sets the stack layers status) - Public for VS
	varStackLayersCreate2DObjects = 95,		// Boolean read-write (gets and sets stack layers option to create 2D objects) - Public for VS
	varStackLayersIgnoreOtherScales = 96,	// Boolean read-write (gets and sets stack layers option to ignore layers with scales different than active layer) - Public for VS
	varStackLayersRestoreViews = 97,		// Boolean read-write (gets and sets stack layers option to restore the original views after unstacking) - Public for VS
	varUseOpenMPMultithreading = 98,		// short (0-no, 1-yes, 2-partial) - Public for VS
	varStackLayersCenterView = 99,			// Boolean read-write (gets and sets stack layers option to center view on active layer) - Public for VS

	// -------------------------------------------------------------------------
	// String selectors
	
	varTextFontName	      = 100,    // Str255 - Public for VS

	// -------------------------------------------------------------------------
	varStackLayersShowPageBoundary = 101,			// Boolean read-write (gets and sets stack layers option to display the page boundary) - Public for VS
	varStackLayersOnlyActiveLayer2DObjects = 102,	// Boolean read-write (gets and sets stack layers option to display only active layer 2D objects) - Public for VS


	// -------------------------------------------------------------------------
	// Miscellaneous Unit Selectors

	varAngularPrecision	      = 120,   // short - Public for VS
	varAngularUnit		      = 121,   // short (EAngularUnits: kDegrees, kRadians, kGradians) - Public for VS


	// -------------------------------------------------------------------------
	// More Boolean Selectors
	varIsResettingPlugInsDuringFileRead	= 129,	// For internal use only
	varDisplayDefaultContent			= 130,	// Public for VS
	varAutoFileExtensionsOnMac			= 131,	// Public for VS
	varUseAdvancedImaging				= 132,	// Public for VS
	varUseAntiAliasing					= 133,	// Public for VS
	varAutoAssociateDims				= 134,	// Public for VS
	varMouseWheelZoom					= 135,	// Public for VS
	varUseCustomMoveDistance			= 136,	// whether or not to use the custom distance when moving objects, see varCustomMoveDistance below - For internal use only
	varPrintPSwithBinary				= 137,	// Some printers fail when sending straight binary data with post script. 1 = true = send binary = default - For internal use only
	varNewDocOnStartup					= 138,	// Public for VS
	varChangeLayerForCreateSimilar		= 139,	// Public for VS
	varDoInvalsDuringSurfaceOperations	= 140,	// For internal use only
	// -------------------------------------------------------------------------
	// Primary Unit Selectors
	
	varUnit1Fraction          = 150,	// double (WorldCoordsPerDrawing unit [get only]) - Public for VS
	varUnit1Format            = 151,	// short	    ufFeetAndInches, ufDecimal - For internal use only
	varUnit1UnitsPerInch      = 152,	// double - Public for VS - Public for VS
	varUnit1UnitName          = 153,	// Str20 - Public for VS
	varUnit1UnitMark          = 154,	// Str8 - Public for VS
	varUnit1SUnitMark         = 155,	// Str8 - Public for VS
	varUnit1SUnitDivider      = 156,	// PStr8 - Public for VS
	varUnit1SMultiplier       = 157,	// short - Public for VS
	varUnit1SquareUnitMark    = 158,	// Str12 - Public for VS
	varUnit1SquareUnitDiv     = 159,	// long - Public for VS
	varUnit1CubeUnitMark      = 160,	// Str12 - Public for VS
	varUnit1CubeUnitDiv       = 161,	// long - Public for VS

//	varUnit1DisplayFrac         = 162,	// long   (old name kept for compatibility below this enum)
	varUnit1DecDisplayPrecision = 162,	// long - Public for VS
	
	varUnit1FlagShowUnits     = 163,	// Boolean - Public for VS
	varUnit1FlagLeading0      = 164,	// Boolean - Public for VS
	varUnit1FlagTrailing0     = 165,	// Boolean - Public for VS
	varUnit1FlagUseMinUnit    = 166,	// Boolean - Public for VS
	varUnit1FlagCustomUnit    = 167,	// Boolean - Public for VS

//	varUnit1FlagShowDecAsFrac = 168,	// Boolean   (old name kept for compatibility below this enum) - Public for VS
	varUnit1FlagDisplayAsFrac = 168,	// Boolean - Public for VS

//	varUnit1DimPrecision      = 169,	// long   (old name kept for compatibility below this enum) - Public for VS
	varUnit1DecDimPrecision   = 169,	// long - Public for VS
	
	varUnit1Style             = 170,	// short - built-in unit (1 thru 7 based on standard unit pop-up order) - Public for VS

	varUnit1FracDisplayPrecision = 171,	// long - Public for VS
	varUnit1FracDimPrecision     = 172,	// long - Public for VS
	varUnit1FlagIsMetric         = 173,	// Boolean - Public for VS
	varUnit1AngularUnit          = 174,	// short (EAngularUnits: kDegrees, kRadians, kGradians) - Public for VS
	varUnit1RoundFracToDecimal   = 175, // Boolean - Public for VS

	varUnit1AreaUnitsPerSquareInch = 176, // double - Public for VS
	varUnit1AreaUnitName		= 177,	// Str20 - Public for VS
	varUnit1AreaUnitMark		= 178,	// Str12 - Public for VS
	varUnit1AreaDecPrecision	= 179,	// long - Public for VS
	varUnit1VolumeUnitsPerCubicInch = 180, // double - Public for VS
	varUnit1VolumeUnitName		= 181,	// Str20 - Public for VS
	varUnit1VolumeUnitMark		= 182,	// Str12 - Public for VS
	varUnit1VolumeDecPrecision	= 183,	// long - Public for VS
	varUnit1FlagCustomAreaUnit	= 184,	// Boolean - Public for VS
	varUnit1FlagCustomVolumeUnit = 185,	// Boolean - Public for VS
	varUnit1AreaFraction		= 186,	// double	(WorldCoordsSquaredPerDrawing unit [get only]) - Public for VS
	varUnit1VolumeFraction		= 187,	// double	(WorldCoordsCubedPerDrawing unit [get only]) - Public for VS
	varUnit1DisplayRoundingBase	= 188,	// short	(0 = 1, 1 = 2.5, 2 = 5) - Public for VS
	varUnit1DimRoundingBase		= 189,	// short	(0 = 1, 1 = 2.5, 2 = 5) - Public for VS
	varUnit1DimFractionDisplayStyle = 190, //short  (0 = regular style, 1 = diagonal style, 2 = horizontal style)

	// -------------------------------------------------------------------------
	// Secondary Unit Selectors
	
	varUnit2Fraction          = 200,	// long - Public for VS
	varUnit2Format            = 201,	// short	   ufFeetAndInches, ufDecimal  - For internal use only
	varUnit2UnitsPerInch      = 202,	// Extended80  (returned as double!) - Public for VS
	varUnit2UnitName          = 203,	// Str20 - Public for VS
	varUnit2UnitMark          = 204,	// Str8 - Public for VS
	varUnit2SUnitMark         = 205,	// Str8 - Public for VS
	varUnit2SUnitDivider      = 206,	// Str8 - Public for VS
	varUnit2SMultiplier       = 207,	// short - Public for VS
	varUnit2SquareUnitMark    = 208,	// Str12 - Public for VS
	varUnit2SquareUnitDiv     = 209,	// long - Public for VS
	varUnit2CubeUnitMark      = 210,	// Str12 - Public for VS
	varUnit2CubeUnitDiv       = 211,	// long - Public for VS

//	varUnit2DisplayFrac       = 212,	// long   (old name kept for compatibility below this enum)
	varUnit2DecDisplayPrecision       = 212,	// long - Public for VS
	
	varUnit2FlagShowUnits     = 213,	// Boolean - Public for VS
	varUnit2FlagLeading0      = 214,	// Boolean - Public for VS
	varUnit2FlagTrailing0     = 215,	// Boolean - Public for VS
	varUnit2FlagUseMinUnit    = 216,	// Boolean - Public for VS
	varUnit2FlagCustomUnit    = 217,	// Boolean - Public for VS

//	varUnit2FlagShowDecAsFrac = 218,	// Boolean   (old name kept for compatibility below this enum)
	varUnit2FlagDisplayAsFrac = 218,	// Boolean - Public for VS

//	varUnit2DimPrecision      = 219,	// long   (old name kept for compatibility below this enum)
	varUnit2DecDimPrecision      = 219,	// long - Public for VS
	
	varUnit2Style             = 220,	// short - built-in unit (1 thru 7 based on standard unit pop-up order) - Public for VS

	varUnit2FracDisplayPrecision = 221,	// long - Public for VS
	varUnit2FracDimPrecision     = 222,	// long - Public for VS
	varUnit2FlagIsMetric         = 223,	// Boolean - Public for VS
	varUnit2AngularUnit          = 224,	// short  (EAngularUnits: kDegrees, kRadians, kGradians) - Public for VS
	varUnit2RoundFracToDecimal   = 225, // Boolean - Public for VS
	varUnit2DimRoundingBase		 = 226,	// short	(0 = 1, 1 = 2.5, 2 = 5) - Public for VS


	// -------------------------------------------------------------------------
	// Product state settings
	
	varRenderWorksEnabled	  = 240,	// Boolean, read only - Public for VS
	varDisableRenderWorks	  = 241,	// Boolean, if TRUE, RenderWorks is disabled for the life of the application - Public for VS
	
	// -------------------------------------------------------------------------
	// Tools:
	
	varToolPenPattern	  		= 250,	// short, pattern index - For internal use only
	varToolPenSize	 	  		= 251,	// short, pixels at one to one - Zoom line pref observed	 - For internal use only
	varAddToolObject	  	  	= 252,	// MCObjectHandle, write only, add Obejct - For internal use only
	varRemoveToolObjects	 	= 253,	// ignored,  - For internal use only
	varAutoScroll	  			= 254,	// Boolean, write only, DisableAutoScroll - For internal use only
	varToolBlitDrawing	  		= 255,	// Boolean, write only, UseToolBlitDrawing - For internal use only
	varToolOptionKeyDown	  	= 256,	// Boolean - For internal use only
	varToolShiftKeyDown	  		= 257,	// Boolean - For internal use only
	varToolPenFGColor			= 258,	// Uint8, foreground color, deprecated use varToolPenFGColor16 - For internal use only
	varToolPenBGColor			= 259,	// Uint8, background color, deprecated use varToolPenBGColor16 - For internal use only
	varToolPenSizeConstPixels	= 260,	// short, pixels Zoom line pref NOT observed - For internal use only
	varToolCtrlCmdKeyDown		= 261,  // Boolean - For internal use only
	varToolPenFGColor16			= 262,	// ColorRef, foreground color, write only - For internal use only
	varToolPenBGColor16			= 263,	// ColorRef, background color, write only - For internal use only

	// -------------------------------------------------------------------------
	// PDF Import setting
	//		Resolution setting for PDFPage Paint Node Creation
	varPDFPageObjPaintNodeRes	= 270,	// long - Public for VS

	// -------------------------------------------------------------------------
	// DXF Import settings. 
	//		Initial VectorWorks values in [brackets].
	//		Some variables are handled automatically by the internal DXF import
	//		command. You can turn off this automatic handling with the 
	//		"Auto..." variables below. For example, to set ModelSpaceScale
	//		to be 1:100, you would first need to set AutoModelSpaceScale to
	//		false and then set ModelSpaceScale to 100.0. 
	
	varDXF_AutoUnits					= 300,	// Boolean	[true] - Public for VS
	varDXF_Units						= 301,	// short	[kDU_Inches] - Public for VS
	varDXF_DXFUnitsPerInch				= 302,	// double	[1.0] - Public for VS
		// Auto Units does this: if the DXF file is set to "Engineering"
		// or "Architectural", then "feet and inches" is assumed because 
		// AutoCAD 14 displays these values as feet and inches; Units 
		// is set to kDU_Inches and units per inch is set to 1.0. Otherwise,
		// it is assumed that the document is already set to the correct units
		// and units and units per inch are set according to the current 
		// document units.
		//	If Auto Units is off, then you can set either Units or UnitsPerInch
		// (setting one results in the other one automatically being set).
		// Units is an enum EDXFUnits listing all the units specified by
		// AutoCAD, from inches to parsecs. Normally you should set only
		// the units variable. You should not set the units to kDU_Unitless,
		// as this will return an error. If you have a custom unit that 
		// is not in AutoCAD's list, then set units per inch instead, and
		// units will be set to kDU_Unitless.

	varDXF_AutoModelSpaceScale			= 303,	// Boolean	[true] - Public for VS
	varDXF_ModelSpaceScale				= 304,	// double	[1.0] - Public for VS
		// Auto ModelSpaceScale chooses a scale that fits model space to 
		// the current page. If false, set your own scale as 1:<your scale>
			
	varDXF_2D3DImportHandling			= 305,	// short	[k23D_2Dand3D] - Public for VS
		// k23D_All2D, k23D_2Dand3D, k23D_All3D.
	
	varDXF_MapLayersToClasses			= 306,	// Boolean	[true] - Public for VS
	varDXF_ConvertMLinesToWalls			= 307,	// Boolean	[false] - Public for VS
	//varDXF_ConvertRaysAndXLines		= 308,	// Boolean	[false]  removed for VW12 - Public for VS
	
	varDXF_ScaleDashLengths				= 309,	// Boolean	[false] - Public for VS
	varDXF_DashLengthScale				= 310,	// double	[1.0] - Public for VS
	
	varDXF_AutoBlockAttributeHandling	= 311,	// Boolean 	[true] - Public for VS
	varDXF_BlockAttributeHandling		= 312,	// short 	[kBAH_PreserveLook] - Public for VS
		// Value chosen from enum EDXFBlockAttributeHandling:
		//	kBAH_PreserveLook, kBAH_ListBelow, kBAH_Hide.
		// Auto BlockAttributeHandling checks the DXF header variable $ATTMODE to 
		// decide which VW import mode most closely matches the behavior in AutoCAD:
		//	$ATTMODE: 0 = "don't show attributes" -> Hide
		//			  1 = "normal"				  -> Preserve Look
		//			  2	= "show all attributes"   -> List Below
		// NOTE: "list below" is currently unimplemented and results in "preserve look"
											
	varDXF_AutoPointHandling			= 313,	// Boolean	[true] - Public for VS
	varDXF_ConvertPointsToLoci			= 314,	// Boolean	[false] - Public for VS
	varDXF_PointSymbolsAreGuides		= 315,	// Boolean	[true] - Public for VS
		// If Auto PointHandling is true, we check the DXF header variable
		// $PDSIZE. If > 0, it's a "real" size and we import as a symbol
		// in the Guides class. Else, if $PDSIZE <= 0, the size of the point 
		// is relative to the size of the screen indicating it's not a true 
		// part of the drawing and we import it as a locus.
			
	varDXF_MapColorsToLineWeights		= 316,	// Boolean	[true] - Public for VS
	varDXF_SetLineColorsBlack			= 317,	// Boolean	[false] - Public for VS
		// *NOTE: this may change with AC2000 to be auto-chosen
		
		// New variables for VW9...
	varDXF_PaperSpaceUnits				= 318,	// short	[kDPU_Inches]	(EDXFPlotUnits) - Public for VS
	varDXF_AutoScaleDashLengths			= 319,	// Boolean	[true] - Public for VS
	varDXF_GroupRecordFields			= 320,	// Boolean	[true] - Public for VS
	varDXF_AutoLineWeightHandling		= 321,	// Boolean	[true] - Public for VS
	
		// New variables for VW12 (from earlier versions)...
	varDXF_ConvertDimensionsToGroups	= 322,	// Boolean	[false] - Public for VS
	varDXF_RaysAndXLinesToGuides		= 323,	// Boolean	[false] - Public for VS

		// New variables for VW12...
	varDXF_AutoCenterAfterImport		= 324,	// Boolean	[true] - Public for VS
	varDXF_CenterAfterImport			= 325,	// Boolean	[true] - Public for VS
	varDXF_UseWorldOrigin				= 326,	// Boolean	[false] - Public for VS

	varDXF_SetVectorWorksUnitsToMatch	= 327,	// Boolean	[false] - Public for VS
		
		// New variables for VW14 (from earlier version)...
	varDXF_AddPrefixToDXFLayers			= 328,	// Boolean	[false] - Public for VS
	varDXF_PrefixToDXFEdit				= 329,	// TXString [empty string] - Public for VS
		// prefix text is set if AddPrefixToDXFLayers, else it is skipped; 
		// if AddPrefixToDXFLayers is set to false, prefix text is deleted

		// New variables for VW14...
	varDXF_ExternalRefsHandling			= 330,	// short	[kBindExternalRefs] - Public for VS
		// 	kBindExternalRefs, kIgnoreExternalRefs,	kCreateVWRefs, kUseLayerImport
	
		// New variables for VW15...
	varDXF_ADTObjects2DView				= 331,	// Boolean	[true] - Public for VS

	// -------------------------------------------------------------------------
	// DXF Export settings. Initial VectorWorks values in [brackets].
	
	// RESERVED BY JDW: 300-399.


	// -------------------------------------------------------------------------
	// SmartCursor . 
	varSmartCursorStartPt2D				= 400,	// WorldPt read/write - For internal use only
	varSmartCursorStartPt3D				= 401,	// WorldPt read/write - For internal use only
	varSmartCursorShiftConstrain		= 402,	// Shift Constrain Mode write - For internal use only
	varSmartCursorConstrainMode			= 403,	// Shift Constrain Mode write - For internal use only
	varSmartCursorGridOptions			= 404,	// Shift Constrain Mode write - For internal use only
	varSmartCursorSpecialAngle2D		= 405,	// WorldPt write - For internal use only
	varDataBar							= 406,	// Set Databar by ID - For internal use only
	
	
	varImmediateVSMode					= 407,	// Immediate Vector Script Mode - Public for VS
	
	varRunPickLoop						= 408,	// Run The Pick Loop - For internal use only
	varUse3DCursor						= 409,	// Boolean True -> Use the 3D cursor Fale -> use the 2D Cursor Maps to TDEF flag "uses3DCursor - For internal use only

	// Standard Advanced Selection Dialog Settings
	varUseFramedSelectionIndication		= 410,	// Boolean	True -> Used framed highlighting for selection indication.  FALSE uses classic VW 12 selection indication - Public for VS
	varSmartCursorShowInteractiveSegment= 411,	// Boolean	[false] TRUE -> Dashed line from startPt to currentPt is drawn by smart cursor.  FALSE not shown - Public for VS

	// ! NEARING_FINAL_RELEASE		// JLoy
	varShowImagingTiming				= 415,
	varShowImagingDebug					= 416,

	// Optional Advanced Selection Dialog Settings
	varFramedSelectionAllowReshapeGrips	= 424,	//	Boolean	True -> Turns reshape grips on/off when using multiple selections - For internal use only
	varEnableSmartCursor				= 430,
	varSmartCursorLockSpecialAngle2D	= 435,	// WorldPt write - For internal use only
	varSmartCursorStartPt2DEx			= 436,	// WorldPt write - For internal use only

	varAPIInval							= 450,	//	maps to GS_GetCallBackInval and GS_SetCallBackInval for VectorScript Access. - Public for VS
	varSnapToToolSnapGeometryOnly		= 460,  // Boolean True-> snap to tool snap geometry only. False ->snap normaly. Used by the attribute mappig tool now to restrict snapping 

	
	// -------------------------------------------------------------------------
	// Header and miscellaneous - JDW, 9/18/01
	varWindowZoomFactor					= 500,	// double	read/write - For internal use only
	
//	varColumnPages						= 501,		UNIMPLEMENTED	XXX_JDW_SDK
//	varRowPages							= 502,
//	varSheetWidth						= 503,
//	varSheetHeight						= 504,
//	varOnePage							= 505,		from pageOrSheet

	varLayerOptions						= 506,	// short	read/write	(ELayerOptions) - Public for VS
	varClassOptions						= 507,	// short	read/write	(EClassOptions) - Public for VS

	varDefaultGradientFill				= 508,	// long		read/write - default gradient fill. - Public for VS
//	varDefaultGradientFillXOffset		= 509,	// double	read/write - UNIMPLEMENTED. X offset of gradient fill from center of object's bounding box.
//	varDefaultGradientFillYOffset		= 510,	// double	read/write - UNIMPLEMENTED. Y offset of gradient fill from center of object's bounding box.
//	varDefaultGradientFillLength		= 511,	// double	read/write - UNIMPLEMENTED. Distance over which a single instance of gradient fill is drawn.
	varDefaultGradientFillAngle			= 512,	// double	read/write - angle of gradient fill relative to object. - Public for VS
	varDefaultGradientFillRepeat		= 513,	// bool		read/write - indicates if gradient is repeated. - Public for VS
//	varDefaultGradientFillTessellate	= 514,	// bool		read/write - UNIMPLEMENTED. Indicates if gradient is tessellated.
	varDefaultGradientFillGeometricType	= 515,	// short	read/write - geometric type of gradient fill. - Public for VS
	varDefaultGradientFillMirror		= 516,	// bool		read/write - indicates if gradient is mirrored. - Public for VS

	varDefaultImageFillMaintainAspectRatio	= 517,	// bool		read/write - indicates if aspect ratio is maintained for image fill. - Public for VS
	varDefaultImageFill					= 518,	// long		read/write - default image fill. - Public for VS
//	varDefaultImageFillXOffset			= 519,	// double	read/write - UNIMPLEMENTED. X offset of image fill from center of object's bounding box.
//	varDefaultImageFillYOffset			= 520,	// double	read/write - UNIMPLEMENTED. Y offset of image fill from center of object's bounding box.
	varDefaultImageFillILength			= 521,	// double	read/write - x distance over which a single instance of image fill is drawn. - For internal use only
	varDefaultImageFillJLength			= 522,	// double	read/write - y distance over which a single instance of image fill is drawn. - For internal use only
	varDefaultImageFillAngle			= 523,	// double	read/write - angle of image fill relative to object. - Public for VS
	varDefaultImageFillRepeat			= 524,	// bool		read/write - indicates if image fill is repeated. - Public for VS
//	varDefaultImageFillTessellate		= 525,	// bool		read/write - UNIMPLEMENTED. Indicates if image fill is tessellated.
	varDefaultImageFillMirror			= 526,	// bool		read/write - indicates if image fill is mirrored. - Public for VS
	varDefaultImageFillFlip				= 527,	// bool		read/write - indicates if image fill is flipped. - Public for VS

	varDefaultFillStyle					= 528,	// long		read/write - default fill style. - Public for VS
	varDefaultFillType					= 529,	// short	read only  - default fill type. - Public for VS

	varDefaultHatchFill					= 530,   // long		read/write - default hatch fill. - Public for VS

	varDefaultImageFillILengthInCurrUnits = 532, // double	read/write - x distance (current units) over which a single instance of image fill is drawn. - Public for VS
	varDefaultImageFillJLengthInCurrUnits = 533, // double	read/write - y distance (current units) over which a single instance of image fill is drawn. - Public for VS


	varHideCavityFactor					= 540,	// short	read/write - layer scales >= varHideCavityFactor will hide wall cavities (Architect Only) - Public for VS

	varSaveViewportCache				= 541, 	// bool		read/write - document preference to save/not save viewport caches. - Public for VS

	varSmoothMesh						= 542,  // bool     read/write - document preference to turn smoothing on for mesh rendering - Public for VS
	varMeshCreaseAngle					= 543,  // double   read/write - crease angle for mesh smoothing to define hard edges - Public for VS
	varUseAutoDrawCoord					= 544,	// bool		read/write - whether to coordinate sheet and drawing numbers for various items - Public for VS

	varTreatSubsequentObjectOperationsTemporary			= 550,  //bool	read/write - Treat Subsequent Object Operations as Temporary or not	[False] - For internal use only
	varTreatSubsequentGlobalSettingsChangesTemporary	= 551,	//bool	read/write - Treat Subsequent Global Settings Changes as Temporary or not [False] - For internal use only

	// Improved autosave
	varAutosaveToCustomLocation							= 552, // Boolean	read/write	- Public for VS
	varKeepBackupsByTime								= 553, // Public for VS
	varAutosaveCustomLocation							= 554, // Str255	read/write	- Public for VS
	varKeepBackupsByNumberValue							= 555, // short		read/write	= Public for VS
	varKeepBackupsByTimeValue							= 556, // Public for VS
	varKeepBackupsByTimeUnit							= 557, // Public for VS

	varCenterView						= 558,					// bool		read/write		default is false.  Performs a Fit-To-Objects after a view change

	varShowTextFilesInPluginEditor		= 560,					// bool		read/write		default is true.   When cleared, text files will not be shown in Plug-In Editor List.

	varReleaseVersionInteger			= 570,					// short	read/write		The release version integer defaults to 0, in which case it is not displayed. If this

	varSymbolToolInsertMode				= 580,	// short	read/write - public for vs - get/set the insertion mode of the symbol tool
	varSymbolToolWallInsertion			= 581,	// bool		read/write - public for vs - get/set the wall insertion mode of the symbol tool
	varSymbolToolAlignementMode			= 582,	// short	read/write - public for vs - get/set the alignment mode of the symbol tool

	varParametricEnableStateEventing	= 590,	// char write - [TParametricStateFlags] - Public for VS
												//				parametrics should receive kParametricAddState event
												//				flags control the type of events to be sent, can be ORed

	varShowSelectionBox					= 1000,	// Boolean 
	varShowSnapBox						= 1001,	// Boolean 
	varAnimationMode					= 1003, // short	
	varCursorPreselectionHighlighting	= 1004,	// Boolean 
	varMarqueePreselectionHighlighting	= 1005,	// Boolean 
	varSnappedObjectHighlighting		= 1006,	// Boolean 
	varToolHighlighting					= 1007,	// Boolean 
	varHighlightingTimer				= 1008, // double  
	varSelectionRadius					= 1009,	// double
	varSnapBoxRadius					= 1010,	// double
	varDisplayHorizontalDPI				= 1011,	// double
	varDisplayVerticalDPI				= 1012,	// double
	varShowSnapPoints					= 1013, // Boolean
	varZoomLineThicknessInSnapLoupe		= 1014, // Boolean
	varOffsetFromSource					= 1015,	// Boolean
	varShowAcquisitionHints				= 1016, // Boolean
	varReferenceGridX					= 1019, // double
	varReferenceGridY					= 1020, // double
	varGridAngleY						= 1021, // double
	varSheetLayerSnapGridX				= 1022, // double
	varSheetLayerSnapGridY				= 1023, // double
	varSheetLayerReferenceGridX			= 1024, // double
	varSheetLayerReferenceGridY			= 1025, // double
	varSheetLayerGridAngleY				= 1026, // double
	varSnapEnd							= 1027,	// Boolean
	varSnapMid							= 1028,	// Boolean
	varSnapCenter						= 1029, // Boolean		
	varSnapQuad							= 1030,	// Boolean							
	varSnapInsertion					= 1031,	// Boolean										
	varSnapVertex						= 1032,	// Boolean														
	varSnapEdge							= 1033,	// Boolean		
	varSnapAnglesDegrees				= 1034, // String
	varPlanRotation						= 1035, // Boolean
	varExtensionLines					= 1036, // Boolean
	varHorizontalVerticalExtensions		= 1037, // Boolean
	varUseAngularExtensions				= 1038, // Boolean
	varUseFloatingSmartPt				= 1039, // Boolean
	varFloatingSmartPtTimeSeconds		= 1040, // double
	varFloatingDatumTimeSeconds			= 1041, // double	
	varUseDatumOffset					= 1042,	// Boolean
	varDatumOffset						= 1043, // double
	varDoFloatingEdges					= 1044, // Boolean
	varFloatingEdgeTimeSeconds			= 1045, // double
	varUseAngleBisector					= 1046, // Boolean
	varDoOffset							= 1047, // Boolean
	varOffsetDistance					= 1048, // double
	varDoCurveExtensions				= 1049, // Boolean
	varDoProportional					= 1050, // Boolean
	varPercent							= 1051, // double
	varDistance							= 1052, // double
	varMultipleDivisions				= 1053, // Boolean
	varAutoUpdateFrequency				= 1054, // short
	varShowOthersInGroupGray			= 1055, // Boolean
	varErrorReportingMode				= 1056, // short
	varOmpParallelTexture				= 1057, // Boolean					
	varOmpParallelImage					= 1058, // Boolean
	varOmpParallelRender				= 1059, // Boolean
	varOmpParallelGeometry				= 1060, // Boolean
	varOmpParallelDTM					= 1061, // Boolean
	varOmpParallelMisc					= 1062, // Boolean
	varShow3DZAxis						= 1063,	// Boolean
};

typedef long SystemVarType;


// Old GetProgramVariable/SetProgramVariable names kept arounbd for SDK compatibility. [MAF 10/2/00]
#define	varUnit1DisplayFrac   162	// long
#define	varUnit1DimPrecision  169	// long
#define	varUnit2DisplayFrac   212	// long
#define	varUnit2DimPrecision  219	// long

#define varUnit1FlagShowDecAsFrac 168	// bitFlag
#define varUnit2FlagShowDecAsFrac 218	// bitFlag



//////////////////////////////////////////////////////////////////////////////////////////
// Tool Objects
enum EToolObjectType {

	kSnapObject,	//	an invisible object is added to the drawing
	kInternalUse1,
	kInternalUse2
};

struct TAddToolObjectData
{
	MCObjectHandle 	fAddObject;
	EToolObjectType	fType;
};

struct MultipleReshapeEventData
{
	MCObjectHandle	fMarqueePoly;
	WorldPt			fMarqueeMoveDistance;
};

//////////////////////////////////////////////////////////////////////////////////////////
// SmartCursor Grid options

//////////////////////////////////////////////////////////////////////////////////////////
// SmartCursor Grid options
enum EGridOptions {
	kGridNone				= 0,
	kGridNormal				= 1,	
	kGridDisableAll			= 2,	
	kGridDisableFloating	= 4		
	//kGridDisableZoom		= 8,
	//kGridPalAlreadySetUp	= 16
};

//////////////////////////////////////////////////////////////////////////////////////////
//	SmartCursor constaint options
enum EConstrainModes {
	eNoConsModes,
	ePointConsModes,
	eLineConsModes,
	eBoxConsModes,
	eLineConsModesSpec,
	eBoxConsModesSpec,
	eHorVerModes,
	eRotBoxModesSpec
};

enum EConstrainType {
	kConsNone			= 0,	//defaults to kConsAngle
	kConsSnapToGrid		= 1,
	kConsSnapToObject	= 2,
	kConsAngle			= 3,	//standard vector constrain mode
	kConsIntersect		= 4,	
	kConsSmartSearch	= 5,	
	kConsFraction		= 6,
	kConsSurface 		= 7,	
#ifdef USE_VW2009_LOGIC_WPCONS_COVERSEDGE
	kConsWP3D			= 7,
#endif
	kConsTangent 		= 8,	
#ifdef USE_VW2009_LOGIC_WPCONS_COVERSEDGE
	kConsWPNormal3D		= 8,
#else
	kConsWP3D			= 8,
#endif
	kConsHorVer			= 9,	//alternate vector constrain mode
	kConsHor 			= 10,	//alternate vector constrain mode
	kConsVer 			= 11,	//alternate vector constrain mode
	kConsSpecialAngle 	= 12,	//alternate vector constrain mode
	kConsSymmetry		= 13,	//alternate vector constrain mode
	kConsParallel		= 14,	//in here for it's old use in tdlist.cpp
#ifdef USE_VW2009_LOGIC_WPCONS_COVERSEDGE
	kConsLockAngle		= 15	//alternate vector constrain mode,always in locked angle mode
#else
	kConsLockAngle		= 15,	//alternate vector constrain mode,always in locked angle mode
	kConsWPNormal3D		= 16
#endif
};

//////////////////////////////////////////////////////////////////////////////////////////
//	DataBar specifiers
enum TDBarModes {
	kVWInternalCustomBar = -2,
	kStandardCustomBar = -1,
	kBlankDataDisplayBar = 0,
	kXYClLaZo = 1,
	kXY = 2,
	kSaAaLAXY = 3,
	kDxDyRaAXY = 4,
	kDxDyTlAXY = 5,
	kDxDyRXY = 6,
	kDxDyLAXY = 7,
	kDxDyArPeXY = 8,
	kA = 9,
	kDxDyLOXY = 10,
	kDxDySxSyXY = 11,

	kXYZClLaZo = 12,
	kVxVyVzYaPi = 13,
	kVz = 14,
	kDa = 15,
	kAzEl = 16,
	kAzElRo = 17,
	kVxVyVzLrUdIo = 18,
	kU1Aw = 19,
	kThXYZ = 20,
	kO1O2WrWhZ = 21,
	kWbWtDz = 22,
	kXYU1 = 23,
	kRaRrRuXYZ = 24,
	kClLaZo = 25,
	
	kLADxDyXY = 26,

	kDzZ = 27,
	kDxDyDzXYZ = 28,
	k3DDxDyXY = 29,

	kAw = 30,


	kLastBarMode
};


//////////////////////////////////////////////////////////////////////////////////////////
// Selectors for DoProgramAction

enum {

	doSelector0 = 0,
	doSelector1 = 1,
	doSelector2 = 2,
	doSelector3 = 3,
	doSelector4 = 4,
	doSelector5 = 5,
	doSelector6 = 6,
	doSelector7 = 7,
	doSelector8 = 8,
	doSelector9 = 9
};

//////////////////////////////////////////////////////////////////////////////////////////
#include "FolderSpecifiers.h"

typedef long FolderSpecifier;

typedef void* VoidPtr;

///////////////////////////////////////////////////////////////////////////////////////////
// File Permissions. Use these to open resource files for reading or writing

// Changed by JDW, [2004-08-02] - See permission comments in ResHandler.X.cpp
//const Byte kFileReadPermission = 1;
const Byte kFileReadPermission = 0;					// RsrcMgr::kReadPermission		= 0		// fsCurPerm	= 0x00,   
//const Byte kFileWritePermission = 2;
const Byte kFileReadWritePermission = 3;			// RsrcMgr::kWritePermission	= 3		// fsRdWrPerm	= 0x03
//const Byte kFileReadWriteSharePermission = 4;	
const Byte kFileReadWrite = kFileReadWritePermission;


//////////////////////////////////////////////////////////////////////////////////////////
// GSErrors

typedef unsigned long GSError;

typedef GSError MCErr;

// No error occurred.
const GSError noError =				0x00000000;

// general errors
const GSError badParameterErr =		0x01000001;	// One or more of the parameters passed to the
												// SDK function are illegal. This can include nil handles.

// general MiniCAD Object errore
const GSError illegalObjectErr =	0x02000004;	// Can't do the requested operation on this object.

// Operating system related errors
const GSError otherOSErr =			0x03000001;	// Unspecified operating system error
const GSError fileNotFoundErr =		0x03000002;	// No such file
const GSError dirNotFoundErr =		0x03000003;	// No such directory
const GSError illegalNameErr =		0x03000004;	// bad filename
const GSError diskFullErr =			0x03000005;	// disk or directory full
const GSError duplicateFilenameErr =0x03000006;	// filename already exists
const GSError lockedErr =			0x03000007;	// file or volume locked
const GSError fileInUseErr =		0x03000008;	// file is already open

// other errors
const GSError nameNotUniqueErr =	0x04000001;	// Object name not unique
const GSError nameTableFullErr =	0x04000002;	// Name table is full -- can't add any more names.


//////////////////////////////////////////////////////////////////////////////////////////
// Type definitions

// JAK 10/17/97
// I don't know why Str20 is defined as 22 bytes instead of 21 bytes.  
// Apple's convention (in Types.h) is to defined it one byte bigger than name because of length byte.
// Perhaps this definition includes a byte of padding, so it is an even size.
// I cannot change its size now because of dependencies (both internal and external), 
// and don't have time to rename it to Str21.
	
//  yes str20                             

typedef unsigned char Str63[64];
typedef const unsigned char *ConstStr63Param;
typedef unsigned char Str20[22];
typedef const unsigned char *ConstStr20Param;
typedef unsigned char Str7[8];
typedef const unsigned char *ConstStr7Param;

typedef long  InternalIndex;  // represents a SysName
typedef Str63 InternalName;   // represents a RefName, but for the SDK it's a straight Str63, not a PStr63

#define kUserDataTypeSize 44

#ifndef _MINICAD_
	struct ObjectColorType {
		ColorRef fillFore, fillBack, penFore, penBack;
	};

inline bool operator==(const ObjectColorType& o1, const ObjectColorType& o2)
	{ return o1.fillBack == o2.fillBack && o1.fillFore == o2.fillFore && o1.penBack == o2.penBack && o1.penFore == o2.penFore; }
inline bool operator!=(const ObjectColorType& o1, const ObjectColorType& o2)
	{ return !(o1 == o2); }


	struct UserDataType {
		char      reserved[kUserDataTypeSize];
		/*  User data goes here
		*/
	};
#endif


//////////////////////////////////////////////////////////////////////////////////////////
// Text


// kTextError is returned in place of vertical, horizontal, flip, or spacing constants
// or text length in case there is a parameter error in the SDK call

const short kTextError = -1;

// text flip
enum {
	kTextNoFlip = 0,
	//kTextHorizontalFlip = 1,		- equivalent to kTextVerticalFlip and 180 degree rotation.
	kTextVerticalFlip = 2
};

// text style
// NOTE - Outline and Shadow text styles are only displayed on the Mac.
enum {
	kTextStylePlain		= 0,
	kTextStyleBold		= 1,
	kTextStyleItalic	= 2,
	kTextStyleUnderline	= 4,
	kTextStyleOutline	= 8,
	kTextStyleShadow	= 16
};
typedef short TStyle;

// text vertical alignment
enum {
	kTextTopBox = 1,
	kTextTopBaseline = 2,
	kTextCenterBox = 3,
	kTextBottomBaseline = 4,
	kTextBottomBox = 5
};
typedef short TVAlignment;


// text horizontal alignment
enum {
	kTextGeneralJustify = 0,			// only used by the Worksheet
	kTextLeftJustify = 1,
	kTextCenterJustify = 2,
	kTextRightJustify = 3
};
typedef short THAlignment;



// text vertical spacing
enum {
	kTextCustomLeading = 0,
	kTextSingle = 2,
	kTextThreeHalves = 3,
	kTextDouble = 4
};
typedef short TSpacing;


const short kTextNoSelection = -1;	// use this constant when there is more than one selection

// flags for disabling controls in the format text dialog
// ABZ: These flags should be either recalculated or used by a NAND bitwise operatot rather than an AND bitwise operator.
typedef Byte TDisableMask;

const Byte kFontFlag 		= 0x01;
const Byte kSizeFlag 		= 0x02;	
const Byte kSpacingFlag 	= 0x04;
const Byte kStyleFlag		= 0x08;
const Byte kHAlignFlag		= 0x10;
const Byte kVAlignFlag		= 0x20;
const Byte kWorksheetFlag	= 0x40;


struct FormatTextType { 
	
	// all fields but the disable mask are input and output fields
	// input values indicate the dialog defaults
	// ouput values indicate the user selection

	Str255			ioFontName; 	// empty for no selection		
	Byte			ioStyle;		// uses the Mac style constants, 0xff for no selection			
	WorldCoord		ioSize;    		// the font size in WorldCoord's
	TSpacing		ioSpacing;		// see TSpacing constants above
	WorldCoord		ioLeading;		// custom leading in WorldCoord's, -1 for no selection
	THAlignment		ioHAlignment;
	TVAlignment		ioVAlignment;
	TDisableMask	iDisableMask;	// pass 0 to enable all controls
	bool 			cFlag;          // Control status of FormatTextDialog Ok/Cancel button
};


// There will likely be more flags here later - JDW
enum EStringCompare 
// Used for GS_CStringEqual() and GS_CStringCompare()
// VW names use kIgnoreCase and kIgnoreDiacritics for GS_CStringEqual():  
//		'foo' and 'Fo<umlaut>o<acute>' are equal strings
// VW normally uses kIncludeCase for sorting strings with GS_CStringCompare()
{
	kIncludeCase			= 0x0001,	// A != a
	kIgnoreCase				= 0x0002	// A == a
//	kIncludeDiacritics		= 0x0004,	// A != A<umlaut>
//	kIgnoreDiacritics		= 0x0008,	// A == A<umlaut>	Currently diacritics are always ignored 
};

enum EStringCompareResult 
// Used only for GS_CStringCompare (GS_CStringEqual returns a boolean)
{
	kEqualStrings			= 0,
	kFirstStringSmaller		= -1,
	kFirstStringBigger		= 1
};

//////////////////////////////////////////////////////////////////////////////////////////
// VertexType - for specifying polyline vertices

enum {
	vtCorner		= 0,
	vtBezier		= 1,
	vtCubic			= 2,
	vtArc			= 3
};
typedef long VertexType;


//	
enum {
	kPolyDirectionClockwise				= -1,
	kPolyDirectionCounterClockwise		= 0,
	kPolyDirectionError					= 1
};
typedef long PolyDirectionSpecType;

enum {
	kLowConvertToPolyResolution	= 16,
	kMedConvertToPolyResolution	= 64,
	kHighConvertToPolyResolution	= 128,
	kVeryHighConvertToPolyResolution = 512
};
typedef short TConvertToPolyResolution;

//////////////////////////////////////////////////////////////////////////////////////////
// ArrowType - for specifying arrowheads using the old style calls

enum {
	arArrow			= 0,
	arTightArrow	= 1,
	arBall			= 2,
	arSlash			= 3,
	arCross			= 4
};
typedef long ArrowType;


//////////////////////////////////////////////////////////////////////////////////////////
// MarkerType - for specifying marker styles using the new marker calls

enum {
// Simple Constants
	// Tail
	kTailMarker					= 32768,  // Meaningless for kCircleMarker, kDimCrossMarker, kLassoMarker, kHexagonMarker, kConeMarker and kRectangleMarker
	// Half Tick
	kLeftHalfTickMarker			= 16384,  // Half-Tick Constants Meaningless for kLassoMarker and kConeMarker
	kRightHalfTickMarker		= 24576,
	// Base
	kFlatBaseMarker				= 0,
	kOpenBaseMarker				= 1024,   // Base Constants only Meaningful for kArrowMarker and kConcaveCurvedArrowMarker
	kAngleBaseMarker			= 2048,
	kArcBaseMarker				= 3072,
	// Fill
	kLineColorFillMarker		= 0,
	kWhiteFillMarker			= 128,    
	kNoFillMarker				= 256,	  // kNoFillMarker is the only valid setting for kLassoMarker, kDimSlashMarker, kDimCrossMarker, 
	// Root Type
	kArrowMarker				= 0,
	kConcaveCurvedArrowMarker	= 1,
	kCircleMarker				= 2,
	kDimSlashMarker				= 3,
	kDimCrossMarker				= 4,
	kLassoMarker				= 5,
	kHexagonMarker				= 6,
	kVShapedMarker				= 7,
	kConeMarker					= 8,
	kTaperedVShapedMarker		= 9,
	kSShapedMarker				= 10,
	kRectangleMarker			= 11,
	
// More Useful Composite Constants. Use these instead of certain Simple Constants.
	kOpenBaseNoFillMarker		= 1280,	// Use this for any Open Base marker instead of just kOpenBaseMarker. You don't want it to have a fill.
	kNoFillLassoMarker			= 261,  // Use this for any Lasso Marker instead of kLassoMarker
	kNoFillDimSlashMarker		= 259,  // Use this for any Lasso Marker instead of kLassoMarker
	kNoFillDimCrossMarker		= 260,  // Use this for any Cross Marker instead of kDimCrossMarker
	kNoFillConeMarker			= 264,  // Use these for Cone Markers as appropriate instead of kConeMarker
	kWhiteFillConeMarker		= 136
};

const CBUnsignedShort kMarkerRootTypeMask = 127;	// && with a MarkerType to get just the RootType ( example: if((myMarkerType && kMarkerRootTypeMask) == kArrowMarker) { doSomething(); } )
const CBUnsignedShort kMarkerFillMask = 896;		// && with a MarkerType to get just the Fill
const CBUnsignedShort kMarkerBaseMask = 7168;		// && with a MarkerType to get just the Base
const CBUnsignedShort kMarkerHalfTickMask = 24576;	// && with a MarkerType to get just the Half-Tick value (0 is a Full marker)
const CBUnsignedShort kMarkerTailMask = 32768;		// && with a MarkerType to get just the Tail value (0 is "not tail")

typedef signed char MarkerVisibility;	
const MarkerVisibility  kMarkerVisibilityUndefined = -1;		
const MarkerVisibility	kMarkerVisibilityMarkerNotVisible = 0;		
const MarkerVisibility	kMarkerVisibilityMarkerVisible = 1 ;  	

typedef signed char MarkerThicknessBasis; 
const MarkerThicknessBasis	kMarkerThicknessLineThickness = 0;
const MarkerThicknessBasis	kMarkerThicknessDimThickness = 1;
const MarkerThicknessBasis	kMarkerThicknessCustomThickness = 2;

const MarkerThicknessBasis	kMarkerThicknessUnitsMils = 0;
const MarkerThicknessBasis	kMarkerThicknessUnitsPoints = 16;
const MarkerThicknessBasis	kMarkerThicknessUnitsMillimeters = 32;

const MarkerThicknessBasis	kMarkerThicknessBasisMask = 15;
const MarkerThicknessBasis	kMarkerThicknessUnitsMask = -16;

typedef CBUnsignedShort MarkerType;

//////////////////////////////////////////////////////////////////////////////////////////
// SMarkerStyle - structure for setting markers using the SDK calls

struct SMarkerStyle {
	MarkerType	style;
	Sint8		nAngle;
	double		dSize;
	double		dWidth;
	Uint8		nThicknessBasis;
	double		dThickness;
	
};

// Example of how to use the marker constants:
//
// SMarkerStyle marker;
// marker.style =  kArrowMarker + kOpenBaseNoFillMarker;											/* MarkerType */
// marker.nAngle = 15;																				/* Angle */
// marker.dSize = 0.125;																			/* Length */
// marker.dWidth = 0.125;																			/* Width */
// marker.nThicknessBasis = kMarkerThicknessCustomThickness + kMarkerThicknessUnitsMillimeters;		/* Thickness Basis & Units */
// marker.dThickness = 2.0;																			/* Thickness Value */
//
//	GS_SetObjBeginningMarker(	object /* theObject */ , marker /* The marker */, kMarkerVisibilityMarkerVisible /* Visibility */);									
//
//
//////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////
// Text style descriptoin
struct STextStyle {
	Sint16			fontIndex;
	Sint32			nFontSize;
	bool			bBold;
	bool			bItalic;
	bool			bUnderlined;
};

//////////////////////////////////////////////////////////////////////////////////////////
// BoundsType - for what kind of bounds to retrieve

enum {
	kGeometricBounds			= 0,	// for an object like a locus, just gives the point the locus is at
	kRefreshBounds				= 1		// for an object like a locus, gives a rectangle that encloses what
										// is drawn on screen to represent the locus
};
typedef CBSignedShort BoundsType;



//////////////////////////////////////////////////////////////////////////////////////////
// Selectors for ForEachObject

enum {
	allSelected					= 0,
	allEditable					= 1,
	allVisible					= 2,
	allDrawing					= 3,
	allSymbolDefs				= 4,
	allSelectedAndEditable		= 5,
	allObjects					= 6,
	
	descendIntoGroups = 32,
	descendIntoAll = 64,
	descendIntoViewports = 128
};


//////////////////////////////////////////////////////////////////////////////////////////
// TNumStyle - for worksheets & records

typedef unsigned char			TNumStyleClass;

const TNumStyleClass
// XXX_JDW_ALTURA [2003-02-24] - Check this - might be wrong
	// The first four are treated the same by GS_StringToDouble,
	// allowing international formats like "1.300,24", 
	// and can do math, but do not allow fractions like
	// 1 5/8  (just 5/8 will work). One of the international 
	//	thousands separators is a space, so "1 234/500" is ambiguous.
	nsGeneral				= 0,
	nsFixDecimal			= 1,
	nsDecwCommas			= 2,
	nsScientific			= 3,	// Exponential: 1.567e+56, 2.678e-94, etc.

	nsFractional			= 4,	// Numbers like 1/2, 34 7/64. Denominator is power of 2 up to 64.
	nsDimension				= 5,	// in WorldCoords / drawing units
	nsAngle					= 6,	// Degrees 
	nsDate					= 7,
	nsConditional			= 8,	// Boolean - don't use unless you know what it's for.
	nsGeneralFrac			= 9,	// Fraction with unreduced denominator that is (currently, 2/22/00)
									//	105840000 == 128 * 27 * 625 * 49  (2^7 * 3^3 * 5^4 * 7^2 
									//  for components of nice typical denominators)
	nsDimensionWithDivider	= 10,	// Same as nsDimension but for use in output-only situations where the 
									//	current units format is feet and inches
									//	and you want a feet and inch divider. ie, 10'-5" vs 10'5".
									//	Do not use in any edit text fields because the divider dash will be 
									//	mistaken for a minus sign. 
	nsDimensionArea			= 11,
	nsDimensionVolume		= 12,
	nsText					= 13,  //Text Format For Worksheets

	nsUseDefault			= 127;	// Special case for telling conversion routine to use format's style.
									//	Don't use it unless you know what it's for.


//--------------------------------------------------------------------
#pragma pack(push, 2) // BEGIN 2 BYTE STRUCTURE ALIGNMENT (.vwx file format)

struct TNumStyle {
	TNumStyleClass				numStyleClass;	// Number style.
	Sint8						accuracy;		// see comment below
	
	void ByteSwap() { }	// Nothing to swap.
};

#pragma pack(pop) // END 2 BYTE STRUCTURE ALIGNMENT (.vwx file format)
//--------------------------------------------------------------------


/* The accuracy field represents:
		for general: May be ignored by some routines; overrides default max # of decimal places.
		for fixDecimal, decwCommas, and scientific: The # of decimal places.
		for fractional: Denominator to round to minus 2. (e.g. to round to nearest 1/2, store 0.)
		for dimension: Ignored.
		for angle: 1 = , 2 = ', 3 = '".
		for date : Date format.
*/

typedef TNumStyle				TNumStyleRef;

//////////////////////////////////////////////////////////////////////////////////////////
// TCellBorder for worksheet cell borders
//--------------------------------------------------------------------
#pragma pack(push, 2) // BEGIN 2 BYTE STRUCTURE ALIGNMENT (.vwx file format)

struct TCellBorder {
	Uint8		Weight;		// border line weight
	Sint8		Style;		// border line style
	ColorRef	Color;		// border color
	Bool8		Enable;		// Is this border visible?
	Byte		pad[1];		// padding for alignment

	void ByteSwap();

};
#pragma pack(pop) // END 2 BYTE STRUCTURE ALIGNMENT (.vwx file format)
//--------------------------------------------------------------------

//////////////////////////////////////////////////////////////////////////////////
// -------------------------------------------------------------------------------
// Export 3DS Render types and enums.

struct STessVertex {
	WorldPt3	pt;			// coordinate of vertex
	WorldPt3	normal;		// normal of this vertex
	double		u;			// texture U coordinate for vertex
	double		v;			// texture V coordinate for vertex
};

struct STessMaterial {
	long			materialRef;
	GSColor			objColor;
	MCObjectHandle	hMaterial;
	float			transparency;	// 0.0 - no transparency; 1.0 - fully transparent
};

struct STessTraingle {
	STessVertex		A;
	STessVertex		B;
	STessVertex		C;
	size_t			indexA;				// index of vertex A
	size_t			indexB;				// index of vertex B
	size_t			indexC;				// index of vertex C

	STessMaterial	material;
	WorldCube		totalBoundingCube;	// total bounding cube untill this triangle

	size_t			totalVertexCount;	// total count of vertices in this mesh
	size_t			totalFacesCount;	// total count of faces in this mesh
};

enum ETessProcReason {
	kTessProcBeginFace,
	kTessProcAddTriangle,
	kTessProcEndFace
};

typedef void*	TTesselator;
typedef void (*GS_TessellateIteratorProcPtr)(ETessProcReason reason, STessTraingle triangle, CallBackPtr cbp, void* pEnv);


//////////////////////////////////////////////////////////////////////////////////////////
//	Field Types
//
//	Used by RecordHandler, RecordNode, FormatNode, Plug-ins (formerlay known as Externals), Plug-in Objects,
//	both internally and externally.
//	Constants kFieldCoordDisp through kFieldCoordLocY were added 10/7/97 for new Plug-in Object fields.
//
//	JAK 9/1/98
//	These constants were moved here from both RecordHandler.x and MObject.h.
//	They are easier to maintain if there is one set of constants defined in one place.


enum EFieldStyle {
	kFieldLongInt		= 1,
	kFieldBoolean		= 2,
	kFieldReal			= 3,
	kFieldText			= 4,
	kFieldCalculation	= 5,
	kFieldHandle 		= 6,
	kFieldCoordDisp		= 7,
	kFieldPopUp			= 8,
	kFieldRadio			= 9,
	kFieldCoordLocX		= 10,	
	kFieldCoordLocY		= 11,
	kFieldStaticText	= 14,
	kFieldControlPoint	= 15,
	kFieldDimStdPopUp	= 16,
	kFieldPrecisionPopUp = 17
};

//
// EPluginObjectSubType indicates the subtype of the Plug-in Object.
// 		kHybridSymbolLike is a point-based object, introduced in VW 8.0.0
// 		kLineLike and kBoxLike objects behave similar to lines and rotated rectangles, introduced in VW 8.5
//		k2DPathLike and k3DPathLike were introduced in VW 9.0.0
//
// 4/7/2000, JAG:
// Moved this enum here from ParametricObj.h, renamed the type, and added kPathLike.


#define GS_CustomSubtype_SAJ 

enum EPluginObjectSubType {kHybridSymbolLike = 0, kLineLike = 10, kBoxLike = 20, k2DPathLike = 30, k3DPathLike = 40
#ifdef GS_CustomSubtype_SAJ
, kCustomSubtype = 50	//	Object definition handles custom insertion eventss
#endif	//	GS_CustomSubtype_SAJ
};
const long kPathPlugin = 0xa0a0b0b0;		// Special message value to indicate that a path plugin is calling the tool.


//////////////////////////////////////////////////////////////////////////////////////////
//	SDK Plug-in Library Routine Argument Types
//
//	Used by SDK Plug-in Library Routines to describe the types of their arguments.
//	Enter these numbers into the 'VLIB' resource's "Argument Type" field.
//
typedef short	EPluginLibraryArgType;
const EPluginLibraryArgType 	kNullArgType 			= 0;
const EPluginLibraryArgType 	kIntegerArgType			= 1;		// use intValue field of PluginLibraryArg structure below...
const EPluginLibraryArgType 	kIntegerVarArgType		= 2;		// use intValue
const EPluginLibraryArgType 	kLongArgType			= 3;		// use longValue
const EPluginLibraryArgType 	kLongVarArgType			= 4;		// use longValue
const EPluginLibraryArgType 	kRealArgType			= 5;		// use realValue
const EPluginLibraryArgType 	kRealVarArgType			= 6;		// use realValue
const EPluginLibraryArgType 	kAngleArgType			= 7;		// use realValue
const EPluginLibraryArgType 	kDistanceArgType		= 8;		// use realValue
const EPluginLibraryArgType 	kPointArgType			= 9;		// use ptValue in SDK.  Use 2 REAL variables in VS.
const EPluginLibraryArgType 	kGlobalPointArgType		= 10;		// use ptValue in SDK.  Use 2 REAL variables in VS.
const EPluginLibraryArgType 	kGlobalPointVarArgType	= 11;		// use ptValue in SDK.  Use 2 REAL variables in VS.
const EPluginLibraryArgType 	k3DPointArgType			= 12;		// use pt3Value in SDK.  Use 3 REAL variables in VS.
const EPluginLibraryArgType 	k3DPointVarArgType		= 13;		// use pt3Value in SDK.  Use 3 REAL variables in VS.
const EPluginLibraryArgType 	kVectorArgType			= 14;		// use vec.vecValue
const EPluginLibraryArgType 	kVectorVarArgType		= 15;		// use vec.vecValue
const EPluginLibraryArgType 	kBooleanArgType			= 16;		// use boolValue
const EPluginLibraryArgType 	kBooleanVarArgType		= 17;		// use boolValue
const EPluginLibraryArgType 	kStringArgType			= 18;		// use strValue
const EPluginLibraryArgType 	kStringVarArgType		= 19;		// use strValue
const EPluginLibraryArgType 	kCharArgType			= 20;		// use charValue
const EPluginLibraryArgType 	kCharVarArgType			= 21;		// use charValue
const EPluginLibraryArgType 	kCharDynarrayArgType	= 22;		// use dadValue
const EPluginLibraryArgType 	kCharDynarrayVarArgType	= 23;		// use dadValue
const EPluginLibraryArgType 	kCharArrayVarArgType	= 24;		// use dadValue
const EPluginLibraryArgType 	kHandleArgType			= 25;		// use handleValue
const EPluginLibraryArgType 	kHandleVarArgType		= 26;		// use handleValue
const EPluginLibraryArgType 	kColorArgType			= 27;		// use intValue
const EPluginLibraryArgType 	kColorVarArgType		= 28;		// use intValue
const EPluginLibraryArgType 	kStyleArgType			= 29;		// use styleValue

const EPluginLibraryArgType		kPointRecArgType		= 30;		// use ptValue in SDK.  Use new "POINT" data structure in VS.  New for VW 10.
const EPluginLibraryArgType		kPointRecVarArgType		= 31;		// use ptValue in SDK.  Use new "POINT" data structure in VS. New for VW 10.
const EPluginLibraryArgType		kPoint3DRecArgType		= 32;		// use pt3Value in SDK. Use new "POINT3D" data structure in VS. New for VW 10.
const EPluginLibraryArgType		kPoint3DRecVarArgType	= 33;		// use pt3Value in SDK. Use new "POINT3D" data structure in VS. New for VW 10. 
const EPluginLibraryArgType		kRGBColorRecArgType		= 34;		// use colorVar in SDK. Use new "RGBCOLOR" data structure in VS. New for VW 10.
const EPluginLibraryArgType		kRGBColorRecVarArgType	= 35;		// use colorVar in SDK. Use new "RGBCOLOR" data structure in VS. New for VW 10.
const EPluginLibraryArgType		kVoidPtr				= 36;					// 



struct PluginLibraryArg {
	EPluginLibraryArgType argType;			// type of this argument
	union {
		double_gs				realValue;	// for kRealArgType, kRealVarArgType, kAngleArgType, kDistanceArgType
		Boolean 				boolValue;	// for kBooleanArgType, kBooleanVarArgType
		unsigned char			charValue;	// for kCharArgType, kCharVarArgType
		short					intValue;	// for kIntegerArgType, kIntegerArgVarType, kColorArgType
		long					longValue;	// for kLongArgType, kLongVarArgType
		GSStr255				strValue;	// for kStringArgType, kStringVarArgType
		GSHandle 				handleValue;// for kHandleArgType, kHandleVarArgType
		_WorldPt				ptValue;	// for kPointArgType, kGlobalPointArgType, kGlobalPointVarArgType
		_WorldPt3				pt3Value;	// for k3DPointArgType, k3DPointVarArgType
		_WorldPt3				vecValue;	// for kVectorArgType, kVectorVarArgType
		unsigned char			styleValue;	// for kStyleArgType
		void*					voidData;	// for kVoidPtr
		

		struct {							// for kColorVarArgType
			long				redValue;
			long				greenValue;
			long				blueValue;
		} colorVar;
		struct {
			GSHandle			textHdl;	// for kCharDynarrayVarArgType
			unsigned char*		textPtr;	// for kCharDynarrayArgType, kCharArrayVarArgType
			short				textLen;	// for kCharDynarrayArgType, kCharArrayVarArgType
		} dynVar;
	};
};

const short kMaxPluginLibraryArgs = 10;
struct PluginLibraryArgTable {
	PluginLibraryArg args[kMaxPluginLibraryArgs];
	PluginLibraryArg functionResult;
};
	
// SDK Plug-in Library Routine constants for "Scope" field of VLIB resource.
const Uint8 kVLIBScopeUniversal				= 0;		// Call from anywhere: VS, SDK, VW.
const Uint8 kVLIBScopeVSOnly 				= 1;		// Only VS can call this library routine.
const Uint8 kVLIBScopeSDKOnly				= 2;		// Only SDK Plug-ins can call this library routine.
const Uint8 kVLIBScopeNemetschekOnly		= 255; 		// prevents calling from VectorScript and SDK.  Only from within VectorWorks application.


//////////////////////////////////////////////////////////////////////////////////////////
// Units

const short unitsTooPrecise	= 1;
const short unitsNotPreciseEnough = 2;

struct UnitFlagsType {
	unsigned short				showUnits:1;			// Should the unit mark be displayed with numbers
	unsigned short				leading0:1;				// Leading 0's
	unsigned short				trailing0:1;			// Trailing 0's
	unsigned short				useMinUnit:1;			// Round dimensions to displayAccuracy
	unsigned short				customUnit:1;			// Was this specified as a custom unit
	unsigned short				showDecAsFractions:1;	// Show base-10 accuracies as fractions
	unsigned short				f6:1;
	unsigned short				f7:1;
	unsigned short				f8:1;
	unsigned short				f9:1;
	unsigned short				f10:1;
	unsigned short				f11:1;
	unsigned short				f12:1;
	unsigned short				f13:1;
	unsigned short				f14:1;
	unsigned short				f15:1;
};

const short 	ufDecimal			= 0;	// anything but feet and inches
//const short	ufFractional		= 1;	obsolete
const short		ufFeetAndInches		= 2;
//const short	ufFracFeetAndInches	= 3;	obsolete
const short 	ufDegrees			= 3;
struct UnitsType {
	WorldCoord						storedAccuracy;		// Coords/unit
	short						format;				// Display format
	double_gs					unitsPerInch;		// units/inch
	Str7						unitMark;			// Unit string at end of each dimension
	long						displayAccuracy;	// Largest denominator displayed
	UnitFlagsType				unitFlags;			// Various flags
};


//////////////////////////////////////////////////////////////////////////////////////////
// Mesh Errors

#ifndef _MINICAD_
enum {
	kMeshNoError = 0,
	kMeshMemoryError = -1,
	kMeshSizeLimitError = -2,
	kMeshOtherError = -3
};
typedef short MeshErrorType;
#else
enum MeshErrorType {
	kMeshNoError = 0,
	kMeshMemoryError = -1,
	kMeshSizeLimitError = -2,
	kMeshOtherError = -3
};

#endif


//////////////////////////////////////////////////////////////////////////////////////////
// Dash Styles

const short kMaxDashPats		= 128;	// Maximum number of dash patterns (was 16 until 7.0)
const short kMaxDashSegs		= 10;	// Maximum # of segments per pattern

struct DashPatType {
	Boolean		scaleThick;
	Sint8 		numSegs;
	double_gs	cumLengths[kMaxDashSegs];
};


//////////////////////////////////////////////////////////////////////////////////////////
// Symbol Tool
//
// If additional modes or alingment types are added, update the corresponding Count constant
//
typedef short SymbolToolModeType;
const SymbolToolModeType	kSymbolToolRegularInsert	= 1;
const SymbolToolModeType	kSymbolToolOffsetInsert		= 2;
const SymbolToolModeType	kSymbolToolPickup			= 3;

const SymbolToolModeType	kSymbolToolModeFirst	= kSymbolToolRegularInsert;
const SymbolToolModeType	kSymbolToolModeCount	= kSymbolToolPickup;

typedef short SymbolToolAlignType;
const SymbolToolAlignType	kSymbolToolAlignLeft	= 1;
const SymbolToolAlignType	kSymbolToolAlignCenter	= 2;
const SymbolToolAlignType	kSymbolToolAlignRight	= 3;
const SymbolToolAlignType	kSymbolToolAlignNatural	= 4;

const SymbolToolAlignType kSymbolToolAlignFirst	= kSymbolToolAlignLeft;
const SymbolToolAlignType kSymbolToolAlignCount	= kSymbolToolAlignNatural;




//////////////////////////////////////////////////////////////////////////////////////////
// Walls

#ifndef _MINICAD_
const short kSymbolBreak		= 1;
const short kHalfBreak			= 2;
const short kPeakBreak			= 3;
const short kCapBreak			= 4;
#endif

//---------------------------------
typedef short InsertModeType;

// The InsertModeType specifies where the symbol is inserted. It is used for in both the 
// SymbolBreakType structure and the Get/Set object variable functions for Symbol definitions.

const InsertModeType kSymInsertOnCenter		= 0;			// insert at the center of the wall
const InsertModeType kSymInsertOnEdge		= 1; 			// Symbol Defs do not distinguish between left and right.

const InsertModeType kSymInsertOnLeftEdge	= 1; 			// insert on the edge of the wall
const InsertModeType kSymInsertOnRightEdge	= 2; 			// 


//---------------------------------
typedef short BreakModeType;

// The BreakModeType specifies the kind of break the symbol creates. It is used for in both the 
// SymbolBreakType structure and the Get/Set object variable functions for Symbol definitions.

const BreakModeType kSymFullBreakWithCaps 	= 1;			// lines are drawn over the ends of the wall where broken
const BreakModeType kSymFullBreakNoCaps		= 2;			// no lines to cap the symbol break
const BreakModeType kSymHalfBreak			= 3; 			// for edge insertion only - only one line is broken for the symbol
const BreakModeType kSymNoBreak				= 4;			// wall does not break for the inserted symbol


struct SymbolBreakType {
	MCObjectHandle		theSymbol;		/* Handle to the symbol inserted */
	Boolean				rightSide;		/* Is the symbol oriented to the right side of the wall */
	Boolean				flipH;			/* Is the symbol flipped toward the first point of the wall */
	WorldCoord			height;			/* Height of the bottom of the symbol from the ground plane */
//	Boolean				capBreakEnds - removed: this functionality has been repleaced by the breakMode field
										
	InsertModeType		insertMode; 	// which edge is the symbol inserted on
	BreakModeType		breakMode;		// break style for the symbol
	Boolean				cornerBreak;	// the symbol will move to the corner
	
	SymbolBreakType(): 					/* constructor sets options for standard center insertion */
		theSymbol(NULL), rightSide(false), flipH(false), height(0),  
		insertMode(kSymInsertOnCenter), breakMode(kSymFullBreakWithCaps),
		cornerBreak(false) {}
};

struct HalfBreakType {
	Boolean			rightSide;		/* Is the break on the right side of the wall */
	WorldCoord		gapWidth;		/* Size of gap opening */
	MCObjectHandle	polyBreakObject;/* optional break geometry*/
	
	HalfBreakType(): polyBreakObject(NULL) {}
};

struct CapBreakType {
	WorldCoord		rightOff;		/* Distance that the right cap end is from the ÒnormalÓ end */
	WorldCoord		leftOff;		/* Distance that the left cap end is from the ÒnormalÓ end */
	Boolean			closed;			/* Is the end of the wall closed */
	Boolean			round;			/* Is the cap rounded or flat */
	MCObjectHandle	polyBreakObject;/* optional break geometry */
	
	CapBreakType(): polyBreakObject(NULL) {}
};

struct PeakBreakType {
	WorldCoord		peakHeight;		/* Height of the peak from the ground plane */
	Boolean		topPeak;		/* Is the peak on the top face of the wall */
};

// The wall cap attributes type
enum EWallCapAttributesType
{
	eWallCapAttributesType_wallLine,		// Wall line
	eWallCapAttributesType_componentLines	// Component lines
};

// The wall texture part assigned to the faces created in a wall by a cutting object in the 3D Wall Hole group of a symbol or plug-in object
enum EWallHoleTexturePart
{
	eWallHoleTexturePart_holes,
	eWallHoleTexturePart_left,
	eWallHoleTexturePart_right
};

// The type of a Wall Feature
enum EWallFeatureType
{
	eWallFeatureType_projection,
	eWallFeatureType_recess
};



//////////////////////////////////////////////////////////////////////////////////////////
// NurbsCurve plannar info for extrude along path plug in  -- Charlene Mao
struct CurveInfo{
	MCObjectHandle inHandle;
	double         tol;
};

struct ConvertToNurbs{
	MCObjectHandle inHandle;
	MCObjectHandle outHandle;
};

struct CurvePlanarInfo{
    bool           isPlanar;        
};

struct ExtrudeAlongPathInfo{
	MCObjectHandle pathHandle;
	MCObjectHandle profileHandle;
	MCObjectHandle outHandle;
	bool bExponential;
	double scale;
	bool bLockDirection;
};

struct CreateLinkedViewportInfo{
	MCObjectHandle linkedMarkerHandle;
	MCObjectHandle unSectionedViewportHandle;
};

struct UpdateLinkedMarkerDefInfo{
	MCObjectHandle linkedMarkerHandle;
};

struct TextAlongPathInfo{
	MCObjectHandle pathHandle;
	MCObjectHandle textHandle;
	MCObjectHandle outHandle;
	short iHowToPlaceText;
	short iTextType;
	double height;
	bool   bAbove;
	double rotateAngle;
	bool   bDoPolyline;
};

struct HelicalAlongCurveInfo{
	MCObjectHandle pathHandle;
	MCObjectHandle outHandle;
	double	radius1;
	double	radius2;
    double	startAng;
	double*	pitch;
	double*	numTurns;
	bool	bPitch;
	bool	bReverseTwist;
	bool	bFlat;
};


struct IsNurbsCurveG1Cont{
	MCObjectHandle inHandle;
	bool           isG1Continuous;
};


struct CreateRoofLayerInfo {
	MCObjectHandle	outSelectLayerhandle;
	long			outError;
};

struct TransferViewportAttributes {
	MCObjectHandle	sourceHandle;
	MCObjectHandle	targetHandle;
	bool			copySource;
	bool			differentDocument;
	bool			transferClassVis;
	bool			transferLayerVis;
	bool			transferClassOverride;
	bool			transferLayerOverride;
	bool			transferOtherProperties;
	bool			deleteTemporaryData;
	bool			classDoesNotExist;
	bool			layerDoesNotExist;
	bool			resourceDoesNotExist;
	bool			usingDocClassVisibility;

	TransferViewportAttributes() {
		sourceHandle = NULL;
		targetHandle = NULL;
	}
};

struct MoveAllObjectsByLayerHeightInfo{
	MoveAllObjectsByLayerHeightInfo()
	{
		addUndoMovePrimitive = false;
		addHeight = true;
		adjustLinkedWallHeight = true;
	}

	bool	addUndoMovePrimitive;
	bool	addHeight;
	bool	adjustLinkedWallHeight;
};

//////////////////////////////////////////////////////////////////////////////////////////
// Textures

struct TransferTexture {
	MCObjectHandle	objHandle;
	bool			useResolveMaterials;
	bool			dropTexture;
};

#ifndef _MINICAD_
const short kPrimary			= 0; // All parts (for single-textured objects), or wall right, or roof top - OLD, see TexturePartSDK below for 2009 texture parts.  -DLD 6/17/2008
const short kSecondary			= 1; // Wall left, or roof dormer - OLD, see TexturePartSDK below for 2009 texture parts.  -DLD 6/17/2008
const short kTertiary			= 2; // Wall center - OLD, see TexturePartSDK below for 2009 texture parts.  -DLD 6/17/2008
const Boolean kResolveByClass	= true; 
const Boolean kNoResolveByClass	= false; 
#endif	// !_MINICAD_


////// Texture mapping info		-DLD 6/17/2008


// GetTextureRef and SetTextureRef functions can be more specific in 2009 about which class texture 
// to use for an object.  For example, calling SetTextureRef with -3 for the texture ref will texture the object 
// using the object's class' wall right texture.  -DLD 6/19/2008
enum {
	kTextureByClass_ByObjectType = -1L,
	kTextureByClass_OtherType = -2L,
	kTextureByClass_WallRight = -3L,
	kTextureByClass_WallLeft = -4L,
	kTextureByClass_WallCenter = -5L,
	kTextureByClass_RoofTop = -6L,
	kTextureByClass_RoofDormer = -7L
};

enum TexturePartSDK
{
	kTexturePart_Overall = 3,
			
	kTexturePart_ExtrudeSweep_Top = 4,
	kTexturePart_ExtrudeSweep_Bottom = 5,
	kTexturePart_ExtrudeSweep_Sides = 6,
	
	kTexturePart_Wall_Left = 7,
	kTexturePart_Wall_Right = 8,
	kTexturePart_Wall_StartCap = 9,
	kTexturePart_Wall_EndCap = 10,
	kTexturePart_Wall_Top = 11,
	kTexturePart_Wall_Bottom = 12,
	kTexturePart_Wall_Holes = 13,
	
	kTexturePart_Slab_Top = 14,
	kTexturePart_Slab_Bottom = 15,
	kTexturePart_Slab_Sides = 16,
	
	kTexturePart_Roof_Top = 17,
	kTexturePart_Roof_Bottom = 18,
	kTexturePart_Roof_Sides = 19,
	kTexturePart_Roof_Walls = 20,
	kTexturePart_Roof_Fascia = 21,
	kTexturePart_Roof_Attic = 22,
	kTexturePart_Roof_Soffit = 23
};


struct TextureMappingInfoSDK
{
	// Normalized 3D axis vectors and 3D offset from parameter space's 
	// default center (bottom center for cylinder, front bottom left for planar, etc.).
	// Transforms from object space to texture space.
	_TransformMatrix fOriginOrient;

	Boolean fInitialized;	// True if the the values have been set in a meaningful way
	
	// EParamSpaceKind: planar, spherical, cylindrical, or algorithmic
	short fParamSpaceKind;

	// Texture bitmap modifiers
	WorldPt f2DOffset;
	double f2DScale;
	double f2DRotation;	// radians

	// Spherical and cylindrical space only 
	// The feature length of the texture bitmap is true size on the sphere or
	// cylinder surface.  The radius value lets the user shrink or expand this
	// surface.
	WorldCoord fRadius;
	
	Boolean fFlipTexture; // This is to indicate whether texture gets fliped horizontally or vertically. 
						// with combination of rotation angle and offset, it achieves flipping -Shirley 3/24/03  
	Boolean fRepeatH; // Repeat texture along horizontal direction 
	Boolean fRepeatV; // Repeat texture along vertical direction
	
	Boolean fAutoAlignPlanar;
	Boolean fAutoAlignPlanarLongestEdge;
	Boolean fUseWorldZ;
};


//////////////////////////////////////////////////////////////////////////////////////////
// Render Options 

const long kRenderWorksDataType		= 'rdrw';
const long kOpenGLDataType			= 'rdgl';
const long kHiddenLineDataType		= 'rdhl';
//////////////////////////////////////////////////////////////////////////////////////////
// ObjectVariable Types

// The TVariableBlock structure holds a value of some type
//	unspecified at compile time.  It is used to pass values
//	to functions such as GetObjectVariable and SetObjectVariable
//	that access and set functions of various types using a
//	selector-value pattern.

enum { 
	t_Boolean = 0, 
	t_Sint16 = 1, 
	t_WorldPt = 2,
	t_Real64 = 3, 
	t_TransformMatrix = 4, 
	t_WorldRect = 5,
	t_WorldPt3 = 6,
	t_Sint32 = 7, 
	t_Str255 = 8, 
	t_str256 = 9,      // this was never used and improperly implemented -- Removed 9/1/98 - PCP
	t_ViewRect = 10,
	t_Sint8 = 11, 
	t_Uint8 = 12, 
	t_FracPt = 13,		// XXX_JDW_FLOATINGPOINT
	t_Fract = 14,		//
	t_XCoordPt3 = 15,
	t_XCoordPt = 16,
	t_Uint32 = 17,
	t_MCObjectHandle = 18
};
typedef long  EVariableBlockType;



#define DEFINE_TYPE(Type) 								\
TVariableBlock(const Type &value)						\
	{ *this = value; }									\
Boolean Get##Type(Type & data) const					\
{ if (eType == t_##Type) {								\
    data = fData.u##Type ;								\
    return true ;										\
  } 													\
  else return false ;									\
}														\
TVariableBlock &	operator=(const Type & data)		\
{   fData.u##Type = data ;								\
	eType = t_##Type ;									\
	return *this ;										\
}

//----------------------------------------------------------------------------------------



class TVariableBlock {

	public:
		TVariableBlock()								{ *this = 0L; }
	
		// Core types
		///////////////////////////////////////////

		DEFINE_TYPE(Boolean)
		DEFINE_TYPE(Sint16)
		DEFINE_TYPE(WorldPt)
		DEFINE_TYPE(Real64)
		DEFINE_TYPE(TransformMatrix)
		DEFINE_TYPE(WorldRect)
		DEFINE_TYPE(WorldPt3)
		DEFINE_TYPE(Sint32)
		DEFINE_TYPE(ViewRect)
		DEFINE_TYPE(Sint8)
		DEFINE_TYPE(Uint32)
		DEFINE_TYPE(MCObjectHandle)


		// To resolve type conflicts
		////////////////////////////////////////////
		// We cannot rely on the compiler to assign these types because they
		// are identical to core types.

		Boolean GetUInt8(Uint8 &value) const
		{ 
			if (eType == t_Uint8) {
				value = fData.uUint8;
				return true ;
			} 
			else return false ;
		}
	
		void SetUInt8(Uint8 value)
		{ 
			eType = t_Uint8;
			fData.uUint8 = value;
		}
	

		// string types
		///////////////////////////////////////////

		TVariableBlock(GSStringPtr value)		{ *this = value; }
		Boolean	GetStr255(GSStringPtr data) const;
		TVariableBlock& operator=(ConstGSStr255Param data);


	private:
		union {
			Boolean			uBoolean ;				// Mac Specific
			Sint16			uSint16 ;
			_WorldPt		uWorldPt;
			Real64			uReal64 ;
			_TransformMatrix uTransformMatrix ;
			_WorldRect		uWorldRect ;
			_WorldPt3		uWorldPt3 ;
			Sint32			uSint32 ;
//			ViewRect		uRect ;					// Mac Specific
			ViewRect_		uViewRect ;	
			Sint8			uSint8 ;
			Uint8			uUint8 ;
			_WorldPt		uFracPt ;				// XXX_JDW_FLOATINGPOINT
			_WorldPt3		uXCoordPt3 ;
			_WorldPt		uXCoordPt;
			Uint32			uUint32;
			MCObjectHandle	uMCObjectHandle;


			unsigned char	uStr[255] ;

		} fData ;
		
		EVariableBlockType	eType ;

#undef DEFINE_TYPE
};





//////////////////////////////////////////////////////////////////////////////////////////
// SetObjectVariable and GetObjectVariable selectors
//
//		These selectors let you get properties
//		specific objects.  They have the return/passed
//		type as a comment following the selector

typedef enum { kAlign = 0, kHorOnly = 1, kHorVert = 2 } EDimTextRotateType ; 

// Dimension Selectors
// -------------------
const short ovDimStandard			=  0 ;	// char - Public for VS
		// The dimension standard index. A value greater than zero indicates a builtin standard (from
		// the resources). A value less than zero indicates a custom standard (user-defined). For 
		// SetObjectVariable, the result for an invalid value (zero, greater the the number of 
		// builtin standards, less than the number of custom standards) is undefined.

const short ovDimTextRotate_OBSOLETE = 1;	// don't reuse this index - Not for public use

#if GS_SDK_VW10_COMPATIBLE
		// Use the new ovDimTextRotation instead of ovDimTextRotate.
		// The new one uses shorts; ovDimTextRotate uses long to get and char to set.
		// This is being left in for compatibility with existing SDK plugins. - JDW [2003-1-9]
const short ovDimTextRotate			=  ovDimTextRotate_OBSOLETE ; // Not for public use
#endif // GS_SDK_VW10_COMPATIBLE


const short ovDimTextAboveLine		=  2 ;	// double - Not for public use
		// The distance of the text from the dimension line.

const short ovDimArrowInside		=  3 ;	// Boolean - Public for VS
		// The dimension arrow inside flag.

const short ovDimLeaderToLeft		=  4 ;	// double - Public for VS
		// The distance of the text from the startpoint (<0) or the endpoint (>0).

const short ovDimBoxText			=  5 ;	// Boolean - Public for VS
		// The box text flag for the primary unit.

const short ovDimShowValue			=  6 ;	// Boolean - Public for VS
		// The show value flag for the primary unit.

const short ovDimStartingWitness	=  7 ;	// Boolean - Public for VS
		// The starting witness flag.

const short ovDimEndingWitness		=  8 ;	// Boolean - Public for VS
		// The ending witness flag.

const short ovDimLeaderText			=  9 ;	// Str31 - Public for VS
		// The leader text for the primary unit (31 chars max).

const short ovDimTrailerText		= 10 ;	// Str31 - Public for VS
		// The trailer text for the primary unit (31 chars max).

const short ovDimTolerance			= 11 ;	// char - Public for VS
		// The tolerance type. Valid values are:
		//   - 0 (kNoTol):	  None
		//   - 1 (kOneTol):   Single
		//   - 2 (kTwoTol):   Double
		//   - 3 (kLimitTol): Limit

const short ovDimDirection			= 12 ;	// FracPt; Vector2 in VW9 - Not for public use
		//  Direction (for dimensions with fixed angles).

const short ovDimStartPt			= 13 ;	// WorldPt - Not for public use
		// The dimension starting point.

const short ovDimEndPt				= 14 ;	// WorldPt - Not for public use
		// The dimension ending point.

const short ovDimStartOffset		= 15 ;	// double - Public for VS
		// The distance of the dimension from the starting point.

const short ovDimBox				= 16 ;	// WorldRect - Not for public use
		// The box of the oval that is being dimensioned (angular, diametral).

const short ovDimFontSize			= 17 ;	// double - Public for VS
		// The dimension text font size.
const short ovObjectFontSize		= ovDimFontSize ;	// double - Not for public use
		// Now ParametricTypes have the same Font API as DimHeaderTypes

const short ovDimFontType_OBSOLETE	= 18 ;	// don't reuse this index - Not for public use
		// You should use ovDimFontIndex instead.

const short ovDimFontStyle			= 19 ;	// char - Public for VS
		// The dimension font style. Values may be summed and set simultaneously. 
		// For example, a value of 5 makes the text underlined and bold.
		// Valid values are:
		//   -  0  Clear
		//   -  1  Bold
		//   -  2  Italic
		//   -  4  Underline
		//   -  8  Outline (Mac only)
		//	 - 16  Shadow  (Mac only)
const short ovObjectFontStyle			= ovDimFontStyle ;	// char - Not for public use


const short ovDimPrec               = 20 ;  // long - Public for VS     
		// The dimension precision for the primary unit. For decimal precision,
		// the value represents how many digits are displayed to the right of the decimal
		// point (0 thru 10). For fractional precision the value represents a power of 2
		// for the fractional denominator (0 for 1/1 [no fractions], 1 for 1/2, 2 for 1/4,
		// 3 for 1/8, 4 for 1/16, 5 for 1/32, or 6 for 1/64.
		// For angular precision, the value must be 1 (only whole numbers), 2 (degrees mins), 
		// 3 (degrees mins secs), 5 (x.x angular units), 6 (x.xx angular units), 
		// 7 (x.xxx angular units), 8 (x.xxxx angular units), 9 (x.xxxxx angular units),
		// 10 (x.xxxxxx angular units), 11 (x.xxxxxxx angular units) or 12 
		// (x.xxxxxxxx angular units). 
		// (For angular precision a value of 4 is invalid.)

const short ovDimPrec2              = 21 ;  // long - Public for VS
		// The dimension precision for the secondary unit. For decimal precision,
		// the value represents how many digits are displayed to the right of the decimal
		// point (0 thru 10). For fractional precision the value represents a power of 2
		// for the fractional denominator (0 for 1/1 [no fractions], 1 for 1/2, 2 for 1/4,
		// 3 for 1/8, 4 for 1/16, 5 for 1/32, or 6 for 1/64.
		// For angular precision, the value is not used.


const short ovDimBoxText2			= 22 ;	// Boolean - Public for VS 
		// The box text flag for the secondary unit.

const short ovDimShowValue2			= 23 ;	// Boolean - Public for VS	  
		// The show value flag for the secondary unit.

const short ovDimLeaderText2		= 24 ;	// Str31 - Public for VS	  
		// The leader text for the secondary unit (31 chars max).

const short ovDimTrailerText2		= 25 ;	// Str31 - Public for VS	  
		// The trailer text for the secondary unit (31 chars max).



const short ovDimClass				= 26 ;	// unsigned char - Public for VS	  
		//	(fix_ang)		= 0,
		//	(sloped)		= 1,
		//	(ordinate)		= 2,
		//	(radial)		= 3,
		//	(diametrical)	= 4,
		//	(ang)			= 5;

const short ovDimStandardName		= 27 ;	// Str20 - Public for VS
		// The dimension standard name.

const short ovDimFontIndex			= 28 ;	// short - Public for VS
		// The font index of the dimension's font.
const short ovObjectFontIndex		= ovDimFontIndex ;	// short
		// Now ParametricTypes have the same Font API as DimHeaderTypes

const short ovDimTextPosCalculated  = 29 ;	// Boolean - Public for VS
		// The dimension text automatically calculated flag.

const short ovDimTextPosInside  = 30 ;	// Boolean - Public for VS
		// The dimension text position inside flag.

const short ovDimReferenceAngle  = 31 ;	// Boolean - Public for VS
		// The angular dimension is a reference angle.

const short ovDimShowPrimaryDual		= 32; // Boolean - Public for VS
		// display only the primary  part of a dual dimension if true

const short ovDimShowSecondaryDual		= 33; // Boolean - Public for VS
		// display only the secondary  part of a dual dimension if true

const short ovDimTopToleranceValue		= 34; // WorldCoord - Public for VS
		// the top tolerance value

const short ovDimBottomToleranceValue	= 35; // WorldCoord - Public for VS
		// the bottom tolerance value

const short ovDimTopToleranceString		= 36;	// Str7 - Public for VS
		// the top tolerance string

const short ovDimBottomToleranceString	= 37;	// Str7 - Public for VS
		// the bottom tolerance string

const short ovDimUseToleranceStrings	= 38;	// Boolean - Public for VS
		// if true, use the strings instead of the values for tolerances - primary units only
		
const short ovDimFlippedText			= 39;	// Boolean - Public for VS
		// whether or not to flip the text to the other side of the dimension line for some dimensions
		
const short ovDimTextSizeInPoints		= 40;	// double - Public for VS
		// The dimension text font size in points.
		// XXX_JDW_MISC - Mark: should this be ovObjectTextSizeInPoints ? (see ovObjectFontSize)
		// [MAF VW10 Revisit, 1/9/03]

const short ovDimTextRotation			= 41;	// short - Public for VS
		// The text rotation type. Valid values are from EDimTextRotateType:
		//   - 0 (kAlign):   Aligned 	
		//   - 1 (kHorOnly): Horizontal Only
		//   - 2 (kHorVert): Horizontal/Vertical

const short ovDim2ReferenceLinesAngle	= 42;	// Boolean - Not for public use
		// The angular dimension has two reference lines.	
	
const short ovDimTextAboveLineInCurrUnits	=  43;	// double - Public for VS
		// The distance of the text from the dimension line in current units.

const short ovDimTextOffsetInCurrUnits		=  44;	// double - Public for VS
		// If the text is inside the witness lines, the ratio of the distance between the startpoint
		// and the text to the distance between the startpoint and the endpoint.  If the text is 
		// outside the witness lines, the distance in current units of the text from the nearer of the 
		// startpoint (<0) or the endpoint (>0).

const short ovDimStartOffsetInCurrUnits		= 45 ;	// double - Public for VS
		// The distance of the dimension from the starting point in current units.
	
const short ovDimShowElevText 				= 46;   // Boolean - Public for VS
		// Display the optional elevation dimension used in the SIA dimensioning standard
		
const short ovDimElevTextValue				= 47;   // WorldCoord - Public for VS
		// The value to be displayed as the optional SIA elevation dimension

const short ovDimElevTextLeader				= 48;   // Str31 - Public for VS
		// The leader text for the optional SIA elevation dimension
		
const short ovDimElevTextTrailer			= 49;   // Str31 - Public for VS
		// The trailer text for the optional SIA elevation dimension   

const short ovDimTranslateInVP				= 1234; // MCObjectHandle - Not for public use
		// Used to move a dimension that is created in a viewport annotation by the exterior wall dimensioner only.
		// This object variable should not be published and is for internal use only.


// Light Selectors  (lightNode)
// ---------------
const short ovLightIsOn					= 50 ;  // Boolean - Public for VS
const short ovLightBrightness			= 51 ; 	// double_gs		0..1; > 1 for overlighting - Public for VS - Not for public use
const short ovLightColor				= 52 ; 	// WorldPt3	x, y, z = 0..1 - Not for public use
const short ovLightCastShadows			= 53 ; 	// Boolean - Public for VS
const short ovLightPosition				= 54 ;	// WorldPt3 - Public for VS
const short ovLightKind					= 55 ; 	// short		(kDirectionalLight | kPointLight | kSpotLight) - Public for VS
const short ovLightDirectionVector		= 56 ; 	// WorldPt3	This vector points _away from_ the light source. - Not for public use

const short ovLightDirectionHorizAngle	= 57 ; 	// double_gs - Public for VS
		// Angle about the z axis for spot and directional light direction vectors.  
		// The positive y axis is 0 horizontal degrees, counterclockwise about the positive z axis 
		// is the positive direction for this angle.  I.e.: negative x axis is +90.0 degrees, 
		// positive x axis is -90.0 degrees.  This angle is also called the pan or azimuth angle.  

const short ovLightDirectionVertAngle	= 58 ; 	// double_gs - Public for VS
		// Angle above or below the ground plane for spot and directional light direction vectors.  
		// Positive angles aim the light downward.  This angle is also called the tilt or 
		// elevation angle.
				
const short ovLightDistanceFalloff		= 59 ; 	// short - Public for VS
		// Distance falloff function (kLightNoFalloff | kLightInverseDistance | kLightInverseDistanceSquared) 
		// for point and spot lights.  These are called ÒNoneÓ, ÒSmoothÓ, and ÒSharpÓ in the user interface.
				
const short ovLightAngularFalloff		= 60 ; 	// short - Public for VS
		// Angular falloff function (kLightNoFalloff | kLightLinear | kLightExponential | kLightCosine) 
		// for spot lights.  These are called ÒNoneÓ, ÒNormalÓ, ÒSmoothÓ, and ÒSharpÓ in the user interface.  
		// The angular falloff function determines how fast the light intensity falls off from the 
		// spot beam angle to the spot spread angle.
		
const short ovLightSpread				= 61 ; 	// double_gs - Public for VS
		// For spot lights.  This is the maximum cone angle for the spot.  The angular 
		// falloff function determines the intensity at this angle.
		
const short ovLightBeam					= 62 ; 	// double_gs - Public for VS
		// For spot lights.  From zero degrees to the beam angle the intensity is constant.  
		// After the beam angle the angular falloff function determines the intensity 
		// (up to the spread angle).

const short ovLightLitFog				= 63 ;	// Boolean - Public for VS
		// Lit fog for creating volumetric effects. Currently for RW rendering modes only.
		// Uses the settings of the applied Background Shader (weather shader)

// Fill Space selectors
// ----------------
const short ovFillOriginPt				= 69;		// WorldPt	 - the Origin point for a gradient or image fill - Not for public use.
const short ovFillXOffset				= 70;		// real		 - the X-offset for a gradient or image fill - Not for public use.
const short ovFillYOffset				= 71;		// real		 - the y-offset for a gradient or image fill. - Not for public use
const short ovFillIAxisLength			= 72;		// real		 - the X-scale for a gradient or image fill. - Not for public use
const short ovFillJAxisLength			= 73;		// real		 - the Y-scale for an image fill. - Not for public use
const short ovFillAngle					= 74;		// real		 - the angle for a gradient or image fill. - Public for VS
const short ovFillRepeat				= 75;		// Boolean	 - the repeat-state for a gradient or image fill. - Public for VS
const short ovFillMirror				= 76;		// Boolean	 - the mirror-state for a gradient or image fill. - Public for VS
const short ovFillFlip					= 77;		// Boolean	 - the flip-state for an image fill. - Public for VS
const short ovFillGeometryType			= 78;		// longint	 - the geometry type for a gradient fill. - Public for VS
const short ovFillMaintainAspectRatio	= 79;		// Boolean	 - indicates if aspect ratio is maintained for an image fill. - Public for VS



// Worksheet selectors
// ----------------
const short ovWSHeader					= 80;		// Str255	 - worksheet header string, limited to 81 characters. - Public for VS
const short ovWSFooter					= 81;		// Str255	 - worksheet footer string, limited to 81 characters. - Public for VS
const short ovWSShowDatabaseHeaders		= 82;		// Boolean	 - worksheet database rows (headers) visibility. - Public for VS
const short ovWSShowGridlines			= 83;		// Boolean	 - worksheet gridlines preference. - Public for VS
const short ovWSShowTabs				= 84;		// Boolean	 - worksheet show tabs prefrerence. - Public for VS
const short ovWSAutoRecalculation		= 85;		// Boolean	 - worksheet auto recalculation preference. - Public for VS
const short ovWSDefaultFontIndex		= 86;		// short	 - worksheet default font index preference. - Public for VS
const short ovWSDefaultFontSize			= 87;		// short	 - worksheet default font size preference. - Public for VS
const short ovWSTopPrintMargin			= 88;		// double_gs - worksheet top print margin preference. - Public for VS
const short ovWSLeftPrintMargin			= 89;		// double_gs - worksheet left print margin preference. - Public for VS
const short ovWSBottomPrintMargin		= 90;		// double_gs - worksheet bottom print margin preference. - Public for VS
const short ovWSRightPrintMargin		= 91;		// double_gs - worksheet right print margin preference. - Public for VS


// Symbol selectors
// ----------------
const short ovSymbolLightMultiplier		= 100 ; 	// double_gs		Instance brightness equals definition brightness times multiplier. - Public for VS


// More Fill Space selectors
// --------------------
const short ovFillXOffsetInCurrUnits	= 110;		// real (current units) - the X-offset for a gradient or image fill - Public for VS
const short ovFillYOffsetInCurrUnits	= 111;		// real (current units) - the Y-offset for a gradient or image fill - Public for VS
const short ovFillIAxisLengthInCurrUnits = 112;		// real (current units) - the X-scale for a gradient or image fill - Public for VS
const short ovFillJAxisLengthInCurrUnits = 113;		// real (current units) - the Y-scale for a gradient or image fill - Public for VS


// Plugin insert selectors
// ----------------													
const short ovPluginInsertMode			= 123 ; 	// short - where to insert the symbol in the wall - Public for VS
	
	//const InsertModeType kPluginnsertOnCenter	= 0;	insert at the center of the wall
	//const InsertModeType kPluginInsertOnEdge	= 1; 	Symbol Defs do not distinguish between left and right.
		
const short ovPluginBreakMode			= 124 ; 	// short, specifies how the wall is broken where the symbol is inserted - Public for VS

	//const BreakModeType kPluginFullBreakWithCaps = 1;	standard for most symbol insertions
	//const BreakModeType kPluginFullBreakNoCaps	= 2;	no cap lines, but the wall is broken
	//const BreakModeType kPluginHalfBreak			= 3; 	for edge insertion only;
	//const BreakModeType kPluginNoBreak			= 4;	no break in the wall		



// Symbol definiton selectors
// ----------------													
const short ovSymDefInsertMode			= 125 ; 	// short - where to insert the symbol in the wall - Public for VS
	
	//const InsertModeType kSymInsertOnCenter	= 0;	insert at the center of the wall
	//const InsertModeType kSymInsertOnEdge		= 1; 	Symbol Defs do not distinguish between left and right.
		
const short ovSymDefBreakMode			= 126 ; 	// short, specifies how the wall is broken where the symbol is inserted - Public for VS

	//const BreakModeType kSymFullBreakWithCaps = 1;	standard for most symbol insertions
	//const BreakModeType kSymFullBreakNoCaps	= 2;	no cap lines, but the wall is broken
	//const BreakModeType kSymHalfBreak			= 3; 	for edge insertion only;
	//const BreakModeType kSymNoBreak			= 4;	no break in the wall		

const short ovSymbolInsertAsGroup		= 127 ;		// Boolean, whether to perform a Shallow Symbol to Group after insertion - Public for VS

const short ovSymDefUseClass			= 128 ;     // Boolean, use the class of the symbol definition as the class for the new insert

const short ovSymDefInsertIntoWalls		= 129 ;		// Boolean, allow or prevent wall insertion of symbols


// Layer selectors (kLayerNode)
// ---------------
const short ovLayerAmbientIsOn			= 150;		// Boolean - Public for VS
const short ovLayerAmbientBrightness	= 151;		// double_gs - Public for VS
const short ovLayerAmbientColor			= 152;		// WorldPt3 - Public for VS
const short ovLayerVisibility			= 153;		// short, -1 = invisible, 0 = normal, 2 = grayed - Public for VS
const short ovLayerType					= 154;		// short - the layer type; read only - Public for VS
const short ovLayerDPI					= 155;		// short - the printing dpi; only for presentation layers; read/write. - Public for VS

const short ovLayerRepaginate			= 156;		// Public for VS
// ovLayerRepaginate (Boolean)
// Set() causes the pagination to be recalculated for the given Sheet Layer or Design Layer (useful after manipulating the PrintInfo).
// true = set drawing size to one page, false = divide drawing size into multiple pages;
// Get() determines how the drawing is currently paginated
// true = one page, false = multiple pages

const short ovLayerHeightInCurrUnits	= 157;		// current units, the base elevation height of the layer - Public for VS
const short ovLayerThicknessInCurrUnits	= 158;		// current units, the thickness of the layer - Public for VS
const short ovLayerDescription			= 159;		// Str63, the description of the layer (only used for sheet layers) - Public for VS

// Layer Link selectors (layerRefNode)
// ---------------
const short ovLayerLinkSourceName 		= 160;		//	InternalName - Public for VS
const short ovLayerLinkProject2D 		= 161;		//	Boolean - Public for VS
const short ovLayerExpandedSheetName	= 162;		//	Str255, the sheet number followed by the sheet title in brackets (only for sheet layers); read only - Public for VS

// Slab selectors (slabNode)
// --------------
const short ovSlabThickness				= 170;		// WorldCoord, the thickness of the roof, floor, or column - Not for public use
const short ovSlabHeight				= 171;		// WorldCoord, the z elevation for the bottom of floors and columns, - Not for public use
													//	 the height of the roof axis
const short ovSlabKind					= 172;		// short, 1 = roof, 2 = floor, 3 = column - Public for VS
const short ovSlabThicknessInCurrUnits	= 173;		// current units, the thickness of the roof, floor or column - Public for VS
const short ovSlabHeightInCurrUnits		= 174;		// current units, the z elevation for the bottom of floors and columns, - Public for VS
													//	 the height of the roof axis
const short ovSlabRoofPt1				= 175;		// WorldPt, first point of the roof axis, only set when slab kind = roof - Not for public use
const short ovSlabRoofPt2				= 176;		// WorldPt, second point of the roof axis, only set when slab kind = roof - Not for public use
const short ovSlabRoofUpslopePt			= 177;		// WorldPt, a point on the upslope side of the roof, only set when slab kind = roof - Not for public use
const short ovSlabRoofRise				= 178;		// WorldCoord, the rise over a given distance.  Use with the run to calculate a slope, only set when slab kind = roof - Not for public use
const short ovSlabRoofRun				= 179;		// WorldCoord, the run over a given distance.  Use with the rise to calculate a slope, only set when slab kind = roof - Not for public use
const short ovSlabRoofMiterType			= 180;		// short, 1 = vertical, 2 = horizontal, 3 = double, only set when slab kind = roof - Public for VS
const short ovSlabRoofDoubleMiterRatio	= 181;		// double, the percentage of a double miter which is vertical (1 is a vertical miter and 0 is a horizontal), only set when slab kind = roof - Public for VS
const short ovSlabRoofRiseInCurrUnits	= 182;		// current units, the rise over a given distance.  Use with the run  - Public for VS
													// to calculate a slope, only set when slab kind = roof
const short ovSlabRoofRunInCurrUnits	= 183;		// current units, the run over a given distance.  Use with the rise - Public for VS
													// to calculate a slope, only set when slab kind = roof
// Cavity selectors (cavityNode)
// ----------------
// NOTE: pass nil to these to get and set the default cavity information
const short ovCavityCount_OBSOLETE		= 199;		// short, the number of cavities in the handle, works only with GetObjectVariable - Public for VS
const short ovCavityOffLeft_OBSOLETE	= 200;		// WorldCoord, offset from center-line to the left edge of cavity - Not for public use
													//   add the cavity index to get successive values (for example, the seventh cavity = ovCavityOffLeft + 6)
const short	ovCavityOffRight_OBSOLETE	= 220;		// WorldCoord, offset from center-line to the right edge of the cavity - Not for public use												
													//	 add the cavity index to get successive values
const short ovCavityIsPair_OBSOLETE		= 240;		// Boolean, true if the cavity is a pair of lines, otherwise it is a single line and the right offset - Public for VS
													// 	 and the fill pattern for this cavity is meaningless
													//	 add the cavity index to get successive values
const short ovCavityFill_OBSOLETE		= 260;		// long, the fill pattern/hatch to be used between a pair of cavity lines - Public for VS
													//	 add the cavity index to get successive values
const short ovCavityPenWeight_OBSOLETE	= 280;		// short, the pen weight of the cavity line(s), in mils - Public for VS
													//	 add the cavity index to get successive values
const short ovCavityPenStyle_OBSOLETE	= 300;		// short, the pen pattern/dash style of the cavity line(s) - Public for VS
													//	 add the cavity index to get successive values
const short ovCavityOffLeftInCurrUnits_OBSOLETE		= 320;		// current units, offset from center-line to the left edge of cavity - Public for VS
													//   add the cavity index to get successive values
const short	ovCavityOffRightInCurrUnits_OBSOLETE	= 340;		// current units, offset from center-line to the right edge of the cavity - Public for VS											
													//	 add the cavity index to get successive values


const short	ovCavityMain_OBSOLETE		= 690;		// short, the index of the main cavity - Public for VS
													// pass NULL for the object handle to use the default cavity settings

// Sweep selectors (cavityNode)
// ----------------
const short ovSweepZOffset				= 400;		// see the document for GS_CreateSweep for more information on how to use - Not for public use
													//	 this value.
const short ovSweepZOffsetInCurrUnits	= 401;		// current units, the z-value for the sweep - Public for VS

// Saved sheet selectors
// ---------------------
const short ovSheetSaveView				= 450;		// Boolean, true if the sheet saves the view orientation factors, which includes the orientation and projection - Public for VS
const short ovSheetSavePage				= 451;		// Boolean, true if the sheet saves the page location - Public for VS
const short ovSheetSaveClass			= 452;		// Boolean, true if the sheet saves the class options, active class and class visibilities - Public for VS
const short ovSheetSaveLayer			= 453;		// Boolean, true if the sheet saves the layer options, active layer and layer visibilities - Not for public use
const short ovSheetSaveZoomPan			= 456;		// Boolean, true if the sheet saves the zoom and pan settings - Public for VS
const short ovSheetSaveStackLayers		= 457;		// Boolean, true if the sheet saves the stack layers settings - Not for public use
const short ovSheetStackLayersStatus	= 458;		// Boolean, true if the sheet has layer stacking on - Not for public use

// Saved View (formerly Sheet) Related
// These change the visibility setting for the given Class/Layer in all existing Saved Views.
// The ovSetDesignLayerVisibilityInAllSavedViews selector only works when given a Design Layer, and only changes Saved Views of Design Layers.
// ---------------------
const short ovSetDesignLayerVisibilityInAllSavedViews	= 454;	// short, -1 = invisible, 0 = normal, 2 = grayed, 3 = don't save - Public for VS
const short ovSetClassVisibilityInAllSavedViews			= 455;	// short, -1 = invisible, 0 = normal, 2 = grayed, 3 = don't save - Public for VS


// Texture selectors (kMaterialNode)
// -----------------
const short	ovIsTextureableObject		= 500;		// Boolean "Get" only - Public for VS

const short	ovMaterialIsExpanded		= 501;		// Boolean, sets whether three or just  - Public for VS
													// a single material is applied to
													// this object (can be up to three for
													// walls or two for roofs).

#if 0
	// These object variables are obsolete in VW/RW 9. -DLD 4/6/2000
	const short	ovMaterialShininess 		= 502;		// long (percentage value - 0 == dull) - Not for public use
	const short	ovMaterialTransparency 		= 503;		// long (percentage value - 0 == opaque) - Not for public use
	const short	ovMaterialTextureShader 	= 504;		// long (LightWorks property ref) - Not for public use
	const short	ovMaterialTextureBitmap 	= 505;		// MCObjectHandle - Not for public use
#endif 	// 0

const short ovMaterialColorShaderRecord 		= 506; 	// MCObjectHandle (record) - Not for public use
const short ovMaterialReflectivityShaderRecord 	= 507; 	// MCObjectHandle (record) - Not for public use
const short ovMaterialTransparencyShaderRecord 	= 508; 	// MCObjectHandle (record) - Not for public use
const short ovMaterialBumpShaderRecord 			= 509; 	// MCObjectHandle (record) - Not for public use
const short ovMaterialSize 						= 510; 	// Real64, in real-world inches - Not for public use
const short ovMaterialSizeInCurrUnits			= 511;  // double, in current units - Public for VS

// TextureBitmap selectors (kTextureBitmapNode)
// -----------------------
#if 0
	// This selector is obsolete in VW/RW 9.  -DLD 2/1/2001
	const short	ovTextureBitmapOrigin 		= 520;		// WorldPt, in pixels - Not for public use
#endif
const short	ovTextureBitmapFeatureStart = 521;		// WorldPt, in pixels - Not for public use
const short	ovTextureBitmapFeatureEnd 	= 522;		// WorldPt, in pixels - Not for public use
const short	ovTextureBitmapFeatureSize 	= 523;		// double_gs, in real-world inches - Not for public use
const short	ovTextureBitmapRepeatHoriz 	= 524;		// Boolean - Public for VS - Not for public use
const short	ovTextureBitmapRepeatVert 	= 525;		// Boolean - Not for public use
#if 0
	// This selector is obsolete in RW 12.  -DLD 12/9/2004
	const short	ovTextureBitmaptagged = 526;		// MCObjectHandle - Not for public use
#endif
const short ovTextureBitmapFeatureSizeInCurrUnits = 527; // double, in current units - Public for VS
const short ovTextureBitmapImageDefNode = 528; 		// MCObjectHandle - Not for public use

// Paint selectors
const short ovPaintWidthPixels 			= 530; 		// long - Public for VS
const short ovPaintHeightPixels 		= 531; 		// long - Public for VS
const short ovPaintCompression			= 532;		// long, 0=None, 1=JPEG, 2=PNG, 3=PNGMono - Public for VS
const short ovImageCompression			= 533;		// long, 0=None, 1=JPEG, 2=PNG, 3=PNGMono - Public for VS
const short ovImageWidthPixels 			= 534; 		// long - Public for VS
const short ovImageHeightPixels 		= 535; 		// long - Public for VS

const short ovPaintTDWidth				= 536;		// WorldCoord - Not for public use
const short ovPaintTDHeight				= 537;		// WorldCoord - Not for public use
const short ovPaintTDOriginX			= 538;		// WorldCoord - Not for public use
const short ovPaintTDOriginY			= 539;		// WorldCoord - Not for public use

// TextureSpace selectors (kTextureSpaceNode)
//
// *** OLD *** Use gSDK->GetTextureMappingInfo and gSDK->SetTextureMappingInfo instead as of 2009.  -DLD 6/17/2008
//
// ----------------------
const short	ovTextureSpaceKind 			= 540;		// long (kPlane, etc.) - Public for VS - Not for public use
const short	ovTextureSpaceOriginOrientation = 541;	// TransformMatrix, from world 	space to texture space - Not for public use
const short	ovTextureSpace2DOffset 		= 542;		// WorldPt, in Coords - Not for public use
const short	ovTextureSpace2DScale 		= 543;		// double, scale factor - Public for VS
const short	ovTextureSpace2DRotation	= 544;		// double_gs radians - Public for VS
const short	ovTextureSpaceRadius 		= 545;		// long (WorldCoord) valid only for spherical & cylindrical texture spaces - Not for public use
const short	ovTextureSpaceStartCap 		= 546;		// Boolean, extrude & sweep only  - Public for VS
const short	ovTextureSpaceEndCap 		= 547;		// Boolean, extrude & sweep only  - Public for VS
const short	ovTextureSpaceMultiPartID 	= 548;		// byte, for walls and roofs (kPrimary, etc.) - Public for VS
const short ovTextureSpaceRadiusInCurrUnits = 549;	// double (current units) valid only for spherical & cylindrical texture spaces - Public for VS


// RoundWall selectors (kRoundWallNode)
// --------------
const short ovRoundWallCounterClockwise	= 570;		// Boolean, read only, TRUE == counterclockwise, FALSE == clockwise - Public for VS
const short ovRoundWallRadius			= 571;		// DOUBLE, round wall thickness, read/write - Public for VS

const short ovLayerCropRect				= 590;		// WorldRect, read only, - Not for public use
const short	ovLayerRWBackground			= 591;		// long (SysName), read/write - Public for VS
const short ovLayerHDRIBackground		= 592;      // long RefNumber of the HDRI background associated with a layer, read only - Public for VS

// Wall selectors (wall Nodes)
// --------------
const short ovWallStartCapLeftPoint		= 600;		// WorldPt, read/write - Not for public use
const short ovWallStartCapRightPoint	= 601;		// WorldPt, read/write  - Not for public use
const short ovWallEndCapLeftPoint		= 602;		// WorldPt, read/write  - Not for public use
const short ovWallEndCapRightPoint		= 603;		// WorldPt, read/write  - Not for public use

const short ovWallStartHeightTop		= 604;		// WorldCoord, read/write - Not for public use
const short ovWallStartHeightBottom		= 605;		// WorldCoord, read/write  - Not for public use
const short ovWallEndHeightTop			= 606;		// WorldCoord, read/write - Not for public use
const short ovWallEndHeightBottom		= 607;		// WorldCoord, read/write  - Not for public use

const short ovWallLeftGrossArea			= 608;		// WorldCoord, read only : area of the wall's left side including windows - Public for VS
const short ovWallRightGrossArea		= 609;		// WorldCoord, read only : area of the wall's right side including windows - Public for VS
const short	ovWallGrossArea				= 610;		// WorldCoord, read only : average of left and right area including windows - Public for VS
const short ovWallLeftNetArea			= 611;		// WorldCoord, read only : area of the wall's left side with window holes subtracted - Public for VS
const short ovWallRightNetArea			= 612;		// WorldCoord, read only : area of the wall's right side with window holes subtracted - Public for VS
const short	ovWallNetArea				= 613;		// WorldCoord, read only : average of left and right area with window holes subtracted - Public for VS
const short ovWallLeftAverageHeight		= 614;		// WorldCoord, read only : average height of the wall's left side - Public for VS
const short ovWallRightAverageHeight	= 615;		// WorldCoord, read only : average height of the wall's right side - Public for VS
const short ovWallAverageHeight			= 616;		// WorldCoord, read only : average height of the wall - Public for VS
const short ovSetRoundWallArc			= 617;		// WorldCoord, read only : returns the defining height of the wall - Not for public use
const short ovSetWallWidth			    = 618;		// WorldCoord, write only : sets the wall's width - Not for public use
const short ovSetWallWigth			    = 618;		// WorldCoord, write only : sets the wall's width (typo retained for compatibility - Not for public use
const short ovSetPolyArcRadius			= 619;		// WorldCoord, read only - Not for public use
const short ovTempPreviewDrawingWall	= 620;		// NNA INTERNAL USE ONLY : BlankHandle, read only : temporary preview drawing wall - Not for public use

// Solids selectors (csg tree nodes)
// --------------
const short ovSolidHistory				= 630;		// Boolean, read/write - Public for VS
const short ovSolidXScale				= 631;		// scaling in X - Public for VS
const short ovSolidYScale				= 632;		// scaling in Y - Public for VS
const short ovSolidZScale				= 633;		// scaling in Z - Public for VS

const short ovIs3D						= 650;		// Boolean, read only  - Public for VS
const short ovIs2D						= 651;		// Boolean, read only  - Public for VS
const short ovIsPoly2DClockwise			= 652;		// Boolean, read only - Public for VS


// Hatch selectors (kHatchDefNode) - JDW, 9/17/01
// --------------
const short ovHatchNumLevels			= 660;		// short,	read only - Not for public use
const short ovHatchIsTransparent		= 661;		// Boolean,	read/write - Not for public use
const short ovHatchHasPageUnits			= 662;		// Boolean,	read/write - Not for public use
const short ovHatchRotateInWall			= 663;		// Boolean,	read/write - Not for public use
const short ovHatchRotateInSymbol		= 664;		// Boolean,	read/write - Not for public use


// Text selectors (kTextNode) - JDW, 9/18/01
// --------------
const short ovTextIsLinkedToRecord		= 680;		// Boolean, read only - Public for VS
const short ovTextRepeatingTab          = 681;      // WorldCoord - Not for public use
const short ovTextRepeatingTabInCurrUnits = 682;	// current units - Public for VS
const short ovTextIsSiaElevText			= 683;		// Boolean, read only - Not for public use


// Fill style/type selectors
// --------------
const short ovFillStyle					= 695;		// long,	read/write - Public for VS
const short ovFillType					= 696;		// short,	read only - Public for VS
const short ovFillWasEdited				= 697;		// Boolean - Not for public use


//	NGNodeType accessors from 700 -> 800 
const short ovLocked					= 700;		// Boolean, read/write - Public for VS
const short ovHideDetail				= 701;		// Boolean, read/write : used to hide wall cavity lines or complex objects content at small scales - Public for VS
const short ovIsStructural				= 702;		// Boolean, read/write : used to mark an object as structural - Public for VS
const short ovFirstAuxObject			= 703;		// MCObjectHandle, read/write : used to manipulate the Aux list - Public for VS
const short ovInheritParentMapping		= 704;		// Boolean, read/write : Used for PIOs to have same texture as parent walls.  -DLD 3/29/2006 - Public for VS
const short ovHideNonDetail				= 705;		// Boolean, read/write : used to hide complex objects content at big scales - Public for VS


const short ovPluginHasFontStyle		= 800;		// Boolean, write : gives Object a font style property - Public for VS
const short ovCustomObjectFontStyle		= ovPluginHasFontStyle; // Public for VS
const short ovCustomObjectArea			= 801;		// Real, Used to hold the area of a custom object - Public for VS
const short ovCustomObjectPerimeter		= 802;		// Real, Used to hold the perimeter of a custom object - Public for VS

//	
const short ovFormatVisibility			= 900;		// Boolean, read/write : gives Format user interface visibility - Public for VS

// Viewport type selectors
// --------------
const short ovViewportProjectionType		= 1000;    	// short	read/write - the viewport projection type. - Public for VS
const short ovViewportRenderType			= 1001;		// short	read/write - the viewport render type. - Public for VS
const short ovViewportPerspectiveDistance	= 1002;		// real		read/write - the viewport perspective distance (used with custom perspective). - Public for VS
const short ovViewportScale					= 1003;		// real		read/write - the viewport scale. - Public for VS
const short ovViewportDirty					= 1004;		// Boolean  read only  - the viewport out-of-date (dirty) state. - Public for VS
const short ovViewportProject2D				= 1005;		// Boolean  read/write - the viewport project 2D state. - Public for VS
const short ovViewportRenderBackground		= 1006;		// long		read/write - the viewport render background. - Public for VS
const short ovViewportViewType				= 1007;		// short	read/write - the viewport view type. - Public for VS
const short ovViewportLineWeightScale		= 1008;		// double	read/write - the viewport line weight scale. - Public for VS
const short ovViewportArrowheadScale		= 1009;		// double	read/write - the viewport arrowhead scale. - Public for VS
const short ovViewportDashedLineScale		= 1010;		// double	read/write - the viewport dashed line length/spacing scale. - Public for VS
const short ovViewportHatchLineScale		= 1011;		// double	read/write - the viewport hatch line spacing scale. - Public for VS
const short ovViewportDesignTextScale		= 1012;		// double	read/write - the viewport design layer referenced text size scale. - Public for VS
const short ovViewportSlashThicknessScale	= 1013;		// double	read/write - the viewport slash thcikness scale. - Public for VS
const short ovViewportAmbientIsOn			= 1014;		// Boolean  read/write - the viewport ambient light is ON or OFF. - Public for VS
const short ovViewportAmbientBrightness		= 1015;		// double	read/write - the viewport ambient light brightness. - Public for VS
const short ovViewportAmbientColor			= 1016;		// WorldPt3 read/write - the viewport ambient light color. - Public for VS
const short ovSetDesignLayerVisibilityInAllViewports	= 1017;	// short, -1 = invisible, 0 = normal, 2 = grayed - Public for VS
const short ovSetClassVisibilityInAllViewports			= 1018;	// short, -1 = invisible, 0 = normal, 2 = grayed - Public for VS
const short ovViewportHDRIBackground		= 1019;		// long		read only  - the background for environment lighting - Public for VS
const short ovSectionVP2DAttributeClass		= 1020;		// long		read only - the RefNumber of the class responsible for attributes of overall cross-section or just the x-section of structural elements. - Public for VS
const short ovSectionVP2DOtherAttribClass	= 1021;		// long		read only - the RefNumber of the class responsible for attributes of cross-section generated from non-structural elements - Public for VS
const short ovSectionVP3DFillStyleClass		= 1022;		// long     read only - the RefNumber of the class reposnsible for fill style of the objects beyond section plane - Public for VS
const short ovSectionVP3DLineStyleClass		= 1023;		// long     read only - the RefNumber of the class responsible for line style of the objects beyond section plane - Public for VS
const short ovViewportXPosition				= 1024;		// double   read only - the X coordinate of the viewport on the sheet layer - Public for VS
const short ovViewportYPosition				= 1025;		// double   read only - the Y coordinate of the viewport on the sheet layer - Public for VS
const short ovViewportAngleWithXAxis		= 1026;		// double	read only - the angle that the viewport subtends with the X axis on the sheet layer in degrees - Public for VS
const short ovViewportShowWallComponents	= 1027;		// Boolean  read/write - the viewport/dlvp show/hide wall components - Public for VS
const short ovViewportGrayTransparent		= 1028;		// Boolean  read/write - the viewport renders gray layers transparent - Public for VS
const short ovViewportFlipText				= 1029;		// Boolean  read/write - the viewport/dlvp adjusts for flipped text - Public for VS
const short ovViewportBlackAndWhite			= 1030;		// Boolean  read/write - the viewport/dlvp draws in black and white only - Public for VS
const short ovViewportUseDocumentClassVis	= 1031;		// Boolean  read/write - set/reads the Use Document Class visibilities settings for dlvps - Public for VS
const short ovViewportDescription			= 1032;		// Str63	read/write - a description for the viewport, which corresponds to the Dwg Title field for a corresponding Drawing Label. - Public for VS
const short ovViewportLocator				= 1033;		// Str63	read/write - the locator for the viewport, which corresponds to the Item field for a corresponding Drawing Label. - Public for VS
const short ovViewportIsLinked				= 1034;		// Boolean	read - indicates whether the viewport is a linked viewport
const short ovViewportDisplayPlanar			= 1035;		// Boolean	read/write - the flag to indicate if planar and 2D objects are to be displayed
const short ovViewportForegroundRenderType	= 1036;		// short	read/write - the viewport render type. - Public for VS

// Sketch selectors
const short ovSketchStyle					= 1100;		// long read/write, -2 = no sketch, 0 = default, > 0 = refNum of the sketch style - Public for VS

// Georeference Node Selectors
const short ovGeoRefProjection				= 1110;		// short		read/write - the projection type lambert conic = 0, utm = 1 - Public for VS
const short ovGeoRefFlag					= 1111;		// Boolean		read/write - the lat/long vs XY flag if lat/long file true else false - Public for VS
const short ovGeoRefFirstFlag				= 1112;		// Boolean		read/write - the first import flag true until a shapefile has been imported - Public for VS
const short ovGeoRefLayerFlag				= 1113;		// Boolean		read/write - the new layer/class flag if user chose new layer option true  - Public for VS - Public for VS
const short ovGeoRefScale					= 1114;		// double		read/write - the model space scale - Public for VS
const short ovGeoRefPoint					= 1115; 	// WorldPt		read/write - the georeference point to use when projection algorithms are called - Public for VS
const short ovGeoRefOffset					= 1116;		// WorldPt		read/write - the georeference offset to use when projection algorithms are called - Public for VS
const short ovGeoRefLayer					= 1117;		// RefNumber	read/write - the layer of the first import to class if user selected import to new class - Public for VS

// Wall Style Selectors
const short ovWallStyleThickness						= 1118;	// WorldCoord	read/write - The wall thickness - Public for VS
const short ovWallStylePenWeight						= 1119;	// short		read/write - The wall pen weight - Public for VS
const short ovWallStylePenStyle							= 1120;	// short		read/write - The wall pen style - Public for VS
const short ovWallStyleFill								= 1121;	// long			read/write - The fill pattern index or negative ref number of the wall fill - Public for VS
const short ovWallStylePenForeColor						= 1122;	// short		read/write - The color index of the wall pen fore color - Public for VS
const short ovWallStylePenBackColor						= 1123;	// short		read/write - The color index of the wall pen back color - Public for VS
const short ovWallStyleFillForeColor					= 1124;	// short		read/write - The color index of the wall fill fore color - Public for VS
const short ovWallStyleFillBackColor					= 1125;	// short		read/write - The color index of the wall fill back color - Public for VS
const short ovWallStyleUseClassAttributes				= 1126;	// Boolean		read/write - Whether or not all the wall attributes are by class - Public for VS
const short ovWallStyleHeight							= 1127;	// WorldCoord	read/write - The wall height (insertion option) - Public for VS
const short ovWallStyleLinkHeightToLayerDeltaZ			= 1128;	// Boolean		read/write - Whether or not the wall height is linked to the layer delta z (insertion option) - Public for VS
const short ovWallStyleLayerDeltaZOffset				= 1129;	// WorldCoord	read/write - The offset of the wall height from the layer delta z (insertion option) - Public for VS
const short ovWallStyleClass							= 1130;	// RefNumber	read/write - The ref number of the class of the wall (insertion option) - Public for VS
const short ovWallStyleCaps								= 1131;	// short		read/write - The wall caps (insertion option) - 0 = None, 1 = Start, 2 = End, 3 = Both - Public for VS
const short ovWallStyleControlOffset					= 1132;	// WorldCoord	read/write - The control offset for the Wall Tool or Round Wall Tool (insertion option)  - Public for VS
const short ovWallStyleUseTexturesAtWallCreation		= 1133;	// Boolean		read/write - Whether or not the Wall Style textures are applied at creation (insertion option) - Public for VS
const short ovWallStyleUseLeftTextureForTheEntireWall	= 1134;	// Boolean		read/write - Whether or not the left Wall Style texture is used for the entire wall (insertion option) - Public for VS
const short ovWallStyleLeftTexture						= 1135;	// RefNumber	read/write - The ref number of the left texture of the wall (insertion option) - Public for VS
const short ovWallStyleCenterTexture					= 1136;	// RefNumber	read/write - The ref number of the center texture of the wall (insertion option) - Public for VS
const short ovWallStyleRightTexture						= 1137;	// RefNumber	read/write - The ref number of the right texture of the wall (insertion option) - Public for VS
const short ovWallStyleMark								= 1138;	// Str255		read/write - The mark (data field) - Public for VS
const short ovWallStyleDescription						= 1139;	// Str255		read/write - The description (data field) - Public for VS
const short ovWallStyleWallFunction						= 1140;	// Str255		read/write - The function (data field) - Public for VS
const short ovWallStyleCostIndexCode					= 1141;	// Str255		read/write - The cost index code (data field) - Public for VS
const short ovWallStyleFireRating						= 1142;	// Str255		read/write - The fire rating (data field) - Public for VS
const short ovWallStyleSTCRating						= 1143;	// Str255		read/write - The STC rating (data field) - Public for VS
const short ovWallStyleThermalResistance				= 1144;	// Str255		read/write - The thermal resistance (data field) - Public for VS
const short ovWallStyleModel							= 1145;	// Str255		read/write - The model (data field) - Public for VS
const short ovWallStyleManufacturer						= 1146;	// Str255		read/write - The manufacturer (data field) - Public for VS
const short ovWallStyleURL								= 1147;	// Str255		read/write - The URL (data field) - Public for VS
const short ovWallStyleUseFillClassAttributes			= 1148;	// Boolean		read/write - Whether or not the wall fill attributes are by class - Public for VS
const short ovWallStyleUsePenClassAttributes			= 1149;	// Boolean		read/write - Whether or not the wall pen attributes are by class - Public for VS
const short ovWallStyleOpacity							= 1150;	// short		read/write - The wall opacity - Not for public use
const short ovWallStyleUseClassOpacity					= 1151;	// Boolean		read/write - Whether or not the wall opacity is by class - Public for VS
const short ovWallStyleCapAttributesType				= 1157; // short		read/write - The wall cap attributes type - 0 = Wall line, 1 = Component lines - Public for VS

// Symbol Definition Resource Browser Preview Selectors
// --------------
const short ovThumbnailView								= 1152;	// short		write only - The Resource Browser's thumbnail view for a symbol - Public for VS
const short ovThumbnailRender							= 1153;	// short		write only - The Resource Browser's thumbnail render for a symbol - Public for VS

// RenderWorks Background
const short ovRWBackgroundWidth							= 1154; // WorldCoord	read/write - RenderWorks image background width - Public for VS
const short ovRWBackgroundHeight						= 1155; // WorldCoord	read/write - RenderWorks image background height - Public for VS

// Planar Objects
const short ovPlanarObjIsSrceen							= 1160;	// Boolean		read/write - Checks if an object is 2D screen object.

//////////////////////////////////////////////////////////////////////////////////////////
// GetDimensionStandardVariable and SetCustomDimensionStandardVariable selectors
//
//		These selectors let you get properties of
//		specific dimension standards.  They have the return/passed
//		type as a comment following the selector

const short dimStdWitGap		  =  1;	  // (double_gs)	the gap between the witness line and the object being dimensioned (-2.0 to 2.0 page inches)
const short dimStdWitExtend		  =  2;	  // (double_gs)	the length that the witness line extends above the dimension line (-2.0 to 2.0 page inches)
const short dimStdMinALength	  =  3;	  // (double_gs)	the minimum length of the dimension arrow lines when they are inside (between the witness lines) (-2.0 to 2.0 page inches)
const short dimStdExtALength	  =  4;   // (double_gs)	the length of the dimension arrow lines when they are outside (not between the witness lines) (-2.0 to 2.0 page inches)
const short dimStdStackGap		  =  5;	  // (double_gs)	the distance between dimension lines for stacked (base-line) dimensions (-2.0 to 2.0 page inches)
const short dimStdAboveGap		  =  6;   // (double_gs)	the distance that the text sits above the dimension line (-2.0 to 2.0 page inches)
const short dimStdLeaderLength	  =  7;   // (double_gs)	the length of the leader line for radial and diametral dimensions (-2.0 to 2.0 page inches)
const short dimStdOverHang		  =	 8;   // (double_gs)	the amount that the dimension line extends beyond the witness lines (-2.0 to 2.0 page inches)
const short dimStdMarkLength	  =	 9;   // (double_gs)	the length of one spoke of the center cross for centermarks (-2.0 to 2.0 page inches)
const short dimStdExtendLength	  = 10;   // (double_gs)	the amount that the extension line extends beyond the circle for centermarks (-2.0 to 2.0 page inches)
const short dimStdMarkGap		  =	11;	  // (double_gs)	the gap between the center cross and the extension lines for centermarks (-2.0 to 2.0 page inches)
const short dimStdAlignDimText	  = 12;   // (UInt8)		the text alignment for linear dimensions (0: horiz, 1: horiz/vert, 2: aligned)
const short dimStdAlignInsideRad  = 13;   // (UInt8)		the text alignment for interior radial dimensions (0: horiz, 1: horiz/vert, 2: aligned)
const short dimStdAlignAngText	  = 14;   // (UInt8)		the text alignment for angular dimensions (0: horiz, 1: horiz/vert, 2: aligned)
const short dimStdOptions		  =	15;   // (UInt8)		a set of 5 bit flags: (128: witness lines, 64: text left, 32: dim in/out, 16: SIA format, 8: arrows inside only) 	
const short dimStdLinearArrowType = 16;	  // (UInt8)		the type of the linear dimension arrowheads (see MarkerStyleType)
const short dimStdAlignRadText	  = 17;   // (UInt8)		the text alignment for exterior radial dimensions (0: horiz, 1: horiz/vert, 2: aligned)
const short dimStdSlashThickness  = 18;	  // (UInt8)		the thickness of the dimension slash tick marks in mils
const short dimStdRadArrowType	  = 19;   // (UInt8)		the type of the radial dimension arrowheads
const short dimStdAngArrowType	  = 20;   // (UInt8)		the type of the angular dimension arrowheads
const short dimStdWitnessFixed	  = 21;   // (UInt8)		the state of the fixed witness line flag (0: off, 1: on)
const short dimStdLinearASize	  =	22;	  // (Sint16)		the size of the linear dimension arrowheads
const short dimStdRadASize		  =	23;	  // (Sint16)		the size of the radial dimension arrowheads
const short dimStdAngASize		  =	24;	  // (Sint16)		the size of the angular dimension arrowheads
const short dimStdstandardName	  = 25;   // (Str255)		the name of the dimension standard
const short dimStdTolSizeFac	  =	26;   // (UInt8)		the size of the tolerance text (as a percentage of the dimension text)
const short dimStdLinearAAngle	  = 27;	  // (UInt8)		the angle of the linear dimension arrowheads
const short dimStdRadAAngle		  =	28;	  // (UInt8)		the angle of the radial dimension arrowheads
const short dimStdAngAAngle		  =	29;	  // (UInt8)		the angle of the angular dimension arrowheads
const short dimStdDualUnitsInd	  = 30;   // (Sint16)		the dual units indicator (1: single, 2: side-by-side, 3: stacked)
const short dimStdFixedWitLength  = 31;   // (double_gs)	the length ofthe fixed witness lines (-2.0 to 2.0 page inches)
const short dimStdDialUnitsView   = 32;	  // (UInt8)		the dual units view selector: kDualViewPrimaryOnly(1):primary only, kDualViewSecondaryOnly(2):secondary only, kDualViewBoth(0): both
const short dimStdLinearArrowVis  = 33;   // (UInt8)		visibility of the linear dimension arrowheads
const short dimStdRadArrowVis     = 34;   // (UInt8)		visibility of the radial dimension arrowheads
const short dimStdAngArrowVis     = 35;   // (UInt8)		visibility of the angular dimension arrowheads
const short dimStdLinearAWidth	  = 36;	  // (Sint16)		the width of the linear dimension arrowheads (zero value also allowed)
const short dimStdRadAWidth		  = 37;	  // (Sint16)		the width of the radial dimension arrowheads (zero value also allowed)
const short dimStdAngAWidth		  = 38;	  // (Sint16)		the width of the angular dimension arrowheads (zero value also allowed)
const short dimStdLArrThickBasis  = 39;	  // (Sint8)		linear marker thickness basis dimLinearMarkerThicknessBasis - values are MarkerThicknessBasis type
const short dimStdAArrThickBasis  = 40;	  // (Sint8)		angular marker thickness basis dimOtherMarkerThicknessBasis - values are MarkerThicknessBasis type
const short dimStdRArrThickBasis  = 41;	  // (Sint8)		radial marker thickness basis dimOtherMarkerThicknessBasis - values are MarkerThicknessBasis type
const short dimStdLArrThickness   = 42;	  // (UInt8)		linear marker thickness value dimLinearMarkerThickness
const short dimStdAArrThickness   = 43;	  // (UInt8)		angular marker thickness value dimOtherMarkerThickness
const short dimStdRArrThickness   = 44;	  // (UInt8)		radial marker thickness value dimOtherMarkerThickness
												


//////////////////////////////////////////////////////////////////////////////////////////
// GetApplicationResFile selectors
//

const short kTopmostApplicationResFile	= 1;	// pass this to get the resource file topmost in the chain. If you use the
												// normal resource search progression with this constant, you will always
												// find any resource in the core application. Otherwise, you can use a more
												// specific selector below.
const short kMainAppResFile				= 2;
const short kVWResourcesResFile			= 3;
const short kVWHelpResFile				= 4;
const short kVWLocaleResFile			= 5;





//////////////////////////////////////////////////////////////////////////////////////////
// Intersection types

struct Sect2Struct {
	WorldPt		int1;
	Boolean			legal1;		/* Is int1 a real intersection */
	WorldPt		int2;
	Boolean			legal2;		/* Is int2 a real intersection */
};

struct Sect4Struct {
	WorldPt		int1;
	Boolean			legal1;		/* Is int1 a real intersection */
	WorldPt		int2;
	Boolean			legal2;		/* Is int2 a real intersection */
	WorldPt		int3;
	Boolean			legal3;		/* Is int3 a real intersection */
	WorldPt		int4;
	Boolean			legal4;		/* Is int4 a real intersection */
};


//////////////////////////////////////////////////////////////////////////////////////////
// CustomObject (Parametric) callback argument constants
// Renamed the "parametric" constants with "customobject". JAK 5/4/98

const Sint8 kCustomObjectPrefNever 		= 0;
const Sint8 kCustomObjectPrefAlways 	= 1;
const Sint8 kCustomObjectPrefNew 		= 2;


//////////////////////////////////////////////////////////////////////////////////////////
// LightType constants

enum {
	// Light kind
	kDirectionalLight = 0,
	kPointLight,
	kSpotLight,
	
	// Distance and angular falloff
	kLightNoFalloff	= 0,

	// Distance falloff
	kLightInverseDistance = 1,
	kLightInverseDistanceSquared,

	// Angular falloff
	kLightLinear = 1,
	kLightExponential,
	kLightCosine
};

// Constants for standard views
const short viewUserDefined		= 0;
const short viewFront			= 3;
const short viewBack			= 4;
const short viewLeft			= 5;
const short viewRight			= 6;
const short viewTop 			= 7;
const short viewBottom			= 8;
const short viewRightIso		= 9;
const short viewLeftIso 		= 10;
const short viewRightRearIso	= 11;
const short viewLeftRearIso 	= 12;
const short viewBottomRightIso	= 13;
const short viewBottomLeftIso	= 14;
const short viewBottomRightRearIso = 15;
const short viewBottomLeftRearIso = 16;


#ifndef _MINICAD_

//////////////////////////////////////////////////////////////////////////////////////////
// projection types (from XGraf3d.h)

const short perspective 		= 1;
const short cavalierOblique45	= 2;	// parallel oblique projection at angle
const short cavalierOblique30	= 3;	// parallel oblique projection at angle
const short cabinetOblique45	= 4;	// parallel oblique projection at angle
const short cabinetOblique30	= 5;	// parallel oblique projection at angle
const short plan				= 6;
const short section 			= 7;
const short sectionPlus 		= 8;



//////////////////////////////////////////////////////////////////////////////////////////
//Render Constants

const short renderWireFrame 	= 0;
const short renderQuick 		= 1;
const short renderSolid 		= 2;
const short renderShadedSolid	= 3;
const short renderShadedNoLines = 4;
const short renderFinalShaded 	= 5;
const short renderFinalHiddenLine = 6;
const short renderDashedHiddenLine = 7;
const short render2DSection		= 8;
const short render3DSection		= 9;


//////////////////////////////////////////////////////////////////////////////////////////
// sym def types

const short k2DSym				= 0;
const short k3DSym				= 1;
const short kHybridSym			= 2;

#endif // _MINICAD_


//-----------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------
struct CustomBarFieldInfo
//
//	CustomBarFieldInfo is used for the Custom Editable DataBar APIs
//	
//		GS_CustomBarGetFieldInfo and GS_CustomBarSetFieldInfo
{	
	CustomBarFieldInfo() :
		fIsEditable(false),
		fIsLocked(false)
	{
		fFieldLabel[0] = 0;
		fFieldValue[0] = 0;
	}
	
	
	Str20 	fFieldLabel;
	Str20 	fFieldValue;
	Boolean fIsEditable;
	Boolean fIsLocked;
};


//////////////////////////////////////////////////////////////////////////////////////////
// Host information about which program is currently running

#ifndef GSEBUILDTYPES
#define GSEBUILDTYPES
const short kMiniCad 			= 1;
const short kBlueprint 			= 2;
#endif


//////////////////////////////////////////////////////////////////////////////////////////



#define GS_COMPATIBILITY
#define GS_LIBRARY


//////////////////////////////////////////////////////////////////////////////////////////

extern "C" {
	typedef Boolean (*GS_ForEachBreakProcPtr)(MCObjectHandle h, long index, WorldCoord off, long breakType, void* breakData, CallBackPtr cbp, void* env);
	typedef void (*GS_I2DDrawProcPtr)(const WorldPt& startPt, const WorldPt& drawPt, CallBackPtr cbp, void *env);
	typedef void (*GS_ForEachObjectProcPtr)(MCObjectHandle h, CallBackPtr cbp, void *env);
	typedef bool (*GS_3DPointIteratorProcPtr)(WorldPt3 point3D, CallBackPtr cbp, void* env);	// XXX_JDW_MISC - i think bool is illegal in SDK, and also unused in these functions
	typedef void (*GS_ForEachPolyEdgeProcPtr)(const WorldPt& inStartPt, const WorldPt& inControlPt, const WorldPt& inEndPt, WorldCoord inRadius, VertexType inType, CBBoolean inVisible, CallBackPtr inCBP, void* inEnv);
	typedef void (*GS_PersistentDrawProcPtr)(CallBackPtr cbp, void *env); 
	
	typedef void (*GS_CustomObjectControlPtsInitProcPtr)(CallBackPtr cbp, long inIndex, WorldPt3& outPt, Boolean& outIs2DOnly, Boolean& outIsHidden, short& outClientID, void* env);	



// XXX_JDW_ALTURA CLEANUP cross platform SDK based file identifier for
// ForEachFileProcPtr - we have a mix of Boolean, OSErr, and GSError
// This was Boolean but seems to need to be OSErr...
// JDW  [2003-01-12] - added  && !_GSWINSDK_ to build GSWinSDK	
// JDW  [2003-05-12] - changing all to EForEachFileResult enum to get rid of wackyness
// JDW  [2005-01-19] - changed order to have true/false correspond to stop/continue (as before with Boolean results)
//						and restored the Boolean versions of the proc ptrs and callbacks in compatibility mode in 
//						case existing 3rd party SDK code hasn't been updated.  This may or may not make one or more people happy.

#ifndef EForEachFileResult_DEFINED
#define EForEachFileResult_DEFINED
enum EForEachFileResult 
// THIS IS ALSO DEFINED IN APPLICATIONFOLDERS.H - keep in sync
{
	kContinueForEachFile		= 0,	// Keep traversing - Returned by callback to tell ForEachFile to keep going
	kStopForEachFile_NoError	= 1,	// Stop traversal for non-error reason - This is the normal return value when you are only looking for one file
	kStopForEachFile_Error		= 2,	// Abnormal abort of traversal due to some error
	kFolderNotFoundError		= 3,	// You may get this if you pass in invalid folder info
	kOSFinishedTraversingSubDir	= 4,	// No more files available - This is the normal successful return value for ForEachFile

	kDummyForceEnumToBeLong		= 0xFFFFFFFF
};
#endif

#if !_WIN_EXTERNAL_ && !_GSWINSDK_
	#if GS_SDK_VW11_COMPATIBLE
	typedef Boolean			   (*GS_ForEachFileProcPtr )(long vRefNum, long dirID, StringPtr fileName, OSType fileType, CallBackPtr cbp, void* env);
	#endif
	typedef EForEachFileResult (*GS_ForEachFileNProcPtr)(long vRefNum, long dirID, StringPtr fileName, OSType fileType, CallBackPtr cbp, void* env);
#endif

	#if GS_SDK_VW11_COMPATIBLE
	typedef Boolean			   (*GS_ForEachFilePathProcPtr )(const char* fullPath, const char* fileName, const char* fileExtension, CallBackPtr cbp, void* env);
	#endif
	typedef EForEachFileResult (*GS_ForEachFilePathNProcPtr)(const char* fullPath, const char* fileName, const char* fileExtension, CallBackPtr cbp, void* env);



	//------------------------------------------------------------------------------------
	//	ToolDefProcPtr is the procedure pointer that is passed in to GS_RunTemporaryTool.
	//	
	typedef long (*ToolDefProcPtr)(long action, long message1, long message2, long& userData, CallBackPtr defData);
	

	//------------------------------------------------------------------------------------
	// XXX_JDW_ALTURA [2003-02-19] - de-kludge
	#if GS_WIN && (defined(_GSESDK_) || defined(_MINICAD_))
		typedef enum EAlturaBufFunctionEnum { eAnsiToMacBuf = 0, eMacToAnsiBuf };

		const unsigned int			kAnsiMacBufDataStructSize = 24;		//The size of the structure used by the kKludgeAlturaBufFunctionAccess GS_Kludge(...)
																		//selector, as originally defined by the author. This is also defined in 
																		//AlturaStubs.cpp.

		const CBSignedShort	kKludgeAlturaBufFunctionAccess  = 5678; //Provides access to WinAnsiToMacBuf(...) and WinMacToAnsiBuf(...) for externals. This
																	//is a temporary solution until more appropriate access to this functionality can 
																	//be provided. [AAO, 1-30-03]

		const CBSignedShort kKludgeAlturaPortGlobalAccess	= 5679;	//Provides access to QDGlobals.thePort for externals. This
																	//is a temporary solution until more appropriate access to this functionality can 
																	//be provided. [AAO, 2-5-03]

		// XXX_JDW_ALTURA [2003-02-19] - See also fake callback GS_Mac2WinString, GS_Win2MacString
		struct TAnsiMacBufDataStructAlturaRemoval {
			EAlturaBufFunctionEnum	feFunctionEnumeration;				//Function enumeration - indicates which function should be called.
			unsigned char const*	fpInAnsiString;						//Pointer to an ANSI string (constant) - used by WinAnsiToMacBuf(...)
			unsigned char const*	fpInMacString;						//Pointer to a "Mac-style" string (constant) - used by WinMacToAnsiBuf(...)
			unsigned char*			fpOutAnsiString;					//Pointer to an ANSI string - used by WinMacToAnsiBuf(...)
			unsigned char*			fpOutMacString;						//Pointer to a "Mac-style" string - used by WinAnsiToMacBuf(...)
			short					fStringLength;						//Length of the ANSI or "Mac-style" string - used by both functions
			short					fConversionFlag;					//Conversion flag - used by WinMacToAnsiBuf(...)
		};
	#endif //  GS_WIN && (defined(_GSESDK_) || defined(_MINICAD_))


	//------------------------------------------------------------------------------------
	// Kludge so 
	
	const CBSignedShort kKludgeHandleIncomingFilePath = 3650;
	struct TKludgeHandleIncomingFilePath {
		Boolean fForWrite;
		Str255	fPath;
		Boolean fHadError;
	};


	// 
	// --------------------------------------------------------
	// kludge used for the addsurface function in plant object
	// --------------------------------------------------------
	//    

	const CBSignedShort kAddSurfaceKludge = 5555;
	struct AddSurfaceInformation {
		MCObjectHandle h1;
		MCObjectHandle h2;
		MCObjectHandle result;
	};

	//
	// --------------------------------------------------------
	// kludge used for the entering 2d and 3d groups
	// in the plant object editing
	// --------------------------------------------------------
	//

	const CBSignedShort kEnterGroups = 5556;

	//
	// --------------------------------------------------------
	// kludge used for initializing and setting the
	// hidden plant record
	// --------------------------------------------------------
	//

	const CBSignedShort kSetAndGetHiddenPlantRecord = 5557;
	struct SetAndGetHiddenPlantRecord{
		Boolean isDoubleClick;
		Boolean isSetting;
		Boolean result;
	};

	//
	// --------------------------------------------------------
	// kludge used when creating the default
	// plant record
	// --------------------------------------------------------
	//

	const CBSignedShort kCreatePlantRecord = 5558;

	//
	// --------------------------------------------------------
	// kludge used from the plugin to tell if object is 
	// a plant object or not
	// --------------------------------------------------------
	//

	const CBSignedShort kIsPlantObject = 5559;
	struct isPlantObject{
		MCObjectHandle objectInQuestion;
		Boolean isPlantOrNot;
	};

	//
	// --------------------------------------------------------
	// kludge used from the plant plugin to rename a plant
	// resource if the user edits the plant ID in the 
	// definition of the plant
	// --------------------------------------------------------
	//

	const CBSignedShort kIsEditingPlantID = 5560;
	struct isEditingPlantID{
		Str255 oldName;
		Str255 newName;
	};

	// 
	// --------------------------------------------------------
	// kludge used from the plant plugin to change the view
	// to specific angles for the 3d scaling portion of the
	// plant object
	// --------------------------------------------------------
	//

	const CBSignedShort kChange3DViewForPlant = 5561;

	// 
	// --------------------------------------------------------
	// kludge used to set the height/width of the image prop
	// from inside the plant object
	// --------------------------------------------------------
	//

	const CBSignedShort kSetImagePropStuff = 5562;
	struct isSettingImagePropStuff{
		MCObjectHandle imageProp;
		double spread;
		double height;
	};

	//
	// --------------------------------------------------------
	// kludge used to set the tool in reshape mode from the
	// plant special edit dialog
	// --------------------------------------------------------
	//

	const CBSignedShort kEditPlantPath = 5563;

	//
	// --------------------------------------------------------
	// kludge used for setting the symbol type of the plant
	// --------------------------------------------------------
	//

	const CBSignedShort kSetPlantSymbolType = 5564;
	struct plantSymbolTypeStuff{
		MCObjectHandle plant;
		short symbolType;
	};

	//
	// --------------------------------------------------------
	// kludge used for setting timestamp of plant symbols
	// --------------------------------------------------------
	//

	const CBSignedShort kSetPlantSymbolTimeStamp = 5565;

	//
	// --------------------------------------------------------
	// kludge used for refreshing the resource browser
	// --------------------------------------------------------
	// 

	const CBSignedShort kRefreshResourceBrowser = 5566;

	// 
	// --------------------------------------------------------
	// kludge used for the plant object when creating a new
	// image prop for the 3d symbol portion of a plant
	// --------------------------------------------------------
	//    

	const CBSignedShort kCreatePlantImageProp = 5567;
	struct PlantImagePropStuff {
		InternalName imagePropName;
		InternalIndex textureRef;
		double spread;
		double height;
		MCObjectHandle imagePropHandle;
	};

	//
	// --------------------------------------------------------
	// kludge used when verifying/fixing the plant price
	// display style in the plant record
	// --------------------------------------------------------
	// 

	const CBSignedShort kUpdatePriceInPlantRecord = 5568;

	//
	// --------------------------------------------------------
	// kludge used when the dtm modifier record has to be 
	// attached to a poly so that the landscape area can 
	// be a texture bed on the dtm
	// --------------------------------------------------------
	//

	const CBSignedShort kCreateDTMModifierRecord = 5569;
	const int kDTMModifierRecordStringIndex		= 259;
	const int kDTMModifierRecord_recordName		= 1;
	const int kDTMModifierRecord_type			= 2;
	const int kDTMModifierRecord_deltaz			= 3;
	const int kDTMModifierRecord_riseOverRun	= 4;
	const int kDTMModifierRecord_className		= 5;
	const int kDTMModifierRecord_errMessage		= 6;
	const int kDTMModifierRecord_value1			= 7;
	const int kDTMModifierRecord_value2			= 8;

	// 
	// --------------------------------------------------------
	// kludge that checks for a "New" or "Window" menu command
	// inside the plant tool
	// --------------------------------------------------------
	//

	const CBSignedShort kCheckMenuForPlantTool = 5575;

	//
	// --------------------------------------------------------
	// kludge that sets it so the image popup in the plant tool
	// will unpopup when there is a resource conflict when
	// importing from default content
	// --------------------------------------------------------
	//

	const CBSignedShort kSetUnpopupValueForPlantTool = 5576;

	// 
	// --------------------------------------------------------
	// kludge used to get the unpopup global variable
	// for the plant tool image popup issue
	// --------------------------------------------------------
	//

	const CBSignedShort kGetUnpopupValueForPlantTool = 5577;

	//
	// --------------------------------------------------------
	// kludge used to remove all the "all by class" flags
	// --------------------------------------------------------
	//

	const CBSignedShort kClearAllByClassFlags = 5570;

    const CBSignedShort kIntersectSurfaceKludge = 5571;
	struct IntersectSurfaceInformation {
		MCObjectHandle h1;
		MCObjectHandle h2;
		MCObjectHandle result;
	};

 	//
	// --------------------------------------------------------
	// kludge used to raise a notitifcation
	// --------------------------------------------------------
	//
    const CBSignedShort kKludgeNotifyAny = 5573;
    struct NotifyAnyStuff {
        NotifyAnyStuff(long selector) { notifySelector = selector; }
        long notifySelector;
        long additionalData;
    };

	//
	// --------------------------------------------------------
	// kludge used to draw a gray dashed 2D line
	// --------------------------------------------------------
	//

	const CBSignedShort kKludgeDrawGrayDashed2DLine = 4007;
	struct DrawGrayDashed2DLineStuff  {
		WorldPt pt1;
		WorldPt pt2;
	};

	//------------------------------------------------------------------------------------
	#if _WINDOWS
	
	// These are fake callbacks.  They are implemented in the DLL not the EXE.

	void GS_CALLBACK GS_Mac2WinString(CallBackPtr cbp, const unsigned char *ps, char *sz, int max);
	// Convert from Mac Pascal string to Windows C-string.

	void GS_CALLBACK GS_Win2MacString(CallBackPtr cbp, const char *sz, unsigned char *ps, int max);
	// Convert from Windows C-string to Mac Pascal string.

	void GS_CALLBACK GS_AngleToCString(CallBackPtr cbp, double_param angle, char *sz, int max);
	void GS_CALLBACK GS_CoordToDimCString(CallBackPtr cbp, const WorldCoord &c, char *sz, int max);
	Boolean GS_CALLBACK GS_CStringToAngle(CallBackPtr cbp, const char *sz, double_gs &angle);
	Boolean GS_CALLBACK GS_DimCStringToCoord(CallBackPtr cbp, const char *sz, WorldCoord& c);

	#endif // _WINDOWS
}


//	NNA TaggedData contaner IDs:
//	NNA reserves all "lowercase" OSTypes.
//	The Tagged Data APIs are reserved at this point for internal NNA usage.
const OSType kTaggedDataContainerNNA_Internal1 = 'rwrs';
const OSType kTaggedDataContainerNNA_Internal2 = 'rwlo';
const OSType kTaggedDataContainerNNA_Internal3 = 'rwvs';
const OSType kTaggedDataContainerNNA_Internal4 = 'pxpm';
const OSType kTaggedDataContainerNNA_Internal5 = 'seli';
const OSType kTaggedDataContainerNNA_Internal6 = 'ptd_';
const OSType kTaggedDataContainerNNA_Internal7 = 'pdf_';
const OSType kTaggedDataContainerNNA_Internal8 = 'mshs';
const OSType kTaggedDataContainerNNA_Internal9 = 'vcs_';
const OSType kTaggedDataContainerNNA_Internal10 = 'dlvp';
const OSType kTaggedDataContainerNNA_Internal11 = 'stlo';
const OSType kTaggedDataContainerNNA_Internal12 = 'gdlt';
const OSType kTaggedDataContainerNNA_Internal13 = 'rwtt';
const OSType kTaggedDataContainerNNA_Internal14 = 'ptag';
const OSType kTaggedDataContainerNNA_Internal15 = 'sbnt';
const OSType kTaggedDataContainerNNA_Internal16 = 'rdnt';
const OSType kTaggedDataContainerNNA_Internal17 = 'iobj';

//	TaggedData data type IDs used in GS_TagggedData## APIs:
const int kTaggedDataByteArrayTypeID = 1;		
const int kTaggedDataFlagsContainerTypeID = 2;	
const int kTaggedDataDoubleArrayTypeID = 6;		
const int kTaggedDataTramsformMatrixTypeID = 7;
const int kTaggedDataUint32ArrayTypeID = 8;	
const int kTaggedDataColorRefArrayTypeID = 13;	
const int kTaggedDataObjectRefArrayTypeID = 15;


const int kNNA_InternalTag1 = 1;	// Tag Used by NNA Plugin
const int kNNA_InternalTag2 = 2;	// Tag Used by NNA Plugin


//////////////////////////////////////////////////////////////////////////////////////////
// =======================================================================================
//	"Private" Callback information
//
//	The following definitions are only needed by "Private" callbacks, 
//	(called by those externals for which Diehl Graphsoft does not ship source code).
//	This information should be moved to some new private header file which we 
//	do not ship with SDK releases, but is available in house for our externals.
//	JAK 4/23/98

//	Define my own structure that is similar but not identical to the ones in Overlay.h.
//	I'm doing this for two reasons.  Attempting to use Overlay.h caused this not to 
//	compile in externals because MiniCadCallBacks is included in GCL files which have
//	different string achitecture, so the PStr31 below would not work.  Cannot successfully
//	include GSString.h here either.  Would have to cut-n-paste the TFlag stuff into here
//	for externals also which is ugly.
//	Also...by using the existing structs in Overlay.h I am unnecessarily tying my callback 
//	to that file. If it changes, it would break my callback and require a separate definition
//	so I might as well do it now.
//
//	We don't need binary compatibililty with the structures defined in Overlay.h, 
//	we only need similar data. 
//

//	enum MPEType {	kMPMenu = 0, 
//				kMPTool = 1, 
//				kMPParametricTool = 2,
//				kMPTextFile = 3 };
// JAK 4/26/99 Rename type and enum constants using appropriate terminology.
enum EVSPluginType	{	kVSPluginMenu	= 0, 
						kVSPluginTool	= 1, 
						kVSPluginObject	= 2,
						kVSTextFile 	= 3 };

// =======================================================================================
// ObjectState struct information data

//----------------------------------------------------------
struct ObjectStateData_Position
// StateData for position changes
// data reflect the offsets of the change
//	matrix contains offset of translation
//	matrix contains angle difference for rotation
{
	Boolean			fbIs3DMove;
	TransformMatrix	fTransformOffset;
};

//----------------------------------------------------------
struct ObjectStateData_ParamChanged
// StateData for parameter changes
//	data reflects the parameter index and old data of the format record parameter
{
	Sint32			fWidgetID;
	Sint32			fParameterIndex;
	Boolean			fParameterValidOldValue;
	TVariableBlock	fParameterOldValue;
};

//----------------------------------------------------------
struct ObjectStateData_ObjectChanged
// StateData for object changes
//	this is sent for attributes object change
{
	Sint32			fChangeID;
}; 

//----------------------------------------------------------
struct ObjectStateData_LayerChanged
// StateData for scale changes of the parent layer or viewport
{
	double			fdOldLayerScale;
	double			fdLayerScale;
	Boolean			fbScaleText;
};

//----------------------------------------------------------
struct ObjectStateData_ExitFromEditGroup
// StateData for exit edit group
//	fGroupType is one of the 'kObjectEditGroupPropertyID' property values
{
	unsigned char		fGroupType;
};

//----------------------------------------------------------
struct ObjectStateData_ObjectNameChanged
// StateData for object name change
{
	GSStr63		fOldName;
	GSStr63		fNewName;
};

//----------------------------------------------------------
struct ObjectStateData_ObjectPlanarRefChanged
// StateData for object planar ref change
{
	bool		fbIsScreenObject;
};

// =======================================================================================

#ifndef _MENUENABLEACCESS_
	#define _MENUENABLEACCESS_ 1

	// From MMenu.h
	struct MenuEnableAccess
	{
		Uint16 needs;
		Uint16 needsNot;
	};
#endif


// =======================================================================================
// similar to ToolFlagsType as defined in Overlay.h

struct MPToolFlags {
	Boolean			disablePickUpdate;		// Selects whether UpdateToolInfo is called when the mouse is moved
	Boolean			needsScreenPlane;		// Does the tool require screen plane
	Boolean			needs3DView;			// Does the tool require a non-plan projection
	Boolean			uses3DCursor;			// Does the tool use 3D grid/snap points
	Boolean			screenBasedCursor;		// Does the tool use only screen pos. without gridding
	Boolean			needsPerspective;
	Boolean			dontShowScreenHints;	// Turn off screen hints
	
};


// =======================================================================================
// similar to PalToolDataType as defined in Overlay.h (and 'TDef' resources)

struct MPToolData {
	MPToolFlags		toolFlags;
	short			iconID;
	short			defaultCursID;
	GSStr255		messageStr;
	short			waitMoveDist;
	long			constraintFlags;
	short			barDisplayMode;
	short			minCompatibleVers;		// 500 for 5.0.0
};
typedef	MPToolData *MPToolDataPtr, **MPToolDataHandle;


// =======================================================================================
class TMPExternalDataForWorkspace
{
	public:
		EVSPluginType			fType;
		GSStr63				fName;			// name:category
		GSStr255				fHelpText;
		MenuEnableAccess		fEnableFlags;
		MPToolDataHandle		fToolDataHand;
		Uint8					fIconData[32 * 32 * 4];
		size_t					fIconDataSize;
		short					fVersionCreated;
		short					fVersionModified;
		short					fVersionRetired;		
};


// End "Private" Callback section
//=====================================================================================
//////////////////////////////////////////////////////////////////////////////////////////



//////////////////////////////////////////////////////////////////////////////////////////
// include the automatically generated portion of this file

#if _MINICAD_ && !BUG
	// inline these calls if we are compiling inside MiniCAD except for the BUG version.
	// we won't get duplicate function name checks if we inline these functions
	// because the inlined functions use C++ calling conventions - PCP
	#define GS_INLINE_SDK_CALLS 1
#else
	#define GS_INLINE_SDK_CALLS 0
#endif

#if GS_INTERFACE_FACTORING && !GS_CORE_BUILD
	// This is skipped for now in Bernini because some of the functions are implemented as macros. [DMB 4/7/99]
#else
	#if GS_INLINE_SDK_CALLS
		#include "MiniCadCallBacks.InlineDefs.h"	
	#else
		#include "MiniCadCallBacks.Defs.h"
	#endif

	#include "ExtendedProperties.h"
	#include "../Interfaces/VectorWorks/ISDK.h"
#endif


//////////////////////////////////////////////////////////////////////////////////////////
//#if defined(_supply_new_)
//
//	#if _MINICAD_
//		#error "_supply_new_ is unsupported in MiniCAD - PCP"
//	#endif
//
//	// supply new for altura based windows externals
//	// this must be in the header because if it is in the library, then MFC
//	// based externals will not link - PCP
//
//	static void*	operator new(size_t size)		{ return GS_NewPtr(gCBP, size); }
//	static void		operator delete(void* p)		{ GS_DisposePtr(gCBP, p); }
//
//#endif // _supply_new_


// for these inlines, we don't need to export them as they are generated
// in the client code

// these are also C++ functions and can be overloaded



//////////////////////////////////////////////////////////////////////////////////////////
#if GS_SDK_VW8_COMPATIBLE
// Inlined obsolete version 8.* callbacks.

inline void GS_COMPATIBILITY GS_GetWorksheetSize(CallBackPtr cbp, MCObjectHandle worksheet, short& rows, short& cols)
{
	GS_GetWorksheetRowColumnCount (cbp, worksheet, rows, cols);
}

inline void GS_COMPATIBILITY GS_SetCellFormula(CallBackPtr cbp, MCObjectHandle worksheet, ViewPt c, ConstStr255Param formula)
{
	GS_SetWorksheetCellFormula (cbp, worksheet, c, c, formula);
}

inline void GS_COMPATIBILITY GS_GetCellFormula(CallBackPtr cbp, MCObjectHandle worksheet, ViewPt c, Str255 formula)
{
	GS_GetWorksheetCellFormula (cbp, worksheet, c, formula);
}

inline void GS_COMPATIBILITY GS_SetCellFormat(CallBackPtr cbp, MCObjectHandle worksheet, ViewPt c, CBSignedShort numForm, CBSignedShort numAcc, CBSignedShort align, ConstStr7Param leader, ConstStr7Param trailer)
{
	if (align == 2) align = kTextRightJustify;
	else if (align == 3) align = kTextCenterJustify;

	GS_SetWorksheetCellNumberFormat (cbp, worksheet, c, c, numForm, numAcc, leader, trailer);
	GS_SetWorksheetCellAlignment (cbp, worksheet, c, c, align);
}

inline void GS_COMPATIBILITY GS_GetCellFormat(CallBackPtr cbp, MCObjectHandle worksheet, ViewPt c, short& numForm, short& numAcc, short& align, Str7 leader, Str7 trailer)
{
	GS_GetWorksheetCellNumberFormat (cbp, worksheet, c, numForm, numAcc, leader, trailer);
	GS_GetWorksheetCellAlignment (cbp, worksheet, c, align);

	if (align == kTextRightJustify) align = 2;
	else if (align == kTextCenterJustify) align = 3;
}

inline void GS_COMPATIBILITY GS_SetCellBorder(CallBackPtr cbp, MCObjectHandle worksheet, ViewPt c, CBBoolean left, CBBoolean top, CBBoolean right, CBBoolean bottom)
{
	GS_SetWorksheetCellBorder (cbp, worksheet, c, c, top, left, bottom , right, false);
}

inline void GS_COMPATIBILITY GS_GetCellBorder(CallBackPtr cbp, MCObjectHandle worksheet, ViewPt c, Boolean& left, Boolean& top, Boolean& right, Boolean& bottom)
{
	GS_GetWorksheetCellBorder (cbp, worksheet, c, top, left, bottom, right);
}

inline void GS_COMPATIBILITY GS_SetColumnWidth(CallBackPtr cbp, MCObjectHandle worksheet, CBSignedShort column, CBSignedShort colWidth)
{
	GS_SetWorksheetColumnWidth (cbp, worksheet, column, column, colWidth);
}

inline void GS_COMPATIBILITY GS_GetColumnWidth(CallBackPtr cbp, MCObjectHandle worksheet, CBSignedShort column, short& colWidth)
{
	GS_GetWorksheetColumnWidth (cbp, worksheet, column, colWidth);
}

inline void GS_COMPATIBILITY GS_SetCellTextFormatN(CallBackPtr cbp, MCObjectHandle worksheet, ViewPt c, CBSignedShort fontIndex, CBSignedShort size, CBSignedShort style)
{
	GS_SetWorksheetCellTextFormat (cbp, worksheet, c, c, fontIndex, size, style);
}

inline void GS_COMPATIBILITY GS_GetCellTextFormatN(CallBackPtr cbp, MCObjectHandle worksheet, ViewPt c, short& fontIndex, short& size, short& style)
{
	GS_GetWorksheetCellTextFormat (cbp, worksheet, c, fontIndex, size, style);
}

inline void GS_COMPATIBILITY GS_SetWorksheetWindow(CallBackPtr cbp, MCObjectHandle worksheet, CBBoolean open, const ViewRect& windowPos)
{
	bool bVisible = GS_IsWorksheetVisible (cbp, worksheet);
	
	if ((bVisible && open) || (!bVisible && !open)) {
		GS_SetWorksheetPlacement (cbp, worksheet, windowPos);
	}
	else if (bVisible && !open) {
		GS_ShowWorksheet (cbp, worksheet, false);
		GS_SetWorksheetPlacement (cbp, worksheet, windowPos);
	}
 	else if (!bVisible && open) {
		GS_SetWorksheetPlacement (cbp, worksheet, windowPos);
		GS_ShowWorksheet (cbp, worksheet, false);
	}
}

inline void GS_COMPATIBILITY GS_GetWorksheetWindow(CallBackPtr cbp, MCObjectHandle worksheet, Boolean& open, ViewRect& windowPos)
{
	GS_GetWorksheetPlacement (cbp, worksheet, windowPos);
	open = GS_IsWorksheetVisible (cbp, worksheet);
}

inline void GS_COMPATIBILITY GS_SetColumnOperators(CallBackPtr cbp, MCObjectHandle worksheet, CBSignedShort row, CBSignedShort sort1, CBSignedShort sort2, CBSignedShort sort3, CBSignedShort sum1,  CBSignedShort sum2,  CBSignedShort sum3)
{
	GS_SetWorksheetColumnOperators (cbp, worksheet, row, sort1, sort2, sort3, sum1, sum2, sum3);
}

inline void GS_COMPATIBILITY GS_GetColumnOperators(CallBackPtr cbp, MCObjectHandle worksheet, CBSignedShort row, short& sort1, short& sort2, short& sort3, short& sum1, short& sum2, short& sum3)
{
	GS_GetWorksheetColumnOperators (cbp, worksheet, row, sort1, sort2, sort3, sum1, sum2, sum3);
}

inline void GS_COMPATIBILITY GS_DeleteRows(CallBackPtr cbp, MCObjectHandle w, CBSignedShort startRow, CBSignedShort numRows)
{
	GS_DeleteWorksheetRows (cbp, w, startRow, numRows);
}

inline void GS_COMPATIBILITY GS_AddRows(CallBackPtr cbp, MCObjectHandle w, CBSignedShort beforeRow, CBSignedShort numRows)
{
	GS_InsertWorksheetRows (cbp, w, beforeRow, numRows);
}

inline void GS_COMPATIBILITY GS_DeleteColumns(CallBackPtr cbp, MCObjectHandle w, CBSignedShort startColumn, CBSignedShort numColumns)
{
	GS_DeleteWorksheetColumns (cbp, w, startColumn, numColumns);
}

inline void GS_COMPATIBILITY GS_AddColumns(CallBackPtr cbp, MCObjectHandle w, CBSignedShort beforeColumn, CBSignedShort numColumns)
{
	GS_InsertWorksheetColumns (cbp, w, beforeColumn, numColumns);
}

inline CBBoolean GS_COMPATIBILITY GS_GetCellValueN(CallBackPtr cbp, MCObjectHandle worksheet, ViewPt c, double_gs& cellValue)
{
	GS_GetWorksheetCellValue (cbp, worksheet, c, cellValue);
	return GS_IsWorksheetCellNumber (cbp, worksheet, c);
}


inline CBBoolean GS_COMPATIBILITY GS_GetCellString(CallBackPtr cbp, MCObjectHandle worksheet, ViewPt c, Str255 cellStr)
{
	GS_GetWorksheetCellString (cbp, worksheet, c, cellStr);
	return GS_IsWorksheetCellString (cbp, worksheet, c);
}

inline MCObjectHandle GS_COMPATIBILITY GS_GetActiveWorksheet(CallBackPtr cbp)
{
	return GS_GetTopVisibleWorksheet (cbp);
}

#endif // GS_SDK_VW8_COMPATIBLE
//////////////////////////////////////////////////////////////////////////////////////////

#if 0 // XXX:GITASK - uncomment this after merge.
//////////////////////////////////////////////////////////////////////////////////////////
#if GS_SDK_VW9_COMPATIBLE
// Inlined obsolete version 9.* callbacks.

inline InternalIndex GS_COMPATIBILITY GS_GetFillPat (CallBackPtr cbp, MCObjectHandle objectHandle)
{
	FillValType			fillStyle;
	EAttributeFillType	fillType;

	fillStyle = GS_GetFillStyle (cbp, objectHandle);

	fillType = GS_GetFillType (cbp, objectHandle);

	if (fillType == kFillGradient ||
		fillType == kFillImage) {

		fillStyle = 0; // None fill style.
	}

	return fillStyle;
}

inline InternalIndex GS_COMPATIBILITY GS_GetClFillPat (CallBackPtr cbp, InternalIndex classIndex)
{
	FillValType			fillStyle;
	EAttributeFillType	fillType;

	fillStyle = GS_GetClassFillStyle (cbp, objectHandle);

	fillType = GS_GetClassFillType (cbp, objectHandle);

	if (fillType == kFillGradient ||
		fillType == kFillImage) {

		fillStyle = 0; // None fill style.
	}

	return fillStyle;
}

#endif // GS_SDK_VW9_COMPATIBLE
//////////////////////////////////////////////////////////////////////////////////////////
#endif


/////////////////////////////////////////////////////////////////////
//	VW 12 APIs using Color Table indices of type BYTE produce link errors and must be changed to use 
//	new ColorRef type.
void GS_ColorIndexToRGB(CallBackPtr cbp, Byte colorIndex, RGBColor& rgb);
MCObjectHandle GS_CreateHatch(CallBackPtr cbp, const InternalName inName, CBBoolean inUsePageUnits, CBBoolean inRotateInWalls, CBBoolean inRotateInSymbols, CBBoolean inTransparent, Byte inFillColorIndex);
CBBoolean GS_GetHatchLevel(CallBackPtr cbp, MCObjectHandle inHatchDef, CBSignedShort inLevel, WorldPt& outStartPt, WorldPt& outRepeatVec, double& outDashFactor, WorldPt& outOffsetVec, Byte& outColorIndex, short& outMilsLineWeight);
void GS_RGBToColorIndex(CallBackPtr cbp, const RGBColor& rgb, Byte& colorIndex);
CBBoolean GS_SetHatchLevel(CallBackPtr cbp, MCObjectHandle inHatchDef, CBSignedShort inLevel, const WorldPt& inStartPt, const WorldPt& inRepeatVec, CBDouble_param inDashFactor, const WorldPt& inOffsetVec, Byte inColorIndex, CBSignedShort inMilsLineWeight);
void GS_GetTextColor(CallBackPtr cbp, MCObjectHandle textBlock, long charNum, Byte& charColor);
void GS_SetTextColor(CallBackPtr cbp, MCObjectHandle textBlock, long firstChar, long numChars, Byte charColor);
void GS_GetWorksheetCellFill(CallBackPtr cbp, MCObjectHandle worksheet, const ViewPt& cell, short& style, Byte& bgcolor, Byte& fgcolor, short& fillpattern);
void GS_GetWorksheetCellTextColor(CallBackPtr cbp, MCObjectHandle worksheet, const ViewPt& cell, Byte& color);
void GS_SetWorksheetCellFill(CallBackPtr cbp, MCObjectHandle worksheet, const ViewPt& topLeftCell, const ViewPt& bottomRightCell, CBSignedShort style, Byte bgcolor, Byte fgcolor, CBSignedShort fillpattern);
void GS_SetWorksheetCellTextColor(CallBackPtr cbp, MCObjectHandle worksheet, const ViewPt& topLeftCell, const ViewPt& bottomRightCell, Byte color);
void GS_SetWSCellBottomBorder(CallBackPtr cbp, MCObjectHandle worksheet, const ViewPt& topLeftCell, const ViewPt& bottomRightCell, CBSignedByte style, CBUnsignedByte weight, Byte color);
void GS_SetWSCellInsideHorizBorder(CallBackPtr cbp, MCObjectHandle worksheet, const ViewPt& topLeftCell, const ViewPt& bottomRightCell, CBSignedByte style, CBUnsignedByte weight, Byte color);
void GS_SetWSCellInsideVertBorder(CallBackPtr cbp, MCObjectHandle worksheet, const ViewPt& topLeftCell, const ViewPt& bottomRightCell, CBSignedByte style, CBUnsignedByte weight, Byte color);
void GS_SetWSCellInsideVertBorder(CallBackPtr cbp, MCObjectHandle worksheet, const ViewPt& topLeftCell, const ViewPt& bottomRightCell, CBSignedByte style, CBUnsignedByte weight, Byte color);
void GS_SetWSCellOutlineBorder(CallBackPtr cbp, MCObjectHandle worksheet, const ViewPt& topLeftCell, const ViewPt& bottomRightCell, CBSignedByte style, CBUnsignedByte weight, Byte color);
void GS_SetWSCellRightBorder(CallBackPtr cbp, MCObjectHandle worksheet, const ViewPt& topLeftCell, const ViewPt& bottomRightCell, CBSignedByte style, CBUnsignedByte weight, Byte color);
void GS_SetWSCellTopBorder(CallBackPtr cbp, MCObjectHandle worksheet, const ViewPt& topLeftCell, const ViewPt& bottomRightCell, CBSignedByte style, CBUnsignedByte weight, Byte color);





//----------------------------------
//----------------------------------
//	Hot Spot API:
//
typedef short HotSpotType;

const HotSpotType kScreenPlanarSelBox = 0; 	// A 2D location with selection box like the VectorWorks selection handles 
const HotSpotType kModel3DSelBox = 1;		// A 3D location with selection box like the VectorWorks selection handles
const HotSpotType kUnderConstruction = 2;	// internal use




//---------------------------------------------------------------
//---------------------------------------------------------------
struct CustomBarLockValueData
//
//	CustomBarEventData::fCustomBarEventSelector == kCustomBarLockValue contains a pointer to
//	this structure.
{
	short 	fFieldIndex;
	Str20	fUserLockString;
};


////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
//
//
//		BEGIN NNA DECLARATION SPACE:
//	
//	Declarations below should be considered as internal NNA and subject to change. 


// See Kludge 3652, 3653 for documentation on this structure.
struct KSS
{
	GSStr255	str1;
	GSStr255	str2;
	GSStr255	str3;
};


///////////////////////////////////////////////////////////////////////////////
// 	NNA plugins are registered to be reset for file tranlation using the code below.
//	The code below is called from the NNA plug-in Library VS_SharedLibrary from its
//	kPluginLIBInitGlobals action/event:
//	
//
//		case kPluginLIBInitGlobals: {
//			
//			//	Here is where we specify the IP plugins for reset at file translate time
//			RegisterPluginForFileTranslationReset();
//			break;
//		}
//	Third Party Developers can use the GS_Kludge(gCBP, 3654 	
//	to specify their plugins for reset at file translation.
//	
//	The call to GS_Kludge(gCBP, 3654 ...) can go in the object's kParametricInitGlobals
//	action handler or in some plugin library as is the case with VS_SharedLibrary 
//
	
/*
static void AddResetSpec(const TXString inUniversalObjectName, short inFileVersion)
//
//	Called from RegisterPluginForFileTranslationReset below
{
	//	See MiniCadCallBacks.h below
	KludgeObjectResetAfterTranslate callParams;
	
	inUniversalObjectName.CopyInto(callParams.objectNameUniversal);
	callParams.oldVersionNum = inFileVersion;
	
	(void) GS_Kludge(gCBP, 3654, &callParams, nil);
}

//--------------------------------------------------------------------------------------------
void RegisterPluginForFileTranslationReset()
//	
//	This code is called from VS_SharedLibrary's kPluginLIBInitGlobals event.
//	Here is how NNA plugins are registered for Reset on file translation.
//	
{
	#define kVectorWorks11FileVersion	122
	#define kVectorWorks10FileVersion	111
	#define kMiniCad9FileVersion		101

	AddResetSpec("Callout", 			kMiniCad9FileVersion);
	AddResetSpec("Base Cabinet", 		kVectorWorks11FileVersion);
	AddResetSpec("Door", 				kVectorWorks11FileVersion);
	AddResetSpec("Drawing Label", 		kVectorWorks11FileVersion);
	AddResetSpec("Feature Control Frame",kVectorWorks11FileVersion);
	AddResetSpec("Focus Point Object", 	kVectorWorks11FileVersion);
	AddResetSpec("Lighting Device", 	kVectorWorks11FileVersion);
	AddResetSpec("PhotoGrid", 			kVectorWorks11FileVersion);
	AddResetSpec("Photometer", 			kVectorWorks11FileVersion);
	AddResetSpec("Utility Cabinet", 	kVectorWorks11FileVersion);
	AddResetSpec("Wall Cabinet", 		kVectorWorks11FileVersion);
	AddResetSpec("Window", 				kVectorWorks11FileVersion);
	AddResetSpec("Property Line", 		kVectorWorks11FileVersion);
	
	#undef kVectorWorks11FileVersion
	#undef kVectorWorks10FileVersion
	#undef kMiniCad9FileVersion	
}
*/

struct KludgeObjectResetAfterTranslate
{
	Str63	objectNameUniversal;
	short	oldVersionNum;
};



////////////////////////////////////////////////////////////////////////////////////////
//
//	
//	APP_API is provided to encourage the development of VectorWorks SDK APIs.  
//
//	Internal developers can use APP_API_## to declare APIs without the need to commit to 
//	an officail/published SDK API.  I


//	Use APP_API_FUNCTION for APIs with a return value
#define APP_API_FUNCTION(returnType,_GS_declare_, _CB_declare_, _CB_call_) \
														\
	extern "C" { returnType _CB_declare_; }\
	inline returnType _GS_declare_ { return _CB_call_; }

//	Use APP_API_PROCEDURE for void APIs
#define APP_API_PROCEDURE(GS_declare_, CB_declare_, CB_call_) \
														\
	extern "C" { void CB_declare_; }\
	inline void GS_declare_ { CB_call_; }
//
////////////////////////////////////////////////////////////////////////////////////////

//
//	SDK APIs waiting to be published for external use.

//	The FreehandInteractive APIs below are used to produce the interactive behavior of the lasso
//	selection of the cursor tools.  It is also used by the multiple reshape tool and Revision cloud
//	tool.

#if NEARING_FINAL_RELEASE
	#if SteveJ
		// Should these be published ???
	#endif
#endif


APP_API_FUNCTION(MCObjectHandle,
		GS_CreateSectionLineInstance(CallBackPtr, MCObjectHandle inSectionView),
	 	CB_CreateSectionLineInstance(MCObjectHandle inSectionView), 
	 	CB_CreateSectionLineInstance(inSectionView))	
	//	Call CreateSectionLineInstance to create a the section line instance.  The instance is NOT inserted into the drawing

// FREEHAND INTERACTIVE
APP_API_PROCEDURE( 
		GS_BeginFreehandInteractive(CallBackPtr),
	 	CB_BeginFreehandInteractive(), 
	 	CB_BeginFreehandInteractive())	
	//	Call BeginFreehandInteractive to switch the current tool state to follow freehand interactive behaviors
	//	This global state forced the tool to observe two point tool status while accumulating the mouse motion in
	//	a kPolyGon object returned by GS_EndFreehandInteractive.

APP_API_PROCEDURE( 
		GS_CancelFreehandInteractive(CallBackPtr),
	 	CB_CancelFreehandInteractive(), 
	 	CB_CancelFreehandInteractive())
	 //	Tool must call GS_CancelFreehandInteractive to return the tool system back to its normal state.

APP_API_PROCEDURE( 
		GS_UpdateFreehandInteractive(CallBackPtr),
	 	CB_UpdateFreehandInteractive(), 
	 	CB_UpdateFreehandInteractive())
	//	Call from kToolMouseMove handler to update FreehandInteractive state

APP_API_PROCEDURE( 
		GS_SetFreehandInteractivePenStyle(CallBackPtr, short inStyle),
	 	CB_SetFreehandInteractivePenStyle(short inStyle), 
	 	CB_SetFreehandInteractivePenStyle(inStyle))
	
APP_API_PROCEDURE( 
		GS_SetFreehandInteractivePen(CallBackPtr, short inStyle, short inPenSize, GSColor foreColor, GSColor backColor),
	 	CB_SetFreehandInteractivePen(short inStyle, short inPenSize, GSColor foreColor, GSColor backColor), 
	 	CB_SetFreehandInteractivePen(inStyle, inPenSize, foreColor, backColor))
	
APP_API_PROCEDURE( 
		GS_DrawFreehandInteractive(CallBackPtr),
	 	CB_DrawFreehandInteractive(), 
	 	CB_DrawFreehandInteractive())
	//	Call from kToolDraw handler to draw FreehandInteractive sample polygon.  

APP_API_FUNCTION(MCObjectHandle,
		GS_GetFreehandInteractivePoly(CallBackPtr),
	 	CB_GetFreehandInteractivePoly(), 
	 	CB_GetFreehandInteractivePoly())

APP_API_FUNCTION(MCObjectHandle,
		GS_EndFreehandInteractive(CallBackPtr),
	 	CB_EndFreehandInteractive(), 

	 	CB_EndFreehandInteractive())
	//	Call GS_EndFreehandInteractive from the tool's kToolHandleComplete handler.  The MCObjectHandle will
	//	contain a polygon holding the points sampled as the user moved the mouse.



//	---------------------------------------------------------------------------------------
//	---------------------------------------------------------------------------------------
//long DisplayImagePopup (TDisplayImageListInfo& imageInfo, int top, int left, int bottom, int right);
APP_API_FUNCTION(long, 
		GS_DisplayImagePopup(CallBackPtr, TDisplayImageListInfo& imageInfo, int top, int left, int bottom, int right),
	 	CB_DisplayImagePopup(TDisplayImageListInfo& imageInfo, int top, int left, int bottom, int right), 
	 	CB_DisplayImagePopup(imageInfo, top, left, bottom, right))

//	---------------------------------------------------------------------------------------
//	---------------------------------------------------------------------------------------

#endif
