/*\r
* WinBoard.c -- Windows NT front end to XBoard\r
- * $Id: winboard.c,v 2.3 2003/11/25 05:25:20 mann Exp $\r
*\r
* Copyright 1991 by Digital Equipment Corporation, Maynard,\r
- * Massachusetts. Enhancements Copyright\r
- * 1992-2001,2002,2003,2004,2005,2006,2007,2008,2009 Free Software\r
- * Foundation, Inc.\r
+ * Massachusetts. \r
+ *\r
+ * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006,\r
+ * 2007, 2008, 2009 Free Software Foundation, Inc.\r
+ *\r
+ * Enhancements Copyright 2005 Alessandro Scotti\r
*\r
* XBoard borrows its colors and the bitmaps.xchess bitmap set from XChess,\r
* which was written and is copyrighted by Wayne Christopher.\r
#include "woptions.h"\r
#include "wsockerr.h"\r
#include "defaults.h"\r
-\r
+#include "help.h"\r
#include "wsnap.h"\r
\r
//void InitEngineUCI( const char * iniDir, ChessProgramState * cps );\r
void AnimateAtomicCapture(int fromX, int fromY, int toX, int toY, int nFrames);\r
void DisplayMove P((int moveNumber));\r
Boolean ParseFEN P((Board board, int *blackPlaysFirst, char *fen));\r
-#ifdef VISTA\r
-#include "htmlhelp.h"\r
-#else\r
-HWND WINAPI HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD_PTR data );\r
-#endif\r
-\r
typedef struct {\r
ChessSquare piece; \r
POINT pos; /* window coordinates of current pos */\r
};\r
\r
int tinyLayout = 0, smallLayout = 0;\r
-#define MENU_BAR_ITEMS 6\r
+#define MENU_BAR_ITEMS 7\r
char *menuBarText[2][MENU_BAR_ITEMS+1] = {\r
{ "&File", "&Mode", "&Action", "&Step", "&Options", "&Help", NULL },\r
{ "&F", "&M", "&A", "&S", "&O", "&H", NULL },\r
BOOL EngineOutputIsUp();\r
VOID EngineOutputUpdate( FrontEndProgramStats * stats );\r
\r
+VOID EngineOptionsPopup(); // [HGM] settings\r
+\r
VOID GothicPopUp(char *title, VariantClass variant);\r
/*\r
* Setting "frozen" should disable all user input other than deleting\r
#define JAWS_MENU_ITEMS\r
#define JAWS_SILENCE\r
#define JAWS_REPLAY\r
+#define JAWS_ACCEL\r
+#define JAWS_COPYRIGHT\r
#define JAWS_DELETE(X) X\r
#define SAYMACHINEMOVE()\r
#define SAY(X)\r
!(editTagsDialog && IsDialogMessage(editTagsDialog, &msg)) &&\r
!(gameListDialog && IsDialogMessage(gameListDialog, &msg)) &&\r
!(errorDialog && IsDialogMessage(errorDialog, &msg)) &&\r
- !(!frozen && TranslateAccelerator(hwndMain, hAccelMain, &msg)) &&\r
+ !(!frozen && TranslateAccelerator(hwndMain, hAccelMain, &msg)) && JAWS_ACCEL\r
!(!hwndConsole && TranslateAccelerator(hwndMain, hAccelNoICS, &msg)) &&\r
!(!hwndConsole && TranslateAccelerator(hwndMain, hAccelNoAlt, &msg))) {\r
TranslateMessage(&msg); /* Translates virtual key codes */\r
wp.rcNormalPosition.bottom = boardY + winHeight;\r
SetWindowPlacement(hwndMain, &wp);\r
\r
- SetWindowPos(hwndMain, alwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST,\r
+ if(!appData.noGUI) SetWindowPos(hwndMain, alwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST,\r
0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);\r
\r
if (hwndConsole) {\r
#endif\r
ShowWindow(hwndConsole, nCmdShow);\r
}\r
- UpdateWindow(hwnd);\r
+ if(!appData.noGUI) UpdateWindow(hwnd); else ShowWindow(hwnd, SW_MINIMIZE);\r
\r
return TRUE;\r
\r
return;\r
}\r
fprintf(f, ";\n");\r
- fprintf(f, "; %s %s.%s Save Settings file\n", PRODUCT, VERSION, PATCHLEVEL);\r
+ fprintf(f, "; %s Save Settings file\n", PACKAGE_STRING);\r
fprintf(f, ";\n");\r
fprintf(f, "; You can edit the values of options that are already set in this file,\n");\r
fprintf(f, "; but if you add other options, the next Save Settings will not save them.\n");\r
) {\r
/* Downclick on different square. */\r
/* [HGM] if on holdings file, should count as new first click ! */\r
- { /* [HGM] <sameColor> now always do UserMoveTest(), and check colors there */\r
+ /* [HGM] <sameColor> now always do UserMoveTest(), and check colors there */\r
toX = x;\r
toY = y;\r
/* [HGM] <popupFix> UserMoveEvent requires two calls now,\r
break; \r
} else \r
if(moveType != ImpossibleMove) {\r
+ if(moveType == IllegalMove) {\r
+ ;\r
+ } else\r
/* [HGM] We use PromotionToKnight in Shogi to indicate frorced promotion */\r
if (moveType == WhitePromotionKnight || moveType == BlackPromotionKnight ||\r
((moveType == WhitePromotionQueen || moveType == BlackPromotionQueen) &&\r
If promotion to Q is legal, all are legal! */\r
if(gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat)\r
{ ChessSquare p = boards[currentMove][fromY][fromX], q = boards[currentMove][toY][toX];\r
- // kludge to temporarily execute move on display, wthout promotng yet\r
+ // kludge to temporarily execute move on display, without promotng yet\r
promotionChoice = TRUE;\r
boards[currentMove][fromY][fromX] = EmptySquare; // move Pawn to 8th rank\r
boards[currentMove][toY][toX] = p;\r
ClearHighlights();\r
}\r
FinishMove(moveType, fromX, fromY, toX, toY, NULLCHAR);\r
- fromX = fromY = -1;\r
if (appData.animate && !appData.highlightLastMove) {\r
ClearHighlights();\r
DrawPosition(forceFullRepaint || FALSE, NULL);\r
}\r
}\r
- break;\r
+ fromX = fromY = -1;\r
+ break;\r
}\r
if (gotPremove) {\r
- /* [HGM] it seemed that braces were missing here */\r
- SetPremoveHighlights(fromX, fromY, toX, toY);\r
- fromX = fromY = -1;\r
- break;\r
- }\r
- }\r
- ClearHighlights();\r
- DrawPosition(forceFullRepaint || FALSE, NULL);\r
+ SetPremoveHighlights(fromX, fromY, toX, toY);\r
+ DrawPosition(forceFullRepaint || FALSE, NULL);\r
+ } else ClearHighlights();\r
+ fromX = fromY = -1;\r
+ DrawPosition(forceFullRepaint || FALSE, NULL);\r
}\r
/* First downclick, or restart on a square with same color piece */\r
if (!frozen && OKToStartUserMove(x, y)) {\r
\r
JAWS_ALT_INTERCEPT\r
\r
- if (appData.icsActive && (isalpha((char)wParam) || wParam == '0')) { \r
+ if (appData.icsActive && (char)wParam > ' ' && !((char)wParam >= '1' && (char)wParam <= '9')) { \r
// [HGM] movenum: for non-zero digits we always do type-in dialog\r
HWND h = GetDlgItem(hwndConsole, OPT_ConsoleInput);\r
if (IsIconic(hwndConsole)) ShowWindow(hwndConsole, SW_RESTORE);\r
EnginePlayOptionsPopup(hwnd);\r
break;\r
\r
+ case IDM_Engine1Options:\r
+ EngineOptionsPopup(hwnd, &first);\r
+ break;\r
+\r
+ case IDM_Engine2Options:\r
+ EngineOptionsPopup(hwnd, &second);\r
+ break;\r
+\r
case IDM_OptionsUCI:\r
UciOptionsPopup(hwnd);\r
break;\r
MyPlaySound(MySound *ms)\r
{\r
BOOLEAN ok = FALSE;\r
- if(appData.debugMode) fprintf(debugFP, "make sound %s %x %d\n", ms->name, ms, ms->name[0]);\r
+\r
switch (ms->name[0]) {\r
case NULLCHAR:\r
if(appData.debugMode) fprintf(debugFP, "silence\n");\r
/* Center the dialog over the application window */\r
CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));\r
SetDlgItemText(hDlg, ABOUTBOX_Version, programVersion);\r
+ JAWS_COPYRIGHT\r
return (TRUE);\r
\r
case WM_COMMAND: /* message: received a command */\r