ColorPicker.pas 19 KB

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