commit 1e6aa2c9a648f165abad83bda9d5ed94df91ea3f
Author: Jakub Bogusz <[email protected]>
Date:   Fri Sep 2 21:26:21 2016 +0200

    - updated to 4.9.1
    - removed outdated 
lowtime-warning,hilight-threatened-pieces,xtname,default-program patches
    - use upstream .desktop and .png files

 xboard-default-program.patch           |  11 -
 xboard-hilight-threatened-pieces.patch | 499 ---------------------------------
 xboard-lowtime-warning.patch           | 174 ------------
 xboard-xtname.patch                    |  41 ---
 xboard.desktop                         |  57 ----
 xboard.png                             | Bin 2867 -> 0 bytes
 xboard.spec                            |  73 ++---
 7 files changed, 40 insertions(+), 815 deletions(-)
---
diff --git a/xboard.spec b/xboard.spec
index 002bec7..8da88f9 100644
--- a/xboard.spec
+++ b/xboard.spec
@@ -8,24 +8,27 @@ Summary(ru.UTF-8):    Графический (X11) интерфейс к шахма
 Summary(tr.UTF-8):     GNU Chess (satranç) oyununa X11 grafik arabirimi
 Summary(uk.UTF-8):     Графічний (X11) інтерфейс до шахових програм
 Name:          xboard
-Version:       4.2.7
-Release:       7
-License:       GPL
+Version:       4.9.1
+Release:       1
+License:       GPL v3+
 Group:         X11/Applications/Games
 Source0:       http://ftp.gnu.org/gnu/xboard/%{name}-%{version}.tar.gz
-# Source0-md5: b70ad8ff7569975302c5fb402d5eea32
-Source1:       %{name}.desktop
-Source2:       %{name}.png
+# Source0-md5: 93d7475bbd69a06ff9cce7add5636beb
 Patch0:                %{name}-info.patch
-Patch1:                %{name}-lowtime-warning.patch
-Patch2:                %{name}-hilight-threatened-pieces.patch
-Patch3:                %{name}-xtname.patch
-Patch4:                %{name}-default-program.patch
 URL:           http://www.tim-mann.org/xboard.html
-BuildRequires: automake
+BuildRequires: cairo-devel >= 1.2.0
+BuildRequires: gettext-tools >= 0.17
+BuildRequires: gtk+2-devel >= 2:2.16.0
+BuildRequires: librsvg-devel >= 2.14.0
+# pangocairo
+BuildRequires: pango-devel
+BuildRequires: perl-base
+BuildRequires: pkgconfig
 BuildRequires: texinfo
-Suggests:      gnuchess
 Suggests:      crafty
+# TODO: package (now it's default program)
+#Suggests:     fairymax
+Suggests:      gnuchess
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -82,53 +85,57 @@ записами ігор.
 %prep
 %setup -q
 %patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p0
 
 %build
-cp -f /usr/share/automake/config.sub .
-%configure
+%configure \
+       --disable-silent-rules
 %{__make}
 
 %{__make} info
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
 
 %{__make} install \
-       prefix=$RPM_BUILD_ROOT%{_prefix} \
-       bindir=$RPM_BUILD_ROOT%{_bindir} \
-       man6dir=$RPM_BUILD_ROOT%{_mandir}/man6 \
-       infodir=$RPM_BUILD_ROOT%{_infodir}
+       DESTDIR=$RPM_BUILD_ROOT
+
+install -p cmail $RPM_BUILD_ROOT%{_bindir}
 
 echo '.so xboard.6' > $RPM_BUILD_ROOT%{_mandir}/man6/cmail.6
 echo '.so xboard.6' > $RPM_BUILD_ROOT%{_mandir}/man6/pxboard.6
 
-install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
-install %{SOURCE2} $RPM_BUILD_ROOT%{_pixmapsdir}
+# engines integration files (see {gtk,xaw}/xboard.c)
+install -d $RPM_BUILD_ROOT%{_datadir}/games/plugins/{logos,xboard}
+
+%find_lang %{name}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post  -p      /sbin/postshell
+%post  -p /sbin/postshell
 -/usr/sbin/fix-info-dir -c %{_infodir}
 
-%postun        -p      /sbin/postshell
+%postun        -p /sbin/postshell
 -/usr/sbin/fix-info-dir -c %{_infodir}
 
-%files
+%files -f %{name}.lang
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/cmail
-%attr(755,root,root) %{_bindir}/pxboard
 %attr(755,root,root) %{_bindir}/xboard
-%attr(755,root,root) %{_bindir}/zic2xpm
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/xboard.conf
+%{_datadir}/games/xboard
+%dir %{_datadir}/games/plugins
+%dir %{_datadir}/games/plugins/logos
+%dir %{_datadir}/games/plugins/xboard
+%{_datadir}/mime/packages/xboard.xml
+%{_desktopdir}/xboard.desktop
+%{_desktopdir}/xboard-config.desktop
+%{_desktopdir}/xboard-fen-viewer.desktop
+%{_desktopdir}/xboard-pgn-viewer.desktop
+%{_desktopdir}/xboard-tourney.desktop
+%{_iconsdir}/hicolor/48x48/apps/xboard.png
+%{_iconsdir}/hicolor/scalable/apps/xboard.svg
 %{_mandir}/man6/cmail.6*
 %{_mandir}/man6/pxboard.6*
 %{_mandir}/man6/xboard.6*
-%{_mandir}/man6/zic2xpm.6*
 %{_infodir}/xboard.info*
-%{_desktopdir}/*.desktop
-%{_pixmapsdir}/*
diff --git a/xboard-default-program.patch b/xboard-default-program.patch
deleted file mode 100644
index 34c8f72..0000000
--- a/xboard-default-program.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- xboard.old 2002-04-13 19:44:26.000000000 -0700
-+++ xboard.h   2002-04-13 19:44:08.000000000 -0700
-@@ -100,7 +100,7 @@
- 
- #define BORDER_X_OFFSET 3
- #define BORDER_Y_OFFSET 27
--#define FIRST_CHESS_PROGRAM   "gnuchessx"
-+#define FIRST_CHESS_PROGRAM   "gnuchess"
- #define SECOND_CHESS_PROGRAM  "gnuchessx"
- 
- /* Default to no flashing (the "usual" XBoard behavior) */
diff --git a/xboard-hilight-threatened-pieces.patch 
b/xboard-hilight-threatened-pieces.patch
deleted file mode 100644
index e29cbd2..0000000
--- a/xboard-hilight-threatened-pieces.patch
+++ /dev/null
@@ -1,499 +0,0 @@
---- xboard-4.2.7/common.h.hilite       2005-06-03 09:04:12.000000000 +0800
-+++ xboard-4.2.7/common.h      2005-06-03 09:33:57.000000000 +0800
-@@ -130,6 +130,8 @@ int pclose(FILE *);
- #define DARK_SQUARE_COLOR     "#77A26D"
- #define JAIL_SQUARE_COLOR       "#808080"
- #define HIGHLIGHT_SQUARE_COLOR        "#FFFF00"
-+#define MOVE_SQUARE_COLOR         "#4C00FF"
-+#define THREATENED_SQUARE_COLOR       "#D80000"
- #define PREMOVE_HIGHLIGHT_COLOR       "#FF0000"
- #define BELLCHAR                '\007'
- #define NULLCHAR                '\000'
-@@ -265,6 +267,8 @@ typedef struct {
-     char *darkSquareColor;
-     char *jailSquareColor;
-     char *highlightSquareColor;
-+    char *moveSquareColor;
-+    char *threatenedSquareColor;
-     char *premoveHighlightColor;
- #else
-     int whitePieceColor;
-@@ -273,6 +277,7 @@ typedef struct {
-     int darkSquareColor;
-     int jailSquareColor;
-     int highlightSquareColor;
-+    int moveSquareColor;
-     int premoveHighlightColor;
- #endif
-     int movesPerSession;
-@@ -424,6 +429,8 @@ typedef struct {
-     char *zippyVariants;
-     int zippyMaxGames;
-     int zippyReplayTimeout; /*seconds*/
-+      Boolean showLegalMoves;
-+      Boolean showThreatenedPieces;
- #endif
- #if LOWTIMEWARNING
-   char *lowTimeWarningColor;
---- xboard-4.2.7/xboard.h.hilite       2005-06-03 09:04:12.000000000 +0800
-+++ xboard-4.2.7/xboard.h      2005-06-03 09:33:57.000000000 +0800
-@@ -113,6 +113,7 @@ typedef struct {
- 
- typedef int (*FileProc) P((FILE *f, int n, char *title));
- void CatchDeleteWindow(Widget w, String procname);
-+void ShowThreatenedPieces(Board board);
- 
- #define TOPLEVEL 1 /* preference item; 1 = make popup windows toplevel */
- 
---- xboard-4.2.7/xboard.c.hilite       2005-06-03 09:04:12.000000000 +0800
-+++ xboard-4.2.7/xboard.c      2005-06-03 09:45:55.000000000 +0800
-@@ -185,6 +185,7 @@ extern char *getenv();
- #include "common.h"
- #include "frontend.h"
- #include "backend.h"
-+#include "backendz.h"
- #include "moves.h"
- #include "xboard.h"
- #include "childio.h"
-@@ -385,6 +386,10 @@ void ShowThinkingProc P((Widget w, XEven
-                        Cardinal *nprms));
- void TestLegalityProc P((Widget w, XEvent *event, String *prms,
-                         Cardinal *nprms));
-+void ShowLegalMovesProc P((Widget w, XEvent *event, String *prms,
-+              Cardinal *nprms));
-+void ShowThreatenedPiecesProc P((Widget w, XEvent *event, String *prms,
-+              Cardinal *nprms));
- void InfoProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
- void ManProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
- void HintProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
-@@ -408,6 +413,9 @@ static void DragPieceEnd P((int x, int y
- static void DrawDragPiece P((void));
- char *ModeToWidgetName P((GameMode mode));
- 
-+static void ShowLegalPieceSquares(int boardX,int boardY);
-+static void UnShowLegalPieceSquares();
-+
- /*
- * XBoard depends on Xt R4 or higher
- */
-@@ -417,6 +425,7 @@ int xScreen;
- Display *xDisplay;
- Window xBoardWindow;
- Pixel lightSquareColor, darkSquareColor, whitePieceColor, blackPieceColor,
-+  moveSquareColor, threatenedSquareColor,
-   jailSquareColor, highlightSquareColor, premoveHighlightColor;
- #if LOWTIMEWARNING
- Pixel lowTimeWarningColor;
-@@ -608,6 +617,8 @@ MenuItem optionsMenu[] = {
-     {"Show Coords", ShowCoordsProc},
-     {"Show Thinking", ShowThinkingProc},
-     {"Test Legality", TestLegalityProc},
-+    {"Show Legal Moves",ShowLegalMovesProc},
-+    {"Show Threatened Pieces",ShowThreatenedPiecesProc},
-     {NULL, NULL}
- };
- 
-@@ -742,6 +753,12 @@ XtResource clientResources[] = {
-     { "highlightSquareColor", "highlightSquareColor", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, highlightSquareColor),
-       XtRString, HIGHLIGHT_SQUARE_COLOR },
-+    { "moveSquareColor", "moveSquareColor", XtRString,
-+    sizeof(String), XtOffset(AppDataPtr, moveSquareColor),
-+    XtRString, MOVE_SQUARE_COLOR },
-+    { "threatenedSquareColor", "threatenedSquareColor", XtRString,
-+    sizeof(String), XtOffset(AppDataPtr, threatenedSquareColor),
-+    XtRString, THREATENED_SQUARE_COLOR },
-     { "premoveHighlightColor", "premoveHighlightColor", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, premoveHighlightColor),
-       XtRString, PREMOVE_HIGHLIGHT_COLOR },
-@@ -1155,6 +1172,8 @@ XrmOptionDescRec shellOptions[] = {
-     { "-lightSquareColor", "lightSquareColor", XrmoptionSepArg, NULL },
-     { "-darkSquareColor", "darkSquareColor", XrmoptionSepArg, NULL },
-     { "-highlightSquareColor", "highlightSquareColor", XrmoptionSepArg, NULL 
},
-+    { "-moveSquareColor", "moveSquareColor", XrmoptionSepArg, NULL },
-+    { "-threatenedSquareColor", "threatenedSquareColor", XrmoptionSepArg, 
NULL },
-     { "-premoveHighlightColor", "premoveHighlightColor", 
XrmoptionSepArg,NULL},
-     { "-movesPerSession", "movesPerSession", XrmoptionSepArg, NULL },
-     { "-mps", "movesPerSession", XrmoptionSepArg, NULL },
-@@ -1537,6 +1556,7 @@ XtActionsRec boardActions[] = {
-     { "ShowCoordsProc", ShowCoordsProc },
-     { "ShowThinkingProc", ShowThinkingProc },
-     { "TestLegalityProc", TestLegalityProc },
-+    { "ShowLegalMovesProc", ShowLegalMovesProc },
-     { "InfoProc", InfoProc },
-     { "ManProc", ManProc },
-     { "HintProc", HintProc },
-@@ -2097,6 +2117,30 @@ main(argc, argv)
-     }
- 
-     if (!appData.monoMode) {
-+    vFrom.addr = (caddr_t) appData.moveSquareColor;
-+    vFrom.size = strlen(appData.moveSquareColor);
-+    XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo);
-+    if (vTo.addr == NULL) {
-+      appData.monoMode = True;
-+      forceMono = True;
-+    } else {
-+      moveSquareColor = *(Pixel *) vTo.addr;
-+    }
-+    }
-+
-+    if (!appData.monoMode) {
-+    vFrom.addr = (caddr_t) appData.threatenedSquareColor;
-+    vFrom.size = strlen(appData.threatenedSquareColor);
-+    XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo);
-+    if (vTo.addr == NULL) {
-+      appData.monoMode = True;
-+      forceMono = True;
-+    } else {
-+      threatenedSquareColor = *(Pixel *) vTo.addr;
-+    }
-+    }
-+
-+    if (!appData.monoMode) {
-       vFrom.addr = (caddr_t) appData.premoveHighlightColor;
-       vFrom.size = strlen(appData.premoveHighlightColor);
-       XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo);
-@@ -4315,6 +4359,7 @@ void XDrawPosition(w, repaint, board)
- 
-     /* If piece being dragged around board, must redraw that too */
-     DrawDragPiece();
-+    ShowThreatenedPieces(board);
- 
-     XSync(xDisplay, False);
- }
-@@ -6306,6 +6351,43 @@ void BlindfoldProc(w, event, prms, nprms
-     DrawPosition(True, NULL);
- }
- 
-+/* show legal moves on board when moving/dragging a piece */
-+void ShowLegalMovesProc(w, event, prms, nprms)
-+     Widget w;
-+     XEvent *event;
-+     String *prms;
-+     Cardinal *nprms;
-+{
-+    Arg args[16];
-+    appData.showLegalMoves = !appData.showLegalMoves;
-+
-+    if (appData.showLegalMoves) {
-+    XtSetArg(args[0], XtNleftBitmap, xMarkPixmap);
-+    } else {
-+    XtSetArg(args[0], XtNleftBitmap, None);
-+    }
-+    XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Show Legal Moves"),
-+        args, 1);
-+}
-+
-+void ShowThreatenedPiecesProc(w, event, prms, nprms)
-+     Widget w;
-+     XEvent *event;
-+     String *prms;
-+     Cardinal *nprms;
-+{
-+    Arg args[16];
-+    appData.showThreatenedPieces = !appData.showThreatenedPieces;
-+
-+    if (appData.showThreatenedPieces) {
-+    XtSetArg(args[0], XtNleftBitmap, xMarkPixmap);
-+    } else {
-+    XtSetArg(args[0], XtNleftBitmap, None);
-+    }
-+    XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Show Threatened 
Pieces"),
-+        args, 1);
-+}
-+
- void TestLegalityProc(w, event, prms, nprms)
-      Widget w;
-      XEvent *event;
-@@ -8344,6 +8426,7 @@ EndAnimation (anim, finish)
-               0, 0, squareSize, squareSize,
-               anim->prevFrame.x, anim->prevFrame.y);
-   }
-+    
- }
- 
- static void
-@@ -8464,6 +8547,10 @@ DragPieceBegin(x, y)
-     if (player.dragPiece >= 0 && player.dragPiece < EmptySquare) {
-       player.dragActive = True;
-       BeginAnimation(&player, player.dragPiece, color, &corner);
-+
-+    /* show the squares where this piece can be legally moved */
-+    ShowLegalPieceSquares(fromX,fromY);
-+
-       /* Mark this square as needing to be redrawn. Note that
-          we don't remove the piece though, since logically (ie
-          as seen by opponent) the move hasn't been made yet. */
-@@ -8473,6 +8560,93 @@ DragPieceBegin(x, y)
-     }
- }
- 
-+/* squares that are highlighted from moving a piece */
-+static int xHighlights[BOARD_SIZE*BOARD_SIZE];
-+static int yHighlights[BOARD_SIZE*BOARD_SIZE];
-+
-+/* highlight squares where legal moves can be made by current piece */
-+static void ShowLegalPieceSquares(boardX,boardY)
-+    int boardX;int boardY;
-+{
-+
-+    int  x, y, currHighlight = 0, i = 0;
-+
-+    if ( ! appData.showLegalMoves ) return;
-+
-+    for ( i = 0 ; i < BOARD_SIZE; i++ )
-+    {
-+        xHighlights[i] = -1;
-+        yHighlights[i] = -1;
-+    }
-+    
-+    for ( x = 0; x < BOARD_SIZE ; x++)
-+    {
-+        for ( y = 0 ; y < BOARD_SIZE; y++)
-+        {
-+            int legalmove = LegalityTest(boards[currentMove],
-+                                         PosFlags(currentMove),
-+                                         EP_UNKNOWN, fromY, fromX, y,x,0);
-+#ifdef DEBUG_MOVE_PIECES
-+            printf("Move from %d %d to %d %d == %s - currentMove = 
%d\n",fromX,fromY,x,y,(legalmove == IllegalMove || legalmove == 
ImpossibleMove)?"Illegal move":"Legal move",currentMove);
-+
-+#endif
-+
-+            if ( legalmove != IllegalMove && legalmove != ImpossibleMove)
-+            {
-+                XtGCMask value_mask = GCLineWidth | GCLineStyle | GCForeground
-+                                    | GCBackground | GCFunction | GCPlaneMask;
-+                XGCValues gc_values;
-+                gc_values.plane_mask = AllPlanes;
-+                gc_values.line_width = lineGap;
-+                gc_values.line_style = LineSolid;
-+                gc_values.function = GXcopy;
-+
-+#ifdef DEBUG_MOVE_PIECES
-+                printf("Highlight x = %d y = %d\n",x,y);
-+#endif
-+                gc_values.foreground = moveSquareColor;
-+                gc_values.background = moveSquareColor;
-+
-+                drawHighlight(x,y,XtGetGC(shellWidget, value_mask, 
&gc_values));
-+                xHighlights[currHighlight] = x;
-+                yHighlights[currHighlight] = y;
-+                currHighlight++;
-+            }
-+        }
-+    }
-+}
-+
-+/* remove highlights from squares that were highlighted
-+   as a result of picking up a piece and showing the legal moves */
-+static void UnShowLegalPieceSquares()
-+{
-+    int i = 0;
-+    GC clearpieceGC;
-+    XtGCMask value_mask = GCLineWidth | GCLineStyle | GCForeground
-+                                    | GCBackground | GCFunction | GCPlaneMask;
-+    XGCValues gc_values;
-+    if ( ! appData.showLegalMoves ) return;
-+
-+    gc_values.plane_mask = AllPlanes;
-+    gc_values.line_width = lineGap;
-+    gc_values.line_style = LineSolid;
-+    gc_values.function = GXcopy;
-+
-+    gc_values.foreground = jailSquareColor;
-+    gc_values.background = jailSquareColor;
-+
-+    for ( i = 0 ; i < BOARD_SIZE*BOARD_SIZE && xHighlights[i] != -1 && 
yHighlights[i] != -1; i++ )
-+    {
-+        clearpieceGC = XtGetGC(shellWidget, value_mask, &gc_values);    
-+#ifdef DEBUG_MOVE_PIECES
-+        printf("Erasing %d 
%d\n",BOARD_SIZE*BOARD_SIZE,xHighlights[i],yHighlights[i]);
-+#endif
-+        drawHighlight(xHighlights[i], yHighlights[i],clearpieceGC);
-+        xHighlights[i] = -1;
-+        yHighlights[i] = -1;
-+    }
-+}
-+
- static void
- DragPieceMove(x, y)
-      int x; int y;
-@@ -8492,7 +8666,8 @@ DragPieceMove(x, y)
-     corner.y = y - player.mouseDelta.y;
-     AnimationFrame(&player, &corner, player.dragPiece);
- #if HIGHDRAG
--    if (appData.highlightDragging) {
-+    if (appData.highlightDragging) 
-+    {
-       int boardX, boardY;
-       BoardSquare(x, y, &boardX, &boardY);
-       SetHighlights(fromX, fromY, boardX, boardY);
-@@ -8526,12 +8701,156 @@ DragPieceEnd(x, y)
-     /* This prevents weird things happening with fast successive
-        clicks which on my Sun at least can cause motion events
-        without corresponding press/release. */
-+
-+    /* un highlight the squares where the piece can be legally moved */
-+    UnShowLegalPieceSquares();
-     player.dragActive = False;
- }
- 
-+/* return false (0) if not a white piece, true otherwise */
-+static int WhitePiece(piece)
-+     ChessSquare piece;
-+{
-+    return (int) piece >= (int) WhitePawn && (int) piece <= (int) WhiteKing;
-+}
-+
-+/* return false (0) if not a black piece, true otherwise */
-+static int BlackPiece(piece)
-+     ChessSquare piece;
-+{
-+    return (int) piece >= (int) BlackPawn && (int) piece <= (int) BlackKing;
-+}
-+
-+/* used for keeping track of whether a move was made or a
-+   screen refresh has occured */
-+static int old_currentMove = -1;
-+/* 2d array of board positions, used to indicate which
-+   square to highlight as threatened */
-+static int threatenedSquares[BOARD_SIZE][BOARD_SIZE];
-+
-+/* called from ShowThreatenedPieces, redraw screen (refresh) */
-+static void redrawBoard(Board board)
-+{
-+    int i, j;
-+    /* setup colors to show threatened squares */
-+    XtGCMask value_mask = GCLineWidth | GCLineStyle | GCForeground
-+        | GCBackground | GCFunction | GCPlaneMask;
-+    XGCValues gc_values;
-+    gc_values.plane_mask = AllPlanes;
-+    gc_values.line_width = lineGap;
-+    gc_values.line_style = LineSolid;
-+    gc_values.function = GXcopy;
-+
-+    gc_values.foreground = threatenedSquareColor;
-+    gc_values.background = threatenedSquareColor;
-+
-+    /* iterate through board and highlight threatened pieces */
-+    for ( i = 0 ; i < BOARD_SIZE ; i++ )
-+        for ( j = 0 ; j < BOARD_SIZE ; j++ )
-+            if ( threatenedSquares[i][j] == 1 ) 
-+                drawHighlight(j,i,XtGetGC(shellWidget, value_mask, 
&gc_values));
-+}
-+
-+void ShowThreatenedPieces(Board board)
-+{
-+    int x, y, boardX, boardY;
-+
-+    if ( !appData.showThreatenedPieces) return;
-+
-+    if ( old_currentMove == currentMove)
-+        redrawBoard(board);
-+    else /* piece was moved on the board */
-+    {
-+        int i, j;
-+
-+    /* setup color for threatened pieces squares */
-+        old_currentMove = currentMove;
-+        GC clearpieceGC;
-+        XtGCMask value_mask = GCLineWidth | GCLineStyle | GCForeground
-+                                        | GCBackground | GCFunction | 
GCPlaneMask;
-+        XGCValues gc_values;
-+
-+        gc_values.plane_mask = AllPlanes;
-+        gc_values.line_width = lineGap;
-+        gc_values.line_style = LineSolid;
-+        gc_values.function = GXcopy;
-+
-+        gc_values.foreground = jailSquareColor;
-+        gc_values.background = jailSquareColor;
-+
-+        clearpieceGC = XtGetGC(shellWidget, value_mask, &gc_values);    
-+
-+        /* clear previous storage of threatened squares coords */
-+        for ( i = 0 ; i < BOARD_SIZE ; i++ )
-+            for ( j = 0 ; j < BOARD_SIZE ; j++ )
-+                if (threatenedSquares[i][j] == 1 )
-+                {
-+                    drawHighlight(j,i ,clearpieceGC);
-+                    threatenedSquares[i][j] = 0 ;
-+                }
-+
-+        /* determine which squares need to be highlightened 
-+           as threatened */
-+        for(boardX = 0 ; boardX < BOARD_SIZE ; boardX++ )
-+            for ( boardY = 0 ; boardY < BOARD_SIZE ; boardY++ )
-+            {
-+                /* not worth continuing if from or to square is blank */
-+                if ( !WhitePiece(board[boardY][boardX]) &&
-+                     !BlackPiece(board[boardY][boardX]))
-+                    continue;
-+
-+                for ( toX = 0; toX < BOARD_SIZE ; toX++)
-+                {
-+                    for ( toY = 0 ; toY < BOARD_SIZE; toY++)
-+                    {
-+                        int legalmove, legalmove2;
-+                /* test if it's worth continuing, from piece moving to 
-+                   opponent piece */
-+                        if ( !WhitePiece(board[toY][toX]) &&
-+                             !BlackPiece(board[toY][toX]))
-+                            continue;
-+
-+                        if ( BlackPiece(board[boardY][boardX]) && 
-+                             !WhitePiece(board[toY][toX]) )  
-+                            continue;
-+
-+                        if ( WhitePiece(board[boardY][boardX]) &&
-+                             !BlackPiece(board[toY][toX]) ) 
-+                            continue;
-+            
-+            /* the Posflags in the LegalityTest needs to be -1 because
-+               the LegalityTest is done for the current move, which is updated
-+               when the current piece was put down and switched to the other 
color
-+               whereas we want the legality test for the old color otherwise
-+               it will be classified as an IllegalMove */
-+
-+                /* legal moves for the previous color (user) */
-+                        legalmove = LegalityTest(boards[currentMove],
-+                                                 PosFlags(currentMove)-1, 
-+                                                 EP_UNKNOWN, 
-+                                                 boardY, boardX, toY,toX,0);
-+
-+                /* legal moves for the current color (user) */
-+                        legalmove2 = LegalityTest(boards[currentMove],
-+                                                 PosFlags(currentMove), 
-+                                                 EP_UNKNOWN,    
-+                                                 boardY, boardX, toY,toX,0);
-+
-+                        if ( legalmove != IllegalMove  || 
-+                             legalmove2 != IllegalMove)
-+                            threatenedSquares[toY][toX] = 1;
-+                    }
-+                }
-+            }
-+    }
-+    /* redraw the board to reflect current changes */
-+    redrawBoard(board);
-+}
-+
- /* Handle expose event while piece being dragged */
- 
--static void
-+static
-+void
- DrawDragPiece ()
- {
-   if (!player.dragActive || appData.blindfold)
---- xboard-4.2.7/backend.c.hilite      2003-11-28 17:37:36.000000000 +0800
-+++ xboard-4.2.7/backend.c     2005-06-03 09:33:57.000000000 +0800
-@@ -4858,6 +4858,7 @@ ShowMove(fromX, fromY, toX, toY)
-     DrawPosition(FALSE, boards[currentMove]);
-     DisplayBothClocks();
-     HistorySet(parseList,backwardMostMove,forwardMostMove,currentMove-1);
-+      ShowThreatenedPieces(boards[currentMove]);
- }
- 
- 
diff --git a/xboard-lowtime-warning.patch b/xboard-lowtime-warning.patch
deleted file mode 100644
index e12e85e..0000000
--- a/xboard-lowtime-warning.patch
+++ /dev/null
@@ -1,174 +0,0 @@
---- xboard-4.2.7/common.h.lowtime      2003-10-28 03:21:00.000000000 +0800
-+++ xboard-4.2.7/common.h      2005-06-03 07:26:40.000000000 +0800
-@@ -425,6 +425,10 @@ typedef struct {
-     int zippyMaxGames;
-     int zippyReplayTimeout; /*seconds*/
- #endif
-+#if LOWTIMEWARNING
-+  char *lowTimeWarningColor;
-+  Boolean lowTimeWarning;
-+#endif
- } AppData, *AppDataPtr;
- 
- extern AppData appData;
---- xboard-4.2.7/xboard.h.lowtime      2003-10-28 03:21:00.000000000 +0800
-+++ xboard-4.2.7/xboard.h      2005-06-03 07:26:40.000000000 +0800
-@@ -64,6 +64,7 @@
- #define COLOR_REQUEST           "red"
- #define COLOR_SEEK              "blue"
- #define COLOR_NORMAL            "default"
-+#define COLOR_LOWTIMEWARNING    "red"
- 
- typedef struct {
-     char *name;
---- xboard-4.2.7/xboard.man.lowtime    2003-11-29 05:35:39.000000000 +0800
-+++ xboard-4.2.7/xboard.man    2005-06-03 07:26:40.000000000 +0800
-@@ -1641,6 +1641,15 @@ Sets the Animate Moving menu option. See
- .B -animateSpeed n
- Number of milliseconds delay between each animation frame when Animate
- Moves is on.
-+.TP
-+.B -lowTimeWarning true/false
-+When time is tight, use alternative color to show timer. This is done when
-+the clock counts down to icsAlarmTime (5 seconds by default). It can be
-+used in conjunction with sound alarm.  Default: true.
-+.TP
-+.B -lowTimeWarningColor color
-+Color to use when lowTimeWarning option is used and time is tight.
-+Default: red.
- .PP
- .SS Other Options
- .TP
---- xboard-4.2.7/xboard.c.lowtime      2003-11-19 16:42:18.000000000 +0800
-+++ xboard-4.2.7/xboard.c      2005-06-03 07:26:40.000000000 +0800
-@@ -418,6 +418,9 @@ Display *xDisplay;
- Window xBoardWindow;
- Pixel lightSquareColor, darkSquareColor, whitePieceColor, blackPieceColor,
-   jailSquareColor, highlightSquareColor, premoveHighlightColor;
-+#if LOWTIMEWARNING
-+Pixel lowTimeWarningColor;
-+#endif
- GC lightSquareGC, darkSquareGC, jailSquareGC, lineGC, wdPieceGC, wlPieceGC,
-   bdPieceGC, blPieceGC, wbPieceGC, bwPieceGC, coordGC, highlineGC,
-   wjPieceGC, bjPieceGC, prelineGC;
-@@ -1136,6 +1139,14 @@ XtResource clientResources[] = {
-     { "showButtonBar", "showButtonBar", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, showButtonBar),
-       XtRImmediate, (XtPointer) True },
-+#if LOWTIMEWARNING
-+    { "lowTimeWarningColor", "lowTimeWarningColor", XtRString,
-+      sizeof(String), XtOffset(AppDataPtr, lowTimeWarningColor),
-+      XtRString, COLOR_LOWTIMEWARNING },
-+    { "lowTimeWarning", "lowTimeWarning", XtRBoolean,
-+      sizeof(Boolean), XtOffset(AppDataPtr, lowTimeWarning),
-+      XtRImmediate, (XtPointer) True },
-+#endif   
- };
- 
- XrmOptionDescRec shellOptions[] = {
-@@ -1426,6 +1437,10 @@ XrmOptionDescRec shellOptions[] = {
-     { "-showButtonBar", "showButtonBar", XrmoptionSepArg, NULL },
-     { "-buttons", "showButtonBar", XrmoptionNoArg, "True" },
-     { "-xbuttons", "showButtonBar", XrmoptionNoArg, "False" },
-+#if LOWTIMEWARNING
-+    { "-lowTimeWarningColor", "lowTimeWarningColor", XrmoptionSepArg, NULL },
-+    { "-lowTimeWarning", "lowTimeWarning", XrmoptionSepArg, NULL },
-+#endif
- };
- 
- 
-@@ -1861,6 +1876,20 @@ main(argc, argv)
-     if (argc > 1) {
-       fprintf(stderr, "%s: unrecognized argument %s\n",
-               programName, argv[1]);
-+      fprintf(stderr, "Recognized options:\n");
-+      for(i = 0; i < XtNumber(shellOptions); i++) {
-+          j = fprintf(stderr, "  %s%s", shellOptions[i].option,
-+                      (shellOptions[i].argKind == XrmoptionSepArg
-+                       ? " ARG" : ""));
-+          if (i++ < XtNumber(shellOptions)) {
-+              fprintf(stderr, "%*c%s%s\n", 40 - j, ' ',
-+                      shellOptions[i].option,
-+                      (shellOptions[i].argKind == XrmoptionSepArg
-+                       ? " ARG" : ""));
-+          } else {
-+              fprintf(stderr, "\n");
-+          }
-+      }
-       exit(2);
-     }
-     
-@@ -2084,6 +2113,21 @@ main(argc, argv)
-             programName);
-     }
- 
-+#if LOWTIMEWARNING
-+
-+    if (appData.lowTimeWarning && !appData.monoMode) {
-+      vFrom.addr = (caddr_t) appData.lowTimeWarningColor;
-+      vFrom.size = strlen(appData.lowTimeWarningColor);
-+      XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo);
-+      if (vTo.addr == NULL) 
-+      appData.monoMode = True;
-+      else
-+      lowTimeWarningColor = *(Pixel *) vTo.addr;
-+    }
-+
-+#endif
-+      
-+
-     if (appData.monoMode && appData.debugMode) {
-       fprintf(stderr, "white pixel = 0x%lx, black pixel = 0x%lx\n",
-               (unsigned long) XWhitePixel(xDisplay, xScreen),
-@@ -7321,7 +7365,17 @@ DisplayTimerLabel(w, color, timer, highl
- {
-     char buf[MSG_SIZ];
-     Arg args[16];
--    
-+
-+#if LOWTIMEWARNING
-+    Pixel foregroundOrWarningColor = timerForegroundPixel;
-+
-+    if (appData.lowTimeWarning
-+      && timer < appData.icsAlarmTime)
-+
-+      foregroundOrWarningColor = lowTimeWarningColor;
-+
-+#endif
-+
-     if (appData.clockMode) {
-       sprintf(buf, "%s: %s", color, TimeString(timer));
-       XtSetArg(args[0], XtNlabel, buf);
-@@ -7331,11 +7385,24 @@ DisplayTimerLabel(w, color, timer, highl
-     }
-     
-     if (highlight) {
-+
-+#if LOWTIMEWARNING
-+      XtSetArg(args[1], XtNbackground, foregroundOrWarningColor);
-+#else
-       XtSetArg(args[1], XtNbackground, timerForegroundPixel);
-+#endif
-+
-       XtSetArg(args[2], XtNforeground, timerBackgroundPixel);
-     } else {
-+
-       XtSetArg(args[1], XtNbackground, timerBackgroundPixel);
-+
-+#if LOWTIMEWARNING
-+      XtSetArg(args[2], XtNforeground, foregroundOrWarningColor);
-+#else
-       XtSetArg(args[2], XtNforeground, timerForegroundPixel);
-+#endif
-+
-     }
-     
-     XtSetValues(w, args, 3);
---- xboard-4.2.7/config.h.in.lowtime   2000-12-17 10:24:48.000000000 +0800
-+++ xboard-4.2.7/config.h.in   2005-06-03 07:26:40.000000000 +0800
-@@ -133,3 +133,5 @@
- 
- /* Define if you have the seq library (-lseq).  */
- #undef HAVE_LIBSEQ
-+
-+#define LOWTIMEWARNING 1
diff --git a/xboard-xtname.patch b/xboard-xtname.patch
deleted file mode 100644
index 4933aee..0000000
--- a/xboard-xtname.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- xboard-4.2.7/xboard.c.xtname       2005-06-03 07:49:06.000000000 +0800
-+++ xboard-4.2.7/xboard.c      2005-06-03 07:49:45.000000000 +0800
-@@ -4790,9 +4790,7 @@ void EditCommentCallback(w, client_data,
-     int j;
-     Widget edit;
- 
--    j = 0;
--    XtSetArg(args[j], XtNlabel, &name);  j++;
--    XtGetValues(w, args, j);
-+    name = XtName(w);
- 
-     if (strcmp(name, "ok") == 0) {
-       edit = XtNameToWidget(editShell, "*form.text");
---- xboard-4.2.7/xedittags.c.xtname    2003-10-28 03:21:00.000000000 +0800
-+++ xboard-4.2.7/xedittags.c   2005-06-03 07:49:45.000000000 +0800
-@@ -105,13 +105,7 @@ void TagsCallback(w, client_data, call_d
-      Widget w;
-      XtPointer client_data, call_data;
- {
--    String name;
--    Arg args[16];
--    int j;
--
--    j = 0;
--    XtSetArg(args[j], XtNlabel, &name);  j++;
--    XtGetValues(w, args, j);
-+    String name = XtName(w);
- 
-     if (strcmp(name, "close") == 0) {
-       TagsPopDown();
-@@ -131,9 +125,7 @@ void EditTagsCallback(w, client_data, ca
-     int j;
-     Widget textw;
- 
--    j = 0;
--    XtSetArg(args[j], XtNlabel, &name);  j++;
--    XtGetValues(w, args, j);
-+    name = XtName(w);
- 
-     if (strcmp(name, "ok") == 0) {
-       textw = XtNameToWidget(editTagsShell, "*form.text");
diff --git a/xboard.desktop b/xboard.desktop
deleted file mode 100644
index 2aed94d..0000000
--- a/xboard.desktop
+++ /dev/null
@@ -1,57 +0,0 @@
-[Desktop Entry]
-Name=Xboard
-Name[af]=X-bord
-Name[eo]=X-Breto
-Name[ru]=Шахматы X
-Name[ve]=Bodo ya X
-Name[zh_CN]=X 国际象棋
-Name[zh_TW]=Xboard 國際象棋
-Name[zu]=X Ibhodi
-Comment=Chess Game
-Comment[af]=Skaak Speletjie
-Comment[ar]=لعبة شطرنج
-Comment[be]=Шахматы
-Comment[bg]=Шах
-Comment[bs]=Igra šaha
-Comment[cs]=Šachy
-Comment[da]=Skakspil
-Comment[de]=Schachspiel
-Comment[el]=Παιχνίδι Σκάκι
-Comment[eo]=Ŝakludo
-Comment[es]=Juego de ajedrez
-Comment[et]=Male
-Comment[eu]=Xakea
-Comment[fi]=Shakkipeli
-Comment[fr]=Jeu d'échecs
-Comment[he]=משחק שחמט
-Comment[hu]=sakk
-Comment[is]=Skákleikur
-Comment[it]=Gioco di scacchi
-Comment[ja]=チェスゲーム
-Comment[lt]=Šachmatai
-Comment[lv]=Šaha Spēle
-Comment[mt]=Logħba ċess
-Comment[nb]=Sjakkspill
-Comment[nl]=schaakspel
-Comment[nn]=Sjakkspel
-Comment[pl]=Szachy
-Comment[pt]=Jogo de Xadrez
-Comment[pt_BR]=Xadrez
-Comment[ro]=Un joc de şah
-Comment[ru]=Шахматы
-Comment[sk]=Šach
-Comment[sl]=Igra šaha
-Comment[sv]=Schackspel
-Comment[th]=เกมหมากรุก
-Comment[uk]=Шахи
-Comment[ve]=Mutambo wa Tshese
-Comment[vi]=Chơi Cờ
-Comment[zh_CN]=国际象棋游戏
-Comment[zh_TW]=棋類遊戲
-Comment[zu]=Gnome umdlalo wechesi
-Exec=xboard
-Icon=xboard
-Terminal=false
-Type=Application
-Categories=Game;BoardGame;
-# vi: encoding=utf-8
diff --git a/xboard.png b/xboard.png
deleted file mode 100644
index 3a66588..0000000
Binary files a/xboard.png and /dev/null differ
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/xboard.git/commitdiff/1e6aa2c9a648f165abad83bda9d5ed94df91ea3f

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to