Merge branch 'master' into gtk
authorArun Persaud <arun@nubati.net>
Sat, 3 Oct 2009 17:48:41 +0000 (10:48 -0700)
committerArun Persaud <arun@nubati.net>
Sat, 3 Oct 2009 17:55:50 +0000 (10:55 -0700)
Conflicts:
Makefile.am
backend.c
configure.ac
xboard.c

1  2 
Makefile.am
backend.c
xboard.c
xengineoutput.c

diff --cc Makefile.am
@@@ -1,18 -1,43 +1,46 @@@
  
  if ZIPPY
-   ZPY = zippy.c
- else 
+   ZPY = zippy.c zippy.h
+ else
    ZPY =
- endif 
+ endif
  
  bin_PROGRAMS = xboard
- xboard_SOURCES = backend.c lists.c pgntags.c xedittags.c xhistory.c $(ZPY) childio.c moves.c uci.c xengineoutput.c xoptions.c gamelist.c parser.l xboard.c xgamelist.c book.c callback.c interface.c
++
+ xboard_SOURCES = backend.c backend.h backendz.h \
+                book.c \
++               callback.c\
+                childio.c childio.h \
+                common.h \
+                frontend.h \
+                gamelist.c \
+                gettext.h  \
++               interface.c    \
+                lists.c lists.h \
+                moves.c moves.h \
+                parser.l parser.h \
+                pgntags.c \
+                uci.c \
+                xboard.c xboard.h \
+                xedittags.c xedittags.h \
+                xengineoutput.c \
+                xgamelist.c xgamelist.h\
+                xhistory.c  xhistory.h \
+                xoptions.c \
+                $(ZPY)
 -xboard_LDADD = -lm @X_PRE_LIBS@ @XAW_LIBS@ @X_LIBS@ @X_EXTRA_LIBS@
++xboard_LDADD = -lm  @XAW_LIBS@ @GTK_LIBS@
+ EXTRA_DIST = pixmaps  bitmaps shogibitmaps \
+       xboard.texi gpl.texinfo texi2man texinfo.tex xboard.man \
+       COPYRIGHT FAQ.html engine-intf.html ics-parsing.txt readme.htm readme_HGM.txt zippy.README
+ DISTCLEANFILES = stamp-h
  
 -AM_CPPFLAGS=-DINFODIR='"$(infodir)"' @X_CFLAGS@
 +AM_CPPFLAGS=-DINFODIR='"$(infodir)"' @GTK_CFLAGS@
- AM_LDFLAGS= -lm @X_PRE_LIBS@ @XAW_LIBS@ @X_LIBS@ @X_EXTRA_LIBS@ @GTK_LIBS@
  
- info_TEXINFOS = copyright.texi xboard.texi
- man6_MANS = xboard.man 
+ info_TEXINFOS =  xboard.texi
+ xboard_TEXINFOS =  copyright.texi 
+ man6_MANS = xboard.man
  
  xboard.man: xboard.texi copyright.texi gpl.texinfo version.texi
-       $(srcdir)/texi2man xboard.texi > xboard.man || (rm -f xboard.man ; false)
+       $(srcdir)/texi2man $(srcdir)/xboard.texi > xboard.man || (rm -f xboard.man ; false)
diff --cc backend.c
+++ b/backend.c
@@@ -465,8 -467,9 +467,9 @@@ int   nrCastlingRights; // For TwoKings
  int   initialRulePlies, FENrulePlies;
  char  FENepStatus;
  FILE  *serverMoves = NULL; // next two for broadcasting (/serverMoves option)
 -int loadFlag = 0; 
 +int loadFlag = 0;
  int shuffleOpenings;
+ int mute; // mute all sounds
  
  ChessSquare  FIDEArray[2][BOARD_SIZE] = {
      { WhiteRook, WhiteKnight, WhiteBishop, WhiteQueen,
@@@ -5425,12 -5448,14 +5496,14 @@@ UserMoveEvent(fromX, fromY, toX, toY, p
         slip a promotion popup in between. But that it always needs two
         calls, to the first part, (now called UserMoveTest() ), and to
         FinishMove if the first part succeeded. Calls that do not need
 -       to do anything in between, can call this routine the old way. 
 +       to do anything in between, can call this routine the old way.
      */
-   ChessMove moveType = UserMoveTest(fromX, fromY, toX, toY, promoChar);
-   if(appData.debugMode) fprintf(debugFP, "moveType 4 = %d, promochar = %x\n", moveType, promoChar);
-   if(moveType != ImpossibleMove)
-     FinishMove(moveType, fromX, fromY, toX, toY, promoChar);
+     ChessMove moveType = UserMoveTest(fromX, fromY, toX, toY, promoChar);
+ if(appData.debugMode) fprintf(debugFP, "moveType 4 = %d, promochar = %x\n", moveType, promoChar);
+     if(moveType == AmbiguousMove)
+       DrawPosition(FALSE, boards[currentMove]);
+     else if(moveType != ImpossibleMove)
+         FinishMove(moveType, fromX, fromY, toX, toY, promoChar);
  }
  
  void SendProgramStatsToFrontend( ChessProgramState * cps, ChessProgramStats * cpstats )
@@@ -8274,8 -8291,8 +8348,9 @@@ Reset(redraw, init
      ExitAnalyzeMode();
      gameMode = BeginningOfGame;
      ModeHighlight();
 +
      if(appData.icsActive) gameInfo.variant = VariantNormal;
+     currentMove = forwardMostMove = backwardMostMove = 0;
      InitPosition(redraw);
      for (i = 0; i < MAX_MOVES; i++) {
        if (commentList[i] != NULL) {
diff --cc xboard.c
+++ b/xboard.c
@@@ -6668,11 -8142,15 +6672,14 @@@ FireDelayedEvent(data
  
  void
  ScheduleDelayedEvent(cb, millisec)
 -     DelayedEventCallback cb; long millisec;
 +     DelayedEventCallback cb; guint millisec;
  {
 -    if(delayedEventTimerXID && delayedEventCallback == cb)
++    if(delayedEventTimerTag && delayedEventCallback == cb)
+       // [HGM] alive: replace, rather than add or flush identical event
 -      XtRemoveTimeOut(delayedEventTimerXID);
++      g_source_remove(delayedEventTimerTag);
      delayedEventCallback = cb;
 -    delayedEventTimerXID =
 -      XtAppAddTimeOut(appContext, millisec,
 -                    (XtTimerCallbackProc) FireDelayedEvent, (XtPointer) 0);
 +    delayedEventTimerTag = g_timeout_add(millisec,(GSourceFunc) FireDelayedEvent, NULL);
 +    return;
  }
  
  DelayedEventCallback
diff --cc xengineoutput.c
Simple merge