commentShell, promotionShell, whitePieceMenu, blackPieceMenu, dropMenu,
menuBarWidget, buttonBarWidget, editShell, errorShell, analysisShell,
ICSInputShell, fileNameShell, askQuestionShell;
+Widget historyShell, evalGraphShell, gameListShell;
XSegment gridSegments[BOARD_RANKS + BOARD_FILES + 2];
XSegment jailGridSegments[BOARD_RANKS + BOARD_FILES + 6];
Font clockFontID, coordFontID, countFontID;
#define ICS_TEXT_MENU_SIZE 90
#define SetCurrentDirectory chdir
#define GetCurrentDirectory(SIZE, NAME) getcwd(NAME, SIZE)
+#define OPTCHAR "-"
+#define SEPCHAR " "
// these two must some day move to frontend.h, when they are implemented
Boolean EvalGraphIsUp();
Boolean MoveHistoryIsUp();
+Boolean GameListIsUp();
// The option definition and parsing code common to XBoard and WinBoard is collected in this file
#include "args.h"
default:
return;
}
- fprintf(f, "/%s=%s\n", ad->argName, name);
+ fprintf(f, OPTCHAR "%s" SEPCHAR "%s\n", ad->argName, name);
}
void
void
SaveAttribsArg(FILE *f, ArgDescriptor *ad)
{ // here the "argLoc" defines a table index. It could have contained the 'ta' pointer itself, though
- fprintf(f, "/%s=%s\n", ad->argName, (&appData.colorShout)[(int)ad->argLoc]);
+ fprintf(f, OPTCHAR "%s" SEPCHAR "%s\n", ad->argName, (&appData.colorShout)[(int)ad->argLoc]);
}
void
SaveColor(FILE *f, ArgDescriptor *ad)
{ // in WinBoard the color is an int and has to be converted to text. In X it would be a string already?
if(colorVariable[(int)ad->argLoc])
- fprintf(f, "/%s=%s\n", ad->argName, *(char**)colorVariable[(int)ad->argLoc]);
+ fprintf(f, OPTCHAR "%s" SEPCHAR "%s\n", ad->argName, *(char**)colorVariable[(int)ad->argLoc]);
}
void
SaveBoardSize(FILE *f, char *name, void *addr)
{ // wrapper to shield back-end from BoardSize & sizeInfo
- fprintf(f, "/%s=%s\n", name, appData.boardSize);
+ fprintf(f, OPTCHAR "%s" SEPCHAR "%s\n", name, appData.boardSize);
}
void
{ // no such option in XBoard (yet)
}
+extern Widget engineOutputShell;
+extern Widget tagsShell, editTagsShell;
+void
+GetActualPlacement(Widget wg, WindowPlacement *wp)
+{
+ Arg args[16];
+ Dimension w, h;
+ Position x, y;
+ int i;
+
+ if(!wg) return;
+
+ i = 0;
+ XtSetArg(args[i], XtNx, &x); i++;
+ XtSetArg(args[i], XtNy, &y); i++;
+ XtSetArg(args[i], XtNwidth, &w); i++;
+ XtSetArg(args[i], XtNheight, &h); i++;
+ XtGetValues(wg, args, i);
+ wp->x = x - 4;
+ wp->y = y - 23;
+ wp->height = h;
+ wp->width = w;
+}
+
void
GetWindowCoords()
{ // wrapper to shield use of window handles from back-end (make addressible by number?)
-#if 0
// In XBoard this will have to wait until awareness of window parameters is implemented
- GetActualPlacement(hwndMain, &wpMain);
+ GetActualPlacement(shellWidget, &wpMain);
+ if(EngineOutputIsUp()) GetActualPlacement(engineOutputShell, &wpEngineOutput); else
+ if(MoveHistoryIsUp()) GetActualPlacement(historyShell, &wpMoveHistory);
+ if(GameListIsUp()) GetActualPlacement(gameListShell, &wpGameList);
+ if(commentShell) GetActualPlacement(commentShell, &wpComment);
+ else GetActualPlacement(editShell, &wpComment);
+ if(tagsShell) GetActualPlacement(tagsShell, &wpTags);
+ else GetActualPlacement(editTagsShell, &wpTags);
+#if 0
GetActualPlacement(hwndConsole, &wpConsole);
- GetActualPlacement(commentDialog, &wpComment);
- GetActualPlacement(editTagsDialog, &wpTags);
- GetActualPlacement(gameListDialog, &wpGameList);
- GetActualPlacement(moveHistoryDialog, &wpMoveHistory);
GetActualPlacement(evalGraphDialog, &wpEvalGraph);
- GetActualPlacement(engineOutputDialog, &wpEngineOutput);
#endif
}
}
Boolean
-MoveHistoryIsUp()
-{
- return True; // still have to fix this *****************************************************************************
-}
-
-Boolean
EvalGraphIsUp()
{
return False;
XtRealizeWidget(shellWidget);
+ if(wpMain.x > 0) {
+ XtSetArg(args[0], XtNx, wpMain.x);
+ XtSetArg(args[1], XtNy, wpMain.y);
+ XtSetValues(shellWidget, args, 2);
+ }
+
/*
* Correct the width of the message and title widgets.
* It is not known why some systems need the extra fudge term.
(XtEventHandler) EventProc, NULL);
/* end why */
+ /* [AS] Restore layout */
+ if( wpMoveHistory.visible ) {
+ HistoryPopUp();
+ }
+
+// if( wpEvalGraph.visible ) {
+// EvalGraphPopUp();
+// }
+
+ if( wpEngineOutput.visible ) {
+ EngineOutputPopUp();
+ }
+
InitBackEnd2();
if (errorExitStatus == -1) {
#endif /*!NOTDEF*/
if (commentY < 0) commentY = 0; /*avoid positioning top offscreen*/
}
+
+ if(wpComment.width > 0) {
+ commentX = wpComment.x;
+ commentY = wpComment.y;
+ commentW = wpComment.width;
+ commentH = wpComment.height;
+ }
+
j = 0;
XtSetArg(args[j], XtNheight, commentH); j++;
XtSetArg(args[j], XtNwidth, commentW); j++;
* have a notion of a position that is selected but not copied.
* See http://www.freedesktop.org/wiki/Specifications/ClipboardsWiki
*/
+ if(gameMode == EditPosition) EditPositionDone(TRUE);
if (selected_fen_position) free(selected_fen_position);
selected_fen_position = (char *)PositionToFEN(currentMove, NULL);
if (!selected_fen_position) return;
strcpy(buf, cmdLine);
p = buf;
for (;;) {
+ while(*p == ' ') p++;
argv[i++] = p;
- p = strchr(p, ' ');
+ if(*p == '"' || *p == '\'')
+ p = strchr(++argv[i-1], *p);
+ else p = strchr(p, ' ');
if (p == NULL) break;
*p++ = NULLCHAR;
}