QD3DIO.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:32k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       QD3DIO.h
  3.  
  4.      Contains:   QuickDraw 3D IO API
  5.  
  6.      Version:    Technology: Quickdraw 3D 1.6
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1995-2001 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __QD3DIO__
  18. #define __QD3DIO__
  19. #ifndef __QD3D__
  20. #include "QD3D.h"
  21. #endif
  22. #ifndef __QD3DDRAWCONTEXT__
  23. #include "QD3DDrawContext.h"
  24. #endif
  25. #ifndef __QD3DVIEW__
  26. #include "QD3DView.h"
  27. #endif
  28. #if PRAGMA_ONCE
  29. #pragma once
  30. #endif
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. #if PRAGMA_IMPORT
  35. #pragma import on
  36. #endif
  37. #if PRAGMA_STRUCT_ALIGN
  38.     #pragma options align=power
  39. #elif PRAGMA_STRUCT_PACKPUSH
  40.     #pragma pack(push, 2)
  41. #elif PRAGMA_STRUCT_PACK
  42.     #pragma pack(2)
  43. #endif
  44. #if PRAGMA_ENUM_ALWAYSINT
  45.     #if defined(__fourbyteints__) && !__fourbyteints__ 
  46.         #define __QD3DIO__RESTORE_TWOBYTEINTS
  47.         #pragma fourbyteints on
  48.     #endif
  49.     #pragma enumsalwaysint on
  50. #elif PRAGMA_ENUM_OPTIONS
  51.     #pragma option enum=int
  52. #elif PRAGMA_ENUM_PACK
  53.     #if __option(pack_enums)
  54.         #define __QD3DIO__RESTORE_PACKED_ENUMS
  55.         #pragma options(!pack_enums)
  56.     #endif
  57. #endif
  58. /******************************************************************************
  59.  **                                                                          **
  60.  **                                 Basic Types                              **                                                 
  61.  **                                                                          **
  62.  *****************************************************************************/
  63. typedef unsigned char                   TQ3Uns8;
  64. typedef signed char                     TQ3Int8;
  65. typedef unsigned short                  TQ3Uns16;
  66. typedef signed short                    TQ3Int16;
  67. typedef unsigned long                   TQ3Uns32;
  68. typedef signed long                     TQ3Int32;
  69. #if TARGET_RT_BIG_ENDIAN
  70. struct TQ3Uns64 {
  71.     unsigned long                   hi;
  72.     unsigned long                   lo;
  73. };
  74. typedef struct TQ3Uns64                 TQ3Uns64;
  75. struct TQ3Int64 {
  76.     signed long                     hi;
  77.     unsigned long                   lo;
  78. };
  79. typedef struct TQ3Int64                 TQ3Int64;
  80. #else
  81. struct TQ3Uns64 {
  82.     unsigned long                   lo;
  83.     unsigned long                   hi;
  84. };
  85. typedef struct TQ3Uns64                 TQ3Uns64;
  86. struct TQ3Int64 {
  87.     unsigned long                   lo;
  88.     signed long                     hi;
  89. };
  90. typedef struct TQ3Int64                 TQ3Int64;
  91. #endif  /* TARGET_RT_BIG_ENDIAN */
  92. typedef float                           TQ3Float32;
  93. typedef double                          TQ3Float64;
  94. typedef TQ3Uns32                        TQ3Size;
  95. /******************************************************************************
  96.  **                                                                          **
  97.  **                                 File Types                               **
  98.  **                                                                          **
  99.  *****************************************************************************/
  100. enum TQ3FileModeMasks {
  101.     kQ3FileModeNormal           = 0,
  102.     kQ3FileModeStream           = 1 << 0,
  103.     kQ3FileModeDatabase         = 1 << 1,
  104.     kQ3FileModeText             = 1 << 2
  105. };
  106. typedef enum TQ3FileModeMasks TQ3FileModeMasks;
  107. typedef unsigned long                   TQ3FileMode;
  108. /******************************************************************************
  109.  **                                                                          **
  110.  **                                 Method Types                             **
  111.  **                                                                          **
  112.  *****************************************************************************/
  113. /*
  114.  *  IO Methods
  115.  *
  116.  *  The IO system treats all objects as groups of typed information.
  117.  *  When you register your element or attribute, the "elementType" is the 
  118.  *  binary type of your object, the "elementName" the ascii type.
  119.  *  
  120.  *  All objects in the metafile are made up of a "root" or parent object which
  121.  *  defines the instantiated object type. You may define the format of your 
  122.  *  data any way you wish as long as you use the primitives types above and the
  123.  *  routines below.
  124.  *
  125.  *  Root Objects are often appended with additional child objects, called 
  126.  *  subobjects. You may append your object with other QuickDraw 3D objects.
  127.  *  
  128.  *  Writing is straightforward: an object traverses itself any other objects 
  129.  *  that make it up, then writes its own data. Writing uses two methods: 
  130.  *  TQ3XObjectTraverseMethod and TQ3XObjectWriteMethod.
  131.  *
  132.  *  The TQ3XObjectTraverseMethod method should:
  133.  *  + First, Determine if the data should be written 
  134.  *      - if you don't want to write out your object after examining your
  135.  *          data, return kQ3Success in your Traverse method without calling
  136.  *          any other submit calls.
  137.  *  + Next, calculate the size of your object on disk
  138.  *  + Gather whatever state from the view you need to preserve
  139.  *      - you may access the view state NOW, as the state of the
  140.  *          view duing your TQ3XObjectWriteMethod will not be valid. You may
  141.  *          pass a temporary buffer to your write method.
  142.  *  + Submit your view write data using Q3View_SubmitWriteData
  143.  *      - note that you MUST call this before any other "_Submit" call.
  144.  *      - you may pass in a "deleteMethod" for your data. This method
  145.  *          will be called whether or not your write method succeeds or fails.
  146.  *  + Submit your subobjects to the view
  147.  *  
  148.  *  The TQ3XObjectWriteMethod method should:
  149.  *  + Write your data format to the file using the primitives routines below.
  150.  *      - If you passed a "deleteMethod" in your Q3View_SubmitWriteData, that
  151.  *          method will be called upon exit of your write method.
  152.  *
  153.  *  Reading is less straightforward because your root object and
  154.  *  any subobjects must be read inside of your TQ3XObjectReadDataMethod. There 
  155.  *  is an implicit state contained in the file while reading, which you must 
  156.  *  be aware of. When you first enter the read method, you must physically 
  157.  *  read in your data format using the primitives routines until
  158.  *  
  159.  *  Q3File_IsEndOfData(file) == kQ3True
  160.  *  
  161.  *  Generally, your data format should be self-descriptive such that you do not
  162.  *  need to call Q3File_IsEndOfData to determine if you are done reading. 
  163.  *  However, this call is useful for determining zero-sized object or 
  164.  *  determining the end of an object's data.
  165.  *  
  166.  *  Once you have read in all the data, you may collect subobjects. A metafile
  167.  *  object ONLY has subobjects if it is in a container. The call
  168.  *  
  169.  *  Q3File_IsEndOfContainer(file)
  170.  *  
  171.  *  returns kQ3False if subobjects exist, and kQ3True if subobjects do not 
  172.  *  exist.
  173.  *  
  174.  *  At this point, you may use
  175.  *  
  176.  *  Q3File_GetNextObjectType
  177.  *  Q3File_IsNextObjectOfType
  178.  *  Q3File_ReadObject
  179.  *  Q3File_SkipObject
  180.  *  
  181.  *  to iterate through the subobjects until Q3File_IsEndOfContainer(file) 
  182.  *  is kQ3True.
  183.  * 
  184.  */
  185. /*
  186.  * IO Methods
  187.  */
  188. enum {
  189.     kQ3XMethodTypeObjectFileVersion = FOUR_CHAR_CODE('vers'),   /* version */
  190.     kQ3XMethodTypeObjectTraverse = FOUR_CHAR_CODE('trvs'),      /* byte count */
  191.     kQ3XMethodTypeObjectTraverseData = FOUR_CHAR_CODE('trvd'),  /* byte count */
  192.     kQ3XMethodTypeObjectWrite   = FOUR_CHAR_CODE('writ'),       /* Dump info to file */
  193.     kQ3XMethodTypeObjectReadData = FOUR_CHAR_CODE('rddt'),      /* Read info from file into buffer or, attach read data to parent */
  194.     kQ3XMethodTypeObjectRead    = FOUR_CHAR_CODE('read'),
  195.     kQ3XMethodTypeObjectAttach  = FOUR_CHAR_CODE('attc')
  196. };
  197. /*
  198.  *  TQ3XObjectTraverseMethod
  199.  *
  200.  *  For "elements" (meaning "attributes, too), you will be passed NULL for 
  201.  *  object. Sorry, custom objects will be available in the next major revision.
  202.  *
  203.  *  The "data" is a pointer to your internal element data.
  204.  *
  205.  *  The view is the current traversal view.
  206.  */
  207. typedef CALLBACK_API_C( TQ3Status , TQ3XObjectTraverseMethod )(TQ3Object object, void *data, TQ3ViewObject view);
  208. /*
  209.  *  TQ3XObjectTraverseDataMethod
  210.  */
  211. typedef CALLBACK_API_C( TQ3Status , TQ3XObjectTraverseDataMethod )(TQ3Object object, void *data, TQ3ViewObject view);
  212. /*
  213.  *  TQ3XObjectWriteMethod
  214.  */
  215. typedef CALLBACK_API_C( TQ3Status , TQ3XObjectWriteMethod )(const void *object, TQ3FileObject theFile);
  216. /*
  217.  *  Custom object writing 
  218.  */
  219. typedef CALLBACK_API_C( void , TQ3XDataDeleteMethod )(void *data);
  220. #if CALL_NOT_IN_CARBON
  221. EXTERN_API_C( TQ3Status )
  222. Q3XView_SubmitWriteData         (TQ3ViewObject          view,
  223.                                  TQ3Size                size,
  224.                                  void *                 data,
  225.                                  TQ3XDataDeleteMethod   deleteData);
  226. EXTERN_API_C( TQ3Status )
  227. Q3XView_SubmitSubObjectData     (TQ3ViewObject          view,
  228.                                  TQ3XObjectClass        objectClass,
  229.                                  unsigned long          size,
  230.                                  void *                 data,
  231.                                  TQ3XDataDeleteMethod   deleteData);
  232. /*
  233.  *  TQ3XObjectReadMethod
  234.  */
  235. #endif  /* CALL_NOT_IN_CARBON */
  236. typedef CALLBACK_API_C( TQ3Object , TQ3XObjectReadMethod )(TQ3FileObject theFile);
  237. /*
  238.  *  TQ3XObjectReadDataMethod
  239.  *
  240.  *  For "elements" (meaning "attributes", too), you must allocate stack space 
  241.  *  and call Q3Set_Add on "parentObject", which is an TQ3SetObject.
  242.  *
  243.  *  Otherwise, parentObject is whatever object your element is a subobject of...
  244.  */
  245. typedef CALLBACK_API_C( TQ3Status , TQ3XObjectReadDataMethod )(TQ3Object parentObject, TQ3FileObject theFile);
  246. /*
  247.  *  TQ3XObjectAttachMethod
  248.  */
  249. typedef CALLBACK_API_C( TQ3Status , TQ3XObjectAttachMethod )(TQ3Object childObject, TQ3Object parentObject);
  250. /******************************************************************************
  251.  **                                                                          **
  252.  **                             Versioning                                   **
  253.  **                                                                          **
  254.  *****************************************************************************/
  255. #define Q3FileVersion(majorVersion, minorVersion)  (TQ3FileVersion) 
  256.  ((((TQ3Uns32) majorVersion & 0xFFFF) << 16) | ((TQ3Uns32) minorVersion & 0xFFFF))
  257. typedef unsigned long                   TQ3FileVersion;
  258. #define kQ3FileVersionCurrent   Q3FileVersion(1,6)
  259. /******************************************************************************
  260.  **                                                                          **
  261.  **                             File Routines                                **
  262.  **                                                                          **
  263.  *****************************************************************************/
  264. /*
  265.  * Creation and accessors
  266.  */
  267. #if CALL_NOT_IN_CARBON
  268. EXTERN_API_C( TQ3FileObject )
  269. Q3File_New                      (void);
  270. EXTERN_API_C( TQ3Status )
  271. Q3File_GetStorage               (TQ3FileObject          theFile,
  272.                                  TQ3StorageObject *     storage);
  273. EXTERN_API_C( TQ3Status )
  274. Q3File_SetStorage               (TQ3FileObject          theFile,
  275.                                  TQ3StorageObject       storage);
  276. /*
  277.  * Opening, and accessing "open" state, closing/cancelling
  278.  */
  279. EXTERN_API_C( TQ3Status )
  280. Q3File_OpenRead                 (TQ3FileObject          theFile,
  281.                                  TQ3FileMode *          mode);
  282. EXTERN_API_C( TQ3Status )
  283. Q3File_OpenWrite                (TQ3FileObject          theFile,
  284.                                  TQ3FileMode            mode);
  285. EXTERN_API_C( TQ3Status )
  286. Q3File_IsOpen                   (TQ3FileObject          theFile,
  287.                                  TQ3Boolean *           isOpen);
  288. EXTERN_API_C( TQ3Status )
  289. Q3File_GetMode                  (TQ3FileObject          theFile,
  290.                                  TQ3FileMode *          mode);
  291. EXTERN_API_C( TQ3Status )
  292. Q3File_GetVersion               (TQ3FileObject          theFile,
  293.                                  TQ3FileVersion *       version);
  294. EXTERN_API_C( TQ3Status )
  295. Q3File_Close                    (TQ3FileObject          theFile);
  296. EXTERN_API_C( TQ3Status )
  297. Q3File_Cancel                   (TQ3FileObject          theFile);
  298. /*
  299.  * Writing (Application)
  300.  */
  301. EXTERN_API_C( TQ3Status )
  302. Q3View_StartWriting             (TQ3ViewObject          view,
  303.                                  TQ3FileObject          theFile);
  304. EXTERN_API_C( TQ3ViewStatus )
  305. Q3View_EndWriting               (TQ3ViewObject          view);
  306. /*
  307.  * Reading (Application)
  308.  */
  309. EXTERN_API_C( TQ3ObjectType )
  310. Q3File_GetNextObjectType        (TQ3FileObject          theFile);
  311. EXTERN_API_C( TQ3Boolean )
  312. Q3File_IsNextObjectOfType       (TQ3FileObject          theFile,
  313.                                  TQ3ObjectType          ofType);
  314. EXTERN_API_C( TQ3Object )
  315. Q3File_ReadObject               (TQ3FileObject          theFile);
  316. EXTERN_API_C( TQ3Status )
  317. Q3File_SkipObject               (TQ3FileObject          theFile);
  318. EXTERN_API_C( TQ3Boolean )
  319. Q3File_IsEndOfData              (TQ3FileObject          theFile);
  320. EXTERN_API_C( TQ3Boolean )
  321. Q3File_IsEndOfContainer         (TQ3FileObject          theFile,
  322.                                  TQ3Object              rootObject);
  323. EXTERN_API_C( TQ3Boolean )
  324. Q3File_IsEndOfFile              (TQ3FileObject          theFile);
  325. /*    
  326.  *  External file references
  327.  */
  328. EXTERN_API_C( TQ3Status )
  329. Q3File_MarkAsExternalReference  (TQ3FileObject          theFile,
  330.                                  TQ3SharedObject        sharedObject);
  331. EXTERN_API_C( TQ3GroupObject )
  332. Q3File_GetExternalReferences    (TQ3FileObject          theFile);
  333. /*    
  334.  *  Tracking editing in read-in objects with custom elements
  335.  */
  336. EXTERN_API_C( TQ3Status )
  337. Q3Shared_ClearEditTracking      (TQ3SharedObject        sharedObject);
  338. EXTERN_API_C( TQ3Boolean )
  339. Q3Shared_GetEditTrackingState   (TQ3SharedObject        sharedObject);
  340. /*    
  341.  *  Reading objects inside a group one-by-one
  342.  */
  343. #endif  /* CALL_NOT_IN_CARBON */
  344. enum TQ3FileReadGroupStateMasks {
  345.     kQ3FileReadWholeGroup       = 0,
  346.     kQ3FileReadObjectsInGroup   = 1 << 0,
  347.     kQ3FileCurrentlyInsideGroup = 1 << 1
  348. };
  349. typedef enum TQ3FileReadGroupStateMasks TQ3FileReadGroupStateMasks;
  350. typedef unsigned long                   TQ3FileReadGroupState;
  351. #if CALL_NOT_IN_CARBON
  352. EXTERN_API_C( TQ3Status )
  353. Q3File_SetReadInGroup           (TQ3FileObject          theFile,
  354.                                  TQ3FileReadGroupState  readGroupState);
  355. EXTERN_API_C( TQ3Status )
  356. Q3File_GetReadInGroup           (TQ3FileObject          theFile,
  357.                                  TQ3FileReadGroupState * readGroupState);
  358. /*
  359.  * Idling
  360.  */
  361. #endif  /* CALL_NOT_IN_CARBON */
  362. typedef CALLBACK_API_C( TQ3Status , TQ3FileIdleMethod )(TQ3FileObject theFile, const void *idlerData);
  363. #if CALL_NOT_IN_CARBON
  364. EXTERN_API_C( TQ3Status )
  365. Q3File_SetIdleMethod            (TQ3FileObject          theFile,
  366.                                  TQ3FileIdleMethod      idle,
  367.                                  const void *           idleData);
  368. /******************************************************************************
  369.  **                                                                          **
  370.  **                             Primitives Routines                          **
  371.  **                                                                          **
  372.  *****************************************************************************/
  373. EXTERN_API_C( TQ3Status )
  374. Q3NewLine_Write                 (TQ3FileObject          theFile);
  375. EXTERN_API_C( TQ3Status )
  376. Q3Uns8_Read                     (TQ3Uns8 *              data,
  377.                                  TQ3FileObject          theFile);
  378. EXTERN_API_C( TQ3Status )
  379. Q3Uns8_Write                    (TQ3Uns8                data,
  380.                                  TQ3FileObject          theFile);
  381. EXTERN_API_C( TQ3Status )
  382. Q3Uns16_Read                    (TQ3Uns16 *             data,
  383.                                  TQ3FileObject          theFile);
  384. EXTERN_API_C( TQ3Status )
  385. Q3Uns16_Write                   (TQ3Uns16               data,
  386.                                  TQ3FileObject          theFile);
  387. EXTERN_API_C( TQ3Status )
  388. Q3Uns32_Read                    (TQ3Uns32 *             data,
  389.                                  TQ3FileObject          theFile);
  390. EXTERN_API_C( TQ3Status )
  391. Q3Uns32_Write                   (TQ3Uns32               data,
  392.                                  TQ3FileObject          theFile);
  393. EXTERN_API_C( TQ3Status )
  394. Q3Int8_Read                     (TQ3Int8 *              data,
  395.                                  TQ3FileObject          theFile);
  396. EXTERN_API_C( TQ3Status )
  397. Q3Int8_Write                    (TQ3Int8                data,
  398.                                  TQ3FileObject          theFile);
  399. EXTERN_API_C( TQ3Status )
  400. Q3Int16_Read                    (TQ3Int16 *             data,
  401.                                  TQ3FileObject          theFile);
  402. EXTERN_API_C( TQ3Status )
  403. Q3Int16_Write                   (TQ3Int16               data,
  404.                                  TQ3FileObject          theFile);
  405. EXTERN_API_C( TQ3Status )
  406. Q3Int32_Read                    (TQ3Int32 *             data,
  407.                                  TQ3FileObject          theFile);
  408. EXTERN_API_C( TQ3Status )
  409. Q3Int32_Write                   (TQ3Int32               data,
  410.                                  TQ3FileObject          theFile);
  411. EXTERN_API_C( TQ3Status )
  412. Q3Uns64_Read                    (TQ3Uns64 *             data,
  413.                                  TQ3FileObject          theFile);
  414. EXTERN_API_C( TQ3Status )
  415. Q3Uns64_Write                   (TQ3Uns64               data,
  416.                                  TQ3FileObject          theFile);
  417. EXTERN_API_C( TQ3Status )
  418. Q3Int64_Read                    (TQ3Int64 *             data,
  419.                                  TQ3FileObject          theFile);
  420. EXTERN_API_C( TQ3Status )
  421. Q3Int64_Write                   (TQ3Int64               data,
  422.                                  TQ3FileObject          theFile);
  423. EXTERN_API_C( TQ3Status )
  424. Q3Float32_Read                  (TQ3Float32 *           data,
  425.                                  TQ3FileObject          theFile);
  426. EXTERN_API_C( TQ3Status )
  427. Q3Float32_Write                 (TQ3Float32             data,
  428.                                  TQ3FileObject          theFile);
  429. EXTERN_API_C( TQ3Status )
  430. Q3Float64_Read                  (TQ3Float64 *           data,
  431.                                  TQ3FileObject          theFile);
  432. EXTERN_API_C( TQ3Status )
  433. Q3Float64_Write                 (TQ3Float64             data,
  434.                                  TQ3FileObject          theFile);
  435. EXTERN_API_C( TQ3Size )
  436. Q3Size_Pad                      (TQ3Size                size);
  437. /*
  438.  * Pass a pointer to a buffer of kQ3StringMaximumLength bytes
  439.  */
  440. EXTERN_API_C( TQ3Status )
  441. Q3String_Read                   (char *                 data,
  442.                                  unsigned long *        length,
  443.                                  TQ3FileObject          theFile);
  444. EXTERN_API_C( TQ3Status )
  445. Q3String_Write                  (const char *           data,
  446.                                  TQ3FileObject          theFile);
  447. /* 
  448.  * This call will read Q3Size_Pad(size) bytes,
  449.  *  but only place size bytes into data.
  450.  */
  451. EXTERN_API_C( TQ3Status )
  452. Q3RawData_Read                  (unsigned char *        data,
  453.                                  unsigned long          size,
  454.                                  TQ3FileObject          theFile);
  455. /* 
  456.  * This call will write Q3Size_Pad(size) bytes,
  457.  *  adding 0's to pad to the nearest 4 byte boundary.
  458.  */
  459. EXTERN_API_C( TQ3Status )
  460. Q3RawData_Write                 (const unsigned char *  data,
  461.                                  unsigned long          size,
  462.                                  TQ3FileObject          theFile);
  463. /******************************************************************************
  464.  **                                                                          **
  465.  **                     Convenient Primitives Routines                       **
  466.  **                                                                          **
  467.  *****************************************************************************/
  468. EXTERN_API_C( TQ3Status )
  469. Q3Point2D_Read                  (TQ3Point2D *           point2D,
  470.                                  TQ3FileObject          theFile);
  471. EXTERN_API_C( TQ3Status )
  472. Q3Point2D_Write                 (const TQ3Point2D *     point2D,
  473.                                  TQ3FileObject          theFile);
  474. EXTERN_API_C( TQ3Status )
  475. Q3Point3D_Read                  (TQ3Point3D *           point3D,
  476.                                  TQ3FileObject          theFile);
  477. EXTERN_API_C( TQ3Status )
  478. Q3Point3D_Write                 (const TQ3Point3D *     point3D,
  479.                                  TQ3FileObject          theFile);
  480. EXTERN_API_C( TQ3Status )
  481. Q3RationalPoint3D_Read          (TQ3RationalPoint3D *   point3D,
  482.                                  TQ3FileObject          theFile);
  483. EXTERN_API_C( TQ3Status )
  484. Q3RationalPoint3D_Write         (const TQ3RationalPoint3D * point3D,
  485.                                  TQ3FileObject          theFile);
  486. EXTERN_API_C( TQ3Status )
  487. Q3RationalPoint4D_Read          (TQ3RationalPoint4D *   point4D,
  488.                                  TQ3FileObject          theFile);
  489. EXTERN_API_C( TQ3Status )
  490. Q3RationalPoint4D_Write         (const TQ3RationalPoint4D * point4D,
  491.                                  TQ3FileObject          theFile);
  492. EXTERN_API_C( TQ3Status )
  493. Q3Vector2D_Read                 (TQ3Vector2D *          vector2D,
  494.                                  TQ3FileObject          theFile);
  495. EXTERN_API_C( TQ3Status )
  496. Q3Vector2D_Write                (const TQ3Vector2D *    vector2D,
  497.                                  TQ3FileObject          theFile);
  498. EXTERN_API_C( TQ3Status )
  499. Q3Vector3D_Read                 (TQ3Vector3D *          vector3D,
  500.                                  TQ3FileObject          theFile);
  501. EXTERN_API_C( TQ3Status )
  502. Q3Vector3D_Write                (const TQ3Vector3D *    vector3D,
  503.                                  TQ3FileObject          theFile);
  504. EXTERN_API_C( TQ3Status )
  505. Q3Matrix4x4_Read                (TQ3Matrix4x4 *         matrix4x4,
  506.                                  TQ3FileObject          theFile);
  507. EXTERN_API_C( TQ3Status )
  508. Q3Matrix4x4_Write               (const TQ3Matrix4x4 *   matrix4x4,
  509.                                  TQ3FileObject          theFile);
  510. EXTERN_API_C( TQ3Status )
  511. Q3Tangent2D_Read                (TQ3Tangent2D *         tangent2D,
  512.                                  TQ3FileObject          theFile);
  513. EXTERN_API_C( TQ3Status )
  514. Q3Tangent2D_Write               (const TQ3Tangent2D *   tangent2D,
  515.                                  TQ3FileObject          theFile);
  516. EXTERN_API_C( TQ3Status )
  517. Q3Tangent3D_Read                (TQ3Tangent3D *         tangent3D,
  518.                                  TQ3FileObject          theFile);
  519. EXTERN_API_C( TQ3Status )
  520. Q3Tangent3D_Write               (const TQ3Tangent3D *   tangent3D,
  521.                                  TQ3FileObject          theFile);
  522. /*  This call affects only text Files - it is a no-op in binary files */
  523. EXTERN_API_C( TQ3Status )
  524. Q3Comment_Write                 (char *                 comment,
  525.                                  TQ3FileObject          theFile);
  526. /******************************************************************************
  527.  **                                                                          **
  528.  **                             Unknown Object                               **
  529.  **                                                                          **
  530.  **     Unknown objects are generated when reading files which contain       **
  531.  **     custom data which has not been registered in the current             **
  532.  **     instantiation of QuickDraw 3D.                                       **
  533.  **                                                                          **
  534.  *****************************************************************************/
  535. EXTERN_API_C( TQ3ObjectType )
  536. Q3Unknown_GetType               (TQ3UnknownObject       unknownObject);
  537. EXTERN_API_C( TQ3Status )
  538. Q3Unknown_GetDirtyState         (TQ3UnknownObject       unknownObject,
  539.                                  TQ3Boolean *           isDirty);
  540. EXTERN_API_C( TQ3Status )
  541. Q3Unknown_SetDirtyState         (TQ3UnknownObject       unknownObject,
  542.                                  TQ3Boolean             isDirty);
  543. /******************************************************************************
  544.  **                                                                          **
  545.  **                         Unknown Text Routines                            **
  546.  **                                                                          **
  547.  *****************************************************************************/
  548. #endif  /* CALL_NOT_IN_CARBON */
  549. struct TQ3UnknownTextData {
  550.     char *                          objectName;                 /* '' terminated */
  551.     char *                          contents;                   /* '' terminated */
  552. };
  553. typedef struct TQ3UnknownTextData       TQ3UnknownTextData;
  554. #if CALL_NOT_IN_CARBON
  555. EXTERN_API_C( TQ3Status )
  556. Q3UnknownText_GetData           (TQ3UnknownObject       unknownObject,
  557.                                  TQ3UnknownTextData *   unknownTextData);
  558. EXTERN_API_C( TQ3Status )
  559. Q3UnknownText_EmptyData         (TQ3UnknownTextData *   unknownTextData);
  560. /******************************************************************************
  561.  **                                                                          **
  562.  **                         Unknown Binary Routines                          **
  563.  **                                                                          **
  564.  *****************************************************************************/
  565. #endif  /* CALL_NOT_IN_CARBON */
  566. struct TQ3UnknownBinaryData {
  567.     TQ3ObjectType                   objectType;
  568.     unsigned long                   size;
  569.     TQ3Endian                       byteOrder;
  570.     char *                          contents;
  571. };
  572. typedef struct TQ3UnknownBinaryData     TQ3UnknownBinaryData;
  573. #if CALL_NOT_IN_CARBON
  574. EXTERN_API_C( TQ3Status )
  575. Q3UnknownBinary_GetData         (TQ3UnknownObject       unknownObject,
  576.                                  TQ3UnknownBinaryData * unknownBinaryData);
  577. EXTERN_API_C( TQ3Status )
  578. Q3UnknownBinary_EmptyData       (TQ3UnknownBinaryData * unknownBinaryData);
  579. #endif  /* CALL_NOT_IN_CARBON */
  580. #if CALL_NOT_IN_CARBON
  581. EXTERN_API_C( TQ3Status )
  582. Q3UnknownBinary_GetTypeString   (TQ3UnknownObject       unknownObject,
  583.                                  char **                typeString);
  584. EXTERN_API_C( TQ3Status )
  585. Q3UnknownBinary_EmptyTypeString (char **                typeString);
  586. #endif  /* CALL_NOT_IN_CARBON */
  587. /******************************************************************************
  588.  **                                                                          **
  589.  **                         ViewHints routines                               **
  590.  **                                                                          **
  591.  **     ViewHints are an object in a metafile to give you some hints on how  **
  592.  **     to render a scene.  You may create a view with any of the objects    **
  593.  **     retrieved from it, or you can just throw it away.                    **
  594.  **                                                                          **
  595.  **     To write a view hints to a file, create a view hints object from a   **
  596.  **     view and write the view hints.                                       **
  597.  **                                                                          **
  598.  *****************************************************************************/
  599. #if CALL_NOT_IN_CARBON
  600. EXTERN_API_C( TQ3ViewHintsObject )
  601. Q3ViewHints_New                 (TQ3ViewObject          view);
  602. EXTERN_API_C( TQ3Status )
  603. Q3ViewHints_SetRenderer         (TQ3ViewHintsObject     viewHints,
  604.                                  TQ3RendererObject      renderer);
  605. EXTERN_API_C( TQ3Status )
  606. Q3ViewHints_GetRenderer         (TQ3ViewHintsObject     viewHints,
  607.                                  TQ3RendererObject *    renderer);
  608. EXTERN_API_C( TQ3Status )
  609. Q3ViewHints_SetCamera           (TQ3ViewHintsObject     viewHints,
  610.                                  TQ3CameraObject        camera);
  611. EXTERN_API_C( TQ3Status )
  612. Q3ViewHints_GetCamera           (TQ3ViewHintsObject     viewHints,
  613.                                  TQ3CameraObject *      camera);
  614. EXTERN_API_C( TQ3Status )
  615. Q3ViewHints_SetLightGroup       (TQ3ViewHintsObject     viewHints,
  616.                                  TQ3GroupObject         lightGroup);
  617. EXTERN_API_C( TQ3Status )
  618. Q3ViewHints_GetLightGroup       (TQ3ViewHintsObject     viewHints,
  619.                                  TQ3GroupObject *       lightGroup);
  620. EXTERN_API_C( TQ3Status )
  621. Q3ViewHints_SetAttributeSet     (TQ3ViewHintsObject     viewHints,
  622.                                  TQ3AttributeSet        attributeSet);
  623. EXTERN_API_C( TQ3Status )
  624. Q3ViewHints_GetAttributeSet     (TQ3ViewHintsObject     viewHints,
  625.                                  TQ3AttributeSet *      attributeSet);
  626. EXTERN_API_C( TQ3Status )
  627. Q3ViewHints_SetDimensionsState  (TQ3ViewHintsObject     viewHints,
  628.                                  TQ3Boolean             isValid);
  629. EXTERN_API_C( TQ3Status )
  630. Q3ViewHints_GetDimensionsState  (TQ3ViewHintsObject     viewHints,
  631.                                  TQ3Boolean *           isValid);
  632. EXTERN_API_C( TQ3Status )
  633. Q3ViewHints_SetDimensions       (TQ3ViewHintsObject     viewHints,
  634.                                  unsigned long          width,
  635.                                  unsigned long          height);
  636. EXTERN_API_C( TQ3Status )
  637. Q3ViewHints_GetDimensions       (TQ3ViewHintsObject     viewHints,
  638.                                  unsigned long *        width,
  639.                                  unsigned long *        height);
  640. EXTERN_API_C( TQ3Status )
  641. Q3ViewHints_SetMaskState        (TQ3ViewHintsObject     viewHints,
  642.                                  TQ3Boolean             isValid);
  643. EXTERN_API_C( TQ3Status )
  644. Q3ViewHints_GetMaskState        (TQ3ViewHintsObject     viewHints,
  645.                                  TQ3Boolean *           isValid);
  646. EXTERN_API_C( TQ3Status )
  647. Q3ViewHints_SetMask             (TQ3ViewHintsObject     viewHints,
  648.                                  const TQ3Bitmap *      mask);
  649. EXTERN_API_C( TQ3Status )
  650. Q3ViewHints_GetMask             (TQ3ViewHintsObject     viewHints,
  651.                                  TQ3Bitmap *            mask);
  652. /* Call Q3Bitmap_Empty when done with the mask  */
  653. EXTERN_API_C( TQ3Status )
  654. Q3ViewHints_SetClearImageMethod (TQ3ViewHintsObject     viewHints,
  655.                                  TQ3DrawContextClearImageMethod  clearMethod);
  656. EXTERN_API_C( TQ3Status )
  657. Q3ViewHints_GetClearImageMethod (TQ3ViewHintsObject     viewHints,
  658.                                  TQ3DrawContextClearImageMethod * clearMethod);
  659. EXTERN_API_C( TQ3Status )
  660. Q3ViewHints_SetClearImageColor  (TQ3ViewHintsObject     viewHints,
  661.                                  const TQ3ColorARGB *   color);
  662. EXTERN_API_C( TQ3Status )
  663. Q3ViewHints_GetClearImageColor  (TQ3ViewHintsObject     viewHints,
  664.                                  TQ3ColorARGB *         color);
  665. #endif  /* CALL_NOT_IN_CARBON */
  666. #if PRAGMA_ENUM_ALWAYSINT
  667.     #pragma enumsalwaysint reset
  668.     #ifdef __QD3DIO__RESTORE_TWOBYTEINTS
  669.         #pragma fourbyteints off
  670.     #endif
  671. #elif PRAGMA_ENUM_OPTIONS
  672.     #pragma option enum=reset
  673. #elif defined(__QD3DIO__RESTORE_PACKED_ENUMS)
  674.     #pragma options(pack_enums)
  675. #endif
  676. #if PRAGMA_STRUCT_ALIGN
  677.     #pragma options align=reset
  678. #elif PRAGMA_STRUCT_PACKPUSH
  679.     #pragma pack(pop)
  680. #elif PRAGMA_STRUCT_PACK
  681.     #pragma pack()
  682. #endif
  683. #ifdef PRAGMA_IMPORT_OFF
  684. #pragma import off
  685. #elif PRAGMA_IMPORT
  686. #pragma import reset
  687. #endif
  688. #ifdef __cplusplus
  689. }
  690. #endif
  691. #endif /* __QD3DIO__ */