1 Overview =TITLE Color Customizer Demonstration Program =KEYWORD Overview The color customizer demonstration program allows users to dynamically control the colors of their workstation environment. Window colors, icon colors, window manager colors, and more can all be changed individually or as part of an entire palette switch. The user has control over the mapping between resources and color cells, as well as the size and contents of the palette set. Also, automatic shadowing through the standard Motif shadowing algorithms is supported. o Supported Displays The color customizer supports any display using pseudocolor or grayscale visuals. This includes most 4- and 8-plane workstation displays. o Supported Applications The color customizer can affect the colors of any applications that use the current release of the Digital X Toolkit (Xt) library. Applications that run against another vendor's X Toolkit Library will be unaffected. Applications that run against previous versions of Digital's X Toolkit library will be unaffected. ________________________ Note ________________________ If the color customizer is used to control the colors of applications that have their own color customization dialog boxes (like the Session Manager, Window Manager, and DECwindows Mail), those application-specific color customization dialog boxes may not reflect the correct current color values while the customizer is running the application. This is normal; use the customizer instead of the application- specific dialog box to change these values. ______________________________________________________ 2 building =TITLE 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. $ 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. $ @BUILD_CUSTOMIZER.COM This command procedure creates the following output files: o CUSTOM.UID o CUSTOM.EXE o XSETROOT_CUST.EXE 2 running =TITLE 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 building of the customizer, to the directory from which the customizer will be run. A typical location is SYS$LOGIN or DECW$USER_DEFAULTS. 2. Copy the files CUSTOM.DAT and DXMDEFAULTS.DAT from DECW$EXAMPLES to the same location as in step 1. Typically SYS$LOGIN or DECW$USER_DEFAULTS. 3. Run the executable file CUSTOM.EXE. $ RUN CUSTOM ________________________ Note ________________________ Only the colors of applications invoked after the customizer starts will be affected. For this reason, make the customizer the first X application to start during the login process. ______________________________________________________ o Modifying DECW$LOGIN.COM The color customizer should be the first X application started during the login process. This can be accomplished by starting it as a subprocess from within your file DECW$LOGIN.COM. You will also want to add a command to wait, approximately 10 seconds, to allow the customizer to get started before starting other applications. Add the following lines to DECW$LOGIN.COM: $! 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 inter_sum =TITLE Command Interface Summary A list of available palettes is in the upper left section of the screen-click on the desired palette to see it take effect. Below that are two arrays of colored buttons, representing the dynamically allocated color cells for normal and shadow colors. To find out what resources are being affected by a color cell, click and hold the arrow button next to it. As a shortcut, you can click on the screen facsimile in the upper right corner of the dialog box. If the portion you click on is colored by one of resource values controlled by the customizer, the popup for the appropriate color button will be displayed. To modify a single color cell, click on the corresponding color button. A colormix widget will pop up, and, as you modify the color, you will see these modifications 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: o To modify an existing palette, select the palette, change to the desired colors, and choose Save Palette from the File menu. o To add a new palette to the list box, 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. o To delete a palette, select the palette in the listbox and choose Delete Palette from the File menu. Changes made through the File menu will automatically update the file that contains the resource defaults, CUSTOM.DAT. 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 freed. After the customizer exits, if the colors of the currently running applications are not correct, the applications will need to be restarted to restore normal colors. Normally, there is no need to exit the color customizer-it is typically kept running all the time, like the Session Manager. 2 chngcolmap =TITLE 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, which uses the correct X Toolkit library, will merge these resources with its normal resource database. Resource specifications in this file will take precedence over specifications with equivalent left-hand sides in other resource defaults files. The color values for the right side, 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 many resources to use the same color cells. You can have separate dynamic color cells, especially for scrollbar widgets or for your Mail application, by adding lines like the following: Mail*background: DXmDynamicMyMailBackground Mail*foreground: DXmDynamicMyMailForeground Mail*topShadowColor: DXmDynamicMyMailTopShadow Mail*bottomShadowColor: DXmDynamicMyMailBottomShadow Doing this 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. Copy the shipped versions of CUSTOM.DAT and DXMDEFAULTS.DAT from DECW$EXAMPLES into your login directory to resolve the problem. ______________________________________________________ 2 decterms =TITLE DECterm Windows not Affected The color customizer does not affect the colors of DECterm windows, set up as described previously. To affect 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 will allow the DECterm window colors to be customized with the color customizer. 2 auto_shadow =TITLE Changing the Default Value of the Automatic Shadowing Toggle Button The default value of the Automatic shadowing toggle button can be set using the Custom.autoShadow resource in the CUSTOM.DAT file as follows: Custom.autoShadowing: False The default value is True. 2 multihead =TITLE Using the Customizer on Multihead Systems The color customizer only affects 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 can be turned on by modifying the Custom.multiScreen resource in the CUSTOM.DAT defaults file as follows: Custom.multiScreen: True The default value is False. 2 xsetrootcust =TITLE Using the XSETROOT_CUST Demonstration Program The XSETROOT_CUST.EXE demonstration program, created during the building of the customizer, is a modified version of xsetroot that can be used to set a bitmap on the root window. The XSETROOT_CUST.EXE program will use 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