Important: The information in this document is obsolete and should not be used for new development.
Identifying the Current Default System Profile
For theNCMBeginMatching,NCMDrawMatchedPicture, andNCWNewColorWorldfunctions, your application can specifyNULLto signify the default system profile. For all other functions--for example, theCMGetProfileElementfunction, theCMValidateProfilefunction, and theCMCopyProfilefunction--for which you want to specify the default system profile, you must give an explicit reference to the profile. You can use theCMGetSystemProfilefunction to obtain a reference to the default system profile.Each profile has a name associated with it, including the profile configured as the default system profile. There are cases in which your application may need to display the name of the default system profile to the user. For example, you may want to present a list or selection menu to your user showing the names of all available display profiles. To obtain the name of the default system profile, your application can call the CMGetScriptProfileDescripti
onfunction.To call this function, your application must first obtain a reference to the default system profile because you cannot specify
NULLto identify it. Given a profile reference, the CMGetScriptProfileDescriptionfunction returns the profile name and script code. Listing 4-3 uses theCMGetSystemProfileand CMGetScriptProfileDescriptionfunctions to obtain a reference to the default system profile and the system profile's name and script code.Listing 4-3 Obtaining the current system profile
void MyPrintSystemProfileName (void) { CMError cmErr; CMProfileRefsysProf; Str255 profName; ScriptCode profScript; cmErr = CMGetSystemProfile(&sysProf); if (cmErr == noErr) { cmErr = CMGetScriptProfileDescription(sysProf, profName, &profScript); if (cmErr == noErr) { DrawString(profname); } } }