X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xengineoutput.c;h=3c0921e133d40284c109f2bf27423090debd96c1;hb=6dc1a307d4ec7c6a793865d8a0bee6e48109435e;hp=980b639a68c4b7e251fca622168b2dddf88d1b0b;hpb=34e7a4b058c8ee6691dea2b5776459d58569840d;p=xboard.git diff --git a/xengineoutput.c b/xengineoutput.c index 980b639..3c0921e 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,17 +108,11 @@ 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; Dimension engineOutputW, engineOutputH; -Widget engineOutputShell; +Widget engineOutputShell = NULL; static int engineOutputDialogUp; /* Module variables */ @@ -175,10 +161,18 @@ static void InitializeEngineOutput() void DoSetWindowText(int which, int field, char *s_label) { - Arg arg; + Arg args[16]; - XtSetArg(arg, XtNlabel, (XtArgVal) s_label); - XtSetValues(outputField[which][field], &arg, 1); + XtSetArg(args[0], XtNlabel, (XtArgVal) s_label); + XtSetValues(outputField[which][field], args, 1); +} + +void SetEngineOutputTitle(char *title) +{ + Arg args[16]; + if(engineOutputShell==NULL) return; + XtSetArg(args[0], XtNtitle, (XtArgVal) title); + XtSetValues(engineOutputShell, args, 1); } void InsertIntoMemo( int which, char * text, int where ) @@ -212,17 +206,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 +224,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 +242,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;