PATHDocumentation > Mac OS 8 and 9 > Mutlimedia and Graphics > ColorSync Manager >

Managing Color With ColorSync


Handling Request Codes

When your component receives a request, it should examine the what field of the ComponentParameters data structure to determine the nature of the request, perform the appropriate processing, set an error code if necessary, and return an appropriate function result to the Component Manager.

Your entry point routine can call a separate subroutine to handle each type of request. ColorSync Reference for Color Management Modules describes the prototypes for functions your CMM must supply to handle the corresponding ColorSync Manager request codes. The entry routine itself can unpack the parameters from the params parameter to pass to its subroutines, or it can call the Component Manager's CallComponentFunctionWithStorage routine or CallComponentFunction routine to perform these services.

The CallComponentFunctionWithStorage function is useful if your CMM uses private storage. When you call this function, you pass it a handle to the storage for this component instance, the ComponentParameters data structure, and the address of your subroutine handler. Each time it calls your entry point function, the Component Manager passes to your function the storage handle along with the ComponentParameters data structure. For a description of how you associate private storage with a component instance, see Establishing the Environment for a New Component Instance . The Component Manager's CallComponentFunctionWithStorage function extracts the calling application's parameters from the ComponentParameters data structure and invokes your function, passing to it the extracted parameters and the private storage handle.

For sample code that illustrates how to respond to the required Component Manager and ColorSync Manager requests, see the DemoCMM project available with the ColorSync SDK. You may also wish to refer to the Apple technical note QT05, "Component Manager Version 3.0." This technical note shows how to create a fat component, which is a single component usable for both 68K-based and PowerPC-based systems.

For more information describing how your CMM component should respond to request code calls from the Component Manager, see "Creating Components" in Inside Macintosh: More Macintosh Toolbox.


© 1988-1999 Apple Computer, Inc. — (Last Updated 20 Jan 99)