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

Managing Color With ColorSync


Profile Access Procedure Operation Codes

When your application calls the CMOpenProfile , CMNewProfile , CMCopyProfile , or CMNewLinkProfile functions, it can supply the ColorSync Manager with a profile location structure of type CMProcedureLocation to specify a procedure that provides access to a profile. The ColorSync Manager calls your procedure when the profile is created, initialized, opened, read, updated, or closed. The profile access procedure declaration is described in MyCMProfileAccessProc. For sample code demonstrating procedure-based profile access, see Accessing a Resource-Based Profile With a Procedure .

When the ColorSync Manager calls your profile access procedure, it passes one of the following constants in the command parameter to specify an operation. Your procedure must be able to respond to each of these constants.

enum {
    cmOpenReadAccess    = 1,    /* open profile for reading */
    cmOpenWriteAccess   = 2,    /* open profile for writing */
    cmReadAccess        = 3,    /* read specified bytes from profile */
    cmWriteAccess       = 4,    /* write specifies bytes to profile */
    cmCloseAccess       = 5,    /* close profile for read or write */
    cmCreateNewAccess   = 6,    /* create new data stream for profile */
    cmAbortWriteAccess  = 7,    /* cancel current write process */
    cmBeginAccess       = 8,    /* begin procedure access */
    cmEndAccess         = 9     /* end procedure access */
};

Enumerator descriptions

cmOpenReadAccess
Open the profile for reading.
cmOpenWriteAccess
Open the profile for writing. The total size of the profile is specified in the size parameter.
cmReadAccess
Read the number of bytes specified by the size parameter.
cmWriteAccess
Write the number of bytes specified by the size parameter.
cmCloseAccess
Close the profile for reading or writing.
cmCreateNewAccess
Create a new data stream for the profile.
cmAbortWriteAccess
Cancel the current write attempt.
cmBeginAccess
Begin the process of procedural access. This is always the first operation constant passed to the access procedure. If the call is successful, the cmEndAccess operation is guaranteed to be the last call to the procedure.
cmEndAccess
End the process of procedural access. This is always the last operation constant passed to the access procedure (unless the cmBeginAccess call failed).

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