  MGv 2.2.1: A Motif Interface to Ghostscript
  Eric A. Howe (mu@echo-on.net)
  1997/12/09

  MGv is free software; you can redistribute it and/or modify it under
  the terms of the GNU General Public License as published by the Free
  Software Foundation; either version 2 of the License, or (at your
  option) any later version.  This program is distributed in the hope
  that it will be useful, but WITHOUT ANY WARRANTY; without even the
  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR-
  POSE.  See the ``GNU General Public License'' for more details.  You
  should have received a copy of the GNU General Public License along
  with this program; if not, write to the Free Software Foundation,
  Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  ______________________________________________________________________

  Table of Contents:

  1.      Introduction

  1.1.    Running MGv

  2.      The Main Window

  3.      The File Menu

  4.      The Page Menu

  5.      The Mark Menu

  6.      The Magstep Menu

  7.      The Orientation Menu

  8.      The Media Menu

  9.      The Options Menu

  10.     The Window and Popup Menus

  11.     The Help Menu

  11.1.   About Dialog

  11.2.   Build Options Dialog

  12.     Printing

  13.     Zooming

  14.     The Ghostscript Message Log

  15.     Application Resources

  15.1.   The Application Defaults File

  16.     Actions

  17.     Command Line Switches

  18.     Caveats and Bugs

  18.1.   Modal Dialogs

  18.2.   Anti-aliasing

  18.3.   Non-DSC and PDF Documents

  18.4.   Broken Windows PostScript Drivers

  18.5.   DSC Parsing Problems

  18.6.   Application Defaults Version Problems

  18.7.   LessTif Problems

  18.8.   Non-Default Visuals on Irix 5.3

  18.9.   Reporting Bugs

  19.     Mathoms

  19.1.   Enlightening MGv

  19.2.   Using MGv With Netscape

  19.3.   Using MGv With CDE

  20.     See Also

  21.     Availability

  22.     Acknowledgements

  23.     Installing and Porting

  23.1.   Porting

  24.     History

  24.1.   MGv 2.2.1: December 1997

  24.2.   MGv 2.2: November 1997

  24.3.   MGv 2.1: October 1997

  24.4.   MGv 2.0.2: August 1997

  24.5.   MGv 2.0.1: August 1997

  24.6.   MGv 2.0: August 1997

  24.7.   MGv 1.0: September 1996

  25.     Wish List

  26.     The Interface to Ghostscript

  26.1.   The GHOSTVIEW Environment Variable

  26.2.   The GHOSTVIEW Property

  26.3.   Events from Ghostscript

  27.     GNU General Public License

  27.1.   Philosophy
  ______________________________________________________________________

  1.  Introduction

  MGv is essentially a Motif version of the Ghostview PostScript viewer;
  in fact, the Ghostview widget and the DSC parser in MGv are the same
  as the ones in Ghostview (with minor tweaks).  The two programs are
  almost identical in terms of features but MGv has nicer zooming
  (inspired by Ghostview-VMS), an HTML based on-line help system, a
  nicer Motif user interface, and rudimentary support for PDF files (if
  your Ghostscript can deal with PDF).  As of version 2.0, MGv also
  supports multiple top level windows, viewing of compressed/gzipped
  files, scrolling with automatic page changes, arbitrary magsteps (up
  to the limits of your memory of course), and smooth scrolling.  MGv is
  almost a complete re-write, the only things from Ghostview are the
  Ghostview widget and the DSC parser and even these have been modified
  to suit my needs.

  This project started out as a test bed for the widget tree creation
  ideas in wlib and then became a playpen for learning more about Xt and
  Motif.  Along the way MGv became a useful program so I decided to
  release it for others to use.  I still consider MGv a playground for
  learning and trying new things with Xt and Motif but since I view a
  lot of PostScript documents, I will do my best to keep MGv free of
  bugs.

  Parts of this document were extracted from the documentation supplied
  with Ghostview version 1.5; in particular, ``The Interface to
  Ghostscript'' is essentially the contents of the gs.interface file
  from Ghostview 1.5.

  The documentation for MGv is available in PostScript (mgv.ps and mgv-
  a4.ps), HTML (mgv*.html), and ASCII text (mgv.txt) formats.

  1.1.  Running MGv

  Executing MGv is very simple:

          mgv [switches] file.ps ...

  If you mention multiple files on the command line, MGv will attempt to
  open each file in its own window (so be careful with "mgv *.ps").  The
  available switches are detailed in the ``Command Line Switches'' sec-
  tion.

  2.  The Main Window

  The main MGv window consists of the following areas:

     Menu Bar
        The menu bar is across the top of the MGv window; nothing
        exciting here.  The menu bar may be toggled on and off via the
        ``Window menu''.

     Page List
        The scrolled list along the left side contains the page numbers
        (if any); selecting an entry in this list will display the
        selected page.  Marked pages will appear in a different font
        (the fontList resource for the list should contain two fonts
        tagged MARKED and UNMARKED).  Shift-button1 will toggle the
        marked status of a page in the page list (see ``The Mark Menu''
        for more information on marking pages).  If the %%Page comments
        in the current document contain page labels, then the page list
        will display the labels along with the raw page numbers; you can
        toggle between page numbers and labels and just page numbers
        using the ``Page'' menu.  The page list may be toggled on and
        off via the ``Window menu''.

     Status Line
        Along the bottom of the MGv window there is a status line which
        displays the name of the current document, the creation date if
        available, and the current cursor position.  If the document
        contains a %%Title comment, then that will be used as the name,
        otherwise, the name of the file is used.  The status line may be
        toggled on and off via the ``Window menu''.

        The status line also contains a ``magstep'' display and a button
        for changing the magstep.  When you press this button, the
        button will turn into a text field; type in your desired magstep
        and press Enter to activate it.  This button has the same effect
        as using the ``Set...'' entry on the Magstep menu.

     Viewing Area
        The rest of the MGv window is the actual viewing area.  Mouse
        button one will activate the zooming reticule when you are in
        this area (see ``Zooming'').

  Inside the viewing area and page list, the cursor keys will scroll the
  main window.

  3.  The File Menu

  The File menu contains the following items:

     Open (Ctrl+O)

        This button will open a new file.  A file selector will be
        popped up for you to chose a file to open.  The file selector
        will have an extra Browse toggle button; when this toggle is
        activated, the file selector will not automatically pop down
        when a file has been selected.  If the New Window toggle is on
        when you select a file, a new MGv window will be created with
        your chosen file; otherwise, the new file replaces the current
        file.  When you open a file, all of the zoom windows attached to
        the old file will be removed from the screen.  If the selected
        file appears to compressed (i.e. has an extension of Z, z, or gz
        and starts with one of the correct magic numbers), MGv will
        attempt to decompress it using the command specified in the
        ``decompress'' resource.

     Reopen (Ctrl+R)
        This button re-opens the current file.  The current page number
        will be retained if possible.  If you have explicitly requested
        a page orientation (i.e. you pushed one of the radio buttons in
        the ``Orientation'' menu) then that orientation will remain in
        effect.  This is equivalent to choosing the current file through
        the Open menu entry, reselecting the current page, and possibly
        resetting the orientation.

     Save (Ctrl+S)

        Activating this entry will prompt you for a file name and write
        the current document, all or only the marked pages, to disk.
        The file selector will have two extra toggle buttons:

        Save Marked Pages Only
           When this toggle is set, only the currently marked pages will
           be written; otherwise, the entire document will be written.

        Unmark Pages After Saving
           If this toggle is set, all pages will be unmarked after
           saving.

        If you select a file that already exists, you will be asked if
        you want to overwrite it (the confirmation dialog is modeless so
        you can type in a different name without responding to the con-
        firmation request and the right thing will be done).

     Print (Ctrl+P)
        This will bring up a dialog box which allows you to print the
        whole file or just the marked pages (if any); the print dialog
        is explained in ``Printing''.

     Close (Ctrl+D)
        Close the current window; if there is only one viewing window,
        then this is equivalent to Exit.

     Exit (Ctrl+C)
        Exit MGv.  If you have more than one viewing window and the
        confirmExit resource is True, you will be asked for
        confirmation.  Note that all of MGv's child processes--including
        HTML browsers--will be terminated (via SIGTERM) when MGv exits
        (if you don't like this, the ``killChildrenAtExit'' resource can
        be used stop it).

  4.  The Page Menu

  The Page menu contains various page movement controls.

     Next (PageDown), Previous (PageUp)
        Display the next or previous page.

     Center (Alt+C)
        Center the current page in the display.

     Redisplay (Alt+R)
        Redisplay the current page.

     Show Page Labels (Alt+B), Show Page Numbers (Alt+N)
        These toggles control what is displayed in the page list.  The
        Page Numbers are just absolute position numbers; the Page Labels
        are arbitrary strings which were assigned by the application
        which generated the PostScript file.  The labels will often
        match up with the table of contents (if there is one) of the
        document.  For example, the page numbers may be 1, 2, 3, 4, 5, 6
        but the labels might be 0, i, 1, 2, 3, 4.

        Page labels will appear in parentheses.

        Turning off both page labels and page numbers will remove the
        page list from the screen; if you bring the page list back using
        the ``Window'' menu and both labels and numbers are deactivated,
        the page numbers will be turned on to make sure there is
        something to show.

     Automatic Sizing
        This sub-menu offers the following radio buttons for controlling
        automatic window sizing:

        Size (Ctrl+E)
           Try and keep the main window large enough to display the
           entire page.

        Height (Ctrl+H)
           Try and keep the main window tall enough to display an entire
           page height.

        Width (Ctrl+W)
           Try and keep the main window wide enough to display an entire
           page.

        None (Ctrl+N)
           Leave the window size alone.

        If your window manager doesn't limit the size of windows (some
        won't let you resize a window to exceed the screen size), then
        you can try and use the ``smartSizing'' resource to limit the
        resizing.

        Whether or not any of this sizing stuff works is really up to
        your window manager (which is not required to honor out humble
        requests) but most window managers will grant our wishes (within
        limits).

  5.  The Mark Menu

  This Mark menu contains the various page marking commands.

     Mark Current Page(Ctrl+M), Mark All (Alt+M)
        Mark the current page (or all pages).  Marked pages will appear
        in a different font in the page list.

     Unmark Current Page (Ctrl+U), Unmark All (Alt+U)
        Unmark the current page (or all pages).

     Mark Even Pages (Alt+E), Mark Odd Pages (Alt+D)
        Mark the even/odd numbered pages; odd/even numbered pages will
        be un-marked if they are marked.

     Invert Marked Pages (Alt+I)
        Mark the un-marked pages and un-mark the marked pages (i.e.
        toggle the marked status of each page).

  6.  The Magstep Menu

  The Magstep menu controls the document magnification.  The default
  magstep, zero, implies no magnification (i.e. the on-screen image
  should be the same size as the paper version).  Positive magsteps
  increase the magnification by a factor of 1.2 at each step and
  negative magsteps decrease the magnification by a factor of 1.2 at
  each step.  The factor of 1.2 is the same factor used by Ghostview
  (upon which MGv is based) and Ghostview borrowed the factor from TeX:
  if 1.2 is good enough for Donald Knuth, then it is certainly good
  enough for me.

  The following entries are provided on the menu:

     Decrease (Alt+-), Increase (Alt++)
        Decrease or increase the magstep factor.

     -5, -4, -3, -2, -1, Normal (Alt+0), +1, +2, +3, +4, +5
        Set the magstep to the specified number; normal means zero
        magnification.  The radio buttons are provided for convenient
        access to commonly used magsteps.  If none of the radio buttons
        are toggled on, then you have a magstep outside their range.

     Set...

        This pops up a simple dialog which allows you to set a specific
        magstep value.

  The current magstep is displayed in, and can be changed from, the
  status line.

  If the magstep is above +5 or below -5, then no radio button will be
  on but the status line will still show the correct value.

  Warning:  High magsteps can be pretty hard on your machine:  caveat
  emptor.  If you want to put an upper limit on the magstep, a simple
  modification to magstep.c:mgv_ui_magnify() is all that is needed (just
  don't make it less than 5 or you'll probably confuse the program).

  7.  The Orientation Menu

  The following page orientations are available:

     Portrait
        This is the natural orientation for a given media; in most
        cases, the short sides will be at the top and bottom.

     Landscape
        This is a clockwise rotation of 90 degrees.  Some PostScript
        producers get things backwards and rotate counter-clockwise so
        you might have to use the Seascape orientation instead.

     Upside-down
        This is a rotation of 180 degrees.  Note that this is not a
        reflection so Upside-down may be misleading.

     Seascape
        This is a clockwise rotation of 270 degrees.  Some PostScript
        documents that claim to be landscape have actually been rotated
        by 90 degrees counter-clockwise so you might have to use this
        orientation to get a landscape document to appear right-side-up.

  If you explicitly force an orientation, MGv will preserve it if you
  reopen the current document.

  8.  The Media Menu

  The Media menu allows you to select different paper sizes; if the
  paper size can be determined from the PostScript file, then that paper
  size will be selected by default, otherwise, the value of the
  defaultPageMedia resource (see ``Application Resources'') will be
  used.  The following media, which are the standard ones from Adobe's
  PPD, are currently supported (there are 72 points in an inch and about
  28.3 points in a centimeter):

     Letter, Letter Small
        Standard U.S. paper, 612x792 points.

     Tabloid
        792x1224 points

     Ledger
        1224x792 points (note that this is the only standard media that
        is wider than it is tall).

     Legal
        612x1008 points.

     Statement
        396x612 points.

     Executive
        540x720 points.

     A3 842x1190 points.

     A4, A4 Small
        This is the most common European paper, 595x842 points.

     A5 420x595 points.

     B4 729x1032 points.

     B5 516x729 points.

     Folio
        612x936 points.

     Quarto
        610x780 points.

     10x14
        720x1008 points.

  A3, A4, B4, and B5 are European paper sizes, the others are North
  American sizes.

  9.  The Options Menu

  The Options menu is effectively a dumping ground for menu items that
  don't belong in any of the other menus; the following items have been
  abandoned here:
     Enable Anti-aliasing (Ctrl+A)
        Enable or disable anti-aliasing within Ghostscript.  Your copy
        of Ghostscript must support the x11alpha device if you want to
        use anti-aliasing.  Note that anti-aliasing can make some
        PostScript files look worse (see ``Caveats and Bugs'').

     Enable Magic Scrolling (Alt+G)
        Enable or disable magic scrolling.  When magic scrolling is
        enabled, attempting to scroll down at the bottom of a page (or
        scroll up at the top of a page) will move you to the next (or
        previous) page. The ``magicResistance'' resource controls the
        number of attempts you have to make before magic scrolling takes
        effect.

     Enable Smooth Scrolling (Alt+L)
        Enable or disable smooth scrolling.  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, normal scrolling is performed.  The
        ``smoothScrolling'' resource controls the initial state of
        smooth scrolling and the ``smoothness'' resource controls how
        smooth the scrolling will be.  If you're interested in the
        scrolling, you might want to look at the ``scrollPercentage''
        resource as well.

     Enable Smart Sizing (Alt+Z)
        Enable or disable smart sizing.  The documentation for the
        ``smartSizing'' resource covers the smart sizing features and
        their limitations.

     Color Palette
        This sub-menu allows you to choose the color palette used for
        rendering files.  You can choose from Monochrome, Grayscale, and
        Color palettes.  Palette changes are not propagated to existing
        zoom windows but the new palette will be used by new zoom
        windows.

  10.  The Window and Popup Menus

  The Window menu supplies buttons for hiding/showing various parts of
  the MGv user interface; for convenience, the window menu is duplicated
  as a popup menu which can be activated by pressing mouse button three
  anywhere in the main window.  The following items are available on
  both menus:

     Hide Log (Ctrl+L)
        This hides or un-hides the Ghostscript ``message log''.

     Hide Page List (Ctrl+G)
        This hides or un-hides the page list.  If you have deactivated
        both page labels and page numbers from the ``Page'' menu, un-
        hiding the page list will turn on page numbers so it has
        something to display.

     Hide Status Line (Ctrl+T)
        This hides or un-hides the status line.

     Hide Menu Bar (Ctrl+B)
        This hides or un-hides the menu bar.  Note that the menu bar and
        the accelerator keys are still active even when the menu bar is
        hidden--hiding the menu bar only places it underneath the main
        viewing window (this is sneaky but it works just fine).

     Close All Zooms (Ctrl+Z)
        This will close all of the existing zoom windows.

  11.  The Help Menu

  The Help menu provides access to the on-line help system via the
  following entries:

     Contents

        This entry will launch an HTML browser, set via the helpBrowser
        resource (see ``Application Resources''), with the contents
        page.

     On Context (F1)

        This entry will change the mouse cursor to a question mark; if
        you click on a widget, an HTML browser will be launched with the
        help entry for that widget.  If the widget doesn't have any help
        text, the bell will be rung and no browser will get launched.

     On Application Resources

        This entry will launch an HTML browser, set via the helpBrowser
        resource, with the ``Application Resources'' section.

     On Command Line

        This entry will launch an HTML browser, set via the helpBrowser
        resource (see ``Application Resources''), with the ``Command
        Line Switches'' section.

     About

        This will pop-up a dialog box with the MGv version, operating
        system, etc...  If you encounter a bug, the information in this
        dialog may be useful to the author.

  If you are using Netscape/remote, Mosaic/CCI, or libhelp for on-line
  help, then MGv will attempt to maintain a connection with the browser
  so that only one instance of the browser will be required.  If you are
  using plain HTML, then MGv will launch a separate browser for each
  help request.  Note that when MGv exits, it will attempt to kill (via
  SIGTERM) any browsers that it has launched (this can be changed by
  setting the ``killChildrenAtExit'' resource to False).

  11.1.  About Dialog

  The About dialog contains the program name, a copyright statement,
  author contact information, a Build Options button, and a Dismiss
  button.  The Dismiss button will remove the about box from the screen;
  if the Build Options dialog is also visible, it will be removed as
  well.  Activating the Build Options button will pop up the Build
  Options dialog (see ``Build Options Dialog'').

  11.2.  Build Options Dialog

  The Build Options dialog contains various flags and program names used
  to compile the program;.  The entries are as follows:

     version
        The program version.

     OS The operating system name and version number.

     cc The C compiler used.

     defs
        Macros defined by the build system.

     warn
        Warning and other miscellaneous compiler flags.

     opt
        Optimization/debugging compiler flags.

     incl
        Include paths for the C compiler.

     ldflags
        Flags passed to the linker.

     libs
        Libraries used to link the program.

     uname
        This line will contain the operating system name, release
        number, version, and machine type.  The OS line should contain
        similar information but the values in uname come straight from
        the operating system rather than the person that compiled the
        program.

     build date
        The data and time (in the form yyyy/mm/dd HH:MM UTC) when the
        program was linked.

  If you find a bug, the information in this dialog may be useful to the
  maintainer.

  Dismissing the About dialog will also dismiss the Build Options
  dialog.

  12.  Printing

  MGv has the ability to print an entire document or just selected
  pages.  Printing is accessed through the Print button in the File menu
  which pops up a Print dialog.  You can try and print a PDF file but
  don't expect it to work unless your print spooler knows what to do
  with PDF files.

  The Print dialog contains the following widgets:

  o  A text field for specifying the print spooling command to use.  The
     command should specify the printer to use and arguments to make it
     read from the standard input.

  o  A Print Marked Pages Only toggle button.  If this toggle is set,
     only the marked pages will be sent to the print spooler.  This
     toggle is only active if there are marked pages.

  o  An Unmark Pages After Printing toggle button.  If this toggle is
     set, the marked pages will be unmarked after the marked pages have
     been submitted to the print spooler.  This toggle is only active if
     there are marked pages.

  o  A Print button.  Pressing this button will submit the requested
     pages to the print spooler and pop down the Print dialog.  Any
     output from the print spooler will be displayed in a message box.

  o  A Help button for requesting help.

  o  A Dismiss button for popping down the Print dialog.

     The default print command is taken from the printCommand and
     printer application resources.  If you do not specify the printer
     or printCommand resources, MGv will attempt to choose sensible
     values. The ``Application Resources'' section discusses the
     guessing procedure.

  If the current document does not contain DSC comments, then you will
  not be able to mark individual pages and hence, you will only be able
  to print the entire document.

  If your print spooler prints any status messages, a message box
  containing the messages will be popped up.

  13.  Zooming

  If you wish to magnify a section of the displayed image, you can
  either magnify the entire image using the ``Magstep Menu'' or zoom in
  on a specific region using mouse button one.  Pressing mouse button
  one and dragging will mark out the selected area; when the button is
  released, a menu will popup with several zoom factors to choose from.
  Of course you can zoom in on a zoom if you wish.

  Note that resizing a zoom dialog stretches the area rather than
  expanding it.

  14.  The Ghostscript Message Log

  All messages from Ghostscript are stored in a log dialog.  By default
  this dialog is not visible but may be viewed at any time using the
  Hide Log entry in the ``Window Menu''.  The ``hideLog'' application
  resource may be used to alter the default behavior for all instances
  of MGv and the -log and -nolog command-line switches (see ``Command
  Line Switches'') may be used to alter the default behavior for a
  single execution.  The message log is also used to display errors from
  the Ghostscript interpreter.  If there is an error, the log will
  automatically pop up.

  The log dialog consists of the following widgets:

  o  A Scrolled text region for displaying the messages.  The text
     widget is editable so you are free to add notes if you find a bug
     in MGv, Ghostscript, or someone's PostScript program.

  o  A Hide button for popping down the log until an error occurs or you
     explicitly request its presence again.

  o  A Save button for saving the current contents of the log to a file.
     This button will activate a standard file selector to ask for the
     filename.

  o  A Clear button for emptying the log.

  o  A Help button for requesting help on the log dialog.

  15.  Application Resources

  The following list details the MGv application resources.  Each
  resource name is followed by its type and the resource class name in
  parentheses.

     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.

     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.

     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.

     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.

     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".

     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.

     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.

     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.

     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.

     magstep Integer (Magstep)
        This resource specifies the initial ``magstep''.  The default
        value is zero.

     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 printer command
        should contain a %s where the actual printer name should go.
        The ``print dialog'' allows you to change the print command.

     printer String (Printer)
        This resource specifies the name of the printer to use.  If you
        don't specify this resource, MGv will attempt to read the
        contents of the LPDEST environment variable and then the PRINTER
        environment variable.  If neither of these variables is set, the
        default value will be ps.  The ``print dialog'' allows you to
        change the printer name.

     resetScrollBars Boolean (ResetScrollBars)
        If this resource is True, then the scrollbars on the viewing
        window will be moved back to their home positions (i.e. the
        upper left corner of the page will be visible) whenever you
        change pages, otherwise, the visible region will be unchanged
        when you change pages.  Note that changing the orientation or
        media type will always reset the scrollbars.  The default value
        is True.

     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.

     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.

     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.

     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.

     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.

     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:

     o  the TMPDIR environment variable

     o  the TEMPDIR environment variable

     o  the standard temporary directory for your system (P_tmpdir in
        stdio.h).

     o  /tmp/.

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

     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.

     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.

  The following resources affect the Ghostview widget in MGv:

     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.

     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.

     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.

  You should set these resources with a prefix of "MGv*Ghostview.".

  The WlAppShell widget (which is used instead of the standard
  applicationShell widget for non-default visual support) defines the
  following resources:

     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 xdpy-
        info command will tell you which visuals are available.  If you
        don't know what any of the descriptions mean, you should experi-
        ment to find the visual which you like best and bug the author
        (mu@echo-on.net) to clarify the documentation.  If you aren't
        having any problems with your colormaps, then you should proba-
        bly 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.

  The wlib library (which is used to help create and maintain the widget
  trees and for the help system) defines the following resources:

     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.

     helpCCIPort Integer (HelpCCIPort)
        This resource contains the port number to use with the
        Mosaic/CCI protocol.  The default value is "getpid() % 1024 +
        2048".  This resource is only relevant if your helpType is html-
        cci.

     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-cci, mosaic, cci
           HTML with Mosaic's CCI protocol.  If you choose this help
           type, you should set the helpBrowser resource to Mosaic.

        html-remote, netscape, remote
           HTML with Netscape's -remote protocol.

        cde
           The Common Desktop Environment help system (NOT IMPLEMENTED).
           Implementing this will require adding another back-end to
           sgml-tools and sgml-tools is currently being reworked so I'll
           probably wait until the next major release of sgml-tools
           before trying to make this work.

        sgi
           SGI's help system (NOT IMPLEMENTED).  Implementing this will
           require adding another back-end to sgml-tools and sgml-tools
           is currently being reworked so I'll probably wait until the
           next major release of sgml-tools before trying to make this
           work.

        xnt
           The Xnt help system (NOT IMPLEMENTED).  See
           http://www.xs4all.nl/~ripley <http://www.xs4all.nl/~ripley>
           for more information on XntHelp.  Once the whole Xnt help
           system (including libraries) is released I will make a real
           effort to make this work.  This will also require some sgml-
           tools work.

        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
           <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 connec-
        tion 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 sup-
        ply 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.

     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.

  The following resources specify the various error, warning, and
  message strings used throughout MGv; only the default values are
  listed.

     stringBadArgument String (StringBadArgument)
        "%s:  unknown argument %s to action."

     stringCantAllocPixmap String (StringCantAllocPixmap)
        "backing pixmap could not be allocated."

     stringCantDecompress String (StringCantDecompress)
        "Cannot decompress"

     stringCantHideMenu String (StringCantHideMenu)
        "Menu bar won't let itself be hidden."

     stringCantOpen String (StringCantOpen)
        "Could not open"

     stringCantPrint String (StringPrint)
        "Print command failed:"

     stringError String (StringError)
        "Error"

     stringFileExists String (StringFileExists)
        "File exists, overwrite?"

     stringInterpDone String (StringInterpDone)
        "Interpreter done."

     stringInterpFailed String (StringInterpFailed)
        "GhostScript interpreter failure."

     stringMessage String (StringMessage)
        "Message"

     stringNoCoordinates String (StringNoCoordinates)
        "(?, ?)"

     stringNoDate String (StringNoDate)
        "No Date"

     stringNoFile String (StringNoFile)
        "No File"

     stringNoPrintCommand String (StringPrintCommand)
        "No print command given."

     stringPageFinished String (StringPageFinished)
        "Page finished."

     stringUnknown String (StringUnknown)
        "Unknown message."

  The following strings are used by wlib:

     stringBadVersion String (StringBadVersion)
        "Incorrect application defaults version found:  found '%s' but
        wanted '%s'.  The "applicationVersion" documentation should help
        you fix this problem."

     stringCantBrowse String (StringCantBrowse)
        "Could not launch browser %s: %s"

     stringCantGetFile String (StringCantGetFile)
        "could not get file name from file selector."

     stringEmptyLog String (StringEmptyLog)
        "This log has nothing to save."

     stringNotSupported String (StringNotSupported)
        "%s help not supported, using %s."

  15.1.  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.

  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.

  16.  Actions

  The following actions are defined by MGv:

     mgvMark()
        Toggle the marked status of a page; this action is only valid in
        the main page list.  This action takes no arguments.  This
        action is bound to Shift-Button1 by default.

     mgvScroll(direction [, magical [, force]])
        This action scrolls the main viewing window; the action has one,
        two, or three arguments.  The first argument should be the
        scrolling direction (up, down, left, or right), the second
        (optional) argument should be magical or non-existent--the
        scrolling will be ``magical'' if the second argument is magical.
        If you specify the second argument, you can also specify the
        third argument which indicates how many scrolling attempts this
        should count for; the absolute value of this parameter is used
        so the sign of force makes no difference; a value of zero is
        considered to be one (which is also the default value).

        You can use the third argument to attach different levels of
        magicalness to different keys.  For example, if your
        magicResistance is 3 and you add these bindings:

                <Key>space:             mgvScroll(down, magical, 3)
                <Key>osfBackSpace:      mgvScroll(up,   magical, 3)

     then the spacebar will always scroll down magically and the
     backspace key will always scroll up magically.

     This action will scroll smoothly if smooth scrolling is enabled.

     mgvZoom(command)
        Begin, extend, or end a zoom reticule.  This action takes one
        argument which must be one of:  begin (begin a new zoom reticule
        at the current mouse position), end (end the current zoom
        reticule at the current mouse position), or extend (extend the
        current zoom reticule).

  All arguments are case insensitive.  Arguments in (square) brackets
  are optional.

  The wlib library defines the following actions:

     wlHelpContext()
        This action activates the context sensitive help system; the
        cursor will turn into a question mark so you can select the
        widget you want help with.  This action is normally bound to the
        osfHelp virtual key (which is generally F1).

  17.  Command Line Switches

  The command line switches for MGv generally set application resources;
  see ``Application Resources'' for descriptions of the various
  resources.  The following switches affect the overall behavior of MGv:

     -aliaseps, -noaliaseps
        Anti-aliasing graphic images will often make the images look
        worse and increase the rendering time significantly; hence,
        these switches are offered to give you finer control over when
        anti-aliasing is used.  These switches set the ``antialiasEPS''
        application resource.

     -autoheight, -noautoheight
        Attempt to make the main window tall enough to accomodate a
        whole page.  This switch sets the ``autoHeight'' resource.

     -autowidth, -noautowidth
        Attempt to make the main window wide enough to accomodate a
        whole page.  This switch sets the ``autoWidth'' resource.

     -confirmexit, -noconfirmexit
        Require or don't require user confirmation when attempting to
        exit the application with more than one top level viewing
        window.  These switches set the ``confirmExit'' resource.

     -decompress cmd
        Specify the command to decompress compressed files; the command
        should read from the standard input and write to the standard
        output.  This switch sets the ``decompress'' resource.

     -help
        Display a short summary of the available command line switches.

     -killkids, -nokillkids
        Kill or don't kill child processes when MGv exits; this switch
        sets the ``killChildrenAtExit'' resource.

     -labels, -nolabels
        Show or don't show the page labels in the page list; this switch
        sets the ``showLabels'' resource.

     -log, -nolog
        Show or hide the Ghostscript log on start-up; this switch sets
        the ``hideLog'' resource.

     -longhelp
        Display a summary, with explanations, of the available command
        line switches.

     -magicresistance n
        Specify the number of attempts to scroll beyond the page
        boundaries before magical scrolling takes effect; this switch
        sets the ``magicResistance'' resource.

     -magicscroll, -nomagicscroll
        Allow or disallow magical scrolling; this switch sets the
        ``magicScrolling'' resource.

     -magstep m
        Set the initial magstep to m; this switch sets the ``magstep''
        resource.

     -media media, -paper media
        Specify the default page media; this switch sets the
        ``defaultPageMedia'' resource.

     -menubar, -nomenubar
        Show or hide the menu bar at start up; this switch sets the
        ``hideMenuBar'' resource.

     -pagelist, -nopagelist
        Show or hide the page list at start up; this switch sets the
        ``hidePageList'' resource.

     -pgnums, -nopgnums
        Show or don't show the page numbers in the page list; this
        resource sets the ``showPageNumbers'' resource.

     -printcommand cmd
        Use cmd as the default printer command; this switch sets the
        ``printCommand'' resource.

     -printer name
        Use name as the default printer name; this switch sets the
        ``printer'' resource.

     -scrollpercent percentage
        Scroll the screen by percentage of the window size when
        scrolling with the keyboard.  This switch sets the
        ``scrollPercentage'' resource.

     -smartsizing, -nosmartsizing
        Enable or disable smart sizing.  This switch sets the
        ``smartSizing'' resource.

     -smooth, -nosmooth
        Enable or disable smooth scrolling.  This switch sets the
        ``smoothScrolling'' resource.

     -smoothness n
        Specify how smooth smooth scrolling should be.  This switch sets
        the ``smoothness'' resource to n.

     -status, -nostatus
        Show or hide the status line at start up; this switch sets the
        ``hideStatusLine'' resource.

     -temp dir
        Specify the temporary directory; this switch sets the
        ``tempDir'' resource.

     -version
        Display lots of version and build information about MGv.  The
        displayed information is the same as that in the ``Build Options
        Dialog''.

     -wmwidth width, -wmheight height
        Set the total width or height of the window manager decorations.
        These switches set the ``wmWidth'' and ``wmHeight'' resources.

     -zoomfg color, -reticulefg color
        Specify the zoom reticule color; these switches set the
        ``reticuleForeground'' resource.

     -zoomwidth n, -reticulewidth n
        Specify the zoom reticule width; these switches set the
        ``reticuleLineWidth'' resource.

  The following switches affect the behavior of the Ghostview widget:

     -antialias, -noantialias
        Enable or disable anti-aliasing within Ghostscript; by default,
        anti-aliasing is enabled.  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.  This switch sets the ``antialias''
        resource for Ghostview widgets.

     -arguments args
        Specify additional arguments for Ghostscript; this switch sets
        the ``arguments'' resource.

     -color, -grayscale, -greyscale, -monochrome
        Force color/grayscale/monochrome display; these switches do not
        have anything to do with the visual, depth, or colormap that MGv
        uses, you will want to use the -visual, -visualid, -depth, and
        -privatecm switches for that.  These switches set the palette
        resource.

     -dpi n, -resolution n
        Specify the overall resolution; these switches set the
        Resolution resource.

     -gslocale locale
        Force the GHOSTVIEW window property to be written according to
        locale.  This switch sets the ``gsLocale'' resource.

     -interpreter interp
        Use interp as the PostScript interpreter.  This switch is useful
        if you want to use an interpreter that is not in your PATH or is
        not the first gs is your PATH.  This switch sets the
        ``interpreter'' resource.

     -portrait, -landscape, -seascape, -upsidedown
        Specify the initial page orientation.

     -quiet, -noquiet
        Use or don't use -dQUIET with Ghostscript; this switch sets the
        quiet resource.  The -dQUIET switch tells Ghostscript to
        suppresses the normal startup messages.

     -safer, -nosafer
        Use or don't use -dSAFER with Ghostscript; this switch sets the
        safer resource.  When run with the -dSAFER switch, Ghostscript
        disables the deletefile and renamefile operators and can only
        open files with read-only access.

     -xdpi n, -ypdi n
        Specify the horizontal and vertical resolutions; these switches
        set the xdpi and ydpi resources.

  The following switches affect the behavior of the WlAppShell widget
  which is used by MGv for non-default color depth and visual support:

     -depth n
        Specify a non-default color depth.  This switch sets the
        ``wlDepth'' resource.

     -privatecm, -noinstall, -noprivatecm, -noinstall
        Install or don't install a private colormap.  Non-default visual
        and/or depth settings may cause this switch to be ignored.  This
        switch sets the ``wlUsePrivateColormap'' resource.

     -visual visualClass
        Specify a non-default visual.  This switch sets the
        ``wlVisualClass'' resource.

     -visualid visualID
        Specify a non-default visual by visual id (see xdpyinfo for a
        list of visual ids).  This switch sets the ``wlVisualID''
        resource.

  The following switches affect the behavior of the wlib library used by
  MGv:

     -browser htmlbrowser
        Specify the HTML browser to use for the on-line help; this
        switch sets the ``helpBrowser'' resource.

     -helpport port
        Specify a non-default port to use for Mosaic/CCI on-line help.
        This switch sets the ``helpCCIPort'' resource.

     -helptype type
        Specify the help type for on-line help.  This switch sets the
        ``helpType'' resource to type.

     -prefix pfx
        Specify the location of the files for the on-line help; this
        switch sets the ``helpPrefix'' resource.

     -coloricon, -monoicon, -nocoloricon
        Use or don't use a color icon (if available).  These switches
        set the ``wlUseColorIcon'' resource.

  The standard toolkit options are also supported.

  18.  Caveats and Bugs

  18.1.  Modal Dialogs

  MGv has no modal dialogs (even the overwrite confirmation dialog in
  File/Save... is modeless); modal dialogs are evil.  This really means
  that dialogs don't stop you from doing other things in the
  application: you don't have to back out of a dialog to change
  something and bring the dialog back--you just go and change things
  without leaving your current dialog.  For people that have lived too
  long under the tyranny of modal dialogs this may be confusing.

  18.2.  Anti-aliasing

  The anti-aliasing support in newer versions of Ghostscript (version
  3.33 GNU and higher) is a mixed blessing.  For text documents,
  especially those produced by dvips from TeX DVI documents, the
  readability advantages are wonderful and easily overshadow the
  performance penalties (which aren't that noticeable with text anyway);
  however, anti-aliasing delivers a noticeable performance penalty on
  graphics and can actually make the images look worse.  If you find
  this happening to you, try using the antialiasEPS resource (or the
  -aliaseps and -noaliaseps switches) to change the anti-aliasing of EPS
  files.

  18.3.  Non-DSC and PDF Documents

  If the document does not begin with %!PS-Adobe-, it does not claim
  conformance to the document structuring convention; the functionality
  of MGv is severely limited when dealing with non-DSC conformant
  documents--about all you can do is move to the next page.  Also,
  zooming in a non-DSC document will always display the first page.
  Since I haven't implemented a PDF parser, PDF files are effectively
  treated as non-DSC documents so that MGv is quite limited when viewing
  PDF files (xpdf or Adobe's Acroread are much better for PDF files).

  18.4.  Broken Windows PostScript Drivers

  Some PostScript documents produced by the MS-Windows PostScript
  drivers will cause erroneous warnings about a lack of virtual memory.
  When trying to view such documents, you will only get a page telling
  you that you don't have enough memory in your printer and some steps
  (which will probably be useless if you don't have the original
  document) to correct the problem.  A simple hack to fix this problem
  is to find a line that looks like

          30000 VM?

  and remove it.  The following perl filter should fix such documents:

          perl -pe 's/^(\d+\s+VM\?\r?)$/% \1/'

  Thanks to Bart Robinson (lomew@cs.utah.edu) in comp.lang.postscript
  for this advice.

  Windows printer drivers for PostScript also tend to produce incorrect
  DSC comments.  The Windows PostScript driver builds the NTPSOct94
  dictionary which contains various functions; the required NTPSOct94
  begin command appears between the %%EndSetup comment and the first
  %%Page comment so that neither MGv or Ghostview will pass NTPSOct94
  begin to Ghostscript.  The simplest solution is to change

          %%EndSetup
          NTPSOct94 begin
          %%Page: 1 1

  to

          NTPSOct94 begin
          %%EndSetup
          %%Page: 1 1

  in the offending document (this is will leave your PostScript file
  less broken rather than fixed).  A better solution--which the NT
  PostScript driver should probably be doing--is to remove the offending
  "NTPSOct94 begin" command and add "NTPSOct94 begin" at the beginning
  of each page and add an "end" at the end of each page.  The following
  perl script should perform this transformation on its standard input
  and print the fixed file to its standard output:

          #!/usr/local/bin/perl
          $first_page = 1;
          $bogus      = "";
          while($line = <STDIN>) {
                  ##
                  ## Skip NT's brain damage (at least a little teeny tiny
                  ## part of it)
                  ##
                  if($line =~ /^NTPSOct9[45] begin/) {
                          $bogus = $line;
                          next;
                  }

                  ##
                  ## Insert appropriate begin/end pairs
                  ##
                  if($first_page && $line =~ /%%Page:/) {
                          print $line, $bogus;
                          $first_page = 0;
                  }
                  elsif($line =~ /%%Page:/) {
                          print "end\n", $line, $bogus;
                  }
                  elsif($line =~ /%%Trailer/) {
                          print "end\n$line";
                          # next line is the "end" that we want to kill
                          $line = <STDIN>;
                  }
                  else {
                          print $line;
                  }
          }
          exit(0);

  The same problem occurs with the NTPSOct95 version of the PostScript
  driver but the above script should deal with that one too.

  18.5.  DSC Parsing Problems

  The current DSC parser doesn't like Mac files (which use a single
  carriage return as end-of-line); if you want to view such files,
  change the carriage returns to line feeds with something like this:

          perl -pe 's/\r/\n/g' < mac-file > unix-file

  and try again.  I could attempt to fix the DSC parser but I'd rather
  not touch it until I have time to build a cleaner one.

  Files with a PageOrder of Special will confuse the DSC parser--pages
  will be lost or out of order.  If you have to deal with such files,
  you'll have to use another viewer until I can rewrite the DSC parser.

  18.6.  Application Defaults Version Problems

  The application defaults file specifies a significant portion of MGv's
  behavior; hence, an incorrect application defaults file can cause many
  problems.  If MGv warns you about an incorrect version number, you
  should fix it--setting the ``applicationVersion'' will not fix the
  problem, it will only make the warning go away.

  The correct version of the application defaults file should be
  installed in the same place as the documentation (look for a file
  called MGv) so you can fix the problem by running MGv like this:

          XENVIRONMENT=/path/to/mgv/library/files/MGv mgv

  until the local administrator can fix the problem (the ``Installation
  and Porting'' section outlines the required fix).

  18.7.  LessTif Problems

  I know of the following problems with MGv and the lesstif-current from
  1997-11-01:

  1. If you start MGv with a file from the command line ("mgv blah.ps"),
     the page list will be far wider than it should be; if you start MGv
     and then open a file, this problem doesn't occur.  Opening a new
     window will sometimes show the same sizing problem.

  2. The popup menus aren't working.  There should be a popup menu
     attached to button three in the main window but it never comes up.
     There should be another popup menu at the end of a zoom selection
     (mouse button one drag) but it goes away as soon as it comes up;
     this means that zooming won't be available.

  3. Keyboard handling is busted in the main window.  The PageUp and
     PageDown keys should change pages but they won't, the arrow keys
     should scroll the current page but they won't.

  4. The dirMask resource will be ignored by the file selectors so they
     will always start out with a filter of "*".

  5. The file selectors lose track of their current directory and filter
     every time you bring one up.

  6. If you turn on page labels, the page list won't get larger to
     accomodate them.

  7. The magstep button in the status line didn't work.  I changed some
     things from gadgets to widgets and it works better but you can
     expect some sizing problems after you use it.

     Some of these problems might be fixed by now; versions of LessTif
     before 1997-10-01 (approximately) will not work at all due to the
     lack of String to Widget type converter.  I will try to keep a
     current list of problems on my homepage.

  18.8.  Non-Default Visuals on Irix 5.3

  I have had reports of problems with non-default visuals under Irix 5.3
  when the root window has depth eight.  Everything works fine with Irix
  6.2/6.4 and other systems.  Private colormaps do work with Irix 5.3 so
  all is not lost.

  18.9.  Reporting Bugs

  If you find any bugs in MGv please send a bug report to mu@echo-on.net
  which includes the following information:

  o  MGv version number

  o  operating system name and release number

  o  Motif and X versions

  o  Ghostscript version

  o  clear and concise instructions to reproduce the bug (include sample
     PostScript files if possible)

     The information in the build options dialog (see ``Build Options
     Dialog'') may be useful as well.  You might also want to include
     the RCS IDs from the executable (this really isn't necessary but it
     can't hurt); the IDs can be extracted with any of the following
     commands:

  o  If you have RCS:   "ident mgv"

  o  If you have SCCS:  "what mgv"

  o  If you have neither RCS nor SCCS: "strings mgv | egrep '\$[a-zA-
     Z][a-zA-Z]*:'"

     If you can fix the bug, a patch would be appreciated but please
     bear in mind that the author is somewhat fanatical about
     maintaining a consistent coding/naming style in the code.

  I will try and respond to all bug reports quickly (where quickly is a
  function of how detailed the report is and how easy it is for me to
  reproduce) but don't be surprised if it takes me a few days to
  respond.

  19.  Mathoms

  This section is a dumping ground for things that don't belong anywhere
  else (mathom is a Hobbit term:  a mathom is something that no one
  knows what to do with but they don't want to throw it away).

  19.1.  Enlightening MGv

  If you're into the enlightened look, then you should make sure you
  don't try and specify a backgroundPixmap for the main scrolled window.
  Resource settings like this:

          MGv*view*backgroundPixmap:              XmUNSPECIFIED_PIXMAP
          MGv*backgroundPixmap:                   /full/path/to/tile.xpm
          MGv*foreground:                         fg
          MGv*background:                         bg
          MGv*XmText.backgroundPixmap:            XmUNSPECIFIED_PIXMAP
          MGv*XmTextField.backgroundPixmap:       XmUNSPECIFIED_PIXMAP
          MGv*XmList.backgroundPixmap:            XmUNSPECIFIED_PIXMAP

  should give you the enlightened look (text and list widgets look
  pretty crappy with background pixmaps so there's no point in even try-
  ing).  If you try and specify a backgroundPixmap for view, you will
  probably get an X protocol error at startup.  For best results, fg
  should contrast with the whole tiling pixmap (smooth pixmaps work
  best) and bg should be a solid color that is close the pixmap colors.
  Better results can be had if you're willing to set up different
  pixmaps for the various types of widgets; if you come up with anything
  really cool, let me know.  If you're wondering what this stuff looks
  like, my homepage has a couple of screen shots.

  If you don't have Motif 2.0.1+ then the backgroundPixmap resource
  might not work (it does work with Netscape 4.X/Linux and that uses
  Motif 1.2.X).  I have tried this stuff with Irix and CDE (Motif 1.2.5)
  without success: MGv died on Irix and ignored the pixmap under CDE.  I
  think the problem could be fixed by adding a String to Pixmap type
  converter that understood XPM files but that will have to wait.

  19.2.  Using MGv With Netscape

  If you want to use MGv as the PostScript viewer with Netscape you just
  have to set the application/postscript MIME handler to "mgv %s".  The
  MIME handlers can be configured in the big Preferences dialog for
  Netscape 4 or in the Helpers tab of the General Preferences dialog in
  Netscape 3.

  This is the original reason that I changed the saving behavior of MGv
  (in version one you could only save marked pages, now you can save
  whatever you want).

  19.3.  Using MGv With CDE

  If you want to use MGv in the CDE desktop, the following article from
  comp.unix.cde may be of interest:

  Article 1968 of comp.unix.cde:
  From: Larry Gardner <lkg@atl.hp.com>
  Newsgroups: comp.unix.cde
  Subject: Re: Registering new file types
  Date: Wed, 25 Jun 1997 10:11:39 -0400
  Organization: Hewlett Packard TIS/SEM/IES
  Lines: 109
  Message-ID: <33B1271B.3BC4@atl.hp.com>
  References: <5oojdv$823@bioko.ifi.unizh.ch>
  NNTP-Posting-Host: wscoe2.atl.hp.com
  Mime-Version: 1.0
  Content-Type: text/plain; charset=us-ascii
  Content-Transfer-Encoding: 7bit
  X-Mailer: Mozilla 3.01 (X11; I; HP-UX B.10.00 9000/747)
  To: Dimitrios Tombros <tombros@ifi.unizh.ch>
  Xref: news.lglobal.com comp.unix.cde:1968

  Dimitrios Tombros wrote:
  >
  > Is it possible to register new file types with CDE for a specific
  > user so that when clicking on these types from the file manager
  > the respective application is started?
  >
  > Any help will be appreciated; if this is a FAQ then please point me
  > to the FAQ location.
  >
  > --
  >
  > ----------------------------------------------------------------------
  > Dimitrios Tombros                   Database Technology Research Group
  > e-mail: tombros@ifi.unizh.ch               Computer Science Department
  > http://www.ifi.unizh.ch/staff/tombros.html        University of Zurich

  Here's an example for the postscript file type that will use ghostscript
  and ghostview to print/view postscript files.

  HTH

  Larry

  ghostview.dt

  ################################################################################
  #
  # File:         ghostview.dt
  # RCS:          $ Header: ghostview.dt,v 1.0 97/06/04 16:39:57 lkg Exp $
  # Description:  CDE generic action for application execution.
  # Author:       TIS/SEM/IES WS-COE Team.
  # Created:      Wed Jun  4 16:39:27 EDT 1997
  # Modified:
  # Language:     CDE 1.0 Actions
  #
  ################################################################################
  #
  # Initialize Variables
  #
  ################################################################################

  set GHOSTVIEW=/opt/gnu/bin/X11/ghostview

  ################## END OF VARIABLE INITIALIZATION
  ##############################

  ACTION GhostView
  {
      ARG_COUNT   0
      ICON        gv
      TYPE        COMMAND
      WINDOW_TYPE NO_STDIO
      EXEC_STRING $GHOSTVIEW
      DESCRIPTION Ghostview postscript viewer.
  }

  ACTION GhostView
  {
      ARG_COUNT   *
      ARG_TYPE    POSTSCRIPT
      ICON        gv
      TYPE        COMMAND
      WINDOW_TYPE NO_STDIO
      EXEC_STRING $GHOSTVIEW %(File)Arg_1%
      DESCRIPTION Ghostview postscript viewer.
  }

  ACTION gsPrint
  {
      TYPE        COMMAND
      WINDOW_TYPE NO_STDIO
      EXEC_STRING sh -c '/opt/gnu/bin/gs -q -sDEVICE=ljet4 -r300 -dNOPAUSE \
                         -sOutputFile=- \
                         %(File)Arg_1"Postscript File To Print:"% \
                         %(File)Args% | lp -s -oraw'
      DESCRIPTION The gsPrint action formats its arguments \
                  using the 'gs' command and prints them to \
                  the default printer using 'lp'.
  }

  DATA_ATTRIBUTES POSTSCRIPT
  {
      ICON        Dtps
      ACTIONS     Open,Print
      DESCRIPTION This is a postscript file.
  }
  DATA_CRITERIA POSTSCRIPT1
  {
      DATA_ATTRIBUTES_NAME POSTSCRIPT
      MODE                 !d
      NAME_PATTERN         *.[Pp][Ss]
  }

  ACTION Open
  {
      ARG_TYPE    POSTSCRIPT
      TYPE        MAP
      MAP_ACTION  GhostView
      DESCRIPTION This action opens the postscript file type.
  }

  ACTION Print
  {
      ARG_TYPE    POSTSCRIPT
      TYPE        MAP
      MAP_ACTION  gsPrint
      DESCRIPTION This action prints the postscript file type.
  }

  This would probably work with MGv if you change "ghostview" to "mgv"
  all over the place.  You'll have to make your own icons though
  (mine/mgv_cicon.xpm would be a good starting place but it is the wrong
  size).  I can't really help you with this (yet) so you're on your own
  (of course, I'd be interested in any results).
  I plan to eventually support the CDE help system in the future
  (eventually I'll get CDE for my other linux box; when that happens,
  I'll set up some decent CDE integration).

  20.  See Also

  The following sources may of interest:

  o  The MGv man page (man mgv) contains a short reference of the
     command line switches.

  o  The man page for Ghostscript ("man gs").

  o  PostScript Language Reference Manual, Second Edition published by
     Addison-Wesley (ISBN: 0-201-18127-4).

  o  The Joy of Coffee by Corby Kummer, published by Chapters Publishing
     Ltd. (ISBN:  1-881527-53-0).

  o  PostScript Language Document Structuring Conventions Specification,
     available from the Adobe FTP site as 5001.DSC_Spec.ps.

  o  PostScript Language Program Design published by Addison-Wesley
     (ISBN: 0-201-14396-8).

  21.  Availability

  The latest release of MGv will be available at my homepage (any beta
  versions will be here as well) and probably at The Sunsite Linux
  Archives <ftp://sunsite.unc.edu/pub/Linux/X11/xapps/graphics/viewers>
  (Linux binaries may be here as well as the source).  I will also try
  and upload release versions to ftp.x.org
  <ftp://ftp.x.org/contrib/applications/>.  New releases will be
  announced in the comp.windows.x.motif and comp.windows.x.announce
  newsgroups (and maybe comp.lang.postscript).

  The latest release of Ghostscript is available from the GNU home site
  <ftp://prep.ai.mit.edu/pub/gnu> and the GhostScript archives
  <ftp://ftp.cs.wisc.edu/ghost/aladdin>.

  22.  Acknowledgements

  MGv is based on Ghostview by Tim Theisen (tim@cs.wisc.edu) with some
  ideas from Ghostview-VMS by Johannes Plass (plass@dipmza.physik.uni-
  mainz.de).  I'd also like to thank L. Peter Deutsch, president of
  Aladdin Enterprises, (ghost@aladdin.com) for Ghostscript (without
  which, MGv would not be possible).

  Of course, none of this would be possible without Linux and the FSF.

  The following people have offered helpful advice and patches:

  o  Brian Dowling

  o  Erik Luijten

  o  Andy Polyakov

  o  Thanh Ma tma@encore.com

  o  Karl Storck

  o  Hans Vahlenkamp

     My apologies if I have left anyone out.

  The WlAppShell widget (which is used to provide easy support for non-
  default depths and visuals) is based on the AppPlus shell by John L.
  Cwikla; the AppPlus widget comes with the following copyright:

          Copyright 1994,1995 John L. Cwikla

          Permission to use, copy, modify, distribute, and sell this software
          and its documentation for any purpose is hereby granted without fee,
          provided that the above copyright notice appears in all copies and that
          both that copyright notice and this permission notice appear in
          supporting documentation, and that the name of John L. Cwikla or
          Wolfram Research, Inc not be used in advertising or publicity
          pertaining to distribution of the software without specific, written
          prior permission.  John L. Cwikla and Wolfram Research, Inc make no
          representations about the suitability of this software for any
          purpose.  It is provided "as is" without express or implied warranty.

          John L. Cwikla and Wolfram Research, Inc disclaim all warranties with
          regard to this software, including all implied warranties of
          merchantability and fitness, in no event shall John L. Cwikla or
          Wolfram Research, Inc be liable for any special, indirect or
          consequential damages or any damages whatsoever resulting from loss of
          use, data or profits, whether in an action of contract, negligence or
          other tortious action, arising out of or in connection with the use or
          performance of this software.

          Author:
                  John L. Cwikla
                  X Programmer
                  Wolfram Research Inc.

                  cwikla@wri.com

  W.  Installing and Porting

  The following are required to compile and use MGv:

  o  GNU Make 3.74 or higher (I haven't tried with older versions) which
     is available from ftp://prep.ai.mit.edu/pub/gnu

  o  ANSI/POSIX compliant C compiler and libraries

  o  X11R5 or X11R6

  o  Motif 1.2 or higher

  o  GNU Ghostscript version 2.6.1 or 3.33 (I haven't tried other
     versions or the Aladdin versions), both versions should be
     available from ftp://prep.ai.mit.edu/pub/gnu

  o  Perl or GNU m4 for patching up the resource file.  If you don't
     have either of these, then don't touch MGv.ad--fiddle with MGv.in
     instead since MGv.in only passes through sed.  Most people won't
     need perl or m4 so ignore the substitutions that will happen in the
     tools/ directory (the perl and m4 scripts will almost never get
     used by anyone but me).
     If you want to hack the documentation, you will need the sgml-tools
     package (I'm using version 0.99.0) which should be available at any
     Linux archive; you may wish to apply my patch (tools/sgml-
     tools-0.99.0.patch) if you want to duplicate the look of my
     documents.  If you want to make the dep or rdep targets, you will
     need an awk that understands the -v switch for setting variables;
     the findawk script in the tools directory will be called by the
     makefiles to attempt to find such an awk.

  If you have the necessary tools in place, you are ready to build MGv:

  1. Go into the make subdirectory and copy or link the appropriate
     sys.*.mk file to sys.mk; if there isn't one for your system, start
     with sys.TEMPLATE.mk and fill in the blanks (sending a copy to
     mu@echo-on.net would be appreciated).  I could have used Imake for
     this but Imake is really disgusting when it works and a complete
     mess when it doesn't; I've had far too many problems with Imake to
     bother with it.  I could have used GNU autoconf to generate a
     configure script but I like to use pretty strict compiler flags and
     I don't think autoconf can do that for me.

  2. Check sys.mk to make sure it is sane for your system.  If you If
     you don't have the Xpm library installed, set mk-xpm to no and
     remove -lXpm from libs.  If you have CDE, set mk-cde to yes;
     otherwise, set it to no (the CDE option doesn't do anything yet but
     it will be used in the future for the help system).  If you have
     libhelp, you can activate libhelp support by setting mk-libhelp to
     yes and fixing up the include and link paths as needed.

  3. If you have an SGI system, rename MGv.ad.sgi to MGv.ad if you want
     to try and use SGI schemes.  Keep in mind that the font changes in
     the page list don't work with SGI schemes yet so you won't be able
     to tell which pages are marked.  If anyone can help me with this, I
     would appreciate it.  If you just use the normal MGv.ad file,
     things should work just fine.

  4. Go back to the main directory and run GNU Make.  If you are hacking
     the sources, you might want to make the rdep target to get
     dependency lists.

  5. Execute the install target to install everything.  There are also
     install-bin, install-man, install-ad, and install-doc targets if
     you only want to install parts of MGv.

     If you have installed any of the 1.0 versions of MGv you should
     delete the old application defaults file (probably
     /usr/X11/lib/app-defaults/MGv or something similar) before running
     MGv; if you don't, MGv will warn you about it and the user
     interface will be really screwed up.  If you have just compiled a
     new version of MGv and you haven't installed it yet, you can set
     the XENVIRONMENT environment variable to temporarily fix the
     version problem:

             XENVIRONMENT=MGv ./mgv

  However, you really should delete the old application defaults file
  anyway (none of the MGv versions need it, they all compile the whole
  thing in as defaults anyway).

  There shouldn't be any problems compiling MGv but if there are, you
  might have to defined _POSIX_SOURCE and/or _XOPEN_SOURCE to get at
  popen(3) (POSIX.2 says it is there (at least HP's man pages claim
  this) and everyone has it but not everyone's headers agree; in
  particular, SCO forced me to use -a xpg4 to get popen()).  You might
  have to fiddle with the FDOPEN_BY_HAND and BUSTED_SYS_TYPES macros as
  well due to the sorry mess that is in some vendor supplied header
  files (all praise exclusive (as opposed to just inclusive) standards
  compliance testing).

  The clean target will remove most intermediate files and the realclean
  target will remove everything that can be generated (note that the
  realclean target is equivalent to the clean target in the doc
  directory in the released versions).

  W.1.  Porting

  Porting to new platforms should be easy if you have the required
  libraries and an ANSI compiler.  If you lack any of these, you'll have
  to get them or abandon MGv.  I have found that popen() and the socket
  stuff in wlib/wlib/dirtysocks.h causes the grief.  You can usually get
  at popen() by using -D_XOPEN_SOURCE (be careful about what this might
  do to POSIX things though).  If you're having trouble with the socket
  code, look at the stuff in the other sys.*.mk files for work arounds.
  Of course, you are welcome to hack the sources for your system and
  send patches to the author.

  I have personally compiled and used MGv on the following platforms:

     aix-gcc, aix-xlc
        AIX 4.1 with gcc-2.7.2/xlc.

     dec-cc, dec-gcc
        OSF/1 4.0 (Digital Unix) on a DEC Alpha with cc/gcc-2.7.2

     dynix
        Dynix/ptx 4.1.2 with cc.

     hpux-c89, hpux-gcc
        HP-UX 9.05 with c89/gcc-2.7.2

     irix62
        Irix 6.2 with cc -32.

     linux
        Linux with gcc 2.7.2, libc 5, Mootif 2.0.1 (ELF).

     mpras-cc, mpras-gcc
        AT&T MP-RAS running NCR unix 3.0 with cc/gcc-2.7.2.

     sco
        SCO 5.0 with cc (ELF).

     sinix
        Siemens Nixdorf Sinix 5.42 with c89.

     solaris-cc, solaris-gcc
        Solaris 2.4/2.5 with SPARCompiler cc/gcc-2.7.2.

  I haven't tried the SCO or Dynix/ptx systems for awhile but I don't
  think there will be any problems.  I have had reports of success on
  the following systems:

  o  AIX 3.2.5

  o  HP-UX 10.20 with c89

  o  Solaris 2.6/Intel with gcc

  o  UnixWare 2.1.2 with cc

  o  Encore UMAXC/m88k with gcc

  o  FreeBSD 3.0

     A makefile for FreeBSD 2.2.2 is in the make directory but I don't
     know how well MGv works on FreeBSD due to LessTif problems.

  X.  History

  X.1.  MGv 2.2.1: December 1997

  o  Fixed a buffer overflow problem in the printing.  The bug was a
     really dumb mistake, sorry for the brain damage.

  X.2.  MGv 2.2: November 1997

  o  Added support for non-default color depths, non-default visuals,
     and private color maps.  This didn't have that much impact on the
     application but it is a cool enough increase in functionality to
     warrant an increase in the minor version number rather than just
     the patch level.  Thanks to Hans Vahlenkamp  for hassling me about
     this lacking feature (okay, hassling is probably a little strong).

  o  Fixed a bug in zoom window destruction.  If you zoomed on a zoom
     and killed the first zoom before the zoomed zoom, you used to get
     death but now you don't.

  o  Fixed the menu accelerators to avoid duplication; the following
     accelerators were changed:

  o  The Magstep menu is now activated with Alt+T instead of Alt+G.

  o  The Options menu is now activated with Alt+S instead of Alt+O (this
     was taken).

  o  The Set entry in the Magstep menu no longer has an accelerator, I
     couldn't think of anything sensible that wasn't already taken by
     something that gets more use.

  o  The Enable Smooth Scrolling entry in the Options menu is now
     activated with Alt+L instead of the old Alt+O.

     If anyone doesn't like this, you can change them through the
     resource database to whatever you want.

  o  Fixed up the code that deals with (depth one) bitmaps for icons.
     The old code was causing a BadMatch error on some systems because a
     copy was attempted from a depth one Pixmap to a Window with a
     different depth.

  o  Added the wlUseColorIcon resource so you can tell MGv to use or not
     use a color icon at run-time.

  o  Fixed the spelling of Matthew's name in various places (I thought
     there was only one "t").

  o  Added a couple of minor (and harmless) changes to the resources for
     LessTif.  These changes don't affect Motif versions of MGv.
  o  Added some notes on the Ghostview widget resources to the
     Application Resources section of the manual.  I was sure the
     resources were already listed but I was wrong.

  o  Added the -portrait, -landscape, -seascape, and -upsidedown
     switches to control the initial page orientation.

  o  Extended the FreeBSD 2.2.2 support to deal with FreeBSD 3 with
     Motif 1.2.

  X.3.  MGv 2.1: October 1997

  o  Reversed the order of History list.

  o  Removed the Printer Name text field from the print dialog.  The
     print command now holds both the command to use and the printer
     name.  The resources (printer and printCommand are still separate,
     you can forget about printer and put it all in printCommand if you
     want).

  o  Fixed the GhostviewSendPS prototype.  The old prototype had a long
     where it should have had an off_t.  Apparently HP-UX 10.20's off_t
     isn't a long like it is on all the other machines (otherwise the
     compilers would have complained long ago).  This was reported and
     fixed by Karl Storck .

  o  Small fixes to the makefiles and dirtysocks.h for Solaris
     2.6/Intel.  Thanks to Thanh Ma tma@encore.com for the patch.

  o  I've changed ISPs once again (I'm on my third one this year),
     lglobal.com just got swallowed by echo-on.net so I've updated
     everything for this.  I think it is time I forked out the cash for
     a virtual host somewhere.

  o  Some minor hacks were added to allow MGv and LessTif to get along a
     little better.  There are still a number of problems with using
     LessTif (see ``LessTif Problems'' for a list of known problems) but
     most things work.  I've only tested things with the lesstif-current
     from 1997-10-02 so the current release might still be broken.  You
     might also want to check my homepage for any updates on MGv and
     LessTif.

  o  A preliminary port to FreeBSD 2.2.2 was supplied by Christopher
     Yoder .  The initial attempt was done with LessTif so I don't know
     how well this works yet (I don't expect any problems).

  X.4.  MGv 2.0.2: August 1997

  o  Always scroll the scrolled window back to the top when closing a
     file.  Sometimes the scrolled window would get confused about where
     its child was when opening a new file; this only appears to happen
     if you are scrolled down near the bottom and then you open a new
     file in the same window.  The confusion only happens with some
     files (the exact conditions are unknown but this scrolling-back-to-
     the-top trick makes the problem go away).

  X.5.  MGv 2.0.1: August 1997

  o  Fixed an auto-sizing bug.  Any auto-sizing will now take effect if
     you hide the page list, menubar, or status line.
  o  Trying to open a non-existent file from the command line will now
     produce a warning message.  Doing "mgv not-there.ps" used to just
     give an empty window.

  X.6.  MGv 2.0: August 1997

  o  Help system extended to deal with Netscape's remote protocol and
     Mosaic's CCI protocol.  CDE help, and SGI help are still coming.
     The helpSuffix resource has been replaced with helpType.

  o  Added palette changing menu items.

  o  Changed the float resources in the Ghostview widget to integers to
     avoid alignment problems on the DEC Alpha (unaligned access).

  o  Freeing unallocated memory bugs in Ghostview.c fixed (some
     resources were getting copied by SetValues() and freed by Destroy()
     but not copied by Initialize()).  These bugs were caused by some
     modifications that I made to the Ghostview widget.  All of the
     String resources for the Ghostview widget are now copied as God
     intended them to be.

  o  You can now save a document without marking pages.

  o  Fixed two orientation bugs so that you no longer get forced back to
     the first page when changing orientation and changing the
     orientation from the menus will always work (in some cases, mgv
     would switch to the orientation in the document when you tried to
     change orientations).

  o  Added a ghost to the icon (hey, this is reason enough to upgrade
     isn't it?).

  o  Added the mgvMark action to the page list to make marking pages
     easier (maybe).

  o  Cleaned up the keyboard handling in the main viewing window so that
     the cursor keys do the right thing; the new mgvScroll action was
     added to facilitate this.

  o  Support for multiple top level windows added.

  o  On-the-fly decompression of compressed files added.

  o  All dialogs now make use of the defaultButton and cancelButton
     resources for better compliance with the Motif Style Guide.  The
     zooming is now attached to mouse button one (used to be button two
     but Motif wants button two for drag-and-drop operations).  If you
     want the old bindings back you just have to change the
     baseTranslations for the Ghostview widget to:

             MGv*Ghostview.baseTranslations: #replace                \n\
                     <Key>osfHelp:   wlHelpContext()                 \n\
                     <Message>:      gvMessage()                     \n\
                     !<Btn2Down>:    mgvZoom(begin)                  \n\
                     !<Btn2Motion>:  mgvZoom(extend)                 \n\
                     !<Btn2Up>:      mgvZoom(end)                    \n\
                     !<Btn1Down>:    mgvZoom(begin)                  \n\
                     !<Btn1Motion>:  mgvZoom(extend)                 \n\
                     !<Btn1Up>:      mgvZoom(end)                    \n\
                     <EnterWindow>:  gvNotify(0)                     \n\
                     <LeaveWindow>:  gvNotify(0)                     \n\
                     <MotionNotify>: gvNotify(0)                     \n\
                     <Key>osfUp:     mgvScroll(up,   magical)        \n\
                     <Key>osfDown:   mgvScroll(down, magical)        \n\
                     <Key>osfLeft:   mgvScroll(left)                 \n\
                     <Key>osfRight:  mgvScroll(right)

  These bindings will give you zooming with either button one or button
  two.

  o  Added the magic scrolling based on a suggestion and patch from
     Brian Dowling . This introduced the magicScrolling and
     magicResistance resources.

  o  Modified the magstep menu based on a suggestion and patch from
     Brian Dowling .  The old magstep menu let you choose from -5
     through +5, the new one lets you increase and decrease it as
     desired.

  o  Added the Auto Size, Auto Height, and Auto Width buttons to the
     Page menu; the autoHeight and autoWidth application resources were
     also added. Thanks go to Brian Dowling for suggesting this.

  o  Added MP-RAS support to the makefiles.

  o  Added some screen shots to the documentation.

  o  The Reopen command will now try and reset the page number.

  o  Added support for libhelp online help (see
     http://www.informatik.uni-
     stuttgart.de/ipvr/bv/personen/mache/libhelp
     <http://www.informatik.uni-
     stuttgart.de/ipvr/bv/personen/mache/libhelp> for the libhelp
     sources).

  o  Added smooth scrolling options.

  o  Added the magstep resource and the -magstep switch to make setting
     the initial magstep easier. Andy Polyakov  pointed out this feature
     that got lost between Ghostview and MGv.

  o  Put the quick access -5 through +5 magstep entries back on the
     Magstep menu (a user thought all the clicking and typing and screen
     re-drawing was inconvenient and since I agreed, I put the radio
     buttons back).  Erik Luijten  liked the old -5 through +5 options
     so they came back.

  o  Made explicit page orientations persist through reopens.  Credit
     for this behavior belongs to Erik Luijten .

  o  Hacked the new auto sizing stuff to, optionally, stay within the
     screen dimensions.  I think mwm does this for us but mwm is an evil
     window manager (if you like mwm, go ahead and disagree with me, or
     kill me, or not).  Since there is no sane way to determine how
     large the window manager decorations are, the wmWidth and wmHeight
     resources were added so you can tell MGv how big they are (you may
     notice that Ghostview uses pretty much the same hack).  Added the
     -smartsizing, -wmwidth, and -wmheight switches to control these
     settings from the command line.  I also added the Enable Smart
     Sizing button to the Options menu.  This stuff was based on a
     suggestion from Andy Polyakov .

  o  Added the applicationVersion resource to help detect app-defaults
     files with the wrong version.  I also expanded the installation
     documentation to cover this situation.  This stuff was added based
     on problems experienced by Erik Luijten . After adding this, I
     moved it to wlib since it was too useful to duplicate in my other
     (as yet unpublished) projects.

  o  The Close All Zooms entry in the Window menu is now only sensitive
     if there are zoom windows.

  o  Change the default dirMask of the file-open dialog to *.*ps* (it
     was *.ps and then *.ps* to get gzipped/compressed files) to try and
     pick up .eps files too.

  o  Converted the menu bar widget tree to the standard (and highly
     idiotic, nonsensical, brain damaged, ...) Motif way.  This allows
     MGv to work better with Motif 2.0.0 and perhaps some other old
     versions of Motif (Motif 1.2.2 on AIX 3.2.5 is one of them).

  o  Keyboard scrolling (the mgvScroll() action) cleaned up.  I added
     the scrollPercentage resource to let users decide how much of the
     screen should be scrolled (the default of 90% yields a little bit
     of overlap for context).  This little change should make scrolling
     (including the smooth kind) nicer.

  o  Fixed Mosaic-cci help.  This got broken sometime (I don't know when
     since I almost never use this).  The CCI stuff was trying to get a
     hostname out of "file:///path/to/x/blah.html" without realizing
     that file:// means localhost.

  o  Lots of internal changes that shouldn't be visible to the user.

  X.7.  MGv 1.0: September 1996

  o  First release.

  Y.  Wish List

  This is an unordered list of things that I'm thinking about doing with
  MGv.

  o  I'm considering moving to GNU autoconf (mostly to get libtool so I
     can portably make wlib a shared library) but I'll have to see if I
     can make autoconf as convenient to use as my GNU makefiles.

  o  I would like to increase the usefulness of MGv for PDF files.  All
     this really means is that I have to build a PDF parser that can
     produce something like the DSC structure that is currently used for
     DSC conformant PostScript files.  I do have the official PDF book
     and it doesn't look like it will be that hard to get the DSC
     information.  If you use PDF a lot, I'd recommend using xpdf or
     Adobe Acroread instead of MGv.

  o  Resizing a zoom window should expand the zoomed area rather than
     stretching it; effectively, this would allow you to alter the zoom
     reticule after the zoom has popped up.  The GHOSTVIEW window
     property (see ``The GHOSTVIEW Property'') has four optional values
     that may be of assistance here.

  o  The DSC scanner in dsc.c needs to be rewritten and expanded to
     handle PDF files.  The current scanner (which was borrowed from
     Ghostview 1.5) works but is rather messy and has problems with the
     Special page order and Mac PostScript files (i.e. those with just a
     carriage return as a line terminator) so this might be a good
     excuse to replace it.

  o  Switching to an XmMainWindow widget might be a good idea but
     writing my own simpler main window widget would probably be a
     better idea.  The only utility of this modification would be proper
     resize handling for the menu bar.  In order to get the menu bar to
     wrap around when the window gets too thin, you have to set its
     XmNcolumns resource; however, you need to be directly involved in
     the geometry management in order to determine what value XmNcolumns
     should have.  Hence, you need to be a manager widget to properly
     resize a menu bar without resorting to kludges.

  o  I would like to implement an emulator for SGI's GUI schemes (the
     SGI schemes mechanism provides nice spacing, colors, and fonts
     which can be changed with a single resource setting).  The
     tools/standard.ad file contains a rough attempt at matching the
     spacing and font settings of a scheme but it is primitive.  Setting
     the spacing and colors would be fairly easy (just read in a file
     and stuff some extra strings into the resource database before any
     widgets get created). The fonts are more difficult to implement
     since they use a virtual font naming system (you say
     "blah*fontList: SGI_DYNAMIC ObliqueLabelFont" and you get an italic
     font of some kind); in order to make this work, I'll have to
     replace the String to FontList type converter but the replacement
     cannot be made until at least one Motif widget has been created.
     I'll probably end up borrowing the converter from LessTif and
     installing it after creating and destroying a sacrificial XmLabel.
     While I'm at it, I might try and add backgroundPixmap settings to
     the schemes so you can get the enlightened look.

  o  The wlib library needs a simple resource persistence interface.
     This should be pretty easy once I have whatever to String type
     converters for the various resources.  Any hacking towards this end
     might also yield a reasonable way to build Options dialogs for
     modifying the application resources.

  o  I like the panning in Acroread (you grab the page and move it
     around with the mouse) so I think I'll add it to MGv some time.

  o  The next release will probably drop the automatic scrolling in the
     main scrolled window; moving to application defined scrolling will
     offer better control over the scrolling in general.  This should
     make the Acroread panning easier, smooth scrolling better, and I
     could make the scrollbar increment more sensible.  While I'm
     hacking the scrolling code I'll have to figure out some simple way
     to indicate how many more attempts are needed before magic
     scrolling moves to the next page (maybe I could cycle the
     colors--dark to light--on the scrollbar).

  o  I'm starting to get sick of the xdvi interface so I may try and
     work in some DVI support sometime in the future.  This will require
     some non-trivial source hacking.

  o  Adding compression for saved files might be a nice (and fairly
     simple) addition.  I'll probably add compressZ and compressGZ
     resources for this and check the requested file name to see which
     kind of compression should be used.

  o  I have had a request for a toolbar so I'll probably add one even
     though I personally hate toolbars.  When I add a toolbar, I'll make
     sure it is fully user configurable.

  o  The mgvScroll action should have a percentage argument (with the
     scrollPercentage resource as a default).

  Z.  The Interface to Ghostscript

  Z.1.  The GHOSTVIEW Environment Variable

  When the GHOSTVIEW environment variable is set, ghostscript draws on
  an existing drawable rather than creating its own window; ghostscript
  will draw in either a window or a pixmap depending on the contents of
  this variable.

  The general form of the GHOSTVIEW variable is

          window-id [pixmap-id]

  where window-id is the identifier of the destination window (XtWin-
  dow(ghostview_widget) for example) and the optional pixmap-id value is
  the identifier for a pixmap to draw into; both values are of type XID
  (32-bit unsigned integer).  If only a window is specified, ghostscript
  will draw into that window but if the pixmap is also specified, all
  drawing will be done on the pixmap.  In both cases the window is used
  to determine the colormap, screen, and visual to use; if the destina-
  tion is a window, then the height and width will be retrieved from the
  window, otherwise, the dimensions will be those of the pixmap.  All
  remaining information is retrieved from the GHOSTVIEW property on the
  window (when drawing is done to a pixmap, this property is deleted
  when read).  Any events that ghostscript wishes to send will be
  directed at the window specified in the GHOSTVIEW environment vari-
  able.

  Z.2.  The GHOSTVIEW Property

  The GHOSTVIEW property is of type STRING and should have the form

          bpixmap orient llx lly urx ury xdpi ydpi [left bottom top right]

  and a scanf(3) format of

          %d %d %d %d %d %d %f %f %d %d %d %d

  The parameters are:

     bpixmap
        Pixmap id of the backing pixmap for the window.  If no pixmap is
        to be used, this parameter should be zero and this parameter
        must be zero when the destination is a pixmap rather than a
        window.

     orient
        This should be a number representing the page orientation.  The
        value is the clockwise rotation of the paper in degrees; only 0,
        90, 180, and 270 are permitted

     llx, lly, urx, ury
        The bounding box of the drawable in PostScript points in the
        default user coordinate system.

     xdpi, ydpi
        These values specify the horizontal and vertical resolution of
        the destination.  Even though these values may be computed from
        other parameters, they are specified to avoid round-off errors.

     left, bottom, top, right
        These optional parameters specify the margins around the window
        in PostScript points; the margins extend the imageable area
        beyond the boundaries of the window.  This is primarily used for
        popup zoom windows.  Some PostScript programs position
        themselves based on the imageable area so these values are
        useful at times.  Any unspecified margins are assumed to be
        zero.

  Z.3.  Events from Ghostscript

  If the final destination is a pixmap, the client will get a property
  notify event when ghostscript reads the GHOSTVIEW property causing it
  to be deleted.

  Ghostscript sends events to the window where it read the GHOSTVIEW
  property; these events are of type ClientMessage and the message_type
  is set to either PAGE or DONE.  The first long data value specifies
  the window which is to be used when sending replies to ghostscript;
  the second long data value specifies the primary drawable which is:

  o  the pixmap if ghostscript is drawing into a pixmap which was
     specified in the GHOSTVIEW environment variable

  o  the destination window if the window does not have a backing pixmap

  o  the backing pixmap of the destination window if it has one.

     This field is necessary to distinguish multiple ghostscripts
     rendering to separate pixmaps when the GHOSTVIEW property was
     placed on the same window.  The PAGE message indicates that a page
     has been completed; ghostscript will wait until it receives a
     ClientMessage whose message_type is NEXT before continuing.  The
     DONE message indicates that ghostscript has finished processing.

  AA.  GNU General Public License

                      GNU GENERAL PUBLIC LICENSE
                         Version 2, June 1991

   Copyright (C) 1989, 1991 Free Software Foundation, Inc.
                            675 Mass Ave, Cambridge, MA 02139, USA
   Everyone is permitted to copy and distribute verbatim copies
   of this license document, but changing it is not allowed.

                              Preamble

    The licenses for most software are designed to take away your
  freedom to share and change it.  By contrast, the GNU General Public
  License is intended to guarantee your freedom to share and change free
  software--to make sure the software is free for all its users.  This
  General Public License applies to most of the Free Software
  Foundation's software and to any other program whose authors commit to
  using it.  (Some other Free Software Foundation software is covered by
  the GNU Library General Public License instead.)  You can apply it to
  your programs, too.

    When we speak of free software, we are referring to freedom, not
  price.  Our General Public Licenses are designed to make sure that you
  have the freedom to distribute copies of free software (and charge for
  this service if you wish), that you receive source code or can get it
  if you want it, that you can change the software or use pieces of it
  in new free programs; and that you know you can do these things.

    To protect your rights, we need to make restrictions that forbid
  anyone to deny you these rights or to ask you to surrender the rights.
  These restrictions translate to certain responsibilities for you if you
  distribute copies of the software, or if you modify it.

    For example, if you distribute copies of such a program, whether
  gratis or for a fee, you must give the recipients all the rights that
  you have.  You must make sure that they, too, receive or can get the
  source code.  And you must show them these terms so they know their
  rights.

    We protect your rights with two steps: (1) copyright the software, and
  (2) offer you this license which gives you legal permission to copy,
  distribute and/or modify the software.

    Also, for each author's protection and ours, we want to make certain
  that everyone understands that there is no warranty for this free
  software.  If the software is modified by someone else and passed on, we
  want its recipients to know that what they have is not the original, so
  that any problems introduced by others will not reflect on the original
  authors' reputations.

    Finally, any free program is threatened constantly by software
  patents.  We wish to avoid the danger that redistributors of a free
  program will individually obtain patent licenses, in effect making the
  program proprietary.  To prevent this, we have made it clear that any
  patent must be licensed for everyone's free use or not licensed at all.

    The precise terms and conditions for copying, distribution and
  modification follow.

                      GNU GENERAL PUBLIC LICENSE
     TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

    0. This License applies to any program or other work which contains
  a notice placed by the copyright holder saying it may be distributed
  under the terms of this General Public License.  The "Program", below,
  refers to any such program or work, and a "work based on the Program"
  means either the Program or any derivative work under copyright law:
  that is to say, a work containing the Program or a portion of it,
  either verbatim or with modifications and/or translated into another
  language.  (Hereinafter, translation is included without limitation in
  the term "modification".)  Each licensee is addressed as "you".

  Activities other than copying, distribution and modification are not
  covered by this License; they are outside its scope.  The act of
  running the Program is not restricted, and the output from the Program
  is covered only if its contents constitute a work based on the
  Program (independent of having been made by running the Program).
  Whether that is true depends on what the Program does.

    1. You may copy and distribute verbatim copies of the Program's
  source code as you receive it, in any medium, provided that you
  conspicuously and appropriately publish on each copy an appropriate
  copyright notice and disclaimer of warranty; keep intact all the
  notices that refer to this License and to the absence of any warranty;
  and give any other recipients of the Program a copy of this License
  along with the Program.

  You may charge a fee for the physical act of transferring a copy, and
  you may at your option offer warranty protection in exchange for a fee.

    2. You may modify your copy or copies of the Program or any portion
  of it, thus forming a work based on the Program, and copy and
  distribute such modifications or work under the terms of Section 1
  above, provided that you also meet all of these conditions:

      a) You must cause the modified files to carry prominent notices
      stating that you changed the files and the date of any change.

      b) You must cause any work that you distribute or publish, that in
      whole or in part contains or is derived from the Program or any
      part thereof, to be licensed as a whole at no charge to all third
      parties under the terms of this License.

      c) If the modified program normally reads commands interactively
      when run, you must cause it, when started running for such
      interactive use in the most ordinary way, to print or display an
      announcement including an appropriate copyright notice and a
      notice that there is no warranty (or else, saying that you provide
      a warranty) and that users may redistribute the program under
      these conditions, and telling the user how to view a copy of this
      License.  (Exception: if the Program itself is interactive but
      does not normally print such an announcement, your work based on
      the Program is not required to print an announcement.)

  These requirements apply to the modified work as a whole.  If
  identifiable sections of that work are not derived from the Program,
  and can be reasonably considered independent and separate works in
  themselves, then this License, and its terms, do not apply to those
  sections when you distribute them as separate works.  But when you
  distribute the same sections as part of a whole which is a work based
  on the Program, the distribution of the whole must be on the terms of
  this License, whose permissions for other licensees extend to the
  entire whole, and thus to each and every part regardless of who wrote it.

  Thus, it is not the intent of this section to claim rights or contest
  your rights to work written entirely by you; rather, the intent is to
  exercise the right to control the distribution of derivative or
  collective works based on the Program.

  In addition, mere aggregation of another work not based on the Program
  with the Program (or with a work based on the Program) on a volume of
  a storage or distribution medium does not bring the other work under
  the scope of this License.
    3. You may copy and distribute the Program (or a work based on it,
  under Section 2) in object code or executable form under the terms of
  Sections 1 and 2 above provided that you also do one of the following:

      a) Accompany it with the complete corresponding machine-readable
      source code, which must be distributed under the terms of Sections
      1 and 2 above on a medium customarily used for software interchange; or,

      b) Accompany it with a written offer, valid for at least three
      years, to give any third party, for a charge no more than your
      cost of physically performing source distribution, a complete
      machine-readable copy of the corresponding source code, to be
      distributed under the terms of Sections 1 and 2 above on a medium
      customarily used for software interchange; or,

      c) Accompany it with the information you received as to the offer
      to distribute corresponding source code.  (This alternative is
      allowed only for noncommercial distribution and only if you
      received the program in object code or executable form with such
      an offer, in accord with Subsection b above.)

  The source code for a work means the preferred form of the work for
  making modifications to it.  For an executable work, complete source
  code means all the source code for all modules it contains, plus any
  associated interface definition files, plus the scripts used to
  control compilation and installation of the executable.  However, as a
  special exception, the source code distributed need not include
  anything that is normally distributed (in either source or binary
  form) with the major components (compiler, kernel, and so on) of the
  operating system on which the executable runs, unless that component
  itself accompanies the executable.

  If distribution of executable or object code is made by offering
  access to copy from a designated place, then offering equivalent
  access to copy the source code from the same place counts as
  distribution of the source code, even though third parties are not
  compelled to copy the source along with the object code.

    4. You may not copy, modify, sublicense, or distribute the Program
  except as expressly provided under this License.  Any attempt
  otherwise to copy, modify, sublicense or distribute the Program is
  void, and will automatically terminate your rights under this License.
  However, parties who have received copies, or rights, from you under
  this License will not have their licenses terminated so long as such
  parties remain in full compliance.

    5. You are not required to accept this License, since you have not
  signed it.  However, nothing else grants you permission to modify or
  distribute the Program or its derivative works.  These actions are
  prohibited by law if you do not accept this License.  Therefore, by
  modifying or distributing the Program (or any work based on the
  Program), you indicate your acceptance of this License to do so, and
  all its terms and conditions for copying, distributing or modifying
  the Program or works based on it.

    6. Each time you redistribute the Program (or any work based on the
  Program), the recipient automatically receives a license from the
  original licensor to copy, distribute or modify the Program subject to
  these terms and conditions.  You may not impose any further
  restrictions on the recipients' exercise of the rights granted herein.
  You are not responsible for enforcing compliance by third parties to
  this License.

    7. If, as a consequence of a court judgment or allegation of patent
  infringement or for any other reason (not limited to patent issues),
  conditions are imposed on you (whether by court order, agreement or
  otherwise) that contradict the conditions of this License, they do not
  excuse you from the conditions of this License.  If you cannot
  distribute so as to satisfy simultaneously your obligations under this
  License and any other pertinent obligations, then as a consequence you
  may not distribute the Program at all.  For example, if a patent
  license would not permit royalty-free redistribution of the Program by
  all those who receive copies directly or indirectly through you, then
  the only way you could satisfy both it and this License would be to
  refrain entirely from distribution of the Program.

  If any portion of this section is held invalid or unenforceable under
  any particular circumstance, the balance of the section is intended to
  apply and the section as a whole is intended to apply in other
  circumstances.

  It is not the purpose of this section to induce you to infringe any
  patents or other property right claims or to contest validity of any
  such claims; this section has the sole purpose of protecting the
  integrity of the free software distribution system, which is
  implemented by public license practices.  Many people have made
  generous contributions to the wide range of software distributed
  through that system in reliance on consistent application of that
  system; it is up to the author/donor to decide if he or she is willing
  to distribute software through any other system and a licensee cannot
  impose that choice.

  This section is intended to make thoroughly clear what is believed to
  be a consequence of the rest of this License.

    8. If the distribution and/or use of the Program is restricted in
  certain countries either by patents or by copyrighted interfaces, the
  original copyright holder who places the Program under this License
  may add an explicit geographical distribution limitation excluding
  those countries, so that distribution is permitted only in or among
  countries not thus excluded.  In such case, this License incorporates
  the limitation as if written in the body of this License.

    9. The Free Software Foundation may publish revised and/or new versions
  of the General Public License from time to time.  Such new versions will
  be similar in spirit to the present version, but may differ in detail to
  address new problems or concerns.

  Each version is given a distinguishing version number.  If the Program
  specifies a version number of this License which applies to it and "any
  later version", you have the option of following the terms and conditions
  either of that version or of any later version published by the Free
  Software Foundation.  If the Program does not specify a version number of
  this License, you may choose any version ever published by the Free Software
  Foundation.

    10. If you wish to incorporate parts of the Program into other free
  programs whose distribution conditions are different, write to the author
  to ask for permission.  For software which is copyrighted by the Free
  Software Foundation, write to the Free Software Foundation; we sometimes
  make exceptions for this.  Our decision will be guided by the two goals
  of preserving the free status of all derivatives of our free software and
  of promoting the sharing and reuse of software generally.

                              NO WARRANTY

    11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
  FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
  OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
  PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
  OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
  TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
  REPAIR OR CORRECTION.

    12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
  REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
  INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
  OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
  TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
  YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
  POSSIBILITY OF SUCH DAMAGES.

                       END OF TERMS AND CONDITIONS

          Appendix: How to Apply These Terms to Your New Programs

    If you develop a new program, and you want it to be of the greatest
  possible use to the public, the best way to achieve this is to make it
  free software which everyone can redistribute and change under these terms.

    To do so, attach the following notices to the program.  It is safest
  to attach them to the start of each source file to most effectively
  convey the exclusion of warranty; and each file should have at least
  the "copyright" line and a pointer to where the full notice is found.

      <one line to give the program's name and a brief idea of what it does.>
      Copyright (C) 19yy  <name of author>

      This program is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published by
      the Free Software Foundation; either version 2 of the License, or
      (at your option) any later version.

      This program is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      GNU General Public License for more details.

      You should have received a copy of the GNU General Public License
      along with this program; if not, write to the Free Software
      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

  Also add information on how to contact you by electronic and paper mail.

  If the program is interactive, make it output a short notice like this
  when it starts in an interactive mode:

      Gnomovision version 69, Copyright (C) 19yy name of author
      Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type show w.
      This is free software, and you are welcome to redistribute it
      under certain conditions; type show c for details.

  The hypothetical commands show w and show c should show the appropriate
  parts of the General Public License.  Of course, the commands you use may
  be called something other than show w and show c; they could even be
  mouse-clicks or menu items--whatever suits your program.

  You should also get your employer (if you work as a programmer) or your
  school, if any, to sign a "copyright disclaimer" for the program, if
  necessary.  Here is a sample; alter the names:

    Yoyodyne, Inc., hereby disclaims all copyright interest in the program
    Gnomovision (which makes passes at compilers) written by James Hacker.

    <signature of Ty Coon>, 1 April 1989
    Ty Coon, President of Vice

  This General Public License does not permit incorporating your program into
  proprietary programs.  If your program is a subroutine library, you may
  consider it more useful to permit linking proprietary applications with the
  library.  If this is what you want to do, use the GNU Library General
  Public License instead of this License.

  AA.1.  Philosophy

       Give me slack, or give me food, or kill me, or not.

