Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Advanced Color Imaging on the Mac OS /
Chapter 5 - Developing Color Management Modules / Creating a Color Management Module


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 type ComponentDescription contains the following fields for which you must set values:

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 shows a Rez listing of a component resource that describes a CMM.

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
   }
};

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 NOV 1996