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 \
--- /dev/null
+/*
+ * 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);
+}
#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 */
/* 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
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;
\r
winboard.o: winboard.c config.h winboard.h ../common.h ../frontend.h ../backend.h \\r
../moves.h defaults.h resource.h wclipbrd.h \\r
- wsockerr.h woptions.h wsnap.h ../lists.h help.h\r
+ wsockerr.h woptions.h wsnap.h ../lists.h help.h ../args.h\r
$(call compile, $<)\r
\r
backend.o: ../backend.c config.h ../common.h ../frontend.h ../backend.h \\r
\r
winboard.obj: winboard.c config.h winboard.h ../common.h ../frontend.h \\r
../backend.h ../moves.h wgamelist.h defaults.h resource.h wclipbrd.h \\r
- wedittags.h wsockerr.h woptions.h wsnap.h ../lists.h help.h\r
+ wedittags.h wsockerr.h woptions.h wsnap.h ../lists.h help.h ../args.h\r
$(CC) $(CFLAGS) winboard.c\r
\r
backend.obj: ../backend.c config.h ../common.h ../frontend.h ../backend.h \\r
\r
char *programName;\r
char *settingsFileName;\r
-BOOLEAN saveSettingsOnExit;\r
+Boolean saveSettingsOnExit;\r
char installDir[MSG_SIZ];\r
\r
BoardSize boardSize;\r
-BOOLEAN chessProgram;\r
+Boolean chessProgram;\r
//static int boardX, boardY;\r
int minX, minY; // [HGM] placement: volatile limits on upper-left corner\r
static int squareSize, lineGap, minorSize;\r
char *firstChessProgramNames;\r
char *secondChessProgramNames;\r
\r
-#define ARG_MAX 128*1024 /* [AS] For Roger Brown's very long list! */\r
-\r
#define PALETTESIZE 256\r
\r
HINSTANCE hInst; /* current instance */\r
-BOOLEAN alwaysOnTop = FALSE;\r
+Boolean alwaysOnTop = FALSE;\r
RECT boardRect;\r
COLORREF lightSquareColor, darkSquareColor, whitePieceColor, \r
blackPieceColor, highlightSquareColor, premoveHighlightColor;\r
static int prevStderrPort;\r
static HBITMAP userLogo;\r
\r
-/* [AS] Support for background textures */\r
-#define BACK_TEXTURE_MODE_DISABLED 0\r
-#define BACK_TEXTURE_MODE_PLAIN 1\r
-#define BACK_TEXTURE_MODE_FULL_RANDOM 2\r
-\r
static HBITMAP liteBackTexture = NULL;\r
static HBITMAP darkBackTexture = NULL;\r
static int liteBackTextureMode = BACK_TEXTURE_MODE_PLAIN;\r
#endif\r
#endif\r
\r
-char *defaultTextAttribs[] = \r
-{\r
- COLOR_SHOUT, COLOR_SSHOUT, COLOR_CHANNEL1, COLOR_CHANNEL, COLOR_KIBITZ,\r
- COLOR_TELL, COLOR_CHALLENGE, COLOR_REQUEST, COLOR_SEEK, COLOR_NORMAL,\r
- COLOR_NONE\r
-};\r
-\r
typedef struct {\r
char *name;\r
int squareSize;\r
char *filepart;\r
\r
hInst = hInstance; /* Store instance handle in our global variable */\r
+ programName = szAppName;\r
\r
if (SearchPath(NULL, "WinBoard.exe", NULL, MSG_SIZ, installDir, &filepart)) {\r
*filepart = NULLCHAR;\r
gameInfo.boardWidth = gameInfo.boardHeight = 8; // [HGM] won't have open window otherwise\r
screenWidth = screenHeight = 1000; // [HGM] placement: kludge to allow calling EnsureOnScreen from InitAppData\r
InitAppData(lpCmdLine); /* Get run-time parameters */\r
+ /* xboard, and older WinBoards, controlled the move sound with the\r
+ appData.ringBellAfterMoves option. In the current WinBoard, we\r
+ always turn the option on (so that the backend will call us),\r
+ then let the user turn the sound off by setting it to silence if\r
+ desired. To accommodate old winboard.ini files saved by old\r
+ versions of WinBoard, we also turn off the sound if the option\r
+ was initially set to false. [HGM] taken out of InitAppData */\r
+ if (!appData.ringBellAfterMoves) {\r
+ sounds[(int)SoundMove].name = strdup("");\r
+ appData.ringBellAfterMoves = TRUE;\r
+ }\r
if (appData.debugMode) {\r
debugFP = fopen(appData.nameOfDebugFile, "w");\r
setbuf(debugFP, NULL);\r
\r
}\r
\r
+VOID\r
+InitMenuChecks()\r
+{\r
+ HMENU hmenu = GetMenu(hwndMain);\r
\r
-typedef enum {\r
- ArgString, ArgInt, ArgFloat, ArgBoolean, ArgTrue, ArgFalse, ArgNone, \r
- ArgColor, ArgAttribs, ArgFilename, ArgBoardSize, ArgFont, ArgCommSettings,\r
- ArgSettingsFilename,\r
- ArgX, ArgY, ArgZ // [HGM] placement: for window-placement options stored relative to main window\r
-} ArgType;\r
-\r
-typedef void *ArgIniType;\r
-#define INVALID (ArgIniType) 6915 /* Some number unlikely to be needed as default for anything */\r
+ (void) EnableMenuItem(hmenu, IDM_CommPort,\r
+ MF_BYCOMMAND|((appData.icsActive &&\r
+ *appData.icsCommPort != NULLCHAR) ?\r
+ MF_ENABLED : MF_GRAYED));\r
+ (void) CheckMenuItem(hmenu, IDM_SaveSettingsOnExit,\r
+ MF_BYCOMMAND|(saveSettingsOnExit ?\r
+ MF_CHECKED : MF_UNCHECKED));\r
+}\r
\r
-typedef struct {\r
- char *argName;\r
- ArgType argType;\r
- /***\r
- union {\r
- String *pString; // ArgString\r
- int *pInt; // ArgInt\r
- float *pFloat; // ArgFloat\r
- Boolean *pBoolean; // ArgBoolean\r
- COLORREF *pColor; // ArgColor\r
- ColorClass cc; // ArgAttribs\r
- String *pFilename; // ArgFilename\r
- BoardSize *pBoardSize; // ArgBoardSize\r
- int whichFont; // ArgFont\r
- DCB *pDCB; // ArgCommSettings\r
- String *pFilename; // ArgSettingsFilename\r
- } argLoc;\r
- ***/\r
- LPVOID argLoc;\r
- BOOL save;\r
- ArgIniType defaultValue;\r
-} ArgDescriptor;\r
-\r
-int junk;\r
+//---------------------------------------------------------------------------------------------------------\r
\r
+#define ICS_TEXT_MENU_SIZE (IDM_CommandXLast - IDM_CommandX + 1)\r
#define XBOARD FALSE\r
\r
-ArgDescriptor argDescriptors[] = {\r
- /* positional arguments */\r
- { "loadGameFile", ArgFilename, (LPVOID) &appData.loadGameFile, FALSE, INVALID },\r
- { "", ArgNone, NULL, FALSE, INVALID },\r
- /* keyword arguments */\r
- JAWS_ARGS\r
- { "whitePieceColor", ArgColor, (LPVOID) &whitePieceColor, TRUE, INVALID },\r
- { "wpc", ArgColor, (LPVOID) &whitePieceColor, FALSE, INVALID },\r
- { "blackPieceColor", ArgColor, (LPVOID) &blackPieceColor, TRUE, INVALID },\r
- { "bpc", ArgColor, (LPVOID) &blackPieceColor, FALSE, INVALID },\r
- { "lightSquareColor", ArgColor, (LPVOID) &lightSquareColor, TRUE, INVALID },\r
- { "lsc", ArgColor, (LPVOID) &lightSquareColor, FALSE, INVALID },\r
- { "darkSquareColor", ArgColor, (LPVOID) &darkSquareColor, TRUE, INVALID },\r
- { "dsc", ArgColor, (LPVOID) &darkSquareColor, FALSE, INVALID },\r
- { "highlightSquareColor", ArgColor, (LPVOID) &highlightSquareColor, TRUE, INVALID },\r
- { "hsc", ArgColor, (LPVOID) &highlightSquareColor, FALSE, INVALID },\r
- { "premoveHighlightColor", ArgColor, (LPVOID) &premoveHighlightColor, TRUE, INVALID },\r
- { "phc", ArgColor, (LPVOID) &premoveHighlightColor, FALSE, INVALID },\r
- { "movesPerSession", ArgInt, (LPVOID) &appData.movesPerSession, TRUE, (ArgIniType) MOVES_PER_SESSION },\r
- { "mps", ArgInt, (LPVOID) &appData.movesPerSession, FALSE, INVALID },\r
- { "initString", ArgString, (LPVOID) &appData.initString, FALSE, INVALID },\r
- { "firstInitString", ArgString, (LPVOID) &appData.initString, FALSE, (ArgIniType) INIT_STRING },\r
- { "secondInitString", ArgString, (LPVOID) &appData.secondInitString, FALSE, (ArgIniType) INIT_STRING },\r
- { "firstComputerString", ArgString, (LPVOID) &appData.firstComputerString,\r
- FALSE, (ArgIniType) COMPUTER_STRING },\r
- { "secondComputerString", ArgString, (LPVOID) &appData.secondComputerString,\r
- FALSE, (ArgIniType) COMPUTER_STRING },\r
- { "firstChessProgram", ArgFilename, (LPVOID) &appData.firstChessProgram,\r
- FALSE, (ArgIniType) FIRST_CHESS_PROGRAM },\r
- { "fcp", ArgFilename, (LPVOID) &appData.firstChessProgram, FALSE, INVALID },\r
- { "secondChessProgram", ArgFilename, (LPVOID) &appData.secondChessProgram,\r
- FALSE, (ArgIniType) SECOND_CHESS_PROGRAM },\r
- { "scp", ArgFilename, (LPVOID) &appData.secondChessProgram, FALSE, INVALID },\r
- { "firstPlaysBlack", ArgBoolean, (LPVOID) &appData.firstPlaysBlack, FALSE, FALSE },\r
- { "fb", ArgTrue, (LPVOID) &appData.firstPlaysBlack, FALSE, FALSE },\r
- { "xfb", ArgFalse, (LPVOID) &appData.firstPlaysBlack, FALSE, INVALID },\r
- { "-fb", ArgFalse, (LPVOID) &appData.firstPlaysBlack, FALSE, INVALID },\r
- { "noChessProgram", ArgBoolean, (LPVOID) &appData.noChessProgram, FALSE, FALSE },\r
- { "ncp", ArgTrue, (LPVOID) &appData.noChessProgram, FALSE, INVALID },\r
- { "xncp", ArgFalse, (LPVOID) &appData.noChessProgram, FALSE, INVALID },\r
- { "-ncp", ArgFalse, (LPVOID) &appData.noChessProgram, FALSE, INVALID },\r
- { "firstHost", ArgString, (LPVOID) &appData.firstHost, FALSE, (ArgIniType) FIRST_HOST },\r
- { "fh", ArgString, (LPVOID) &appData.firstHost, FALSE, INVALID },\r
- { "secondHost", ArgString, (LPVOID) &appData.secondHost, FALSE, (ArgIniType) SECOND_HOST },\r
- { "sh", ArgString, (LPVOID) &appData.secondHost, FALSE, INVALID },\r
- { "firstDirectory", ArgFilename, (LPVOID) &appData.firstDirectory, FALSE, (ArgIniType) FIRST_DIRECTORY },\r
- { "fd", ArgFilename, (LPVOID) &appData.firstDirectory, FALSE, INVALID },\r
- { "secondDirectory", ArgFilename, (LPVOID) &appData.secondDirectory, FALSE, (ArgIniType) SECOND_DIRECTORY },\r
- { "sd", ArgFilename, (LPVOID) &appData.secondDirectory, FALSE, INVALID },\r
-\r
- /* some options only used by the XBoard front end, and ignored in WinBoard */\r
- /* Their saving is controlled by XBOARD, which in WinBoard is defined as FALSE */\r
- { "internetChessServerInputBox", ArgBoolean, (LPVOID) &appData.icsInputBox, XBOARD, (ArgIniType) FALSE },\r
- { "icsinput", ArgTrue, (LPVOID) &appData.icsInputBox, FALSE, INVALID },\r
- { "xicsinput", ArgFalse, (LPVOID) &appData.icsInputBox, FALSE, INVALID },\r
- { "cmail", ArgString, (LPVOID) &appData.cmailGameName, FALSE, (ArgIniType) "" },\r
- { "soundProgram", ArgFilename, (LPVOID) &appData.soundProgram, XBOARD, (ArgIniType) "play" },\r
- { "fontSizeTolerance", ArgInt, (LPVOID) &appData.fontSizeTolerance, XBOARD, (ArgIniType) 4 },\r
- { "lowTimeWarningColor", ArgColor, (LPVOID) &appData.lowTimeWarningColor, XBOARD, \r
- (ArgIniType) LOWTIMEWARNING_COLOR },\r
- { "lowTimeWarning", ArgBoolean, (LPVOID) &appData.lowTimeWarning, XBOARD, (ArgIniType) FALSE },\r
- { "titleInWindow", ArgBoolean, (LPVOID) &appData.titleInWindow, XBOARD, (ArgIniType) FALSE },\r
- { "title", ArgTrue, (LPVOID) &appData.titleInWindow, FALSE, INVALID },\r
- { "xtitle", ArgFalse, (LPVOID) &appData.titleInWindow, FALSE, INVALID },\r
- { "flashCount", ArgInt, (LPVOID) &appData.flashCount, XBOARD, (ArgIniType) FLASH_COUNT },\r
- { "flashRate", ArgInt, (LPVOID) &appData.flashRate, XBOARD, (ArgIniType) FLASH_RATE },\r
- { "pixmapDirectory", ArgFilename, (LPVOID) &appData.pixmapDirectory, XBOARD, (ArgIniType) "" },\r
- { "pixmap", ArgFilename, (LPVOID) &appData.pixmapDirectory, FALSE, INVALID },\r
- { "bitmapDirectory", ArgFilename, (LPVOID) &appData.bitmapDirectory, XBOARD, (ArgIniType) "" },\r
- { "bm", ArgFilename, (LPVOID) &appData.bitmapDirectory, FALSE, INVALID },\r
- { "msLoginDelay", ArgInt, (LPVOID) &appData.msLoginDelay, XBOARD, (ArgIniType) MS_LOGIN_DELAY },\r
- { "pasteSelection", ArgBoolean, (LPVOID) &appData.pasteSelection, XBOARD, (ArgIniType) FALSE },\r
-\r
- { "remoteShell", ArgFilename, (LPVOID) &appData.remoteShell, FALSE, (ArgIniType) REMOTE_SHELL },\r
- { "rsh", ArgFilename, (LPVOID) &appData.remoteShell, FALSE, INVALID },\r
- { "remoteUser", ArgString, (LPVOID) &appData.remoteUser, FALSE, INVALID },\r
- { "ruser", ArgString, (LPVOID) &appData.remoteUser, FALSE, INVALID },\r
- { "timeDelay", ArgFloat, (LPVOID) &appData.timeDelay, TRUE, INVALID },\r
- { "td", ArgFloat, (LPVOID) &appData.timeDelay, FALSE, INVALID },\r
- { "timeControl", ArgString, (LPVOID) &appData.timeControl, TRUE, (ArgIniType) TIME_CONTROL },\r
- { "tc", ArgString, (LPVOID) &appData.timeControl, FALSE, INVALID },\r
- { "timeIncrement", ArgInt, (LPVOID) &appData.timeIncrement, TRUE, (ArgIniType) TIME_INCREMENT },\r
- { "inc", ArgInt, (LPVOID) &appData.timeIncrement, FALSE, INVALID },\r
- { "internetChessServerMode", ArgBoolean, (LPVOID) &appData.icsActive, FALSE, INVALID },\r
- { "ics", ArgTrue, (LPVOID) &appData.icsActive, FALSE, (ArgIniType) FALSE },\r
- { "xics", ArgFalse, (LPVOID) &appData.icsActive, FALSE, INVALID },\r
- { "-ics", ArgFalse, (LPVOID) &appData.icsActive, FALSE, INVALID },\r
- { "internetChessServerHost", ArgString, (LPVOID) &appData.icsHost, FALSE, (ArgIniType) "" },\r
- { "icshost", ArgString, (LPVOID) &appData.icsHost, FALSE, INVALID },\r
- { "internetChessServerPort", ArgString, (LPVOID) &appData.icsPort, FALSE, (ArgIniType) ICS_PORT },\r
- { "icsport", ArgString, (LPVOID) &appData.icsPort, FALSE, INVALID },\r
- { "internetChessServerCommPort", ArgString, (LPVOID) &appData.icsCommPort, FALSE, (ArgIniType) ICS_COMM_PORT },\r
- { "icscomm", ArgString, (LPVOID) &appData.icsCommPort, FALSE, INVALID },\r
- { "internetChessServerComPort", ArgString, (LPVOID) &appData.icsCommPort, FALSE, INVALID },\r
- { "icscom", ArgString, (LPVOID) &appData.icsCommPort, FALSE, INVALID },\r
- { "internetChessServerLogonScript", ArgFilename, (LPVOID) &appData.icsLogon, FALSE, (ArgIniType) ICS_LOGON },\r
- { "icslogon", ArgFilename, (LPVOID) &appData.icsLogon, FALSE, INVALID },\r
- { "useTelnet", ArgBoolean, (LPVOID) &appData.useTelnet, FALSE, INVALID },\r
- { "telnet", ArgTrue, (LPVOID) &appData.useTelnet, FALSE, INVALID },\r
- { "xtelnet", ArgFalse, (LPVOID) &appData.useTelnet, FALSE, INVALID },\r
- { "-telnet", ArgFalse, (LPVOID) &appData.useTelnet, FALSE, INVALID },\r
- { "telnetProgram", ArgFilename, (LPVOID) &appData.telnetProgram, FALSE, (ArgIniType) TELNET_PROGRAM },\r
- { "internetChessserverHelper", ArgFilename, (LPVOID) &appData.icsHelper, \r
- FALSE, INVALID }, // for XB\r
- { "icshelper", ArgFilename, (LPVOID) &appData.icsHelper, FALSE, (ArgIniType) "" },\r
- { "gateway", ArgString, (LPVOID) &appData.gateway, FALSE, (ArgIniType) "" },\r
- { "loadGameFile", ArgFilename, (LPVOID) &appData.loadGameFile, FALSE, (ArgIniType) "" },\r
- { "lgf", ArgFilename, (LPVOID) &appData.loadGameFile, FALSE, INVALID },\r
- { "loadGameIndex", ArgInt, (LPVOID) &appData.loadGameIndex, FALSE, (ArgIniType) 0 },\r
- { "lgi", ArgInt, (LPVOID) &appData.loadGameIndex, FALSE, INVALID },\r
- { "saveGameFile", ArgFilename, (LPVOID) &appData.saveGameFile, TRUE, (ArgIniType) "" },\r
- { "sgf", ArgFilename, (LPVOID) &appData.saveGameFile, FALSE, INVALID },\r
- { "autoSaveGames", ArgBoolean, (LPVOID) &appData.autoSaveGames, TRUE, (ArgIniType) FALSE },\r
- { "autosave", ArgTrue, (LPVOID) &appData.autoSaveGames, FALSE, INVALID },\r
- { "xautosave", ArgFalse, (LPVOID) &appData.autoSaveGames, FALSE, INVALID },\r
- { "-autosave", ArgFalse, (LPVOID) &appData.autoSaveGames, FALSE, INVALID },\r
- { "loadPositionFile", ArgFilename, (LPVOID) &appData.loadPositionFile, FALSE, (ArgIniType) "" },\r
- { "lpf", ArgFilename, (LPVOID) &appData.loadPositionFile, FALSE, INVALID },\r
- { "loadPositionIndex", ArgInt, (LPVOID) &appData.loadPositionIndex, FALSE, (ArgIniType) 1 },\r
- { "lpi", ArgInt, (LPVOID) &appData.loadPositionIndex, FALSE, INVALID },\r
- { "savePositionFile", ArgFilename, (LPVOID) &appData.savePositionFile, FALSE, (ArgIniType) "" },\r
- { "spf", ArgFilename, (LPVOID) &appData.savePositionFile, FALSE, INVALID },\r
- { "matchMode", ArgBoolean, (LPVOID) &appData.matchMode, FALSE, (ArgIniType) FALSE },\r
- { "mm", ArgTrue, (LPVOID) &appData.matchMode, FALSE, INVALID },\r
- { "xmm", ArgFalse, (LPVOID) &appData.matchMode, FALSE, INVALID },\r
- { "-mm", ArgFalse, (LPVOID) &appData.matchMode, FALSE, INVALID },\r
- { "matchGames", ArgInt, (LPVOID) &appData.matchGames, FALSE, (ArgIniType) 0 },\r
- { "mg", ArgInt, (LPVOID) &appData.matchGames, FALSE, INVALID },\r
- { "monoMode", ArgBoolean, (LPVOID) &appData.monoMode, TRUE, (ArgIniType) FALSE },\r
- { "mono", ArgTrue, (LPVOID) &appData.monoMode, FALSE, INVALID },\r
- { "xmono", ArgFalse, (LPVOID) &appData.monoMode, FALSE, INVALID },\r
- { "-mono", ArgFalse, (LPVOID) &appData.monoMode, FALSE, INVALID },\r
- { "debugMode", ArgBoolean, (LPVOID) &appData.debugMode, FALSE, (ArgIniType) FALSE },\r
- { "debug", ArgTrue, (LPVOID) &appData.debugMode, FALSE, INVALID },\r
- { "xdebug", ArgFalse, (LPVOID) &appData.debugMode, FALSE, INVALID },\r
- { "-debug", ArgFalse, (LPVOID) &appData.debugMode, FALSE, INVALID },\r
- { "clockMode", ArgBoolean, (LPVOID) &appData.clockMode, FALSE, (ArgIniType) TRUE },\r
- { "clock", ArgTrue, (LPVOID) &appData.clockMode, FALSE, INVALID },\r
- { "xclock", ArgFalse, (LPVOID) &appData.clockMode, FALSE, INVALID },\r
- { "-clock", ArgFalse, (LPVOID) &appData.clockMode, FALSE, INVALID },\r
- { "searchTime", ArgString, (LPVOID) &appData.searchTime, FALSE, (ArgIniType) "" },\r
- { "st", ArgString, (LPVOID) &appData.searchTime, FALSE, INVALID },\r
- { "searchDepth", ArgInt, (LPVOID) &appData.searchDepth, FALSE, (ArgIniType) 0 },\r
- { "depth", ArgInt, (LPVOID) &appData.searchDepth, FALSE, INVALID },\r
- { "showCoords", ArgBoolean, (LPVOID) &appData.showCoords, TRUE, (ArgIniType) FALSE },\r
- { "coords", ArgTrue, (LPVOID) &appData.showCoords, FALSE, INVALID },\r
- { "xcoords", ArgFalse, (LPVOID) &appData.showCoords, FALSE, INVALID },\r
- { "-coords", ArgFalse, (LPVOID) &appData.showCoords, FALSE, INVALID },\r
- { "showThinking", ArgBoolean, (LPVOID) &appData.showThinking, TRUE, (ArgIniType) FALSE },\r
- { "thinking", ArgTrue, (LPVOID) &appData.showThinking, FALSE, INVALID },\r
- { "xthinking", ArgFalse, (LPVOID) &appData.showThinking, FALSE, INVALID },\r
- { "-thinking", ArgFalse, (LPVOID) &appData.showThinking, FALSE, INVALID },\r
- { "ponderNextMove", ArgBoolean, (LPVOID) &appData.ponderNextMove, TRUE, (ArgIniType) TRUE },\r
- { "ponder", ArgTrue, (LPVOID) &appData.ponderNextMove, FALSE, INVALID },\r
- { "xponder", ArgFalse, (LPVOID) &appData.ponderNextMove, FALSE, INVALID },\r
- { "-ponder", ArgFalse, (LPVOID) &appData.ponderNextMove, FALSE, INVALID },\r
- { "periodicUpdates", ArgBoolean, (LPVOID) &appData.periodicUpdates, TRUE, (ArgIniType) TRUE },\r
- { "periodic", ArgTrue, (LPVOID) &appData.periodicUpdates, FALSE, INVALID },\r
- { "xperiodic", ArgFalse, (LPVOID) &appData.periodicUpdates, FALSE, INVALID },\r
- { "-periodic", ArgFalse, (LPVOID) &appData.periodicUpdates, FALSE, INVALID },\r
- { "popupExitMessage", ArgBoolean, (LPVOID) &appData.popupExitMessage, TRUE, (ArgIniType) TRUE },\r
- { "exit", ArgTrue, (LPVOID) &appData.popupExitMessage, FALSE, INVALID },\r
- { "xexit", ArgFalse, (LPVOID) &appData.popupExitMessage, FALSE, INVALID },\r
- { "-exit", ArgFalse, (LPVOID) &appData.popupExitMessage, FALSE, INVALID },\r
- { "popupMoveErrors", ArgBoolean, (LPVOID) &appData.popupMoveErrors, TRUE, (ArgIniType) FALSE },\r
- { "popup", ArgTrue, (LPVOID) &appData.popupMoveErrors, FALSE, INVALID },\r
- { "xpopup", ArgFalse, (LPVOID) &appData.popupMoveErrors, FALSE, INVALID },\r
- { "-popup", ArgFalse, (LPVOID) &appData.popupMoveErrors, FALSE, INVALID },\r
- { "popUpErrors", ArgBoolean, (LPVOID) &appData.popupMoveErrors, \r
- FALSE, INVALID }, /* only so that old WinBoard.ini files from betas can be read */\r
- { "clockFont", ArgFont, (LPVOID) CLOCK_FONT, TRUE, INVALID },\r
- { "messageFont", ArgFont, (LPVOID) MESSAGE_FONT, TRUE, INVALID },\r
- { "coordFont", ArgFont, (LPVOID) COORD_FONT, TRUE, INVALID },\r
- { "tagsFont", ArgFont, (LPVOID) EDITTAGS_FONT, TRUE, INVALID },\r
- { "commentFont", ArgFont, (LPVOID) COMMENT_FONT, TRUE, INVALID },\r
- { "icsFont", ArgFont, (LPVOID) CONSOLE_FONT, TRUE, INVALID },\r
- { "moveHistoryFont", ArgFont, (LPVOID) MOVEHISTORY_FONT, TRUE, INVALID }, /* [AS] */\r
- { "boardSize", ArgBoardSize, (LPVOID) &boardSize,\r
- TRUE, (ArgIniType) -1 }, /* must come after all fonts */\r
- { "size", ArgBoardSize, (LPVOID) &boardSize, FALSE, INVALID },\r
- { "ringBellAfterMoves", ArgBoolean, (LPVOID) &appData.ringBellAfterMoves,\r
- FALSE, (ArgIniType) TRUE }, /* historical; kept only so old winboard.ini files will parse */\r
- { "bell", ArgTrue, (LPVOID) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB\r
- { "xbell", ArgFalse, (LPVOID) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB\r
- { "movesound", ArgTrue, (LPVOID) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB\r
- { "xmovesound", ArgFalse, (LPVOID) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB\r
- { "alwaysOnTop", ArgBoolean, (LPVOID) &alwaysOnTop, TRUE, INVALID },\r
- { "top", ArgTrue, (LPVOID) &alwaysOnTop, FALSE, INVALID },\r
- { "xtop", ArgFalse, (LPVOID) &alwaysOnTop, FALSE, INVALID },\r
- { "-top", ArgFalse, (LPVOID) &alwaysOnTop, FALSE, INVALID },\r
- { "autoCallFlag", ArgBoolean, (LPVOID) &appData.autoCallFlag, TRUE, (ArgIniType) FALSE },\r
- { "autoflag", ArgTrue, (LPVOID) &appData.autoCallFlag, FALSE, INVALID },\r
- { "xautoflag", ArgFalse, (LPVOID) &appData.autoCallFlag, FALSE, INVALID },\r
- { "-autoflag", ArgFalse, (LPVOID) &appData.autoCallFlag, FALSE, INVALID },\r
- { "autoComment", ArgBoolean, (LPVOID) &appData.autoComment, TRUE, (ArgIniType) FALSE },\r
- { "autocomm", ArgTrue, (LPVOID) &appData.autoComment, FALSE, INVALID },\r
- { "xautocomm", ArgFalse, (LPVOID) &appData.autoComment, FALSE, INVALID },\r
- { "-autocomm", ArgFalse, (LPVOID) &appData.autoComment, FALSE, INVALID },\r
- { "autoObserve", ArgBoolean, (LPVOID) &appData.autoObserve, TRUE, (ArgIniType) FALSE },\r
- { "autobs", ArgTrue, (LPVOID) &appData.autoObserve, FALSE, INVALID },\r
- { "xautobs", ArgFalse, (LPVOID) &appData.autoObserve, FALSE, INVALID },\r
- { "-autobs", ArgFalse, (LPVOID) &appData.autoObserve, FALSE, INVALID },\r
- { "flipView", ArgBoolean, (LPVOID) &appData.flipView, FALSE, (ArgIniType) FALSE },\r
- { "flip", ArgTrue, (LPVOID) &appData.flipView, FALSE, INVALID },\r
- { "xflip", ArgFalse, (LPVOID) &appData.flipView, FALSE, INVALID },\r
- { "-flip", ArgFalse, (LPVOID) &appData.flipView, FALSE, INVALID },\r
- { "autoFlipView", ArgBoolean, (LPVOID) &appData.autoFlipView, TRUE, (ArgIniType) TRUE },\r
- { "autoflip", ArgTrue, (LPVOID) &appData.autoFlipView, FALSE, INVALID },\r
- { "xautoflip", ArgFalse, (LPVOID) &appData.autoFlipView, FALSE, INVALID },\r
- { "-autoflip", ArgFalse, (LPVOID) &appData.autoFlipView, FALSE, INVALID },\r
- { "autoRaiseBoard", ArgBoolean, (LPVOID) &appData.autoRaiseBoard, TRUE, (ArgIniType) TRUE },\r
- { "autoraise", ArgTrue, (LPVOID) &appData.autoRaiseBoard, FALSE, INVALID },\r
- { "xautoraise", ArgFalse, (LPVOID) &appData.autoRaiseBoard, FALSE, INVALID },\r
- { "-autoraise", ArgFalse, (LPVOID) &appData.autoRaiseBoard, FALSE, INVALID },\r
- { "alwaysPromoteToQueen", ArgBoolean, (LPVOID) &appData.alwaysPromoteToQueen, TRUE, (ArgIniType) FALSE },\r
- { "queen", ArgTrue, (LPVOID) &appData.alwaysPromoteToQueen, FALSE, INVALID },\r
- { "xqueen", ArgFalse, (LPVOID) &appData.alwaysPromoteToQueen, FALSE, INVALID },\r
- { "-queen", ArgFalse, (LPVOID) &appData.alwaysPromoteToQueen, FALSE, INVALID },\r
- { "oldSaveStyle", ArgBoolean, (LPVOID) &appData.oldSaveStyle, TRUE, (ArgIniType) FALSE },\r
- { "oldsave", ArgTrue, (LPVOID) &appData.oldSaveStyle, FALSE, INVALID },\r
- { "xoldsave", ArgFalse, (LPVOID) &appData.oldSaveStyle, FALSE, INVALID },\r
- { "-oldsave", ArgFalse, (LPVOID) &appData.oldSaveStyle, FALSE, INVALID },\r
- { "quietPlay", ArgBoolean, (LPVOID) &appData.quietPlay, TRUE, (ArgIniType) FALSE },\r
- { "quiet", ArgTrue, (LPVOID) &appData.quietPlay, FALSE, INVALID },\r
- { "xquiet", ArgFalse, (LPVOID) &appData.quietPlay, FALSE, INVALID },\r
- { "-quiet", ArgFalse, (LPVOID) &appData.quietPlay, FALSE, INVALID },\r
- { "getMoveList", ArgBoolean, (LPVOID) &appData.getMoveList, TRUE, (ArgIniType) TRUE },\r
- { "moves", ArgTrue, (LPVOID) &appData.getMoveList, FALSE, INVALID },\r
- { "xmoves", ArgFalse, (LPVOID) &appData.getMoveList, FALSE, INVALID },\r
- { "-moves", ArgFalse, (LPVOID) &appData.getMoveList, FALSE, INVALID },\r
- { "testLegality", ArgBoolean, (LPVOID) &appData.testLegality, TRUE, (ArgIniType) TRUE },\r
- { "legal", ArgTrue, (LPVOID) &appData.testLegality, FALSE, INVALID },\r
- { "xlegal", ArgFalse, (LPVOID) &appData.testLegality, FALSE, INVALID },\r
- { "-legal", ArgFalse, (LPVOID) &appData.testLegality, FALSE, INVALID },\r
- { "premove", ArgBoolean, (LPVOID) &appData.premove, TRUE, (ArgIniType) TRUE },\r
- { "pre", ArgTrue, (LPVOID) &appData.premove, FALSE, INVALID },\r
- { "xpre", ArgFalse, (LPVOID) &appData.premove, FALSE, INVALID },\r
- { "-pre", ArgFalse, (LPVOID) &appData.premove, FALSE, INVALID },\r
- { "premoveWhite", ArgBoolean, (LPVOID) &appData.premoveWhite, TRUE, (ArgIniType) FALSE },\r
- { "prewhite", ArgTrue, (LPVOID) &appData.premoveWhite, FALSE, INVALID },\r
- { "xprewhite", ArgFalse, (LPVOID) &appData.premoveWhite, FALSE, INVALID },\r
- { "-prewhite", ArgFalse, (LPVOID) &appData.premoveWhite, FALSE, INVALID },\r
- { "premoveWhiteText", ArgString, (LPVOID) &appData.premoveWhiteText, TRUE, (ArgIniType) "" },\r
- { "premoveBlack", ArgBoolean, (LPVOID) &appData.premoveBlack, TRUE, (ArgIniType) FALSE },\r
- { "preblack", ArgTrue, (LPVOID) &appData.premoveBlack, FALSE, INVALID },\r
- { "xpreblack", ArgFalse, (LPVOID) &appData.premoveBlack, FALSE, INVALID },\r
- { "-preblack", ArgFalse, (LPVOID) &appData.premoveBlack, FALSE, INVALID },\r
- { "premoveBlackText", ArgString, (LPVOID) &appData.premoveBlackText, TRUE, (ArgIniType) "" },\r
- { "icsAlarm", ArgBoolean, (LPVOID) &appData.icsAlarm, TRUE, (ArgIniType) TRUE},\r
- { "alarm", ArgTrue, (LPVOID) &appData.icsAlarm, FALSE},\r
- { "xalarm", ArgFalse, (LPVOID) &appData.icsAlarm, FALSE},\r
- { "-alarm", ArgFalse, (LPVOID) &appData.icsAlarm, FALSE},\r
- { "icsAlarmTime", ArgInt, (LPVOID) &appData.icsAlarmTime, TRUE, (ArgIniType) 5000},\r
- { "localLineEditing", ArgBoolean, (LPVOID) &appData.localLineEditing, FALSE, (ArgIniType) TRUE},\r
- { "edit", ArgTrue, (LPVOID) &appData.localLineEditing, FALSE, INVALID },\r
- { "xedit", ArgFalse, (LPVOID) &appData.localLineEditing, FALSE, INVALID },\r
- { "-edit", ArgFalse, (LPVOID) &appData.localLineEditing, FALSE, INVALID },\r
- { "animateMoving", ArgBoolean, (LPVOID) &appData.animate, TRUE, (ArgIniType) TRUE },\r
- { "animate", ArgTrue, (LPVOID) &appData.animate, FALSE, INVALID },\r
- { "xanimate", ArgFalse, (LPVOID) &appData.animate, FALSE, INVALID },\r
- { "-animate", ArgFalse, (LPVOID) &appData.animate, FALSE, INVALID },\r
- { "animateSpeed", ArgInt, (LPVOID) &appData.animSpeed, TRUE, (ArgIniType) 10 },\r
- { "animateDragging", ArgBoolean, (LPVOID) &appData.animateDragging, TRUE, (ArgIniType) TRUE },\r
- { "drag", ArgTrue, (LPVOID) &appData.animateDragging, FALSE, INVALID },\r
- { "xdrag", ArgFalse, (LPVOID) &appData.animateDragging, FALSE, INVALID },\r
- { "-drag", ArgFalse, (LPVOID) &appData.animateDragging, FALSE, INVALID },\r
- { "blindfold", ArgBoolean, (LPVOID) &appData.blindfold, TRUE, (ArgIniType) FALSE },\r
- { "blind", ArgTrue, (LPVOID) &appData.blindfold, FALSE, INVALID },\r
- { "xblind", ArgFalse, (LPVOID) &appData.blindfold, FALSE, INVALID },\r
- { "-blind", ArgFalse, (LPVOID) &appData.blindfold, FALSE, INVALID },\r
- { "highlightLastMove", ArgBoolean,\r
- (LPVOID) &appData.highlightLastMove, TRUE, (ArgIniType) TRUE },\r
- { "highlight", ArgTrue, (LPVOID) &appData.highlightLastMove, FALSE, INVALID },\r
- { "xhighlight", ArgFalse, (LPVOID) &appData.highlightLastMove, FALSE, INVALID },\r
- { "-highlight", ArgFalse, (LPVOID) &appData.highlightLastMove, FALSE, INVALID },\r
- { "highlightDragging", ArgBoolean,\r
- (LPVOID) &appData.highlightDragging, TRUE, INVALID },\r
- { "highdrag", ArgTrue, (LPVOID) &appData.highlightDragging, FALSE, INVALID },\r
- { "xhighdrag", ArgFalse, (LPVOID) &appData.highlightDragging, FALSE, INVALID },\r
- { "-highdrag", ArgFalse, (LPVOID) &appData.highlightDragging, FALSE, INVALID },\r
- { "colorizeMessages", ArgBoolean, (LPVOID) &appData.colorize, TRUE, (ArgIniType) TRUE },\r
- { "colorize", ArgTrue, (LPVOID) &appData.colorize, FALSE, INVALID },\r
- { "xcolorize", ArgFalse, (LPVOID) &appData.colorize, FALSE, INVALID },\r
- { "-colorize", ArgFalse, (LPVOID) &appData.colorize, FALSE, INVALID },\r
- { "colorShout", ArgAttribs, (LPVOID) ColorShout, TRUE, INVALID },\r
- { "colorSShout", ArgAttribs, (LPVOID) ColorSShout, TRUE, INVALID },\r
- { "colorChannel1", ArgAttribs, (LPVOID) ColorChannel1, TRUE, INVALID },\r
- { "colorChannel", ArgAttribs, (LPVOID) ColorChannel, TRUE, INVALID },\r
- { "colorKibitz", ArgAttribs, (LPVOID) ColorKibitz, TRUE, INVALID },\r
- { "colorTell", ArgAttribs, (LPVOID) ColorTell, TRUE, INVALID },\r
- { "colorChallenge", ArgAttribs, (LPVOID) ColorChallenge, TRUE, INVALID },\r
- { "colorRequest", ArgAttribs, (LPVOID) ColorRequest, TRUE, INVALID },\r
- { "colorSeek", ArgAttribs, (LPVOID) ColorSeek, TRUE, INVALID },\r
- { "colorNormal", ArgAttribs, (LPVOID) ColorNormal, TRUE, INVALID },\r
- { "colorBackground", ArgColor, (LPVOID) &consoleBackgroundColor, TRUE, INVALID },\r
- { "soundShout", ArgFilename, (LPVOID) &appData.soundShout, TRUE, (ArgIniType) "" },\r
- { "soundSShout", ArgFilename, (LPVOID) &appData.soundSShout, TRUE, (ArgIniType) "" },\r
- { "soundCShout", ArgFilename, (LPVOID) &appData.soundSShout, TRUE, (ArgIniType) "" }, // for XB\r
- { "soundChannel1", ArgFilename, (LPVOID) &appData.soundChannel1, TRUE, (ArgIniType) "" },\r
- { "soundChannel", ArgFilename, (LPVOID) &appData.soundChannel, TRUE, (ArgIniType) "" },\r
- { "soundKibitz", ArgFilename, (LPVOID) &appData.soundKibitz, TRUE, (ArgIniType) "" },\r
- { "soundTell", ArgFilename, (LPVOID) &appData.soundTell, TRUE, (ArgIniType) "" },\r
- { "soundChallenge", ArgFilename, (LPVOID) &appData.soundChallenge, TRUE, (ArgIniType) "" },\r
- { "soundRequest", ArgFilename, (LPVOID) &appData.soundRequest, TRUE, (ArgIniType) "" },\r
- { "soundSeek", ArgFilename, (LPVOID) &appData.soundSeek, TRUE, (ArgIniType) "" },\r
- { "soundMove", ArgFilename, (LPVOID) &appData.soundMove, TRUE, (ArgIniType) "" },\r
- { "soundBell", ArgFilename, (LPVOID) &appData.soundBell, TRUE, (ArgIniType) SOUND_BELL },\r
- { "soundIcsWin", ArgFilename, (LPVOID) &appData.soundIcsWin, TRUE, (ArgIniType) "" },\r
- { "soundIcsLoss", ArgFilename, (LPVOID) &appData.soundIcsLoss, TRUE, (ArgIniType) "" },\r
- { "soundIcsDraw", ArgFilename, (LPVOID) &appData.soundIcsDraw, TRUE, (ArgIniType) "" },\r
- { "soundIcsUnfinished", ArgFilename, (LPVOID) &appData.soundIcsUnfinished, TRUE, (ArgIniType) "" },\r
- { "soundIcsAlarm", ArgFilename, (LPVOID) &appData.soundIcsAlarm, TRUE, (ArgIniType) "" },\r
- { "reuseFirst", ArgBoolean, (LPVOID) &appData.reuseFirst, FALSE, (ArgIniType) TRUE },\r
- { "reuse", ArgTrue, (LPVOID) &appData.reuseFirst, FALSE, INVALID },\r
- { "xreuse", ArgFalse, (LPVOID) &appData.reuseFirst, FALSE, INVALID },\r
- { "-reuse", ArgFalse, (LPVOID) &appData.reuseFirst, FALSE, INVALID },\r
- { "reuseChessPrograms", ArgBoolean,\r
- (LPVOID) &appData.reuseFirst, FALSE, INVALID }, /* backward compat only */\r
- { "reuseSecond", ArgBoolean, (LPVOID) &appData.reuseSecond, FALSE, (ArgIniType) TRUE },\r
- { "reuse2", ArgTrue, (LPVOID) &appData.reuseSecond, FALSE, INVALID },\r
- { "xreuse2", ArgFalse, (LPVOID) &appData.reuseSecond, FALSE, INVALID },\r
- { "-reuse2", ArgFalse, (LPVOID) &appData.reuseSecond, FALSE, INVALID },\r
- { "comPortSettings", ArgCommSettings, (LPVOID) &dcb, TRUE, INVALID },\r
- { "settingsFile", ArgSettingsFilename, (LPVOID) &settingsFileName, FALSE, (ArgIniType) SETTINGS_FILE },\r
- { "ini", ArgSettingsFilename, (LPVOID) &settingsFileName, FALSE, INVALID },\r
- { "saveSettingsOnExit", ArgBoolean, (LPVOID) &saveSettingsOnExit, TRUE, (ArgIniType) TRUE },\r
- { "chessProgram", ArgBoolean, (LPVOID) &chessProgram, FALSE, (ArgIniType) FALSE },\r
- { "cp", ArgTrue, (LPVOID) &chessProgram, FALSE, INVALID },\r
- { "xcp", ArgFalse, (LPVOID) &chessProgram, FALSE, INVALID },\r
- { "-cp", ArgFalse, (LPVOID) &chessProgram, FALSE, INVALID },\r
- { "icsMenu", ArgString, (LPVOID) &icsTextMenuString, TRUE, (ArgIniType) ICS_TEXT_MENU_DEFAULT },\r
- { "icsNames", ArgString, (LPVOID) &icsNames, TRUE, (ArgIniType) ICS_NAMES },\r
- { "firstChessProgramNames", ArgString, (LPVOID) &firstChessProgramNames,\r
- TRUE, (ArgIniType) FCP_NAMES },\r
- { "secondChessProgramNames", ArgString, (LPVOID) &secondChessProgramNames,\r
- TRUE, (ArgIniType) SCP_NAMES },\r
- { "initialMode", ArgString, (LPVOID) &appData.initialMode, FALSE, (ArgIniType) "" },\r
- { "mode", ArgString, (LPVOID) &appData.initialMode, FALSE, INVALID },\r
- { "variant", ArgString, (LPVOID) &appData.variant, FALSE, (ArgIniType) "normal" },\r
- { "firstProtocolVersion", ArgInt, (LPVOID) &appData.firstProtocolVersion, FALSE, (ArgIniType) PROTOVER },\r
- { "secondProtocolVersion", ArgInt, (LPVOID) &appData.secondProtocolVersion,FALSE, (ArgIniType) PROTOVER },\r
- { "showButtonBar", ArgBoolean, (LPVOID) &appData.showButtonBar, TRUE, (ArgIniType) TRUE },\r
- { "buttons", ArgTrue, (LPVOID) &appData.showButtonBar, FALSE, INVALID },\r
- { "xbuttons", ArgFalse, (LPVOID) &appData.showButtonBar, FALSE, INVALID },\r
- { "-buttons", ArgFalse, (LPVOID) &appData.showButtonBar, FALSE, INVALID },\r
-\r
- /* [AS] New features */\r
- { "firstScoreAbs", ArgBoolean, (LPVOID) &appData.firstScoreIsAbsolute, FALSE, (ArgIniType) FALSE },\r
- { "secondScoreAbs", ArgBoolean, (LPVOID) &appData.secondScoreIsAbsolute, FALSE, (ArgIniType) FALSE },\r
- { "pgnExtendedInfo", ArgBoolean, (LPVOID) &appData.saveExtendedInfoInPGN, TRUE, (ArgIniType) FALSE },\r
- { "hideThinkingFromHuman", ArgBoolean, (LPVOID) &appData.hideThinkingFromHuman, TRUE, (ArgIniType) FALSE },\r
- { "liteBackTextureFile", ArgString, (LPVOID) &appData.liteBackTextureFile, TRUE, (ArgIniType) "" },\r
- { "darkBackTextureFile", ArgString, (LPVOID) &appData.darkBackTextureFile, TRUE, (ArgIniType) "" },\r
- { "liteBackTextureMode", ArgInt, (LPVOID) &appData.liteBackTextureMode, TRUE, (ArgIniType) BACK_TEXTURE_MODE_PLAIN },\r
- { "darkBackTextureMode", ArgInt, (LPVOID) &appData.darkBackTextureMode, TRUE, (ArgIniType) BACK_TEXTURE_MODE_PLAIN },\r
- { "renderPiecesWithFont", ArgString, (LPVOID) &appData.renderPiecesWithFont, TRUE, (ArgIniType) "" },\r
- { "fontPieceToCharTable", ArgString, (LPVOID) &appData.fontToPieceTable, TRUE, (ArgIniType) "" },\r
- { "fontPieceBackColorWhite", ArgColor, (LPVOID) &appData.fontBackColorWhite, TRUE, (ArgIniType) 0 },\r
- { "fontPieceForeColorWhite", ArgColor, (LPVOID) &appData.fontForeColorWhite, TRUE, (ArgIniType) 0 },\r
- { "fontPieceBackColorBlack", ArgColor, (LPVOID) &appData.fontBackColorBlack, TRUE, (ArgIniType) 0 },\r
- { "fontPieceForeColorBlack", ArgColor, (LPVOID) &appData.fontForeColorBlack, TRUE, (ArgIniType) 0 },\r
- { "fontPieceSize", ArgInt, (LPVOID) &appData.fontPieceSize, TRUE, (ArgIniType) 80 },\r
- { "overrideLineGap", ArgInt, (LPVOID) &appData.overrideLineGap, TRUE, (ArgIniType) 1 },\r
- { "adjudicateLossThreshold", ArgInt, (LPVOID) &appData.adjudicateLossThreshold, TRUE, (ArgIniType) 0 },\r
- { "delayBeforeQuit", ArgInt, (LPVOID) &appData.delayBeforeQuit, TRUE, (ArgIniType) 0 },\r
- { "delayAfterQuit", ArgInt, (LPVOID) &appData.delayAfterQuit, TRUE, (ArgIniType) 0 },\r
- { "nameOfDebugFile", ArgFilename, (LPVOID) &appData.nameOfDebugFile, FALSE, (ArgIniType) "winboard.debug" },\r
- { "debugfile", ArgFilename, (LPVOID) &appData.nameOfDebugFile, FALSE, INVALID },\r
- { "pgnEventHeader", ArgString, (LPVOID) &appData.pgnEventHeader, TRUE, (ArgIniType) "Computer Chess Game" },\r
- { "defaultFrcPosition", ArgInt, (LPVOID) &appData.defaultFrcPosition, TRUE, (ArgIniType) -1 },\r
- { "gameListTags", ArgString, (LPVOID) &appData.gameListTags, TRUE, (ArgIniType) GLT_DEFAULT_TAGS },\r
- { "saveOutOfBookInfo", ArgBoolean, (LPVOID) &appData.saveOutOfBookInfo, TRUE, (ArgIniType) TRUE },\r
- { "showEvalInMoveHistory", ArgBoolean, (LPVOID) &appData.showEvalInMoveHistory, TRUE, (ArgIniType) TRUE },\r
- { "evalHistColorWhite", ArgColor, (LPVOID) &appData.evalHistColorWhite, TRUE, INVALID },\r
- { "evalHistColorBlack", ArgColor, (LPVOID) &appData.evalHistColorBlack, TRUE, INVALID },\r
- { "highlightMoveWithArrow", ArgBoolean, (LPVOID) &appData.highlightMoveWithArrow, TRUE, (ArgIniType) FALSE },\r
- { "highlightArrowColor", ArgColor, (LPVOID) &appData.highlightArrowColor, TRUE, INVALID },\r
- { "stickyWindows", ArgBoolean, (LPVOID) &appData.useStickyWindows, TRUE, (ArgIniType) TRUE },\r
- { "adjudicateDrawMoves", ArgInt, (LPVOID) &appData.adjudicateDrawMoves, TRUE, (ArgIniType) TRUE },\r
- { "autoDisplayComment", ArgBoolean, (LPVOID) &appData.autoDisplayComment, TRUE, (ArgIniType) TRUE },\r
- { "autoDisplayTags", ArgBoolean, (LPVOID) &appData.autoDisplayTags, TRUE, (ArgIniType) TRUE },\r
- { "firstIsUCI", ArgBoolean, (LPVOID) &appData.firstIsUCI, FALSE, (ArgIniType) FALSE },\r
- { "fUCI", ArgTrue, (LPVOID) &appData.firstIsUCI, FALSE, INVALID },\r
- { "secondIsUCI", ArgBoolean, (LPVOID) &appData.secondIsUCI, FALSE, (ArgIniType) FALSE },\r
- { "sUCI", ArgTrue, (LPVOID) &appData.secondIsUCI, FALSE, INVALID },\r
- { "firstHasOwnBookUCI", ArgBoolean, (LPVOID) &appData.firstHasOwnBookUCI, FALSE, (ArgIniType) TRUE },\r
- { "fNoOwnBookUCI", ArgFalse, (LPVOID) &appData.firstHasOwnBookUCI, FALSE, INVALID },\r
- { "firstXBook", ArgFalse, (LPVOID) &appData.firstHasOwnBookUCI, FALSE, INVALID },\r
- { "secondHasOwnBookUCI", ArgBoolean, (LPVOID) &appData.secondHasOwnBookUCI, FALSE, (ArgIniType) TRUE },\r
- { "sNoOwnBookUCI", ArgFalse, (LPVOID) &appData.secondHasOwnBookUCI, FALSE, INVALID },\r
- { "secondXBook", ArgFalse, (LPVOID) &appData.secondHasOwnBookUCI, FALSE, INVALID },\r
- { "polyglotDir", ArgFilename, (LPVOID) &appData.polyglotDir, TRUE, (ArgIniType) "" },\r
- { "usePolyglotBook", ArgBoolean, (LPVOID) &appData.usePolyglotBook, TRUE, (ArgIniType) FALSE },\r
- { "polyglotBook", ArgFilename, (LPVOID) &appData.polyglotBook, TRUE, (ArgIniType) "" },\r
- { "defaultHashSize", ArgInt, (LPVOID) &appData.defaultHashSize, TRUE, (ArgIniType) 64 }, \r
- { "defaultCacheSizeEGTB", ArgInt, (LPVOID) &appData.defaultCacheSizeEGTB, TRUE, (ArgIniType) 4 },\r
- { "defaultPathEGTB", ArgFilename, (LPVOID) &appData.defaultPathEGTB, TRUE, (ArgIniType) "c:\\egtb" },\r
-\r
- /* [HGM] board-size, adjudication and misc. options */\r
- { "boardWidth", ArgInt, (LPVOID) &appData.NrFiles, TRUE, (ArgIniType) -1 },\r
- { "boardHeight", ArgInt, (LPVOID) &appData.NrRanks, TRUE, (ArgIniType) -1 },\r
- { "holdingsSize", ArgInt, (LPVOID) &appData.holdingsSize, TRUE, (ArgIniType) -1 },\r
- { "matchPause", ArgInt, (LPVOID) &appData.matchPause, TRUE, (ArgIniType) 10000 },\r
- { "pieceToCharTable", ArgString, (LPVOID) &appData.pieceToCharTable, FALSE, INVALID },\r
- { "flipBlack", ArgBoolean, (LPVOID) &appData.upsideDown, TRUE, (ArgIniType) FALSE },\r
- { "allWhite", ArgBoolean, (LPVOID) &appData.allWhite, TRUE, (ArgIniType) FALSE },\r
- { "alphaRank", ArgBoolean, (LPVOID) &appData.alphaRank, FALSE, (ArgIniType) FALSE },\r
- { "firstAlphaRank", ArgBoolean, (LPVOID) &first.alphaRank, FALSE, (ArgIniType) FALSE },\r
- { "secondAlphaRank", ArgBoolean, (LPVOID) &second.alphaRank, FALSE, (ArgIniType) FALSE },\r
- { "testClaims", ArgBoolean, (LPVOID) &appData.testClaims, TRUE, (ArgIniType) FALSE },\r
- { "checkMates", ArgBoolean, (LPVOID) &appData.checkMates, TRUE, (ArgIniType) FALSE },\r
- { "materialDraws", ArgBoolean, (LPVOID) &appData.materialDraws, TRUE, (ArgIniType) FALSE },\r
- { "trivialDraws", ArgBoolean, (LPVOID) &appData.trivialDraws, TRUE, (ArgIniType) FALSE },\r
- { "ruleMoves", ArgInt, (LPVOID) &appData.ruleMoves, TRUE, (ArgIniType) 51 },\r
- { "repeatsToDraw", ArgInt, (LPVOID) &appData.drawRepeats, TRUE, (ArgIniType) 6 },\r
- { "autoKibitz", ArgTrue, (LPVOID) &appData.autoKibitz, FALSE, INVALID },\r
- { "engineDebugOutput", ArgInt, (LPVOID) &appData.engineComments, FALSE, (ArgIniType) 1 },\r
- { "userName", ArgString, (LPVOID) &appData.userName, FALSE, INVALID },\r
- { "rewindIndex", ArgInt, (LPVOID) &appData.rewindIndex, FALSE, INVALID },\r
- { "sameColorGames", ArgInt, (LPVOID) &appData.sameColorGames, FALSE, INVALID },\r
- { "smpCores", ArgInt, (LPVOID) &appData.smpCores, TRUE, (ArgIniType) 1 },\r
- { "egtFormats", ArgString, (LPVOID) &appData.egtFormats, TRUE, (ArgIniType) "" },\r
- { "niceEngines", ArgInt, (LPVOID) &appData.niceEngines, TRUE, INVALID },\r
- { "firstLogo", ArgFilename, (LPVOID) &appData.firstLogo, FALSE, INVALID },\r
- { "secondLogo", ArgFilename, (LPVOID) &appData.secondLogo, FALSE, INVALID },\r
- { "autoLogo", ArgBoolean, (LPVOID) &appData.autoLogo, TRUE, INVALID },\r
- { "firstOptions", ArgString, (LPVOID) &appData.firstOptions, FALSE, (ArgIniType) "" },\r
- { "secondOptions", ArgString, (LPVOID) &appData.secondOptions, FALSE, (ArgIniType) "" },\r
- { "firstNeedsNoncompliantFEN", ArgString, (LPVOID) &appData.fenOverride1, FALSE, (ArgIniType) "" },\r
- { "secondNeedsNoncompliantFEN", ArgString, (LPVOID) &appData.fenOverride2, FALSE, (ArgIniType) "" },\r
- { "keepAlive", ArgInt, (LPVOID) &appData.keepAlive, FALSE, INVALID },\r
- { "icstype", ArgInt, (LPVOID) &ics_type, FALSE, INVALID },\r
- { "forceIllegalMoves", ArgTrue, (LPVOID) &appData.forceIllegal, FALSE, INVALID },\r
-\r
-#ifdef ZIPPY\r
- { "zippyTalk", ArgBoolean, (LPVOID) &appData.zippyTalk, FALSE, (ArgIniType) ZIPPY_TALK },\r
- { "zt", ArgTrue, (LPVOID) &appData.zippyTalk, FALSE, INVALID },\r
- { "xzt", ArgFalse, (LPVOID) &appData.zippyTalk, FALSE, INVALID },\r
- { "-zt", ArgFalse, (LPVOID) &appData.zippyTalk, FALSE, INVALID },\r
- { "zippyPlay", ArgBoolean, (LPVOID) &appData.zippyPlay, FALSE, (ArgIniType) ZIPPY_PLAY },\r
- { "zp", ArgTrue, (LPVOID) &appData.zippyPlay, FALSE, INVALID },\r
- { "xzp", ArgFalse, (LPVOID) &appData.zippyPlay, FALSE, INVALID },\r
- { "-zp", ArgFalse, (LPVOID) &appData.zippyPlay, FALSE, INVALID },\r
- { "zippyLines", ArgFilename, (LPVOID) &appData.zippyLines, FALSE, (ArgIniType) ZIPPY_LINES },\r
- { "zippyPinhead", ArgString, (LPVOID) &appData.zippyPinhead, FALSE, (ArgIniType) ZIPPY_PINHEAD },\r
- { "zippyPassword", ArgString, (LPVOID) &appData.zippyPassword, FALSE, (ArgIniType) ZIPPY_PASSWORD },\r
- { "zippyPassword2", ArgString, (LPVOID) &appData.zippyPassword2, FALSE, (ArgIniType) ZIPPY_PASSWORD2 },\r
- { "zippyWrongPassword", ArgString, (LPVOID) &appData.zippyWrongPassword,\r
- FALSE, (ArgIniType) ZIPPY_WRONG_PASSWORD },\r
- { "zippyAcceptOnly", ArgString, (LPVOID) &appData.zippyAcceptOnly, FALSE, (ArgIniType) ZIPPY_ACCEPT_ONLY },\r
- { "zippyUseI", ArgBoolean, (LPVOID) &appData.zippyUseI, FALSE, (ArgIniType) ZIPPY_USE_I },\r
- { "zui", ArgTrue, (LPVOID) &appData.zippyUseI, FALSE, INVALID },\r
- { "xzui", ArgFalse, (LPVOID) &appData.zippyUseI, FALSE, INVALID },\r
- { "-zui", ArgFalse, (LPVOID) &appData.zippyUseI, FALSE, INVALID },\r
- { "zippyBughouse", ArgInt, (LPVOID) &appData.zippyBughouse, FALSE, (ArgIniType) ZIPPY_BUGHOUSE },\r
- { "zippyNoplayCrafty", ArgBoolean, (LPVOID) &appData.zippyNoplayCrafty,\r
- FALSE, (ArgIniType) ZIPPY_NOPLAY_CRAFTY },\r
- { "znc", ArgTrue, (LPVOID) &appData.zippyNoplayCrafty, FALSE, INVALID },\r
- { "xznc", ArgFalse, (LPVOID) &appData.zippyNoplayCrafty, FALSE, INVALID },\r
- { "-znc", ArgFalse, (LPVOID) &appData.zippyNoplayCrafty, FALSE, INVALID },\r
- { "zippyGameEnd", ArgString, (LPVOID) &appData.zippyGameEnd, FALSE, (ArgIniType) ZIPPY_GAME_END },\r
- { "zippyGameStart", ArgString, (LPVOID) &appData.zippyGameStart, FALSE, (ArgIniType) ZIPPY_GAME_START },\r
- { "zippyAdjourn", ArgBoolean, (LPVOID) &appData.zippyAdjourn, FALSE, (ArgIniType) ZIPPY_ADJOURN },\r
- { "zadj", ArgTrue, (LPVOID) &appData.zippyAdjourn, FALSE, INVALID },\r
- { "xzadj", ArgFalse, (LPVOID) &appData.zippyAdjourn, FALSE, INVALID },\r
- { "-zadj", ArgFalse, (LPVOID) &appData.zippyAdjourn, FALSE, INVALID },\r
- { "zippyAbort", ArgBoolean, (LPVOID) &appData.zippyAbort, FALSE, (ArgIniType) ZIPPY_ABORT },\r
- { "zab", ArgTrue, (LPVOID) &appData.zippyAbort, FALSE, INVALID },\r
- { "xzab", ArgFalse, (LPVOID) &appData.zippyAbort, FALSE, INVALID },\r
- { "-zab", ArgFalse, (LPVOID) &appData.zippyAbort, FALSE, INVALID },\r
- { "zippyVariants", ArgString, (LPVOID) &appData.zippyVariants, FALSE, (ArgIniType) ZIPPY_VARIANTS },\r
- { "zippyMaxGames", ArgInt, (LPVOID)&appData.zippyMaxGames, FALSE, (ArgIniType) ZIPPY_MAX_GAMES},\r
- { "zippyReplayTimeout", ArgInt, (LPVOID)&appData.zippyReplayTimeout, FALSE, (ArgIniType) ZIPPY_REPLAY_TIMEOUT },\r
- { "zippyShortGame", ArgInt, (LPVOID)&appData.zippyShortGame, FALSE, INVALID },\r
- /* Kludge to allow winboard.ini files from buggy 4.0.4 to be read: */\r
- { "zippyReplyTimeout", ArgInt, (LPVOID)&junk, FALSE, INVALID },\r
-#endif\r
- /* [HGM] options for broadcasting and time odds */\r
- { "serverMoves", ArgString, (LPVOID) &appData.serverMovesName, FALSE, (ArgIniType) NULL },\r
- { "suppressLoadMoves", ArgBoolean, (LPVOID) &appData.suppressLoadMoves, FALSE, (ArgIniType) FALSE },\r
- { "serverPause", ArgInt, (LPVOID) &appData.serverPause, FALSE, (ArgIniType) 15 },\r
- { "firstTimeOdds", ArgInt, (LPVOID) &appData.firstTimeOdds, FALSE, (ArgIniType) 1 },\r
- { "secondTimeOdds", ArgInt, (LPVOID) &appData.secondTimeOdds, FALSE, (ArgIniType) 1 },\r
- { "timeOddsMode", ArgInt, (LPVOID) &appData.timeOddsMode, TRUE, INVALID },\r
- { "firstAccumulateTC", ArgInt, (LPVOID) &appData.firstAccumulateTC, FALSE, (ArgIniType) 1 },\r
- { "secondAccumulateTC", ArgInt, (LPVOID) &appData.secondAccumulateTC, FALSE, (ArgIniType) 1 },\r
- { "firstNPS", ArgInt, (LPVOID) &appData.firstNPS, FALSE, (ArgIniType) -1 },\r
- { "secondNPS", ArgInt, (LPVOID) &appData.secondNPS, FALSE, (ArgIniType) -1 },\r
- { "noGUI", ArgTrue, (LPVOID) &appData.noGUI, FALSE, INVALID },\r
- { "keepLineBreaksICS", ArgBoolean, (LPVOID) &appData.noJoin, TRUE, INVALID },\r
- { "wrapContinuationSequence", ArgString, (LPVOID) &appData.wrapContSeq, FALSE, INVALID },\r
- { "useInternalWrap", ArgTrue, (LPVOID) &appData.useInternalWrap, FALSE, INVALID }, /* noJoin usurps this if set */\r
- \r
- // [HGM] placement: put all window layouts last in ini file, but man X,Y before all others\r
- { "minX", ArgZ, (LPVOID) &minX, FALSE, INVALID }, // [HGM] placement: to make suer auxialary windows can be placed\r
- { "minY", ArgZ, (LPVOID) &minY, FALSE, INVALID },\r
- { "winWidth", ArgInt, (LPVOID) &wpMain.width, TRUE, INVALID }, // [HGM] placement: dummies to remember right & bottom\r
- { "winHeight", ArgInt, (LPVOID) &wpMain.height, TRUE, INVALID }, // for attaching auxiliary windows to them\r
- { "x", ArgInt, (LPVOID) &wpMain.x, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "y", ArgInt, (LPVOID) &wpMain.y, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "icsX", ArgX, (LPVOID) &wpConsole.x, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "icsY", ArgY, (LPVOID) &wpConsole.y, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "icsW", ArgInt, (LPVOID) &wpConsole.width, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "icsH", ArgInt, (LPVOID) &wpConsole.height, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "analysisX", ArgX, (LPVOID) &dummy, FALSE, INVALID }, // [HGM] placement: analysis window no longer exists\r
- { "analysisY", ArgY, (LPVOID) &dummy, FALSE, INVALID }, // provided for compatibility with old ini files\r
- { "analysisW", ArgInt, (LPVOID) &dummy, FALSE, INVALID },\r
- { "analysisH", ArgInt, (LPVOID) &dummy, FALSE, INVALID },\r
- { "commentX", ArgX, (LPVOID) &wpComment.x, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "commentY", ArgY, (LPVOID) &wpComment.y, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "commentW", ArgInt, (LPVOID) &wpComment.width, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "commentH", ArgInt, (LPVOID) &wpComment.height, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "tagsX", ArgX, (LPVOID) &wpTags.x, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "tagsY", ArgY, (LPVOID) &wpTags.y, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "tagsW", ArgInt, (LPVOID) &wpTags.width, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "tagsH", ArgInt, (LPVOID) &wpTags.height, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "gameListX", ArgX, (LPVOID) &wpGameList.x, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "gameListY", ArgY, (LPVOID) &wpGameList.y, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "gameListW", ArgInt, (LPVOID) &wpGameList.width, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "gameListH", ArgInt, (LPVOID) &wpGameList.height, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- /* [AS] Layout stuff */\r
- { "moveHistoryUp", ArgBoolean, (LPVOID) &wpMoveHistory.visible, TRUE, (ArgIniType) TRUE },\r
- { "moveHistoryX", ArgX, (LPVOID) &wpMoveHistory.x, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "moveHistoryY", ArgY, (LPVOID) &wpMoveHistory.y, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "moveHistoryW", ArgInt, (LPVOID) &wpMoveHistory.width, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "moveHistoryH", ArgInt, (LPVOID) &wpMoveHistory.height, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-\r
- { "evalGraphUp", ArgBoolean, (LPVOID) &wpEvalGraph.visible, TRUE, (ArgIniType) TRUE },\r
- { "evalGraphX", ArgX, (LPVOID) &wpEvalGraph.x, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "evalGraphY", ArgY, (LPVOID) &wpEvalGraph.y, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "evalGraphW", ArgInt, (LPVOID) &wpEvalGraph.width, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "evalGraphH", ArgInt, (LPVOID) &wpEvalGraph.height, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-\r
- { "engineOutputUp", ArgBoolean, (LPVOID) &wpEngineOutput.visible, TRUE, (ArgIniType) TRUE },\r
- { "engineOutputX", ArgX, (LPVOID) &wpEngineOutput.x, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "engineOutputY", ArgY, (LPVOID) &wpEngineOutput.y, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "engineOutputW", ArgInt, (LPVOID) &wpEngineOutput.width, TRUE, (ArgIniType) CW_USEDEFAULT },\r
- { "engineOutputH", ArgInt, (LPVOID) &wpEngineOutput.height, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-\r
- { NULL, ArgNone, NULL, FALSE, INVALID }\r
-};\r
-\r
-\r
-/* Kludge for indirection files on command line */\r
-char* lastIndirectionFilename;\r
-ArgDescriptor argDescriptorIndirection =\r
-{ "", ArgSettingsFilename, (LPVOID) NULL, FALSE };\r
+#include "args.h"\r
\r
+// front-end part of option handling\r
\r
VOID\r
-ExitArgError(char *msg, char *badArg)\r
+LFfromMFP(LOGFONT* lf, MyFontParams *mfp)\r
{\r
- char buf[MSG_SIZ];\r
+ HDC hdc = CreateDC("DISPLAY", NULL, NULL, NULL);\r
+ lf->lfHeight = -(int)(mfp->pointSize * GetDeviceCaps(hdc, LOGPIXELSY) / 72.0 + 0.5);\r
+ DeleteDC(hdc);\r
+ lf->lfWidth = 0;\r
+ lf->lfEscapement = 0;\r
+ lf->lfOrientation = 0;\r
+ lf->lfWeight = mfp->bold ? FW_BOLD : FW_NORMAL;\r
+ lf->lfItalic = mfp->italic;\r
+ lf->lfUnderline = mfp->underline;\r
+ lf->lfStrikeOut = mfp->strikeout;\r
+ lf->lfCharSet = mfp->charset;\r
+ lf->lfOutPrecision = OUT_DEFAULT_PRECIS;\r
+ lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;\r
+ lf->lfQuality = DEFAULT_QUALITY;\r
+ lf->lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE;\r
+ strcpy(lf->lfFaceName, mfp->faceName);\r
+}\r
\r
- sprintf(buf, "%s %s", msg, badArg);\r
- DisplayFatalError(buf, 0, 2);\r
- exit(2);\r
+void\r
+CreateFontInMF(MyFont *mf)\r
+{ \r
+ LFfromMFP(&mf->lf, &mf->mfp);\r
+ if (mf->hf) DeleteObject(mf->hf);\r
+ mf->hf = CreateFontIndirect(&mf->lf);\r
}\r
\r
+// [HGM] This platform-dependent table provides the location for storing the color info\r
+void *\r
+colorVariable[] = {\r
+ &whitePieceColor, \r
+ &blackPieceColor, \r
+ &lightSquareColor,\r
+ &darkSquareColor, \r
+ &highlightSquareColor,\r
+ &premoveHighlightColor,\r
+ NULL,\r
+ &consoleBackgroundColor,\r
+ &appData.fontForeColorWhite,\r
+ &appData.fontBackColorWhite,\r
+ &appData.fontForeColorBlack,\r
+ &appData.fontBackColorBlack,\r
+ &appData.evalHistColorWhite,\r
+ &appData.evalHistColorBlack,\r
+ &appData.highlightArrowColor,\r
+};\r
+\r
/* Command line font name parser. NULL name means do nothing.\r
Syntax like "Courier New:10.0 bi" or "Arial:10" or "Arial:10b"\r
For backward compatibility, syntax without the colon is also\r
mfp->charset = (BYTE) atoi(q+1);\r
}\r
\r
+void\r
+ParseFont(char *name, int number)\r
+{ // wrapper to shield back-end from 'font'\r
+ ParseFontName(name, &font[boardSize][number]->mfp);\r
+}\r
+\r
+void\r
+SetFontDefaults()\r
+{ // in WB we have a 2D array of fonts; this initializes their description\r
+ int i, j;\r
+ /* Point font array elements to structures and\r
+ parse default font names */\r
+ for (i=0; i<NUM_FONTS; i++) {\r
+ for (j=0; j<NUM_SIZES; j++) {\r
+ font[j][i] = &fontRec[j][i];\r
+ ParseFontName(font[j][i]->def, &font[j][i]->mfp);\r
+ }\r
+ }\r
+}\r
+\r
+void\r
+CreateFonts()\r
+{ // here we create the actual fonts from the selected descriptions\r
+ int i, j;\r
+ for (i=0; i<NUM_FONTS; i++) {\r
+ for (j=0; j<NUM_SIZES; j++) {\r
+ CreateFontInMF(font[j][i]);\r
+ }\r
+ }\r
+}\r
/* Color name parser.\r
X version accepts X color names, but this one\r
handles only the #rrggbb form (hex) or rrr,ggg,bbb (decimal) */\r
return PALETTERGB(red, green, blue);\r
}\r
\r
+void\r
+ParseColor(int n, char *name)\r
+{ // for WinBoard the color is an int, which needs to be derived from the string\r
+ if(colorVariable[n]) *(int*)colorVariable[n] = ParseColorName(name);\r
+}\r
\r
-void ParseAttribs(COLORREF *color, int *effects, char* argValue)\r
+void\r
+ParseAttribs(COLORREF *color, int *effects, char* argValue)\r
{\r
char *e = argValue;\r
int eff = 0;\r
*color = ParseColorName(e);\r
}\r
\r
+void\r
+ParseTextAttribs(ColorClass cc, char *s)\r
+{ // [HGM] front-end wrapper that does the platform-dependent call\r
+ // for XBoard we would set (&appData.colorShout)[cc] = strdup(s);\r
+ ParseAttribs(&textAttribs[cc].color, &textAttribs[cc].effects, s);\r
+}\r
\r
-BoardSize\r
-ParseBoardSize(char *name)\r
-{\r
+void\r
+ParseBoardSize(void *addr, char *name)\r
+{ // [HGM] rewritten with return-value ptr to shield back-end from BoardSize\r
BoardSize bs = SizeTiny;\r
while (sizeInfo[bs].name != NULL) {\r
- if (StrCaseCmp(name, sizeInfo[bs].name) == 0) return bs;\r
+ if (StrCaseCmp(name, sizeInfo[bs].name) == 0) {\r
+ *(BoardSize *)addr = bs;\r
+ return;\r
+ }\r
bs++;\r
}\r
ExitArgError("Unrecognized board size value", name);\r
- return bs; /* not reached */\r
-}\r
-\r
-\r
-char\r
-StringGet(void *getClosure)\r
-{\r
- char **p = (char **) getClosure;\r
- return *((*p)++);\r
-}\r
-\r
-char\r
-FileGet(void *getClosure)\r
-{\r
- int c;\r
- FILE* f = (FILE*) getClosure;\r
-\r
- c = getc(f);\r
- if (c == '\r') c = getc(f); // work around DOS format files by bypassing the '\r' completely\r
- if (c == EOF)\r
- return NULLCHAR;\r
- else\r
- return (char) c;\r
-}\r
-\r
-/* Parse settings file named "name". If file found, return the\r
- full name in fullname and return TRUE; else return FALSE */\r
-BOOLEAN\r
-ParseSettingsFile(char *name, char fullname[MSG_SIZ])\r
-{\r
- char *dummy;\r
- FILE *f;\r
- int ok; char buf[MSG_SIZ];\r
-\r
- ok = SearchPath(installDir, name, NULL, MSG_SIZ, fullname, &dummy);\r
- if(!ok && strchr(name, '.') == NULL) { // [HGM] append default file-name extension '.ini' when needed\r
- sprintf(buf, "%s.ini", name);\r
- ok = SearchPath(installDir, buf, NULL, MSG_SIZ, fullname, &dummy);\r
- }\r
- if (ok) {\r
- f = fopen(fullname, "r");\r
- if (f != NULL) {\r
- ParseArgs(FileGet, f);\r
- fclose(f);\r
- return TRUE;\r
- }\r
- }\r
- return FALSE;\r
-}\r
-\r
-VOID\r
-ParseArgs(GetFunc get, void *cl)\r
-{\r
- char argName[ARG_MAX];\r
- char argValue[ARG_MAX];\r
- ArgDescriptor *ad;\r
- char start;\r
- char *q;\r
- int i, octval;\r
- char ch;\r
- int posarg = 0;\r
-\r
- ch = get(cl);\r
- for (;;) {\r
- while (ch == ' ' || ch == '\n' || ch == '\t') ch = get(cl);\r
- if (ch == NULLCHAR) break;\r
- if (ch == ';') {\r
- /* Comment to end of line */\r
- ch = get(cl);\r
- while (ch != '\n' && ch != NULLCHAR) ch = get(cl);\r
- continue;\r
- } else if (ch == '/' || ch == '-') {\r
- /* Switch */\r
- q = argName;\r
- while (ch != ' ' && ch != '=' && ch != ':' && ch != NULLCHAR &&\r
- ch != '\n' && ch != '\t') {\r
- *q++ = ch;\r
- ch = get(cl);\r
- }\r
- *q = NULLCHAR;\r
-\r
- for (ad = argDescriptors; ad->argName != NULL; ad++)\r
- if (strcmp(ad->argName, argName + 1) == 0) break;\r
-\r
- if (ad->argName == NULL)\r
- ExitArgError("Unrecognized argument", argName);\r
-\r
- } else if (ch == '@') {\r
- /* Indirection file */\r
- ad = &argDescriptorIndirection;\r
- ch = get(cl);\r
- } else {\r
- /* Positional argument */\r
- ad = &argDescriptors[posarg++];\r
- strcpy(argName, ad->argName);\r
- }\r
-\r
- if (ad->argType == ArgTrue) {\r
- *(Boolean *) ad->argLoc = TRUE;\r
- continue;\r
- }\r
- if (ad->argType == ArgFalse) {\r
- *(Boolean *) ad->argLoc = FALSE;\r
- continue;\r
- }\r
-\r
- while (ch == ' ' || ch == '=' || ch == ':' || ch == '\t') ch = get(cl);\r
- if (ch == NULLCHAR || ch == '\n') {\r
- ExitArgError("No value provided for argument", argName);\r
- }\r
- q = argValue;\r
- if (ch == '{') {\r
- // Quoting with { }. No characters have to (or can) be escaped.\r
- // Thus the string cannot contain a '}' character.\r
- start = ch;\r
- ch = get(cl);\r
- while (start) {\r
- switch (ch) {\r
- case NULLCHAR:\r
- start = NULLCHAR;\r
- break;\r
- \r
- case '}':\r
- ch = get(cl);\r
- start = NULLCHAR;\r
- break;\r
-\r
- default:\r
- *q++ = ch;\r
- ch = get(cl);\r
- break;\r
- }\r
- } \r
- } else if (ch == '\'' || ch == '"') {\r
- // Quoting with ' ' or " ", with \ as escape character.\r
- // Inconvenient for long strings that may contain Windows filenames.\r
- start = ch;\r
- ch = get(cl);\r
- while (start) {\r
- switch (ch) {\r
- case NULLCHAR:\r
- start = NULLCHAR;\r
- break;\r
-\r
- default:\r
- not_special:\r
- *q++ = ch;\r
- ch = get(cl);\r
- break;\r
-\r
- case '\'':\r
- case '\"':\r
- if (ch == start) {\r
- ch = get(cl);\r
- start = NULLCHAR;\r
- break;\r
- } else {\r
- goto not_special;\r
- }\r
-\r
- case '\\':\r
- if (ad->argType == ArgFilename\r
- || ad->argType == ArgSettingsFilename) {\r
- goto not_special;\r
- }\r
- ch = get(cl);\r
- switch (ch) {\r
- case NULLCHAR:\r
- ExitArgError("Incomplete \\ escape in value for", argName);\r
- break;\r
- case 'n':\r
- *q++ = '\n';\r
- ch = get(cl);\r
- break;\r
- case 'r':\r
- *q++ = '\r';\r
- ch = get(cl);\r
- break;\r
- case 't':\r
- *q++ = '\t';\r
- ch = get(cl);\r
- break;\r
- case 'b':\r
- *q++ = '\b';\r
- ch = get(cl);\r
- break;\r
- case 'f':\r
- *q++ = '\f';\r
- ch = get(cl);\r
- break;\r
- default:\r
- octval = 0;\r
- for (i = 0; i < 3; i++) {\r
- if (ch >= '0' && ch <= '7') {\r
- octval = octval*8 + (ch - '0');\r
- ch = get(cl);\r
- } else {\r
- break;\r
- }\r
- }\r
- if (i > 0) {\r
- *q++ = (char) octval;\r
- } else {\r
- *q++ = ch;\r
- ch = get(cl);\r
- }\r
- break;\r
- }\r
- break;\r
- }\r
- }\r
- } else {\r
- while (ch != ' ' && ch != NULLCHAR && ch != '\t' && ch != '\n') {\r
- *q++ = ch;\r
- ch = get(cl);\r
- }\r
- }\r
- *q = NULLCHAR;\r
-\r
- switch (ad->argType) {\r
- case ArgInt:\r
- *(int *) ad->argLoc = atoi(argValue);\r
- break;\r
-\r
- case ArgX:\r
- *(int *) ad->argLoc = atoi(argValue) + wpMain.x; // [HGM] placement: translate stored relative to absolute \r
- break;\r
-\r
- case ArgY:\r
- *(int *) ad->argLoc = atoi(argValue) + wpMain.y; // (this is really kludgey, it should be done where used...)\r
- break;\r
-\r
- case ArgZ:\r
- *(int *) ad->argLoc = atoi(argValue);\r
- EnsureOnScreen(&wpMain.x, &wpMain.y, minX, minY); \r
- break;\r
-\r
- case ArgFloat:\r
- *(float *) ad->argLoc = (float) atof(argValue);\r
- break;\r
-\r
- case ArgString:\r
- case ArgFilename:\r
- *(char **) ad->argLoc = strdup(argValue);\r
- break;\r
-\r
- case ArgSettingsFilename:\r
- {\r
- char fullname[MSG_SIZ];\r
- if (ParseSettingsFile(argValue, fullname)) {\r
- if (ad->argLoc != NULL) {\r
- *(char **) ad->argLoc = strdup(fullname);\r
- }\r
- } else {\r
- if (ad->argLoc != NULL) {\r
- } else {\r
- ExitArgError("Failed to open indirection file", argValue);\r
- }\r
- }\r
- }\r
- break;\r
-\r
- case ArgBoolean:\r
- switch (argValue[0]) {\r
- case 't':\r
- case 'T':\r
- *(Boolean *) ad->argLoc = TRUE;\r
- break;\r
- case 'f':\r
- case 'F':\r
- *(Boolean *) ad->argLoc = FALSE;\r
- break;\r
- default:\r
- ExitArgError("Unrecognized boolean argument value", argValue);\r
- break;\r
- }\r
- break;\r
-\r
- case ArgColor:\r
- *(COLORREF *)ad->argLoc = ParseColorName(argValue);\r
- break;\r
-\r
- case ArgAttribs: {\r
- ColorClass cc = (ColorClass)ad->argLoc;\r
- ParseAttribs(&textAttribs[cc].color, &textAttribs[cc].effects, argValue);\r
- }\r
- break;\r
- \r
- case ArgBoardSize:\r
- *(BoardSize *)ad->argLoc = ParseBoardSize(argValue);\r
- break;\r
-\r
- case ArgFont:\r
- ParseFontName(argValue, &font[boardSize][(int)ad->argLoc]->mfp);\r
- break;\r
-\r
- case ArgCommSettings:\r
- ParseCommSettings(argValue, &dcb);\r
- break;\r
-\r
- case ArgNone:\r
- ExitArgError("Unrecognized argument", argValue);\r
- break;\r
- case ArgTrue:\r
- case ArgFalse: ;\r
- }\r
- }\r
-}\r
-\r
-VOID\r
-LFfromMFP(LOGFONT* lf, MyFontParams *mfp)\r
-{\r
- HDC hdc = CreateDC("DISPLAY", NULL, NULL, NULL);\r
- lf->lfHeight = -(int)(mfp->pointSize * GetDeviceCaps(hdc, LOGPIXELSY) / 72.0 + 0.5);\r
- DeleteDC(hdc);\r
- lf->lfWidth = 0;\r
- lf->lfEscapement = 0;\r
- lf->lfOrientation = 0;\r
- lf->lfWeight = mfp->bold ? FW_BOLD : FW_NORMAL;\r
- lf->lfItalic = mfp->italic;\r
- lf->lfUnderline = mfp->underline;\r
- lf->lfStrikeOut = mfp->strikeout;\r
- lf->lfCharSet = mfp->charset;\r
- lf->lfOutPrecision = OUT_DEFAULT_PRECIS;\r
- lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;\r
- lf->lfQuality = DEFAULT_QUALITY;\r
- lf->lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE;\r
- strcpy(lf->lfFaceName, mfp->faceName);\r
-}\r
-\r
-VOID\r
-CreateFontInMF(MyFont *mf)\r
-{\r
- LFfromMFP(&mf->lf, &mf->mfp);\r
- if (mf->hf) DeleteObject(mf->hf);\r
- mf->hf = CreateFontIndirect(&mf->lf);\r
}\r
\r
-VOID\r
-SetDefaultTextAttribs()\r
-{\r
- ColorClass cc;\r
- for (cc = (ColorClass)0; cc < NColorClasses; cc++) {\r
- ParseAttribs(&textAttribs[cc].color, \r
- &textAttribs[cc].effects, \r
- defaultTextAttribs[cc]);\r
- }\r
-}\r
-\r
-VOID\r
-SetDefaultSounds()\r
-{ // [HGM] only sounds for which no option exists\r
- ColorClass cc;\r
- for (cc = ColorNormal; cc < NColorClasses; cc++) {\r
- textAttribs[cc].sound.name = strdup("");\r
- textAttribs[cc].sound.data = NULL;\r
- }\r
-}\r
-\r
-VOID\r
+void\r
LoadAllSounds()\r
{ // [HGM] import name from appData first\r
ColorClass cc;\r
textAttribs[cc].sound.data = NULL;\r
MyLoadSound(&textAttribs[cc].sound);\r
}\r
+ for (cc = ColorNormal; cc < NColorClasses; cc++) {\r
+ textAttribs[cc].sound.name = strdup("");\r
+ textAttribs[cc].sound.data = NULL;\r
+ }\r
for (sc = (SoundClass)0; sc < NSoundClasses; sc++) {\r
sounds[sc].name = strdup((&appData.soundMove)[sc]);\r
sounds[sc].data = NULL;\r
}\r
\r
void\r
-SetDefaultsFromList()\r
-{ // [HGM] ini: take defaults from argDescriptor list\r
- int i;\r
-\r
- for(i=0; argDescriptors[i].argName != NULL; i++) {\r
- if(argDescriptors[i].defaultValue != INVALID)\r
- switch(argDescriptors[i].argType) {\r
- case ArgBoolean:\r
- case ArgTrue:\r
- case ArgFalse:\r
- *(Boolean *) argDescriptors[i].argLoc = (int)argDescriptors[i].defaultValue;\r
- break;\r
- case ArgInt:\r
- case ArgX:\r
- case ArgY:\r
- case ArgZ:\r
- *(int *) argDescriptors[i].argLoc = (int)argDescriptors[i].defaultValue;\r
- break;\r
- case ArgString:\r
- case ArgFilename:\r
- case ArgSettingsFilename:\r
- *(char **) argDescriptors[i].argLoc = (char *)argDescriptors[i].defaultValue;\r
- break;\r
- case ArgBoardSize:\r
- *(BoardSize *) argDescriptors[i].argLoc = (BoardSize)argDescriptors[i].defaultValue;\r
- break;\r
- case ArgFloat: // floats cannot be casted to int without precision loss\r
- default: ; // some arg types cannot be initialized through table\r
- }\r
- }\r
-}\r
-\r
-VOID\r
-InitAppData(LPSTR lpCmdLine)\r
+SetCommPortDefaults()\r
{\r
- int i, j;\r
- char buf[ARG_MAX], currDir[MSG_SIZ];\r
- char *dummy, *p;\r
-\r
- programName = szAppName;\r
-\r
- /* Initialize to defaults */\r
- SetDefaultsFromList(); // this sets most defaults\r
-\r
- // some parameters for which there are no options!\r
- appData.Iconic = FALSE; /*unused*/\r
- appData.cmailGameName = "";\r
- appData.icsEngineAnalyze = FALSE;\r
-\r
- // float: casting to int is not harmless, so default cannot be contained in table\r
- appData.timeDelay = TIME_DELAY;\r
-\r
- // colors have platform-dependent option format and internal representation\r
- // their setting and parsing must remain in front-end\r
- lightSquareColor = ParseColorName(LIGHT_SQUARE_COLOR);\r
- darkSquareColor = ParseColorName(DARK_SQUARE_COLOR);\r
- whitePieceColor = ParseColorName(WHITE_PIECE_COLOR);\r
- blackPieceColor = ParseColorName(BLACK_PIECE_COLOR);\r
- highlightSquareColor = ParseColorName(HIGHLIGHT_SQUARE_COLOR);\r
- premoveHighlightColor = ParseColorName(PREMOVE_HIGHLIGHT_COLOR);\r
- consoleBackgroundColor = ParseColorName(COLOR_BKGD);\r
- // the following must be moved out of appData to front-end variables\r
- appData.evalHistColorWhite = ParseColorName( "#FFFFB0" );\r
- appData.evalHistColorBlack = ParseColorName( "#AD5D3D" );\r
- appData.highlightArrowColor = ParseColorName( "#FFFF80" );\r
-\r
- // some complex, platform-dependent stuff\r
- SetDefaultTextAttribs();\r
- SetDefaultSounds();\r
-\r
- memset(&dcb, 0, sizeof(DCB)); // required by VS 2002 +\r
+ memset(&dcb, 0, sizeof(DCB)); // required by VS 2002 +\r
dcb.DCBlength = sizeof(DCB);\r
dcb.BaudRate = 9600;\r
dcb.fBinary = TRUE;\r
dcb.ByteSize = 7;\r
dcb.Parity = SPACEPARITY;\r
dcb.StopBits = ONESTOPBIT;\r
-\r
- /* Point font array elements to structures and\r
- parse default font names */\r
- for (i=0; i<NUM_FONTS; i++) {\r
- for (j=0; j<NUM_SIZES; j++) {\r
- font[j][i] = &fontRec[j][i];\r
- ParseFontName(font[j][i]->def, &font[j][i]->mfp);\r
- }\r
- }\r
- \r
- /* Parse default settings file if any */\r
- if (ParseSettingsFile(settingsFileName, buf)) {\r
- settingsFileName = strdup(buf);\r
- }\r
-\r
- /* Parse command line */\r
- ParseArgs(StringGet, &lpCmdLine);\r
-\r
- /* [HGM] make sure board size is acceptable */\r
- if(appData.NrFiles > BOARD_FILES ||\r
- appData.NrRanks > BOARD_RANKS )\r
- DisplayFatalError("Recompile with BOARD_RANKS or BOARD_FILES, to support this size", 0, 2);\r
-\r
- /* [HGM] After parsing the options from the .ini file, and overruling them\r
- * with options from the command line, we now make an even higher priority\r
- * overrule by WB options attached to the engine command line. This so that\r
- * tournament managers can use WB options (such as /timeOdds) that follow\r
- * the engines.\r
- */\r
- if(appData.firstChessProgram != NULL) {\r
- char *p = StrStr(appData.firstChessProgram, "WBopt");\r
- static char *f = "first";\r
- char buf[MSG_SIZ], *q = buf;\r
- if(p != NULL) { // engine command line contains WinBoard options\r
- sprintf(buf, p+6, f, f, f, f, f, f, f, f, f, f); // replace %s in them by "first"\r
- ParseArgs(StringGet, &q);\r
- p[-1] = 0; // cut them offengine command line\r
- }\r
- }\r
- // now do same for second chess program\r
- if(appData.secondChessProgram != NULL) {\r
- char *p = StrStr(appData.secondChessProgram, "WBopt");\r
- static char *s = "second";\r
- char buf[MSG_SIZ], *q = buf;\r
- if(p != NULL) { // engine command line contains WinBoard options\r
- sprintf(buf, p+6, s, s, s, s, s, s, s, s, s, s); // replace %s in them by "first"\r
- ParseArgs(StringGet, &q);\r
- p[-1] = 0; // cut them offengine command line\r
- }\r
- }\r
-\r
-\r
- /* Propagate options that affect others */\r
- if (appData.matchMode || appData.matchGames) chessProgram = TRUE;\r
- if (appData.icsActive || appData.noChessProgram) {\r
- chessProgram = FALSE; /* not local chess program mode */\r
- }\r
-\r
- /* Open startup dialog if needed */\r
- if ((!appData.noChessProgram && !chessProgram && !appData.icsActive) ||\r
- (appData.icsActive && *appData.icsHost == NULLCHAR) ||\r
- (chessProgram && (*appData.firstChessProgram == NULLCHAR ||\r
- *appData.secondChessProgram == NULLCHAR))) {\r
- FARPROC lpProc;\r
- \r
- lpProc = MakeProcInstance((FARPROC)StartupDialog, hInst);\r
- DialogBox(hInst, MAKEINTRESOURCE(DLG_Startup), NULL, (DLGPROC)lpProc);\r
- FreeProcInstance(lpProc);\r
- }\r
-\r
- /* Make sure save files land in the right (?) directory */\r
- if (GetFullPathName(appData.saveGameFile, MSG_SIZ, buf, &dummy)) {\r
- appData.saveGameFile = strdup(buf);\r
- }\r
- if (GetFullPathName(appData.savePositionFile, MSG_SIZ, buf, &dummy)) {\r
- appData.savePositionFile = strdup(buf);\r
- }\r
-\r
- /* Finish initialization for fonts and sounds */\r
- for (i=0; i<NUM_FONTS; i++) {\r
- for (j=0; j<NUM_SIZES; j++) {\r
- CreateFontInMF(font[j][i]);\r
- }\r
- }\r
- /* xboard, and older WinBoards, controlled the move sound with the\r
- appData.ringBellAfterMoves option. In the current WinBoard, we\r
- always turn the option on (so that the backend will call us),\r
- then let the user turn the sound off by setting it to silence if\r
- desired. To accommodate old winboard.ini files saved by old\r
- versions of WinBoard, we also turn off the sound if the option\r
- was initially set to false. */\r
- if (!appData.ringBellAfterMoves) {\r
- sounds[(int)SoundMove].name = strdup("");\r
- appData.ringBellAfterMoves = TRUE;\r
- }\r
- GetCurrentDirectory(MSG_SIZ, currDir);\r
- SetCurrentDirectory(installDir);\r
- LoadAllSounds();\r
- SetCurrentDirectory(currDir);\r
-\r
- p = icsTextMenuString;\r
- if (p[0] == '@') {\r
- FILE* f = fopen(p + 1, "r");\r
- if (f == NULL) {\r
- DisplayFatalError(p + 1, errno, 2);\r
- return;\r
- }\r
- i = fread(buf, 1, sizeof(buf)-1, f);\r
- fclose(f);\r
- buf[i] = NULLCHAR;\r
- p = buf;\r
- }\r
- ParseIcsTextMenu(strdup(p));\r
-}\r
-\r
-\r
-VOID\r
-InitMenuChecks()\r
-{\r
- HMENU hmenu = GetMenu(hwndMain);\r
-\r
- (void) EnableMenuItem(hmenu, IDM_CommPort,\r
- MF_BYCOMMAND|((appData.icsActive &&\r
- *appData.icsCommPort != NULLCHAR) ?\r
- MF_ENABLED : MF_GRAYED));\r
- (void) CheckMenuItem(hmenu, IDM_SaveSettingsOnExit,\r
- MF_BYCOMMAND|(saveSettingsOnExit ?\r
- MF_CHECKED : MF_UNCHECKED));\r
}\r
\r
// [HGM] args: these three cases taken out to stay in front-end\r
}\r
}\r
\r
-VOID\r
+void\r
ExportSounds()\r
{ // [HGM] copy the names from the internal WB variables to appData\r
ColorClass cc;\r
void\r
SaveColor(FILE *f, ArgDescriptor *ad)\r
{ // in WinBoard the color is an int and has to be converted to text. In X it would be a string already?\r
- COLORREF color = *(COLORREF *)ad->argLoc;\r
+ COLORREF color = *(COLORREF *)colorVariable[(int)ad->argLoc];\r
fprintf(f, "/%s=#%02lx%02lx%02lx\n", ad->argName, \r
color&0xff, (color>>8)&0xff, (color>>16)&0xff);\r
}\r
\r
-int\r
-MainWindowUp()\r
-{ // [HGM] args: allows testing if main window is realized from back-end\r
- return hwndMain != NULL;\r
+void\r
+SaveBoardSize(FILE *f, char *name, void *addr)\r
+{ // wrapper to shield back-end from BoardSize & sizeInfo\r
+ fprintf(f, "/%s=%s\n", name, sizeInfo[*(BoardSize *)addr].name);\r
}\r
\r
-VOID\r
-SaveSettings(char* name)\r
-{\r
- FILE *f;\r
- ArgDescriptor *ad;\r
- char dir[MSG_SIZ];\r
-\r
- if (!MainWindowUp()) return;\r
-\r
- GetCurrentDirectory(MSG_SIZ, dir);\r
- SetCurrentDirectory(installDir);\r
- f = fopen(name, "w");\r
- SetCurrentDirectory(dir);\r
- if (f == NULL) {\r
- DisplayError(name, errno);\r
- return;\r
- }\r
- fprintf(f, ";\n");\r
- fprintf(f, "; %s Save Settings file\n", PACKAGE_STRING);\r
- fprintf(f, ";\n");\r
- fprintf(f, "; You can edit the values of options that are already set in this file,\n");\r
- fprintf(f, "; but if you add other options, the next Save Settings will not save them.\n");\r
- fprintf(f, "; Use a shortcut, an @indirection file, or a .bat file instead.\n");\r
- fprintf(f, ";\n");\r
+void\r
+ParseCommPortSettings(char *s)\r
+{ // wrapper to keep dcb from back-end\r
+ ParseCommSettings(s, &dcb);\r
+}\r
\r
+void\r
+GetWindowCoords()\r
+{ // wrapper to shield use of window handles from back-end (make addressible by number?)\r
GetActualPlacement(hwndMain, &wpMain);\r
GetActualPlacement(hwndConsole, &wpConsole);\r
GetActualPlacement(commentDialog, &wpComment);\r
GetActualPlacement(editTagsDialog, &wpTags);\r
GetActualPlacement(gameListDialog, &wpGameList);\r
-\r
- /* [AS] Move history */\r
- wpMoveHistory.visible = MoveHistoryIsUp();\r
GetActualPlacement(moveHistoryDialog, &wpMoveHistory);\r
-\r
- /* [AS] Eval graph */\r
- wpEvalGraph.visible = EvalGraphIsUp();\r
GetActualPlacement(evalGraphDialog, &wpEvalGraph);\r
-\r
- /* [AS] Engine output */\r
- wpEngineOutput.visible = EngineOutputIsUp();\r
GetActualPlacement(engineOutputDialog, &wpEngineOutput);\r
+}\r
\r
- // [HGM] in WB we have to copy sound names to appData first\r
- ExportSounds();\r
+void\r
+PrintCommPortSettings(FILE *f, char *name)\r
+{ // wrapper to shield back-end from DCB\r
+ PrintCommSettings(f, name, &dcb);\r
+}\r
\r
- for (ad = argDescriptors; ad->argName != NULL; ad++) {\r
- if (!ad->save) continue;\r
- switch (ad->argType) {\r
- case ArgString:\r
- {\r
- char *p = *(char **)ad->argLoc;\r
- if ((strchr(p, '\\') || strchr(p, '\n')) && !strchr(p, '}')) {\r
- /* Quote multiline values or \-containing values\r
- with { } if possible */\r
- fprintf(f, "/%s={%s}\n", ad->argName, p);\r
- } else {\r
- /* Else quote with " " */\r
- fprintf(f, "/%s=\"", ad->argName);\r
- while (*p) {\r
- if (*p == '\n') fprintf(f, "\n");\r
- else if (*p == '\r') fprintf(f, "\\r");\r
- else if (*p == '\t') fprintf(f, "\\t");\r
- else if (*p == '\b') fprintf(f, "\\b");\r
- else if (*p == '\f') fprintf(f, "\\f");\r
- else if (*p < ' ') fprintf(f, "\\%03o", *p);\r
- else if (*p == '\"') fprintf(f, "\\\"");\r
- else if (*p == '\\') fprintf(f, "\\\\");\r
- else putc(*p, f);\r
- p++;\r
- }\r
- fprintf(f, "\"\n");\r
- }\r
- }\r
- break;\r
- case ArgInt:\r
- case ArgZ:\r
- fprintf(f, "/%s=%d\n", ad->argName, *(int *)ad->argLoc);\r
- break;\r
- case ArgX:\r
- fprintf(f, "/%s=%d\n", ad->argName, *(int *)ad->argLoc - wpMain.x); // [HGM] placement: stor relative value\r
- break;\r
- case ArgY:\r
- fprintf(f, "/%s=%d\n", ad->argName, *(int *)ad->argLoc - wpMain.y);\r
- break;\r
- case ArgFloat:\r
- fprintf(f, "/%s=%g\n", ad->argName, *(float *)ad->argLoc);\r
- break;\r
- case ArgBoolean:\r
- fprintf(f, "/%s=%s\n", ad->argName, \r
- (*(Boolean *)ad->argLoc) ? "true" : "false");\r
- break;\r
- case ArgTrue:\r
- if (*(Boolean *)ad->argLoc) fprintf(f, "/%s\n", ad->argName);\r
- break;\r
- case ArgFalse:\r
- if (!*(Boolean *)ad->argLoc) fprintf(f, "/%s\n", ad->argName);\r
- break;\r
- case ArgColor:\r
- SaveColor(f, ad);\r
- break;\r
- case ArgAttribs:\r
- break;\r
- case ArgFilename:\r
- if (strchr(*(char **)ad->argLoc, '\"')) {\r
- fprintf(f, "/%s='%s'\n", ad->argName, *(char **)ad->argLoc);\r
- } else {\r
- fprintf(f, "/%s=\"%s\"\n", ad->argName, *(char **)ad->argLoc);\r
- }\r
- break;\r
- case ArgBoardSize:\r
- fprintf(f, "/%s=%s\n", ad->argName,\r
- sizeInfo[*(BoardSize *)ad->argLoc].name);\r
- break;\r
- case ArgFont:\r
- SaveFontArg(f, ad);\r
- break;\r
- case ArgCommSettings:\r
- PrintCommSettings(f, ad->argName, (DCB *)ad->argLoc);\r
- case ArgNone:\r
- case ArgSettingsFilename: ;\r
- }\r
- }\r
- fclose(f);\r
+int\r
+MySearchPath(char *installDir, char *name, char *fullname)\r
+{\r
+ char *dummy;\r
+ return (int) SearchPath(installDir, name, NULL, MSG_SIZ, fullname, &dummy);\r
+}\r
+\r
+int\r
+MyGetFullPathName(char *name, char *fullname)\r
+{\r
+ char *dummy;\r
+ return (int) GetFullPathName(name, MSG_SIZ, fullname, &dummy);\r
}\r
\r
+int\r
+MainWindowUp()\r
+{ // [HGM] args: allows testing if main window is realized from back-end\r
+ return hwndMain != NULL;\r
+}\r
\r
+void\r
+PopUpStartupDialog()\r
+{\r
+ FARPROC lpProc;\r
+ \r
+ lpProc = MakeProcInstance((FARPROC)StartupDialog, hInst);\r
+ DialogBox(hInst, MAKEINTRESOURCE(DLG_Startup), NULL, (DLGPROC)lpProc);\r
+ FreeProcInstance(lpProc);\r
+}\r
\r
/*---------------------------------------------------------------------------*\\r
*\r
void\r
InitComboStringsFromOption(HANDLE hwndCombo, char *str)\r
{\r
- char buf1[ARG_MAX];\r
+ char buf1[MAX_ARG_LEN];\r
int len;\r
\r
if (str[0] == '@') {\r
{\r
if (histP == histIn) return NULL;\r
histP = (histP + 1) % HISTORY_SIZE;\r
- return history[histP];\r
-}\r
-\r
-typedef struct {\r
- char *item;\r
- char *command;\r
- BOOLEAN getname;\r
- BOOLEAN immediate;\r
-} IcsTextMenuEntry;\r
-#define ICS_TEXT_MENU_SIZE (IDM_CommandXLast - IDM_CommandX + 1)\r
-IcsTextMenuEntry icsTextMenuEntry[ICS_TEXT_MENU_SIZE];\r
-\r
-void\r
-ParseIcsTextMenu(char *icsTextMenuString)\r
-{\r
-// int flags = 0;\r
- IcsTextMenuEntry *e = icsTextMenuEntry;\r
- char *p = icsTextMenuString;\r
- while (e->item != NULL && e < icsTextMenuEntry + ICS_TEXT_MENU_SIZE) {\r
- free(e->item);\r
- e->item = NULL;\r
- if (e->command != NULL) {\r
- free(e->command);\r
- e->command = NULL;\r
- }\r
- e++;\r
- }\r
- e = icsTextMenuEntry;\r
- while (*p && e < icsTextMenuEntry + ICS_TEXT_MENU_SIZE) {\r
- if (*p == ';' || *p == '\n') {\r
- e->item = strdup("-");\r
- e->command = NULL;\r
- p++;\r
- } else if (*p == '-') {\r
- e->item = strdup("-");\r
- e->command = NULL;\r
- p++;\r
- if (*p) p++;\r
- } else {\r
- char *q, *r, *s, *t;\r
- char c;\r
- q = strchr(p, ',');\r
- if (q == NULL) break;\r
- *q = NULLCHAR;\r
- r = strchr(q + 1, ',');\r
- if (r == NULL) break;\r
- *r = NULLCHAR;\r
- s = strchr(r + 1, ',');\r
- if (s == NULL) break;\r
- *s = NULLCHAR;\r
- c = ';';\r
- t = strchr(s + 1, c);\r
- if (t == NULL) {\r
- c = '\n';\r
- t = strchr(s + 1, c);\r
- }\r
- if (t != NULL) *t = NULLCHAR;\r
- e->item = strdup(p);\r
- e->command = strdup(q + 1);\r
- e->getname = *(r + 1) != '0';\r
- e->immediate = *(s + 1) != '0';\r
- *q = ',';\r
- *r = ',';\r
- *s = ',';\r
- if (t == NULL) break;\r
- *t = c;\r
- p = t + 1;\r
- }\r
- e++;\r
- } \r
+ return history[histP]; \r
}\r
\r
HMENU\r
BOOL APIENTRY MyCreateFont(HWND hwnd, MyFont *font);\r
VOID ErrorPopDown(VOID);\r
VOID EnsureOnScreen(int *x, int *y, int minX, int minY);\r
-typedef char GetFunc(void *getClosure);\r
-VOID ParseArgs(GetFunc get, void *cl);\r
HBITMAP \r
DoLoadBitmap(HINSTANCE hinst, char *piece, int squareSize, char *suffix);\r
COLORREF ParseColorName(char *name);\r
BOOLEAN MyLoadSound(MySound *ms);\r
BOOLEAN MyPlaySound(MySound *ms);\r
VOID ExitArgError(char *msg, char *badArg);\r
+void SaveSettings(char* name);\r
\r
/* Constants */\r
\r
W_MoveHist, W_EngineOut, W_GameList, NUM_WINDOWS\r
} WindowID;\r
\r
-/* [AS] Layout management */\r
-typedef struct {\r
- Boolean visible;\r
- int x;\r
- int y;\r
- int width;\r
- int height;\r
-} WindowPlacement;\r
-\r
extern WindowPlacement placementTab[NUM_WINDOWS];\r
extern HWND hwndTab[NUM_WINDOWS]; // this remains pure front-end.\r
\r
VOID ReattachAfterSize( LPRECT lprcOldPos, int new_w, int new_h, HWND hWndChild, WindowPlacement * pwpChild );\r
BOOL GetActualPlacement( HWND hWnd, WindowPlacement * wp );\r
\r
-extern WindowPlacement wpEngineOutput;\r
-extern WindowPlacement wpEvalGraph;\r
-extern WindowPlacement wpMoveHistory;\r
-extern WindowPlacement wpGameList;\r
-extern WindowPlacement wpTags;\r
-\r
VOID MoveHistoryPopUp();\r
VOID MoveHistoryPopDown();\r
VOID MoveHistorySet( char movelist[][2*MOVE_LEN], int first, int last, int current, ChessProgramStats_Move * pvInfo );\r
-BOOL MoveHistoryIsUp();\r
extern HWND moveHistoryDialog;\r
\r
VOID EvalGraphSet( int first, int last, int current, ChessProgramStats_Move * pvInfo );\r
VOID EvalGraphPopUp();\r
VOID EvalGraphPopDown();\r
-Boolean EvalGraphIsUp();\r
extern HWND evalGraphDialog;\r
\r
extern HWND engineOutputDialog;\r
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));
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,
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
{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}
};
};
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[] = {
{ "ShowThinkingProc", ShowThinkingProc },
{ "HideThinkingProc", HideThinkingProc },
{ "TestLegalityProc", TestLegalityProc },
+ { "SaveSettingsProc", SaveSettingsProc },
+ { "SaveOnExitProc", SaveOnExitProc },
{ "InfoProc", InfoProc },
{ "ManProc", ManProc },
{ "HintProc", HintProc },
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<argc; i++) {
+ if( (strchr(argv[i], ' ') || strchr(argv[i], '\n') ||strchr(argv[i], '\t') )
+ && argv[i][0] != '{' )
+ sprintf(buf, "{%s} ", argv[i]);
+ else sprintf(buf, "%s ", argv[i]);
+ strcat(line, buf);
+ }
+ line[strlen(line)-1] = NULLCHAR;
+ return line;
+}
+
+//--------------------------------------------------------------------------------------------
+
#ifdef IDSIZES
// eventually, all layout determining code should go into a subroutine, but until then IDSIZE remains undefined
#else
char *p;
XrmDatabase xdb;
int forceMono = False;
-#define INDIRECTION
+//define INDIRECTION
#ifdef INDIRECTION
// [HGM] before anything else, expand any indirection files amongst options
char *argvCopy[1000]; // 1000 seems enough
XtAppInitialize(&appContext, "XBoard", shellOptions,
XtNumber(shellOptions),
&argc, argv, xboardResources, NULL, 0);
- if (argc > 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;
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++;
XtSetValues(XtNameToWidget(menuBarWidget,"menuOptions.Test Legality"),
args, 1);
}
+ if (saveSettingsOnExit) {
+ XtSetValues(XtNameToWidget(menuBarWidget,"menuOptions.Save Settings on Exit"),
+ args, 1);
+ }
/*
* Create an icon.
if (appData.icsActive && oldICSInteractionTitle != NULL) {
DisplayIcsInteractionTitle(oldICSInteractionTitle);
}
+ if (saveSettingsOnExit) SaveSettings(settingsFileName);
unlink(gameCopyFilename);
unlink(gamePasteFilename);
}
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;
#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"
#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);