X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=callback.c;h=cd831535fdcb208b02fb39d4f822f207bf6842c1;hb=9363a0417ee37bcbe98656aa3054c62b5fedc195;hp=0f6ce91a1014b5bf35e6b3469b70b05141567865;hpb=03e79d233e26f97d1c214f326cc618e61af2302b;p=xboard.git diff --git a/callback.c b/callback.c index 0f6ce91..cd83153 100644 --- a/callback.c +++ b/callback.c @@ -175,6 +175,32 @@ void AboutProc (object, user_data) /* End Help Menu */ +/* Mode Menu */ + +void MachineWhiteProc(object, user_data) + GtkObject *object; + gpointer user_data; +{ + MachineWhiteEvent(); + return; +} + +void MachineBlackProc(object, user_data) + GtkObject *object; + gpointer user_data; +{ + MachineBlackEvent(); + return; +} + +void TwoMachinesProc(object, user_data) + GtkObject *object; + gpointer user_data; +{ + TwoMachinesEvent(); + return; +} + void IcsClientProc(object, user_data) GtkObject *object; gpointer user_data; @@ -183,6 +209,108 @@ void IcsClientProc(object, user_data) return; } +void +AnalyzeFileProc(object, user_data) + GtkObject *object; + gpointer user_data; +{ + if (!first.analysisSupport) + { + char buf[MSG_SIZ]; + snprintf(buf, sizeof(buf), _("%s does not support analysis"), first.tidy); + DisplayError(buf, 0); + return; + }; + Reset(FALSE, TRUE); + + if (!appData.showThinking) + ShowThinkingProc(NULL,NULL); + + AnalyzeFileEvent(); + FileNamePopUp(_("File to analyze"), "", LoadGamePopUp, "rb"); + AnalysisPeriodicEvent(1); + return; +} + +void +AnalyzeModeProc(object, user_data) + GtkObject *object; + gpointer user_data; +{ + char buf[MSG_SIZ]; + + if (!first.analysisSupport) + { + snprintf(buf, sizeof(buf), _("%s does not support analysis"), first.tidy); + DisplayError(buf, 0); + return; + } + /* [DM] icsEngineAnalyze [HGM] This is horrible code; reverse the gameMode and isEngineAnalyze tests! */ + 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; + } + /* 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(NULL,NULL); + + AnalyzeModeEvent(); + return; +} + +void +EditGameProc(object, user_data) + GtkObject *object; + gpointer user_data; +{ + EditGameEvent(); + return; +} + +void +EditPositionProc(object, user_data) + GtkObject *object; + gpointer user_data; +{ + EditPositionEvent(); + return; +} + +void +TrainingProc(object, user_data) + GtkObject *object; + gpointer user_data; +{ + TrainingEvent(); + return; +} + + + +/* End Mode Menu */ + /* * File menu */ @@ -277,56 +405,9 @@ SavePositionProc(object, user_data) return; } -void -AnalyzeFileProc(object, user_data) - GtkObject *object; - gpointer user_data; -{ - if (!first.analysisSupport) - { - char buf[MSG_SIZ]; - snprintf(buf, sizeof(buf), _("%s does not support analysis"), first.tidy); - DisplayError(buf, 0); - return; - }; - Reset(FALSE, TRUE); - - if (!appData.showThinking) - ShowThinkingProc(NULL,NULL); - - AnalyzeFileEvent(); - FileNamePopUp(_("File to analyze"), "", LoadGamePopUp, "rb"); - AnalysisPeriodicEvent(1); - return; -} - /* End File Menu */ -void MachineWhiteProc(object, user_data) - GtkObject *object; - gpointer user_data; -{ - MachineWhiteEvent(); - return; -} - -void MachineBlackProc(object, user_data) - GtkObject *object; - gpointer user_data; -{ - MachineBlackEvent(); - return; -} - -void TwoMachinesProc(object, user_data) - GtkObject *object; - gpointer user_data; -{ - TwoMachinesEvent(); - return; -} - void AcceptProc(object, user_data) GtkObject *object; gpointer user_data;