X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xengineoutput.c;h=11b06950a48a811d75e16c3f29528cd878b78508;hb=56310c5b198bc521e0a715377c68378b7bcf10a5;hp=980b639a68c4b7e251fca622168b2dddf88d1b0b;hpb=34e7a4b058c8ee6691dea2b5776459d58569840d;p=xboard.git diff --git a/xengineoutput.c b/xengineoutput.c index 980b639..11b0695 100644 --- a/xengineoutput.c +++ b/xengineoutput.c @@ -100,14 +100,6 @@ extern char *getenv(); #define _LL_ 100 -// imports from xboard.c -extern Widget formWidget, shellWidget, boardWidget, menuBarWidget; -extern Display *xDisplay; -extern Window xBoardWindow; -extern int squareSize; -extern Pixmap xMarkPixmap, wIconPixmap, bIconPixmap; -extern char *layoutName; - Pixmap icons[8]; // [HGM] this front-end array translates back-end icon indicator to handle Widget outputField[2][7]; // [HGM] front-end array to translate output field to window handle @@ -116,12 +108,6 @@ void engineOutputPopUp(); int EngineOutputIsUp(); void SetEngineColorIcon( int which ); -/* Imports from backend.c */ -extern int opponentKibitzes; - -/* Imports from xboard.c */ -extern Arg layoutArgs[2], formArgs[2], messageArgs[4]; - //extern WindowPlacement wpEngineOutput; Position engineOutputX = -1, engineOutputY = -1; @@ -181,6 +167,13 @@ void DoSetWindowText(int which, int field, char *s_label) XtSetValues(outputField[which][field], &arg, 1); } +void SetEngineOutputTitle(char *title) +{ + Arg arg; + XtSetArg(arg, XtNtitle, (XtArgVal) title); + XtSetValues(engineOutputShell, &arg, 1); +} + void InsertIntoMemo( int which, char * text, int where ) { XawTextBlock t; @@ -212,17 +205,16 @@ void SetIcon( int which, int field, int nIcon ) void DoClearMemo(int which) { - Widget edit; - - edit = XtNameToWidget(engineOutputShell, which ? "*form2.text" : "*form.text"); - XtCallActionProc(edit, "select-all", NULL, NULL, 0); - XtCallActionProc(edit, "kill-selection", NULL, NULL, 0); + Widget edit = XtNameToWidget(engineOutputShell, which ? "*form2.text" : "*form.text"); + Arg arg; +// XtCallActionProc(edit, "select-all", NULL, NULL, 0); +// XtCallActionProc(edit, "kill-selection", NULL, NULL, 0); + XtSetArg(arg, XtNstring, ""); // clear without disturbing selection! + XtSetValues(edit, &arg, 1); } // cloned from CopyPositionProc. Abuse selected_fen_position to hold selection -extern char *selected_fen_position; - Boolean SendPositionSelection(Widget w, Atom *selection, Atom *target, Atom *type_return, XtPointer *value_return, unsigned long *length_return, int *format_return); // from xboard.c @@ -231,7 +223,8 @@ void SetFocus(Widget w, XtPointer data, XEvent *event, Boolean *b); // from xopt char memoTranslations[] = ":Ctrlc: CopyMemoProc() \n \ : HandlePV() \n \ -: select-start() SelectPV() \n \ +Shift: select-start() SelectPV(1) \n \ +Any: select-start() SelectPV(0) \n \ : extend-end() StopPV() \n"; void @@ -248,6 +241,7 @@ SelectPV (Widget w, XEvent * event, String * params, Cardinal * nParams) XawTextGetSelectionPos(w, &index, &dummy); XtSetArg(arg, XtNstring, &val); XtGetValues(w, &arg, 1); + shiftKey = strcmp(params[0], "0"); if(LoadMultiPV(x, y, val, index, &start, &end)) { XawTextSetSelection( outputField[currentPV][nMemo], start, end ); highTextStart[currentPV] = start; highTextEnd[currentPV] = end;