xboard.git
8 years agoFix spurious clearing of Engine Output during PV walk
H.G.Muller [Sun, 6 Mar 2016 22:52:06 +0000]
Fix spurious clearing of Engine Output during PV walk

Due to messing with forwardMostMove during PV walking the Engine Output
panes couldbe cleared when a new PV arrived.

8 years agoPrevent out-of-turn grabbing of piece in analysis mode
H.G.Muller [Sun, 6 Mar 2016 22:45:54 +0000]
Prevent out-of-turn grabbing of piece in analysis mode

In Analyze modeit was possible to grab pieces for dragging of the side
that did not have the move.

8 years agoFix parent dialog of Error Popup
H.G.Muller [Sat, 5 Mar 2016 21:59:14 +0000]
Fix parent dialog of Error Popup

If the parent dialog of the Error Popup is wrong, the OK button in it
will not manage to pop it down. Migrating the Tourney Options to their
own DialogClass had changed testing for a parent other than the board
window from TransientDlg to MasterDlg, but Toerney Options was not the
only such dialog throwing up errors. (E.g. New Variant coulddo it too.)
So we now test if MasterDlg or TransientDlg is up, and use those as
parent if they are.

8 years agoBeef up variant detection in New Variant dialog WB
H.G.Muller [Sat, 5 Mar 2016 21:42:33 +0000]
Beef up variant detection in New Variant dialog WB

In WinBoard the enabling of radio buttons was still done when the
variant nameon the button was a sub-string of the variants feature,
without requiring a match of the full name (so that 'grande-acedrex'
would enable the 'grand' button of Grand Chess).

8 years agoFix crash in New Variant dialog Xaw
H.G.Muller [Sat, 5 Mar 2016 21:33:07 +0000]
Fix crash in New Variant dialog Xaw

The earlier patch to beef up variant recognition couldnot handle it
that some buttons has -1 as variant value.

8 years agoRemove warning from About box against GTK build
H.G.Muller [Sat, 5 Mar 2016 08:02:11 +0000]
Remove warning from About box against GTK build

It was still mentioned that the GTK build is unstable.

8 years agoSuppress underscores in Xaw menus
H.G.Muller [Thu, 3 Mar 2016 10:11:07 +0000]
Suppress underscores in Xaw menus

The underscores that indicate shortcut keys in GTK menu items were
showing up in the Xaw menus. Now we remove them when creating the menu
button.

8 years agoFix another Xaw compile error
H.G.Muller [Thu, 3 Mar 2016 09:40:17 +0000]
Fix another Xaw compile error

This is what you get when changing code without testing if it at least
compiles...

8 years agoSilence warning
H.G.Muller [Wed, 2 Mar 2016 22:42:43 +0000]
Silence warning

Conversion to use of strncpy had led to the length of a (char*) being
tested, and atypically we got away with that so far because the copied
string was only 2 characters long. Now we use length limit 4, which also
renders the use of strncpy instead of strcpy useless, but at least
does notproduce a warning.

8 years agoFix recognition of title in small layout
H.G.Muller [Wed, 2 Mar 2016 22:39:37 +0000]
Fix recognition of title in small layout

The title handle was set based on invalidation of Options by making
their type -1, while this nowadays is done by setting them to Skip
(as enum types are unsigned).

8 years agoFix compile error in SetComboChoice Xaw
H.G.Muller [Wed, 2 Mar 2016 22:27:59 +0000]
Fix compile error in SetComboChoice Xaw

8 years agoFix crash on changing piece directory
H.G.Muller [Wed, 2 Mar 2016 14:18:58 +0000]
Fix crash on changing piece directory

The loop for deleting the old pieces in ActivateTheme was still assuming
the four promo-Golds were stored behind the normal set, which for the
new piece ordering isn't the case anymore.

8 years agoFix black border around saved diagrams (WB)
H.G.Muller [Wed, 2 Mar 2016 10:14:36 +0000]
Fix black border around saved diagrams (WB)

The 'Save as Diagram' function of WinBoard produced bitmaps with a black
border, because the buffer bitmap used for drawing the board (which was
flushed to file to create the diagram) had a size larger than the board,
including somemargins of the main window. Now we copy it to a board-sized
bitmap first, and flush that.

8 years agoPreserve flip on pasting game when auto-flipView is off
H.G.Muller [Tue, 1 Mar 2016 20:09:49 +0000]
Preserve flip on pasting game when auto-flipView is off

Normally starting a new game would restore the orientation as given by
the -flipView option on the command line, which might flip the view even
when -autoFlipView is off. A new game started through Paste Game now
always preserves the current orientation when -autoFlipView is off.

8 years agoDescribe engine grouping in texi file
H.G.Muller [Tue, 1 Mar 2016 19:39:55 +0000]
Describe engine grouping in texi file

The paragraph on the Edit Engine List menu item now contains a description
of the method for organizing engines in groups by adding "# GROUP" and
"# end" lines.

8 years agoAdd 'divide by 60' checkbox in Time Control dialog XB
H.G.Muller [Tue, 1 Mar 2016 09:35:11 +0000]
Add 'divide by 60' checkbox in Time Control dialog XB

The TC could not be set to fractional minutes (base time) or seconds
(increment) in the GTK version, as the spin controls there do not allow
you to type such numbers. An added checkbox 'Divide entered times by 60'
allows you to enter base time in seconds, and increment in 1/60 sec.
The dialog always pops upwith this checkbox unticked.

8 years agoMerge branch 'v4.8.x'
Arun Persaud [Sun, 6 Mar 2016 00:32:37 +0000]
Merge branch 'v4.8.x'

8 years agoupdated copyright for 2016
Arun Persaud [Sun, 6 Mar 2016 00:30:45 +0000]
updated copyright for 2016

8 years agoMerge branch 'v4.8.x'
Arun Persaud [Sat, 5 Mar 2016 21:04:43 +0000]
Merge branch 'v4.8.x'

8 years agofixed configure script: GTK default was enabled even with --with-Xaw
Arun Persaud [Sat, 5 Mar 2016 21:03:04 +0000]
fixed configure script: GTK default was enabled even with --with-Xaw

8 years agoupdate Russian translation
Arun Persaud [Tue, 27 Oct 2015 06:08:31 +0000]
update Russian translation

8 years agoPrint score with same sign in message and engine output
H.G.Muller [Mon, 29 Feb 2016 21:54:44 +0000]
Print score with same sign in message and engine output

There are two options that affect the score POV (always or analysis only),
but they were only working on the score in the Engine Output window, and
not in the message field of the board window. Now they work for both.

8 years agoFix bugs in previous 3 commits
H.G.Muller [Mon, 29 Feb 2016 21:24:31 +0000]
Fix bugs in previous 3 commits

The commits before this were pushed a bit prematurely, inspired by
the wish tosee if I could push from my new laptop.

8 years agoAdd configure-options section to texi file
H.G.Muller [Mon, 29 Feb 2016 13:24:11 +0000]
Add configure-options section to texi file

The options data, saveDate, addMasterOption, installEngine, installTheme
and autoClose are now described in the manual.

8 years agoUpdate texi file
H.G.Muller [Mon, 29 Feb 2016 12:15:47 +0000]
Update texi file

8 years agoAdd -installTheme option
H.G.Muller [Mon, 29 Feb 2016 11:53:57 +0000]
Add -installTheme option

A new option of type ArgInstall is added, which will add its argument
to the -themeNames list (under the usual restriction it is not already
in there, and that it was not seen before). By appending such a (time-
stamped) option to the master settings file with -addMasterOption,
newly installed themes can be made to trickle their way into the user's
private settings file. All the theme package has to is call XBoard with
the applicable -addMasterOption "-installTheme ...." arguments in its
install script, and copy any associated files to XBoard's datadir.

8 years agoFix disappearance of premoved piece
H.G.Muller [Sun, 28 Feb 2016 11:01:40 +0000]
Fix disappearance of premoved piece

When a premove was done by dragging, (which for expected recaptures would
be the only way, as click-click moving selects the intended target),
the moved piece would disappear from view. This because the from-square
would not be redrawn (in normal move execution it would remain empty).
This could have been an XBoard-only problem. In any case We now force a
complete redraw of the board, which is not very elegant, but should always
fix it.

8 years agoFix bug #43792 (no highlights after rejection of premove)
H.G.Muller [Sun, 28 Feb 2016 10:34:52 +0000]
Fix bug #43792 (no highlights after rejection of premove)

If the sending of a premove fails to add a move to the game, because
XBoard itself judges the move illegal (which could only be determined
after arrival of the opponent move, not when it was entered), XBoard
now re-applies the move highlights for that opponent move.
 This does not solve the problem yet with legality testing off,
when it later turns out the ICS rejects the move.

8 years agoFix bug #45599 (inclusion of keysym.h in Xaw)
H.G.Muller [Sat, 27 Feb 2016 20:59:52 +0000]
Fix bug #45599 (inclusion of keysym.h in Xaw)

8 years agoFix bug #45773 (needless #inclusion of cairo-xlib.h)
H.G.Muller [Sat, 27 Feb 2016 19:50:27 +0000]
Fix bug #45773 (needless #inclusion of cairo-xlib.h)

As this header no longer exists this was causing a compilation error.
In the GTK version they are of course never needed, and the draw.c
that is also part of an Xaw build also does not call any function to
draw on an Xaw surface directly.

8 years agoFix bug #45775 (Infinite loop on nonexistent texture file)
H.G.Muller [Sat, 27 Feb 2016 19:45:01 +0000]
Fix bug #45775 (Infinite loop on nonexistent texture file)

8 years agoFix bug #45774 (GTK compile bug with ENABLE_NLS)
H.G.Muller [Sat, 27 Feb 2016 19:37:09 +0000]
Fix bug #45774 (GTK compile bug with ENABLE_NLS)

The declaration of an XFontSet function was not protected by

8 years agoMove Common Engine dialog to Engine menu (WB)
H.G.Muller [Sat, 27 Feb 2016 16:06:33 +0000]
Move Common Engine dialog to Engine menu (WB)

The item is renamed to "Common Settings", whith shortut 'C'.
The "Edit Engine List" item is also assigned a shortcut ('E').

8 years agoUse mouse wheel for selecting piece in Edit Position mode (XB)
H.G.Muller [Fri, 26 Feb 2016 22:35:39 +0000]
Use mouse wheel for selecting piece in Edit Position mode (XB)

Rather than calling ForwardEvent() and BackwardEvent() directly from the
mouse-wheel handler, we now call a backend routine Wheel(), which gets
the pointer coordinates passed to it (which we must remember during
mouse move events). This then calls the Forward/Backward event, except
in EditPosition mode, where it changes the piece in the square below the
pointer.

8 years agoAllow promotion choice in engine-defined variants
H.G.Muller [Wed, 17 Feb 2016 19:55:36 +0000]
Allow promotion choice in engine-defined variants

When variant shatranj, courier or makruk, which normally do not have
promotion choice, are used as parent for an engine-defined variant,
we now invoke the piece-selection routine. This to make these variants
also suitable as parent for variants that do have choice (e.g. to give
them the baring rule, which is unique for Shatranj).

8 years agoFix erasing of arrow highlight (XB)
H.G.Muller [Wed, 17 Feb 2016 11:47:45 +0000]
Fix erasing of arrow highlight (XB)

On large board with long-range oblique moves (like in Grande Acedrex)
the head of the arrow was not always erased (and not always drawn either).
This was partly due to the arrow pointing to a corner of the target square
even if the path was nearly orthogonal, while the damage trail is always
assumed to connect the square centers. Having the arrow point more
precisely and widening the damage trail a bit solved the problem.

8 years agoAllow promotion on two-leg move
H.G.Muller [Tue, 9 Feb 2016 09:59:31 +0000]
Allow promotion on two-leg move

After a second-leg of a SAN move the parser now checks for apromotion
suffix, and if any is found this is used by ParseOneMove / LoadGameOneMove
to set the promoChar. In converting to SAN for the parseList the promoChar
is now appended to the second leg, rather than the first, and the Edit Book
window will also show it. The promochar is written behind the kill square
in the moveList, and when sending the move there to the engine it is
appended to the second move of the multi-move pair.

8 years agoFix type-in of hit-and-run captures
H.G.Muller [Tue, 9 Feb 2016 09:25:40 +0000]
Fix type-in of hit-and-run captures

Processing of the move in ParseOneMove (which basically duplicates
the code of LoadGameOneMove) was not yet adapted to ignore ';' as a
promotion character when it is internally used to append 'kill squares'
where locust capture should take place..

8 years agoAllow setting of piece nicknames from pieceToChar string
H.G.Muller [Tue, 9 Feb 2016 08:53:44 +0000]
Allow setting of piece nicknames from pieceToChar string

A piece IDs in the pieceToChar string can now be suffixed by "=L",
with L an arbitrary single letter, to define a nickname for the piece.
Such a nickname would make it possible to specify a complex ID like +I'
as promotion choice, and by indicating this in the pieceToChar string
the engine can configure that through the 'setup' command. This facility
is needed to force promotion after capture of a contageous piece in
variants with Shogi promotion, such as Maka Dai Dai Shogi.

8 years agoSlight speedup of parsing promotion suffix
H.G.Muller [Tue, 9 Feb 2016 08:31:11 +0000]
Slight speedup of parsing promotion suffix

8 years agoFix printing of 'x' in position diagram
H.G.Muller [Mon, 8 Feb 2016 12:21:20 +0000]
Fix printing of 'x' in position diagram

The times where 'x' was used as PieceToChar result for an empty square
are long behind us; 'x' now is a valid piece ID.

8 years agoImprove variant recognition for enabling buttons (XB)
H.G.Muller [Sun, 7 Feb 2016 21:48:34 +0000]
Improve variant recognition for enabling buttons (XB)

Buttons for variants were enabled when the name of the variant they
selected was a sub-string of waht the engine could play, so that
Grand Chess (variant grand) would be enabled by Fairy-Max' grande-acedrex.
Now we test if the matched sub-string of the engine's variants feature
is immediately followed by a comma (or at the end).

8 years agoFix using VariantMen PGN tag for both colors
H.G.Muller [Sat, 6 Feb 2016 17:18:29 +0000]
Fix using VariantMen PGN tag for both colors

Black pieces were not recognized as the same as white pieces.

8 years agoAlways assume FEN in variant-fairy PGN game is initial position
H.G.Muller [Sat, 6 Feb 2016 15:19:52 +0000]
Always assume FEN in variant-fairy PGN game is initial position

As variant fairy is a catch-all without a defined initial position,
the FEN tag n a PGN game for this variant must be considered an initial
position. So we copy over the FEN position to the initial one in this
case. Otherwise castling would always be thought illegal in fairy games
loaded from PGN.

8 years agoProcess VariantMen PGN tag
H.G.Muller [Sat, 6 Feb 2016 14:12:19 +0000]
Process VariantMen PGN tag

On loading a PGN game the VariantMen tag is now parsed, and the
move definitions are assigned to the mentioned pieces.
This only works when the pieceToCharTable is defined in advance!

8 years agoLet VarianMen PGN tag work with dressed letters
H.G.Muller [Sat, 6 Feb 2016 12:46:43 +0000]
Let VarianMen PGN tag work with dressed letters

The internal 'character' codes > 127 are now printed as letter + suffix.

8 years agoRemove debug printf
H.G.Muller [Sat, 6 Feb 2016 09:25:27 +0000]
Remove debug printf

8 years agoFix spurious promotion partners
H.G.Muller [Sat, 6 Feb 2016 09:21:21 +0000]
Fix spurious promotion partners

When defining a new promotion pairing through ^L the default partners
of L and +L must be made partnerless, or they would still promote to +L
or demote to L.

8 years agoFix printing of piece ID in illegal SAN moves
H.G.Muller [Fri, 5 Feb 2016 10:26:51 +0000]
Fix printing of piece ID in illegal SAN moves

Illegal SAN moves did not add ' or ! suffixes to the piece ID,
and printed shogi-promoted pieces as a '+' without ID.

8 years agoFix clipping of GTK menu-bar labels for broad boards
H.G.Muller [Fri, 5 Feb 2016 09:06:09 +0000]
Fix clipping of GTK menu-bar labels for broad boards

The number of characters kept in the menu-bar labels was dependent on
square size, but did not take into account the number of files of the
board. So when there were more than 8 files, the label texts were often
clipped while there was in fact plenty of room to display them fully.
Now the adjustment of square size based on number of board files is done
after the other window parameters have been picked based on the window
width calculated as 8*squareSize. Only the default line gap is then
adapted to the actual square size (consistent with what is done during
user sizing of the board later).

8 years agoChange the piece order again
H.G.Muller [Thu, 4 Feb 2016 18:43:14 +0000]
Change the piece order again

The internal piece encoding is now altered such that the uninteresting
ones (promoted Shogi pieces and symmetry partners) are all at the end,
just before King. These now start with the PromoBishop. A slash in the
pieceToChar string skips to this new 'promoted series', so that strings
can be made 'future proof' (for when new pieces are added before it).
The promoted Chu pieces all get new book keys by this, but as it is
unlikely that they occurin opening lines, this was considered acceptable.
The +L, +T in Chu are now represented by Pegasus and Gnu rather than
Knight and Chancellor, but the latter two are defined as fall-backs to
remain compatible with old Chu themes.
The +N, +L, +S replacements in Shogi are now also taken from amongst the
regular pieces, rather than extra images stored beyond King.

8 years agoAdapt Chu-Shogi pieceToCharTable to new piece order
H.G.Muller [Wed, 3 Feb 2016 09:24:17 +0000]
Adapt Chu-Shogi pieceToCharTable to new piece order

8 years agoFix demoting in Edit Position mode
H.G.Muller [Wed, 3 Feb 2016 08:34:42 +0000]
Fix demoting in Edit Position mode

A click on an already selected demotable piece will now cause demotion,
rather than disappearance of that piece, similar to how clicks on a
selected promotable piece will promote it.

8 years agoClear highlights after moving piece in Edit Position
H.G.Muller [Wed, 3 Feb 2016 08:23:15 +0000]
Clear highlights after moving piece in Edit Position

When moving a piece during Edit position the from-square remained
highlighted, but the to square was not highlighted, which would
create the erroneous impression that the (now-empty) from-square
was selected (and ready to obliterate a piece on the next click).
Now this highlight is cleared. This was preferred over also highlighting
the to-square, because this is not really a move in a game.

8 years agoFix aborted detour under-promotion XB
H.G.Muller [Tue, 2 Feb 2016 18:18:13 +0000]
Fix aborted detour under-promotion XB

When a dragged Pawn was released before the promotion piece was fixed,
this would fake a release on the from-square. But the repair of animation
damage would take place on the to-square derived from the actual mouse
coordinates. When this was different from the from-square, the animation
damage (consisting of removalof the piece) would thus not be repaired
by redrawing that square, as normally (when the to-square is different)
it should remain empty. Now we mark the from-square as damaged when the
detour under-promotion changes the dragged piece.

8 years agoFix default piece in Shogi promotions
H.G.Muller [Tue, 2 Feb 2016 16:34:53 +0000]
Fix default piece in Shogi promotions

In Shogi the default should be promotion, but it was using Queen like
the other variants. As the +/= issue was decided based on comparing this
default promotion piece with the moved piece, the Lance (which internally
is represented by Queen) would by default defer. Now the up-click of
a drag-drop move (which would bypass sweep selection) sets the default
choice to the promoted partner if the pieceToCharTable specifies one.

8 years agoFix sweep promotions to Tokin
H.G.Muller [Tue, 2 Feb 2016 16:31:41 +0000]
Fix sweep promotions to Tokin

Sweep promotions of multiple pieces to Tokin were not working, because
once the promoted version was shown it would always demote to Pawn.
Now the toggle always demotes to the selected piece.

8 years agoFix setting default piece from 'choice' command
H.G.Muller [Tue, 2 Feb 2016 12:10:24 +0000]
Fix setting default piece from 'choice' command

PieceToCharwas used instead of CharToPiece. In addition it is important
to deduce the color from currentMoe rather than forwardMostMove, as
one could be entering a move in the middle of a game (e.g. when editing
or starting a variation).

8 years agoFix two compiler warnings
H.G.Muller [Tue, 2 Feb 2016 11:09:17 +0000]
Fix two compiler warnings

8 years agoAllow pieces with dressed-letter ID as promotion choice
H.G.Muller [Tue, 2 Feb 2016 08:27:34 +0000]
Allow pieces with dressed-letter ID as promotion choice

Testing for the occurrence of a piece in the promotion set specified
through the 'choice' command now takes dressing of the piece IDs into
account.

8 years agoFix castling rights
H.G.Muller [Mon, 1 Feb 2016 20:51:04 +0000]
Fix castling rights

The expansion of the number of piece types to > 64 had broken the
accounting of castling rights, because the code for NoRights is also
a piece code (as it is stored in the board), and had gotten a value
so high that it could no longer be stored as signed char. This is
solved by declaring the initialRights array as unsigned char instead.

8 years agoImplement engine-requested settings-popup WB
H.G.Muller [Mon, 1 Feb 2016 19:45:14 +0000]
Implement engine-requested settings-popup WB

8 years agoAllow O1 as Betza castling descriptor
H.G.Muller [Mon, 1 Feb 2016 16:32:05 +0000]
Allow O1 as Betza castling descriptor

The notation On is now also recognized as castling for n=1, but this
uses the same system as non-royal castling ('guarding'), which is
performed as hit-and-run capture of the Rook (or whatever you want to
castle with) while moving to the destination (one square away here).
This to avoid the ambiguity with normal King moves (which for the
guarding always existed).

8 years agoAllow engine to force popup of its settings dialog
H.G.Muller [Sun, 31 Jan 2016 23:12:41 +0000]
Allow engine to force popup of its settings dialog

An engine can now force popping up of its settings dialog by sending
'feature done=3' to the GUI. It can clear its option list (e.g. for the
purpose of resending it because of altered settings) by sending
'feature done=0'. Such resending would cause the dialog to be updated
when it was already open, or close it and pop up a new one when the
engine specifies it has to be redesigned by ending the list with
'feature done=2'.

8 years agoChange pieceToCharTable order of pieces beyond Lion
H.G.Muller [Sun, 31 Jan 2016 16:28:40 +0000]
Change pieceToCharTable order of pieces beyond Lion

The positions in the pieceToCharstring no longer correspond to internal
piece type, but are remapped such that more useful symbols reside near
the beginning. The piece types themselves could not be re-ordered,
as this would alter the calculation of the opening-book hash key.

8 years agoExpand numer of new piece types to 2 x 11
H.G.Muller [Sun, 31 Jan 2016 14:53:05 +0000]
Expand numer of new piece types to 2 x 11

The number of pieces added between basic and promoted series, and between
the latter and King is increased to 11, and they are ordered differently.
The image used for the Chu-Shogi White-Horse piece,which was a duplicat
of the Knight, is now replaced by a winged Knight.

8 years agoUse flexible promotion assignment
H.G.Muller [Sat, 30 Jan 2016 08:09:03 +0000]
Use flexible promotion assignment

The promoted partner now comes from an array, rather than by adding
a constant (11, or 27 in chu) to the base type. The array is initialized
so the first 11 pieces (the old 'base pieces') point to the second 11
(the old 'promoted series'), and the latter point back (so the array
also contains the demotions!). The pieces above 21 (= Lion) point to
themselves.
  Parsing of the pieceToChar string now considers ^, - and * prefixes
rather than independent IDs. Nevertheless it is the - and ^ that get
stored in the pieceToCharTable (the latter as '+') for the corresponding
piece. But the ID that follows them specifies what other piece they are
the demoted or promoted partner of, rather than their own ID, and is
thus used to update the promoPartner array for both of them.
  A * prefix does mean the following ID is the ID assigned to the piece,
but that the piece promotes to Tokin (if the latter is assigned a '+').
  The default pieceToChar string for varaint chu is adapted to use this
new assignment mechanism of promotion partner. (Chu is so far the only
variant that needed other pairing than the default.)

8 years agoBit more accelerator stuff
Joshua Pettus [Sat, 30 Jan 2016 04:15:28 +0000]
Bit more accelerator stuff

Bit of code didn't do what I wanted it to and took away to many 'alt'
flags

8 years agooops, accidentally added a .orig file from a patch
Joshua Pettus [Sat, 30 Jan 2016 03:01:25 +0000]
oops, accidentally added a .orig file from a patch

8 years agoChange accelerators again to be more mac like
Joshua Pettus [Sat, 30 Jan 2016 02:32:58 +0000]
Change accelerators again to be more mac like

After playing around with the beta quite a bit, it really bothered me
to have half be ‘cmd’ and half be ‘ctrl’, to the point where it almost
made me want to do away with ‘cmd’ altogether  (really non-standard on
OSX). This way is a little smarter and only changes the conflicting
accelerators to alt-cmd which while being a little more mac standard,
as well as be acceptable ascetically when combined with other
accelerators that are just cmd.

8 years agoLet PROMOTED and DEMOTED macros use argument
H.G.Muller [Fri, 29 Jan 2016 16:41:58 +0000]
Let PROMOTED and DEMOTED macros use argument

These macros were expanding to offsets added to what followed them.
Now the thing that followed them is passed to them as an argument.
This will allow them to expand the prmomotion or demotion to a table
lookup, rather than just an addition. Where PROMOTED appeared in a case
label, though, it was just a readability enhancement for the fixed
assignment, and a new macro PROMO equal to the old PROMOTED is introduced
for that.

8 years agoFix Chu promotion with added pieces
H.G.Muller [Fri, 29 Jan 2016 09:32:02 +0000]
Fix Chu promotion with added pieces

There were still some hard-coded 22s in the code, which no longer described
the difference between Pawn and Tokin and the number of promotable pieces,
now that new pieces have been added.

8 years agoRemove added pango modules to coincide with macports package
Joshua Pettus [Thu, 28 Jan 2016 22:58:00 +0000]
Remove added pango modules to coincide with macports package

Macports got rid of the +builtin_modules variant and made that the default port.  (I assume macports, maybe it was a gtk change)  This is great for installation simplicity, but messes up my build script which was set to use the former base pango install. Hopefully they stick with this.

8 years agoH.G.Muller's patch to avoid collisions with built-in OSX text
Joshua Pettus [Thu, 28 Jan 2016 22:55:56 +0000]
H.G.Muller's patch to avoid collisions with built-in OSX text
 edit accellerators

Unfortunately this means many of the menus items use the standard linux ctrl-letter style accelerators as oppose to the cmd-letter OSX style ones.  But at least we can copy, paste, and cut text into xboard dialogs as well as select all.

8 years agoH.G.Muller's patch to fix argument related spurious instances
Joshua Pettus [Thu, 28 Jan 2016 22:52:27 +0000]
H.G.Muller's patch to fix argument related spurious instances

In certain situations adding launch arguments to xboard would cause multiple xboard instances when not desired. H.G.Muller fixed this by waiting 1 second before accepting genuine user input.

8 years agoCheck for gettext before installing localization files
Joshua Pettus [Thu, 28 Jan 2016 22:50:36 +0000]
Check for gettext before installing localization files

Probably a good idea to check if gettext is enabled before attempting to install localization files.

8 years agoback to the old header names for gtkosxapplication.h
Joshua Pettus [Thu, 28 Jan 2016 22:48:04 +0000]
back to the old header names for gtkosxapplication.h

They seemed to have gone back for compatibility’s sake, hopefully they don't change it again

8 years agoFix for launching on case-sensitive systems
Joshua Pettus [Thu, 28 Jan 2016 22:43:04 +0000]
Fix for launching on case-sensitive systems

Forgot to take case-sensitive journaled systems into account…

8 years agoMake move to own piece a swap rather than capture
H.G.Muller [Thu, 28 Jan 2016 16:55:15 +0000]
Make move to own piece a swap rather than capture

This is useful for Tamerlane Chess, where you can one time during the
game have your King swap places with a friendly piece.

8 years agoImplement 'choice' engine->GUI command
H.G.Muller [Thu, 28 Jan 2016 16:32:19 +0000]
Implement 'choice' engine->GUI command

A new CECP command is implemented: With 'choice XYZ' in reply to a
'lift' or 'put' command an engine can redefine the promotion choice
of the promotion move that emitted these to X, Y or Z. (Always capitals!)
For now only affects sweep & detour promotions, not the promotion
popup.

8 years agoLet target-square highlighting prevail over legality test
H.G.Muller [Thu, 28 Jan 2016 13:08:28 +0000]
Let target-square highlighting prevail over legality test

For engine-defined variants the highlight command is accepted even
with legality testing on. If an engine explicitly marks a square as a
legal destination for the picked-up piece, XBoard now always accepts
the move, even when according to its own move generation, even when based
on the engine's supplied 'piece' commands, going there would be illegal,
and legality testing is on.

8 years agoAdd support for Multi-PV Margin
H.G.Muller [Thu, 28 Jan 2016 11:32:12 +0000]
Add support for Multi-PV Margin

An engine option with a name containing multi, PV and margin is now
recognized, and will lead to printing of a multi-PV header (during
analysis in the Engine Output pane) even in absence of a MultiPV option.
Right-clicking the part of that header between 'fewer' and 'more'
allows tuning of the option value through horizontal mouse moving.
During this tuning the value is displayed in the message field of the
main window. When there is no MultiPV option to specify the number of
PVs, the margin value will be displayed in the header instead of the
number of PVs.

8 years agoFix highlighting in text memos (GTK)
H.G.Muller [Thu, 28 Jan 2016 08:51:37 +0000]
Fix highlighting in text memos (GTK)

The yellow highlighting as used in Engine Output to indicate the
walked PV, or in Move History to show the current move, was only
working the first time that text would be highlighted. Apparently
to unhighlight it the yellow tag had to be removed, rather than a
white tag applied.

8 years agoFix pasting of moves after starting from position file
H.G.Muller [Wed, 27 Jan 2016 19:14:07 +0000]
Fix pasting of moves after starting from position file

When starting from a position file boards[0] would be set to the position,
but initialPosition was not. In LoadGame() initialPosition would then be
copied to boards[0] before loading the game, and without FEN or variant
PGN tag would not be corrected.

8 years agoMove Common Engine menu item to Engine menu
H.G.Muller [Wed, 27 Jan 2016 15:49:20 +0000]
Move Common Engine menu item to Engine menu

The new name of this menu item is 'Common Settings'.

8 years agoFix double-clicks for copying in Edit Position mode
H.G.Muller [Wed, 27 Jan 2016 15:03:04 +0000]
Fix double-clicks for copying in Edit Position mode

The time measurement between clicks on the same square in Edit Position
mode was seeing presses as well as releases, so that a fast click would
be mistaken for a double click on that square. Only presses should be
judged this way. In addition the piece should be grabbed for dragging
again on the second press, as the first release had ended the drag.

8 years agoFix book probing
H.G.Muller [Wed, 27 Jan 2016 10:22:42 +0000]
Fix book probing

The Zobrist key for Kings had been inadvertantly changed in the patch that
assigned new keys to the pieces added for Chu Shogi (the 'chu-promoted
series'), because the King would be considered as a chu-promoted piece.

8 years agoFix crash on pasting garbage FEN
H.G.Muller [Wed, 20 Jan 2016 20:30:51 +0000]
Fix crash on pasting garbage FEN

The auto-size patch had made XBoard crash-prone on pasting pure garbage
with Paste Position, because this would set the number of files or ranks
to values <= 0. Which would cause a floating pont exception during
drawing of the board in XBoard.

8 years agoPrevent changing time control during game (XB)
H.G.Muller [Wed, 20 Jan 2016 19:37:52 +0000]
Prevent changing time control during game (XB)

An attempt to pop up the Time Control Options dialog during a game
will now be met with an Error popup to say it cannot be done, like
in WinBoard. Before it would reset the game.

8 years agoFix Error popup in Tournament Options
H.G.Muller [Wed, 20 Jan 2016 19:31:34 +0000]
Fix Error popup in Tournament Options

Since Tournament Options has been assigned its own DialogClass (MasterDlg)
instead of being one of the TransientDlg, the Error popup should really
test if MasterDlg is already up, to know if its parent window is th
main window or not.

8 years agoUpdate xboard.conf with renamed xq board textures
Joshua Pettus [Sat, 16 Jan 2016 03:30:08 +0000]
Update xboard.conf with renamed xq board textures

8 years agoUpdate makefile.am for renamed xq board images
Joshua Pettus [Fri, 15 Jan 2016 19:12:23 +0000]
Update makefile.am for renamed xq board images

8 years agoChange name of xq board images to fit with handling code
Joshua Pettus [Fri, 15 Jan 2016 18:19:22 +0000]
Change name of xq board images to fit with handling code

8 years agoUse ii in Betza notation for 3rd-rank Pawn push
H.G.Muller [Thu, 14 Jan 2016 18:16:50 +0000]
Use ii in Betza notation for 3rd-rank Pawn push

The 'i' modifier specifies the move is only for virgin pieces. We now
use 'ii' to indicate a move that can be made when the piece is standing
on the square in front of that were such a piece starts in the initial
setup. This is intended for Pawns that can still be pushed extra far
after they have made a first single step, such as in Wildebeest Chess,
where pawns on 2nd rank can move 1, 2 or 3 squares ahead, and on 3rd rank
can still move 1 or 2 (fmWifmW3iifmW2).

8 years agoFix spurious undo at game start
H.G.Muller [Thu, 14 Jan 2016 15:49:34 +0000]
Fix spurious undo at game start

For ping-supporting engines the logic in handling unexpected moves
is completely changed. Such moves can occur when an engine think is
interrupted by a 'force' command, which in many engines is only
processed after the think completes naturally with a move, and could
cross such a move anyway in engines that would abort the search promptly.
If the 'force' is the result of the user switching to EditGame mode,
such a move should be undone, if it occurs at game end or start,
the moves can be ignored, as the following 'new' will erase all memory
of them. So in EditGameEvent, if the engine was thinking, a flag is set
to indicate its upcoming move should be undone, and ping is sent after
'force'. The 'pong' response would arrive after the move (if any), and
clears the flag. In all other cases of ping imbalance, incoming moves
are ignored.
 While waiting for a pong after EditGameEvent the user interface is
frozen, and a message is displayed to keep the user quiet.

8 years agoSend ping in EditGameEvent
H.G.Muller [Thu, 14 Jan 2016 13:36:47 +0000]
Send ping in EditGameEvent

An EditGameEvent can interrupt tinking of an engine, and the engine
might or might not send back a move as a result of that thinking.
To solve this, a "force" command sent to an engine playing white or
black will now be followed by a "ping". (If supported, of course.)

8 years agoFix variant recognition in ICS mode
H.G.Muller [Wed, 13 Jan 2016 21:23:55 +0000]
Fix variant recognition in ICS mode

The patch that made recognizing variant names of the 'exotic variants'
(i.e. those beyond Shogi) more strict, by requiring an exact match,
had broken variant recognition on the Variant ICS. In that case it
has to act on strings like "ICS unrated xiangqi game", and this now
defaulted to variant normal. The requirement that the variant name
should be the first word of the string is now dropped in ICS mode.

8 years agoLet FENs handle Betza initial rights in castlingless variants
H.G.Muller [Wed, 13 Jan 2016 19:35:36 +0000]
Let FENs handle Betza initial rights in castlingless variants

When a variant has no castling, or is redefined to have no castling
through a 'piece' command for the King, the FEN castling field of a
written FEN will now contain the file ID of all pieces with initial
('i') moves in their Betza definition. On reading the virginity of
pieces not thus mentioned in the castling field will get their
virginity revoked.

8 years agoFix setting of initial virginity on PGN read
H.G.Muller [Wed, 13 Jan 2016 15:07:48 +0000]
Fix setting of initial virginity on PGN read

The back-rank virginity bitmaps were not cleared in ParseFEN.

8 years agoUpdate zh_CN.po translation
Joshua Pettus [Tue, 12 Jan 2016 19:48:57 +0000]
Update zh_CN.po translation