*
* Copyright 2005 Alessandro Scotti
*
+ * Enhancements Copyright 1995, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ *
* ------------------------------------------------------------------------
*
* GNU XBoard is free software: you can redistribute it and/or modify
#include "backend.h"
#include "moves.h"
#include "engineoutput.h"
+#include "gettext.h"
+
+#ifdef ENABLE_NLS
+# define _(s) gettext (s)
+# define N_(s) gettext_noop (s)
+#else
+# define _(s) (s)
+# define N_(s) s
+#endif
typedef struct {
char * name;
extern int initialRulePlies;
-void MakeEngineOutputTitle()
+void
+MakeEngineOutputTitle ()
{
static char buf[MSG_SIZ];
static char oldTitle[MSG_SIZ];
- char *title = "Engine Output";
+ char title[MSG_SIZ];
int count, rule = 2*appData.ruleMoves;
+
+ snprintf(title, MSG_SIZ, _("Engine Output") );
+
+ if(!EngineOutputIsUp()) return;
// figure out value of 50-move counter
count = currentMove;
while( (signed char)boards[count][EP_STATUS] <= EP_NONE && count > backwardMostMove ) count--;
if( count == backwardMostMove ) count -= initialRulePlies;
count = currentMove - count;
- snprintf(buf, MSG_SIZ, "%s (%d reversible plies)", title, count);
if(!rule) rule = 100;
- if(count >= rule - 40 && !appData.icsActive) title = buf;
+ if(count >= rule - 40 && (!appData.icsActive || gameMode == IcsObserving)) {
+ snprintf(buf, MSG_SIZ, _("%s (%d reversible plies)"), title, count);
+ safeStrCpy(title, buf, MSG_SIZ);
+ }
if(!strcmp(oldTitle, title)) return;
safeStrCpy(oldTitle, title, MSG_SIZ);
SetEngineOutputTitle(title);
}
// back end, due to front-end wrapper for SetWindowText, and new SetIcon arguments
-void SetEngineState( int which, int state, char * state_data )
+void
+SetEngineState (int which, int state, char * state_data)
{
int x_which = 1 - which;
}
// back end, now the front-end wrapper ClearMemo is used, and ed no longer contains handles.
-void SetProgramStats( FrontEndProgramStats * stats ) // now directly called by back-end
+void
+SetProgramStats (FrontEndProgramStats * stats) // now directly called by back-end
{
EngineOutputData ed;
int clearMemo = FALSE;
#define ENGINE_COLOR_UNKNOWN ' '
// pure back end
-static char GetEngineColor( int which )
+static char
+GetEngineColor (int which)
{
char result = ENGINE_COLOR_UNKNOWN;
}
// pure back end
-static char GetActiveEngineColor()
+static char
+GetActiveEngineColor ()
{
char result = ENGINE_COLOR_UNKNOWN;
}
// pure back end
-static int IsEnginePondering( int which )
+static int
+IsEnginePondering (int which)
{
int result = FALSE;
}
// back end
-static void SetDisplayMode( int mode )
+static void
+SetDisplayMode (int mode)
{
if( windowMode != mode ) {
windowMode = mode;
}
// pure back end
-static void VerifyDisplayMode()
+static void
+VerifyDisplayMode ()
{
int mode;
}
// back end. Determine what icon to set in the color-icon field, and print it
-void SetEngineColorIcon( int which )
+void
+SetEngineColorIcon (int which)
{
char color = GetEngineColor(which);
int nicon = 0;
// [HGM] multivar: sort Thinking Output within one depth on score
-static int InsertionPoint( int len, EngineOutputData * ed )
+static int
+InsertionPoint (int len, EngineOutputData *ed)
{
int i, offs = 0, newScore = ed->score, n = ed->which;
// pure back end, now SetWindowText is called via wrapper DoSetWindowText
-static void UpdateControls( EngineOutputData * ed )
+static void
+UpdateControls (EngineOutputData *ed)
{
// int isPondering = FALSE;
}
// [HGM] kibitz: write kibitz line; split window for it if necessary
-void OutputKibitz(int window, char *text)
+void
+OutputKibitz (int window, char *text)
{
static int currentLineEnd[2];
int where = 0;