Fix windows build breakages due to missing NAN and INFINITY.

Add some #definery for platforms where NAN and INFINITY aren't
defined in std headers.
Add option for vertical scrolling support in Android App.

A potential customer (currently a free user) contacted us asking
that MuPDF be extended to support vertical scrolling rather than
horizontal scrolling. He supplied a partially working patch.

We reviewed his patch, and found the bit he'd missed, which he added
and it now works for his purposes. We also spotted some places
where his patch is incorrect in general though (and will go wrong
for cases where PDF files have varying page sizes).

This is a commit of a correct version. ReaderView gains a
HORIZONTAL_SCROLLING boolean that is set to true currently to
maintain the normal behaviour. Change it to false and we will
scroll vertically instead.

Possibly we could add a button to allow this to be a runtime option,
but that's a future enhancement.
Update test-device to check images piecemeal.

Rather than decoding entire image only to give up after we find the
very first pixel is color, add code so that the test-device can
treat the image as a stream. This means that (for most image types
at least) we can bale out without decoding everything.

This reduces the runtime of 3001Pages.pdf from 14 minutes to 18 seconds.
Bug 695440: fix buffer underflows in load-jpeg.c

With this change, all 32-bit values read from untrusted data through
read_value are compared unmodified in order to prevent unintended
integer overflows during the comparison.
Revert part of commit 5509a4ef7520bf0b5280ce7d6af8eb15b1b8b0f1

Even though the encryption key length isn't supposed to be taken from
the encryption dictionary's /Length for crypt version 4, other readers
such as Adobe's still use that value if a crypt filter's /Length is
missing.

See https://code.google.com/p/sumatrapdf/issues/detail?id=2710 for a
document where this makes a difference (or simply remove /Length from
the crypt filter in any document encrypted with crypt version 4 and an
AESV2 crypt filter).
test-device: Abort interpretation when color found.

Add a new class of errors and use them to abort interpretation when
the test device detects a color page.
Initial commit of setup for desktop gsview application
A bit more work on gsview.  Slowly adding parts.
Some temporary changes and the addition of a library that will not be winRT based.
Additional menu items and icons
Update of a few minor project related items for gsview
Significant amount of content needed for gsview

This includes the interface to ghostscript for creating pdf files from ps
for mupdf to then render in the viewer as well as the capability to print
the output of xpswrite through the windows print queue.   Added thumb
viewing and navigation as well as navigation through the table of contents.

To do.  Add in password handling, Text Search, Hyperlinks, GS conversion to
other file formats, MuPDF save as other file formats, Page extractions,
proper page selection for printing, Zooming (rescale), Fix the page ranges
that are displayed at full resolution during navigation.
Rename of munet to mupdfnet
Addition of zoom control

Need a bit of work when window resizing occurs.
Fix zooming issues

The window resize was causing issues as this was triggering a scroll change and the
size we were rendering was tied to the window size.
Add in rescale to 1.0 with double click of mouse on page
Add in the cancel for the thumb rendering.

Also clean up a few things that result in someone canceling the thumbs.
Force clean up when document closed.
Addition of support for password files.
Add code to feed gs chunks of file enabling progress callback during distilling

Also enable Async Cancel during distilling.