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

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       ToolUtils.h
  3.  
  4.      Contains:   Toolbox Utilities Interfaces.
  5.  
  6.      Version:    Technology: System 7.5
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1990-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 __TOOLUTILS__
  18. #define __TOOLUTILS__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __OSUTILS__
  23. #include "OSUtils.h"
  24. #endif
  25. #ifndef __FIXMATH__
  26. #include "FixMath.h"
  27. #endif
  28. #ifndef __ICONS__
  29. #include "Icons.h"
  30. #endif
  31. #ifndef __QUICKDRAW__
  32. #include "Quickdraw.h"
  33. #endif
  34. #ifndef __TEXTUTILS__
  35. #include "TextUtils.h"
  36. #endif
  37. #if PRAGMA_ONCE
  38. #pragma once
  39. #endif
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. #if PRAGMA_IMPORT
  44. #pragma import on
  45. #endif
  46. #if PRAGMA_STRUCT_ALIGN
  47.     #pragma options align=mac68k
  48. #elif PRAGMA_STRUCT_PACKPUSH
  49.     #pragma pack(push, 2)
  50. #elif PRAGMA_STRUCT_PACK
  51.     #pragma pack(2)
  52. #endif
  53. /*
  54. ------------------------------------------------------------------------------------
  55.     Note: 
  56.     
  57.     The following routines that used to be in this header file, have moved to
  58.     more appropriate headers.  
  59.     
  60.         FixMath.h:      FixMul
  61.                         FixRatio
  62.                         FixRound
  63.         
  64.         Icons.h:        GetIcon
  65.                         PlotIcon
  66.                         
  67.         Quickdraw.h:    AngleFromSlope
  68.                         DeltaPoint
  69.                         GetCursor
  70.                         GetIndPattern
  71.                         GetPattern
  72.                         GetPicture
  73.                         PackBits
  74.                         ScreenRes
  75.                         ShieldCursor
  76.                         SlopeFromAngle
  77.                         UnpackBits
  78.                         
  79.         TextUtils.h:    Munger
  80.                         GetIndString
  81.                         GetString
  82.                         NewString
  83.                         SetString
  84. ------------------------------------------------------------------------------------
  85. */
  86. EXTERN_API( Boolean )
  87. BitTst                          (const void *           bytePtr,
  88.                                  long                   bitNum)                             ONEWORDINLINE(0xA85D);
  89. EXTERN_API( void )
  90. BitSet                          (void *                 bytePtr,
  91.                                  long                   bitNum)                             ONEWORDINLINE(0xA85E);
  92. EXTERN_API( void )
  93. BitClr                          (void *                 bytePtr,
  94.                                  long                   bitNum)                             ONEWORDINLINE(0xA85F);
  95. EXTERN_API( long )
  96. BitAnd                          (long                   value1,
  97.                                  long                   value2)                             ONEWORDINLINE(0xA858);
  98. EXTERN_API( long )
  99. BitOr                           (long                   value1,
  100.                                  long                   value2)                             ONEWORDINLINE(0xA85B);
  101. EXTERN_API( long )
  102. BitXor                          (long                   value1,
  103.                                  long                   value2)                             ONEWORDINLINE(0xA859);
  104. EXTERN_API( long )
  105. BitNot                          (long                   value)                              ONEWORDINLINE(0xA85A);
  106. EXTERN_API( long )
  107. BitShift                        (long                   value,
  108.                                  short                  count)                              ONEWORDINLINE(0xA85C);
  109. #if TARGET_CPU_68K
  110. struct Int64Bit {
  111.     SInt32                          hiLong;
  112.     UInt32                          loLong;
  113. };
  114. typedef struct Int64Bit                 Int64Bit;
  115. #if CALL_NOT_IN_CARBON
  116. EXTERN_API( void )
  117. LongMul                         (long                   a,
  118.                                  long                   b,
  119.                                  Int64Bit *             result)                             ONEWORDINLINE(0xA867);
  120. #else
  121.     #define LongMul(a, b, result) ((void) WideMultiply((a), (b), (wide*)(result)))
  122. #endif  /* CALL_NOT_IN_CARBON */
  123. #endif  /* TARGET_CPU_68K */
  124. #define HiWord(x) ((short)((long)(x) >> 16))
  125. #define LoWord(x) ((short)(x))
  126. #if PRAGMA_STRUCT_ALIGN
  127.     #pragma options align=reset
  128. #elif PRAGMA_STRUCT_PACKPUSH
  129.     #pragma pack(pop)
  130. #elif PRAGMA_STRUCT_PACK
  131.     #pragma pack()
  132. #endif
  133. #ifdef PRAGMA_IMPORT_OFF
  134. #pragma import off
  135. #elif PRAGMA_IMPORT
  136. #pragma import reset
  137. #endif
  138. #ifdef __cplusplus
  139. }
  140. #endif
  141. #endif /* __TOOLUTILS__ */