#define SOLID 0
#define OUTLINE 1
Boolean cairoAnimate;
-static cairo_surface_t *csBoardWindow, *csBoardBackup;
+static cairo_surface_t *csBoardWindow, *csBoardBackup, *csDualBoard;
static cairo_surface_t *pngPieceBitmaps[2][(int)BlackPawn]; // scaled pieces as used
static cairo_surface_t *pngPieceBitmaps2[2][(int)BlackPawn+4]; // scaled pieces in store
static cairo_surface_t *pngBoardBitmap[2];
extern Option dualOptions[];
static Window dual;
Window tmp = xBoardWindow;
+ cairo_surface_t *cstmp = csBoardWindow;
if(!dual) dual = XtWindow(dualOptions[3].handle); // must be first call
xBoardWindow = dual; // swap them
dual = tmp;
+ csBoardWindow = csDualBoard;
+ if(!csDualBoard && cstmp) {
+ int boardWidth = lineGap + BOARD_WIDTH * (squareSize + lineGap);
+ int boardHeight = lineGap + BOARD_HEIGHT * (squareSize + lineGap);
+ csBoardWindow = cairo_xlib_surface_create(xDisplay, xBoardWindow, DefaultVisual(xDisplay, 0), boardWidth, boardHeight);
+ }
}
void
// delete surfaces after size becomes invalid, so they will be recreated
if(csBoardWindow) cairo_surface_destroy(csBoardWindow);
if(csBoardBackup) cairo_surface_destroy(csBoardBackup);
- csBoardWindow = csBoardBackup = NULL;
+ if(csDualBoard) cairo_surface_destroy(csDualBoard);
+ csBoardWindow = csBoardBackup = csDualBoard = NULL;
}
#define BoardSize int
if (appData.monoMode) {
XDrawImageString(xDisplay, xBoardWindow, hGC, xx, yy, string, 1);
} else {
+ if(*appData.pngDirectory) {
+ cairo_t *cr = cairo_create (csBoardWindow);
+ cairo_select_font_face (cr, "Sans",
+ CAIRO_FONT_SLANT_NORMAL,
+ CAIRO_FONT_WEIGHT_BOLD);
+
+ cairo_set_font_size (cr, squareSize/4);
+
+ cairo_move_to (cr, xx-1, yy);
+ if(align < 3) cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
+ else cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
+ cairo_show_text (cr, string);
+
+ /* free memory */
+ cairo_destroy (cr);
+ } else
XDrawString(xDisplay, xBoardWindow, hGC, xx, yy, string, 1);
}
}
cairo_set_font_size (cr, 12.0);
cairo_move_to (cr, x, y+4);
- cairo_show_text( cr, buf);
-
cairo_set_source_rgba(cr, 0, 0, 0,1.0);
- cairo_stroke(cr);
+ cairo_show_text( cr, buf);
/* free memory */
cairo_destroy (cr);