home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 …ember: Reference Library / Apple Developer Reference Library (December 1999) (Disk 1).iso / pc / technical documentation / develop / develop issue 26 / develop issue 26 code / qd3d custom attributes / draft quickdraw 3d technotes / cattrs from developers / microspot custom attributes / customattribute.h < prev    next >
Encoding:
Text File  |  1996-03-22  |  6.6 KB  |  177 lines

  1. // ===========================================================================
  2. //    Project : QuickDraw 3D
  3. //    File    : CustomAttribute.h
  4. //
  5. //    Authors : Robin Landsbert
  6. //        
  7. // ===========================================================================
  8.  
  9. #include <QD3D.h>
  10. #include <QD3DSet.h>
  11.  
  12. typedef long bool ;
  13.  
  14. //------------------------------------------------------------------------------------------------
  15.  
  16. void UnregisterCustomAttribute ( TQ3ObjectClass theClass ) ;
  17. TQ3ObjectClass RegisterCustomAttribute ( TQ3AttributeType theType , unsigned long theSize , TQ3MetaHandler theHandler ) ;
  18.  
  19. //------------------------------------------------------------------------------------------------
  20.  
  21. struct THandleRecord
  22.     {
  23.     unsigned long    theSize ;
  24.     Handle            theHandle ;
  25.     } ;
  26.  
  27. //------------------------------------------------------------------------------------------------
  28. // Sound custom attribute
  29. //------------------------------------------------------------------------------------------------
  30. // the THandleRecord contains the entire sound
  31.  
  32. const TQ3AttributeType kCustomSoundType = 'snd ' ;
  33. TQ3ObjectClass RegisterSoundAttribute ( void ) ;
  34.  
  35. //------------------------------------------------------------------------------------------------
  36. // PICT custom attribute
  37. //------------------------------------------------------------------------------------------------
  38. // the THandleRecord contains the entire pict
  39.  
  40. const TQ3AttributeType kCustomPictType = 'PICT' ;
  41. TQ3ObjectClass RegisterPictAttribute ( void ) ;
  42.  
  43. //------------------------------------------------------------------------------------------------
  44. // TEXT custom attribute
  45. //------------------------------------------------------------------------------------------------
  46. // the THandleRecord contains the entire text
  47.  
  48. const TQ3AttributeType kCustomTextType = 'TEXT' ;
  49. TQ3ObjectClass RegisterTextAttribute ( void ) ;
  50.  
  51. //------------------------------------------------------------------------------------------------
  52. // Movie custom attribute
  53. //------------------------------------------------------------------------------------------------
  54. // the THandleRecord contains an alias record to the movie file
  55.  
  56. const TQ3AttributeType kCustomMovieType = 'moov' ;
  57. TQ3ObjectClass RegisterMovieAttribute ( void ) ;
  58.  
  59. //----------------------------------------------------------------------------- 
  60. // Locked custom attribute
  61. //----------------------------------------------------------------------------- 
  62. // the data is a long with the LSB being the global locked bit
  63.  
  64. const TQ3AttributeType kLockedAttribute = 'LOCK' ;
  65.  
  66. // Object Lock Stuff
  67. enum TObjectLockBits
  68.    {
  69.    kObjectLockedBit,
  70.    kObjectConstrainPosXBit,
  71.    kObjectConstrainPosYBit,
  72.    kObjectConstrainPosZBit,
  73.    kObjectConstrainSizeXBit,
  74.    kObjectConstrainSizeYBit,
  75.    kObjectConstrainSizeZBit,
  76.    kObjectConstrainRotateXBit,
  77.    kObjectConstrainRotateYBit,
  78.    kObjectConstrainRotateZBit,
  79.    kObjectProportionConstrainedBit,
  80. // only allows the object to be resized proportionally
  81.    kObjectSimplifiableBit
  82. // user allows the object to be ungrouped or simplified if possible
  83.    };
  84.  
  85. enum TObjectLockMasks
  86.    {
  87.    kObjectAllUnlocked          = 0L,
  88.    kObjectLocked              = 1L << kObjectLockedBit,
  89.    kObjectConstrainPosX      = 1L << kObjectConstrainPosXBit,
  90.    kObjectConstrainPosY      = 1L << kObjectConstrainPosYBit,
  91.    kObjectConstrainPosZ      = 1L << kObjectConstrainPosZBit,
  92.    kObjectConstrainSizeX           = 1L << kObjectConstrainSizeXBit,
  93.    kObjectConstrainSizeY        = 1L << kObjectConstrainSizeYBit,
  94.    kObjectConstrainSizeZ          = 1L << kObjectConstrainSizeZBit,
  95.    kObjectConstrainRotateX    = 1L << kObjectConstrainRotateXBit,
  96.    kObjectConstrainRotateY    = 1L << kObjectConstrainRotateYBit,
  97.    kObjectConstrainRotateZ    = 1L << kObjectConstrainRotateZBit,
  98.    kObjectProportionConstrained= 1L << kObjectProportionConstrainedBit,
  99.    kObjectSimplifiable       = 1L << kObjectSimplifiableBit
  100.    };
  101.  
  102. typedef long TObjectLockFlags;
  103.  
  104.  
  105. const TQ3AttributeType kLockedAttribute = 'LOCK' ;
  106. TQ3ObjectClass RegisterLockedAttribute ( void ) ;
  107.  
  108. //------------------------------------------------------------------------------------------------
  109. // Units custom attribute
  110. //------------------------------------------------------------------------------------------------
  111. // the data is a double which is the ratio between 1 model unit and 1 meter
  112. const TQ3AttributeType kUnitsAttribute = 'unts' ;
  113. const TQ3AttributeType kScaleAttribute = 'scle' ;
  114. TQ3ObjectClass RegisterUnitsAttribute ( void ) ;
  115. TQ3ObjectClass RegisterScaleAttribute ( void ) ;
  116.  
  117. //------------------------------------------------------------------------------------------------
  118. // Description custom attribute
  119. //------------------------------------------------------------------------------------------------
  120. // the description is a THandleRecord containing the text
  121. const TQ3AttributeType kDescriptionAttribute = 'desc' ;
  122. TQ3ObjectClass RegisterDescriptionAttribute ( void ) ;
  123.  
  124. //------------------------------------------------------------------------------------------------
  125. // Name custom attribute
  126. //------------------------------------------------------------------------------------------------
  127. // the name is a TQ3StringObject containing the text
  128. const TQ3AttributeType kNameAttribute = 'name' ;
  129. TQ3ObjectClass RegisterNameAttribute ( void ) ;
  130.  
  131. //------------------------------------------------------------------------------------------------
  132. // Vector custom attribute
  133. //------------------------------------------------------------------------------------------------
  134. // these are TQ3Vector3Ds that define the direction
  135.  
  136. const TQ3AttributeType kUpVectorAttribute            = 'upvt' ;
  137. TQ3ObjectClass RegisterUpVectorAttribute ( void ) ;
  138.  
  139. const TQ3AttributeType kForwardDirectionAttribute    = 'fwrd' ;
  140. TQ3ObjectClass RegisterForwardDirectionAttribute ( void ) ;
  141.  
  142. //------------------------------------------------------------------------------------------------
  143. // URL custom attribute
  144. //------------------------------------------------------------------------------------------------
  145.  
  146. const TQ3AttributeType kW3AnchorAttribute        = 'w3nr' ;
  147. const TQ3AttributeType kW3InlineAttribute        = 'w3nl' ;
  148. const TQ3AttributeType kElementTypeWWWAnchor    = 'wwwa' ; // obsolete
  149.  
  150. typedef enum W3AnchorOptions
  151.     {
  152.     kW3AnchorOptionNone                =  0 ,
  153.     kW3AnchorOptionUseMap            =  1
  154.     } W3AnchorOptions ;
  155.  
  156. typedef struct W3AnchorData
  157.     {
  158.     char                *url ;
  159.     TQ3StringObject        description ;
  160.     W3AnchorOptions        options ;
  161.     } W3AnchorData ;
  162.  
  163. typedef struct W3InlineData
  164.     {
  165.     char                *url ;
  166.     } W3InlineData ;
  167.  
  168.  
  169. typedef struct WWWAnchorData
  170.     {
  171.     char                *url ;
  172.     } WWWAnchorData ;
  173.  
  174. TQ3ObjectClass RegisterW3Anchor ( void ) ;
  175. TQ3ObjectClass RegisterW3Inline ( void ) ;
  176. TQ3ObjectClass RegisterWWWAnchor ( void ) ;
  177.