X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xboard.c;h=909ca8573277e0c0a245e14f4dbd796db35f95fd;hb=ca99bd4de57d0b079024cbdf5435de1ae61d5fd9;hp=59221fc309a127ee14f72e12f71b8d478cc3e4c6;hpb=8e5273b69c00339351adf894ded9297a86729315;p=xboard.git diff --git a/xboard.c b/xboard.c index 59221fc..909ca85 100644 --- a/xboard.c +++ b/xboard.c @@ -1409,6 +1409,12 @@ XtResource clientResources[] = { 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}, }; @@ -1780,9 +1786,10 @@ XrmOptionDescRec shellOptions[] = { { "-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 }, @@ -2770,6 +2777,7 @@ XBoard square size (hint): %d\n\ widgetList[j++] = menuBarWidget = CreateMenuBar(menuBar); XtSetArg(args[0], XtNtop, XtChainTop); XtSetArg(args[1], XtNbottom, XtChainTop); + XtSetArg(args[1], XtNright, XtChainLeft); XtSetValues(menuBarWidget, args, 2); widgetList[j++] = whiteTimerWidget = @@ -3186,6 +3194,9 @@ XBoard square size (hint): %d\n\ if (appData.icsInputBox) ICSInputBoxPopUp(); } + #ifdef SIGWINCH + signal(SIGWINCH, TermSizeSigHandler); + #endif signal(SIGINT, IntSigHandler); signal(SIGTERM, IntSigHandler); if (*appData.cmailGameName != NULLCHAR) { @@ -8188,10 +8199,6 @@ int StartChildProcess(cmdLine, dir, pr) 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 @@ -8506,11 +8513,33 @@ int OutputToProcess(pr, message, count, outError) 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);