X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=71923d73dfae441830a1d3c737297617531884b2;hb=50ffaff1de1b05f1bf76dd842e734eff2974afd4;hp=4522ca1b650b95607b82ac622f92e2f6ea6fdf20;hpb=ebd08ce25333cb175bc80b21be42bea0723c147e;p=xboard.git diff --git a/backend.c b/backend.c index 4522ca1..71923d7 100644 --- a/backend.c +++ b/backend.c @@ -129,6 +129,7 @@ extern int gettimeofday(struct timeval *, struct timezone *); # include "zippy.h" #endif #include "backendz.h" +#include "evalgraph.h" #include "gettext.h" #ifdef ENABLE_NLS @@ -2513,9 +2514,7 @@ PlotSeekAd (int i) void PlotSingleSeekAd (int i) { - DrawSeekOpen(); PlotSeekAd(i); - DrawSeekClose(); } void @@ -2602,14 +2601,13 @@ DrawSeekGraph () h = BOARD_HEIGHT * (squareSize + lineGap) + lineGap; w = BOARD_WIDTH * (squareSize + lineGap) + lineGap; - DrawSeekOpen(); DrawSeekBackground(0, 0, w, h); DrawSeekAxis(hMargin, h-1-vMargin, w-5, h-1-vMargin); DrawSeekAxis(hMargin, h-1-vMargin, hMargin, 5); for(i=0; i<4000; i+= 100) if(i>=minRating && i 0) StartLoadGameTimer((long)(1000.0f * appData.timeDelay)); + AnalysisPeriodicEvent(1); } void @@ -17434,3 +17483,59 @@ LoadVariation (int index, char *text) ToNrEvent(currentMove+1); } +void +LoadTheme () +{ + char *p, *q, buf[MSG_SIZ]; + if(engineLine && engineLine[0]) { // a theme was selected from the listbox + snprintf(buf, MSG_SIZ, "-theme %s", engineLine); + ParseArgsFromString(buf); + ActivateTheme(TRUE); // also redo colors + return; + } + p = nickName; + if(*p && !strchr(p, '"')) // theme name specified and well-formed; add settings to theme list + { + int len; + q = appData.themeNames; + snprintf(buf, MSG_SIZ, "\"%s\"", nickName); + if(appData.useBitmaps) { + snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), " -ubt true -lbtf \"%s\" -dbtf \"%s\" -lbtm %d -dbtm %d", + appData.liteBackTextureFile, appData.darkBackTextureFile, + appData.liteBackTextureMode, + appData.darkBackTextureMode ); + } else { + snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), " -ubt false -lsc %s -dsc %s", + Col2Text(2), // lightSquareColor + Col2Text(3) ); // darkSquareColor + } + if(appData.useBorder) { + snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), " -ub true -border \"%s\"", + appData.border); + } else { + snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), " -ub false"); + } + if(appData.useFont) { + snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), " -upf true -pf \"%s\" -fptc \"%s\" -fpfcw %s -fpbcb %s", + appData.renderPiecesWithFont, + appData.fontToPieceTable, + Col2Text(9), // appData.fontBackColorWhite + Col2Text(10) ); // appData.fontForeColorBlack + } else { + snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), " -upf false -pid \"%s\"", + appData.pieceDirectory); + if(!appData.pieceDirectory[0]) + snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), " -wpc %s -bpc %s", + Col2Text(0), // whitePieceColor + Col2Text(1) ); // blackPieceColor + } + snprintf(buf+strlen(buf), MSG_SIZ-strlen(buf), " -hsc %s -phc %s\n", + Col2Text(4), // highlightSquareColor + Col2Text(5) ); // premoveHighlightColor + appData.themeNames = malloc(len = strlen(q) + strlen(buf) + 1); + if(insert != q) insert[-1] = NULLCHAR; + snprintf(appData.themeNames, len, "%s\n%s%s", q, buf, insert); + if(q) free(q); + } + ActivateTheme(FALSE); +}