X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xboard.c;h=5877c3a74a2682bef03f0b71bb66c11dbbfecc50;hb=9addf5a6f332430b00c36e5df8ca13040c2190a5;hp=d3b827f5801e28a26398578dc56e106953d7d3f6;hpb=2ad3ca1ba84d14592ebcee541d4c27eb505d0784;p=xboard.git diff --git a/xboard.c b/xboard.c index d3b827f..5877c3a 100644 --- a/xboard.c +++ b/xboard.c @@ -272,9 +272,7 @@ void DisplayMove P((int moveNumber)); void ICSInitScript P((void)); void SelectMove P((Widget w, XEvent * event, String * params, Cardinal * nParams)); void update_ics_width P(()); -int get_term_width P(()); int CopyMemoProc P(()); -void SetupDropMenu P((void)); /* * XBoard depends on Xt R4 or higher @@ -839,23 +837,20 @@ int frameX, frameY; void GetActualPlacement (Widget wg, WindowPlacement *wp) { - Arg args[16]; - Dimension w, h; - Position x, y; XWindowAttributes winAt; Window win, dummy; - int i, rx, ry; + int rx, ry; if(!wg) return; - win = XtWindow(wg); - XGetWindowAttributes(xDisplay, win, &winAt); // this works, where XtGetValues on XtNx, XtNy does not! - XTranslateCoordinates (xDisplay, win, winAt.root, -winAt.border_width, -winAt.border_width, &rx, &ry, &dummy); - wp->x = rx - winAt.x; - wp->y = ry - winAt.y; - wp->height = winAt.height; - wp->width = winAt.width; - frameX = winAt.x; frameY = winAt.y; // remember to decide if windows touch + win = XtWindow(wg); + XGetWindowAttributes(xDisplay, win, &winAt); // this works, where XtGetValues on XtNx, XtNy does not! + XTranslateCoordinates (xDisplay, win, winAt.root, -winAt.border_width, -winAt.border_width, &rx, &ry, &dummy); + wp->x = rx - winAt.x; + wp->y = ry - winAt.y; + wp->height = winAt.height; + wp->width = winAt.width; + frameX = winAt.x; frameY = winAt.y; // remember to decide if windows touch } void @@ -888,7 +883,8 @@ MainWindowUp () return xBoardWindow != 0; } -void SwitchWindow() +void +SwitchWindow () { extern Option dualOptions[]; static Window dual; @@ -930,9 +926,7 @@ ConvertToLine (int argc, char **argv) void InitDrawingSizes (BoardSize boardSize, int flags) { // [HGM] resize is functional now, but for board format changes only (nr of ranks, files) - Dimension timerWidth, boardWidth, boardHeight, w, h, sep, bor, wr, hr; - Arg args[16]; - XtGeometryResult gres; + Dimension boardWidth, boardHeight, w, h; int i; static Dimension oldWidth, oldHeight; static VariantClass oldVariant; @@ -946,7 +940,7 @@ InitDrawingSizes (BoardSize boardSize, int flags) if(appData.overrideLineGap >= 0) lineGap = appData.overrideLineGap; boardWidth = lineGap + BOARD_WIDTH * (squareSize + lineGap); boardHeight = lineGap + BOARD_HEIGHT * (squareSize + lineGap); -fprintf(debugFP, "BOARD %d x %d\n",boardWidth, boardHeight); + if(boardWidth != oldWidth || boardHeight != oldHeight) { // do resizing stuff only if size actually changed oldWidth = boardWidth; oldHeight = boardHeight; @@ -1114,8 +1108,8 @@ InitDrawingParams () void InitializeFonts (int clockFontPxlSize, int coordFontPxlSize, int fontPxlSize) -{ // determine what fonts to use, and create them - XrmValue vFrom, vTo; +{ // detervtomine what fonts to use, and create them + XrmValue vTo; XrmDatabase xdb; if(!fontIsSet[CLOCK_FONT] && fontValid[CLOCK_FONT][squareSize]) @@ -1170,11 +1164,10 @@ InitializeFonts (int clockFontPxlSize, int coordFontPxlSize, int fontPxlSize) int main (int argc, char **argv) { - int i, j, clockFontPxlSize, coordFontPxlSize, fontPxlSize; + int i, clockFontPxlSize, coordFontPxlSize, fontPxlSize; XSetWindowAttributes window_attributes; Arg args[16]; - Dimension timerWidth, boardWidth, boardHeight, w, h, sep, bor, wr, hr; - XtGeometryResult gres; + Dimension boardWidth, boardHeight, w, h; char *p; int forceMono = False; @@ -1751,8 +1744,6 @@ CreateOneGC (XGCValues *gc_values, Pixel foreground, Pixel background) static void CreateGCs (int redo) { - XtGCMask value_mask = GCLineWidth | GCLineStyle | GCForeground - | GCBackground | GCFunction | GCPlaneMask; XGCValues gc_values; GC copyInvertedGC; Pixel white = XWhitePixel(xDisplay, xScreen); @@ -2316,8 +2307,6 @@ SetMenuEnables (Enables *enab) void KeyBindingProc (Widget w, XEvent *event, String *prms, Cardinal *nprms) { // [HGM] new method of key binding: specify MenuItem(FlipView) in stead of FlipViewProc in translation string - int i; - char *p; MenuItem *item; if(*nprms == 0) return; item = MenuNameToItem(prms[0]); @@ -2325,14 +2314,6 @@ KeyBindingProc (Widget w, XEvent *event, String *prms, Cardinal *nprms) } static void -MenuBarSelect (Widget w, caddr_t addr, caddr_t index) -{ - MenuProc *proc = (MenuProc *) addr; - - (proc)(); -} - -static void MenuEngineSelect (Widget w, caddr_t addr, caddr_t index) { RecentEngineEvent((int) (intptr_t) addr); @@ -2834,7 +2815,7 @@ FileNamePopUp (char *label, char *def, char *filter, FileProc proc, char *openMo fileProc = proc; /* I can't see a way not */ fileOpenMode = openMode; /* to use globals here */ { // [HGM] use file-selector dialog stolen from Ghostview - int index; // this is not supported yet + // int index; // this is not supported yet Browse(BoardWindow, label, (def[0] ? def : NULL), filter, False, openMode, &openName, &openFP); } }