QTML.pas 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. {
  2. File: QTML.p
  3. Contains: QuickTime Cross-platform specific interfaces
  4. Version: Technology: QuickTime 5.0
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1997-2002 by Apple Computer, Inc., all rights reserved.
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://www.freepascal.org/bugs.html
  10. }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit QTML;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,Quickdraw,Events,MacMemory,MacWindows,OSUtils,Files;
  92. {$ALIGN MAC68K}
  93. {$ifc CALL_NOT_IN_CARBON}
  94. {
  95. * QTMLYieldCPU()
  96. *
  97. * Availability:
  98. * Non-Carbon CFM: not available
  99. * CarbonLib: not available
  100. * Mac OS X: not available
  101. * Windows: in qtmlClient.lib 3.0 and later
  102. }
  103. procedure QTMLYieldCPU; external name '_QTMLYieldCPU';
  104. {
  105. * QTMLYieldCPUTime()
  106. *
  107. * Availability:
  108. * Non-Carbon CFM: not available
  109. * CarbonLib: not available
  110. * Mac OS X: not available
  111. * Windows: in qtmlClient.lib 3.0 and later
  112. }
  113. procedure QTMLYieldCPUTime(milliSeconds: SInt32; flags: UInt32); external name '_QTMLYieldCPUTime';
  114. {$endc} {CALL_NOT_IN_CARBON}
  115. type
  116. QTMLMutex = ^SInt32; { an opaque 32-bit type }
  117. QTMLMutexPtr = ^QTMLMutex; { when a var xx:QTMLMutex parameter can be nil, it is changed to xx: QTMLMutexPtr }
  118. {$ifc NOT (TARGET_OS_MAC AND TARGET_API_MAC_OS8)}
  119. QTMLSyncVar = ^SInt32; { an opaque 32-bit type }
  120. QTMLSyncVarPtr = ^QTMLSyncVar; { when a var xx:QTMLSyncVar parameter can be nil, it is changed to xx: QTMLSyncVarPtr }
  121. const
  122. kInitializeQTMLNoSoundFlag = $00000001; { flag for requesting no sound when calling InitializeQTML }
  123. kInitializeQTMLUseGDIFlag = $00000002; { flag for requesting GDI when calling InitializeQTML }
  124. kInitializeQTMLDisableDirectSound = $00000004; { disables QTML's use of DirectSound }
  125. kInitializeQTMLUseExclusiveFullScreenModeFlag = $00000008; { later than QTML 3.0: qtml starts up in exclusive full screen mode }
  126. kInitializeQTMLDisableDDClippers = $00000010; { flag for requesting QTML not to use DirectDraw clipper objects; QTML 5.0 and later }
  127. kQTMLHandlePortEvents = $00000001; { flag for requesting requesting QTML to handle events }
  128. kQTMLNoIdleEvents = $00000002; { flag for requesting requesting QTML not to send Idle Events }
  129. {$ifc CALL_NOT_IN_CARBON}
  130. {
  131. * InitializeQTML()
  132. *
  133. * Availability:
  134. * Non-Carbon CFM: not available
  135. * CarbonLib: not available
  136. * Mac OS X: not available
  137. * Windows: in qtmlClient.lib 3.0 and later
  138. }
  139. function InitializeQTML(flag: SInt32): OSErr; external name '_InitializeQTML';
  140. {
  141. * TerminateQTML()
  142. *
  143. * Availability:
  144. * Non-Carbon CFM: not available
  145. * CarbonLib: not available
  146. * Mac OS X: not available
  147. * Windows: in qtmlClient.lib 3.0 and later
  148. }
  149. procedure TerminateQTML; external name '_TerminateQTML';
  150. {
  151. * CreatePortAssociation()
  152. *
  153. * Availability:
  154. * Non-Carbon CFM: not available
  155. * CarbonLib: not available
  156. * Mac OS X: not available
  157. * Windows: in qtmlClient.lib 3.0 and later
  158. }
  159. function CreatePortAssociation(theWnd: UnivPtr; storage: Ptr; flags: SInt32): GrafPtr; external name '_CreatePortAssociation';
  160. {
  161. * DestroyPortAssociation()
  162. *
  163. * Availability:
  164. * Non-Carbon CFM: not available
  165. * CarbonLib: not available
  166. * Mac OS X: not available
  167. * Windows: in qtmlClient.lib 3.0 and later
  168. }
  169. procedure DestroyPortAssociation(cgp: CGrafPtr); external name '_DestroyPortAssociation';
  170. {
  171. * QTMLGrabMutex()
  172. *
  173. * Availability:
  174. * Non-Carbon CFM: not available
  175. * CarbonLib: not available
  176. * Mac OS X: not available
  177. * Windows: in qtmlClient.lib 3.0 and later
  178. }
  179. procedure QTMLGrabMutex(mu: QTMLMutex); external name '_QTMLGrabMutex';
  180. {
  181. * QTMLTryGrabMutex()
  182. *
  183. * Availability:
  184. * Non-Carbon CFM: not available
  185. * CarbonLib: not available
  186. * Mac OS X: not available
  187. * Windows: in qtmlClient.lib 4.1 and later
  188. }
  189. function QTMLTryGrabMutex(mu: QTMLMutex): boolean; external name '_QTMLTryGrabMutex';
  190. {
  191. * QTMLReturnMutex()
  192. *
  193. * Availability:
  194. * Non-Carbon CFM: not available
  195. * CarbonLib: not available
  196. * Mac OS X: not available
  197. * Windows: in qtmlClient.lib 3.0 and later
  198. }
  199. procedure QTMLReturnMutex(mu: QTMLMutex); external name '_QTMLReturnMutex';
  200. {
  201. * QTMLCreateMutex()
  202. *
  203. * Availability:
  204. * Non-Carbon CFM: not available
  205. * CarbonLib: not available
  206. * Mac OS X: not available
  207. * Windows: in qtmlClient.lib 3.0 and later
  208. }
  209. function QTMLCreateMutex: QTMLMutex; external name '_QTMLCreateMutex';
  210. {
  211. * QTMLDestroyMutex()
  212. *
  213. * Availability:
  214. * Non-Carbon CFM: not available
  215. * CarbonLib: not available
  216. * Mac OS X: not available
  217. * Windows: in qtmlClient.lib 3.0 and later
  218. }
  219. procedure QTMLDestroyMutex(mu: QTMLMutex); external name '_QTMLDestroyMutex';
  220. {
  221. * QTMLCreateSyncVar()
  222. *
  223. * Availability:
  224. * Non-Carbon CFM: not available
  225. * CarbonLib: not available
  226. * Mac OS X: not available
  227. * Windows: in qtmlClient.lib 3.0 and later
  228. }
  229. function QTMLCreateSyncVar: QTMLSyncVarPtr; external name '_QTMLCreateSyncVar';
  230. {
  231. * QTMLDestroySyncVar()
  232. *
  233. * Availability:
  234. * Non-Carbon CFM: not available
  235. * CarbonLib: not available
  236. * Mac OS X: not available
  237. * Windows: in qtmlClient.lib 3.0 and later
  238. }
  239. procedure QTMLDestroySyncVar(p: QTMLSyncVarPtr); external name '_QTMLDestroySyncVar';
  240. {
  241. * QTMLTestAndSetSyncVar()
  242. *
  243. * Availability:
  244. * Non-Carbon CFM: not available
  245. * CarbonLib: not available
  246. * Mac OS X: not available
  247. * Windows: in qtmlClient.lib 3.0 and later
  248. }
  249. function QTMLTestAndSetSyncVar(sync: QTMLSyncVarPtr): SInt32; external name '_QTMLTestAndSetSyncVar';
  250. {
  251. * QTMLWaitAndSetSyncVar()
  252. *
  253. * Availability:
  254. * Non-Carbon CFM: not available
  255. * CarbonLib: not available
  256. * Mac OS X: not available
  257. * Windows: in qtmlClient.lib 3.0 and later
  258. }
  259. procedure QTMLWaitAndSetSyncVar(sync: QTMLSyncVarPtr); external name '_QTMLWaitAndSetSyncVar';
  260. {
  261. * QTMLResetSyncVar()
  262. *
  263. * Availability:
  264. * Non-Carbon CFM: not available
  265. * CarbonLib: not available
  266. * Mac OS X: not available
  267. * Windows: in qtmlClient.lib 3.0 and later
  268. }
  269. procedure QTMLResetSyncVar(sync: QTMLSyncVarPtr); external name '_QTMLResetSyncVar';
  270. {
  271. * InitializeQHdr()
  272. *
  273. * Availability:
  274. * Non-Carbon CFM: not available
  275. * CarbonLib: not available
  276. * Mac OS X: not available
  277. * Windows: in qtmlClient.lib 3.0 and later
  278. }
  279. procedure InitializeQHdr(var qhdr_: QHdr); external name '_InitializeQHdr';
  280. {
  281. * TerminateQHdr()
  282. *
  283. * Availability:
  284. * Non-Carbon CFM: not available
  285. * CarbonLib: not available
  286. * Mac OS X: not available
  287. * Windows: in qtmlClient.lib 3.0 and later
  288. }
  289. procedure TerminateQHdr(var qhdr_: QHdr); external name '_TerminateQHdr';
  290. {
  291. * QTMLAcquireWindowList()
  292. *
  293. * Availability:
  294. * Non-Carbon CFM: not available
  295. * CarbonLib: not available
  296. * Mac OS X: not available
  297. * Windows: in qtmlClient.lib 3.0 and later
  298. }
  299. procedure QTMLAcquireWindowList; external name '_QTMLAcquireWindowList';
  300. {
  301. * QTMLReleaseWindowList()
  302. *
  303. * Availability:
  304. * Non-Carbon CFM: not available
  305. * CarbonLib: not available
  306. * Mac OS X: not available
  307. * Windows: in qtmlClient.lib 3.0 and later
  308. }
  309. procedure QTMLReleaseWindowList; external name '_QTMLReleaseWindowList';
  310. {
  311. These routines are here to support "interrupt level" code
  312. These are dangerous routines, only use if you know what you are doing.
  313. }
  314. {
  315. * QTMLRegisterInterruptSafeThread()
  316. *
  317. * Availability:
  318. * Non-Carbon CFM: not available
  319. * CarbonLib: not available
  320. * Mac OS X: not available
  321. * Windows: in qtmlClient.lib 3.0 and later
  322. }
  323. function QTMLRegisterInterruptSafeThread(threadID: UInt32; threadInfo: UnivPtr): SInt32; external name '_QTMLRegisterInterruptSafeThread';
  324. {
  325. * QTMLUnregisterInterruptSafeThread()
  326. *
  327. * Availability:
  328. * Non-Carbon CFM: not available
  329. * CarbonLib: not available
  330. * Mac OS X: not available
  331. * Windows: in qtmlClient.lib 3.0 and later
  332. }
  333. function QTMLUnregisterInterruptSafeThread(threadID: UInt32): SInt32; external name '_QTMLUnregisterInterruptSafeThread';
  334. {
  335. * NativeEventToMacEvent()
  336. *
  337. * Availability:
  338. * Non-Carbon CFM: not available
  339. * CarbonLib: not available
  340. * Mac OS X: not available
  341. * Windows: in qtmlClient.lib 3.0 and later
  342. }
  343. function NativeEventToMacEvent(nativeEvent: UnivPtr; var macEvent: EventRecord): SInt32; external name '_NativeEventToMacEvent';
  344. {$endc} {CALL_NOT_IN_CARBON}
  345. {$ifc TARGET_OS_WIN32}
  346. {$ifc CALL_NOT_IN_CARBON}
  347. {
  348. * WinEventToMacEvent()
  349. *
  350. * Availability:
  351. * Non-Carbon CFM: not available
  352. * CarbonLib: not available
  353. * Mac OS X: not available
  354. * Windows: in qtmlClient.lib 3.0 and later
  355. }
  356. function WinEventToMacEvent(winMsg: UnivPtr; var macEvent: EventRecord): SInt32; external name '_WinEventToMacEvent';
  357. {
  358. * IsTaskBarVisible()
  359. *
  360. * Availability:
  361. * Non-Carbon CFM: not available
  362. * CarbonLib: not available
  363. * Mac OS X: not available
  364. * Windows: in qtmlClient.lib 3.0 and later
  365. }
  366. function IsTaskBarVisible: boolean; external name '_IsTaskBarVisible';
  367. {
  368. * ShowHideTaskBar()
  369. *
  370. * Availability:
  371. * Non-Carbon CFM: not available
  372. * CarbonLib: not available
  373. * Mac OS X: not available
  374. * Windows: in qtmlClient.lib 3.0 and later
  375. }
  376. procedure ShowHideTaskBar(showIt: boolean); external name '_ShowHideTaskBar';
  377. {$endc} {CALL_NOT_IN_CARBON}
  378. const
  379. kDDSurfaceLocked = $00000001;
  380. kDDSurfaceStatic = $00000002;
  381. {$ifc CALL_NOT_IN_CARBON}
  382. {
  383. * QTGetDDObject()
  384. *
  385. * Availability:
  386. * Non-Carbon CFM: not available
  387. * CarbonLib: not available
  388. * Mac OS X: not available
  389. * Windows: in qtmlClient.lib 3.0 and later
  390. }
  391. function QTGetDDObject(var lpDDObject: UnivPtr): OSErr; external name '_QTGetDDObject';
  392. {
  393. * QTSetDDObject()
  394. *
  395. * Availability:
  396. * Non-Carbon CFM: not available
  397. * CarbonLib: not available
  398. * Mac OS X: not available
  399. * Windows: in qtmlClient.lib 3.0 and later
  400. }
  401. function QTSetDDObject(lpNewDDObject: UnivPtr): OSErr; external name '_QTSetDDObject';
  402. {
  403. * QTSetDDPrimarySurface()
  404. *
  405. * Availability:
  406. * Non-Carbon CFM: not available
  407. * CarbonLib: not available
  408. * Mac OS X: not available
  409. * Windows: in qtmlClient.lib 3.0 and later
  410. }
  411. function QTSetDDPrimarySurface(lpNewDDSurface: UnivPtr; flags: UInt32): OSErr; external name '_QTSetDDPrimarySurface';
  412. {
  413. * QTMLGetVolumeRootPath()
  414. *
  415. * Availability:
  416. * Non-Carbon CFM: not available
  417. * CarbonLib: not available
  418. * Mac OS X: not available
  419. * Windows: in qtmlClient.lib 3.0 and later
  420. }
  421. function QTMLGetVolumeRootPath(fullPath: CStringPtr; volumeRootPath: CStringPtr; volumeRootLen: UInt32): OSErr; external name '_QTMLGetVolumeRootPath';
  422. {
  423. * QTMLSetWindowWndProc()
  424. *
  425. * Availability:
  426. * Non-Carbon CFM: not available
  427. * CarbonLib: not available
  428. * Mac OS X: not available
  429. * Windows: in qtmlClient.lib 3.0 and later
  430. }
  431. procedure QTMLSetWindowWndProc(theWindow: WindowRef; windowProc: UnivPtr); external name '_QTMLSetWindowWndProc';
  432. {
  433. * QTMLGetWindowWndProc()
  434. *
  435. * Availability:
  436. * Non-Carbon CFM: not available
  437. * CarbonLib: not available
  438. * Mac OS X: not available
  439. * Windows: in qtmlClient.lib 3.0 and later
  440. }
  441. function QTMLGetWindowWndProc(theWindow: WindowRef): Ptr; external name '_QTMLGetWindowWndProc';
  442. {$endc} {CALL_NOT_IN_CARBON}
  443. {$endc} {TARGET_OS_WIN32}
  444. {$ifc CALL_NOT_IN_CARBON}
  445. {
  446. * QTMLGetCanonicalPathName()
  447. *
  448. * Availability:
  449. * Non-Carbon CFM: not available
  450. * CarbonLib: not available
  451. * Mac OS X: not available
  452. * Windows: in qtmlClient.lib 3.0 and later
  453. }
  454. function QTMLGetCanonicalPathName(inName: CStringPtr; outName: CStringPtr; outLen: UInt32): OSErr; external name '_QTMLGetCanonicalPathName';
  455. {$endc} {CALL_NOT_IN_CARBON}
  456. const
  457. kFullNativePath = 0;
  458. kFileNameOnly = $01;
  459. kDirectoryPathOnly = $02;
  460. kUFSFullPathName = $04;
  461. kTryVDIMask = $08; { Used in NativePathNameToFSSpec to specify to search VDI mountpoints }
  462. kFullPathSpecifiedMask = $10; { the passed in name is a fully qualified full path }
  463. {$ifc CALL_NOT_IN_CARBON}
  464. {
  465. * FSSpecToNativePathName()
  466. *
  467. * Availability:
  468. * Non-Carbon CFM: not available
  469. * CarbonLib: not available
  470. * Mac OS X: not available
  471. * Windows: in qtmlClient.lib 3.0 and later
  472. }
  473. function FSSpecToNativePathName(const (*var*) inFile: FSSpec; outName: CStringPtr; outLen: UInt32; flags: SInt32): OSErr; external name '_FSSpecToNativePathName';
  474. {$endc} {CALL_NOT_IN_CARBON}
  475. const
  476. kErrorIfFileNotFound = $80000000;
  477. {$ifc CALL_NOT_IN_CARBON}
  478. {
  479. * NativePathNameToFSSpec()
  480. *
  481. * Availability:
  482. * Non-Carbon CFM: not available
  483. * CarbonLib: not available
  484. * Mac OS X: not available
  485. * Windows: in qtmlClient.lib 3.0 and later
  486. }
  487. function NativePathNameToFSSpec(inName: CStringPtr; var outFile: FSSpec; flags: SInt32): OSErr; external name '_NativePathNameToFSSpec';
  488. {
  489. * QTGetAliasInfo()
  490. *
  491. * Availability:
  492. * Non-Carbon CFM: not available
  493. * CarbonLib: not available
  494. * Mac OS X: not available
  495. * Windows: in qtmlClient.lib 5.0 and later
  496. }
  497. function QTGetAliasInfo(alias: AliasHandle; index: AliasInfoType; outBuf: CStringPtr; bufLen: SInt32; var outLen: SInt32; flags: UInt32): OSErr; external name '_QTGetAliasInfo';
  498. {$endc} {CALL_NOT_IN_CARBON}
  499. {$endc}
  500. {$ALIGN MAC68K}
  501. end.