X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xboard.c;h=033c53bc7601dc1497effd155e39302298d9fb1a;hb=c69beebf3decbe67eb92beab56bbc34c41c39831;hp=b4efcd75e14b3ed799162e2e0a3ab0fb333c6537;hpb=7180ffa637f0e06d678b180218f4de6d52d5cf32;p=xboard.git diff --git a/xboard.c b/xboard.c index b4efcd7..033c53b 100644 --- a/xboard.c +++ b/xboard.c @@ -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 \ @@ -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 \ @@ -1130,8 +1134,12 @@ char boardTranslations[] = Any: XawPositionSimpleMenu(menuB) XawPositionSimpleMenu(menuD) \ PieceMenuPopup(menuB) \n"; -char whiteTranslations[] = ": WhiteClock()\n"; -char blackTranslations[] = ": BlackClock()\n"; +char whiteTranslations[] = + "Shift: WhiteClock(1)\n \ + : WhiteClock(0)\n"; +char blackTranslations[] = + "Shift: BlackClock(1)\n \ + : BlackClock(0)\n"; char ICSInputTranslations[] = "Up: UpKeyProc() \n " @@ -3593,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; } @@ -4141,6 +4149,7 @@ void WhiteClock(w, event, prms, nprms) String *prms; Cardinal *nprms; { + shiftKey = prms[0][0] & 1; ClockClick(0); } @@ -4150,6 +4159,7 @@ void BlackClock(w, event, prms, nprms) String *prms; Cardinal *nprms; { + shiftKey = prms[0][0] & 1; ClockClick(1); } @@ -4993,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; @@ -5003,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); } } @@ -5736,8 +5753,6 @@ SendGameSelection(Widget w, Atom *selection, Atom *target, void CopySomething() { - int ret; - /* * Set both PRIMARY (the selection) and CLIPBOARD, since we don't * have a notion of a game that is selected but not copied. @@ -6939,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); } @@ -7746,7 +7762,7 @@ int OpenTCP(host, port, pr) struct addrinfo hints; struct addrinfo *ais, *ai; int error; - int s; + int s=0; ChildProc *cp; memset(&hints, 0, sizeof(hints)); @@ -8644,8 +8660,8 @@ AnimateMove(board, fromX, fromY, toX, toY) } void -DragPieceBegin(x, y) - int x; int y; +DragPieceBegin(x, y, instantly) + int x; int y; Boolean instantly; { int boardX, boardY, color; XPoint corner;