updated INSTALL file to add ./autogen.sh
[xboard.git] / xengineoutput.c
index 6fe9931..29e987e 100644 (file)
@@ -3,22 +3,28 @@
  *\r
  * Author: Alessandro Scotti (Dec 2005)\r
  *\r
+ * Copyright 2005 Alessandro Scotti\r
+ *\r
+ * Enhancements Copyright 2009 Free Software Foundation, Inc.\r
+ *\r
  * ------------------------------------------------------------------------\r
- * This program is free software; you can redistribute it and/or modify\r
+ *\r
+ * GNU XBoard is free software: you can redistribute it and/or modify\r
  * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
+ * the Free Software Foundation, either version 3 of the License, or (at\r
+ * your option) any later version.\r
  *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
+ * GNU XBoard is distributed in the hope that it will be useful, but\r
+ * WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+ * General Public License for more details.\r
  *\r
  * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+ * along with this program. If not, see http://www.gnu.org/licenses/.\r
+ *\r
  * ------------------------------------------------------------------------\r
- */\r
+ ** See the file ChangeLog for a revision history.  */\r
+\r
 #include "config.h"\r
 \r
 #include <stdio.h>\r
@@ -952,13 +958,22 @@ EngineOutputProc(w, event, prms, nprms)
 }\r
 \r
 // [HGM] kibitz: write kibitz line; split window for it if necessary\r
-void OutputKibitz(char *text)\r
+void OutputKibitz(int window, char *text)\r
 {\r
        if(!EngineOutputIsUp()) return;\r
-       if(!opponentKibitzes) DoClearMemo(1);\r
-       opponentKibitzes = TRUE; // thas causes split window DisplayMode in ICS modes.\r
+       if(!opponentKibitzes) { // on first kibitz of game, clear memos\r
+           DoClearMemo(1);\r
+           if(gameMode == IcsObserving) DoClearMemo(0);\r
+       }\r
+       opponentKibitzes = TRUE; // this causes split window DisplayMode in ICS modes.\r
        VerifyDisplayMode();\r
-       DoSetWindowText(1, nLabel, gameMode == IcsPlayingWhite ? gameInfo.black : gameInfo.white); // opponent name\r
-       SetIcon( 1, nColorIcon,  gameMode == IcsPlayingWhite ? nColorBlack : nColorWhite);\r
-       InsertIntoMemo(1, text);\r
+       if(gameMode == IcsObserving) {\r
+           DoSetWindowText(0, nLabel, gameInfo.white);\r
+           SetIcon( 0, nColorIcon,  nColorWhite);\r
+           SetIcon( 0, nStateIcon,  nClear);\r
+       }\r
+       DoSetWindowText(1, nLabel, gameMode == IcsPlayingBlack ? gameInfo.white : gameInfo.black); // opponent name\r
+       SetIcon( 1, nColorIcon,  gameMode == IcsPlayingBlack ? nColorWhite : nColorBlack);\r
+       SetIcon( 1, nStateIcon,  nClear);\r
+       InsertIntoMemo(window-1, text);\r
 }\r