<HTML>
<HEAD>
<TITLE> gv 3.5, June 1997: Resources </TITLE>
</HEAD>
<BODY>
<A HREF="gv-3.html">Previous</A>
<A HREF="gv-5.html">Next</A>
<A HREF="gv.html#toc4">Table of Contents</A>
<HR>
<H2><A NAME="Resources"></A> <A NAME="s4">4. Resources </A></H2>

<P><B>Resource files</B></P>
<P>In general gv does not depend on any external resource files.
However, when starting gv, preferences are read from</P>
<P>
<UL>
<LI> <B>a system specific resource file</B>.
The name of this file is as described by the "XFILESEARCHPATH"
environment variable, or, if this variable is not defined,
implementation dependant. In most cases it is  
"/usr/X11/lib/X11/app-defaults/GV".
Administrators may want to modify this file in order
to set up gv according to the local needs of their system.</LI>
<LI> <B>a user specific resource file</B>.
The name of this file is either "~/.gv" or as described
by the "XUSERFILESEARCHPATH" environment variable.</LI>
</UL>
</P>
<P>The files "gv_user.ad" and "gv_system.ad" (located in the library directory
of gv, which is most probably either 
"/usr/local/lib/gv/" or "/usr/lib/gv/" may serve as a basis
for constructing the user and system specific resource files.</P>
<P>Note that the user and system specific resource files are not the only
sources of preferences taken into account when gv is started.
However, in practice these are the most important.</P>
<P><B>Resources of gv</B></P>
<P>The following describes some of the resources of gv.
The precise syntax of some of the resource values may be 
inferred from the appended default system specific resource file.</P>
<P>
<DL>
<DT><B>antialias</B><DD><P>Whether antialiasing should be used.
Valid values are "True" and "False".</P>
<DT><B>autoCenter</B><DD><P>Whether the displayed page should automatically be centered 
(for instance when opening a new file).
Valid values are "True" and "False".</P>
<DT><B>autoResize</B><DD><P>Whether gv is allowed to resize the main window
according to the size of the current page.
Valid values are "True" and "False".</P>
<DT><B>confirmPrint</B><DD><P>Whether printing requires an extra confirmation.
Valid values are "True" and "False".</P>
<DT><B>confirmQuit</B><DD><P>Whether leaving gv requires extra confirmation.
Valid values are "0" (Never), "1"
(When processing) and "2" (Always).
The default value is "1", which causes
a confirmation request when trying to leave gv
in the presence of pending PDF to Postscript conversions.</P>
<DT><B>scrollingEyeGuide</B><DD><P>If this resource is "True" scrolling via the
keyboard causes a temporary border to be drawn around the
previously visible area of the page.
Allowed values are "True" and "False".   </P>
<DT><B>ignoreEOF</B><DD><P>Defines the behaviour of the postscript scanner as described
in the 
<A HREF="gv-3.html#Options">Options</A> section.
Valid values are "True" and "False".   </P>
<DT><B>respectDSC</B><DD><P>Determines whether gv should attempt to respect document 
structuring comments.
Valid values are "True" and "False".</P>
<DT><B>reverseScrolling</B><DD><P>Defines the interpretation of directions when
scrolling with the mouse.
Valid values are "True" and "False".</P>
<DT><B>swapLandscape</B><DD><P>Whether the meaning of "landscape" and "seacape"
should be interchanged.
Valid values are "True" and "False".</P>
<DT><B>scratchDir</B><DD><P>Specifies a directory used to store temporary data.</P>
<DT><B>defaultSaveDir</B><DD><P>Specifies the default destination directory for files to be saved.</P>
<DT><B>useBackingPixmap</B><DD><P>If the value of this resource is "False" the <I>X Server</I>
is advised that saving off-screen pixels of the displayed page
would be beneficial (maintaining backing store). In this case gv 
does not actively maintain the contents of the page but relies
on the <I>X Server</I>. The server is, however, always free to stop 
maintaining backing backing store.
If the value of this resource is "True" the <I>X Server</I>
is advised that maintaining backing store is not useful.
In this case gv attempts to allocate a sufficiently large pixmap
to store the contents of the displayed page.</P>
<DT><B>watchFile</B><DD><P>Whether the document should be checked periodically and updated
automatically if  changes are detected.
Valid values are "True" and "False".</P>
<DT><B>watchFileFrequency</B><DD><P>Defines the time in milliseconds elapsing between successive
checks of the document when <I>watchFile</I> is set to "True".
Allowed values must be larger than 500.</P>
<DT><B>printCommand</B><DD><P>The command used for printing a file.
The command may contain multiple '%s' wildcards
which will be replaced by the name of the file to be 
printed.</P>
<DT><B>gsInterpreter</B><DD><P>The command used to start the ghostscript interpreter.</P>
<DT><B>gsCmdScanPDF</B><DD><P>The command used to extract document structuring comments
from a PDF file.</P>
<DT><B>gsCmdConvPDF</B><DD><P>The command used to convert a PDF file to PostScript.</P>
<DT><B>gsX11Device</B><DD><P>The ghostscript command line option which activates the
"X11" device. </P>
<DT><B>gsX11AlphaDevice</B><DD><P>The ghostscript command line option which activates the
"X11" device with antialiasing enabled. </P>
<DT><B>gsSafer</B><DD><P>Determines whether ghostscript should be started with the
"-dSAFER" command line option.</P>
<DT><B>gsQuiet</B><DD><P>Determines whether ghostscript should be started with the
"-dQUIET" command line option.</P>
<DT><B>gsArguments</B><DD><P>May be used to provide additional command line options for the
ghostscript interpreter.
Starting gv with the "-arguments <I>&lt;arguments&gt;</I>"
option will override this resource setting.</P>
<DT><B>magMenu</B><DD><P>Describes the menu that pops up when preparing to
to zoom an area of the displayed page.</P>
<DT><B>dirs</B><DD><P>Defines a list of directories accessible via the <I>Directories</I>
menu in the file selection window.
The special value "Home" corresponds to the users home directory,
the value "Tmp" corresponds to the scratch directory as defined
by the <I>scratchDir</I> resource.</P>
<DT><B>filter</B><DD><P>Defines the default filter to be used when displaying a directory
contents in the file selection window.
A filter is specified according to the syntax
<PRE>
   &lt;filter&gt;    := [&lt;filespecs&gt;] [no &lt;filespecs&gt;]
   &lt;filespecs&gt; := &lt;filespec&gt; [&lt;filespecs&gt;]
   &lt;filespec&gt;  := filename possibly including wildcards '*'
                  which match any character.
</PRE>

Example: The filter
<PRE>
   GV*filter: *.ps *.pdf no .*
</PRE>

screens out all files with names starting with a dot
and keeps of the remaining ones only those which end
on ".ps" or ".pdf".</P>
<DT><B>filters</B><DD><P>Defines a list of filters offered in the <I>Filters</I>
menu of the file selection window.
The filter "None" has a special meaning
causing all files to be displayed when the corresponding
menu entry is selected.</P>
<DT><B>miscMenuEntries</B><DD><P>Describes the menu that pops up when clicking with the 
third mouse button on the displayed page. 
The value of this resource is a list of menu entries.
Allowed entries are
"update",
"redisplay",    
"toggle_current",    
"toggle_even",    
"toggle_odd",    
"unmark",    
"stop",    
"print_all",    
"print_marked",    
"save_all",    
"save_marked" and
"line".</P>
<DT><B>showTitle</B><DD><P>Whether the name of the displayed document should be shown in the
title bar of the window. The name of gv's icon will also change
accordingly if this resource is set to "True".</P>
<DT><B>maximumWidth, maximumHeight</B><DD><P>When resizing gv will not attempt to exceed the size specified
by these resources.
These resources may be specified as a positive integer
or as "screen", optionally combined with
a positive or negative offset.
The default values listed above provide examples for this syntax.
"screen" will automatically be replaced by the size of the
screen.</P>
<DT><B>minimumWidth, minimumHeight</B><DD><P>Defines a minimum size for the main window.
Valid values for both resources are positive integers larger
than 200.</P>
<DT><B>scale</B><DD><P>Sets the initial scale. The value of this resource is the offset
of the scale to be selected relative to the scale 1.0 in the
the "Scale" menu.</P>
<DT><B>scaleBase</B><DD><P>Selects the initial scale base. The value of this resource should 
be a positive integer.</P>
<DT><B>scales</B><DD><P>Defines the available scales bases and scales in the "Scale"
menu.   </P>
<DT><B>orientation</B><DD><P>Sets the initial orientation. Valid values are 
"portrait", "landscape","seascape",
"upside-down" and
"automatic".
"automatic" causes gv to attempt
to derive the correct orientation from document structuring
comments.</P>
<DT><B>fallbackOrientation</B><DD><P>Defines the paper-size to be used when automatic orientation
detetction fails.  Valid values are 
"portrait", "landscape","seascape" 
and "upside-down".</P>
<DT><B>medias</B><DD><P>A list describing the page medias known to gv.
List entries starting with "!" or "#" will not appear in the
"Media" menu but will still be used for automatic paper size 
detection.</P>
<DT><B>pagemedia</B><DD><P>Sets the paper size. 
Allowd values are as given in the above list of paper-sizes.
Specifying
"automatic" causes gv to attempt
to derive the correct paper-size from document structuring
comments.</P>
<DT><B>fallbackPageMedia</B><DD><P>Defines the paper-size to be used when automatic paper-size 
detetction fails.  Valid values are as given in the  above
list of paper-sizes.</P>
</DL>
</P>
<P><B>The default user and system specific resource file</B>
<PRE>
GV.pageMedia:           automatic
GV.orientation:         automatic
GV.fallbackOrientation: portrait
GV.swapLandscape:       False
GV.autoCenter:          True
GV.antialias:           False
GV.respectDSC:          True
GV.ignoreEOF:           True
GV.confirmPrint:        True
GV.reverseScrolling:    False
GV.scrollingEyeGuide:   True
GV.autoResize:          True
GV.maximumWidth:        screen-20
GV.maximumHeight:       screen-44
GV.minimumWidth:        400
GV.minimumHeight:       430
GV.confirmQuit:         1
GV.watchFile:           False
GV.watchFileFrequency:  1000
GV.showTitle:           True
GV.miscMenuEntries:     redisplay       \n\ 
                        # update        \n\ 
                        stop            \n\ 
                        line            \n\ 
                        toggle_current  \n\ 
                        toggle_even     \n\ 
                        toggle_odd      \n\ 
                        unmark          \n\ 
                        line            \n\ 
                        print_all       \n\ 
                        print_marked    \n\ 
                        save_all        \n\ 
                        save_marked
GV.scale:               0
GV.scaleBase:           1
GV.scales:              Natural size,   1.000,  screen  \n\ 
                        Pixel based,    1.000,  pixel   \n\ 
                        0.100,          0.100           \n\ 
                        0.125,          0.125           \n\ 
                        0.250,          0.250           \n\ 
                        0.500,          0.500           \n\ 
                        0.707,          0.707           \n\ 
                        1.000,          1.000           \n\ 
                        1.414,          1.414           \n\ 
                        2.000,          2.000           \n\ 
                        4.000,          4.000           \n\ 
                        8.000,          8.000           \n\ 
                        10.00,          10.00
GV.medias:              Letter,         612     792     \n\ 
                        # LetterSmall,  612     792     \n\ 
                        Legal,          612     1008    \n\ 
                        Statement,      396     612     \n\ 
                        Tabloid,                792     1224    \n\ 
                        Ledger,         1224    792     \n\ 
                        Folio,          612     936     \n\ 
                        Quarto,         610     780     \n\ 
                        # 7x9,          504     648     \n\ 
                        # 9x11,         648     792     \n\ 
                        # 9x12,         648     864     \n\ 
                        # 10x13,                720     936     \n\ 
                        10x14,          720     1008    \n\ 
                        Executive,      540     720     \n\ 
                        # A0,           2384    3370    \n\ 
                        # A1,           1684    2384    \n\ 
                        # A2,           1191    1684    \n\ 
                        A3,             842     1191    \n\ 
                        A4,             595     842     \n\ 
                        # A4Small,      595     842     \n\ 
                        A5,             420     595     \n\ 
                        # A6,           297     420     \n\ 
                        # A7,           210     297     \n\ 
                        # A8,           148     210     \n\ 
                        # A9,           105     148     \n\ 
                        # A10,          73      105     \n\ 
                        # B0,           2920    4127    \n\ 
                        # B1,           2064    2920    \n\ 
                        # B2,           1460    2064    \n\ 
                        # B3,           1032    1460    \n\ 
                        B4,             729     1032    \n\ 
                        B5,             516     729     \n\ 
                        # B6,           363     516     \n\ 
                        # B7,           258     363     \n\ 
                        # B8,           181     258     \n\ 
                        # B9,           127     181     \n\ 
                        # B10,          91      127     \n\ 
                        # ISOB0,                2835    4008    \n\ 
                        # ISOB1,                2004    2835    \n\ 
                        # ISOB2,                1417    2004    \n\ 
                        # ISOB3,                1001    1417    \n\ 
                        # ISOB4,                709     1001    \n\ 
                        # ISOB5,                499     709     \n\ 
                        # ISOB6,                354     499     \n\ 
                        # ISOB7,                249     354     \n\ 
                        # ISOB8,                176     249     \n\ 
                        # ISOB9,                125     176     \n\ 
                        # ISOB10,       88      125     \n\ 
                        # C0,           2599    3676    \n\ 
                        # C1,           1837    2599    \n\ 
                        # C2,           1298    1837    \n\ 
                        # C3,           918     1296    \n\ 
                        # C4,           649     918     \n\ 
                        # C5,           459     649     \n\ 
                        # C6,           323     459     \n\ 
                        # C7,           230     323     \n\ 
                        # DL,           312     624
GV.magMenu:             2,      2       \n\ 
                        4,      4       \n\ 
                        8,      8       \n\ 
                        16,     16      \n\ 
                        32,     32      \n\ 
                        64,     64
GV*Ghostview.background:                white
GV*Ghostview.foreground:                black
GV.gsInterpreter:       gs
GV.gsCmdScanPDF:        gs -dNODISPLAY -dQUIET -sPDFname=%s -sDSCname=%s pdf2dsc.ps -c quit
GV.gsCmdConvPDF:        gs -dNODISPLAY -dQUIET  -dNOPAUSE -sPSFile=%s %s -c quit
GV.gsX11Device:         -sDEVICE=x11
GV.gsX11AlphaDevice:    -dNOPLATFONTS -sDEVICE=x11alpha
GV.gsSafer:             True
GV.gsQuiet:             True
GV.gsArguments:
GV.uncompressCommand:   gzip -d -c %s &gt; %s
GV.printCommand:        lpr
GV.scratchDir:          ~/
GV.defaultSaveDir:      ~/
GV.fallbackPageMedia:   a4
GV.useBackingPixmap:    True
GV*dirs:                Home\n\ 
                        Tmp\n\ 
                        /usr/doc\n\ 
                        /usr/local/doc
GV*filter:              no .*
GV*filters:             None\n\ 
                        *.*ps* *.pdf*  no  .*\n\ 
                        *.*ps*   no  .*\n\ 
                        *.pdf*  no  .*\n\ 
                        no  .*
</PRE>

</P>
<HR>
<A HREF="gv-3.html">Previous</A>
<A HREF="gv-5.html">Next</A>
<A HREF="gv.html#toc4">Table of Contents</A>
</BODY>
</HTML>
