# include <unistd.h>
#endif
-#include <X11/Intrinsic.h>
-#include <X11/StringDefs.h>
-#include <X11/Shell.h>
-#include <X11/Xaw/Dialog.h>
-#include <X11/Xaw/Form.h>
-#include <X11/Xaw/List.h>
-#include <X11/Xaw/Label.h>
-#include <X11/Xaw/SimpleMenu.h>
-#include <X11/Xaw/SmeBSB.h>
-#include <X11/Xaw/SmeLine.h>
-#include <X11/Xaw/Box.h>
-#include <X11/Xaw/Paned.h>
-#include <X11/Xaw/MenuButton.h>
-#include <X11/cursorfont.h>
-#include <X11/Xaw/Text.h>
-#include <X11/Xaw/AsciiText.h>
-#include <X11/Xaw/Viewport.h>
-#include <X11/Xatom.h>
-#include <X11/Xmu/Atoms.h>
+#include <gtk/gtk.h>
#include "common.h"
#include "frontend.h"
# define N_(s) s
#endif
-#include <X11/xpm.h>
-
// [HGM] pixmaps of some ICONS used in the engine-outut window
#include "pixmaps/WHITE_14.xpm"
#include "pixmaps/BLACK_14.xpm"
/* 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)
{
exit(1);
}
}
+#endif
void
-InitializeEngineOutput (Option *opt, Option *memo2)
+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;
ReadIcon(PONDER_14, nPondering, w);
ReadIcon(THINK_14, nThinking, w);
ReadIcon(ANALYZE_14, nAnalyzing, w);
+#endif
}
void
-DrawIcon (Option *opt, int nIcon)
+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;
highTextStart[which] += len; highTextEnd[which] += len;
XawTextSetSelection( edit, highTextStart[which], highTextEnd[which] );
}
+#endif
}
//--------------------------------- PV walking ---------------------------------------
char memoTranslations[] =
":Ctrl<Key>c: CopyMemoProc() \n \
<Btn3Motion>: HandlePV() \n \
-Shift<Btn3Down>: select-start() SelectPV(1) \n \
-Any<Btn3Down>: select-start() SelectPV(0) \n \
-<Btn3Up>: extend-end() StopPV() \n";
+Shift<Btn3Down>: select-start() extend-end() SelectPV(1) \n \
+Any<Btn3Down>: select-start() extend-end() SelectPV(0) \n \
+<Btn3Up>: 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
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 ---------------------------
// 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
CurrentTime
);
}
+#endif
//------------------------------- pane switching -----------------------------------
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;
XtSetArg(args[j], XtNheight, (XtArgVal) (ew_height/2)); j++;
XtSetValues(form2, args, j);
}
+#endif
}