{ "showButtonBar", "showButtonBar", XtRBoolean,
sizeof(Boolean), XtOffset(AppDataPtr, showButtonBar),
XtRImmediate, (XtPointer) True },
+ /* icsEngineAnalyze */
+ {"icsEngineAnalyze", "icsEngineAnalyze", XtRBoolean,
+ sizeof(Boolean), XtOffset(AppDataPtr, icsEngineAnalyze),
+ XtRImmediate, (XtPointer) False },
};
XrmOptionDescRec shellOptions[] = {
XtGetApplicationResources(shellWidget, (XtPointer) &appData,
clientResources, XtNumber(clientResources),
NULL, 0);
-
+
+ if (appData.debugMode) {
+ if ((debugFP = fopen("xboard.debug", "w")) == NULL) {
+ printf(_("Failed to open file xboard.debug \n"));
+ exit(errno);
+ }
+ setbuf(debugFP, NULL);
+ }
+
#if !HIGHDRAG
/* This feature does not work; animation needs a rewrite */
appData.highlightDragging = FALSE;
}
XtAppMainLoop(appContext);
+ if (appData.debugMode) fclose(debugFP);
+
return 0;
}
void SetICSMode()
{
SetMenuEnables(icsEnables);
+
+ #ifdef ZIPPY
+ /* icsEngineAnalyze */
+ if (appData.zippyPlay && !appData.noChessProgram)
+ XtSetSensitive(XtNameToWidget(menuBarWidget, "menuMode.Analysis Mode"), True);
+ #endif
}
void
XtPopdown(analysisShell);
XSync(xDisplay, False);
analysisUp = False;
+ /* icsEngineAnalyze */
+ if (appData.icsEngineAnalyze) ExitAnalyzeMode();
}
gameMode == Training || gameMode == PlayFromGameFile);
}
-
/*
* Button/menu procedures
*/
String *prms;
Cardinal *nprms;
{
+ char buf[MSG_SIZ];
+
if (!first.analysisSupport) {
- char buf[MSG_SIZ];
sprintf(buf, _("%s does not support analysis"), first.tidy);
DisplayError(buf, 0);
return;
}
+ /* icsEngineAnalyze */
+ if (appData.icsActive) {
+ if (gameMode != IcsObserving) {
+ sprintf(buf,_("You are not observing a game"));
+ DisplayError(buf, 0);
+ /* secure check */
+ if (appData.icsEngineAnalyze) {
+ if (appData.debugMode)
+ fprintf(debugFP, _("Found unexpected active ICS engine analyze \n"));
+ ExitAnalyzeMode();
+ ModeHighlight();
+ return;
+ }
+ return;
+ } else {
+ /* if enable, use want disable icsEngineAnalyze */
+ if (appData.icsEngineAnalyze) {
+ ExitAnalyzeMode();
+ ModeHighlight();
+ return;
+ }
+ appData.icsEngineAnalyze = TRUE;
+ if (appData.debugMode)
+ fprintf(debugFP, "ICS engine analyze starting... \n");
+ }
+ }
if (!appData.showThinking)
ShowThinkingProc(w,event,prms,nprms);
-
AnalyzeModeEvent();
}
XtPointer arg;
XtIntervalId *id;
{
- if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) {
+ if (gameMode == AnalyzeMode || gameMode == AnalyzeFile
+ || appData.icsEngineAnalyze) {
AnalysisPeriodicEvent(0);
StartAnalysisClock();
}