
*********************************************************************
****************************  FILEVIEW  *****************************
*********************************************************************


                           by Nick Christie
                             Version 1.01
                            2nd August 1994


Index.
======

   1. Distribution.
   2. Disclaimer.
   3. Contents.
   4. Background.
   5. Requirements.
   6. Installation.
   7. Starting FileView.
   8. Using FileView.
     8.1. The Status Display.
     8.2. Using the Mouse.
     8.3. Using the Keyboard.
     8.4. About Searching.
   9. Tooltypes.
  10. Limitations.
  11. Bugs and Improvements.
  12. Version History.
  13. Credits.
  14. Author.


The ReqTools and PowerPacker libraries are Copyright © Nico Francois.

The XPK system is Copyright © Urban Mueller, et al.

All trademarks are acknowledged.



1. Distribution.
================

    o FileView is Copyright ©1994 by Nick Christie. All rights
      reserved.

    o FileView is "freeware" so no donation is required. It is _not_
      in the public domain.

    o FileView may be freely distributed provided all the files listed
      in "Contents", below, remain unaltered and are included in the
      distribution. They may, however, be archived to conserve space.

    o No profit is to be made by selling this software. You may not
      charge more than Fred Fish does for a single floppy disk from
      his library. This restriction is waived in the case of the
      AmiNet CD-ROM, and for any CD-ROM produced by Fred Fish.

    o This software may not be included in a commercial package, or on
      a magazine coverdisk, without the author's written permission.

    o This software may not be uploaded onto any BBS that claims
      copyright on uploaded material.

    o If you use FV, I would enjoy receiving a postcard from you (even
      an electronic one).




2. Disclaimer.
==============

This program is provided "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 this program is
with you. In no event can I be liable to you for damages of any kind
arising out of the use of this program, or the inability to use it.



3. Contents.
============

This package consists of:
    FV                  executable for any 680x0 CPU
    FV.info             icon for above
    FV_nd               non-detaching executable for any 680x0 CPU
    FV_nd.info          icon for above
    FV_020              executable for 68020 or better
    FV_020.info         icon for above
    FV_020nd            non-detaching executable for 68020 or better
    FV_020nd.info       icon for above
    FV.doc              this documentation
    FV.doc.info         icon for above
    FV.readme           short description
    FV.readme.info      icon for above
    reqtools.library    requester library



4. Background.
==============

FileView (or more simply, FV) is a text and hex file viewer. I wrote
it because I couldn't find an existing viewer that was fast enough,
and also had a hex dump mode, amongst other things. I had to make some
compromises in order to achieve the desired result, in particular:

    o It doesn't interpret ANSI sequences for changing colours and
      text attributes like bold and underline.

    o It will only run on its own custom screen, which cannot be made
      public.

    o The screen can only be 640x256 (PAL) or 640x200 (NTSC) in 2 or 4
      colours.

    o It only supports 8x8 monospace fonts.

Okay, so if you haven't stopped reading, this is what it _does_ offer:

    o Scrolls at 4 speeds, from a smooth 1 pixel to a fast 8.
    o Comprehensive mouse and keyboard controls.
    o Can be launched from shell or WB.
    o On-line help screens.
    o Hex dump mode.
    o Junk filter in hex mode.
    o Detaches from shell.
    o Installs as a commodity.
    o Fast searching in both hex and text modes.
    o Wildcard text searches, with case-sensitive option.
    o Searches in hex mode for hex, dec, and ASCII bytes.
    o Uses the ReqTools library for attractive requesters.
    o Can read PowerPacked and XPK'd files.
    o Keeps a file list for quickly moving between files.
    o Can launch your editor with the current file.
    o Can go to sleep and pop up with a hotkey.
    o Supports five bookmarks.
    o Can mark blocks of text and write them to a file, device,
      clipboard, or into the input stream of another application.
    o Has an adjustable palette.
    o Has adjustable tab spacing.
    o Choice of any 8 by 8 monospace font.
    o It is pure and hence may be made resident.
    o Hand-crafted with loving care in 100% assembly language.


5. Requirements.
================

FV requires AmigaDOS 2.04 (Kickstart V37) or better. You must have
reqtools.library V38 or better in the LIBS: directory. FV supports
files compressed with PowerPacker and XPK if you have the appropriate
software installed.



6. Installation.
================

FV can be copied anywhere you please. For ease of configuration, enter
your preferences as tooltypes in the icon (see below). If you're
likely to run FV from the shell, copy the icon file to ENVARC: and
ENV:, because it will pick up your preference settings from there.

Four flavours of FV are provided: "FV" is compiled for any processor
while "FV_020" is for 68020's or better. The "nd" flavours are versions
that don't detach from the shell, which some people prefer. Pick the
one you want and rename it as "FV" for simplicity.

You must also copy the reqtools.library file to LIBS: if you don't
have a copy of it already. I recommend obtaining the full ReqTools
package, to get its preference editor and other utilities.

Sorry, but at this time I have not prepared an installation script.
This is something I will look into for future releases.



7. Starting FileView.
=====================

FileView can be run from the Workbench or shell in the normal manner.
You can specify multiple files and directories by shift-selecting from
WB or naming them on the shell command line. Specifying a directory
will cause FV to open a file requester in the first selected
directory. If you don't specify any files or directories when you
start FV, it will open a file requester.

FV keeps the names of all selected files and directories in a file
list, so you can step from one to another. Any new files loaded via
requester from within FV are also added to this list. The list is
forgotten when you exit FV, however.

The only command line option is the HEX switch, which starts FV in its
hex dump mode.

If FV is already running, launching it again will wake it up (if it is
asleep) and bring it to the front, whereupon it will respond to any
arguments you have given it.

FV detaches automatically from the shell. There is no need to "Run
>NIL:" it. If this bothers you, use one of the "nodetach" versions
supplied.



8. Using FileView
=================

You can control most of FV with both mouse and keyboard. There are
some help screens available on-line as reminders; select one of the
options in the help menu, or press the help key.


8.1. The Status Display.
========================

FV uses the screen title bar for status messages. Normally it shows
the name of the current file (without the path), the line numbers of
the topmost and bottommost lines, the column number of the leftmost
column, and a percentage indicating how far into the file you are. FV
will also display some letters to indicate that certain options are
active. These are:

    U - Indicates that the "unload buffer" option is on, so if you put
        FV to sleep it will unload the current file.

    S - Shown when FV has been asleep at least once, so pressing ESC
        will send it back to sleep instead of quitting FV. Use
        Shift-ESC or the Quit menu option to really quit FV.

    P - Indicates that the current file was packed.

    B - Shown when block marking is active.

    W - Indicates that the wildcard searches are enabled.

    C - Indicates that case-sensitive searches are enabled.


8.2. Using the Mouse.
=====================

A single left mousebutton (LMB) click on the screen starts continuous
scrolling, another click stops it. So does deactivating FV's screen.
The position of the mouse pointer controls the direction and speed of
scrolling: up when the pointer is in the top half of the screen, down
in the bottom half. Scroll speed is slow when the pointer is near the
centre of the screen, and progressively faster in four stages as the
pointer is moved towards the top or bottom of the screen.

In addition, you can scroll by 8 columns left or right with an LMB
click in the far left or right of the screen.

Marking blocks (text mode only) is achieved with mouse and keyboard.
An LMB click with left shift key depressed defines the start of the
block, and a right-shifted LMB click defines the end. You can adjust
the positions with further clicks.

Once a block is marked, you can use the menu options under "Block" (or
the key equivalents, see below) to write the block to a file, a device
or the clipboard. You can also switch to another application and press
the "paste block" hotkey (default, control-lalt-v) to paste the block
into the program as if you had typed it yourself.

There are also menu options to play with, accessed as usual with the
right mousebutton.


8.3. Using the Keyboard.
========================

The key commands are:

CrsrUp          Move up one line (16 bytes in hex mode).
CrsrDown        Move down one line (16 bytes in hex mode).
CrsrLeft        Move left 8 columns (1 byte in hex mode).
CrsrRight       Move right 8 columns (1 byte in hex mode).
Ctrl-Left       Move back to the leftmost column (to previous
                multiple of 16 offset in hex mode).
Ctrl-Right      Move right far enough to see the end of the longest
                line. (to next multiple of 16 offset in hex mode).
Shift-Up        Move up quickly by one screen.
Shift-Down      Move down quickly by one screen.
Ctrl-Up         Move to the beginning of the file.
Ctrl-Down       Move to the end of the file.
Alt-Up          Start continuous smooth scrolling upwards.
Alt-Down        Start continuous smooth scrolling downwards.
Shift-Alt-Up    Smooth scroll up one screen.
Shift-Alt-Down  Smooth scroll down one screen.
Space           Stop continuous scrolling (other keys do this, too).

While FV is continuously scrolling, you can hold down the Alt,
Shift,or Ctrl keys to make it scroll progressively faster.

S               Search forward again from last match.
A               Search backward again from last match.
Alt-S           Search forward again from the current position.
Alt-A           Search backward again from the current position.
Shift-S         Search forward for (brings up a requester).
Shift-A         Search backward for (brings up a requester).
Shift-Alt-S/A   Return to last search match.
W               Toggles wildcard searching (text mode only).
C               Toggles case-sensitivity (text mode only).

L               Load a new file (brings up a requester).
Ctrl-L          Load a file from the filelist (brings up the list).
Shift-L         Load the next file from the filelist.
Alt-L           Load the previous file from the filelist.

Numeric Pad     Corresponds to cursor keys, plus:
NumEnter        Load a new file (brings up a requester).
NumAsterisk     Load a file from the filelist (brings up the list).
NumPlus         Load the next file from the filelist.
NumMinus        Load the previous file from the filelist.
Num5            Return to last search match.

F1-F5           Jump to bookmark number 1-5.
Shift-F1-F5     Drop bookmark number 1-5.

H               Toggles between text and hex mode.
Alt-H           Toggles the junk filter in hex mode.
P               Opens a palette requester.
Tab             Opens a requester for specifying tab spacings.
I               Shows some information about the current file.
1,2,3,4         Sets the scrolling speed for moving up/down by line.
Ctrl-E          Launch your editor with the current file (requires
                you to have set the EDITOR tooltype).

Ctrl-W          Write the marked block to a file (via requester).
Ctrl-Shift-W    Write the marked block to a device (via requester).
Alt-W           Write the marked block to the clipboard.
DEL             Clear the current block definition.

Help            Show some help on key commands.
Shift-Help      Show some help on mouse control.
Ctrl-Help       Show some help on searching.
Alt-Help        Show some help on block marking.

U               Toggle the 'unload buffer' option. If set, FV will
                free the current file buffer when you put it to sleep.
Q/ESC           Quit FV.
Shift-Q/ESC     Put FV to sleep.

After FV has been asleep once, the meanings of the above are reversed,
so that ESC puts FV back to sleep, while Shift-ESC really quits it.


8.4. About Searching.
=====================

In text mode, FV can use DOS wildcard patterns for searches. Just turn
on the wildcard option but remember that the pattern must match the
_whole_ line. Searches can be made case-sensitive as well, by turning
on the case-sensitivity option.

In hex mode, you must specify the search pattern as a series of bytes,
separated by commas or spaces. The values are assumed to be hex, put
"#" in front for decimal, eg. "#32". You can also put in ASCII
characters by preceeding them with "@", eg. "@A". Of course these can
be mixed together: "30 #32 @A" corresponds to "0", space and an "A".



9. Tooltypes.
=============

The following tooltypes may be entered into FV's icon to set your
preferences:

CX_PRIORITY     (-128 to +127, default: 0)
Sets FV's priority within the the commodities input handling chain.

CX_POPKEY       (see DOS manual, default: "control lalt f")
Defines the hotkey to wake FV up when it is asleep.

CX_PASTEKEY     (see DOS manual, default: "control lalt v")
Defines the hotkey that makes FV paste the currently marked block
into the input stream of the active window.

TASKPRIORITY    (-128 to +127, default: inherited from shell or WB)
Sets FV's priority relative to other tasks. Careful with this ! Best
to stay in the ±3 range. Try +1 if you always want FV to respond
quickly even when other programs are running, and -1 if you don't want
FV to interfere with the running of other programs.

HEX             (switch, default: off)
If HEX is specified in the tooltypes, FV will start in hex dump mode.
This is a switch, ie. it doesn't need to be given a value.

NTSC            (switch, default: machine's native mode)
Will force FV to open its screen with the NTSC monitor specification.
This monitor must have already been installed with AddMonitor.

PAL             (switch, default: machine's native mode)
Like the NTSC switch, but for the PAL monitor spec.

MONO            (switch, default: off)
If MONO is specified in the tooltypes, FV will open a 2 colour screen
instead of a 4 colour one. As FV itself doesn't use 4 colours (the
requesters do, though) you can save a bit of graphics memory this way.

PENx            (0 to 32767, default: similar to standard WB palette)
Actually, this is four tooltypes: PEN0, PEN1, PEN2 and PEN3, for
setting the colours of FV's screen. Each takes an argument of the
form: red, green, blue, eg. "PEN0=6,11,5".

FONT            (fontname, default: topaz.font)
You can select a font for FV to use with this tooltype, but there are
restrictions: the font must be monospace and 8 by 8 pixels in size.
Write it like this: "FONT=byte.font".

EDITOR          (pathname, default: none)
Put in the path and name of your favourite text editor and FV should
be able to launch it with the current text file, eg. "EDITOR=C:Ed".



10. Limitations.
================

    o Maximum line length is 32K.
    o Maximum number of lines is also 32K.
    o Maximum file size is otherwise limited only by available memory.
    o Maximum number of files in filelist is also up to available mem.



11. Bugs and Improvements.
==========================
Okay, so there is one "failure mode" I am aware of at present, but it
is so extremely unlikely to occur that it's not very high on my list.
Please do inform me (address below) if you find any reproducible
"unintentional features" (bugs).

As for improvements, I am considering (in no particular order):

    o Using ASL by default and offering a switch to use ReqTools.
    o Writing an installation script.
    o AmigaGuide format doc, launchable from within FV.
    o Command line option to disable detaching.
    o Updating the help screens to explain some features currently not
      described in them.
    o Selectable screenmode, or at least a LACE option. But I find
      scrolling to be too slow with large screens (maybe with AGA it's
      okay) and it would certainly require support for larger fonts.
    o A "TAB" tooltype for default tab spacing, possibly associated
      with file extensions.
    o Button bar along the top or bottom, with up/down, load, etc.
    o A way to mark blocks just using the mouse.
    o Display clipboard contents like a file ?
    o Locale support, except I don't have WB3.
    o Simple AmigaGuide support.
    o Reduce use of hard-coded rawkey codes for use with foreign kbds.
    o More filters in hex mode, and maybe some in text mode, too.
    o Switch into text or hex mode according to file content.
    o Split-screen operation on 2 files.
    o Expand wildcard inputs on cmd line. Thing is, I use Csh which
      does this for me already. Oh well, yeah, I'll probably do it.
    o Support for CX_NOPOPUP, so you can put it in WBStartup and
      always have it running in the background.
    o Not use gadtools for Load from List function -> reduces size.
    o Option in prefs tooltypes to make ESC always mean "quit", never
      "go to sleep".
    o Option in prefs tooltypes to make "unload buffer during sleep"
      the default behaviour.
    o Put prefs in separate file so it takes less space in ENV:.
    o Facility to list an archive and extract a file from it to view.
    o ARexx port. I don't know what for, but it seems a program is
      naked without one these days.
    o Rework arithmetic (from WORDs to LONGs) to remove all practical
      restrictions on line length and number of lines.
    o Eliminate slight beam contention when scrolling upwards.
    o Option to write filelist to ENV: on exit, reload when launched
      again.



12. Version History.
====================
1.00    10/07/94    First release.
1.01    02/08/94    Fixed odd-aligned reference that crashed 68K CPUs.


13. Credits.
============

Thanks go to:

Nico Francois for ReqTools, PowerPacker, and dozens of other great
products.

Urban Dominik Mueller, Bryan Ford, Peter Struijk, Christian Roques,
Andre Beck, Marc Zimmermann, Kristian Nielsen, Matthias Scheler,
Martin A. Blatter and others for the XPK packing system.

Urban Dominik Mueller and Andreas M. Kirchwitz for Csh.

CygnusSoft for CEDPro3.

HiSoft for DevPac3.

Stefan for pointing out the big 68K bug! Ooops. :-)

Plus all the authors who make the software that makes the Amiga great.



14. Author.
===========

For the forseeable future I can be reached at

    nick.christie@computing-services.oxford.ac.uk
  or try:
    nick@vax.ox.ac.uk

or if you _must_ use snail mail:

    Nick Christie
    The Bungalow
    300 Meadow Lane
    Oxford
    OX4 4BL
    Great Britain

