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

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       QTML.h
  3.  
  4.      Contains:   QuickTime Cross-platform specific interfaces
  5.  
  6.      Version:    Technology: QuickTime 4.1
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1997-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 __QTML__
  18. #define __QTML__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __MACMEMORY__
  23. #include "MacMemory.h"
  24. #endif
  25. #ifndef __MACWINDOWS__
  26. #include "MacWindows.h"
  27. #endif
  28. #ifndef __OSUTILS__
  29. #include "OSUtils.h"
  30. #endif
  31. #ifndef __FILES__
  32. #include "Files.h"
  33. #endif
  34. #if PRAGMA_ONCE
  35. #pragma once
  36. #endif
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40. #if PRAGMA_IMPORT
  41. #pragma import on
  42. #endif
  43. #if PRAGMA_STRUCT_ALIGN
  44.     #pragma options align=mac68k
  45. #elif PRAGMA_STRUCT_PACKPUSH
  46.     #pragma pack(push, 2)
  47. #elif PRAGMA_STRUCT_PACK
  48.     #pragma pack(2)
  49. #endif
  50. EXTERN_API( void )
  51. QTMLYieldCPU                    (void);
  52. /* QTMLYieldCPUTime flags*/
  53. enum {
  54.     kQTMLHandlePortEvents       = (1L << 0)                     /* ask for event handling during the yield*/
  55. };
  56. EXTERN_API( void )
  57. QTMLYieldCPUTime                (long                   milliSeconds,
  58.                                  unsigned long          flags);
  59. typedef struct OpaqueQTMLMutex*         QTMLMutex;
  60. #if !(TARGET_OS_MAC && TARGET_API_MAC_OS8)
  61. typedef struct OpaqueQTMLSyncVar*       QTMLSyncVar;
  62. typedef QTMLSyncVar *                   QTMLSyncVarPtr;
  63. /* InitializeQTML flags*/
  64. enum {
  65.     kInitializeQTMLNoSoundFlag  = (1L << 0),                    /* flag for requesting no sound when calling InitializeQTML*/
  66.     kInitializeQTMLUseGDIFlag   = (1L << 1),                    /* flag for requesting GDI when calling InitializeQTML*/
  67.     kInitializeQTMLDisableDirectSound = (1L << 2),              /* disables QTML's use of DirectSound*/
  68.     kInitializeQTMLUseExclusiveFullScreenModeFlag = (1L << 3),  /* later than QTML 3.0: qtml starts up in exclusive full screen mode*/
  69.     kInitializeQTMLDisableDDClippers = (1L << 4)                /* flag for requesting QTML not to use DirectDraw clipper objects; QTML 5.0 and later*/
  70. };
  71. #if CALL_NOT_IN_CARBON
  72. EXTERN_API( OSErr )
  73. InitializeQTML                  (long                   flag);
  74. EXTERN_API( void )
  75. TerminateQTML                   (void);
  76. /* CreatePortAssociation flags*/
  77. #endif  /* CALL_NOT_IN_CARBON */
  78. enum {
  79.     kQTMLNoIdleEvents           = (1L << 1)                     /* ask for a non-auto-idled port to be created*/
  80. };
  81. #if CALL_NOT_IN_CARBON
  82. EXTERN_API( GrafPtr )
  83. CreatePortAssociation           (void *                 theWnd,
  84.                                  Ptr                    storage,
  85.                                  long                   flags);
  86. EXTERN_API( void )
  87. DestroyPortAssociation          (CGrafPtr               cgp);
  88. #endif  /* CALL_NOT_IN_CARBON */
  89. EXTERN_API( void )
  90. QTMLGrabMutex                   (QTMLMutex              mu);
  91. EXTERN_API( Boolean )
  92. QTMLTryGrabMutex                (QTMLMutex              mu);
  93. EXTERN_API( void )
  94. QTMLReturnMutex                 (QTMLMutex              mu);
  95. EXTERN_API( QTMLMutex )
  96. QTMLCreateMutex                 (void);
  97. EXTERN_API( void )
  98. QTMLDestroyMutex                (QTMLMutex              mu);
  99. #if CALL_NOT_IN_CARBON
  100. EXTERN_API( QTMLSyncVarPtr )
  101. QTMLCreateSyncVar               (void);
  102. EXTERN_API( void )
  103. QTMLDestroySyncVar              (QTMLSyncVarPtr         p);
  104. EXTERN_API( long )
  105. QTMLTestAndSetSyncVar           (QTMLSyncVarPtr         sync);
  106. EXTERN_API( void )
  107. QTMLWaitAndSetSyncVar           (QTMLSyncVarPtr         sync);
  108. EXTERN_API( void )
  109. QTMLResetSyncVar                (QTMLSyncVarPtr         sync);
  110. EXTERN_API( void )
  111. InitializeQHdr                  (QHdr *                 qhdr);
  112. EXTERN_API( void )
  113. TerminateQHdr                   (QHdr *                 qhdr);
  114. EXTERN_API( void )
  115. QTMLAcquireWindowList           (void);
  116. EXTERN_API( void )
  117. QTMLReleaseWindowList           (void);
  118. /*
  119.    These routines are here to support "interrupt level" code
  120.       These are dangerous routines, only use if you know what you are doing.
  121. */
  122. EXTERN_API( long )
  123. QTMLRegisterInterruptSafeThread (unsigned long          threadID,
  124.                                  void *                 threadInfo);
  125. EXTERN_API( long )
  126. QTMLUnregisterInterruptSafeThread (unsigned long        threadID);
  127. EXTERN_API( long )
  128. NativeEventToMacEvent           (void *                 nativeEvent,
  129.                                  EventRecord *          macEvent);
  130. #endif  /* CALL_NOT_IN_CARBON */
  131. #if TARGET_OS_WIN32
  132. #if CALL_NOT_IN_CARBON
  133. EXTERN_API( long )
  134. WinEventToMacEvent              (void *                 winMsg,
  135.                                  EventRecord *          macEvent);
  136. #define WinEventToMacEvent  NativeEventToMacEvent
  137. EXTERN_API( Boolean )
  138. IsTaskBarVisible                (void);
  139. EXTERN_API( void )
  140. ShowHideTaskBar                 (Boolean                showIt);
  141. #endif  /* CALL_NOT_IN_CARBON */
  142. enum {
  143.     kDDSurfaceLocked            = (1L << 0),
  144.     kDDSurfaceStatic            = (1L << 1)
  145. };
  146. #if CALL_NOT_IN_CARBON
  147. EXTERN_API( OSErr )
  148. QTGetDDObject                   (void **                lpDDObject);
  149. EXTERN_API( OSErr )
  150. QTSetDDObject                   (void *                 lpNewDDObject);
  151. EXTERN_API( OSErr )
  152. QTSetDDPrimarySurface           (void *                 lpNewDDSurface,
  153.                                  unsigned long          flags);
  154. EXTERN_API( OSErr )
  155. QTMLGetVolumeRootPath           (char *                 fullPath,
  156.                                  char *                 volumeRootPath,
  157.                                  unsigned long          volumeRootLen);
  158. EXTERN_API( void )
  159. QTMLSetWindowWndProc            (WindowRef              theWindow,
  160.                                  void *                 windowProc);
  161. EXTERN_API( void *)
  162. QTMLGetWindowWndProc            (WindowRef              theWindow);
  163. #endif  /* CALL_NOT_IN_CARBON */
  164. #endif  /* TARGET_OS_WIN32 */
  165. #if CALL_NOT_IN_CARBON
  166. EXTERN_API( OSErr )
  167. QTMLGetCanonicalPathName        (char *                 inName,
  168.                                  char *                 outName,
  169.                                  unsigned long          outLen);
  170. #endif  /* CALL_NOT_IN_CARBON */
  171. enum {
  172.     kFullNativePath             = 0,
  173.     kFileNameOnly               = (1 << 0),
  174.     kDirectoryPathOnly          = (1 << 1),
  175.     kUFSFullPathName            = (1 << 2),
  176.     kTryVDIMask                 = (1 << 3),                     /*    Used in NativePathNameToFSSpec to specify to search VDI mountpoints*/
  177.     kFullPathSpecifiedMask      = (1 << 4)                      /*    the passed in name is a fully qualified full path*/
  178. };
  179. #if CALL_NOT_IN_CARBON
  180. EXTERN_API( OSErr )
  181. FSSpecToNativePathName          (const FSSpec *         inFile,
  182.                                  char *                 outName,
  183.                                  unsigned long          outLen,
  184.                                  long                   flags);
  185. #endif  /* CALL_NOT_IN_CARBON */
  186. enum {
  187.     kErrorIfFileNotFound        = 1L << 31
  188. };
  189. #if CALL_NOT_IN_CARBON
  190. EXTERN_API( OSErr )
  191. NativePathNameToFSSpec          (char *                 inName,
  192.                                  FSSpec *               outFile,
  193.                                  long                   flags);
  194. EXTERN_API( OSErr )
  195. QTGetAliasInfo                  (AliasHandle            alias,
  196.                                  AliasInfoType          index,
  197.                                  char *                 outBuf,
  198.                                  long                   bufLen,
  199.                                  long *                 outLen,
  200.                                  unsigned long          flags);
  201. /*%if QUICKTIME_ONLY*/
  202. #endif  /* CALL_NOT_IN_CARBON */
  203. #else
  204. #define QTMLGrabMutex(MU)
  205. #define QTMLTryGrabMutex(MU) true
  206. #define QTMLReturnMutex(MU)
  207. #define QTMLCreateMutex()      ((struct OpaqueQTMLMutex*) 1)   /* nonzero, since zero indicates creation failure */
  208. #define QTMLDestroyMutex(MU)
  209. /*%endif*/
  210. #endif  /* !(TARGET_OS_MAC && TARGET_API_MAC_OS8) */
  211. #if PRAGMA_STRUCT_ALIGN
  212.     #pragma options align=reset
  213. #elif PRAGMA_STRUCT_PACKPUSH
  214.     #pragma pack(pop)
  215. #elif PRAGMA_STRUCT_PACK
  216.     #pragma pack()
  217. #endif
  218. #ifdef PRAGMA_IMPORT_OFF
  219. #pragma import off
  220. #elif PRAGMA_IMPORT
  221. #pragma import reset
  222. #endif
  223. #ifdef __cplusplus
  224. }
  225. #endif
  226. #endif /* __QTML__ */