% Librarian A09-23)WW$ %5Overview W 1 Overview -=TITLE Color Customizer Demonstration Program=KEYWORD OverviewE The color customizer demonstration program allows usersD to dynamically control the colors of their workstationE environment. Window colors, icon colors, window managerD colors, and more can all be changed individually or asI part of an entire palette switch. The user has control overG the mapping between resource s and color cells, as well asG the size and contents of the palette set. Also, automaticG shadowing through the standard Motif shadowing algorithms is supported." o Supported DisplaysI The color customizer supports any display using pseudocolorE or grayscale visuals. This includes most 4- and 8-plane# workstation displays.& o Supported Applications? The color cu stomizer can affect the colors of anyH applications that use the current release of the Digital XI Toolkit (Xt) library. Applications that run against anotherI vendor's X Toolkit Library will be unaffected. ApplicationsG that run against previous versions of Digital's X Toolkit) library will be unaffected.F ________________________ Note ________________________> If the color customizer is use d to control the@ colors of applications that have their own color< customization dialog boxes (like the SessionD Manager, Window Manager, and DECwindows Mail), thoseE application-specific color customization dialog boxesF may not reflect the correct current color values whileB the customizer is running the application. This isF normal; use the customizer instead of the application-;  specific dialog box to change these values.F ______________________________________________________ 2 building7=TITLE Building the Color Customizer on OpenVMS SystemsG To build the color customizer on OpenVMS systems, perform" the following steps:7 1. Copy the files to a private directory.( $ SET DEFAULT SYS$LOGIN1 $ CREATE/DIRECTORY [.CUSTOMIZER], $ SET DEFAULT [.CUS TOMIZER]1 $ COPY DECW$EXAMPLES:CUSTOM.C []3 $ COPY DECW$EXAMPLES:CUSTOM.UIL []8 $ COPY DECW$EXAMPLES:CUSTOMIMAGE.DAT []8 $ COPY DECW$EXAMPLES:XSETROOT_CUST.C []= $ COPY DECW$EXAMPLES:BUILD_CUSTOMIZER.COM []& 2. Build the customizer.( $ @BUILD_CUSTOMIZER.COMH This command procedure creates the following output files: o CUSTOM.UID o CUSTOM.EXE" o XSETROOT_CUST.EXE 2 running#=TITLE Running the Color CustomizerG To run the color customizer, perform the following steps:E 1. Copy the files CUSTOM.UID and CUSTOM.EXE, which wereF created during the building of the customizer, to theC directory from which the customizer will be run. AE typical location is SYS$LOGIN or DECW$USER_DEFAULTS.C 2. Copy the files CU STOM.DAT and DXMDEFAULTS.DAT fromA DECW$EXAMPLES to the same location as in step 1.; Typically SYS$LOGIN or DECW$USER_DEFAULTS.4 3. Run the executable file CUSTOM.EXE. $ RUN CUSTOMF ________________________ Note ________________________A Only the colors of applications invoked after theD customizer starts will be affected. For this reason,D make the customizer the first X application to start) during the login process.F ______________________________________________________( o Modifying DECW$LOGIN.COMD The color customizer should be the first X applicationH started during the login process. This can be accomplishedB by starting it as a subprocess from within your fileD DECW$LOGIN.COM. You will also want to add a command toE wait, approx imately 10 seconds, to allow the customizerH to get started before starting other applications. Add the0 following lines to DECW$LOGIN.COM:. $! Starting the color customizer3 $ DISPLAY = F$LOGICAL("DECW$DISPLAY")F $ SPAWN/NOWAIT/OUTPUT='DISPLAY' RUN SYS$LOGIN:CUSTOM.EXE $ WAIT 0:0:10A See Using DECwindows Motif for OpenVMS and ManagingG DECwindows Motif for OpenVMS Systems for more information) on the file DECW$LOGIN.COM. 2 inter_sum =TITLE Command Interface SummaryG A list of available palettes is in the upper left sectionG of the screen-click on the desired palette to see it take effect.H Below that are two arrays of colored buttons, representingI the dynamically allocated color cells for normal and shadowH colors. To find out what resources are being affected by a H color cell, click and hold the arrow button next to it. AsF a shortcut, you can click on the screen facsimile in theF upper right corner of the dialog box. If the portion youI click on is colored by one of resource values controlled byH the customizer, the popup for the appropriate color button will be displayed.G To modify a single color cell, click on the correspondingB color button . A colormix widget will pop up, and, asD you modify the color, you will see these modificationsI reflected in your workstation environment. Use the colormixH widget reset button to return to the starting color at anyH time. You can also change the color cell you are modifyingH by clicking on a different color button while the colormix" widget is displayed.E The automatic shadowing option causes shadow  and selectI colors to be automatically updated when their correspondingI background colors are changed. The standard Motif shadowing9 algorithms are used for these calculations.I Use the File menu to modify, add, and delete color palettes as follows:C o To modify an existing palette, select the palette,F change to the desired colors, and choose Save Palette$ from the File  menu.I o To add a new palette to the list box, select an existingI palette, modify the colors as necessary, and choose SaveH Palette As... from the File menu. A message box prompts5 you for the name of the new palette.G o To delete a palette, select the palette in the listbox> and choose Delete Palette from the File menu.C Changes made through the File menu will automaticallyB  update the file that contains the resource defaults, CUSTOM.DAT.I The File menu Exit button causes the customizer applicationI to exit. A warning dialog is displayed first. Note that theF color cells allocated by the customizer (and used by theF currently running applications) will be freed. After theF customizer exits, if the colors of the currently runningI applications are not correct , the applications will need toG be restarted to restore normal colors. Normally, there isG no need to exit the color customizer-it is typically kept= running all the time, like the Session Manager. 2 chngcolmapC=TITLE Changing the Mapping Between Color Resources and Color CellsE The file DXMDEFAULTS.DAT allows you to control how manyF dynamic color cells are allocated and what resources areG affected. Th is file contains resource specifications like the following:; *background: DXmDynamicWindowBackground; *foreground: DXmDynamicWindowForeground: *topShadowColor: DXmDynamicWindowTopShadowI When the customizer is started, the file DXMDEFAULTS.DAT isG written to a property on the root window. Any applicationH that is subsequently run, which uses the correct X ToolkitA li brary, will merge these resources with its normalE resource database. Resource specifications in this fileF will take precedence over specifications with equivalent? left-hand sides in other resource defaults files.B The color values for the right side, within the fileE DXMDEFAULTS.DAT, have a special format. For each uniqueB color value in this file that begins with the stringB "DXmDynamic", a color button is created in the colorD customizer. If the string "Shadow" is encountered in aC name, the color button is placed in the shadow buttonE box rather than the normal color button box. If a colorC value string ends with the suffix "Background", it isE linked to any color buttons with identical prefixes andG suffixes of "TopShadow", "BottomShadow", or "SelectColor"I for purposes of automatic shad owing. If a color value namedI "DXmDynamicScreenBackground" is encountered, the color cellH allocated is used by the customizer to set the root window background color.C You can edit the file DXMDEFAULTS.DAT and define manyA resources to use the same color cells. You can haveD separate dynamic color cells, especially for scrollbarH widgets or for your Mail application, by adding lines like  the following:A Mail*background: DXmDynamicMyMailBackgroundA Mail*foreground: DXmDynamicMyMailForeground@ Mail*topShadowColor: DXmDynamicMyMailTopShadowC Mail*bottomShadowColor: DXmDynamicMyMailBottomShadowF Doing this and restarting the customizer causes four newG color cells to be allocated and four new color buttons toE be added to the customizer interface. These bu ttons areH assigned default color values (usually black or white) forH each palette. These defaults can then be modified for each7 palette through the customizer interface.F ________________________ Note ________________________@ The text of the DXMDEFAULTS.DAT file is read andE parsed by the color customizer. The parsing algorithm> does not allow comments, incorrect spacing, orB  incorrect resource specifications. If this file or@ the CUSTOM.DAT resource file become corrupt, theC customizer cannot start correctly. Copy the shipped? versions of CUSTOM.DAT and DXMDEFAULTS.DAT fromB DECW$EXAMPLES into your login directory to resolve the problem.F ______________________________________________________ 2 decterms#=TITLE DECterm Windows not AffectedH Th e color customizer does not affect the colors of DECterm@ windows, set up as described previously. To affectF the colors of DECterm windows, copy the DECterm resourceB specifications from the file DXMDEFAULTS.DAT and addC them to the DECterm resource defaults file DECW$USER_F DEFAULTS:DECW$TERMINAL_DEFAULT.DAT. For example, add theD following lines to the DECterm resource defaults file: . ! .T DECW$TERMINAL.main.terminal.background: DXmDynamicTerminalBackgroundT DECW$TERMINAL.main.terminal.foreground: DXmDynamicTerminalForegroundH This will allow the DECterm window colors to be customized( with the color customizer.2 auto_shadowJ=TITLE Changing the Default Value of the Automatic Shadowing Toggle ButtonH The default value of the Automatic shadowing toggle buttonD can be set using the Cus"tom.autoShadow resource in the) CUSTOM.DAT file as follows:) Custom.autoShadowing: False( The default value is True. 2 multihead0=TITLE Using the Customizer on Multihead SystemsG The color customizer only affects applications started onF the same screen as the customizer. On multihead systems,H you can start a different color customizer for each screenD and have a different palette in effect# on each screen.B The color customizer can be configured so that it isE invoked once and affects all applications regardless ofC where they are started. This mode can be turned on byI modifying the Custom.multiScreen resource in the CUSTOM.DAT' defaults file as follows:& Custom.multiScreen: True) The default value is False.2 xsetrootcust4=TITLE Using the XSETROOT_CUST Demonstration Program $; The XSETROOT_CUST.EXE demonstration program, createdB during the building of the customizer, is a modifiedE version of xsetroot that can be used to set a bitmap onE the root window. The XSETROOT_CUST.EXE program will useG DXmDynamicScreenBackground and DXmDynamicScreenForegroundF as the background and foreground colors of the specifiedC bitmap. If your DXMDEFAULTS.DAT file contains entriesF  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"7 $ XSETROOT_CUST -BITMAP your_xbm_file.XBMww