From: H.G. Muller Date: Wed, 3 Jul 2013 14:27:47 +0000 (+0200) Subject: Implement hover command X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=c487bc03058931c96f8358728286b8db0e711806;p=xboard.git Implement hover command When the user hovers a dragged piece over a square marked as a legal capture target (by R in the highlight command), the engine is notified by a hover command indicating the square (at the moment the user enters it). Only send hover when the engine has feature highlight=1. --- diff --git a/backend.c b/backend.c index abc4495..24ae75d 100644 --- a/backend.c +++ b/backend.c @@ -7111,6 +7111,28 @@ CanPromote (ChessSquare piece, int y) piece == WhiteLance && y == BOARD_HEIGHT-2 ); } +void +HoverEvent (int hiX, int hiY, int x, int y) +{ + static char baseMarker[BOARD_RANKS][BOARD_FILES], baseLegal[BOARD_RANKS][BOARD_FILES]; + int r, f; + if(!first.highlight) return; + if(hiX == -1 && hiY == -1 && x == fromX && y == fromY) // record markings + for(r=0; r= BOARD_WIDTH || y < 0 || y >= BOARD_HEIGHT) ) { full_repaint = TRUE; } diff --git a/xboard2.h b/xboard2.h index 98aec80..825b0f2 100644 --- a/xboard2.h +++ b/xboard2.h @@ -6,4 +6,4 @@ extern int searchTime; extern int squareSize, lineGap, defaultLineGap; extern int startedFromPositionFile; extern char *icsTextMenuString; - +extern int hi2X, hi2Y;