Fix pointer initialization to prevent NULL events.

Moved call to initEventq() into InitInputDevice() to prevent NULL events from being passed in.  The surrounding IFDEF explains why Red Hat BZ bug #820443 just went away, EL6 bumped the version of xorg-x11-server-source to 1.13 at EL6.4.
Handle PrintScreen and SysReq on Windows

This key requires a bit extra care on Windows. We get wildly
different messages depending on if Alt is pressed or not. The symbol
chosen now follows the standard behaviour on X11.
Merge pull request #42 from bphinz/buildfixes

Fix pointer initialization to prevent NULL events.
Use constants for the test buffer dimensions
Make sure stride handling is also tested
Wrong padding size calculated (copy-paste error)
Merge branch 'jpeg16' of https://github.com/CendioOssman/tigervnc
Remove unused assert.h include
Make sure we check failed memory allocations
Use the same style for exception messages
Use exceptions rather than asserts for for "normal" errors

Although these are rare, they are still not indicative of bugs so
an exception (which ends up in the log and might also be shown to
the user) is more appropriate than an assert. Asserts should only
be used to catch blatant API misuse and similar.
Merge branch 'assert' of https://github.com/CendioOssman/tigervnc
Don't use MIT-SHM on remote displays.

When run from within 'ssh -X' or 'ssh -Y', MIT-SHM will appear to be
available even though it won't work: the shared memory will be on the
machine running vncviewer, not on the machine running the X server it
displays to. Depending on what shm segments are available on the
machine running the X server, the failure may not be apparent when
checking that MIT-SHM works.

Avoid this by not using MIT-SHM when XDisplayName() indicates we may
not be running locally.

Original bug report:
  https://bugzilla.redhat.com/show_bug.cgi?id=1072733
Clean up GnuTLS linking and instructions

GnuTLS can have different crypto backends, and it is rarely gcrypt
these days. So we should not be including that unconditionally,
and should not be pointing people at it either. Also remove the
section about Win32 binaries as those are out of date and probably
insecure. Lastly remove the section about static builds as it is
a general issue and in no way complete with just the GnuTLS portions.
Remove libjpeg-turbo build instructions

There is nothing special about this library that warrants special
treatment.
Check the return value from XShmAttach.
Link basic X11 libraries last

The extension libraries might depend on libXext or libX11, so
make sure they come last on the link line.
Move ws2_32 dependency to the correct place

It is rdr and network that needs it, not vncviewer.
Add Carbon and Cocoa dependencies to vncviewer

We use both frameworks directly from vncviewer so we should
make sure they get pulled in.
Extend "static" build option

Try to link as much as possible statically in an effort to produce
binaries that can be run everywhere.