Resources.pas 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968
  1. {
  2. File: Resources.p
  3. Contains: Resource Manager Interfaces.
  4. Version: Technology: Mac OS 8.1
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1985-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 Resources;
  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,MixedMode,Files;
  92. {$ALIGN MAC68K}
  93. const
  94. resSysHeap = 64; { System or application heap? }
  95. resPurgeable = 32; { Purgeable resource? }
  96. resLocked = 16; { Load it in locked? }
  97. resProtected = 8; { Protected? }
  98. resPreload = 4; { Load in on OpenResFile? }
  99. resChanged = 2; { Resource changed? }
  100. mapReadOnly = 128; { Resource file read-only }
  101. mapCompact = 64; { Compact resource file }
  102. mapChanged = 32; { Write map out at update }
  103. resSysRefBit = 7; { reference to system/local reference }
  104. resSysHeapBit = 6; { In system/in application heap }
  105. resPurgeableBit = 5; { Purgeable/not purgeable }
  106. resLockedBit = 4; { Locked/not locked }
  107. resProtectedBit = 3; { Protected/not protected }
  108. resPreloadBit = 2; { Read in at OpenResource? }
  109. resChangedBit = 1; { Existing resource changed since last update }
  110. mapReadOnlyBit = 7; { is this file read-only? }
  111. mapCompactBit = 6; { Is a compact necessary? }
  112. mapChangedBit = 5; { Is it necessary to write map? }
  113. kResFileNotOpened = -1; { ref num return as error when opening a resource file }
  114. kSystemResFile = 0; { this is the default ref num to the system file }
  115. type
  116. {$ifc TYPED_FUNCTION_POINTERS}
  117. ResErrProcPtr = procedure(thErr: OSErr);
  118. {$elsec}
  119. ResErrProcPtr = Register68kProcPtr;
  120. {$endc}
  121. {$ifc OPAQUE_UPP_TYPES}
  122. ResErrUPP = ^SInt32; { an opaque UPP }
  123. {$elsec}
  124. ResErrUPP = UniversalProcPtr;
  125. {$endc}
  126. const
  127. uppResErrProcInfo = $00001002;
  128. {
  129. * NewResErrUPP()
  130. *
  131. * Availability:
  132. * Non-Carbon CFM: available as macro/inline
  133. * CarbonLib: in CarbonLib 1.0 and later
  134. * Mac OS X: in version 10.0 and later
  135. }
  136. function NewResErrUPP(userRoutine: ResErrProcPtr): ResErrUPP; external name '_NewResErrUPP'; { old name was NewResErrProc }
  137. {
  138. * DisposeResErrUPP()
  139. *
  140. * Availability:
  141. * Non-Carbon CFM: available as macro/inline
  142. * CarbonLib: in CarbonLib 1.0 and later
  143. * Mac OS X: in version 10.0 and later
  144. }
  145. procedure DisposeResErrUPP(userUPP: ResErrUPP); external name '_DisposeResErrUPP';
  146. {
  147. * InvokeResErrUPP()
  148. *
  149. * Availability:
  150. * Non-Carbon CFM: available as macro/inline
  151. * CarbonLib: in CarbonLib 1.0 and later
  152. * Mac OS X: in version 10.0 and later
  153. }
  154. procedure InvokeResErrUPP(thErr: OSErr; userRoutine: ResErrUPP); external name '_InvokeResErrUPP'; { old name was CallResErrProc }
  155. { QuickTime 3.0 }
  156. type
  157. {$ifc TYPED_FUNCTION_POINTERS}
  158. ResourceEndianFilterPtr = function(theResource: Handle; currentlyNativeEndian: boolean): OSErr;
  159. {$elsec}
  160. ResourceEndianFilterPtr = ProcPtr;
  161. {$endc}
  162. {$ifc CALL_NOT_IN_CARBON}
  163. {
  164. * InitResources()
  165. *
  166. * Availability:
  167. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  168. * CarbonLib: not available
  169. * Mac OS X: not available
  170. }
  171. function InitResources: SInt16; external name '_InitResources';
  172. {
  173. * RsrcZoneInit()
  174. *
  175. * Availability:
  176. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  177. * CarbonLib: not available
  178. * Mac OS X: not available
  179. }
  180. procedure RsrcZoneInit; external name '_RsrcZoneInit';
  181. {$endc} {CALL_NOT_IN_CARBON}
  182. {
  183. * CloseResFile()
  184. *
  185. * Availability:
  186. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  187. * CarbonLib: in CarbonLib 1.0 and later
  188. * Mac OS X: in version 10.0 and later
  189. }
  190. procedure CloseResFile(refNum: SInt16); external name '_CloseResFile';
  191. {
  192. * ResError()
  193. *
  194. * Availability:
  195. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  196. * CarbonLib: in CarbonLib 1.0 and later
  197. * Mac OS X: in version 10.0 and later
  198. }
  199. function ResError: OSErr; external name '_ResError';
  200. {
  201. * CurResFile()
  202. *
  203. * Availability:
  204. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  205. * CarbonLib: in CarbonLib 1.0 and later
  206. * Mac OS X: in version 10.0 and later
  207. }
  208. function CurResFile: SInt16; external name '_CurResFile';
  209. {
  210. * HomeResFile()
  211. *
  212. * Availability:
  213. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  214. * CarbonLib: in CarbonLib 1.0 and later
  215. * Mac OS X: in version 10.0 and later
  216. }
  217. function HomeResFile(theResource: Handle): SInt16; external name '_HomeResFile';
  218. {$ifc CALL_NOT_IN_CARBON}
  219. {
  220. * CreateResFile()
  221. *
  222. * Availability:
  223. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  224. * CarbonLib: not available
  225. * Mac OS X: not available
  226. }
  227. procedure CreateResFile(const (*var*) fileName: Str255); external name '_CreateResFile';
  228. {
  229. * OpenResFile()
  230. *
  231. * Availability:
  232. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  233. * CarbonLib: not available
  234. * Mac OS X: not available
  235. }
  236. function OpenResFile(const (*var*) fileName: Str255): SInt16; external name '_OpenResFile';
  237. {$endc} {CALL_NOT_IN_CARBON}
  238. {
  239. * UseResFile()
  240. *
  241. * Availability:
  242. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  243. * CarbonLib: in CarbonLib 1.0 and later
  244. * Mac OS X: in version 10.0 and later
  245. }
  246. procedure UseResFile(refNum: SInt16); external name '_UseResFile';
  247. {
  248. * CountTypes()
  249. *
  250. * Availability:
  251. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  252. * CarbonLib: in CarbonLib 1.0 and later
  253. * Mac OS X: in version 10.0 and later
  254. }
  255. function CountTypes: SInt16; external name '_CountTypes';
  256. {
  257. * Count1Types()
  258. *
  259. * Availability:
  260. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  261. * CarbonLib: in CarbonLib 1.0 and later
  262. * Mac OS X: in version 10.0 and later
  263. }
  264. function Count1Types: SInt16; external name '_Count1Types';
  265. {
  266. * GetIndType()
  267. *
  268. * Availability:
  269. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  270. * CarbonLib: in CarbonLib 1.0 and later
  271. * Mac OS X: in version 10.0 and later
  272. }
  273. procedure GetIndType(var theType: ResType; index: SInt16); external name '_GetIndType';
  274. {
  275. * Get1IndType()
  276. *
  277. * Availability:
  278. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  279. * CarbonLib: in CarbonLib 1.0 and later
  280. * Mac OS X: in version 10.0 and later
  281. }
  282. procedure Get1IndType(var theType: ResType; index: SInt16); external name '_Get1IndType';
  283. {
  284. * SetResLoad()
  285. *
  286. * Availability:
  287. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  288. * CarbonLib: in CarbonLib 1.0 and later
  289. * Mac OS X: in version 10.0 and later
  290. }
  291. procedure SetResLoad(load: boolean); external name '_SetResLoad';
  292. {
  293. * CountResources()
  294. *
  295. * Availability:
  296. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  297. * CarbonLib: in CarbonLib 1.0 and later
  298. * Mac OS X: in version 10.0 and later
  299. }
  300. function CountResources(theType: ResType): SInt16; external name '_CountResources';
  301. {
  302. * Count1Resources()
  303. *
  304. * Availability:
  305. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  306. * CarbonLib: in CarbonLib 1.0 and later
  307. * Mac OS X: in version 10.0 and later
  308. }
  309. function Count1Resources(theType: ResType): SInt16; external name '_Count1Resources';
  310. {
  311. * GetIndResource()
  312. *
  313. * Availability:
  314. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  315. * CarbonLib: in CarbonLib 1.0 and later
  316. * Mac OS X: in version 10.0 and later
  317. }
  318. function GetIndResource(theType: ResType; index: SInt16): Handle; external name '_GetIndResource';
  319. {
  320. * Get1IndResource()
  321. *
  322. * Availability:
  323. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  324. * CarbonLib: in CarbonLib 1.0 and later
  325. * Mac OS X: in version 10.0 and later
  326. }
  327. function Get1IndResource(theType: ResType; index: SInt16): Handle; external name '_Get1IndResource';
  328. {
  329. * GetResource()
  330. *
  331. * Availability:
  332. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  333. * CarbonLib: in CarbonLib 1.0 and later
  334. * Mac OS X: in version 10.0 and later
  335. }
  336. function GetResource(theType: ResType; theID: SInt16): Handle; external name '_GetResource';
  337. {
  338. * Get1Resource()
  339. *
  340. * Availability:
  341. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  342. * CarbonLib: in CarbonLib 1.0 and later
  343. * Mac OS X: in version 10.0 and later
  344. }
  345. function Get1Resource(theType: ResType; theID: SInt16): Handle; external name '_Get1Resource';
  346. {
  347. * GetNamedResource()
  348. *
  349. * Availability:
  350. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  351. * CarbonLib: in CarbonLib 1.0 and later
  352. * Mac OS X: in version 10.0 and later
  353. }
  354. function GetNamedResource(theType: ResType; const (*var*) name: Str255): Handle; external name '_GetNamedResource';
  355. {
  356. * Get1NamedResource()
  357. *
  358. * Availability:
  359. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  360. * CarbonLib: in CarbonLib 1.0 and later
  361. * Mac OS X: in version 10.0 and later
  362. }
  363. function Get1NamedResource(theType: ResType; const (*var*) name: Str255): Handle; external name '_Get1NamedResource';
  364. {
  365. * [Mac]LoadResource()
  366. *
  367. * Availability:
  368. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  369. * CarbonLib: in CarbonLib 1.0 and later
  370. * Mac OS X: in version 10.0 and later
  371. }
  372. procedure LoadResource(theResource: Handle); external name '_LoadResource';
  373. {
  374. * ReleaseResource()
  375. *
  376. * Availability:
  377. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  378. * CarbonLib: in CarbonLib 1.0 and later
  379. * Mac OS X: in version 10.0 and later
  380. }
  381. procedure ReleaseResource(theResource: Handle); external name '_ReleaseResource';
  382. {
  383. * DetachResource()
  384. *
  385. * Availability:
  386. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  387. * CarbonLib: in CarbonLib 1.0 and later
  388. * Mac OS X: in version 10.0 and later
  389. }
  390. procedure DetachResource(theResource: Handle); external name '_DetachResource';
  391. {
  392. * UniqueID()
  393. *
  394. * Availability:
  395. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  396. * CarbonLib: in CarbonLib 1.0 and later
  397. * Mac OS X: in version 10.0 and later
  398. }
  399. function UniqueID(theType: ResType): SInt16; external name '_UniqueID';
  400. {
  401. * Unique1ID()
  402. *
  403. * Availability:
  404. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  405. * CarbonLib: in CarbonLib 1.0 and later
  406. * Mac OS X: in version 10.0 and later
  407. }
  408. function Unique1ID(theType: ResType): SInt16; external name '_Unique1ID';
  409. {
  410. * GetResAttrs()
  411. *
  412. * Availability:
  413. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  414. * CarbonLib: in CarbonLib 1.0 and later
  415. * Mac OS X: in version 10.0 and later
  416. }
  417. function GetResAttrs(theResource: Handle): SInt16; external name '_GetResAttrs';
  418. {
  419. * GetResInfo()
  420. *
  421. * Availability:
  422. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  423. * CarbonLib: in CarbonLib 1.0 and later
  424. * Mac OS X: in version 10.0 and later
  425. }
  426. procedure GetResInfo(theResource: Handle; var theID: SInt16; var theType: ResType; var name: Str255); external name '_GetResInfo';
  427. {
  428. * SetResInfo()
  429. *
  430. * Availability:
  431. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  432. * CarbonLib: in CarbonLib 1.0 and later
  433. * Mac OS X: in version 10.0 and later
  434. }
  435. procedure SetResInfo(theResource: Handle; theID: SInt16; const (*var*) name: Str255); external name '_SetResInfo';
  436. {
  437. * AddResource()
  438. *
  439. * Availability:
  440. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  441. * CarbonLib: in CarbonLib 1.0 and later
  442. * Mac OS X: in version 10.0 and later
  443. }
  444. procedure AddResource(theData: Handle; theType: ResType; theID: SInt16; const (*var*) name: Str255); external name '_AddResource';
  445. {
  446. * GetResourceSizeOnDisk()
  447. *
  448. * Availability:
  449. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  450. * CarbonLib: in CarbonLib 1.0 and later
  451. * Mac OS X: in version 10.0 and later
  452. }
  453. function GetResourceSizeOnDisk(theResource: Handle): SInt32; external name '_GetResourceSizeOnDisk';
  454. {
  455. * GetMaxResourceSize()
  456. *
  457. * Availability:
  458. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  459. * CarbonLib: in CarbonLib 1.0 and later
  460. * Mac OS X: in version 10.0 and later
  461. }
  462. function GetMaxResourceSize(theResource: Handle): SInt32; external name '_GetMaxResourceSize';
  463. {$ifc CALL_NOT_IN_CARBON}
  464. {
  465. * RsrcMapEntry()
  466. *
  467. * Availability:
  468. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  469. * CarbonLib: not available
  470. * Mac OS X: not available
  471. }
  472. function RsrcMapEntry(theResource: Handle): SInt32; external name '_RsrcMapEntry';
  473. {$endc} {CALL_NOT_IN_CARBON}
  474. {
  475. * SetResAttrs()
  476. *
  477. * Availability:
  478. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  479. * CarbonLib: in CarbonLib 1.0 and later
  480. * Mac OS X: in version 10.0 and later
  481. }
  482. procedure SetResAttrs(theResource: Handle; attrs: SInt16); external name '_SetResAttrs';
  483. {
  484. * ChangedResource()
  485. *
  486. * Availability:
  487. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  488. * CarbonLib: in CarbonLib 1.0 and later
  489. * Mac OS X: in version 10.0 and later
  490. }
  491. procedure ChangedResource(theResource: Handle); external name '_ChangedResource';
  492. {
  493. * RemoveResource()
  494. *
  495. * Availability:
  496. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  497. * CarbonLib: in CarbonLib 1.0 and later
  498. * Mac OS X: in version 10.0 and later
  499. }
  500. procedure RemoveResource(theResource: Handle); external name '_RemoveResource';
  501. {
  502. * UpdateResFile()
  503. *
  504. * Availability:
  505. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  506. * CarbonLib: in CarbonLib 1.0 and later
  507. * Mac OS X: in version 10.0 and later
  508. }
  509. procedure UpdateResFile(refNum: SInt16); external name '_UpdateResFile';
  510. {
  511. * WriteResource()
  512. *
  513. * Availability:
  514. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  515. * CarbonLib: in CarbonLib 1.0 and later
  516. * Mac OS X: in version 10.0 and later
  517. }
  518. procedure WriteResource(theResource: Handle); external name '_WriteResource';
  519. {
  520. * SetResPurge()
  521. *
  522. * Availability:
  523. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  524. * CarbonLib: in CarbonLib 1.0 and later
  525. * Mac OS X: in version 10.0 and later
  526. }
  527. procedure SetResPurge(install: boolean); external name '_SetResPurge';
  528. {
  529. * GetResFileAttrs()
  530. *
  531. * Availability:
  532. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  533. * CarbonLib: in CarbonLib 1.0 and later
  534. * Mac OS X: in version 10.0 and later
  535. }
  536. function GetResFileAttrs(refNum: SInt16): SInt16; external name '_GetResFileAttrs';
  537. {
  538. * SetResFileAttrs()
  539. *
  540. * Availability:
  541. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  542. * CarbonLib: in CarbonLib 1.0 and later
  543. * Mac OS X: in version 10.0 and later
  544. }
  545. procedure SetResFileAttrs(refNum: SInt16; attrs: SInt16); external name '_SetResFileAttrs';
  546. {
  547. * OpenRFPerm()
  548. *
  549. * Availability:
  550. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  551. * CarbonLib: in CarbonLib 1.0 and later
  552. * Mac OS X: in version 10.0 and later
  553. }
  554. function OpenRFPerm(const (*var*) fileName: Str255; vRefNum: SInt16; permission: SInt8): SInt16; external name '_OpenRFPerm';
  555. {$ifc CALL_NOT_IN_CARBON}
  556. {
  557. * RGetResource()
  558. *
  559. * Availability:
  560. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  561. * CarbonLib: not available
  562. * Mac OS X: not available
  563. }
  564. function RGetResource(theType: ResType; theID: SInt16): Handle; external name '_RGetResource';
  565. {$endc} {CALL_NOT_IN_CARBON}
  566. {
  567. * HOpenResFile()
  568. *
  569. * Availability:
  570. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  571. * CarbonLib: in CarbonLib 1.0 and later
  572. * Mac OS X: in version 10.0 and later
  573. }
  574. function HOpenResFile(vRefNum: SInt16; dirID: SInt32; const (*var*) fileName: Str255; permission: SInt8): SInt16; external name '_HOpenResFile';
  575. {
  576. * HCreateResFile()
  577. *
  578. * Availability:
  579. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  580. * CarbonLib: in CarbonLib 1.0 and later
  581. * Mac OS X: in version 10.0 and later
  582. }
  583. procedure HCreateResFile(vRefNum: SInt16; dirID: SInt32; const (*var*) fileName: Str255); external name '_HCreateResFile';
  584. {
  585. * FSpOpenResFile()
  586. *
  587. * Availability:
  588. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  589. * CarbonLib: in CarbonLib 1.0 and later
  590. * Mac OS X: in version 10.0 and later
  591. }
  592. function FSpOpenResFile(const (*var*) spec: FSSpec; permission: SignedByte): SInt16; external name '_FSpOpenResFile';
  593. {
  594. * FSpCreateResFile()
  595. *
  596. * Availability:
  597. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  598. * CarbonLib: in CarbonLib 1.0 and later
  599. * Mac OS X: in version 10.0 and later
  600. }
  601. procedure FSpCreateResFile(const (*var*) spec: FSSpec; creator: OSType; fileType: OSType; scriptTag: ScriptCode); external name '_FSpCreateResFile';
  602. {
  603. * ReadPartialResource()
  604. *
  605. * Availability:
  606. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  607. * CarbonLib: in CarbonLib 1.0 and later
  608. * Mac OS X: in version 10.0 and later
  609. }
  610. procedure ReadPartialResource(theResource: Handle; offset: SInt32; buffer: UnivPtr; count: SInt32); external name '_ReadPartialResource';
  611. {
  612. * WritePartialResource()
  613. *
  614. * Availability:
  615. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  616. * CarbonLib: in CarbonLib 1.0 and later
  617. * Mac OS X: in version 10.0 and later
  618. }
  619. procedure WritePartialResource(theResource: Handle; offset: SInt32; buffer: UnivPtr; count: SInt32); external name '_WritePartialResource';
  620. {
  621. * SetResourceSize()
  622. *
  623. * Availability:
  624. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  625. * CarbonLib: in CarbonLib 1.0 and later
  626. * Mac OS X: in version 10.0 and later
  627. }
  628. procedure SetResourceSize(theResource: Handle; newSize: SInt32); external name '_SetResourceSize';
  629. {
  630. * GetNextFOND()
  631. *
  632. * Availability:
  633. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  634. * CarbonLib: in CarbonLib 1.0 and later
  635. * Mac OS X: in version 10.0 and later
  636. }
  637. function GetNextFOND(fondHandle: Handle): Handle; external name '_GetNextFOND';
  638. { QuickTime 3.0 }
  639. {$ifc CALL_NOT_IN_CARBON}
  640. {
  641. * RegisterResourceEndianFilter()
  642. *
  643. * Availability:
  644. * Non-Carbon CFM: not available
  645. * CarbonLib: not available
  646. * Mac OS X: not available
  647. }
  648. function RegisterResourceEndianFilter(theType: ResType; theFilterProc: ResourceEndianFilterPtr): OSErr; external name '_RegisterResourceEndianFilter';
  649. { Use TempInsertROMMap to force the ROM resource map to be
  650. inserted into the chain in front of the system. Note that
  651. this call is only temporary - the modified resource chain
  652. is only used for the next call to the resource manager.
  653. See IM IV 19 for more information.
  654. }
  655. {
  656. * TempInsertROMMap()
  657. *
  658. * Availability:
  659. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  660. * CarbonLib: not available
  661. * Mac OS X: not available
  662. }
  663. procedure TempInsertROMMap(tempResLoad: boolean); external name '_TempInsertROMMap';
  664. {
  665. _________________________________________________________________________________________________________
  666. ¥ RESOURCE CHAIN LOCATION - for use with the Resource Manager chain manipulation routines under Carbon.
  667. _________________________________________________________________________________________________________
  668. }
  669. {$endc} {CALL_NOT_IN_CARBON}
  670. type
  671. RsrcChainLocation = SInt16;
  672. const
  673. kRsrcChainBelowSystemMap = 0; { Below the system's resource map }
  674. kRsrcChainBelowApplicationMap = 1; { Below the application's resource map }
  675. kRsrcChainAboveApplicationMap = 2; { Above the application's resource map }
  676. kRsrcChainAboveAllMaps = 4; { Above all resource maps }
  677. {
  678. If the file is already in the resource chain, it is removed and re-inserted at the specified location
  679. If the file has been detached, it is added to the resource chain at the specified location
  680. Returns resFNotFound if it's not currently open.
  681. }
  682. {
  683. * InsertResourceFile()
  684. *
  685. * Availability:
  686. * Non-Carbon CFM: not available
  687. * CarbonLib: in CarbonLib 1.0 and later
  688. * Mac OS X: in version 10.0 and later
  689. }
  690. function InsertResourceFile(refNum: SInt16; where: RsrcChainLocation): OSErr; external name '_InsertResourceFile';
  691. {
  692. If the file is not currently in the resource chain, this returns resNotFound
  693. Otherwise, the resource file is removed from the resource chain.
  694. }
  695. {
  696. * DetachResourceFile()
  697. *
  698. * Availability:
  699. * Non-Carbon CFM: not available
  700. * CarbonLib: in CarbonLib 1.0 and later
  701. * Mac OS X: in version 10.0 and later
  702. }
  703. function DetachResourceFile(refNum: SInt16): OSErr; external name '_DetachResourceFile';
  704. {
  705. Returns true if the resource file is already open and known by the Resource Manager (i.e., it is
  706. either in the current resource chain or it's a detached resource file.) If it's in the resource
  707. chain, the inChain Boolean is set to true on exit and true is returned. If it's an open file, but
  708. the file is currently detached, inChain is set to false and true is returned. If the file is open,
  709. the refNum to the file is returned.
  710. }
  711. {
  712. * FSpResourceFileAlreadyOpen()
  713. *
  714. * Availability:
  715. * Non-Carbon CFM: in InterfaceLib 9.0 and later
  716. * CarbonLib: in CarbonLib 1.0 and later
  717. * Mac OS X: in version 10.0 and later
  718. }
  719. function FSpResourceFileAlreadyOpen(const (*var*) resourceFile: FSSpec; var inChain: boolean; var refNum: SInt16): boolean; external name '_FSpResourceFileAlreadyOpen';
  720. {
  721. FSpOpenOrphanResFile should be used to open a resource file that is persistent across all contexts,
  722. because using OpenResFile normally loads a map and all preloaded resources into the application
  723. context. FSpOpenOrphanResFile loads everything into the system context and detaches the file
  724. from the context in which it was opened. If the file is already in the resource chain and a new
  725. instance is not opened, FSpOpenOrphanResFile will return a paramErr.
  726. Use with care, as can and will fail if the map is very large or a lot of preload
  727. resources exist.
  728. }
  729. {
  730. * FSpOpenOrphanResFile()
  731. *
  732. * Availability:
  733. * Non-Carbon CFM: not available
  734. * CarbonLib: in CarbonLib 1.0 and later
  735. * Mac OS X: in version 10.0 and later
  736. }
  737. function FSpOpenOrphanResFile(const (*var*) spec: FSSpec; permission: SignedByte; var refNum: SInt16): OSErr; external name '_FSpOpenOrphanResFile';
  738. {
  739. GetTopResourceFile returns the refNum of the top most resource map in the current resource chain. If
  740. the resource chain is empty it returns resFNotFound.
  741. }
  742. {
  743. * GetTopResourceFile()
  744. *
  745. * Availability:
  746. * Non-Carbon CFM: not available
  747. * CarbonLib: in CarbonLib 1.0.2 and later
  748. * Mac OS X: in version 10.0 and later
  749. }
  750. function GetTopResourceFile(var refNum: SInt16): OSErr; external name '_GetTopResourceFile';
  751. {
  752. GetNextResourceFile can be used to iterate over resource files in the resource chain. By passing a
  753. valid refNum in curRefNum it will return in nextRefNum the refNum of the next file in
  754. the chain. If curRefNum is not found in the resource chain, GetNextResourceFile returns resFNotFound.
  755. When the end of the chain is reached GetNextResourceFile will return noErr and nextRefNum will be NIL.
  756. }
  757. {
  758. * GetNextResourceFile()
  759. *
  760. * Availability:
  761. * Non-Carbon CFM: not available
  762. * CarbonLib: in CarbonLib 1.0.2 and later
  763. * Mac OS X: in version 10.0 and later
  764. }
  765. function GetNextResourceFile(curRefNum: SInt16; var nextRefNum: SInt16): OSErr; external name '_GetNextResourceFile';
  766. {$ifc OLDROUTINENAMES}
  767. {$ifc CALL_NOT_IN_CARBON}
  768. {
  769. * SizeResource()
  770. *
  771. * Availability:
  772. * Non-Carbon CFM: not available
  773. * CarbonLib: not available
  774. * Mac OS X: not available
  775. }
  776. function SizeResource(theResource: Handle): SInt32; external name '_SizeResource';
  777. {
  778. * MaxSizeRsrc()
  779. *
  780. * Availability:
  781. * Non-Carbon CFM: not available
  782. * CarbonLib: not available
  783. * Mac OS X: not available
  784. }
  785. function MaxSizeRsrc(theResource: Handle): SInt32; external name '_MaxSizeRsrc';
  786. {
  787. * RmveResource()
  788. *
  789. * Availability:
  790. * Non-Carbon CFM: not available
  791. * CarbonLib: not available
  792. * Mac OS X: not available
  793. }
  794. procedure RmveResource(theResource: Handle); external name '_RmveResource';
  795. {$endc} {CALL_NOT_IN_CARBON}
  796. {$endc} {OLDROUTINENAMES}
  797. {
  798. * FSOpenResFile()
  799. *
  800. * Availability:
  801. * Non-Carbon CFM: in InterfaceLib 9.1 and later
  802. * CarbonLib: in CarbonLib 1.1 and later
  803. * Mac OS X: in version 10.0 and later
  804. }
  805. function FSOpenResFile(const (*var*) ref: FSRef; permission: SInt8): SInt16; external name '_FSOpenResFile';
  806. {
  807. * FSCreateResFile()
  808. *
  809. * Availability:
  810. * Non-Carbon CFM: in InterfaceLib 9.1 and later
  811. * CarbonLib: in CarbonLib 1.1 and later
  812. * Mac OS X: in version 10.0 and later
  813. }
  814. procedure FSCreateResFile(const (*var*) parentRef: FSRef; nameLength: UniCharCount; name: UniCharPtr; whichInfo: FSCatalogInfoBitmap; const (*var*) catalogInfo: FSCatalogInfo; newRef: FSRefPtr; newSpec: FSSpecPtr); external name '_FSCreateResFile';
  815. {
  816. * FSResourceFileAlreadyOpen()
  817. *
  818. * Availability:
  819. * Non-Carbon CFM: in InterfaceLib 9.1 and later
  820. * CarbonLib: in CarbonLib 1.1 and later
  821. * Mac OS X: in version 10.0 and later
  822. }
  823. function FSResourceFileAlreadyOpen(const (*var*) resourceFileRef: FSRef; var inChain: boolean; var refNum: SInt16): boolean; external name '_FSResourceFileAlreadyOpen';
  824. {
  825. * FSCreateResourceFile()
  826. *
  827. * Summary:
  828. * Creates a new resource file.
  829. *
  830. * Discussion:
  831. * This function creates a new file and initializes the specified
  832. * named fork as an empty resource fork. This function allows for
  833. * the creation of data fork only files which can be used for
  834. * storing resources. Passing in a null name defaults to using the
  835. * data fork.
  836. *
  837. * Parameters:
  838. *
  839. * parentRef:
  840. * The directory where the file is to be created
  841. *
  842. * nameLength:
  843. * Number of Unicode characters in the file's name
  844. *
  845. * name:
  846. * A pointer to the Unicode name
  847. *
  848. * whichInfo:
  849. * Which catalog info fields to set
  850. *
  851. * catalogInfo:
  852. * The values for catalog info fields to set; may be NULL
  853. *
  854. * forkNameLength:
  855. * The length of the fork name (in Unicode characters)
  856. *
  857. * forkName:
  858. * The name of the fork to initialize (in Unicode); may be NULL
  859. *
  860. * newRef:
  861. * A pointer to the FSRef for the new file; may be NULL
  862. *
  863. * newSpec:
  864. * A pointer to the FSSpec for the new directory; may be NULL
  865. *
  866. * Availability:
  867. * Non-Carbon CFM: not available
  868. * CarbonLib: in CarbonLib 1.3 and later
  869. * Mac OS X: in version 10.0 and later
  870. }
  871. function FSCreateResourceFile(const (*var*) parentRef: FSRef; nameLength: UniCharCount; name: UniCharPtr; whichInfo: FSCatalogInfoBitmap; catalogInfo: {Const}FSCatalogInfoPtr; forkNameLength: UniCharCount; forkName: UniCharPtr; newRef: FSRefPtr; newSpec: FSSpecPtr): OSErr; external name '_FSCreateResourceFile';
  872. {
  873. * FSOpenResourceFile()
  874. *
  875. * Summary:
  876. * Opens the specified named fork as a resource fork.
  877. *
  878. * Discussion:
  879. * This function allows any named fork of a file to be used for
  880. * storing resources. Passing in a null forkname will result in the
  881. * data fork being used.
  882. *
  883. * Parameters:
  884. *
  885. * ref:
  886. * The file containing the fork to open
  887. *
  888. * forkNameLength:
  889. * The length of the fork name (in Unicode characters)
  890. *
  891. * forkName:
  892. * The name of the fork to open (in Unicode); may be NULL
  893. *
  894. * permissions:
  895. * The access (read and/or write) you want
  896. *
  897. * refNum:
  898. * On exit the reference number for accessing the open fork
  899. *
  900. * Availability:
  901. * Non-Carbon CFM: not available
  902. * CarbonLib: in CarbonLib 1.3 and later
  903. * Mac OS X: in version 10.0 and later
  904. }
  905. function FSOpenResourceFile(const (*var*) ref: FSRef; forkNameLength: UniCharCount; forkName: UniCharPtr; permissions: SInt8; var refNum: SInt16): OSErr; external name '_FSOpenResourceFile';
  906. {
  907. These typedefs were originally created for the Copland Resource Mangager
  908. }
  909. type
  910. ResFileRefNum = SInt16;
  911. ResID = SInt16;
  912. ResAttributes = SInt16;
  913. ResFileAttributes = SInt16;
  914. {$ALIGN MAC68K}
  915. end.