H.G. Muller [Tue, 17 Apr 2012 13:44:15 +0000]
Fix warnings about character index
H.G. Muller [Tue, 17 Apr 2012 13:37:53 +0000]
Move ManProc to xboard.c
It calls ManInner, which requires X11 data types, even if the values are NULL.
H.G. Muller [Tue, 17 Apr 2012 13:27:21 +0000]
Move FileNamePopUp to dialogs.c
H.G. Muller [Tue, 17 Apr 2012 13:15:03 +0000]
Fix readout of numeric combobox
As currently no numeric comboboxes are used, this bug was silent.
H.G. Muller [Tue, 17 Apr 2012 13:10:54 +0000]
Shuffle prototypes to correct header, or add them there
H.G. Muller [Tue, 17 Apr 2012 12:15:15 +0000]
Fix MenuNameToItem
This function could crash when called with ann argument that did not
contain a period, while the idea was that it should handle this as if the
item is in noMenu (for user-specified key binding to non-menu funtions).
H.G. Muller [Mon, 16 Apr 2012 17:43:03 +0000]
Fix click-click under-promotion animation save
H.G. Muller [Tue, 17 Apr 2012 09:02:39 +0000]
Define TOPLEVEL in winboard.c
H.G. Muller [Tue, 17 Apr 2012 08:59:33 +0000]
Add two new strings to WinBoard language file
H.G. Muller [Tue, 17 Apr 2012 08:51:02 +0000]
Fix second-engine variant test
The test whether the second engine supports the selected variant took place
before the second engine was loaded, thus always coming to the conclusion
that the variant was not supported, and aborting the TwoMachines command.
The test is now moved to after second-engine loading (but before its
initialization, where non-supporting would become a fatal error).
H.G. Muller [Mon, 16 Apr 2012 10:11:09 +0000]
Fix clearing of ICS input box after send
Arun Persaud [Tue, 17 Apr 2012 02:08:10 +0000]
enable -Wall -Wno-parentheses for all compilers that understand them
Byrial Jensen [Mon, 16 Apr 2012 11:18:37 +0000]
Remove 5 unused variables from zippy code
Byrial Jensen [Mon, 16 Apr 2012 11:14:06 +0000]
Remove unused static function ShowTC
Byrial Jensen [Mon, 16 Apr 2012 11:10:58 +0000]
Remove unused static function MenuBarSelect
Byrial Jensen [Mon, 16 Apr 2012 11:07:01 +0000]
Remove unused variable first_entry from function find_key
Byrial Jensen [Mon, 16 Apr 2012 11:01:09 +0000]
Remove unused variable tm from function SaveGamePGN
Byrial Jensen [Mon, 16 Apr 2012 10:56:46 +0000]
Remove unused variable delayedKing from function QuickScan
Byrial Jensen [Mon, 16 Apr 2012 10:52:57 +0000]
Remove unused variable pdown from function UserMoveEvent
Byrial Jensen [Sun, 15 Apr 2012 02:25:59 +0000]
Change some double literals to floats.
To avoid unnecessary implicit promotions of float variables to double.
H.G. Muller [Sun, 15 Apr 2012 09:12:02 +0000]
Remove debug printf
Byrial Jensen [Sat, 14 Apr 2012 20:43:03 +0000]
Translate "NPS" also in engine output window
Arun Persaud [Sat, 14 Apr 2012 23:19:34 +0000]
removed unused variables (-Wunused-variable)
Arun Persaud [Sat, 14 Apr 2012 22:37:05 +0000]
added m4 directory to search path for aclocal. As suggested by Michel Van den Bergh
H.G. Muller [Sat, 14 Apr 2012 21:21:56 +0000]
Fix Eval Graph scale in drop games
H.G. Muller [Sat, 14 Apr 2012 21:16:29 +0000]
Fix ArrowDamage out-of-bounds access on drop moves
H.G. Muller [Sat, 14 Apr 2012 19:33:49 +0000]
Implement automatic partner observe
Starting a game, or starting to observe one, now automatically issues a
'pobserve' command if dual-board is switched on, so that the partner game
will pop up in the secondary board (assuming it is bughouse).
The secondary board now displays the players in the title. (This (lightly)
breaks WinBoard again.) When the primary game ends, the secondary board
closes automatically. Initial sizing of the board is repaired, and now uses
the actual current board size, rather than the initial size of the main board.
H.G. Muller [Sat, 14 Apr 2012 13:43:30 +0000]
Fix crash due to empty PV
Reception of a stat01 command before the first PV could cause a crash,
as apparently the parser cannot handle this.
H.G. Muller [Sat, 14 Apr 2012 11:27:48 +0000]
Suppress testing for availability in bughouse drops
Give up on testing legality of bughouse drop moves; this only causes problems,
because the move list sent by the ICS is not accompanied by holdings updates.
So XBoard parses it thinking the holdings are empty, making every drop move
an ImpossibleMove. Bughouse can only be played on ICS, and we might as well
trust the ICS that it will only pass us legal moves. A user should not be
able to enter illegal drops; unavailable pieces cannot be grabbed from the
holdings, and typing is diverted to the ICS directly (which would reject the
illegal drop without XBoard even knowing about it).
Also improve switching to bh/zh, based on drop move in initial board.
H.G. Muller [Sat, 14 Apr 2012 07:11:22 +0000]
Fix some compile errors / warnings
H.G. Muller [Fri, 13 Apr 2012 17:06:17 +0000]
Fix promotionPopDown on new move entry
The promotion popup is non-modal, and old XBoard versions popped it down
as soon as the user clicked the board, so he could just enter a new move
to abort the promotion. This was broken in the new version, because the code
to do the PopDown and abort in HandleUserMove had not been ported.
H.G. Muller [Fri, 13 Apr 2012 16:38:51 +0000]
Use in-place sweep-selection for click-click under-promotion
With detour under-promotion a piece cycles through all possible choices
during backwards dragging. But in a click-click move there is no dragging.
This used to be solved by letting the second click start a drag event of
the default promotion choice, which you could accept by immediately
releasing the mouse button, or drag around to change it first.
The dragging in this case seemed a little unnatural, because the to-square
was already indicated by the down-click. So it has been changed now to the
promo choice appearing on the down-clicked to-square, followed by
EditPosition-like sweep-selection on that square when one wants to under-
promote. The move is always accepted no matter where the up-click takes
place, except when it takes place on the from-square (which offers a last-
resort abort possibiliy).
Note that click-click promotion is essential in variants where it is not
obvious from the from-square alone that a promotion is imminent, but where
it depends on the to-square. (Such as Shogi.) There drag-drop detour under-
promotion is not possible.
H.G. Muller [Fri, 13 Apr 2012 14:05:16 +0000]
Improve arrow drawing
The arrow is now erased together with the border highlights, by marking
the damage it did, and then doing a selected redraw of the board to let
the damaged square be re-drawn. Highlights of a previous move are now
cleared on the down-click that selects a new piece, so there never is an
arrow to infavorably interact with animation of dragging.
H.G. Muller [Fri, 13 Apr 2012 12:57:15 +0000]
Also do selective redraw with showTargetSquares on
The XBoard DrawPosition now also keeps track of the previous marker state,
and redraws squares for which thi shas changed. As a result, the routine
MarkTargetSquares does no longer have to force to complete redraw.
(Breaks WinBoard?)
H.G. Muller [Thu, 12 Apr 2012 22:33:28 +0000]
Fix click-click sweep promotions to empty square
These did not work, because DragPieceBegin would fail on an EmptySquare.
H.G. Muller [Thu, 12 Apr 2012 21:58:41 +0000]
Move clearing of target squares to after drag end
A dragged piece that would partly overshoot its destination into a square
with a marker would effectively protect that marker from erasing, when the
erasing was done before the piece was released, because redrawal after the
move only would draw the target square. (Unlike erasing, which forces a full
redraw.)
H.G. Muller [Thu, 12 Apr 2012 21:49:27 +0000]
Fix double promotion popup
Only the up-click of a click-click move gives a promotion popup now.
H.G. Muller [Thu, 12 Apr 2012 21:32:28 +0000]
Fix promotion popup
The new GenericPopUp did not like it if the first button had 'SAME_ROW' set.
H.G. Muller [Thu, 12 Apr 2012 15:28:32 +0000]
Allow clearing of marker dots in any mode
There might already be dots when you change to a mode where there should
be none, and you don't want them to stay on forever in that case...
H.G. Muller [Thu, 12 Apr 2012 15:00:55 +0000]
Fix redraw of secondary board on flipping view
H.G. Muller [Thu, 12 Apr 2012 08:30:21 +0000]
Let clocks of secondary board count down
The back-end now remembers what is the active clock, and the time left on it.
This is then decremented and updated together with the clocks of your own
game, using the partnerUp flag to divert the clock display to the secondary.
H.G. Muller [Thu, 12 Apr 2012 07:47:43 +0000]
Fix 3 forgotten symbolic widget references
H.G. Muller [Wed, 11 Apr 2012 17:24:36 +0000]
Add sound files to browser menu
H.G. Muller [Wed, 11 Apr 2012 11:04:24 +0000]
Add New Directory button to file browser
H.G. Muller [Wed, 11 Apr 2012 07:54:51 +0000]
Detect engine exit during startup
The case where engine startup failure does not result in a fatal protocol
message, like "No such file", but where it simply exits, is now also covered.
H.G. Muller [Tue, 10 Apr 2012 20:55:07 +0000]
Suppress popup for fatal error after tellusererror
For cooperating better with Polyglot, and allowing more to-the-point
error messaging, the (awful) default message will be suppressed if the
dying engine already provided an explanation for its demise to the user.
H.G. Muller [Tue, 10 Apr 2012 18:28:45 +0000]
Fix Engine Output icon heights in international versions
The text in a label option could not be an empty string, or it would be
'translated' to something of enormous size. So it is set to a space now.
H.G. Muller [Tue, 10 Apr 2012 18:21:56 +0000]
Fix internationalization
The internationalization was broken by moving the XtSetLanguageProc
to behind 'bindtextdomain'.
H.G. Muller [Tue, 10 Apr 2012 18:03:46 +0000]
Make reference to board widgets symbolic
H.G. Muller [Tue, 10 Apr 2012 16:39:25 +0000]
Don't strip path from engine name if directory given
H.G. Muller [Tue, 10 Apr 2012 15:54:33 +0000]
Fix vertical chaining of Buttons and browser ListBoxes
H.G. Muller [Tue, 10 Apr 2012 13:53:47 +0000]
Fix auto-play
The 'narrow search' modification had broken auto-play, because all selected
games were marked as matching position 0, so that they would all start in
thr opening position.
H.G. Muller [Tue, 10 Apr 2012 11:30:44 +0000]
updated po/pot files
H.G. Muller [Tue, 10 Apr 2012 09:54:50 +0000]
new version number for developer release
H.G. Muller [Tue, 10 Apr 2012 11:22:40 +0000]
Update POTFILES.in
H.G. Muller [Tue, 10 Apr 2012 11:21:33 +0000]
Fix Makefile EXTRA_DIST
H.G. Muller [Mon, 2 Apr 2012 15:53:40 +0000]
Use Ctrl key in EditPosition mode to copy pieces
H.G. Muller [Wed, 28 Mar 2012 21:51:28 +0000]
Fix bug in FRC castling for position search
In FRC it is essential that both pieces are taken off the board before
any of them is put back, lest they obliterate each other.
H.G. Muller [Wed, 28 Mar 2012 10:25:20 +0000]
Fix bug on loading engine
A newly loaded engine was put at the end of the game, rather than at the
current position, (which is required in EditGame mode).
H.G. Muller [Fri, 6 Apr 2012 15:02:21 +0000]
Add 'Narrow' function to position search
H.G. Muller [Fri, 6 Apr 2012 08:52:45 +0000]
Reorganize main() a bit
The font stuff goes into a separate routine, and the X11 stuff is
moved backwards as far as possible.
H.G. Muller [Wed, 4 Apr 2012 19:55:50 +0000]
Give the dual-board option a separate board window
The second board window pops up whenever an alien board is received
during your game. Moves in it are highlighted by an arrow, irrespective
of the 'Highlight with Arrow' setting. The clocks are displayed, but do
not count down.
H.G. Muller [Thu, 5 Apr 2012 09:23:03 +0000]
Port engine grouping to Match Options dialog
H.G. Muller [Thu, 5 Apr 2012 13:18:25 +0000]
Change default directory in Load Engine to "."
H.G. Muller [Thu, 5 Apr 2012 08:49:56 +0000]
Port grouping to XBoard Load Engine
Add highlight to Load Engine grouping
H.G. Muller [Fri, 6 Apr 2012 15:19:33 +0000]
Fix default file types for browse buttons
H.G. Muller [Tue, 3 Apr 2012 07:14:44 +0000]
New browser
Redo file browser with GenericPopUp
This had to solve quite some problems, because it wanted to use a ComboBox
option while a transient dialog could be up, was a non-engine dialog
while an engine dialog is up, and XRaiseWindow does not work properly.
Sorting is done alphabetically, or for digit groups by numeric value.
H.G. Muller [Mon, 2 Apr 2012 12:43:24 +0000]
Use ListBox in stead of ComboBox in Match-Options dialog
H.G. Muller [Mon, 2 Apr 2012 12:09:15 +0000]
Use ListBox in stead of ComboBox in Load Engine dialog
Make Load Engine listbox sensitive to double-clicking
H.G. Muller [Mon, 26 Mar 2012 15:06:33 +0000]
Add message about enabling in New Variant dialog
H.G. Muller [Sat, 31 Mar 2012 18:27:20 +0000]
Move LoadGamePopUp to menus.c
H.G. Muller [Sat, 31 Mar 2012 18:25:22 +0000]
Move DisplayMessage to dialogs.c
Use the wrapper SetWidgetLabel to make it back-end.
H.G. Muller [Sat, 31 Mar 2012 13:23:30 +0000]
Fix switching debug option during session.
Switching on debug mode during the session did not create the requested
debug file.
H.G. Muller [Sat, 31 Mar 2012 13:22:57 +0000]
Correct texi file for use of .Xresources
H.G. Muller [Mon, 2 Apr 2012 17:19:30 +0000]
Fix recent-engines menu
A new primitive to create an item in a given menu was added to do this.
H.G. Muller [Sat, 31 Mar 2012 08:54:22 +0000]
Switch back two two-part menu names
The menu code is again completely changed; a handle field is added
to the MenuItem tables to store the widget for the item, and this info
is used to alter sensitivity or marking. MenuToNr is replaced by
MenuNameToItem, which looks up the two-level name directly in the
menu tables. Put all currently unused MenuProcs in noMenu table,
so they are available for key binding through the new method.
H.G. Muller [Sat, 24 Mar 2012 17:36:44 +0000]
Redo main board window with generic popup
Some of the improvements in GenericPopUp (committed earlier) were added
especiall for this (menu and box Option types), and the commits that used
them to make a fully functional board, listed below, were collapsed into
this one.
This uses the new box and menu features of the Generic popup.
Make option table shadow board consistent with refactor
Do main menus in shadow board
The board made by GenericPopUp now also has (functional) menus. The Expose
callback now also uses the new format (passing coordinates).
Use BoxEnd callback to decide about smallLayout
The shadow board now dynamically decides whether it should use smallLayout
positioning of the title-in-window widget, using a callback in the BoxEnd
option for the menu bar: If no reasonable amount of space is left behind
the menu bar, the title is forced under the clocks (smallLayout).
Do some mouse handling on shadow board
Only button 1 events for now. We have to keep track if the button is down!
Connect button 3 to shadow board
For now only for piece and PV manipulation: no context menus yet
Symbolic reference in option formatting
choice <-> textValue xboard.c
Improve expose callback shadow board
Implement context menus of shadow board
This uses the new generic PopUp option
TopLevel xboard.c
Make mock-up board available through menu item
Make clocks of shadow board sensitive to clicking
Make button bar of shadow board operational
The back-end Event functions are specified as user callbacks directly;
this is not very clean, as they are parameterless, but called with an int
argument. This should have no bad consequences, though.
Switch to using shadow board as main board
The menu marking and enabling had to b switched off for this, as it
only worked on the old menus. Remove HandleUserMove.
Deleting of unused shell variables, clocks to dialogs.c
Move BoardPopUp to dialogs.c
This required passing on fome front-end vars as parameters, and returning
apointer to the option list, to make the handles available in xboard.c.
Simplify InitDrawingSizes
Now that all widgets of the main window are properly chained, there is
no need to resize them when the board format changes: setting a new width
for the shell suffices.
Cleanup some unused Xt Args
H.G. Muller [Sat, 31 Mar 2012 08:53:46 +0000]
Remove unnecessary menu unmarking for Edit Tags
H.G. Muller [Thu, 29 Mar 2012 17:09:34 +0000]
Split sync-after options in Match dialog into checkbox + label
Now the checkbox texts are highlighted on hovering, we don't want the
explanatory text behind it to be highlighted with it.
H.G. Muller [Mon, 26 Mar 2012 15:12:33 +0000]
Make variant-unsupported-by-second error non-fatal
H.G. Muller [Fri, 23 Mar 2012 19:06:15 +0000]
Redo Eval Graph with generic popup
The Graph option of the GenericPopUp is used to implement the Eval Graph.
Compared to the previous implementation, which was drawing directly in the
form widget, the new one has one extra widget layer, but that did not
affect the code anywhere. Adapt eval title to width of eval graph.
H.G. Muller [Fri, 23 Mar 2012 14:17:14 +0000]
Redo Engine Output window with generic popup
A new file nengineoutput.c holds the X-independent code. This makes use
of new capablities of GenerciPopup, for having Label widgets on same row,
stacking panes after a Break, and chaining Label and Text widgets.
H.G. Muller [Wed, 21 Mar 2012 22:00:05 +0000]
Redo Game List with generic popup
Check in ngamelist.c
Redo Game List with generic popup
The X-independent code (i.e. almost all) is moved to a new file
ngamelist.c.
Make button in Game List to pop up Game List Options
Fix scrolling game list
Fix popup of existing Game List after loading file
Wheel-scroll game list
Symbolic reference game list
TopLevel game list
Put format flags with listbox options
H.G. Muller [Wed, 21 Mar 2012 16:58:27 +0000]
Redo Game List Options with generic popup
H.G. Muller [Thu, 5 Apr 2012 19:56:52 +0000]
Add -dialogColor and -buttonColor options
These only override system defaults if they are non-empty strings.
H.G. Muller [Wed, 28 Mar 2012 13:52:01 +0000]
Add -topLevel option
This persistent Boolean option determines if the auxiliary windows
(Game List, Move List, Engine Output, Eval Graph, Tags and Comment)
use top-level shells (with their own icon on the task bar, and
independently closable). Other dialogs will always use transient shells.
(Also he modal Error and Promotion dialogs, for which the modality
presumably only serves to pop them down without special attention.)
A control for this was added in the General Options dialog.
H.G. Muller [Tue, 20 Mar 2012 14:30:00 +0000]
Redo ErrorPopUp with generic dialog
<Enter> keeps popping down error popup.Multiple Error popups remeain tricky;
add comment to describe problem with multiple ErrorPopUps.
H.G. Muller [Tue, 20 Mar 2012 09:22:46 +0000]
Redo PromotionPopUp with generic dialog
The dialog is no longer modal.
H.G. Muller [Mon, 19 Mar 2012 20:56:48 +0000]
Redo AskQuestion dialog with generic popup
H.G. Muller [Mon, 19 Mar 2012 20:55:58 +0000]
Major refactoring of GenericPopUp
Allow more transient dialogs in GenericPopUp
Remove grab from promotion popup
Fix other generic popup over transient popup
To use the generic dialog generator for 'asynchronous' popups (Ask Qustion
or Error popup caused by engine), the currentOptions setting has to be
restored for the combo and checkbox callbacks of the transient to still
work after the asynchronous dialog returns. Note that only transient dialogs
can have check and combo controls.
Make generic calcel button suppressible
Also #define some more symbols for Option.min flags,
and move them to dialogs.h.
Change TypeInProc to general OK handler
The move type-in now has its own option list, to distinguish it from
the ICS input box, and give it its own OK handler. Rather than having
the translation for <Enter> on the text widget call TypeInEvent directly,
we let it call GenericCallback, which calls GenericReadout, which calls
the OK proc, which does the job.
To be able to call GenericCallback from the TypeInProc, the recognition
of OK and cancel buttons had to be changed. This because it was too difficult
to arrange the calling widget had label OK or cancell. So these buttons are
no longer recognized by name, but by the option number passed as client data.
(This solves the problem that a user could not make buttons named 'cancel'
or 'OK'.)
Make Cancel button optional
Fix closing multiple popups of same kind
The GenericCallback figures out its own shell, so all buttons of
multiple dialogs keep working. External calls to PopDown only work
on the lastcreated instance of that kind, though (including those from
the Delete Window button, which can do 'cross-closing'). shellUp is now
a counter, and PopDowns are only prevented when it reaches 0 or the
current shell does not exist. (To know this, PopDown now resets shells[n]
to NULL when is shell is destroyed.
Beware of double PopDowns (through OK procs); they wreck the system.
Fix Delete Window button of multipe ErrorPopUps
The action routine for handling the Delete Window now pays attention
to the shell widget that the system passes to it, and temporarily
replaces shells[n] by it to let PopDown act on the proper instance.
Add ListBox dialog type to GenericPopUp
Fix vert sizing of ListBox
Put listbox widgets in viewport
Put listbox in viewport
Improved xoptions.c support for focussing and listboxes
Fix OK-row button positioning
Let GenericPopUp take parent and modality as arguments
This makes the code a bit more explicit and less kludgy. It also becomes
possible to call the same dialog (e.g. Load Options) from the main menu
and from another dialog (e.g. the Game List).
Support scroll function for generic popup listboxes
Fix scrolling
Move HighlightWithScroll to xoptions.c
Change scroll algorithm
Add mouse-wheel scroll to generic list boxes
Implement tabbing between text edits
Implement same-row text labels in generic dialog
Allow labels to specify their chaining in generic popup
The opt.min variable is used to specify the chaining: 0xF0 are the bits
for (left, right) chaining of the left side (0xC0) and right side (0x30).
The 0xC bits determine top or bottom chaining of the entire label.
Without anything spcified (0), the chaining is XtRubber.
TextBox options can also specify top-chaining of their top. All this was
needed to allow decent implementation of the Engine Output window with
the generic popup. (Although tags and comment popup ca benefit from the
latter feature.)
Let GenericPopUp support a Graph option
The Graph option results in an area where one can draw something. It is
positioned / chained similar to Label options. A handler for expose events
can be specified in the textValue field of the option.
Implement box widgets and menu buttons in GenericPopup
To enhance the capabilities of GenericPopUp such that it could create the
main window, it needs to be able tha packaging of controls into a box widget
(for mennu and button bar). Menu buttons are also required elements
(although they do look a lot like comboboxes?) Option types BoxBegin and
BoxEnd can now be used to bracket a group of controls that will be put
in a box widget. (Cannot be used recursively!) The positioning of the box
is similar to that of a Label, and is specified in the BogBegin option.
The code to shrink the menu buttons to fit is also incorporated, to act
on any box widget: if the BoxBegin option specifies a width, the elements
in it are shrunk to meet the requirement. Otherwise the box just gets the
size of the sum of its children (plus spacings).
Label options can now specify a font, casted into their textValue field.
(This is needed to get the proper size for the clock widgets.)
Implement callback in BoxEnd options
BoxEnd is a pseudo-option, to trigger packing the preceeding ones in
an earlier-opened box widget. In the process it calculates the size of
the box widget (and trims it if a size was specified for it in the
corresponding BoxBegin). The Option.target field of BoxEnd is now
interpreted as a callback, which can be use to take decisions based
on the determined size for the remaining options in the list, before
these are processed b GenericPopUp.
Refactor xoptions.c
Make a subroutine to set args shared by almost all widgets. Swap meaning
of '1'-bit in option.min flag of Break option, to be consistent with
SAME_ROW interpretation in other option types.
Make option tables consistent with refactored GenericPopUp
The flag for stacking in the Break option needed to be inverted, and
the BoardPopUp needed to pass the font in another field. Better use was
made of the improved chaining options too.
Improve Graph-option event handling
The user-supplied callback now gets 3 arguments passed: the event type
(0 = pointer motion, 1...5 button press, -1...-5 release, 10 = expose),
and two coordinates. For ouse events these are the pointer (x,y), while
for expose events they are the window size (w,h). The callback is now
specified in the option.target field of the Graph option.
Store engine options in malloc'ed memory
The Option.name field has been re-declared as (char*), from (char[MSG_SIZ]).
There are still MSG_SIZ chars allocated irrespective of actual size, because
the field is also supposed to store the textValue, which can be changed by
the user. But at least it means that unused options of the generous list
now don't waste much space. (And the prparated Option tables in dialogs.c
will shrink by a large factor as well.)
Improve GenericPopUp ComboBox handling.
The dialog type is now passed to the combobox callback as well, and this is
used to really figure out what option it is called for.
Allow numeric comboboxes
When no list of strings is given in Option.choice, the target is assumed
to be (int), and the number of the slected entry is stored there. Also
adapts the Label options that act as fillers to the new method for making
dummies (namely NULL in the Option.name field).
Put comboCallback in Option struct
Rather than having a general comboCallback variable for the entire current
dialog, each ComboBox option can now specify its own callback in the
target field of the option: the COMBO_CALLBACK bit of Option.min indicates
whether the target is a variable to be set or a callback. The callback can
still fetch the choice from the values array.
Allow generic CreateComboPopup also to do main menus
An extra parameter to CreateComboPopup determines if the menu texts
should be taken from a list of strings (the old method with engine-
supplied choices), or from a menu table of MenuItems. It can now also
recognize "----" as a menu break, and keeps margins (for the marking).
Make subroutine for determining curren combo selection
Various fixes to GenericPopUp
Delete one border-width setting
Fix max nr of args in GenerocPopUp
Fix button release events of Graph options
Fix generic Graph callback pointer motion coordinates
Make all format referencing in Option tables symbolic
Let Option.choice define menu texts, rather than Option.textValue
This is more logical than ussing textValue for it, because choice already
has the correct (char**) type, while textValue was (char*), and needed
casting everywhere. Note that for engine options, the fields were the
same anyway, so no back-end change was required. The textValue now
contains the (casted) list of actual string values, where these are
needed. (But for numeric and function menus they aren't.)
Add PopUp Option type
An new pseudo-Option is defined, to add a popup menu to a previous Graph
option. The actual popping up is done by the expose handler.
The function XUngrabPointer is the key to success here. A PopUp option
specifies a callback for handling the selection from the menu, which will
be called with the option number, exacty as with ComboBox options.
Update option explanation in dialogs.h
Make Spin and CheckBox callbacks pass dialog number
No longer rely on 'currentOptions' for getting the option belonging to
the callback, but get it out of the dialogOptions array indexed by dialog
type. This way things cannot be messed up by an asynchrounous error popup.
It also means that it is now save for non-modal dialogs to use these options.
Use button widget for text behind checkbox
Let listboxes use general formatting hints
Let GenericPopUp option always finish last pane after Break
Allow LisBox to specify select callback in Option.textValue
Use double-click to trigger ListBox callback
Make ListBox callback re-entrant
Fix multi-line Label options
Separate CreateMenuItem out from CreateComboPopup
Chain checkbox texts entirely left
Allow a user-specified callback to Label options
This is needed to implement the clocks. Let the CheckBox callback handle
it. For now ther is no distinction between different mouse buttons.
H.G. Muller [Wed, 21 Mar 2012 10:15:01 +0000]
Prevent double PopDowns
Some DialogOK functions ordered an early PopDown themselves. This,
however, resulted in PopDown being called twice when they returned TRUE.
This interfered with the new system for allowing multiple instances of
the same dialog. So these functions are now fixed to suppress the
standard PopDown by always returning FALSE.
H.G. Muller [Tue, 20 Mar 2012 18:10:50 +0000]
Split usounds.c and usystem.c from xboard.c
X-independent code was moved to separate files. The nef file usound.c
contains the sound handling, which in XBoard is trivial, because it uses
an external player, but could be replaced by a complex one on platforms
that have to handle the sound themselves.
The usystem.c file contains all non-X Unix-like stuff, such as fork,
pipe, system, getenv. I also contains some color parsing for the xterm
colors. This stuff could be useful on platforms that support Unix-like
system calls.
H.G. Muller [Mon, 26 Mar 2012 17:03:19 +0000]
Make routine to probe shift keys
The code to probe Alt keys was taken out of MoveTypeInProc, and extended
to probing Ctrl and Shift keys too. These are now returned in the 6 LSB
of an int by ShiftKeys().
H.G. Muller [Mon, 19 Mar 2012 12:15:11 +0000]
Remove one level of indirection on ICSInputBoxPopUp
H.G. Muller [Tue, 10 Apr 2012 08:26:24 +0000]
Cleanup of xboard.c
Remove AskQuestionProc
A bit of cleanup on xboard.c prototypes
Remove dead file-browser code
Delete vestigial jail code
All the stuff about jailColor was deleted. Only one fishy thing remains:
xpmJailSquare seems under some conditions used in BlankSquare to draw a
'neutral' square. it is set to a copy of a light square image. But in the
current design 'neutral' means blacked out between board and holdings,
and even with image use, it should not resemble a light square...
Remove registering of CommentPopDown and TagsPopDown
Merge CopyGameSelection into CopyPositionSelection
H.G. Muller [Mon, 19 Mar 2012 10:38:17 +0000]
Move some back-endish routines from xboard.c to dialogs.c
Move ICS input-history handling to dialogs.c
Move ICS Input Box text handling to dialogs.c
Move DisplayXxxx routines to dialogs.c
Move DisplayTitle to dialogs.c
A wrapper SetWindowTitle remains in xboard.c.
H.G. Muller [Sun, 18 Mar 2012 19:10:35 +0000]
Split back-endish part off xoptions.c, and move to dialogs.c
Some MenuProcs for dialogs were also moved to dialogs.c from menus.c.
MoveTypeInProc which is an event handler for the board widget,
was moved to xboard.c, where it can be static.
Identify dialogs by enum type
A new header dialogs.h is created, which defines an enum type DialogClass
that is now used to identify the various dialogs done by GenericPopUp.
The prototypes for GenericPopUp/PopDown, and other globals shared by the
dialogs code and other modules can go in here as well.
Remove ClearTextWidget
This did the same as SetWidgetText with an empty string.
Split X-code from PutText
Split back-end part from MoveTypeInProc
Take set-title out of comment popup
Sort MenuProcs in dialogs.c with their support functions
Declare globals in dialogs.c with functions where they belong
Add prototypes to dialogs.h
Move prototypes and globals from xoptions.c to dialogs.h
Make accessor DialogExists for dialog shells
Add dialogs.c to makefile: compiles and runs!
Combine 3 calls into front-end to InitDrawingParams
Move EditCommentProc and ICSInputBoxProc to dialogs.c
Pass option list as argument to GenericUpdate and GenericReadOut
Shorten argument name from currentOption to opts
This to prevent confusing it with the global variable of that name.
H.G. Muller [Sun, 18 Mar 2012 14:33:18 +0000]
Declare some shared global variables in backend.h
The vlobals twoBoards and partnerUp were only shared through an extern
declaration in xboard.c
H.G. Muller [Sun, 18 Mar 2012 11:34:42 +0000]
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
H.G. Muller [Sun, 18 Mar 2012 09:08:55 +0000]
Contract some awful code replication
The code for making an X-color was replicated 6 times, and is now made
into a subroutine. The code for creating GCs was quite repetitive as well.