Important: The information in this document is obsolete and should not be used for new development.
Creating a Component Resource for a CMM
A CMM is stored as a component resource. It contains a number of resources, including the standard component resource (a resource of type'thng'
) required of any Component Manager component. In addition, a CMM must contain code to handle required request codes passed to it by the Component Manager. This includes support for Component Manager required request codes as well as ColorSync Manager required request codes.To allow the ColorSync Manager to use your CMM when a profile specifies it as its preferred CMM, your CMM should be located in the Extensions folder, where it will automatically be registered at startup. The file type for component files must be set to
'thng'
.The component resource contains all the information needed to register a code resource as a component. Information in the component resource tells the Component Manager where to find the code for the component. As part of the component resource, you must provide a component description record that specifies the component type, subtype, manufacturer, and flags. Here is the component description data structure:
struct ComponentDescription { OSType componentType; OSType componentSubType; OSType componentManufacturer; unsigned long componentFlags; unsigned long componentFlagsMask; };The component description data structure of typeComponentDescription
contains the following fields for which you must set values:
- The
componentType
field contains a unique 4-byte code specifying the resource type and resource ID of the component's executable code. For your CMM, set this field to'cmm '
.- The
componentSubType
field indicates the type of services your CMM provides. You should set this field to your CMM name. This value must match exactly the value specified in the profile header'sCMMType
field. You must register this value with the ICC.- The
componentManufacturer
field indicates the creator of the CMM. You may set this field to any value you wish.- The
componentFlags
field is a 32-bit field that provides additional information about your CMM component. The high-order 8 bits are reserved for definition by the Component Manager. The low-order 24 bits are specific to each component type. You can use these flags to indicate any special capabilities or features of your component. For more information, see the chapter "Component Manager" in Inside Macintosh: More Macintosh Toolbox.- The
componentFlagsMask
field is reserved.
Listing 5-1 shows a Rez listing of a component resource that describes a CMM.
- Note
- Values you specify for all fields except the
componentType
field must include at least one uppercase character. Apple Computer reserves values containing all lowercase characters for its own use.Listing 5-1 CMM component Rez listing
/#define UseExtendedThingResource1 #include "Types.r" resource 'STR ' (128, purgeable) { "CMM Component" }; resource 'STR ' (129, purgeable) { "Copyright © 1995 Apple Computer, Inc." }; resource 'ICN#' (128, purgeable) { { /* array: 2 elements */ /* [1] */ $"FFE0 07FF 8040 0201 8080 0101 807F FE01" $"8000 0001 8000 0001 8003 F001 800F FC01" $"803F FF01 807F FF01 807E 9E01 80F8 4401" $"80F4 8A01 81F2 5201 81E0 8101 81F5 5501" $"81EA AB01 81E0 4101 81F2 9201 80F4 4A01" $"80F8 8401 807E 5E01 807F FF01 803F FF01" $"800F FC01 8003 F001 8000 0001 8000 0001" $"FFF0 0FFF 0020 0400 0040 0200 003F FC", /* [2] */ $"FFE0 07FF FFC0 03FF FF80 01FF FFFF FFFF" $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF" $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF" $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF" $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF" $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF" $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF" $"FFFF FFFF 003F FC00 007F FE00 003F FC" } }; resource 'thng' (128, purgeable) { 'cmm ', 'fake', 'fake', 0X80000000, kAnyComponentFlagsMask, 'cmm ', 128, 'STR ', 128, 'STR ', 129, 'ICN#', 128, 0x0, 9, 128, { /* array ComponentPlatformInfo: 2 elements */ /* [1] */ 0X80000000, 'cmm ', 128, platform68k, /* [2] */ 0X80000000, 'cmm ', 129, platformPowerPC } };