				Slide Show Screen Saver Development Log
							by John Walker
						http://www.fourmilab.ch/

22nd July 1998

Initial release.  For historical reasons, the initial release was
designated version 1.1.

29th January 1999

Incorporated the most recent version of Scream Saver (screamsv.h and
screamsv.c).  This version, included with the Terranova screen saver
fixes several Bounds Checker natters but is functionally the same.

Changed version in Settings dialogue to 1.2 and date to January 1999.

The day of the week wasn't being shown in the date and time display
due to updviewfrom() in paintscr.c failing to set the tm_wday
field in the tm structure.  I added a jwday() function in
julian.c to obtain the day of the week for a Julian day and
added code to updviewfrom() to set tm_wday.

Grey scale JPEG images failed to display correctly because the
code which expands them to DIB format in loadjpeg.c did not
account for the fact that they contain only one colour
component byte per pixel.  I modified the code to check
num_components and expand accordingly.

30th January 1999

If palette mapping was requested, grey scale images caused
page faults when attempting to access the colour map tables
for 3-component RGB.  Changed loadjpeg.c to access a single
component grey scale table if the image is grey scale.

Modified loadgif.c so GIF89a images with a transparent
palette entry are displayed with transparent pixels set to
black.  Previously they displayed using whatever colour appeared
in the transparent palette entry slot.

Added a check box to the configuration dialogue which
permits hiding the file type.  Folks who like long titles
for slides needn't see the .jpg, .png, etc. if they
don't wish to.

Release 1.2.

25 February 2003

Built with Visual Studio .NET after the usual struggle with "library is corrupt"
due, as far as I can tell, to libcd.lib being included in the link, and battle
with name changes of system libraries.  Both Debug and Release configurations now
build, but I have not at all reviewed the options they're using.

Integrated Bob Elman's fix to Loadimg.c which corrects JPEG files not being
identified due to a too stringent test of the magic header sequence.

Integrated Bob Elman's fix to startSound() in Scrnwind.c to quote the names
of sound files passed to mciSendString().  Without quotes, sound file names
with embedded spaces will not play.

After figuring out, thanks to Google (no thanks to Microsoft's own documentation),
that the magical MCI "open" type for an MP3 audio file is "MPEGvideo" (why
couldn't I have guessed that?), I added code to Filelist.c to recognise
.MP3 files as audio files and Scrnwind.c to play them.  In the process, I
made it easier to add additional audio file types to startSound() in Scrnwind.c
when the time inevitably comes to do so.

Got rid of the "ver.h" file include which caused the resource file compilation
to fail.  It took a while to figure out where it was coming from--I'd delete
it from Scrnsave.rc and every time I modified something with the resource
editor it would come right back.  To change resource includes you have to
right click on the resource folder in the Resource View, select Resource
Includes, then edit the list of files.

Changed the version number to 1.3 in the configuration dialogue and the
VS_VERSION_INFO resource.

Fixed a truncation in the DLG_CREDITS dialogue due to changes in default
font since it was last tested.

Integrated Zlib 1.1.4, replacing the earlier 1.1.3 version used by Libpbg.

Integrated Libpng 1.2.5, replacing the 1.0.2 release used before.

Integrated JPEG library version 6b, using Bob Elman's modified include
files for the Slidescr directory, with a change to the declaration of the
J_boolean type in Slidescr\jconfig.h to preserve source compatibility
with the original distribution source in the Jpeg directory.  This
corrected the "Benign type conversion" warning produced by Slidescr\jmorecfg.h
in the previous version.

Updated makesrc.bat in the root directory to exclude intermediate files
used by Visual Studio .NET and to include itself in the archive.

26 February 2003

The tacky scheme paintDate() used to attempt to keep shorter strings
from leaving the remains of longer strings on the screen (for example, when
showing file names and the current name is shorter than the last, or at
the end of a sound file), namely affixing a bunch of spaces to the start
and end of the centred strings, did not work if the difference in the
widths of the old and new string was sufficiently great.  I modified it,
and the ssavetime() function in Util.c which it calls, to erase the
a line as high as the former text across the entire screen width before
painting the new text.

Updated copyright notices in the Credits dialogue to reflect the current
versions of the graphics library packages.

Added scrnsave.lib and comctl32.lib to the linker inputs to enable build
without SCREAM_SAVER defined.  They had been removed when fighting with
the "Library is corrupted" nightmare after first moving to .NET.

Release 1.3.

28 February 2003

Changed the version number to 1.4 in the configuration dialogue and the
VS_VERSION_INFO resource.

Converted all files in the Slidescr directory to C++ (.cpp)
as this is required to interface with the COM horrors which
underlie the Internet URL file access mechanisms.

Added the ability, if INTERNET_FILES is defined in Screensv.h, to include
.url links in slide directories, which access files across the Web.
At the moment this is implemented only in Filelist.cpp, and just
includes the URLs in the file list; it does not actually retrieve them
when they come up to be the current image or sound track.  

25 July 2006

Modified the definition of fileListItem in Screensv.h to include a dummy
byte in the filename field to avoid a bullshit warning in the latest
iteration of Monkey C.

Modified the fileListShuffleImages and fileListShuffleSounds functions
in Filelist.cpp to remove a bias toward lower-numbered images due to
choosing the image to swap by taking a large (31 bit) pseudorandom
variate modulo the number of files to be swapped.  As Niels Ferguson and 
Bruce Schneier observe in section 10.8 of "Practical Cryptography"
(ISBN 0-471-22357-3), this creates a bias toward choosing the first
items in the list, the magnitude of which depends upon the difference
between the number of list items and the next greater power of two.
I rewrote the code to use the "try, try, again" algorithm recommended in
this section to generate the selection values for the Moses/Oakford/Durstenfeld
algorithm used to shuffle the items in the list (this is Algorithm P in
section 3.4.2 of Knuth's "Seminumerical Algorithms").

Modified the settings load and save code in Scrnsave.cpp to store
the setting in the registry under HKEY_CURRENT_USER, allowing
each user on a machine to have their own settings and users
without administrator privilege to save their settings.

Added support in Paintscr.cpp for Internet URL links.  If a file
has been flagged in FileList.cpp as being an Internet link,
needImageBitmap calls the new function loadInternetFile, which
downloads the file into a local temporary file and returns
its FILE pointer.  This is than passed to loadImage as usual,
and when the image has been loaded into memory as a bitmap,
the temporary file is deleted.  Since loadImage determines the
image format by examining the "magic" bytes at the start of
the file, the extension (or absence of one) in the Internet link
URL is irrelevant.  If the URL cannot be accessed or something
goes wrong whilst downloading it, the mishap is treated precisely
like the failure to open an image file in the file list (for
example, because somebody deleted it from the directory after we
prepared the list).

26 July 2006

After further reflection, I changed the way Internet shortcut URLs
are handled in Filelist.cpp.  Instead of replacing the file name
in the item, they are now stored in a new iURL string pointer
field in the fileListItem structure (which, if non-null, is released
when fileListDestroy is called.  This allows Internet shortcuts to be
sorted by name for alphabetical display and, even more importantly,
specify their target file type by its extension even if the URL used
to retrieve it does not include that extension.  For example, you
can create a shortcut named "EarthWeatherDaySide.gif.url" which links
to:
    http://www.fourmilab.ch/cgi-bin/uncgi/Earth?img=cloudy.bmp&opt=-s&date=0&dynimg=1
This will be sorted by the name of its shortcut, and the file
type determined by the .gif in the shortcut name even though it
appears nowhere in the URL.  To support this, fileListBuild trims
the .url extension from Internet links and re-classifies them with
fileListFilter, OR-ing 0x80 with the file type it determines to
indicate this is an Internet 

Added code in Scrnwind.cpp to support playing sound files from
Internet shortcuts (if INTERNET_FILES is defined).  If a file has
been flagged by Filelist.cpp as being an Internet shortcut,
startSound calls the new function fetchInternetSoundFile to
download the sound to a local temporary file, which is used on
the mciSendString command to play the sound.  As soon as the file
is passed to MCI, it is deleted, which should cause it to go
away after it's done playing.

Modified ssavetime in Util.cpp to remove both the .url file type
and the preceding file type of the target of the link for Internet
shortcuts.  For example "ArgleBargle.jpg.url" will display as
"ArgleBargle" is showFileType is FALSE.

Eliminated legacy calls on GlobalAlloc and GlobalFree throughout;
deleted the work-around definitions for them in Screensv.c.

27 July 2006

Added an "Ignore Internet shortcut links" check box in the configuration
dialogue and code in Filelist.c which discards all *.url files if it
is checked.  This allows users who are running offline to easily
suppress attempts to retrieve Internet resources by the screen
saver.  If set, fileListBuild in Filelist.c excludes all Internet shortcuts
from its list of image and sound files.

What the heck--there's enough pain in this release to call it 2.0, so I
changed everything accordingly.

Here are some dynamic URLs to link to for testing:
	EarthFromSun.jpg.url		http://www.fourmilab.ch/cgi-bin/uncgi/Earth?img=learth.evif&imgsize=640&dynimg=y&opt=-s&date=0&client=SlideShow
	MoonFromEarth.jpg.url		http://www.fourmilab.ch/cgi-bin/uncgi/Earth?img=MoonTopo.evif&imgsize=640&dynimg=y&opt=-m&date=0&client=SlideShow
	SunFromEarth.gif.url		http://sohowww.nascom.nasa.gov/data/realtime/eit_304/512/latest.gif
	EasternHemisphere.jpg.url	http://www.ssec.wisc.edu/data/geo/met8/latest_met8_10_fd.jpg
	WesternHemisphere.jpg.url	http://www.ssec.wisc.edu/data/geo/east/latest_east_ir4_fd.jpg
	UniversalTime.wav.url		http://www.fourmilab.ch/cgi-bin/SayTime
	JulianDay.wav.url			http://www.fourmilab.ch/cgi-bin/SayJulian
	StockIndices.wav.url		http://www.fourmilab.ch/cgi-bin/SayQuote?=^DJI(Dow),=^GSPC(S and P),=^IXIC(Nasdaq)

Changed the file type determination logic for URL links so that if fileListFilter
in Filelist.cpp cannot determine the file type from the extension of what
remains after ".url" is trimmed from the file name, it assumes the
file is an image.  Most people are going to want to link to dynamic
images, not sounds, and this allows them to omit an explicit file type.
Since we always determine the type of an image from its magic bytes,
simply knowing it an image suffices.  For sounds, however, we need to know
the type to choose the MCI command to play the sound, so it's reasonable
to ask the user to include the type in Internet audio file links.  Note
that this determination is based on the shortcut name, *not* that of the
URL it links to, so we have no problems with URLs which do not specify the
type of the content they return.
	
Modified startSound in Scrnwind.cpp so that if fetchInternetSoundFile fails
the Internet sound is ignored and the next sound from the list scheduled to
play on the next tick.

Changed the default path for the slides on an initial configuration to
"C:\My Documents\My Pictures".

Added code to fileListBuild in Filelist.cpp to use InternetGetConnectedState()
to determine if the machine is actually connected to the Internet at the
moment.  If not, all URL links are ignored, just as if ignoreInternetShortcuts
were set.  This handles the case of a laptop where the user has permanent
connectivity at home base but which is disconnected on the road.  It may
also keep some ISP's automatic dialer from being activated when we
try to open the Internet for a URL link.

28 July 2006

Updated LibPNG to version 1.2.12 and Zlib to 1.2.3.  These are the current
versions and are reputed to be faster than earlier releases.  More
importantly, they contain fixes for several security problems which could
be explited by deliberately malformed image files.  In both cases I upgraded
by renaming the package directory to OLD_xxxx, creating a new empty package
directory, then extracting the Zipped (MS-DOS CR/LF EOL) version of the
package into it.  I then copied over the xxxx.vcproj file from the OLD_xxxx
directory and attempted to build.  With Zlib, some file names had changed
and new files added, so I had to remove the now-missing files and add the
new ones before it would build OK.  With LibPNG, it built the first time.
(All of this is only in Debug mode at the present; we shall see how things
go when it's time to build a Release edition.

Rewrote retrieval of Internet shortcut files in Paintscr.cpp
(loadInternetFile) and Scrnwind.cpp (fetchInternetSoundFile) to call
the high-level URLDownloadToCacheFile API function rather than doing
it the hard way with InternetOpenUrl and its friends.  (Why didn't I
do it that way at the outset?  Because none of the documents I
consulted on how to go about such things even mentioned
URLDownloadToCacheFile.  You'd think that the MSDN page for
InternetOpenUrl would refer users looking for a simpler solution to
that API call, but then it wouldn't be Microsoft if they did.) 
Anyway, pending further testing, from now on we simply download image
and audio files to the local Internet cache and rely upon the embedded
Internet Exploder functionality to get rid of them when the cache
reaches its configured limit.  This means that repeated retrievals of
unchanging documents should be served from the cache, without hitting
the site of origin.

29 July 2006

Got rid of some legacy FAR declarations in Screensv.h and Julian.cpp.

Rebuilt with INTERNET_FILES_DEBUG undefined to make sure everything
was OK, and then built a Release configuration.  Amazingly, this worked
the first time.

Updated copyright dates for Zlib and Libpng in the Credits dialogue
to reflect the updated packages.

The "Internet help" buttons in the settings dialogue procedure in
Scrnsave.cpp did not work when I tested them on Ovni--they did nothing
and the call on the (grotesquely complicated) HlinkSimpleNavigateToString
function returned the ever-helpful status code "E_FAIL".  It turns out that
if you have configured a browser other than Exploder as your default, this
function will silently fail for you; can you say "torpedo the competition"?
For testing, I made Exploder the default, and the buttons duly worked.  In
the process, I replaced HlinkSimpleNavigateToString with HlinkNavigateString
which is, of course, actually the simple form of this API call.

Modified slidescr/Makezip.bat and Makesrc.bat to put the zipped files into
a Zips directory in the project parent directory.  Tested both binary and
source zip creation, as well as a complete re-build from the source
distribution.

Moved two variable declarations outside the #ifdef on INTERNET_FILES in
startSound in Screenwind.c to avoid undefined symbols when building the
non-Internet version.

Built and tested the non-Internet version, confirming that the new
"Ignore Internet shortcut links" check box is hidden in that configuration.

Release 2.0.
