From: H.G. Muller Date: Tue, 24 Nov 2009 03:51:19 +0000 (-0800) Subject: same argDescriptor parsing for Xboard and Winbaord X-Git-Tag: hgm-4.20100107~37 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=acca181c7d39eea4904084170f8b5fae08361846;p=xboard.git same argDescriptor parsing for Xboard and Winbaord This patch makes XBoard and WinBoard use the same argDescriptor list of options, and (largely) use the same code for parsing and saving them. This is acheived by moving this code to a new file args.h, and #including this in both winboard.c and xboard.c (so that tiny differences, e.g. in default values in the table, are decided by the context). XBoard has new menu items "Save Settings Now" and "Save Settings on Exit" in the "Option" menu. XBoard uses /etc/xboard/xboard.conf as default settings file. A new option, -saveSettingsFile, can specify where settings should be saved, without parsing the file. (So that it also works if the file does not yet exist.) --- diff --git a/Makefile.am b/Makefile.am index b9d91cb..e06b568 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,9 +16,9 @@ xboard_SOURCES = backend.c backend.h backendz.h \ lists.c lists.h \ moves.c moves.h \ parser.l parser.h \ - pgntags.c \ + pgntags.c \ uci.c \ - xboard.c xboard.h \ + xboard.c xboard.h args.h \ xedittags.c xedittags.h \ engineoutput.c engineoutput.h \ xengineoutput.c \ diff --git a/args.h b/args.h new file mode 100644 index 0000000..f1e0320 --- /dev/null +++ b/args.h @@ -0,0 +1,1337 @@ +/* + * args.c -- Option parsing and saving for X and Windows versions of XBoard + * + * Copyright 1991 by Digital Equipment Corporation, Maynard, + * Massachusetts. + * + * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, + * 2007, 2008, 2009 Free Software Foundation, Inc. + * + * Enhancements Copyright 2005 Alessandro Scotti + * + * The following terms apply to Digital Equipment Corporation's copyright + * interest in XBoard: + * ------------------------------------------------------------------------ + * All Rights Reserved + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of Digital not be + * used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * + * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * ------------------------------------------------------------------------ + * + * The following terms apply to the enhanced version of XBoard + * distributed by the Free Software Foundation: + * ------------------------------------------------------------------------ + * + * GNU XBoard is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * GNU XBoard is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. * + * + *------------------------------------------------------------------------ + ** See the file ChangeLog for a revision history. +*/ + +// Note: this file is not a normal header, but contains executable code +// for #inclusion in winboard.c and xboard.c, rather than separate compilation, +// so that it can make use of the proper context of #defined symbols and +// declarations in those files. + +typedef enum { + ArgString, ArgInt, ArgFloat, ArgBoolean, ArgTrue, ArgFalse, ArgNone, + ArgColor, ArgAttribs, ArgFilename, ArgBoardSize, ArgFont, ArgCommSettings, + ArgSettingsFilename, + ArgX, ArgY, ArgZ // [HGM] placement: for window-placement options stored relative to main window +} ArgType; + +typedef void *ArgIniType; + +#define INVALID (ArgIniType) 6915 /* Some number unlikely to be needed as default for anything */ +#define MAX_ARG_LEN 128*1024 /* [AS] For Roger Brown's very long list! */ + +typedef struct { + char *argName; + ArgType argType; + /*** + union { + String *pString; // ArgString + int *pInt; // ArgInt + float *pFloat; // ArgFloat + Boolean *pBoolean; // ArgBoolean + COLORREF *pColor; // ArgColor + ColorClass cc; // ArgAttribs + String *pFilename; // ArgFilename + BoardSize *pBoardSize; // ArgBoardSize + int whichFont; // ArgFont + DCB *pDCB; // ArgCommSettings + String *pFilename; // ArgSettingsFilename + } argLoc; + ***/ + void *argLoc; + Boolean save; + ArgIniType defaultValue; +} ArgDescriptor; + +typedef struct { + char *item; + char *command; + Boolean getname; + Boolean immediate; +} IcsTextMenuEntry; + +IcsTextMenuEntry icsTextMenuEntry[ICS_TEXT_MENU_SIZE]; + +int junk; + +void EnsureOnScreen(int *x, int *y, int minX, int minY); +char StringGet(void *getClosure); +void ParseFont(char *name, int number); +void SetFontDefaults(); +void CreateFonts(); +void ParseColor(int n, char *name); +void ParseTextAttribs(ColorClass cc, char *s); +void ParseBoardSize(void * addr, char *name); +void ParseCommPortSettings(char *name); +void LoadAllSounds(); +void SetCommPortDefaults(); +void SaveFontArg(FILE *f, ArgDescriptor *ad); +void ExportSounds(); +void SaveAttribsArg(FILE *f, ArgDescriptor *ad); +void SaveColor(FILE *f, ArgDescriptor *ad); +void SaveBoardSize(FILE *f, char *name, void *addr); +void PrintCommPortSettings(FILE *f, char *name); +void GetWindowCoords(); +int MySearchPath(char *installDir, char *name, char *fullname); +int MyGetFullPathName(char *name, char *fullname); +int MainWindowUp(); +void PopUpStartupDialog(); +typedef char GetFunc(void *getClosure); +void ParseArgs(GetFunc get, void *cl); + +// [HGM] this is an exact duplicate of something in winboard.c. Move to backend.c? +char *defaultTextAttribs[] = +{ + COLOR_SHOUT, COLOR_SSHOUT, COLOR_CHANNEL1, COLOR_CHANNEL, COLOR_KIBITZ, + COLOR_TELL, COLOR_CHALLENGE, COLOR_REQUEST, COLOR_SEEK, COLOR_NORMAL, + "#000000" +}; + +ArgDescriptor argDescriptors[] = { + /* positional arguments */ + { "loadGameFile", ArgFilename, (void *) &appData.loadGameFile, FALSE, INVALID }, + { "", ArgNone, NULL, FALSE, INVALID }, + /* keyword arguments */ + JAWS_ARGS + { "whitePieceColor", ArgColor, (void *) 0, TRUE, (ArgIniType) WHITE_PIECE_COLOR }, + { "wpc", ArgColor, (void *) 0, FALSE, INVALID }, + { "blackPieceColor", ArgColor, (void *) 1, TRUE, (ArgIniType) BLACK_PIECE_COLOR }, + { "bpc", ArgColor, (void *) 1, FALSE, INVALID }, + { "lightSquareColor", ArgColor, (void *) 2, TRUE, (ArgIniType) LIGHT_SQUARE_COLOR }, + { "lsc", ArgColor, (void *) 2, FALSE, INVALID }, + { "darkSquareColor", ArgColor, (void *) 3, TRUE, (ArgIniType) DARK_SQUARE_COLOR }, + { "dsc", ArgColor, (void *) 3, FALSE, INVALID }, + { "highlightSquareColor", ArgColor, (void *) 4, TRUE, (ArgIniType) HIGHLIGHT_SQUARE_COLOR }, + { "hsc", ArgColor, (void *) 4, FALSE, INVALID }, + { "premoveHighlightColor", ArgColor, (void *) 5, TRUE, (ArgIniType) PREMOVE_HIGHLIGHT_COLOR }, + { "phc", ArgColor, (void *) 5, FALSE, INVALID }, + { "movesPerSession", ArgInt, (void *) &appData.movesPerSession, TRUE, (ArgIniType) MOVES_PER_SESSION }, + { "mps", ArgInt, (void *) &appData.movesPerSession, FALSE, INVALID }, + { "initString", ArgString, (void *) &appData.initString, FALSE, INVALID }, + { "firstInitString", ArgString, (void *) &appData.initString, FALSE, (ArgIniType) INIT_STRING }, + { "secondInitString", ArgString, (void *) &appData.secondInitString, FALSE, (ArgIniType) INIT_STRING }, + { "firstComputerString", ArgString, (void *) &appData.firstComputerString, + FALSE, (ArgIniType) COMPUTER_STRING }, + { "secondComputerString", ArgString, (void *) &appData.secondComputerString, + FALSE, (ArgIniType) COMPUTER_STRING }, + { "firstChessProgram", ArgFilename, (void *) &appData.firstChessProgram, + FALSE, (ArgIniType) FIRST_CHESS_PROGRAM }, + { "fcp", ArgFilename, (void *) &appData.firstChessProgram, FALSE, INVALID }, + { "secondChessProgram", ArgFilename, (void *) &appData.secondChessProgram, + FALSE, (ArgIniType) SECOND_CHESS_PROGRAM }, + { "scp", ArgFilename, (void *) &appData.secondChessProgram, FALSE, INVALID }, + { "firstPlaysBlack", ArgBoolean, (void *) &appData.firstPlaysBlack, FALSE, FALSE }, + { "fb", ArgTrue, (void *) &appData.firstPlaysBlack, FALSE, FALSE }, + { "xfb", ArgFalse, (void *) &appData.firstPlaysBlack, FALSE, INVALID }, + { "-fb", ArgFalse, (void *) &appData.firstPlaysBlack, FALSE, INVALID }, + { "noChessProgram", ArgBoolean, (void *) &appData.noChessProgram, FALSE, FALSE }, + { "ncp", ArgTrue, (void *) &appData.noChessProgram, FALSE, INVALID }, + { "xncp", ArgFalse, (void *) &appData.noChessProgram, FALSE, INVALID }, + { "-ncp", ArgFalse, (void *) &appData.noChessProgram, FALSE, INVALID }, + { "firstHost", ArgString, (void *) &appData.firstHost, FALSE, (ArgIniType) FIRST_HOST }, + { "fh", ArgString, (void *) &appData.firstHost, FALSE, INVALID }, + { "secondHost", ArgString, (void *) &appData.secondHost, FALSE, (ArgIniType) SECOND_HOST }, + { "sh", ArgString, (void *) &appData.secondHost, FALSE, INVALID }, + { "firstDirectory", ArgFilename, (void *) &appData.firstDirectory, FALSE, (ArgIniType) FIRST_DIRECTORY }, + { "fd", ArgFilename, (void *) &appData.firstDirectory, FALSE, INVALID }, + { "secondDirectory", ArgFilename, (void *) &appData.secondDirectory, FALSE, (ArgIniType) SECOND_DIRECTORY }, + { "sd", ArgFilename, (void *) &appData.secondDirectory, FALSE, INVALID }, + + /* some options only used by the XBoard front end, and ignored in WinBoard */ + /* Their saving is controlled by XBOARD, which in WinBoard is defined as FALSE */ + { "internetChessServerInputBox", ArgBoolean, (void *) &appData.icsInputBox, XBOARD, (ArgIniType) FALSE }, + { "icsinput", ArgTrue, (void *) &appData.icsInputBox, FALSE, INVALID }, + { "xicsinput", ArgFalse, (void *) &appData.icsInputBox, FALSE, INVALID }, + { "cmail", ArgString, (void *) &appData.cmailGameName, FALSE, (ArgIniType) "" }, + { "soundProgram", ArgFilename, (void *) &appData.soundProgram, XBOARD, (ArgIniType) "play" }, + { "fontSizeTolerance", ArgInt, (void *) &appData.fontSizeTolerance, XBOARD, (ArgIniType) 4 }, + { "lowTimeWarningColor", ArgColor, (void *) 6, XBOARD, (ArgIniType) LOWTIMEWARNING_COLOR }, + { "lowTimeWarning", ArgBoolean, (void *) &appData.lowTimeWarning, XBOARD, (ArgIniType) FALSE }, + { "titleInWindow", ArgBoolean, (void *) &appData.titleInWindow, XBOARD, (ArgIniType) FALSE }, + { "title", ArgTrue, (void *) &appData.titleInWindow, FALSE, INVALID }, + { "xtitle", ArgFalse, (void *) &appData.titleInWindow, FALSE, INVALID }, + { "flashCount", ArgInt, (void *) &appData.flashCount, XBOARD, INVALID }, // let X handle this + { "flashRate", ArgInt, (void *) &appData.flashRate, XBOARD, (ArgIniType) FLASH_RATE }, + { "pixmapDirectory", ArgFilename, (void *) &appData.pixmapDirectory, XBOARD, (ArgIniType) "" }, + { "pixmap", ArgFilename, (void *) &appData.pixmapDirectory, FALSE, INVALID }, + { "bitmapDirectory", ArgFilename, (void *) &appData.bitmapDirectory, XBOARD, (ArgIniType) "" }, + { "bm", ArgFilename, (void *) &appData.bitmapDirectory, FALSE, INVALID }, + { "msLoginDelay", ArgInt, (void *) &appData.msLoginDelay, XBOARD, (ArgIniType) MS_LOGIN_DELAY }, + { "pasteSelection", ArgBoolean, (void *) &appData.pasteSelection, XBOARD, (ArgIniType) FALSE }, + + { "remoteShell", ArgFilename, (void *) &appData.remoteShell, FALSE, (ArgIniType) REMOTE_SHELL }, + { "rsh", ArgFilename, (void *) &appData.remoteShell, FALSE, INVALID }, + { "remoteUser", ArgString, (void *) &appData.remoteUser, FALSE, INVALID }, + { "ruser", ArgString, (void *) &appData.remoteUser, FALSE, INVALID }, + { "timeDelay", ArgFloat, (void *) &appData.timeDelay, TRUE, INVALID }, + { "td", ArgFloat, (void *) &appData.timeDelay, FALSE, INVALID }, + { "timeControl", ArgString, (void *) &appData.timeControl, TRUE, (ArgIniType) TIME_CONTROL }, + { "tc", ArgString, (void *) &appData.timeControl, FALSE, INVALID }, + { "timeIncrement", ArgInt, (void *) &appData.timeIncrement, TRUE, (ArgIniType) TIME_INCREMENT }, + { "inc", ArgInt, (void *) &appData.timeIncrement, FALSE, INVALID }, + { "internetChessServerMode", ArgBoolean, (void *) &appData.icsActive, FALSE, INVALID }, + { "ics", ArgTrue, (void *) &appData.icsActive, FALSE, (ArgIniType) FALSE }, + { "xics", ArgFalse, (void *) &appData.icsActive, FALSE, INVALID }, + { "-ics", ArgFalse, (void *) &appData.icsActive, FALSE, INVALID }, + { "internetChessServerHost", ArgString, (void *) &appData.icsHost, FALSE, (ArgIniType) "" }, + { "icshost", ArgString, (void *) &appData.icsHost, FALSE, INVALID }, + { "internetChessServerPort", ArgString, (void *) &appData.icsPort, FALSE, (ArgIniType) ICS_PORT }, + { "icsport", ArgString, (void *) &appData.icsPort, FALSE, INVALID }, + { "internetChessServerCommPort", ArgString, (void *) &appData.icsCommPort, FALSE, (ArgIniType) ICS_COMM_PORT }, + { "icscomm", ArgString, (void *) &appData.icsCommPort, FALSE, INVALID }, + { "internetChessServerComPort", ArgString, (void *) &appData.icsCommPort, FALSE, INVALID }, + { "icscom", ArgString, (void *) &appData.icsCommPort, FALSE, INVALID }, + { "internetChessServerLogonScript", ArgFilename, (void *) &appData.icsLogon, FALSE, (ArgIniType) ICS_LOGON }, + { "icslogon", ArgFilename, (void *) &appData.icsLogon, FALSE, INVALID }, + { "useTelnet", ArgBoolean, (void *) &appData.useTelnet, FALSE, INVALID }, + { "telnet", ArgTrue, (void *) &appData.useTelnet, FALSE, INVALID }, + { "xtelnet", ArgFalse, (void *) &appData.useTelnet, FALSE, INVALID }, + { "-telnet", ArgFalse, (void *) &appData.useTelnet, FALSE, INVALID }, + { "telnetProgram", ArgFilename, (void *) &appData.telnetProgram, FALSE, (ArgIniType) TELNET_PROGRAM }, + { "internetChessserverHelper", ArgFilename, (void *) &appData.icsHelper, + FALSE, INVALID }, // for XB + { "icshelper", ArgFilename, (void *) &appData.icsHelper, FALSE, (ArgIniType) "" }, + { "gateway", ArgString, (void *) &appData.gateway, FALSE, (ArgIniType) "" }, + { "loadGameFile", ArgFilename, (void *) &appData.loadGameFile, FALSE, (ArgIniType) "" }, + { "lgf", ArgFilename, (void *) &appData.loadGameFile, FALSE, INVALID }, + { "loadGameIndex", ArgInt, (void *) &appData.loadGameIndex, FALSE, (ArgIniType) 0 }, + { "lgi", ArgInt, (void *) &appData.loadGameIndex, FALSE, INVALID }, + { "saveGameFile", ArgFilename, (void *) &appData.saveGameFile, TRUE, (ArgIniType) "" }, + { "sgf", ArgFilename, (void *) &appData.saveGameFile, FALSE, INVALID }, + { "autoSaveGames", ArgBoolean, (void *) &appData.autoSaveGames, TRUE, (ArgIniType) FALSE }, + { "autosave", ArgTrue, (void *) &appData.autoSaveGames, FALSE, INVALID }, + { "xautosave", ArgFalse, (void *) &appData.autoSaveGames, FALSE, INVALID }, + { "-autosave", ArgFalse, (void *) &appData.autoSaveGames, FALSE, INVALID }, + { "loadPositionFile", ArgFilename, (void *) &appData.loadPositionFile, FALSE, (ArgIniType) "" }, + { "lpf", ArgFilename, (void *) &appData.loadPositionFile, FALSE, INVALID }, + { "loadPositionIndex", ArgInt, (void *) &appData.loadPositionIndex, FALSE, (ArgIniType) 1 }, + { "lpi", ArgInt, (void *) &appData.loadPositionIndex, FALSE, INVALID }, + { "savePositionFile", ArgFilename, (void *) &appData.savePositionFile, FALSE, (ArgIniType) "" }, + { "spf", ArgFilename, (void *) &appData.savePositionFile, FALSE, INVALID }, + { "matchMode", ArgBoolean, (void *) &appData.matchMode, FALSE, (ArgIniType) FALSE }, + { "mm", ArgTrue, (void *) &appData.matchMode, FALSE, INVALID }, + { "xmm", ArgFalse, (void *) &appData.matchMode, FALSE, INVALID }, + { "-mm", ArgFalse, (void *) &appData.matchMode, FALSE, INVALID }, + { "matchGames", ArgInt, (void *) &appData.matchGames, FALSE, (ArgIniType) 0 }, + { "mg", ArgInt, (void *) &appData.matchGames, FALSE, INVALID }, + { "monoMode", ArgBoolean, (void *) &appData.monoMode, TRUE, (ArgIniType) FALSE }, + { "mono", ArgTrue, (void *) &appData.monoMode, FALSE, INVALID }, + { "xmono", ArgFalse, (void *) &appData.monoMode, FALSE, INVALID }, + { "-mono", ArgFalse, (void *) &appData.monoMode, FALSE, INVALID }, + { "debugMode", ArgBoolean, (void *) &appData.debugMode, FALSE, (ArgIniType) FALSE }, + { "debug", ArgTrue, (void *) &appData.debugMode, FALSE, INVALID }, + { "xdebug", ArgFalse, (void *) &appData.debugMode, FALSE, INVALID }, + { "-debug", ArgFalse, (void *) &appData.debugMode, FALSE, INVALID }, + { "clockMode", ArgBoolean, (void *) &appData.clockMode, FALSE, (ArgIniType) TRUE }, + { "clock", ArgTrue, (void *) &appData.clockMode, FALSE, INVALID }, + { "xclock", ArgFalse, (void *) &appData.clockMode, FALSE, INVALID }, + { "-clock", ArgFalse, (void *) &appData.clockMode, FALSE, INVALID }, + { "searchTime", ArgString, (void *) &appData.searchTime, FALSE, (ArgIniType) "" }, + { "st", ArgString, (void *) &appData.searchTime, FALSE, INVALID }, + { "searchDepth", ArgInt, (void *) &appData.searchDepth, FALSE, (ArgIniType) 0 }, + { "depth", ArgInt, (void *) &appData.searchDepth, FALSE, INVALID }, + { "showCoords", ArgBoolean, (void *) &appData.showCoords, TRUE, (ArgIniType) FALSE }, + { "coords", ArgTrue, (void *) &appData.showCoords, FALSE, INVALID }, + { "xcoords", ArgFalse, (void *) &appData.showCoords, FALSE, INVALID }, + { "-coords", ArgFalse, (void *) &appData.showCoords, FALSE, INVALID }, + { "showThinking", ArgBoolean, (void *) &appData.showThinking, TRUE, (ArgIniType) FALSE }, + { "thinking", ArgTrue, (void *) &appData.showThinking, FALSE, INVALID }, + { "xthinking", ArgFalse, (void *) &appData.showThinking, FALSE, INVALID }, + { "-thinking", ArgFalse, (void *) &appData.showThinking, FALSE, INVALID }, + { "ponderNextMove", ArgBoolean, (void *) &appData.ponderNextMove, TRUE, (ArgIniType) TRUE }, + { "ponder", ArgTrue, (void *) &appData.ponderNextMove, FALSE, INVALID }, + { "xponder", ArgFalse, (void *) &appData.ponderNextMove, FALSE, INVALID }, + { "-ponder", ArgFalse, (void *) &appData.ponderNextMove, FALSE, INVALID }, + { "periodicUpdates", ArgBoolean, (void *) &appData.periodicUpdates, TRUE, (ArgIniType) TRUE }, + { "periodic", ArgTrue, (void *) &appData.periodicUpdates, FALSE, INVALID }, + { "xperiodic", ArgFalse, (void *) &appData.periodicUpdates, FALSE, INVALID }, + { "-periodic", ArgFalse, (void *) &appData.periodicUpdates, FALSE, INVALID }, + { "popupExitMessage", ArgBoolean, (void *) &appData.popupExitMessage, TRUE, (ArgIniType) TRUE }, + { "exit", ArgTrue, (void *) &appData.popupExitMessage, FALSE, INVALID }, + { "xexit", ArgFalse, (void *) &appData.popupExitMessage, FALSE, INVALID }, + { "-exit", ArgFalse, (void *) &appData.popupExitMessage, FALSE, INVALID }, + { "popupMoveErrors", ArgBoolean, (void *) &appData.popupMoveErrors, TRUE, (ArgIniType) FALSE }, + { "popup", ArgTrue, (void *) &appData.popupMoveErrors, FALSE, INVALID }, + { "xpopup", ArgFalse, (void *) &appData.popupMoveErrors, FALSE, INVALID }, + { "-popup", ArgFalse, (void *) &appData.popupMoveErrors, FALSE, INVALID }, + { "popUpErrors", ArgBoolean, (void *) &appData.popupMoveErrors, + FALSE, INVALID }, /* only so that old WinBoard.ini files from betas can be read */ + { "clockFont", ArgFont, (void *) CLOCK_FONT, TRUE, INVALID }, + { "messageFont", ArgFont, (void *) MESSAGE_FONT, !XBOARD, INVALID }, + { "font", ArgFont, (void *) MESSAGE_FONT, XBOARD, INVALID }, + { "coordFont", ArgFont, (void *) COORD_FONT, TRUE, INVALID }, + { "tagsFont", ArgFont, (void *) EDITTAGS_FONT, TRUE, INVALID }, + { "commentFont", ArgFont, (void *) COMMENT_FONT, TRUE, INVALID }, + { "icsFont", ArgFont, (void *) CONSOLE_FONT, TRUE, INVALID }, + { "moveHistoryFont", ArgFont, (void *) MOVEHISTORY_FONT, TRUE, INVALID }, /* [AS] */ + { "boardSize", ArgBoardSize, (void *) &boardSize, + TRUE, (ArgIniType) -1 }, /* must come after all fonts */ + { "size", ArgBoardSize, (void *) &boardSize, FALSE, INVALID }, + { "ringBellAfterMoves", ArgBoolean, (void *) &appData.ringBellAfterMoves, + FALSE, (ArgIniType) TRUE }, /* historical; kept only so old winboard.ini files will parse */ + { "bell", ArgTrue, (void *) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB + { "xbell", ArgFalse, (void *) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB + { "movesound", ArgTrue, (void *) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB + { "xmovesound", ArgFalse, (void *) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB + { "alwaysOnTop", ArgBoolean, (void *) &alwaysOnTop, TRUE, INVALID }, + { "top", ArgTrue, (void *) &alwaysOnTop, FALSE, INVALID }, + { "xtop", ArgFalse, (void *) &alwaysOnTop, FALSE, INVALID }, + { "-top", ArgFalse, (void *) &alwaysOnTop, FALSE, INVALID }, + { "autoCallFlag", ArgBoolean, (void *) &appData.autoCallFlag, TRUE, (ArgIniType) FALSE }, + { "autoflag", ArgTrue, (void *) &appData.autoCallFlag, FALSE, INVALID }, + { "xautoflag", ArgFalse, (void *) &appData.autoCallFlag, FALSE, INVALID }, + { "-autoflag", ArgFalse, (void *) &appData.autoCallFlag, FALSE, INVALID }, + { "autoComment", ArgBoolean, (void *) &appData.autoComment, TRUE, (ArgIniType) FALSE }, + { "autocomm", ArgTrue, (void *) &appData.autoComment, FALSE, INVALID }, + { "xautocomm", ArgFalse, (void *) &appData.autoComment, FALSE, INVALID }, + { "-autocomm", ArgFalse, (void *) &appData.autoComment, FALSE, INVALID }, + { "autoObserve", ArgBoolean, (void *) &appData.autoObserve, TRUE, (ArgIniType) FALSE }, + { "autobs", ArgTrue, (void *) &appData.autoObserve, FALSE, INVALID }, + { "xautobs", ArgFalse, (void *) &appData.autoObserve, FALSE, INVALID }, + { "-autobs", ArgFalse, (void *) &appData.autoObserve, FALSE, INVALID }, + { "flipView", ArgBoolean, (void *) &appData.flipView, FALSE, (ArgIniType) FALSE }, + { "flip", ArgTrue, (void *) &appData.flipView, FALSE, INVALID }, + { "xflip", ArgFalse, (void *) &appData.flipView, FALSE, INVALID }, + { "-flip", ArgFalse, (void *) &appData.flipView, FALSE, INVALID }, + { "autoFlipView", ArgBoolean, (void *) &appData.autoFlipView, TRUE, (ArgIniType) TRUE }, + { "autoflip", ArgTrue, (void *) &appData.autoFlipView, FALSE, INVALID }, + { "xautoflip", ArgFalse, (void *) &appData.autoFlipView, FALSE, INVALID }, + { "-autoflip", ArgFalse, (void *) &appData.autoFlipView, FALSE, INVALID }, + { "autoRaiseBoard", ArgBoolean, (void *) &appData.autoRaiseBoard, TRUE, (ArgIniType) TRUE }, + { "autoraise", ArgTrue, (void *) &appData.autoRaiseBoard, FALSE, INVALID }, + { "xautoraise", ArgFalse, (void *) &appData.autoRaiseBoard, FALSE, INVALID }, + { "-autoraise", ArgFalse, (void *) &appData.autoRaiseBoard, FALSE, INVALID }, + { "alwaysPromoteToQueen", ArgBoolean, (void *) &appData.alwaysPromoteToQueen, TRUE, (ArgIniType) FALSE }, + { "queen", ArgTrue, (void *) &appData.alwaysPromoteToQueen, FALSE, INVALID }, + { "xqueen", ArgFalse, (void *) &appData.alwaysPromoteToQueen, FALSE, INVALID }, + { "-queen", ArgFalse, (void *) &appData.alwaysPromoteToQueen, FALSE, INVALID }, + { "oldSaveStyle", ArgBoolean, (void *) &appData.oldSaveStyle, TRUE, (ArgIniType) FALSE }, + { "oldsave", ArgTrue, (void *) &appData.oldSaveStyle, FALSE, INVALID }, + { "xoldsave", ArgFalse, (void *) &appData.oldSaveStyle, FALSE, INVALID }, + { "-oldsave", ArgFalse, (void *) &appData.oldSaveStyle, FALSE, INVALID }, + { "quietPlay", ArgBoolean, (void *) &appData.quietPlay, TRUE, (ArgIniType) FALSE }, + { "quiet", ArgTrue, (void *) &appData.quietPlay, FALSE, INVALID }, + { "xquiet", ArgFalse, (void *) &appData.quietPlay, FALSE, INVALID }, + { "-quiet", ArgFalse, (void *) &appData.quietPlay, FALSE, INVALID }, + { "getMoveList", ArgBoolean, (void *) &appData.getMoveList, TRUE, (ArgIniType) TRUE }, + { "moves", ArgTrue, (void *) &appData.getMoveList, FALSE, INVALID }, + { "xmoves", ArgFalse, (void *) &appData.getMoveList, FALSE, INVALID }, + { "-moves", ArgFalse, (void *) &appData.getMoveList, FALSE, INVALID }, + { "testLegality", ArgBoolean, (void *) &appData.testLegality, TRUE, (ArgIniType) TRUE }, + { "legal", ArgTrue, (void *) &appData.testLegality, FALSE, INVALID }, + { "xlegal", ArgFalse, (void *) &appData.testLegality, FALSE, INVALID }, + { "-legal", ArgFalse, (void *) &appData.testLegality, FALSE, INVALID }, + { "premove", ArgBoolean, (void *) &appData.premove, TRUE, (ArgIniType) TRUE }, + { "pre", ArgTrue, (void *) &appData.premove, FALSE, INVALID }, + { "xpre", ArgFalse, (void *) &appData.premove, FALSE, INVALID }, + { "-pre", ArgFalse, (void *) &appData.premove, FALSE, INVALID }, + { "premoveWhite", ArgBoolean, (void *) &appData.premoveWhite, TRUE, (ArgIniType) FALSE }, + { "prewhite", ArgTrue, (void *) &appData.premoveWhite, FALSE, INVALID }, + { "xprewhite", ArgFalse, (void *) &appData.premoveWhite, FALSE, INVALID }, + { "-prewhite", ArgFalse, (void *) &appData.premoveWhite, FALSE, INVALID }, + { "premoveWhiteText", ArgString, (void *) &appData.premoveWhiteText, TRUE, (ArgIniType) "" }, + { "premoveBlack", ArgBoolean, (void *) &appData.premoveBlack, TRUE, (ArgIniType) FALSE }, + { "preblack", ArgTrue, (void *) &appData.premoveBlack, FALSE, INVALID }, + { "xpreblack", ArgFalse, (void *) &appData.premoveBlack, FALSE, INVALID }, + { "-preblack", ArgFalse, (void *) &appData.premoveBlack, FALSE, INVALID }, + { "premoveBlackText", ArgString, (void *) &appData.premoveBlackText, TRUE, (ArgIniType) "" }, + { "icsAlarm", ArgBoolean, (void *) &appData.icsAlarm, TRUE, (ArgIniType) TRUE}, + { "alarm", ArgTrue, (void *) &appData.icsAlarm, FALSE}, + { "xalarm", ArgFalse, (void *) &appData.icsAlarm, FALSE}, + { "-alarm", ArgFalse, (void *) &appData.icsAlarm, FALSE}, + { "icsAlarmTime", ArgInt, (void *) &appData.icsAlarmTime, TRUE, (ArgIniType) 5000}, + { "localLineEditing", ArgBoolean, (void *) &appData.localLineEditing, FALSE, (ArgIniType) TRUE}, + { "edit", ArgTrue, (void *) &appData.localLineEditing, FALSE, INVALID }, + { "xedit", ArgFalse, (void *) &appData.localLineEditing, FALSE, INVALID }, + { "-edit", ArgFalse, (void *) &appData.localLineEditing, FALSE, INVALID }, + { "animateMoving", ArgBoolean, (void *) &appData.animate, TRUE, (ArgIniType) TRUE }, + { "animate", ArgTrue, (void *) &appData.animate, FALSE, INVALID }, + { "xanimate", ArgFalse, (void *) &appData.animate, FALSE, INVALID }, + { "-animate", ArgFalse, (void *) &appData.animate, FALSE, INVALID }, + { "animateSpeed", ArgInt, (void *) &appData.animSpeed, TRUE, (ArgIniType) 10 }, + { "animateDragging", ArgBoolean, (void *) &appData.animateDragging, TRUE, (ArgIniType) TRUE }, + { "drag", ArgTrue, (void *) &appData.animateDragging, FALSE, INVALID }, + { "xdrag", ArgFalse, (void *) &appData.animateDragging, FALSE, INVALID }, + { "-drag", ArgFalse, (void *) &appData.animateDragging, FALSE, INVALID }, + { "blindfold", ArgBoolean, (void *) &appData.blindfold, TRUE, (ArgIniType) FALSE }, + { "blind", ArgTrue, (void *) &appData.blindfold, FALSE, INVALID }, + { "xblind", ArgFalse, (void *) &appData.blindfold, FALSE, INVALID }, + { "-blind", ArgFalse, (void *) &appData.blindfold, FALSE, INVALID }, + { "highlightLastMove", ArgBoolean, + (void *) &appData.highlightLastMove, TRUE, (ArgIniType) TRUE }, + { "highlight", ArgTrue, (void *) &appData.highlightLastMove, FALSE, INVALID }, + { "xhighlight", ArgFalse, (void *) &appData.highlightLastMove, FALSE, INVALID }, + { "-highlight", ArgFalse, (void *) &appData.highlightLastMove, FALSE, INVALID }, + { "highlightDragging", ArgBoolean, + (void *) &appData.highlightDragging, TRUE, INVALID }, + { "highdrag", ArgTrue, (void *) &appData.highlightDragging, FALSE, INVALID }, + { "xhighdrag", ArgFalse, (void *) &appData.highlightDragging, FALSE, INVALID }, + { "-highdrag", ArgFalse, (void *) &appData.highlightDragging, FALSE, INVALID }, + { "colorizeMessages", ArgBoolean, (void *) &appData.colorize, TRUE, (ArgIniType) TRUE }, + { "colorize", ArgTrue, (void *) &appData.colorize, FALSE, INVALID }, + { "xcolorize", ArgFalse, (void *) &appData.colorize, FALSE, INVALID }, + { "-colorize", ArgFalse, (void *) &appData.colorize, FALSE, INVALID }, + { "colorShout", ArgAttribs, (void *) ColorShout, TRUE, INVALID }, + { "colorSShout", ArgAttribs, (void *) ColorSShout, TRUE, INVALID }, + { "colorCShout", ArgAttribs, (void *) ColorSShout, FALSE, INVALID }, // for XB + { "colorChannel1", ArgAttribs, (void *) ColorChannel1, TRUE, INVALID }, + { "colorChannel", ArgAttribs, (void *) ColorChannel, TRUE, INVALID }, + { "colorKibitz", ArgAttribs, (void *) ColorKibitz, TRUE, INVALID }, + { "colorTell", ArgAttribs, (void *) ColorTell, TRUE, INVALID }, + { "colorChallenge", ArgAttribs, (void *) ColorChallenge, TRUE, INVALID }, + { "colorRequest", ArgAttribs, (void *) ColorRequest, TRUE, INVALID }, + { "colorSeek", ArgAttribs, (void *) ColorSeek, TRUE, INVALID }, + { "colorNormal", ArgAttribs, (void *) ColorNormal, TRUE, INVALID }, + { "colorBackground", ArgColor, (void *) 7, TRUE, COLOR_BKGD }, + { "soundShout", ArgFilename, (void *) &appData.soundShout, TRUE, (ArgIniType) "" }, + { "soundSShout", ArgFilename, (void *) &appData.soundSShout, TRUE, (ArgIniType) "" }, + { "soundCShout", ArgFilename, (void *) &appData.soundSShout, FALSE, (ArgIniType) "" }, // for XB + { "soundChannel1", ArgFilename, (void *) &appData.soundChannel1, TRUE, (ArgIniType) "" }, + { "soundChannel", ArgFilename, (void *) &appData.soundChannel, TRUE, (ArgIniType) "" }, + { "soundKibitz", ArgFilename, (void *) &appData.soundKibitz, TRUE, (ArgIniType) "" }, + { "soundTell", ArgFilename, (void *) &appData.soundTell, TRUE, (ArgIniType) "" }, + { "soundChallenge", ArgFilename, (void *) &appData.soundChallenge, TRUE, (ArgIniType) "" }, + { "soundRequest", ArgFilename, (void *) &appData.soundRequest, TRUE, (ArgIniType) "" }, + { "soundSeek", ArgFilename, (void *) &appData.soundSeek, TRUE, (ArgIniType) "" }, + { "soundMove", ArgFilename, (void *) &appData.soundMove, TRUE, (ArgIniType) "" }, + { "soundBell", ArgFilename, (void *) &appData.soundBell, TRUE, (ArgIniType) SOUND_BELL }, + { "soundIcsWin", ArgFilename, (void *) &appData.soundIcsWin, TRUE, (ArgIniType) "" }, + { "soundIcsLoss", ArgFilename, (void *) &appData.soundIcsLoss, TRUE, (ArgIniType) "" }, + { "soundIcsDraw", ArgFilename, (void *) &appData.soundIcsDraw, TRUE, (ArgIniType) "" }, + { "soundIcsUnfinished", ArgFilename, (void *) &appData.soundIcsUnfinished, TRUE, (ArgIniType) "" }, + { "soundIcsAlarm", ArgFilename, (void *) &appData.soundIcsAlarm, TRUE, (ArgIniType) "" }, + { "reuseFirst", ArgBoolean, (void *) &appData.reuseFirst, FALSE, (ArgIniType) TRUE }, + { "reuse", ArgTrue, (void *) &appData.reuseFirst, FALSE, INVALID }, + { "xreuse", ArgFalse, (void *) &appData.reuseFirst, FALSE, INVALID }, + { "-reuse", ArgFalse, (void *) &appData.reuseFirst, FALSE, INVALID }, + { "reuseChessPrograms", ArgBoolean, + (void *) &appData.reuseFirst, FALSE, INVALID }, /* backward compat only */ + { "reuseSecond", ArgBoolean, (void *) &appData.reuseSecond, FALSE, (ArgIniType) TRUE }, + { "reuse2", ArgTrue, (void *) &appData.reuseSecond, FALSE, INVALID }, + { "xreuse2", ArgFalse, (void *) &appData.reuseSecond, FALSE, INVALID }, + { "-reuse2", ArgFalse, (void *) &appData.reuseSecond, FALSE, INVALID }, + { "comPortSettings", ArgCommSettings, (void *) /*&dcb*/ 0, TRUE, INVALID }, + { "settingsFile", ArgSettingsFilename, (void *) &settingsFileName, FALSE, (ArgIniType) SETTINGS_FILE }, + { "ini", ArgSettingsFilename, (void *) &settingsFileName, FALSE, INVALID }, + { "saveSettingsFile", ArgFilename, (void *) &settingsFileName, FALSE, INVALID }, + { "saveSettingsOnExit", ArgBoolean, (void *) &saveSettingsOnExit, TRUE, (ArgIniType) TRUE }, + { "chessProgram", ArgBoolean, (void *) &chessProgram, FALSE, (ArgIniType) FALSE }, + { "cp", ArgTrue, (void *) &chessProgram, FALSE, INVALID }, + { "xcp", ArgFalse, (void *) &chessProgram, FALSE, INVALID }, + { "-cp", ArgFalse, (void *) &chessProgram, FALSE, INVALID }, + { "icsMenu", ArgString, (void *) &icsTextMenuString, TRUE, (ArgIniType) ICS_TEXT_MENU_DEFAULT }, + { "icsNames", ArgString, (void *) &icsNames, TRUE, (ArgIniType) ICS_NAMES }, + { "firstChessProgramNames", ArgString, (void *) &firstChessProgramNames, + TRUE, (ArgIniType) FCP_NAMES }, + { "secondChessProgramNames", ArgString, (void *) &secondChessProgramNames, + TRUE, (ArgIniType) SCP_NAMES }, + { "initialMode", ArgString, (void *) &appData.initialMode, FALSE, (ArgIniType) "" }, + { "mode", ArgString, (void *) &appData.initialMode, FALSE, INVALID }, + { "variant", ArgString, (void *) &appData.variant, FALSE, (ArgIniType) "normal" }, + { "firstProtocolVersion", ArgInt, (void *) &appData.firstProtocolVersion, FALSE, (ArgIniType) PROTOVER }, + { "secondProtocolVersion", ArgInt, (void *) &appData.secondProtocolVersion,FALSE, (ArgIniType) PROTOVER }, + { "showButtonBar", ArgBoolean, (void *) &appData.showButtonBar, TRUE, (ArgIniType) TRUE }, + { "buttons", ArgTrue, (void *) &appData.showButtonBar, FALSE, INVALID }, + { "xbuttons", ArgFalse, (void *) &appData.showButtonBar, FALSE, INVALID }, + { "-buttons", ArgFalse, (void *) &appData.showButtonBar, FALSE, INVALID }, + + /* [AS] New features */ + { "firstScoreAbs", ArgBoolean, (void *) &appData.firstScoreIsAbsolute, FALSE, (ArgIniType) FALSE }, + { "secondScoreAbs", ArgBoolean, (void *) &appData.secondScoreIsAbsolute, FALSE, (ArgIniType) FALSE }, + { "pgnExtendedInfo", ArgBoolean, (void *) &appData.saveExtendedInfoInPGN, TRUE, (ArgIniType) FALSE }, + { "hideThinkingFromHuman", ArgBoolean, (void *) &appData.hideThinkingFromHuman, TRUE, (ArgIniType) FALSE }, + { "liteBackTextureFile", ArgString, (void *) &appData.liteBackTextureFile, TRUE, (ArgIniType) "" }, + { "darkBackTextureFile", ArgString, (void *) &appData.darkBackTextureFile, TRUE, (ArgIniType) "" }, + { "liteBackTextureMode", ArgInt, (void *) &appData.liteBackTextureMode, TRUE, (ArgIniType) BACK_TEXTURE_MODE_PLAIN }, + { "darkBackTextureMode", ArgInt, (void *) &appData.darkBackTextureMode, TRUE, (ArgIniType) BACK_TEXTURE_MODE_PLAIN }, + { "renderPiecesWithFont", ArgString, (void *) &appData.renderPiecesWithFont, TRUE, (ArgIniType) "" }, + { "fontPieceToCharTable", ArgString, (void *) &appData.fontToPieceTable, TRUE, (ArgIniType) "" }, + { "fontPieceBackColorWhite", ArgColor, (void *) 8, TRUE, (ArgIniType) WHITE_PIECE_COLOR }, + { "fontPieceForeColorWhite", ArgColor, (void *) 9, TRUE, (ArgIniType) WHITE_PIECE_COLOR }, + { "fontPieceBackColorBlack", ArgColor, (void *) 10, TRUE, (ArgIniType) BLACK_PIECE_COLOR }, + { "fontPieceForeColorBlack", ArgColor, (void *) 11, TRUE, (ArgIniType) BLACK_PIECE_COLOR }, + { "fontPieceSize", ArgInt, (void *) &appData.fontPieceSize, TRUE, (ArgIniType) 80 }, + { "overrideLineGap", ArgInt, (void *) &appData.overrideLineGap, TRUE, (ArgIniType) 1 }, + { "adjudicateLossThreshold", ArgInt, (void *) &appData.adjudicateLossThreshold, TRUE, (ArgIniType) 0 }, + { "delayBeforeQuit", ArgInt, (void *) &appData.delayBeforeQuit, TRUE, (ArgIniType) 0 }, + { "delayAfterQuit", ArgInt, (void *) &appData.delayAfterQuit, TRUE, (ArgIniType) 0 }, + { "nameOfDebugFile", ArgFilename, (void *) &appData.nameOfDebugFile, FALSE, (ArgIniType) "winboard.debug" }, + { "debugfile", ArgFilename, (void *) &appData.nameOfDebugFile, FALSE, INVALID }, + { "pgnEventHeader", ArgString, (void *) &appData.pgnEventHeader, TRUE, (ArgIniType) "Computer Chess Game" }, + { "defaultFrcPosition", ArgInt, (void *) &appData.defaultFrcPosition, TRUE, (ArgIniType) -1 }, + { "gameListTags", ArgString, (void *) &appData.gameListTags, TRUE, (ArgIniType) GLT_DEFAULT_TAGS }, + { "saveOutOfBookInfo", ArgBoolean, (void *) &appData.saveOutOfBookInfo, TRUE, (ArgIniType) TRUE }, + { "showEvalInMoveHistory", ArgBoolean, (void *) &appData.showEvalInMoveHistory, TRUE, (ArgIniType) TRUE }, + { "evalHistColorWhite", ArgColor, (void *) 12, TRUE, (ArgIniType) "#FFFFB0" }, + { "evalHistColorBlack", ArgColor, (void *) 13, TRUE, (ArgIniType) "#AD5D3D" }, + { "highlightMoveWithArrow", ArgBoolean, (void *) &appData.highlightMoveWithArrow, TRUE, (ArgIniType) FALSE }, + { "highlightArrowColor", ArgColor, (void *) 14, TRUE, (ArgIniType) "#FFFF80" }, + { "stickyWindows", ArgBoolean, (void *) &appData.useStickyWindows, TRUE, (ArgIniType) TRUE }, + { "adjudicateDrawMoves", ArgInt, (void *) &appData.adjudicateDrawMoves, TRUE, (ArgIniType) 0 }, + { "autoDisplayComment", ArgBoolean, (void *) &appData.autoDisplayComment, TRUE, (ArgIniType) TRUE }, + { "autoDisplayTags", ArgBoolean, (void *) &appData.autoDisplayTags, TRUE, (ArgIniType) TRUE }, + { "firstIsUCI", ArgBoolean, (void *) &appData.firstIsUCI, FALSE, (ArgIniType) FALSE }, + { "fUCI", ArgTrue, (void *) &appData.firstIsUCI, FALSE, INVALID }, + { "secondIsUCI", ArgBoolean, (void *) &appData.secondIsUCI, FALSE, (ArgIniType) FALSE }, + { "sUCI", ArgTrue, (void *) &appData.secondIsUCI, FALSE, INVALID }, + { "firstHasOwnBookUCI", ArgBoolean, (void *) &appData.firstHasOwnBookUCI, FALSE, (ArgIniType) TRUE }, + { "fNoOwnBookUCI", ArgFalse, (void *) &appData.firstHasOwnBookUCI, FALSE, INVALID }, + { "firstXBook", ArgFalse, (void *) &appData.firstHasOwnBookUCI, FALSE, INVALID }, + { "secondHasOwnBookUCI", ArgBoolean, (void *) &appData.secondHasOwnBookUCI, FALSE, (ArgIniType) TRUE }, + { "sNoOwnBookUCI", ArgFalse, (void *) &appData.secondHasOwnBookUCI, FALSE, INVALID }, + { "secondXBook", ArgFalse, (void *) &appData.secondHasOwnBookUCI, FALSE, INVALID }, + { "polyglotDir", ArgFilename, (void *) &appData.polyglotDir, TRUE, (ArgIniType) "" }, + { "usePolyglotBook", ArgBoolean, (void *) &appData.usePolyglotBook, TRUE, (ArgIniType) FALSE }, + { "polyglotBook", ArgFilename, (void *) &appData.polyglotBook, TRUE, (ArgIniType) "" }, + { "defaultHashSize", ArgInt, (void *) &appData.defaultHashSize, TRUE, (ArgIniType) 64 }, + { "defaultCacheSizeEGTB", ArgInt, (void *) &appData.defaultCacheSizeEGTB, TRUE, (ArgIniType) 4 }, + { "defaultPathEGTB", ArgFilename, (void *) &appData.defaultPathEGTB, TRUE, (ArgIniType) "c:\\egtb" }, + + /* [HGM] board-size, adjudication and misc. options */ + { "boardWidth", ArgInt, (void *) &appData.NrFiles, TRUE, (ArgIniType) -1 }, + { "boardHeight", ArgInt, (void *) &appData.NrRanks, TRUE, (ArgIniType) -1 }, + { "holdingsSize", ArgInt, (void *) &appData.holdingsSize, TRUE, (ArgIniType) -1 }, + { "matchPause", ArgInt, (void *) &appData.matchPause, TRUE, (ArgIniType) 10000 }, + { "pieceToCharTable", ArgString, (void *) &appData.pieceToCharTable, FALSE, INVALID }, + { "flipBlack", ArgBoolean, (void *) &appData.upsideDown, TRUE, (ArgIniType) FALSE }, + { "allWhite", ArgBoolean, (void *) &appData.allWhite, TRUE, (ArgIniType) FALSE }, + { "alphaRank", ArgBoolean, (void *) &appData.alphaRank, FALSE, (ArgIniType) FALSE }, + { "firstAlphaRank", ArgBoolean, (void *) &first.alphaRank, FALSE, (ArgIniType) FALSE }, + { "secondAlphaRank", ArgBoolean, (void *) &second.alphaRank, FALSE, (ArgIniType) FALSE }, + { "testClaims", ArgBoolean, (void *) &appData.testClaims, TRUE, (ArgIniType) FALSE }, + { "checkMates", ArgBoolean, (void *) &appData.checkMates, TRUE, (ArgIniType) FALSE }, + { "materialDraws", ArgBoolean, (void *) &appData.materialDraws, TRUE, (ArgIniType) FALSE }, + { "trivialDraws", ArgBoolean, (void *) &appData.trivialDraws, TRUE, (ArgIniType) FALSE }, + { "ruleMoves", ArgInt, (void *) &appData.ruleMoves, TRUE, (ArgIniType) 51 }, + { "repeatsToDraw", ArgInt, (void *) &appData.drawRepeats, TRUE, (ArgIniType) 6 }, + { "autoKibitz", ArgTrue, (void *) &appData.autoKibitz, FALSE, INVALID }, + { "engineDebugOutput", ArgInt, (void *) &appData.engineComments, FALSE, (ArgIniType) 1 }, + { "userName", ArgString, (void *) &appData.userName, FALSE, INVALID }, + { "rewindIndex", ArgInt, (void *) &appData.rewindIndex, FALSE, INVALID }, + { "sameColorGames", ArgInt, (void *) &appData.sameColorGames, FALSE, INVALID }, + { "smpCores", ArgInt, (void *) &appData.smpCores, TRUE, (ArgIniType) 1 }, + { "egtFormats", ArgString, (void *) &appData.egtFormats, TRUE, (ArgIniType) "" }, + { "niceEngines", ArgInt, (void *) &appData.niceEngines, TRUE, INVALID }, + { "firstLogo", ArgFilename, (void *) &appData.firstLogo, FALSE, INVALID }, + { "secondLogo", ArgFilename, (void *) &appData.secondLogo, FALSE, INVALID }, + { "autoLogo", ArgBoolean, (void *) &appData.autoLogo, TRUE, INVALID }, + { "firstOptions", ArgString, (void *) &appData.firstOptions, FALSE, (ArgIniType) "" }, + { "secondOptions", ArgString, (void *) &appData.secondOptions, FALSE, (ArgIniType) "" }, + { "firstNeedsNoncompliantFEN", ArgString, (void *) &appData.fenOverride1, FALSE, (ArgIniType) "" }, + { "secondNeedsNoncompliantFEN", ArgString, (void *) &appData.fenOverride2, FALSE, (ArgIniType) "" }, + { "keepAlive", ArgInt, (void *) &appData.keepAlive, FALSE, INVALID }, + { "icstype", ArgInt, (void *) &ics_type, FALSE, INVALID }, + { "forceIllegalMoves", ArgTrue, (void *) &appData.forceIllegal, FALSE, INVALID }, + +#ifdef ZIPPY + { "zippyTalk", ArgBoolean, (void *) &appData.zippyTalk, FALSE, (ArgIniType) ZIPPY_TALK }, + { "zt", ArgTrue, (void *) &appData.zippyTalk, FALSE, INVALID }, + { "xzt", ArgFalse, (void *) &appData.zippyTalk, FALSE, INVALID }, + { "-zt", ArgFalse, (void *) &appData.zippyTalk, FALSE, INVALID }, + { "zippyPlay", ArgBoolean, (void *) &appData.zippyPlay, FALSE, (ArgIniType) ZIPPY_PLAY }, + { "zp", ArgTrue, (void *) &appData.zippyPlay, FALSE, INVALID }, + { "xzp", ArgFalse, (void *) &appData.zippyPlay, FALSE, INVALID }, + { "-zp", ArgFalse, (void *) &appData.zippyPlay, FALSE, INVALID }, + { "zippyLines", ArgFilename, (void *) &appData.zippyLines, FALSE, (ArgIniType) ZIPPY_LINES }, + { "zippyPinhead", ArgString, (void *) &appData.zippyPinhead, FALSE, (ArgIniType) ZIPPY_PINHEAD }, + { "zippyPassword", ArgString, (void *) &appData.zippyPassword, FALSE, (ArgIniType) ZIPPY_PASSWORD }, + { "zippyPassword2", ArgString, (void *) &appData.zippyPassword2, FALSE, (ArgIniType) ZIPPY_PASSWORD2 }, + { "zippyWrongPassword", ArgString, (void *) &appData.zippyWrongPassword, + FALSE, (ArgIniType) ZIPPY_WRONG_PASSWORD }, + { "zippyAcceptOnly", ArgString, (void *) &appData.zippyAcceptOnly, FALSE, (ArgIniType) ZIPPY_ACCEPT_ONLY }, + { "zippyUseI", ArgBoolean, (void *) &appData.zippyUseI, FALSE, (ArgIniType) ZIPPY_USE_I }, + { "zui", ArgTrue, (void *) &appData.zippyUseI, FALSE, INVALID }, + { "xzui", ArgFalse, (void *) &appData.zippyUseI, FALSE, INVALID }, + { "-zui", ArgFalse, (void *) &appData.zippyUseI, FALSE, INVALID }, + { "zippyBughouse", ArgInt, (void *) &appData.zippyBughouse, FALSE, (ArgIniType) ZIPPY_BUGHOUSE }, + { "zippyNoplayCrafty", ArgBoolean, (void *) &appData.zippyNoplayCrafty, + FALSE, (ArgIniType) ZIPPY_NOPLAY_CRAFTY }, + { "znc", ArgTrue, (void *) &appData.zippyNoplayCrafty, FALSE, INVALID }, + { "xznc", ArgFalse, (void *) &appData.zippyNoplayCrafty, FALSE, INVALID }, + { "-znc", ArgFalse, (void *) &appData.zippyNoplayCrafty, FALSE, INVALID }, + { "zippyGameEnd", ArgString, (void *) &appData.zippyGameEnd, FALSE, (ArgIniType) ZIPPY_GAME_END }, + { "zippyGameStart", ArgString, (void *) &appData.zippyGameStart, FALSE, (ArgIniType) ZIPPY_GAME_START }, + { "zippyAdjourn", ArgBoolean, (void *) &appData.zippyAdjourn, FALSE, (ArgIniType) ZIPPY_ADJOURN }, + { "zadj", ArgTrue, (void *) &appData.zippyAdjourn, FALSE, INVALID }, + { "xzadj", ArgFalse, (void *) &appData.zippyAdjourn, FALSE, INVALID }, + { "-zadj", ArgFalse, (void *) &appData.zippyAdjourn, FALSE, INVALID }, + { "zippyAbort", ArgBoolean, (void *) &appData.zippyAbort, FALSE, (ArgIniType) ZIPPY_ABORT }, + { "zab", ArgTrue, (void *) &appData.zippyAbort, FALSE, INVALID }, + { "xzab", ArgFalse, (void *) &appData.zippyAbort, FALSE, INVALID }, + { "-zab", ArgFalse, (void *) &appData.zippyAbort, FALSE, INVALID }, + { "zippyVariants", ArgString, (void *) &appData.zippyVariants, FALSE, (ArgIniType) ZIPPY_VARIANTS }, + { "zippyMaxGames", ArgInt, (void *)&appData.zippyMaxGames, FALSE, (ArgIniType) ZIPPY_MAX_GAMES}, + { "zippyReplayTimeout", ArgInt, (void *)&appData.zippyReplayTimeout, FALSE, (ArgIniType) ZIPPY_REPLAY_TIMEOUT }, + { "zippyShortGame", ArgInt, (void *)&appData.zippyShortGame, FALSE, INVALID }, + /* Kludge to allow winboard.ini files from buggy 4.0.4 to be read: */ + { "zippyReplyTimeout", ArgInt, (void *)&junk, FALSE, INVALID }, +#endif + /* [HGM] options for broadcasting and time odds */ + { "serverMoves", ArgString, (void *) &appData.serverMovesName, FALSE, (ArgIniType) NULL }, + { "suppressLoadMoves", ArgBoolean, (void *) &appData.suppressLoadMoves, FALSE, (ArgIniType) FALSE }, + { "serverPause", ArgInt, (void *) &appData.serverPause, FALSE, (ArgIniType) 15 }, + { "firstTimeOdds", ArgInt, (void *) &appData.firstTimeOdds, FALSE, (ArgIniType) 1 }, + { "secondTimeOdds", ArgInt, (void *) &appData.secondTimeOdds, FALSE, (ArgIniType) 1 }, + { "timeOddsMode", ArgInt, (void *) &appData.timeOddsMode, TRUE, INVALID }, + { "firstAccumulateTC", ArgInt, (void *) &appData.firstAccumulateTC, FALSE, (ArgIniType) 1 }, + { "secondAccumulateTC", ArgInt, (void *) &appData.secondAccumulateTC, FALSE, (ArgIniType) 1 }, + { "firstNPS", ArgInt, (void *) &appData.firstNPS, FALSE, (ArgIniType) -1 }, + { "secondNPS", ArgInt, (void *) &appData.secondNPS, FALSE, (ArgIniType) -1 }, + { "noGUI", ArgTrue, (void *) &appData.noGUI, FALSE, INVALID }, + { "keepLineBreaksICS", ArgBoolean, (void *) &appData.noJoin, TRUE, INVALID }, + { "wrapContinuationSequence", ArgString, (void *) &appData.wrapContSeq, FALSE, INVALID }, + { "useInternalWrap", ArgTrue, (void *) &appData.useInternalWrap, FALSE, INVALID }, /* noJoin usurps this if set */ + + // [HGM] placement: put all window layouts last in ini file, but man X,Y before all others + { "minX", ArgZ, (void *) &minX, FALSE, INVALID }, // [HGM] placement: to make suer auxialary windows can be placed + { "minY", ArgZ, (void *) &minY, FALSE, INVALID }, + { "winWidth", ArgInt, (void *) &wpMain.width, TRUE, INVALID }, // [HGM] placement: dummies to remember right & bottom + { "winHeight", ArgInt, (void *) &wpMain.height, TRUE, INVALID }, // for attaching auxiliary windows to them + { "x", ArgInt, (void *) &wpMain.x, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "y", ArgInt, (void *) &wpMain.y, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "icsX", ArgX, (void *) &wpConsole.x, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "icsY", ArgY, (void *) &wpConsole.y, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "icsW", ArgInt, (void *) &wpConsole.width, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "icsH", ArgInt, (void *) &wpConsole.height, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "analysisX", ArgX, (void *) &junk, FALSE, INVALID }, // [HGM] placement: analysis window no longer exists + { "analysisY", ArgY, (void *) &junk, FALSE, INVALID }, // provided for compatibility with old ini files + { "analysisW", ArgInt, (void *) &junk, FALSE, INVALID }, + { "analysisH", ArgInt, (void *) &junk, FALSE, INVALID }, + { "commentX", ArgX, (void *) &wpComment.x, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "commentY", ArgY, (void *) &wpComment.y, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "commentW", ArgInt, (void *) &wpComment.width, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "commentH", ArgInt, (void *) &wpComment.height, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "tagsX", ArgX, (void *) &wpTags.x, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "tagsY", ArgY, (void *) &wpTags.y, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "tagsW", ArgInt, (void *) &wpTags.width, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "tagsH", ArgInt, (void *) &wpTags.height, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "gameListX", ArgX, (void *) &wpGameList.x, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "gameListY", ArgY, (void *) &wpGameList.y, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "gameListW", ArgInt, (void *) &wpGameList.width, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "gameListH", ArgInt, (void *) &wpGameList.height, TRUE, (ArgIniType) CW_USEDEFAULT }, + /* [AS] Layout stuff */ + { "moveHistoryUp", ArgBoolean, (void *) &wpMoveHistory.visible, TRUE, (ArgIniType) TRUE }, + { "moveHistoryX", ArgX, (void *) &wpMoveHistory.x, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "moveHistoryY", ArgY, (void *) &wpMoveHistory.y, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "moveHistoryW", ArgInt, (void *) &wpMoveHistory.width, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "moveHistoryH", ArgInt, (void *) &wpMoveHistory.height, TRUE, (ArgIniType) CW_USEDEFAULT }, + + { "evalGraphUp", ArgBoolean, (void *) &wpEvalGraph.visible, TRUE, (ArgIniType) TRUE }, + { "evalGraphX", ArgX, (void *) &wpEvalGraph.x, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "evalGraphY", ArgY, (void *) &wpEvalGraph.y, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "evalGraphW", ArgInt, (void *) &wpEvalGraph.width, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "evalGraphH", ArgInt, (void *) &wpEvalGraph.height, TRUE, (ArgIniType) CW_USEDEFAULT }, + + { "engineOutputUp", ArgBoolean, (void *) &wpEngineOutput.visible, TRUE, (ArgIniType) TRUE }, + { "engineOutputX", ArgX, (void *) &wpEngineOutput.x, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "engineOutputY", ArgY, (void *) &wpEngineOutput.y, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "engineOutputW", ArgInt, (void *) &wpEngineOutput.width, TRUE, (ArgIniType) CW_USEDEFAULT }, + { "engineOutputH", ArgInt, (void *) &wpEngineOutput.height, TRUE, (ArgIniType) CW_USEDEFAULT }, + + { NULL, ArgNone, NULL, FALSE, INVALID } +}; + + +/* Kludge for indirection files on command line */ +char* lastIndirectionFilename; +ArgDescriptor argDescriptorIndirection = +{ "", ArgSettingsFilename, (void *) NULL, FALSE }; + +void +ExitArgError(char *msg, char *badArg) +{ + char buf[MSG_SIZ]; + + sprintf(buf, "%s %s", msg, badArg); + DisplayFatalError(buf, 0, 2); + exit(2); +} + + +char +StringGet(void *getClosure) +{ + char **p = (char **) getClosure; + return *((*p)++); +} + +char +FileGet(void *getClosure) +{ + int c; + FILE* f = (FILE*) getClosure; + + c = getc(f); + if (c == '\r') c = getc(f); // work around DOS format files by bypassing the '\r' completely + if (c == EOF) + return NULLCHAR; + else + return (char) c; +} + +/* Parse settings file named "name". If file found, return the + full name in fullname and return TRUE; else return FALSE */ +Boolean +ParseSettingsFile(char *name, char **addr) +{ + FILE *f; + int ok; char buf[MSG_SIZ], fullname[MSG_SIZ]; + + ok = MySearchPath(installDir, name, fullname); + if(!ok && strchr(name, '.') == NULL) { // [HGM] append default file-name extension '.ini' when needed + sprintf(buf, "%s.ini", name); + ok = MySearchPath(installDir, buf, fullname); + } + if (ok) { + f = fopen(fullname, "r"); + if (f != NULL) { + if (addr != NULL) { + *addr = strdup(fullname); + } + ParseArgs(FileGet, f); + fclose(f); + return TRUE; + } + } + return FALSE; +} + +void +ParseArgs(GetFunc get, void *cl) +{ + char argName[MAX_ARG_LEN]; + char argValue[MAX_ARG_LEN]; + ArgDescriptor *ad; + char start; + char *q; + int i, octval; + char ch; + int posarg = 0; + + ch = get(cl); + for (;;) { + while (ch == ' ' || ch == '\n' || ch == '\t') ch = get(cl); + if (ch == NULLCHAR) break; + if (ch == ';') { + /* Comment to end of line */ + ch = get(cl); + while (ch != '\n' && ch != NULLCHAR) ch = get(cl); + continue; + } else if (ch == '/' || ch == '-') { + /* Switch */ + q = argName; + while (ch != ' ' && ch != '=' && ch != ':' && ch != NULLCHAR && + ch != '\n' && ch != '\t') { + *q++ = ch; + ch = get(cl); + } + *q = NULLCHAR; + + for (ad = argDescriptors; ad->argName != NULL; ad++) + if (strcmp(ad->argName, argName + 1) == 0) break; + + if (ad->argName == NULL) + ExitArgError("Unrecognized argument", argName); + + } else if (ch == '@') { + /* Indirection file */ + ad = &argDescriptorIndirection; + ch = get(cl); + } else { + /* Positional argument */ + ad = &argDescriptors[posarg++]; + strcpy(argName, ad->argName); + } + + if (ad->argType == ArgTrue) { + *(Boolean *) ad->argLoc = TRUE; + continue; + } + if (ad->argType == ArgFalse) { + *(Boolean *) ad->argLoc = FALSE; + continue; + } + + while (ch == ' ' || ch == '=' || ch == ':' || ch == '\t') ch = get(cl); + if (ch == NULLCHAR || ch == '\n') { + ExitArgError("No value provided for argument", argName); + } + q = argValue; + if (ch == '{') { + // Quoting with { }. No characters have to (or can) be escaped. + // Thus the string cannot contain a '}' character. + start = ch; + ch = get(cl); + while (start) { + switch (ch) { + case NULLCHAR: + start = NULLCHAR; + break; + + case '}': + ch = get(cl); + start = NULLCHAR; + break; + + default: + *q++ = ch; + ch = get(cl); + break; + } + } + } else if (ch == '\'' || ch == '"') { + // Quoting with ' ' or " ", with \ as escape character. + // Inconvenient for long strings that may contain Windows filenames. + start = ch; + ch = get(cl); + while (start) { + switch (ch) { + case NULLCHAR: + start = NULLCHAR; + break; + + default: + not_special: + *q++ = ch; + ch = get(cl); + break; + + case '\'': + case '\"': + if (ch == start) { + ch = get(cl); + start = NULLCHAR; + break; + } else { + goto not_special; + } + + case '\\': + if (ad->argType == ArgFilename + || ad->argType == ArgSettingsFilename) { + goto not_special; + } + ch = get(cl); + switch (ch) { + case NULLCHAR: + ExitArgError("Incomplete \\ escape in value for", argName); + break; + case 'n': + *q++ = '\n'; + ch = get(cl); + break; + case 'r': + *q++ = '\r'; + ch = get(cl); + break; + case 't': + *q++ = '\t'; + ch = get(cl); + break; + case 'b': + *q++ = '\b'; + ch = get(cl); + break; + case 'f': + *q++ = '\f'; + ch = get(cl); + break; + default: + octval = 0; + for (i = 0; i < 3; i++) { + if (ch >= '0' && ch <= '7') { + octval = octval*8 + (ch - '0'); + ch = get(cl); + } else { + break; + } + } + if (i > 0) { + *q++ = (char) octval; + } else { + *q++ = ch; + ch = get(cl); + } + break; + } + break; + } + } + } else { + while (ch != ' ' && ch != NULLCHAR && ch != '\t' && ch != '\n') { + *q++ = ch; + ch = get(cl); + } + } + *q = NULLCHAR; + + switch (ad->argType) { + case ArgInt: + *(int *) ad->argLoc = atoi(argValue); + break; + + case ArgX: + *(int *) ad->argLoc = atoi(argValue) + wpMain.x; // [HGM] placement: translate stored relative to absolute + break; + + case ArgY: + *(int *) ad->argLoc = atoi(argValue) + wpMain.y; // (this is really kludgey, it should be done where used...) + break; + + case ArgZ: + *(int *) ad->argLoc = atoi(argValue); + EnsureOnScreen(&wpMain.x, &wpMain.y, minX, minY); + break; + + case ArgFloat: + *(float *) ad->argLoc = (float) atof(argValue); + break; + + case ArgString: + case ArgFilename: + *(char **) ad->argLoc = strdup(argValue); + break; + + case ArgSettingsFilename: + { + if (ParseSettingsFile(argValue, (char**)ad->argLoc)) { + } else { + if (ad->argLoc != NULL) { + } else { + ExitArgError("Failed to open indirection file", argValue); + } + } + } + break; + + case ArgBoolean: + switch (argValue[0]) { + case 't': + case 'T': + *(Boolean *) ad->argLoc = TRUE; + break; + case 'f': + case 'F': + *(Boolean *) ad->argLoc = FALSE; + break; + default: + ExitArgError("Unrecognized boolean argument value", argValue); + break; + } + break; + + case ArgColor: + ParseColor((int)ad->argLoc, argValue); + break; + + case ArgAttribs: { + ColorClass cc = (ColorClass)ad->argLoc; + ParseTextAttribs(cc, argValue); // [HGM] wrapper for platform independency + } + break; + + case ArgBoardSize: + ParseBoardSize(ad->argLoc, argValue); + break; + + case ArgFont: + ParseFont(argValue, (int)ad->argLoc); + break; + + case ArgCommSettings: + ParseCommPortSettings(argValue); + break; + + case ArgNone: + ExitArgError("Unrecognized argument", argValue); + break; + case ArgTrue: + case ArgFalse: ; + } + } +} + +void +ParseIcsTextMenu(char *icsTextMenuString) +{ +// int flags = 0; + IcsTextMenuEntry *e = icsTextMenuEntry; + char *p = icsTextMenuString; + while (e->item != NULL && e < icsTextMenuEntry + ICS_TEXT_MENU_SIZE) { + free(e->item); + e->item = NULL; + if (e->command != NULL) { + free(e->command); + e->command = NULL; + } + e++; + } + e = icsTextMenuEntry; + while (*p && e < icsTextMenuEntry + ICS_TEXT_MENU_SIZE) { + if (*p == ';' || *p == '\n') { + e->item = strdup("-"); + e->command = NULL; + p++; + } else if (*p == '-') { + e->item = strdup("-"); + e->command = NULL; + p++; + if (*p) p++; + } else { + char *q, *r, *s, *t; + char c; + q = strchr(p, ','); + if (q == NULL) break; + *q = NULLCHAR; + r = strchr(q + 1, ','); + if (r == NULL) break; + *r = NULLCHAR; + s = strchr(r + 1, ','); + if (s == NULL) break; + *s = NULLCHAR; + c = ';'; + t = strchr(s + 1, c); + if (t == NULL) { + c = '\n'; + t = strchr(s + 1, c); + } + if (t != NULL) *t = NULLCHAR; + e->item = strdup(p); + e->command = strdup(q + 1); + e->getname = *(r + 1) != '0'; + e->immediate = *(s + 1) != '0'; + *q = ','; + *r = ','; + *s = ','; + if (t == NULL) break; + *t = c; + p = t + 1; + } + e++; + } +} + +void +SetDefaultTextAttribs() +{ + ColorClass cc; + for (cc = (ColorClass)0; cc < ColorNone; cc++) { + ParseTextAttribs(cc, defaultTextAttribs[cc]); + } +} + +void +SetDefaultsFromList() +{ // [HGM] ini: take defaults from argDescriptor list + int i; + + for(i=0; argDescriptors[i].argName != NULL; i++) { + if(argDescriptors[i].defaultValue != INVALID) + switch(argDescriptors[i].argType) { + case ArgBoolean: + case ArgTrue: + case ArgFalse: + *(Boolean *) argDescriptors[i].argLoc = (int)argDescriptors[i].defaultValue; + break; + case ArgInt: + case ArgX: + case ArgY: + case ArgZ: + *(int *) argDescriptors[i].argLoc = (int)argDescriptors[i].defaultValue; + break; + case ArgString: + case ArgFilename: + case ArgSettingsFilename: + *(char **) argDescriptors[i].argLoc = (char *)argDescriptors[i].defaultValue; + break; + case ArgBoardSize: + *(int *) argDescriptors[i].argLoc = (int)argDescriptors[i].defaultValue; + break; + case ArgColor: + ParseColor((int)argDescriptors[i].argLoc, (char*)argDescriptors[i].defaultValue); + break; + case ArgFloat: // floats cannot be casted to int without precision loss + default: ; // some arg types cannot be initialized through table + } + } +} + +void +InitAppData(char *lpCmdLine) +{ + int i; + char buf[MAX_ARG_LEN], currDir[MSG_SIZ]; + char *p; + + /* Initialize to defaults */ + SetDefaultsFromList(); // this sets most defaults + + // some parameters for which there are no options! + appData.Iconic = FALSE; /*unused*/ + appData.icsEngineAnalyze = FALSE; + + // float: casting to int is not harmless, so default cannot be contained in table + appData.timeDelay = TIME_DELAY; + + // some complex, platform-dependent stuff that could not be handled from table + SetDefaultTextAttribs(); + SetFontDefaults(); + SetCommPortDefaults(); + + /* Parse default settings file if any */ + ParseSettingsFile(settingsFileName, &settingsFileName); + + /* Parse command line */ + ParseArgs(StringGet, &lpCmdLine); + + /* [HGM] make sure board size is acceptable */ + if(appData.NrFiles > BOARD_FILES || + appData.NrRanks > BOARD_RANKS ) + DisplayFatalError("Recompile with BOARD_RANKS or BOARD_FILES, to support this size", 0, 2); + + /* [HGM] After parsing the options from the .ini file, and overruling them + * with options from the command line, we now make an even higher priority + * overrule by WB options attached to the engine command line. This so that + * tournament managers can use WB options (such as /timeOdds) that follow + * the engines. + */ + if(appData.firstChessProgram != NULL) { + char *p = StrStr(appData.firstChessProgram, "WBopt"); + static char *f = "first"; + char buf[MSG_SIZ], *q = buf; + if(p != NULL) { // engine command line contains WinBoard options + sprintf(buf, p+6, f, f, f, f, f, f, f, f, f, f); // replace %s in them by "first" + ParseArgs(StringGet, &q); + p[-1] = 0; // cut them offengine command line + } + } + // now do same for second chess program + if(appData.secondChessProgram != NULL) { + char *p = StrStr(appData.secondChessProgram, "WBopt"); + static char *s = "second"; + char buf[MSG_SIZ], *q = buf; + if(p != NULL) { // engine command line contains WinBoard options + sprintf(buf, p+6, s, s, s, s, s, s, s, s, s, s); // replace %s in them by "first" + ParseArgs(StringGet, &q); + p[-1] = 0; // cut them offengine command line + } + } + + /* Propagate options that affect others */ + if (appData.matchMode || appData.matchGames) chessProgram = TRUE; + if (appData.icsActive || appData.noChessProgram) { + chessProgram = FALSE; /* not local chess program mode */ + } + + /* Open startup dialog if needed */ + if ((!appData.noChessProgram && !chessProgram && !appData.icsActive) || + (appData.icsActive && *appData.icsHost == NULLCHAR) || + (chessProgram && (*appData.firstChessProgram == NULLCHAR || + *appData.secondChessProgram == NULLCHAR))) + PopUpStartupDialog(); + + /* Make sure save files land in the right (?) directory */ + if (MyGetFullPathName(appData.saveGameFile, buf)) { + appData.saveGameFile = strdup(buf); + } + if (MyGetFullPathName(appData.savePositionFile, buf)) { + appData.savePositionFile = strdup(buf); + } + + /* Finish initialization for fonts and sounds */ + CreateFonts(); + + GetCurrentDirectory(MSG_SIZ, currDir); + SetCurrentDirectory(installDir); + LoadAllSounds(); + SetCurrentDirectory(currDir); + + p = icsTextMenuString; + if (p[0] == '@') { + FILE* f = fopen(p + 1, "r"); + if (f == NULL) { + DisplayFatalError(p + 1, errno, 2); + return; + } + i = fread(buf, 1, sizeof(buf)-1, f); + fclose(f); + buf[i] = NULLCHAR; + p = buf; + } + ParseIcsTextMenu(strdup(p)); +} + +void +SaveSettings(char* name) +{ + FILE *f; + ArgDescriptor *ad; + char dir[MSG_SIZ], buf[MSG_SIZ]; + + if (!MainWindowUp()) return; + + GetCurrentDirectory(MSG_SIZ, dir); + if(MySearchPath(installDir, name, buf)) { + f = fopen(buf, "w"); + } else { + SetCurrentDirectory(installDir); + f = fopen(name, "w"); + SetCurrentDirectory(dir); + } + if (f == NULL) { + DisplayError(name, errno); + return; + } + + fprintf(f, ";\n"); + fprintf(f, "; %s Save Settings file\n", PACKAGE_STRING); + fprintf(f, ";\n"); + fprintf(f, "; You can edit the values of options that are already set in this file,\n"); + fprintf(f, "; but if you add other options, the next Save Settings will not save them.\n"); + fprintf(f, "; Use a shortcut, an @indirection file, or a .bat file instead.\n"); + fprintf(f, ";\n"); + + GetWindowCoords(); + + /* [AS] Move history */ + wpMoveHistory.visible = MoveHistoryIsUp(); + + /* [AS] Eval graph */ + wpEvalGraph.visible = EvalGraphIsUp(); + + /* [AS] Engine output */ + wpEngineOutput.visible = EngineOutputIsUp(); + + // [HGM] in WB we have to copy sound names to appData first + ExportSounds(); + + for (ad = argDescriptors; ad->argName != NULL; ad++) { + if (!ad->save) continue; + switch (ad->argType) { + case ArgString: + { + char *p = *(char **)ad->argLoc; + if(p == NULL) break; // just in case + if ((strchr(p, '\\') || strchr(p, '\n')) && !strchr(p, '}')) { + /* Quote multiline values or \-containing values + with { } if possible */ + fprintf(f, "/%s={%s}\n", ad->argName, p); + } else { + /* Else quote with " " */ + fprintf(f, "/%s=\"", ad->argName); + while (*p) { + if (*p == '\n') fprintf(f, "\n"); + else if (*p == '\r') fprintf(f, "\\r"); + else if (*p == '\t') fprintf(f, "\\t"); + else if (*p == '\b') fprintf(f, "\\b"); + else if (*p == '\f') fprintf(f, "\\f"); + else if (*p < ' ') fprintf(f, "\\%03o", *p); + else if (*p == '\"') fprintf(f, "\\\""); + else if (*p == '\\') fprintf(f, "\\\\"); + else putc(*p, f); + p++; + } + fprintf(f, "\"\n"); + } + } + break; + case ArgInt: + case ArgZ: + fprintf(f, "/%s=%d\n", ad->argName, *(int *)ad->argLoc); + break; + case ArgX: + fprintf(f, "/%s=%d\n", ad->argName, *(int *)ad->argLoc - wpMain.x); // [HGM] placement: stor relative value + break; + case ArgY: + fprintf(f, "/%s=%d\n", ad->argName, *(int *)ad->argLoc - wpMain.y); + break; + case ArgFloat: + fprintf(f, "/%s=%g\n", ad->argName, *(float *)ad->argLoc); + break; + case ArgBoolean: + fprintf(f, "/%s=%s\n", ad->argName, + (*(Boolean *)ad->argLoc) ? "true" : "false"); + break; + case ArgTrue: + if (*(Boolean *)ad->argLoc) fprintf(f, "/%s\n", ad->argName); + break; + case ArgFalse: + if (!*(Boolean *)ad->argLoc) fprintf(f, "/%s\n", ad->argName); + break; + case ArgColor: + SaveColor(f, ad); + break; + case ArgAttribs: + SaveAttribsArg(f, ad); + break; + case ArgFilename: + if(*(char**)ad->argLoc == NULL) break; // just in case + if (strchr(*(char **)ad->argLoc, '\"')) { + fprintf(f, "/%s='%s'\n", ad->argName, *(char **)ad->argLoc); + } else { + fprintf(f, "/%s=\"%s\"\n", ad->argName, *(char **)ad->argLoc); + } + break; + case ArgBoardSize: + SaveBoardSize(f, ad->argName, ad->argLoc); + break; + case ArgFont: + SaveFontArg(f, ad); + break; + case ArgCommSettings: + PrintCommPortSettings(f, ad->argName); + case ArgNone: + case ArgSettingsFilename: ; + } + } + fclose(f); +} diff --git a/common.h b/common.h index 03f7bb0..e0b6633 100644 --- a/common.h +++ b/common.h @@ -173,6 +173,15 @@ int pclose(FILE *); #define NULLCHAR '\000' #define FEATURE_TIMEOUT 10000 /*ms*/ +#define CLOCK_FONT 0 +#define MESSAGE_FONT 1 +#define COORD_FONT 2 +#define CONSOLE_FONT 3 +#define COMMENT_FONT 4 +#define EDITTAGS_FONT 5 +#define MOVEHISTORY_FONT 6 +#define NUM_FONTS 7 + /* Default to no flashing (the "usual" XBoard behavior) */ #define FLASH_COUNT 0 /* Number of times to flash */ #define FLASH_RATE 5 /* Flashes per second */ @@ -180,6 +189,11 @@ int pclose(FILE *); /* Default delay per character (in msec) while sending login script */ #define MS_LOGIN_DELAY 0 +/* [AS] Support for background textures */ +#define BACK_TEXTURE_MODE_DISABLED 0 +#define BACK_TEXTURE_MODE_PLAIN 1 +#define BACK_TEXTURE_MODE_FULL_RANDOM 2 + /* Zippy defaults */ #define ZIPPY_TALK FALSE #define ZIPPY_PLAY FALSE @@ -678,6 +692,21 @@ typedef struct { int time; /* Milliseconds */ } ChessProgramStats_Move; +/* [AS] Layout management */ +typedef struct { + Boolean visible; + int x; + int y; + int width; + int height; +} WindowPlacement; + +extern WindowPlacement wpEngineOutput; +extern WindowPlacement wpEvalGraph; +extern WindowPlacement wpMoveHistory; +extern WindowPlacement wpGameList; +extern WindowPlacement wpTags; + // [HGM] chat #define MAX_CHAT 3 extern int chatCount; diff --git a/winboard/makefile.gcc b/winboard/makefile.gcc index 4c73c8d..c130416 100644 --- a/winboard/makefile.gcc +++ b/winboard/makefile.gcc @@ -87,7 +87,7 @@ $(PROJ).exe: $(OBJS) $(PROJ).hlp winboard.o: winboard.c config.h winboard.h ../common.h ../frontend.h ../backend.h \ ../moves.h defaults.h resource.h wclipbrd.h \ - wsockerr.h woptions.h wsnap.h ../lists.h help.h + wsockerr.h woptions.h wsnap.h ../lists.h help.h ../args.h $(call compile, $<) backend.o: ../backend.c config.h ../common.h ../frontend.h ../backend.h \ diff --git a/winboard/makefile.ms b/winboard/makefile.ms index e81f17a..6b995b0 100644 --- a/winboard/makefile.ms +++ b/winboard/makefile.ms @@ -92,7 +92,7 @@ parser.c: ../parser.l winboard.obj: winboard.c config.h winboard.h ../common.h ../frontend.h \ ../backend.h ../moves.h wgamelist.h defaults.h resource.h wclipbrd.h \ - wedittags.h wsockerr.h woptions.h wsnap.h ../lists.h help.h + wedittags.h wsockerr.h woptions.h wsnap.h ../lists.h help.h ../args.h $(CC) $(CFLAGS) winboard.c backend.obj: ../backend.c config.h ../common.h ../frontend.h ../backend.h \ diff --git a/winboard/winboard.c b/winboard/winboard.c index ee5fa0c..b34afa1 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -151,11 +151,11 @@ char szConsoleTitle[] = "I C S Interaction"; char *programName; char *settingsFileName; -BOOLEAN saveSettingsOnExit; +Boolean saveSettingsOnExit; char installDir[MSG_SIZ]; BoardSize boardSize; -BOOLEAN chessProgram; +Boolean chessProgram; //static int boardX, boardY; int minX, minY; // [HGM] placement: volatile limits on upper-left corner static int squareSize, lineGap, minorSize; @@ -174,12 +174,10 @@ char *icsNames; char *firstChessProgramNames; char *secondChessProgramNames; -#define ARG_MAX 128*1024 /* [AS] For Roger Brown's very long list! */ - #define PALETTESIZE 256 HINSTANCE hInst; /* current instance */ -BOOLEAN alwaysOnTop = FALSE; +Boolean alwaysOnTop = FALSE; RECT boardRect; COLORREF lightSquareColor, darkSquareColor, whitePieceColor, blackPieceColor, highlightSquareColor, premoveHighlightColor; @@ -206,11 +204,6 @@ static int lastSizing = 0; static int prevStderrPort; static HBITMAP userLogo; -/* [AS] Support for background textures */ -#define BACK_TEXTURE_MODE_DISABLED 0 -#define BACK_TEXTURE_MODE_PLAIN 1 -#define BACK_TEXTURE_MODE_FULL_RANDOM 2 - static HBITMAP liteBackTexture = NULL; static HBITMAP darkBackTexture = NULL; static int liteBackTextureMode = BACK_TEXTURE_MODE_PLAIN; @@ -228,13 +221,6 @@ static struct { int x; int y; int mode; } backTextureSquareInfo[BOARD_RANKS][BOA #endif #endif -char *defaultTextAttribs[] = -{ - COLOR_SHOUT, COLOR_SSHOUT, COLOR_CHANNEL1, COLOR_CHANNEL, COLOR_KIBITZ, - COLOR_TELL, COLOR_CHALLENGE, COLOR_REQUEST, COLOR_SEEK, COLOR_NORMAL, - COLOR_NONE -}; - typedef struct { char *name; int squareSize; @@ -712,6 +698,7 @@ InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine) char *filepart; hInst = hInstance; /* Store instance handle in our global variable */ + programName = szAppName; if (SearchPath(NULL, "WinBoard.exe", NULL, MSG_SIZ, installDir, &filepart)) { *filepart = NULLCHAR; @@ -721,6 +708,17 @@ InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine) gameInfo.boardWidth = gameInfo.boardHeight = 8; // [HGM] won't have open window otherwise screenWidth = screenHeight = 1000; // [HGM] placement: kludge to allow calling EnsureOnScreen from InitAppData InitAppData(lpCmdLine); /* Get run-time parameters */ + /* xboard, and older WinBoards, controlled the move sound with the + appData.ringBellAfterMoves option. In the current WinBoard, we + always turn the option on (so that the backend will call us), + then let the user turn the sound off by setting it to silence if + desired. To accommodate old winboard.ini files saved by old + versions of WinBoard, we also turn off the sound if the option + was initially set to false. [HGM] taken out of InitAppData */ + if (!appData.ringBellAfterMoves) { + sounds[(int)SoundMove].name = strdup(""); + appData.ringBellAfterMoves = TRUE; + } if (appData.debugMode) { debugFP = fopen(appData.nameOfDebugFile, "w"); setbuf(debugFP, NULL); @@ -867,603 +865,78 @@ InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine) } +VOID +InitMenuChecks() +{ + HMENU hmenu = GetMenu(hwndMain); -typedef enum { - ArgString, ArgInt, ArgFloat, ArgBoolean, ArgTrue, ArgFalse, ArgNone, - ArgColor, ArgAttribs, ArgFilename, ArgBoardSize, ArgFont, ArgCommSettings, - ArgSettingsFilename, - ArgX, ArgY, ArgZ // [HGM] placement: for window-placement options stored relative to main window -} ArgType; - -typedef void *ArgIniType; -#define INVALID (ArgIniType) 6915 /* Some number unlikely to be needed as default for anything */ + (void) EnableMenuItem(hmenu, IDM_CommPort, + MF_BYCOMMAND|((appData.icsActive && + *appData.icsCommPort != NULLCHAR) ? + MF_ENABLED : MF_GRAYED)); + (void) CheckMenuItem(hmenu, IDM_SaveSettingsOnExit, + MF_BYCOMMAND|(saveSettingsOnExit ? + MF_CHECKED : MF_UNCHECKED)); +} -typedef struct { - char *argName; - ArgType argType; - /*** - union { - String *pString; // ArgString - int *pInt; // ArgInt - float *pFloat; // ArgFloat - Boolean *pBoolean; // ArgBoolean - COLORREF *pColor; // ArgColor - ColorClass cc; // ArgAttribs - String *pFilename; // ArgFilename - BoardSize *pBoardSize; // ArgBoardSize - int whichFont; // ArgFont - DCB *pDCB; // ArgCommSettings - String *pFilename; // ArgSettingsFilename - } argLoc; - ***/ - LPVOID argLoc; - BOOL save; - ArgIniType defaultValue; -} ArgDescriptor; - -int junk; +//--------------------------------------------------------------------------------------------------------- +#define ICS_TEXT_MENU_SIZE (IDM_CommandXLast - IDM_CommandX + 1) #define XBOARD FALSE -ArgDescriptor argDescriptors[] = { - /* positional arguments */ - { "loadGameFile", ArgFilename, (LPVOID) &appData.loadGameFile, FALSE, INVALID }, - { "", ArgNone, NULL, FALSE, INVALID }, - /* keyword arguments */ - JAWS_ARGS - { "whitePieceColor", ArgColor, (LPVOID) &whitePieceColor, TRUE, INVALID }, - { "wpc", ArgColor, (LPVOID) &whitePieceColor, FALSE, INVALID }, - { "blackPieceColor", ArgColor, (LPVOID) &blackPieceColor, TRUE, INVALID }, - { "bpc", ArgColor, (LPVOID) &blackPieceColor, FALSE, INVALID }, - { "lightSquareColor", ArgColor, (LPVOID) &lightSquareColor, TRUE, INVALID }, - { "lsc", ArgColor, (LPVOID) &lightSquareColor, FALSE, INVALID }, - { "darkSquareColor", ArgColor, (LPVOID) &darkSquareColor, TRUE, INVALID }, - { "dsc", ArgColor, (LPVOID) &darkSquareColor, FALSE, INVALID }, - { "highlightSquareColor", ArgColor, (LPVOID) &highlightSquareColor, TRUE, INVALID }, - { "hsc", ArgColor, (LPVOID) &highlightSquareColor, FALSE, INVALID }, - { "premoveHighlightColor", ArgColor, (LPVOID) &premoveHighlightColor, TRUE, INVALID }, - { "phc", ArgColor, (LPVOID) &premoveHighlightColor, FALSE, INVALID }, - { "movesPerSession", ArgInt, (LPVOID) &appData.movesPerSession, TRUE, (ArgIniType) MOVES_PER_SESSION }, - { "mps", ArgInt, (LPVOID) &appData.movesPerSession, FALSE, INVALID }, - { "initString", ArgString, (LPVOID) &appData.initString, FALSE, INVALID }, - { "firstInitString", ArgString, (LPVOID) &appData.initString, FALSE, (ArgIniType) INIT_STRING }, - { "secondInitString", ArgString, (LPVOID) &appData.secondInitString, FALSE, (ArgIniType) INIT_STRING }, - { "firstComputerString", ArgString, (LPVOID) &appData.firstComputerString, - FALSE, (ArgIniType) COMPUTER_STRING }, - { "secondComputerString", ArgString, (LPVOID) &appData.secondComputerString, - FALSE, (ArgIniType) COMPUTER_STRING }, - { "firstChessProgram", ArgFilename, (LPVOID) &appData.firstChessProgram, - FALSE, (ArgIniType) FIRST_CHESS_PROGRAM }, - { "fcp", ArgFilename, (LPVOID) &appData.firstChessProgram, FALSE, INVALID }, - { "secondChessProgram", ArgFilename, (LPVOID) &appData.secondChessProgram, - FALSE, (ArgIniType) SECOND_CHESS_PROGRAM }, - { "scp", ArgFilename, (LPVOID) &appData.secondChessProgram, FALSE, INVALID }, - { "firstPlaysBlack", ArgBoolean, (LPVOID) &appData.firstPlaysBlack, FALSE, FALSE }, - { "fb", ArgTrue, (LPVOID) &appData.firstPlaysBlack, FALSE, FALSE }, - { "xfb", ArgFalse, (LPVOID) &appData.firstPlaysBlack, FALSE, INVALID }, - { "-fb", ArgFalse, (LPVOID) &appData.firstPlaysBlack, FALSE, INVALID }, - { "noChessProgram", ArgBoolean, (LPVOID) &appData.noChessProgram, FALSE, FALSE }, - { "ncp", ArgTrue, (LPVOID) &appData.noChessProgram, FALSE, INVALID }, - { "xncp", ArgFalse, (LPVOID) &appData.noChessProgram, FALSE, INVALID }, - { "-ncp", ArgFalse, (LPVOID) &appData.noChessProgram, FALSE, INVALID }, - { "firstHost", ArgString, (LPVOID) &appData.firstHost, FALSE, (ArgIniType) FIRST_HOST }, - { "fh", ArgString, (LPVOID) &appData.firstHost, FALSE, INVALID }, - { "secondHost", ArgString, (LPVOID) &appData.secondHost, FALSE, (ArgIniType) SECOND_HOST }, - { "sh", ArgString, (LPVOID) &appData.secondHost, FALSE, INVALID }, - { "firstDirectory", ArgFilename, (LPVOID) &appData.firstDirectory, FALSE, (ArgIniType) FIRST_DIRECTORY }, - { "fd", ArgFilename, (LPVOID) &appData.firstDirectory, FALSE, INVALID }, - { "secondDirectory", ArgFilename, (LPVOID) &appData.secondDirectory, FALSE, (ArgIniType) SECOND_DIRECTORY }, - { "sd", ArgFilename, (LPVOID) &appData.secondDirectory, FALSE, INVALID }, - - /* some options only used by the XBoard front end, and ignored in WinBoard */ - /* Their saving is controlled by XBOARD, which in WinBoard is defined as FALSE */ - { "internetChessServerInputBox", ArgBoolean, (LPVOID) &appData.icsInputBox, XBOARD, (ArgIniType) FALSE }, - { "icsinput", ArgTrue, (LPVOID) &appData.icsInputBox, FALSE, INVALID }, - { "xicsinput", ArgFalse, (LPVOID) &appData.icsInputBox, FALSE, INVALID }, - { "cmail", ArgString, (LPVOID) &appData.cmailGameName, FALSE, (ArgIniType) "" }, - { "soundProgram", ArgFilename, (LPVOID) &appData.soundProgram, XBOARD, (ArgIniType) "play" }, - { "fontSizeTolerance", ArgInt, (LPVOID) &appData.fontSizeTolerance, XBOARD, (ArgIniType) 4 }, - { "lowTimeWarningColor", ArgColor, (LPVOID) &appData.lowTimeWarningColor, XBOARD, - (ArgIniType) LOWTIMEWARNING_COLOR }, - { "lowTimeWarning", ArgBoolean, (LPVOID) &appData.lowTimeWarning, XBOARD, (ArgIniType) FALSE }, - { "titleInWindow", ArgBoolean, (LPVOID) &appData.titleInWindow, XBOARD, (ArgIniType) FALSE }, - { "title", ArgTrue, (LPVOID) &appData.titleInWindow, FALSE, INVALID }, - { "xtitle", ArgFalse, (LPVOID) &appData.titleInWindow, FALSE, INVALID }, - { "flashCount", ArgInt, (LPVOID) &appData.flashCount, XBOARD, (ArgIniType) FLASH_COUNT }, - { "flashRate", ArgInt, (LPVOID) &appData.flashRate, XBOARD, (ArgIniType) FLASH_RATE }, - { "pixmapDirectory", ArgFilename, (LPVOID) &appData.pixmapDirectory, XBOARD, (ArgIniType) "" }, - { "pixmap", ArgFilename, (LPVOID) &appData.pixmapDirectory, FALSE, INVALID }, - { "bitmapDirectory", ArgFilename, (LPVOID) &appData.bitmapDirectory, XBOARD, (ArgIniType) "" }, - { "bm", ArgFilename, (LPVOID) &appData.bitmapDirectory, FALSE, INVALID }, - { "msLoginDelay", ArgInt, (LPVOID) &appData.msLoginDelay, XBOARD, (ArgIniType) MS_LOGIN_DELAY }, - { "pasteSelection", ArgBoolean, (LPVOID) &appData.pasteSelection, XBOARD, (ArgIniType) FALSE }, - - { "remoteShell", ArgFilename, (LPVOID) &appData.remoteShell, FALSE, (ArgIniType) REMOTE_SHELL }, - { "rsh", ArgFilename, (LPVOID) &appData.remoteShell, FALSE, INVALID }, - { "remoteUser", ArgString, (LPVOID) &appData.remoteUser, FALSE, INVALID }, - { "ruser", ArgString, (LPVOID) &appData.remoteUser, FALSE, INVALID }, - { "timeDelay", ArgFloat, (LPVOID) &appData.timeDelay, TRUE, INVALID }, - { "td", ArgFloat, (LPVOID) &appData.timeDelay, FALSE, INVALID }, - { "timeControl", ArgString, (LPVOID) &appData.timeControl, TRUE, (ArgIniType) TIME_CONTROL }, - { "tc", ArgString, (LPVOID) &appData.timeControl, FALSE, INVALID }, - { "timeIncrement", ArgInt, (LPVOID) &appData.timeIncrement, TRUE, (ArgIniType) TIME_INCREMENT }, - { "inc", ArgInt, (LPVOID) &appData.timeIncrement, FALSE, INVALID }, - { "internetChessServerMode", ArgBoolean, (LPVOID) &appData.icsActive, FALSE, INVALID }, - { "ics", ArgTrue, (LPVOID) &appData.icsActive, FALSE, (ArgIniType) FALSE }, - { "xics", ArgFalse, (LPVOID) &appData.icsActive, FALSE, INVALID }, - { "-ics", ArgFalse, (LPVOID) &appData.icsActive, FALSE, INVALID }, - { "internetChessServerHost", ArgString, (LPVOID) &appData.icsHost, FALSE, (ArgIniType) "" }, - { "icshost", ArgString, (LPVOID) &appData.icsHost, FALSE, INVALID }, - { "internetChessServerPort", ArgString, (LPVOID) &appData.icsPort, FALSE, (ArgIniType) ICS_PORT }, - { "icsport", ArgString, (LPVOID) &appData.icsPort, FALSE, INVALID }, - { "internetChessServerCommPort", ArgString, (LPVOID) &appData.icsCommPort, FALSE, (ArgIniType) ICS_COMM_PORT }, - { "icscomm", ArgString, (LPVOID) &appData.icsCommPort, FALSE, INVALID }, - { "internetChessServerComPort", ArgString, (LPVOID) &appData.icsCommPort, FALSE, INVALID }, - { "icscom", ArgString, (LPVOID) &appData.icsCommPort, FALSE, INVALID }, - { "internetChessServerLogonScript", ArgFilename, (LPVOID) &appData.icsLogon, FALSE, (ArgIniType) ICS_LOGON }, - { "icslogon", ArgFilename, (LPVOID) &appData.icsLogon, FALSE, INVALID }, - { "useTelnet", ArgBoolean, (LPVOID) &appData.useTelnet, FALSE, INVALID }, - { "telnet", ArgTrue, (LPVOID) &appData.useTelnet, FALSE, INVALID }, - { "xtelnet", ArgFalse, (LPVOID) &appData.useTelnet, FALSE, INVALID }, - { "-telnet", ArgFalse, (LPVOID) &appData.useTelnet, FALSE, INVALID }, - { "telnetProgram", ArgFilename, (LPVOID) &appData.telnetProgram, FALSE, (ArgIniType) TELNET_PROGRAM }, - { "internetChessserverHelper", ArgFilename, (LPVOID) &appData.icsHelper, - FALSE, INVALID }, // for XB - { "icshelper", ArgFilename, (LPVOID) &appData.icsHelper, FALSE, (ArgIniType) "" }, - { "gateway", ArgString, (LPVOID) &appData.gateway, FALSE, (ArgIniType) "" }, - { "loadGameFile", ArgFilename, (LPVOID) &appData.loadGameFile, FALSE, (ArgIniType) "" }, - { "lgf", ArgFilename, (LPVOID) &appData.loadGameFile, FALSE, INVALID }, - { "loadGameIndex", ArgInt, (LPVOID) &appData.loadGameIndex, FALSE, (ArgIniType) 0 }, - { "lgi", ArgInt, (LPVOID) &appData.loadGameIndex, FALSE, INVALID }, - { "saveGameFile", ArgFilename, (LPVOID) &appData.saveGameFile, TRUE, (ArgIniType) "" }, - { "sgf", ArgFilename, (LPVOID) &appData.saveGameFile, FALSE, INVALID }, - { "autoSaveGames", ArgBoolean, (LPVOID) &appData.autoSaveGames, TRUE, (ArgIniType) FALSE }, - { "autosave", ArgTrue, (LPVOID) &appData.autoSaveGames, FALSE, INVALID }, - { "xautosave", ArgFalse, (LPVOID) &appData.autoSaveGames, FALSE, INVALID }, - { "-autosave", ArgFalse, (LPVOID) &appData.autoSaveGames, FALSE, INVALID }, - { "loadPositionFile", ArgFilename, (LPVOID) &appData.loadPositionFile, FALSE, (ArgIniType) "" }, - { "lpf", ArgFilename, (LPVOID) &appData.loadPositionFile, FALSE, INVALID }, - { "loadPositionIndex", ArgInt, (LPVOID) &appData.loadPositionIndex, FALSE, (ArgIniType) 1 }, - { "lpi", ArgInt, (LPVOID) &appData.loadPositionIndex, FALSE, INVALID }, - { "savePositionFile", ArgFilename, (LPVOID) &appData.savePositionFile, FALSE, (ArgIniType) "" }, - { "spf", ArgFilename, (LPVOID) &appData.savePositionFile, FALSE, INVALID }, - { "matchMode", ArgBoolean, (LPVOID) &appData.matchMode, FALSE, (ArgIniType) FALSE }, - { "mm", ArgTrue, (LPVOID) &appData.matchMode, FALSE, INVALID }, - { "xmm", ArgFalse, (LPVOID) &appData.matchMode, FALSE, INVALID }, - { "-mm", ArgFalse, (LPVOID) &appData.matchMode, FALSE, INVALID }, - { "matchGames", ArgInt, (LPVOID) &appData.matchGames, FALSE, (ArgIniType) 0 }, - { "mg", ArgInt, (LPVOID) &appData.matchGames, FALSE, INVALID }, - { "monoMode", ArgBoolean, (LPVOID) &appData.monoMode, TRUE, (ArgIniType) FALSE }, - { "mono", ArgTrue, (LPVOID) &appData.monoMode, FALSE, INVALID }, - { "xmono", ArgFalse, (LPVOID) &appData.monoMode, FALSE, INVALID }, - { "-mono", ArgFalse, (LPVOID) &appData.monoMode, FALSE, INVALID }, - { "debugMode", ArgBoolean, (LPVOID) &appData.debugMode, FALSE, (ArgIniType) FALSE }, - { "debug", ArgTrue, (LPVOID) &appData.debugMode, FALSE, INVALID }, - { "xdebug", ArgFalse, (LPVOID) &appData.debugMode, FALSE, INVALID }, - { "-debug", ArgFalse, (LPVOID) &appData.debugMode, FALSE, INVALID }, - { "clockMode", ArgBoolean, (LPVOID) &appData.clockMode, FALSE, (ArgIniType) TRUE }, - { "clock", ArgTrue, (LPVOID) &appData.clockMode, FALSE, INVALID }, - { "xclock", ArgFalse, (LPVOID) &appData.clockMode, FALSE, INVALID }, - { "-clock", ArgFalse, (LPVOID) &appData.clockMode, FALSE, INVALID }, - { "searchTime", ArgString, (LPVOID) &appData.searchTime, FALSE, (ArgIniType) "" }, - { "st", ArgString, (LPVOID) &appData.searchTime, FALSE, INVALID }, - { "searchDepth", ArgInt, (LPVOID) &appData.searchDepth, FALSE, (ArgIniType) 0 }, - { "depth", ArgInt, (LPVOID) &appData.searchDepth, FALSE, INVALID }, - { "showCoords", ArgBoolean, (LPVOID) &appData.showCoords, TRUE, (ArgIniType) FALSE }, - { "coords", ArgTrue, (LPVOID) &appData.showCoords, FALSE, INVALID }, - { "xcoords", ArgFalse, (LPVOID) &appData.showCoords, FALSE, INVALID }, - { "-coords", ArgFalse, (LPVOID) &appData.showCoords, FALSE, INVALID }, - { "showThinking", ArgBoolean, (LPVOID) &appData.showThinking, TRUE, (ArgIniType) FALSE }, - { "thinking", ArgTrue, (LPVOID) &appData.showThinking, FALSE, INVALID }, - { "xthinking", ArgFalse, (LPVOID) &appData.showThinking, FALSE, INVALID }, - { "-thinking", ArgFalse, (LPVOID) &appData.showThinking, FALSE, INVALID }, - { "ponderNextMove", ArgBoolean, (LPVOID) &appData.ponderNextMove, TRUE, (ArgIniType) TRUE }, - { "ponder", ArgTrue, (LPVOID) &appData.ponderNextMove, FALSE, INVALID }, - { "xponder", ArgFalse, (LPVOID) &appData.ponderNextMove, FALSE, INVALID }, - { "-ponder", ArgFalse, (LPVOID) &appData.ponderNextMove, FALSE, INVALID }, - { "periodicUpdates", ArgBoolean, (LPVOID) &appData.periodicUpdates, TRUE, (ArgIniType) TRUE }, - { "periodic", ArgTrue, (LPVOID) &appData.periodicUpdates, FALSE, INVALID }, - { "xperiodic", ArgFalse, (LPVOID) &appData.periodicUpdates, FALSE, INVALID }, - { "-periodic", ArgFalse, (LPVOID) &appData.periodicUpdates, FALSE, INVALID }, - { "popupExitMessage", ArgBoolean, (LPVOID) &appData.popupExitMessage, TRUE, (ArgIniType) TRUE }, - { "exit", ArgTrue, (LPVOID) &appData.popupExitMessage, FALSE, INVALID }, - { "xexit", ArgFalse, (LPVOID) &appData.popupExitMessage, FALSE, INVALID }, - { "-exit", ArgFalse, (LPVOID) &appData.popupExitMessage, FALSE, INVALID }, - { "popupMoveErrors", ArgBoolean, (LPVOID) &appData.popupMoveErrors, TRUE, (ArgIniType) FALSE }, - { "popup", ArgTrue, (LPVOID) &appData.popupMoveErrors, FALSE, INVALID }, - { "xpopup", ArgFalse, (LPVOID) &appData.popupMoveErrors, FALSE, INVALID }, - { "-popup", ArgFalse, (LPVOID) &appData.popupMoveErrors, FALSE, INVALID }, - { "popUpErrors", ArgBoolean, (LPVOID) &appData.popupMoveErrors, - FALSE, INVALID }, /* only so that old WinBoard.ini files from betas can be read */ - { "clockFont", ArgFont, (LPVOID) CLOCK_FONT, TRUE, INVALID }, - { "messageFont", ArgFont, (LPVOID) MESSAGE_FONT, TRUE, INVALID }, - { "coordFont", ArgFont, (LPVOID) COORD_FONT, TRUE, INVALID }, - { "tagsFont", ArgFont, (LPVOID) EDITTAGS_FONT, TRUE, INVALID }, - { "commentFont", ArgFont, (LPVOID) COMMENT_FONT, TRUE, INVALID }, - { "icsFont", ArgFont, (LPVOID) CONSOLE_FONT, TRUE, INVALID }, - { "moveHistoryFont", ArgFont, (LPVOID) MOVEHISTORY_FONT, TRUE, INVALID }, /* [AS] */ - { "boardSize", ArgBoardSize, (LPVOID) &boardSize, - TRUE, (ArgIniType) -1 }, /* must come after all fonts */ - { "size", ArgBoardSize, (LPVOID) &boardSize, FALSE, INVALID }, - { "ringBellAfterMoves", ArgBoolean, (LPVOID) &appData.ringBellAfterMoves, - FALSE, (ArgIniType) TRUE }, /* historical; kept only so old winboard.ini files will parse */ - { "bell", ArgTrue, (LPVOID) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB - { "xbell", ArgFalse, (LPVOID) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB - { "movesound", ArgTrue, (LPVOID) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB - { "xmovesound", ArgFalse, (LPVOID) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB - { "alwaysOnTop", ArgBoolean, (LPVOID) &alwaysOnTop, TRUE, INVALID }, - { "top", ArgTrue, (LPVOID) &alwaysOnTop, FALSE, INVALID }, - { "xtop", ArgFalse, (LPVOID) &alwaysOnTop, FALSE, INVALID }, - { "-top", ArgFalse, (LPVOID) &alwaysOnTop, FALSE, INVALID }, - { "autoCallFlag", ArgBoolean, (LPVOID) &appData.autoCallFlag, TRUE, (ArgIniType) FALSE }, - { "autoflag", ArgTrue, (LPVOID) &appData.autoCallFlag, FALSE, INVALID }, - { "xautoflag", ArgFalse, (LPVOID) &appData.autoCallFlag, FALSE, INVALID }, - { "-autoflag", ArgFalse, (LPVOID) &appData.autoCallFlag, FALSE, INVALID }, - { "autoComment", ArgBoolean, (LPVOID) &appData.autoComment, TRUE, (ArgIniType) FALSE }, - { "autocomm", ArgTrue, (LPVOID) &appData.autoComment, FALSE, INVALID }, - { "xautocomm", ArgFalse, (LPVOID) &appData.autoComment, FALSE, INVALID }, - { "-autocomm", ArgFalse, (LPVOID) &appData.autoComment, FALSE, INVALID }, - { "autoObserve", ArgBoolean, (LPVOID) &appData.autoObserve, TRUE, (ArgIniType) FALSE }, - { "autobs", ArgTrue, (LPVOID) &appData.autoObserve, FALSE, INVALID }, - { "xautobs", ArgFalse, (LPVOID) &appData.autoObserve, FALSE, INVALID }, - { "-autobs", ArgFalse, (LPVOID) &appData.autoObserve, FALSE, INVALID }, - { "flipView", ArgBoolean, (LPVOID) &appData.flipView, FALSE, (ArgIniType) FALSE }, - { "flip", ArgTrue, (LPVOID) &appData.flipView, FALSE, INVALID }, - { "xflip", ArgFalse, (LPVOID) &appData.flipView, FALSE, INVALID }, - { "-flip", ArgFalse, (LPVOID) &appData.flipView, FALSE, INVALID }, - { "autoFlipView", ArgBoolean, (LPVOID) &appData.autoFlipView, TRUE, (ArgIniType) TRUE }, - { "autoflip", ArgTrue, (LPVOID) &appData.autoFlipView, FALSE, INVALID }, - { "xautoflip", ArgFalse, (LPVOID) &appData.autoFlipView, FALSE, INVALID }, - { "-autoflip", ArgFalse, (LPVOID) &appData.autoFlipView, FALSE, INVALID }, - { "autoRaiseBoard", ArgBoolean, (LPVOID) &appData.autoRaiseBoard, TRUE, (ArgIniType) TRUE }, - { "autoraise", ArgTrue, (LPVOID) &appData.autoRaiseBoard, FALSE, INVALID }, - { "xautoraise", ArgFalse, (LPVOID) &appData.autoRaiseBoard, FALSE, INVALID }, - { "-autoraise", ArgFalse, (LPVOID) &appData.autoRaiseBoard, FALSE, INVALID }, - { "alwaysPromoteToQueen", ArgBoolean, (LPVOID) &appData.alwaysPromoteToQueen, TRUE, (ArgIniType) FALSE }, - { "queen", ArgTrue, (LPVOID) &appData.alwaysPromoteToQueen, FALSE, INVALID }, - { "xqueen", ArgFalse, (LPVOID) &appData.alwaysPromoteToQueen, FALSE, INVALID }, - { "-queen", ArgFalse, (LPVOID) &appData.alwaysPromoteToQueen, FALSE, INVALID }, - { "oldSaveStyle", ArgBoolean, (LPVOID) &appData.oldSaveStyle, TRUE, (ArgIniType) FALSE }, - { "oldsave", ArgTrue, (LPVOID) &appData.oldSaveStyle, FALSE, INVALID }, - { "xoldsave", ArgFalse, (LPVOID) &appData.oldSaveStyle, FALSE, INVALID }, - { "-oldsave", ArgFalse, (LPVOID) &appData.oldSaveStyle, FALSE, INVALID }, - { "quietPlay", ArgBoolean, (LPVOID) &appData.quietPlay, TRUE, (ArgIniType) FALSE }, - { "quiet", ArgTrue, (LPVOID) &appData.quietPlay, FALSE, INVALID }, - { "xquiet", ArgFalse, (LPVOID) &appData.quietPlay, FALSE, INVALID }, - { "-quiet", ArgFalse, (LPVOID) &appData.quietPlay, FALSE, INVALID }, - { "getMoveList", ArgBoolean, (LPVOID) &appData.getMoveList, TRUE, (ArgIniType) TRUE }, - { "moves", ArgTrue, (LPVOID) &appData.getMoveList, FALSE, INVALID }, - { "xmoves", ArgFalse, (LPVOID) &appData.getMoveList, FALSE, INVALID }, - { "-moves", ArgFalse, (LPVOID) &appData.getMoveList, FALSE, INVALID }, - { "testLegality", ArgBoolean, (LPVOID) &appData.testLegality, TRUE, (ArgIniType) TRUE }, - { "legal", ArgTrue, (LPVOID) &appData.testLegality, FALSE, INVALID }, - { "xlegal", ArgFalse, (LPVOID) &appData.testLegality, FALSE, INVALID }, - { "-legal", ArgFalse, (LPVOID) &appData.testLegality, FALSE, INVALID }, - { "premove", ArgBoolean, (LPVOID) &appData.premove, TRUE, (ArgIniType) TRUE }, - { "pre", ArgTrue, (LPVOID) &appData.premove, FALSE, INVALID }, - { "xpre", ArgFalse, (LPVOID) &appData.premove, FALSE, INVALID }, - { "-pre", ArgFalse, (LPVOID) &appData.premove, FALSE, INVALID }, - { "premoveWhite", ArgBoolean, (LPVOID) &appData.premoveWhite, TRUE, (ArgIniType) FALSE }, - { "prewhite", ArgTrue, (LPVOID) &appData.premoveWhite, FALSE, INVALID }, - { "xprewhite", ArgFalse, (LPVOID) &appData.premoveWhite, FALSE, INVALID }, - { "-prewhite", ArgFalse, (LPVOID) &appData.premoveWhite, FALSE, INVALID }, - { "premoveWhiteText", ArgString, (LPVOID) &appData.premoveWhiteText, TRUE, (ArgIniType) "" }, - { "premoveBlack", ArgBoolean, (LPVOID) &appData.premoveBlack, TRUE, (ArgIniType) FALSE }, - { "preblack", ArgTrue, (LPVOID) &appData.premoveBlack, FALSE, INVALID }, - { "xpreblack", ArgFalse, (LPVOID) &appData.premoveBlack, FALSE, INVALID }, - { "-preblack", ArgFalse, (LPVOID) &appData.premoveBlack, FALSE, INVALID }, - { "premoveBlackText", ArgString, (LPVOID) &appData.premoveBlackText, TRUE, (ArgIniType) "" }, - { "icsAlarm", ArgBoolean, (LPVOID) &appData.icsAlarm, TRUE, (ArgIniType) TRUE}, - { "alarm", ArgTrue, (LPVOID) &appData.icsAlarm, FALSE}, - { "xalarm", ArgFalse, (LPVOID) &appData.icsAlarm, FALSE}, - { "-alarm", ArgFalse, (LPVOID) &appData.icsAlarm, FALSE}, - { "icsAlarmTime", ArgInt, (LPVOID) &appData.icsAlarmTime, TRUE, (ArgIniType) 5000}, - { "localLineEditing", ArgBoolean, (LPVOID) &appData.localLineEditing, FALSE, (ArgIniType) TRUE}, - { "edit", ArgTrue, (LPVOID) &appData.localLineEditing, FALSE, INVALID }, - { "xedit", ArgFalse, (LPVOID) &appData.localLineEditing, FALSE, INVALID }, - { "-edit", ArgFalse, (LPVOID) &appData.localLineEditing, FALSE, INVALID }, - { "animateMoving", ArgBoolean, (LPVOID) &appData.animate, TRUE, (ArgIniType) TRUE }, - { "animate", ArgTrue, (LPVOID) &appData.animate, FALSE, INVALID }, - { "xanimate", ArgFalse, (LPVOID) &appData.animate, FALSE, INVALID }, - { "-animate", ArgFalse, (LPVOID) &appData.animate, FALSE, INVALID }, - { "animateSpeed", ArgInt, (LPVOID) &appData.animSpeed, TRUE, (ArgIniType) 10 }, - { "animateDragging", ArgBoolean, (LPVOID) &appData.animateDragging, TRUE, (ArgIniType) TRUE }, - { "drag", ArgTrue, (LPVOID) &appData.animateDragging, FALSE, INVALID }, - { "xdrag", ArgFalse, (LPVOID) &appData.animateDragging, FALSE, INVALID }, - { "-drag", ArgFalse, (LPVOID) &appData.animateDragging, FALSE, INVALID }, - { "blindfold", ArgBoolean, (LPVOID) &appData.blindfold, TRUE, (ArgIniType) FALSE }, - { "blind", ArgTrue, (LPVOID) &appData.blindfold, FALSE, INVALID }, - { "xblind", ArgFalse, (LPVOID) &appData.blindfold, FALSE, INVALID }, - { "-blind", ArgFalse, (LPVOID) &appData.blindfold, FALSE, INVALID }, - { "highlightLastMove", ArgBoolean, - (LPVOID) &appData.highlightLastMove, TRUE, (ArgIniType) TRUE }, - { "highlight", ArgTrue, (LPVOID) &appData.highlightLastMove, FALSE, INVALID }, - { "xhighlight", ArgFalse, (LPVOID) &appData.highlightLastMove, FALSE, INVALID }, - { "-highlight", ArgFalse, (LPVOID) &appData.highlightLastMove, FALSE, INVALID }, - { "highlightDragging", ArgBoolean, - (LPVOID) &appData.highlightDragging, TRUE, INVALID }, - { "highdrag", ArgTrue, (LPVOID) &appData.highlightDragging, FALSE, INVALID }, - { "xhighdrag", ArgFalse, (LPVOID) &appData.highlightDragging, FALSE, INVALID }, - { "-highdrag", ArgFalse, (LPVOID) &appData.highlightDragging, FALSE, INVALID }, - { "colorizeMessages", ArgBoolean, (LPVOID) &appData.colorize, TRUE, (ArgIniType) TRUE }, - { "colorize", ArgTrue, (LPVOID) &appData.colorize, FALSE, INVALID }, - { "xcolorize", ArgFalse, (LPVOID) &appData.colorize, FALSE, INVALID }, - { "-colorize", ArgFalse, (LPVOID) &appData.colorize, FALSE, INVALID }, - { "colorShout", ArgAttribs, (LPVOID) ColorShout, TRUE, INVALID }, - { "colorSShout", ArgAttribs, (LPVOID) ColorSShout, TRUE, INVALID }, - { "colorChannel1", ArgAttribs, (LPVOID) ColorChannel1, TRUE, INVALID }, - { "colorChannel", ArgAttribs, (LPVOID) ColorChannel, TRUE, INVALID }, - { "colorKibitz", ArgAttribs, (LPVOID) ColorKibitz, TRUE, INVALID }, - { "colorTell", ArgAttribs, (LPVOID) ColorTell, TRUE, INVALID }, - { "colorChallenge", ArgAttribs, (LPVOID) ColorChallenge, TRUE, INVALID }, - { "colorRequest", ArgAttribs, (LPVOID) ColorRequest, TRUE, INVALID }, - { "colorSeek", ArgAttribs, (LPVOID) ColorSeek, TRUE, INVALID }, - { "colorNormal", ArgAttribs, (LPVOID) ColorNormal, TRUE, INVALID }, - { "colorBackground", ArgColor, (LPVOID) &consoleBackgroundColor, TRUE, INVALID }, - { "soundShout", ArgFilename, (LPVOID) &appData.soundShout, TRUE, (ArgIniType) "" }, - { "soundSShout", ArgFilename, (LPVOID) &appData.soundSShout, TRUE, (ArgIniType) "" }, - { "soundCShout", ArgFilename, (LPVOID) &appData.soundSShout, TRUE, (ArgIniType) "" }, // for XB - { "soundChannel1", ArgFilename, (LPVOID) &appData.soundChannel1, TRUE, (ArgIniType) "" }, - { "soundChannel", ArgFilename, (LPVOID) &appData.soundChannel, TRUE, (ArgIniType) "" }, - { "soundKibitz", ArgFilename, (LPVOID) &appData.soundKibitz, TRUE, (ArgIniType) "" }, - { "soundTell", ArgFilename, (LPVOID) &appData.soundTell, TRUE, (ArgIniType) "" }, - { "soundChallenge", ArgFilename, (LPVOID) &appData.soundChallenge, TRUE, (ArgIniType) "" }, - { "soundRequest", ArgFilename, (LPVOID) &appData.soundRequest, TRUE, (ArgIniType) "" }, - { "soundSeek", ArgFilename, (LPVOID) &appData.soundSeek, TRUE, (ArgIniType) "" }, - { "soundMove", ArgFilename, (LPVOID) &appData.soundMove, TRUE, (ArgIniType) "" }, - { "soundBell", ArgFilename, (LPVOID) &appData.soundBell, TRUE, (ArgIniType) SOUND_BELL }, - { "soundIcsWin", ArgFilename, (LPVOID) &appData.soundIcsWin, TRUE, (ArgIniType) "" }, - { "soundIcsLoss", ArgFilename, (LPVOID) &appData.soundIcsLoss, TRUE, (ArgIniType) "" }, - { "soundIcsDraw", ArgFilename, (LPVOID) &appData.soundIcsDraw, TRUE, (ArgIniType) "" }, - { "soundIcsUnfinished", ArgFilename, (LPVOID) &appData.soundIcsUnfinished, TRUE, (ArgIniType) "" }, - { "soundIcsAlarm", ArgFilename, (LPVOID) &appData.soundIcsAlarm, TRUE, (ArgIniType) "" }, - { "reuseFirst", ArgBoolean, (LPVOID) &appData.reuseFirst, FALSE, (ArgIniType) TRUE }, - { "reuse", ArgTrue, (LPVOID) &appData.reuseFirst, FALSE, INVALID }, - { "xreuse", ArgFalse, (LPVOID) &appData.reuseFirst, FALSE, INVALID }, - { "-reuse", ArgFalse, (LPVOID) &appData.reuseFirst, FALSE, INVALID }, - { "reuseChessPrograms", ArgBoolean, - (LPVOID) &appData.reuseFirst, FALSE, INVALID }, /* backward compat only */ - { "reuseSecond", ArgBoolean, (LPVOID) &appData.reuseSecond, FALSE, (ArgIniType) TRUE }, - { "reuse2", ArgTrue, (LPVOID) &appData.reuseSecond, FALSE, INVALID }, - { "xreuse2", ArgFalse, (LPVOID) &appData.reuseSecond, FALSE, INVALID }, - { "-reuse2", ArgFalse, (LPVOID) &appData.reuseSecond, FALSE, INVALID }, - { "comPortSettings", ArgCommSettings, (LPVOID) &dcb, TRUE, INVALID }, - { "settingsFile", ArgSettingsFilename, (LPVOID) &settingsFileName, FALSE, (ArgIniType) SETTINGS_FILE }, - { "ini", ArgSettingsFilename, (LPVOID) &settingsFileName, FALSE, INVALID }, - { "saveSettingsOnExit", ArgBoolean, (LPVOID) &saveSettingsOnExit, TRUE, (ArgIniType) TRUE }, - { "chessProgram", ArgBoolean, (LPVOID) &chessProgram, FALSE, (ArgIniType) FALSE }, - { "cp", ArgTrue, (LPVOID) &chessProgram, FALSE, INVALID }, - { "xcp", ArgFalse, (LPVOID) &chessProgram, FALSE, INVALID }, - { "-cp", ArgFalse, (LPVOID) &chessProgram, FALSE, INVALID }, - { "icsMenu", ArgString, (LPVOID) &icsTextMenuString, TRUE, (ArgIniType) ICS_TEXT_MENU_DEFAULT }, - { "icsNames", ArgString, (LPVOID) &icsNames, TRUE, (ArgIniType) ICS_NAMES }, - { "firstChessProgramNames", ArgString, (LPVOID) &firstChessProgramNames, - TRUE, (ArgIniType) FCP_NAMES }, - { "secondChessProgramNames", ArgString, (LPVOID) &secondChessProgramNames, - TRUE, (ArgIniType) SCP_NAMES }, - { "initialMode", ArgString, (LPVOID) &appData.initialMode, FALSE, (ArgIniType) "" }, - { "mode", ArgString, (LPVOID) &appData.initialMode, FALSE, INVALID }, - { "variant", ArgString, (LPVOID) &appData.variant, FALSE, (ArgIniType) "normal" }, - { "firstProtocolVersion", ArgInt, (LPVOID) &appData.firstProtocolVersion, FALSE, (ArgIniType) PROTOVER }, - { "secondProtocolVersion", ArgInt, (LPVOID) &appData.secondProtocolVersion,FALSE, (ArgIniType) PROTOVER }, - { "showButtonBar", ArgBoolean, (LPVOID) &appData.showButtonBar, TRUE, (ArgIniType) TRUE }, - { "buttons", ArgTrue, (LPVOID) &appData.showButtonBar, FALSE, INVALID }, - { "xbuttons", ArgFalse, (LPVOID) &appData.showButtonBar, FALSE, INVALID }, - { "-buttons", ArgFalse, (LPVOID) &appData.showButtonBar, FALSE, INVALID }, - - /* [AS] New features */ - { "firstScoreAbs", ArgBoolean, (LPVOID) &appData.firstScoreIsAbsolute, FALSE, (ArgIniType) FALSE }, - { "secondScoreAbs", ArgBoolean, (LPVOID) &appData.secondScoreIsAbsolute, FALSE, (ArgIniType) FALSE }, - { "pgnExtendedInfo", ArgBoolean, (LPVOID) &appData.saveExtendedInfoInPGN, TRUE, (ArgIniType) FALSE }, - { "hideThinkingFromHuman", ArgBoolean, (LPVOID) &appData.hideThinkingFromHuman, TRUE, (ArgIniType) FALSE }, - { "liteBackTextureFile", ArgString, (LPVOID) &appData.liteBackTextureFile, TRUE, (ArgIniType) "" }, - { "darkBackTextureFile", ArgString, (LPVOID) &appData.darkBackTextureFile, TRUE, (ArgIniType) "" }, - { "liteBackTextureMode", ArgInt, (LPVOID) &appData.liteBackTextureMode, TRUE, (ArgIniType) BACK_TEXTURE_MODE_PLAIN }, - { "darkBackTextureMode", ArgInt, (LPVOID) &appData.darkBackTextureMode, TRUE, (ArgIniType) BACK_TEXTURE_MODE_PLAIN }, - { "renderPiecesWithFont", ArgString, (LPVOID) &appData.renderPiecesWithFont, TRUE, (ArgIniType) "" }, - { "fontPieceToCharTable", ArgString, (LPVOID) &appData.fontToPieceTable, TRUE, (ArgIniType) "" }, - { "fontPieceBackColorWhite", ArgColor, (LPVOID) &appData.fontBackColorWhite, TRUE, (ArgIniType) 0 }, - { "fontPieceForeColorWhite", ArgColor, (LPVOID) &appData.fontForeColorWhite, TRUE, (ArgIniType) 0 }, - { "fontPieceBackColorBlack", ArgColor, (LPVOID) &appData.fontBackColorBlack, TRUE, (ArgIniType) 0 }, - { "fontPieceForeColorBlack", ArgColor, (LPVOID) &appData.fontForeColorBlack, TRUE, (ArgIniType) 0 }, - { "fontPieceSize", ArgInt, (LPVOID) &appData.fontPieceSize, TRUE, (ArgIniType) 80 }, - { "overrideLineGap", ArgInt, (LPVOID) &appData.overrideLineGap, TRUE, (ArgIniType) 1 }, - { "adjudicateLossThreshold", ArgInt, (LPVOID) &appData.adjudicateLossThreshold, TRUE, (ArgIniType) 0 }, - { "delayBeforeQuit", ArgInt, (LPVOID) &appData.delayBeforeQuit, TRUE, (ArgIniType) 0 }, - { "delayAfterQuit", ArgInt, (LPVOID) &appData.delayAfterQuit, TRUE, (ArgIniType) 0 }, - { "nameOfDebugFile", ArgFilename, (LPVOID) &appData.nameOfDebugFile, FALSE, (ArgIniType) "winboard.debug" }, - { "debugfile", ArgFilename, (LPVOID) &appData.nameOfDebugFile, FALSE, INVALID }, - { "pgnEventHeader", ArgString, (LPVOID) &appData.pgnEventHeader, TRUE, (ArgIniType) "Computer Chess Game" }, - { "defaultFrcPosition", ArgInt, (LPVOID) &appData.defaultFrcPosition, TRUE, (ArgIniType) -1 }, - { "gameListTags", ArgString, (LPVOID) &appData.gameListTags, TRUE, (ArgIniType) GLT_DEFAULT_TAGS }, - { "saveOutOfBookInfo", ArgBoolean, (LPVOID) &appData.saveOutOfBookInfo, TRUE, (ArgIniType) TRUE }, - { "showEvalInMoveHistory", ArgBoolean, (LPVOID) &appData.showEvalInMoveHistory, TRUE, (ArgIniType) TRUE }, - { "evalHistColorWhite", ArgColor, (LPVOID) &appData.evalHistColorWhite, TRUE, INVALID }, - { "evalHistColorBlack", ArgColor, (LPVOID) &appData.evalHistColorBlack, TRUE, INVALID }, - { "highlightMoveWithArrow", ArgBoolean, (LPVOID) &appData.highlightMoveWithArrow, TRUE, (ArgIniType) FALSE }, - { "highlightArrowColor", ArgColor, (LPVOID) &appData.highlightArrowColor, TRUE, INVALID }, - { "stickyWindows", ArgBoolean, (LPVOID) &appData.useStickyWindows, TRUE, (ArgIniType) TRUE }, - { "adjudicateDrawMoves", ArgInt, (LPVOID) &appData.adjudicateDrawMoves, TRUE, (ArgIniType) TRUE }, - { "autoDisplayComment", ArgBoolean, (LPVOID) &appData.autoDisplayComment, TRUE, (ArgIniType) TRUE }, - { "autoDisplayTags", ArgBoolean, (LPVOID) &appData.autoDisplayTags, TRUE, (ArgIniType) TRUE }, - { "firstIsUCI", ArgBoolean, (LPVOID) &appData.firstIsUCI, FALSE, (ArgIniType) FALSE }, - { "fUCI", ArgTrue, (LPVOID) &appData.firstIsUCI, FALSE, INVALID }, - { "secondIsUCI", ArgBoolean, (LPVOID) &appData.secondIsUCI, FALSE, (ArgIniType) FALSE }, - { "sUCI", ArgTrue, (LPVOID) &appData.secondIsUCI, FALSE, INVALID }, - { "firstHasOwnBookUCI", ArgBoolean, (LPVOID) &appData.firstHasOwnBookUCI, FALSE, (ArgIniType) TRUE }, - { "fNoOwnBookUCI", ArgFalse, (LPVOID) &appData.firstHasOwnBookUCI, FALSE, INVALID }, - { "firstXBook", ArgFalse, (LPVOID) &appData.firstHasOwnBookUCI, FALSE, INVALID }, - { "secondHasOwnBookUCI", ArgBoolean, (LPVOID) &appData.secondHasOwnBookUCI, FALSE, (ArgIniType) TRUE }, - { "sNoOwnBookUCI", ArgFalse, (LPVOID) &appData.secondHasOwnBookUCI, FALSE, INVALID }, - { "secondXBook", ArgFalse, (LPVOID) &appData.secondHasOwnBookUCI, FALSE, INVALID }, - { "polyglotDir", ArgFilename, (LPVOID) &appData.polyglotDir, TRUE, (ArgIniType) "" }, - { "usePolyglotBook", ArgBoolean, (LPVOID) &appData.usePolyglotBook, TRUE, (ArgIniType) FALSE }, - { "polyglotBook", ArgFilename, (LPVOID) &appData.polyglotBook, TRUE, (ArgIniType) "" }, - { "defaultHashSize", ArgInt, (LPVOID) &appData.defaultHashSize, TRUE, (ArgIniType) 64 }, - { "defaultCacheSizeEGTB", ArgInt, (LPVOID) &appData.defaultCacheSizeEGTB, TRUE, (ArgIniType) 4 }, - { "defaultPathEGTB", ArgFilename, (LPVOID) &appData.defaultPathEGTB, TRUE, (ArgIniType) "c:\\egtb" }, - - /* [HGM] board-size, adjudication and misc. options */ - { "boardWidth", ArgInt, (LPVOID) &appData.NrFiles, TRUE, (ArgIniType) -1 }, - { "boardHeight", ArgInt, (LPVOID) &appData.NrRanks, TRUE, (ArgIniType) -1 }, - { "holdingsSize", ArgInt, (LPVOID) &appData.holdingsSize, TRUE, (ArgIniType) -1 }, - { "matchPause", ArgInt, (LPVOID) &appData.matchPause, TRUE, (ArgIniType) 10000 }, - { "pieceToCharTable", ArgString, (LPVOID) &appData.pieceToCharTable, FALSE, INVALID }, - { "flipBlack", ArgBoolean, (LPVOID) &appData.upsideDown, TRUE, (ArgIniType) FALSE }, - { "allWhite", ArgBoolean, (LPVOID) &appData.allWhite, TRUE, (ArgIniType) FALSE }, - { "alphaRank", ArgBoolean, (LPVOID) &appData.alphaRank, FALSE, (ArgIniType) FALSE }, - { "firstAlphaRank", ArgBoolean, (LPVOID) &first.alphaRank, FALSE, (ArgIniType) FALSE }, - { "secondAlphaRank", ArgBoolean, (LPVOID) &second.alphaRank, FALSE, (ArgIniType) FALSE }, - { "testClaims", ArgBoolean, (LPVOID) &appData.testClaims, TRUE, (ArgIniType) FALSE }, - { "checkMates", ArgBoolean, (LPVOID) &appData.checkMates, TRUE, (ArgIniType) FALSE }, - { "materialDraws", ArgBoolean, (LPVOID) &appData.materialDraws, TRUE, (ArgIniType) FALSE }, - { "trivialDraws", ArgBoolean, (LPVOID) &appData.trivialDraws, TRUE, (ArgIniType) FALSE }, - { "ruleMoves", ArgInt, (LPVOID) &appData.ruleMoves, TRUE, (ArgIniType) 51 }, - { "repeatsToDraw", ArgInt, (LPVOID) &appData.drawRepeats, TRUE, (ArgIniType) 6 }, - { "autoKibitz", ArgTrue, (LPVOID) &appData.autoKibitz, FALSE, INVALID }, - { "engineDebugOutput", ArgInt, (LPVOID) &appData.engineComments, FALSE, (ArgIniType) 1 }, - { "userName", ArgString, (LPVOID) &appData.userName, FALSE, INVALID }, - { "rewindIndex", ArgInt, (LPVOID) &appData.rewindIndex, FALSE, INVALID }, - { "sameColorGames", ArgInt, (LPVOID) &appData.sameColorGames, FALSE, INVALID }, - { "smpCores", ArgInt, (LPVOID) &appData.smpCores, TRUE, (ArgIniType) 1 }, - { "egtFormats", ArgString, (LPVOID) &appData.egtFormats, TRUE, (ArgIniType) "" }, - { "niceEngines", ArgInt, (LPVOID) &appData.niceEngines, TRUE, INVALID }, - { "firstLogo", ArgFilename, (LPVOID) &appData.firstLogo, FALSE, INVALID }, - { "secondLogo", ArgFilename, (LPVOID) &appData.secondLogo, FALSE, INVALID }, - { "autoLogo", ArgBoolean, (LPVOID) &appData.autoLogo, TRUE, INVALID }, - { "firstOptions", ArgString, (LPVOID) &appData.firstOptions, FALSE, (ArgIniType) "" }, - { "secondOptions", ArgString, (LPVOID) &appData.secondOptions, FALSE, (ArgIniType) "" }, - { "firstNeedsNoncompliantFEN", ArgString, (LPVOID) &appData.fenOverride1, FALSE, (ArgIniType) "" }, - { "secondNeedsNoncompliantFEN", ArgString, (LPVOID) &appData.fenOverride2, FALSE, (ArgIniType) "" }, - { "keepAlive", ArgInt, (LPVOID) &appData.keepAlive, FALSE, INVALID }, - { "icstype", ArgInt, (LPVOID) &ics_type, FALSE, INVALID }, - { "forceIllegalMoves", ArgTrue, (LPVOID) &appData.forceIllegal, FALSE, INVALID }, - -#ifdef ZIPPY - { "zippyTalk", ArgBoolean, (LPVOID) &appData.zippyTalk, FALSE, (ArgIniType) ZIPPY_TALK }, - { "zt", ArgTrue, (LPVOID) &appData.zippyTalk, FALSE, INVALID }, - { "xzt", ArgFalse, (LPVOID) &appData.zippyTalk, FALSE, INVALID }, - { "-zt", ArgFalse, (LPVOID) &appData.zippyTalk, FALSE, INVALID }, - { "zippyPlay", ArgBoolean, (LPVOID) &appData.zippyPlay, FALSE, (ArgIniType) ZIPPY_PLAY }, - { "zp", ArgTrue, (LPVOID) &appData.zippyPlay, FALSE, INVALID }, - { "xzp", ArgFalse, (LPVOID) &appData.zippyPlay, FALSE, INVALID }, - { "-zp", ArgFalse, (LPVOID) &appData.zippyPlay, FALSE, INVALID }, - { "zippyLines", ArgFilename, (LPVOID) &appData.zippyLines, FALSE, (ArgIniType) ZIPPY_LINES }, - { "zippyPinhead", ArgString, (LPVOID) &appData.zippyPinhead, FALSE, (ArgIniType) ZIPPY_PINHEAD }, - { "zippyPassword", ArgString, (LPVOID) &appData.zippyPassword, FALSE, (ArgIniType) ZIPPY_PASSWORD }, - { "zippyPassword2", ArgString, (LPVOID) &appData.zippyPassword2, FALSE, (ArgIniType) ZIPPY_PASSWORD2 }, - { "zippyWrongPassword", ArgString, (LPVOID) &appData.zippyWrongPassword, - FALSE, (ArgIniType) ZIPPY_WRONG_PASSWORD }, - { "zippyAcceptOnly", ArgString, (LPVOID) &appData.zippyAcceptOnly, FALSE, (ArgIniType) ZIPPY_ACCEPT_ONLY }, - { "zippyUseI", ArgBoolean, (LPVOID) &appData.zippyUseI, FALSE, (ArgIniType) ZIPPY_USE_I }, - { "zui", ArgTrue, (LPVOID) &appData.zippyUseI, FALSE, INVALID }, - { "xzui", ArgFalse, (LPVOID) &appData.zippyUseI, FALSE, INVALID }, - { "-zui", ArgFalse, (LPVOID) &appData.zippyUseI, FALSE, INVALID }, - { "zippyBughouse", ArgInt, (LPVOID) &appData.zippyBughouse, FALSE, (ArgIniType) ZIPPY_BUGHOUSE }, - { "zippyNoplayCrafty", ArgBoolean, (LPVOID) &appData.zippyNoplayCrafty, - FALSE, (ArgIniType) ZIPPY_NOPLAY_CRAFTY }, - { "znc", ArgTrue, (LPVOID) &appData.zippyNoplayCrafty, FALSE, INVALID }, - { "xznc", ArgFalse, (LPVOID) &appData.zippyNoplayCrafty, FALSE, INVALID }, - { "-znc", ArgFalse, (LPVOID) &appData.zippyNoplayCrafty, FALSE, INVALID }, - { "zippyGameEnd", ArgString, (LPVOID) &appData.zippyGameEnd, FALSE, (ArgIniType) ZIPPY_GAME_END }, - { "zippyGameStart", ArgString, (LPVOID) &appData.zippyGameStart, FALSE, (ArgIniType) ZIPPY_GAME_START }, - { "zippyAdjourn", ArgBoolean, (LPVOID) &appData.zippyAdjourn, FALSE, (ArgIniType) ZIPPY_ADJOURN }, - { "zadj", ArgTrue, (LPVOID) &appData.zippyAdjourn, FALSE, INVALID }, - { "xzadj", ArgFalse, (LPVOID) &appData.zippyAdjourn, FALSE, INVALID }, - { "-zadj", ArgFalse, (LPVOID) &appData.zippyAdjourn, FALSE, INVALID }, - { "zippyAbort", ArgBoolean, (LPVOID) &appData.zippyAbort, FALSE, (ArgIniType) ZIPPY_ABORT }, - { "zab", ArgTrue, (LPVOID) &appData.zippyAbort, FALSE, INVALID }, - { "xzab", ArgFalse, (LPVOID) &appData.zippyAbort, FALSE, INVALID }, - { "-zab", ArgFalse, (LPVOID) &appData.zippyAbort, FALSE, INVALID }, - { "zippyVariants", ArgString, (LPVOID) &appData.zippyVariants, FALSE, (ArgIniType) ZIPPY_VARIANTS }, - { "zippyMaxGames", ArgInt, (LPVOID)&appData.zippyMaxGames, FALSE, (ArgIniType) ZIPPY_MAX_GAMES}, - { "zippyReplayTimeout", ArgInt, (LPVOID)&appData.zippyReplayTimeout, FALSE, (ArgIniType) ZIPPY_REPLAY_TIMEOUT }, - { "zippyShortGame", ArgInt, (LPVOID)&appData.zippyShortGame, FALSE, INVALID }, - /* Kludge to allow winboard.ini files from buggy 4.0.4 to be read: */ - { "zippyReplyTimeout", ArgInt, (LPVOID)&junk, FALSE, INVALID }, -#endif - /* [HGM] options for broadcasting and time odds */ - { "serverMoves", ArgString, (LPVOID) &appData.serverMovesName, FALSE, (ArgIniType) NULL }, - { "suppressLoadMoves", ArgBoolean, (LPVOID) &appData.suppressLoadMoves, FALSE, (ArgIniType) FALSE }, - { "serverPause", ArgInt, (LPVOID) &appData.serverPause, FALSE, (ArgIniType) 15 }, - { "firstTimeOdds", ArgInt, (LPVOID) &appData.firstTimeOdds, FALSE, (ArgIniType) 1 }, - { "secondTimeOdds", ArgInt, (LPVOID) &appData.secondTimeOdds, FALSE, (ArgIniType) 1 }, - { "timeOddsMode", ArgInt, (LPVOID) &appData.timeOddsMode, TRUE, INVALID }, - { "firstAccumulateTC", ArgInt, (LPVOID) &appData.firstAccumulateTC, FALSE, (ArgIniType) 1 }, - { "secondAccumulateTC", ArgInt, (LPVOID) &appData.secondAccumulateTC, FALSE, (ArgIniType) 1 }, - { "firstNPS", ArgInt, (LPVOID) &appData.firstNPS, FALSE, (ArgIniType) -1 }, - { "secondNPS", ArgInt, (LPVOID) &appData.secondNPS, FALSE, (ArgIniType) -1 }, - { "noGUI", ArgTrue, (LPVOID) &appData.noGUI, FALSE, INVALID }, - { "keepLineBreaksICS", ArgBoolean, (LPVOID) &appData.noJoin, TRUE, INVALID }, - { "wrapContinuationSequence", ArgString, (LPVOID) &appData.wrapContSeq, FALSE, INVALID }, - { "useInternalWrap", ArgTrue, (LPVOID) &appData.useInternalWrap, FALSE, INVALID }, /* noJoin usurps this if set */ - - // [HGM] placement: put all window layouts last in ini file, but man X,Y before all others - { "minX", ArgZ, (LPVOID) &minX, FALSE, INVALID }, // [HGM] placement: to make suer auxialary windows can be placed - { "minY", ArgZ, (LPVOID) &minY, FALSE, INVALID }, - { "winWidth", ArgInt, (LPVOID) &wpMain.width, TRUE, INVALID }, // [HGM] placement: dummies to remember right & bottom - { "winHeight", ArgInt, (LPVOID) &wpMain.height, TRUE, INVALID }, // for attaching auxiliary windows to them - { "x", ArgInt, (LPVOID) &wpMain.x, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "y", ArgInt, (LPVOID) &wpMain.y, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "icsX", ArgX, (LPVOID) &wpConsole.x, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "icsY", ArgY, (LPVOID) &wpConsole.y, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "icsW", ArgInt, (LPVOID) &wpConsole.width, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "icsH", ArgInt, (LPVOID) &wpConsole.height, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "analysisX", ArgX, (LPVOID) &dummy, FALSE, INVALID }, // [HGM] placement: analysis window no longer exists - { "analysisY", ArgY, (LPVOID) &dummy, FALSE, INVALID }, // provided for compatibility with old ini files - { "analysisW", ArgInt, (LPVOID) &dummy, FALSE, INVALID }, - { "analysisH", ArgInt, (LPVOID) &dummy, FALSE, INVALID }, - { "commentX", ArgX, (LPVOID) &wpComment.x, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "commentY", ArgY, (LPVOID) &wpComment.y, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "commentW", ArgInt, (LPVOID) &wpComment.width, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "commentH", ArgInt, (LPVOID) &wpComment.height, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "tagsX", ArgX, (LPVOID) &wpTags.x, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "tagsY", ArgY, (LPVOID) &wpTags.y, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "tagsW", ArgInt, (LPVOID) &wpTags.width, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "tagsH", ArgInt, (LPVOID) &wpTags.height, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "gameListX", ArgX, (LPVOID) &wpGameList.x, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "gameListY", ArgY, (LPVOID) &wpGameList.y, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "gameListW", ArgInt, (LPVOID) &wpGameList.width, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "gameListH", ArgInt, (LPVOID) &wpGameList.height, TRUE, (ArgIniType) CW_USEDEFAULT }, - /* [AS] Layout stuff */ - { "moveHistoryUp", ArgBoolean, (LPVOID) &wpMoveHistory.visible, TRUE, (ArgIniType) TRUE }, - { "moveHistoryX", ArgX, (LPVOID) &wpMoveHistory.x, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "moveHistoryY", ArgY, (LPVOID) &wpMoveHistory.y, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "moveHistoryW", ArgInt, (LPVOID) &wpMoveHistory.width, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "moveHistoryH", ArgInt, (LPVOID) &wpMoveHistory.height, TRUE, (ArgIniType) CW_USEDEFAULT }, - - { "evalGraphUp", ArgBoolean, (LPVOID) &wpEvalGraph.visible, TRUE, (ArgIniType) TRUE }, - { "evalGraphX", ArgX, (LPVOID) &wpEvalGraph.x, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "evalGraphY", ArgY, (LPVOID) &wpEvalGraph.y, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "evalGraphW", ArgInt, (LPVOID) &wpEvalGraph.width, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "evalGraphH", ArgInt, (LPVOID) &wpEvalGraph.height, TRUE, (ArgIniType) CW_USEDEFAULT }, - - { "engineOutputUp", ArgBoolean, (LPVOID) &wpEngineOutput.visible, TRUE, (ArgIniType) TRUE }, - { "engineOutputX", ArgX, (LPVOID) &wpEngineOutput.x, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "engineOutputY", ArgY, (LPVOID) &wpEngineOutput.y, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "engineOutputW", ArgInt, (LPVOID) &wpEngineOutput.width, TRUE, (ArgIniType) CW_USEDEFAULT }, - { "engineOutputH", ArgInt, (LPVOID) &wpEngineOutput.height, TRUE, (ArgIniType) CW_USEDEFAULT }, - - { NULL, ArgNone, NULL, FALSE, INVALID } -}; - - -/* Kludge for indirection files on command line */ -char* lastIndirectionFilename; -ArgDescriptor argDescriptorIndirection = -{ "", ArgSettingsFilename, (LPVOID) NULL, FALSE }; +#include "args.h" +// front-end part of option handling VOID -ExitArgError(char *msg, char *badArg) +LFfromMFP(LOGFONT* lf, MyFontParams *mfp) { - char buf[MSG_SIZ]; + HDC hdc = CreateDC("DISPLAY", NULL, NULL, NULL); + lf->lfHeight = -(int)(mfp->pointSize * GetDeviceCaps(hdc, LOGPIXELSY) / 72.0 + 0.5); + DeleteDC(hdc); + lf->lfWidth = 0; + lf->lfEscapement = 0; + lf->lfOrientation = 0; + lf->lfWeight = mfp->bold ? FW_BOLD : FW_NORMAL; + lf->lfItalic = mfp->italic; + lf->lfUnderline = mfp->underline; + lf->lfStrikeOut = mfp->strikeout; + lf->lfCharSet = mfp->charset; + lf->lfOutPrecision = OUT_DEFAULT_PRECIS; + lf->lfClipPrecision = CLIP_DEFAULT_PRECIS; + lf->lfQuality = DEFAULT_QUALITY; + lf->lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE; + strcpy(lf->lfFaceName, mfp->faceName); +} - sprintf(buf, "%s %s", msg, badArg); - DisplayFatalError(buf, 0, 2); - exit(2); +void +CreateFontInMF(MyFont *mf) +{ + LFfromMFP(&mf->lf, &mf->mfp); + if (mf->hf) DeleteObject(mf->hf); + mf->hf = CreateFontIndirect(&mf->lf); } +// [HGM] This platform-dependent table provides the location for storing the color info +void * +colorVariable[] = { + &whitePieceColor, + &blackPieceColor, + &lightSquareColor, + &darkSquareColor, + &highlightSquareColor, + &premoveHighlightColor, + NULL, + &consoleBackgroundColor, + &appData.fontForeColorWhite, + &appData.fontBackColorWhite, + &appData.fontForeColorBlack, + &appData.fontBackColorBlack, + &appData.evalHistColorWhite, + &appData.evalHistColorBlack, + &appData.highlightArrowColor, +}; + /* Command line font name parser. NULL name means do nothing. Syntax like "Courier New:10.0 bi" or "Arial:10" or "Arial:10b" For backward compatibility, syntax without the colon is also @@ -1504,6 +977,36 @@ ParseFontName(char *name, MyFontParams *mfp) mfp->charset = (BYTE) atoi(q+1); } +void +ParseFont(char *name, int number) +{ // wrapper to shield back-end from 'font' + ParseFontName(name, &font[boardSize][number]->mfp); +} + +void +SetFontDefaults() +{ // in WB we have a 2D array of fonts; this initializes their description + int i, j; + /* Point font array elements to structures and + parse default font names */ + for (i=0; idef, &font[j][i]->mfp); + } + } +} + +void +CreateFonts() +{ // here we create the actual fonts from the selected descriptions + int i, j; + for (i=0; iargName != NULL; ad++) - if (strcmp(ad->argName, argName + 1) == 0) break; - - if (ad->argName == NULL) - ExitArgError("Unrecognized argument", argName); - - } else if (ch == '@') { - /* Indirection file */ - ad = &argDescriptorIndirection; - ch = get(cl); - } else { - /* Positional argument */ - ad = &argDescriptors[posarg++]; - strcpy(argName, ad->argName); - } - - if (ad->argType == ArgTrue) { - *(Boolean *) ad->argLoc = TRUE; - continue; - } - if (ad->argType == ArgFalse) { - *(Boolean *) ad->argLoc = FALSE; - continue; - } - - while (ch == ' ' || ch == '=' || ch == ':' || ch == '\t') ch = get(cl); - if (ch == NULLCHAR || ch == '\n') { - ExitArgError("No value provided for argument", argName); - } - q = argValue; - if (ch == '{') { - // Quoting with { }. No characters have to (or can) be escaped. - // Thus the string cannot contain a '}' character. - start = ch; - ch = get(cl); - while (start) { - switch (ch) { - case NULLCHAR: - start = NULLCHAR; - break; - - case '}': - ch = get(cl); - start = NULLCHAR; - break; - - default: - *q++ = ch; - ch = get(cl); - break; - } - } - } else if (ch == '\'' || ch == '"') { - // Quoting with ' ' or " ", with \ as escape character. - // Inconvenient for long strings that may contain Windows filenames. - start = ch; - ch = get(cl); - while (start) { - switch (ch) { - case NULLCHAR: - start = NULLCHAR; - break; - - default: - not_special: - *q++ = ch; - ch = get(cl); - break; - - case '\'': - case '\"': - if (ch == start) { - ch = get(cl); - start = NULLCHAR; - break; - } else { - goto not_special; - } - - case '\\': - if (ad->argType == ArgFilename - || ad->argType == ArgSettingsFilename) { - goto not_special; - } - ch = get(cl); - switch (ch) { - case NULLCHAR: - ExitArgError("Incomplete \\ escape in value for", argName); - break; - case 'n': - *q++ = '\n'; - ch = get(cl); - break; - case 'r': - *q++ = '\r'; - ch = get(cl); - break; - case 't': - *q++ = '\t'; - ch = get(cl); - break; - case 'b': - *q++ = '\b'; - ch = get(cl); - break; - case 'f': - *q++ = '\f'; - ch = get(cl); - break; - default: - octval = 0; - for (i = 0; i < 3; i++) { - if (ch >= '0' && ch <= '7') { - octval = octval*8 + (ch - '0'); - ch = get(cl); - } else { - break; - } - } - if (i > 0) { - *q++ = (char) octval; - } else { - *q++ = ch; - ch = get(cl); - } - break; - } - break; - } - } - } else { - while (ch != ' ' && ch != NULLCHAR && ch != '\t' && ch != '\n') { - *q++ = ch; - ch = get(cl); - } - } - *q = NULLCHAR; - - switch (ad->argType) { - case ArgInt: - *(int *) ad->argLoc = atoi(argValue); - break; - - case ArgX: - *(int *) ad->argLoc = atoi(argValue) + wpMain.x; // [HGM] placement: translate stored relative to absolute - break; - - case ArgY: - *(int *) ad->argLoc = atoi(argValue) + wpMain.y; // (this is really kludgey, it should be done where used...) - break; - - case ArgZ: - *(int *) ad->argLoc = atoi(argValue); - EnsureOnScreen(&wpMain.x, &wpMain.y, minX, minY); - break; - - case ArgFloat: - *(float *) ad->argLoc = (float) atof(argValue); - break; - - case ArgString: - case ArgFilename: - *(char **) ad->argLoc = strdup(argValue); - break; - - case ArgSettingsFilename: - { - char fullname[MSG_SIZ]; - if (ParseSettingsFile(argValue, fullname)) { - if (ad->argLoc != NULL) { - *(char **) ad->argLoc = strdup(fullname); - } - } else { - if (ad->argLoc != NULL) { - } else { - ExitArgError("Failed to open indirection file", argValue); - } - } - } - break; - - case ArgBoolean: - switch (argValue[0]) { - case 't': - case 'T': - *(Boolean *) ad->argLoc = TRUE; - break; - case 'f': - case 'F': - *(Boolean *) ad->argLoc = FALSE; - break; - default: - ExitArgError("Unrecognized boolean argument value", argValue); - break; - } - break; - - case ArgColor: - *(COLORREF *)ad->argLoc = ParseColorName(argValue); - break; - - case ArgAttribs: { - ColorClass cc = (ColorClass)ad->argLoc; - ParseAttribs(&textAttribs[cc].color, &textAttribs[cc].effects, argValue); - } - break; - - case ArgBoardSize: - *(BoardSize *)ad->argLoc = ParseBoardSize(argValue); - break; - - case ArgFont: - ParseFontName(argValue, &font[boardSize][(int)ad->argLoc]->mfp); - break; - - case ArgCommSettings: - ParseCommSettings(argValue, &dcb); - break; - - case ArgNone: - ExitArgError("Unrecognized argument", argValue); - break; - case ArgTrue: - case ArgFalse: ; - } - } -} - -VOID -LFfromMFP(LOGFONT* lf, MyFontParams *mfp) -{ - HDC hdc = CreateDC("DISPLAY", NULL, NULL, NULL); - lf->lfHeight = -(int)(mfp->pointSize * GetDeviceCaps(hdc, LOGPIXELSY) / 72.0 + 0.5); - DeleteDC(hdc); - lf->lfWidth = 0; - lf->lfEscapement = 0; - lf->lfOrientation = 0; - lf->lfWeight = mfp->bold ? FW_BOLD : FW_NORMAL; - lf->lfItalic = mfp->italic; - lf->lfUnderline = mfp->underline; - lf->lfStrikeOut = mfp->strikeout; - lf->lfCharSet = mfp->charset; - lf->lfOutPrecision = OUT_DEFAULT_PRECIS; - lf->lfClipPrecision = CLIP_DEFAULT_PRECIS; - lf->lfQuality = DEFAULT_QUALITY; - lf->lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE; - strcpy(lf->lfFaceName, mfp->faceName); -} - -VOID -CreateFontInMF(MyFont *mf) -{ - LFfromMFP(&mf->lf, &mf->mfp); - if (mf->hf) DeleteObject(mf->hf); - mf->hf = CreateFontIndirect(&mf->lf); } -VOID -SetDefaultTextAttribs() -{ - ColorClass cc; - for (cc = (ColorClass)0; cc < NColorClasses; cc++) { - ParseAttribs(&textAttribs[cc].color, - &textAttribs[cc].effects, - defaultTextAttribs[cc]); - } -} - -VOID -SetDefaultSounds() -{ // [HGM] only sounds for which no option exists - ColorClass cc; - for (cc = ColorNormal; cc < NColorClasses; cc++) { - textAttribs[cc].sound.name = strdup(""); - textAttribs[cc].sound.data = NULL; - } -} - -VOID +void LoadAllSounds() { // [HGM] import name from appData first ColorClass cc; @@ -1923,6 +1084,10 @@ LoadAllSounds() textAttribs[cc].sound.data = NULL; MyLoadSound(&textAttribs[cc].sound); } + for (cc = ColorNormal; cc < NColorClasses; cc++) { + textAttribs[cc].sound.name = strdup(""); + textAttribs[cc].sound.data = NULL; + } for (sc = (SoundClass)0; sc < NSoundClasses; sc++) { sounds[sc].name = strdup((&appData.soundMove)[sc]); sounds[sc].data = NULL; @@ -1931,77 +1096,9 @@ LoadAllSounds() } void -SetDefaultsFromList() -{ // [HGM] ini: take defaults from argDescriptor list - int i; - - for(i=0; argDescriptors[i].argName != NULL; i++) { - if(argDescriptors[i].defaultValue != INVALID) - switch(argDescriptors[i].argType) { - case ArgBoolean: - case ArgTrue: - case ArgFalse: - *(Boolean *) argDescriptors[i].argLoc = (int)argDescriptors[i].defaultValue; - break; - case ArgInt: - case ArgX: - case ArgY: - case ArgZ: - *(int *) argDescriptors[i].argLoc = (int)argDescriptors[i].defaultValue; - break; - case ArgString: - case ArgFilename: - case ArgSettingsFilename: - *(char **) argDescriptors[i].argLoc = (char *)argDescriptors[i].defaultValue; - break; - case ArgBoardSize: - *(BoardSize *) argDescriptors[i].argLoc = (BoardSize)argDescriptors[i].defaultValue; - break; - case ArgFloat: // floats cannot be casted to int without precision loss - default: ; // some arg types cannot be initialized through table - } - } -} - -VOID -InitAppData(LPSTR lpCmdLine) +SetCommPortDefaults() { - int i, j; - char buf[ARG_MAX], currDir[MSG_SIZ]; - char *dummy, *p; - - programName = szAppName; - - /* Initialize to defaults */ - SetDefaultsFromList(); // this sets most defaults - - // some parameters for which there are no options! - appData.Iconic = FALSE; /*unused*/ - appData.cmailGameName = ""; - appData.icsEngineAnalyze = FALSE; - - // float: casting to int is not harmless, so default cannot be contained in table - appData.timeDelay = TIME_DELAY; - - // colors have platform-dependent option format and internal representation - // their setting and parsing must remain in front-end - lightSquareColor = ParseColorName(LIGHT_SQUARE_COLOR); - darkSquareColor = ParseColorName(DARK_SQUARE_COLOR); - whitePieceColor = ParseColorName(WHITE_PIECE_COLOR); - blackPieceColor = ParseColorName(BLACK_PIECE_COLOR); - highlightSquareColor = ParseColorName(HIGHLIGHT_SQUARE_COLOR); - premoveHighlightColor = ParseColorName(PREMOVE_HIGHLIGHT_COLOR); - consoleBackgroundColor = ParseColorName(COLOR_BKGD); - // the following must be moved out of appData to front-end variables - appData.evalHistColorWhite = ParseColorName( "#FFFFB0" ); - appData.evalHistColorBlack = ParseColorName( "#AD5D3D" ); - appData.highlightArrowColor = ParseColorName( "#FFFF80" ); - - // some complex, platform-dependent stuff - SetDefaultTextAttribs(); - SetDefaultSounds(); - - memset(&dcb, 0, sizeof(DCB)); // required by VS 2002 + + memset(&dcb, 0, sizeof(DCB)); // required by VS 2002 + dcb.DCBlength = sizeof(DCB); dcb.BaudRate = 9600; dcb.fBinary = TRUE; @@ -2019,134 +1116,6 @@ InitAppData(LPSTR lpCmdLine) dcb.ByteSize = 7; dcb.Parity = SPACEPARITY; dcb.StopBits = ONESTOPBIT; - - /* Point font array elements to structures and - parse default font names */ - for (i=0; idef, &font[j][i]->mfp); - } - } - - /* Parse default settings file if any */ - if (ParseSettingsFile(settingsFileName, buf)) { - settingsFileName = strdup(buf); - } - - /* Parse command line */ - ParseArgs(StringGet, &lpCmdLine); - - /* [HGM] make sure board size is acceptable */ - if(appData.NrFiles > BOARD_FILES || - appData.NrRanks > BOARD_RANKS ) - DisplayFatalError("Recompile with BOARD_RANKS or BOARD_FILES, to support this size", 0, 2); - - /* [HGM] After parsing the options from the .ini file, and overruling them - * with options from the command line, we now make an even higher priority - * overrule by WB options attached to the engine command line. This so that - * tournament managers can use WB options (such as /timeOdds) that follow - * the engines. - */ - if(appData.firstChessProgram != NULL) { - char *p = StrStr(appData.firstChessProgram, "WBopt"); - static char *f = "first"; - char buf[MSG_SIZ], *q = buf; - if(p != NULL) { // engine command line contains WinBoard options - sprintf(buf, p+6, f, f, f, f, f, f, f, f, f, f); // replace %s in them by "first" - ParseArgs(StringGet, &q); - p[-1] = 0; // cut them offengine command line - } - } - // now do same for second chess program - if(appData.secondChessProgram != NULL) { - char *p = StrStr(appData.secondChessProgram, "WBopt"); - static char *s = "second"; - char buf[MSG_SIZ], *q = buf; - if(p != NULL) { // engine command line contains WinBoard options - sprintf(buf, p+6, s, s, s, s, s, s, s, s, s, s); // replace %s in them by "first" - ParseArgs(StringGet, &q); - p[-1] = 0; // cut them offengine command line - } - } - - - /* Propagate options that affect others */ - if (appData.matchMode || appData.matchGames) chessProgram = TRUE; - if (appData.icsActive || appData.noChessProgram) { - chessProgram = FALSE; /* not local chess program mode */ - } - - /* Open startup dialog if needed */ - if ((!appData.noChessProgram && !chessProgram && !appData.icsActive) || - (appData.icsActive && *appData.icsHost == NULLCHAR) || - (chessProgram && (*appData.firstChessProgram == NULLCHAR || - *appData.secondChessProgram == NULLCHAR))) { - FARPROC lpProc; - - lpProc = MakeProcInstance((FARPROC)StartupDialog, hInst); - DialogBox(hInst, MAKEINTRESOURCE(DLG_Startup), NULL, (DLGPROC)lpProc); - FreeProcInstance(lpProc); - } - - /* Make sure save files land in the right (?) directory */ - if (GetFullPathName(appData.saveGameFile, MSG_SIZ, buf, &dummy)) { - appData.saveGameFile = strdup(buf); - } - if (GetFullPathName(appData.savePositionFile, MSG_SIZ, buf, &dummy)) { - appData.savePositionFile = strdup(buf); - } - - /* Finish initialization for fonts and sounds */ - for (i=0; iargLoc; + COLORREF color = *(COLORREF *)colorVariable[(int)ad->argLoc]; fprintf(f, "/%s=#%02lx%02lx%02lx\n", ad->argName, color&0xff, (color>>8)&0xff, (color>>16)&0xff); } -int -MainWindowUp() -{ // [HGM] args: allows testing if main window is realized from back-end - return hwndMain != NULL; +void +SaveBoardSize(FILE *f, char *name, void *addr) +{ // wrapper to shield back-end from BoardSize & sizeInfo + fprintf(f, "/%s=%s\n", name, sizeInfo[*(BoardSize *)addr].name); } -VOID -SaveSettings(char* name) -{ - FILE *f; - ArgDescriptor *ad; - char dir[MSG_SIZ]; - - if (!MainWindowUp()) return; - - GetCurrentDirectory(MSG_SIZ, dir); - SetCurrentDirectory(installDir); - f = fopen(name, "w"); - SetCurrentDirectory(dir); - if (f == NULL) { - DisplayError(name, errno); - return; - } - fprintf(f, ";\n"); - fprintf(f, "; %s Save Settings file\n", PACKAGE_STRING); - fprintf(f, ";\n"); - fprintf(f, "; You can edit the values of options that are already set in this file,\n"); - fprintf(f, "; but if you add other options, the next Save Settings will not save them.\n"); - fprintf(f, "; Use a shortcut, an @indirection file, or a .bat file instead.\n"); - fprintf(f, ";\n"); +void +ParseCommPortSettings(char *s) +{ // wrapper to keep dcb from back-end + ParseCommSettings(s, &dcb); +} +void +GetWindowCoords() +{ // wrapper to shield use of window handles from back-end (make addressible by number?) GetActualPlacement(hwndMain, &wpMain); GetActualPlacement(hwndConsole, &wpConsole); GetActualPlacement(commentDialog, &wpComment); GetActualPlacement(editTagsDialog, &wpTags); GetActualPlacement(gameListDialog, &wpGameList); - - /* [AS] Move history */ - wpMoveHistory.visible = MoveHistoryIsUp(); GetActualPlacement(moveHistoryDialog, &wpMoveHistory); - - /* [AS] Eval graph */ - wpEvalGraph.visible = EvalGraphIsUp(); GetActualPlacement(evalGraphDialog, &wpEvalGraph); - - /* [AS] Engine output */ - wpEngineOutput.visible = EngineOutputIsUp(); GetActualPlacement(engineOutputDialog, &wpEngineOutput); +} - // [HGM] in WB we have to copy sound names to appData first - ExportSounds(); +void +PrintCommPortSettings(FILE *f, char *name) +{ // wrapper to shield back-end from DCB + PrintCommSettings(f, name, &dcb); +} - for (ad = argDescriptors; ad->argName != NULL; ad++) { - if (!ad->save) continue; - switch (ad->argType) { - case ArgString: - { - char *p = *(char **)ad->argLoc; - if ((strchr(p, '\\') || strchr(p, '\n')) && !strchr(p, '}')) { - /* Quote multiline values or \-containing values - with { } if possible */ - fprintf(f, "/%s={%s}\n", ad->argName, p); - } else { - /* Else quote with " " */ - fprintf(f, "/%s=\"", ad->argName); - while (*p) { - if (*p == '\n') fprintf(f, "\n"); - else if (*p == '\r') fprintf(f, "\\r"); - else if (*p == '\t') fprintf(f, "\\t"); - else if (*p == '\b') fprintf(f, "\\b"); - else if (*p == '\f') fprintf(f, "\\f"); - else if (*p < ' ') fprintf(f, "\\%03o", *p); - else if (*p == '\"') fprintf(f, "\\\""); - else if (*p == '\\') fprintf(f, "\\\\"); - else putc(*p, f); - p++; - } - fprintf(f, "\"\n"); - } - } - break; - case ArgInt: - case ArgZ: - fprintf(f, "/%s=%d\n", ad->argName, *(int *)ad->argLoc); - break; - case ArgX: - fprintf(f, "/%s=%d\n", ad->argName, *(int *)ad->argLoc - wpMain.x); // [HGM] placement: stor relative value - break; - case ArgY: - fprintf(f, "/%s=%d\n", ad->argName, *(int *)ad->argLoc - wpMain.y); - break; - case ArgFloat: - fprintf(f, "/%s=%g\n", ad->argName, *(float *)ad->argLoc); - break; - case ArgBoolean: - fprintf(f, "/%s=%s\n", ad->argName, - (*(Boolean *)ad->argLoc) ? "true" : "false"); - break; - case ArgTrue: - if (*(Boolean *)ad->argLoc) fprintf(f, "/%s\n", ad->argName); - break; - case ArgFalse: - if (!*(Boolean *)ad->argLoc) fprintf(f, "/%s\n", ad->argName); - break; - case ArgColor: - SaveColor(f, ad); - break; - case ArgAttribs: - break; - case ArgFilename: - if (strchr(*(char **)ad->argLoc, '\"')) { - fprintf(f, "/%s='%s'\n", ad->argName, *(char **)ad->argLoc); - } else { - fprintf(f, "/%s=\"%s\"\n", ad->argName, *(char **)ad->argLoc); - } - break; - case ArgBoardSize: - fprintf(f, "/%s=%s\n", ad->argName, - sizeInfo[*(BoardSize *)ad->argLoc].name); - break; - case ArgFont: - SaveFontArg(f, ad); - break; - case ArgCommSettings: - PrintCommSettings(f, ad->argName, (DCB *)ad->argLoc); - case ArgNone: - case ArgSettingsFilename: ; - } - } - fclose(f); +int +MySearchPath(char *installDir, char *name, char *fullname) +{ + char *dummy; + return (int) SearchPath(installDir, name, NULL, MSG_SIZ, fullname, &dummy); +} + +int +MyGetFullPathName(char *name, char *fullname) +{ + char *dummy; + return (int) GetFullPathName(name, MSG_SIZ, fullname, &dummy); } +int +MainWindowUp() +{ // [HGM] args: allows testing if main window is realized from back-end + return hwndMain != NULL; +} +void +PopUpStartupDialog() +{ + FARPROC lpProc; + + lpProc = MakeProcInstance((FARPROC)StartupDialog, hInst); + DialogBox(hInst, MAKEINTRESOURCE(DLG_Startup), NULL, (DLGPROC)lpProc); + FreeProcInstance(lpProc); +} /*---------------------------------------------------------------------------*\ * @@ -6581,7 +5477,7 @@ InitComboStrings(HANDLE hwndCombo, char **cd) void InitComboStringsFromOption(HANDLE hwndCombo, char *str) { - char buf1[ARG_MAX]; + char buf1[MAX_ARG_LEN]; int len; if (str[0] == '@') { @@ -7328,76 +6224,7 @@ NextInHistory() { if (histP == histIn) return NULL; histP = (histP + 1) % HISTORY_SIZE; - return history[histP]; -} - -typedef struct { - char *item; - char *command; - BOOLEAN getname; - BOOLEAN immediate; -} IcsTextMenuEntry; -#define ICS_TEXT_MENU_SIZE (IDM_CommandXLast - IDM_CommandX + 1) -IcsTextMenuEntry icsTextMenuEntry[ICS_TEXT_MENU_SIZE]; - -void -ParseIcsTextMenu(char *icsTextMenuString) -{ -// int flags = 0; - IcsTextMenuEntry *e = icsTextMenuEntry; - char *p = icsTextMenuString; - while (e->item != NULL && e < icsTextMenuEntry + ICS_TEXT_MENU_SIZE) { - free(e->item); - e->item = NULL; - if (e->command != NULL) { - free(e->command); - e->command = NULL; - } - e++; - } - e = icsTextMenuEntry; - while (*p && e < icsTextMenuEntry + ICS_TEXT_MENU_SIZE) { - if (*p == ';' || *p == '\n') { - e->item = strdup("-"); - e->command = NULL; - p++; - } else if (*p == '-') { - e->item = strdup("-"); - e->command = NULL; - p++; - if (*p) p++; - } else { - char *q, *r, *s, *t; - char c; - q = strchr(p, ','); - if (q == NULL) break; - *q = NULLCHAR; - r = strchr(q + 1, ','); - if (r == NULL) break; - *r = NULLCHAR; - s = strchr(r + 1, ','); - if (s == NULL) break; - *s = NULLCHAR; - c = ';'; - t = strchr(s + 1, c); - if (t == NULL) { - c = '\n'; - t = strchr(s + 1, c); - } - if (t != NULL) *t = NULLCHAR; - e->item = strdup(p); - e->command = strdup(q + 1); - e->getname = *(r + 1) != '0'; - e->immediate = *(s + 1) != '0'; - *q = ','; - *r = ','; - *s = ','; - if (t == NULL) break; - *t = c; - p = t + 1; - } - e++; - } + return history[histP]; } HMENU diff --git a/winboard/winboard.h b/winboard/winboard.h index 443f728..3ecf46f 100644 --- a/winboard/winboard.h +++ b/winboard/winboard.h @@ -121,8 +121,6 @@ VOID ChangeBoardSize(BoardSize newSize); BOOL APIENTRY MyCreateFont(HWND hwnd, MyFont *font); VOID ErrorPopDown(VOID); VOID EnsureOnScreen(int *x, int *y, int minX, int minY); -typedef char GetFunc(void *getClosure); -VOID ParseArgs(GetFunc get, void *cl); HBITMAP DoLoadBitmap(HINSTANCE hinst, char *piece, int squareSize, char *suffix); COLORREF ParseColorName(char *name); @@ -134,6 +132,7 @@ void InitComboStrings(HANDLE hwndCombo, char **cd); BOOLEAN MyLoadSound(MySound *ms); BOOLEAN MyPlaySound(MySound *ms); VOID ExitArgError(char *msg, char *badArg); +void SaveSettings(char* name); /* Constants */ @@ -186,15 +185,6 @@ typedef enum { W_MoveHist, W_EngineOut, W_GameList, NUM_WINDOWS } WindowID; -/* [AS] Layout management */ -typedef struct { - Boolean visible; - int x; - int y; - int width; - int height; -} WindowPlacement; - extern WindowPlacement placementTab[NUM_WINDOWS]; extern HWND hwndTab[NUM_WINDOWS]; // this remains pure front-end. @@ -204,22 +194,14 @@ VOID ReattachAfterMove( LPRECT lprcOldPos, int new_x, int new_y, HWND hWndChild, VOID ReattachAfterSize( LPRECT lprcOldPos, int new_w, int new_h, HWND hWndChild, WindowPlacement * pwpChild ); BOOL GetActualPlacement( HWND hWnd, WindowPlacement * wp ); -extern WindowPlacement wpEngineOutput; -extern WindowPlacement wpEvalGraph; -extern WindowPlacement wpMoveHistory; -extern WindowPlacement wpGameList; -extern WindowPlacement wpTags; - VOID MoveHistoryPopUp(); VOID MoveHistoryPopDown(); VOID MoveHistorySet( char movelist[][2*MOVE_LEN], int first, int last, int current, ChessProgramStats_Move * pvInfo ); -BOOL MoveHistoryIsUp(); extern HWND moveHistoryDialog; VOID EvalGraphSet( int first, int last, int current, ChessProgramStats_Move * pvInfo ); VOID EvalGraphPopUp(); VOID EvalGraphPopDown(); -Boolean EvalGraphIsUp(); extern HWND evalGraphDialog; extern HWND engineOutputDialog; diff --git a/xboard.c b/xboard.c index b18b24b..d7ea5a7 100644 --- a/xboard.c +++ b/xboard.c @@ -409,6 +409,8 @@ void HideThinkingProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); void TestLegalityProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); +void SaveSettingsProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); +void SaveOnExitProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); void InfoProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); void ManProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); void HintProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); @@ -478,7 +480,11 @@ char installDir[] = "."; // [HGM] UCI: needed for UCI; probably needs run-time i Position commentX = -1, commentY = -1; Dimension commentW, commentH; +typedef unsigned int BoardSize; +BoardSize boardSize; +Boolean chessProgram; +int minX, minY; // [HGM] placement: volatile limits on upper-left corner int squareSize, smallLayout = 0, tinyLayout = 0, marginW, marginH, // [HGM] for run-time resizing fromX = -1, fromY = -1, toX, toY, commentUp = False, analysisUp = False, @@ -489,6 +495,22 @@ Pixel timerForegroundPixel, timerBackgroundPixel; Pixel buttonForegroundPixel, buttonBackgroundPixel; char *chessDir, *programName, *programVersion, *gameCopyFilename, *gamePasteFilename; +Boolean alwaysOnTop = False; +Boolean saveSettingsOnExit; +char *settingsFileName; +char *icsTextMenuString; +char *icsNames; +char *firstChessProgramNames; +char *secondChessProgramNames; + +WindowPlacement wpMain; +WindowPlacement wpConsole; +WindowPlacement wpComment; +WindowPlacement wpMoveHistory; +WindowPlacement wpEvalGraph; +WindowPlacement wpEngineOutput; +WindowPlacement wpGameList; +WindowPlacement wpTags; #define SOLID 0 #define OUTLINE 1 @@ -663,6 +685,9 @@ MenuItem optionsMenu[] = { {N_("Show Coords"), ShowCoordsProc}, {N_("Hide Thinking"), HideThinkingProc}, {N_("Test Legality"), TestLegalityProc}, + {"----", NothingProc}, + {N_("Save Settings Now"), SaveSettingsProc}, + {N_("Save Settings on Exit"), SaveOnExitProc}, {NULL, NULL} }; @@ -788,1016 +813,15 @@ Arg timerArgs[] = { }; XtResource clientResources[] = { - { "whitePieceColor", "whitePieceColor", XtRString, sizeof(String), - XtOffset(AppDataPtr, whitePieceColor), XtRString, - WHITE_PIECE_COLOR }, - { "blackPieceColor", "blackPieceColor", XtRString, sizeof(String), - XtOffset(AppDataPtr, blackPieceColor), XtRString, - BLACK_PIECE_COLOR }, - { "lightSquareColor", "lightSquareColor", XtRString, - sizeof(String), XtOffset(AppDataPtr, lightSquareColor), - XtRString, LIGHT_SQUARE_COLOR }, - { "darkSquareColor", "darkSquareColor", XtRString, sizeof(String), - XtOffset(AppDataPtr, darkSquareColor), XtRString, - DARK_SQUARE_COLOR }, - { "highlightSquareColor", "highlightSquareColor", XtRString, - sizeof(String), XtOffset(AppDataPtr, highlightSquareColor), - XtRString, HIGHLIGHT_SQUARE_COLOR }, - { "premoveHighlightColor", "premoveHighlightColor", XtRString, - sizeof(String), XtOffset(AppDataPtr, premoveHighlightColor), - XtRString, PREMOVE_HIGHLIGHT_COLOR }, - { "movesPerSession", "movesPerSession", XtRInt, sizeof(int), - XtOffset(AppDataPtr, movesPerSession), XtRImmediate, - (XtPointer) MOVES_PER_SESSION }, - { "timeIncrement", "timeIncrement", XtRInt, sizeof(int), - XtOffset(AppDataPtr, timeIncrement), XtRImmediate, - (XtPointer) TIME_INCREMENT }, - { "initString", "initString", XtRString, sizeof(String), - XtOffset(AppDataPtr, initString), XtRString, INIT_STRING }, - { "secondInitString", "secondInitString", XtRString, sizeof(String), - XtOffset(AppDataPtr, secondInitString), XtRString, INIT_STRING }, - { "firstComputerString", "firstComputerString", XtRString, - sizeof(String), XtOffset(AppDataPtr, firstComputerString), XtRString, - COMPUTER_STRING }, - { "secondComputerString", "secondComputerString", XtRString, - sizeof(String), XtOffset(AppDataPtr, secondComputerString), XtRString, - COMPUTER_STRING }, - { "firstChessProgram", "firstChessProgram", XtRString, - sizeof(String), XtOffset(AppDataPtr, firstChessProgram), - XtRString, FIRST_CHESS_PROGRAM }, - { "secondChessProgram", "secondChessProgram", XtRString, - sizeof(String), XtOffset(AppDataPtr, secondChessProgram), - XtRString, SECOND_CHESS_PROGRAM }, - { "firstPlaysBlack", "firstPlaysBlack", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, firstPlaysBlack), - XtRImmediate, (XtPointer) False }, - { "noChessProgram", "noChessProgram", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, noChessProgram), - XtRImmediate, (XtPointer) False }, - { "firstHost", "firstHost", XtRString, sizeof(String), - XtOffset(AppDataPtr, firstHost), XtRString, FIRST_HOST }, - { "secondHost", "secondHost", XtRString, sizeof(String), - XtOffset(AppDataPtr, secondHost), XtRString, SECOND_HOST }, - { "firstDirectory", "firstDirectory", XtRString, sizeof(String), - XtOffset(AppDataPtr, firstDirectory), XtRString, "." }, - { "secondDirectory", "secondDirectory", XtRString, sizeof(String), - XtOffset(AppDataPtr, secondDirectory), XtRString, "." }, - { "bitmapDirectory", "bitmapDirectory", XtRString, - sizeof(String), XtOffset(AppDataPtr, bitmapDirectory), - XtRString, "" }, - { "remoteShell", "remoteShell", XtRString, sizeof(String), - XtOffset(AppDataPtr, remoteShell), XtRString, REMOTE_SHELL }, - { "remoteUser", "remoteUser", XtRString, sizeof(String), - XtOffset(AppDataPtr, remoteUser), XtRString, "" }, - { "timeDelay", "timeDelay", XtRFloat, sizeof(float), - XtOffset(AppDataPtr, timeDelay), XtRString, - (XtPointer) TIME_DELAY_QUOTE }, - { "timeControl", "timeControl", XtRString, sizeof(String), - XtOffset(AppDataPtr, timeControl), XtRString, - (XtPointer) TIME_CONTROL }, - { "internetChessServerMode", "internetChessServerMode", - XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, icsActive), XtRImmediate, - (XtPointer) False }, - { "internetChessServerHost", "internetChessServerHost", - XtRString, sizeof(String), - XtOffset(AppDataPtr, icsHost), - XtRString, (XtPointer) ICS_HOST }, - { "internetChessServerPort", "internetChessServerPort", - XtRString, sizeof(String), - XtOffset(AppDataPtr, icsPort), XtRString, - (XtPointer) ICS_PORT }, - { "internetChessServerCommPort", "internetChessServerCommPort", - XtRString, sizeof(String), - XtOffset(AppDataPtr, icsCommPort), XtRString, - ICS_COMM_PORT }, - { "internetChessServerLogonScript", "internetChessServerLogonScript", - XtRString, sizeof(String), - XtOffset(AppDataPtr, icsLogon), XtRString, - ICS_LOGON }, - { "internetChessServerHelper", "internetChessServerHelper", - XtRString, sizeof(String), - XtOffset(AppDataPtr, icsHelper), XtRString, "" }, - { "internetChessServerInputBox", "internetChessServerInputBox", - XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, icsInputBox), XtRImmediate, - (XtPointer) False }, - { "icsAlarm", "icsAlarm", - XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, icsAlarm), XtRImmediate, - (XtPointer) True }, - { "icsAlarmTime", "icsAlarmTime", - XtRInt, sizeof(int), - XtOffset(AppDataPtr, icsAlarmTime), XtRImmediate, - (XtPointer) 5000 }, - { "useTelnet", "useTelnet", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, useTelnet), XtRImmediate, - (XtPointer) False }, - { "telnetProgram", "telnetProgram", XtRString, sizeof(String), - XtOffset(AppDataPtr, telnetProgram), XtRString, TELNET_PROGRAM }, - { "gateway", "gateway", XtRString, sizeof(String), - XtOffset(AppDataPtr, gateway), XtRString, "" }, - { "loadGameFile", "loadGameFile", XtRString, sizeof(String), - XtOffset(AppDataPtr, loadGameFile), XtRString, "" }, - { "loadGameIndex", "loadGameIndex", - XtRInt, sizeof(int), - XtOffset(AppDataPtr, loadGameIndex), XtRImmediate, - (XtPointer) 0 }, - { "saveGameFile", "saveGameFile", XtRString, sizeof(String), - XtOffset(AppDataPtr, saveGameFile), XtRString, "" }, - { "autoRaiseBoard", "autoRaiseBoard", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoRaiseBoard), - XtRImmediate, (XtPointer) True }, - { "autoSaveGames", "autoSaveGames", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoSaveGames), - XtRImmediate, (XtPointer) False }, - { "blindfold", "blindfold", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, blindfold), - XtRImmediate, (XtPointer) False }, - { "loadPositionFile", "loadPositionFile", XtRString, - sizeof(String), XtOffset(AppDataPtr, loadPositionFile), - XtRString, "" }, - { "loadPositionIndex", "loadPositionIndex", - XtRInt, sizeof(int), - XtOffset(AppDataPtr, loadPositionIndex), XtRImmediate, - (XtPointer) 1 }, - { "savePositionFile", "savePositionFile", XtRString, - sizeof(String), XtOffset(AppDataPtr, savePositionFile), - XtRString, "" }, - { "matchMode", "matchMode", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, matchMode), XtRImmediate, (XtPointer) False }, - { "matchGames", "matchGames", XtRInt, sizeof(int), - XtOffset(AppDataPtr, matchGames), XtRImmediate, - (XtPointer) 0 }, - { "monoMode", "monoMode", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, monoMode), XtRImmediate, - (XtPointer) False }, - { "debugMode", "debugMode", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, debugMode), XtRImmediate, - (XtPointer) False }, - { "clockMode", "clockMode", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, clockMode), XtRImmediate, - (XtPointer) True }, - { "boardSize", "boardSize", XtRString, sizeof(String), - XtOffset(AppDataPtr, boardSize), XtRString, "" }, - { "searchTime", "searchTime", XtRString, sizeof(String), - XtOffset(AppDataPtr, searchTime), XtRString, - (XtPointer) "" }, - { "searchDepth", "searchDepth", XtRInt, sizeof(int), - XtOffset(AppDataPtr, searchDepth), XtRImmediate, - (XtPointer) 0 }, - { "showCoords", "showCoords", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, showCoords), XtRImmediate, - (XtPointer) False }, - { "showJail", "showJail", XtRInt, sizeof(int), - XtOffset(AppDataPtr, showJail), XtRImmediate, - (XtPointer) 0 }, - { "showThinking", "showThinking", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, showThinking), XtRImmediate, - (XtPointer) True }, - { "ponderNextMove", "ponderNextMove", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, ponderNextMove), XtRImmediate, - (XtPointer) True }, - { "periodicUpdates", "periodicUpdates", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, periodicUpdates), XtRImmediate, - (XtPointer) True }, - { "clockFont", "clockFont", XtRString, sizeof(String), - XtOffset(AppDataPtr, clockFont), XtRString, CLOCK_FONT }, - { "coordFont", "coordFont", XtRString, sizeof(String), - XtOffset(AppDataPtr, coordFont), XtRString, COORD_FONT }, - { "font", "font", XtRString, sizeof(String), - XtOffset(AppDataPtr, font), XtRString, DEFAULT_FONT }, - { "ringBellAfterMoves", "ringBellAfterMoves", - XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, ringBellAfterMoves), - XtRImmediate, (XtPointer) False }, - { "autoCallFlag", "autoCallFlag", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoCallFlag), - XtRImmediate, (XtPointer) False }, - { "autoFlipView", "autoFlipView", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoFlipView), - XtRImmediate, (XtPointer) True }, - { "autoObserve", "autoObserve", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoObserve), - XtRImmediate, (XtPointer) False }, - { "autoComment", "autoComment", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoComment), - XtRImmediate, (XtPointer) False }, - { "getMoveList", "getMoveList", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, getMoveList), - XtRImmediate, (XtPointer) True }, -#if HIGHDRAG - { "highlightDragging", "highlightDragging", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, highlightDragging), - XtRImmediate, (XtPointer) False }, -#endif - { "highlightLastMove", "highlightLastMove", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, highlightLastMove), - XtRImmediate, (XtPointer) False }, - { "premove", "premove", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, premove), - XtRImmediate, (XtPointer) True }, - { "testLegality", "testLegality", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, testLegality), - XtRImmediate, (XtPointer) True }, - { "flipView", "flipView", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, flipView), - XtRImmediate, (XtPointer) False }, - { "cmail", "cmailGameName", XtRString, sizeof(String), - XtOffset(AppDataPtr, cmailGameName), XtRString, "" }, - { "alwaysPromoteToQueen", "alwaysPromoteToQueen", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, alwaysPromoteToQueen), - XtRImmediate, (XtPointer) False }, - { "oldSaveStyle", "oldSaveStyle", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, oldSaveStyle), - XtRImmediate, (XtPointer) False }, - { "quietPlay", "quietPlay", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, quietPlay), - XtRImmediate, (XtPointer) False }, - { "titleInWindow", "titleInWindow", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, titleInWindow), - XtRImmediate, (XtPointer) False }, - { "localLineEditing", "localLineEditing", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, localLineEditing), - XtRImmediate, (XtPointer) True }, /* not implemented, must be True */ -#if ZIPPY - { "zippyTalk", "zippyTalk", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, zippyTalk), - XtRImmediate, (XtPointer) ZIPPY_TALK }, - { "zippyPlay", "zippyPlay", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, zippyPlay), - XtRImmediate, (XtPointer) ZIPPY_PLAY }, - { "zippyLines", "zippyLines", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyLines), XtRString, ZIPPY_LINES }, - { "zippyPinhead", "zippyPinhead", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyPinhead), XtRString, ZIPPY_PINHEAD }, - { "zippyPassword", "zippyPassword", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyPassword), XtRString, ZIPPY_PASSWORD }, - { "zippyPassword2", "zippyPassword2", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyPassword2), XtRString, ZIPPY_PASSWORD2 }, - { "zippyWrongPassword", "zippyWrongPassword", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyWrongPassword), XtRString, - ZIPPY_WRONG_PASSWORD }, - { "zippyAcceptOnly", "zippyAcceptOnly", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyAcceptOnly), XtRString, ZIPPY_ACCEPT_ONLY }, - { "zippyUseI", "zippyUseI", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, zippyUseI), - XtRImmediate, (XtPointer) ZIPPY_USE_I }, - { "zippyBughouse", "zippyBughouse", XtRInt, - sizeof(int), XtOffset(AppDataPtr, zippyBughouse), - XtRImmediate, (XtPointer) ZIPPY_BUGHOUSE }, - { "zippyNoplayCrafty", "zippyNoplayCrafty", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, zippyNoplayCrafty), - XtRImmediate, (XtPointer) ZIPPY_NOPLAY_CRAFTY }, - { "zippyGameEnd", "zippyGameEnd", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyGameEnd), XtRString, ZIPPY_GAME_END }, - { "zippyGameStart", "zippyGameStart", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyGameStart), XtRString, ZIPPY_GAME_START }, - { "zippyAdjourn", "zippyAdjourn", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, zippyAdjourn), - XtRImmediate, (XtPointer) ZIPPY_ADJOURN }, - { "zippyAbort", "zippyAbort", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, zippyAbort), - XtRImmediate, (XtPointer) ZIPPY_ABORT }, - { "zippyVariants", "zippyVariants", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyVariants), XtRString, ZIPPY_VARIANTS }, - { "zippyMaxGames", "zippyMaxGames", XtRInt, sizeof(int), - XtOffset(AppDataPtr, zippyMaxGames), XtRImmediate, - (XtPointer) ZIPPY_MAX_GAMES }, - { "zippyReplayTimeout", "zippyReplayTimeout", XtRInt, sizeof(int), - XtOffset(AppDataPtr, zippyReplayTimeout), XtRImmediate, - (XtPointer) ZIPPY_REPLAY_TIMEOUT }, - { "zippyShortGame", "zippyShortGame", XtRInt, sizeof(int), - XtOffset(AppDataPtr, zippyShortGame), XtRImmediate, - (XtPointer) 0 }, -#endif { "flashCount", "flashCount", XtRInt, sizeof(int), XtOffset(AppDataPtr, flashCount), XtRImmediate, (XtPointer) FLASH_COUNT }, - { "flashRate", "flashRate", XtRInt, sizeof(int), - XtOffset(AppDataPtr, flashRate), XtRImmediate, - (XtPointer) FLASH_RATE }, - { "pixmapDirectory", "pixmapDirectory", XtRString, - sizeof(String), XtOffset(AppDataPtr, pixmapDirectory), - XtRString, "" }, - { "msLoginDelay", "msLoginDelay", XtRInt, sizeof(int), - XtOffset(AppDataPtr, msLoginDelay), XtRImmediate, - (XtPointer) MS_LOGIN_DELAY }, - { "colorizeMessages", "colorizeMessages", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, colorize), - XtRImmediate, (XtPointer) False }, - { "colorShout", "colorShout", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorShout), - XtRString, COLOR_SHOUT }, - { "colorSShout", "colorSShout", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorSShout), - XtRString, COLOR_SSHOUT }, - { "colorChannel1", "colorChannel1", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorChannel1), - XtRString, COLOR_CHANNEL1 }, - { "colorChannel", "colorChannel", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorChannel), - XtRString, COLOR_CHANNEL }, - { "colorKibitz", "colorKibitz", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorKibitz), - XtRString, COLOR_KIBITZ }, - { "colorTell", "colorTell", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorTell), - XtRString, COLOR_TELL }, - { "colorChallenge", "colorChallenge", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorChallenge), - XtRString, COLOR_CHALLENGE }, - { "colorRequest", "colorRequest", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorRequest), - XtRString, COLOR_REQUEST }, - { "colorSeek", "colorSeek", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorSeek), - XtRString, COLOR_SEEK }, - { "colorNormal", "colorNormal", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorNormal), - XtRString, COLOR_NORMAL }, - { "soundProgram", "soundProgram", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundProgram), - XtRString, "play" }, - { "soundShout", "soundShout", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundShout), - XtRString, "" }, - { "soundSShout", "soundSShout", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundSShout), - XtRString, "" }, - { "soundChannel1", "soundChannel1", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundChannel1), - XtRString, "" }, - { "soundChannel", "soundChannel", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundChannel), - XtRString, "" }, - { "soundKibitz", "soundKibitz", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundKibitz), - XtRString, "" }, - { "soundTell", "soundTell", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundTell), - XtRString, "" }, - { "soundChallenge", "soundChallenge", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundChallenge), - XtRString, "" }, - { "soundRequest", "soundRequest", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundRequest), - XtRString, "" }, - { "soundSeek", "soundSeek", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundSeek), - XtRString, "" }, - { "soundMove", "soundMove", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundMove), - XtRString, "$" }, - { "soundIcsWin", "soundIcsWin", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundIcsWin), - XtRString, "" }, - { "soundIcsLoss", "soundIcsLoss", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundIcsLoss), - XtRString, "" }, - { "soundIcsDraw", "soundIcsDraw", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundIcsDraw), - XtRString, "" }, - { "soundIcsUnfinished", "soundIcsUnfinished", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundIcsUnfinished), - XtRString, "" }, - { "soundIcsAlarm", "soundIcsAlarm", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundIcsAlarm), - XtRString, "$" }, - { "reuseFirst", "reuseFirst", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, reuseFirst), - XtRImmediate, (XtPointer) True }, - { "reuseSecond", "reuseSecond", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, reuseSecond), - XtRImmediate, (XtPointer) True }, - { "animateDragging", "animateDragging", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, animateDragging), - XtRImmediate, (XtPointer) True }, - { "animateMoving", "animateMoving", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, animate), - XtRImmediate, (XtPointer) True }, - { "animateSpeed", "animateSpeed", XtRInt, - sizeof(int), XtOffset(AppDataPtr, animSpeed), - XtRImmediate, (XtPointer)10 }, - { "popupExitMessage", "popupExitMessage", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, popupExitMessage), - XtRImmediate, (XtPointer) True }, - { "popupMoveErrors", "popupMoveErrors", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, popupMoveErrors), - XtRImmediate, (XtPointer) False }, - { "fontSizeTolerance", "fontSizeTolerance", XtRInt, - sizeof(int), XtOffset(AppDataPtr, fontSizeTolerance), - XtRImmediate, (XtPointer)4 }, - { "initialMode", "initialMode", XtRString, - sizeof(String), XtOffset(AppDataPtr, initialMode), - XtRImmediate, (XtPointer) "" }, - { "variant", "variant", XtRString, - sizeof(String), XtOffset(AppDataPtr, variant), - XtRImmediate, (XtPointer) "normal" }, - { "firstProtocolVersion", "firstProtocolVersion", XtRInt, - sizeof(int), XtOffset(AppDataPtr, firstProtocolVersion), - XtRImmediate, (XtPointer)PROTOVER }, - { "secondProtocolVersion", "secondProtocolVersion", XtRInt, - sizeof(int), XtOffset(AppDataPtr, secondProtocolVersion), - XtRImmediate, (XtPointer)PROTOVER }, - { "showButtonBar", "showButtonBar", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, showButtonBar), - XtRImmediate, (XtPointer) True }, - { "lowTimeWarningColor", "lowTimeWarningColor", XtRString, - sizeof(String), XtOffset(AppDataPtr, lowTimeWarningColor), - XtRString, COLOR_LOWTIMEWARNING }, - { "lowTimeWarning", "lowTimeWarning", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, lowTimeWarning), - XtRImmediate, (XtPointer) False }, - {"icsEngineAnalyze", "icsEngineAnalyze", XtRBoolean, /* [DM] icsEngineAnalyze */ - sizeof(Boolean), XtOffset(AppDataPtr, icsEngineAnalyze), - XtRImmediate, (XtPointer) False }, - { "firstScoreAbs", "firstScoreAbs", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, firstScoreIsAbsolute), - XtRImmediate, (XtPointer) False }, - { "secondScoreAbs", "secondScoreAbs", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, secondScoreIsAbsolute), - XtRImmediate, (XtPointer) False }, - { "pgnExtendedInfo", "pgnExtendedInfo", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, saveExtendedInfoInPGN), - XtRImmediate, (XtPointer) False }, - { "hideThinkingFromHuman", "hideThinkingFromHuman", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, hideThinkingFromHuman), - XtRImmediate, (XtPointer) True }, - { "adjudicateLossThreshold", "adjudicateLossThreshold", XtRInt, - sizeof(int), XtOffset(AppDataPtr, adjudicateLossThreshold), - XtRImmediate, (XtPointer) 0}, - { "adjudicateDrawMoves", "adjudicateDrawMoves", XtRInt, - sizeof(int), XtOffset(AppDataPtr, adjudicateDrawMoves), - XtRImmediate, (XtPointer) 0}, - { "pgnEventHeader", "pgnEventHeader", XtRString, - sizeof(String), XtOffset(AppDataPtr, pgnEventHeader), - XtRImmediate, (XtPointer) "Computer Chess Game" }, - { "defaultFrcPosition", "defaultFrcPositon", XtRInt, - sizeof(int), XtOffset(AppDataPtr, defaultFrcPosition), - XtRImmediate, (XtPointer) -1}, - { "gameListTags", "gameListTags", XtRString, - sizeof(String), XtOffset(AppDataPtr, gameListTags), - XtRImmediate, (XtPointer) GLT_DEFAULT_TAGS }, - - // [HGM] 4.3.xx options - { "boardWidth", "boardWidth", XtRInt, - sizeof(int), XtOffset(AppDataPtr, NrFiles), - XtRImmediate, (XtPointer) -1}, - { "boardHeight", "boardHeight", XtRInt, - sizeof(int), XtOffset(AppDataPtr, NrRanks), - XtRImmediate, (XtPointer) -1}, - { "matchPause", "matchPause", XtRInt, - sizeof(int), XtOffset(AppDataPtr, matchPause), - XtRImmediate, (XtPointer) 10000}, - { "holdingsSize", "holdingsSize", XtRInt, - sizeof(int), XtOffset(AppDataPtr, holdingsSize), - XtRImmediate, (XtPointer) -1}, - { "flipBlack", "flipBlack", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, upsideDown), - XtRImmediate, (XtPointer) False}, - { "allWhite", "allWhite", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, allWhite), - XtRImmediate, (XtPointer) False}, - { "pieceToCharTable", "pieceToCharTable", XtRString, - sizeof(String), XtOffset(AppDataPtr, pieceToCharTable), - XtRImmediate, (XtPointer) 0}, - { "alphaRank", "alphaRank", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, alphaRank), - XtRImmediate, (XtPointer) False}, - { "testClaims", "testClaims", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, testClaims), - XtRImmediate, (XtPointer) True}, - { "checkMates", "checkMates", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, checkMates), - XtRImmediate, (XtPointer) True}, - { "materialDraws", "materialDraws", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, materialDraws), - XtRImmediate, (XtPointer) True}, - { "trivialDraws", "trivialDraws", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, trivialDraws), - XtRImmediate, (XtPointer) False}, - { "ruleMoves", "ruleMoves", XtRInt, - sizeof(int), XtOffset(AppDataPtr, ruleMoves), - XtRImmediate, (XtPointer) 51}, - { "repeatsToDraw", "repeatsToDraw", XtRInt, - sizeof(int), XtOffset(AppDataPtr, drawRepeats), - XtRImmediate, (XtPointer) 6}, - { "engineDebugOutput", "engineDebugOutput", XtRInt, - sizeof(int), XtOffset(AppDataPtr, engineComments), - XtRImmediate, (XtPointer) 1}, - { "userName", "userName", XtRString, - sizeof(int), XtOffset(AppDataPtr, userName), - XtRImmediate, (XtPointer) 0}, - { "autoKibitz", "autoKibitz", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoKibitz), - XtRImmediate, (XtPointer) False}, - { "firstTimeOdds", "firstTimeOdds", XtRInt, - sizeof(int), XtOffset(AppDataPtr, firstTimeOdds), - XtRImmediate, (XtPointer) 1}, - { "secondTimeOdds", "secondTimeOdds", XtRInt, - sizeof(int), XtOffset(AppDataPtr, secondTimeOdds), - XtRImmediate, (XtPointer) 1}, - { "timeOddsMode", "timeOddsMode", XtRInt, - sizeof(int), XtOffset(AppDataPtr, timeOddsMode), - XtRImmediate, (XtPointer) 0}, - { "firstAccumulateTC", "firstAccumulateTC", XtRInt, - sizeof(int), XtOffset(AppDataPtr, firstAccumulateTC), - XtRImmediate, (XtPointer) 1}, - { "secondAccumulateTC", "secondAccumulateTC", XtRInt, - sizeof(int), XtOffset(AppDataPtr, secondAccumulateTC), - XtRImmediate, (XtPointer) 1}, - { "firstNPS", "firstNPS", XtRInt, - sizeof(int), XtOffset(AppDataPtr, firstNPS), - XtRImmediate, (XtPointer) -1}, - { "secondNPS", "secondNPS", XtRInt, - sizeof(int), XtOffset(AppDataPtr, secondNPS), - XtRImmediate, (XtPointer) -1}, - { "serverMoves", "serverMoves", XtRString, - sizeof(String), XtOffset(AppDataPtr, serverMovesName), - XtRImmediate, (XtPointer) 0}, - { "serverPause", "serverPause", XtRInt, - sizeof(int), XtOffset(AppDataPtr, serverPause), - XtRImmediate, (XtPointer) 0}, - { "suppressLoadMoves", "suppressLoadMoves", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, suppressLoadMoves), - XtRImmediate, (XtPointer) False}, - { "userName", "userName", XtRString, - sizeof(String), XtOffset(AppDataPtr, userName), - XtRImmediate, (XtPointer) 0}, - { "egtFormats", "egtFormats", XtRString, - sizeof(String), XtOffset(AppDataPtr, egtFormats), - XtRImmediate, (XtPointer) 0}, - { "rewindIndex", "rewindIndex", XtRInt, - sizeof(int), XtOffset(AppDataPtr, rewindIndex), - XtRImmediate, (XtPointer) 0}, - { "sameColorGames", "sameColorGames", XtRInt, - sizeof(int), XtOffset(AppDataPtr, sameColorGames), - XtRImmediate, (XtPointer) 0}, - { "smpCores", "smpCores", XtRInt, - sizeof(int), XtOffset(AppDataPtr, smpCores), - XtRImmediate, (XtPointer) 1}, - { "niceEngines", "niceEngines", XtRInt, - sizeof(int), XtOffset(AppDataPtr, niceEngines), - XtRImmediate, (XtPointer) 0}, - { "nameOfDebugFile", "nameOfDebugFile", XtRString, - sizeof(String), XtOffset(AppDataPtr, nameOfDebugFile), - XtRImmediate, (XtPointer) "xboard.debug"}, - { "engineDebugOutput", "engineDebugOutput", XtRInt, - sizeof(int), XtOffset(AppDataPtr, engineComments), - XtRImmediate, (XtPointer) 1}, - { "noGUI", "noGUI", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, noGUI), - XtRImmediate, (XtPointer) 0}, - { "firstOptions", "firstOptions", XtRString, - sizeof(String), XtOffset(AppDataPtr, firstOptions), - XtRImmediate, (XtPointer) "" }, - { "secondOptions", "secondOptions", XtRString, - sizeof(String), XtOffset(AppDataPtr, secondOptions), - XtRImmediate, (XtPointer) "" }, - { "firstNeedsNoncompliantFEN", "firstNeedsNoncompliantFEN", XtRString, - sizeof(String), XtOffset(AppDataPtr, fenOverride1), - XtRImmediate, (XtPointer) 0 }, - { "secondNeedsNoncompliantFEN", "secondNeedsNoncompliantFEN", XtRString, - sizeof(String), XtOffset(AppDataPtr, fenOverride2), - XtRImmediate, (XtPointer) 0 }, - - // [HGM] Winboard_x UCI options - { "firstIsUCI", "firstIsUCI", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, firstIsUCI), - XtRImmediate, (XtPointer) False}, - { "secondIsUCI", "secondIsUCI", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, secondIsUCI), - XtRImmediate, (XtPointer) False}, - { "firstHasOwnBookUCI", "firstHasOwnBookUCI", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, firstHasOwnBookUCI), - XtRImmediate, (XtPointer) True}, - { "secondHasOwnBookUCI", "secondHasOwnBookUCI", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, secondHasOwnBookUCI), - XtRImmediate, (XtPointer) True}, - { "usePolyglotBook", "usePolyglotBook", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, usePolyglotBook), - XtRImmediate, (XtPointer) False}, - { "defaultHashSize", "defaultHashSize", XtRInt, - sizeof(int), XtOffset(AppDataPtr, defaultHashSize), - XtRImmediate, (XtPointer) 64}, - { "defaultCacheSizeEGTB", "defaultCacheSizeEGTB", XtRInt, - sizeof(int), XtOffset(AppDataPtr, defaultCacheSizeEGTB), - XtRImmediate, (XtPointer) 4}, - { "polyglotDir", "polyglotDir", XtRString, - sizeof(String), XtOffset(AppDataPtr, polyglotDir), - XtRImmediate, (XtPointer) "." }, - { "polyglotBook", "polyglotBook", XtRString, - sizeof(String), XtOffset(AppDataPtr, polyglotBook), - XtRImmediate, (XtPointer) "" }, - { "defaultPathEGTB", "defaultPathEGTB", XtRString, - sizeof(String), XtOffset(AppDataPtr, defaultPathEGTB), - XtRImmediate, (XtPointer) "/usr/local/share/egtb"}, - { "delayBeforeQuit", "delayBeforeQuit", XtRInt, - sizeof(int), XtOffset(AppDataPtr, delayBeforeQuit), - XtRImmediate, (XtPointer) 0}, - { "delayAfterQuit", "delayAfterQuit", XtRInt, - sizeof(int), XtOffset(AppDataPtr, delayAfterQuit), - XtRImmediate, (XtPointer) 0}, - { "keepAlive", "keepAlive", XtRInt, - sizeof(int), XtOffset(AppDataPtr, keepAlive), - XtRImmediate, (XtPointer) 0}, - { "forceIllegalMoves", "forceIllegalMoves", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, forceIllegal), - XtRImmediate, (XtPointer) False}, - { "keepLineBreaksICS", "keepLineBreaksICS", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, noJoin), - XtRImmediate, (XtPointer) False}, - { "wrapContinuationSequence", "wrapContinuationSequence", XtRString, - sizeof(String), XtOffset(AppDataPtr, wrapContSeq), - XtRString, ""}, - { "useInternalWrap", "useInternalWrap", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, useInternalWrap), - XtRImmediate, (XtPointer) True}, - { "autoDisplayTags", "autoDisplayTags", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoDisplayTags), - XtRImmediate, (XtPointer) True}, - { "autoDisplayComment", "autoDisplayComment", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoDisplayComment), - XtRImmediate, (XtPointer) True}, - { "pasteSelection", "pasteSelection", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, pasteSelection), - XtRImmediate, (XtPointer) False}, }; XrmOptionDescRec shellOptions[] = { - { "-whitePieceColor", "whitePieceColor", XrmoptionSepArg, NULL }, - { "-blackPieceColor", "blackPieceColor", XrmoptionSepArg, NULL }, - { "-lightSquareColor", "lightSquareColor", XrmoptionSepArg, NULL }, - { "-darkSquareColor", "darkSquareColor", XrmoptionSepArg, NULL }, - { "-highlightSquareColor", "highlightSquareColor", XrmoptionSepArg, NULL }, - { "-premoveHighlightColor", "premoveHighlightColor", XrmoptionSepArg,NULL}, - { "-movesPerSession", "movesPerSession", XrmoptionSepArg, NULL }, - { "-mps", "movesPerSession", XrmoptionSepArg, NULL }, - { "-timeIncrement", "timeIncrement", XrmoptionSepArg, NULL }, - { "-inc", "timeIncrement", XrmoptionSepArg, NULL }, - { "-initString", "initString", XrmoptionSepArg, NULL }, - { "-firstInitString", "initString", XrmoptionSepArg, NULL }, - { "-secondInitString", "secondInitString", XrmoptionSepArg, NULL }, - { "-firstComputerString", "firstComputerString", XrmoptionSepArg, NULL }, - { "-secondComputerString", "secondComputerString", XrmoptionSepArg, NULL }, - { "-firstChessProgram", "firstChessProgram", XrmoptionSepArg, NULL }, - { "-fcp", "firstChessProgram", XrmoptionSepArg, NULL }, - { "-secondChessProgram", "secondChessProgram", XrmoptionSepArg, NULL }, - { "-scp", "secondChessProgram", XrmoptionSepArg, NULL }, - { "-firstPlaysBlack", "firstPlaysBlack", XrmoptionSepArg, NULL }, - { "-fb", "firstPlaysBlack", XrmoptionNoArg, "True" }, - { "-xfb", "firstPlaysBlack", XrmoptionNoArg, "False" }, - { "-noChessProgram", "noChessProgram", XrmoptionSepArg, NULL }, - { "-ncp", "noChessProgram", XrmoptionNoArg, "True" }, - { "-xncp", "noChessProgram", XrmoptionNoArg, "False" }, - { "-firstHost", "firstHost", XrmoptionSepArg, NULL }, - { "-fh", "firstHost", XrmoptionSepArg, NULL }, - { "-secondHost", "secondHost", XrmoptionSepArg, NULL }, - { "-sh", "secondHost", XrmoptionSepArg, NULL }, - { "-firstDirectory", "firstDirectory", XrmoptionSepArg, NULL }, - { "-fd", "firstDirectory", XrmoptionSepArg, NULL }, - { "-secondDirectory", "secondDirectory", XrmoptionSepArg, NULL }, - { "-sd", "secondDirectory", XrmoptionSepArg, NULL }, - { "-bitmapDirectory", "bitmapDirectory", XrmoptionSepArg, NULL }, - { "-bm", "bitmapDirectory", XrmoptionSepArg, NULL }, - { "-remoteShell", "remoteShell", XrmoptionSepArg, NULL }, - { "-rsh", "remoteShell", XrmoptionSepArg, NULL }, - { "-remoteUser", "remoteUser", XrmoptionSepArg, NULL }, - { "-ruser", "remoteUser", XrmoptionSepArg, NULL }, - { "-timeDelay", "timeDelay", XrmoptionSepArg, NULL }, - { "-td", "timeDelay", XrmoptionSepArg, NULL }, - { "-timeControl", "timeControl", XrmoptionSepArg, NULL }, - { "-tc", "timeControl", XrmoptionSepArg, NULL }, - { "-internetChessServerMode", "internetChessServerMode", - XrmoptionSepArg, NULL }, - { "-ics", "internetChessServerMode", XrmoptionNoArg, "True" }, - { "-xics", "internetChessServerMode", XrmoptionNoArg, "False" }, - { "-internetChessServerHost", "internetChessServerHost", - XrmoptionSepArg, NULL }, - { "-icshost", "internetChessServerHost", XrmoptionSepArg, NULL }, - { "-internetChessServerPort", "internetChessServerPort", - XrmoptionSepArg, NULL }, - { "-icsport", "internetChessServerPort", XrmoptionSepArg, NULL }, - { "-internetChessServerCommPort", "internetChessServerCommPort", - XrmoptionSepArg, NULL }, - { "-icscomm", "internetChessServerCommPort", XrmoptionSepArg, NULL }, - { "-internetChessServerLogonScript", "internetChessServerLogonScript", - XrmoptionSepArg, NULL }, - { "-icslogon", "internetChessServerLogonScript", XrmoptionSepArg, NULL }, - { "-internetChessServerHelper", "internetChessServerHelper", - XrmoptionSepArg, NULL }, - { "-icshelper", "internetChessServerHelper", XrmoptionSepArg, NULL }, - { "-internetChessServerInputBox", "internetChessServerInputBox", - XrmoptionSepArg, NULL }, - { "-icsinput", "internetChessServerInputBox", XrmoptionNoArg, "True" }, - { "-xicsinput", "internetChessServerInputBox", XrmoptionNoArg, "False" }, - { "-icsAlarm", "icsAlarm", XrmoptionSepArg, NULL }, - { "-alarm", "icsAlarm", XrmoptionNoArg, "True" }, - { "-xalarm", "icsAlarm", XrmoptionNoArg, "False" }, - { "-icsAlarmTime", "icsAlarmTime", XrmoptionSepArg, NULL }, - { "-useTelnet", "useTelnet", XrmoptionSepArg, NULL }, - { "-telnet", "useTelnet", XrmoptionNoArg, "True" }, - { "-xtelnet", "useTelnet", XrmoptionNoArg, "False" }, - { "-telnetProgram", "telnetProgram", XrmoptionSepArg, NULL }, - { "-gateway", "gateway", XrmoptionSepArg, NULL }, - { "-loadGameFile", "loadGameFile", XrmoptionSepArg, NULL }, - { "-lgf", "loadGameFile", XrmoptionSepArg, NULL }, - { "-loadGameIndex", "loadGameIndex", XrmoptionSepArg, NULL }, - { "-lgi", "loadGameIndex", XrmoptionSepArg, NULL }, - { "-saveGameFile", "saveGameFile", XrmoptionSepArg, NULL }, - { "-sgf", "saveGameFile", XrmoptionSepArg, NULL }, - { "-autoSaveGames", "autoSaveGames", XrmoptionSepArg, NULL }, - { "-autosave", "autoSaveGames", XrmoptionNoArg, "True" }, - { "-xautosave", "autoSaveGames", XrmoptionNoArg, "False" }, - { "-autoRaiseBoard", "autoRaiseBoard", XrmoptionSepArg, NULL }, - { "-autoraise", "autoRaiseBoard", XrmoptionNoArg, "True" }, - { "-xautoraise", "autoRaiseBoard", XrmoptionNoArg, "False" }, - { "-blindfold", "blindfold", XrmoptionSepArg, NULL }, - { "-blind", "blindfold", XrmoptionNoArg, "True" }, - { "-xblind", "blindfold", XrmoptionNoArg, "False" }, - { "-loadPositionFile", "loadPositionFile", XrmoptionSepArg, NULL }, - { "-lpf", "loadPositionFile", XrmoptionSepArg, NULL }, - { "-loadPositionIndex", "loadPositionIndex", XrmoptionSepArg, NULL }, - { "-lpi", "loadPositionIndex", XrmoptionSepArg, NULL }, - { "-savePositionFile", "savePositionFile", XrmoptionSepArg, NULL }, - { "-spf", "savePositionFile", XrmoptionSepArg, NULL }, - { "-matchMode", "matchMode", XrmoptionSepArg, NULL }, - { "-mm", "matchMode", XrmoptionNoArg, "True" }, - { "-xmm", "matchMode", XrmoptionNoArg, "False" }, - { "-matchGames", "matchGames", XrmoptionSepArg, NULL }, - { "-mg", "matchGames", XrmoptionSepArg, NULL }, - { "-monoMode", "monoMode", XrmoptionSepArg, NULL }, - { "-mono", "monoMode", XrmoptionNoArg, "True" }, - { "-xmono", "monoMode", XrmoptionNoArg, "False" }, - { "-debugMode", "debugMode", XrmoptionSepArg, NULL }, - { "-debug", "debugMode", XrmoptionNoArg, "True" }, - { "-xdebug", "debugMode", XrmoptionNoArg, "False" }, - { "-clockMode", "clockMode", XrmoptionSepArg, NULL }, - { "-clock", "clockMode", XrmoptionNoArg, "True" }, - { "-xclock", "clockMode", XrmoptionNoArg, "False" }, - { "-boardSize", "boardSize", XrmoptionSepArg, NULL }, - { "-size", "boardSize", XrmoptionSepArg, NULL }, - { "-searchTime", "searchTime", XrmoptionSepArg, NULL }, - { "-st", "searchTime", XrmoptionSepArg, NULL }, - { "-searchDepth", "searchDepth", XrmoptionSepArg, NULL }, - { "-depth", "searchDepth", XrmoptionSepArg, NULL }, - { "-showCoords", "showCoords", XrmoptionSepArg, NULL }, - { "-coords", "showCoords", XrmoptionNoArg, "True" }, - { "-xcoords", "showCoords", XrmoptionNoArg, "False" }, -#if JAIL - { "-showJail", "showJail", XrmoptionSepArg, NULL }, - { "-jail", "showJail", XrmoptionNoArg, "1" }, - { "-sidejail", "showJail", XrmoptionNoArg, "2" }, - { "-xjail", "showJail", XrmoptionNoArg, "0" }, -#endif - { "-showThinking", "showThinking", XrmoptionSepArg, NULL }, - { "-thinking", "showThinking", XrmoptionNoArg, "True" }, - { "-xthinking", "showThinking", XrmoptionNoArg, "False" }, - { "-ponderNextMove", "ponderNextMove", XrmoptionSepArg, NULL }, - { "-ponder", "ponderNextMove", XrmoptionNoArg, "True" }, - { "-xponder", "ponderNextMove", XrmoptionNoArg, "False" }, - { "-periodicUpdates", "periodicUpdates", XrmoptionSepArg, NULL }, - { "-periodic", "periodicUpdates", XrmoptionNoArg, "True" }, - { "-xperiodic", "periodicUpdates", XrmoptionNoArg, "False" }, - { "-clockFont", "clockFont", XrmoptionSepArg, NULL }, - { "-coordFont", "coordFont", XrmoptionSepArg, NULL }, - { "-font", "font", XrmoptionSepArg, NULL }, - { "-ringBellAfterMoves", "ringBellAfterMoves", XrmoptionSepArg, NULL }, - { "-bell", "ringBellAfterMoves", XrmoptionNoArg, "True" }, - { "-xbell", "ringBellAfterMoves", XrmoptionNoArg, "False" }, - { "-movesound", "ringBellAfterMoves", XrmoptionNoArg, "True" }, - { "-xmovesound", "ringBellAfterMoves", XrmoptionNoArg, "False" }, - { "-autoCallFlag", "autoCallFlag", XrmoptionSepArg, NULL }, - { "-autoflag", "autoCallFlag", XrmoptionNoArg, "True" }, - { "-xautoflag", "autoCallFlag", XrmoptionNoArg, "False" }, - { "-autoFlipView", "autoFlipView", XrmoptionSepArg, NULL }, - { "-autoflip", "autoFlipView", XrmoptionNoArg, "True" }, - { "-xautoflip", "autoFlipView", XrmoptionNoArg, "False" }, - { "-autoObserve", "autoObserve", XrmoptionSepArg, NULL }, - { "-autobs", "autoObserve", XrmoptionNoArg, "True" }, - { "-xautobs", "autoObserve", XrmoptionNoArg, "False" }, - { "-autoComment", "autoComment", XrmoptionSepArg, NULL }, - { "-autocomm", "autoComment", XrmoptionNoArg, "True" }, - { "-xautocomm", "autoComment", XrmoptionNoArg, "False" }, - { "-getMoveList", "getMoveList", XrmoptionSepArg, NULL }, - { "-moves", "getMoveList", XrmoptionNoArg, "True" }, - { "-xmoves", "getMoveList", XrmoptionNoArg, "False" }, -#if HIGHDRAG - { "-highlightDragging", "highlightDragging", XrmoptionSepArg, NULL }, - { "-highdrag", "highlightDragging", XrmoptionNoArg, "True" }, - { "-xhighdrag", "highlightDragging", XrmoptionNoArg, "False" }, -#endif - { "-highlightLastMove", "highlightLastMove", XrmoptionSepArg, NULL }, - { "-highlight", "highlightLastMove", XrmoptionNoArg, "True" }, - { "-xhighlight", "highlightLastMove", XrmoptionNoArg, "False" }, - { "-premove", "premove", XrmoptionSepArg, NULL }, - { "-pre", "premove", XrmoptionNoArg, "True" }, - { "-xpre", "premove", XrmoptionNoArg, "False" }, - { "-testLegality", "testLegality", XrmoptionSepArg, NULL }, - { "-legal", "testLegality", XrmoptionNoArg, "True" }, - { "-xlegal", "testLegality", XrmoptionNoArg, "False" }, - { "-flipView", "flipView", XrmoptionSepArg, NULL }, - { "-flip", "flipView", XrmoptionNoArg, "True" }, - { "-xflip", "flipView", XrmoptionNoArg, "False" }, - { "-cmail", "cmailGameName", XrmoptionSepArg, NULL }, - { "-alwaysPromoteToQueen", "alwaysPromoteToQueen", - XrmoptionSepArg, NULL }, - { "-queen", "alwaysPromoteToQueen", XrmoptionNoArg, "True" }, - { "-xqueen", "alwaysPromoteToQueen", XrmoptionNoArg, "False" }, - { "-oldSaveStyle", "oldSaveStyle", XrmoptionSepArg, NULL }, - { "-oldsave", "oldSaveStyle", XrmoptionNoArg, "True" }, - { "-xoldsave", "oldSaveStyle", XrmoptionNoArg, "False" }, - { "-quietPlay", "quietPlay", XrmoptionSepArg, NULL }, - { "-quiet", "quietPlay", XrmoptionNoArg, "True" }, - { "-xquiet", "quietPlay", XrmoptionNoArg, "False" }, - { "-titleInWindow", "titleInWindow", XrmoptionSepArg, NULL }, - { "-title", "titleInWindow", XrmoptionNoArg, "True" }, - { "-xtitle", "titleInWindow", XrmoptionNoArg, "False" }, -#ifdef ZIPPY - { "-zippyTalk", "zippyTalk", XrmoptionSepArg, NULL }, - { "-zt", "zippyTalk", XrmoptionNoArg, "True" }, - { "-xzt", "zippyTalk", XrmoptionNoArg, "False" }, - { "-zippyPlay", "zippyPlay", XrmoptionSepArg, NULL }, - { "-zp", "zippyPlay", XrmoptionNoArg, "True" }, - { "-xzp", "zippyPlay", XrmoptionNoArg, "False" }, - { "-zippyLines", "zippyLines", XrmoptionSepArg, NULL }, - { "-zippyPinhead", "zippyPinhead", XrmoptionSepArg, NULL }, - { "-zippyPassword", "zippyPassword", XrmoptionSepArg, NULL }, - { "-zippyPassword2", "zippyPassword2", XrmoptionSepArg, NULL }, - { "-zippyWrongPassword", "zippyWrongPassword", XrmoptionSepArg, NULL }, - { "-zippyAcceptOnly", "zippyAcceptOnly", XrmoptionSepArg, NULL }, - { "-zippyUseI", "zippyUseI", XrmoptionSepArg, NULL }, - { "-zui", "zippyUseI", XrmoptionNoArg, "True" }, - { "-xzui", "zippyUseI", XrmoptionNoArg, "False" }, - { "-zippyBughouse", "zippyBughouse", XrmoptionSepArg, NULL }, - { "-zippyNoplayCrafty", "zippyNoplayCrafty", XrmoptionSepArg, NULL }, - { "-znc", "zippyNoplayCrafty", XrmoptionNoArg, "True" }, - { "-xznc", "zippyNoplayCrafty", XrmoptionNoArg, "False" }, - { "-zippyGameEnd", "zippyGameEnd", XrmoptionSepArg, NULL }, - { "-zippyGameStart", "zippyGameStart", XrmoptionSepArg, NULL }, - { "-zippyAdjourn", "zippyAdjourn", XrmoptionSepArg, NULL }, - { "-zadj", "zippyAdjourn", XrmoptionNoArg, "True" }, - { "-xzadj", "zippyAdjourn", XrmoptionNoArg, "False" }, - { "-zippyAbort", "zippyAbort", XrmoptionSepArg, NULL }, - { "-zab", "zippyAbort", XrmoptionNoArg, "True" }, - { "-xzab", "zippyAbort", XrmoptionNoArg, "False" }, - { "-zippyVariants", "zippyVariants", XrmoptionSepArg, NULL }, - { "-zippyMaxGames", "zippyMaxGames", XrmoptionSepArg, NULL }, - { "-zippyReplayTimeout", "zippyReplayTimeout", XrmoptionSepArg, NULL }, - { "-zippyShortGame", "zippyShortGame", XrmoptionSepArg, NULL }, -#endif { "-flashCount", "flashCount", XrmoptionSepArg, NULL }, { "-flash", "flashCount", XrmoptionNoArg, "3" }, { "-xflash", "flashCount", XrmoptionNoArg, "0" }, - { "-flashRate", "flashRate", XrmoptionSepArg, NULL }, - { "-pixmapDirectory", "pixmapDirectory", XrmoptionSepArg, NULL }, - { "-msLoginDelay", "msLoginDelay", XrmoptionSepArg, NULL }, - { "-pixmap", "pixmapDirectory", XrmoptionSepArg, NULL }, - { "-colorizeMessages", "colorizeMessages", XrmoptionSepArg, NULL }, - { "-colorize", "colorizeMessages", XrmoptionNoArg, "True" }, - { "-xcolorize", "colorizeMessages", XrmoptionNoArg, "False" }, - { "-colorShout", "colorShout", XrmoptionSepArg, NULL }, - { "-colorSShout", "colorSShout", XrmoptionSepArg, NULL }, - { "-colorCShout", "colorSShout", XrmoptionSepArg, NULL }, /*FICS name*/ - { "-colorChannel1", "colorChannel1", XrmoptionSepArg, NULL }, - { "-colorChannel", "colorChannel", XrmoptionSepArg, NULL }, - { "-colorKibitz", "colorKibitz", XrmoptionSepArg, NULL }, - { "-colorTell", "colorTell", XrmoptionSepArg, NULL }, - { "-colorChallenge", "colorChallenge", XrmoptionSepArg, NULL }, - { "-colorRequest", "colorRequest", XrmoptionSepArg, NULL }, - { "-colorSeek", "colorSeek", XrmoptionSepArg, NULL }, - { "-colorNormal", "colorNormal", XrmoptionSepArg, NULL }, - { "-soundProgram", "soundProgram", XrmoptionSepArg, NULL }, - { "-soundShout", "soundShout", XrmoptionSepArg, NULL }, - { "-soundSShout", "soundSShout", XrmoptionSepArg, NULL }, - { "-soundCShout", "soundSShout", XrmoptionSepArg, NULL }, /*FICS name*/ - { "-soundChannel1", "soundChannel1", XrmoptionSepArg, NULL }, - { "-soundChannel", "soundChannel", XrmoptionSepArg, NULL }, - { "-soundKibitz", "soundKibitz", XrmoptionSepArg, NULL }, - { "-soundTell", "soundTell", XrmoptionSepArg, NULL }, - { "-soundChallenge", "soundChallenge", XrmoptionSepArg, NULL }, - { "-soundRequest", "soundRequest", XrmoptionSepArg, NULL }, - { "-soundSeek", "soundSeek", XrmoptionSepArg, NULL }, - { "-soundMove", "soundMove", XrmoptionSepArg, NULL }, - { "-soundIcsWin", "soundIcsWin", XrmoptionSepArg, NULL }, - { "-soundIcsLoss", "soundIcsLoss", XrmoptionSepArg, NULL }, - { "-soundIcsDraw", "soundIcsDraw", XrmoptionSepArg, NULL }, - { "-soundIcsUnfinished", "soundIcsUnfinished", XrmoptionSepArg, NULL }, - { "-soundIcsAlarm", "soundIcsAlarm", XrmoptionSepArg, NULL }, - { "-reuseFirst", "reuseFirst", XrmoptionSepArg, NULL }, - { "-reuseChessPrograms", "reuseFirst", XrmoptionSepArg, NULL }, /*compat*/ - { "-reuse", "reuseFirst", XrmoptionNoArg, "True" }, - { "-xreuse", "reuseFirst", XrmoptionNoArg, "False" }, - { "-reuseSecond", "reuseSecond", XrmoptionSepArg, NULL }, - { "-reuse2", "reuseSecond", XrmoptionNoArg, "True" }, - { "-xreuse2", "reuseSecond", XrmoptionNoArg, "False" }, - { "-animateMoving", "animateMoving", XrmoptionSepArg, NULL }, - { "-animate", "animateMoving", XrmoptionNoArg, "True" }, - { "-xanimate", "animateMoving", XrmoptionNoArg, "False" }, - { "-animateDragging", "animateDragging", XrmoptionSepArg, NULL }, - { "-drag", "animateDragging", XrmoptionNoArg, "True" }, - { "-xdrag", "animateDragging", XrmoptionNoArg, "False" }, - { "-animateSpeed", "animateSpeed", XrmoptionSepArg, NULL }, - { "-popupExitMessage", "popupExitMessage", XrmoptionSepArg, NULL }, - { "-exit", "popupExitMessage", XrmoptionNoArg, "True" }, - { "-xexit", "popupExitMessage", XrmoptionNoArg, "False" }, - { "-popupMoveErrors", "popupMoveErrors", XrmoptionSepArg, NULL }, - { "-popup", "popupMoveErrors", XrmoptionNoArg, "True" }, - { "-xpopup", "popupMoveErrors", XrmoptionNoArg, "False" }, - { "-fontSizeTolerance", "fontSizeTolerance", XrmoptionSepArg, NULL }, - { "-initialMode", "initialMode", XrmoptionSepArg, NULL }, - { "-mode", "initialMode", XrmoptionSepArg, NULL }, - { "-variant", "variant", XrmoptionSepArg, NULL }, - { "-firstProtocolVersion", "firstProtocolVersion", XrmoptionSepArg, NULL }, - { "-secondProtocolVersion","secondProtocolVersion",XrmoptionSepArg, NULL }, - { "-showButtonBar", "showButtonBar", XrmoptionSepArg, NULL }, - { "-buttons", "showButtonBar", XrmoptionNoArg, "True" }, - { "-xbuttons", "showButtonBar", XrmoptionNoArg, "False" }, - { "-lowTimeWarningColor", "lowTimeWarningColor", XrmoptionSepArg, NULL }, - { "-lowTimeWarning", "lowTimeWarning", XrmoptionSepArg, NULL }, - /* [AS,HR] New features */ - { "-firstScoreAbs", "firstScoreAbs", XrmoptionSepArg, NULL }, - { "-secondScoreAbs", "secondScoreAbs", XrmoptionSepArg, NULL }, - { "-pgnExtendedInfo", "pgnExtendedInfo", XrmoptionSepArg, NULL }, - { "-hideThinkingFromHuman", "hideThinkingFromHuman", XrmoptionSepArg, NULL }, - { "-adjudicateLossThreshold", "adjudicateLossThreshold", XrmoptionSepArg, NULL }, - { "-adjudicateDrawMoves", "adjudicateDrawMoves", XrmoptionSepArg, NULL }, - { "-pgnEventHeader", "pgnEventHeader", XrmoptionSepArg, NULL }, - { "-firstIsUCI", "firstIsUCI", XrmoptionSepArg, NULL }, - { "-secondIsUCI", "secondIsUCI", XrmoptionSepArg, NULL }, - { "-fUCI", "firstIsUCI", XrmoptionNoArg, "True" }, - { "-sUCI", "secondIsUCI", XrmoptionNoArg, "True" }, - { "-firstHasOwnBookUCI", "firstHasOwnBookUCI", XrmoptionSepArg, NULL }, - { "-secondHasOwnBookUCI", "secondHasOwnBookUCI", XrmoptionSepArg, NULL }, - { "-fNoOwnBookUCI", "firstHasOwnBookUCI", XrmoptionNoArg, "False" }, - { "-sNoOwnBookUCI", "secondHasOwnBookUCI", XrmoptionNoArg, "False" }, - { "-firstXBook", "firstHasOwnBookUCI", XrmoptionNoArg, "False" }, - { "-secondXBook", "secondHasOwnBookUCI", XrmoptionNoArg, "False" }, - { "-polyglotDir", "polyglotDir", XrmoptionSepArg, NULL }, - { "-usePolyglotBook", "usePolyglotBook", XrmoptionSepArg, NULL }, - { "-polyglotBook", "polyglotBook", XrmoptionSepArg, NULL }, - { "-defaultHashSize", "defaultHashSize", XrmoptionSepArg, NULL }, - { "-defaultCacheSizeEGTB", "defaultCacheSizeEGTB", XrmoptionSepArg, NULL }, - { "-defaultPathEGTB", "defaultPathEGTB", XrmoptionSepArg, NULL }, - { "-defaultFrcPosition", "defaultFrcPosition", XrmoptionSepArg, NULL }, - { "-gameListTags", "gameListTags", XrmoptionSepArg, NULL }, - // [HGM] I am sure AS added many more options, but we have to fish them out, from the list in winboard.c - - /* [HGM,HR] User-selectable board size */ - { "-boardWidth", "boardWidth", XrmoptionSepArg, NULL }, - { "-boardHeight", "boardHeight", XrmoptionSepArg, NULL }, - { "-matchPause", "matchPause", XrmoptionSepArg, NULL }, - - /* [HGM] new arguments of 4.3.xx. All except first three are back-end options, which should work immediately */ - { "-holdingsSize", "holdingsSize", XrmoptionSepArg, NULL }, // requires extensive front-end changes to work - { "-flipBlack", "flipBlack", XrmoptionSepArg, NULL }, // requires front-end changes to work - { "-allWhite", "allWhite", XrmoptionSepArg, NULL }, // requires front-end changes to work - { "-pieceToCharTable", "pieceToCharTable", XrmoptionSepArg, NULL }, - { "-alphaRank", "alphaRank", XrmoptionSepArg, NULL }, - { "-testClaims", "testClaims", XrmoptionSepArg, NULL }, - { "-checkMates", "checkMates", XrmoptionSepArg, NULL }, - { "-materialDraws", "materialDraws", XrmoptionSepArg, NULL }, - { "-trivialDraws", "trivialDraws", XrmoptionSepArg, NULL }, - { "-ruleMoves", "ruleMoves", XrmoptionSepArg, NULL }, - { "-repeatsToDraw", "repeatsToDraw", XrmoptionSepArg, NULL }, - { "-engineDebugOutput", "engineDebugOutput", XrmoptionSepArg, NULL }, - { "-userName", "userName", XrmoptionSepArg, NULL }, - { "-autoKibitz", "autoKibitz", XrmoptionNoArg, "True" }, - { "-firstTimeOdds", "firstTimeOdds", XrmoptionSepArg, NULL }, - { "-secondTimeOdds", "secondTimeOdds", XrmoptionSepArg, NULL }, - { "-timeOddsMode", "timeOddsMode", XrmoptionSepArg, NULL }, - { "-firstAccumulateTC", "firstAccumulateTC", XrmoptionSepArg, NULL }, - { "-secondAccumulateTC", "secondAccumulateTC", XrmoptionSepArg, NULL }, - { "-firstNPS", "firstNPS", XrmoptionSepArg, NULL }, - { "-secondNPS", "secondNPS", XrmoptionSepArg, NULL }, - { "-serverMoves", "serverMoves", XrmoptionSepArg, NULL }, - { "-serverPause", "serverPause", XrmoptionSepArg, NULL }, - { "-suppressLoadMoves", "suppressLoadMoves", XrmoptionSepArg, NULL }, - { "-egtFormats", "egtFormats", XrmoptionSepArg, NULL }, - { "-userName", "userName", XrmoptionSepArg, NULL }, - { "-smpCores", "smpCores", XrmoptionSepArg, NULL }, - { "-sameColorGames", "sameColorGames", XrmoptionSepArg, NULL }, - { "-rewindIndex", "rewindIndex", XrmoptionSepArg, NULL }, - { "-niceEngines", "niceEngines", XrmoptionSepArg, NULL }, - { "-delayBeforeQuit", "delayBeforeQuit", XrmoptionSepArg, NULL }, - { "-delayAfterQuit", "delayAfterQuit", XrmoptionSepArg, NULL }, - { "-nameOfDebugFile", "nameOfDebugFile", XrmoptionSepArg, NULL }, - { "-debugFile", "nameOfDebugFile", XrmoptionSepArg, NULL }, - { "-engineDebugOutput", "engineDebugOutput", XrmoptionSepArg, NULL }, - { "-noGUI", "noGUI", XrmoptionNoArg, "True" }, - { "-firstOptions", "firstOptions", XrmoptionSepArg, NULL }, - { "-secondOptions", "secondOptions", XrmoptionSepArg, NULL }, - { "-firstNeedsNoncompliantFEN", "firstNeedsNoncompliantFEN", XrmoptionSepArg, NULL }, - { "-secondNeedsNoncompliantFEN", "secondNeedsNoncompliantFEN", XrmoptionSepArg, NULL }, - { "-keepAlive", "keepAlive", XrmoptionSepArg, NULL }, - { "-forceIllegalMoves", "forceIllegalMoves", XrmoptionNoArg, "True" }, - { "-keepLineBreaksICS", "keepLineBreaksICS", XrmoptionSepArg, NULL }, - { "-wrapContinuationSequence", "wrapContinuationSequence", XrmoptionSepArg, NULL }, - { "-useInternalWrap", "useInternalWrap", XrmoptionSepArg, NULL }, - { "-autoDisplayTags", "autoDisplayTags", XrmoptionSepArg, NULL }, - { "-autoDisplayComment", "autoDisplayComment", XrmoptionSepArg, NULL }, - { "-pasteSelection", "pasteSelection", XrmoptionSepArg, NULL }, }; XtActionsRec boardActions[] = { @@ -1898,6 +922,8 @@ XtActionsRec boardActions[] = { { "ShowThinkingProc", ShowThinkingProc }, { "HideThinkingProc", HideThinkingProc }, { "TestLegalityProc", TestLegalityProc }, + { "SaveSettingsProc", SaveSettingsProc }, + { "SaveOnExitProc", SaveOnExitProc }, { "InfoProc", InfoProc }, { "ManProc", ManProc }, { "HintProc", HintProc }, @@ -2212,6 +1238,240 @@ BoardToTop() XtPopup(shellWidget, XtGrabNone); /* Raise if lowered */ } +//--------------------------------------------------------------------------------------------------------- +// some symbol definitions to provide the proper (= XBoard) context for the code in args.h +#define XBOARD True +#define JAWS_ARGS +#define CW_USEDEFAULT (1<<31) +#define ICS_TEXT_MENU_SIZE 90 +#define SetCurrentDirectory chdir +#define GetCurrentDirectory(SIZE, NAME) getcwd(NAME, SIZE) + +// these two must some day move to frontend.h, when they are implemented +Boolean EvalGraphIsUp(); +Boolean MoveHistoryIsUp(); + +// The option definition and parsing code common to XBoard and WinBoard is collected in this file +#include "args.h" + +// front-end part of option handling + +// [HGM] This platform-dependent table provides the location for storing the color info +void * +colorVariable[] = { + &appData.whitePieceColor, + &appData.blackPieceColor, + &appData.lightSquareColor, + &appData.darkSquareColor, + &appData.highlightSquareColor, + &appData.premoveHighlightColor, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL +}; + +void +ParseFont(char *name, int number) +{ // in XBoard, only 2 of the fonts are currently implemented, and we just copy their name + switch(number) { + case 0: // CLOCK_FONT + appData.clockFont = strdup(name); + break; + case 1: // MESSAGE_FONT + appData.font = strdup(name); + break; + case 2: // COORD_FONT + appData.coordFont = strdup(name); + break; + default: + return; + } +} + +void +SetFontDefaults() +{ // only 2 fonts currently + appData.clockFont = CLOCK_FONT_NAME; + appData.coordFont = COORD_FONT_NAME; + appData.font = DEFAULT_FONT_NAME; +} + +void +CreateFonts() +{ // no-op, until we identify the code for this already in XBoard and move it here +} + +void +ParseColor(int n, char *name) +{ // in XBoard, just copy the color-name string + if(colorVariable[n]) *(char**)colorVariable[n] = strdup(name); +} + +void +ParseTextAttribs(ColorClass cc, char *s) +{ + (&appData.colorShout)[cc] = strdup(s); +} + +void +ParseBoardSize(void *addr, char *name) +{ + appData.boardSize = strdup(name); +} + +void +LoadAllSounds() +{ // In XBoard the sound-playing program takes care of obtaining the actual sound +} + +void +SetCommPortDefaults() +{ // for now, this is a no-op, as the corresponding option does not exist in XBoard +} + +// [HGM] args: these three cases taken out to stay in front-end +void +SaveFontArg(FILE *f, ArgDescriptor *ad) +{ + char *name; + switch((int)ad->argLoc) { + case 0: // CLOCK_FONT + name = appData.clockFont; + break; + case 1: // MESSAGE_FONT + name = appData.font; + break; + case 2: // COORD_FONT + name = appData.coordFont; + break; + default: + return; + } + fprintf(f, "/%s=%s\n", ad->argName, name); +} + +void +ExportSounds() +{ // nothing to do, as the sounds are at all times represented by their text-string names already +} + +void +SaveAttribsArg(FILE *f, ArgDescriptor *ad) +{ // here the "argLoc" defines a table index. It could have contained the 'ta' pointer itself, though + fprintf(f, "/%s=%s\n", ad->argName, (&appData.colorShout)[(int)ad->argLoc]); +} + +void +SaveColor(FILE *f, ArgDescriptor *ad) +{ // in WinBoard the color is an int and has to be converted to text. In X it would be a string already? + if(colorVariable[(int)ad->argLoc]) + fprintf(f, "/%s=%s\n", ad->argName, *(char**)colorVariable[(int)ad->argLoc]); +} + +void +SaveBoardSize(FILE *f, char *name, void *addr) +{ // wrapper to shield back-end from BoardSize & sizeInfo + fprintf(f, "/%s=%s\n", name, appData.boardSize); +} + +void +ParseCommPortSettings(char *s) +{ // no such option in XBoard (yet) +} + +void +GetWindowCoords() +{ // wrapper to shield use of window handles from back-end (make addressible by number?) +#if 0 + // In XBoard this will have to wait until awareness of window parameters is implemented + GetActualPlacement(hwndMain, &wpMain); + GetActualPlacement(hwndConsole, &wpConsole); + GetActualPlacement(commentDialog, &wpComment); + GetActualPlacement(editTagsDialog, &wpTags); + GetActualPlacement(gameListDialog, &wpGameList); + GetActualPlacement(moveHistoryDialog, &wpMoveHistory); + GetActualPlacement(evalGraphDialog, &wpEvalGraph); + GetActualPlacement(engineOutputDialog, &wpEngineOutput); +#endif +} + +void +PrintCommPortSettings(FILE *f, char *name) +{ // This option does not exist in XBoard +} + +int +MySearchPath(char *installDir, char *name, char *fullname) +{ // just append installDir and name. Perhaps ExpandPath should be used here? + name = ExpandPathName(name); + if(name && name[0] == '/') strcpy(fullname, name); else { + sprintf(fullname, "%s%c%s", installDir, '/', name); + } + return 1; +} + +int +MyGetFullPathName(char *name, char *fullname) +{ // should use ExpandPath? + name = ExpandPathName(name); + strcpy(fullname, name); + return 1; +} + +void +EnsureOnScreen(int *x, int *y, int minX, int minY) +{ + return; +} + +Boolean +MoveHistoryIsUp() +{ + return True; // still have to fix this ***************************************************************************** +} + +Boolean +EvalGraphIsUp() +{ + return False; +} + +int +MainWindowUp() +{ // [HGM] args: allows testing if main window is realized from back-end + return xBoardWindow != 0; +} + +void +PopUpStartupDialog() +{ // start menu not implemented in XBoard +} +char * +ConvertToLine(int argc, char **argv) +{ + static char line[128*1024], buf[1024]; + int i; + + line[0] = NULLCHAR; + for(i=1; i 1) - { /* left over command line arguments, print out help and exit. - * Use two columns to print help - */ - fprintf(stderr, _("%s: unrecognized argument %s\n"), - programName, argv[1]); - - fprintf(stderr, "Recognized options:\n"); - for(i = 0; i < XtNumber(shellOptions); i++) - { - /* print first column */ - j = fprintf(stderr, " %s%s", shellOptions[i].option, - (shellOptions[i].argKind == XrmoptionSepArg - ? " ARG" : "")); - /* print second column and end line */ - if (++i < XtNumber(shellOptions)) - { - fprintf(stderr, "%*c%s%s\n", 40 - j, ' ', - shellOptions[i].option, - (shellOptions[i].argKind == XrmoptionSepArg - ? " ARG" : "")); - } - else - { - fprintf(stderr, "\n"); - }; - }; - exit(2); - }; - + appData.boardSize = ""; + InitAppData(ConvertToLine(argc, argv)); p = getenv("HOME"); if (p == NULL) p = "/tmp"; i = strlen(p) + strlen("/.xboardXXXXXx.pgn") + 1; @@ -2565,6 +1797,7 @@ main(argc, argv) szd++; } if (szd->name == NULL) szd--; + appData.boardSize = strdup(szd->name); // [HGM] settings: remember name for saving settings } else { while (szd->name != NULL && StrCaseCmp(szd->name, appData.boardSize) != 0) szd++; @@ -3126,6 +2359,10 @@ XBoard square size (hint): %d\n\ XtSetValues(XtNameToWidget(menuBarWidget,"menuOptions.Test Legality"), args, 1); } + if (saveSettingsOnExit) { + XtSetValues(XtNameToWidget(menuBarWidget,"menuOptions.Save Settings on Exit"), + args, 1); + } /* * Create an icon. @@ -3227,6 +2464,7 @@ ShutDownFrontEnd() if (appData.icsActive && oldICSInteractionTitle != NULL) { DisplayIcsInteractionTitle(oldICSInteractionTitle); } + if (saveSettingsOnExit) SaveSettings(settingsFileName); unlink(gameCopyFilename); unlink(gamePasteFilename); } @@ -7393,6 +6631,34 @@ void HideThinkingProc(w, event, prms, nprms) args, 1); } +void SaveOnExitProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; +{ + Arg args[16]; + + saveSettingsOnExit = !saveSettingsOnExit; + + if (saveSettingsOnExit) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Save Settings on Exit"), + args, 1); +} + +void SaveSettingsProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; +{ + SaveSettings(settingsFileName); +} + void InfoProc(w, event, prms, nprms) Widget w; XEvent *event; diff --git a/xboard.h b/xboard.h index 9f3cdd7..7ada32f 100644 --- a/xboard.h +++ b/xboard.h @@ -54,9 +54,9 @@ #define ICS_LOGON ".icsrc" #define INFOFILE "xboard.info" #define MANPAGE "xboard.6" -#define CLOCK_FONT "-*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*" -#define COORD_FONT "-*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*" -#define DEFAULT_FONT "-*-helvetica-medium-r-normal--*-*-*-*-*-*-*-*" +#define CLOCK_FONT_NAME "-*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*" +#define COORD_FONT_NAME "-*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*" +#define DEFAULT_FONT_NAME "-*-helvetica-medium-r-normal--*-*-*-*-*-*-*-*" #define COLOR_SHOUT "green" #define COLOR_SSHOUT "green,black,1" #define COLOR_CHANNEL1 "cyan" @@ -106,8 +106,15 @@ typedef struct { #define BORDER_Y_OFFSET 27 #define FIRST_CHESS_PROGRAM "fairymax" #define SECOND_CHESS_PROGRAM "fairymax" - -#define XBOARD True +#define FIRST_DIRECTORY "." +#define SECOND_DIRECTORY "." +#define SOUND_BELL "" +#define ICS_NAMES "" +#define FCP_NAMES "" +#define SCP_NAMES "" +#define ICS_TEXT_MENU_DEFAULT "" +#define SETTINGS_FILE "/etc/xboard/xboard.conf" +#define COLOR_BKGD "white" typedef int (*FileProc) P((FILE *f, int n, char *title)); void CatchDeleteWindow(Widget w, String procname);