This directory contains a Sun Answerbook compatible navigator and viewer
that can be used to consult the Answerbook Postscript documents on a
plain X server.

The navigator and viewer are a single program based on the XView toolkit.
The GNU ghostscript interpreter is used as a Postscript engine.
Communication between the viewer and ghostscript follows `ghostview'
protocol. In fact, the Ghostview widget is used as a base to implement
an XView `GSCANVAS' object, which is a subclass of the XView CANVAS object
with the special purpose of rendering postscript code.

Here is a brief overview of source code:

subdir gscanvas:
	The XView class GSCANVAS. This class manages the ghostscript
	interpreter and sees to it that Postscript code is rendered on
	a XView canvas.

subdir dc:
	Contains an (non-visual) XView class implementing double click
	events. Much like a scrollbar, an instance of this type "attaches"
	to its owner and marks events destined for that owner that fulfill a
	double click criterion.

nav.c:
	The main program. It presents the contents of the Answerbook
	database.

abdbm.c bookinfo.c:
	Routines to parse the Answerbook database formats.

viewer.c psviewer.c:
	Routines to manage the (Postscript) viewer part of the navigator,
	including the presentation fo the hyperlinks.

ps.c:
	Almost a verbatim copy of the GNU Ghostview Document Structuring
	Convention parser. Knows about AB `%%Link' comments.



USAGE
	Of cause you should have a properly installed Answerbook.
	Xnav expects the environment variable BOOKINFO to be set
	to a bookinfo file. If this variable is not set, /etc/bookinfo is
	used.

	Start xnav with a collection Id as an argument. For release
	1.4 of Sun's answerbook, this would be `SUNWab_1_4'.

	The resource "Psview.Interpreter" determines the pathname of the
	ghostscript interpreter. The default is "gs" (implying that it
	should be in $PATH). See the manual page for other resources
	used by xnav.


KNOWN PROBLEMS

	o The viewer currently relies on retained canvases. On servers
	  that do/can not support this, things can get very slow.

	o The GSCANVAS interface is not mature. In particular, the
	  GSCANVAS_SENDPS and GSCANVAS_PSTOX attributes need rethinking.

	o Searching and bookmarks are not implemented.

	o Printing (directly from xnav) is not implemented.

	o The viewer part knows next to nothing about the Answerbook
	  structure (unlike Sun's docviewer). This prevents `walking through'
	  a book past the end of a Postscript file.

	o Sun's docviewer appears to automatically rotate some files
	  (notably those of the AB TOUR) by 90 degrees. I can find no
	  clue for this in PS files themselves. For now these oddballs
	  are displayed sideways in xnav.

	o The Palatino fount used in most Answerbook documents does not
	  have the prettiest of looks when rendered by ghostscript.



COMMENTS TO

	Paul Kranenburg, Dept. Computer Science, Erasmus University.
	email: pk@cs.few.eur.nl

