summaryrefslogtreecommitdiff
path: root/common/quicktime_win32/QD3DOld.h
blob: 7b89385943d0fe6dd2f876813406a1a53c186adc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
/*
     File:       QD3DOld.h
 
     Contains:   Obsolete API for Quickdraw 3D that QuickTime still uses
 
     Version:    Technology: Quickdraw 3D 1.5.1
                 Release:    QuickTime 7.3
 
     Copyright:  (c) 2007 (c) 1995-1998 by Apple Computer, Inc., all rights reserved.
 
     Bugs?:      For bug reports, consult the following page on
                 the World Wide Web:
 
                     http://developer.apple.com/bugreporter/
 
*/
#ifndef __QD3DOLD__
#define __QD3DOLD__

#ifndef __CONDITIONALMACROS__
#include <ConditionalMacros.h>
#endif


#if TARGET_OS_MAC
#ifndef __MACTYPES__
#include <MacTypes.h>
#endif

#endif  /* TARGET_OS_MAC */

#ifndef __QD3D__
#include <QD3D.h>
#endif

#ifndef __QD3DPICK__
#include <QD3DPick.h>
#endif

#ifndef __QD3DRENDERER__
#include <QD3DRenderer.h>
#endif

#ifndef __QD3DIO__
#include <QD3DIO.h>
#endif




#if PRAGMA_ONCE
#pragma once
#endif

#ifdef __cplusplus
extern "C" {
#endif

#if PRAGMA_IMPORT
#pragma import on
#endif

#if PRAGMA_STRUCT_ALIGN
    #pragma options align=power
#elif PRAGMA_STRUCT_PACKPUSH
    #pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
    #pragma pack(2)
#endif

#if PRAGMA_ENUM_ALWAYSINT
    #if defined(__fourbyteints__) && !__fourbyteints__ 
        #define __QD3DOLD__RESTORE_TWOBYTEINTS
        #pragma fourbyteints on
    #endif
    #pragma enumsalwaysint on
#elif PRAGMA_ENUM_OPTIONS
    #pragma option enum=int
#elif PRAGMA_ENUM_PACK
    #if __option(pack_enums)
        #define __QD3DOLD__RESTORE_PACKED_ENUMS
        #pragma options(!pack_enums)
    #endif
#endif

/******************************************************************************
 **                                                                          **
 **                     Obsolete Object System Types                         **
 **                         from QD3D.i                                      **
 **                                                                          **
 *****************************************************************************/
typedef struct OpaqueTQ3ObjectClass*    TQ3ObjectClass;
typedef unsigned long                   TQ3MethodType;
/*
 * Object methods
 */
#define kQ3MethodTypeObjectUnregister       Q3_METHOD_TYPE('u','n','r','g')
/*
 * IO Methods
 */
#define kQ3MethodTypeObjectFileVersion      Q3_METHOD_TYPE('v','e','r','s') /* version */
#define kQ3MethodTypeObjectTraverse         Q3_METHOD_TYPE('t','r','v','s') /* byte count */
#define kQ3MethodTypeObjectTraverseData     Q3_METHOD_TYPE('t','r','v','d') /* byte count */
#define kQ3MethodTypeObjectWrite            Q3_METHOD_TYPE('w','r','i','t') /* Dump info to file */
#define kQ3MethodTypeObjectReadData         Q3_METHOD_TYPE('r','d','d','t') /* Read info from file into buffer or, attach read data to parent */ 
typedef CALLBACK_API_C( void , TQ3FunctionPointer )(void);
typedef CALLBACK_API_C( TQ3FunctionPointer , TQ3MetaHandler )(TQ3MethodType methodType);
/*
 * MetaHandler:
 *      When you give a metahandler to QuickDraw 3D, it is called multiple times to
 *      build method tables, and then is thrown away. You are guaranteed that
 *      your metahandler will never be called again after a call that was passed
 *      a metahandler returns.
 *
 *      Your metahandler should contain a switch on the methodType passed to it
 *      and should return the corresponding method as an TQ3FunctionPointer.
 *
 *      IMPORTANT: A metaHandler MUST always "return" a value. If you are
 *      passed a methodType that you do not understand, ALWAYS return NULL.
 *
 *      These types here are prototypes of how your functions should look.
 */
typedef CALLBACK_API_C( TQ3Status , TQ3ObjectUnregisterMethod )(TQ3ObjectClass objectClass);
/******************************************************************************
 **                                                                          **
 **                     Obsolete ObjectClass Routines                        **
 **                         from QD3D.i                                      **
 **                                                                          **
 *****************************************************************************/
/*
 *  Q3ObjectClass_Unregister is an obsolete function.  For the new extensions 
 *  model you should now use Q3XObjectHierarchy_UnregisterClass which is 
 *  defined in QD3DExtension.h and takes identical parameters.
 */
#if CALL_NOT_IN_CARBON
/*
 *  Q3ObjectClass_Unregister()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API_C( TQ3Status )
Q3ObjectClass_Unregister(TQ3ObjectClass objectClass);




/******************************************************************************
 **                                                                          **
 **                 Obsolete Custom Element Registration                     **
 **                         from QD3DSet.i                                   **
 **                                                                          **
 *****************************************************************************/
#define kQ3MethodTypeElementCopyAdd         Q3_METHOD_TYPE('e','c','p','a')
#define kQ3MethodTypeElementCopyReplace     Q3_METHOD_TYPE('e','c','p','r')
#define kQ3MethodTypeElementCopyGet         Q3_METHOD_TYPE('e','c','p','g')
#define kQ3MethodTypeElementCopyDuplicate   Q3_METHOD_TYPE('e','c','p','d')
#define kQ3MethodTypeElementDelete          Q3_METHOD_TYPE('e','d','e','l')
#endif  /* CALL_NOT_IN_CARBON */

typedef CALLBACK_API_C( TQ3Status , TQ3ElementCopyAddMethod )(const void *fromAPIElement, void *toInternalElement);
typedef CALLBACK_API_C( TQ3Status , TQ3ElementCopyReplaceMethod )(const void *fromAPIElement, void *ontoInternalElement);
typedef CALLBACK_API_C( TQ3Status , TQ3ElementCopyGetMethod )(const void *fromInternalElement, void *toAPIElement);
typedef CALLBACK_API_C( TQ3Status , TQ3ElementCopyDuplicateMethod )(const void *fromInternalElement, void *toInternalElement);
typedef CALLBACK_API_C( TQ3Status , TQ3ElementDeleteMethod )(void * internalElement);
#if CALL_NOT_IN_CARBON
/*
 *  Q3ElementClass_Register()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API_C( TQ3ObjectClass )
Q3ElementClass_Register(
  TQ3ElementType   elementType,
  const char *     name,
  unsigned long    sizeOfElement,
  TQ3MetaHandler   metaHandler);


/*
 *  Q3ElementType_GetElementSize()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API_C( TQ3Status )
Q3ElementType_GetElementSize(
  TQ3ElementType   elementType,
  unsigned long *  sizeOfElement);



/******************************************************************************
 **                                                                          **
 **                 Obsolete QD3DPick.i API                                  **
 **                                                                          **
 *****************************************************************************/
/*
 *  The following data structure has been obsoleted by
 *  the Q3Pick_GetPickDetailData function in conjunction
 *  with the pickDetailValue enum
 */
#endif  /* CALL_NOT_IN_CARBON */

struct TQ3HitData {
  TQ3PickParts        part;
  TQ3PickDetail       validMask;
  unsigned long       pickID;
  TQ3HitPath          path;
  TQ3Object           object;
  TQ3Matrix4x4        localToWorldMatrix;
  TQ3Point3D          xyzPoint;
  float               distance;
  TQ3Vector3D         normal;
  TQ3ShapePartObject  shapePart;
};
typedef struct TQ3HitData               TQ3HitData;
/*
 *  The following functions have been superseeded
 *  by the Q3Pick_GetPickDetailData function
 */
#if CALL_NOT_IN_CARBON
/*
 *  Q3Pick_GetHitData()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API_C( TQ3Status )
Q3Pick_GetHitData(
  TQ3PickObject   pick,
  unsigned long   index,
  TQ3HitData *    hitData);


/*
 *  Q3Hit_EmptyData()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API_C( TQ3Status )
Q3Hit_EmptyData(TQ3HitData * hitData);


/******************************************************************************
 **                                                                          **
 **                 Obsolete QD3DRenderer.i API                              **
 **                                                                          **
 *****************************************************************************/
/*
 *  Blocking, flush all buffered graphics to rasterizer and update
 *  draw context.
 *  
 *  This function has been replaced by Q3View_Sync
 */
/*
 *  Q3Renderer_Sync()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API_C( TQ3Status )
Q3Renderer_Sync(
  TQ3RendererObject   renderer,
  TQ3ViewObject       view);



/******************************************************************************
 **                                                                          **
 **                     Obsolete QD3DIO.i API                                **
 **                                                                          **
 *****************************************************************************/
/*
 *  TQ3ObjectTraverseMethod
 *
 *  For "elements" (meaning "attributes, too), you will be passed NULL for 
 *  object. Sorry, custom objects will be available in the next major revision.
 *
 *  The "data" is a pointer to your internal element data.
 *
 *  The view is the current traversal view.
 */
#endif  /* CALL_NOT_IN_CARBON */

typedef CALLBACK_API_C( TQ3Status , TQ3ObjectTraverseMethod )(TQ3Object object, void *data, TQ3ViewObject view);
typedef CALLBACK_API_C( TQ3Status , TQ3ObjectWriteMethod )(const void *object, TQ3FileObject theFile);
/*
 *  Use Q3XView_SubmitWriteData instead...
 */
typedef CALLBACK_API_C( void , TQ3DataDeleteMethod )(void * data);
#if CALL_NOT_IN_CARBON
/*
 *  Q3View_SubmitWriteData()
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         not available
 */
EXTERN_API_C( TQ3Status )
Q3View_SubmitWriteData(
  TQ3ViewObject         view,
  TQ3Size               size,
  void *                data,
  TQ3DataDeleteMethod   deleteData);


/*
 *  TQ3ObjectReadDataMethod
 *
 *  For "elements" (meaning "attributes", too), you must allocate stack space 
 *  and call Q3Set_Add on "parentObject", which is an TQ3SetObject.
 *
 *  Otherwise, parentObject is whatever object your element is a subobject of...
 */
#endif  /* CALL_NOT_IN_CARBON */

typedef CALLBACK_API_C( TQ3Status , TQ3ObjectReadDataMethod )(TQ3Object parentObject, TQ3FileObject theFile);


#if PRAGMA_ENUM_ALWAYSINT
    #pragma enumsalwaysint reset
    #ifdef __QD3DOLD__RESTORE_TWOBYTEINTS
        #pragma fourbyteints off
    #endif
#elif PRAGMA_ENUM_OPTIONS
    #pragma option enum=reset
#elif defined(__QD3DOLD__RESTORE_PACKED_ENUMS)
    #pragma options(pack_enums)
#endif

#if PRAGMA_STRUCT_ALIGN
    #pragma options align=reset
#elif PRAGMA_STRUCT_PACKPUSH
    #pragma pack(pop)
#elif PRAGMA_STRUCT_PACK
    #pragma pack()
#endif

#ifdef PRAGMA_IMPORT_OFF
#pragma import off
#elif PRAGMA_IMPORT
#pragma import reset
#endif

#ifdef __cplusplus
}
#endif

#endif /* __QD3DOLD__ */