PATHMac OS 8 Developer Documentation > Mutlimedia and Graphics > ColorSync Manager >

Managing Color With ColorSync


How Your CMM Is Called by the Component Manager

Because a CMM is a direct client of the Component Manager, it must conform to the Component Manager's interface requirements, including supporting and responding to required Component Manager calls.

The code for your CMM should be contained in a resource. The Component Manager expects the entry point to this resource to be a function having this format:

pascal ComponentResult main(ComponentParameters *params, Handle storage);

Whenever the Component Manager receives a request for your CMM, it calls your component's entry point and passes any parameters, along with information about the current connection, in a data structure of type ComponentParameters . This entry point must be the first function in your CMM's code segment. The Component Manager also passes a handle to the private storage (if any) associated with the current instance of your component. Here is the component parameters data structure, which is described in detail in Inside Macintosh: More Macintosh Toolbox.

struct ComponentParameters {
        unsigned char       flags;
        unsigned char       paramSize;
        short               what;
        long                params[1];
};

The first field of the ComponentParameters data structure is reserved. The following three fields carry information your CMM needs to perform its processing. The what field contains a value that identifies the type of request. The paramSize field specifies the size in bytes of the parameters passed from the ColorSync-supportive calling application to your CMM. The parameters themselves are passed in the params field.


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