X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xboard.c;h=4a6d7f0403672fecb392d5999c1b9318b452d2b2;hb=4d04bc8a6c2d5e410d519b25164613c5e5c2d160;hp=89fcb70ddf6546815a822c98bd82b97421aafe4c;hpb=681dfc03596526017b3b8f39caef7f8f7c032987;p=xboard.git diff --git a/xboard.c b/xboard.c index 89fcb70..4a6d7f0 100644 --- a/xboard.c +++ b/xboard.c @@ -683,7 +683,7 @@ MenuItem modeMenu[] = { {N_("Machine Black Ctrl+B"), "Machine Black", MachineBlackProc}, {N_("Two Machines Ctrl+T"), "Two Machines", TwoMachinesProc}, {N_("Analysis Mode Ctrl+A"), "Analysis Mode", AnalyzeModeProc}, - {N_("Analyze File Ctrl+F"), "Analyze File", AnalyzeFileProc }, + {N_("Analyze Game Ctrl+G"), "Analyze File", AnalyzeFileProc }, {N_("Edit Game Ctrl+E"), "Edit Game", EditGameProc}, {N_("Edit Position Ctrl+Shift+E"), "Edit Position", EditPositionProc}, {N_("Training"), "Training", TrainingProc}, @@ -1051,6 +1051,8 @@ char globalTranslations[] = :Ctrlo: LoadGameProc() \n \ :MetaNext: LoadNextGameProc() \n \ :MetaPrior: LoadPrevGameProc() \n \ + :CtrlDown: LoadSelectedProc(3) \n \ + :CtrlUp: LoadSelectedProc(-3) \n \ :Ctrls: SaveGameProc() \n \ :Ctrlc: CopyGameProc() \n \ :Ctrlv: PasteGameProc() \n \ @@ -1065,7 +1067,7 @@ char globalTranslations[] = :Ctrlb: MachineBlackProc() \n \ :Ctrlt: TwoMachinesProc() \n \ :Ctrla: AnalysisModeProc() \n \ - :Ctrlf: AnalyzeFileProc() \n \ + :Ctrlg: AnalyzeFileProc() \n \ :Ctrle: EditGameProc() \n \ :CtrlE: EditPositionProc() \n \ :MetaO: EngineOutputProc() \n \ @@ -1087,6 +1089,8 @@ char globalTranslations[] = :MetaRight: ForwardProc() \n \ :MetaHome: ToStartProc() \n \ :MetaLeft: BackwardProc() \n \ + :Left: BackwardProc() \n \ + :Right: ForwardProc() \n \ :Home: RevertProc() \n \ :End: TruncateGameProc() \n \ :Ctrlm: MoveNowProc() \n \ @@ -3597,7 +3601,7 @@ void CreateXPMBoard(char *s, int kind) { XpmAttributes attr; attr.valuemask = 0; - if(s == NULL || *s == 0 || *s == '*') { useTexture &= ~(kind+1); return; } + if(!appData.useBitmaps || s == NULL || *s == 0 || *s == '*') { useTexture &= ~(kind+1); return; } if (XpmReadFileToPixmap(xDisplay, xBoardWindow, s, &(xpmBoardBitmap[kind]), NULL, &attr) == 0) { useTexture |= kind + 1; textureW[kind] = attr.width; textureH[kind] = attr.height; } @@ -4999,6 +5003,14 @@ void CommentPopDown() PopDown(1); } +static char *openName; +FILE *openFP; + +void DelayedLoad() +{ + (void) (*fileProc)(openFP, 0, openName); +} + void FileNamePopUp(label, def, filter, proc, openMode) char *label; char *def; @@ -5009,12 +5021,11 @@ void FileNamePopUp(label, def, filter, proc, openMode) fileProc = proc; /* I can't see a way not */ fileOpenMode = openMode; /* to use globals here */ { // [HGM] use file-selector dialog stolen from Ghostview - char *name; int index; // this is not supported yet - FILE *f; - if(f = XsraSelFile(shellWidget, label, NULL, NULL, "could not open: ", - (def[0] ? def : NULL), filter, openMode, NULL, &name)) - (void) (*fileProc)(f, index=0, name); + if(openFP = XsraSelFile(shellWidget, label, NULL, NULL, "could not open: ", + (def[0] ? def : NULL), filter, openMode, NULL, &openName)) + // [HGM] delay to give expose event opportunity to redraw board after browser-dialog popdown before lengthy load starts + ScheduleDelayedEvent(&DelayedLoad, 50); } } @@ -5928,13 +5939,13 @@ void AnalyzeFileProc(w, event, prms, nprms) DisplayError(buf, 0); return; } - Reset(FALSE, TRUE); +// Reset(FALSE, TRUE); #ifndef OPTIONSDIALOG if (!appData.showThinking) ShowThinkingProc(w,event,prms,nprms); #endif AnalyzeFileEvent(); - FileNamePopUp(_("File to analyze"), "", ".pgn .game", LoadGamePopUp, "rb"); +// FileNamePopUp(_("File to analyze"), "", ".pgn .game", LoadGamePopUp, "rb"); AnalysisPeriodicEvent(1); } @@ -6943,6 +6954,7 @@ void DisplayTitle(text) XtSetArg(args[i], XtNiconName, (XtArgVal) icon); i++; XtSetArg(args[i], XtNtitle, (XtArgVal) title); i++; XtSetValues(shellWidget, args, i); + XSync(xDisplay, False); } @@ -7251,6 +7263,12 @@ EchoOff() } void +RunCommand(char *buf) +{ + system(buf); +} + +void Colorize(cc, continuation) ColorClass cc; int continuation;