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

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       QD3DErrors.h
  3.  
  4.      Contains:   Error API and error codes
  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 __QD3DERRORS__
  18. #define __QD3DERRORS__
  19. #ifndef __QD3D__
  20. #include "QD3D.h"
  21. #endif
  22. #if TARGET_OS_MAC
  23. #ifndef __MACTYPES__
  24. #include "MacTypes.h"
  25. #endif
  26. #endif  /* TARGET_OS_MAC */
  27. #if PRAGMA_ONCE
  28. #pragma once
  29. #endif
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. #if PRAGMA_IMPORT
  34. #pragma import on
  35. #endif
  36. #if PRAGMA_STRUCT_ALIGN
  37.     #pragma options align=power
  38. #elif PRAGMA_STRUCT_PACKPUSH
  39.     #pragma pack(push, 2)
  40. #elif PRAGMA_STRUCT_PACK
  41.     #pragma pack(2)
  42. #endif
  43. #if PRAGMA_ENUM_ALWAYSINT
  44.     #if defined(__fourbyteints__) && !__fourbyteints__ 
  45.         #define __QD3DERRORS__RESTORE_TWOBYTEINTS
  46.         #pragma fourbyteints on
  47.     #endif
  48.     #pragma enumsalwaysint on
  49. #elif PRAGMA_ENUM_OPTIONS
  50.     #pragma option enum=int
  51. #elif PRAGMA_ENUM_PACK
  52.     #if __option(pack_enums)
  53.         #define __QD3DERRORS__RESTORE_PACKED_ENUMS
  54.         #pragma options(!pack_enums)
  55.     #endif
  56. #endif
  57. /******************************************************************************
  58.  **                                                                          **
  59.  **                         Error Types and Codes                            **
  60.  **                                                                          **
  61.  *****************************************************************************/
  62. enum TQ3Error {
  63.     kQ3ErrorNone                = 0,                            /* Fatal Errors */
  64.     kQ3ErrorInternalError       = -28500,
  65.     kQ3ErrorNoRecovery          = -28499,
  66.     kQ3ErrorLastFatalError      = -28498,                       /* System Errors */
  67.     kQ3ErrorNotInitialized      = -28490,
  68.     kQ3ErrorAlreadyInitialized  = -28489,
  69.     kQ3ErrorUnimplemented       = -28488,
  70.     kQ3ErrorRegistrationFailed  = -28487,                       /* OS Errors */
  71.     kQ3ErrorUnixError           = -28486,
  72.     kQ3ErrorMacintoshError      = -28485,
  73.     kQ3ErrorX11Error            = -28484,                       /* Memory Errors */
  74.     kQ3ErrorMemoryLeak          = -28483,
  75.     kQ3ErrorOutOfMemory         = -28482,                       /* Parameter errors */
  76.     kQ3ErrorNULLParameter       = -28481,
  77.     kQ3ErrorParameterOutOfRange = -28480,
  78.     kQ3ErrorInvalidParameter    = -28479,
  79.     kQ3ErrorInvalidData         = -28478,
  80.     kQ3ErrorAcceleratorAlreadySet = -28477,
  81.     kQ3ErrorVector3DNotUnitLength = -28476,
  82.     kQ3ErrorVector3DZeroLength  = -28475,                       /* Object Errors */
  83.     kQ3ErrorInvalidObject       = -28474,
  84.     kQ3ErrorInvalidObjectClass  = -28473,
  85.     kQ3ErrorInvalidObjectType   = -28472,
  86.     kQ3ErrorInvalidObjectName   = -28471,
  87.     kQ3ErrorObjectClassInUse    = -28470,
  88.     kQ3ErrorAccessRestricted    = -28469,
  89.     kQ3ErrorMetaHandlerRequired = -28468,
  90.     kQ3ErrorNeedRequiredMethods = -28467,
  91.     kQ3ErrorNoSubClassType      = -28466,
  92.     kQ3ErrorUnknownElementType  = -28465,
  93.     kQ3ErrorNotSupported        = -28464,                       /* Extension Errors */
  94.     kQ3ErrorNoExtensionsFolder  = -28463,
  95.     kQ3ErrorExtensionError      = -28462,
  96.     kQ3ErrorPrivateExtensionError = -28461,                     /* Geometry Errors */
  97.     kQ3ErrorDegenerateGeometry  = -28460,
  98.     kQ3ErrorGeometryInsufficientNumberOfPoints = -28459,        /* IO Errors */
  99.     kQ3ErrorNoStorageSetForFile = -28458,
  100.     kQ3ErrorEndOfFile           = -28457,
  101.     kQ3ErrorFileCancelled       = -28456,
  102.     kQ3ErrorInvalidMetafile     = -28455,
  103.     kQ3ErrorInvalidMetafilePrimitive = -28454,
  104.     kQ3ErrorInvalidMetafileLabel = -28453,
  105.     kQ3ErrorInvalidMetafileObject = -28452,
  106.     kQ3ErrorInvalidMetafileSubObject = -28451,
  107.     kQ3ErrorInvalidSubObjectForObject = -28450,
  108.     kQ3ErrorUnresolvableReference = -28449,
  109.     kQ3ErrorUnknownObject       = -28448,
  110.     kQ3ErrorStorageInUse        = -28447,
  111.     kQ3ErrorStorageAlreadyOpen  = -28446,
  112.     kQ3ErrorStorageNotOpen      = -28445,
  113.     kQ3ErrorStorageIsOpen       = -28444,
  114.     kQ3ErrorFileAlreadyOpen     = -28443,
  115.     kQ3ErrorFileNotOpen         = -28442,
  116.     kQ3ErrorFileIsOpen          = -28441,
  117.     kQ3ErrorBeginWriteAlreadyCalled = -28440,
  118.     kQ3ErrorBeginWriteNotCalled = -28439,
  119.     kQ3ErrorEndWriteNotCalled   = -28438,
  120.     kQ3ErrorReadStateInactive   = -28437,
  121.     kQ3ErrorStateUnavailable    = -28436,
  122.     kQ3ErrorWriteStateInactive  = -28435,
  123.     kQ3ErrorSizeNotLongAligned  = -28434,
  124.     kQ3ErrorFileModeRestriction = -28433,
  125.     kQ3ErrorInvalidHexString    = -28432,
  126.     kQ3ErrorWroteMoreThanSize   = -28431,
  127.     kQ3ErrorWroteLessThanSize   = -28430,
  128.     kQ3ErrorReadLessThanSize    = -28429,
  129.     kQ3ErrorReadMoreThanSize    = -28428,
  130.     kQ3ErrorNoBeginGroup        = -28427,
  131.     kQ3ErrorSizeMismatch        = -28426,
  132.     kQ3ErrorStringExceedsMaximumLength = -28425,
  133.     kQ3ErrorValueExceedsMaximumSize = -28424,
  134.     kQ3ErrorNonUniqueLabel      = -28423,
  135.     kQ3ErrorEndOfContainer      = -28422,
  136.     kQ3ErrorUnmatchedEndGroup   = -28421,
  137.     kQ3ErrorFileVersionExists   = -28420,                       /* View errors */
  138.     kQ3ErrorViewNotStarted      = -28419,
  139.     kQ3ErrorViewIsStarted       = -28418,
  140.     kQ3ErrorRendererNotSet      = -28417,
  141.     kQ3ErrorRenderingIsActive   = -28416,
  142.     kQ3ErrorImmediateModeUnderflow = -28415,
  143.     kQ3ErrorDisplayNotSet       = -28414,
  144.     kQ3ErrorCameraNotSet        = -28413,
  145.     kQ3ErrorDrawContextNotSet   = -28412,
  146.     kQ3ErrorNonInvertibleMatrix = -28411,
  147.     kQ3ErrorRenderingNotStarted = -28410,
  148.     kQ3ErrorPickingNotStarted   = -28409,
  149.     kQ3ErrorBoundsNotStarted    = -28408,
  150.     kQ3ErrorDataNotAvailable    = -28407,
  151.     kQ3ErrorNothingToPop        = -28406,                       /* Renderer Errors */
  152.     kQ3ErrorUnknownStudioType   = -28405,
  153.     kQ3ErrorAlreadyRendering    = -28404,
  154.     kQ3ErrorStartGroupRange     = -28403,
  155.     kQ3ErrorUnsupportedGeometryType = -28402,
  156.     kQ3ErrorInvalidGeometryType = -28401,
  157.     kQ3ErrorUnsupportedFunctionality = -28400,                  /* Group Errors */
  158.     kQ3ErrorInvalidPositionForGroup = -28399,
  159.     kQ3ErrorInvalidObjectForGroup = -28398,
  160.     kQ3ErrorInvalidObjectForPosition = -28397,                  /* Transform Errors */
  161.     kQ3ErrorScaleOfZero         = -28396,                       /* String Errors */
  162.     kQ3ErrorBadStringType       = -28395,                       /* Attribute Errors */
  163.     kQ3ErrorAttributeNotContained = -28394,
  164.     kQ3ErrorAttributeInvalidType = -28393,                      /* Camera Errors */
  165.     kQ3ErrorInvalidCameraValues = -28392,                       /* DrawContext Errors */
  166.     kQ3ErrorBadDrawContextType  = -28391,
  167.     kQ3ErrorBadDrawContextFlag  = -28390,
  168.     kQ3ErrorBadDrawContext      = -28389,
  169.     kQ3ErrorUnsupportedPixelDepth = -28388,                     /* Controller Errors */
  170.     kQ3ErrorController          = -28387,                       /* Tracker Errors */
  171.     kQ3ErrorTracker             = -28386,                       /* Another OS Error */
  172.     kQ3ErrorWin32Error          = -28385,                       /* Object Errors */
  173.     kQ3ErrorTypeAlreadyExistsAndHasSubclasses = -28384,
  174.     kQ3ErrorTypeAlreadyExistsAndOtherClassesDependOnIt = -28383,
  175.     kQ3ErrorTypeAlreadyExistsAndHasObjectInstances = -28382,    /* submit loop errors: if you ever get one of these check the previous*/
  176.                                                                 /* error posted, it may be kQ3ErrorOutOfMemory.  If so you *may* be able*/
  177.                                                                 /* to recover by freeing up some memory and trying again*/
  178.     kQ3ErrorPickingLoopFailed   = -28381,
  179.     kQ3ErrorRenderingLoopFailed = -28380,
  180.     kQ3ErrorWritingLoopFailed   = -28379,
  181.     kQ3ErrorBoundingLoopFailed  = -28378
  182. };
  183. typedef enum TQ3Error TQ3Error;
  184. enum TQ3Warning {
  185.     kQ3WarningNone              = 0,                            /* General System */
  186.     kQ3WarningInternalException = -28300,                       /* Object Warnings */
  187.     kQ3WarningNoObjectSupportForDuplicateMethod = -28299,
  188.     kQ3WarningNoObjectSupportForDrawMethod = -28298,
  189.     kQ3WarningNoObjectSupportForWriteMethod = -28297,
  190.     kQ3WarningNoObjectSupportForReadMethod = -28296,
  191.     kQ3WarningUnknownElementType = -28295,
  192.     kQ3WarningTypeAndMethodAlreadyDefined = -28294,
  193.     kQ3WarningTypeIsOutOfRange  = -28293,
  194.     kQ3WarningTypeHasNotBeenRegistered = -28292,                /* Parameter Warnings */
  195.     kQ3WarningVector3DNotUnitLength = -28291,                   /* IO Warnings */
  196.     kQ3WarningInvalidSubObjectForObject = -28290,
  197.     kQ3WarningInvalidHexString  = -28289,
  198.     kQ3WarningUnknownObject     = -28288,
  199.     kQ3WarningInvalidMetafileObject = -28287,
  200.     kQ3WarningUnmatchedBeginGroup = -28286,
  201.     kQ3WarningUnmatchedEndGroup = -28285,
  202.     kQ3WarningInvalidTableOfContents = -28284,
  203.     kQ3WarningUnresolvableReference = -28283,
  204.     kQ3WarningNoAttachMethod    = -28282,
  205.     kQ3WarningInconsistentData  = -28281,
  206.     kQ3WarningReadLessThanSize  = -28280,
  207.     kQ3WarningFilePointerResolutionFailed = -28279,
  208.     kQ3WarningFilePointerRedefined = -28278,
  209.     kQ3WarningStringExceedsMaximumLength = -28277,              /* Memory Warnings */
  210.     kQ3WarningLowMemory         = -28276,
  211.     kQ3WarningPossibleMemoryLeak = -28275,                      /* View Warnings */
  212.     kQ3WarningViewTraversalInProgress = -28274,
  213.     kQ3WarningNonInvertibleMatrix = -28273,                     /* Quaternion Warning */
  214.     kQ3WarningQuaternionEntriesAreZero = -28272,                /* Renderer Warning */
  215.     kQ3WarningFunctionalityNotSupported = -28271,               /* DrawContext Warning */
  216.     kQ3WarningInvalidPaneDimensions = -28270,                   /* Pick Warning */
  217.     kQ3WarningPickParamOutside  = -28269,                       /* Scale Warnings */
  218.     kQ3WarningScaleEntriesAllZero = -28268,
  219.     kQ3WarningScaleContainsNegativeEntries = -28267,            /* Generic Warnings */
  220.     kQ3WarningParameterOutOfRange = -28266,                     /* Extension Warnings */
  221.     kQ3WarningExtensionNotLoading = -28265,                     /* Object Warnings */
  222.     kQ3WarningTypeAlreadyRegistered = -28264,
  223.     kQ3WarningTypeSameVersionAlreadyRegistered = -28263,
  224.     kQ3WarningTypeNewerVersionAlreadyRegistered = -28262,       /* Invalid Group Object */
  225.     kQ3WarningInvalidObjectInGroupMetafile = -28261
  226. };
  227. typedef enum TQ3Warning TQ3Warning;
  228. enum TQ3Notice {
  229.     kQ3NoticeNone               = 0,
  230.     kQ3NoticeDataAlreadyEmpty   = -28100,
  231.     kQ3NoticeMethodNotSupported = -28099,
  232.     kQ3NoticeObjectAlreadySet   = -28098,
  233.     kQ3NoticeParameterOutOfRange = -28097,
  234.     kQ3NoticeFileAliasWasChanged = -28096,
  235.     kQ3NoticeMeshVertexHasNoComponent = -28095,
  236.     kQ3NoticeMeshInvalidVertexFacePair = -28094,
  237.     kQ3NoticeMeshEdgeVertexDoNotCorrespond = -28093,
  238.     kQ3NoticeMeshEdgeIsNotBoundary = -28092,
  239.     kQ3NoticeDrawContextNotSetUsingInternalDefaults = -28091,
  240.     kQ3NoticeInvalidAttenuationTypeUsingInternalDefaults = -28090,
  241.     kQ3NoticeBrightnessGreaterThanOne = -28089,
  242.     kQ3NoticeScaleContainsZeroEntries = -28088,
  243.     kQ3NoticeSystemAlreadyInitialized = -28087,
  244.     kQ3NoticeViewSyncCalledAgain = -28086,
  245.     kQ3NoticeFileCancelled      = -28085
  246. };
  247. typedef enum TQ3Notice TQ3Notice;
  248. typedef CALLBACK_API_C( void , TQ3ErrorMethod )(TQ3Error firstError, TQ3Error lastError, long reference);
  249. typedef CALLBACK_API_C( void , TQ3WarningMethod )(TQ3Warning firstWarning, TQ3Warning lastWarning, long reference);
  250. typedef CALLBACK_API_C( void , TQ3NoticeMethod )(TQ3Notice firstNotice, TQ3Notice lastNotice, long reference);
  251. /******************************************************************************
  252.  **                                                                          **
  253.  **                             Error Routines                               **
  254.  **                                                                          **
  255.  *****************************************************************************/
  256. #if CALL_NOT_IN_CARBON
  257. EXTERN_API_C( TQ3Status )
  258. Q3Error_Register                (TQ3ErrorMethod         errorPost,
  259.                                  long                   reference);
  260. EXTERN_API_C( TQ3Status )
  261. Q3Warning_Register              (TQ3WarningMethod       warningPost,
  262.                                  long                   reference);
  263. EXTERN_API_C( TQ3Status )
  264. Q3Notice_Register               (TQ3NoticeMethod        noticePost,
  265.                                  long                   reference);
  266. /*
  267.  *  Getting error codes -
  268.  *  Clears error type on next entry into system (except all of these 
  269.  *  error calls), and returns the last error, and optionally the 
  270.  *  first error. The parameter to these "_Get" calls may be NULL.
  271.  */
  272. EXTERN_API_C( TQ3Error )
  273. Q3Error_Get                     (TQ3Error *             firstError);
  274. EXTERN_API_C( TQ3Boolean )
  275. Q3Error_IsFatalError            (TQ3Error               error);
  276. EXTERN_API_C( TQ3Warning )
  277. Q3Warning_Get                   (TQ3Warning *           firstWarning);
  278. EXTERN_API_C( TQ3Notice )
  279. Q3Notice_Get                    (TQ3Notice *            firstNotice);
  280. #endif  /* CALL_NOT_IN_CARBON */
  281. #if TARGET_OS_MAC
  282. #if CALL_NOT_IN_CARBON
  283. EXTERN_API_C( OSErr )
  284. Q3MacintoshError_Get            (OSErr *                firstMacErr);
  285. #endif  /* CALL_NOT_IN_CARBON */
  286. #endif  /* TARGET_OS_MAC */
  287. #if PRAGMA_ENUM_ALWAYSINT
  288.     #pragma enumsalwaysint reset
  289.     #ifdef __QD3DERRORS__RESTORE_TWOBYTEINTS
  290.         #pragma fourbyteints off
  291.     #endif
  292. #elif PRAGMA_ENUM_OPTIONS
  293.     #pragma option enum=reset
  294. #elif defined(__QD3DERRORS__RESTORE_PACKED_ENUMS)
  295.     #pragma options(pack_enums)
  296. #endif
  297. #if PRAGMA_STRUCT_ALIGN
  298.     #pragma options align=reset
  299. #elif PRAGMA_STRUCT_PACKPUSH
  300.     #pragma pack(pop)
  301. #elif PRAGMA_STRUCT_PACK
  302.     #pragma pack()
  303. #endif
  304. #ifdef PRAGMA_IMPORT_OFF
  305. #pragma import off
  306. #elif PRAGMA_IMPORT
  307. #pragma import reset
  308. #endif
  309. #ifdef __cplusplus
  310. }
  311. #endif
  312. #endif /* __QD3DERRORS__ */