From: A. Scotti Date: Thu, 16 Apr 2009 21:12:48 +0000 (-0700) Subject: changes from Alessandro Scotti from 20060129 X-Git-Tag: v4.3.2~2 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=70ce586b8f06a35ee1eaf5e6202a01d1718c7311;p=xboard.git changes from Alessandro Scotti from 20060129 --- diff --git a/backend.c b/backend.c index 5fbe8f0..af1a7c5 100644 --- a/backend.c +++ b/backend.c @@ -4040,15 +4040,28 @@ FinishMove(moveType, fromX, fromY, toX, toY, promoChar) } } -void SendProgramStatsToFrontend( ChessProgramState * cps ) +void SendProgramStatsToFrontend( ChessProgramState * cps, ChessProgramStats * cpstats ) { - SetProgramStats( cps == &first ? 0 : 1, - programStats.depth, - programStats.nodes, - programStats.score, - programStats.time, - programStats.movelist, - lastHint ); + char * hint = lastHint; + FrontEndProgramStats stats; + + stats.which = cps == &first ? 0 : 1; + stats.depth = cpstats->depth; + stats.nodes = cpstats->nodes; + stats.score = cpstats->score; + stats.time = cpstats->time; + stats.pv = cpstats->movelist; + stats.hint = lastHint; + stats.an_move_index = 0; + stats.an_move_count = 0; + + if( gameMode == AnalyzeMode || gameMode == AnalyzeFile ) { + stats.hint = cpstats->move_name; + stats.an_move_index = cpstats->nr_moves - cpstats->moves_left; + stats.an_move_count = cpstats->nr_moves; + } + + SetProgramStats( &stats ); } void @@ -4109,6 +4122,7 @@ HandleMachineMove(message, cps) fprintf(debugFP, "Undoing extra move from %s, gameMode %d\n", cps->which, gameMode); } + SendToProgram("undo\n", cps); } return; @@ -4764,7 +4778,7 @@ HandleMachineMove(message, cps) programStats.line_is_book = 0; } - SendProgramStatsToFrontend( cps ); + SendProgramStatsToFrontend( cps, &programStats ); /* [AS] Protect the thinkOutput buffer from overflow... this @@ -4816,7 +4830,7 @@ HandleMachineMove(message, cps) isn't searching, so stats won't change) */ programStats.line_is_book = 1; - SendProgramStatsToFrontend( cps ); + SendProgramStatsToFrontend( cps, &programStats ); if (currentMove == forwardMostMove || gameMode==AnalyzeMode || gameMode == AnalyzeFile) { DisplayMove(currentMove - 1); @@ -4841,8 +4855,9 @@ HandleMachineMove(message, cps) programStats.nr_moves = mvtot; strcpy(programStats.move_name, mvname); programStats.ok_to_send = 1; + programStats.movelist[0] = '\0'; - SendProgramStatsToFrontend( cps ); + SendProgramStatsToFrontend( cps, &programStats ); DisplayAnalysis(); return; @@ -4890,6 +4905,8 @@ HandleMachineMove(message, cps) if (sscanf(message, "%d%c %d %d %lu %[^\n]\n", &plylev, &plyext, &curscore, &time, &nodes, buf1) >= 5) { + ChessProgramStats cpstats; + if (plyext != ' ' && plyext != '\t') { time *= 100; } @@ -4899,23 +4916,23 @@ HandleMachineMove(message, cps) curscore = -curscore; } - programStats.depth = plylev; - programStats.nodes = nodes; - programStats.time = time; - programStats.score = curscore; - programStats.got_only_move = 0; - programStats.movelist[0] = '\0'; + cpstats.depth = plylev; + cpstats.nodes = nodes; + cpstats.time = time; + cpstats.score = curscore; + cpstats.got_only_move = 0; + cpstats.movelist[0] = '\0'; if (buf1[0] != NULLCHAR) { - safeStrCpy( programStats.movelist, buf1, sizeof(programStats.movelist) ); + safeStrCpy( cpstats.movelist, buf1, sizeof(cpstats.movelist) ); } - programStats.ok_to_send = 0; - programStats.line_is_book = 0; - programStats.nr_moves = 0; - programStats.moves_left = 0; + cpstats.ok_to_send = 0; + cpstats.line_is_book = 0; + cpstats.nr_moves = 0; + cpstats.moves_left = 0; - SendProgramStatsToFrontend( cps ); + SendProgramStatsToFrontend( cps, &cpstats ); } } } @@ -7028,6 +7045,7 @@ SavePart(str) #define PGN_SIDE_WHITE 0 #define PGN_SIDE_BLACK 1 +/* [AS] */ static int FindFirstMoveOutOfBook( int side ) { int result = -1; @@ -7046,13 +7064,14 @@ static int FindFirstMoveOutOfBook( int side ) int score = pvInfoList[index].score; int in_book = 0; - if( depth == 0 ) { - in_book = 1; /* Yace */ - } - if( score == 0 ) { - if( depth <= 1 || depth == 63 /* Zappa */ ) { + if( depth <= 2 ) { in_book = 1; } + else if( score == 0 && depth == 63 ) { + in_book = 1; /* Zappa */ + } + else if( score == 2 && depth == 99 ) { + in_book = 1; /* Abrok */ } has_book_hit += in_book; @@ -7070,6 +7089,7 @@ static int FindFirstMoveOutOfBook( int side ) return result; } +/* [AS] */ void GetOutOfBookInfo( char * buf ) { int oob[2]; @@ -9629,7 +9649,10 @@ SendTimeRemaining(cps, machineWhite) if (time <= 0) time = 1; if (otime <= 0) otime = 1; - sprintf(message, "time %ld\notim %ld\n", time, otime); + sprintf(message, "time %ld\n", time); + SendToProgram(message, cps); + + sprintf(message, "otim %ld\n", otime); SendToProgram(message, cps); } diff --git a/bitmaps/analyze2_14.ico b/bitmaps/analyze2_14.ico new file mode 100644 index 0000000..8f725f1 Binary files /dev/null and b/bitmaps/analyze2_14.ico differ diff --git a/bitmaps/analyze_14.ico b/bitmaps/analyze_14.ico new file mode 100644 index 0000000..f25d0fb Binary files /dev/null and b/bitmaps/analyze_14.ico differ diff --git a/frontend.h b/frontend.h index 853c665..f3556e6 100644 --- a/frontend.h +++ b/frontend.h @@ -169,6 +169,18 @@ void FreezeUI P((void)); void ThawUI P((void)); extern char *programName; -void SetProgramStats P(( int which, int depth, unsigned long nodes, int score, int time, char * pv, char * hint )); /* [AS] */ +typedef struct FrontEndProgramStats_TAG { + int which; + int depth; + unsigned long nodes; + int score; + int time; + char * pv; + char * hint; + int an_move_index; + int an_move_count; +} FrontEndProgramStats; + +void SetProgramStats P(( FrontEndProgramStats * stats )); /* [AS] */ #endif diff --git a/winboard/defaults.h b/winboard/defaults.h index f129447..c90fd9e 100644 --- a/winboard/defaults.h +++ b/winboard/defaults.h @@ -177,6 +177,8 @@ #define EDITTAGS_FONT_COLOSSAL "Courier New:8.0" #define EDITTAGS_FONT_TITANIC "Courier New:8.0" +#define MOVEHISTORY_FONT_ALL "MS Sans Serif:8.0" + #define COLOR_SHOUT "#209000" #define COLOR_SSHOUT "b #289808" #define COLOR_CHANNEL1 "#2020E0" diff --git a/winboard/resource.h b/winboard/resource.h index 43b6a47..ae996c7 100644 --- a/winboard/resource.h +++ b/winboard/resource.h @@ -100,6 +100,8 @@ #define IDI_CLOCK_14 470 #define IDI_UNKNOWN_14 471 #define IDI_BALOON_14 472 +#define IDI_ANALYZE_14 473 +#define IDI_ANALYZE2_14 474 #define DLG_Promotion 500 #define PB_Queen 502 #define PB_Rook 503 @@ -370,8 +372,11 @@ #define OPT_ChooseCommentsFont 1417 #define OPT_ChooseConsoleFont 1418 #define OPT_DefaultFonts 1419 +#define OPT_ChooseMoveHistoryFont 1420 #define OPT_AutoRaiseBoard 1421 +#define OPT_SampleMoveHistoryFont 1421 #define OPT_ShowButtonBar 1422 +#define OPT_MessageFont6 1422 #define OPT_SaveExtPGN 1423 #define OPT_HideThinkFromHuman 1424 #define IDC_GameListDoFilter 1425 diff --git a/winboard/wengineoutput.c b/winboard/wengineoutput.c index cac4744..0eb7536 100644 --- a/winboard/wengineoutput.c +++ b/winboard/wengineoutput.c @@ -66,6 +66,7 @@ extern WindowPlacement wpEngineOutput; #define STATE_THINKING 0 #define STATE_IDLE 1 #define STATE_PONDERING 2 +#define STATE_ANALYZING 3 static int windowMode = 1; @@ -77,13 +78,13 @@ static HICON hiColorUnknown = NULL; static HICON hiClear = NULL; static HICON hiPondering = NULL; static HICON hiThinking = NULL; +static HICON hiAnalyzing = NULL; static int lastDepth[2] = { -1, -1 }; static int lastForwardMostMove[2] = { -1, -1 }; static int engineState[2] = { -1, -1 }; typedef struct { - int which; HWND hColorIcon; HWND hLabel; HWND hStateIcon; @@ -91,12 +92,15 @@ typedef struct { HWND hLabelNPS; HWND hMemo; char * name; + int which; int depth; unsigned long nodes; int score; int time; char * pv; char * hint; + int an_move_index; + int an_move_count; } EngineOutputData; static HICON LoadIconEx( int id ) @@ -113,6 +117,7 @@ static VOID InitializeEngineOutput() hiClear = LoadIconEx( IDI_TRANS_14 ); hiPondering = LoadIconEx( IDI_PONDER_14 ); hiThinking = LoadIconEx( IDI_CLOCK_14 ); + hiAnalyzing = LoadIconEx( IDI_ANALYZE2_14 ); needInit = FALSE; } } @@ -216,6 +221,29 @@ char GetActiveEngineColor() return result; } +static int IsEnginePondering( int which ) +{ + int result = FALSE; + + switch (gameMode) { + case MachinePlaysBlack: + case IcsPlayingBlack: + if( WhiteOnMove(forwardMostMove) ) result = TRUE; + break; + case MachinePlaysWhite: + case IcsPlayingWhite: + if( ! WhiteOnMove(forwardMostMove) ) result = TRUE; + break; + case TwoMachinesPlay: + if( GetActiveEngineColor() != ENGINE_COLOR_UNKNOWN ) { + if( GetEngineColor( which ) != GetActiveEngineColor() ) result = TRUE; + } + break; + } + + return result; +} + static VOID PositionControlSet( HWND hDlg, int x, int y, int clientWidth, int memoHeight, int idColor, int idEngineLabel, int idNPS, int idMemo, int idStateIcon, int idStateData ) { int label_x = x + ICON_SIZE + H_MARGIN; @@ -230,7 +258,7 @@ static VOID PositionControlSet( HWND hDlg, int x, int y, int clientWidth, int me int memo_y = y + ICON_SIZE + LABEL_V_DISTANCE; SetControlPos( hDlg, idColor, x, y, ICON_SIZE, ICON_SIZE ); - SetControlPos( hDlg, idEngineLabel, label_x, label_y, max_w / 2, label_h ); + SetControlPos( hDlg, idEngineLabel, label_x, label_y, state_icon_x - label_x, label_h ); SetControlPos( hDlg, idStateIcon, state_icon_x, y, ICON_SIZE, ICON_SIZE ); SetControlPos( hDlg, idStateData, state_data_x, label_y, state_data_w, label_h ); SetControlPos( hDlg, idNPS, nps_x, label_y, nps_w, label_h ); @@ -376,6 +404,9 @@ static SetEngineState( int which, int state, char * state_data ) case STATE_PONDERING: SetIcon( hStateIcon, hiPondering ); break; + case STATE_ANALYZING: + SetIcon( hStateIcon, hiAnalyzing ); + break; default: SetIcon( hStateIcon, hiClear ); break; @@ -391,6 +422,8 @@ static SetEngineState( int which, int state, char * state_data ) static VOID UpdateControls( EngineOutputData * ed ) { + BOOL isPondering = FALSE; + char s_label[MAX_NAME_LENGTH + 32]; char * name = ed->name; @@ -404,8 +437,7 @@ static VOID UpdateControls( EngineOutputData * ed ) s_label[ MAX_NAME_LENGTH-1 ] = '\0'; #ifdef SHOW_PONDERING - if( GetActiveEngineColor() != ENGINE_COLOR_UNKNOWN ) { - if( GetEngineColor(ed->which) != GetActiveEngineColor() ) { + if( IsEnginePondering( ed->which ) ) { char buf[8]; buf[0] = '\0'; @@ -429,9 +461,26 @@ static VOID UpdateControls( EngineOutputData * ed ) SetEngineState( ed->which, STATE_PONDERING, buf ); } - else { + else if( gameMode == TwoMachinesPlay ) { SetEngineState( ed->which, STATE_THINKING, "" ); } + else if( gameMode == AnalyzeMode || gameMode == AnalyzeFile ) { + char buf[64]; + int time_secs = ed->time / 100; + int time_mins = time_secs / 60; + + buf[0] = '\0'; + + if( ed->an_move_index != 0 && ed->an_move_count != 0 && *ed->hint != '\0' ) { + char mov[16]; + + strncpy( mov, ed->hint, sizeof(mov) ); + mov[ sizeof(mov)-1 ] = '\0'; + + sprintf( buf, "%d/%d: %s [%02d:%02d:%02d]", ed->an_move_index, ed->an_move_count, mov, time_mins / 60, time_mins % 60, time_secs % 60 ); + } + + SetEngineState( ed->which, STATE_ANALYZING, buf ); } else { SetEngineState( ed->which, STATE_IDLE, "" ); @@ -617,12 +666,23 @@ BOOL EngineOutputIsUp() return engineOutputDialogUp; } -VOID EngineOutputUpdate( int which, int depth, unsigned long nodes, int score, int time, char * pv, char * hint ) +VOID EngineOutputUpdate( FrontEndProgramStats * stats ) { EngineOutputData ed; BOOL clearMemo = FALSE; + int which; + int depth; + + if( stats == 0 ) { + SetEngineState( 0, STATE_IDLE, "" ); + SetEngineState( 1, STATE_IDLE, "" ); + return; + } + + which = stats->which; + depth = stats->depth; - if( which < 0 || which > 1 || depth < 0 || time < 0 || pv == 0 || *pv == '\0' ) { + if( which < 0 || which > 1 || depth < 0 || stats->time < 0 || stats->pv == 0 ) { return; } @@ -634,11 +694,13 @@ VOID EngineOutputUpdate( int which, int depth, unsigned long nodes, int score, i ed.which = which; ed.depth = depth; - ed.nodes = nodes; - ed.score = score; - ed.time = time; - ed.pv = pv; - ed.hint = hint; + ed.nodes = stats->nodes; + ed.score = stats->score; + ed.time = stats->time; + ed.pv = stats->pv; + ed.hint = stats->hint; + ed.an_move_index = stats->an_move_index; + ed.an_move_count = stats->an_move_count; /* Get target control */ if( which == 0 ) { @@ -677,8 +739,8 @@ VOID EngineOutputUpdate( int which, int depth, unsigned long nodes, int score, i lastDepth[which] = depth; lastForwardMostMove[which] = forwardMostMove; - if( pv[0] == ' ' ) { - if( strncmp( pv, " no PV", 6 ) == 0 ) { /* Hack on hack! :-O */ + if( ed.pv != 0 && ed.pv[0] == ' ' ) { + if( strncmp( ed.pv, " no PV", 6 ) == 0 ) { /* Hack on hack! :-O */ ed.pv = ""; } } diff --git a/winboard/whistory.c b/winboard/whistory.c index bab9332..60af898 100644 --- a/winboard/whistory.c +++ b/winboard/whistory.c @@ -53,6 +53,8 @@ extern HWND hwndMain; extern WindowPlacement wpMoveHistory; +extern BoardSize boardSize; + /* Module globals */ typedef char MoveHistoryString[ MOVE_LEN*2 ]; @@ -302,6 +304,9 @@ LRESULT CALLBACK HistoryDialogProc( HWND hDlg, UINT message, WPARAM wParam, LPAR SendDlgItemMessage( moveHistoryDialog, IDC_MoveHistory, EM_SETEVENTMASK, 0, ENM_MOUSEEVENTS ); + /* Set font */ + SendDlgItemMessage( moveHistoryDialog, IDC_MoveHistory, WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf, MAKELPARAM(TRUE, 0 )); + /* Restore window placement */ RestoreWindowPlacement( hDlg, &wpMoveHistory ); } diff --git a/winboard/winboard.c b/winboard/winboard.c index 1346da4..f9c566b 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -239,60 +239,24 @@ SizeInfo sizeInfo[] = #define MF(x) {x, {0, }, {0, }, 0} MyFont fontRec[NUM_SIZES][NUM_FONTS] = { - { MF(CLOCK_FONT_TINY), MF(MESSAGE_FONT_TINY), - MF(COORD_FONT_TINY), MF(CONSOLE_FONT_TINY), - MF(COMMENT_FONT_TINY), MF(EDITTAGS_FONT_TINY) }, - { MF(CLOCK_FONT_TEENY), MF(MESSAGE_FONT_TEENY), - MF(COORD_FONT_TEENY), MF(CONSOLE_FONT_TEENY), - MF(COMMENT_FONT_TEENY), MF(EDITTAGS_FONT_TEENY) }, - { MF(CLOCK_FONT_DINKY), MF(MESSAGE_FONT_DINKY), - MF(COORD_FONT_DINKY), MF(CONSOLE_FONT_DINKY), - MF(COMMENT_FONT_DINKY), MF(EDITTAGS_FONT_DINKY) }, - { MF(CLOCK_FONT_PETITE), MF(MESSAGE_FONT_PETITE), - MF(COORD_FONT_PETITE), MF(CONSOLE_FONT_PETITE), - MF(COMMENT_FONT_PETITE), MF(EDITTAGS_FONT_PETITE) }, - { MF(CLOCK_FONT_SLIM), MF(MESSAGE_FONT_SLIM), - MF(COORD_FONT_SLIM), MF(CONSOLE_FONT_SLIM), - MF(COMMENT_FONT_SLIM), MF(EDITTAGS_FONT_SLIM) }, - { MF(CLOCK_FONT_SMALL), MF(MESSAGE_FONT_SMALL), - MF(COORD_FONT_SMALL), MF(CONSOLE_FONT_SMALL), - MF(COMMENT_FONT_SMALL), MF(EDITTAGS_FONT_SMALL) }, - { MF(CLOCK_FONT_MEDIOCRE), MF(MESSAGE_FONT_MEDIOCRE), - MF(COORD_FONT_MEDIOCRE), MF(CONSOLE_FONT_MEDIOCRE), - MF(COMMENT_FONT_MEDIOCRE), MF(EDITTAGS_FONT_MEDIOCRE) }, - { MF(CLOCK_FONT_MIDDLING), MF(MESSAGE_FONT_MIDDLING), - MF(COORD_FONT_MIDDLING), MF(CONSOLE_FONT_MIDDLING), - MF(COMMENT_FONT_MIDDLING), MF(EDITTAGS_FONT_MIDDLING) }, - { MF(CLOCK_FONT_AVERAGE), MF(MESSAGE_FONT_AVERAGE), - MF(COORD_FONT_AVERAGE), MF(CONSOLE_FONT_AVERAGE), - MF(COMMENT_FONT_AVERAGE), MF(EDITTAGS_FONT_AVERAGE) }, - { MF(CLOCK_FONT_MODERATE), MF(MESSAGE_FONT_MODERATE), - MF(COORD_FONT_MODERATE), MF(CONSOLE_FONT_MODERATE), - MF(COMMENT_FONT_MODERATE), MF(EDITTAGS_FONT_MODERATE) }, - { MF(CLOCK_FONT_MEDIUM), MF(MESSAGE_FONT_MEDIUM), - MF(COORD_FONT_MEDIUM), MF(CONSOLE_FONT_MEDIUM), - MF(COMMENT_FONT_MEDIUM), MF(EDITTAGS_FONT_MEDIUM) }, - { MF(CLOCK_FONT_BULKY), MF(MESSAGE_FONT_BULKY), - MF(COORD_FONT_BULKY), MF(CONSOLE_FONT_BULKY), - MF(COMMENT_FONT_BULKY), MF(EDITTAGS_FONT_BULKY) }, - { MF(CLOCK_FONT_LARGE), MF(MESSAGE_FONT_LARGE), - MF(COORD_FONT_LARGE), MF(CONSOLE_FONT_LARGE), - MF(COMMENT_FONT_LARGE), MF(EDITTAGS_FONT_LARGE) }, - { MF(CLOCK_FONT_BIG), MF(MESSAGE_FONT_BIG), - MF(COORD_FONT_BIG), MF(CONSOLE_FONT_BIG), - MF(COMMENT_FONT_BIG), MF(EDITTAGS_FONT_BIG) }, - { MF(CLOCK_FONT_HUGE), MF(MESSAGE_FONT_HUGE), - MF(COORD_FONT_HUGE), MF(CONSOLE_FONT_HUGE), - MF(COMMENT_FONT_HUGE), MF(EDITTAGS_FONT_HUGE) }, - { MF(CLOCK_FONT_GIANT), MF(MESSAGE_FONT_GIANT), - MF(COORD_FONT_GIANT), MF(CONSOLE_FONT_GIANT), - MF(COMMENT_FONT_GIANT), MF(EDITTAGS_FONT_GIANT) }, - { MF(CLOCK_FONT_COLOSSAL), MF(MESSAGE_FONT_COLOSSAL), - MF(COORD_FONT_COLOSSAL), MF(CONSOLE_FONT_COLOSSAL), - MF(COMMENT_FONT_COLOSSAL), MF(EDITTAGS_FONT_COLOSSAL) }, - { MF(CLOCK_FONT_TITANIC), MF(MESSAGE_FONT_TITANIC), - MF(COORD_FONT_TITANIC), MF(CONSOLE_FONT_TITANIC), - MF(COMMENT_FONT_TITANIC), MF(EDITTAGS_FONT_TITANIC) }, + { MF(CLOCK_FONT_TINY), MF(MESSAGE_FONT_TINY), MF(COORD_FONT_TINY), MF(CONSOLE_FONT_TINY), MF(COMMENT_FONT_TINY), MF(EDITTAGS_FONT_TINY), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_TEENY), MF(MESSAGE_FONT_TEENY), MF(COORD_FONT_TEENY), MF(CONSOLE_FONT_TEENY), MF(COMMENT_FONT_TEENY), MF(EDITTAGS_FONT_TEENY), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_DINKY), MF(MESSAGE_FONT_DINKY), MF(COORD_FONT_DINKY), MF(CONSOLE_FONT_DINKY), MF(COMMENT_FONT_DINKY), MF(EDITTAGS_FONT_DINKY), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_PETITE), MF(MESSAGE_FONT_PETITE), MF(COORD_FONT_PETITE), MF(CONSOLE_FONT_PETITE), MF(COMMENT_FONT_PETITE), MF(EDITTAGS_FONT_PETITE), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_SLIM), MF(MESSAGE_FONT_SLIM), MF(COORD_FONT_SLIM), MF(CONSOLE_FONT_SLIM), MF(COMMENT_FONT_SLIM), MF(EDITTAGS_FONT_SLIM), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_SMALL), MF(MESSAGE_FONT_SMALL), MF(COORD_FONT_SMALL), MF(CONSOLE_FONT_SMALL), MF(COMMENT_FONT_SMALL), MF(EDITTAGS_FONT_SMALL), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_MEDIOCRE), MF(MESSAGE_FONT_MEDIOCRE), MF(COORD_FONT_MEDIOCRE), MF(CONSOLE_FONT_MEDIOCRE), MF(COMMENT_FONT_MEDIOCRE), MF(EDITTAGS_FONT_MEDIOCRE), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_MIDDLING), MF(MESSAGE_FONT_MIDDLING), MF(COORD_FONT_MIDDLING), MF(CONSOLE_FONT_MIDDLING), MF(COMMENT_FONT_MIDDLING), MF(EDITTAGS_FONT_MIDDLING), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_AVERAGE), MF(MESSAGE_FONT_AVERAGE), MF(COORD_FONT_AVERAGE), MF(CONSOLE_FONT_AVERAGE), MF(COMMENT_FONT_AVERAGE), MF(EDITTAGS_FONT_AVERAGE), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_MODERATE), MF(MESSAGE_FONT_MODERATE), MF(COORD_FONT_MODERATE), MF(CONSOLE_FONT_MODERATE), MF(COMMENT_FONT_MODERATE), MF(EDITTAGS_FONT_MODERATE), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_MEDIUM), MF(MESSAGE_FONT_MEDIUM), MF(COORD_FONT_MEDIUM), MF(CONSOLE_FONT_MEDIUM), MF(COMMENT_FONT_MEDIUM), MF(EDITTAGS_FONT_MEDIUM), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_BULKY), MF(MESSAGE_FONT_BULKY), MF(COORD_FONT_BULKY), MF(CONSOLE_FONT_BULKY), MF(COMMENT_FONT_BULKY), MF(EDITTAGS_FONT_BULKY), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_LARGE), MF(MESSAGE_FONT_LARGE), MF(COORD_FONT_LARGE), MF(CONSOLE_FONT_LARGE), MF(COMMENT_FONT_LARGE), MF(EDITTAGS_FONT_LARGE), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_BIG), MF(MESSAGE_FONT_BIG), MF(COORD_FONT_BIG), MF(CONSOLE_FONT_BIG), MF(COMMENT_FONT_BIG), MF(EDITTAGS_FONT_BIG), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_HUGE), MF(MESSAGE_FONT_HUGE), MF(COORD_FONT_HUGE), MF(CONSOLE_FONT_HUGE), MF(COMMENT_FONT_HUGE), MF(EDITTAGS_FONT_HUGE), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_GIANT), MF(MESSAGE_FONT_GIANT), MF(COORD_FONT_GIANT), MF(CONSOLE_FONT_GIANT), MF(COMMENT_FONT_GIANT), MF(EDITTAGS_FONT_GIANT), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_COLOSSAL), MF(MESSAGE_FONT_COLOSSAL), MF(COORD_FONT_COLOSSAL), MF(CONSOLE_FONT_COLOSSAL), MF(COMMENT_FONT_COLOSSAL), MF(EDITTAGS_FONT_COLOSSAL), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_TITANIC), MF(MESSAGE_FONT_TITANIC), MF(COORD_FONT_TITANIC), MF(CONSOLE_FONT_TITANIC), MF(COMMENT_FONT_TITANIC), MF(EDITTAGS_FONT_TITANIC), MF(MOVEHISTORY_FONT_ALL) }, }; MyFont *font[NUM_SIZES][NUM_FONTS]; @@ -452,7 +416,7 @@ BOOL EvalGraphIsUp(); VOID EngineOutputPopUp(); VOID EngineOutputPopDown(); BOOL EngineOutputIsUp(); -VOID EngineOutputUpdate( int which, int depth, unsigned long nodes, int score, int time, char * pv, char * hint ); +VOID EngineOutputUpdate( FrontEndProgramStats * stats ); /* * Setting "frozen" should disable all user input other than deleting @@ -912,6 +876,7 @@ ArgDescriptor argDescriptors[] = { { "tagsFont", ArgFont, (LPVOID) EDITTAGS_FONT, TRUE }, { "commentFont", ArgFont, (LPVOID) COMMENT_FONT, TRUE }, { "icsFont", ArgFont, (LPVOID) CONSOLE_FONT, TRUE }, + { "moveHistoryFont", ArgFont, (LPVOID) MOVEHISTORY_FONT, TRUE }, /* [AS] */ { "boardSize", ArgBoardSize, (LPVOID) &boardSize, TRUE }, /* must come after all fonts */ { "size", ArgBoardSize, (LPVOID) &boardSize, FALSE }, @@ -9471,16 +9436,16 @@ HistorySet( char movelist[][2*MOVE_LEN], int first, int last, int current ) EvalGraphSet( first, last, current, pvInfoList ); } -void SetProgramStats( int which, int depth, unsigned long nodes, int score, int time, char * pv, char * hint ) +void SetProgramStats( FrontEndProgramStats * stats ) { #if 0 char buf[1024]; sprintf( buf, "SetStats for %d: depth=%d, nodes=%lu, score=%5.2f, time=%5.2f, pv=%s\n", - which, depth, nodes, score / 100.0, time / 100.0, pv == 0 ? "n/a" : pv ); + stats->which, stats->depth, stats->nodes, stats->score / 100.0, stats->time / 100.0, stats->pv == 0 ? "n/a" : stats->pv ); OutputDebugString( buf ); #endif - EngineOutputUpdate( which, depth, nodes, score, time, pv, hint ); + EngineOutputUpdate( stats ); } diff --git a/winboard/winboard.rc b/winboard/winboard.rc index 9727241..250e604 100644 --- a/winboard/winboard.rc +++ b/winboard/winboard.rc @@ -597,33 +597,38 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,156,208,50,14 PUSHBUTTON "Cancel",IDCANCEL,212,208,50,14 PUSHBUTTON "Choose...",OPT_ChooseClockFont,212,15,45,15 - PUSHBUTTON "Choose...",OPT_ChooseMessageFont,212,45,45,15 - PUSHBUTTON "Choose...",OPT_ChooseCoordFont,212,75,45,15 - PUSHBUTTON "Choose...",OPT_ChooseTagFont,212,118,45,15 - PUSHBUTTON "Choose...",OPT_ChooseCommentsFont,212,148,45,15 - PUSHBUTTON "Choose...",OPT_ChooseConsoleFont,212,178,45,15 + PUSHBUTTON "Choose...",OPT_ChooseMessageFont,212,39,45,15 + PUSHBUTTON "Choose...",OPT_ChooseCoordFont,212,63,45,15 + PUSHBUTTON "Choose...",OPT_ChooseTagFont,212,101,45,15 + PUSHBUTTON "Choose...",OPT_ChooseCommentsFont,212,125,45,15 + PUSHBUTTON "Choose...",OPT_ChooseConsoleFont,212,149,45,15 + PUSHBUTTON "Choose...",OPT_ChooseMoveHistoryFont,212,174,45,15 PUSHBUTTON "&Defaults",OPT_DefaultFonts,3,208,50,15 CONTROL "",OPT_SampleCoordFont,"RICHEDIT",ES_READONLY | - WS_DISABLED | WS_BORDER,67,71,140,20 + WS_DISABLED | WS_BORDER,67,59,140,20 CONTROL "",OPT_SampleTagFont,"RICHEDIT",ES_READONLY | - WS_DISABLED | WS_BORDER,67,114,140,20 + WS_DISABLED | WS_BORDER,67,97,140,20 CONTROL "",OPT_SampleCommentsFont,"RICHEDIT",ES_READONLY | - WS_DISABLED | WS_BORDER,67,144,140,20 + WS_DISABLED | WS_BORDER,67,121,140,20 CONTROL "",OPT_SampleConsoleFont,"RICHEDIT",ES_READONLY | - WS_DISABLED | WS_BORDER,67,174,140,20 + WS_DISABLED | WS_BORDER,67,145,140,20 LTEXT "Clocks",OPT_ClockFont,13,16,45,10,NOT WS_GROUP - LTEXT "Messages",OPT_MessageFont,13,46,45,10,NOT WS_GROUP - LTEXT "Coordinates",OPT_CoordFont,13,76,45,10,NOT WS_GROUP - LTEXT "Tags",OPT_EditTagsFont,13,119,45,10,NOT WS_GROUP - LTEXT "Comments",OPT_CommentsFont,13,149,45,10,NOT WS_GROUP - LTEXT "ICS Interaction",OPT_MessageFont5,13,179,50,10,NOT + LTEXT "Messages",OPT_MessageFont,13,40,45,10,NOT WS_GROUP + LTEXT "Coordinates",OPT_CoordFont,13,64,45,10,NOT WS_GROUP + LTEXT "Tags",OPT_EditTagsFont,13,102,45,10,NOT WS_GROUP + LTEXT "Comments",OPT_CommentsFont,13,126,45,10,NOT WS_GROUP + LTEXT "ICS Interaction",OPT_MessageFont5,13,150,50,10,NOT WS_GROUP CONTROL "",OPT_SampleClockFont,"RICHEDIT",ES_READONLY | WS_DISABLED | WS_BORDER,67,11,140,20 CONTROL "",OPT_SampleMessageFont,"RICHEDIT",ES_READONLY | - WS_DISABLED | WS_BORDER,67,41,140,20 - GROUPBOX "Current Board Size",IDC_STATIC,3,1,259,100 - GROUPBOX "All Board Sizes",IDC_STATIC,3,102,259,100 + WS_DISABLED | WS_BORDER,67,35,140,20 + GROUPBOX "Current Board Size",IDC_STATIC,3,1,259,83 + GROUPBOX "All Board Sizes",IDC_STATIC,3,87,259,109 + CONTROL "",OPT_SampleMoveHistoryFont,"RICHEDIT",ES_READONLY | + WS_DISABLED | WS_BORDER,67,170,140,20 + LTEXT "Move History",OPT_MessageFont6,13,175,50,10,NOT + WS_GROUP END DLG_NewGameFRC DIALOG DISCARDABLE 0, 0, 176, 47 @@ -679,7 +684,7 @@ EXSTYLE WS_EX_TOOLWINDOW CAPTION "Engine output" FONT 8, "MS Sans Serif" BEGIN - LTEXT "Engine #1",IDC_EngineLabel1,14,2,110,8 + LTEXT "Engine #1",IDC_EngineLabel1,14,2,84,8 RTEXT "NPS",IDC_Engine1_NPS,206,2,57,8 CONTROL "",IDC_EngineMemo1,"RICHEDIT",ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | @@ -691,8 +696,8 @@ BEGIN WS_HSCROLL | WS_TABSTOP,2,92,262,74 ICON IDI_UNKNOWN_14,IDC_Color1,2,4,20,20,SS_REALSIZEIMAGE ICON IDI_UNKNOWN_14,IDC_Color2,4,84,20,20 - LTEXT "Static",IDC_StateData1,182,2,19,8 - ICON IDI_TRANS_14,IDC_StateIcon1,160,2,20,20 + LTEXT "Static",IDC_StateData1,120,2,83,8 + ICON IDI_TRANS_14,IDC_StateIcon1,98,0,21,20 LTEXT "Static",IDC_StateData2,186,84,19,8 ICON IDI_TRANS_14,IDC_StateIcon2,164,84,20,20 END @@ -725,7 +730,7 @@ BEGIN PUSHBUTTON "Cancel",IDCANCEL,154,112,50,14 END -DLG_OptionsUCI DIALOG DISCARDABLE 0, 0, 228, 102 +DLG_OptionsUCI DIALOG DISCARDABLE 0, 0, 228, 124 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "UCI Options" FONT 8, "MS Sans Serif" @@ -740,8 +745,19 @@ BEGIN PUSHBUTTON "...",IDC_BrowseForEGTB,206,40,17,14 LTEXT "EGTB Size (MB):",IDC_STATIC,2,62,54,8 EDITTEXT IDC_SizeOfEGTB,62,58,40,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,118,84,50,14 - PUSHBUTTON "Cancel",IDCANCEL,174,84,50,14 + CONTROL "Use Book:",IDC_UseBook,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,2,80,49,10 + EDITTEXT IDC_BookFile,62,76,140,14,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_BrowseForBook,206,76,17,14 + DEFPUSHBUTTON "OK",IDOK,118,106,50,14 + PUSHBUTTON "Cancel",IDCANCEL,174,106,50,14 +END + +DLG_Null DIALOG DISCARDABLE 0, 0, 186, 50 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Null" +FONT 8, "MS Sans Serif" +BEGIN END @@ -848,7 +864,15 @@ BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 221 TOPMARGIN, 7 - BOTTOMMARGIN, 95 + BOTTOMMARGIN, 117 + END + + DLG_Null, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 179 + TOPMARGIN, 7 + BOTTOMMARGIN, 43 END END #endif // APSTUDIO_INVOKED @@ -871,6 +895,8 @@ IDI_TRANS_14 ICON DISCARDABLE "bitmaps\\trans_14.ico" IDI_CLOCK_14 ICON DISCARDABLE "bitmaps\\clock_14.ico" IDI_UNKNOWN_14 ICON DISCARDABLE "bitmaps\\unknown_14.ico" IDI_BALOON_14 ICON DISCARDABLE "bitmaps\\baloon_14.ico" +IDI_ANALYZE_14 ICON DISCARDABLE "bitmaps\\analyze_14.ico" +IDI_ANALYZE2_14 ICON DISCARDABLE "bitmaps\\analyze2_14.ico" ///////////////////////////////////////////////////////////////////////////// // @@ -1108,9 +1134,10 @@ WINBOARD ACCELERATORS MOVEABLE PURE BEGIN "1", IDM_DirectCommand1, VIRTKEY, ALT, NOINVERT "2", IDM_DirectCommand2, VIRTKEY, ALT, NOINVERT + "B", IDM_Book, VIRTKEY, ALT, NOINVERT "C", IDM_CopyGame, VIRTKEY, ALT, NOINVERT "C", IDM_CopyPosition, VIRTKEY, SHIFT, ALT, NOINVERT - "M", IDM_TypeInMove, VIRTKEY, ALT, NOINVERT + "I", IDM_TypeInMove, VIRTKEY, ALT, NOINVERT "N", IDM_NewGame, VIRTKEY, CONTROL, NOINVERT "O", IDM_LoadGame, VIRTKEY, CONTROL, NOINVERT "S", IDM_SaveGame, VIRTKEY, CONTROL, NOINVERT diff --git a/winboard/woptions.c b/winboard/woptions.c index 16e9313..a740f8f 100644 --- a/winboard/woptions.c +++ b/winboard/woptions.c @@ -60,6 +60,7 @@ extern ColorClass currentColorClass; extern HWND hwndConsole; extern char *defaultTextAttribs[]; extern HWND commentDialog; +extern HWND moveHistoryDialog; extern char installDir[]; extern HWND hCommPort; /* currently open comm port */ extern DCB dcb; @@ -1320,6 +1321,7 @@ FontOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) SetSampleFontText(hDlg, OPT_SampleTagFont, &workFont[EDITTAGS_FONT]); SetSampleFontText(hDlg, OPT_SampleCommentsFont, &workFont[COMMENT_FONT]); SetSampleFontText(hDlg, OPT_SampleConsoleFont, &workFont[CONSOLE_FONT]); + SetSampleFontText(hDlg, OPT_SampleMoveHistoryFont, &workFont[MOVEHISTORY_FONT]); firstPaint = FALSE; } break; @@ -1347,6 +1349,7 @@ FontOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) CopyFont(font[i][EDITTAGS_FONT], &workFont[EDITTAGS_FONT]); CopyFont(font[i][CONSOLE_FONT], &workFont[CONSOLE_FONT]); CopyFont(font[i][COMMENT_FONT], &workFont[COMMENT_FONT]); + CopyFont(font[i][MOVEHISTORY_FONT], &workFont[MOVEHISTORY_FONT]); } /* end sad necessity */ @@ -1369,6 +1372,13 @@ FontOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) InvalidateRect(editTagsDialog, &rect, TRUE); } + if( moveHistoryDialog != NULL ) { + SendDlgItemMessage(moveHistoryDialog, IDC_MoveHistory, + WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf, + MAKELPARAM(TRUE, 0)); + InvalidateRect(editTagsDialog, NULL, TRUE); + } + if (hwndConsole) { ChangedConsoleFont(); } @@ -1414,6 +1424,11 @@ FontOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) SetSampleFontText(hDlg, OPT_SampleConsoleFont, &workFont[CONSOLE_FONT]); break; + case OPT_ChooseMoveHistoryFont: + MyCreateFont(hDlg, &workFont[MOVEHISTORY_FONT]); + SetSampleFontText(hDlg, OPT_SampleMoveHistoryFont, &workFont[MOVEHISTORY_FONT]); + break; + case OPT_DefaultFonts: for (i=0; i