|
| typedef | CALLBACK_API_C (TQ3Status, TQ3XObjectTraverseMethod)(TQ3Object object |
| |
| typedef | CALLBACK_API_C (TQ3Status, TQ3XObjectTraverseDataMethod)(TQ3Object object |
| |
| typedef | CALLBACK_API_C (TQ3Status, TQ3XObjectWriteMethod)(const void *object |
| |
| typedef | CALLBACK_API_C (void, TQ3XDataDeleteMethod)(void *data) |
| |
| TQ3Status | Q3XView_SubmitWriteData (TQ3ViewObject view, TQ3Size size, void *data, TQ3XDataDeleteMethod deleteData) |
| |
| TQ3Status | Q3XView_SubmitSubObjectData (TQ3ViewObject view, TQ3XObjectClass objectClass, unsigned long size, void *data, TQ3XDataDeleteMethod deleteData) |
| |
| typedef | CALLBACK_API_C (TQ3Object, TQ3XObjectReadMethod)(TQ3FileObject theFile) |
| |
| typedef | CALLBACK_API_C (TQ3Status, TQ3XObjectReadDataMethod)(TQ3Object parentObject |
| |
| typedef | CALLBACK_API_C (TQ3Status, TQ3XObjectAttachMethod)(TQ3Object childObject |
| |
| TQ3FileObject | Q3File_New (void) |
| |
| TQ3Status | Q3File_GetStorage (TQ3FileObject theFile, TQ3StorageObject *storage) |
| |
| TQ3Status | Q3File_SetStorage (TQ3FileObject theFile, TQ3StorageObject storage) |
| |
| TQ3Status | Q3File_OpenRead (TQ3FileObject theFile, TQ3FileMode *mode) |
| |
| TQ3Status | Q3File_OpenWrite (TQ3FileObject theFile, TQ3FileMode mode) |
| |
| TQ3Status | Q3File_IsOpen (TQ3FileObject theFile, TQ3Boolean *isOpen) |
| |
| TQ3Status | Q3File_GetMode (TQ3FileObject theFile, TQ3FileMode *mode) |
| |
| TQ3Status | Q3File_GetVersion (TQ3FileObject theFile, TQ3FileVersion *version) |
| |
| TQ3Status | Q3File_Close (TQ3FileObject theFile) |
| |
| TQ3Status | Q3File_Cancel (TQ3FileObject theFile) |
| |
| TQ3Status | Q3View_StartWriting (TQ3ViewObject view, TQ3FileObject theFile) |
| |
| TQ3ViewStatus | Q3View_EndWriting (TQ3ViewObject view) |
| |
| TQ3ObjectType | Q3File_GetNextObjectType (TQ3FileObject theFile) |
| |
| TQ3Boolean | Q3File_IsNextObjectOfType (TQ3FileObject theFile, TQ3ObjectType ofType) |
| |
| TQ3Object | Q3File_ReadObject (TQ3FileObject theFile) |
| |
| TQ3Status | Q3File_SkipObject (TQ3FileObject theFile) |
| |
| TQ3Boolean | Q3File_IsEndOfData (TQ3FileObject theFile) |
| |
| TQ3Boolean | Q3File_IsEndOfContainer (TQ3FileObject theFile, TQ3Object rootObject) |
| |
| TQ3Boolean | Q3File_IsEndOfFile (TQ3FileObject theFile) |
| |
| TQ3Status | Q3File_MarkAsExternalReference (TQ3FileObject theFile, TQ3SharedObject sharedObject) |
| |
| TQ3GroupObject | Q3File_GetExternalReferences (TQ3FileObject theFile) |
| |
| TQ3Status | Q3Shared_ClearEditTracking (TQ3SharedObject sharedObject) |
| |
| TQ3Boolean | Q3Shared_GetEditTrackingState (TQ3SharedObject sharedObject) |
| |
| TQ3Status | Q3File_SetReadInGroup (TQ3FileObject theFile, TQ3FileReadGroupState readGroupState) |
| |
| TQ3Status | Q3File_GetReadInGroup (TQ3FileObject theFile, TQ3FileReadGroupState *readGroupState) |
| |
| typedef | CALLBACK_API_C (TQ3Status, TQ3FileIdleMethod)(TQ3FileObject theFile |
| |
| TQ3Status | Q3File_SetIdleMethod (TQ3FileObject theFile, TQ3FileIdleMethod idle, const void *idleData) |
| |
| TQ3Status | Q3NewLine_Write (TQ3FileObject theFile) |
| |
| TQ3Status | Q3Uns8_Read (TQ3Uns8 *data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Uns8_Write (TQ3Uns8 data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Uns16_Read (TQ3Uns16 *data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Uns16_Write (TQ3Uns16 data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Uns32_Read (TQ3Uns32 *data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Uns32_Write (TQ3Uns32 data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Int8_Read (TQ3Int8 *data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Int8_Write (TQ3Int8 data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Int16_Read (TQ3Int16 *data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Int16_Write (TQ3Int16 data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Int32_Read (TQ3Int32 *data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Int32_Write (TQ3Int32 data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Uns64_Read (TQ3Uns64 *data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Uns64_Write (TQ3Uns64 data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Int64_Read (TQ3Int64 *data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Int64_Write (TQ3Int64 data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Float32_Read (TQ3Float32 *data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Float32_Write (TQ3Float32 data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Float64_Read (TQ3Float64 *data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Float64_Write (TQ3Float64 data, TQ3FileObject theFile) |
| |
| TQ3Size | Q3Size_Pad (TQ3Size size) |
| |
| TQ3Status | Q3String_Read (char *data, unsigned long *length, TQ3FileObject theFile) |
| |
| TQ3Status | Q3String_Write (const char *data, TQ3FileObject theFile) |
| |
| TQ3Status | Q3RawData_Read (unsigned char *data, unsigned long size, TQ3FileObject theFile) |
| |
| TQ3Status | Q3RawData_Write (const unsigned char *data, unsigned long size, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Point2D_Read (TQ3Point2D *point2D, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Point2D_Write (const TQ3Point2D *point2D, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Point3D_Read (TQ3Point3D *point3D, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Point3D_Write (const TQ3Point3D *point3D, TQ3FileObject theFile) |
| |
| TQ3Status | Q3RationalPoint3D_Read (TQ3RationalPoint3D *point3D, TQ3FileObject theFile) |
| |
| TQ3Status | Q3RationalPoint3D_Write (const TQ3RationalPoint3D *point3D, TQ3FileObject theFile) |
| |
| TQ3Status | Q3RationalPoint4D_Read (TQ3RationalPoint4D *point4D, TQ3FileObject theFile) |
| |
| TQ3Status | Q3RationalPoint4D_Write (const TQ3RationalPoint4D *point4D, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Vector2D_Read (TQ3Vector2D *vector2D, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Vector2D_Write (const TQ3Vector2D *vector2D, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Vector3D_Read (TQ3Vector3D *vector3D, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Vector3D_Write (const TQ3Vector3D *vector3D, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Matrix4x4_Read (TQ3Matrix4x4 *matrix4x4, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Matrix4x4_Write (const TQ3Matrix4x4 *matrix4x4, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Tangent2D_Read (TQ3Tangent2D *tangent2D, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Tangent2D_Write (const TQ3Tangent2D *tangent2D, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Tangent3D_Read (TQ3Tangent3D *tangent3D, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Tangent3D_Write (const TQ3Tangent3D *tangent3D, TQ3FileObject theFile) |
| |
| TQ3Status | Q3Comment_Write (char *comment, TQ3FileObject theFile) |
| |
| TQ3ObjectType | Q3Unknown_GetType (TQ3UnknownObject unknownObject) |
| |
| TQ3Status | Q3Unknown_GetDirtyState (TQ3UnknownObject unknownObject, TQ3Boolean *isDirty) |
| |
| TQ3Status | Q3Unknown_SetDirtyState (TQ3UnknownObject unknownObject, TQ3Boolean isDirty) |
| |
| TQ3Status | Q3UnknownText_GetData (TQ3UnknownObject unknownObject, TQ3UnknownTextData *unknownTextData) |
| |
| TQ3Status | Q3UnknownText_EmptyData (TQ3UnknownTextData *unknownTextData) |
| |
| TQ3Status | Q3UnknownBinary_GetData (TQ3UnknownObject unknownObject, TQ3UnknownBinaryData *unknownBinaryData) |
| |
| TQ3Status | Q3UnknownBinary_EmptyData (TQ3UnknownBinaryData *unknownBinaryData) |
| |
| TQ3Status | Q3UnknownBinary_GetTypeString (TQ3UnknownObject unknownObject, char **typeString) |
| |
| TQ3Status | Q3UnknownBinary_EmptyTypeString (char **typeString) |
| |
| TQ3ViewHintsObject | Q3ViewHints_New (TQ3ViewObject view) |
| |
| TQ3Status | Q3ViewHints_SetRenderer (TQ3ViewHintsObject viewHints, TQ3RendererObject renderer) |
| |
| TQ3Status | Q3ViewHints_GetRenderer (TQ3ViewHintsObject viewHints, TQ3RendererObject *renderer) |
| |
| TQ3Status | Q3ViewHints_SetCamera (TQ3ViewHintsObject viewHints, TQ3CameraObject camera) |
| |
| TQ3Status | Q3ViewHints_GetCamera (TQ3ViewHintsObject viewHints, TQ3CameraObject *camera) |
| |
| TQ3Status | Q3ViewHints_SetLightGroup (TQ3ViewHintsObject viewHints, TQ3GroupObject lightGroup) |
| |
| TQ3Status | Q3ViewHints_GetLightGroup (TQ3ViewHintsObject viewHints, TQ3GroupObject *lightGroup) |
| |
| TQ3Status | Q3ViewHints_SetAttributeSet (TQ3ViewHintsObject viewHints, TQ3AttributeSet attributeSet) |
| |
| TQ3Status | Q3ViewHints_GetAttributeSet (TQ3ViewHintsObject viewHints, TQ3AttributeSet *attributeSet) |
| |
| TQ3Status | Q3ViewHints_SetDimensionsState (TQ3ViewHintsObject viewHints, TQ3Boolean isValid) |
| |
| TQ3Status | Q3ViewHints_GetDimensionsState (TQ3ViewHintsObject viewHints, TQ3Boolean *isValid) |
| |
| TQ3Status | Q3ViewHints_SetDimensions (TQ3ViewHintsObject viewHints, unsigned long width, unsigned long height) |
| |
| TQ3Status | Q3ViewHints_GetDimensions (TQ3ViewHintsObject viewHints, unsigned long *width, unsigned long *height) |
| |
| TQ3Status | Q3ViewHints_SetMaskState (TQ3ViewHintsObject viewHints, TQ3Boolean isValid) |
| |
| TQ3Status | Q3ViewHints_GetMaskState (TQ3ViewHintsObject viewHints, TQ3Boolean *isValid) |
| |
| TQ3Status | Q3ViewHints_SetMask (TQ3ViewHintsObject viewHints, const TQ3Bitmap *mask) |
| |
| TQ3Status | Q3ViewHints_GetMask (TQ3ViewHintsObject viewHints, TQ3Bitmap *mask) |
| |
| TQ3Status | Q3ViewHints_SetClearImageMethod (TQ3ViewHintsObject viewHints, TQ3DrawContextClearImageMethod clearMethod) |
| |
| TQ3Status | Q3ViewHints_GetClearImageMethod (TQ3ViewHintsObject viewHints, TQ3DrawContextClearImageMethod *clearMethod) |
| |
| TQ3Status | Q3ViewHints_SetClearImageColor (TQ3ViewHintsObject viewHints, const TQ3ColorARGB *color) |
| |
| TQ3Status | Q3ViewHints_GetClearImageColor (TQ3ViewHintsObject viewHints, TQ3ColorARGB *color) |
| |
QuickDraw 3D IO API.
- Introduced In: Quickdraw 3D 1.6
- Avaliable From: Universal Interfaces 3.4.1
- Copyright: © 1995-2001 by Apple Computer, Inc., all rights reserved.
For bug reports, consult the following page on the World Wide Web:
http://developer.apple.com/bugreporter/
IO Methods
The IO system treats all objects as groups of typed information. When you register your element or attribute, the "elementType" is the binary type of your object, the "elementName" the ascii type.
All objects in the metafile are made up of a "root" or parent object which defines the instantiated object type. You may define the format of your data any way you wish as long as you use the primitives types above and the routines below.
Root Objects are often appended with additional child objects, called subobjects. You may append your object with other QuickDraw 3D objects.
Writing is straightforward: an object traverses itself any other objects that make it up, then writes its own data. Writing uses two methods: TQ3XObjectTraverseMethod and TQ3XObjectWriteMethod.
The TQ3XObjectTraverseMethod method should:
- First, Determine if the data should be written
- if you don't want to write out your object after examining your data, return kQ3Success in your Traverse method without calling any other submit calls.
- Next, calculate the size of your object on disk
- Gather whatever state from the view you need to preserve
- you may access the view state NOW, as the state of the view duing your TQ3XObjectWriteMethod will not be valid. You may pass a temporary buffer to your write method.
- Submit your view write data using Q3View_SubmitWriteData
- note that you MUST call this before any other "_Submit" call.
- you may pass in a "deleteMethod" for your data. This method will be called whether or not your write method succeeds or fails.
- Submit your subobjects to the view
The TQ3XObjectWriteMethod method should:
- Write your data format to the file using the primitives routines below.
- If you passed a "deleteMethod" in your Q3View_SubmitWriteData, that method will be called upon exit of your write method.
Reading is less straightforward because your root object and any subobjects must be read inside of your TQ3XObjectReadDataMethod. There is an implicit state contained in the file while reading, which you must be aware of. When you first enter the read method, you must physically read in your data format using the primitives routines until
Q3File_IsEndOfData(file) == kQ3True
Generally, your data format should be self-descriptive such that you do not need to call Q3File_IsEndOfData to determine if you are done reading. However, this call is useful for determining zero-sized object or determining the end of an object's data.
Once you have read in all the data, you may collect subobjects. A metafile object ONLY has subobjects if it is in a container. The call
Q3File_IsEndOfContainer(file)
returns kQ3False if subobjects exist, and kQ3True if subobjects do not exist.
At this point, you may use
Q3File_GetNextObjectType Q3File_IsNextObjectOfType Q3File_ReadObject Q3File_SkipObject
to iterate through the subobjects until Q3File_IsEndOfContainer(file) is kQ3True. IO Methods
| Enumerator |
|---|
| kQ3XMethodTypeObjectTraverse | version
|
| kQ3XMethodTypeObjectTraverseData | byte count
|
| kQ3XMethodTypeObjectWrite | byte count
|
| kQ3XMethodTypeObjectReadData | Dump info to file
|
| kQ3XMethodTypeObjectRead | Read info from file into buffer or, attach read data to parent
|