X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xengineoutput.c;h=b4e1ce8264d96c20d3148761374b47d37ddc7f51;hb=0a3919ff10a347a8d840f75fd2c816efe52e5098;hp=5221e6a9fe75c06e096f931c8ab0783ed6044a8a;hpb=7c9ee0544821f7981792be03e90ba15e9a8aeada;p=xboard.git diff --git a/xengineoutput.c b/xengineoutput.c index 5221e6a..b4e1ce8 100644 --- a/xengineoutput.c +++ b/xengineoutput.c @@ -48,25 +48,7 @@ extern char *getenv(); # include #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include "common.h" #include "frontend.h" @@ -84,8 +66,6 @@ extern char *getenv(); # define N_(s) s #endif -#include - // [HGM] pixmaps of some ICONS used in the engine-outut window #include "pixmaps/WHITE_14.xpm" #include "pixmaps/BLACK_14.xpm" @@ -97,11 +77,13 @@ extern char *getenv(); /* Module variables */ +#ifdef TODO_GTK static int currentPV, highTextStart[2], highTextEnd[2]; static Pixmap icons[8]; // [HGM] this front-end array translates back-end icon indicator to handle static Widget memoWidget; +#endif - +#ifdef TODO_GTK static void ReadIcon (char *pixData[], int iconNr, Widget w) { @@ -115,10 +97,12 @@ ReadIcon (char *pixData[], int iconNr, Widget w) exit(1); } } +#endif void InitEngineOutput (Option *opt, Option *memo2) { // front-end, because it must have access to the pixmaps +#ifdef TODO_GTK Widget w = opt->handle; memoWidget = memo2->handle; @@ -130,19 +114,23 @@ InitEngineOutput (Option *opt, Option *memo2) ReadIcon(PONDER_14, nPondering, w); ReadIcon(THINK_14, nThinking, w); ReadIcon(ANALYZE_14, nAnalyzing, w); +#endif } void DrawWidgetIcon (Option *opt, int nIcon) { // as we are already in X front-end, so do X-stuff here +#ifdef TODO_GTK Arg arg; XtSetArg(arg, XtNleftBitmap, (XtArgVal) icons[nIcon]); XtSetValues(opt->handle, &arg, 1); +#endif } void InsertIntoMemo (int which, char * text, int where) { +#ifdef TODO_GTK XawTextBlock t; Widget edit; @@ -158,6 +146,7 @@ InsertIntoMemo (int which, char * text, int where) highTextStart[which] += len; highTextEnd[which] += len; XawTextSetSelection( edit, highTextStart[which], highTextEnd[which] ); } +#endif } //--------------------------------- PV walking --------------------------------------- @@ -165,10 +154,11 @@ InsertIntoMemo (int which, char * text, int where) char memoTranslations[] = ":Ctrlc: CopyMemoProc() \n \ : HandlePV() \n \ -Shift: select-start() SelectPV(1) \n \ -Any: select-start() SelectPV(0) \n \ -: extend-end() StopPV() \n"; +Shift: select-start() extend-end() SelectPV(1) \n \ +Any: select-start() extend-end() SelectPV(0) \n \ +: StopPV() \n"; +#ifdef TODO_GTK void SelectPV (Widget w, XEvent * event, String * params, Cardinal * nParams) { // [HGM] pv: translate click to PV line, and load it for display @@ -184,19 +174,23 @@ SelectPV (Widget w, XEvent * event, String * params, Cardinal * nParams) XtSetArg(arg, XtNstring, &val); XtGetValues(w, &arg, 1); shiftKey = strcmp(params[0], "0"); - if(LoadMultiPV(x, y, val, index, &start, &end)) { + if(LoadMultiPV(x, y, val, index, &start, &end, currentPV)) { XawTextSetSelection( w, start, end ); highTextStart[currentPV] = start; highTextEnd[currentPV] = end; } } +#endif +#ifdef TODO_GTK void StopPV (Widget w, XEvent * event, String * params, Cardinal * nParams) { // [HGM] pv: on right-button release, stop displaying PV XawTextUnsetSelection( w ); highTextStart[currentPV] = highTextEnd[currentPV] = 0; UnLoadPV(); + XtCallActionProc(w, "beginning-of-file", event, NULL, 0); } +#endif //------------------------- Ctrl-C copying of memo texts --------------------------- @@ -208,6 +202,7 @@ StopPV (Widget w, XEvent * event, String * params, Cardinal * nParams) // cloned from CopyPositionProc. Abuse selected_fen_position to hold selection +#ifdef TODO_GTK Boolean SendPositionSelection(Widget w, Atom *selection, Atom *target, Atom *type_return, XtPointer *value_return, unsigned long *length_return, int *format_return); // from xboard.c @@ -242,6 +237,7 @@ CopyMemoProc (Widget w, XEvent *event, String *prms, Cardinal *nprms) CurrentTime ); } +#endif //------------------------------- pane switching ----------------------------------- @@ -249,6 +245,7 @@ void ResizeWindowControls (int mode) { // another hideous kludge: to have only a single pane, we resize the // second to 5 pixels (which makes it too small to display anything) +#ifdef TODO_GTK Widget form1, form2; Arg args[16]; int j; @@ -281,5 +278,6 @@ ResizeWindowControls (int mode) XtSetArg(args[j], XtNheight, (XtArgVal) (ew_height/2)); j++; XtSetValues(form2, args, j); } +#endif }