Fix buffer overflow in parser

When a line ended with a comment, the parser had to read a line ahead
to check if there was a PGNresult following, without being able to
throw away the previous line yet. This could lead to buffer overflow
in a long game where every line ended in a comment. The buffer now is
cleansed of already parsed data when starting on a new syntactical unit.
Fix adjudication of Giveaway stalemates

The case where the side-to-move would win by stalemate was not treated
in the Adjudicate switch.
Fix node count range

The node count was still clipped to 32 bit because one of the structs
it passes through (FrontEndProgramStats) had the nodes field declared
as an unsigned long.
WinBoard multi-monitor support

A patch provided by Tim Kosse
Repair XBoard from node-count patch

u64 was #defined in backend.h, which unfortunately was almost alwats
(Not sure why WinBoard did not suffer from this!) This, and related
definitions have now been moved to common.h (which is always #included
first).
Repair FRC A-side castling legality testing

XBoard allowed A-side castling when a rook started on the a-file,
and the b-file was blocked.
Allow castling and e.p. to be edited in opening book
Remove width limiting of shuffle checkbox
Widen Xaw text entries for larger square sizes

Presumably people will use larger fonts if they use larger board squares.
(And in any case te default fonts would be larger.) This means they need
more space to see what is the current value of text options.
Fix Xaw file-browser New Directory

Prevent people from using the error messages that will be printed here
as directory name by pressing New Directory a second time after first
pressing it with an empty or existing name.
Fix packing of FRC castlings

The routine for packing moves to the internal database format was not
working for FRC castlings, totally messing up position search for FRC
and CRC.
Make filler variant button inactive
Fix sorting of lines in Engine Output

Lines tat were fail-lows or fail-ighs should get the scores on the basis
of wich they are sorted corrected to that of te line (for the same move)
superceding them, so that other moves can rise to above them, when they
score higher than the corrected score.
Cure weirdness when dragging outside of board

Dragging outside the board (when people maximized the window) did not
properly restore background, (leaving a trail of dragged piece). Filling
the canvas with white when it is creatd cured this. The problem most likely
was that unitialized cairo surfaces had transparancy, and writing back
transparancy doesn't helpmuch to erase things.
Put some OSX code into gtk version

Under control of #ifdef OSX code is added to integrate the GTK front-end
into OS X. This involves moving the menu bar to outside the window, and
catching the signal that OS X sends to running applications when opening
another instance was requested. Som files are renamed to conform to the
file tree of the OS X App package.
Remove use of strndup

The use of strndup was actually unsafe, as the length was passed using
an ordinary strlen. strndup was not availableon OS X 10.6, and is now
replaced by an ordinary strdup, which should be save enough.
Activate ManProc in GTK
Expand ~~/ to bundle path (OSX)

DATADIR is #defined in WinBoard as "~~" to make the expansion a no-op
there. Same for Linux compiles. For OS X it is #defined as a variable,
obtained from GTK-OSX at startup.
Use __APPLE__ compile switch for OS X

It seems that on Apple machines the compiler will always define the
symbol __APPLE__, so this is now used instead of OSX, which had to
be defined with a -DOSX compiler flag. The gtkmacintegration header
is now using <> in stead of "" in its #include. (Strange enough both
were working.)
Make building of Windows .hlp file optional

By using && and || operators in the build recipe, the building of WinBoard
with Cygwin is now not aborted whe the Help Compiler is not installed.