X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xengineoutput.c;h=bdf4928426e0b4b7e2f131e9067fa44735936ac4;hb=cbb23e5f23cee542f8099c7f80fd07df8d9f0a08;hp=f83dcf07916bf5ab4ff9845b8d1bdad785016ba5;hpb=10d5fd5e9759d36baa78cc2f5b57b828c12e0394;p=xboard.git diff --git a/xengineoutput.c b/xengineoutput.c index f83dcf0..bdf4928 100644 --- a/xengineoutput.c +++ b/xengineoutput.c @@ -83,6 +83,7 @@ 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 +static void *memoWidget; #ifdef TODO_GTK static void @@ -162,39 +163,37 @@ 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) +SelectPV (Option *opt, int x, int y) { // [HGM] pv: translate click to PV line, and load it for display - String val; - int start, end; - XawTextPosition index, dummy; - int x, y; - Arg arg; - - x = event->xmotion.x; y = event->xmotion.y; - currentPV = (w != memoWidget); + int start, end, index; + char *val; + int currentPV = (opt->handle != memoWidget); +#ifdef TODO_GTK XawTextGetSelectionPos(w, &index, &dummy); XtSetArg(arg, XtNstring, &val); XtGetValues(w, &arg, 1); - shiftKey = strcmp(params[0], "0"); +#endif if(LoadMultiPV(x, y, val, index, &start, &end, currentPV)) { +#ifdef TODO_GTK XawTextSetSelection( w, start, end ); +#endif highTextStart[currentPV] = start; highTextEnd[currentPV] = end; } } -#endif -#ifdef TODO_GTK void -StopPV (Widget w, XEvent * event, String * params, Cardinal * nParams) +StopPV (Option *opt) { // [HGM] pv: on right-button release, stop displaying PV - XawTextUnsetSelection( w ); +#ifdef TODO_GTK + XawTextUnsetSelection( opt->handle ); +#endif highTextStart[currentPV] = highTextEnd[currentPV] = 0; UnLoadPV(); - XtCallActionProc(w, "beginning-of-file", event, NULL, 0); -} +#ifdef TODO_GTK + XtCallActionProc(opt->handle, "beginning-of-file", event, NULL, 0); #endif +} //------------------------------- pane switching -----------------------------------