X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwinboard.c;h=03b1fc2538c58836a97f88803560a67e942a0772;hb=5cd55bddca592918f38deff675d05b650a71412e;hp=24fd967df54780be9da6bdc0cd0dd3106e5ebf7a;hpb=8e0e2f1c14e76ea660f7bff6a104baed0f0048df;p=xboard.git diff --git a/winboard/winboard.c b/winboard/winboard.c index 24fd967..03b1fc2 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -5,7 +5,7 @@ * Massachusetts. * * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009 Free Software Foundation, Inc. + * 2007, 2008, 2009, 2010 Free Software Foundation, Inc. * * Enhancements Copyright 2005 Alessandro Scotti * @@ -80,13 +80,11 @@ #endif #include "common.h" -#include "winboard.h" #include "frontend.h" #include "backend.h" +#include "winboard.h" #include "moves.h" #include "wclipbrd.h" -#include "wgamelist.h" -#include "wedittags.h" #include "woptions.h" #include "wsockerr.h" #include "defaults.h" @@ -153,15 +151,16 @@ char szConsoleTitle[] = "I C S Interaction"; char *programName; char *settingsFileName; -BOOLEAN saveSettingsOnExit; +Boolean saveSettingsOnExit; char installDir[MSG_SIZ]; +int errorExitStatus; BoardSize boardSize; -BOOLEAN chessProgram; -static int boardX, boardY; +Boolean chessProgram; +//static int boardX, boardY; int minX, minY; // [HGM] placement: volatile limits on upper-left corner -static int squareSize, lineGap, minorSize; -static int winWidth, winHeight, winW, winH; +int squareSize, lineGap, minorSize; +static int winW, winH; static RECT messageRect, whiteRect, blackRect, leftLogoRect, rightLogoRect; // [HGM] logo static int logoHeight = 0; static char messageText[MESSAGE_TEXT_MAX]; @@ -176,14 +175,10 @@ char *icsNames; char *firstChessProgramNames; char *secondChessProgramNames; -#define ARG_MAX 128*1024 /* [AS] For Roger Brown's very long list! */ - #define PALETTESIZE 256 HINSTANCE hInst; /* current instance */ -HWND hwndMain = NULL; /* root window*/ -HWND hwndConsole = NULL; -BOOLEAN alwaysOnTop = FALSE; +Boolean alwaysOnTop = FALSE; RECT boardRect; COLORREF lightSquareColor, darkSquareColor, whitePieceColor, blackPieceColor, highlightSquareColor, premoveHighlightColor; @@ -196,9 +191,10 @@ static HBITMAP pieceBitmap[3][(int) BlackPawn]; /* [HGM] nr of bitmaps referred static HBRUSH lightSquareBrush, darkSquareBrush, blackSquareBrush, /* [HGM] for band between board and holdings */ explodeBrush, /* [HGM] atomic */ + markerBrush, /* [HGM] markers */ whitePieceBrush, blackPieceBrush, iconBkgndBrush /*, outlineBrush*/; -static POINT gridEndpoints[(BOARD_SIZE + 1) * 4]; -static DWORD gridVertexCounts[(BOARD_SIZE + 1) * 2]; +static POINT gridEndpoints[(BOARD_RANKS + BOARD_FILES + 2) * 2]; +static DWORD gridVertexCounts[BOARD_RANKS + BOARD_FILES + 2]; static HPEN gridPen = NULL; static HPEN highlightPen = NULL; static HPEN premovePen = NULL; @@ -210,17 +206,12 @@ static int lastSizing = 0; static int prevStderrPort; static HBITMAP userLogo; -/* [AS] Support for background textures */ -#define BACK_TEXTURE_MODE_DISABLED 0 -#define BACK_TEXTURE_MODE_PLAIN 1 -#define BACK_TEXTURE_MODE_FULL_RANDOM 2 - static HBITMAP liteBackTexture = NULL; static HBITMAP darkBackTexture = NULL; static int liteBackTextureMode = BACK_TEXTURE_MODE_PLAIN; static int darkBackTextureMode = BACK_TEXTURE_MODE_PLAIN; static int backTextureSquareSize = 0; -static struct { int x; int y; int mode; } backTextureSquareInfo[BOARD_SIZE][BOARD_SIZE]; +static struct { int x; int y; int mode; } backTextureSquareInfo[BOARD_RANKS][BOARD_FILES]; #if __GNUC__ && !defined(_winmajor) #define oldDialog 0 /* cygwin doesn't define _winmajor; mingw does */ @@ -232,13 +223,6 @@ static struct { int x; int y; int mode; } backTextureSquareInfo[BOARD_SIZE][BOAR #endif #endif -char *defaultTextAttribs[] = -{ - COLOR_SHOUT, COLOR_SSHOUT, COLOR_CHANNEL1, COLOR_CHANNEL, COLOR_KIBITZ, - COLOR_TELL, COLOR_CHALLENGE, COLOR_REQUEST, COLOR_SEEK, COLOR_NORMAL, - COLOR_NONE -}; - typedef struct { char *name; int squareSize; @@ -346,15 +330,7 @@ static char *commentTitle; static char *commentText; static int commentIndex; static Boolean editComment = FALSE; -HWND commentDialog = NULL; -BOOLEAN commentDialogUp = FALSE; -static int commentX, commentY, commentH, commentW; -static char *analysisTitle; -static char *analysisText; -HWND analysisDialog = NULL; -BOOLEAN analysisDialogUp = FALSE; -static int analysisX, analysisY, analysisH, analysisW; char errorTitle[MSG_SIZ]; char errorMessage[2*MSG_SIZ]; @@ -424,37 +400,27 @@ VOID UpdateSampleText(HWND hDlg, int id, MyColorizeAttribs *mca); int NewGameFRC(); int GameListOptions(); -HWND moveHistoryDialog = NULL; -BOOLEAN moveHistoryDialogUp = FALSE; - -WindowPlacement wpMoveHistory; +int dummy; // [HGM] for obsolete args +HWND hwndMain = NULL; /* root window*/ +HWND hwndConsole = NULL; +HWND commentDialog = NULL; +HWND moveHistoryDialog = NULL; HWND evalGraphDialog = NULL; -BOOLEAN evalGraphDialogUp = FALSE; - -WindowPlacement wpEvalGraph; - HWND engineOutputDialog = NULL; -BOOLEAN engineOutputDialogUp = FALSE; +HWND gameListDialog = NULL; +HWND editTagsDialog = NULL; +int commentUp = FALSE; + +WindowPlacement wpMain; +WindowPlacement wpConsole; +WindowPlacement wpComment; +WindowPlacement wpMoveHistory; +WindowPlacement wpEvalGraph; WindowPlacement wpEngineOutput; WindowPlacement wpGameList; -WindowPlacement wpConsole; - -VOID MoveHistoryPopUp(); -VOID MoveHistoryPopDown(); -VOID MoveHistorySet( char movelist[][2*MOVE_LEN], int first, int last, int current, ChessProgramStats_Move * pvInfo ); -BOOL MoveHistoryIsUp(); - -VOID EvalGraphSet( int first, int last, int current, ChessProgramStats_Move * pvInfo ); -VOID EvalGraphPopUp(); -VOID EvalGraphPopDown(); -BOOL EvalGraphIsUp(); - -VOID EngineOutputPopUp(); -VOID EngineOutputPopDown(); -BOOL EngineOutputIsUp(); -VOID EngineOutputUpdate( FrontEndProgramStats * stats ); +WindowPlacement wpTags; VOID EngineOptionsPopup(); // [HGM] settings @@ -734,6 +700,7 @@ InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine) char *filepart; hInst = hInstance; /* Store instance handle in our global variable */ + programName = szAppName; if (SearchPath(NULL, "WinBoard.exe", NULL, MSG_SIZ, installDir, &filepart)) { *filepart = NULLCHAR; @@ -743,6 +710,17 @@ InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine) gameInfo.boardWidth = gameInfo.boardHeight = 8; // [HGM] won't have open window otherwise screenWidth = screenHeight = 1000; // [HGM] placement: kludge to allow calling EnsureOnScreen from InitAppData InitAppData(lpCmdLine); /* Get run-time parameters */ + /* xboard, and older WinBoards, controlled the move sound with the + appData.ringBellAfterMoves option. In the current WinBoard, we + always turn the option on (so that the backend will call us), + then let the user turn the sound off by setting it to silence if + desired. To accommodate old winboard.ini files saved by old + versions of WinBoard, we also turn off the sound if the option + was initially set to false. [HGM] taken out of InitAppData */ + if (!appData.ringBellAfterMoves) { + sounds[(int)SoundMove].name = strdup(""); + appData.ringBellAfterMoves = TRUE; + } if (appData.debugMode) { debugFP = fopen(appData.nameOfDebugFile, "w"); setbuf(debugFP, NULL); @@ -861,15 +839,15 @@ InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine) InitBackEnd2(); /* Make the window visible; update its client area; and return "success" */ - EnsureOnScreen(&boardX, &boardY, minX, minY); + EnsureOnScreen(&wpMain.x, &wpMain.y, minX, minY); wp.length = sizeof(WINDOWPLACEMENT); wp.flags = 0; wp.showCmd = nCmdShow; wp.ptMaxPosition.x = wp.ptMaxPosition.y = 0; - wp.rcNormalPosition.left = boardX; - wp.rcNormalPosition.right = boardX + winWidth; - wp.rcNormalPosition.top = boardY; - wp.rcNormalPosition.bottom = boardY + winHeight; + wp.rcNormalPosition.left = wpMain.x; + wp.rcNormalPosition.right = wpMain.x + wpMain.width; + wp.rcNormalPosition.top = wpMain.y; + wp.rcNormalPosition.bottom = wpMain.y + wpMain.height; SetWindowPlacement(hwndMain, &wp); if(!appData.noGUI) SetWindowPos(hwndMain, alwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, @@ -889,579 +867,81 @@ InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine) } +VOID +InitMenuChecks() +{ + HMENU hmenu = GetMenu(hwndMain); -typedef enum { - ArgString, ArgInt, ArgFloat, ArgBoolean, ArgTrue, ArgFalse, ArgNone, - ArgColor, ArgAttribs, ArgFilename, ArgBoardSize, ArgFont, ArgCommSettings, - ArgSettingsFilename, - ArgX, ArgY, ArgZ // [HGM] placement: for window-placement options stored relative to main window -} ArgType; + (void) EnableMenuItem(hmenu, IDM_CommPort, + MF_BYCOMMAND|((appData.icsActive && + *appData.icsCommPort != NULLCHAR) ? + MF_ENABLED : MF_GRAYED)); + (void) CheckMenuItem(hmenu, IDM_SaveSettingsOnExit, + MF_BYCOMMAND|(saveSettingsOnExit ? + MF_CHECKED : MF_UNCHECKED)); +} -typedef struct { - char *argName; - ArgType argType; - /*** - union { - String *pString; // ArgString - int *pInt; // ArgInt - float *pFloat; // ArgFloat - Boolean *pBoolean; // ArgBoolean - COLORREF *pColor; // ArgColor - ColorClass cc; // ArgAttribs - String *pFilename; // ArgFilename - BoardSize *pBoardSize; // ArgBoardSize - int whichFont; // ArgFont - DCB *pDCB; // ArgCommSettings - String *pFilename; // ArgSettingsFilename - } argLoc; - ***/ - LPVOID argLoc; - BOOL save; -} ArgDescriptor; - -int junk; -ArgDescriptor argDescriptors[] = { - /* positional arguments */ - { "loadGameFile", ArgFilename, (LPVOID) &appData.loadGameFile, FALSE }, - { "", ArgNone, NULL }, - /* keyword arguments */ - JAWS_ARGS - { "whitePieceColor", ArgColor, (LPVOID) &whitePieceColor, TRUE }, - { "wpc", ArgColor, (LPVOID) &whitePieceColor, FALSE }, - { "blackPieceColor", ArgColor, (LPVOID) &blackPieceColor, TRUE }, - { "bpc", ArgColor, (LPVOID) &blackPieceColor, FALSE }, - { "lightSquareColor", ArgColor, (LPVOID) &lightSquareColor, TRUE }, - { "lsc", ArgColor, (LPVOID) &lightSquareColor, FALSE }, - { "darkSquareColor", ArgColor, (LPVOID) &darkSquareColor, TRUE }, - { "dsc", ArgColor, (LPVOID) &darkSquareColor, FALSE }, - { "highlightSquareColor", ArgColor, (LPVOID) &highlightSquareColor, TRUE }, - { "hsc", ArgColor, (LPVOID) &highlightSquareColor, FALSE }, - { "premoveHighlightColor", ArgColor, (LPVOID) &premoveHighlightColor, TRUE }, - { "phc", ArgColor, (LPVOID) &premoveHighlightColor, FALSE }, - { "movesPerSession", ArgInt, (LPVOID) &appData.movesPerSession, TRUE }, - { "mps", ArgInt, (LPVOID) &appData.movesPerSession, FALSE }, - { "initString", ArgString, (LPVOID) &appData.initString, FALSE }, - { "firstInitString", ArgString, (LPVOID) &appData.initString, FALSE }, - { "secondInitString", ArgString, (LPVOID) &appData.secondInitString, FALSE }, - { "firstComputerString", ArgString, (LPVOID) &appData.firstComputerString, - FALSE }, - { "secondComputerString", ArgString, (LPVOID) &appData.secondComputerString, - FALSE }, - { "firstChessProgram", ArgFilename, (LPVOID) &appData.firstChessProgram, - FALSE }, - { "fcp", ArgFilename, (LPVOID) &appData.firstChessProgram, FALSE }, - { "secondChessProgram", ArgFilename, (LPVOID) &appData.secondChessProgram, - FALSE }, - { "scp", ArgFilename, (LPVOID) &appData.secondChessProgram, FALSE }, - { "firstPlaysBlack", ArgBoolean, (LPVOID) &appData.firstPlaysBlack, FALSE }, - { "fb", ArgTrue, (LPVOID) &appData.firstPlaysBlack, FALSE }, - { "xfb", ArgFalse, (LPVOID) &appData.firstPlaysBlack, FALSE }, - { "-fb", ArgFalse, (LPVOID) &appData.firstPlaysBlack, FALSE }, - { "noChessProgram", ArgBoolean, (LPVOID) &appData.noChessProgram, FALSE }, - { "ncp", ArgTrue, (LPVOID) &appData.noChessProgram, FALSE }, - { "xncp", ArgFalse, (LPVOID) &appData.noChessProgram, FALSE }, - { "-ncp", ArgFalse, (LPVOID) &appData.noChessProgram, FALSE }, - { "firstHost", ArgString, (LPVOID) &appData.firstHost, FALSE }, - { "fh", ArgString, (LPVOID) &appData.firstHost, FALSE }, - { "secondHost", ArgString, (LPVOID) &appData.secondHost, FALSE }, - { "sh", ArgString, (LPVOID) &appData.secondHost, FALSE }, - { "firstDirectory", ArgFilename, (LPVOID) &appData.firstDirectory, FALSE }, - { "fd", ArgFilename, (LPVOID) &appData.firstDirectory, FALSE }, - { "secondDirectory", ArgFilename, (LPVOID) &appData.secondDirectory, FALSE }, - { "sd", ArgFilename, (LPVOID) &appData.secondDirectory, FALSE }, - /*!!bitmapDirectory?*/ - { "remoteShell", ArgFilename, (LPVOID) &appData.remoteShell, FALSE }, - { "rsh", ArgFilename, (LPVOID) &appData.remoteShell, FALSE }, - { "remoteUser", ArgString, (LPVOID) &appData.remoteUser, FALSE }, - { "ruser", ArgString, (LPVOID) &appData.remoteUser, FALSE }, - { "timeDelay", ArgFloat, (LPVOID) &appData.timeDelay, TRUE }, - { "td", ArgFloat, (LPVOID) &appData.timeDelay, FALSE }, - { "timeControl", ArgString, (LPVOID) &appData.timeControl, TRUE }, - { "tc", ArgString, (LPVOID) &appData.timeControl, FALSE }, - { "timeIncrement", ArgInt, (LPVOID) &appData.timeIncrement, TRUE }, - { "inc", ArgInt, (LPVOID) &appData.timeIncrement, FALSE }, - { "internetChessServerMode", ArgBoolean, (LPVOID) &appData.icsActive, FALSE }, - { "ics", ArgTrue, (LPVOID) &appData.icsActive, FALSE }, - { "xics", ArgFalse, (LPVOID) &appData.icsActive, FALSE }, - { "-ics", ArgFalse, (LPVOID) &appData.icsActive, FALSE }, - { "internetChessServerHost", ArgString, (LPVOID) &appData.icsHost, FALSE }, - { "icshost", ArgString, (LPVOID) &appData.icsHost, FALSE }, - { "internetChessServerPort", ArgString, (LPVOID) &appData.icsPort, FALSE }, - { "icsport", ArgString, (LPVOID) &appData.icsPort, FALSE }, - { "internetChessServerCommPort", ArgString, (LPVOID) &appData.icsCommPort, FALSE }, - { "icscomm", ArgString, (LPVOID) &appData.icsCommPort, FALSE }, - { "internetChessServerComPort", ArgString, (LPVOID) &appData.icsCommPort, FALSE }, - { "icscom", ArgString, (LPVOID) &appData.icsCommPort, FALSE }, - { "internetChessServerLogonScript", ArgFilename, (LPVOID) &appData.icsLogon, FALSE }, - { "icslogon", ArgFilename, (LPVOID) &appData.icsLogon, FALSE }, - { "useTelnet", ArgBoolean, (LPVOID) &appData.useTelnet, FALSE }, - { "telnet", ArgTrue, (LPVOID) &appData.useTelnet, FALSE }, - { "xtelnet", ArgFalse, (LPVOID) &appData.useTelnet, FALSE }, - { "-telnet", ArgFalse, (LPVOID) &appData.useTelnet, FALSE }, - { "telnetProgram", ArgFilename, (LPVOID) &appData.telnetProgram, FALSE }, - { "icshelper", ArgFilename, (LPVOID) &appData.icsHelper, FALSE }, - { "gateway", ArgString, (LPVOID) &appData.gateway, FALSE }, - { "loadGameFile", ArgFilename, (LPVOID) &appData.loadGameFile, FALSE }, - { "lgf", ArgFilename, (LPVOID) &appData.loadGameFile, FALSE }, - { "loadGameIndex", ArgInt, (LPVOID) &appData.loadGameIndex, FALSE }, - { "lgi", ArgInt, (LPVOID) &appData.loadGameIndex, FALSE }, - { "saveGameFile", ArgFilename, (LPVOID) &appData.saveGameFile, TRUE }, - { "sgf", ArgFilename, (LPVOID) &appData.saveGameFile, FALSE }, - { "autoSaveGames", ArgBoolean, (LPVOID) &appData.autoSaveGames, TRUE }, - { "autosave", ArgTrue, (LPVOID) &appData.autoSaveGames, FALSE }, - { "xautosave", ArgFalse, (LPVOID) &appData.autoSaveGames, FALSE }, - { "-autosave", ArgFalse, (LPVOID) &appData.autoSaveGames, FALSE }, - { "loadPositionFile", ArgFilename, (LPVOID) &appData.loadPositionFile, FALSE }, - { "lpf", ArgFilename, (LPVOID) &appData.loadPositionFile, FALSE }, - { "loadPositionIndex", ArgInt, (LPVOID) &appData.loadPositionIndex, FALSE }, - { "lpi", ArgInt, (LPVOID) &appData.loadPositionIndex, FALSE }, - { "savePositionFile", ArgFilename, (LPVOID) &appData.savePositionFile, FALSE }, - { "spf", ArgFilename, (LPVOID) &appData.savePositionFile, FALSE }, - { "matchMode", ArgBoolean, (LPVOID) &appData.matchMode, FALSE }, - { "mm", ArgTrue, (LPVOID) &appData.matchMode, FALSE }, - { "xmm", ArgFalse, (LPVOID) &appData.matchMode, FALSE }, - { "-mm", ArgFalse, (LPVOID) &appData.matchMode, FALSE }, - { "matchGames", ArgInt, (LPVOID) &appData.matchGames, FALSE }, - { "mg", ArgInt, (LPVOID) &appData.matchGames, FALSE }, - { "monoMode", ArgBoolean, (LPVOID) &appData.monoMode, TRUE }, - { "mono", ArgTrue, (LPVOID) &appData.monoMode, FALSE }, - { "xmono", ArgFalse, (LPVOID) &appData.monoMode, FALSE }, - { "-mono", ArgFalse, (LPVOID) &appData.monoMode, FALSE }, - { "debugMode", ArgBoolean, (LPVOID) &appData.debugMode, FALSE }, - { "debug", ArgTrue, (LPVOID) &appData.debugMode, FALSE }, - { "xdebug", ArgFalse, (LPVOID) &appData.debugMode, FALSE }, - { "-debug", ArgFalse, (LPVOID) &appData.debugMode, FALSE }, - { "clockMode", ArgBoolean, (LPVOID) &appData.clockMode, FALSE }, - { "clock", ArgTrue, (LPVOID) &appData.clockMode, FALSE }, - { "xclock", ArgFalse, (LPVOID) &appData.clockMode, FALSE }, - { "-clock", ArgFalse, (LPVOID) &appData.clockMode, FALSE }, - { "searchTime", ArgString, (LPVOID) &appData.searchTime, FALSE }, - { "st", ArgString, (LPVOID) &appData.searchTime, FALSE }, - { "searchDepth", ArgInt, (LPVOID) &appData.searchDepth, FALSE }, - { "depth", ArgInt, (LPVOID) &appData.searchDepth, FALSE }, - { "showCoords", ArgBoolean, (LPVOID) &appData.showCoords, TRUE }, - { "coords", ArgTrue, (LPVOID) &appData.showCoords, FALSE }, - { "xcoords", ArgFalse, (LPVOID) &appData.showCoords, FALSE }, - { "-coords", ArgFalse, (LPVOID) &appData.showCoords, FALSE }, - { "showThinking", ArgBoolean, (LPVOID) &appData.showThinking, TRUE }, - { "thinking", ArgTrue, (LPVOID) &appData.showThinking, FALSE }, - { "xthinking", ArgFalse, (LPVOID) &appData.showThinking, FALSE }, - { "-thinking", ArgFalse, (LPVOID) &appData.showThinking, FALSE }, - { "ponderNextMove", ArgBoolean, (LPVOID) &appData.ponderNextMove, TRUE }, - { "ponder", ArgTrue, (LPVOID) &appData.ponderNextMove, FALSE }, - { "xponder", ArgFalse, (LPVOID) &appData.ponderNextMove, FALSE }, - { "-ponder", ArgFalse, (LPVOID) &appData.ponderNextMove, FALSE }, - { "periodicUpdates", ArgBoolean, (LPVOID) &appData.periodicUpdates, TRUE }, - { "periodic", ArgTrue, (LPVOID) &appData.periodicUpdates, FALSE }, - { "xperiodic", ArgFalse, (LPVOID) &appData.periodicUpdates, FALSE }, - { "-periodic", ArgFalse, (LPVOID) &appData.periodicUpdates, FALSE }, - { "popupExitMessage", ArgBoolean, (LPVOID) &appData.popupExitMessage, TRUE }, - { "exit", ArgTrue, (LPVOID) &appData.popupExitMessage, FALSE }, - { "xexit", ArgFalse, (LPVOID) &appData.popupExitMessage, FALSE }, - { "-exit", ArgFalse, (LPVOID) &appData.popupExitMessage, FALSE }, - { "popupMoveErrors", ArgBoolean, (LPVOID) &appData.popupMoveErrors, TRUE }, - { "popup", ArgTrue, (LPVOID) &appData.popupMoveErrors, FALSE }, - { "xpopup", ArgFalse, (LPVOID) &appData.popupMoveErrors, FALSE }, - { "-popup", ArgFalse, (LPVOID) &appData.popupMoveErrors, FALSE }, - { "popUpErrors", ArgBoolean, (LPVOID) &appData.popupMoveErrors, - FALSE }, /* only so that old WinBoard.ini files from betas can be read */ - { "clockFont", ArgFont, (LPVOID) CLOCK_FONT, TRUE }, - { "messageFont", ArgFont, (LPVOID) MESSAGE_FONT, TRUE }, - { "coordFont", ArgFont, (LPVOID) COORD_FONT, TRUE }, - { "tagsFont", ArgFont, (LPVOID) EDITTAGS_FONT, TRUE }, - { "commentFont", ArgFont, (LPVOID) COMMENT_FONT, TRUE }, - { "icsFont", ArgFont, (LPVOID) CONSOLE_FONT, TRUE }, - { "moveHistoryFont", ArgFont, (LPVOID) MOVEHISTORY_FONT, TRUE }, /* [AS] */ - { "boardSize", ArgBoardSize, (LPVOID) &boardSize, - TRUE }, /* must come after all fonts */ - { "size", ArgBoardSize, (LPVOID) &boardSize, FALSE }, - { "ringBellAfterMoves", ArgBoolean, (LPVOID) &appData.ringBellAfterMoves, - FALSE }, /* historical; kept only so old winboard.ini files will parse */ - { "alwaysOnTop", ArgBoolean, (LPVOID) &alwaysOnTop, TRUE }, - { "top", ArgTrue, (LPVOID) &alwaysOnTop, FALSE }, - { "xtop", ArgFalse, (LPVOID) &alwaysOnTop, FALSE }, - { "-top", ArgFalse, (LPVOID) &alwaysOnTop, FALSE }, - { "autoCallFlag", ArgBoolean, (LPVOID) &appData.autoCallFlag, TRUE }, - { "autoflag", ArgTrue, (LPVOID) &appData.autoCallFlag, FALSE }, - { "xautoflag", ArgFalse, (LPVOID) &appData.autoCallFlag, FALSE }, - { "-autoflag", ArgFalse, (LPVOID) &appData.autoCallFlag, FALSE }, - { "autoComment", ArgBoolean, (LPVOID) &appData.autoComment, TRUE }, - { "autocomm", ArgTrue, (LPVOID) &appData.autoComment, FALSE }, - { "xautocomm", ArgFalse, (LPVOID) &appData.autoComment, FALSE }, - { "-autocomm", ArgFalse, (LPVOID) &appData.autoComment, FALSE }, - { "autoObserve", ArgBoolean, (LPVOID) &appData.autoObserve, TRUE }, - { "autobs", ArgTrue, (LPVOID) &appData.autoObserve, FALSE }, - { "xautobs", ArgFalse, (LPVOID) &appData.autoObserve, FALSE }, - { "-autobs", ArgFalse, (LPVOID) &appData.autoObserve, FALSE }, - { "flipView", ArgBoolean, (LPVOID) &appData.flipView, FALSE }, - { "flip", ArgTrue, (LPVOID) &appData.flipView, FALSE }, - { "xflip", ArgFalse, (LPVOID) &appData.flipView, FALSE }, - { "-flip", ArgFalse, (LPVOID) &appData.flipView, FALSE }, - { "autoFlipView", ArgBoolean, (LPVOID) &appData.autoFlipView, TRUE }, - { "autoflip", ArgTrue, (LPVOID) &appData.autoFlipView, FALSE }, - { "xautoflip", ArgFalse, (LPVOID) &appData.autoFlipView, FALSE }, - { "-autoflip", ArgFalse, (LPVOID) &appData.autoFlipView, FALSE }, - { "autoRaiseBoard", ArgBoolean, (LPVOID) &appData.autoRaiseBoard, TRUE }, - { "autoraise", ArgTrue, (LPVOID) &appData.autoRaiseBoard, FALSE }, - { "xautoraise", ArgFalse, (LPVOID) &appData.autoRaiseBoard, FALSE }, - { "-autoraise", ArgFalse, (LPVOID) &appData.autoRaiseBoard, FALSE }, - { "alwaysPromoteToQueen", ArgBoolean, (LPVOID) &appData.alwaysPromoteToQueen, TRUE }, - { "queen", ArgTrue, (LPVOID) &appData.alwaysPromoteToQueen, FALSE }, - { "xqueen", ArgFalse, (LPVOID) &appData.alwaysPromoteToQueen, FALSE }, - { "-queen", ArgFalse, (LPVOID) &appData.alwaysPromoteToQueen, FALSE }, - { "oldSaveStyle", ArgBoolean, (LPVOID) &appData.oldSaveStyle, TRUE }, - { "oldsave", ArgTrue, (LPVOID) &appData.oldSaveStyle, FALSE }, - { "xoldsave", ArgFalse, (LPVOID) &appData.oldSaveStyle, FALSE }, - { "-oldsave", ArgFalse, (LPVOID) &appData.oldSaveStyle, FALSE }, - { "quietPlay", ArgBoolean, (LPVOID) &appData.quietPlay, TRUE }, - { "quiet", ArgTrue, (LPVOID) &appData.quietPlay, FALSE }, - { "xquiet", ArgFalse, (LPVOID) &appData.quietPlay, FALSE }, - { "-quiet", ArgFalse, (LPVOID) &appData.quietPlay, FALSE }, - { "getMoveList", ArgBoolean, (LPVOID) &appData.getMoveList, TRUE }, - { "moves", ArgTrue, (LPVOID) &appData.getMoveList, FALSE }, - { "xmoves", ArgFalse, (LPVOID) &appData.getMoveList, FALSE }, - { "-moves", ArgFalse, (LPVOID) &appData.getMoveList, FALSE }, - { "testLegality", ArgBoolean, (LPVOID) &appData.testLegality, TRUE }, - { "legal", ArgTrue, (LPVOID) &appData.testLegality, FALSE }, - { "xlegal", ArgFalse, (LPVOID) &appData.testLegality, FALSE }, - { "-legal", ArgFalse, (LPVOID) &appData.testLegality, FALSE }, - { "premove", ArgBoolean, (LPVOID) &appData.premove, TRUE }, - { "pre", ArgTrue, (LPVOID) &appData.premove, FALSE }, - { "xpre", ArgFalse, (LPVOID) &appData.premove, FALSE }, - { "-pre", ArgFalse, (LPVOID) &appData.premove, FALSE }, - { "premoveWhite", ArgBoolean, (LPVOID) &appData.premoveWhite, TRUE }, - { "prewhite", ArgTrue, (LPVOID) &appData.premoveWhite, FALSE }, - { "xprewhite", ArgFalse, (LPVOID) &appData.premoveWhite, FALSE }, - { "-prewhite", ArgFalse, (LPVOID) &appData.premoveWhite, FALSE }, - { "premoveWhiteText", ArgString, (LPVOID) &appData.premoveWhiteText, TRUE }, - { "premoveBlack", ArgBoolean, (LPVOID) &appData.premoveBlack, TRUE }, - { "preblack", ArgTrue, (LPVOID) &appData.premoveBlack, FALSE }, - { "xpreblack", ArgFalse, (LPVOID) &appData.premoveBlack, FALSE }, - { "-preblack", ArgFalse, (LPVOID) &appData.premoveBlack, FALSE }, - { "premoveBlackText", ArgString, (LPVOID) &appData.premoveBlackText, TRUE }, - { "icsAlarm", ArgBoolean, (LPVOID) &appData.icsAlarm, TRUE}, - { "alarm", ArgTrue, (LPVOID) &appData.icsAlarm, FALSE}, - { "xalarm", ArgFalse, (LPVOID) &appData.icsAlarm, FALSE}, - { "-alarm", ArgFalse, (LPVOID) &appData.icsAlarm, FALSE}, - { "icsAlarmTime", ArgInt, (LPVOID) &appData.icsAlarmTime, TRUE}, - { "localLineEditing", ArgBoolean, (LPVOID) &appData.localLineEditing, FALSE}, - { "localLineEditing", ArgBoolean, (LPVOID) &appData.localLineEditing, FALSE}, - { "edit", ArgTrue, (LPVOID) &appData.localLineEditing, FALSE }, - { "xedit", ArgFalse, (LPVOID) &appData.localLineEditing, FALSE }, - { "-edit", ArgFalse, (LPVOID) &appData.localLineEditing, FALSE }, - { "animateMoving", ArgBoolean, (LPVOID) &appData.animate, TRUE }, - { "animate", ArgTrue, (LPVOID) &appData.animate, FALSE }, - { "xanimate", ArgFalse, (LPVOID) &appData.animate, FALSE }, - { "-animate", ArgFalse, (LPVOID) &appData.animate, FALSE }, - { "animateSpeed", ArgInt, (LPVOID) &appData.animSpeed, TRUE }, - { "animateDragging", ArgBoolean, (LPVOID) &appData.animateDragging, TRUE }, - { "drag", ArgTrue, (LPVOID) &appData.animateDragging, FALSE }, - { "xdrag", ArgFalse, (LPVOID) &appData.animateDragging, FALSE }, - { "-drag", ArgFalse, (LPVOID) &appData.animateDragging, FALSE }, - { "blindfold", ArgBoolean, (LPVOID) &appData.blindfold, TRUE }, - { "blind", ArgTrue, (LPVOID) &appData.blindfold, FALSE }, - { "xblind", ArgFalse, (LPVOID) &appData.blindfold, FALSE }, - { "-blind", ArgFalse, (LPVOID) &appData.blindfold, FALSE }, - { "highlightLastMove", ArgBoolean, - (LPVOID) &appData.highlightLastMove, TRUE }, - { "highlight", ArgTrue, (LPVOID) &appData.highlightLastMove, FALSE }, - { "xhighlight", ArgFalse, (LPVOID) &appData.highlightLastMove, FALSE }, - { "-highlight", ArgFalse, (LPVOID) &appData.highlightLastMove, FALSE }, - { "highlightDragging", ArgBoolean, - (LPVOID) &appData.highlightDragging, TRUE }, - { "highdrag", ArgTrue, (LPVOID) &appData.highlightDragging, FALSE }, - { "xhighdrag", ArgFalse, (LPVOID) &appData.highlightDragging, FALSE }, - { "-highdrag", ArgFalse, (LPVOID) &appData.highlightDragging, FALSE }, - { "colorizeMessages", ArgBoolean, (LPVOID) &appData.colorize, TRUE }, - { "colorize", ArgTrue, (LPVOID) &appData.colorize, FALSE }, - { "xcolorize", ArgFalse, (LPVOID) &appData.colorize, FALSE }, - { "-colorize", ArgFalse, (LPVOID) &appData.colorize, FALSE }, - { "colorShout", ArgAttribs, (LPVOID) ColorShout, TRUE }, - { "colorSShout", ArgAttribs, (LPVOID) ColorSShout, TRUE }, - { "colorChannel1", ArgAttribs, (LPVOID) ColorChannel1, TRUE }, - { "colorChannel", ArgAttribs, (LPVOID) ColorChannel, TRUE }, - { "colorKibitz", ArgAttribs, (LPVOID) ColorKibitz, TRUE }, - { "colorTell", ArgAttribs, (LPVOID) ColorTell, TRUE }, - { "colorChallenge", ArgAttribs, (LPVOID) ColorChallenge, TRUE }, - { "colorRequest", ArgAttribs, (LPVOID) ColorRequest, TRUE }, - { "colorSeek", ArgAttribs, (LPVOID) ColorSeek, TRUE }, - { "colorNormal", ArgAttribs, (LPVOID) ColorNormal, TRUE }, - { "colorBackground", ArgColor, (LPVOID) &consoleBackgroundColor, TRUE }, - { "soundShout", ArgFilename, - (LPVOID) &textAttribs[ColorShout].sound.name, TRUE }, - { "soundSShout", ArgFilename, - (LPVOID) &textAttribs[ColorSShout].sound.name, TRUE }, - { "soundChannel1", ArgFilename, - (LPVOID) &textAttribs[ColorChannel1].sound.name, TRUE }, - { "soundChannel", ArgFilename, - (LPVOID) &textAttribs[ColorChannel].sound.name, TRUE }, - { "soundKibitz", ArgFilename, - (LPVOID) &textAttribs[ColorKibitz].sound.name, TRUE }, - { "soundTell", ArgFilename, - (LPVOID) &textAttribs[ColorTell].sound.name, TRUE }, - { "soundChallenge", ArgFilename, - (LPVOID) &textAttribs[ColorChallenge].sound.name, TRUE }, - { "soundRequest", ArgFilename, - (LPVOID) &textAttribs[ColorRequest].sound.name, TRUE }, - { "soundSeek", ArgFilename, - (LPVOID) &textAttribs[ColorSeek].sound.name, TRUE }, - { "soundMove", ArgFilename, (LPVOID) &sounds[(int)SoundMove].name, TRUE }, - { "soundBell", ArgFilename, (LPVOID) &sounds[(int)SoundBell].name, TRUE }, - { "soundIcsWin", ArgFilename, (LPVOID) &sounds[(int)SoundIcsWin].name,TRUE }, - { "soundIcsLoss", ArgFilename, - (LPVOID) &sounds[(int)SoundIcsLoss].name, TRUE }, - { "soundIcsDraw", ArgFilename, - (LPVOID) &sounds[(int)SoundIcsDraw].name, TRUE }, - { "soundIcsUnfinished", ArgFilename, - (LPVOID) &sounds[(int)SoundIcsUnfinished].name, TRUE}, - { "soundIcsAlarm", ArgFilename, - (LPVOID) &sounds[(int)SoundAlarm].name, TRUE }, - { "reuseFirst", ArgBoolean, (LPVOID) &appData.reuseFirst, FALSE }, - { "reuse", ArgTrue, (LPVOID) &appData.reuseFirst, FALSE }, - { "xreuse", ArgFalse, (LPVOID) &appData.reuseFirst, FALSE }, - { "-reuse", ArgFalse, (LPVOID) &appData.reuseFirst, FALSE }, - { "reuseChessPrograms", ArgBoolean, - (LPVOID) &appData.reuseFirst, FALSE }, /* backward compat only */ - { "reuseSecond", ArgBoolean, (LPVOID) &appData.reuseSecond, FALSE }, - { "reuse2", ArgTrue, (LPVOID) &appData.reuseSecond, FALSE }, - { "xreuse2", ArgFalse, (LPVOID) &appData.reuseSecond, FALSE }, - { "-reuse2", ArgFalse, (LPVOID) &appData.reuseSecond, FALSE }, - { "comPortSettings", ArgCommSettings, (LPVOID) &dcb, TRUE }, - { "settingsFile", ArgSettingsFilename, (LPVOID) &settingsFileName, FALSE }, - { "ini", ArgSettingsFilename, (LPVOID) &settingsFileName, FALSE }, - { "saveSettingsOnExit", ArgBoolean, (LPVOID) &saveSettingsOnExit, TRUE }, - { "chessProgram", ArgBoolean, (LPVOID) &chessProgram, FALSE }, - { "cp", ArgTrue, (LPVOID) &chessProgram, FALSE }, - { "xcp", ArgFalse, (LPVOID) &chessProgram, FALSE }, - { "-cp", ArgFalse, (LPVOID) &chessProgram, FALSE }, - { "icsMenu", ArgString, (LPVOID) &icsTextMenuString, TRUE }, - { "icsNames", ArgString, (LPVOID) &icsNames, TRUE }, - { "firstChessProgramNames", ArgString, (LPVOID) &firstChessProgramNames, - TRUE }, - { "secondChessProgramNames", ArgString, (LPVOID) &secondChessProgramNames, - TRUE }, - { "initialMode", ArgString, (LPVOID) &appData.initialMode, FALSE }, - { "mode", ArgString, (LPVOID) &appData.initialMode, FALSE }, - { "variant", ArgString, (LPVOID) &appData.variant, FALSE }, - { "firstProtocolVersion", ArgInt, (LPVOID) &appData.firstProtocolVersion, FALSE }, - { "secondProtocolVersion", ArgInt, (LPVOID) &appData.secondProtocolVersion,FALSE }, - { "showButtonBar", ArgBoolean, (LPVOID) &appData.showButtonBar, TRUE }, - { "buttons", ArgTrue, (LPVOID) &appData.showButtonBar, FALSE }, - { "xbuttons", ArgFalse, (LPVOID) &appData.showButtonBar, FALSE }, - { "-buttons", ArgFalse, (LPVOID) &appData.showButtonBar, FALSE }, - /* [AS] New features */ - { "firstScoreAbs", ArgBoolean, (LPVOID) &appData.firstScoreIsAbsolute, FALSE }, - { "secondScoreAbs", ArgBoolean, (LPVOID) &appData.secondScoreIsAbsolute, FALSE }, - { "pgnExtendedInfo", ArgBoolean, (LPVOID) &appData.saveExtendedInfoInPGN, TRUE }, - { "hideThinkingFromHuman", ArgBoolean, (LPVOID) &appData.hideThinkingFromHuman, TRUE }, - { "liteBackTextureFile", ArgString, (LPVOID) &appData.liteBackTextureFile, TRUE }, - { "darkBackTextureFile", ArgString, (LPVOID) &appData.darkBackTextureFile, TRUE }, - { "liteBackTextureMode", ArgInt, (LPVOID) &appData.liteBackTextureMode, TRUE }, - { "darkBackTextureMode", ArgInt, (LPVOID) &appData.darkBackTextureMode, TRUE }, - { "renderPiecesWithFont", ArgString, (LPVOID) &appData.renderPiecesWithFont, TRUE }, - { "fontPieceToCharTable", ArgString, (LPVOID) &appData.fontToPieceTable, TRUE }, - { "fontPieceBackColorWhite", ArgColor, (LPVOID) &appData.fontBackColorWhite, TRUE }, - { "fontPieceForeColorWhite", ArgColor, (LPVOID) &appData.fontForeColorWhite, TRUE }, - { "fontPieceBackColorBlack", ArgColor, (LPVOID) &appData.fontBackColorBlack, TRUE }, - { "fontPieceForeColorBlack", ArgColor, (LPVOID) &appData.fontForeColorBlack, TRUE }, - { "fontPieceSize", ArgInt, (LPVOID) &appData.fontPieceSize, TRUE }, - { "overrideLineGap", ArgInt, (LPVOID) &appData.overrideLineGap, TRUE }, - { "adjudicateLossThreshold", ArgInt, (LPVOID) &appData.adjudicateLossThreshold, TRUE }, - { "delayBeforeQuit", ArgInt, (LPVOID) &appData.delayBeforeQuit, TRUE }, - { "delayAfterQuit", ArgInt, (LPVOID) &appData.delayAfterQuit, TRUE }, - { "nameOfDebugFile", ArgFilename, (LPVOID) &appData.nameOfDebugFile, FALSE }, - { "debugfile", ArgFilename, (LPVOID) &appData.nameOfDebugFile, FALSE }, - { "pgnEventHeader", ArgString, (LPVOID) &appData.pgnEventHeader, TRUE }, - { "defaultFrcPosition", ArgInt, (LPVOID) &appData.defaultFrcPosition, TRUE }, - { "gameListTags", ArgString, (LPVOID) &appData.gameListTags, TRUE }, - { "saveOutOfBookInfo", ArgBoolean, (LPVOID) &appData.saveOutOfBookInfo, TRUE }, - { "showEvalInMoveHistory", ArgBoolean, (LPVOID) &appData.showEvalInMoveHistory, TRUE }, - { "evalHistColorWhite", ArgColor, (LPVOID) &appData.evalHistColorWhite, TRUE }, - { "evalHistColorBlack", ArgColor, (LPVOID) &appData.evalHistColorBlack, TRUE }, - { "highlightMoveWithArrow", ArgBoolean, (LPVOID) &appData.highlightMoveWithArrow, TRUE }, - { "highlightArrowColor", ArgColor, (LPVOID) &appData.highlightArrowColor, TRUE }, - { "stickyWindows", ArgBoolean, (LPVOID) &appData.useStickyWindows, TRUE }, - { "adjudicateDrawMoves", ArgInt, (LPVOID) &appData.adjudicateDrawMoves, TRUE }, - { "autoDisplayComment", ArgBoolean, (LPVOID) &appData.autoDisplayComment, TRUE }, - { "autoDisplayTags", ArgBoolean, (LPVOID) &appData.autoDisplayTags, TRUE }, - { "firstIsUCI", ArgBoolean, (LPVOID) &appData.firstIsUCI, FALSE }, - { "fUCI", ArgTrue, (LPVOID) &appData.firstIsUCI, FALSE }, - { "secondIsUCI", ArgBoolean, (LPVOID) &appData.secondIsUCI, FALSE }, - { "sUCI", ArgTrue, (LPVOID) &appData.secondIsUCI, FALSE }, - { "firstHasOwnBookUCI", ArgBoolean, (LPVOID) &appData.firstHasOwnBookUCI, FALSE }, - { "fNoOwnBookUCI", ArgFalse, (LPVOID) &appData.firstHasOwnBookUCI, FALSE }, - { "firstXBook", ArgFalse, (LPVOID) &appData.firstHasOwnBookUCI, FALSE }, - { "secondHasOwnBookUCI", ArgBoolean, (LPVOID) &appData.secondHasOwnBookUCI, FALSE }, - { "sNoOwnBookUCI", ArgFalse, (LPVOID) &appData.secondHasOwnBookUCI, FALSE }, - { "secondXBook", ArgFalse, (LPVOID) &appData.secondHasOwnBookUCI, FALSE }, - { "polyglotDir", ArgFilename, (LPVOID) &appData.polyglotDir, TRUE }, - { "usePolyglotBook", ArgBoolean, (LPVOID) &appData.usePolyglotBook, TRUE }, - { "polyglotBook", ArgFilename, (LPVOID) &appData.polyglotBook, TRUE }, - { "defaultHashSize", ArgInt, (LPVOID) &appData.defaultHashSize, TRUE }, - { "defaultCacheSizeEGTB", ArgInt, (LPVOID) &appData.defaultCacheSizeEGTB, TRUE }, - { "defaultPathEGTB", ArgFilename, (LPVOID) &appData.defaultPathEGTB, TRUE }, - - /* [HGM] board-size, adjudication and misc. options */ - { "boardWidth", ArgInt, (LPVOID) &appData.NrFiles, TRUE }, - { "boardHeight", ArgInt, (LPVOID) &appData.NrRanks, TRUE }, - { "holdingsSize", ArgInt, (LPVOID) &appData.holdingsSize, TRUE }, - { "matchPause", ArgInt, (LPVOID) &appData.matchPause, TRUE }, - { "pieceToCharTable", ArgString, (LPVOID) &appData.pieceToCharTable, FALSE }, - { "flipBlack", ArgBoolean, (LPVOID) &appData.upsideDown, TRUE }, - { "allWhite", ArgBoolean, (LPVOID) &appData.allWhite, TRUE }, - { "alphaRank", ArgBoolean, (LPVOID) &appData.alphaRank, FALSE }, - { "firstAlphaRank", ArgBoolean, (LPVOID) &first.alphaRank, FALSE }, - { "secondAlphaRank", ArgBoolean, (LPVOID) &second.alphaRank, FALSE }, - { "testClaims", ArgBoolean, (LPVOID) &appData.testClaims, TRUE }, - { "checkMates", ArgBoolean, (LPVOID) &appData.checkMates, TRUE }, - { "materialDraws", ArgBoolean, (LPVOID) &appData.materialDraws, TRUE }, - { "trivialDraws", ArgBoolean, (LPVOID) &appData.trivialDraws, TRUE }, - { "ruleMoves", ArgInt, (LPVOID) &appData.ruleMoves, TRUE }, - { "repeatsToDraw", ArgInt, (LPVOID) &appData.drawRepeats, TRUE }, - { "autoKibitz", ArgTrue, (LPVOID) &appData.autoKibitz, FALSE }, - { "engineDebugOutput", ArgInt, (LPVOID) &appData.engineComments, FALSE }, - { "userName", ArgString, (LPVOID) &appData.userName, FALSE }, - { "rewindIndex", ArgInt, (LPVOID) &appData.rewindIndex, FALSE }, - { "sameColorGames", ArgInt, (LPVOID) &appData.sameColorGames, FALSE }, - { "smpCores", ArgInt, (LPVOID) &appData.smpCores, TRUE }, - { "egtFormats", ArgString, (LPVOID) &appData.egtFormats, TRUE }, - { "niceEngines", ArgInt, (LPVOID) &appData.niceEngines, TRUE }, - { "firstLogo", ArgFilename, (LPVOID) &appData.firstLogo, FALSE }, - { "secondLogo", ArgFilename, (LPVOID) &appData.secondLogo, FALSE }, - { "autoLogo", ArgBoolean, (LPVOID) &appData.autoLogo, TRUE }, - { "firstOptions", ArgString, (LPVOID) &appData.firstOptions, FALSE }, - { "secondOptions", ArgString, (LPVOID) &appData.secondOptions, FALSE }, - { "firstNeedsNoncompliantFEN", ArgString, (LPVOID) &appData.fenOverride1, FALSE }, - { "secondNeedsNoncompliantFEN", ArgString, (LPVOID) &appData.fenOverride2, FALSE }, - { "keepAlive", ArgInt, (LPVOID) &appData.keepAlive, FALSE }, - { "icstype", ArgInt, (LPVOID) &ics_type, FALSE }, - { "forceIllegalMoves", ArgTrue, (LPVOID) &appData.forceIllegal, FALSE }, +//--------------------------------------------------------------------------------------------------------- -#ifdef ZIPPY - { "zippyTalk", ArgBoolean, (LPVOID) &appData.zippyTalk, FALSE }, - { "zt", ArgTrue, (LPVOID) &appData.zippyTalk, FALSE }, - { "xzt", ArgFalse, (LPVOID) &appData.zippyTalk, FALSE }, - { "-zt", ArgFalse, (LPVOID) &appData.zippyTalk, FALSE }, - { "zippyPlay", ArgBoolean, (LPVOID) &appData.zippyPlay, FALSE }, - { "zp", ArgTrue, (LPVOID) &appData.zippyPlay, FALSE }, - { "xzp", ArgFalse, (LPVOID) &appData.zippyPlay, FALSE }, - { "-zp", ArgFalse, (LPVOID) &appData.zippyPlay, FALSE }, - { "zippyLines", ArgFilename, (LPVOID) &appData.zippyLines, FALSE }, - { "zippyPinhead", ArgString, (LPVOID) &appData.zippyPinhead, FALSE }, - { "zippyPassword", ArgString, (LPVOID) &appData.zippyPassword, FALSE }, - { "zippyPassword2", ArgString, (LPVOID) &appData.zippyPassword2, FALSE }, - { "zippyWrongPassword", ArgString, (LPVOID) &appData.zippyWrongPassword, - FALSE }, - { "zippyAcceptOnly", ArgString, (LPVOID) &appData.zippyAcceptOnly, FALSE }, - { "zippyUseI", ArgBoolean, (LPVOID) &appData.zippyUseI, FALSE }, - { "zui", ArgTrue, (LPVOID) &appData.zippyUseI, FALSE }, - { "xzui", ArgFalse, (LPVOID) &appData.zippyUseI, FALSE }, - { "-zui", ArgFalse, (LPVOID) &appData.zippyUseI, FALSE }, - { "zippyBughouse", ArgInt, (LPVOID) &appData.zippyBughouse, FALSE }, - { "zippyNoplayCrafty", ArgBoolean, (LPVOID) &appData.zippyNoplayCrafty, - FALSE }, - { "znc", ArgTrue, (LPVOID) &appData.zippyNoplayCrafty, FALSE }, - { "xznc", ArgFalse, (LPVOID) &appData.zippyNoplayCrafty, FALSE }, - { "-znc", ArgFalse, (LPVOID) &appData.zippyNoplayCrafty, FALSE }, - { "zippyGameEnd", ArgString, (LPVOID) &appData.zippyGameEnd, FALSE }, - { "zippyGameStart", ArgString, (LPVOID) &appData.zippyGameStart, FALSE }, - { "zippyAdjourn", ArgBoolean, (LPVOID) &appData.zippyAdjourn, FALSE }, - { "zadj", ArgTrue, (LPVOID) &appData.zippyAdjourn, FALSE }, - { "xzadj", ArgFalse, (LPVOID) &appData.zippyAdjourn, FALSE }, - { "-zadj", ArgFalse, (LPVOID) &appData.zippyAdjourn, FALSE }, - { "zippyAbort", ArgBoolean, (LPVOID) &appData.zippyAbort, FALSE }, - { "zab", ArgTrue, (LPVOID) &appData.zippyAbort, FALSE }, - { "xzab", ArgFalse, (LPVOID) &appData.zippyAbort, FALSE }, - { "-zab", ArgFalse, (LPVOID) &appData.zippyAbort, FALSE }, - { "zippyVariants", ArgString, (LPVOID) &appData.zippyVariants, FALSE }, - { "zippyMaxGames", ArgInt, (LPVOID)&appData.zippyMaxGames, FALSE }, - { "zippyReplayTimeout", ArgInt, (LPVOID)&appData.zippyReplayTimeout, FALSE }, - { "zippyShortGame", ArgInt, (LPVOID)&appData.zippyShortGame, FALSE }, - /* Kludge to allow winboard.ini files from buggy 4.0.4 to be read: */ - { "zippyReplyTimeout", ArgInt, (LPVOID)&junk, FALSE }, -#endif - /* [HGM] options for broadcasting and time odds */ - { "serverMoves", ArgString, (LPVOID) &appData.serverMovesName, FALSE }, - { "suppressLoadMoves", ArgBoolean, (LPVOID) &appData.suppressLoadMoves, FALSE }, - { "serverPause", ArgInt, (LPVOID) &appData.serverPause, FALSE }, - { "firstTimeOdds", ArgInt, (LPVOID) &appData.firstTimeOdds, FALSE }, - { "secondTimeOdds", ArgInt, (LPVOID) &appData.secondTimeOdds, FALSE }, - { "timeOddsMode", ArgInt, (LPVOID) &appData.timeOddsMode, TRUE }, - { "firstAccumulateTC", ArgInt, (LPVOID) &appData.firstAccumulateTC, FALSE }, - { "secondAccumulateTC", ArgInt, (LPVOID) &appData.secondAccumulateTC, FALSE }, - { "firstNPS", ArgInt, (LPVOID) &appData.firstNPS, FALSE }, - { "secondNPS", ArgInt, (LPVOID) &appData.secondNPS, FALSE }, - { "noGUI", ArgTrue, (LPVOID) &appData.noGUI, FALSE }, - { "keepLineBreaksICS", ArgBoolean, (LPVOID) &appData.noJoin, TRUE }, - { "wrapContinuationSequence", ArgString, (LPVOID) &appData.wrapContSeq, FALSE }, - { "useInternalWrap", ArgTrue, (LPVOID) &appData.useInternalWrap, FALSE }, /* noJoin usurps this if set */ - - // [HGM] placement: put all window layouts last in ini file, but man X,Y before all others - { "minX", ArgZ, (LPVOID) &minX, FALSE }, // [HGM] placement: to make suer auxialary windows can be placed - { "minY", ArgZ, (LPVOID) &minY, FALSE }, - { "winWidth", ArgInt, (LPVOID) &winWidth, TRUE }, // [HGM] placement: dummies to remember right & bottom - { "winHeight", ArgInt, (LPVOID) &winHeight, TRUE }, // for attaching auxiliary windows to them - { "x", ArgInt, (LPVOID) &boardX, TRUE }, - { "y", ArgInt, (LPVOID) &boardY, TRUE }, - { "icsX", ArgX, (LPVOID) &wpConsole.x, TRUE }, - { "icsY", ArgY, (LPVOID) &wpConsole.y, TRUE }, - { "icsW", ArgInt, (LPVOID) &wpConsole.width, TRUE }, - { "icsH", ArgInt, (LPVOID) &wpConsole.height, TRUE }, - { "analysisX", ArgX, (LPVOID) &analysisX, FALSE }, // [HGM] placement: analysis window no longer exists - { "analysisY", ArgY, (LPVOID) &analysisY, FALSE }, // provided for compatibility with old ini files - { "analysisW", ArgInt, (LPVOID) &analysisW, FALSE }, - { "analysisH", ArgInt, (LPVOID) &analysisH, FALSE }, - { "commentX", ArgX, (LPVOID) &commentX, TRUE }, - { "commentY", ArgY, (LPVOID) &commentY, TRUE }, - { "commentW", ArgInt, (LPVOID) &commentW, TRUE }, - { "commentH", ArgInt, (LPVOID) &commentH, TRUE }, - { "tagsX", ArgX, (LPVOID) &editTagsX, TRUE }, - { "tagsY", ArgY, (LPVOID) &editTagsY, TRUE }, - { "tagsW", ArgInt, (LPVOID) &editTagsW, TRUE }, - { "tagsH", ArgInt, (LPVOID) &editTagsH, TRUE }, - { "gameListX", ArgX, (LPVOID) &wpGameList.x, TRUE }, - { "gameListY", ArgY, (LPVOID) &wpGameList.y, TRUE }, - { "gameListW", ArgInt, (LPVOID) &wpGameList.width, TRUE }, - { "gameListH", ArgInt, (LPVOID) &wpGameList.height, TRUE }, - /* [AS] Layout stuff */ - { "moveHistoryUp", ArgBoolean, (LPVOID) &wpMoveHistory.visible, TRUE }, - { "moveHistoryX", ArgX, (LPVOID) &wpMoveHistory.x, TRUE }, - { "moveHistoryY", ArgY, (LPVOID) &wpMoveHistory.y, TRUE }, - { "moveHistoryW", ArgInt, (LPVOID) &wpMoveHistory.width, TRUE }, - { "moveHistoryH", ArgInt, (LPVOID) &wpMoveHistory.height, TRUE }, - - { "evalGraphUp", ArgBoolean, (LPVOID) &wpEvalGraph.visible, TRUE }, - { "evalGraphX", ArgX, (LPVOID) &wpEvalGraph.x, TRUE }, - { "evalGraphY", ArgY, (LPVOID) &wpEvalGraph.y, TRUE }, - { "evalGraphW", ArgInt, (LPVOID) &wpEvalGraph.width, TRUE }, - { "evalGraphH", ArgInt, (LPVOID) &wpEvalGraph.height, TRUE }, - - { "engineOutputUp", ArgBoolean, (LPVOID) &wpEngineOutput.visible, TRUE }, - { "engineOutputX", ArgX, (LPVOID) &wpEngineOutput.x, TRUE }, - { "engineOutputY", ArgY, (LPVOID) &wpEngineOutput.y, TRUE }, - { "engineOutputW", ArgInt, (LPVOID) &wpEngineOutput.width, TRUE }, - { "engineOutputH", ArgInt, (LPVOID) &wpEngineOutput.height, TRUE }, - - { NULL, ArgNone, NULL, FALSE } -}; +#define ICS_TEXT_MENU_SIZE (IDM_CommandXLast - IDM_CommandX + 1) +#define XBOARD FALSE +#define OPTCHAR "/" +#define SEPCHAR "=" -/* Kludge for indirection files on command line */ -char* lastIndirectionFilename; -ArgDescriptor argDescriptorIndirection = -{ "", ArgSettingsFilename, (LPVOID) NULL, FALSE }; +#include "args.h" +// front-end part of option handling VOID -ExitArgError(char *msg, char *badArg) +LFfromMFP(LOGFONT* lf, MyFontParams *mfp) { - char buf[MSG_SIZ]; + HDC hdc = CreateDC("DISPLAY", NULL, NULL, NULL); + lf->lfHeight = -(int)(mfp->pointSize * GetDeviceCaps(hdc, LOGPIXELSY) / 72.0 + 0.5); + DeleteDC(hdc); + lf->lfWidth = 0; + lf->lfEscapement = 0; + lf->lfOrientation = 0; + lf->lfWeight = mfp->bold ? FW_BOLD : FW_NORMAL; + lf->lfItalic = mfp->italic; + lf->lfUnderline = mfp->underline; + lf->lfStrikeOut = mfp->strikeout; + lf->lfCharSet = mfp->charset; + lf->lfOutPrecision = OUT_DEFAULT_PRECIS; + lf->lfClipPrecision = CLIP_DEFAULT_PRECIS; + lf->lfQuality = DEFAULT_QUALITY; + lf->lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE; + strcpy(lf->lfFaceName, mfp->faceName); +} - sprintf(buf, "%s %s", msg, badArg); - DisplayFatalError(buf, 0, 2); - exit(2); +void +CreateFontInMF(MyFont *mf) +{ + LFfromMFP(&mf->lf, &mf->mfp); + if (mf->hf) DeleteObject(mf->hf); + mf->hf = CreateFontIndirect(&mf->lf); } +// [HGM] This platform-dependent table provides the location for storing the color info +void * +colorVariable[] = { + &whitePieceColor, + &blackPieceColor, + &lightSquareColor, + &darkSquareColor, + &highlightSquareColor, + &premoveHighlightColor, + NULL, + &consoleBackgroundColor, + &appData.fontForeColorWhite, + &appData.fontBackColorWhite, + &appData.fontForeColorBlack, + &appData.fontBackColorBlack, + &appData.evalHistColorWhite, + &appData.evalHistColorBlack, + &appData.highlightArrowColor, +}; + /* Command line font name parser. NULL name means do nothing. Syntax like "Courier New:10.0 bi" or "Arial:10" or "Arial:10b" For backward compatibility, syntax without the colon is also @@ -1502,6 +982,36 @@ ParseFontName(char *name, MyFontParams *mfp) mfp->charset = (BYTE) atoi(q+1); } +void +ParseFont(char *name, int number) +{ // wrapper to shield back-end from 'font' + ParseFontName(name, &font[boardSize][number]->mfp); +} + +void +SetFontDefaults() +{ // in WB we have a 2D array of fonts; this initializes their description + int i, j; + /* Point font array elements to structures and + parse default font names */ + for (i=0; idef, &font[j][i]->mfp); + } + } +} + +void +CreateFonts() +{ // here we create the actual fonts from the selected descriptions + int i, j; + for (i=0; iargName != NULL; ad++) - if (strcmp(ad->argName, argName + 1) == 0) break; - - if (ad->argName == NULL) - ExitArgError("Unrecognized argument", argName); - - } else if (ch == '@') { - /* Indirection file */ - ad = &argDescriptorIndirection; - ch = get(cl); - } else { - /* Positional argument */ - ad = &argDescriptors[posarg++]; - strcpy(argName, ad->argName); - } - - if (ad->argType == ArgTrue) { - *(Boolean *) ad->argLoc = TRUE; - continue; - } - if (ad->argType == ArgFalse) { - *(Boolean *) ad->argLoc = FALSE; - continue; - } - - while (ch == ' ' || ch == '=' || ch == ':' || ch == '\t') ch = get(cl); - if (ch == NULLCHAR || ch == '\n') { - ExitArgError("No value provided for argument", argName); - } - q = argValue; - if (ch == '{') { - // Quoting with { }. No characters have to (or can) be escaped. - // Thus the string cannot contain a '}' character. - start = ch; - ch = get(cl); - while (start) { - switch (ch) { - case NULLCHAR: - start = NULLCHAR; - break; - - case '}': - ch = get(cl); - start = NULLCHAR; - break; - - default: - *q++ = ch; - ch = get(cl); - break; - } - } - } else if (ch == '\'' || ch == '"') { - // Quoting with ' ' or " ", with \ as escape character. - // Inconvenient for long strings that may contain Windows filenames. - start = ch; - ch = get(cl); - while (start) { - switch (ch) { - case NULLCHAR: - start = NULLCHAR; - break; - - default: - not_special: - *q++ = ch; - ch = get(cl); - break; - - case '\'': - case '\"': - if (ch == start) { - ch = get(cl); - start = NULLCHAR; - break; - } else { - goto not_special; - } - - case '\\': - if (ad->argType == ArgFilename - || ad->argType == ArgSettingsFilename) { - goto not_special; - } - ch = get(cl); - switch (ch) { - case NULLCHAR: - ExitArgError("Incomplete \\ escape in value for", argName); - break; - case 'n': - *q++ = '\n'; - ch = get(cl); - break; - case 'r': - *q++ = '\r'; - ch = get(cl); - break; - case 't': - *q++ = '\t'; - ch = get(cl); - break; - case 'b': - *q++ = '\b'; - ch = get(cl); - break; - case 'f': - *q++ = '\f'; - ch = get(cl); - break; - default: - octval = 0; - for (i = 0; i < 3; i++) { - if (ch >= '0' && ch <= '7') { - octval = octval*8 + (ch - '0'); - ch = get(cl); - } else { - break; - } - } - if (i > 0) { - *q++ = (char) octval; - } else { - *q++ = ch; - ch = get(cl); - } - break; - } - break; - } - } - } else { - while (ch != ' ' && ch != NULLCHAR && ch != '\t' && ch != '\n') { - *q++ = ch; - ch = get(cl); - } - } - *q = NULLCHAR; - - switch (ad->argType) { - case ArgInt: - *(int *) ad->argLoc = atoi(argValue); - break; - - case ArgX: - *(int *) ad->argLoc = atoi(argValue) + boardX; // [HGM] placement: translate stored relative to absolute - break; - - case ArgY: - *(int *) ad->argLoc = atoi(argValue) + boardY; // (this is really kludgey, it should be done where used...) - break; - - case ArgZ: - *(int *) ad->argLoc = atoi(argValue); - EnsureOnScreen(&boardX, &boardY, minX, minY); - break; - - case ArgFloat: - *(float *) ad->argLoc = (float) atof(argValue); - break; - - case ArgString: - case ArgFilename: - *(char **) ad->argLoc = strdup(argValue); - break; - - case ArgSettingsFilename: - { - char fullname[MSG_SIZ]; - if (ParseSettingsFile(argValue, fullname)) { - if (ad->argLoc != NULL) { - *(char **) ad->argLoc = strdup(fullname); - } - } else { - if (ad->argLoc != NULL) { - } else { - ExitArgError("Failed to open indirection file", argValue); - } - } - } - break; - - case ArgBoolean: - switch (argValue[0]) { - case 't': - case 'T': - *(Boolean *) ad->argLoc = TRUE; - break; - case 'f': - case 'F': - *(Boolean *) ad->argLoc = FALSE; - break; - default: - ExitArgError("Unrecognized boolean argument value", argValue); - break; - } - break; - - case ArgColor: - *(COLORREF *)ad->argLoc = ParseColorName(argValue); - break; - - case ArgAttribs: { - ColorClass cc = (ColorClass)ad->argLoc; - ParseAttribs(&textAttribs[cc].color, &textAttribs[cc].effects, argValue); - } - break; - - case ArgBoardSize: - *(BoardSize *)ad->argLoc = ParseBoardSize(argValue); - break; - - case ArgFont: - ParseFontName(argValue, &font[boardSize][(int)ad->argLoc]->mfp); - break; - - case ArgCommSettings: - ParseCommSettings(argValue, &dcb); - break; - - case ArgNone: - ExitArgError("Unrecognized argument", argValue); - break; - case ArgTrue: - case ArgFalse: ; - } - } -} - -VOID -LFfromMFP(LOGFONT* lf, MyFontParams *mfp) -{ - HDC hdc = CreateDC("DISPLAY", NULL, NULL, NULL); - lf->lfHeight = -(int)(mfp->pointSize * GetDeviceCaps(hdc, LOGPIXELSY) / 72.0 + 0.5); - DeleteDC(hdc); - lf->lfWidth = 0; - lf->lfEscapement = 0; - lf->lfOrientation = 0; - lf->lfWeight = mfp->bold ? FW_BOLD : FW_NORMAL; - lf->lfItalic = mfp->italic; - lf->lfUnderline = mfp->underline; - lf->lfStrikeOut = mfp->strikeout; - lf->lfCharSet = mfp->charset; - lf->lfOutPrecision = OUT_DEFAULT_PRECIS; - lf->lfClipPrecision = CLIP_DEFAULT_PRECIS; - lf->lfQuality = DEFAULT_QUALITY; - lf->lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE; - strcpy(lf->lfFaceName, mfp->faceName); -} - -VOID -CreateFontInMF(MyFont *mf) -{ - LFfromMFP(&mf->lf, &mf->mfp); - if (mf->hf) DeleteObject(mf->hf); - mf->hf = CreateFontIndirect(&mf->lf); -} - -VOID -SetDefaultTextAttribs() -{ - ColorClass cc; - for (cc = (ColorClass)0; cc < NColorClasses; cc++) { - ParseAttribs(&textAttribs[cc].color, - &textAttribs[cc].effects, - defaultTextAttribs[cc]); - } -} - -VOID -SetDefaultSounds() -{ +void +LoadAllSounds() +{ // [HGM] import name from appData first ColorClass cc; SoundClass sc; - for (cc = (ColorClass)0; cc < NColorClasses; cc++) { + for (cc = (ColorClass)0; cc < ColorNormal; cc++) { + textAttribs[cc].sound.name = strdup((&appData.soundShout)[cc]); + textAttribs[cc].sound.data = NULL; + MyLoadSound(&textAttribs[cc].sound); + } + for (cc = ColorNormal; cc < NColorClasses; cc++) { textAttribs[cc].sound.name = strdup(""); textAttribs[cc].sound.data = NULL; } for (sc = (SoundClass)0; sc < NSoundClasses; sc++) { - sounds[sc].name = strdup(""); + sounds[sc].name = strdup((&appData.soundMove)[sc]); sounds[sc].data = NULL; - } - sounds[(int)SoundBell].name = strdup(SOUND_BELL); -} - -VOID -LoadAllSounds() -{ - ColorClass cc; - SoundClass sc; - for (cc = (ColorClass)0; cc < NColorClasses; cc++) { - MyLoadSound(&textAttribs[cc].sound); - } - for (sc = (SoundClass)0; sc < NSoundClasses; sc++) { MyLoadSound(&sounds[sc]); } } -VOID -InitAppData(LPSTR lpCmdLine) +void +SetCommPortDefaults() { - int i, j; - char buf[ARG_MAX], currDir[MSG_SIZ]; - char *dummy, *p; - - programName = szAppName; - - /* Initialize to defaults */ - lightSquareColor = ParseColorName(LIGHT_SQUARE_COLOR); - darkSquareColor = ParseColorName(DARK_SQUARE_COLOR); - whitePieceColor = ParseColorName(WHITE_PIECE_COLOR); - blackPieceColor = ParseColorName(BLACK_PIECE_COLOR); - highlightSquareColor = ParseColorName(HIGHLIGHT_SQUARE_COLOR); - premoveHighlightColor = ParseColorName(PREMOVE_HIGHLIGHT_COLOR); - consoleBackgroundColor = ParseColorName(COLOR_BKGD); - SetDefaultTextAttribs(); - SetDefaultSounds(); - appData.movesPerSession = MOVES_PER_SESSION; - appData.initString = INIT_STRING; - appData.secondInitString = INIT_STRING; - appData.firstComputerString = COMPUTER_STRING; - appData.secondComputerString = COMPUTER_STRING; - appData.firstChessProgram = FIRST_CHESS_PROGRAM; - appData.secondChessProgram = SECOND_CHESS_PROGRAM; - appData.firstPlaysBlack = FALSE; - appData.noChessProgram = FALSE; - chessProgram = FALSE; - appData.firstHost = FIRST_HOST; - appData.secondHost = SECOND_HOST; - appData.firstDirectory = FIRST_DIRECTORY; - appData.secondDirectory = SECOND_DIRECTORY; - appData.bitmapDirectory = ""; - appData.remoteShell = REMOTE_SHELL; - appData.remoteUser = ""; - appData.timeDelay = TIME_DELAY; - appData.timeControl = TIME_CONTROL; - appData.timeIncrement = TIME_INCREMENT; - appData.icsActive = FALSE; - appData.icsHost = ""; - appData.icsPort = ICS_PORT; - appData.icsCommPort = ICS_COMM_PORT; - appData.icsLogon = ICS_LOGON; - appData.icsHelper = ""; - appData.useTelnet = FALSE; - appData.telnetProgram = TELNET_PROGRAM; - appData.gateway = ""; - appData.loadGameFile = ""; - appData.loadGameIndex = 0; - appData.saveGameFile = ""; - appData.autoSaveGames = FALSE; - appData.loadPositionFile = ""; - appData.loadPositionIndex = 1; - appData.savePositionFile = ""; - appData.matchMode = FALSE; - appData.matchGames = 0; - appData.monoMode = FALSE; - appData.debugMode = FALSE; - appData.clockMode = TRUE; - boardSize = (BoardSize) -1; /* determine by screen size */ - appData.Iconic = FALSE; /*unused*/ - appData.searchTime = ""; - appData.searchDepth = 0; - appData.showCoords = FALSE; - appData.ringBellAfterMoves = TRUE; /*obsolete in WinBoard*/ - appData.autoCallFlag = FALSE; - appData.flipView = FALSE; - appData.autoFlipView = TRUE; - appData.cmailGameName = ""; - appData.alwaysPromoteToQueen = FALSE; - appData.oldSaveStyle = FALSE; - appData.quietPlay = FALSE; - appData.showThinking = FALSE; - appData.ponderNextMove = TRUE; - appData.periodicUpdates = TRUE; - appData.popupExitMessage = TRUE; - appData.popupMoveErrors = FALSE; - appData.autoObserve = FALSE; - appData.autoComment = FALSE; - appData.animate = TRUE; - appData.animSpeed = 10; - appData.animateDragging = TRUE; - appData.highlightLastMove = TRUE; - appData.getMoveList = TRUE; - appData.testLegality = TRUE; - appData.premove = TRUE; - appData.premoveWhite = FALSE; - appData.premoveWhiteText = ""; - appData.premoveBlack = FALSE; - appData.premoveBlackText = ""; - appData.icsAlarm = TRUE; - appData.icsAlarmTime = 5000; - appData.autoRaiseBoard = TRUE; - appData.localLineEditing = TRUE; - appData.colorize = TRUE; - appData.reuseFirst = TRUE; - appData.reuseSecond = TRUE; - appData.blindfold = FALSE; - appData.icsEngineAnalyze = FALSE; - memset(&dcb, 0, sizeof(DCB)); // required by VS 2002 + + memset(&dcb, 0, sizeof(DCB)); // required by VS 2002 + dcb.DCBlength = sizeof(DCB); dcb.BaudRate = 9600; dcb.fBinary = TRUE; @@ -2048,451 +1121,14 @@ InitAppData(LPSTR lpCmdLine) dcb.ByteSize = 7; dcb.Parity = SPACEPARITY; dcb.StopBits = ONESTOPBIT; - settingsFileName = SETTINGS_FILE; - saveSettingsOnExit = TRUE; - boardX = CW_USEDEFAULT; - boardY = CW_USEDEFAULT; - analysisX = CW_USEDEFAULT; - analysisY = CW_USEDEFAULT; - analysisW = CW_USEDEFAULT; - analysisH = CW_USEDEFAULT; - commentX = CW_USEDEFAULT; - commentY = CW_USEDEFAULT; - commentW = CW_USEDEFAULT; - commentH = CW_USEDEFAULT; - editTagsX = CW_USEDEFAULT; - editTagsY = CW_USEDEFAULT; - editTagsW = CW_USEDEFAULT; - editTagsH = CW_USEDEFAULT; - icsTextMenuString = ICS_TEXT_MENU_DEFAULT; - icsNames = ICS_NAMES; - firstChessProgramNames = FCP_NAMES; - secondChessProgramNames = SCP_NAMES; - appData.initialMode = ""; - appData.variant = "normal"; - appData.firstProtocolVersion = PROTOVER; - appData.secondProtocolVersion = PROTOVER; - appData.showButtonBar = TRUE; - - /* [AS] New properties (see comments in header file) */ - appData.firstScoreIsAbsolute = FALSE; - appData.secondScoreIsAbsolute = FALSE; - appData.saveExtendedInfoInPGN = FALSE; - appData.hideThinkingFromHuman = FALSE; - appData.liteBackTextureFile = ""; - appData.liteBackTextureMode = BACK_TEXTURE_MODE_PLAIN; - appData.darkBackTextureFile = ""; - appData.darkBackTextureMode = BACK_TEXTURE_MODE_PLAIN; - appData.renderPiecesWithFont = ""; - appData.fontToPieceTable = ""; - appData.fontBackColorWhite = 0; - appData.fontForeColorWhite = 0; - appData.fontBackColorBlack = 0; - appData.fontForeColorBlack = 0; - appData.fontPieceSize = 80; - appData.overrideLineGap = 1; - appData.adjudicateLossThreshold = 0; - appData.delayBeforeQuit = 0; - appData.delayAfterQuit = 0; - appData.nameOfDebugFile = "winboard.debug"; - appData.pgnEventHeader = "Computer Chess Game"; - appData.defaultFrcPosition = -1; - appData.gameListTags = GLT_DEFAULT_TAGS; - appData.saveOutOfBookInfo = TRUE; - appData.showEvalInMoveHistory = TRUE; - appData.evalHistColorWhite = ParseColorName( "#FFFFB0" ); - appData.evalHistColorBlack = ParseColorName( "#AD5D3D" ); - appData.highlightMoveWithArrow = FALSE; - appData.highlightArrowColor = ParseColorName( "#FFFF80" ); - appData.useStickyWindows = TRUE; - appData.adjudicateDrawMoves = 0; - appData.autoDisplayComment = TRUE; - appData.autoDisplayTags = TRUE; - appData.firstIsUCI = FALSE; - appData.secondIsUCI = FALSE; - appData.firstHasOwnBookUCI = TRUE; - appData.secondHasOwnBookUCI = TRUE; - appData.polyglotDir = ""; - appData.usePolyglotBook = FALSE; - appData.polyglotBook = ""; - appData.defaultHashSize = 64; - appData.defaultCacheSizeEGTB = 4; - appData.defaultPathEGTB = "c:\\egtb"; - appData.firstOptions = ""; - appData.secondOptions = ""; - - InitWindowPlacement( &wpGameList ); - InitWindowPlacement( &wpMoveHistory ); - InitWindowPlacement( &wpEvalGraph ); - InitWindowPlacement( &wpEngineOutput ); - InitWindowPlacement( &wpConsole ); - - /* [HGM] User-selectable board size, adjudication control, miscellaneous */ - appData.NrFiles = -1; - appData.NrRanks = -1; - appData.holdingsSize = -1; - appData.testClaims = FALSE; - appData.checkMates = FALSE; - appData.materialDraws= FALSE; - appData.trivialDraws = FALSE; - appData.ruleMoves = 51; - appData.drawRepeats = 6; - appData.matchPause = 10000; - appData.alphaRank = FALSE; - appData.allWhite = FALSE; - appData.upsideDown = FALSE; - appData.serverPause = 15; - appData.serverMovesName = NULL; - appData.suppressLoadMoves = FALSE; - appData.firstTimeOdds = 1; - appData.secondTimeOdds = 1; - appData.firstAccumulateTC = 1; // combine previous and current sessions - appData.secondAccumulateTC = 1; - appData.firstNPS = -1; // [HGM] nps: use wall-clock time - appData.secondNPS = -1; - appData.engineComments = 1; - appData.smpCores = 1; // [HGM] SMP: max nr of cores - appData.egtFormats = ""; - -#ifdef ZIPPY - appData.zippyTalk = ZIPPY_TALK; - appData.zippyPlay = ZIPPY_PLAY; - appData.zippyLines = ZIPPY_LINES; - appData.zippyPinhead = ZIPPY_PINHEAD; - appData.zippyPassword = ZIPPY_PASSWORD; - appData.zippyPassword2 = ZIPPY_PASSWORD2; - appData.zippyWrongPassword = ZIPPY_WRONG_PASSWORD; - appData.zippyAcceptOnly = ZIPPY_ACCEPT_ONLY; - appData.zippyUseI = ZIPPY_USE_I; - appData.zippyBughouse = ZIPPY_BUGHOUSE; - appData.zippyNoplayCrafty = ZIPPY_NOPLAY_CRAFTY; - appData.zippyGameEnd = ZIPPY_GAME_END; - appData.zippyGameStart = ZIPPY_GAME_START; - appData.zippyAdjourn = ZIPPY_ADJOURN; - appData.zippyAbort = ZIPPY_ABORT; - appData.zippyVariants = ZIPPY_VARIANTS; - appData.zippyMaxGames = ZIPPY_MAX_GAMES; - appData.zippyReplayTimeout = ZIPPY_REPLAY_TIMEOUT; -#endif - - /* Point font array elements to structures and - parse default font names */ - for (i=0; idef, &font[j][i]->mfp); - } - } - - /* Parse default settings file if any */ - if (ParseSettingsFile(settingsFileName, buf)) { - settingsFileName = strdup(buf); - } - - /* Parse command line */ - ParseArgs(StringGet, &lpCmdLine); - - /* [HGM] make sure board size is acceptable */ - if(appData.NrFiles > BOARD_SIZE || - appData.NrRanks > BOARD_SIZE ) - DisplayFatalError("Recompile with BOARD_SIZE > 12, to support this size", 0, 2); - - /* [HGM] After parsing the options from the .ini file, and overruling them - * with options from the command line, we now make an even higher priority - * overrule by WB options attached to the engine command line. This so that - * tournament managers can use WB options (such as /timeOdds) that follow - * the engines. - */ - if(appData.firstChessProgram != NULL) { - char *p = StrStr(appData.firstChessProgram, "WBopt"); - static char *f = "first"; - char buf[MSG_SIZ], *q = buf; - if(p != NULL) { // engine command line contains WinBoard options - sprintf(buf, p+6, f, f, f, f, f, f, f, f, f, f); // replace %s in them by "first" - ParseArgs(StringGet, &q); - p[-1] = 0; // cut them offengine command line - } - } - // now do same for second chess program - if(appData.secondChessProgram != NULL) { - char *p = StrStr(appData.secondChessProgram, "WBopt"); - static char *s = "second"; - char buf[MSG_SIZ], *q = buf; - if(p != NULL) { // engine command line contains WinBoard options - sprintf(buf, p+6, s, s, s, s, s, s, s, s, s, s); // replace %s in them by "first" - ParseArgs(StringGet, &q); - p[-1] = 0; // cut them offengine command line - } - } - - - /* Propagate options that affect others */ - if (appData.matchMode || appData.matchGames) chessProgram = TRUE; - if (appData.icsActive || appData.noChessProgram) { - chessProgram = FALSE; /* not local chess program mode */ - } - - /* Open startup dialog if needed */ - if ((!appData.noChessProgram && !chessProgram && !appData.icsActive) || - (appData.icsActive && *appData.icsHost == NULLCHAR) || - (chessProgram && (*appData.firstChessProgram == NULLCHAR || - *appData.secondChessProgram == NULLCHAR))) { - FARPROC lpProc; - - lpProc = MakeProcInstance((FARPROC)StartupDialog, hInst); - DialogBox(hInst, MAKEINTRESOURCE(DLG_Startup), NULL, (DLGPROC)lpProc); - FreeProcInstance(lpProc); - } - - /* Make sure save files land in the right (?) directory */ - if (GetFullPathName(appData.saveGameFile, MSG_SIZ, buf, &dummy)) { - appData.saveGameFile = strdup(buf); - } - if (GetFullPathName(appData.savePositionFile, MSG_SIZ, buf, &dummy)) { - appData.savePositionFile = strdup(buf); - } - - /* Finish initialization for fonts and sounds */ - for (i=0; iargName != NULL; ad++) { - if (!ad->save) continue; - switch (ad->argType) { - case ArgString: - { - char *p = *(char **)ad->argLoc; - if ((strchr(p, '\\') || strchr(p, '\n')) && !strchr(p, '}')) { - /* Quote multiline values or \-containing values - with { } if possible */ - fprintf(f, "/%s={%s}\n", ad->argName, p); - } else { - /* Else quote with " " */ - fprintf(f, "/%s=\"", ad->argName); - while (*p) { - if (*p == '\n') fprintf(f, "\n"); - else if (*p == '\r') fprintf(f, "\\r"); - else if (*p == '\t') fprintf(f, "\\t"); - else if (*p == '\b') fprintf(f, "\\b"); - else if (*p == '\f') fprintf(f, "\\f"); - else if (*p < ' ') fprintf(f, "\\%03o", *p); - else if (*p == '\"') fprintf(f, "\\\""); - else if (*p == '\\') fprintf(f, "\\\\"); - else putc(*p, f); - p++; - } - fprintf(f, "\"\n"); - } - } - break; - case ArgInt: - case ArgZ: - fprintf(f, "/%s=%d\n", ad->argName, *(int *)ad->argLoc); - break; - case ArgX: - fprintf(f, "/%s=%d\n", ad->argName, *(int *)ad->argLoc - boardX); // [HGM] placement: stor relative value - break; - case ArgY: - fprintf(f, "/%s=%d\n", ad->argName, *(int *)ad->argLoc - boardY); - 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: - { - COLORREF color = *(COLORREF *)ad->argLoc; - fprintf(f, "/%s=#%02lx%02lx%02lx\n", ad->argName, - color&0xff, (color>>8)&0xff, (color>>16)&0xff); - } - break; - case ArgAttribs: - { - MyTextAttribs* ta = &textAttribs[(ColorClass)ad->argLoc]; - fprintf(f, "/%s=\"%s%s%s%s%s#%02lx%02lx%02lx\"\n", ad->argName, - (ta->effects & CFE_BOLD) ? "b" : "", - (ta->effects & CFE_ITALIC) ? "i" : "", - (ta->effects & CFE_UNDERLINE) ? "u" : "", - (ta->effects & CFE_STRIKEOUT) ? "s" : "", - (ta->effects) ? " " : "", - ta->color&0xff, (ta->color >> 8)&0xff, (ta->color >> 16)&0xff); - } - break; - case ArgFilename: - if (strchr(*(char **)ad->argLoc, '\"')) { - fprintf(f, "/%s='%s'\n", ad->argName, *(char **)ad->argLoc); - } else { - fprintf(f, "/%s=\"%s\"\n", ad->argName, *(char **)ad->argLoc); - } - break; - case ArgBoardSize: - fprintf(f, "/%s=%s\n", ad->argName, - sizeInfo[*(BoardSize *)ad->argLoc].name); - break; - case ArgFont: - { +// [HGM] args: these three cases taken out to stay in front-end +void +SaveFontArg(FILE *f, ArgDescriptor *ad) +{ // in WinBoard every board size has its own font, and the "argLoc" identifies the table, + // while the curent board size determines the element. This system should be ported to XBoard. + // What the table contains pointers to, and how to print the font description, remains platform-dependent int bs; for (bs=0; bsargLoc]->mfp; @@ -2507,17 +1143,99 @@ SaveSettings(char* name) (int)mfp->charset); } } - break; - case ArgCommSettings: - PrintCommSettings(f, ad->argName, (DCB *)ad->argLoc); - case ArgNone: - case ArgSettingsFilename: ; - } - } - fclose(f); + +void +ExportSounds() +{ // [HGM] copy the names from the internal WB variables to appData + ColorClass cc; + SoundClass sc; + for (cc = (ColorClass)0; cc < ColorNormal; cc++) + (&appData.soundShout)[cc] = textAttribs[cc].sound.name; + for (sc = (SoundClass)0; sc < NSoundClasses; sc++) + (&appData.soundMove)[sc] = sounds[sc].name; +} + +void +SaveAttribsArg(FILE *f, ArgDescriptor *ad) +{ // here the "argLoc" defines a table index. It could have contained the 'ta' pointer itself, though + MyTextAttribs* ta = &textAttribs[(ColorClass)ad->argLoc]; + fprintf(f, "/%s=\"%s%s%s%s%s#%02lx%02lx%02lx\"\n", ad->argName, + (ta->effects & CFE_BOLD) ? "b" : "", + (ta->effects & CFE_ITALIC) ? "i" : "", + (ta->effects & CFE_UNDERLINE) ? "u" : "", + (ta->effects & CFE_STRIKEOUT) ? "s" : "", + (ta->effects) ? " " : "", + ta->color&0xff, (ta->color >> 8)&0xff, (ta->color >> 16)&0xff); + } + +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? + COLORREF color = *(COLORREF *)colorVariable[(int)ad->argLoc]; + fprintf(f, "/%s=#%02lx%02lx%02lx\n", ad->argName, + color&0xff, (color>>8)&0xff, (color>>16)&0xff); +} + +void +SaveBoardSize(FILE *f, char *name, void *addr) +{ // wrapper to shield back-end from BoardSize & sizeInfo + fprintf(f, "/%s=%s\n", name, sizeInfo[*(BoardSize *)addr].name); +} + +void +ParseCommPortSettings(char *s) +{ // wrapper to keep dcb from back-end + ParseCommSettings(s, &dcb); +} + +void +GetWindowCoords() +{ // wrapper to shield use of window handles from back-end (make addressible by number?) + GetActualPlacement(hwndMain, &wpMain); + GetActualPlacement(hwndConsole, &wpConsole); + GetActualPlacement(commentDialog, &wpComment); + GetActualPlacement(editTagsDialog, &wpTags); + GetActualPlacement(gameListDialog, &wpGameList); + GetActualPlacement(moveHistoryDialog, &wpMoveHistory); + GetActualPlacement(evalGraphDialog, &wpEvalGraph); + GetActualPlacement(engineOutputDialog, &wpEngineOutput); } +void +PrintCommPortSettings(FILE *f, char *name) +{ // wrapper to shield back-end from DCB + PrintCommSettings(f, name, &dcb); +} +int +MySearchPath(char *installDir, char *name, char *fullname) +{ + char *dummy; + return (int) SearchPath(installDir, name, NULL, MSG_SIZ, fullname, &dummy); +} + +int +MyGetFullPathName(char *name, char *fullname) +{ + char *dummy; + return (int) GetFullPathName(name, MSG_SIZ, fullname, &dummy); +} + +int +MainWindowUp() +{ // [HGM] args: allows testing if main window is realized from back-end + return hwndMain != NULL; +} + +void +PopUpStartupDialog() +{ + FARPROC lpProc; + + lpProc = MakeProcInstance((FARPROC)StartupDialog, hInst); + DialogBox(hInst, MAKEINTRESOURCE(DLG_Startup), NULL, (DLGPROC)lpProc); + FreeProcInstance(lpProc); +} /*---------------------------------------------------------------------------*\ * @@ -3032,7 +1750,7 @@ void CreatePiecesFromFont() } else if( strstr(lf.lfFaceName,"GC2004D") != NULL ) { /* Good Companion (Some characters get warped as literal :-( */ - char s[] = "1cmWG0ñueOS¯®oYI23wgQU"; + char s[] = "1cmWG0??S??oYI23wgQU"; s[0]=0xB9; s[1]=0xA9; s[6]=0xB1; s[11]=0xBB; s[12]=0xAB; s[17]=0xB3; SetCharTable(pieceToFontChar, s); } @@ -3136,6 +1854,7 @@ InitDrawingColors() blackPieceBrush = CreateSolidBrush(blackPieceColor); iconBkgndBrush = CreateSolidBrush(GetSysColor(COLOR_BACKGROUND)); explodeBrush = CreateSolidBrush(highlightSquareColor); // [HGM] atomic + markerBrush = CreateSolidBrush(premoveHighlightColor); // [HGM] markers /* [AS] Force rendering of the font-based pieces */ if( fontBitmapSquareSize > 0 ) { fontBitmapSquareSize = 0; @@ -3200,10 +1919,10 @@ InitDrawingSizes(BoardSize boardSize, int flags) /* [HGM] call with -2 uses old size (for if nr of files, ranks changes) */ if(boardSize == (BoardSize)(-2) ) boardSize = oldBoardSize; - oldRect.left = boardX; //[HGM] placement: remember previous window params - oldRect.top = boardY; - oldRect.right = boardX + winWidth; - oldRect.bottom = boardY + winHeight; + oldRect.left = wpMain.x; //[HGM] placement: remember previous window params + oldRect.top = wpMain.y; + oldRect.right = wpMain.x + wpMain.width; + oldRect.bottom = wpMain.y + wpMain.height; tinyLayout = sizeInfo[boardSize].tinyLayout; smallLayout = sizeInfo[boardSize].smallLayout; @@ -3286,6 +2005,8 @@ InitDrawingSizes(BoardSize boardSize, int flags) blackRect.right = blackRect.left + boardWidth/2 - 1; blackRect.top = whiteRect.top; blackRect.bottom = whiteRect.bottom; + + logoHeight = 0; // [HGM] logo: suppress logo after change to tiny layout! } messageRect.left = OUTER_MARGIN + MESSAGE_LINE_LEFTMARGIN; @@ -3311,49 +2032,49 @@ InitDrawingSizes(BoardSize boardSize, int flags) winH = 2 * GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYMENU) + GetSystemMetrics(SM_CYCAPTION) + boardRect.bottom + OUTER_MARGIN; if(suppressVisibleEffects) return; // [HGM] when called for filling sizeInfo only - winWidth = winW; // [HGM] placement: set through temporary which can used by initial sizing choice - winHeight = winH; // without disturbing window attachments + wpMain.width = winW; // [HGM] placement: set through temporary which can used by initial sizing choice + wpMain.height = winH; // without disturbing window attachments GetWindowRect(hwndMain, &wrect); - SetWindowPos(hwndMain, NULL, 0, 0, winWidth, winHeight, + SetWindowPos(hwndMain, NULL, 0, 0, wpMain.width, wpMain.height, SWP_NOCOPYBITS|SWP_NOZORDER|SWP_NOMOVE); // [HGM] placement: let attached windows follow size change. - ReattachAfterSize( &oldRect, winWidth, winHeight, moveHistoryDialog, &wpMoveHistory ); - ReattachAfterSize( &oldRect, winWidth, winHeight, evalGraphDialog, &wpEvalGraph ); - ReattachAfterSize( &oldRect, winWidth, winHeight, engineOutputDialog, &wpEngineOutput ); - ReattachAfterSize( &oldRect, winWidth, winHeight, gameListDialog, &wpGameList ); - ReattachAfterSize( &oldRect, winWidth, winHeight, hwndConsole, &wpConsole ); + ReattachAfterSize( &oldRect, wpMain.width, wpMain.height, moveHistoryDialog, &wpMoveHistory ); + ReattachAfterSize( &oldRect, wpMain.width, wpMain.height, evalGraphDialog, &wpEvalGraph ); + ReattachAfterSize( &oldRect, wpMain.width, wpMain.height, engineOutputDialog, &wpEngineOutput ); + ReattachAfterSize( &oldRect, wpMain.width, wpMain.height, gameListDialog, &wpGameList ); + ReattachAfterSize( &oldRect, wpMain.width, wpMain.height, hwndConsole, &wpConsole ); /* compensate if menu bar wrapped */ GetClientRect(hwndMain, &crect); offby = boardRect.bottom + OUTER_MARGIN - crect.bottom; - winHeight += offby; + wpMain.height += offby; switch (flags) { case WMSZ_TOPLEFT: SetWindowPos(hwndMain, NULL, - wrect.right - winWidth, wrect.bottom - winHeight, - winWidth, winHeight, SWP_NOCOPYBITS|SWP_NOZORDER); + wrect.right - wpMain.width, wrect.bottom - wpMain.height, + wpMain.width, wpMain.height, SWP_NOCOPYBITS|SWP_NOZORDER); break; case WMSZ_TOPRIGHT: case WMSZ_TOP: SetWindowPos(hwndMain, NULL, - wrect.left, wrect.bottom - winHeight, - winWidth, winHeight, SWP_NOCOPYBITS|SWP_NOZORDER); + wrect.left, wrect.bottom - wpMain.height, + wpMain.width, wpMain.height, SWP_NOCOPYBITS|SWP_NOZORDER); break; case WMSZ_BOTTOMLEFT: case WMSZ_LEFT: SetWindowPos(hwndMain, NULL, - wrect.right - winWidth, wrect.top, - winWidth, winHeight, SWP_NOCOPYBITS|SWP_NOZORDER); + wrect.right - wpMain.width, wrect.top, + wpMain.width, wpMain.height, SWP_NOCOPYBITS|SWP_NOZORDER); break; case WMSZ_BOTTOMRIGHT: case WMSZ_BOTTOM: case WMSZ_RIGHT: default: - SetWindowPos(hwndMain, NULL, 0, 0, winWidth, winHeight, + SetWindowPos(hwndMain, NULL, 0, 0, wpMain.width, wpMain.height, SWP_NOCOPYBITS|SWP_NOZORDER|SWP_NOMOVE); break; } @@ -4214,7 +2935,7 @@ BOOL DrawPositionNeedsFullRepaint() but animation is fast enough that it's difficult to notice. */ if( animInfo.piece == EmptySquare ) { - if( (appData.highlightLastMove || appData.highlightDragging) && IsDrawArrowEnabled() && HasHighlightInfo() ) { + if( (appData.highlightLastMove || appData.highlightDragging) && IsDrawArrowEnabled() /*&& HasHighlightInfo()*/ ) { result = TRUE; } } @@ -4234,8 +2955,8 @@ DrawBoardOnDC(HDC hdc, Board board, HDC tmphdc) if( liteBackTexture != NULL || darkBackTexture != NULL ) { static int backTextureBoardSize; /* [HGM] boardsize: also new texture if board format changed */ if( backTextureSquareSize != squareSize - || backTextureBoardSize != BOARD_WIDTH+BOARD_SIZE*BOARD_HEIGHT) { - backTextureBoardSize = BOARD_WIDTH+BOARD_SIZE*BOARD_HEIGHT; + || backTextureBoardSize != BOARD_WIDTH+BOARD_FILES*BOARD_HEIGHT) { + backTextureBoardSize = BOARD_WIDTH+BOARD_FILES*BOARD_HEIGHT; backTextureSquareSize = squareSize; RebuildTextureSquareInfo(); } @@ -4363,6 +3084,62 @@ DrawLogoOnDC(HDC hdc, RECT logoRect, HBITMAP logo) DeleteDC(tmphdc); } +static HDC hdcSeek; + +// [HGM] seekgraph +void DrawSeekAxis( int x, int y, int xTo, int yTo ) +{ + POINT stPt; + HPEN hp = SelectObject( hdcSeek, gridPen ); + MoveToEx( hdcSeek, boardRect.left+x, boardRect.top+y, &stPt ); + LineTo( hdcSeek, boardRect.left+xTo, boardRect.top+yTo ); + SelectObject( hdcSeek, hp ); +} + +// front-end wrapper for drawing functions to do rectangles +void DrawSeekBackground( int left, int top, int right, int bottom ) +{ + HPEN hp; + RECT rc; + + if (hdcSeek == NULL) { + hdcSeek = GetDC(hwndMain); + if (!appData.monoMode) { + SelectPalette(hdcSeek, hPal, FALSE); + RealizePalette(hdcSeek); + } + } + hp = SelectObject( hdcSeek, gridPen ); + rc.top = boardRect.top+top; rc.left = boardRect.left+left; + rc.bottom = boardRect.top+bottom; rc.right = boardRect.left+right; + FillRect( hdcSeek, &rc, lightSquareBrush ); + SelectObject( hdcSeek, hp ); +} + +// front-end wrapper for putting text in graph +void DrawSeekText(char *buf, int x, int y) +{ + SIZE stSize; + SetBkMode( hdcSeek, TRANSPARENT ); + GetTextExtentPoint32( hdcSeek, buf, strlen(buf), &stSize ); + TextOut( hdcSeek, boardRect.left+x-3, boardRect.top+y-stSize.cy/2, buf, strlen(buf) ); +} + +void DrawSeekDot(int x, int y, int color) +{ + int square = color & 0x80; + color &= 0x7F; + HBRUSH oldBrush = SelectObject(hdcSeek, + color == 0 ? markerBrush : color == 1 ? darkSquareBrush : explodeBrush); + if(square) + Rectangle(hdcSeek, boardRect.left+x - squareSize/9, boardRect.top+y - squareSize/9, + boardRect.left+x + squareSize/9, boardRect.top+y + squareSize/9); + else + Ellipse(hdcSeek, boardRect.left+x - squareSize/8, boardRect.top+y - squareSize/8, + boardRect.left+x + squareSize/8, boardRect.top+y + squareSize/8); + SelectObject(hdcSeek, oldBrush); +} + VOID HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) { @@ -4389,6 +3166,8 @@ HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) */ Boolean fullrepaint = repaint; + if(DrawSeekGraph()) return; // [HG} seekgraph: suppress printing board if seek graph up + if( DrawPositionNeedsFullRepaint() ) { fullrepaint = TRUE; } @@ -4595,6 +3374,18 @@ HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) DrawHighlightsOnDC(hdcmem); DrawBoardOnDC(hdcmem, board, tmphdc); } + for (row = 0; row < BOARD_HEIGHT; row++) { + for (column = 0; column < BOARD_WIDTH; column++) { + if (marker[row][column]) { // marker changes only occur with full repaint! + HBRUSH oldBrush = SelectObject(hdcmem, + marker[row][column] == 2 ? markerBrush : explodeBrush); + SquareToPos(row, column, &x, &y); + Ellipse(hdcmem, x + squareSize/4, y + squareSize/4, + x + 3*squareSize/4, y + 3*squareSize/4); + SelectObject(hdcmem, oldBrush); + } + } + } if(logoHeight) { HBITMAP whiteLogo = (HBITMAP) first.programLogo, blackLogo = (HBITMAP) second.programLogo; if(appData.autoLogo) { @@ -4847,7 +3638,7 @@ PaintProc(HWND hwnd) * subtracted from x. */ int EventToSquare(x, limit) - int x; + int x, limit; { if (x <= 0) return -2; @@ -4921,7 +3712,7 @@ void DragPieceEnd(int x, int y) VOID MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { - int x, y; + int x, y, menuNr; POINT pt; static int recursive = 0; HMENU hmenu; @@ -4988,6 +3779,8 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) break; case WM_MOUSEMOVE: + if(SeekGraphClick(Press, pt.x - boardRect.left, pt.y - boardRect.top, 1)) break; + MovePV(pt.x - boardRect.left, pt.y - boardRect.top, boardRect.bottom - boardRect.top); if ((appData.animateDragging || appData.highlightDragging) && (wParam & MK_LBUTTON) && dragInfo.from.x >= 0) @@ -5025,6 +3818,12 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) } break; + case WM_MBUTTONUP: + case WM_RBUTTONUP: + ReleaseCapture(); + RightClick(Release, pt.x - boardRect.left, pt.y - boardRect.top, &fromX, &fromY); + break; + case WM_MBUTTONDOWN: case WM_RBUTTONDOWN: ErrorPopDown(); @@ -5047,12 +3846,9 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) } DrawPosition(TRUE, NULL); - switch (gameMode) { - case EditPosition: - case IcsExamining: - if (x < 0 || y < 0) break; - fromX = x; - fromY = y; + menuNr = RightClick(Press, pt.x - boardRect.left, pt.y - boardRect.top, &fromX, &fromY); + switch (menuNr) { + case 0: if (message == WM_MBUTTONDOWN) { buttonCount = 3; /* even if system didn't think so */ if (wParam & MK_SHIFT) @@ -5069,21 +3865,13 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) MenuPopup(hwnd, pt, LoadMenu(hInst, "ShogiPieceMenu"), -1); } break; - case IcsPlayingWhite: - case IcsPlayingBlack: - case EditGame: - case MachinePlaysWhite: - case MachinePlaysBlack: - if (appData.testLegality && - gameInfo.variant != VariantBughouse && - gameInfo.variant != VariantCrazyhouse) break; - if (x < 0 || y < 0) break; - fromX = x; - fromY = y; + case 2: + SetCapture(hwndMain); + break; + case 1: hmenu = LoadMenu(hInst, "DropPieceMenu"); SetupDropMenu(hmenu); MenuPopup(hwnd, pt, hmenu, -1); - break; default: break; } @@ -5780,7 +4568,7 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) break; case IDM_EditComment: - if (commentDialogUp && editComment) { + if (commentUp && editComment) { CommentPopDown(); } else { EditCommentEvent(); @@ -6252,18 +5040,18 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) RECT rcMain; // GetWindowRect( hwnd, &rcMain ); //[HGM] sticky: in XP this returned new position, not old - rcMain.left = boardX; // replace by these 4 lines to reconstruct old rect - rcMain.right = boardX + winWidth; - rcMain.top = boardY; - rcMain.bottom = boardY + winHeight; + rcMain.left = wpMain.x; // replace by these 4 lines to reconstruct old rect + rcMain.right = wpMain.x + wpMain.width; + rcMain.top = wpMain.y; + rcMain.bottom = wpMain.y + wpMain.height; ReattachAfterMove( &rcMain, lpwp->x, lpwp->y, moveHistoryDialog, &wpMoveHistory ); ReattachAfterMove( &rcMain, lpwp->x, lpwp->y, evalGraphDialog, &wpEvalGraph ); ReattachAfterMove( &rcMain, lpwp->x, lpwp->y, engineOutputDialog, &wpEngineOutput ); ReattachAfterMove( &rcMain, lpwp->x, lpwp->y, gameListDialog, &wpGameList ); ReattachAfterMove( &rcMain, lpwp->x, lpwp->y, hwndConsole, &wpConsole ); - boardX = lpwp->x; - boardY = lpwp->y; + wpMain.x = lpwp->x; + wpMain.y = lpwp->y; } } break; @@ -6764,7 +5552,7 @@ InitComboStrings(HANDLE hwndCombo, char **cd) void InitComboStringsFromOption(HANDLE hwndCombo, char *str) { - char buf1[ARG_MAX]; + char buf1[MAX_ARG_LEN]; int len; if (str[0] == '@') { @@ -7026,18 +5814,18 @@ CommentDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) GetClientRect(hDlg, &rect); sizeX = rect.right; sizeY = rect.bottom; - if (commentX != CW_USEDEFAULT && commentY != CW_USEDEFAULT && - commentW != CW_USEDEFAULT && commentH != CW_USEDEFAULT) { + if (wpComment.x != CW_USEDEFAULT && wpComment.y != CW_USEDEFAULT && + wpComment.width != CW_USEDEFAULT && wpComment.height != CW_USEDEFAULT) { WINDOWPLACEMENT wp; - EnsureOnScreen(&commentX, &commentY, 0, 0); + EnsureOnScreen(&wpComment.x, &wpComment.y, 0, 0); wp.length = sizeof(WINDOWPLACEMENT); wp.flags = 0; wp.showCmd = SW_SHOW; wp.ptMaxPosition.x = wp.ptMaxPosition.y = 0; - wp.rcNormalPosition.left = commentX; - wp.rcNormalPosition.right = commentX + commentW; - wp.rcNormalPosition.top = commentY; - wp.rcNormalPosition.bottom = commentY + commentH; + wp.rcNormalPosition.left = wpComment.x; + wp.rcNormalPosition.right = wpComment.x + wpComment.width; + wp.rcNormalPosition.top = wpComment.y; + wp.rcNormalPosition.bottom = wpComment.y + wpComment.height; SetWindowPlacement(hDlg, &wp); GetClientRect(hDlg, &rect); @@ -7136,14 +5924,14 @@ EitherCommentPopUp(int index, char *title, char *str, BOOLEAN edit) if (commentDialog) { SendMessage(commentDialog, WM_INITDIALOG, 0, 0); - if (!commentDialogUp) ShowWindow(commentDialog, SW_SHOW); + if (!commentUp) ShowWindow(commentDialog, SW_SHOW); } else { lpProc = MakeProcInstance((FARPROC)CommentDialog, hInst); CreateDialog(hInst, MAKEINTRESOURCE(DLG_EditComment), hwndMain, (DLGPROC)lpProc); FreeProcInstance(lpProc); } - commentDialogUp = TRUE; + commentUp = TRUE; } @@ -7186,13 +5974,8 @@ TypeInMoveDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) } // [HGM] movenum: allow move number to be typed in any mode if(sscanf(move, "%d", &n) == 1 && n != 0 ) { - currentMove = 2*n-1; - if(currentMove > forwardMostMove) currentMove = forwardMostMove; - if(currentMove < backwardMostMove) currentMove = backwardMostMove; + ToNrEvent(2*n-1); EndDialog(hDlg, TRUE); - DrawPosition(TRUE, boards[currentMove]); - if(currentMove > backwardMostMove) DisplayMove(currentMove - 1); - else DisplayMessage("", ""); return TRUE; } } @@ -7354,6 +6137,7 @@ ErrorPopDown() if (errorDialog == NULL) return; DestroyWindow(errorDialog); errorDialog = NULL; + if(errorExitStatus) ExitEvent(errorExitStatus); } LRESULT CALLBACK @@ -7416,7 +6200,7 @@ GothicDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) case WM_INITDIALOG: GetWindowRect(hDlg, &rChild); - SetWindowPos(hDlg, NULL, boardX, boardY-height, winWidth, height, + SetWindowPos(hDlg, NULL, wpMain.x, wpMain.y-height, wpMain.width, height, SWP_NOZORDER); /* @@ -7516,76 +6300,7 @@ NextInHistory() { if (histP == histIn) return NULL; histP = (histP + 1) % HISTORY_SIZE; - return history[histP]; -} - -typedef struct { - char *item; - char *command; - BOOLEAN getname; - BOOLEAN immediate; -} IcsTextMenuEntry; -#define ICS_TEXT_MENU_SIZE (IDM_CommandXLast - IDM_CommandX + 1) -IcsTextMenuEntry icsTextMenuEntry[ICS_TEXT_MENU_SIZE]; - -void -ParseIcsTextMenu(char *icsTextMenuString) -{ -// int flags = 0; - IcsTextMenuEntry *e = icsTextMenuEntry; - char *p = icsTextMenuString; - while (e->item != NULL && e < icsTextMenuEntry + ICS_TEXT_MENU_SIZE) { - free(e->item); - e->item = NULL; - if (e->command != NULL) { - free(e->command); - e->command = NULL; - } - e++; - } - e = icsTextMenuEntry; - while (*p && e < icsTextMenuEntry + ICS_TEXT_MENU_SIZE) { - if (*p == ';' || *p == '\n') { - e->item = strdup("-"); - e->command = NULL; - p++; - } else if (*p == '-') { - e->item = strdup("-"); - e->command = NULL; - p++; - if (*p) p++; - } else { - char *q, *r, *s, *t; - char c; - q = strchr(p, ','); - if (q == NULL) break; - *q = NULLCHAR; - r = strchr(q + 1, ','); - if (r == NULL) break; - *r = NULLCHAR; - s = strchr(r + 1, ','); - if (s == NULL) break; - *s = NULLCHAR; - c = ';'; - t = strchr(s + 1, c); - if (t == NULL) { - c = '\n'; - t = strchr(s + 1, c); - } - if (t != NULL) *t = NULLCHAR; - e->item = strdup(p); - e->command = strdup(q + 1); - e->getname = *(r + 1) != '0'; - e->immediate = *(s + 1) != '0'; - *q = ','; - *r = ','; - *s = ','; - if (t == NULL) break; - *t = c; - p = t + 1; - } - e++; - } + return history[histP]; } HMENU @@ -8037,10 +6752,10 @@ ConsoleWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) // [HGM] Chessknight's change 2004-07-13 else { /* Determine Defaults */ WINDOWPLACEMENT wp; - wpConsole.x = winWidth + 1; - wpConsole.y = boardY; - wpConsole.width = screenWidth - winWidth; - wpConsole.height = winHeight; + wpConsole.x = wpMain.width + 1; + wpConsole.y = wpMain.y; + wpConsole.width = screenWidth - wpMain.width; + wpConsole.height = wpMain.height; EnsureOnScreen(&wpConsole.x, &wpConsole.y, 0, 0); wp.length = sizeof(WINDOWPLACEMENT); wp.flags = 0; @@ -8569,6 +7284,13 @@ typedef struct { } Enables; VOID +GreyRevert(Boolean grey) +{ // [HGM] vari: for retracting variations in local mode + HMENU hmenu = GetMenu(hwndMain); + EnableMenuItem(hmenu, IDM_Revert, MF_BYCOMMAND|(grey ? MF_GRAYED : MF_ENABLED)); +} + +VOID SetMenuEnables(HMENU hmenu, Enables *enab) { while (enab->item > 0) { @@ -9180,104 +7902,42 @@ int NewGameFRC() return result; } -/* [AS] Game list options */ -typedef struct { - char id; - char * name; -} GLT_Item; - -static GLT_Item GLT_ItemInfo[] = { - { GLT_EVENT, "Event" }, - { GLT_SITE, "Site" }, - { GLT_DATE, "Date" }, - { GLT_ROUND, "Round" }, - { GLT_PLAYERS, "Players" }, - { GLT_RESULT, "Result" }, - { GLT_WHITE_ELO, "White Rating" }, - { GLT_BLACK_ELO, "Black Rating" }, - { GLT_TIME_CONTROL,"Time Control" }, - { GLT_VARIANT, "Variant" }, - { GLT_OUT_OF_BOOK,PGN_OUT_OF_BOOK }, - { GLT_RESULT_COMMENT, "Result Comment" }, // [HGM] rescom - { 0, 0 } -}; - -const char * GLT_FindItem( char id ) -{ - const char * result = 0; - - GLT_Item * list = GLT_ItemInfo; +/* [AS] Game list options. Refactored by HGM */ - while( list->id != 0 ) { - if( list->id == id ) { - result = list->name; - break; - } +HWND gameListOptionsDialog; - list++; - } - - return result; +// low-level front-end: clear text edit / list widget +void +GLT_ClearList() +{ + SendDlgItemMessage( gameListOptionsDialog, IDC_GameListTags, LB_RESETCONTENT, 0, 0 ); } -void GLT_AddToList( HWND hDlg, int iDlgItem, char id, int index ) +// low-level front-end: clear text edit / list widget +void +GLT_DeSelectList() { - const char * name = GLT_FindItem( id ); - - if( name != 0 ) { - if( index >= 0 ) { - SendDlgItemMessage( hDlg, iDlgItem, LB_INSERTSTRING, index, (LPARAM) name ); - } - else { - SendDlgItemMessage( hDlg, iDlgItem, LB_ADDSTRING, 0, (LPARAM) name ); - } - } + SendDlgItemMessage( gameListOptionsDialog, IDC_GameListTags, LB_SETCURSEL, 0, 0 ); } -void GLT_TagsToList( HWND hDlg, char * tags ) +// low-level front-end: append line to text edit / list widget +void +GLT_AddToList( char *name ) { - char * pc = tags; - - SendDlgItemMessage( hDlg, IDC_GameListTags, LB_RESETCONTENT, 0, 0 ); - - while( *pc ) { - GLT_AddToList( hDlg, IDC_GameListTags, *pc, -1 ); - pc++; - } - - SendDlgItemMessage( hDlg, IDC_GameListTags, LB_ADDSTRING, 0, (LPARAM) "\t --- Hidden tags ---" ); - - pc = GLT_ALL_TAGS; - - while( *pc ) { - if( strchr( tags, *pc ) == 0 ) { - GLT_AddToList( hDlg, IDC_GameListTags, *pc, -1 ); - } - pc++; + if( name != 0 ) { + SendDlgItemMessage( gameListOptionsDialog, IDC_GameListTags, LB_ADDSTRING, 0, (LPARAM) name ); } - - SendDlgItemMessage( hDlg, IDC_GameListTags, LB_SETCURSEL, 0, 0 ); } -char GLT_ListItemToTag( HWND hDlg, int index ) +// low-level front-end: get line from text edit / list widget +Boolean +GLT_GetFromList( int index, char *name ) { - char result = '\0'; - char name[128]; - - GLT_Item * list = GLT_ItemInfo; - - if( SendDlgItemMessage( hDlg, IDC_GameListTags, LB_GETTEXT, index, (LPARAM) name ) != LB_ERR ) { - while( list->id != 0 ) { - if( strcmp( list->name, name ) == 0 ) { - result = list->id; - break; - } - - list++; - } + if( name != 0 ) { + if( SendDlgItemMessage( gameListOptionsDialog, IDC_GameListTags, LB_GETTEXT, index, (LPARAM) name ) != LB_ERR ) + return TRUE; } - - return result; + return FALSE; } void GLT_MoveSelection( HWND hDlg, int delta ) @@ -9298,20 +7958,15 @@ void GLT_MoveSelection( HWND hDlg, int delta ) LRESULT CALLBACK GameListOptions_Proc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { - static char glt[64]; - static char * lpUserGLT; - switch( message ) { case WM_INITDIALOG: - lpUserGLT = (char *) lParam; + gameListOptionsDialog = hDlg; // [HGM] pass through global to keep out off back-end - strcpy( glt, lpUserGLT ); - CenterWindow(hDlg, GetWindow(hDlg, GW_OWNER)); /* Initialize list */ - GLT_TagsToList( hDlg, glt ); + GLT_TagsToList( lpUserGLT ); SetFocus( GetDlgItem(hDlg, IDC_GameListTags) ); @@ -9320,19 +7975,7 @@ LRESULT CALLBACK GameListOptions_Proc(HWND hDlg, UINT message, WPARAM wParam, LP case WM_COMMAND: switch( LOWORD(wParam) ) { case IDOK: - { - char * pc = lpUserGLT; - int idx = 0; -// int cnt = (int) SendDlgItemMessage( hDlg, IDC_GameListTags, LB_GETCOUNT, 0, 0 ); - char id; - - do { - id = GLT_ListItemToTag( hDlg, idx ); - - *pc++ = id; - idx++; - } while( id != '\0' ); - } + GLT_ParseList(); EndDialog( hDlg, 0 ); return TRUE; case IDCANCEL: @@ -9340,13 +7983,11 @@ LRESULT CALLBACK GameListOptions_Proc(HWND hDlg, UINT message, WPARAM wParam, LP return TRUE; case IDC_GLT_Default: - strcpy( glt, GLT_DEFAULT_TAGS ); - GLT_TagsToList( hDlg, glt ); + GLT_TagsToList( GLT_DEFAULT_TAGS ); return TRUE; case IDC_GLT_Restore: - strcpy( glt, lpUserGLT ); - GLT_TagsToList( hDlg, glt ); + GLT_TagsToList( appData.gameListTags ); return TRUE; case IDC_GLT_Up: @@ -9366,23 +8007,21 @@ LRESULT CALLBACK GameListOptions_Proc(HWND hDlg, UINT message, WPARAM wParam, LP int GameListOptions() { - char glt[64]; int result; FARPROC lpProc = MakeProcInstance( (FARPROC) GameListOptions_Proc, hInst ); - strcpy( glt, appData.gameListTags ); + strcpy( lpUserGLT, appData.gameListTags ); - result = DialogBoxParam( hInst, MAKEINTRESOURCE(DLG_GameListOptions), hwndMain, (DLGPROC)lpProc, (LPARAM)glt ); + result = DialogBoxParam( hInst, MAKEINTRESOURCE(DLG_GameListOptions), hwndMain, (DLGPROC)lpProc, (LPARAM)lpUserGLT ); if( result == 0 ) { /* [AS] Memory leak here! */ - appData.gameListTags = strdup( glt ); + appData.gameListTags = strdup( lpUserGLT ); } return result; } - VOID DisplayIcsInteractionTitle(char *str) { @@ -9436,7 +8075,7 @@ CommentPopDown(void) if (commentDialog) { ShowWindow(commentDialog, SW_HIDE); } - commentDialogUp = FALSE; + commentUp = FALSE; } VOID @@ -10490,86 +9129,6 @@ StartAnalysisClock() (UINT) 2000, NULL); } -LRESULT CALLBACK -AnalysisDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) -{ - static HANDLE hwndText; - RECT rect; - static int sizeX, sizeY; - int newSizeX, newSizeY, flags; - MINMAXINFO *mmi; - - switch (message) { - case WM_INITDIALOG: /* message: initialize dialog box */ - /* Initialize the dialog items */ - hwndText = GetDlgItem(hDlg, OPT_AnalysisText); - SetWindowText(hDlg, analysisTitle); - SetDlgItemText(hDlg, OPT_AnalysisText, analysisText); - /* Size and position the dialog */ - if (!analysisDialog) { - analysisDialog = hDlg; - flags = SWP_NOZORDER; - GetClientRect(hDlg, &rect); - sizeX = rect.right; - sizeY = rect.bottom; - if (analysisX != CW_USEDEFAULT && analysisY != CW_USEDEFAULT && - analysisW != CW_USEDEFAULT && analysisH != CW_USEDEFAULT) { - WINDOWPLACEMENT wp; - EnsureOnScreen(&analysisX, &analysisY, 0, 0); - wp.length = sizeof(WINDOWPLACEMENT); - wp.flags = 0; - wp.showCmd = SW_SHOW; - wp.ptMaxPosition.x = wp.ptMaxPosition.y = 0; - wp.rcNormalPosition.left = analysisX; - wp.rcNormalPosition.right = analysisX + analysisW; - wp.rcNormalPosition.top = analysisY; - wp.rcNormalPosition.bottom = analysisY + analysisH; - SetWindowPlacement(hDlg, &wp); - - GetClientRect(hDlg, &rect); - newSizeX = rect.right; - newSizeY = rect.bottom; - ResizeEditPlusButtons(hDlg, hwndText, sizeX, sizeY, - newSizeX, newSizeY); - sizeX = newSizeX; - sizeY = newSizeY; - } - } - return FALSE; - - case WM_COMMAND: /* message: received a command */ - switch (LOWORD(wParam)) { - case IDCANCEL: - if (appData.icsActive && appData.icsEngineAnalyze) { /* [DM] icsEngineAnalyze */ - ExitAnalyzeMode(); - ModeHighlight(); - return TRUE; - } - EditGameEvent(); - return TRUE; - default: - break; - } - break; - - case WM_SIZE: - newSizeX = LOWORD(lParam); - newSizeY = HIWORD(lParam); - ResizeEditPlusButtons(hDlg, hwndText, sizeX, sizeY, newSizeX, newSizeY); - sizeX = newSizeX; - sizeY = newSizeY; - break; - - case WM_GETMINMAXINFO: - /* Prevent resizing window too small */ - mmi = (MINMAXINFO *) lParam; - mmi->ptMinTrackSize.x = 100; - mmi->ptMinTrackSize.y = 100; - break; - } - return FALSE; -} - VOID SetHighlights(int fromX, int fromY, int toX, int toY) { @@ -10774,8 +9333,3 @@ HistorySet( char movelist[][2*MOVE_LEN], int first, int last, int current ) EvalGraphSet( first, last, current, pvInfoList ); } - -void SetProgramStats( FrontEndProgramStats * stats ) -{ - EngineOutputUpdate( stats ); -}