Connect CommentClick handler
[xboard.git] / xaw / xboard.c
index 7669269..5bf3b0c 100644 (file)
@@ -202,8 +202,6 @@ extern char *getenv();
 #include "childio.h"
 #include "xgamelist.h"
 #include "xhistory.h"
-#include "xevalgraph.h"
-#include "xedittags.h"
 #include "menus.h"
 #include "board.h"
 #include "dialogs.h"
@@ -1267,7 +1265,6 @@ main (int argc, char **argv)
       XtSetArg(args[1], XtNforeground, &buttonForegroundPixel);
       XtGetValues(optList[W_PAUSE].handle, args, 2);
     }
-    AppendEnginesToMenu(appData.recentEngineList);
 
     xBoardWindow = XtWindow(boardWidget);
 
@@ -1625,18 +1622,6 @@ KeyBindingProc (Widget w, XEvent *event, String *prms, Cardinal *nprms)
     if(item) ((MenuProc *) item->proc) ();
 }
 
-static void
-MenuEngineSelect (Widget w, caddr_t addr, caddr_t index)
-{
-    RecentEngineEvent((int) (intptr_t) addr);
-}
-
-void
-AppendMenuItem (char *msg, int n)
-{
-    CreateMenuItem((Widget) optList[W_ENGIN].textValue, msg, (XtCallbackProc) MenuEngineSelect, n);
-}
-
 void
 SetupDropMenu ()
 {
@@ -1796,7 +1781,7 @@ HandlePV (Widget w, XEvent * event, String * params, Cardinal * nParams)
     MovePV(event->xmotion.x, event->xmotion.y, lineGap + BOARD_HEIGHT * (squareSize + lineGap));
 }
 
-static int savedIndex;  /* gross that this is global */
+extern int savedIndex;  /* gross that this is global */
 
 void
 CommentClick (Widget w, XEvent * event, String * params, Cardinal * nParams)
@@ -1813,27 +1798,6 @@ CommentClick (Widget w, XEvent * event, String * params, Cardinal * nParams)
        LoadVariation( index, val ); // [HGM] also does the actual moving to it, now
 }
 
-void
-EditCommentPopUp (int index, char *title, char *text)
-{
-    savedIndex = index;
-    if (text == NULL) text = "";
-    NewCommentPopup(title, text, index);
-}
-
-void
-CommentPopUp (char *title, char *text)
-{
-    savedIndex = currentMove; // [HGM] vari
-    NewCommentPopup(title, text, currentMove);
-}
-
-void
-CommentPopDown ()
-{
-    PopDown(CommentDlg);
-}
-
 
 /* Disable all user input other than deleting the window */
 static int frozen = 0;
@@ -2403,6 +2367,19 @@ SetClockIcon (int color)
     }
 }
 
+#define INPUT_SOURCE_BUF_SIZE 8192
+
+typedef struct {
+    CPKind kind;
+    int fd;
+    int lineByLine;
+    char *unused;
+    InputCallback func;
+    XtInputId xid;
+    char buf[INPUT_SOURCE_BUF_SIZE];
+    VOIDSTAR closure;
+} InputSource;
+
 void
 DoInputCallback (caddr_t closure, int *source, XtInputId *xid)
 {