* xhistory.c -- Move list window, part of X front end for XBoard\r
* $Id$\r
*\r
- * Copyright 2000 Free Software Foundation, Inc.\r
- *\r
- * The following terms apply to the enhanced version of XBoard distributed\r
- * by the Free Software Foundation:\r
+ * Copyright 2000,2009 Free Software Foundation, Inc.\r
* ------------------------------------------------------------------------\r
- * This program is free software; you can redistribute it and/or modify\r
+ *\r
+ * GNU XBoard is free software: you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
+ * the Free Software Foundation, either version 3 of the License, or (at\r
+ * your option) any later version.\r
*\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
+ * GNU XBoard is distributed in the hope that it will be useful, but\r
+ * WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+ * General Public License for more details.\r
*\r
* You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\r
- * ------------------------------------------------------------------------\r
+ * along with this program. If not, see http://www.gnu.org/licenses/. *\r
*\r
- * See the file ChangeLog for a revision history.\r
- */\r
+ *------------------------------------------------------------------------\r
+ ** See the file ChangeLog for a revision history. */\r
\r
#include "config.h"\r
\r
\r
struct History{\r
String *Nr,*white,*black;\r
- int aNr; /* space actually alocated */ \r
+ int aNr; /* space actually alocated */\r
Widget mvn,mvw,mvb,vbox,viewport,sh;\r
char Up;\r
};\r
}\r
j=0;\r
XtSetArg(args[j], XtNleftBitmap, None); j++;\r
- XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Move List"),\r
+ XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Move History"),\r
args, j);\r
}\r
\r
free(hist->Nr);free(hist->white);free(hist->black);\r
}\r
else{\r
- hist=(struct History*)malloc(sizeof(struct History)); \r
+ hist=(struct History*)malloc(sizeof(struct History));\r
}\r
hist->aNr=len;\r
hist->Nr=(String*)malloc(hist->aNr*sizeof(String*));\r
hist->white=(String*)malloc(hist->aNr*sizeof(String*));\r
hist->black=(String*)malloc(hist->aNr*sizeof(String*));\r
- \r
+\r
hist->Nr[0]=(String)malloc(hist->aNr*6);\r
hist->white[0]=(String)malloc(hist->aNr*MOVE_LEN);\r
hist->black[0]=(String)malloc(hist->aNr*MOVE_LEN);\r
} else {\r
extra = extra/2;\r
}\r
- \r
+\r
j = 0;\r
XtSetArg(args[j], XtNwidth, &w); j++;\r
XtGetValues(hist->mvw, args, j);\r
if(hist){\r
if(last >= hist->aNr) HistoryAlloc(last+_LL_);\r
for(i=0;i<last;i++) {\r
- if((i%2)==0) { \r
+ if((i%2)==0) {\r
if(movelist[i][0]) {\r
char* p = strchr(movelist[i], ' ');\r
if (p) {\r
hist->white[i/2+1][p-movelist[i]] = NULLCHAR;\r
} else {\r
strcpy(hist->white[i/2+1],movelist[i]);\r
- } \r
+ }\r
} else {\r
strcpy(hist->white[i/2+1],dots);\r
}\r
hist->black[i/2+1][p-movelist[i]] = NULLCHAR;\r
} else {\r
strcpy(hist->black[i/2+1],movelist[i]);\r
- } \r
+ }\r
} else {\r
strcpy(hist->black[i/2+1],"");\r
}\r
<Key>Right: ForwardProc() \n";\r
/*--- allocate memory for move-strings ---*/\r
HistoryAlloc(_LL_);\r
- \r
+\r
/*-------- create the widgets ---------------*/\r
j = 0;\r
XtSetArg(args[j], XtNresizable, True); j++;\r
- XtSetArg(args[j], XtNallowShellResize, True); j++; \r
+ XtSetArg(args[j], XtNallowShellResize, True); j++;\r
#if TOPLEVEL\r
hist->sh =\r
XtCreatePopupShell(_("Move list"), topLevelShellWidgetClass,\r
hist->sh =\r
XtCreatePopupShell(_("Move list"), transientShellWidgetClass,\r
shellWidget, args, j);\r
-#endif \r
+#endif\r
j = 0;\r
XtSetArg(args[j], XtNborderWidth, 0); j++;\r
XtSetArg(args[j], XtNdefaultDistance, 0); j++;\r
layout =\r
XtCreateManagedWidget(layoutName, formWidgetClass, hist->sh,\r
args, j);\r
- \r
+\r
j = 0;\r
XtSetArg(args[j], XtNborderWidth, 0); j++;\r
XtSetArg(args[j], XtNresizable, True); j++;\r
- \r
+\r
form =\r
XtCreateManagedWidget("form", formWidgetClass, layout, args, j);\r
j=0;\r
XtSetArg(args[j], XtNorientation,XtorientHorizontal);j++;\r
hist->vbox =\r
XtCreateManagedWidget("vbox", formWidgetClass, hist->viewport, args, j);\r
- \r
+\r
j=0;\r
XtSetArg(args[j], XtNtop, XtChainTop); j++;\r
XtSetArg(args[j], XtNbottom, XtChainTop); j++;\r
XtSetArg(args[j], XtNleft, XtChainLeft); j++;\r
- XtSetArg(args[j], XtNright, XtChainLeft); j++; \r
- \r
+ XtSetArg(args[j], XtNright, XtChainLeft); j++;\r
+\r
XtSetArg(args[j], XtNdefaultColumns, 1); j++;\r
XtSetArg(args[j], XtNforceColumns, True); j++;\r
XtSetArg(args[j], XtNverticalList, True); j++;\r
XtSetArg(args[j], XtNtop, XtChainTop); j++;\r
XtSetArg(args[j], XtNbottom, XtChainTop); j++;\r
XtSetArg(args[j], XtNleft, XtChainLeft); j++;\r
- XtSetArg(args[j], XtNright, XtRubber); j++; \r
- \r
+ XtSetArg(args[j], XtNright, XtRubber); j++;\r
+\r
XtSetArg(args[j], XtNdefaultColumns, 1); j++;\r
XtSetArg(args[j], XtNforceColumns, True); j++;\r
XtSetArg(args[j], XtNverticalList, True); j++;\r
XtSetArg(args[j], XtNbottom, XtChainTop); j++;\r
XtSetArg(args[j], XtNleft, XtRubber); j++;\r
XtSetArg(args[j], XtNright, XtRubber); j++;\r
- \r
+\r
XtSetArg(args[j], XtNdefaultColumns, 1); j++;\r
XtSetArg(args[j], XtNforceColumns, True); j++;\r
XtSetArg(args[j], XtNverticalList, True); j++;\r
XtSetArg(args[j], XtNright, XtChainLeft); j++;\r
XtSetArg(args[j], XtNfromVert, hist->viewport); j++;\r
b_close= XtCreateManagedWidget(_("Close"), commandWidgetClass,\r
- form, args, j); \r
+ form, args, j);\r
XtAddCallback(b_close, XtNcallback, HistoryPopDown, (XtPointer) 0);\r
\r
- XtAugmentTranslations(hist->sh,XtParseTranslationTable (trstr)); \r
+ XtAugmentTranslations(hist->sh,XtParseTranslationTable (trstr));\r
\r
XtRealizeWidget(hist->sh);\r
CatchDeleteWindow(hist->sh, "HistoryPopDown");\r
strcpy(hist->white[i],dots);\r
strcpy(hist->black[i],"");\r
}\r
- \r
+\r
return hist->sh;\r
}\r
\r
int j;\r
\r
if(!hist) HistoryCreate();\r
+\r
XtPopup(hist->sh, XtGrabNone);\r
\r
// [HGM] restore old position\r
\r
j=0;\r
XtSetArg(args[j], XtNleftBitmap, xMarkPixmap); j++;\r
- XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Move List"),\r
+ XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Move History"),\r
args, j);\r
hist->Up=True;\r
}\r
\r
- \r
+\r
void\r
HistoryShowProc(w, event, prms, nprms)\r
Widget w;\r
}\r
ToNrEvent(currentMove);\r
}\r
- \r
+\r