19 #ifndef __COLORPICKER__
20 #define __COLORPICKER__
30 #ifndef __CMAPPLICATION__
51 #if PRAGMA_STRUCT_ALIGN
52 #pragma options align = mac68k
53 #elif PRAGMA_STRUCT_PACKPUSH
55 #elif PRAGMA_STRUCT_PACK
62 kMaximumSmallFract = 0x0000FFFF
67 kDefaultColorPickerWidth = 383,
68 kDefaultColorPickerHeight = 238
71 typedef SInt16 DialogPlacementSpec;
74 kAtSpecifiedOrigin = 0,
75 kDeepestColorScreen = 1,
76 kCenterOnMainScreen = 2
83 kColorPickerDialogIsMoveable = 1,
84 kColorPickerDialogIsModal = 2,
85 kColorPickerCanModifyPalette = 4,
86 kColorPickerCanAnimatePalette = 8,
87 kColorPickerAppIsColorSyncAware = 16,
88 kColorPickerInSystemDialog = 32,
89 kColorPickerInApplicationDialog = 64,
90 kColorPickerInPickerDialog = 128,
91 kColorPickerDetachedFromChoices = 256,
92 kColorPickerCallColorProcLive = 512
99 MaxSmallFract = 0x0000FFFF
112 DialogIsMoveable = 1,
114 CanModifyPalette = 4,
115 CanAnimatePalette = 8,
116 AppIsColorSyncAware = 16,
118 InApplicationDialog = 64,
119 InPickerDialog = 128,
120 DetachedFromChoices = 256,
121 CallColorProcLive = 512
131 typedef unsigned short SmallFract;
139 SmallFract saturation;
146 SmallFract saturation;
147 SmallFract lightness;
171 typedef struct OpaquePicker *Picker;
172 typedef Picker picker;
187 typedef CALLBACK_API(
void, ColorChangedProcPtr)(
long userData,
189 typedef CALLBACK_API(
void, NColorChangedProcPtr)(
long userData,
200 DialogPlacementSpec placeWhere;
203 UserEventUPP eventProc;
204 ColorChangedUPP colorProc;
205 UInt32 colorProcData;
215 CMProfileRef dstProfile;
217 DialogPlacementSpec placeWhere;
220 UserEventUPP eventProc;
221 NColorChangedUPP colorProc;
222 UInt32 colorProcData;
369 #if !OPAQUE_UPP_TYPES
372 uppColorChangedProcInfo = 0x000003C0
378 uppColorChangedProcInfo,
379 GetCurrentArchitecture());
382 #define NewColorChangedUPP(userRoutine) \
384 NewRoutineDescriptor((ProcPtr)(userRoutine), uppColorChangedProcInfo, \
385 GetCurrentArchitecture())
399 #if !OPAQUE_UPP_TYPES
402 uppNColorChangedProcInfo = 0x000003C0
408 uppNColorChangedProcInfo,
409 GetCurrentArchitecture());
412 #define NewNColorChangedUPP(userRoutine) \
414 NewRoutineDescriptor((ProcPtr)(userRoutine), uppNColorChangedProcInfo, \
415 GetCurrentArchitecture())
429 #if !OPAQUE_UPP_TYPES
432 uppUserEventProcInfo = 0x000000D0
438 (ProcPtr)(userRoutine), uppUserEventProcInfo, GetCurrentArchitecture());
441 #define NewUserEventUPP(userRoutine) \
442 (UserEventUPP) NewRoutineDescriptor( \
443 (ProcPtr)(userRoutine), uppUserEventProcInfo, GetCurrentArchitecture())
457 #if !OPAQUE_UPP_TYPES
464 #define DisposeColorChangedUPP(userUPP) DisposeRoutineDescriptor(userUPP)
478 #if !OPAQUE_UPP_TYPES
485 #define DisposeNColorChangedUPP(userUPP) DisposeRoutineDescriptor(userUPP)
499 #if !OPAQUE_UPP_TYPES
506 #define DisposeUserEventUPP(userUPP) DisposeRoutineDescriptor(userUPP)
520 ColorChangedUPP userUPP);
521 #if !OPAQUE_UPP_TYPES
524 ColorChangedUPP userUPP)
526 CALL_TWO_PARAMETER_UPP(userUPP, uppColorChangedProcInfo, userData,
newColor);
529 #define InvokeColorChangedUPP(userData, newColor, userUPP) \
530 CALL_TWO_PARAMETER_UPP((userUPP), uppColorChangedProcInfo, (userData), \
545 NColorChangedUPP userUPP);
546 #if !OPAQUE_UPP_TYPES
549 NColorChangedUPP userUPP)
551 CALL_TWO_PARAMETER_UPP(userUPP, uppNColorChangedProcInfo, userData,
newColor);
554 #define InvokeNColorChangedUPP(userData, newColor, userUPP) \
555 CALL_TWO_PARAMETER_UPP((userUPP), uppNColorChangedProcInfo, (userData), \
570 #if !OPAQUE_UPP_TYPES
574 return (
Boolean)CALL_ONE_PARAMETER_UPP(userUPP, uppUserEventProcInfo,
event);
577 #define InvokeUserEventUPP(event, userUPP) \
578 (Boolean) CALL_ONE_PARAMETER_UPP((userUPP), uppUserEventProcInfo, (event))
582 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
584 #define NewColorChangedProc(userRoutine) NewColorChangedUPP(userRoutine)
585 #define NewNColorChangedProc(userRoutine) NewNColorChangedUPP(userRoutine)
586 #define NewUserEventProc(userRoutine) NewUserEventUPP(userRoutine)
587 #define CallColorChangedProc(userRoutine, userData, newColor) \
588 InvokeColorChangedUPP(userData, newColor, userRoutine)
589 #define CallNColorChangedProc(userRoutine, userData, newColor) \
590 InvokeNColorChangedUPP(userData, newColor, userRoutine)
591 #define CallUserEventProc(userRoutine, event) \
592 InvokeUserEventUPP(event, userRoutine)
595 #if PRAGMA_STRUCT_ALIGN
596 #pragma options align = reset
597 #elif PRAGMA_STRUCT_PACKPUSH
599 #elif PRAGMA_STRUCT_PACK
603 #ifdef PRAGMA_IMPORT_OFF
Color Matching Interfaces.
Fixed SmallFract2Fix(SmallFract s)
void DisposeColorChangedUPP(ColorChangedUPP userUPP)
void InvokeNColorChangedUPP(long userData, NPMColor *newColor, NColorChangedUPP userUPP)
SmallFract Fix2SmallFract(Fixed f)
OSErr NPickColor(NColorPickerInfo *theColorInfo)
Boolean InvokeUserEventUPP(EventRecord *event, UserEventUPP userUPP)
void InvokeColorChangedUPP(long userData, PMColor *newColor, ColorChangedUPP userUPP)
void HSL2RGB(const HSLColor *hColor, RGBColor *rColor)
void RGB2CMY(const RGBColor *rColor, CMYColor *cColor)
NColorChangedUPP NewNColorChangedUPP(NColorChangedProcPtr userRoutine)
void HSV2RGB(const HSVColor *hColor, RGBColor *rColor)
ColorChangedUPP NewColorChangedUPP(ColorChangedProcPtr userRoutine)
void CMY2RGB(const CMYColor *cColor, RGBColor *rColor)
void DisposeUserEventUPP(UserEventUPP userUPP)
void DisposeNColorChangedUPP(NColorChangedUPP userUPP)
UserEventUPP NewUserEventUPP(UserEventProcPtr userRoutine)
Boolean GetColor(Point where, ConstStr255Param prompt, const RGBColor *inColor, RGBColor *outColor)
void RGB2HSV(const RGBColor *rColor, HSVColor *hColor)
OSErr PickColor(ColorPickerInfo *theColorInfo)
void RGB2HSL(const RGBColor *rColor, HSLColor *hColor)
Event Manager Interfaces.
long Fixed
Definition: MacTypes.h:153
unsigned char Boolean
Definition: MacTypes.h:318
Mixed Mode Manager Interfaces.
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
#define STACK_UPP_TYPE(name)
Definition: MixedMode.h:734
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)
Interface to Quickdraw Graphics.
Definition: CMICCProfile.h:821
Definition: ColorPicker.h:151
Definition: ColorPicker.h:196
Definition: ColorPicker.h:144
Definition: ColorPicker.h:137
Definition: ColorPicker.h:213
Definition: ColorPicker.h:165
Definition: ColorPicker.h:158
Definition: MacTypes.h:520
Definition: Quickdraw.h:1710
Definition: CMApplication.h:330