Next Previous Contents

19. Application Resources

The following sections detail the mgv application resources. Each resource name is followed by its type and the resource class name in parentheses. All resource settings should have the form:

        mgv*resourceName: value
to make sure the resource gets to the proper widget.

19.1 Help Resources

The following resource control various aspects of the on-line help system:

helpBrowser String (HelpBrowser)

This resource specifies the HTML browser to use for on-line help. The HTML files used by wlib are quite generic so any HTML browser should work. Note that the browser will be given a -display display argument before the actual URL so the browser that you use should understand this standard X option.

The helpType resource should agree with your chosen browser.

helpPrefix String (HelpPrefix)

The help prefix serves as the root of the HTML documentation tree. If the help files are installed locally, then this will be the full path (including the trailing slash) to the directory containing the help files. If you are accessing the help files through an HTTP server, then this resource should have the form http://hostname/path/to/help/files/. If you are using a helpType of libhelp, then the help files must be accessible from the file system.

helpType String (HelpType)

This resource specifies your preferred on-line help format. The following types are known:

html

Plain old HTML with no communication with the browser. This help method will launch a separate browser for each help request.

html-remote, netscape, remote

HTML with Netscape's -remote protocol.

libhelp

The libhelp help system. If you wish to use libhelp for online help then you should make sure that your LIBHELPPATH environment variable contains a path to the libhelp images; the application will add its own entries to LIBHELPPATH based on the helpPrefix resource so you should make sure that helpPrefix is correctly set. See http://www.informatik.uni-stuttgart.de/ipvr/bv/personen/mache/libhelp for more information about libhelp. This is the lightest weight help system currently supported so I recommend that you use it if possible.

All help methods except html will attempt to maintain a connection to the help browser used so that only one instance of the help browser will be used. Not all help methods are supported on all platforms but the three HTML methods should always be available (assuming the availability of browsers). If you supply an unknown help type a warning message will be printed on standard error and html will be used.

The helpBrowser resource should agree with your chosen help type.

19.2 Rendering Resources

The following resources control the actual PostScript rendering process and supply various rendering defaults. Most of these resources are converted to switches for the child Ghostscript that does all of the real work.

antialias Boolean (Antialias)

If this resource is true then PostScript files will be anti-aliased to improve image quality (at the expense of performance). Your Ghostscript must support the x11alpha device or anti-aliasing won't work. If anti-aliasing is enable, then the x11alpha device is used and Ghostscript will be run with the -dNOPLATFONTS switch; if anti-aliasing is disabled, then the x11 device will be used. The default value is true.

antialiasEPS Boolean (AntialiasEPS)

Anti-aliasing graphic images (which seems to be what most EPS files contain) will often produce a poorer quality display and significantly increase the rendering time. If you find yourself disabling anti-aliasing by hand whenever you open an EPS file, then this resource is for you. If you disable anti-aliasing globally, then this resource is irrelevant. If you enable anti-aliasing globally, then this resource is only relevant if its value is False; in this case, anti-aliasing will automatically be disabled when you load an EPS file and, of course, reset to the previous state when you load a non-EPS file. The default value is True which means that EPS files will be treated like any other PostScript file so that anti-aliasing of EPS files will be controlled by the antialias resource of the Ghostview widget.

arguments String (Arguments)

This resource is used to supply extra command-line switches to Ghostscript. This resource is useful for passing -I switches to Ghostscript when your library files are not where Ghostscript thinks they are. The default value is empty.

defaultPageMedia String (DefaultPageMedia)

This resource sets the media for documents that do not specify one with a %%BoundingBox or %%PageMedia comment. All of the values in the Media Menu are valid values for this resource and the values are case insensitive. The default is Letter.

gsLocale String (GsLocale)

This resource supplies the locale used when writing the GHOSTVIEW window property. In order to support multiple locales, mgv calls XtSetLanguageProc() and this might put you into a non POSIX locale; using a non-POSIX locale can alter the decimal separator so that commas are used where Ghostscript expects periods. By default, mgv temporarily forces a POSIX locale while building the the property string but your copy of Ghostscript may be expecting something else. If Ghostscript is having problems parsing the GHOSTVIEW property, then you should try adjusting this resource.

interpreter String (Interpreter)

Specify where your Ghostscript lives. If you don't specify a particular Ghostscript, mgv will use the first one that shows up in your PATH environment variable.

magstep Integer (Magstep)

This resource specifies the initial magstep. The default value is zero.

19.3 Display Resources

The following resources control which parts of the mgv user interface will be displayed at start up:

hideLog Boolean (HideLog)

If this resource is True then the Ghostscript message log will be hidden by default. Any errors from Ghostscript will force the log to be displayed. Messages from Ghostscript will be logged even if the log is hidden. The default value is True. Note that the log does not exist until there is something to put in it.

hideMenuBar Boolean (HideMenuBar)

This resource controls the initial state of the menu bar; if set to True, the menu bar will be hidden at start up and the menu bar will be visible at start up if this resource is False. The default value is False.

hidePageList Boolean (HidePageList)

When this resource is False, the page list will be visible at start up and the page list will be hidden if this resource is set to True. The default value is False.

hideStatusLine Boolean (HideStatusLine)

If this resource is True, the status line will be hidden at start up; if this resource is False, the status line will be visible at start up. The default value is False.

hideToolBar Boolean (HideToolBar)

If this resource is True, the tool bar will be hidden at start up; if this resource is False, the tool bar will be visible at start up. The default value is False.

showLabels Boolean (ShowLabels)

If this resource is True then the page labels, if any, will be displayed in the page list; if showPageNumbers is also True then both will be displayed. The default value is False.

showPageNumbers Boolean (ShowPageNumbers)

If this resource is True then the page numbers, if any, will be displayed in the pagelist; if showLabels is also True then both will be displayed. The default value is True.

19.4 Colormap Resources

The following resources control such things as private color maps and non-default visuals. If you're running out of colors, there may be some help for you here.

wlDepth Integer (WlDepth)

Specify a non-default color depth.

wlUsePrivateColormap Boolean (WlUsePrivateColormap)

Install a private colormap if true, otherwise use the default colormap. If you specify a non-default visual or depth, you will get a private colormap whether you ask for one or not.

wlVisualClass WlVisualClass (WlVisualClass)

Specify a non-default visual by visual class. The value of this resource can be any of the following strings (case insensitive):

StaticGray

This visual yields a hardware defined read-only grayscale palette, the colors cannot be changed to suit the application's needs.

StaticColor

This visual yields a hardware defined read-only color palette, the colors cannot be changed to suit the application's needs.

PseudoColor

This visual yields an indexed read/write palette, the colors may be modified to suit an application's needs. This is the most common visual on eight bit color displays.

GrayScale, GreyScale

This visual yields an indexed read/write palette where the red, green, and blue components of each color are equal.

TrueColor

This visual yields a hardware defined, non-indexed, read-only palette.

DirectColor

This visual is a high-performance visual where the red, green, and blue color components are separately indexed. The palette is read/write.

Not all visual classes are available with all servers, the xdpyinfo command will tell you which visuals are available. If you don't know what any of the descriptions mean, you should experiment to find the visual which you like best and bug the author (mu@trends.net) to clarify the documentation. If you aren't having any problems with your colormaps, then you should probably just use the defaults and leave these resources alone.

You might want to set the wlDepth resource as well.

wlVisualID String (WlVisualID)

Specify a non-default visual by visual id. This resource takes precedence over the wlDepth and wlVisualClass resources. This resource is available in case the visual chosen by the wlDepth and wlVisualClass resources is not the one you want--you should only use this resource if wlDepth and wlVisualClass are not giving the visual you want.

The final visual, depth, and colormap are chosen as follows:
  1. If the wlVisualID is set and it contains a valid visual, then we use that.
  2. If wlDepth and wlVisualClass are set, then we try and find a visual with the desired depth and class. If this fails, the defaults are used. If only wlDepth is set, then we use the first available visual which supports that depth.
  3. If wlVisualClass is set but wlDepth is not, we use the visual of the specified class which has the largest depth.
  4. If all else fails (or nothing special is requested), then the defaults supplied by Xt are used.
If wlUsePrivateColormap is true or the visual requires a private colormap, then a private colormap is used. Normally you can just specify the wlVisualClass and wlDepth (after looking at the output of xdpyinfo(1) first) and you'll get what you want, if that doesn't work, just specify the visual ID in wlVisualID.

19.5 Scrolling Resources

The following resource affect various aspects of scrolling in mgv:

center String (Center)

When this resource is True, pages will be centered when displayed. The default value is False. You can also enable or disable page centering at run-time with the Center menu entry.

magicResistance Integer (MagicResistance)

This resource specifies the number of consecutive attempts to scroll beyond the page boundaries that are needed before magic scrolling takes effect. This resource has no effect if magic scrolling is not enabled. The absolute value of this resource is used. If you want no resistance at all (i.e. magic happens as soon as you try to exceed the page boundary), use a value of zero. The default value is 2 (i.e. the second attempt succeeds).

The documentation for the mgvScroll contains some more notes about scrolling in general.

magicScrolling Boolean (MagicScrolling)

When this resource is True, mgv will move to the next page if you try and scroll down at the bottom of a page and move to the previous page if you try and scroll up at the top of a page. You can change this behavior at run-time via the Option menu. The default value is True.

resetScrollBars ResetScrollBars (ResetScrollBars)

This resource controls the resetting of the horizontal and vertical scrollbars in the main window when you change pages; the possible values are

All of these values are case-insensitive. When this resource is used, the chosen scrollbars will be moved back to their home positions (the top or left edge) when you change pages. Note that changing the orientation or media type will always reset both scrollbars. The default value is both.

scrollPercentage Percentage (ScrollPercentage)

This resource controls how far the page will move when you scroll with the mgvScroll action (i.e. the keyboard but not the little buttons on the scrollbars). A value of 100% will scroll a whole window height/width while a value of 90% (the default) will leave a little bit of overlap for context. If the value you specify has a trailing percent sign ("%"), then it will be interpreted as a percentage (i.e. the value will be divided by 100), otherwise, the value will be considered a raw floating point value. For example: 75%, .75, and 7.5e-1 all represent the same value.

smoothScrolling Boolean (SmoothScrolling)

This resource controls the smooth scrolling in the main viewing window. When smooth scrolling is enabled, scrolling with the mgvScroll action (i.e. with the arrow keys but not the little buttons on the scrollbars) will scroll the screen a couple pixels at a time with an update after each movement; this will give the scrolling a smoother appearance than the normal scrolling. When smooth scrolling is disabled, the normal scrolling is performed. Smooth scrolling makes it much easier to keep track of where you are on the page but it is slower: caveat emptor. Smooth scrolling can be turned on and off at run time from the Options menu. Smooth scrolling is enabled by default.

smoothness Integer (Smoothness)

This resource controls how smooth smooth scrolling will be; the normal increment (see the scrollPercentage resource) is divided by the value of this resource to determine how many pixels to scroll between screen updates. Larger values will yield smoother scrolling but will take more time. Values between 20 and 30 tend give fairly good results (this is dependent on how fast your machine and X server are). The default value is 25.

19.6 Sizing Resources

The following resources control how mgv resizes the main window to accomodate the page size of a PostScript file.

autoHeight Boolean (AutoHeight)

If the this resource is True then mgv will attempt to make the main window tall enough to display an entire page; your window manager may refuse the request but mgv will try anyway. This resource is False by default.

autoWidth Boolean (AutoWidth)

If the this resource is True then mgv will attempt to make the main window wide enough to display an entire page; your window manager may refuse the request but mgv will try anyway. This resource is True by default.

smartSizing Boolean (SmartSizing)

This resource controls how smart the automatic sizing will be. If this resource is True, then mgv will attempt to keep the window smaller than the screen during automatic resizing; if False, mgv will leave this task to your window manager. The default is False since this stuff is really your window manager's problem.

You should only need to use the smartSizing resource if your window manager allows windows to exceed the screen size. If you need to use this resource, you should set the wmWidth and wmHeight resources since there is no sane way to get determine how large the window manager decorations are.

wmHeight Integer (WmHeight)

This resource specifies the height (top and bottom combined) of the window manager decorations. You will only need to care about this resource if you need to use the smartSizing resource. The default value of 30 is most likely incorrect for your system; the easiest way of finding the correct value is to run "xwininfo" and "xwininfo -frame" and use the difference between the reported Height values.

wmWidth Integer (WmWidth)

This resource specifies the width (both sides combined) of the window manager decorations. You will only need to care about this resource if you need to use the smartSizing resource. The default value of 12 is most likely incorrect for your system; the easiest way of finding the correct value is to run "xwininfo" and " xwininfo -frame" and use the difference between the reported Width values.

19.7 Splash Screen and Icon Resources

The following resources control the mgv splash screen and window manager icon.

wlInstallIcon Boolean (WlInstallIcon)

This resource tells the application to install or not install its own built-in icon when it runs. If you have your own cool icon that matches your personal desktop better than the built-in icon you can set this resource to false and tell your window manager to use your preferred icon. This resource is true by default.

wlSplashBitmap String (WlSplashBitmap)

The full path to your desired splash screen as an XBM file.

wlSplashPixmap String (WlSplashPixmap)

The full path to your desired splash screen as an XPM file. If the file doesn't exist or cannot be loaded, then the bitmap will be tried.

wlShowSplashScreen Boolean (WlShowSplashScreen)

If this resource is True, the splash screen will be shown; if this resource is False, the splash screen will not be shown. The internal default is False but the application defaults file will probably specify True.

wlUseColorIcon Boolean (WlUseColorIcon)

Use or don't use a color icon. If the color icon is not available (due to a lack of Xpm support), then the monochrome icon will be used. The default value for this resource is true.

wlUseMonoSplash Boolean (WlUseMonoSplash)

If this resource is True, then the application will show the monochrome splash screen without even trying to show the color one. Normally, the application will try the color splash screen (as specified by the wlSplashPixmap resource) and then try the monochrome splash screen (as specified by the wlSplashBitmap resource) if that doesn't work. The default value is False.

19.8 Tool Bar Resources

The following resources control various aspects of the mgv toolbar.

buttonMarginExtra Dimension (ButtonMarginExtra)

Margin setting for tool bar buttons. The default value is 1.

buttonShadowThickness Dimension (ButtonShadowThickness)

The shadow thickness for tool bar buttons. The default value is 1.

flattenButtons Boolean (FlattenButtons)

If this resource is True, the toolbar buttons will appear flat until the mouse passes over them, when the mouse enters one of the buttons, it will pop up (i.e. its shadow will be drawn). If this resource is False, the toolbar buttons will look and act like every other button. The default value is True.

groupSpacing Dimension (GroupSpacing)

The amount of space between groups of buttons (see newGroup). The default value is 10 pixels.

showToolTips Boolean (ShowToolTips)

If this resource is True, then tool tips will be shown for the toolbar buttons, otherwise, tooltips will not be shown. The default value is True.

tipBackground Color (TipBackground)

The background color for tool tips. The default value is yellow.

tipBorderWidth Dimension (TipBorderWidth)

The border width for tool bar buttons. The default value is 1.

tipDelay Integer (TipDelay)

The delay before showing a tool tip. When the mouse cursor enters a tool bar button, mgv will wait tipDelay milliseconds before showing the tool tip. The default value is 1000 (one second).

tipDistance Dimension (TipDistance)

The distance, in pixels, between a tool bar button and its tool tip. The default value is 10 pixels.

tipFontList FontList (TipFontList)

The font list to use when drawing tool tips. The default is the standard Motif default font list.

tipForeground Color (TipForeground)

The foreground color for tool tips. The default is black.

tipPosition TipPosition (TipPosition)

The position, relative to the button, where tool tips will be drawn. This resource may have one of the following values:

The values may be specified with a tip-, wltip-, xwltip-, or xmtip- prefix and underscores may be used instead of hyphens. The default value is bottom-left.

useColorIcons Boolean (UseColorIcons)

If this resource is True then mgv will attempt to use color icons in the toolbar, if False then monochrome images will be used. If your copy of mgv was compiled without XPM support then you will get monochrome toolbar icons even if this resource is True. The default value is True.

The following resources can be set on the tool bar buttons:

newGroup Boolean (NewGroup)

Mark a button as the start of a new group of buttons. Button groups are separated by groupSpacing extra space. The default value is False.

toolBarIcon String (ToolBarIcon)

The name of the icon to use for this button. This resource specifies a name which is used to construct file names or a value in an internal icon table. If the name begins with INTERNAL:: then the list of compiled-in icons is used to find the icon, otherwise, the name should specify a full path to your desired icon without the .xpm or .xbm extension: the extension will be appended by mgv. The insensitive icon image file should have a -i suffix; for example: if the image name is someIcon, then the sensitive pixmap would be someIcon.xpm and the insensitive pixmap would be someIcon-i.xpm. Color icons should be in XPM format, monochrome icons in XBM format. For color icons, you can use the None and none color symbols to indicate transparency (the GIMP, at least, uses these symbols in transparent XPM files).

toolTip String (ToolTip)

The tool tip to display for this button. The default value is an empty string.

19.9 Miscellaneous Resources

The following list contains resources which don't fit in any of the other categories:

applicationVersion String (ApplicationVersion)

This resource holds the application version number. mgv uses the value of this resource to check the version of the application defaults files that gets used. If the incorrect version is found, mgv will warn you to expect strange behavior. If this occurs, then you have the wrong version of the application defaults installed somewhere and you should remove or replace it.

You should never alter the value of this resource.

bunzip String (Bunzip)

This resource contains the command (including arguments) that will be used to decompress bzip2ed files; the command must read from the standard input and write to the standard output. By default this resource is set to "bunzip2".

bzip String (Bzip)

This resource contains the command (including arguments) that will be used to compress files with bzip2; the command must read from the standard input and write to the standard output. This resource defaults to "bzip -9".

compress String (Compress)

This resource contains the command (including arguments) that will be used to compress files with compress; the command must read from the standard input and write to the standard output. This resource defaults to "compress".

confirmExit Boolean (ConfirmExit)

If this resource is True and you have multiple top level viewing windows when you issue an exit request (through the Exit entry in the File menu), you will be prompted to confirm that you really meant it; note that this resource only has an effect when you have more than one viewing window. The default is True.

copyStdin Boolean (CopyStdin)

This resource controls whether or not PostScript files read from the standard input are copied to temporary files. If you don't copy the standard input then you won't get page navigation; however, if the file you're reading from the standard input is quite large you may wish to give up page navigation to avoid running out of temporary file space. This resource is True by default.

decompress String (Decompress)

This resource contains the command (including arguments) that will be used to decompress compressed files; the command must read from the standard input and write to the standard output. By default this resource is set to "gzip --stdout --decompress".

gunzip String (Gunzip)

This resource contains the command (including arguments) that will be used to decompress gzipped files; the command must read from the standard input and write to the standard output. By default this resource is set to "gzip --stdout --decompress".

gzip String (Gzip)

This resource contains the command (including arguments) that will be used to compress files with gzip; the command must read from the standard input and write to the standard output. This resource defaults to "gzip -9".

killChildrenAtExit Boolean (KillChildrenAtExit)

When this resource is True, all child processes (which for now are just the HTML browsers) will be killed, using SIGTERM, when mgv exits; if this resource is False, then the children will be left alone. Note that Ghostscript children will always be killed. By default this resource is True.

printCommand String (PrintCommand)

The command for your printer spooler. If you don't specify this resource, mgv will attempt to determine it automatically by looking for lp in your PATH environment variable and if lp cannot be found, it will search for lpr. The printCommand does not understand shell quoting, the command will be broken into arguments at white space boundaries; if you really need to supply quoted arguments to your print command, then you'll have to write a shell script wrapper. The print dialog allows you to change the print command.

reticuleForeground Color (ReticuleForeground)

This resource specifies the foreground color for the zoom selection reticule; the reticule is drawn in xor mode so it should always be visible. The default value is red.

reticuleLineWidth Integer (ReticuleLineWidth)

This resource specifies the width of the lines used to draw the zoom selection reticule. The default value is 2.

tempDir String (TempDir)

This resource specifies where temporary files should be stored. If this resource is not specified, mgv will use the directory specified in first available source from the following list:

For convenience, mgv will create its own directory under the specified directory.

wlUseEditRes Boolean (WlUseEditRes)

This resource controls whether support for the editres protocol will be installed in application shell widgets. If wlUseEditRes is true, then the editres protocol will be support; otherwise, editres will not be supported. On system that don't support editres at all, this resource will do nothing. The default value is true.

19.10 The Application Defaults File

By default the mgv application defaults file is installed in the mgv library directory for future reference--the application defaults is not needed since the entire application defaults file is compiled into mgv as fallback resources. However, you may, if you wish, install the application defaults file in the normal location (probably /usr/lib/X11/app-defaults or /usr/X11/lib/X11/app-defaults) and everything should work just fine until the next mgv upgrade.

I stopped installing the application defaults file in the app-defaults directory to avoid version conflicts: an incorrect application defaults file can seriously break mgv. mgv will detect an out-of-date application defaults file and warn you about it.


Next Previous Contents