Redo Eval Graph with generic popup
[xboard.git] / xboard.c
index ada34c2..9e89d57 100644 (file)
--- a/xboard.c
+++ b/xboard.c
@@ -206,6 +206,7 @@ extern char *getenv();
 #include "menus.h"
 #include "board.h"
 #include "dialogs.h"
+#include "engineoutput.h"
 #include "usystem.h"
 #include "gettext.h"
 
@@ -260,10 +261,6 @@ void AnimateUserMove P((Widget w, XEvent * event,
                     String * params, Cardinal * nParams));
 void HandlePV P((Widget w, XEvent * event,
                     String * params, Cardinal * nParams));
-void SelectPV P((Widget w, XEvent * event,
-                    String * params, Cardinal * nParams));
-void StopPV P((Widget w, XEvent * event,
-                    String * params, Cardinal * nParams));
 void WhiteClock P((Widget w, XEvent *event,
                   String *prms, Cardinal *nprms));
 void BlackClock P((Widget w, XEvent *event,
@@ -312,7 +309,7 @@ Widget shellWidget, layoutWidget, formWidget, boardWidget, messageWidget,
   commentShell, whitePieceMenu, blackPieceMenu, dropMenu,
   menuBarWidget, buttonBarWidget, editShell, errorShell, analysisShell,
   ICSInputShell, fileNameShell;
-Widget historyShell, evalGraphShell, gameListShell;
+Widget historyShell;
 XSegment secondSegments[BOARD_RANKS + BOARD_FILES + 2];
 XSegment gridSegments[BOARD_RANKS + BOARD_FILES + 2];
 #if ENABLE_NLS
@@ -522,10 +519,6 @@ XtActionsRec boardActions[] = {
     { "TempBackwardProc", TempBackwardProc },
     { "TempForwardProc", TempForwardProc },
     { "CommentClick", (XtActionProc) CommentClick },
-    { "GameListPopDown", (XtActionProc) GameListPopDown },
-    { "GameListOptionsPopDown", (XtActionProc) GameListOptionsPopDown },
-    { "EngineOutputPopDown", (XtActionProc) EngineOutputPopDown },
-    { "EvalGraphPopDown", (XtActionProc) EvalGraphPopDown },
     { "GenericPopDown", (XtActionProc) GenericPopDown },
     { "ErrorPopDown", (XtActionProc) ErrorPopDown },
     { "CopyMemoProc", (XtActionProc) CopyMemoProc },
@@ -808,9 +801,6 @@ BoardToTop ()
 #define OPTCHAR "-"
 #define SEPCHAR " "
 
-// these two must some day move to frontend.h, when they are implemented
-Boolean GameListIsUp();
-
 // The option definition and parsing code common to XBoard and WinBoard is collected in this file
 #include "args.h"
 
@@ -972,7 +962,6 @@ ParseCommPortSettings (char *s)
 { // no such option in XBoard (yet)
 }
 
-extern Widget engineOutputShell;
 int frameX, frameY;
 
 void
@@ -1002,10 +991,10 @@ GetWindowCoords ()
 { // wrapper to shield use of window handles from back-end (make addressible by number?)
   // In XBoard this will have to wait until awareness of window parameters is implemented
   GetActualPlacement(shellWidget, &wpMain);
-  if(EngineOutputIsUp()) GetActualPlacement(engineOutputShell, &wpEngineOutput);
-  if(MoveHistoryIsUp()) GetActualPlacement(shells[HistoryDlg], &wpMoveHistory);
-  if(EvalGraphIsUp()) GetActualPlacement(evalGraphShell, &wpEvalGraph);
-  if(GameListIsUp()) GetActualPlacement(gameListShell, &wpGameList);
+  if(shellUp[EngOutDlg]) GetActualPlacement(shells[EngOutDlg], &wpEngineOutput);
+  if(shellUp[HistoryDlg]) GetActualPlacement(shells[HistoryDlg], &wpMoveHistory);
+  if(shellUp[EvalGraphDlg]) GetActualPlacement(shells[EvalGraphDlg], &wpEvalGraph);
+  if(shellUp[GameListDlg]) GetActualPlacement(shells[GameListDlg], &wpGameList);
   if(shellUp[CommentDlg]) GetActualPlacement(shells[CommentDlg], &wpComment);
   if(shellUp[TagsDlg]) GetActualPlacement(shells[TagsDlg], &wpTags);
 }
@@ -3391,10 +3380,10 @@ DragProc ()
        if(wpNew.x == wpMain.x && wpNew.y == wpMain.y && // not moved
           wpNew.width == wpMain.width && wpNew.height == wpMain.height) // not sized
            return; // false alarm
-       if(EngineOutputIsUp()) CoDrag(engineOutputShell, &wpEngineOutput);
-       if(MoveHistoryIsUp()) CoDrag(shells[HistoryDlg], &wpMoveHistory);
-       if(EvalGraphIsUp()) CoDrag(evalGraphShell, &wpEvalGraph);
-       if(GameListIsUp()) CoDrag(gameListShell, &wpGameList);
+       if(shellUp[EngOutDlg]) CoDrag(shells[EngOutDlg], &wpEngineOutput);
+       if(shellUp[HistoryDlg]) CoDrag(shells[HistoryDlg], &wpMoveHistory);
+       if(shellUp[EvalGraphDlg]) CoDrag(shells[EvalGraphDlg], &wpEvalGraph);
+       if(shellUp[GameListDlg]) CoDrag(shells[GameListDlg], &wpGameList);
        wpMain = wpNew;
        DrawPosition(True, NULL);
        delayedDragID = 0; // now drag executed, make sure next DelayedDrag will not cancel timer event (which could now be used by other)