Fix multi-leg promotions
[xboard.git] / xaw / xengineoutput.c
index 78269b8..50adedf 100644 (file)
@@ -5,7 +5,8 @@
  *
  * Copyright 2005 Alessandro Scotti
  *
- * Enhancements Copyright 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ * Enhancements Copyright 2009, 2010, 2011, 2012, 2013,
+ * 2014, 2015, 2016 Free Software Foundation, Inc.
  *
  * ------------------------------------------------------------------------
  *
@@ -84,36 +85,52 @@ extern char *getenv();
 # define N_(s)  s
 #endif
 
-#include <X11/xpm.h>
+// [HGM] bitmaps of some ICONS used in the engine-outut window
+
+static unsigned char CLEAR_14[28];
+
+static unsigned char WHITE_14[] = {
+0xe0, 0x01, 0x18, 0x06, 0x04, 0x08, 0x02, 0x10, 0x02, 0x10, 0x01, 0x20, 0x01, 0x20,
+0x01, 0x20, 0x01, 0x20, 0x02, 0x10, 0x02, 0x10, 0x04, 0x08, 0x18, 0x06, 0xe0, 0x01
+};
+
+static unsigned char BLACK_14[] = {
+0xe0, 0x01, 0xf8, 0x07, 0xfc, 0x0f, 0xfe, 0x1f, 0xfe, 0x1f, 0xff, 0x3f, 0xff, 0x3f,
+0xff, 0x3f, 0xff, 0x3f, 0xfe, 0x1f, 0xfe, 0x1f, 0xfc, 0x0f, 0xf8, 0x07, 0xe0, 0x01
+};
+
+static unsigned char ANALYZE_14[] = {
+0x80, 0x03, 0x60, 0x0c, 0x10, 0x10, 0x90, 0x10, 0xc8, 0x20, 0x08, 0x20, 0x08, 0x20,
+0x10, 0x10, 0x10, 0x10, 0x68, 0x0c, 0x94, 0x03, 0x0a, 0x00, 0x07, 0x00, 0x00, 0x00
+};
+
+static unsigned char THINK_14[] = {
+0xe0, 0x00, 0x18, 0x03, 0x44, 0x04, 0x42, 0x08, 0x42, 0x08, 0x41, 0x10, 0xe1, 0x13,
+0x41, 0x10, 0x02, 0x08, 0x02, 0x08, 0x04, 0x04, 0x18, 0x03, 0xe0, 0x00, 0x00, 0x00
+};
+
+static unsigned char PONDER_14[] = {
+0x30, 0x03, 0x8c, 0x0c, 0x02, 0x10, 0x01, 0x08, 0x01, 0x10, 0x06, 0x20, 0x04, 0x20,
+0x02, 0x10, 0x04, 0x0c, 0xc8, 0x04, 0x34, 0x03, 0x0e, 0x00, 0x01, 0x00, 0x00, 0x00
+};
+
+static unsigned char UNKNOWN_14[] = {
+0xe0, 0x01, 0x58, 0x07, 0xac, 0x0a, 0x56, 0x15, 0xaa, 0x1a, 0x55, 0x35, 0xab, 0x2a,
+0x55, 0x35, 0xab, 0x2a, 0x56, 0x15, 0xaa, 0x1a, 0x54, 0x0d, 0xb8, 0x06, 0xe0, 0x01
+};
 
-// [HGM] pixmaps of some ICONS used in the engine-outut window
-#include "pixmaps/WHITE_14.xpm"
-#include "pixmaps/BLACK_14.xpm"
-#include "pixmaps/CLEAR_14.xpm"
-#include "pixmaps/UNKNOWN_14.xpm"
-#include "pixmaps/THINKING_14.xpm"
-#include "pixmaps/PONDER_14.xpm"
-#include "pixmaps/ANALYZING_14.xpm"
 
 
 /* Module variables */
-static int currentPV, highTextStart[2], highTextEnd[2];
+static int currentPV;
 static Pixmap icons[8]; // [HGM] this front-end array translates back-end icon indicator to handle
 static Widget memoWidget;
 
 
 static void
-ReadIcon (char *pixData[], int iconNr, Widget w)
+ReadIcon (unsigned char pixData[], int iconNr, Widget w)
 {
-    int r;
-
-       if ((r=XpmCreatePixmapFromData(xDisplay, XtWindow(w),
-                                      pixData,
-                                      &(icons[iconNr]),
-                                      NULL, NULL /*&attr*/)) != 0) {
-         fprintf(stderr, _("Error %d loading icon image\n"), r);
-         exit(1);
-       }
+    icons[iconNr] = XCreateBitmapFromData(xDisplay, XtWindow(w), (char*) pixData, 14, 14);
 }
 
 void
@@ -165,8 +182,8 @@ InsertIntoMemo (int which, char * text, int where)
 char memoTranslations[] =
 ":Ctrl<Key>c: CopyMemoProc() \n \
 <Btn3Motion>: HandlePV() \n \
-Shift<Btn3Down>: select-start() extend-end() SelectPV(1) \n \
-Any<Btn3Down>: select-start() extend-end() SelectPV(0) \n \
+Shift<Btn3Down>: select-start() extend-end(PRIMARY) SelectPV(1) \n \
+Any<Btn3Down>: select-start() extend-end(PRIMARY) SelectPV(0) \n \
 <Btn3Up>: StopPV() \n";
 
 void
@@ -283,4 +300,3 @@ ResizeWindowControls (int mode)
        XtSetValues(form2, args, j);
     }
 }
-