1 /*  NAME:
2         E3Globals.h
3 
4     DESCRIPTION:
5         Header file for E3Globals.c.
6 
7     COPYRIGHT:
8         Copyright (c) 1999-2004, Quesa Developers. All rights reserved.
9 
10         For the current release of Quesa, please see:
11 
12             <http://www.quesa.org/>
13 
14         Redistribution and use in source and binary forms, with or without
15         modification, are permitted provided that the following conditions
16         are met:
17 
18             o Redistributions of source code must retain the above copyright
19               notice, this list of conditions and the following disclaimer.
20 
21             o Redistributions in binary form must reproduce the above
22               copyright notice, this list of conditions and the following
23               disclaimer in the documentation and/or other materials provided
24               with the distribution.
25 
26             o Neither the name of Quesa nor the names of its contributors
27               may be used to endorse or promote products derived from this
28               software without specific prior written permission.
29 
30         THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31         "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32         LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
33         A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
34         OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35         SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
36         TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
37         PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
38         LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
39         NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
40         SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41     ___________________________________________________________________________
42 */
43 #ifndef E3GLOBALS_HDR
44 #define E3GLOBALS_HDR
45 //=============================================================================
46 //		Include files
47 //-----------------------------------------------------------------------------
48 #include "E3ClassTree.h"
49 #include "E3HashTable.h"
50 
51 
52 
53 
54 
55 //=============================================================================
56 //		C++ preamble
57 //-----------------------------------------------------------------------------
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
62 
63 
64 
65 
66 //=============================================================================
67 //      Constants
68 //-----------------------------------------------------------------------------
69 // Class names
70 //
71 // Note - classes which exist in QD3D should have the same class name in Quesa,
72 // as determined by the ObjHierarchy application.
73 //
74 // Classes which do not exist in QD3D should take the "Quesa:type:name" format,
75 // to ensure they do not clash with any existing types (all class names in the
76 // class tree must be unique).
77 //
78 // The QD3D convention for third party class names is "Company:Type:Name".
79 #define kQ3ClassNameAttribute						"Attribute"
80 #define kQ3ClassNameAttributeAmbientCoefficient		"AmbientCoefficient"
81 #define kQ3ClassNameAttributeCSGID					"InteractiveCSGId"
82 #define kQ3ClassNameAttributeDiffuseColor			"DiffuseColor"
83 #define kQ3ClassNameAttributeHighlightState			"HighlightState"
84 #define kQ3ClassNameAttributeNormal					"Normal"
85 #define kQ3ClassNameAttributeShadingUV				"ShadingUV"
86 #define kQ3ClassNameAttributeSpecularColor			"SpecularColor"
87 #define kQ3ClassNameAttributeSpecularControl		"SpecularControl"
88 #define kQ3ClassNameAttributeSurfaceShader			"SurfaceShaderAttribute"
89 #define kQ3ClassNameAttributeSurfaceTangent			"SurfaceTangent"
90 #define kQ3ClassNameAttributeSurfaceUV				"SurfaceUV"
91 #define kQ3ClassNameAttributeTransparencyColor		"TransparencyColor"
92 #define kQ3ClassNameCamera							"Camera"
93 #define kQ3ClassNameCameraOrthographic				"OrthographicCamera"
94 #define kQ3ClassNameCameraViewAngle					"ViewAngleCamera"
95 #define kQ3ClassNameCameraViewPlane					"ViewPlaneCamera"
96 #define kQ3ClassNameCustomElementName				"Apple Computer, Inc.:NameElement"
97 #define kQ3ClassNameCustomElementUrl				"Apple Computer, Inc.:URLElement"
98 #define kQ3ClassNameCustomElementWire				"Apple Computer, Inc.:WireElement"
99 #define kQ3ClassNameCustomElementProperties			"Quesa:PropertyElement"
100 #define kQ3ClassNameDrawContext						"DrawContext"
101 #define kQ3ClassNameDrawContextDDSurface			"DDSurfaceDrawContext"
102 #define kQ3ClassNameDrawContextMac					"MacDrawContext"
103 #define kQ3ClassNameDrawContextCocoa				"CocoaDrawContext"
104 #define kQ3ClassNameDrawContextPixmap				"PixmapDrawContext"
105 #define kQ3ClassNameDrawContextWin32DC				"Win32DCDrawContext"
106 #define kQ3ClassNameDrawContextX11					"X11DrawContext"
107 #define kQ3ClassNameElement							"Element"
108 #define kQ3ClassNameSetElement						"SetElement"
109 #define kQ3ClassNameStorageFSSpec					"MacintoshFSSpec"
110 #define kQ3ClassNameFile							"File"
111 #define kQ3ClassNameFileFormat						"Quesa:FileFormat"
112 #define kQ3ClassNameFileFormatReader				"Quesa:FileFormat:Reader"
113 #define kQ3ClassNameFileFormatR_3DMF_Bin			"Quesa:FileFormat:Reader:3DMF Binary"
114 #define kQ3ClassNameFileFormatR_3DMF_BinSwap		"Quesa:FileFormat:Reader:3DMF Binary Swapped"
115 #define kQ3ClassNameFileFormatR_3DMF_Text			"Quesa:FileFormat:Reader:3DMF Text"
116 #define kQ3ClassNameFileFormatWriter				"Quesa:FileFormat:Writer"
117 #define kQ3ClassNameFileFormatW_3DMF_S_Bin			"Quesa:FileFormat:Writer:3DMF Stream Binary"
118 #define kQ3ClassNameFileFormatW_3DMF_N_Bin			"Quesa:FileFormat:Writer:3DMF Normal Binary"
119 #define kQ3ClassNameFileFormatW_3DMF_D_Bin			"Quesa:FileFormat:Writer:3DMF Database Binary"
120 #define kQ3ClassNameFileFormatW_3DMF_DS_Bin			"Quesa:FileFormat:Writer:3DMF Database Stream Binary"
121 #define kQ3ClassNameFileFormatW_3DMF_SW_Bin			"Quesa:FileFormat:Writer:3DMF Stream Binary Swapped"
122 #define kQ3ClassNameFileFormatW_3DMF_NW_Bin			"Quesa:FileFormat:Writer:3DMF Normal Binary Swapped"
123 #define kQ3ClassNameFileFormatW_3DMF_DW_Bin			"Quesa:FileFormat:Writer:3DMF Database Binary Swapped"
124 #define kQ3ClassNameFileFormatW_3DMF_DSW_Bin		"Quesa:FileFormat:Writer:3DMF Database Stream Binary Swapped"
125 #define kQ3ClassNameGeometry						"Geometry"
126 #define kQ3ClassNameGeometryBox						"Box"
127 #define kQ3ClassNameGeometryBundle					"GeometryBundle"
128 #define kQ3ClassNameGeometryCone					"Cone"
129 #define kQ3ClassNameGeometryCylinder				"Cylinder"
130 #define kQ3ClassNameGeometryDisk					"Disk"
131 #define kQ3ClassNameGeometryEllipse					"Ellipse"
132 #define kQ3ClassNameGeometryEllipsoid				"Ellipsoid"
133 #define kQ3ClassNameGeometryGeneralPolygon			"GeneralPolygon"
134 #define kQ3ClassNameGeometryLine					"Line"
135 #define kQ3ClassNameGeometryMarker					"Marker"
136 #define kQ3ClassNameGeometryMesh					"Mesh"
137 #define kQ3ClassNameGeometryNURBCurve				"NURBCurve"
138 #define kQ3ClassNameGeometryNURBPatch				"NURBPatch"
139 #define kQ3ClassNameGeometryPixmapMarker			"PixmapMarker"
140 #define kQ3ClassNameGeometryPoint					"Point"
141 #define kQ3ClassNameGeometryPolyLine				"PolyLine"
142 #define kQ3ClassNameGeometryPolygon					"Polygon"
143 #define kQ3ClassNameGeometryPolyhedron				"Polyhedron"
144 #define kQ3ClassNameGeometryTorus					"Torus"
145 #define kQ3ClassNameGeometryTriGrid					"TriGrid"
146 #define kQ3ClassNameGeometryTriMesh					"TriMesh"
147 #define kQ3ClassNameGeometryTriangle				"Triangle"
148 #define kQ3ClassNameGroup							"Group"
149 #define kQ3ClassNameGroupDisplay					"DisplayGroup"
150 #define kQ3ClassNameGroupDisplayIOProxy				"IOProxyDisplayGroup"
151 #define kQ3ClassNameGroupDisplayOrdered				"OrderedDisplayGroup"
152 #define kQ3ClassNameGroupInfo						"InfoGroup"
153 #define kQ3ClassNameGroupLight						"LightGroup"
154 #define kQ3ClassNameEndGroup						"EndGroup"
155 #define kQ3ClassNameStorageHandle					"Handle"
156 #define kQ3ClassNameIlluminationLambert				"LambertIllumination"
157 #define kQ3ClassNameIlluminationNULL				"NULLIllumination"
158 #define kQ3ClassNameIlluminationPhong				"PhongIllumination"
159 #define kQ3ClassNameLight							"Light"
160 #define kQ3ClassNameLightAmbient					"AmbientLight"
161 #define kQ3ClassNameLightDirectional				"DirectionalLight"
162 #define kQ3ClassNameLightPoint						"PointLight"
163 #define kQ3ClassNameLightSpot						"SpotLight"
164 #define kQ3ClassNameStorageMacintosh				"MacintoshStorage"
165 #define kQ3ClassNameStorageMemory					"Memory"
166 #define kQ3ClassNameMeshEdgePart					"MeshEdgePart"
167 #define kQ3ClassNameMeshFacePart					"MeshFacePart"
168 #define kQ3ClassNameMeshVertexPart					"MeshVertexPart"
169 #define kQ3ClassNameMeshShapePart					"MeshShapePart"
170 #define kQ3ClassNameMeshCorners						"MeshCorners"
171 #define kQ3ClassNameMeshEdges						"MeshEdges"
172 #define kQ3ClassNamePick							"Pick"
173 #define kQ3ClassNamePickWindowPoint					"WindowPointPick"
174 #define kQ3ClassNamePickWindowRect					"WindowRectPick"
175 #define kQ3ClassNamePickWorldRay					"WorldRayPick"
176 #define kQ3ClassNameRenderer						"Renderer"
177 #define kQ3ClassNameRendererGeneric					"GenericRenderer"
178 #define kQ3ClassNameRendererInteractive				"InteractiveRenderer"
179 #define kQ3ClassNameRendererWireframe				"WireFrame"
180 #define kQ3ClassNameRoot							"Quesa:Root"
181 #define kQ3ClassNameSet								"Set"
182 #define kQ3ClassNameSetAttribute					"AttributeSet"
183 #define kQ3ClassNameShader							"Shader"
184 #define kQ3ClassNameShaderIllumination				"IlluminationShader"
185 #define kQ3ClassNameShaderSurface					"SurfaceShader"
186 #define kQ3ClassNameShape							"Shape"
187 #define kQ3ClassNameShapePart						"ShapePart"
188 #define kQ3ClassNameShared							"SharedObject"
189 #define kQ3ClassNameSharedUnknown					"Unknown"
190 #define kQ3ClassNameStateOperator					"StateOperator"
191 #define kQ3ClassNameStateOperatorPop				"Pop"
192 #define kQ3ClassNameStateOperatorPush				"Push"
193 #define kQ3ClassNameStorage							"Storage"
194 #define kQ3ClassNameString							"String"
195 #define kQ3ClassNameStringTypeC						"CString"
196 #define kQ3ClassNameStyle							"Style"
197 #define kQ3ClassNameStyleAntiAlias					"AntiAliasStyle"
198 #define kQ3ClassNameStyleBackfacing					"BackfacingStyle"
199 #define kQ3ClassNameStyleFill						"FillStyle"
200 #define kQ3ClassNameStyleFog						"FogStyle"
201 #define kQ3ClassNameStyleHighlight					"HighlightStyle"
202 #define kQ3ClassNameStyleInterpolation				"InterpolationStyle"
203 #define kQ3ClassNameStyleOrientation				"OrientationStyle"
204 #define kQ3ClassNameStylePickID						"PickIDStyle"
205 #define kQ3ClassNameStylePickParts					"PickPartsStyle"
206 #define kQ3ClassNameStyleCastShadows				"CastShadowsStyle"
207 #define kQ3ClassNameStyleReceiveShadows				"ReceiveShadowsStyle"
208 #define kQ3ClassNameStyleSubdivision				"SubdivisionStyle"
209 #define kQ3ClassNameSurfaceTexture					"TextureShader"
210 #define kQ3ClassNameTexture							"Texture"
211 #define kQ3ClassNameTextureCompressed				"CompressedPixmapTexture"
212 #define kQ3ClassNameTextureMipmap					"MipmapTexture"
213 #define kQ3ClassNameTexturePixmap					"PixmapTexture"
214 #define kQ3ClassNameTransform						"Transform"
215 #define kQ3ClassNameTransformMatrix					"Matrix"
216 #define kQ3ClassNameTransformQuaternion				"Quaternion"
217 #define kQ3ClassNameTransformReset					"Reset"
218 #define kQ3ClassNameTransformRotate					"Rotate"
219 #define kQ3ClassNameTransformRotateAboutAxis		"RotateAboutAxis"
220 #define kQ3ClassNameTransformRotateAboutPoint		"RotateAboutPoint"
221 #define kQ3ClassNameTransformScale					"Scale"
222 #define kQ3ClassNameTransformTranslate				"Translate"
223 #define kQ3ClassNameTransformCamera					"Quesa:Transform:Camera"
224 #define kQ3ClassNameTransformCameraRasterize		"Quesa:Transform:Camera:Rasterize"
225 #define kQ3ClassNameStorageUnixPath					"UnixPath"
226 #define kQ3ClassNameStorageUnix						"UnixStorage"
227 #define kQ3ClassNameUnknown							"Unknown"
228 #define kQ3ClassNameUnknownBinary					"UnknownBinary"
229 #define kQ3ClassNameUnknownText						"UnknownText"
230 #define kQ3ClassNameView							"View"
231 #define kQ3ClassNameViewer							"Quesa:Viewer"
232 #define kQ3ClassNameSlab							"Quesa:Slab"
233 #define kQ3ClassNameStorageWin32					"Win32Storage"
234 #define kQ3ClassNameAttributeSetList				"AttributeSetList"
235 #define kQ3ClassNameAttributeArray					"AttributeArray"
236 #define kQ3ClassNameAttributeSetListGeometry		"GeometryAttributeSetList"
237 #define kQ3ClassNameAttributeSetListFace			"FaceAttributeSetList"
238 #define kQ3ClassNameAttributeSetListVertex			"VertexAttributeSetList"
239 #define kQ3ClassNameGeneralPolygonHint				"GeneralPolygonHint"
240 #define kQ3ClassNameDisplayGroupState				"DisplayGroupState"
241 #define kQ3ClassNameCaps							"Caps"
242 #define kQ3ClassNameTopCapAttributeSet				"TopCapAttributeSet"
243 #define kQ3ClassNameBottomCapAttributeSet			"BottomCapAttributeSet"
244 #define kQ3ClassNameFaceCapAttributeSet				"FaceCapAttributeSet"
245 #define kQ3ClassNameInteriorCapAttributeSet			"InteriorCapAttributeSet"
246 #define kQ3ClassNameShaderUVTransform				"ShaderUVTransform"
247 #define kQ3ClassNameStoragePath						"Quesa:Storage:Path"
248 #define kQ3ClassNameStorageBe						"Quesa:Storage:Be"
249 #define kQ3ClassNameDrawContextBe					"Quesa:DrawContext:Be"
250 #define kQ3ClassName3DMF							"Metafile"
251 #define kQ3ClassNameTOC								"TableOfContents"
252 #define kQ3ClassNameReference						"Reference"
253 #define kQ3ClassNameType							"Type"
254 #define kQ3ClassNameViewHint						"ViewHint"
255 #define kQ3ClassNameCameraPlacment					"CameraPlacement"
256 #define kQ3ClassNameCameraRange						"CameraRange"
257 #define kQ3ClassNameCameraViewPort					"CameraViewPort"
258 #define kQ3ClassNameLightData						"LightData"
259 #define kQ3ClassNameImageClearColour				"ImageClearColor"
260 #define kQ3ClassNameImageDimensions					"ImageDimensions"
261 
262 
263 // Class types
264 #define kQ3ObjectTypeQuesa							Q3_OBJECT_TYPE(0xDE, 0xAD, 0xD0, 0xD0)
265 #define kQ3ObjectTypeRoot							Q3_OBJECT_TYPE('Q', 'r', 'o', 'o')
266 #define kQ3ObjectTypeQuesaInteractive				Q3_OBJECT_TYPE('Q', 'r', 'n', 'i')
267 #define kQ3ObjectTypeAttributeSurfaceUV				Q3_OBJECT_TYPE('s', 'r', 'u', 'v')
268 #define kQ3ObjectTypeAttributeShadingUV				Q3_OBJECT_TYPE('s', 'h', 'u', 'v')
269 #define kQ3ObjectTypeAttributeNormal				Q3_OBJECT_TYPE('n', 'r', 'm', 'l')
270 #define kQ3ObjectTypeAttributeAmbientCoefficient	Q3_OBJECT_TYPE('c', 'a', 'm', 'b')
271 #define kQ3ObjectTypeAttributeDiffuseColor			Q3_OBJECT_TYPE('k', 'd', 'i', 'f')
272 #define kQ3ObjectTypeAttributeSpecularColor			Q3_OBJECT_TYPE('k', 's', 'p', 'c')
273 #define kQ3ObjectTypeAttributeSpecularControl		Q3_OBJECT_TYPE('c', 's', 'p', 'c')
274 #define kQ3ObjectTypeAttributeTransparencyColor		Q3_OBJECT_TYPE('k', 'x', 'p', 'r')
275 #define kQ3ObjectTypeAttributeSurfaceTangent		Q3_OBJECT_TYPE('s', 'r', 't', 'n')
276 #define kQ3ObjectTypeAttributeHighlightState		Q3_OBJECT_TYPE('h', 'l', 's', 't')
277 #define kQ3ObjectTypeAttributeSurfaceShader			Q3_OBJECT_TYPE('s', 's', 'a', 't')
278 #define kQ3ObjectTypeCustomElementName				Q3_OBJECT_TYPE(0xF0, 'e', 'n', 'a')
279 #define kQ3ObjectTypeCustomElementUrl				Q3_OBJECT_TYPE(0xF0, 'e', 'u', 'r')
280 #define kQ3ObjectTypeCustomElementWire				Q3_OBJECT_TYPE(0xF0, 'e', 'w', 'i')
281 #define kQ3ObjectTypeCustomElementProperties		Q3_OBJECT_TYPE(0xF0, 'e', 'p', 'r')
282 #define kQ3ObjectTypeSetElement						Q3_OBJECT_TYPE('s', 'e', 't', 'e')
283 #define kQ3ObjectType3DMF							Q3_OBJECT_TYPE('3', 'D', 'M', 'F')
284 
285 
286 // Class methods
287 #define kQ3XMethodTypeObjectDispose					Q3_METHOD_TYPE('Q', 'd', 's', 'p')
288 #define kQ3XMethodTypeObjectSubmitRender			Q3_METHOD_TYPE('Q', 's', 'u', 'r')
289 #define kQ3XMethodTypeObjectSubmitPick				Q3_METHOD_TYPE('Q', 's', 'u', 'p')
290 #define kQ3XMethodTypeObjectSubmitWrite				Q3_METHOD_TYPE('Q', 's', 'u', 'w')
291 #define kQ3XMethodTypeObjectSubmitBounds			Q3_METHOD_TYPE('Q', 's', 'u', 'b')
292 #define kQ3XMethodTypeDrawContextUpdate				Q3_METHOD_TYPE('Q', 'u', 'p', 'd')
293 #define kQ3XMethodTypeDrawContextGetDimensions		Q3_METHOD_TYPE('Q', 'g', 'd', 'i')
294 #define kQ3XMethodTypeTransformMatrix				Q3_METHOD_TYPE('Q', 't', 'm', 'x')
295 #define kQ3XMethodTypeCameraFrustumMatrix			Q3_METHOD_TYPE('Q', 'c', 'm', 'x')
296 #define kQ3XMethodTypeRendererMethodsCached			Q3_METHOD_TYPE('Q', 'r', 'm', 'c')
297 #define kQ3XMethodTypeTextureDimensions				Q3_METHOD_TYPE('Q', 't', 'd', 'm')
298 #define kQ3XMethodTypeGeomGetAttribute				Q3_METHOD_TYPE('Q', 'g', 'g', 'a')
299 #define kQ3XMethodTypeGeomGetPublicData				Q3_METHOD_TYPE('Q', 'g', 'p', 'u')
300 #define kQ3XMethodTypeGeomUsesSubdivision			Q3_METHOD_TYPE('Q', 'g', 'u', 's')
301 #define kQ3XMethodTypeGeomUsesOrientation			Q3_METHOD_TYPE('Q', 'g', 'u', 'o')
302 #define kQ3XMethodTypeGeomCacheNew					Q3_METHOD_TYPE('Q', 'g', 'c', 'n')
303 #define kQ3XMethodTypeGeomCacheIsValid				Q3_METHOD_TYPE('Q', 'g', 'c', 'v')
304 #define kQ3XMethodTypeGeomCacheUpdate				Q3_METHOD_TYPE('Q', 'g', 'c', 'u')
305 #define kQ3XMethodTypeStorageReadData				Q3_METHOD_TYPE('Q', 'r', 'e', 'a')
306 #define kQ3XMethodTypeStorageWriteData				Q3_METHOD_TYPE('Q', 'w', 'r', 'i')
307 #define kQ3XMethodTypeStorageGetSize				Q3_METHOD_TYPE('Q', 'G', 's', 'z')
308 #define kQ3XMethodTypeStorageSetSize				Q3_METHOD_TYPE('Q', 'S', 's', 'z')
309 #define kQ3XMethodTypeStorageOpen					Q3_METHOD_TYPE('Q', 'O', 'p', 'n')
310 #define kQ3XMethodTypeStorageClose					Q3_METHOD_TYPE('Q', 'C', 'l', 's')
311 
312 
313 // 3DMF object types
314 #define kQ3AttributeSetTypeBottomCap				Q3_OBJECT_TYPE('b', 'c', 'a', 's')
315 #define kQ3AttributeSetTypeFaceCap					Q3_OBJECT_TYPE('f', 'c', 'a', 's')
316 #define kQ3AttributeSetTypeInteriorCap				Q3_OBJECT_TYPE('i', 'c', 'a', 's')
317 #define kQ3AttributeSetTypeTopCap					Q3_OBJECT_TYPE('t', 'c', 'a', 's')
318 #define kQ3CameraPlacment							Q3_OBJECT_TYPE('c', 'm', 'p', 'l')
319 #define kQ3CameraRange								Q3_OBJECT_TYPE('c', 'm', 'r', 'g')
320 #define kQ3CameraViewPort							Q3_OBJECT_TYPE('c', 'm', 'v', 'p')
321 #define kQ3ImageClearColour							Q3_OBJECT_TYPE('i', 'm', 'c', 'c')
322 #define kQ3ImageDimensions							Q3_OBJECT_TYPE('i', 'm', 'd', 'm')
323 #define kQ3LightData								Q3_OBJECT_TYPE('l', 'i', 'd', 'a')
324 #define kQ3ObjectTypeAttributeArray					Q3_OBJECT_TYPE('a', 't', 'a', 'r')
325 #define kQ3ObjectTypeAttributeSetList				Q3_OBJECT_TYPE('r', 'a', 's', 'l')
326 #define kQ3ObjectTypeAttributeSetListFace			Q3_OBJECT_TYPE('f', 'a', 's', 'l')
327 #define kQ3ObjectTypeAttributeSetListGeometry		Q3_OBJECT_TYPE('g', 'a', 's', 'l')
328 #define kQ3ObjectTypeAttributeSetListVertex			Q3_OBJECT_TYPE('v', 'a', 's', 'l')
329 #define kQ3ObjectTypeDisplayGroupState				Q3_OBJECT_TYPE('d', 'g', 's', 't')
330 #define kQ3ObjectTypeGeneralPolygonHint				Q3_OBJECT_TYPE('g', 'p', 'l', 'h')
331 #define kQ3ObjectTypeGeometryCaps					Q3_OBJECT_TYPE('c', 'a', 'p', 's')
332 #define kQ3ObjectTypeMeshCorners					Q3_OBJECT_TYPE('c', 'r', 'n', 'r')
333 #define kQ3ObjectTypeMeshEdges						Q3_OBJECT_TYPE('e', 'd', 'g', 'e')
334 #define kQ3ObjectTypeShaderTransform				Q3_OBJECT_TYPE('s', 'd', 'x', 'f')
335 #define kQ3ObjectTypeShaderUVTransform				Q3_OBJECT_TYPE('s', 'd', 'u', 'v')
336 #define kQ3ObjectTypeTOC							Q3_OBJECT_TYPE('t', 'o', 'c', ' ')
337 #define kQ3ObjectTypeType							Q3_OBJECT_TYPE('t', 'y', 'p', 'e')
338 
339 
340 // Internal object types
341 #define kQ3ObjectTypeLeaf							Q3_OBJECT_TYPE('l', 'e', 'a', 'f')
342 
343 
344 
345 
346 
347 //=============================================================================
348 //      Types
349 //-----------------------------------------------------------------------------
350 // Object methods
351 typedef Q3_CALLBACK_API_C(void,   		TQ3XObjectDisposeMethod)(TQ3Object theObject);
352 typedef Q3_CALLBACK_API_C(TQ3Status,	TQ3XObjectSubmitMethod)(TQ3ViewObject		theView,
353 																TQ3ObjectType	objectType,
354 																TQ3Object		theObject,
355 																const void		*objectData);
356 
357 
358 // Misc methods
359 typedef Q3_CALLBACK_API_C(TQ3Status, 	TQ3XDrawContextUpdateMethod)(TQ3DrawContextObject theDrawContext);
360 typedef Q3_CALLBACK_API_C(void, 		TQ3XDrawContextGetDimensionsMethod)(TQ3DrawContextObject theDrawContext, TQ3Area *thePane);
361 typedef Q3_CALLBACK_API_C(void,      	TQ3XTransformMatrixMethod)(const void *transformData, TQ3Matrix4x4 *theMatrix);
362 typedef Q3_CALLBACK_API_C(void,		TQ3XCameraFrustumMatrixMethod)(TQ3CameraObject theCamera, TQ3Matrix4x4 *theMatrix);
363 typedef Q3_CALLBACK_API_C(void,		TQ3XTextureDimensionsMethod)(TQ3TextureObject theTexture, TQ3Point2D *theDimensions);
364 
365 
366 // Geometry methods
367 typedef Q3_CALLBACK_API_C(TQ3AttributeSet *,	TQ3XGeomGetAttributeMethod)(TQ3GeometryObject theObject);
368 typedef Q3_CALLBACK_API_C(const void *,			TQ3XGeomGetPublicDataMethod)(TQ3GeometryObject theObject);
369 typedef Q3_CALLBACK_API_C(TQ3Object,			TQ3XGeomCacheNewMethod)(TQ3ViewObject		theView,
370 																	TQ3GeometryObject	theGeom,
371 																	const void			*geomData);
372 typedef Q3_CALLBACK_API_C(TQ3Boolean,			TQ3XGeomCacheIsValidMethod)(TQ3ViewObject		theView,
373 																		TQ3ObjectType		objectType,
374 																		TQ3GeometryObject	theGeom,
375 																		const void			*geomData,
376 																		TQ3Object			cachedGeom);
377 typedef Q3_CALLBACK_API_C(void,				TQ3XGeomCacheUpdateMethod)(TQ3ViewObject		theView,
378 																		TQ3ObjectType		objectType,
379 																		TQ3GeometryObject	theGeom,
380 																		const void			*geomData,
381 																		TQ3Object			*cachedGeom);
382 
383 
384 // Storage methods
385 typedef Q3_CALLBACK_API_C(TQ3Status, TQ3XStorageReadDataMethod)(TQ3StorageObject storage,
386 																TQ3Uns32		offset,
387 																TQ3Uns32		dataSize,
388 																TQ3Uns8			*data,
389 																TQ3Uns32		*sizeRead);
390 typedef Q3_CALLBACK_API_C(TQ3Status, TQ3XStorageWriteDataMethod)(TQ3StorageObject storage,
391 																TQ3Uns32		offset,
392 																TQ3Uns32		dataSize,
393 																const TQ3Uns8	*data,
394 																TQ3Uns32		*sizeWritten);
395 typedef Q3_CALLBACK_API_C(TQ3Status, TQ3XStorageGetSizeMethod)(TQ3StorageObject storage, TQ3Uns32 *size);
396 typedef Q3_CALLBACK_API_C(TQ3Status, TQ3XStorageSetSizeMethod)(TQ3StorageObject storage, TQ3Uns32 size);
397 typedef Q3_CALLBACK_API_C(TQ3Status, TQ3XStorageOpenMethod)(TQ3StorageObject storage, TQ3Boolean forWriting);
398 typedef Q3_CALLBACK_API_C(TQ3Status, TQ3XStorageCloseMethod)(TQ3StorageObject storage);
399 
400 
401 // Definition of TQ3Object
402 #if !QUESA_OBJECTS_ARE_OPAQUE
403 
404 typedef struct OpaqueTQ3Object {
405 	TQ3ObjectType		quesaTag;
406 	E3ClassInfoPtr		theClass;
407 	void				*instanceData;
408 	TQ3Object			parentObject;
409 
410 #if Q3_DEBUG
411 	TQ3Object			childObject;
412 #endif
413 } OpaqueTQ3Object;
414 
415 #endif // !QUESA_OBJECTS_ARE_OPAQUE
416 
417 
418 // Global state for each instance of Quesa.
419 //
420 // With a few exceptions, data in this structure should be considered opaque
421 // to the internals of Quesa - there are internal APIs to get and set almost
422 // every field in this structure, which minimises the amount of code which
423 // depends on the content of the global state.
424 //
425 // Global state introduces penalties when running under a preemptively
426 // threaded environment (which Quesa probably will, at some stage). Please
427 // only use the global state as a last resort.
428 typedef struct E3Globals {
429 	// System
430 	TQ3Boolean				systemInitialised;
431 	TQ3Boolean				systemDoBottleneck;
432 	TQ3Uns32				systemRefCount;
433 
434 
435 	// Class tree
436 	E3HashTablePtr			classTree;
437 	E3ClassInfoPtr			classTreeRoot;
438 	TQ3ObjectType			classNextType;
439 	TQ3Uns32				classStats1;
440 	TQ3Uns32				classStats2;
441 	TQ3Uns32				classStats3;
442 	TQ3Uns32				classStats4;
443 	TQ3Uns32				classStats5;
444 
445 
446 	// Shared libraries
447 	TQ3Uns32				sharedLibraryCount;
448 	TQ3XSharedLibraryInfo	*sharedLibraryInfo;
449 
450 
451 	// Error Manager
452 	TQ3Boolean				errMgrClearError;
453 	TQ3Boolean				errMgrClearWarning;
454 	TQ3Boolean				errMgrClearNotice;
455 	TQ3Boolean				errMgrClearPlatform;
456 	TQ3Boolean				errMgrIsFatalError;
457 	TQ3Error				errMgrOldestError;
458 	TQ3Warning				errMgrOldestWarning;
459 	TQ3Notice				errMgrOldestNotice;
460 	TQ3Uns32				errMgrOldestPlatform;
461 	TQ3Error				errMgrLatestError;
462 	TQ3Warning				errMgrLatestWarning;
463 	TQ3Notice				errMgrLatestNotice;
464 	TQ3Uns32				errMgrLatestPlatform;
465 	TQ3ErrorMethod			errMgrHandlerFuncError;
466 	TQ3WarningMethod		errMgrHandlerFuncWarning;
467 	TQ3NoticeMethod			errMgrHandlerFuncNotice;
468 	TQ3ErrorMethod 			errMgrHandlerFuncPlatform;
469 	TQ3Uns32				errMgrHandlerDataError;
470 	TQ3Uns32				errMgrHandlerDataWarning;
471 	TQ3Uns32				errMgrHandlerDataNotice;
472 	TQ3Uns32		 		errMgrHandlerDataPlatform;
473 
474 
475 	// Platform specific (just Mac for now)
476 #if QUESA_OS_MACINTOSH
477 	DMNotificationUPP		dmNotifyUPP;
478 	TQ3Boolean				dmNotifiedChanges;
479 #endif
480 
481 
482 	// Debugging
483 #if Q3_DEBUG
484 	TQ3Object				listHead;
485 	TQ3Boolean				isLeakChecking;
486 #endif
487 
488 } E3Globals, *E3GlobalsPtr;
489 
490 
491 
492 
493 
494 //=============================================================================
495 //      Globals
496 //-----------------------------------------------------------------------------
497 // Global Quesa state
498 //
499 // Note, all code should access these globals through  E3Globals_Get accessor
500 // rather than accessing them directly. The one exception to this is in
501 // E3System.c, where the bottleneck reads them directly for performance.
502 extern E3Globals gE3Globals;
503 
504 
505 
506 
507 
508 //=============================================================================
509 //      Function prototypes
510 //-----------------------------------------------------------------------------
511 // Get access to the Quesa global state
512 E3GlobalsPtr	E3Globals_Get(void);
513 
514 
515 
516 
517 
518 //=============================================================================
519 //		C++ postamble
520 //-----------------------------------------------------------------------------
521 #ifdef __cplusplus
522 }
523 #endif
524 
525 #endif
526 
527