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.

421 lines
14 KiB

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