XtRImmediate, (XtPointer) False},
{ "keepLineBreaksICS", "keepLineBreaksICS", XtRBoolean,
sizeof(Boolean), XtOffset(AppDataPtr, noJoin),
+ XtRImmediate, (XtPointer) False},
+ { "wrapContinuationSequence", "wrapContinuationSequence", XtRString,
+ sizeof(String), XtOffset(AppDataPtr, wrapContSeq),
+ XtRString, ""},
+ { "useInternalWrap", "useInternalWrap", XtRBoolean,
+ sizeof(Boolean), XtOffset(AppDataPtr, useInternalWrap),
XtRImmediate, (XtPointer) True},
};
{ "-keepAlive", "keepAlive", XrmoptionSepArg, NULL },
{ "-forceIllegalMoves", "forceIllegalMoves", XrmoptionNoArg, "True" },
{ "-keepLineBreaksICS", "keepLineBreaksICS", XrmoptionSepArg, NULL },
+ { "-wrapContinuationSequence", "wrapContinuationSequence", XrmoptionSepArg, NULL },
+ { "-useInternalWrap", "useInternalWrap", XrmoptionSepArg, NULL },
};
-
XtActionsRec boardActions[] = {
{ "DrawPosition", DrawPositionProc },
{ "HandleUserMove", HandleUserMove },
widgetList[j++] = menuBarWidget = CreateMenuBar(menuBar);
XtSetArg(args[0], XtNtop, XtChainTop);
XtSetArg(args[1], XtNbottom, XtChainTop);
- XtSetValues(menuBarWidget, args, 2);
+ XtSetArg(args[2], XtNright, XtChainLeft);
+ XtSetValues(menuBarWidget, args, 3);
widgetList[j++] = whiteTimerWidget =
XtCreateWidget("whiteTime", labelWidgetClass,
if (appData.icsInputBox) ICSInputBoxPopUp();
}
+ #ifdef SIGWINCH
+ signal(SIGWINCH, TermSizeSigHandler);
+ #endif
signal(SIGINT, IntSigHandler);
signal(SIGTERM, IntSigHandler);
if (*appData.cmailGameName != NULLCHAR) {
SetUpChildIO(to_prog, from_prog);
- #ifdef SIGWINCH
- signal(SIGWINCH, TermSizeSigHandler);
- #endif
-
if ((pid = fork()) == 0) {
/* Child process */
// [HGM] PSWBTM: made order resistant against case where fd of created pipe was 0 or 1
int count;
int *outError;
{
+ static int line = 0;
ChildProc *cp = (ChildProc *) pr;
int outCount;
if (pr == NoProc)
- outCount = fwrite(message, 1, count, stdout);
+ {
+ if (appData.noJoin || !appData.useInternalWrap)
+ outCount = fwrite(message, 1, count, stdout);
+ else
+ {
+ int width = get_term_width();
+ int len = wrap(NULL, message, count, width, &line);
+ char *msg = malloc(len);
+ int dbgchk;
+
+ if (!msg)
+ outCount = fwrite(message, 1, count, stdout);
+ else
+ {
+ dbgchk = wrap(msg, message, count, width, &line);
+ if (dbgchk != len && appData.debugMode)
+ fprintf(debugFP, "wrap(): dbgchk(%d) != len(%d)\n", dbgchk, len);
+ outCount = fwrite(msg, 1, dbgchk, stdout);
+ free(msg);
+ }
+ }
+ }
else
outCount = write(cp->fdTo, message, count);