HP OpenVMS Systems Documentation

Content starts here

Compaq DECwindows Motif
for OpenVMS
Release Notes


Previous Contents Index

2.1.1.2.3 Building the Color Customizer on OpenVMS Systems

To build the color customizer on OpenVMS systems, perform the following steps:

  1. Copy the files to a private directory. For example:


    $ SET DEFAULT SYS$LOGIN
    $ CREATE/DIRECTORY [.CUSTOMIZER]
    $ SET DEFAULT [.CUSTOMIZER]
    $ COPY DECW$EXAMPLES:CUSTOM.C []
    $ COPY DECW$EXAMPLES:CUSTOM.UIL []
    $ COPY DECW$EXAMPLES:CUSTOMIMAGE.DAT []
    $ COPY DECW$EXAMPLES:XSETROOT_CUST.C []
    $ COPY DECW$EXAMPLES:BUILD_CUSTOMIZER.COM []
    
  2. Build the customizer using the following command:


    $ @BUILD_CUSTOMIZER.COM
    

This command procedure creates the following output files:

  • CUSTOM.UID
  • CUSTOM.EXE
  • XSETROOT_CUST.EXE
2.1.1.2.4 Running the Color Customizer

To run the color customizer, perform the following steps:

  1. Copy the files CUSTOM.UID and CUSTOM.EXE, which were created during the customizer build, to the directory where the customizer will be run. A typical location is the directory SYS$LOGIN or the directory DECW$USER_DEFAULTS.
  2. Copy the files CUSTOM.DAT and DXMDEFAULTS.DAT from the directory DECW$EXAMPLES to the same location as you copied the files in step 1. The same typical locations apply.
  3. Run the executable file CUSTOM.EXE as follows:


    $ RUN CUSTOM
    

Note

Only the colors of applications invoked after the customizer starts will be affected. For this reason, start the customizer as the first X application during the login process.
2.1.1.2.5 Modifying the DECW$LOGIN.COM File

As noted in Section 2.1.1.2.4, the color customizer should be the first X application started during the login process. Do this by starting it as a subprocess from within the DECW$LOGIN.COM file. Add a command to wait approximately 10 seconds between customizer startup and the startup of other applications.

For example, add the following lines to the DECW$LOGIN.COM file:


$! Starting the color customizer
$ DISPLAY = F$LOGICAL("DECW$DISPLAY")
$ SPAWN/NOWAIT/OUTPUT='DISPLAY' RUN SYS$LOGIN:CUSTOM.EXE
$ WAIT 0:0:10

See Using DECwindows Motif for OpenVMS and Managing DECwindows Motif for OpenVMS Systems for more information on the file DECW$LOGIN.COM.

2.1.1.2.6 Command Interface Summary

A box containing a list of available palettes is in the leftmost section of the Color Customizer window. Click on the desired palette to see the colors take affect.

Below the palettes are two arrays of colored buttons, representing the dynamically allocated color cells for normal and shadow colors. To find out what resources are affected by a color cell, click and hold the arrow button next to the color cell.

Hint

As a shortcut, you can click on the screen facsimile in the rightmost corner of the dialog box. If the portion you click on is colored by one of the resource values controlled by the customizer, the pop-up window for the appropriate color button is displayed.

To modify a single color cell, click on the corresponding color button. A colormix widget pops up; as you modify the color, these modifications are reflected in your workstation environment. Use the colormix widget reset button to return to the starting color at any time. You can also change the color cell you are modifying by clicking on a different color button while the colormix widget is displayed.

The automatic shadowing option causes shadow and select colors to be automatically updated when their corresponding background colors are changed. The standard Motif shadowing algorithms are used for these calculations.

Use the File menu to modify, add, and delete color palettes as follows:

  • To modify an existing palette, select the palette, change the colors, and choose Save Palette from the File menu.
  • To add a new palette, select an existing palette, modify the colors as necessary, and choose Save Palette As... from the File menu. A message box prompts you for the name of the new palette.
  • To delete a palette, select the palette and choose Delete Palette from the File menu.

Changes made through the File menu automatically update the CUSTOM.DAT file, which contains the resource defaults.

The File menu Exit button causes the customizer application to exit. A warning dialog is displayed first. Note that the color cells allocated by the customizer (and used by the currently running applications) will be deallocated. After the customizer exits, if the colors of the currently running applications are not correct, the applications should be restarted to restore normal colors. Usually, there is no need to exit the color customizer; it is typically kept running at all times, like the Session Manager.

2.1.1.2.7 Changing the Mapping Between Color Resources and Color Cells

The file DXMDEFAULTS.DAT allows you to control how many dynamic color cells are allocated and what resources are affected. This file contains resource specifications like the following:


*background:       DXmDynamicWindowBackground
*foreground:       DXmDynamicWindowForeground
*topShadowColor:   DXmDynamicWindowTopShadow

When the customizer is started, the file DXMDEFAULTS.DAT is written to a property on the root window. Any application that is subsequently run and that uses the correct X Toolkit Library merges these resources with its normal resource database. Resource specifications in this file take precedence over specifications with equivalent resource names in other resource default files.

The resource values within the file DXMDEFAULTS.DAT have a special format. For each unique color value in this file that begins with the string "DXmDynamic", a color button is created in the color customizer. If the string "Shadow" is encountered in a name, the color button is placed in the shadow button box rather than the normal color button box. If a color value string ends with the suffix "Background", it is linked to any color buttons with identical prefixes and suffixes of "TopShadow", "BottomShadow", or "SelectColor" for purposes of automatic shadowing. If a color value named "DXmDynamicScreenBackground" is encountered, the color cell allocated is used by the customizer to set the root window background color.

You can edit the file DXMDEFAULTS.DAT and define resources to use the same color cells. You can have separate dynamic color cells, for scrollbar widgets or for your DECwindows Mail application, for example, by adding the following lines to the file DXMDEFAULTS.DAT:


Mail*background:         DXmDynamicMyMailBackground
Mail*foreground:         DXmDynamicMyMailForeground
Mail*topShadowColor:     DXmDynamicMyMailTopShadow
Mail*bottomShadowColor:  DXmDynamicMyMailBottomShadow

Adding the previous lines to the file DXMDEFAULTS.DAT and restarting the customizer causes four new color cells to be allocated and four new color buttons to be added to the customizer interface. These buttons are assigned default color values (usually black or white) for each palette. These defaults can then be modified for each palette through the customizer interface.

Note

The text of the DXMDEFAULTS.DAT file is read and parsed by the color customizer. The parsing algorithm does not allow comments, incorrect spacing, or incorrect resource specifications. If this file or the CUSTOM.DAT resource file become corrupt, the customizer cannot start correctly. To resolve the problem, copy the versions of CUSTOM.DAT and DXMDEFAULTS.DAT from the DECW$EXAMPLES directory into your login directory.
2.1.1.2.8 DECterm Windows Not Affected

The color customizer does not affect the colors of DECterm windows. To change the colors of DECterm windows, copy the DECterm resource specifications from the file DXMDEFAULTS.DAT and add them to the DECterm resource defaults file DECW$USER_DEFAULTS:DECW$TERMINAL_DEFAULT.DAT. For example, add the following lines to the DECterm resource defaults file:


   .
   .
   .
  DECW$TERMINAL.main.terminal.background: DXmDynamicTerminalBackground
  DECW$TERMINAL.main.terminal.foreground: DXmDynamicTerminalForeground

This allows the DECterm window colors to be customized with the color customizer.

2.1.1.2.9 Changing the Default Value of the Automatic Shadowing Toggle Button

The default value of the automatic shadowing toggle button is set using the Custom.autoShadow resource in the CUSTOM.DAT file as follows:


Custom.autoShadowing: False

The default value is True.

2.1.1.2.10 Using the Customizer on Multihead Systems

The color customizer affects only applications started on the same screen as the customizer. On multihead systems, you can start a different color customizer for each screen and have a different palette in effect on each screen.

The color customizer can be configured so that it is invoked once and affects all applications regardless of where they are started. This mode is invoked by modifying the Custom.multiScreen resource in the CUSTOM.DAT file as follows:


Custom.multiScreen: True

The default value is False.

2.1.1.2.11 Using the XSETROOT_CUST.EXE Demonstration Program

The XSETROOT_CUST.EXE demonstration program, created during the customizer build, is a modified version of the MIT utility program xsetroot that is used to set a bitmap on the root window. The XSETROOT_CUST.EXE program uses DXmDynamicScreenBackground and DXmDynamicScreenForeground as the background and foreground colors of the specified bitmap. If your DXMDEFAULTS.DAT file contains entries for these two dynamic colors, then use the customizer to dynamically modify the colors of your bitmap.

For example:


$ XSETROOT_CUST :== "$SYS$LOGIN:XSETROOT_CUST.EXE"
$ XSETROOT_CUST -BITMAP your_xbm_file.XBM

2.1.1.3 Window Dump to Print File (xpr) Utility

V1.2

The Window Dump to Print File utility prints an X Window dump using the xpr program.

The xpr program receives as input a window dump file produced by the Window Dump utility (xwd) and formats it for output on the following printers:

  • PostScript
  • DIGITAL LN03 or LA100
  • IBM PP3812 page printer
  • HP LaserJet (or other PCL printers)
  • HP PaintJet

To use the xpr program, define xpr as a user-defined command:


$ xpr == "$DECW$UTILS:XPR"

You must specify an input file. The xpr program prints the largest possible representation of the window on the output page. Options allow the user to add headers and trailers, specify margins, adjust the scale and orientation, and append multiple window dumps to a single output file.

Use the following command format:


$ xpr input_file [options...]

Options include:


    -append filename  -noff  -output filename
    -compact
    -device {ln03 | la100 | ps | lw | pp | ljet | pjet | pjetxl}
    -dump
    -gamma correction
    -gray {2 | 3 | 4}
    -height inches  -width inches
    -header string  -trailer string
    -landscape  -portrait
    -left inches  -top inches
    -noposition
    -nosixopt
    -plane n
    -psfig
    -render type
    -report
    -rv
    -scale scale
    -slide
    -split n-pages

Table 2-2 defines the available options.

Table 2-2 Window Dump to Print File Options
Option Description
-device devtype Specifies the device on which the file is printed.

Currently supported devices:

la100 DIGITAL LA100.
ln03 DIGITAL LN03.
ljet HP LaserJet series and other monochrome PCL devices such as ThinkJet, QuietJet, RuggedWriter, HP series, and HP-series printers.
pjet HP PaintJet (color mode).
pjetxl HP PaintJet XL Color Graphics Printer (color mode).
pp IBM PP3812.
ps PostScript printer.
lw LaserWriter is equivalent to -device ps and is provided only for backwards compatibility.

The default is PostScript.

-scale scale Affects the size of the window on the page. The PostScript, LN03, and HP printers can translate each bit in a window pixel map into a grid of a specified size. For example, each bit might translate into a 3x3 grid. This would be specified by -scale 3. By default, a window is printed with the largest scale that will fit onto the page for the specified orientation.
-height inches Specifies the maximum height of the page.
-width inches Specifies the maximum width of the page.
-left inches Specifies the left margin in inches. Fractions are allowed. By default the window is centered in the page.
-top inches Specifies the top margin for the picture in inches. Fractions are allowed.
-header string Specifies a header string to be printed above the window.
-trailer string Specifies a trailer string to be printed below the window.
-landscape Forces the window to be printed in landscape mode. By default, a window is printed so that its longest side follows the long side of the paper.
-portrait Forces the window to be printed in portrait mode. By default a window is printed so that its longest side follows the long side of the paper.
-plane number Specifies which bit plane to use in an image. The default is to use the entire image and map values into black and white based on color intensities.
-gray Uses a 2x2, 3x3, or 4x4 gray scale conversion on a color image, rather than mapping to strictly black and white. This doubles, triples, or quadruples the effective width and height of the image.
-rv Forces the window to print in reverse video.
-compact Uses run-length encoding for compact representation of windows with white pixels.
-output filename Specifies an output file name.
-append filename Specifies a file name previously produced by xpr to which the window is to be appended.
-noff When specified in conjunction with -append, the window appears on the same page as the previous window.
-split n-pages Allows the user to split a window onto several pages. This might be necessary for very large windows that would otherwise cause the printer to overload and print the page in an obscure manner.
-psfig Suppresses translation of the PostScript picture to the center of the page.
-density dpi Indicates dot-per-inch density to be used by the HP printer.
-cutoff level Changes the intensity level where colors are mapped to either black or white for monochrome output on a LaserJet printer. The level is expressed as percentage of full brightness. Fractions are allowed.
-noposition Causes header, trailer, and image positioning command generation to be bypassed for LaserJet, PaintJet and PaintJet XL printers.
-gamma correction Changes the intensity of the colors printed by the PaintJet XL printer. The correction is a floating-point value in the range 0.00 to 3.00. Consult the operator's manual to determine the correct value for the specific printer.
-render algorithm Allows the PaintJet XL printer to render the image with the best quality versus performance tradeoff. Consult the operator's manual to determine the available algorithms.
-slide filename Allows overhead transparencies to be printed using the PaintJet and PaintJet XL printers.

The program contains the following limitations:

  • Support for PostScript output currently cannot use the -append, -noff, or -split options.
  • The -compact option is only supported for PostScript output. It compresses white space but not black space, so it is not useful for reverse-video windows.
  • For color images, map directly to PostScript image support.

Program limitations with an LN03 printer:

  • The current version of xpr can print most X Windows that are not larger than two-thirds of the screen.
    For example, the LN03 prints a large Emacs window, but fails when trying to print the entire screen.
  • The LN03 has memory limitations that cause it to incorrectly print large or complex windows. The two most common errors encountered are "band too complex" and "page memory exceeded" and are described as follows:
    • "band too complex"
      A window may have a particular six pixel row that contains too many changes (from black to white to black). This causes the printer to drop part of the line and possibly drop parts of the page. The printer flashes the number "1" on its front panel when this problem occurs. A possible solution to this problem is to increase the scale of the picture or to split the picture onto two or more pages.
    • "page memory exceeded"
      This occurs if the picture contains too much black space, or if the picture contains complex half-tones, such as the background color of a display. When this problem occurs, the printer automatically splits the picture onto two or more pages. The number "5" may flash on its front panel. As a possible solution to the problem, it might be necessary to either cut and paste or to rework the application to produce a less complex picture.

Program limitations with a LA100 printer:

  • The picture is always printed in portrait mode.
  • The scale is ignored.
  • The scale factor will be different in the horizontal and vertical directions.

Program limitations with an HP printer:

  • If the -density option is not specified, 300 dots-per-inch (dpi) is assumed for the ljet device and 90-dpi for the pjet device. The LaserJet printer supports 300-, 150-, 100-, and 75-dpi. Consult the operator's manual to determine the densities supported by other printers.
  • If the -scale option is not specified, the image is expanded to fit the printable page area.
  • The default printable page area is 8x10.5 inches. Other paper sizes can be accommodated using the -height and -width options.
  • Note that a 1024x768 image fits the default printable area when processed at 100-dpi with scale=1; the same image can also be printed using 300-dpi with scale=3, but it requires more data to be transferred to the printer.
  • The xpr program may be tailored for use with monochrome PCL printers other than the LaserJet. To print on a ThinkJet (HP 2225A) printer, invoke xpr as follows:


    xpr -density 96 -width 6.667 filename
    
    To print black-and-white output on a PaintJet printer, invoke xpr as follows:


    xpr -density 180 filename
    
  • The monochrome intensity of a pixel is computed as 0.30*R + 0.59*G + 0.11*B. If the computed intensity of a pixel is less than the -cutoff level, it prints white. This maps light-on-dark display images to black-on-white hard copy. The default cutoff intensity is 50% of full brightness. For example, specifying -cutoff 87.5 means that a pixel will be displayed as black if the computed intensity is less than 85% of full brightness.
  • A LaserJet printer must be configured with sufficient memory to print the image. To print a full page at 300-dpi, approximately 2 MB of printer memory is required.
  • Color images are produced on the PaintJet printer at 90-dpi. The PaintJet is limited to 16 colors from its 330 color palette on each horizontal print line. The xpr program issues a warning message if more than 16 colors are encountered on a line. Xpr programs the PaintJet for the first 16 colors encountered on each line and uses the nearest matching programmed value for other colors on the line.
  • Specifying the -rv option on the PaintJet printer causes black and white to be interchanged on the output image. No other colors are changed.
  • Multiplane images must be recorded by xwd in ZPixmap format. Single-plane (monochrome) images may be in either XYPixmap or ZPixmap format.
  • Some PCL printers do not recognize image positioning commands. Output for these printers is not centered on the page, and header and trailer strings may not appear where expected.
  • The -gamma and -render options are supported only on the PaintJet XL printers.
  • The -slide option is not supported on LaserJet printers.
  • The -split option is not supported on HP printers.
  • The -gray option is not supported on HP or IBM printers.


Previous Next Contents Index