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

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       QD3DStyle.h
  3.  
  4.      Contains:   Q3Style types and routines
  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 __QD3DSTYLE__
  18. #define __QD3DSTYLE__
  19. #ifndef __QD3D__
  20. #include "QD3D.h"
  21. #endif
  22. #if PRAGMA_ONCE
  23. #pragma once
  24. #endif
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. #if PRAGMA_IMPORT
  29. #pragma import on
  30. #endif
  31. #if PRAGMA_STRUCT_ALIGN
  32.     #pragma options align=power
  33. #elif PRAGMA_STRUCT_PACKPUSH
  34.     #pragma pack(push, 2)
  35. #elif PRAGMA_STRUCT_PACK
  36.     #pragma pack(2)
  37. #endif
  38. #if PRAGMA_ENUM_ALWAYSINT
  39.     #if defined(__fourbyteints__) && !__fourbyteints__ 
  40.         #define __QD3DSTYLE__RESTORE_TWOBYTEINTS
  41.         #pragma fourbyteints on
  42.     #endif
  43.     #pragma enumsalwaysint on
  44. #elif PRAGMA_ENUM_OPTIONS
  45.     #pragma option enum=int
  46. #elif PRAGMA_ENUM_PACK
  47.     #if __option(pack_enums)
  48.         #define __QD3DSTYLE__RESTORE_PACKED_ENUMS
  49.         #pragma options(!pack_enums)
  50.     #endif
  51. #endif
  52. /******************************************************************************
  53.  **                                                                          **
  54.  **                 Style Base Class Routines                                **
  55.  **                                                                          **
  56.  *****************************************************************************/
  57. #if CALL_NOT_IN_CARBON
  58. EXTERN_API_C( TQ3ObjectType )
  59. Q3Style_GetType                 (TQ3StyleObject         style);
  60. EXTERN_API_C( TQ3Status )
  61. Q3Style_Submit                  (TQ3StyleObject         style,
  62.                                  TQ3ViewObject          view);
  63. /******************************************************************************
  64.  **                                                                          **
  65.  **                              Subdivision                                 **
  66.  **                                                                          **
  67.  *****************************************************************************/
  68. #endif  /* CALL_NOT_IN_CARBON */
  69. enum TQ3SubdivisionMethod {
  70.     kQ3SubdivisionMethodConstant = 0,
  71.     kQ3SubdivisionMethodWorldSpace = 1,
  72.     kQ3SubdivisionMethodScreenSpace = 2
  73. };
  74. typedef enum TQ3SubdivisionMethod TQ3SubdivisionMethod;
  75. struct TQ3SubdivisionStyleData {
  76.     TQ3SubdivisionMethod            method;
  77.     float                           c1;
  78.     float                           c2;
  79. };
  80. typedef struct TQ3SubdivisionStyleData  TQ3SubdivisionStyleData;
  81. #if CALL_NOT_IN_CARBON
  82. EXTERN_API_C( TQ3StyleObject )
  83. Q3SubdivisionStyle_New          (const TQ3SubdivisionStyleData * data);
  84. EXTERN_API_C( TQ3Status )
  85. Q3SubdivisionStyle_Submit       (const TQ3SubdivisionStyleData * data,
  86.                                  TQ3ViewObject          view);
  87. EXTERN_API_C( TQ3Status )
  88. Q3SubdivisionStyle_SetData      (TQ3StyleObject         subdiv,
  89.                                  const TQ3SubdivisionStyleData * data);
  90. EXTERN_API_C( TQ3Status )
  91. Q3SubdivisionStyle_GetData      (TQ3StyleObject         subdiv,
  92.                                  TQ3SubdivisionStyleData * data);
  93. /******************************************************************************
  94.  **                                                                          **
  95.  **                             Pick ID                                      **
  96.  **                                                                          **
  97.  *****************************************************************************/
  98. EXTERN_API_C( TQ3StyleObject )
  99. Q3PickIDStyle_New               (unsigned long          id);
  100. EXTERN_API_C( TQ3Status )
  101. Q3PickIDStyle_Submit            (unsigned long          id,
  102.                                  TQ3ViewObject          view);
  103. EXTERN_API_C( TQ3Status )
  104. Q3PickIDStyle_Get               (TQ3StyleObject         pickIDObject,
  105.                                  unsigned long *        id);
  106. EXTERN_API_C( TQ3Status )
  107. Q3PickIDStyle_Set               (TQ3StyleObject         pickIDObject,
  108.                                  unsigned long          id);
  109. /******************************************************************************
  110.  **                                                                          **
  111.  **                             Pick Parts                                   **
  112.  **                                                                          **
  113.  *****************************************************************************/
  114. #endif  /* CALL_NOT_IN_CARBON */
  115. enum TQ3PickPartsMasks {
  116.     kQ3PickPartsObject          = 0,
  117.     kQ3PickPartsMaskFace        = 1 << 0,
  118.     kQ3PickPartsMaskEdge        = 1 << 1,
  119.     kQ3PickPartsMaskVertex      = 1 << 2
  120. };
  121. typedef enum TQ3PickPartsMasks TQ3PickPartsMasks;
  122. typedef unsigned long                   TQ3PickParts;
  123. #if CALL_NOT_IN_CARBON
  124. EXTERN_API_C( TQ3StyleObject )
  125. Q3PickPartsStyle_New            (TQ3PickParts           parts);
  126. EXTERN_API_C( TQ3Status )
  127. Q3PickPartsStyle_Submit         (TQ3PickParts           parts,
  128.                                  TQ3ViewObject          view);
  129. EXTERN_API_C( TQ3Status )
  130. Q3PickPartsStyle_Get            (TQ3StyleObject         pickPartsObject,
  131.                                  TQ3PickParts *         parts);
  132. EXTERN_API_C( TQ3Status )
  133. Q3PickPartsStyle_Set            (TQ3StyleObject         pickPartsObject,
  134.                                  TQ3PickParts           parts);
  135. /******************************************************************************
  136.  **                                                                          **
  137.  **                     Receive Shadows                                      **
  138.  **                                                                          **
  139.  *****************************************************************************/
  140. EXTERN_API_C( TQ3StyleObject )
  141. Q3ReceiveShadowsStyle_New       (TQ3Boolean             receives);
  142. EXTERN_API_C( TQ3Status )
  143. Q3ReceiveShadowsStyle_Submit    (TQ3Boolean             receives,
  144.                                  TQ3ViewObject          view);
  145. EXTERN_API_C( TQ3Status )
  146. Q3ReceiveShadowsStyle_Get       (TQ3StyleObject         styleObject,
  147.                                  TQ3Boolean *           receives);
  148. EXTERN_API_C( TQ3Status )
  149. Q3ReceiveShadowsStyle_Set       (TQ3StyleObject         styleObject,
  150.                                  TQ3Boolean             receives);
  151. /******************************************************************************
  152.  **                                                                          **
  153.  **                         Fill Styles                                      **
  154.  **                                                                          **
  155.  *****************************************************************************/
  156. #endif  /* CALL_NOT_IN_CARBON */
  157. enum TQ3FillStyle {
  158.     kQ3FillStyleFilled          = 0,
  159.     kQ3FillStyleEdges           = 1,
  160.     kQ3FillStylePoints          = 2
  161. };
  162. typedef enum TQ3FillStyle TQ3FillStyle;
  163. #if CALL_NOT_IN_CARBON
  164. EXTERN_API_C( TQ3StyleObject )
  165. Q3FillStyle_New                 (TQ3FillStyle           fillStyle);
  166. EXTERN_API_C( TQ3Status )
  167. Q3FillStyle_Submit              (TQ3FillStyle           fillStyle,
  168.                                  TQ3ViewObject          view);
  169. EXTERN_API_C( TQ3Status )
  170. Q3FillStyle_Get                 (TQ3StyleObject         styleObject,
  171.                                  TQ3FillStyle *         fillStyle);
  172. EXTERN_API_C( TQ3Status )
  173. Q3FillStyle_Set                 (TQ3StyleObject         styleObject,
  174.                                  TQ3FillStyle           fillStyle);
  175. /******************************************************************************
  176.  **                                                                          **
  177.  **                         Backfacing Styles                                **
  178.  **                                                                          **
  179.  *****************************************************************************/
  180. #endif  /* CALL_NOT_IN_CARBON */
  181. enum TQ3BackfacingStyle {
  182.     kQ3BackfacingStyleBoth      = 0,
  183.     kQ3BackfacingStyleRemove    = 1,
  184.     kQ3BackfacingStyleFlip      = 2
  185. };
  186. typedef enum TQ3BackfacingStyle TQ3BackfacingStyle;
  187. #if CALL_NOT_IN_CARBON
  188. EXTERN_API_C( TQ3StyleObject )
  189. Q3BackfacingStyle_New           (TQ3BackfacingStyle     backfacingStyle);
  190. EXTERN_API_C( TQ3Status )
  191. Q3BackfacingStyle_Submit        (TQ3BackfacingStyle     backfacingStyle,
  192.                                  TQ3ViewObject          view);
  193. EXTERN_API_C( TQ3Status )
  194. Q3BackfacingStyle_Get           (TQ3StyleObject         backfacingObject,
  195.                                  TQ3BackfacingStyle *   backfacingStyle);
  196. EXTERN_API_C( TQ3Status )
  197. Q3BackfacingStyle_Set           (TQ3StyleObject         backfacingObject,
  198.                                  TQ3BackfacingStyle     backfacingStyle);
  199. /******************************************************************************
  200.  **                                                                          **
  201.  **                         Interpolation Types                              **
  202.  **                                                                          **
  203.  *****************************************************************************/
  204. #endif  /* CALL_NOT_IN_CARBON */
  205. enum TQ3InterpolationStyle {
  206.     kQ3InterpolationStyleNone   = 0,
  207.     kQ3InterpolationStyleVertex = 1,
  208.     kQ3InterpolationStylePixel  = 2
  209. };
  210. typedef enum TQ3InterpolationStyle TQ3InterpolationStyle;
  211. #if CALL_NOT_IN_CARBON
  212. EXTERN_API_C( TQ3StyleObject )
  213. Q3InterpolationStyle_New        (TQ3InterpolationStyle  interpolationStyle);
  214. EXTERN_API_C( TQ3Status )
  215. Q3InterpolationStyle_Submit     (TQ3InterpolationStyle  interpolationStyle,
  216.                                  TQ3ViewObject          view);
  217. EXTERN_API_C( TQ3Status )
  218. Q3InterpolationStyle_Get        (TQ3StyleObject         interpolationObject,
  219.                                  TQ3InterpolationStyle * interpolationStyle);
  220. EXTERN_API_C( TQ3Status )
  221. Q3InterpolationStyle_Set        (TQ3StyleObject         interpolationObject,
  222.                                  TQ3InterpolationStyle  interpolationStyle);
  223. /******************************************************************************
  224.  **                                                                          **
  225.  **                             Highlight Style                              **
  226.  **                                                                          **
  227.  *****************************************************************************/
  228. EXTERN_API_C( TQ3StyleObject )
  229. Q3HighlightStyle_New            (TQ3AttributeSet        highlightAttribute);
  230. EXTERN_API_C( TQ3Status )
  231. Q3HighlightStyle_Submit         (TQ3AttributeSet        highlightAttribute,
  232.                                  TQ3ViewObject          view);
  233. EXTERN_API_C( TQ3Status )
  234. Q3HighlightStyle_Get            (TQ3StyleObject         highlight,
  235.                                  TQ3AttributeSet *      highlightAttribute);
  236. EXTERN_API_C( TQ3Status )
  237. Q3HighlightStyle_Set            (TQ3StyleObject         highlight,
  238.                                  TQ3AttributeSet        highlightAttribute);
  239. /******************************************************************************
  240.  **                                                                          **
  241.  **                         FrontFacing Direction Styles                     **
  242.  **                                                                          **
  243.  *****************************************************************************/
  244. #endif  /* CALL_NOT_IN_CARBON */
  245. enum TQ3OrientationStyle {
  246.     kQ3OrientationStyleCounterClockwise = 0,
  247.     kQ3OrientationStyleClockwise = 1
  248. };
  249. typedef enum TQ3OrientationStyle TQ3OrientationStyle;
  250. #if CALL_NOT_IN_CARBON
  251. EXTERN_API_C( TQ3StyleObject )
  252. Q3OrientationStyle_New          (TQ3OrientationStyle    frontFacingDirection);
  253. EXTERN_API_C( TQ3Status )
  254. Q3OrientationStyle_Submit       (TQ3OrientationStyle    frontFacingDirection,
  255.                                  TQ3ViewObject          view);
  256. EXTERN_API_C( TQ3Status )
  257. Q3OrientationStyle_Get          (TQ3StyleObject         frontFacingDirectionObject,
  258.                                  TQ3OrientationStyle *  frontFacingDirection);
  259. EXTERN_API_C( TQ3Status )
  260. Q3OrientationStyle_Set          (TQ3StyleObject         frontFacingDirectionObject,
  261.                                  TQ3OrientationStyle    frontFacingDirection);
  262. /******************************************************************************
  263.  **                                                                          **
  264.  **                             AntiAlias Style                              **
  265.  **                                                                          **
  266.  *****************************************************************************/
  267. #endif  /* CALL_NOT_IN_CARBON */
  268. enum TQ3AntiAliasModeMasks {
  269.     kQ3AntiAliasModeMaskEdges   = 1 << 0,
  270.     kQ3AntiAliasModeMaskFilled  = 1 << 1
  271. };
  272. typedef enum TQ3AntiAliasModeMasks TQ3AntiAliasModeMasks;
  273. typedef unsigned long                   TQ3AntiAliasMode;
  274. struct TQ3AntiAliasStyleData {
  275.     TQ3Switch                       state;
  276.     TQ3AntiAliasMode                mode;
  277.     float                           quality;
  278. };
  279. typedef struct TQ3AntiAliasStyleData    TQ3AntiAliasStyleData;
  280. #if CALL_NOT_IN_CARBON
  281. EXTERN_API_C( TQ3StyleObject )
  282. Q3AntiAliasStyle_New            (const TQ3AntiAliasStyleData * data);
  283. EXTERN_API_C( TQ3Status )
  284. Q3AntiAliasStyle_Submit         (const TQ3AntiAliasStyleData * data,
  285.                                  TQ3ViewObject          view);
  286. EXTERN_API_C( TQ3Status )
  287. Q3AntiAliasStyle_GetData        (TQ3StyleObject         styleObject,
  288.                                  TQ3AntiAliasStyleData * data);
  289. EXTERN_API_C( TQ3Status )
  290. Q3AntiAliasStyle_SetData        (TQ3StyleObject         styleObject,
  291.                                  const TQ3AntiAliasStyleData * data);
  292. /******************************************************************************
  293.  **                                                                          **
  294.  **                                 Fog Style                                **
  295.  **                                                                          **
  296.  *****************************************************************************/
  297. #endif  /* CALL_NOT_IN_CARBON */
  298. enum TQ3FogMode {
  299.     kQ3FogModeLinear            = 0,
  300.     kQ3FogModeExponential       = 1,
  301.     kQ3FogModeExponentialSquared = 2,
  302.     kQ3FogModeAlpha             = 3
  303. };
  304. typedef enum TQ3FogMode TQ3FogMode;
  305. struct TQ3FogStyleData {
  306.     TQ3Switch                       state;
  307.     TQ3FogMode                      mode;
  308.     float                           fogStart;
  309.     float                           fogEnd;
  310.     float                           density;
  311.     TQ3ColorARGB                    color;
  312. };
  313. typedef struct TQ3FogStyleData          TQ3FogStyleData;
  314. #if CALL_NOT_IN_CARBON
  315. EXTERN_API_C( TQ3StyleObject )
  316. Q3FogStyle_New                  (const TQ3FogStyleData * data);
  317. EXTERN_API_C( TQ3Status )
  318. Q3FogStyle_Submit               (const TQ3FogStyleData * data,
  319.                                  TQ3ViewObject          view);
  320. EXTERN_API_C( TQ3Status )
  321. Q3FogStyle_GetData              (TQ3StyleObject         styleObject,
  322.                                  TQ3FogStyleData *      data);
  323. EXTERN_API_C( TQ3Status )
  324. Q3FogStyle_SetData              (TQ3StyleObject         styleObject,
  325.                                  const TQ3FogStyleData * data);
  326. #endif  /* CALL_NOT_IN_CARBON */
  327. #if PRAGMA_ENUM_ALWAYSINT
  328.     #pragma enumsalwaysint reset
  329.     #ifdef __QD3DSTYLE__RESTORE_TWOBYTEINTS
  330.         #pragma fourbyteints off
  331.     #endif
  332. #elif PRAGMA_ENUM_OPTIONS
  333.     #pragma option enum=reset
  334. #elif defined(__QD3DSTYLE__RESTORE_PACKED_ENUMS)
  335.     #pragma options(pack_enums)
  336. #endif
  337. #if PRAGMA_STRUCT_ALIGN
  338.     #pragma options align=reset
  339. #elif PRAGMA_STRUCT_PACKPUSH
  340.     #pragma pack(pop)
  341. #elif PRAGMA_STRUCT_PACK
  342.     #pragma pack()
  343. #endif
  344. #ifdef PRAGMA_IMPORT_OFF
  345. #pragma import off
  346. #elif PRAGMA_IMPORT
  347. #pragma import reset
  348. #endif
  349. #ifdef __cplusplus
  350. }
  351. #endif
  352. #endif /* __QD3DSTYLE__ */