cc.icon, default.icon

File type to icon mapping rules (graphical interface)

Applicability

Product

Command type

VersionVault

data structure

Platform

UNIX®

Linux®

Synopsis

file-type [ file-type ... ] : icon-name ; . . .

Description

An icon file contains an ordered set of rules that maps file types to names of bitmap files, which contain icon bitmaps.

In xversionvault, a file browser uses a series of lookups to determine how to represent a file system object:

  1. It searches one or more magic files to determine the list of file types for the file system object. (See the cc.magic reference page for details.)
  2. It searches one or more icon files for a match with the first file type. Finding a match yields the name of a bitmap file. For example, this entry maps the file type text_file to the icon bitmap file name text: text_file : -icon text ;
  3. The semicolon (;) that terminates an icon rule must be preceded by white space.
  4. If no match can be found for the first file type, xversionvault searches the same set of icon files for a match with the second file type, and so on through the entire list of file types, if necessary. (If none of the file types produces a match in any icon file, an error occurs.)
  5. Having determined the name of a bitmap file, xversionvault searches for an actual file in one or more directories that contain bitmap files. (If it cannot locate a bitmap file with this name, an error occurs.)
  6. Bitmap file names must have a numeric extension, indicating the size of the bitmap. For example, text.40. xversionvault selects that bitmap file whose name begins with the string specified by –icon and whose size is 40x40 pixels.

If the file system object is selected, this process includes an extra step: xversionvaulttries to match a –selected icon rule for each relevant file type before accepting a bitmap specified by –icon. For example, the following rule specifies both generic and "when selected" icons for use with elements of type text_file:

text_file : -icon text -selected text_selected;

Selecting and deselecting a text_file object from a file browser switches between the two icons.

Search paths

VersionVault supports search paths both for icon files and for bitmap files:

  • Icon file search path. If ICON_PATH is set in your environment (to a colon-separated list of directories), xversionvault searches files with a .icon extension in these directories. In each directory, files are processed in alphabetical order. As soon as a matching rule is found, the search ends; thus, if multiple rules match a file type, the first rule encountered is used.

    If ICON_PATH is not set, this default search path is used:

    home-directory/.icon:${versionvault-home-dir: /opt/hcl/ccm/versionvault}/config/ui/icon
  • Bitmap file search path. If BITMAP_PATH is set in your environment (to a colon-separated list of directories), xversionvault searches for bitmap files with a .40 suffix in these directories.

    If BITMAP_PATH is not set, this default search path is used:

    home-directory/.bitmaps:${versionvault-home-dir:–/opt/hcl/ccm/versionvault}/config/
    ui/bitmaps

Examples

  • For file type c_source, use the icon file named c. When a c_source element is selected, use the icon file c_select.

    c_source : -icon c -selected c_select ;

  • For file type postscript, use the icon file named ps.

    postscript : -icon ps ;