From 3f80235a86adc78d425d3f230bcfab590e22fa46 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Sat, 10 Oct 2009 10:47:40 -0700 Subject: [PATCH] moved show/hide thinking procs to gtk --- callback.c | 20 ++++++++++++++++++++ callback.h | 2 ++ gtk-interface.xml | 1 + xboard.c | 46 +++++----------------------------------------- 4 files changed, 28 insertions(+), 41 deletions(-) diff --git a/callback.c b/callback.c index 23f27e8..e878dfc 100644 --- a/callback.c +++ b/callback.c @@ -345,6 +345,26 @@ void RetractMoveProc(object, user_data) } /* Option Menu */ +void ShowThinkingProc(object, user_data) + GtkObject *object; + gpointer user_data; +{ + appData.showThinking = !appData.showThinking; + ShowThinkingEvent(); + + return; +} + +void HideThinkingProc(object, user_data) + GtkObject *object; + gpointer user_data; +{ + appData.hideThinkingFromHuman = !appData.hideThinkingFromHuman; + ShowThinkingEvent(); + + return; +} + void FlipViewProc(object, user_data) GtkObject *object; gpointer user_data; diff --git a/callback.h b/callback.h index 15b9222..c6e7714 100644 --- a/callback.h +++ b/callback.h @@ -31,6 +31,8 @@ void MoveNowProc P((GtkObject *object, gpointer user_data)); void RetractMoveProc P((GtkObject *object, gpointer user_data)); /* Option Menu */ +void ShowThinkingProc P((GtkObject *object, gpointer user_data)); +void HideThinkingProc P((GtkObject *object, gpointer user_data)); void FlipViewProc P((GtkObject *object, gpointer user_data)); void GetMoveListProc P((GtkObject *object, gpointer user_data)); diff --git a/gtk-interface.xml b/gtk-interface.xml index ab24899..fd90471 100644 --- a/gtk-interface.xml +++ b/gtk-interface.xml @@ -733,6 +733,7 @@ True Show Thinking True + diff --git a/xboard.c b/xboard.c index 86409b5..9ad61d2 100644 --- a/xboard.c +++ b/xboard.c @@ -361,10 +361,6 @@ void PopupExitMessageProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); void PremoveProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); void QuietPlayProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void ShowThinkingProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void HideThinkingProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); void TestLegalityProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); void AboutGameProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); @@ -731,7 +727,7 @@ MenuItem optionsMenu[] = { {N_("Popup Move Errors"), PopupMoveErrorsProc}, {N_("Premove"), PremoveProc}, {N_("Quiet Play"), QuietPlayProc}, - {N_("Hide Thinking"), HideThinkingProc}, + // {N_("Hide Thinking"), HideThinkingProc}, {N_("Test Legality"), TestLegalityProc}, {NULL, NULL} }; @@ -1891,8 +1887,8 @@ XtActionsRec boardActions[] = { { "PopupMoveErrorsProc", PopupMoveErrorsProc }, { "PremoveProc", PremoveProc }, { "QuietPlayProc", QuietPlayProc }, - { "ShowThinkingProc", ShowThinkingProc }, - { "HideThinkingProc", HideThinkingProc }, + // { "ShowThinkingProc", ShowThinkingProc }, + // { "HideThinkingProc", HideThinkingProc }, { "TestLegalityProc", TestLegalityProc }, // { "InfoProc", InfoProc }, // { "ManProc", ManProc }, @@ -5530,7 +5526,7 @@ void AnalyzeModeProc(w, event, prms, nprms) fprintf(debugFP, _("ICS engine analyze starting... \n")); } if (!appData.showThinking) - ShowThinkingProc(w,event,prms,nprms); + ShowThinkingProc(NULL,NULL); AnalyzeModeEvent(); } @@ -5550,7 +5546,7 @@ void AnalyzeFileProc(w, event, prms, nprms) Reset(FALSE, TRUE); if (!appData.showThinking) - ShowThinkingProc(w,event,prms,nprms); + ShowThinkingProc(NULL,NULL); AnalyzeFileEvent(); FileNamePopUp(_("File to analyze"), "", LoadGamePopUp, "rb"); @@ -6072,38 +6068,6 @@ void QuietPlayProc(w, event, prms, nprms) args, 1); } -void ShowThinkingProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ - Arg args[16]; - - appData.showThinking = !appData.showThinking; // [HGM] thinking: tken out of ShowThinkingEvent - ShowThinkingEvent(); -} - -void HideThinkingProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ - Arg args[16]; - - appData.hideThinkingFromHuman = !appData.hideThinkingFromHuman; // [HGM] thinking: tken out of ShowThinkingEvent - ShowThinkingEvent(); - - if (appData.hideThinkingFromHuman) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Hide Thinking"), - args, 1); -} - void DebugProc(w, event, prms, nprms) Widget w; XEvent *event; -- 1.7.0.4