#include "backendz.h"
#include "moves.h"
#include "xboard.h"
+#include "xboard2.h"
#include "childio.h"
#include "xgamelist.h"
#include "xhistory.h"
-#include "xevalgraph.h"
-#include "xedittags.h"
#include "menus.h"
#include "board.h"
#include "dialogs.h"
int xScreen;
Display *xDisplay;
Window xBoardWindow;
-Pixel lightSquareColor, darkSquareColor, whitePieceColor, blackPieceColor,
- highlightSquareColor, premoveHighlightColor; // used in graphics
Pixel lowTimeWarningColor, dialogColor, buttonColor; // used in widgets
Pixmap iconPixmap, wIconPixmap, bIconPixmap, xMarkPixmap;
Widget shellWidget, formWidget, boardWidget, titleWidget, dropMenu, menuBarWidget;
WindowPlacement wpGameList;
WindowPlacement wpTags;
+#define INPUT_SOURCE_BUF_SIZE 8192
+
+typedef struct {
+ CPKind kind;
+ int fd;
+ int lineByLine;
+ char *unused;
+ InputCallback func;
+ XtInputId xid;
+ char buf[INPUT_SOURCE_BUF_SIZE];
+ VOIDSTAR closure;
+} InputSource;
+
/* This magic number is the number of intermediate frames used
in each half of the animation. For short moves it's reduced
{ // [HGM] taken out of main(), so it can be called from BoardOptions dialog
int forceMono = False;
- forceMono |= MakeOneColor(appData.lightSquareColor, &lightSquareColor);
- forceMono |= MakeOneColor(appData.darkSquareColor, &darkSquareColor);
- forceMono |= MakeOneColor(appData.whitePieceColor, &whitePieceColor);
- forceMono |= MakeOneColor(appData.blackPieceColor, &blackPieceColor);
- forceMono |= MakeOneColor(appData.highlightSquareColor, &highlightSquareColor);
- forceMono |= MakeOneColor(appData.premoveHighlightColor, &premoveHighlightColor);
if (appData.lowTimeWarning)
forceMono |= MakeOneColor(appData.lowTimeWarningColor, &lowTimeWarningColor);
if(appData.dialogColor[0]) MakeOneColor(appData.dialogColor, &dialogColor);
}
void
-MarkMenuItem (char *menuRef, int state)
-{
- MenuItem *item = MenuNameToItem(menuRef);
-
- if(item) {
- Arg args[2];
- XtSetArg(args[0], XtNleftBitmap, state ? xMarkPixmap : None);
- XtSetValues(item->handle, args, 1);
- }
-}
-
-void
EnableNamedMenuItem (char *menuRef, int state)
{
MenuItem *item = MenuNameToItem(menuRef);
void
ReSize (WindowPlacement *wp)
{
- int sqx, sqy;
+ int sqx, sqy, w, h;
if(wp->width == wpMain.width && wp->height == wpMain.height) return; // not sized
sqx = (wp->width - lineGap - marginW) / BOARD_WIDTH - lineGap;
sqy = (wp->height - lineGap - marginH) / BOARD_HEIGHT - lineGap;
CreatePNGPieces(); // make newly scaled pieces
InitDrawingSizes(0, 0); // creates grid etc.
} else ResizeBoardWindow(BOARD_WIDTH * (squareSize + lineGap) + lineGap, BOARD_HEIGHT * (squareSize + lineGap) + lineGap, 0);
+ w = BOARD_WIDTH * (squareSize + lineGap) + lineGap;
+ h = BOARD_HEIGHT * (squareSize + lineGap) + lineGap;
+ if(optList[W_BOARD].max > w) optList[W_BOARD].max = w;
+ if(optList[W_BOARD].value > h) optList[W_BOARD].value = h;
}
static XtIntervalId delayedDragID = 0;