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
, andNCWNewColorWorld
functions, your application can specifyNULL
to signify the default system profile. For all other functions--for example, theCMGetProfileElement
function, theCMValidateProfile
function, and theCMCopyProfile
function--for which you want to specify the default system profile, you must give an explicit reference to the profile. You can use theCMGetSystemProfile
function 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
on
function.To call this function, your application must first obtain a reference to the default system profile because you cannot specify
NULL
to identify it. Given a profile reference, the CMGetScriptProfileDescription
function returns the profile name and script code. Listing 4-3 uses theCMGetSystemProfile
and CMGetScriptProfileDescription
functions 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); } } }