\font\twelverm=cmr12
\font\twelvett=cmtt12
\twelverm
\font\it=cmti12
\font\bf=cmbx12
\font\big=cmbx10 scaled\magstep5
\font\bigss=cmssdc10 scaled\magstep5
\font\twelvess=cmssdc10 scaled\magstephalf
\def\Mostra{{\twelvess Mostra}}
\centerline{\bigss Mostra}
\vskip 1cm
\centerline{\big A Universal IFF Viewer}
\vskip 1cm
\parindent=40pt
\parskip=10pt plus 1pt minus 1pt
\baselineskip=15pt
\noindent There are many utilities for viewing IFF ILBM files, but none I'd seen
until now met the goal of displaying every IFF picture; each had its
idiosyncrasies.  If one viewer could display overscan pictures, then every
picture with more than 640 pixels on a line would be shifted like there were 700
pixels; some programs could only show a directory of pictures by forcing the
user to enter all the filenames; some programs would crash with PAL pictures;
others would do the same with pictures larger than any screen; it was rare to
have an option to force a screen mode (for the tech-folks out there:  old IFF
ILBM files don't have the CAMG chunk!); there were no comfortable file
requesters for use when you didn't know the exact name of the file (who can
remember GRABBiT file names?); pressing the right mouse button could cause a
useless drag bar to corrupt the picture$\ldots$

If a program had one feature, it lacked another, so I decided to write a show
utility.  I never would have succeeded without the best friend of an Amiga
programmer:  the ARP library.  If I have been able to write \Mostra, it's only
to ARP's credit.  Pattern matching, resource tracking, powerful resident
functions$\ldots$ The only drawback is that you {\it must\/} have the
arp.library (V39!) in your libs:  directory in order to run \Mostra.  Otherwise,
a message will be displayed, and \Mostra\ will refuse to run.  \Mostra\ is also
a pure program, i.e., it can be made resident.

Note that you can run \Mostra\ from Workbench:  called by itself it will pop the
file requester and will show you pictures until you select {\twelvett CANCEL} or
close the file requester window.  Otherwise, you can select multiple icons, or
you can change the default tool of your pictures.  Note that if you do this with
a CAT or a LIST you will have an automatic little slideshow.

\Mostra\ can process {\it any\/} IFF ILBM file (including Photon Paint files,
excellence!  files etc.); this means not only IFF ILBM FORMs, but also nested
ILBM, FTXT, FORMs, CATs, LISTs and PROPs!  It will always try to find the screen
type that fits the best, and won't give up if you want to see 1$\times$1 brushes
or {\it very\/} large pictures:  Tom tried up to 5120$\times$4096 (thanx Tom).
In any case, you can force the screen type with several options.

One of the major features in this release is direct support for SHAM and
indirect support for Dynamic HAM and Dynamic Hi-Res.  Note that you get {\it
full\/} SHAM support --- you can scroll around SHAM pictures in little screens!
Of course vertical movement requires a {\it lot\/} of work for your Amiga.  For
Dynamic Hi-Res and Dynamic HAM \Mostra\ will call NewTek's Dyna-Show, that must
be in one of your search paths (the simplest way to accomplish this is putting
Dyna-Show in your C:  directory).  You can this way look to every kind of
picture, but with Dynamic modes you lose some of \Mostra's powerful features,
e.g., the screen sizing.  However, all principal functions are implemented.
Including Dyna-Show-like code in \Mostra\ would have increased its size too
much.  Maybe the next release I'll think about it.


To get the syntax in AmigaDOS/ARP style type:

{\obeylines
\parindent=0pt
\twelvett
M ?
\vskip 10pt
\twelverm
This will produce the input template:
\vskip 10pt
\twelvett
{\parskip=0pt Files/$\ldots$,A=ALL/s,R=REPEAT/s,Q=QUIET/s,NOFASTDRAW/s,
C=CENTER/s,B=BLACKBACKGROUND/s,W=Width/k,H=Height/k,CYCLE/s,
Secs/k,Fade/k,NO=NOSTARTUP/s,Batch/k,
N=NOMOUSE/s,F=FREEMOUSE/s,NA=NOACTIVATE/s,DB=DOUBLEBUFFERING/s,
HIRES/s,LACE/s,LORES/s,NOLACE/s,HAM/s,HALFBRITE/s:}
\vskip 10pt
\twelverm
If you ask for more help by typing `?' again, you will see:
\vskip 10pt
\twelvett
{\parskip=0pt \Mostra\ 1.0 {\copyright} 1990 Sebastiano Vigna
Usage: M <wildcards [$\ldots$] | !> [ALL] [REPEAT] [QUIET] [NOFASTDRAW]
        [CENTER] [BLACKBACKGROUND] [WIDTH n] [HEIGHT n] [CYCLE]
        [SECS time] [FADE speed] [NOSTARTUP] [BATCH file]
        [NOMOUSE] [FREEMOUSE] [NOACTIVATE] [DOUBLEBUFFERING]
        [HIRES | LORES] [LACE | NOLACE] [HAM | HALFBRITE]}
\vskip 10pt
\twelverm
The same help is displayed if you call \Mostra\ with no arguments.
}

\Mostra's first argument is a list of patterns (or file names) as long as you
want; you will get every picture whose name matches one of the patterns.
Alternatively, you can type only the `!' character, and \Mostra\ will display
the famous Heath File Requester, allowing you to scan the entire file system.

When you're tired of looking at the picture, move the mouse pointer to the very
top of the screen and press the right button (you can also press the {\twelvett
RETURN}, {\twelvett SPACE} or {\twelvett ESCAPE} keys).  You can drag or depth-
arrange the screen with the left mouse button (the gadgets are invisible, but
they really are there!).  {\twelvett TAB} will toggle on/off color cycling.  To
stop pattern matching or IFF scanning use {\twelvett CTRL-C} at any moment.

If the screen size is less than the size of the picture, you can move around
with cursor keys by themselves (moving by 8 pixels) or in combination with the
{\twelvett ALT} (16 pixels, lowest=weakest), {\twelvett SHIFT} (64 pixels), or
{\twelvett CTRL} (128 pixels, highest=strongest) keys.  A noteworthy feature of
\Mostra\ is that the picture is {\it not\/} decrunched all at one time in a very
large chunk of memory; instead, a fast LM routine decrunches the file in
real-time every time you move (the routine could be faster, but it has lots of
controls to get rid of damaged IFF BODY chunks; safety always first).  This is
not as fast as the memory-eating method, but I think it's {\it much\/} better!
Very large pictures (like 800$\times$900) will be shown in a full screen
(generated on the fly at Workbench size) which you can move around.  Overscan
pictures will retain their size of it's not greater than 400$\times$300 lo-res
pixels (400$\times$250 on a NTSC Amiga).  For hi-res pictures, there is also a
704 pixel width limit due to Intuition.  Small brushes will be shown in a
minimum 256$\times$128 pixel screen.  Of course, moving vertically with SHAM
pictures involves a high system overhead, since CopperLists are continuously
built and deleted.

A weird effect of this method is that you can see pictures that can't even be
{\it loaded\/} into your Amiga.  Let's suppose you have a really crunched
picture; the BODY chunk and a 256$\times$256 lo-res screen could take much less
space than the decrunched picture, so you could create pictures that only
\Mostra\ could let you see in all of their parts.  Why you would want to do
this, well, that's another matter.

If you're looking at a Dynamic HAM/Dynamic Hi-Res picture, remember that you're
dealing with Dyna-Show, and not with \Mostra.  To exit you must simply press a
key or a mouse button.  Remember also that all other task are frozen.

Then we have a lot of options (parentheses show how to shorten 'em):

\item{$\bullet$}{\twelvett ALL (A)} recursively scans all of the subdirectories
during the wildcard search.

\item{$\bullet$}{\twelvett REPEAT (R)} will endlessly restart from the first
pattern when it has finished with the last; if you used the `!' line arguments,
the file requester will pop up after every picture until you {\twelvett CANCEL}
or close.

\item{$\bullet$}{\twelvett QUIET (Q)} turns off all messages except in case of
error.

\item{$\bullet$}{\twelvett NOFASTDRAW} leaves the program at priority 0; by
default, \Mostra\ will surround the BODY decrunching operations with a
SetTaskPri(1).  This will not lock the system, but in a multitasking situation
\Mostra\ will perform quickly when needed.

\item{$\bullet$}{\twelvett CENTER (C)} will force the screen to be centered
(640$\times$200 pictures on PAL screens look so ugly$\ldots$) and will use
overscan if necessary.

\item{$\bullet$}{\twelvett BLACKBACKGROUND (B)} will create a 0-bitplane (almost
no memory consumed!) black screen that will stay until you saw the last picture.
This is for aesthetic purposes only.

\item{$\bullet$}{\twelvett WIDTH} and {\twelvett HEIGHT (W,H)} want an argument
that specifies the dimensions of the viewing screen.  However, \Mostra\ is an
intelligent program, and will almost always find the correct screen by itself.
WARNING:  dimensions allowed are from 64 to 1024, at your own risk.  Your Amiga
won't crash, but weird things can happen$\ldots$ (Please note that SHAM vertical
sizes will be rounded to the next even number).

\item{$\bullet$}{\twelvett CYCLE} will automatically activate color cycling on
every picture.  Usually this happens only by request, through {\twelvett TAB}.

\item{$\bullet$}{\twelvett SECS} must be followed by a number between 0 and 1000
(the zero delay was a request from a BIXen).  \Mostra\ will display the picture
for the number of seconds specified, but you can skip it with mouse, {\twelvett
RETURN}, {\twelvett SPACE}, and {\twelvett ESCAPE} keys as always or stop the
show with {\twelvett CTRL-C}.  Cursor keys are disabled.  Greatly reworked on
Warren's request.

\item{$\bullet$}{\twelvett FADE} lets you specify a speed for pictures to fade
in and out.  Valid numbers are 1 to 4, with four the slowest.  Note that HAM
pictures can't be faded.

\item{$\bullet$}{\twelvett NOMOUSE (N)} will hide the mouse pointer while
\Mostra\ is displaying a picture.

\item{$\bullet$}{\twelvett FREEMOUSE (F)} will let you pass from one picture to
another by clicking either of the mouse buttons at any position on the screen.

\item{$\bullet$}{\twelvett NOACTIVATE (NA)} will inhibit the activation of the
picture screens, so you can keep on typing on your current screen.  This was a
request from Tom.

\item{$\bullet$}{\twelvett DOUBLEBUFFERING (DB)} sets a double buffering show
mode:  while a new picture is being loaded you see the old one, no Workbench
pop-up or black screens.  Eats lots of memory, too.  Again, a request from Tom.
(Note:  it's canceled if you call the file requester; if a picture requiring
Dyna-Show is encountered, the current screen will be closed, in order to get as
much free memory as possible:  you may consider using also {\twelvett
BLACKBACKGROUND} to prevent Workbench appereance.)

Centering is no longer performed via Preferences, so if you move the screen the
centering will go away.  {\twelvett NOSTARTUP} and {\twelvett BATCH} options
will be discussed later.

Now, the graphics options.  You can force all screens to be {\twelvett HIRES} or
{\twelvett LORES}, {\twelvett LACE} or {\twelvett NOLACE}, {\twelvett HAM} or
{\twelvett HALFBRITE}.  Note that if \Mostra\ finds a six bitplane picture with
no indications (no CAMG chunk), it won't set the {\twelvett HAM} flag by
default.  These flags are ``dumb,'' that is, they'll do exactly what you say,
even if it is meaningless.  However, if you use both {\twelvett HALFBRITE} and
{\twelvett HAM} together, only the former will take place.

Note that all of the options after {\twelvett QUIET} won't have any effect on
pictures shown through Dyna-Show, except for {\twelvett BLACKBACKGROUND} and
{\twelvett SECS}.

And now, some examples:

\twelvett
M MyPics:* SECS 5 FADE 1 NOMOUSE BLACKBACKGROUND REPEAT CENTER ALL

\twelverm

\noindent will generate a real (and endless!) slide show of the pictures in the
MyPics:  dir and in all its subdirs, centered and with no mouse pointer hanging
around.  In order to stop the slide show, you must press {\twelvett CTRL-C}.

\twelvett
M df0:*.image df0:pictures/*.pic HIRES LACE

\twelverm
\noindent will show the files ending with .image on the drive df0:  and the
files ending with .pic in the directory df0:pictures.  \Mostra\ will be forced
to use high resolution, interlaced screens.  Setting the {\twelvett HIRES} flag
on pictures with more than 4 bitplanes usually leads you to see absolutely
nothing.

\twelvett
M dh0:hirespic LORES NOLACE

\twelverm
\noindent will show a hi-res picture in lo-res (`zooming in').  You can move
around with the cursor keys as described above.

{\twelvett WIDTH} and {\twelvett HEIGHT} can be useful when you have a picture
that cannot be displayed because there's not enough Chip RAM (you get the
``Can't open Screen'' error message).  In such a case, try:

\twelvett
M pic WIDTH 128 HEIGHT 128

\twelverm
\noindent This will usually allow you to at least get a peek at something.


\vskip 2cm
\centerline{\big Advanced features}
\vskip 1cm


\noindent For maximum flexibility, \Mostra\ allows you to use ``startup'' files
and ``startup'' Tool Types, with which you can configure the program to suit your
tastes.

There is a standard startup file, called `S:Startup-Mostra'.  \Mostra\ will
search for it when run from CLI.  The format of this file is {\it exactly\/} the
same as the \Mostra\ line format minus the command name ({\twelvett M}).
Commands may be spread out over several lines or gathered together onto a single
line.  Every switch or keyword in the startup file will act as a default, and
will be toggled or superseded by any command line arguments.  Command line
switches will act as toggles (if your startup file has the keyword {\twelvett
ALL} and you say {\twelvett M * ALL}, you {\it won't\/} go into subdirectories),
while keywords simply assert the new value (if you have {\twelvett FADE 1} in
your startup file and you say {\twelvett FADE 3} in the command line, your
pictures will be faded at speed 3).

Two options concern startup files:

\item{$\bullet$}{\twelvett NOSTARTUP} inhibit the search for startup files,
useful if you have one of them and you want to specify your options from
scratch; it can be shortened with {\twelvett NO}.

\item{$\bullet$}{\twelvett BATCH} wants a complete path/filename that \Mostra\
will use as startup file.

From the WB side, you can write the startup options in the Tool Types of the
\Mostra\ icon, and it will use them.  The format is the same of
`Startup-Mostra'.  Please note that {\twelvett FADE=1}, {\twelvett WIDTH=352}
are valid, but {\twelvett FREEMOUSE=ON} is not; use only {\twelvett FREEMOUSE}.

Or you can set the first Tool Type of a project icon to {\twelvett STARTUP} and
put your options in the following lines; the project picture file will be shown
with those options when you double-click its icon.  You can do the same thing
with an icon that has no related file, and put some wildcards in the Tool Type.
The wildcards will then be shown with those options.  If you don't put in
wildcards, you get a ``style'' icon:  you can {\twelvett SHIFT} click some
icons, {\twelvett SHIFT} click the ``style'' icon (in {\it this\/} order) and
then {\twelvett SHIFT} double-click the \Mostra\ icon (or directly {\twelvett
SHIFT} double-click the last icon, if its default tool is \Mostra):  you will
see the selected picture files with the options specified in the style icon.
The style icon by itself will pop up the file requester.  Please note that even
an icon with wildcards can be used as a style icon because multiple selections
supersede wildcards.

I know, it seems a little twisted, but using it you'll find, instead, that it's
the way you'd think.

{\bf WARNING}:  strange interactions can take place.  If you have some picture
icons, and you {\twelvett SHIFT} click all but one of them and then you
{\twelvett SHIFT} double click the last {\it and\/} the last picture icon you
clicked had some {\twelvett STARTUP} options, you will see {\it all\/} of the
pictures with those options.  Right?

For curious/tech/interested people, here is the exact algorithm:

\item{1.} If sm\_NumArgs$>$1 (the user started \Mostra\ with al least an icon
argument), check if sm\_ArgList[1] (the first `real' argument) has Tool Types
with first Tool Type = {\twelvett STARTUP}.  If so, scan the whole Tool Types list
like a command line, accepting mixed commands on a single Tool Type as well as
separated commands in separated Tool Types.

\item{2.} If 1.\ goes wrong, check the \Mostra\ icon Tool Types, and take them as
a command line.  (Note:  {\twelvett STARTUP} is not requested.)

\item{3.} Now, if sm\_NumArgs$>$1, check every sc\_ArgList[i] with i$>$0 and if
there is a related file ({\it not\/} a .info file!) generate a list of arguments
as if the user entered them manually, {\it superseding\/} eventual
filenames/wildcards found in 1.\ and 2.


\noindent Now, examples, by means of common problems:


\item{1.} ``I have a hundred pictures on my 360M hard disk, and I've organized
them in a few groups.  How can I make simple slideshows, with each group
separate?''

Simple:  Create a project icon for each group, and add a Tool Type {\twelvett
STARTUP}.  Then add a Tool Type like {\twelvett PICS:Group1/* ALL SECS 5 CENTER}
to choose your options, set the default tool to {\twelvett C:M} (or wherever you
put it) and double-click (of course, this must be done with every group icon).
Don't give the icons the same name as a directory, or \Mostra\ will collapse in
confusion.


\item{2.} ``I want to always see the black screen when I start from WB.''

Set a \Mostra\ Tool Type to {\twelvett BLACKBACKGROUND}.


\item{3.} ``I have some pictures.  Sometimes I want to see a few of them with a
full screen and no mouse, sometimes with a 128$\times$128 screen, sometimes
centered.''

Create three ``style'' icons.  Each icon must have as its first Tool Type
{\twelvett STARTUP}, and the following ones must be something like {\twelvett
NOMOUSE}, {\twelvett WIDTH 128 HEIGHT 128} and {\twelvett CENTER}.  The default
tool must be {\twelvett C:M}.  When you want to see in a certain style,
{\twelvett SHIFT} click the picture icons and {\it then\/} {\twelvett SHIFT}
double-click the style icon you desire.


\item{4.} ``I like to click my pics one at a time, each one with different
options.  I'd like also to see them in irregular groups, each picture with its
options.''

You need a psycho-analyst, not \Mostra.


\vskip 2cm
\centerline{\big Credits}
\vskip 1cm

I am proud to announce that \Mostra\ worked perfectly with .LBM files from an
MS-DOS game, loaded directly from the original disk (via CrossDos, of course).

I wish to thank some people, first of all the ARP team for the arp.library and
John Toebes at Lattice for the best Amiga C.  Speed and compactness of \Mostra\
come from the fabulous 5.04 release.  Dulcis in fundo (I like {\it so\/} much
the Latin!) thanks to Luca Spada (the SkyLink SysOp) for his enthusiasm about my
previous Show program; he persuaded me to create \Mostra\ 1.0.

Also I would thank all of the BIXens that encouraged me someway or helped me to
find bugs.  Great help with SHAM came from Warren Block and Jamie Purdon
(something still has to be fixed$\ldots$).  The new centering code comes from an
example by Willy Langeveld.  Erik Quackenbush made me aware of a big bug.  Dan
Ten Ton suggested the new name (don't wonder, he knows the Italian!) but the
pointer came also from Dave Quick (only, he doesn't know the Italian$\ldots$).
Wes Howe pushed me to improve the diagnostics.  Tom Rokicki, Roger Uzun, Dan,
Warren and Luca helped me to beta-test and they suggested new options.  Warren
also checked the docs.  Keith Hopkins gave me the icon.  Finally, Tom sent me
the greatest compliments {\twelvett 8-)}.  Etc.\ etc., I surely missed
someone$\ldots$ it's the {\it best\/} programming environment in the world!

If you find any bugs please write me or leave me a message at BIX.

This software is not public domain.  It is shareware:  you should send me \$20
(or more, why not?) if you find it useful (BIXfriends are of course free).
Please don't send checks drawn on a US bank, they're almost impossible to cash.
I'd prefer postal money orders, currency or checks drawn on an italian bank.

If you're reading this, you probably have access to a \TeX\ system.  Anyway, if
you spent a good part of your time preparing and printing documents, I'd suggest
you to take a look at Amiga\TeX, a wonderful package from Radical Eye Software.

This software is provided ``AS IS'' without warranty of any kind, either
expressed or implied.  By using \Mostra, you agree to accept the entire risk as
to the quality and performance of the program.  Any liability will be limited
exclusively to product replacement.  \Mostra\ is freely distributable as long as
all of its files are included in their original form without additions,
deletions, or modifications of any kind.  (I {\it hate\/} all of this legal
stuff, but one never knows$\ldots$)

Dyna-Show {\copyright} 1990 NewTek is a show program that features Dynamic modes display.

I hope \Mostra\ will help you to enjoy your Amiga even more (if possible).

\vskip 3cm
{\obeylines\parskip=0pt
Sebastiano Vigna
BIX: svigna
Via Valparaiso, 18
20144 MILANO Italia
}
\bye
