xboard.git
9 years agoImprove SAN of Pawn moves and allow Betza e.p. definition
H.G.Muller [Tue, 23 Sep 2014 12:52:16 +0000]
Improve SAN of Pawn moves and allow Betza e.p. definition

The move descriptions in 'piece' commands can now use 'i' and 'n'
modifiers to define a blockable double push. ('n' only work for moves
of stride 2!) The test for initial moves now is based on comparison with
the opening position, rather than on a way-to-generous heuristic. (This
still does not prove in generak the piece did not move, though, but it
does for Pawns.) A new 'e' modifier stands for e.p. capture; to implement
this the rank and file of the e.p. square are now stored in the board.
(EP_STATUS was holding the file of the moved Pawn, which in Berolina Chess
is not the file of the e.p. square!)
 The generation of SAN moves for Pawns can now reliably distinguish between
captures and non-captures even in Berolina, when the move generator informs
it whether the move was e.p. capture.

9 years agoRetune -stickyWindows GTK
H.G.Muller [Mon, 22 Sep 2014 20:48:50 +0000]
Retune -stickyWindows GTK

This still does not work well, and in particular windows refuse to stick
to the top of the board window.

9 years agoFix detection of screen size GTK
H.G.Muller [Mon, 22 Sep 2014 19:59:00 +0000]
Fix detection of screen size GTK

A gdk call that can get the screen without there first being a window
mapped to it is used now. This fixes initial sizing of the board window
on a cold start.

9 years agoConfigure a size for the Eval Graph
H.G.Muller [Mon, 22 Sep 2014 19:57:23 +0000]
Configure a size for the Eval Graph

If no size for the Eval Graph window is configured in the master
settings file, the window will pop up as 2x4 pixels.

9 years agoPrevent crash on specifying non-existent texture XB
H.G.Muller [Mon, 22 Sep 2014 18:39:21 +0000]
Prevent crash on specifying non-existent texture XB

By setting the texture width to 0 when the texture could not be loaded,
XBoard will never attempt to draw it.

9 years agoConfigure some themes in XBoard master settings
H.G.Muller [Mon, 22 Sep 2014 18:30:50 +0000]
Configure some themes in XBoard master settings

The -themeNames option is set to contain some themes that could be
defined with the default pieces and textures that come with XBoard.

9 years agoRemove debug printf
H.G.Muller [Mon, 22 Sep 2014 16:48:00 +0000]
Remove debug printf

9 years agoControl Eval Graph with mouse
H.G.Muller [Sun, 21 Sep 2014 14:47:41 +0000]
Control Eval Graph with mouse

Let mousewheel control evalZoom, and right-click toggle between
normal view and differential view ('blunder graph').

9 years agoAdd extra font field to Option struct
H.G.Muller [Sun, 21 Sep 2014 14:10:19 +0000]
Add extra font field to Option struct

Storing the font in the textValue field was too kludgy, as this field
is already heavily used in the various Option types, for storing handles,
or defining colors and callbacks. A 'font' field is now added at the end,
so that it can be optionally initialized in the rare case it is needed.

9 years agoRepair damage done by merging with v4.7.x
H.G.Muller [Sun, 21 Sep 2014 11:44:11 +0000]
Repair damage done by merging with v4.7.x

9 years agoSort fail lows and fail highs below others
H.G.Muller [Sun, 21 Sep 2014 06:36:22 +0000]
Sort fail lows and fail highs below others

Every more recent line should always float up aove lines that were
indicated to be fail lows or fail highs through ? or ! PV suffixes.

9 years agoDescribe the new texture conventions in manual
H.G.Muller [Sat, 20 Sep 2014 10:58:32 +0000]
Describe the new texture conventions in manual

The exact rules for how textures are scaled in response to their
filename is described in the manual.

9 years agoForce exactly overlayed texture scaling through filename
H.G.Muller [Fri, 19 Sep 2014 08:22:14 +0000]
Force exactly overlayed texture scaling through filename

A filename suffix -NxM.png on a texture image will cause XBoard to scale
the image as if it were the image of a complete board of N files and M
ranks, to make the square size equal to that of the current board,
and adjust the cutting parameters such that contiguous squares are cut
out of it. (If the current board format is larger than NxM, the remaining
space will be padded with white!)
 If N=M=0, N and M are assumed to correspond to the current board size,
and the bitmap will be scaled to fit the height of the board.
 If no suffix is present, the old cut-and-tile algorithm is used. It will
be assumed the texture bitmap is intended for a single square, unless the
pathname contains a file that starts with "xq", in which case it is assumed
that the file contains a Xiangqi board.

9 years agoAllow two Pawns per file in Tori Shogi
H.G.Muller [Thu, 18 Sep 2014 21:30:09 +0000]
Allow two Pawns per file in Tori Shogi

When the board has 7 ranks it is assumed to be Tori Shogi, and the
requirement for maximally one Pawn per file is relaxed to two.

9 years agoTest legality even when off if engine defined pieces
H.G.Muller [Thu, 18 Sep 2014 21:08:36 +0000]
Test legality even when off if engine defined pieces

After reception of a piece command XBoard will mark target squares
even when legality testing is off, and now also will require the lifted
piece to land on a marked square (like when the engine highlighted them
through a highlight command).
 A problem is that this does not work for drops, as drops do not mark
target squares. So drops are always accepted. Which of course is bad
for Pawn drops. But there really is no way yet for an engine to specify
how pieces can be dropped, similar to the 'piece' command.

9 years agoFix texture scaling
H.G.Muller [Wed, 17 Sep 2014 20:32:43 +0000]
Fix texture scaling

9 years agoImplement engine-defined pieces
H.G.Muller [Wed, 17 Sep 2014 11:41:58 +0000]
Implement engine-defined pieces

When legality testing is off, XBoard now listens to 'piece' commands
to redefine its move generator. After such a piece command is received,
target-square marking also can be used when legality testing is off.
The engine keeps in charge of legality testing, though.
 Only a very basic version of Betza notation is currently understood for
the move description: mode modifiers have to appear in the order mcd,
and gpz modifiers are ignored. Multi-leg moves as in Betza 2.0 is not
implemented at all. A leading i modifier limits the moves to the first
two ranks, which is no good at all. (But XBoard does not keep track of
which pieces have moved, and this at least would work for Pawns in a
FIDE-like setup, in particular Berolina.)

9 years agoScale texture bitmaps that are not large enough
H.G.Muller [Wed, 17 Sep 2014 07:44:15 +0000]
Scale texture bitmaps that are not large enough

Texture bitmaps are now sized up by an integer factor to be at least
as large as the board (if they seem intended for a full XQ board, which is
assumed when they are larger than 256x256) or the square. This necessitated
the textures to be re-initialized in InitDrawingSizes whenever the window
size changes.

9 years agoIgnore color arguments not starting with #
H.G.Muller [Tue, 16 Sep 2014 17:04:19 +0000]
Ignore color arguments not starting with #

Old settings files from xpm-using version might still contain color
designations like 'white' or 'red'. Since Cairo would interpret these
as black, it is better to ignore them, so the default color is used.

9 years agoImplement -autoInstall option
H.G.Muller [Mon, 15 Sep 2014 13:30:40 +0000]
Implement -autoInstall option

When -autoInstall is a non-empty string, XBoard will scan the system's
plugin specs directories for UCI and WB protocol, to see if new engines
were added since the last settings save. If so, they are added to the
list of installed engines.
 The variants listed in the plugin-spec files are currently ignored,
but the option is already configured to install engines for all variants.

9 years agoFix typo
H.G.Muller [Sun, 14 Sep 2014 20:47:55 +0000]
Fix typo

9 years agoMake inlined functions static
H.G.Muller [Sun, 14 Sep 2014 19:41:04 +0000]
Make inlined functions static

Clang apparently chokes on non-static inline functions,
and they were not used from other files anyway.

9 years agoupdated spanish translation, added new polish translation
Arun Persaud [Wed, 10 Sep 2014 03:29:15 +0000]
updated spanish translation, added new polish translation

9 years agoLook for logo in engine dir first (GTK)
H.G.Muller [Sat, 13 Sep 2014 07:12:54 +0000]
Look for logo in engine dir first (GTK)

When setting engine logos, we look for a file logo.png in the engine
directory, before trying <enginename>.png in the -logoDir. This is useful
on OS X. Fix bug that checks for existence of -fd/sd rather than -logoDir,
when using the latter (also in Xaw).

9 years agoFix checkmarking of OS X menu items
H.G.Muller [Thu, 11 Sep 2014 21:10:59 +0000]
Fix checkmarking of OS X menu items

The routine MarkMenuItem() was moved to xboard.c, where it can see
the OSX-specific #defines, and calls to sync_menu_bar were added
to it, and to EnableNamendMenuItem().

9 years agoFix crash of tournament dialog GTK
H.G.Muller [Thu, 11 Sep 2014 20:48:10 +0000]
Fix crash of tournament dialog GTK

The font/color disambiguation of the Option.textField in Label and
ulti-line TextBox options cannot stand it if unused elements are
initialized as "" rather than NULL.

9 years agoLet OS X display dock icon
H.G.Muller [Thu, 11 Sep 2014 17:17:55 +0000]
Let OS X display dock icon

9 years agoFix Xaw button color error
H.G.Muller [Thu, 11 Sep 2014 10:41:50 +0000]
Fix Xaw button color error

The textValue field, now also used to indicate font, was used in two
places when popping up buttons, and the font patch only addressed one.

9 years agoMake SVGDIR a variable
H.G.Muller [Thu, 11 Sep 2014 08:23:42 +0000]
Make SVGDIR a variable

Replace all occurrences of SVGDIR in the source by svgDir, a char array
that is initialized to SVGDIR, so that it can be altered at run time.
This is needed to make portable apps. Where SVGDIR was used in string
concatenation, the code had to be re-written to use snprintf to do the
concatenation at run time, through a new function LoadIconFile.
The extension of image files used there is now made dependent on the
__APPLE__ switch, so that it can use .png in OS X (which does not seem
to understand SVG icons).

9 years agoFix warning in dead code Show
H.G.Muller [Wed, 10 Sep 2014 19:20:40 +0000]
Fix warning in dead code Show

9 years agoReorder variants, to comply with Polyglot book specs
H.G.Muller [Wed, 10 Sep 2014 18:49:38 +0000]
Reorder variants, to comply with Polyglot book specs

XBoard's variant number is used as a key to access Polyglot opening
books, and thus cannot be changed without consequences. (As it was when
we introduced ASEAN and Chu Shogi.)
  We also renamed Chu Chess to Elven Chess (under which name it is now
described on chessvariants.org).

9 years agoReserve piece command in protocol specs
H.G.Muller [Wed, 10 Sep 2014 17:52:12 +0000]
Reserve piece command in protocol specs

9 years agosuppress Alien Edition standard variants
H.G.Muller [Wed, 10 Sep 2014 16:54:45 +0000]
suppress Alien Edition standard variants

Variants that are standard in the Alien Edition should not be
recognized as engine-defined variants: the engines that announce
them will not respond with the required setup command, so allowing
the user to select them just leads to trouble.

9 years agoFix SetWidgetFont GTK
H.G.Muller [Wed, 10 Sep 2014 11:51:44 +0000]
Fix SetWidgetFont GTK

This was testing for an empty font spec in the wrong way, with as a side
effect that some pointers to font strings would be interpreted as colors.

9 years agoUpdate protocol specs
H.G.Muller [Wed, 10 Sep 2014 13:56:59 +0000]
Update protocol specs

9 years agoMerge branch 'v4.7.x' into master
Arun Persaud [Wed, 10 Sep 2014 03:15:45 +0000]
Merge branch 'v4.7.x' into master

Conflicts:
configure.ac
po/da.po
po/de.po
po/es.po
po/it.po
po/ru.po
po/tr.po
po/uk.po
po/vi.po
po/xboard.pot
po/zh_CN.po
po/zh_HK.po
po/zh_TW.po
winboard/config.h

9 years agoLet message field and button bar use GTK -messageFont
H.G.Muller [Tue, 9 Sep 2014 19:43:39 +0000]
Let message field and button bar use GTK -messageFont

The -messageFont spec (using the default coordFont pixel size, like the
others) is now used to modify the fonts of message field and buttons
in the button bar. They pass a pointer to the appData font variable in
their Option's textField. This conflicts with the use of this field in
buttons for specifying a color, as done in the New Variant buttons.
This is resolved by checking if the first byte of the pointed-to value
is a #. The Xaw version must ignore the textField if it does not
specify a color.

9 years agoFix GTK fonts
H.G.Muller [Tue, 9 Sep 2014 18:51:54 +0000]
Fix GTK fonts

9 years agoUse coordFont default pixel size for other fonts
H.G.Muller [Tue, 9 Sep 2014 17:57:52 +0000]
Use coordFont default pixel size for other fonts

The message-font is way too large for the dialogs. A better solution
would be to redo the entire table of SIZE_DEFAULTS in xboard.h, as
this file is front-end-specific anyway.

9 years agoUse -gameListFont in Game List
H.G.Muller [Tue, 9 Sep 2014 17:39:50 +0000]
Use -gameListFont in Game List

Not implemented in a very generic way, but hacked into the code that
added the handler. There aren't many other listboxes that would need
adjustable font.

9 years agoFix Chat window for Xaw build
H.G.Muller [Tue, 9 Sep 2014 14:49:18 +0000]
Fix Chat window for Xaw build

The ICS output field and Hide button are removed from the ICS Interaction
window, to make it similar to the old Chat window. This required adding
some tests in the handlers of this window, to prevent segfaults due to
accessing it.

9 years agoFix infinite-regression problem on OS X
H.G.Muller [Tue, 9 Sep 2014 13:53:29 +0000]
Fix infinite-regression problem on OS X

Apparently the OpenFile handler can already be called during
gtkosx_application_ready (or gtk_signal_connect), so we have to make
sure 'suppress' is set before we call those.

9 years agoCorrect for .Xresources form->paneA renaming in manual
H.G.Muller [Tue, 9 Sep 2014 08:47:41 +0000]
Correct for .Xresources form->paneA renaming in manual

In the Xaw build the name of the form widget of dialog.layout.form...
hierarchy was changed to paneA, paneB, ... when allowing multi-pane
dialogs through the Break Option (such as the Engine Output window).

9 years agoUse GTK fonts in Engine Output and Move History
H.G.Muller [Tue, 9 Sep 2014 08:36:42 +0000]
Use GTK fonts in Engine Output and Move History

9 years agoInclude some conditional OS X fixes
H.G.Muller [Mon, 8 Sep 2014 18:42:11 +0000]
Include some conditional OS X fixes

DATADIR must be corrected to ~~ in the OS X app, and the info command
must be started in a different way.

9 years agoFix WB DoEvents error
H.G.Muller [Mon, 8 Sep 2014 18:12:08 +0000]
Fix WB DoEvents error

9 years agoLimit auto-extending to click on first move of PV
H.G.Muller [Mon, 8 Sep 2014 17:06:35 +0000]
Limit auto-extending to click on first move of PV

Even when auto-exted on clicks on the tail of a PV will no longer cause
any moves to be added to the game. Only clicks on or before the first
move can do that now.

9 years agoAnimate multi-leg in auto-play and forward event
H.G.Muller [Mon, 8 Sep 2014 14:20:26 +0000]
Animate multi-leg in auto-play and forward event

Replaying multi-leg moves is now also done by animating both legs.
In addition, the highlights are set on final and intermediate square,
rather than from-square.
(There seems to be a great deal of code duplication here. Why doesn't
AutoPlayOneMove simply call ForwardInner?)

9 years agoFix key bindings for non-menu functions
H.G.Muller [Mon, 8 Sep 2014 12:45:51 +0000]
Fix key bindings for non-menu functions

The accelerator keystrokes for next game, previous game and debug mode,
which don't have menu items, and are grouped in the menu table 'noMenu',
were not treated in the building of the translation table, as 'noMenu'
does not occur on the menu bar. An extra iteration is done now to
treat this menu group.

9 years agoFix Xaw key bindings
H.G.Muller [Mon, 8 Sep 2014 12:24:59 +0000]
Fix Xaw key bindings

The routine to automatically construct the translation table for
accelerator keys did not respect the rule that more specific keystrokes
(like :Meta<Key>Home:) have to be defined before more general ones
(like :<Key>Home:). As a result Alt+Home would activate the Revert
item, intended for plain Home.

9 years agoDefine default font names
H.G.Muller [Mon, 8 Sep 2014 12:20:08 +0000]
Define default font names

9 years agoFix MSVC problems
H.G.Muller [Mon, 8 Sep 2014 07:25:18 +0000]
Fix MSVC problems

Book.c did not include config.h, and thus missed the redefinition of
snprintf (which is not known in MSVC). The use of 'inline' in parser.c
also needed an MSVC redefinition, now added to winboard/config.h.

9 years agoFix GTK font patch
H.G.Muller [Mon, 8 Sep 2014 07:22:55 +0000]
Fix GTK font patch

9 years agoReplace strcasecmp by StrCaseCmp
H.G.Muller [Sun, 7 Sep 2014 21:35:22 +0000]
Replace strcasecmp by StrCaseCmp

The MicroSoft compiler does not know strcasecmp, so we better use
our own function for this everywhere.

9 years agoLet GTK build pay attention to font arguments
H.G.Muller [Sun, 7 Sep 2014 21:28:29 +0000]
Let GTK build pay attention to font arguments

Multi-line text edits now use the initial value of the Option.textValue
field as a pointer to a (char*) holding a font name, to be used for
the text displayed in it. (After which they overwrite the field with
the textView handle.) The font options -tagsFont, -commentFont, icsFont,
-moveHistoryFont and -gameListFont are now activated in the GTK build,
to control the corresponding memos.

9 years agoFix auto-display comment option in General Options
H.G.Muller [Sun, 7 Sep 2014 11:58:15 +0000]
Fix auto-display comment option in General Options

This options had the same ID as auto-Queen, making it ignored.

9 years agoCall DoEvents during time-consuming operations
H.G.Muller [Sun, 7 Sep 2014 11:43:48 +0000]
Call DoEvents during time-consuming operations

Processing of a game file for reading it, searching positions, saving
selected games or creating a book from them can take minutes. To keep
the application responsive during that time, the main loops of those
tasks calls DoEvents(). A possible risk is that the user can now do
too much, and will initiate actions that interfere with the tast in
progress.

9 years agoFix GameListHighlight WB
H.G.Muller [Sun, 7 Sep 2014 11:32:49 +0000]
Fix GameListHighlight WB

The routine to highlight a game line in the Game List listbox of WinBoard
used an extremely inefficient linear search to find the game amongst the
selected games. This has now been replaced by bisection, after finding
an upper limit to the number of entries in the listbox by doubling
a trial size.

9 years agoProvide DoEvents function in front-ends
H.G.Muller [Sun, 7 Sep 2014 10:10:50 +0000]
Provide DoEvents function in front-ends

A routine to process all pending events in a non-blocking way is now
provided in the Xaw, GTK+ and WinBoard front-ends, so that time-consuming
tasks (such as PGN loading or opening-book creation) can call it to keep
the user control over the application alive.

9 years agoFix syntax error in bitbase code
H.G.Muller [Sat, 6 Sep 2014 21:13:01 +0000]
Fix syntax error in bitbase code

9 years agoDescribe Save Selected Games menu in manual
H.G.Muller [Sat, 6 Sep 2014 20:35:22 +0000]
Describe Save Selected Games menu in manual

9 years agoLet Save Games as Book only use selected games
H.G.Muller [Sat, 6 Sep 2014 20:29:43 +0000]
Let Save Games as Book only use selected games

The book-creation code now only takes games into account that are
selected for display in the Game List.

9 years agoRewrite key-binding section of manual
H.G.Muller [Sat, 6 Sep 2014 20:20:19 +0000]
Rewrite key-binding section of manual

This section still wrongly described the key-binding procedure from
before the rewrite of the XBoard front-end.

9 years agoConnect scroll event to Graph Option in GTK
H.G.Muller [Sat, 6 Sep 2014 11:21:13 +0000]
Connect scroll event to Graph Option in GTK

The mouse wheel is now detected in graphics widgets, and passed to
the user handler as button 4/5 mouse events.

9 years agoMake sure node count is positive
H.G.Muller [Sat, 6 Sep 2014 11:15:55 +0000]
Make sure node count is positive

Engines that print the node count as an int overflow into negative values
when the count exceeds 2G. This is really an engine bug, but as it
interferes extremely annoyingly with the alignment of the Thinking Output
XBoard now repairs it by adding 4G to undo the overflow.

9 years agoConnect mousewheel to Forward/BackwardEvent (XB)
H.G.Muller [Fri, 5 Sep 2014 12:03:49 +0000]
Connect mousewheel to Forward/BackwardEvent (XB)

The mouse buttons 4 and 5 are now processed in the handler for the
board widget.

9 years agoFix size of time in Engine Output window
H.G.Muller [Fri, 5 Sep 2014 11:41:34 +0000]
Fix size of time in Engine Output window

When the thinking time exceeds an hour, the format hr:min:sec is now used,
in stead of min:sec.cents. This prevents the field from extending beyond
the tab stop when thr hours kick in, and should work upto 100 hrs.
(Going beyond that at the moment does not seem useful.)

9 years agoVerify if font-spec looks like one in Xaw
H.G.Muller [Thu, 4 Sep 2014 20:57:07 +0000]
Verify if font-spec looks like one in Xaw

To make XBoard resistant to mixed use of Xaw and GTK builds, which
would not understand each others font specs stored in the settings
file (they have in common), we now determine if the value looks like
an X-font. If it doesn't, the Xaw version ignores it. The GTK build already
ignored it if it did lool like an X-font spec.

9 years agoFix alignment in Engine Output window
H.G.Muller [Thu, 4 Sep 2014 15:03:55 +0000]
Fix alignment in Engine Output window

Numbers above 1000M would become too wide for their field. This is
solved by introducing the abbreviation 'G'. Values below 10M or 10G
now get an extra digit in their fraction, so that the precision is
at least 1%.

9 years agoAdd Save Selected Games menu item
H.G.Muller [Mon, 1 Sep 2014 12:44:54 +0000]
Add Save Selected Games menu item

A menu item to save all selected games in the Game List on a single
file is added.

9 years agoAdd final piece count to search criteria
H.G.Muller [Mon, 1 Sep 2014 10:03:58 +0000]
Add final piece count to search criteria

The Load Options dialog now has a text field in which a range can be
entered (like 8-10). Position search will then only select games that
had their final number of pieces in this range.

9 years agoFix castling rights on using -lgf
H.G.Muller [Fri, 29 Aug 2014 19:15:29 +0000]
Fix castling rights on using -lgf

The dummy InitPosition to force loading pieces was taking place after
InitBackend2(), while the latter could have already loaded a game
from an -lgf argument (which would then be spoiled by the InitPosition).
It has been moved to before InitBackend2() now.

9 years agoFix crash on double-click in Game List Tags
H.G.Muller [Tue, 29 Jul 2014 13:03:04 +0000]
Fix crash on double-click in Game List Tags

A double-click in the Game List Tags listbox has no function, but it
crashed XBoard, because the textValue field of teh ListBox Option definition,
supposed to contain a pointer to the user-supplied handler, contained a
pointer to an empty string.

9 years agoFix typing of null moves
H.G.Muller [Wed, 2 Jul 2014 12:34:53 +0000]
Fix typing of null moves

Entering a null move through the move type-in could fail because the
to-square coordinates (not used in its encoding) could have invalid values,
which would reject the move in an early stage of UserMoveEvent().
Null moves are now exempted from this vaidity test, while variants where
null moves are legal now accept them in any gameMode.

9 years agoFix adjusting clocks in Xaw version
H.G.Muller [Wed, 2 Jul 2014 12:04:22 +0000]
Fix adjusting clocks in Xaw version

The handler attached to Label options failed to flip the sign of the
option number when a button other than Button1 was pressed, so that time
would always be subtracted on Shift + ClockClick and never added.
Shift now also suppresses interpretation as null move when playing.
(In Analyze / EditGame mode it is still null move starting a variation.)

9 years agoFix null-move entry during play
H.G.Muller [Wed, 2 Jul 2014 10:37:18 +0000]
Fix null-move entry during play

Null moving by clicking the clock was only accepted in Edit Game and Analyze
mode, while in Chu Shogi and spin-offs it is also allowed during play.
An F_NULL_MOVE flag was introduced to make it easy to test for such variants,
and Machine White/Black mode now also interpret clock clicks as a null move
if the opponent's flag has not yet fallen.

10 years agoLet EditPosition double-click on piece promote it
H.G.Muller [Wed, 9 Apr 2014 07:53:56 +0000]
Let EditPosition double-click on piece promote it

For pieces with Shogi-like promotion (i.e. if the promoted piece has
pieceToChar defined as '+'), let a second click on it in Edit Position
mode promote or demote it (as the case requires) when the piece menu is off,
rather than remove it (as was the old behavior.

10 years agoMake EditPosition pallette work in Asian variants
H.G.Muller [Wed, 9 Apr 2014 07:19:43 +0000]
Make EditPosition pallette work in Asian variants

Construction of the pallette position was not working in variants that
did not have Pawns start on 2nd rank, or that had multiple ranks of pieces.
Now the algorithm is applied to all ranks.

10 years agoFix crash on opening Tags window Xaw
H.G.Muller [Sat, 5 Apr 2014 21:00:17 +0000]
Fix crash on opening Tags window Xaw

Suppressing the optional book button made the Xaw generic popup crash,
because the following button had the SAME_ROW modality, and was thus
positioned w.r.t. a non-existent widget.

10 years agoFix writing of Chu-Shogi FENs
H.G. Muller [Sat, 5 Apr 2014 18:39:55 +0000]
Fix writing of Chu-Shogi FENs

Promoted pieces were getting the wrong ID letter, of the piece demoted
by 11, rather than 22.

10 years agoAllow pseudo-engines to adjust the clocks
H.G. Muller [Tue, 1 Apr 2014 16:20:29 +0000]
Allow pseudo-engines to adjust the clocks

Implement new options -first/secondPseudo, which declare the corresponding
engine to be a pseudo-engine, which will then be granted super-powers
through some new engine->GUI commands. For instance, to adjust the time
remaining on the GUI clocks through wtime and btime commands (using msec).

10 years agoFix piece inscriptions
H.G. Muller [Tue, 1 Apr 2014 10:00:14 +0000]
Fix piece inscriptions

10 years agoFix reading Chu Shogi FENs
H.G. Muller [Tue, 1 Apr 2014 09:16:48 +0000]
Fix reading Chu Shogi FENs

The X (for Phoenix) was interpreted a 10 empty squares.

10 years agoFix loading positions in engine-defined variant
H.G. Muller [Mon, 17 Mar 2014 22:26:08 +0000]
Fix loading positions in engine-defined variant

Paste Position did not work when an engine-defined variant had redefined
the pieceToCharTable, as the position would be interpreted and sent to the
engine before receiving the setup command. Copying the pieceToCharTable
received from an earlier game to appData cures this, because it will then
be used by InitPosition, which would reset the table to default otherwise.
 Another problem was that setupSpoiledMachineBlack would not be reset
after a game with no moves, leading to a spurious 'go' command to the engine.

10 years agoRender inscriptions on Chu-promoted pieces in red
H.G. Muller [Mon, 17 Mar 2014 22:05:33 +0000]
Render inscriptions on Chu-promoted pieces in red

10 years agoAllow writing text on pieces
H.G. Muller [Mon, 17 Mar 2014 21:56:07 +0000]
Allow writing text on pieces

A new persistent string option -inscriptions allows the user to define
characters to be written on the various piece types. The string is
interpreted as UTF-8. This option is useful for on-the-fly synthesis
of Shogi pieces, where the string can contain the various kanji in
the canonical pieceToCharTable order. Except that only a single color
has to be given.

10 years agoFix initial sizing of board
H.G. Muller [Wed, 12 Mar 2014 21:08:04 +0000]
Fix initial sizing of board

Previous patches had destroyed the ability to obey the -size option.

10 years agoFix width of menu bar
H.G. Muller [Mon, 10 Mar 2014 20:15:30 +0000]
Fix width of menu bar

The truncated name might not have been terminated with '\0'.
TinyLayout now specifies the number of characters kept in the menu names.
In the OS X version truncating is never needed, as the menu bar is
at the top of the screen, independent of board size.

10 years agoFix warnings fonts patch
H.G. Muller [Sun, 9 Mar 2014 19:38:51 +0000]
Fix warnings fonts patch

10 years agoImplement (clock-)font handling in GTK
H.G. Muller [Sun, 2 Mar 2014 22:10:50 +0000]
Implement (clock-)font handling in GTK

The options -clockFont, -coordFont and -messageFont are activated,
and supposed to have string values like "Sans Bold 12". The default
values have the point size as 'wild-card' %d, however "Sans Bold %d",
and are expanded by a printf with the point size taken from the defaults
table. The expanded versions are saved back into the settings file,
prefixed with a size tag, as usual.
 So far -clockFont is the only font that is actually applied while
writing.
 The 'clock kludge' was interfering with the initial sizing, as for some
sizes the initial clock-widget height happened to be equal to the final
height. It was therefore abandoned, and we seem to be able to live without
it.
 Sizes smaller than 49 were dominated (for 8-wide boards) by the menu bar.
Therefore tinyLayout now uses single-letter menu labels.

10 years agoAlso search indirection files in user's .xboard tree
H.G. Muller [Sun, 2 Mar 2014 19:45:57 +0000]
Also search indirection files in user's .xboard tree

10 years agoFix error Engine Output text highlighting
H.G. Muller [Sun, 2 Mar 2014 17:53:17 +0000]
Fix error Engine Output text highlighting

In wengineoutput.c higeTextStart and End where decalred both static and
extern, which somecompilers justifiably don't like.

10 years agoFix Board-dialog bug WB
H.G. Muller [Sat, 1 Mar 2014 15:09:09 +0000]
Fix Board-dialog bug WB

The drawing code for the sample square did ot restore the correct brush.

10 years agoFix various warnings
H.G. Muller [Fri, 28 Feb 2014 20:48:19 +0000]
Fix various warnings

Mostly written but never read errors. Also removed a debug printf that was
causing a format warning.

10 years agoKludge repair of expose after startup resize
H.G. Muller [Wed, 26 Feb 2014 15:34:52 +0000]
Kludge repair of expose after startup resize

Redraw of the main board after resize is delegated to DragProc, which is
scheduled after a delay, to make sure the user is done sizing (mainly to
reposition docked windows). But at startup the program-requested resize when
an engine does not support variant normal and needs a different board format
takes so long that the finale size expose occurs after the DragProc timeout.
As a result, the board was never drawn on the resized canvas.
  This is quite hard to fix in a satisfactory way. For now the suppression
of board redrawing during resize is disabled during the first 10 seconds
after startup, as any resize during that time is likely to be the result
of a program request.

10 years agoUse first engine as default for second
H.G. Muller [Wed, 26 Feb 2014 12:08:50 +0000]
Use first engine as default for second

Rather than having the same fixed default for both engines, we noww only
have a fixed default for the first, and use the actual first as default
for the second. One advantage is that this guarantees the second engine
plays the same variants as the first by default.

10 years agoAllow adding played move to book
H.G. Muller [Sun, 23 Feb 2014 22:51:20 +0000]
Allow adding played move to book

A button is added in the Edit Book dialog to prime XBoard for adding the
next move entered through the user interface to the book window, without
actually playing it.

10 years agoPlay move right-clicked in Edit Book dialog
H.G. Muller [Sun, 23 Feb 2014 21:54:55 +0000]
Play move right-clicked in Edit Book dialog

A handler for button-3 down-clicks is added to the Edit Tags dialog,
which fakes the clicked word was typed in the move type-in box.

10 years agoFix pop-down of ChatDlg and TextMenuDlg from menu
H.G. Muller [Sun, 23 Feb 2014 18:23:28 +0000]
Fix pop-down of ChatDlg and TextMenuDlg from menu

Unlike other windows these two would not react to clicking the menu item
once they were up. Now they pop down in that case.

10 years agoPreserve window width on board-format change
H.G. Muller [Fri, 21 Feb 2014 10:10:41 +0000]
Preserve window width on board-format change

When a variant switch would cause recalculation of the board window,
we now first recalculate square size to keep the window width fixed.
Also adapt initial width on high boards.