Window xBoardWindow;
Pixel lightSquareColor, darkSquareColor, whitePieceColor, blackPieceColor,
jailSquareColor, highlightSquareColor, premoveHighlightColor;
+Pixel lowTimeWarningColor;
GC lightSquareGC, darkSquareGC, jailSquareGC, lineGC, wdPieceGC, wlPieceGC,
bdPieceGC, blPieceGC, wbPieceGC, bwPieceGC, coordGC, highlineGC,
wjPieceGC, bjPieceGC, prelineGC, countGC;
{ "showButtonBar", "showButtonBar", XtRBoolean,
sizeof(Boolean), XtOffset(AppDataPtr, showButtonBar),
XtRImmediate, (XtPointer) True },
+ { "lowTimeWarningColor", "lowTimeWarningColor", XtRString,
+ sizeof(String), XtOffset(AppDataPtr, lowTimeWarningColor),
+ XtRString, COLOR_LOWTIMEWARNING },
+ { "lowTimeWarning", "lowTimeWarning", XtRBoolean,
+ sizeof(Boolean), XtOffset(AppDataPtr, lowTimeWarning),
+ XtRImmediate, (XtPointer) False },
{"icsEngineAnalyze", "icsEngineAnalyze", XtRBoolean, /* [DM] icsEngineAnalyze */
sizeof(Boolean), XtOffset(AppDataPtr, icsEngineAnalyze),
XtRImmediate, (XtPointer) False },
{ "-showButtonBar", "showButtonBar", XrmoptionSepArg, NULL },
{ "-buttons", "showButtonBar", XrmoptionNoArg, "True" },
{ "-xbuttons", "showButtonBar", XrmoptionNoArg, "False" },
+ { "-lowTimeWarningColor", "lowTimeWarningColor", XrmoptionSepArg, NULL },
+ { "-lowTimeWarning", "lowTimeWarning", XrmoptionSepArg, NULL },
/* [AS,HR] New features */
{ "-firstScoreAbs", "firstScoreAbs", XrmoptionSepArg, NULL },
{ "-secondScoreAbs", "secondScoreAbs", XrmoptionSepArg, NULL },
programName);
}
+ if (appData.lowTimeWarning && !appData.monoMode) {
+ vFrom.addr = (caddr_t) appData.lowTimeWarningColor;
+ vFrom.size = strlen(appData.lowTimeWarningColor);
+ XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo);
+ if (vTo.addr == NULL)
+ appData.monoMode = True;
+ else
+ lowTimeWarningColor = *(Pixel *) vTo.addr;
+ }
+
if (appData.monoMode && appData.debugMode) {
fprintf(stderr, _("white pixel = 0x%lx, black pixel = 0x%lx\n"),
(unsigned long) XWhitePixel(xDisplay, xScreen),
char buf[MSG_SIZ];
Arg args[16];
+ Pixel foregroundOrWarningColor = timerForegroundPixel;
+
+ if (timer > 0
+ && appData.lowTimeWarning
+ && (timer / 1000) < appData.icsAlarmTime)
+
+ foregroundOrWarningColor = lowTimeWarningColor;
+
if (appData.clockMode) {
sprintf(buf, "%s: %s", color, TimeString(timer));
XtSetArg(args[0], XtNlabel, buf);
}
if (highlight) {
- XtSetArg(args[1], XtNbackground, timerForegroundPixel);
+
+ XtSetArg(args[1], XtNbackground, foregroundOrWarningColor);
XtSetArg(args[2], XtNforeground, timerBackgroundPixel);
} else {
XtSetArg(args[1], XtNbackground, timerBackgroundPixel);
- XtSetArg(args[2], XtNforeground, timerForegroundPixel);
+ XtSetArg(args[2], XtNforeground, foregroundOrWarningColor);
}
XtSetValues(w, args, 3);
Sets the ICS Alarm menu option. @xref{Options Menu}. Default: true.
@item -icsAlarmTime ms
@cindex icsAlarmTime, option
-Sets the time in milliseconds for the ICS Alarm menu option.
+Sets the time in milliseconds for the ICS Alarm menu option.
@xref{Options Menu}. Default: 5000.
+@item lowTimeWarning true/false
+@cindex lowTimeWarning, option
+Controls a color change of the board as a warning your time is running out.
+@xref{Options Menu}. Default: false.
@item -pre/-xpre \fRor\fB -premove true/false
@cindex pre, option
@cindex premove, option
@itemx -lightSquareColor color
@itemx -darkSquareColor color
@itemx -highlightSquareColor color
+@itemx -lowTimeWarningColor color
@cindex Colors
@cindex whitePieceColor, option
@cindex blackPieceColor, option
@cindex lightSquareColor, option
@cindex darkSquareColor, option
@cindex highlightSquareColor, option
+@cindex lowTimeWarningColor, option
Colors to use for the pieces, squares, and square highlights.
Defaults:
-darkSquareColor #77A26D
-highlightSquareColor #FFFF00
-premoveHighlightColor #FF0000
+-lowTimeWarningColor #FF0000
@end example
On a grayscale monitor you might prefer:
-darkSquareColor gray60
-highlightSquareColor gray100
-premoveHighlightColor gray70
+-lowTimeWarningColor gray70
@end example
@item -drag/-xdrag or -animateDragging true/false
@cindex drag, option