Icon use by GUI browsers

The File Browser can display file system objects either by list or graphically. In the latter case, the File Browser selects an icon for each file system object as follows:
  1. The object name or its contents determines a list of file types, as described in How element types are assigned.
  2. One by one, the file types are compared to the rules in predefined and user-defined icon files, as described in the cc.icon reference page. For example, the file type c_source matches this icon file rule:
    c_source : -icon c ;

    When a match is found, the search ends. The token that follows –icon names the file that contains the icon to be displayed.

  3. The File Browser searches for the file, which must be in bitmap(1) format, in directory $HOME/.bitmaps, or versionvault-home-dir/config/ui/bitmaps, or the directories specified by the environment variable BITMAP_PATH.
  4. If a valid bitmap file is found, the File Browser displays it; otherwise, the search for an icon continues with the next file type.

The name of an icon file must include a numeric extension, which need not be specified in the icon file rule. The extension specifies how much screen space the File Browser must allocate for the icon. Each bitmap supplied with HCL VersionVault version control is stored in a file with a .40 suffix (for example, lib.40), which indicates a 40x40 icon.

This procedure causes the File Browser to display manual page source files with a customized icon. All manual pages have file type manpage.
  1. Add a rule to your personal magic file (in directory $HOME/.magic) that includes manpage among the file types assigned to all manual page source files:
    manpage src_file text_file file:  -name "*.[1-9]" ;
  2. Add a rule to your personal icon file (in directory $HOME/.icon) that maps manpage to a user-defined bitmap file:
    manpage : -icon manual_page_icon ;
  3. Create a manpage icon in your personal bitmaps directory ($HOME/.bitmaps) by revising one of the standard icon bitmaps with the standard X bitmap utility:
    % mkdir $HOME/.bitmaps
    % cd $HOME/.bitmaps
    % cp $versionvault-home-dir/config/ui/bitmaps/c.40 manual_page_icon.40
    % bitmap manual_page_icon.40 
  4. Test your work by having the File Browser display a manual page source file.