ColorPicker.pas 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. {
  2. File: CommonPanels/ColorPicker.h
  3. Contains: Color Picker package Interfaces.
  4. Version: CommonPanels-94~602
  5. Copyright: © 1987-2008 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://bugs.freepascal.org
  9. }
  10. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  11. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  12. {
  13. Modified for use with Free Pascal
  14. Version 308
  15. Please report any bugs to <[email protected]>
  16. }
  17. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  18. {$mode macpas}
  19. {$modeswitch cblocks}
  20. {$packenum 1}
  21. {$macro on}
  22. {$inline on}
  23. {$calling mwpascal}
  24. unit ColorPicker;
  25. interface
  26. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  27. {$setc GAP_INTERFACES_VERSION := $0308}
  28. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  29. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  30. {$endc}
  31. {$ifc defined CPUPOWERPC and defined CPUI386}
  32. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  33. {$endc}
  34. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  35. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  36. {$endc}
  37. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  38. {$setc __ppc__ := 1}
  39. {$elsec}
  40. {$setc __ppc__ := 0}
  41. {$endc}
  42. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  43. {$setc __ppc64__ := 1}
  44. {$elsec}
  45. {$setc __ppc64__ := 0}
  46. {$endc}
  47. {$ifc not defined __i386__ and defined CPUI386}
  48. {$setc __i386__ := 1}
  49. {$elsec}
  50. {$setc __i386__ := 0}
  51. {$endc}
  52. {$ifc not defined __x86_64__ and defined CPUX86_64}
  53. {$setc __x86_64__ := 1}
  54. {$elsec}
  55. {$setc __x86_64__ := 0}
  56. {$endc}
  57. {$ifc not defined __arm__ and defined CPUARM}
  58. {$setc __arm__ := 1}
  59. {$elsec}
  60. {$setc __arm__ := 0}
  61. {$endc}
  62. {$ifc not defined __arm64__ and defined CPUAARCH64}
  63. {$setc __arm64__ := 1}
  64. {$elsec}
  65. {$setc __arm64__ := 0}
  66. {$endc}
  67. {$ifc defined cpu64}
  68. {$setc __LP64__ := 1}
  69. {$elsec}
  70. {$setc __LP64__ := 0}
  71. {$endc}
  72. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  73. {$error Conflicting definitions for __ppc__ and __i386__}
  74. {$endc}
  75. {$ifc defined __ppc__ and __ppc__}
  76. {$setc TARGET_CPU_PPC := TRUE}
  77. {$setc TARGET_CPU_PPC64 := FALSE}
  78. {$setc TARGET_CPU_X86 := FALSE}
  79. {$setc TARGET_CPU_X86_64 := FALSE}
  80. {$setc TARGET_CPU_ARM := FALSE}
  81. {$setc TARGET_CPU_ARM64 := FALSE}
  82. {$setc TARGET_OS_MAC := TRUE}
  83. {$setc TARGET_OS_IPHONE := FALSE}
  84. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  85. {$setc TARGET_OS_EMBEDDED := FALSE}
  86. {$elifc defined __ppc64__ and __ppc64__}
  87. {$setc TARGET_CPU_PPC := FALSE}
  88. {$setc TARGET_CPU_PPC64 := TRUE}
  89. {$setc TARGET_CPU_X86 := FALSE}
  90. {$setc TARGET_CPU_X86_64 := FALSE}
  91. {$setc TARGET_CPU_ARM := FALSE}
  92. {$setc TARGET_CPU_ARM64 := FALSE}
  93. {$setc TARGET_OS_MAC := TRUE}
  94. {$setc TARGET_OS_IPHONE := FALSE}
  95. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  96. {$setc TARGET_OS_EMBEDDED := FALSE}
  97. {$elifc defined __i386__ and __i386__}
  98. {$setc TARGET_CPU_PPC := FALSE}
  99. {$setc TARGET_CPU_PPC64 := FALSE}
  100. {$setc TARGET_CPU_X86 := TRUE}
  101. {$setc TARGET_CPU_X86_64 := FALSE}
  102. {$setc TARGET_CPU_ARM := FALSE}
  103. {$setc TARGET_CPU_ARM64 := FALSE}
  104. {$ifc defined(iphonesim)}
  105. {$setc TARGET_OS_MAC := FALSE}
  106. {$setc TARGET_OS_IPHONE := TRUE}
  107. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  108. {$elsec}
  109. {$setc TARGET_OS_MAC := TRUE}
  110. {$setc TARGET_OS_IPHONE := FALSE}
  111. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  112. {$endc}
  113. {$setc TARGET_OS_EMBEDDED := FALSE}
  114. {$elifc defined __x86_64__ and __x86_64__}
  115. {$setc TARGET_CPU_PPC := FALSE}
  116. {$setc TARGET_CPU_PPC64 := FALSE}
  117. {$setc TARGET_CPU_X86 := FALSE}
  118. {$setc TARGET_CPU_X86_64 := TRUE}
  119. {$setc TARGET_CPU_ARM := FALSE}
  120. {$setc TARGET_CPU_ARM64 := FALSE}
  121. {$ifc defined(iphonesim)}
  122. {$setc TARGET_OS_MAC := FALSE}
  123. {$setc TARGET_OS_IPHONE := TRUE}
  124. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  125. {$elsec}
  126. {$setc TARGET_OS_MAC := TRUE}
  127. {$setc TARGET_OS_IPHONE := FALSE}
  128. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  129. {$endc}
  130. {$setc TARGET_OS_EMBEDDED := FALSE}
  131. {$elifc defined __arm__ and __arm__}
  132. {$setc TARGET_CPU_PPC := FALSE}
  133. {$setc TARGET_CPU_PPC64 := FALSE}
  134. {$setc TARGET_CPU_X86 := FALSE}
  135. {$setc TARGET_CPU_X86_64 := FALSE}
  136. {$setc TARGET_CPU_ARM := TRUE}
  137. {$setc TARGET_CPU_ARM64 := FALSE}
  138. { will require compiler define when/if other Apple devices with ARM cpus ship }
  139. {$setc TARGET_OS_MAC := FALSE}
  140. {$setc TARGET_OS_IPHONE := TRUE}
  141. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  142. {$setc TARGET_OS_EMBEDDED := TRUE}
  143. {$elifc defined __arm64__ and __arm64__}
  144. {$setc TARGET_CPU_PPC := FALSE}
  145. {$setc TARGET_CPU_PPC64 := FALSE}
  146. {$setc TARGET_CPU_X86 := FALSE}
  147. {$setc TARGET_CPU_X86_64 := FALSE}
  148. {$setc TARGET_CPU_ARM := FALSE}
  149. {$setc TARGET_CPU_ARM64 := TRUE}
  150. { will require compiler define when/if other Apple devices with ARM cpus ship }
  151. {$setc TARGET_OS_MAC := FALSE}
  152. {$setc TARGET_OS_IPHONE := TRUE}
  153. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  154. {$setc TARGET_OS_EMBEDDED := TRUE}
  155. {$elsec}
  156. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  157. {$endc}
  158. {$ifc defined __LP64__ and __LP64__ }
  159. {$setc TARGET_CPU_64 := TRUE}
  160. {$elsec}
  161. {$setc TARGET_CPU_64 := FALSE}
  162. {$endc}
  163. {$ifc defined FPC_BIG_ENDIAN}
  164. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  165. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  166. {$elifc defined FPC_LITTLE_ENDIAN}
  167. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  168. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  169. {$elsec}
  170. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  171. {$endc}
  172. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  173. {$setc CALL_NOT_IN_CARBON := FALSE}
  174. {$setc OLDROUTINENAMES := FALSE}
  175. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  176. {$setc OPAQUE_UPP_TYPES := TRUE}
  177. {$setc OTCARBONAPPLICATION := TRUE}
  178. {$setc OTKERNEL := FALSE}
  179. {$setc PM_USE_SESSION_APIS := TRUE}
  180. {$setc TARGET_API_MAC_CARBON := TRUE}
  181. {$setc TARGET_API_MAC_OS8 := FALSE}
  182. {$setc TARGET_API_MAC_OSX := TRUE}
  183. {$setc TARGET_CARBON := TRUE}
  184. {$setc TARGET_CPU_68K := FALSE}
  185. {$setc TARGET_CPU_MIPS := FALSE}
  186. {$setc TARGET_CPU_SPARC := FALSE}
  187. {$setc TARGET_OS_UNIX := FALSE}
  188. {$setc TARGET_OS_WIN32 := FALSE}
  189. {$setc TARGET_RT_MAC_68881 := FALSE}
  190. {$setc TARGET_RT_MAC_CFM := FALSE}
  191. {$setc TARGET_RT_MAC_MACHO := TRUE}
  192. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  193. {$setc TYPE_BOOL := FALSE}
  194. {$setc TYPE_EXTENDED := FALSE}
  195. {$setc TYPE_LONGLONG := TRUE}
  196. uses MacTypes,ColorSyncDeprecated,MixedMode,QuickdrawTypes,Events;
  197. {$endc} {not MACOSALLINCLUDE}
  198. {$ifc TARGET_OS_MAC}
  199. {$ALIGN MAC68K}
  200. {$ifc not TARGET_CPU_64}
  201. const
  202. {Maximum small fract value, as long}
  203. kMaximumSmallFract = $0000FFFF;
  204. {$endc} {not TARGET_CPU_64}
  205. { These are legacy constants. The Color Picker on OS X uses the Cocoa NSColorPanel. }
  206. const
  207. kDefaultColorPickerWidth = 383;
  208. kDefaultColorPickerHeight = 238;
  209. type
  210. DialogPlacementSpec = SInt16;
  211. const
  212. kAtSpecifiedOrigin = 0;
  213. kDeepestColorScreen = 1;
  214. kCenterOnMainScreen = 2;
  215. { Since OS X uses the Cocoa NSColorPanel, the flags below are no longer used. }
  216. const
  217. kColorPickerDialogIsMoveable = 1;
  218. kColorPickerDialogIsModal = 2;
  219. kColorPickerCanModifyPalette = 4;
  220. kColorPickerCanAnimatePalette = 8;
  221. kColorPickerAppIsColorSyncAware = 16;
  222. kColorPickerInSystemDialog = 32;
  223. kColorPickerInApplicationDialog = 64;
  224. kColorPickerInPickerDialog = 128;
  225. kColorPickerDetachedFromChoices = 256;
  226. kColorPickerCallColorProcLive = 512;
  227. {$ifc OLDROUTINENAMES}
  228. {$ifc not TARGET_CPU_64}
  229. const
  230. {Maximum small fract value, as long}
  231. MaxSmallFract = $0000FFFF;
  232. {$endc} {not TARGET_CPU_64}
  233. const
  234. kDefaultWidth = 383;
  235. kDefaultHeight = 238;
  236. { Since OS X uses the Cocoa NSColorPanel, the flags below are no longer used. }
  237. const
  238. DialogIsMoveable = 1;
  239. DialogIsModal = 2;
  240. CanModifyPalette = 4;
  241. CanAnimatePalette = 8;
  242. AppIsColorSyncAware = 16;
  243. InSystemDialog = 32;
  244. InApplicationDialog = 64;
  245. InPickerDialog = 128;
  246. DetachedFromChoices = 256;
  247. CallColorProcLive = 512;
  248. {$endc} {OLDROUTINENAMES}
  249. {$ifc not TARGET_CPU_64}
  250. { A SmallFract value is just the fractional part of a Fixed number,
  251. which is the low order word. They can be
  252. assigned directly to and from INTEGERs. }
  253. { Unsigned fraction between 0 and 1 }
  254. type
  255. SmallFract = UInt16;
  256. HSVColorPtr = ^HSVColor;
  257. HSVColor = record
  258. hue: SmallFract; { Fraction of circle, red at 0 }
  259. saturation: SmallFract; { 0-1, 0 for gray, 1 for pure color }
  260. value: SmallFract; { 0-1, 0 for black, 1 for max intensity }
  261. end;
  262. type
  263. HSLColorPtr = ^HSLColor;
  264. HSLColor = record
  265. hue: SmallFract; { Fraction of circle, red at 0 }
  266. saturation: SmallFract; { 0-1, 0 for gray, 1 for pure color }
  267. lightness: SmallFract; { 0-1, 0 for black, 1 for white }
  268. end;
  269. type
  270. CMYColorPtr = ^CMYColor;
  271. CMYColor = record
  272. cyan: SmallFract;
  273. magenta: SmallFract;
  274. yellow: SmallFract;
  275. end;
  276. type
  277. PMColor = record
  278. profile: CMProfileHandle;
  279. color: CMColor;
  280. end;
  281. PMColorPtr = ^PMColor;
  282. {$endc} {not TARGET_CPU_64}
  283. type
  284. NPMColor = record
  285. profile: CMProfileRef;
  286. color: CMColor;
  287. end;
  288. NPMColorPtr = ^NPMColor;
  289. type
  290. Picker = ^OpaquePicker; { an opaque type }
  291. OpaquePicker = record end;
  292. PickerPtr = ^Picker; { when a var xx:Picker parameter can be nil, it is changed to xx: PickerPtr }
  293. { Since OS X uses the Cocoa NSColorPanel, the struct below is no longer used. }
  294. type
  295. PickerMenuItemInfoPtr = ^PickerMenuItemInfo;
  296. PickerMenuItemInfo = record
  297. editMenuID: SInt16;
  298. cutItem: SInt16;
  299. copyItem: SInt16;
  300. pasteItem: SInt16;
  301. clearItem: SInt16;
  302. undoItem: SInt16;
  303. end;
  304. { The following proc ptr is the only supported way to communicate with the Cocoa NSColorPanel on OS X. }
  305. type
  306. NColorChangedProcPtr = procedure( userData: SRefCon; var newColor: NPMColor );
  307. NColorChangedUPP = NColorChangedProcPtr;
  308. {
  309. * NewNColorChangedUPP()
  310. *
  311. * Availability:
  312. * Mac OS X: in version 10.0 and later in Carbon.framework
  313. * CarbonLib: in CarbonLib 1.0 and later
  314. * Non-Carbon CFM: available as macro/inline
  315. }
  316. function NewNColorChangedUPP( userRoutine: NColorChangedProcPtr ): NColorChangedUPP; external name '_NewNColorChangedUPP';
  317. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  318. {
  319. * DisposeNColorChangedUPP()
  320. *
  321. * Availability:
  322. * Mac OS X: in version 10.0 and later in Carbon.framework
  323. * CarbonLib: in CarbonLib 1.0 and later
  324. * Non-Carbon CFM: available as macro/inline
  325. }
  326. procedure DisposeNColorChangedUPP( userUPP: NColorChangedUPP ); external name '_DisposeNColorChangedUPP';
  327. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  328. {
  329. * InvokeNColorChangedUPP()
  330. *
  331. * Availability:
  332. * Mac OS X: in version 10.0 and later in Carbon.framework
  333. * CarbonLib: in CarbonLib 1.0 and later
  334. * Non-Carbon CFM: available as macro/inline
  335. }
  336. procedure InvokeNColorChangedUPP( userData: SRefCon; var newColor: NPMColor; userUPP: NColorChangedUPP ); external name '_InvokeNColorChangedUPP';
  337. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  338. {$ifc TARGET_CPU_64}
  339. type
  340. ColorChangedUPP = UnivPtr;
  341. UserEventUPP = UnivPtr;
  342. {$elsec}
  343. type
  344. ColorChangedProcPtr = procedure( userData: SInt32; var newColor: PMColor );
  345. UserEventProcPtr = function( var event: EventRecord ): Boolean;
  346. ColorChangedUPP = ColorChangedProcPtr;
  347. UserEventUPP = UserEventProcPtr;
  348. {
  349. * NewColorChangedUPP()
  350. *
  351. * Availability:
  352. * Mac OS X: in version 10.0 and later in Carbon.framework
  353. * CarbonLib: in CarbonLib 1.0 and later
  354. * Non-Carbon CFM: available as macro/inline
  355. }
  356. function NewColorChangedUPP( userRoutine: ColorChangedProcPtr ): ColorChangedUPP; external name '_NewColorChangedUPP';
  357. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  358. {
  359. * NewUserEventUPP()
  360. *
  361. * Availability:
  362. * Mac OS X: in version 10.0 and later in Carbon.framework
  363. * CarbonLib: in CarbonLib 1.0 and later
  364. * Non-Carbon CFM: available as macro/inline
  365. }
  366. function NewUserEventUPP( userRoutine: UserEventProcPtr ): UserEventUPP; external name '_NewUserEventUPP';
  367. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  368. {
  369. * DisposeColorChangedUPP()
  370. *
  371. * Availability:
  372. * Mac OS X: in version 10.0 and later in Carbon.framework
  373. * CarbonLib: in CarbonLib 1.0 and later
  374. * Non-Carbon CFM: available as macro/inline
  375. }
  376. procedure DisposeColorChangedUPP( userUPP: ColorChangedUPP ); external name '_DisposeColorChangedUPP';
  377. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  378. {
  379. * DisposeUserEventUPP()
  380. *
  381. * Availability:
  382. * Mac OS X: in version 10.0 and later in Carbon.framework
  383. * CarbonLib: in CarbonLib 1.0 and later
  384. * Non-Carbon CFM: available as macro/inline
  385. }
  386. procedure DisposeUserEventUPP( userUPP: UserEventUPP ); external name '_DisposeUserEventUPP';
  387. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  388. {
  389. * InvokeColorChangedUPP()
  390. *
  391. * Availability:
  392. * Mac OS X: in version 10.0 and later in Carbon.framework
  393. * CarbonLib: in CarbonLib 1.0 and later
  394. * Non-Carbon CFM: available as macro/inline
  395. }
  396. procedure InvokeColorChangedUPP( userData: SInt32; var newColor: PMColor; userUPP: ColorChangedUPP ); external name '_InvokeColorChangedUPP';
  397. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  398. {
  399. * InvokeUserEventUPP()
  400. *
  401. * Availability:
  402. * Mac OS X: in version 10.0 and later in Carbon.framework
  403. * CarbonLib: in CarbonLib 1.0 and later
  404. * Non-Carbon CFM: available as macro/inline
  405. }
  406. function InvokeUserEventUPP( var event: EventRecord; userUPP: UserEventUPP ): Boolean; external name '_InvokeUserEventUPP';
  407. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  408. {$endc} {TARGET_CPU_64}
  409. {$ifc not TARGET_CPU_64}
  410. type
  411. ColorPickerInfo = record
  412. theColor: PMColor;
  413. dstProfile: CMProfileHandle;
  414. flags: UInt32;
  415. placeWhere: DialogPlacementSpec;
  416. dialogOrigin: Point;
  417. pickerType: OSType;
  418. eventProc: UserEventUPP;
  419. colorProc: ColorChangedUPP;
  420. colorProcData: UInt32;
  421. prompt: Str255;
  422. mInfo: PickerMenuItemInfo;
  423. newColorChosen: Boolean;
  424. filler: SInt8;
  425. end;
  426. {$endc} {not TARGET_CPU_64}
  427. type
  428. NColorPickerInfo = record
  429. theColor: NPMColor;
  430. dstProfile: CMProfileRef; { Currently ignored }
  431. flags: UInt32; { Currently ignored }
  432. placeWhere: DialogPlacementSpec; { Currently ignored }
  433. dialogOrigin: Point; { Currently ignored }
  434. pickerType: OSType; { Currently ignored }
  435. {$ifc not TARGET_CPU_64}
  436. eventProc: UserEventUPP; { Ignored }
  437. {$endc} {not TARGET_CPU_64}
  438. colorProc: NColorChangedUPP;
  439. colorProcData: URefCon;
  440. prompt: Str255; { Currently ignored }
  441. mInfo: PickerMenuItemInfo; { Ignored }
  442. newColorChosen: Boolean;
  443. reserved: UInt8; { Must be 0 }
  444. end;
  445. {$ifc not TARGET_CPU_64}
  446. {
  447. * Fix2SmallFract()
  448. *
  449. * Availability:
  450. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  451. * CarbonLib: in CarbonLib 1.0 and later
  452. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  453. }
  454. function Fix2SmallFract( f: Fixed ): SmallFract; external name '_Fix2SmallFract';
  455. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  456. {
  457. * SmallFract2Fix()
  458. *
  459. * Availability:
  460. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  461. * CarbonLib: in CarbonLib 1.0 and later
  462. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  463. }
  464. function SmallFract2Fix( s: SmallFract ): Fixed; external name '_SmallFract2Fix';
  465. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  466. {
  467. * CMY2RGB()
  468. *
  469. * Availability:
  470. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  471. * CarbonLib: in CarbonLib 1.0 and later
  472. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  473. }
  474. procedure CMY2RGB( const (*var*) cColor: CMYColor; var rColor: RGBColor ); external name '_CMY2RGB';
  475. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  476. {
  477. * RGB2CMY()
  478. *
  479. * Availability:
  480. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  481. * CarbonLib: in CarbonLib 1.0 and later
  482. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  483. }
  484. procedure RGB2CMY( const (*var*) rColor: RGBColor; var cColor: CMYColor ); external name '_RGB2CMY';
  485. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  486. {
  487. * HSL2RGB()
  488. *
  489. * Availability:
  490. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  491. * CarbonLib: in CarbonLib 1.0 and later
  492. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  493. }
  494. procedure HSL2RGB( const (*var*) hColor: HSLColor; var rColor: RGBColor ); external name '_HSL2RGB';
  495. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  496. {
  497. * RGB2HSL()
  498. *
  499. * Availability:
  500. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  501. * CarbonLib: in CarbonLib 1.0 and later
  502. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  503. }
  504. procedure RGB2HSL( const (*var*) rColor: RGBColor; var hColor: HSLColor ); external name '_RGB2HSL';
  505. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  506. {
  507. * HSV2RGB()
  508. *
  509. * Availability:
  510. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  511. * CarbonLib: in CarbonLib 1.0 and later
  512. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  513. }
  514. procedure HSV2RGB( const (*var*) hColor: HSVColor; var rColor: RGBColor ); external name '_HSV2RGB';
  515. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  516. {
  517. * RGB2HSV()
  518. *
  519. * Availability:
  520. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  521. * CarbonLib: in CarbonLib 1.0 and later
  522. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  523. }
  524. procedure RGB2HSV( const (*var*) rColor: RGBColor; var hColor: HSVColor ); external name '_RGB2HSV';
  525. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  526. {$endc} {not TARGET_CPU_64}
  527. {
  528. * GetColor()
  529. *
  530. * Availability:
  531. * Mac OS X: in version 10.0 and later in Carbon.framework
  532. * CarbonLib: in CarbonLib 1.0 and later
  533. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  534. }
  535. function GetColor( where: Point; const (*var*) prompt: Str255; const (*var*) inColor: RGBColor; var outColor: RGBColor ): Boolean; external name '_GetColor';
  536. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  537. {$ifc not TARGET_CPU_64}
  538. {
  539. * PickColor()
  540. *
  541. * Availability:
  542. * Mac OS X: in version 10.0 and later in Carbon.framework [32-bit only]
  543. * CarbonLib: in CarbonLib 1.0 and later
  544. * Non-Carbon CFM: in ColorPickerLib 2.0 and later
  545. }
  546. function PickColor( var theColorInfo: ColorPickerInfo ): OSErr; external name '_PickColor';
  547. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  548. {$endc} {not TARGET_CPU_64}
  549. {
  550. * NPickColor()
  551. *
  552. * Availability:
  553. * Mac OS X: in version 10.0 and later in Carbon.framework
  554. * CarbonLib: in CarbonLib 1.0 and later
  555. * Non-Carbon CFM: in ColorPickerLib 2.1 and later
  556. }
  557. function NPickColor( var theColorInfo: NColorPickerInfo ): OSErr; external name '_NPickColor';
  558. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  559. {$endc} {TARGET_OS_MAC}
  560. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  561. end.
  562. {$endc} {not MACOSALLINCLUDE}