Previous Next Table of Contents

4. Resources

Resource files

When starting gv, preferences are read from

These two files are not the only sources of preferences taken into account when gv is started. However, in practice these are the most important.

General resources of gv

Name                  Class      Default Value
----------------------------------------------
antialias             Boolean    False
autoCenter            Boolean    True
autoResize            Boolean    True
confirmPrint          Boolean    True
confirmQuit           int        1
ignoreEOF             Boolean    True
respectDSC            Boolean    True
reverseScrolling      Boolean    False
swapLandscape         Boolean    False
scratchDir            String     ~/
defaultSaveDir        String     ~/
watchFile             Boolean    False
watchFileFrequency    int        1000
dirs                  String     see below
filter                String     see below
filters               String     see below
maximumWidth          String     screen-20
maximumHeight         String     screen-44
minimumWidth          int        400
minimumHeight         int        400
magstep               int        0
minimumMagstep        int        -7
maximumMagstep        int        7
orientation           String     automatic
fallbackOrientation   String     portrait
pageMedia             String     automatic
fallbackPageMedia     String     a4
antialias

Whether antialiasing should be used. Valid values are "True" and "False".

autoCenter

Whether the displayed page should automatically be centered (for instance when opening a new file). Valid values are "True" and "False".

autoResize

Whether gv is allowed to resize the main window according to the size of the current page. Valid values are "True" and "False".

confirmPrint

Whether printing requires an extra confirmation. Valid values are "True" and "False".

confirmQuit

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.

ignoreEOF

Defines the behaviour of the postscript scanner as described in the Options section. Valid values are "True" and "False".

respectDSC

Determines whether gv should attempt to respect document structuring comments. Valid values are "True" and "False".

reverseScrolling

Defines the interpretation of directions when scrolling with the mouse. Valid values are "True" and "False".

swapLandscape

Whether the meaning of "landscape" and "seacape" should be interchanged. Valid values are "True" and "False".

scratchDir

Specifies a directory used to store temporary data.

defaultSaveDir

Specifies the default destination directory for files to be saved.

watchFile

Whether the document should be checked periodically and updated automatically if changes are detected. Valid values are "True" and "False".

watchFileFrequency

Defines the time in milliseconds elapsing between successive checks of the document when watchFile is set to "True". Allowed values must be larger than 500.

dirs

Defines a list of directories accessible via the Directories menu in the file selection window. Example:

   GV*dirs:\n\ 
   Home\n\ 
   Tmp\n\ 
   /usr/doc\n\ 
The special value "Home" corresponds to the users home directory, the value "Tmp" corresponds to the scratch directory as defined by the scratchDir resource.

filter

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

   <filter>    := [<filespecs>] [no <filespecs>]
   <filespecs> := <filespec> [<filespecs>]
   <filespec>  := filename possibly including wildcards '*'
                  which match any character.
Example: The filter
   GV*filter: *.ps *.pdf no .*
screens out all files with names starting with a dot and keeps of the remaining ones only those which end on ".ps" or ".pdf".

filters

Defines a list of filters offered in the Filters menu of the file selection window. Example:

   GV*filters:\n\ 
   None\n\ 
   *.ps* *.pdf*  no  .*\n\ 
   no  .*

Note that the filter "None" has a special meaning causing all files to be displayed when the corresponding menu entry is selected.

maximumWidth, maximumHeight

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.

minimumWidth, minimumHeight

Defines a minimum size for the main window. Valid values for both resources are positive integers larger than 200.

magstep

Sets the initial magnification. Allowed values are integers.

minimumMagstep, maximumMagstep

Defines a range of allowed magsteps. Valid values for both resources are integers.

orientation

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.

fallbackOrientation

Defines the paper-size to be used when automatic orientation detetction fails. Valid values are "portrait", "landscape","seascape" and "upside-down".

pagemedia

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.

fallbackPageMedia

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.

Resources for the File Selection popup

GV*dirs

Defines a list of directories which are offered in the 'Directories' menu of the file selection window.

GV*filters

Defines a set of filters which can be accessed in the 'Filters' menu of the file selection window.

GV*filter

Defines the initial filter in the the file selection popup. The default value of this resource is set to 'no .*'.

Resources of type "GVintern"

For security reasons some preferences are handled differently than the "General resources" listed above. The default values of these resources of type "GVintern" are defined at compile time and can only be overriden in the user specific resource file.

GVintern.printCommand

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.

GVintern.gsInterpreter

The command used to start the ghostscript interpreter.

GVintern.gsCmdScanPDF

The command used to extract document structuring comments from a PDF file.

GVintern.gsCmdConvPDF

The command used to convert a PDF file to PostScript.

GVintern.gsX11Device

The ghostscript command line option which activates the "X11" device.

GVintern.gsX11AlphaDevice

The ghostscript command line option which activates the "X11" device with antialiasing enabled.

GVintern.gsSafer

Determines whether ghostscript should be started with the "-dSAFER" command line option.

GVintern.gsQuiet

Determines whether ghostscript should be started with the "-dQUIET" command line option.

GVintern.gsArguments

May be used to provide additional command line options for the ghostscript interpreter. Starting gv with the "-arguments <arguments>" option will override this resource setting.


Previous Next Table of Contents