Split back-endish part off drawing code and move to board.c
Split DrawSquare in front-end and back-end part
Back-endize DrawHighlights and DrawPosition
The already existing wrapper FlashDelay is used as a kludge to do an XSync.
We now pass a code for the line color GC to the highight routine. New
wrappers are DrawGrid() and DrawBorder().
Back-endize atomic explosions
Back-endize DrawArrow and DrawDragPiece
DrawDragPiece now calls DrawOneSquare with argument EmptySquare in stead
of the X-type referring BlankSquare. A new wrapper DrawPolygon fixes
DrawArrowBetweenPoints.
Move board-drawing logic to new file board.c
All X-independent drawing logic (board, squares, arrows, highlights,
some animation stuff) has been extracted from xboard.c, and moved to
a new file board.c, which is back-end (but unshared with WinBoard).
A new header board.h defines the cross-references (which of course
required some functions to be no longer declared as static).
A bit of code was moved from DragPieceBegin to BeginAnimation, which
now has an extra argument to indicate which piece should appear from
under a dragged piece. This makes DragPieceBegin free of XCopyArea calls,
so it could be moved too.
Make board.c truly back-end
Get rid of all X data types. For this the AnimState struct had to be
redefined: the GC and Pixmap was taken out and put in front-end arrays
indexed by anim agent (game and player). For this indexing a new enum
was defined. The XPoint type was also replaced by our own type of an
int pair (which is nasty, because the int size could be different).
Move more animation code to board.c