Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1523 lines
56 KiB

  1. /*
  2. File: QD3D.h
  3. Contains: Base types for Quickdraw 3D
  4. Version: Technology: Quickdraw 3D 1.6
  5. Release: QuickTime 7.3
  6. Copyright: (c) 2007 (c) 1995-1999 by Apple Computer, Inc., all rights reserved.
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://developer.apple.com/bugreporter/
  10. */
  11. #ifndef __QD3D__
  12. #define __QD3D__
  13. #ifndef __CONDITIONALMACROS__
  14. #include <ConditionalMacros.h>
  15. #endif
  16. #if TARGET_OS_MAC
  17. #ifndef __MACTYPES__
  18. #include <MacTypes.h>
  19. #endif
  20. #endif /* TARGET_OS_MAC */
  21. #include <stdio.h>
  22. #if PRAGMA_ONCE
  23. #pragma once
  24. #endif
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. #if PRAGMA_IMPORT
  29. #pragma import on
  30. #endif
  31. #if PRAGMA_STRUCT_ALIGN
  32. #pragma options align=power
  33. #elif PRAGMA_STRUCT_PACKPUSH
  34. #pragma pack(push, 2)
  35. #elif PRAGMA_STRUCT_PACK
  36. #pragma pack(2)
  37. #endif
  38. #if PRAGMA_ENUM_ALWAYSINT
  39. #if defined(__fourbyteints__) && !__fourbyteints__
  40. #define __QD3D__RESTORE_TWOBYTEINTS
  41. #pragma fourbyteints on
  42. #endif
  43. #pragma enumsalwaysint on
  44. #elif PRAGMA_ENUM_OPTIONS
  45. #pragma option enum=int
  46. #elif PRAGMA_ENUM_PACK
  47. #if __option(pack_enums)
  48. #define __QD3D__RESTORE_PACKED_ENUMS
  49. #pragma options(!pack_enums)
  50. #endif
  51. #endif
  52. #if TARGET_OS_MAC
  53. #define OS_MACINTOSH 1
  54. #define OS_WIN32 0
  55. #define OS_UNIX 0
  56. #define OS_NEXT 0
  57. #define WINDOW_SYSTEM_MACINTOSH 1
  58. #define WINDOW_SYSTEM_WIN32 0
  59. #define WINDOW_SYSTEM_X11 0
  60. #define WINDOW_SYSTEM_NEXT 0
  61. #endif /* TARGET_OS_MAC */
  62. #if TARGET_OS_WIN32
  63. #define OS_MACINTOSH 0
  64. #define OS_WIN32 1
  65. #define OS_UNIX 0
  66. #define OS_NEXT 0
  67. #define WINDOW_SYSTEM_MACINTOSH 0
  68. #define WINDOW_SYSTEM_WIN32 1
  69. #define WINDOW_SYSTEM_X11 0
  70. #define WINDOW_SYSTEM_NEXT 0
  71. #endif /* TARGET_OS_WIN32 */
  72. #if TARGET_OS_UNIX
  73. #define OS_MACINTOSH 0
  74. #define OS_WIN32 0
  75. #define WINDOW_SYSTEM_MACINTOSH 0
  76. #define WINDOW_SYSTEM_WIN32 0
  77. #if NeXT
  78. #define OS_UNIX 0
  79. #define OS_NEXT 1
  80. #define WINDOW_SYSTEM_X11 0
  81. #define WINDOW_SYSTEM_NEXT 1
  82. #else
  83. #define OS_UNIX 1
  84. #define OS_NEXT 0
  85. #define WINDOW_SYSTEM_X11 1
  86. #define WINDOW_SYSTEM_NEXT 0
  87. #endif /* NeXT */
  88. #endif /* TARGET_OS_UNIX */
  89. /******************************************************************************
  90. ** **
  91. ** Export Control **
  92. ** **
  93. *****************************************************************************/
  94. #if TARGET_OS_WIN32
  95. #if defined(WIN32_EXPORTING) /* define when building DLL */
  96. #define QD3D_EXPORT __declspec( dllexport )
  97. #define QD3D_CALL
  98. #define QD3D_CALLBACK
  99. #else
  100. #define QD3D_EXPORT __declspec( dllimport )
  101. #define QD3D_CALL __cdecl
  102. #define QD3D_CALLBACK __cdecl
  103. #endif /* WIN32_EXPORTING */
  104. #else
  105. #define QD3D_EXPORT
  106. #define QD3D_CALL
  107. #define QD3D_CALLBACK
  108. #endif /* TARGET_OS_WIN32 */
  109. /******************************************************************************
  110. ** **
  111. ** NULL definition **
  112. ** **
  113. *****************************************************************************/
  114. #ifndef NULL
  115. #error /* NULL is undefined? */
  116. #endif /* NULL */
  117. /******************************************************************************
  118. ** **
  119. ** Objects **
  120. ** **
  121. *****************************************************************************/
  122. /*
  123. * Everything in QuickDraw 3D is an OBJECT: a bunch of data with a type,
  124. * deletion, duplication, and i/o methods.
  125. */
  126. typedef long TQ3ObjectType;
  127. typedef struct OpaqueTQ3Object* TQ3Object;
  128. /* */
  129. /*
  130. * There are four subclasses of OBJECT:
  131. * an ELEMENT, which is data that is placed in a SET
  132. * a SHAREDOBJECT, which is reference-counted data that is shared
  133. * VIEWs, which maintain state information for an image
  134. * a PICK, which used to query a VIEW
  135. */
  136. typedef TQ3Object TQ3ElementObject;
  137. typedef TQ3Object TQ3SharedObject;
  138. typedef TQ3Object TQ3ViewObject;
  139. typedef TQ3Object TQ3PickObject;
  140. /*
  141. * There are several types of SharedObjects:
  142. * RENDERERs, which paint to a drawContext
  143. * DRAWCONTEXTs, which are an interface to a device
  144. * SETs, which maintains "mathematical sets" of ELEMENTs
  145. * FILEs, which maintain state information for a metafile
  146. * SHAPEs, which affect the state of the View
  147. * SHAPEPARTs, which contain geometry-specific data about a picking hit
  148. * CONTROLLERSTATEs, which hold state of the output channels for a CONTROLLER
  149. * TRACKERs, which represent a position and orientation in the user interface
  150. * STRINGs, which are abstractions of text string data.
  151. * STORAGE, which is an abstraction for stream-based data storage (files, memory)
  152. * TEXTUREs, for sharing bitmap information for TEXTURESHADERS
  153. * VIEWHINTs, which specifies viewing preferences in FILEs
  154. */
  155. typedef TQ3SharedObject TQ3RendererObject;
  156. typedef TQ3SharedObject TQ3DrawContextObject;
  157. typedef TQ3SharedObject TQ3SetObject;
  158. typedef TQ3SharedObject TQ3FileObject;
  159. typedef TQ3SharedObject TQ3ShapeObject;
  160. typedef TQ3SharedObject TQ3ShapePartObject;
  161. typedef TQ3SharedObject TQ3ControllerStateObject;
  162. typedef TQ3SharedObject TQ3TrackerObject;
  163. typedef TQ3SharedObject TQ3StringObject;
  164. typedef TQ3SharedObject TQ3StorageObject;
  165. typedef TQ3SharedObject TQ3TextureObject;
  166. typedef TQ3SharedObject TQ3ViewHintsObject;
  167. /*
  168. * There is one types of SET:
  169. * ATTRIBUTESETs, which contain ATTRIBUTEs which are inherited
  170. */
  171. typedef TQ3SetObject TQ3AttributeSet;
  172. /*
  173. * There are many types of SHAPEs:
  174. * LIGHTs, which affect how the RENDERER draws 3-D cues
  175. * CAMERAs, which affects the location and orientation of the RENDERER in space
  176. * GROUPs, which may contain any number of SHARED OBJECTS
  177. * GEOMETRYs, which are representations of three-dimensional data
  178. * SHADERs, which affect how colors are drawn on a geometry
  179. * STYLEs, which affect how the RENDERER paints to the DRAWCONTEXT
  180. * TRANSFORMs, which affect the coordinate system in the VIEW
  181. * REFERENCEs, which are references to objects in FILEs
  182. * UNKNOWN, which hold unknown objects read from a metafile.
  183. */
  184. typedef TQ3ShapeObject TQ3GroupObject;
  185. typedef TQ3ShapeObject TQ3GeometryObject;
  186. typedef TQ3ShapeObject TQ3ShaderObject;
  187. typedef TQ3ShapeObject TQ3StyleObject;
  188. typedef TQ3ShapeObject TQ3TransformObject;
  189. typedef TQ3ShapeObject TQ3LightObject;
  190. typedef TQ3ShapeObject TQ3CameraObject;
  191. typedef TQ3ShapeObject TQ3UnknownObject;
  192. typedef TQ3ShapeObject TQ3ReferenceObject;
  193. typedef TQ3ShapeObject TQ3StateOperatorObject;
  194. /*
  195. * For now, there is only one type of SHAPEPARTs:
  196. * MESHPARTs, which describe some part of a mesh
  197. */
  198. typedef TQ3ShapePartObject TQ3MeshPartObject;
  199. /*
  200. * There are three types of MESHPARTs:
  201. * MESHFACEPARTs, which describe a face of a mesh
  202. * MESHEDGEPARTs, which describe a edge of a mesh
  203. * MESHVERTEXPARTs, which describe a vertex of a mesh
  204. */
  205. typedef TQ3MeshPartObject TQ3MeshFacePartObject;
  206. typedef TQ3MeshPartObject TQ3MeshEdgePartObject;
  207. typedef TQ3MeshPartObject TQ3MeshVertexPartObject;
  208. /*
  209. * A DISPLAY Group can be drawn to a view
  210. */
  211. typedef TQ3GroupObject TQ3DisplayGroupObject;
  212. /*
  213. * There are many types of SHADERs:
  214. * SURFACESHADERs, which affect how the surface of a geometry is painted
  215. * ILLUMINATIONSHADERs, which affect how lights affect the color of a surface
  216. */
  217. typedef TQ3ShaderObject TQ3SurfaceShaderObject;
  218. typedef TQ3ShaderObject TQ3IlluminationShaderObject;
  219. /*
  220. * A handle to an object in a group
  221. */
  222. typedef struct OpaqueTQ3GroupPosition* TQ3GroupPosition;
  223. /*
  224. * TQ3ObjectClassNameString is used for the class name of an object
  225. */
  226. enum {
  227. kQ3StringMaximumLength = 1024
  228. };
  229. typedef char TQ3ObjectClassNameString[kQ3StringMaximumLength];
  230. /******************************************************************************
  231. ** **
  232. ** Client/Server Things **
  233. ** **
  234. *****************************************************************************/
  235. typedef void * TQ3ControllerRef;
  236. /******************************************************************************
  237. ** **
  238. ** Flags and Switches **
  239. ** **
  240. *****************************************************************************/
  241. enum TQ3Boolean {
  242. kQ3False = 0,
  243. kQ3True = 1
  244. };
  245. typedef enum TQ3Boolean TQ3Boolean;
  246. enum TQ3Switch {
  247. kQ3Off = 0,
  248. kQ3On = 1
  249. };
  250. typedef enum TQ3Switch TQ3Switch;
  251. enum TQ3Status {
  252. kQ3Failure = 0,
  253. kQ3Success = 1
  254. };
  255. typedef enum TQ3Status TQ3Status;
  256. enum TQ3Axis {
  257. kQ3AxisX = 0,
  258. kQ3AxisY = 1,
  259. kQ3AxisZ = 2
  260. };
  261. typedef enum TQ3Axis TQ3Axis;
  262. enum TQ3PixelType {
  263. kQ3PixelTypeRGB32 = 0, /* Alpha:8 (ignored), R:8, G:8, B:8 */
  264. kQ3PixelTypeARGB32 = 1, /* Alpha:8, R:8, G:8, B:8 */
  265. kQ3PixelTypeRGB16 = 2, /* Alpha:1 (ignored), R:5, G:5, B:5 */
  266. kQ3PixelTypeARGB16 = 3, /* Alpha:1, R:5, G:5, B:5 */
  267. kQ3PixelTypeRGB16_565 = 4, /* Win32 only: 16 bits/pixel, R:5, G:6, B:5 */
  268. kQ3PixelTypeRGB24 = 5 /* Win32 only: 24 bits/pixel, R:8, G:8, B:8 */
  269. };
  270. typedef enum TQ3PixelType TQ3PixelType;
  271. enum TQ3Endian {
  272. kQ3EndianBig = 0,
  273. kQ3EndianLittle = 1
  274. };
  275. typedef enum TQ3Endian TQ3Endian;
  276. enum TQ3EndCapMasks {
  277. kQ3EndCapNone = 0,
  278. kQ3EndCapMaskTop = 1 << 0,
  279. kQ3EndCapMaskBottom = 1 << 1,
  280. kQ3EndCapMaskInterior = 1 << 2
  281. };
  282. typedef enum TQ3EndCapMasks TQ3EndCapMasks;
  283. typedef unsigned long TQ3EndCap;
  284. enum {
  285. kQ3ArrayIndexNULL = ~0
  286. };
  287. /******************************************************************************
  288. ** **
  289. ** Point and Vector Definitions **
  290. ** **
  291. *****************************************************************************/
  292. struct TQ3Vector2D {
  293. float x;
  294. float y;
  295. };
  296. typedef struct TQ3Vector2D TQ3Vector2D;
  297. struct TQ3Vector3D {
  298. float x;
  299. float y;
  300. float z;
  301. };
  302. typedef struct TQ3Vector3D TQ3Vector3D;
  303. struct TQ3Point2D {
  304. float x;
  305. float y;
  306. };
  307. typedef struct TQ3Point2D TQ3Point2D;
  308. struct TQ3Point3D {
  309. float x;
  310. float y;
  311. float z;
  312. };
  313. typedef struct TQ3Point3D TQ3Point3D;
  314. struct TQ3RationalPoint4D {
  315. float x;
  316. float y;
  317. float z;
  318. float w;
  319. };
  320. typedef struct TQ3RationalPoint4D TQ3RationalPoint4D;
  321. struct TQ3RationalPoint3D {
  322. float x;
  323. float y;
  324. float w;
  325. };
  326. typedef struct TQ3RationalPoint3D TQ3RationalPoint3D;
  327. /******************************************************************************
  328. ** **
  329. ** Quaternion **
  330. ** **
  331. *****************************************************************************/
  332. struct TQ3Quaternion {
  333. float w;
  334. float x;
  335. float y;
  336. float z;
  337. };
  338. typedef struct TQ3Quaternion TQ3Quaternion;
  339. /******************************************************************************
  340. ** **
  341. ** Ray Definition **
  342. ** **
  343. *****************************************************************************/
  344. struct TQ3Ray3D {
  345. TQ3Point3D origin;
  346. TQ3Vector3D direction;
  347. };
  348. typedef struct TQ3Ray3D TQ3Ray3D;
  349. /******************************************************************************
  350. ** **
  351. ** Parameterization Data Structures **
  352. ** **
  353. *****************************************************************************/
  354. struct TQ3Param2D {
  355. float u;
  356. float v;
  357. };
  358. typedef struct TQ3Param2D TQ3Param2D;
  359. struct TQ3Param3D {
  360. float u;
  361. float v;
  362. float w;
  363. };
  364. typedef struct TQ3Param3D TQ3Param3D;
  365. struct TQ3Tangent2D {
  366. TQ3Vector3D uTangent;
  367. TQ3Vector3D vTangent;
  368. };
  369. typedef struct TQ3Tangent2D TQ3Tangent2D;
  370. struct TQ3Tangent3D {
  371. TQ3Vector3D uTangent;
  372. TQ3Vector3D vTangent;
  373. TQ3Vector3D wTangent;
  374. };
  375. typedef struct TQ3Tangent3D TQ3Tangent3D;
  376. /******************************************************************************
  377. ** **
  378. ** Polar and Spherical Coordinates **
  379. ** **
  380. *****************************************************************************/
  381. struct TQ3PolarPoint {
  382. float r;
  383. float theta;
  384. };
  385. typedef struct TQ3PolarPoint TQ3PolarPoint;
  386. struct TQ3SphericalPoint {
  387. float rho;
  388. float theta;
  389. float phi;
  390. };
  391. typedef struct TQ3SphericalPoint TQ3SphericalPoint;
  392. /******************************************************************************
  393. ** **
  394. ** Color Definition **
  395. ** **
  396. *****************************************************************************/
  397. struct TQ3ColorRGB {
  398. float r;
  399. float g;
  400. float b;
  401. };
  402. typedef struct TQ3ColorRGB TQ3ColorRGB;
  403. struct TQ3ColorARGB {
  404. float a;
  405. float r;
  406. float g;
  407. float b;
  408. };
  409. typedef struct TQ3ColorARGB TQ3ColorARGB;
  410. /******************************************************************************
  411. ** **
  412. ** Vertices **
  413. ** **
  414. *****************************************************************************/
  415. struct TQ3Vertex3D {
  416. TQ3Point3D point;
  417. TQ3AttributeSet attributeSet;
  418. };
  419. typedef struct TQ3Vertex3D TQ3Vertex3D;
  420. /******************************************************************************
  421. ** **
  422. ** Matrices **
  423. ** **
  424. *****************************************************************************/
  425. struct TQ3Matrix3x3 {
  426. float value[3][3];
  427. };
  428. typedef struct TQ3Matrix3x3 TQ3Matrix3x3;
  429. struct TQ3Matrix4x4 {
  430. float value[4][4];
  431. };
  432. typedef struct TQ3Matrix4x4 TQ3Matrix4x4;
  433. /******************************************************************************
  434. ** **
  435. ** Bitmap/Pixmap **
  436. ** **
  437. *****************************************************************************/
  438. struct TQ3Pixmap {
  439. void * image;
  440. unsigned long width;
  441. unsigned long height;
  442. unsigned long rowBytes;
  443. unsigned long pixelSize; /* MUST be 16 or 32 to use with the Interactive Renderer on Mac OS*/
  444. TQ3PixelType pixelType;
  445. TQ3Endian bitOrder;
  446. TQ3Endian byteOrder;
  447. };
  448. typedef struct TQ3Pixmap TQ3Pixmap;
  449. struct TQ3StoragePixmap {
  450. TQ3StorageObject image;
  451. unsigned long width;
  452. unsigned long height;
  453. unsigned long rowBytes;
  454. unsigned long pixelSize; /* MUST be 16 or 32 to use with the Interactive Renderer on Mac OS*/
  455. TQ3PixelType pixelType;
  456. TQ3Endian bitOrder;
  457. TQ3Endian byteOrder;
  458. };
  459. typedef struct TQ3StoragePixmap TQ3StoragePixmap;
  460. struct TQ3Bitmap {
  461. unsigned char * image;
  462. unsigned long width;
  463. unsigned long height;
  464. unsigned long rowBytes;
  465. TQ3Endian bitOrder;
  466. };
  467. typedef struct TQ3Bitmap TQ3Bitmap;
  468. struct TQ3MipmapImage { /* An image for use as a texture mipmap */
  469. unsigned long width; /* Width of mipmap, must be power of 2 */
  470. unsigned long height; /* Height of mipmap, must be power of 2 */
  471. unsigned long rowBytes; /* Rowbytes of mipmap */
  472. unsigned long offset; /* Offset from image base to this mipmap */
  473. };
  474. typedef struct TQ3MipmapImage TQ3MipmapImage;
  475. struct TQ3Mipmap {
  476. TQ3StorageObject image; /* Data containing the texture map and */
  477. /* if (useMipmapping==kQ3True) the */
  478. /* mipmap data */
  479. TQ3Boolean useMipmapping; /* True if mipmapping should be used */
  480. /* and all mipmaps have been provided */
  481. TQ3PixelType pixelType;
  482. TQ3Endian bitOrder;
  483. TQ3Endian byteOrder;
  484. unsigned long reserved; /* leave NULL for next version */
  485. TQ3MipmapImage mipmaps[32]; /* The actual number of mipmaps is determined from the size of the first mipmap */
  486. };
  487. typedef struct TQ3Mipmap TQ3Mipmap;
  488. struct TQ3CompressedPixmap {
  489. TQ3StorageObject compressedImage; /* storage obj containing compressed image data */
  490. TQ3Endian imageDescByteOrder; /* endianness of the data in the imageDesc */
  491. TQ3StorageObject imageDesc; /* storage obj containing image description created by Quicktime to store info about compressed image */
  492. TQ3Boolean makeMipmaps;
  493. unsigned long width;
  494. unsigned long height;
  495. unsigned long pixelSize;
  496. TQ3PixelType pixelType;
  497. };
  498. typedef struct TQ3CompressedPixmap TQ3CompressedPixmap;
  499. /******************************************************************************
  500. ** **
  501. ** Higher dimension quantities **
  502. ** **
  503. *****************************************************************************/
  504. struct TQ3Area {
  505. TQ3Point2D min;
  506. TQ3Point2D max;
  507. };
  508. typedef struct TQ3Area TQ3Area;
  509. struct TQ3PlaneEquation {
  510. TQ3Vector3D normal;
  511. float constant;
  512. };
  513. typedef struct TQ3PlaneEquation TQ3PlaneEquation;
  514. struct TQ3BoundingBox {
  515. TQ3Point3D min;
  516. TQ3Point3D max;
  517. TQ3Boolean isEmpty;
  518. };
  519. typedef struct TQ3BoundingBox TQ3BoundingBox;
  520. struct TQ3BoundingSphere {
  521. TQ3Point3D origin;
  522. float radius;
  523. TQ3Boolean isEmpty;
  524. };
  525. typedef struct TQ3BoundingSphere TQ3BoundingSphere;
  526. /*
  527. * The TQ3ComputeBounds flag passed to StartBoundingBox or StartBoundingSphere
  528. * calls in the View. It's a hint to the system as to how it should
  529. * compute the bbox of a shape:
  530. *
  531. * kQ3ComputeBoundsExact:
  532. * Vertices of shapes are transformed into world space and
  533. * the world space bounding box is computed from them. Slow!
  534. *
  535. * kQ3ComputeBoundsApproximate:
  536. * A local space bounding box is computed from a shape's
  537. * vertices. This bbox is then transformed into world space,
  538. * and its bounding box is taken as the shape's approximate
  539. * bbox. Fast but the bbox is larger than optimal.
  540. */
  541. enum TQ3ComputeBounds {
  542. kQ3ComputeBoundsExact = 0,
  543. kQ3ComputeBoundsApproximate = 1
  544. };
  545. typedef enum TQ3ComputeBounds TQ3ComputeBounds;
  546. /******************************************************************************
  547. ** **
  548. ** Object System Types **
  549. ** **
  550. *****************************************************************************/
  551. typedef struct OpaqueTQ3XObjectClass* TQ3XObjectClass;
  552. typedef unsigned long TQ3XMethodType;
  553. /*
  554. * Object methods
  555. */
  556. #define kQ3XMethodTypeObjectUnregister Q3_METHOD_TYPE('u','n','r','g')
  557. /*
  558. * Return true from the metahandler if this
  559. * object can be submitted in a rendering loop
  560. */
  561. #define kQ3XMethodTypeObjectIsDrawable Q3_METHOD_TYPE('i','s','d','r') /* return true from the metahandler if this object can be submitted in a rendering loop */
  562. typedef CALLBACK_API_C( void , TQ3XFunctionPointer )(void);
  563. typedef CALLBACK_API_C( TQ3XFunctionPointer , TQ3XMetaHandler )(TQ3XMethodType methodType);
  564. /*
  565. * MetaHandler:
  566. * When you give a metahandler to QuickDraw 3D, it is called multiple
  567. * times to build method tables, and then is thrown away. You are
  568. * guaranteed that your metahandler will never be called again after a
  569. * call that was passed a metahandler returns.
  570. *
  571. * Your metahandler should contain a switch on the methodType passed to it
  572. * and should return the corresponding method as an TQ3XFunctionPointer.
  573. *
  574. * IMPORTANT: A metaHandler MUST always "return" a value. If you are
  575. * passed a methodType that you do not understand, ALWAYS return NULL.
  576. *
  577. * These types here are prototypes of how your functions should look.
  578. */
  579. typedef CALLBACK_API_C( TQ3Status , TQ3XObjectUnregisterMethod )(TQ3XObjectClass objectClass);
  580. /*
  581. * See QD3DIO.h for the IO method types:
  582. * ObjectReadData, ObjectTraverse, ObjectWrite
  583. */
  584. /******************************************************************************
  585. ** **
  586. ** Set Types **
  587. ** **
  588. *****************************************************************************/
  589. typedef long TQ3ElementType;
  590. enum {
  591. kQ3ElementTypeNone = 0,
  592. kQ3ElementTypeUnknown = 32,
  593. kQ3ElementTypeSet = 33
  594. };
  595. /*
  596. * kQ3ElementTypeUnknown is a TQ3Object.
  597. *
  598. * Do Q3Set_Add(s, ..., &obj) or Q3Set_Get(s, ..., &obj);
  599. *
  600. * Note that the object is always referenced when copying around.
  601. *
  602. * Generally, it is an Unknown object, a Group of Unknown objects, or a
  603. * group of other "objects" which have been found in the metafile and
  604. * have no attachment method to their parent. Be prepared to handle
  605. * any or all of these cases if you actually access the set on a shape.
  606. *
  607. * kQ3ElementTypeSet is a TQ3SetObject.
  608. *
  609. * Q3Shape_GetSet(s,&o) is eqivalent to
  610. * Q3Shape_GetElement(s, kQ3ElementTypeSet, &o)
  611. *
  612. * Q3Shape_SetSet(s,o) is eqivalent to
  613. * Q3Shape_SetElement(s, kQ3ElementTypeSet, &o)
  614. *
  615. * Note that the object is always referenced when copying around.
  616. *
  617. * See the note below about the Set and Shape changes.
  618. */
  619. /******************************************************************************
  620. ** **
  621. ** Object System Macros **
  622. ** **
  623. *****************************************************************************/
  624. #define Q3_FOUR_CHARACTER_CONSTANT(a,b,c,d) \
  625. ((const unsigned long) \
  626. ((const unsigned long) (a) << 24) | \
  627. ((const unsigned long) (b) << 16) | \
  628. ((const unsigned long) (c) << 8) | \
  629. ((const unsigned long) (d)))
  630. #define Q3_OBJECT_TYPE(a,b,c,d) \
  631. ((TQ3ObjectType) Q3_FOUR_CHARACTER_CONSTANT(a,b,c,d))
  632. #define Q3_METHOD_TYPE(a,b,c,d) \
  633. ((TQ3XMethodType) Q3_FOUR_CHARACTER_CONSTANT(a,b,c,d))
  634. /******************************************************************************
  635. ** **
  636. ** Object Types **
  637. ** **
  638. *****************************************************************************/
  639. /*
  640. * Note: a call to Q3Foo_GetType will return a value kQ3FooTypeBar
  641. * e.g. Q3Shared_GetType(object) returns kQ3SharedTypeShape, etc.
  642. */
  643. #define kQ3ObjectTypeInvalid 0L
  644. #define kQ3ObjectTypeView ((TQ3ObjectType)FOUR_CHAR_CODE('view'))
  645. #define kQ3ObjectTypeElement ((TQ3ObjectType)FOUR_CHAR_CODE('elmn'))
  646. #define kQ3ElementTypeAttribute ((TQ3ObjectType)FOUR_CHAR_CODE('eatt'))
  647. #define kQ3ObjectTypePick ((TQ3ObjectType)FOUR_CHAR_CODE('pick'))
  648. #define kQ3PickTypeWindowPoint ((TQ3ObjectType)FOUR_CHAR_CODE('pkwp'))
  649. #define kQ3PickTypeWindowRect ((TQ3ObjectType)FOUR_CHAR_CODE('pkwr'))
  650. #define kQ3PickTypeWorldRay ((TQ3ObjectType)FOUR_CHAR_CODE('pkry'))
  651. #define kQ3ObjectTypeShared ((TQ3ObjectType)FOUR_CHAR_CODE('shrd'))
  652. #define kQ3SharedTypeRenderer ((TQ3ObjectType)FOUR_CHAR_CODE('rddr'))
  653. #define kQ3RendererTypeWireFrame ((TQ3ObjectType)FOUR_CHAR_CODE('wrfr'))
  654. #define kQ3RendererTypeGeneric ((TQ3ObjectType)FOUR_CHAR_CODE('gnrr'))
  655. #define kQ3RendererTypeInteractive ((TQ3ObjectType)FOUR_CHAR_CODE('ctwn'))
  656. #define kQ3SharedTypeShape ((TQ3ObjectType)FOUR_CHAR_CODE('shap'))
  657. #define kQ3ShapeTypeGeometry ((TQ3ObjectType)FOUR_CHAR_CODE('gmtr'))
  658. #define kQ3GeometryTypeBox ((TQ3ObjectType)FOUR_CHAR_CODE('box '))
  659. #define kQ3GeometryTypeGeneralPolygon ((TQ3ObjectType)FOUR_CHAR_CODE('gpgn'))
  660. #define kQ3GeometryTypeLine ((TQ3ObjectType)FOUR_CHAR_CODE('line'))
  661. #define kQ3GeometryTypeMarker ((TQ3ObjectType)FOUR_CHAR_CODE('mrkr'))
  662. #define kQ3GeometryTypePixmapMarker ((TQ3ObjectType)FOUR_CHAR_CODE('mrkp'))
  663. #define kQ3GeometryTypeMesh ((TQ3ObjectType)FOUR_CHAR_CODE('mesh'))
  664. #define kQ3GeometryTypeNURBCurve ((TQ3ObjectType)FOUR_CHAR_CODE('nrbc'))
  665. #define kQ3GeometryTypeNURBPatch ((TQ3ObjectType)FOUR_CHAR_CODE('nrbp'))
  666. #define kQ3GeometryTypePoint ((TQ3ObjectType)FOUR_CHAR_CODE('pnt '))
  667. #define kQ3GeometryTypePolygon ((TQ3ObjectType)FOUR_CHAR_CODE('plyg'))
  668. #define kQ3GeometryTypePolyLine ((TQ3ObjectType)FOUR_CHAR_CODE('plyl'))
  669. #define kQ3GeometryTypeTriangle ((TQ3ObjectType)FOUR_CHAR_CODE('trng'))
  670. #define kQ3GeometryTypeTriGrid ((TQ3ObjectType)FOUR_CHAR_CODE('trig'))
  671. #define kQ3GeometryTypeCone ((TQ3ObjectType)FOUR_CHAR_CODE('cone'))
  672. #define kQ3GeometryTypeCylinder ((TQ3ObjectType)FOUR_CHAR_CODE('cyln'))
  673. #define kQ3GeometryTypeDisk ((TQ3ObjectType)FOUR_CHAR_CODE('disk'))
  674. #define kQ3GeometryTypeEllipse ((TQ3ObjectType)FOUR_CHAR_CODE('elps'))
  675. #define kQ3GeometryTypeEllipsoid ((TQ3ObjectType)FOUR_CHAR_CODE('elpd'))
  676. #define kQ3GeometryTypePolyhedron ((TQ3ObjectType)FOUR_CHAR_CODE('plhd'))
  677. #define kQ3GeometryTypeTorus ((TQ3ObjectType)FOUR_CHAR_CODE('tors'))
  678. #define kQ3GeometryTypeTriMesh ((TQ3ObjectType)FOUR_CHAR_CODE('tmsh'))
  679. #define kQ3ShapeTypeShader ((TQ3ObjectType)FOUR_CHAR_CODE('shdr'))
  680. #define kQ3ShaderTypeSurface ((TQ3ObjectType)FOUR_CHAR_CODE('sush'))
  681. #define kQ3SurfaceShaderTypeTexture ((TQ3ObjectType)FOUR_CHAR_CODE('txsu'))
  682. #define kQ3ShaderTypeIllumination ((TQ3ObjectType)FOUR_CHAR_CODE('ilsh'))
  683. #define kQ3IlluminationTypePhong ((TQ3ObjectType)FOUR_CHAR_CODE('phil'))
  684. #define kQ3IlluminationTypeLambert ((TQ3ObjectType)FOUR_CHAR_CODE('lmil'))
  685. #define kQ3IlluminationTypeNULL ((TQ3ObjectType)FOUR_CHAR_CODE('nuil'))
  686. #define kQ3ShapeTypeStyle ((TQ3ObjectType)FOUR_CHAR_CODE('styl'))
  687. #define kQ3StyleTypeBackfacing ((TQ3ObjectType)FOUR_CHAR_CODE('bckf'))
  688. #define kQ3StyleTypeInterpolation ((TQ3ObjectType)FOUR_CHAR_CODE('intp'))
  689. #define kQ3StyleTypeFill ((TQ3ObjectType)FOUR_CHAR_CODE('fist'))
  690. #define kQ3StyleTypePickID ((TQ3ObjectType)FOUR_CHAR_CODE('pkid'))
  691. #define kQ3StyleTypeReceiveShadows ((TQ3ObjectType)FOUR_CHAR_CODE('rcsh'))
  692. #define kQ3StyleTypeHighlight ((TQ3ObjectType)FOUR_CHAR_CODE('high'))
  693. #define kQ3StyleTypeSubdivision ((TQ3ObjectType)FOUR_CHAR_CODE('sbdv'))
  694. #define kQ3StyleTypeOrientation ((TQ3ObjectType)FOUR_CHAR_CODE('ofdr'))
  695. #define kQ3StyleTypePickParts ((TQ3ObjectType)FOUR_CHAR_CODE('pkpt'))
  696. #define kQ3StyleTypeAntiAlias ((TQ3ObjectType)FOUR_CHAR_CODE('anti'))
  697. #define kQ3StyleTypeFog ((TQ3ObjectType)FOUR_CHAR_CODE('fogg'))
  698. #define kQ3ShapeTypeTransform ((TQ3ObjectType)FOUR_CHAR_CODE('xfrm'))
  699. #define kQ3TransformTypeMatrix ((TQ3ObjectType)FOUR_CHAR_CODE('mtrx'))
  700. #define kQ3TransformTypeScale ((TQ3ObjectType)FOUR_CHAR_CODE('scal'))
  701. #define kQ3TransformTypeTranslate ((TQ3ObjectType)FOUR_CHAR_CODE('trns'))
  702. #define kQ3TransformTypeRotate ((TQ3ObjectType)FOUR_CHAR_CODE('rott'))
  703. #define kQ3TransformTypeRotateAboutPoint ((TQ3ObjectType)FOUR_CHAR_CODE('rtap'))
  704. #define kQ3TransformTypeRotateAboutAxis ((TQ3ObjectType)FOUR_CHAR_CODE('rtaa'))
  705. #define kQ3TransformTypeQuaternion ((TQ3ObjectType)FOUR_CHAR_CODE('qtrn'))
  706. #define kQ3TransformTypeReset ((TQ3ObjectType)FOUR_CHAR_CODE('rset'))
  707. #define kQ3ShapeTypeLight ((TQ3ObjectType)FOUR_CHAR_CODE('lght'))
  708. #define kQ3LightTypeAmbient ((TQ3ObjectType)FOUR_CHAR_CODE('ambn'))
  709. #define kQ3LightTypeDirectional ((TQ3ObjectType)FOUR_CHAR_CODE('drct'))
  710. #define kQ3LightTypePoint ((TQ3ObjectType)FOUR_CHAR_CODE('pntl'))
  711. #define kQ3LightTypeSpot ((TQ3ObjectType)FOUR_CHAR_CODE('spot'))
  712. #define kQ3ShapeTypeCamera ((TQ3ObjectType)FOUR_CHAR_CODE('cmra'))
  713. #define kQ3CameraTypeOrthographic ((TQ3ObjectType)FOUR_CHAR_CODE('orth'))
  714. #define kQ3CameraTypeViewPlane ((TQ3ObjectType)FOUR_CHAR_CODE('vwpl'))
  715. #define kQ3CameraTypeViewAngleAspect ((TQ3ObjectType)FOUR_CHAR_CODE('vana'))
  716. #define kQ3ShapeTypeStateOperator ((TQ3ObjectType)FOUR_CHAR_CODE('stop'))
  717. #define kQ3StateOperatorTypePush ((TQ3ObjectType)FOUR_CHAR_CODE('push'))
  718. #define kQ3StateOperatorTypePop ((TQ3ObjectType)FOUR_CHAR_CODE('pop '))
  719. #define kQ3ShapeTypeGroup ((TQ3ObjectType)FOUR_CHAR_CODE('grup'))
  720. #define kQ3GroupTypeDisplay ((TQ3ObjectType)FOUR_CHAR_CODE('dspg'))
  721. #define kQ3DisplayGroupTypeOrdered ((TQ3ObjectType)FOUR_CHAR_CODE('ordg'))
  722. #define kQ3DisplayGroupTypeIOProxy ((TQ3ObjectType)FOUR_CHAR_CODE('iopx'))
  723. #define kQ3GroupTypeLight ((TQ3ObjectType)FOUR_CHAR_CODE('lghg'))
  724. #define kQ3GroupTypeInfo ((TQ3ObjectType)FOUR_CHAR_CODE('info'))
  725. #define kQ3ShapeTypeUnknown ((TQ3ObjectType)FOUR_CHAR_CODE('unkn'))
  726. #define kQ3UnknownTypeText ((TQ3ObjectType)FOUR_CHAR_CODE('uktx'))
  727. #define kQ3UnknownTypeBinary ((TQ3ObjectType)FOUR_CHAR_CODE('ukbn'))
  728. #define kQ3ShapeTypeReference ((TQ3ObjectType)FOUR_CHAR_CODE('rfrn'))
  729. #define kQ3ReferenceTypeExternal ((TQ3ObjectType)FOUR_CHAR_CODE('rfex'))
  730. #define kQ3SharedTypeSet ((TQ3ObjectType)FOUR_CHAR_CODE('set '))
  731. #define kQ3SetTypeAttribute ((TQ3ObjectType)FOUR_CHAR_CODE('attr'))
  732. #define kQ3SharedTypeDrawContext ((TQ3ObjectType)FOUR_CHAR_CODE('dctx'))
  733. #define kQ3DrawContextTypePixmap ((TQ3ObjectType)FOUR_CHAR_CODE('dpxp'))
  734. #define kQ3DrawContextTypeMacintosh ((TQ3ObjectType)FOUR_CHAR_CODE('dmac'))
  735. #define kQ3DrawContextTypeWin32DC ((TQ3ObjectType)FOUR_CHAR_CODE('dw32'))
  736. #define kQ3DrawContextTypeDDSurface ((TQ3ObjectType)FOUR_CHAR_CODE('ddds'))
  737. #define kQ3DrawContextTypeX11 ((TQ3ObjectType)FOUR_CHAR_CODE('dx11'))
  738. #define kQ3SharedTypeTexture ((TQ3ObjectType)FOUR_CHAR_CODE('txtr'))
  739. #define kQ3TextureTypePixmap ((TQ3ObjectType)FOUR_CHAR_CODE('txpm'))
  740. #define kQ3TextureTypeMipmap ((TQ3ObjectType)FOUR_CHAR_CODE('txmm'))
  741. #define kQ3TextureTypeCompressedPixmap ((TQ3ObjectType)FOUR_CHAR_CODE('txcp'))
  742. #define kQ3SharedTypeFile ((TQ3ObjectType)FOUR_CHAR_CODE('file'))
  743. #define kQ3SharedTypeStorage ((TQ3ObjectType)FOUR_CHAR_CODE('strg'))
  744. #define kQ3StorageTypeMemory ((TQ3ObjectType)FOUR_CHAR_CODE('mems'))
  745. #define kQ3MemoryStorageTypeHandle ((TQ3ObjectType)FOUR_CHAR_CODE('hndl'))
  746. #define kQ3StorageTypeUnix ((TQ3ObjectType)FOUR_CHAR_CODE('uxst'))
  747. #define kQ3UnixStorageTypePath ((TQ3ObjectType)FOUR_CHAR_CODE('unix'))
  748. #define kQ3StorageTypeMacintosh ((TQ3ObjectType)FOUR_CHAR_CODE('macn'))
  749. #define kQ3MacintoshStorageTypeFSSpec ((TQ3ObjectType)FOUR_CHAR_CODE('macp'))
  750. #define kQ3StorageTypeWin32 ((TQ3ObjectType)FOUR_CHAR_CODE('wist'))
  751. #define kQ3SharedTypeString ((TQ3ObjectType)FOUR_CHAR_CODE('strn'))
  752. #define kQ3StringTypeCString ((TQ3ObjectType)FOUR_CHAR_CODE('strc'))
  753. #define kQ3SharedTypeShapePart ((TQ3ObjectType)FOUR_CHAR_CODE('sprt'))
  754. #define kQ3ShapePartTypeMeshPart ((TQ3ObjectType)FOUR_CHAR_CODE('spmh'))
  755. #define kQ3MeshPartTypeMeshFacePart ((TQ3ObjectType)FOUR_CHAR_CODE('mfac'))
  756. #define kQ3MeshPartTypeMeshEdgePart ((TQ3ObjectType)FOUR_CHAR_CODE('medg'))
  757. #define kQ3MeshPartTypeMeshVertexPart ((TQ3ObjectType)FOUR_CHAR_CODE('mvtx'))
  758. #define kQ3SharedTypeControllerState ((TQ3ObjectType)FOUR_CHAR_CODE('ctst'))
  759. #define kQ3SharedTypeTracker ((TQ3ObjectType)FOUR_CHAR_CODE('trkr'))
  760. #define kQ3SharedTypeViewHints ((TQ3ObjectType)FOUR_CHAR_CODE('vwhn'))
  761. #define kQ3SharedTypeEndGroup ((TQ3ObjectType)FOUR_CHAR_CODE('endg'))
  762. /******************************************************************************
  763. ** **
  764. ** QuickDraw 3D System Routines **
  765. ** **
  766. *****************************************************************************/
  767. #if CALL_NOT_IN_CARBON
  768. /*
  769. * Q3Initialize()
  770. *
  771. * Availability:
  772. * Non-Carbon CFM: not available
  773. * CarbonLib: not available
  774. * Mac OS X: not available
  775. */
  776. EXTERN_API_C( TQ3Status )
  777. Q3Initialize(void);
  778. /*
  779. * Q3Exit()
  780. *
  781. * Availability:
  782. * Non-Carbon CFM: not available
  783. * CarbonLib: not available
  784. * Mac OS X: not available
  785. */
  786. EXTERN_API_C( TQ3Status )
  787. Q3Exit(void);
  788. /*
  789. * Q3IsInitialized()
  790. *
  791. * Availability:
  792. * Non-Carbon CFM: not available
  793. * CarbonLib: not available
  794. * Mac OS X: not available
  795. */
  796. EXTERN_API_C( TQ3Boolean )
  797. Q3IsInitialized(void);
  798. /*
  799. * Q3GetVersion()
  800. *
  801. * Availability:
  802. * Non-Carbon CFM: not available
  803. * CarbonLib: not available
  804. * Mac OS X: not available
  805. */
  806. EXTERN_API_C( TQ3Status )
  807. Q3GetVersion(
  808. unsigned long * majorRevision,
  809. unsigned long * minorRevision);
  810. /*
  811. * Q3GetReleaseVersion returns the release version number,
  812. * in the format of the first four bytes of a 'vers' resource
  813. * (e.g. 0x01518000 ==> 1.5.1 release).
  814. */
  815. /*
  816. * Q3GetReleaseVersion()
  817. *
  818. * Availability:
  819. * Non-Carbon CFM: not available
  820. * CarbonLib: not available
  821. * Mac OS X: not available
  822. */
  823. EXTERN_API_C( TQ3Status )
  824. Q3GetReleaseVersion(unsigned long * releaseRevision);
  825. /******************************************************************************
  826. ** **
  827. ** ObjectClass Routines **
  828. ** **
  829. *****************************************************************************/
  830. /*
  831. * New object system calls to query the object system.
  832. *
  833. * These comments to move to the stubs file before final release, they
  834. * are here for documentation for developers using early seeds.
  835. */
  836. /*
  837. * Given a class name as a string return the associated class type for the
  838. * class, may return kQ3Failure if the string representing the class is
  839. * invalid.
  840. */
  841. /*
  842. * Q3ObjectHierarchy_GetTypeFromString()
  843. *
  844. * Availability:
  845. * Non-Carbon CFM: not available
  846. * CarbonLib: not available
  847. * Mac OS X: not available
  848. */
  849. EXTERN_API_C( TQ3Status )
  850. Q3ObjectHierarchy_GetTypeFromString(
  851. TQ3ObjectClassNameString objectClassString,
  852. TQ3ObjectType * objectClassType);
  853. /*
  854. * Given a class type as return the associated string for the class name,
  855. * may return kQ3Failure if the type representing the class is invalid.
  856. */
  857. /*
  858. * Q3ObjectHierarchy_GetStringFromType()
  859. *
  860. * Availability:
  861. * Non-Carbon CFM: not available
  862. * CarbonLib: not available
  863. * Mac OS X: not available
  864. */
  865. EXTERN_API_C( TQ3Status )
  866. Q3ObjectHierarchy_GetStringFromType(
  867. TQ3ObjectType objectClassType,
  868. TQ3ObjectClassNameString objectClassString);
  869. /*
  870. * Return true if the class with this type is registered, false if not
  871. */
  872. /*
  873. * Q3ObjectHierarchy_IsTypeRegistered()
  874. *
  875. * Availability:
  876. * Non-Carbon CFM: not available
  877. * CarbonLib: not available
  878. * Mac OS X: not available
  879. */
  880. EXTERN_API_C( TQ3Boolean )
  881. Q3ObjectHierarchy_IsTypeRegistered(TQ3ObjectType objectClassType);
  882. /*
  883. * Return true if the class with this name is registered, false if not
  884. */
  885. /*
  886. * Q3ObjectHierarchy_IsNameRegistered()
  887. *
  888. * Availability:
  889. * Non-Carbon CFM: not available
  890. * CarbonLib: not available
  891. * Mac OS X: not available
  892. */
  893. EXTERN_API_C( TQ3Boolean )
  894. Q3ObjectHierarchy_IsNameRegistered(const char * objectClassName);
  895. /*
  896. * TQ3SubClassData is used when querying the object system for
  897. * the subclasses of a particular parent type:
  898. */
  899. #endif /* CALL_NOT_IN_CARBON */
  900. struct TQ3SubClassData {
  901. unsigned long numClasses; /* the # of subclass types found for a parent class */
  902. TQ3ObjectType * classTypes; /* an array containing the class types */
  903. };
  904. typedef struct TQ3SubClassData TQ3SubClassData;
  905. /*
  906. * Given a parent type and an instance of the TQ3SubClassData struct fill
  907. * it in with the number and class types of all of the subclasses immediately
  908. * below the parent in the class hierarchy. Return kQ3Success to indicate no
  909. * errors occurred, else kQ3Failure.
  910. *
  911. * NOTE: This function will allocate memory for the classTypes array. Be
  912. * sure to call Q3ObjectClass_EmptySubClassData to free this memory up.
  913. */
  914. #if CALL_NOT_IN_CARBON
  915. /*
  916. * Q3ObjectHierarchy_GetSubClassData()
  917. *
  918. * Availability:
  919. * Non-Carbon CFM: not available
  920. * CarbonLib: not available
  921. * Mac OS X: not available
  922. */
  923. EXTERN_API_C( TQ3Status )
  924. Q3ObjectHierarchy_GetSubClassData(
  925. TQ3ObjectType objectClassType,
  926. TQ3SubClassData * subClassData);
  927. /*
  928. * Given an instance of the TQ3SubClassData struct free all memory allocated
  929. * by the Q3ObjectClass_GetSubClassData call.
  930. *
  931. * NOTE: This call MUST be made after a call to Q3ObjectClass_GetSubClassData
  932. * to avoid memory leaks.
  933. */
  934. /*
  935. * Q3ObjectHierarchy_EmptySubClassData()
  936. *
  937. * Availability:
  938. * Non-Carbon CFM: not available
  939. * CarbonLib: not available
  940. * Mac OS X: not available
  941. */
  942. EXTERN_API_C( TQ3Status )
  943. Q3ObjectHierarchy_EmptySubClassData(TQ3SubClassData * subClassData);
  944. /******************************************************************************
  945. ** **
  946. ** Object Routines **
  947. ** **
  948. *****************************************************************************/
  949. /*
  950. * Q3Object_Dispose()
  951. *
  952. * Availability:
  953. * Non-Carbon CFM: not available
  954. * CarbonLib: not available
  955. * Mac OS X: not available
  956. */
  957. EXTERN_API_C( TQ3Status )
  958. Q3Object_Dispose(TQ3Object object);
  959. /*
  960. * Q3Object_Duplicate()
  961. *
  962. * Availability:
  963. * Non-Carbon CFM: not available
  964. * CarbonLib: not available
  965. * Mac OS X: not available
  966. */
  967. EXTERN_API_C( TQ3Object )
  968. Q3Object_Duplicate(TQ3Object object);
  969. /*
  970. * Q3Object_Submit()
  971. *
  972. * Availability:
  973. * Non-Carbon CFM: not available
  974. * CarbonLib: not available
  975. * Mac OS X: not available
  976. */
  977. EXTERN_API_C( TQ3Status )
  978. Q3Object_Submit(
  979. TQ3Object object,
  980. TQ3ViewObject view);
  981. /*
  982. * Q3Object_IsDrawable()
  983. *
  984. * Availability:
  985. * Non-Carbon CFM: not available
  986. * CarbonLib: not available
  987. * Mac OS X: not available
  988. */
  989. EXTERN_API_C( TQ3Boolean )
  990. Q3Object_IsDrawable(TQ3Object object);
  991. /*
  992. * Q3Object_IsWritable()
  993. *
  994. * Availability:
  995. * Non-Carbon CFM: not available
  996. * CarbonLib: not available
  997. * Mac OS X: not available
  998. */
  999. EXTERN_API_C( TQ3Boolean )
  1000. Q3Object_IsWritable(
  1001. TQ3Object object,
  1002. TQ3FileObject theFile);
  1003. /******************************************************************************
  1004. ** **
  1005. ** Object Type Routines **
  1006. ** **
  1007. *****************************************************************************/
  1008. /*
  1009. * Q3Object_GetType()
  1010. *
  1011. * Availability:
  1012. * Non-Carbon CFM: not available
  1013. * CarbonLib: not available
  1014. * Mac OS X: not available
  1015. */
  1016. EXTERN_API_C( TQ3ObjectType )
  1017. Q3Object_GetType(TQ3Object object);
  1018. /*
  1019. * Q3Object_GetLeafType()
  1020. *
  1021. * Availability:
  1022. * Non-Carbon CFM: not available
  1023. * CarbonLib: not available
  1024. * Mac OS X: not available
  1025. */
  1026. EXTERN_API_C( TQ3ObjectType )
  1027. Q3Object_GetLeafType(TQ3Object object);
  1028. /*
  1029. * Q3Object_IsType()
  1030. *
  1031. * Availability:
  1032. * Non-Carbon CFM: not available
  1033. * CarbonLib: not available
  1034. * Mac OS X: not available
  1035. */
  1036. EXTERN_API_C( TQ3Boolean )
  1037. Q3Object_IsType(
  1038. TQ3Object object,
  1039. TQ3ObjectType theType);
  1040. /******************************************************************************
  1041. ** **
  1042. ** Shared Object Routines **
  1043. ** **
  1044. *****************************************************************************/
  1045. /*
  1046. * Q3Shared_GetType()
  1047. *
  1048. * Availability:
  1049. * Non-Carbon CFM: not available
  1050. * CarbonLib: not available
  1051. * Mac OS X: not available
  1052. */
  1053. EXTERN_API_C( TQ3ObjectType )
  1054. Q3Shared_GetType(TQ3SharedObject sharedObject);
  1055. /*
  1056. * Q3Shared_GetReference()
  1057. *
  1058. * Availability:
  1059. * Non-Carbon CFM: not available
  1060. * CarbonLib: not available
  1061. * Mac OS X: not available
  1062. */
  1063. EXTERN_API_C( TQ3SharedObject )
  1064. Q3Shared_GetReference(TQ3SharedObject sharedObject);
  1065. /*
  1066. * Q3Shared_IsReferenced
  1067. * Returns kQ3True if there is more than one reference to sharedObject.
  1068. * Returns kQ3False if there is ONE reference to sharedObject.
  1069. *
  1070. * This call is intended to allow applications and plug-in objects to delete
  1071. * objects of which they hold THE ONLY REFERENCE. This is useful when
  1072. * caching objects, etc.
  1073. *
  1074. * Although many may be tempted, DO NOT DO THIS:
  1075. * while (Q3Shared_IsReferenced(foo)) { Q3Object_Dispose(foo); }
  1076. *
  1077. * Your application will crash and no one will buy it. Chapter 11 is
  1078. * never fun (unless you short the stock). Thanks.
  1079. */
  1080. /*
  1081. * Q3Shared_IsReferenced()
  1082. *
  1083. * Availability:
  1084. * Non-Carbon CFM: not available
  1085. * CarbonLib: not available
  1086. * Mac OS X: not available
  1087. */
  1088. EXTERN_API_C( TQ3Boolean )
  1089. Q3Shared_IsReferenced(TQ3SharedObject sharedObject);
  1090. /*
  1091. * Q3Shared_GetEditIndex
  1092. * Returns the "serial number" of sharedObject. Usefuly for caching
  1093. * object information. Returns 0 on error.
  1094. *
  1095. * Hold onto this number to determine if an object has changed since you
  1096. * last built your caches... To validate, do:
  1097. *
  1098. * if (Q3Shared_GetEditIndex(foo) == oldFooEditIndex) {
  1099. * // Cache is valid
  1100. * } else {
  1101. * // Cache is invalid
  1102. * RebuildSomeSortOfCache(foo);
  1103. * oldFooEditIndex = Q3Shared_GetEditIndex(foo);
  1104. * }
  1105. */
  1106. /*
  1107. * Q3Shared_GetEditIndex()
  1108. *
  1109. * Availability:
  1110. * Non-Carbon CFM: not available
  1111. * CarbonLib: not available
  1112. * Mac OS X: not available
  1113. */
  1114. EXTERN_API_C( unsigned long )
  1115. Q3Shared_GetEditIndex(TQ3SharedObject sharedObject);
  1116. /*
  1117. * Q3Shared_Edited
  1118. * Bumps the "serial number" of sharedObject to a different value. This
  1119. * call is intended to be used solely from a plug-in object which is
  1120. * shared. Call this whenever your private instance data changes.
  1121. *
  1122. * Returns kQ3Failure iff sharedObject is not a shared object, OR
  1123. * QuickDraw 3D isn't initialized.
  1124. */
  1125. /*
  1126. * Q3Shared_Edited()
  1127. *
  1128. * Availability:
  1129. * Non-Carbon CFM: not available
  1130. * CarbonLib: not available
  1131. * Mac OS X: not available
  1132. */
  1133. EXTERN_API_C( TQ3Status )
  1134. Q3Shared_Edited(TQ3SharedObject sharedObject);
  1135. /******************************************************************************
  1136. ** **
  1137. ** Shape Routines **
  1138. ** **
  1139. *****************************************************************************/
  1140. /*
  1141. * QuickDraw 3D 1.5 Note:
  1142. *
  1143. * Shapes and Sets are now (sort of) polymorphic.
  1144. *
  1145. * You may call Q3Shape_Foo or Q3Set_Foo on a shape or a set.
  1146. * The following calls are identical, in implementation:
  1147. *
  1148. * Q3Shape_GetElement = Q3Set_Get
  1149. * Q3Shape_AddElement = Q3Set_Add
  1150. * Q3Shape_ContainsElement = Q3Set_Contains
  1151. * Q3Shape_GetNextElementType = Q3Set_GetNextElementType
  1152. * Q3Shape_EmptyElements = Q3Set_Empty
  1153. * Q3Shape_ClearElement = Q3Set_Clear
  1154. *
  1155. * All of these calls accept a shape or a set as their first parameter.
  1156. *
  1157. * The Q3Shape_GetSet and Q3ShapeSetSet calls are implemented via a new
  1158. * element type kQ3ElementTypeSet. See the note above about
  1159. * kQ3ElementTypeSet;
  1160. *
  1161. * It is important to note that the new Q3Shape_...Element... calls do not
  1162. * create a set on a shape and then add the element to it. This data is
  1163. * attached directly to the shape. Therefore, it is possible for an element
  1164. * to exist on a shape without a set existing on it as well.
  1165. *
  1166. * In your application, if you attach an element to a shape like this:
  1167. * (this isn't checking for errors for simplicity)
  1168. *
  1169. * set = Q3Set_New();
  1170. * Q3Set_AddElement(set, kMyElemType, &data);
  1171. * Q3Shape_SetSet(shape, set);
  1172. *
  1173. * You should retrieve it in the same manner:
  1174. *
  1175. * Q3Shape_GetSet(shape, &set);
  1176. * if (Q3Set_Contains(set, kMyElemType) == kTrue) {
  1177. * Q3Set_Get(set, kMyElemType, &data);
  1178. * }
  1179. *
  1180. * Similarly, if you attach data to a shape with the new calls:
  1181. *
  1182. * Q3Shape_AddElement(shape, kMyElemType, &data);
  1183. *
  1184. * You should retrieve it in the same manner:
  1185. *
  1186. * if (Q3Shape_ContainsElement(set, kMyElemType) == kTrue) {
  1187. * Q3Shape_GetElement(set, kMyElemType, &data);
  1188. * }
  1189. *
  1190. * This really becomes an issue when dealing with version 1.0 and version 1.1
  1191. * metafiles.
  1192. *
  1193. * When attempting to find a particular element on a shape, you should
  1194. * first check with Q3Shape_GetNextElementType or Q3Shape_GetElement, then,
  1195. * Q3Shape_GetSet(s, &set) (or Q3Shape_GetElement(s, kQ3ElementTypeSet, &set))
  1196. * and then Q3Shape_GetElement(set, ...).
  1197. *
  1198. * In terms of implementation, Q3Shape_SetSet and Q3Shape_GetSet should only be
  1199. * used for sets of information that are shared among multiple shapes.
  1200. *
  1201. * Q3Shape_AddElement, Q3Shape_GetElement, etc. calls should only be used
  1202. * for elements that are unique for a particular shape.
  1203. *
  1204. */
  1205. /*
  1206. * Q3Shape_GetType()
  1207. *
  1208. * Availability:
  1209. * Non-Carbon CFM: not available
  1210. * CarbonLib: not available
  1211. * Mac OS X: not available
  1212. */
  1213. EXTERN_API_C( TQ3ObjectType )
  1214. Q3Shape_GetType(TQ3ShapeObject shape);
  1215. /*
  1216. * Q3Shape_GetSet()
  1217. *
  1218. * Availability:
  1219. * Non-Carbon CFM: not available
  1220. * CarbonLib: not available
  1221. * Mac OS X: not available
  1222. */
  1223. EXTERN_API_C( TQ3Status )
  1224. Q3Shape_GetSet(
  1225. TQ3ShapeObject shape,
  1226. TQ3SetObject * theSet);
  1227. /*
  1228. * Q3Shape_SetSet()
  1229. *
  1230. * Availability:
  1231. * Non-Carbon CFM: not available
  1232. * CarbonLib: not available
  1233. * Mac OS X: not available
  1234. */
  1235. EXTERN_API_C( TQ3Status )
  1236. Q3Shape_SetSet(
  1237. TQ3ShapeObject shape,
  1238. TQ3SetObject theSet);
  1239. /*
  1240. * Q3Shape_AddElement()
  1241. *
  1242. * Availability:
  1243. * Non-Carbon CFM: not available
  1244. * CarbonLib: not available
  1245. * Mac OS X: not available
  1246. */
  1247. EXTERN_API_C( TQ3Status )
  1248. Q3Shape_AddElement(
  1249. TQ3ShapeObject shape,
  1250. TQ3ElementType theType,
  1251. const void * data);
  1252. /*
  1253. * Q3Shape_GetElement()
  1254. *
  1255. * Availability:
  1256. * Non-Carbon CFM: not available
  1257. * CarbonLib: not available
  1258. * Mac OS X: not available
  1259. */
  1260. EXTERN_API_C( TQ3Status )
  1261. Q3Shape_GetElement(
  1262. TQ3ShapeObject shape,
  1263. TQ3ElementType theType,
  1264. void * data);
  1265. /*
  1266. * Q3Shape_ContainsElement()
  1267. *
  1268. * Availability:
  1269. * Non-Carbon CFM: not available
  1270. * CarbonLib: not available
  1271. * Mac OS X: not available
  1272. */
  1273. EXTERN_API_C( TQ3Boolean )
  1274. Q3Shape_ContainsElement(
  1275. TQ3ShapeObject shape,
  1276. TQ3ElementType theType);
  1277. /*
  1278. * Q3Shape_GetNextElementType()
  1279. *
  1280. * Availability:
  1281. * Non-Carbon CFM: not available
  1282. * CarbonLib: not available
  1283. * Mac OS X: not available
  1284. */
  1285. EXTERN_API_C( TQ3Status )
  1286. Q3Shape_GetNextElementType(
  1287. TQ3ShapeObject shape,
  1288. TQ3ElementType * theType);
  1289. /*
  1290. * Q3Shape_EmptyElements()
  1291. *
  1292. * Availability:
  1293. * Non-Carbon CFM: not available
  1294. * CarbonLib: not available
  1295. * Mac OS X: not available
  1296. */
  1297. EXTERN_API_C( TQ3Status )
  1298. Q3Shape_EmptyElements(TQ3ShapeObject shape);
  1299. /*
  1300. * Q3Shape_ClearElement()
  1301. *
  1302. * Availability:
  1303. * Non-Carbon CFM: not available
  1304. * CarbonLib: not available
  1305. * Mac OS X: not available
  1306. */
  1307. EXTERN_API_C( TQ3Status )
  1308. Q3Shape_ClearElement(
  1309. TQ3ShapeObject shape,
  1310. TQ3ElementType theType);
  1311. /******************************************************************************
  1312. ** **
  1313. ** Color Table Routines **
  1314. ** **
  1315. *****************************************************************************/
  1316. /*
  1317. * Q3Bitmap_Empty()
  1318. *
  1319. * Availability:
  1320. * Non-Carbon CFM: not available
  1321. * CarbonLib: not available
  1322. * Mac OS X: not available
  1323. */
  1324. EXTERN_API_C( TQ3Status )
  1325. Q3Bitmap_Empty(TQ3Bitmap * bitmap);
  1326. /*
  1327. * Q3Bitmap_GetImageSize()
  1328. *
  1329. * Availability:
  1330. * Non-Carbon CFM: not available
  1331. * CarbonLib: not available
  1332. * Mac OS X: not available
  1333. */
  1334. EXTERN_API_C( unsigned long )
  1335. Q3Bitmap_GetImageSize(
  1336. unsigned long width,
  1337. unsigned long height);
  1338. #endif /* CALL_NOT_IN_CARBON */
  1339. #if PRAGMA_ENUM_ALWAYSINT
  1340. #pragma enumsalwaysint reset
  1341. #ifdef __QD3D__RESTORE_TWOBYTEINTS
  1342. #pragma fourbyteints off
  1343. #endif
  1344. #elif PRAGMA_ENUM_OPTIONS
  1345. #pragma option enum=reset
  1346. #elif defined(__QD3D__RESTORE_PACKED_ENUMS)
  1347. #pragma options(pack_enums)
  1348. #endif
  1349. #if PRAGMA_STRUCT_ALIGN
  1350. #pragma options align=reset
  1351. #elif PRAGMA_STRUCT_PACKPUSH
  1352. #pragma pack(pop)
  1353. #elif PRAGMA_STRUCT_PACK
  1354. #pragma pack()
  1355. #endif
  1356. #ifdef PRAGMA_IMPORT_OFF
  1357. #pragma import off
  1358. #elif PRAGMA_IMPORT
  1359. #pragma import reset
  1360. #endif
  1361. #ifdef __cplusplus
  1362. }
  1363. #endif
  1364. #endif /* __QD3D__ */