From: Arun Persaud Date: Sat, 9 Jan 2010 23:44:04 +0000 (-0800) Subject: Merge branch 'master-20091209' into gtk X-Git-Tag: gtk-20100118~11 X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=fe5ba22edf2cb7c260ecf17c7f095f0bc3e1b0a3 Merge branch 'master-20091209' into gtk Conflicts: Makefile.am backend.c xboard.c xhistory.c xhistory.h compiles, but there command line arguments are not recognized anymore. will fix this later. --- fe5ba22edf2cb7c260ecf17c7f095f0bc3e1b0a3 diff --cc Makefile.am index d678c54,7345205..c0dc779 --- a/Makefile.am +++ b/Makefile.am @@@ -29,7 -27,7 +30,8 @@@ xboard_SOURCES = backend.c backend.h ba xhistory.c xhistory.h \ xoptions.c \ $(ZPY) -xboard_LDADD = -lm @XAW_LIBS@ @X_LIBS@ ++ +xboard_LDADD = -lm @XAW_LIBS@ @GTK_LIBS@ EXTRA_DIST = pixmaps bitmaps winboard\ xboard.texi gpl.texinfo texi2man texinfo.tex xboard.man \ diff --cc gtk-interface.xml index 64cb593,0000000..7a2cf7e mode 100644,000000..100644 --- a/gtk-interface.xml +++ b/gtk-interface.xml @@@ -1,1366 -1,0 +1,1366 @@@ + + + + + + + + + + + + + + + + 5 + normal + False + + + True + vertical + 2 + + + True + True + automatic + automatic + + + True + True + MoveHistoryStore + False + False + 0 + + + Move + + + + 0 + + + + + + + White + + + + 1 + + + + + + + Black + + + + 2 + + + + + + + + + 1 + + + + + True + end + + + gtk-close + True + True + True + True + + + + False + False + 0 + + + + + False + end + 0 + + + + + + CloseButton + + + + GDK_EXPOSURE_MASK | GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK + XBoard + + + + + True + 0 + none + 0 + 0 + False + + + True + vertical + + + True + + + True + _File + True + + + True + + + True + Reset Game + True + + + + + + True + + + + + Load Game + True + image1 + False + + + + + + True + Load Next Game + True + + + + + + True + Load Previous Game + True + + + + + True + Reload Same Game + True + + + + + + Save Game + True + image2 + False + + + + + + True + + + + + True + Copy Game + True + + + + + True + Paste Game + True + + + + + True + + + + + True + Load Position + True + + + + + True + Load Next Position + True + + + + + True + Load Previous Position + True + + + + + True + Reload Same Position + True + + + + + True + Save Position + True + + + + + + True + + + + + True + Copy Position + True + + + + + True + Paste Position + True + + + + + True + + + + + True + Mail Move + True + + + + + True + Reload CMail Message + True + + + + + True + + + + + gtk-quit + True + True + True + + + + + + + + + + + True + _Mode + True + + + True + + + True + Machine White + True + True + + + + + + True + Machine Black + True + True + menuMode.Machine White + + + + + + True + Two Machines + True + True + menuMode.Machine White + + + + + + True + Analyze Mode + True + True + menuMode.Machine White + + + + + + True + Analyze File + True + True + menuMode.Machine White + + + + + + True + ICS Client + True + True + menuMode.Machine White + + + + + + True + Edit Game + True + True + menuMode.Machine White + + + + + + True + Edit Position + True + True + menuMode.Machine White + + + + + + True + Training + True + True + menuMode.Machine White + + + + + + True + + + + + True + Show Game List + True + + + + + True + Show Move List + True + + + + + + True + Edit Tags + True + + + + + + True + Edit Comments + True + + + + + True + ICS Input Box + True + + + + + True + Pause + True + + + + + + + + + True + _Action + True + + + True + + + True + Accept + True + + + + + + True + Decline + True + + + + + + True + Rematch + True + + + + + + True + + + + + True + Call Flag + True + + + + + + True + Draw + True + + + + + + True + Adjourn + True + + + + + + True + Abort + True + + + + + + True + Resign + True + + + + + + True + + + + + True + Stop Observing + True + + + + + True + Stop Examine + True + + + + + True + + + + + True + Adjucate to White + True + + + + + + True + Adjucate to Black + True + + + + + + True + Adjucate Draw + True + + + + + + + + + + True + _Step + True + + + True + + + True + Backward + True + + + + + + True + Forward + True + + + + + + True + Back to Start + True + + + + + + True + Forward to End + True + + + + + + True + Revert + True + + + + + + True + Truncate Game + True + + + + + + True + + + + + True + Move now + True + + + + + + True + Retract Move + True + + + + + + + + + + True + _Options + True + + + True + + + gtk-preferences + True + True + True + + + + + + True + Always Queen + True + + + + + + True + Animate Dragging + True + + + + + + True + Animate Moving + True + + + + + + True + Auto Comment + True + + + + + True + Auto Flag + True + + + + + True + Auto Flip View + True + + + + + True + Auto Observe + True + + + + + + True + Auto Raise Board + True + + + + + + True + Auto Save + True + + + + + + True + Blindfold + True + + + + + + True + Flash Moves + True + + + + + + True + Flip View + True + + + + + + True + Get Move List + True + + + + + + True + Highlight Last Move + True + + + + + + True + Move Sound + True + + + + + + True + ICS Alarm + True + + + + + + True + Old Save Style + True + + + + + + True + Periodic Updates + True + + + + + + True + Ponder Next Move + True + + + + + True + Popup Exit Message + True + + + + + True + Popup Move Errors + True + + + + + True + Premove + True + + + + + True + Quiet Play + True + + + + + True + Show Coords + True + + + + - ++ + True - Show Thinking ++ Hide Thinking + True + + + + + + True + Test Legality + True + + + + + + + + + + True + _Help + True + + + True + + + True + Man XBoard + True + + + + + + True + Info XBoard + True + + + + + + True + Hint + True + + + + + + True + Book + True + + + + + + True + + + + + gtk-about + True + True + True + + + + + + + + + + False + 0 + + + + + True + + + True + + + + True + White: + + + + + 0 + + + + + True + + + + True + Black: + + + + + 1 + + + + + False + 1 + + + + + True + + + True + 0 + not your turn + True + + + 0 + + + + + << + True + True + True + + + + False + False + 1 + + + + + < + True + True + True + + + + False + False + 2 + + + + + P + True + True + True + + + + False + False + 3 + + + + + > + True + True + True + + + False + False + 4 + + + + + >> + True + True + True + + + + False + False + 5 + + + + + False + 2 + + + + + True + GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK + + + + + + False + 3 + + + + + + + + + True + 0.40000000596046448 + gtk-open + + + True + gtk-save + 1 + + + 5 + normal + False + + + True + vertical + 2 + + + True + vertical + + + + + + 1 + + + + + True + end + + + gtk-edit + True + True + True + True + + + False + False + 0 + + + + + gtk-cancel + True + True + True + True + + + + False + False + 1 + + + + + False + end + 0 + + + + + + Edit + Cancel + + + + 5 + normal + False + + + True + vertical + 2 + + + True + True + + + True + + + Periodic Updates (Analysis Mode) + 300 + 40 + True + True + False + True + + + 30 + 10 + + + + + Engine #1 Score is Absolute + 300 + 40 + True + True + False + True + + + 30 + 60 + + + + + Engine #1 Score is Absolute + 400 + 40 + True + True + False + True + + + 30 + 110 + + + + + 300 + 40 + True + 0 + Engine-Engine Adjustications: + + + 10 + 160 + + + + + + + True + Adjudications + + + False + + + + + + + + True + page 2 + + + 1 + False + + + + + + + + True + page 3 + + + 2 + False + + + + + + + + True + page 4 + + + 3 + False + + + + + + + + True + page 5 + + + 4 + False + + + + + 1 + + + + + True + end + + + gtk-ok + True + True + True + True + + + False + False + 0 + + + + + gtk-cancel + True + True + True + True + + + False + False + 1 + + + + + False + end + 0 + + + + + + button1 + button2 + + + diff --cc xboard.c index a3fda95,bd46436..e0129a4 --- a/xboard.c +++ b/xboard.c @@@ -291,8 -339,86 +293,10 @@@ void EditCommentProc P((Widget w, XEven String *prms, Cardinal *nprms)); void IcsInputBoxProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void AcceptProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void DeclineProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void RematchProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void CallFlagProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void DrawProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void AbortProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void AdjournProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void ResignProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void AdjuWhiteProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void AdjuBlackProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void AdjuDrawProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); void EnterKeyProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void StopObservingProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void StopExaminingProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void BackwardProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void ForwardProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void ToStartProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void ToEndProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void RevertProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void TruncateGameProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void RetractMoveProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void MoveNowProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void AlwaysQueenProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void AnimateDraggingProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void AnimateMovingProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void AutocommProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void AutoflagProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void AutoflipProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void AutobsProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void AutoraiseProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void AutosaveProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void BlindfoldProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void FlashMovesProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void FlipViewProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void GetMoveListProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void HighlightDraggingProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void HighlightLastMoveProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void MoveSoundProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void IcsAlarmProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void OldSaveStyleProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void PeriodicUpdatesProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void PonderNextMoveProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void PopupMoveErrorsProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void PopupExitMessageProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void PremoveProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void QuietPlayProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void ShowCoordsProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void ShowThinkingProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void HideThinkingProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); -void TestLegalityProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); + void SaveSettingsProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void SaveOnExitProc 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)); -void BookProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); void AboutGameProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); -void AboutProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); void DebugProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); void NothingProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); void Iconify P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); @@@ -347,12 -466,11 +351,13 @@@ Pixmap iconPixmap, wIconPixmap, bIconPi Widget shellWidget, layoutWidget, formWidget, boardWidget, messageWidget, whiteTimerWidget, blackTimerWidget, titleWidget, widgetList[16], commentShell, promotionShell, whitePieceMenu, blackPieceMenu, dropMenu, - menuBarWidget, buttonBarWidget, editShell, errorShell, analysisShell, + menuBarWidget, editShell, errorShell, analysisShell, ICSInputShell, fileNameShell, askQuestionShell; + + Widget historyShell, evalGraphShell, gameListShell; -XSegment gridSegments[BOARD_RANKS + BOARD_FILES + 2]; -XSegment jailGridSegments[BOARD_RANKS + BOARD_FILES + 6]; +//XSegment gridSegments[BOARD_RANKS + BOARD_FILES + 2]; +//XSegment jailGridSegments[BOARD_RANKS + BOARD_FILES + 6]; + Font clockFontID, coordFontID, countFontID; XFontStruct *clockFontStruct, *coordFontStruct, *countFontStruct; XtAppContext appContext; @@@ -603,24 -596,58 +628,24 @@@ MenuItem fileMenu[] = }; MenuItem modeMenu[] = { - {N_("Machine White"), MachineWhiteProc}, - {N_("Machine Black"), MachineBlackProc}, - {N_("Two Machines"), TwoMachinesProc}, - {N_("Analysis Mode"), AnalyzeModeProc}, - {N_("Analyze File"), AnalyzeFileProc }, - {N_("ICS Client"), IcsClientProc}, - {N_("Edit Game"), EditGameProc}, - {N_("Edit Position"), EditPositionProc}, - {N_("Training"), TrainingProc}, - {"----", NothingProc}, + // {N_("Machine White"), MachineWhiteProc}, + // {N_("Machine Black"), MachineBlackProc}, + // {N_("Two Machines"), TwoMachinesProc}, + // {N_("Analysis Mode"), AnalyzeModeProc}, + // {N_("Analyze File"), AnalyzeFileProc }, + // {N_("ICS Client"), IcsClientProc}, + // {N_("Edit Game"), EditGameProc}, + // {N_("Edit Position"), EditPositionProc}, + // {N_("Training"), TrainingProc}, + // {"----", NothingProc}, {N_("Show Engine Output"), EngineOutputProc}, - {N_("Show Evaluation Graph"), NothingProc}, // [HGM] evalgr: not functional yet + {N_("Show Evaluation Graph"), EvalGraphProc}, {N_("Show Game List"), ShowGameListProc}, - {N_("Show Move History"), HistoryShowProc}, // [HGM] hist: activate 4.2.7 code - {"----", NothingProc}, - {N_("Edit Tags"), EditTagsProc}, + // {"Show Move History", HistoryShowProc}, // [HGM] hist: activate 4.2.7 code + // {"----", NothingProc}, + // {N_("Edit Tags"), EditTagsProc}, {N_("Edit Comment"), EditCommentProc}, {N_("ICS Input Box"), IcsInputBoxProc}, - {N_("Pause"), PauseProc}, - {NULL, NULL} -}; - -MenuItem actionMenu[] = { - {N_("Accept"), AcceptProc}, - {N_("Decline"), DeclineProc}, - {N_("Rematch"), RematchProc}, - {"----", NothingProc}, - {N_("Call Flag"), CallFlagProc}, - {N_("Draw"), DrawProc}, - {N_("Adjourn"), AdjournProc}, - {N_("Abort"), AbortProc}, - {N_("Resign"), ResignProc}, - {"----", NothingProc}, - {N_("Stop Observing"), StopObservingProc}, - {N_("Stop Examining"), StopExaminingProc}, - {"----", NothingProc}, - {N_("Adjudicate to White"), AdjuWhiteProc}, - {N_("Adjudicate to Black"), AdjuBlackProc}, - {N_("Adjudicate Draw"), AdjuDrawProc}, - {NULL, NULL} -}; - -MenuItem stepMenu[] = { - {N_("Backward"), BackwardProc}, - {N_("Forward"), ForwardProc}, - {N_("Back to Start"), ToStartProc}, - {N_("Forward to End"), ToEndProc}, - {N_("Revert"), RevertProc}, - {N_("Truncate Game"), TruncateGameProc}, - {"----", NothingProc}, - {N_("Move Now"), MoveNowProc}, - {N_("Retract Move"), RetractMoveProc}, {NULL, NULL} }; @@@ -633,33 -660,37 +658,37 @@@ MenuItem optionsMenu[] = {N_("Engine #2 Settings ..."), SecondSettingsProc}, {N_("Time Control ..."), TimeControlProc}, {"----", NothingProc}, - {N_("Always Queen"), AlwaysQueenProc}, - {N_("Animate Dragging"), AnimateDraggingProc}, - {N_("Animate Moving"), AnimateMovingProc}, - {N_("Auto Comment"), AutocommProc}, - {N_("Auto Flag"), AutoflagProc}, - {N_("Auto Flip View"), AutoflipProc}, - {N_("Auto Observe"), AutobsProc}, - {N_("Auto Raise Board"), AutoraiseProc}, - {N_("Auto Save"), AutosaveProc}, - {N_("Blindfold"), BlindfoldProc}, - {N_("Flash Moves"), FlashMovesProc}, - {N_("Get Move List"), GetMoveListProc}, -#if HIGHDRAG - {N_("Highlight Dragging"), HighlightDraggingProc}, -#endif - {N_("Highlight Last Move"), HighlightLastMoveProc}, - {N_("Move Sound"), MoveSoundProc}, - {N_("ICS Alarm"), IcsAlarmProc}, - {N_("Old Save Style"), OldSaveStyleProc}, - {N_("Periodic Updates"), PeriodicUpdatesProc}, - {N_("Ponder Next Move"), PonderNextMoveProc}, - {N_("Popup Exit Message"), PopupExitMessageProc}, - {N_("Popup Move Errors"), PopupMoveErrorsProc}, - {N_("Premove"), PremoveProc}, - {N_("Quiet Play"), QuietPlayProc}, - {N_("Show Coords"), ShowCoordsProc}, - {N_("Hide Thinking"), HideThinkingProc}, - {N_("Test Legality"), TestLegalityProc}, + // {N_("Always Queen"), AlwaysQueenProc}, + // {N_("Animate Dragging"), AnimateDraggingProc}, + // {N_("Animate Moving"), AnimateMovingProc}, + // {N_("Auto Comment"), AutocommProc}, + // {N_("Auto Flag"), AutoflagProc}, + // {N_("Auto Flip View"), AutoflipProc}, + // {N_("Auto Observe"), AutobsProc}, + // {N_("Auto Raise Board"), AutoraiseProc}, + // {N_("Auto Save"), AutosaveProc}, + // {N_("Blindfold"), BlindfoldProc}, + // {N_("Flash Moves"), FlashMovesProc}, + // {N_("Get Move List"), GetMoveListProc}, + //#if HIGHDRAG + // {N_("Highlight Dragging"), HighlightDraggingProc}, + //#endif + // {N_("Highlight Last Move"), HighlightLastMoveProc}, + // {N_("Move Sound"), MoveSoundProc}, + // {N_("ICS Alarm"), IcsAlarmProc}, + // {N_("Old Save Style"), OldSaveStyleProc}, + // {N_("Periodic Updates"), PeriodicUpdatesProc}, + // {N_("Ponder Next Move"), PonderNextMoveProc}, + // {N_("Popup Exit Message"), PopupExitMessageProc}, + // {N_("Popup Move Errors"), PopupMoveErrorsProc}, + // {N_("Premove"), PremoveProc}, + // {N_("Quiet Play"), QuietPlayProc}, + // {N_("Hide Thinking"), HideThinkingProc}, + // {N_("Test Legality"), TestLegalityProc}, ++ // {N_("Show Coords"), ShowCoordsProc}, + {"----", NothingProc}, + {N_("Save Settings Now"), SaveSettingsProc}, + {N_("Save Settings on Exit"), SaveOnExitProc}, {NULL, NULL} }; @@@ -732,290 -796,26 +761,7 @@@ Arg boardArgs[] = { XtNheight, 0 } }; -Arg titleArgs[] = { - { XtNjustify, (XtArgVal) XtJustifyRight }, - { XtNlabel, (XtArgVal) "..." }, - { XtNresizable, (XtArgVal) True }, - { XtNresize, (XtArgVal) False } -}; - -Arg messageArgs[] = { - { XtNjustify, (XtArgVal) XtJustifyLeft }, - { XtNlabel, (XtArgVal) "..." }, - { XtNresizable, (XtArgVal) True }, - { XtNresize, (XtArgVal) False } -}; - -Arg timerArgs[] = { - { XtNborderWidth, 0 }, - { XtNjustify, (XtArgVal) XtJustifyLeft } -}; - XtResource clientResources[] = { - { "whitePieceColor", "whitePieceColor", XtRString, sizeof(String), - XtOffset(AppDataPtr, whitePieceColor), XtRString, - WHITE_PIECE_COLOR }, - { "blackPieceColor", "blackPieceColor", XtRString, sizeof(String), - XtOffset(AppDataPtr, blackPieceColor), XtRString, - BLACK_PIECE_COLOR }, - { "lightSquareColor", "lightSquareColor", XtRString, - sizeof(String), XtOffset(AppDataPtr, lightSquareColor), - XtRString, LIGHT_SQUARE_COLOR }, - { "darkSquareColor", "darkSquareColor", XtRString, sizeof(String), - XtOffset(AppDataPtr, darkSquareColor), XtRString, - DARK_SQUARE_COLOR }, - { "highlightSquareColor", "highlightSquareColor", XtRString, - sizeof(String), XtOffset(AppDataPtr, highlightSquareColor), - XtRString, HIGHLIGHT_SQUARE_COLOR }, - { "premoveHighlightColor", "premoveHighlightColor", XtRString, - sizeof(String), XtOffset(AppDataPtr, premoveHighlightColor), - XtRString, PREMOVE_HIGHLIGHT_COLOR }, - { "movesPerSession", "movesPerSession", XtRInt, sizeof(int), - XtOffset(AppDataPtr, movesPerSession), XtRImmediate, - (XtPointer) MOVES_PER_SESSION }, - { "timeIncrement", "timeIncrement", XtRInt, sizeof(int), - XtOffset(AppDataPtr, timeIncrement), XtRImmediate, - (XtPointer) TIME_INCREMENT }, - { "initString", "initString", XtRString, sizeof(String), - XtOffset(AppDataPtr, initString), XtRString, INIT_STRING }, - { "secondInitString", "secondInitString", XtRString, sizeof(String), - XtOffset(AppDataPtr, secondInitString), XtRString, INIT_STRING }, - { "firstComputerString", "firstComputerString", XtRString, - sizeof(String), XtOffset(AppDataPtr, firstComputerString), XtRString, - COMPUTER_STRING }, - { "secondComputerString", "secondComputerString", XtRString, - sizeof(String), XtOffset(AppDataPtr, secondComputerString), XtRString, - COMPUTER_STRING }, - { "firstChessProgram", "firstChessProgram", XtRString, - sizeof(String), XtOffset(AppDataPtr, firstChessProgram), - XtRString, FIRST_CHESS_PROGRAM }, - { "secondChessProgram", "secondChessProgram", XtRString, - sizeof(String), XtOffset(AppDataPtr, secondChessProgram), - XtRString, SECOND_CHESS_PROGRAM }, - { "firstPlaysBlack", "firstPlaysBlack", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, firstPlaysBlack), - XtRImmediate, (XtPointer) False }, - { "noChessProgram", "noChessProgram", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, noChessProgram), - XtRImmediate, (XtPointer) False }, - { "firstHost", "firstHost", XtRString, sizeof(String), - XtOffset(AppDataPtr, firstHost), XtRString, FIRST_HOST }, - { "secondHost", "secondHost", XtRString, sizeof(String), - XtOffset(AppDataPtr, secondHost), XtRString, SECOND_HOST }, - { "firstDirectory", "firstDirectory", XtRString, sizeof(String), - XtOffset(AppDataPtr, firstDirectory), XtRString, "." }, - { "secondDirectory", "secondDirectory", XtRString, sizeof(String), - XtOffset(AppDataPtr, secondDirectory), XtRString, "." }, - { "bitmapDirectory", "bitmapDirectory", XtRString, - sizeof(String), XtOffset(AppDataPtr, bitmapDirectory), - XtRString, "" }, - { "remoteShell", "remoteShell", XtRString, sizeof(String), - XtOffset(AppDataPtr, remoteShell), XtRString, REMOTE_SHELL }, - { "remoteUser", "remoteUser", XtRString, sizeof(String), - XtOffset(AppDataPtr, remoteUser), XtRString, "" }, - { "timeDelay", "timeDelay", XtRFloat, sizeof(float), - XtOffset(AppDataPtr, timeDelay), XtRString, - (XtPointer) TIME_DELAY_QUOTE }, - { "timeControl", "timeControl", XtRString, sizeof(String), - XtOffset(AppDataPtr, timeControl), XtRString, - (XtPointer) TIME_CONTROL }, - { "internetChessServerMode", "internetChessServerMode", - XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, icsActive), XtRImmediate, - (XtPointer) False }, - { "internetChessServerHost", "internetChessServerHost", - XtRString, sizeof(String), - XtOffset(AppDataPtr, icsHost), - XtRString, (XtPointer) ICS_HOST }, - { "internetChessServerPort", "internetChessServerPort", - XtRString, sizeof(String), - XtOffset(AppDataPtr, icsPort), XtRString, - (XtPointer) ICS_PORT }, - { "internetChessServerCommPort", "internetChessServerCommPort", - XtRString, sizeof(String), - XtOffset(AppDataPtr, icsCommPort), XtRString, - ICS_COMM_PORT }, - { "internetChessServerLogonScript", "internetChessServerLogonScript", - XtRString, sizeof(String), - XtOffset(AppDataPtr, icsLogon), XtRString, - ICS_LOGON }, - { "internetChessServerHelper", "internetChessServerHelper", - XtRString, sizeof(String), - XtOffset(AppDataPtr, icsHelper), XtRString, "" }, - { "internetChessServerInputBox", "internetChessServerInputBox", - XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, icsInputBox), XtRImmediate, - (XtPointer) False }, - { "icsAlarm", "icsAlarm", - XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, icsAlarm), XtRImmediate, - (XtPointer) True }, - { "icsAlarmTime", "icsAlarmTime", - XtRInt, sizeof(int), - XtOffset(AppDataPtr, icsAlarmTime), XtRImmediate, - (XtPointer) 5000 }, - { "useTelnet", "useTelnet", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, useTelnet), XtRImmediate, - (XtPointer) False }, - { "telnetProgram", "telnetProgram", XtRString, sizeof(String), - XtOffset(AppDataPtr, telnetProgram), XtRString, TELNET_PROGRAM }, - { "gateway", "gateway", XtRString, sizeof(String), - XtOffset(AppDataPtr, gateway), XtRString, "" }, - { "loadGameFile", "loadGameFile", XtRString, sizeof(String), - XtOffset(AppDataPtr, loadGameFile), XtRString, "" }, - { "loadGameIndex", "loadGameIndex", - XtRInt, sizeof(int), - XtOffset(AppDataPtr, loadGameIndex), XtRImmediate, - (XtPointer) 0 }, - { "saveGameFile", "saveGameFile", XtRString, sizeof(String), - XtOffset(AppDataPtr, saveGameFile), XtRString, "" }, - { "autoRaiseBoard", "autoRaiseBoard", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoRaiseBoard), - XtRImmediate, (XtPointer) True }, - { "autoSaveGames", "autoSaveGames", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoSaveGames), - XtRImmediate, (XtPointer) False }, - { "blindfold", "blindfold", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, blindfold), - XtRImmediate, (XtPointer) False }, - { "loadPositionFile", "loadPositionFile", XtRString, - sizeof(String), XtOffset(AppDataPtr, loadPositionFile), - XtRString, "" }, - { "loadPositionIndex", "loadPositionIndex", - XtRInt, sizeof(int), - XtOffset(AppDataPtr, loadPositionIndex), XtRImmediate, - (XtPointer) 1 }, - { "savePositionFile", "savePositionFile", XtRString, - sizeof(String), XtOffset(AppDataPtr, savePositionFile), - XtRString, "" }, - { "matchMode", "matchMode", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, matchMode), XtRImmediate, (XtPointer) False }, - { "matchGames", "matchGames", XtRInt, sizeof(int), - XtOffset(AppDataPtr, matchGames), XtRImmediate, - (XtPointer) 0 }, - { "monoMode", "monoMode", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, monoMode), XtRImmediate, - (XtPointer) False }, - { "debugMode", "debugMode", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, debugMode), XtRImmediate, - (XtPointer) False }, - { "clockMode", "clockMode", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, clockMode), XtRImmediate, - (XtPointer) True }, - { "boardSize", "boardSize", XtRString, sizeof(String), - XtOffset(AppDataPtr, boardSize), XtRString, "" }, - { "searchTime", "searchTime", XtRString, sizeof(String), - XtOffset(AppDataPtr, searchTime), XtRString, - (XtPointer) "" }, - { "searchDepth", "searchDepth", XtRInt, sizeof(int), - XtOffset(AppDataPtr, searchDepth), XtRImmediate, - (XtPointer) 0 }, - { "showCoords", "showCoords", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, showCoords), XtRImmediate, - (XtPointer) False }, - { "showJail", "showJail", XtRInt, sizeof(int), - XtOffset(AppDataPtr, showJail), XtRImmediate, - (XtPointer) 0 }, - { "showThinking", "showThinking", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, showThinking), XtRImmediate, - (XtPointer) True }, - { "ponderNextMove", "ponderNextMove", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, ponderNextMove), XtRImmediate, - (XtPointer) True }, - { "periodicUpdates", "periodicUpdates", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, periodicUpdates), XtRImmediate, - (XtPointer) True }, - { "clockFont", "clockFont", XtRString, sizeof(String), - XtOffset(AppDataPtr, clockFont), XtRString, CLOCK_FONT }, - { "coordFont", "coordFont", XtRString, sizeof(String), - XtOffset(AppDataPtr, coordFont), XtRString, COORD_FONT }, - { "font", "font", XtRString, sizeof(String), - XtOffset(AppDataPtr, font), XtRString, DEFAULT_FONT }, - { "ringBellAfterMoves", "ringBellAfterMoves", - XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, ringBellAfterMoves), - XtRImmediate, (XtPointer) False }, - { "autoCallFlag", "autoCallFlag", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoCallFlag), - XtRImmediate, (XtPointer) False }, - { "autoFlipView", "autoFlipView", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoFlipView), - XtRImmediate, (XtPointer) True }, - { "autoObserve", "autoObserve", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoObserve), - XtRImmediate, (XtPointer) False }, - { "autoComment", "autoComment", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoComment), - XtRImmediate, (XtPointer) False }, - { "getMoveList", "getMoveList", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, getMoveList), - XtRImmediate, (XtPointer) True }, - #if HIGHDRAG - { "highlightDragging", "highlightDragging", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, highlightDragging), - XtRImmediate, (XtPointer) False }, - #endif - { "highlightLastMove", "highlightLastMove", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, highlightLastMove), - XtRImmediate, (XtPointer) False }, - { "premove", "premove", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, premove), - XtRImmediate, (XtPointer) True }, - { "testLegality", "testLegality", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, testLegality), - XtRImmediate, (XtPointer) True }, - { "flipView", "flipView", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, flipView), - XtRImmediate, (XtPointer) False }, - { "cmail", "cmailGameName", XtRString, sizeof(String), - XtOffset(AppDataPtr, cmailGameName), XtRString, "" }, - { "alwaysPromoteToQueen", "alwaysPromoteToQueen", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, alwaysPromoteToQueen), - XtRImmediate, (XtPointer) False }, - { "oldSaveStyle", "oldSaveStyle", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, oldSaveStyle), - XtRImmediate, (XtPointer) False }, - { "quietPlay", "quietPlay", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, quietPlay), - XtRImmediate, (XtPointer) False }, - { "titleInWindow", "titleInWindow", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, titleInWindow), - XtRImmediate, (XtPointer) False }, - { "localLineEditing", "localLineEditing", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, localLineEditing), - XtRImmediate, (XtPointer) True }, /* not implemented, must be True */ - #if ZIPPY - { "zippyTalk", "zippyTalk", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, zippyTalk), - XtRImmediate, (XtPointer) ZIPPY_TALK }, - { "zippyPlay", "zippyPlay", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, zippyPlay), - XtRImmediate, (XtPointer) ZIPPY_PLAY }, - { "zippyLines", "zippyLines", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyLines), XtRString, ZIPPY_LINES }, - { "zippyPinhead", "zippyPinhead", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyPinhead), XtRString, ZIPPY_PINHEAD }, - { "zippyPassword", "zippyPassword", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyPassword), XtRString, ZIPPY_PASSWORD }, - { "zippyPassword2", "zippyPassword2", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyPassword2), XtRString, ZIPPY_PASSWORD2 }, - { "zippyWrongPassword", "zippyWrongPassword", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyWrongPassword), XtRString, - ZIPPY_WRONG_PASSWORD }, - { "zippyAcceptOnly", "zippyAcceptOnly", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyAcceptOnly), XtRString, ZIPPY_ACCEPT_ONLY }, - { "zippyUseI", "zippyUseI", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, zippyUseI), - XtRImmediate, (XtPointer) ZIPPY_USE_I }, - { "zippyBughouse", "zippyBughouse", XtRInt, - sizeof(int), XtOffset(AppDataPtr, zippyBughouse), - XtRImmediate, (XtPointer) ZIPPY_BUGHOUSE }, - { "zippyNoplayCrafty", "zippyNoplayCrafty", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, zippyNoplayCrafty), - XtRImmediate, (XtPointer) ZIPPY_NOPLAY_CRAFTY }, - { "zippyGameEnd", "zippyGameEnd", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyGameEnd), XtRString, ZIPPY_GAME_END }, - { "zippyGameStart", "zippyGameStart", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyGameStart), XtRString, ZIPPY_GAME_START }, - { "zippyAdjourn", "zippyAdjourn", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, zippyAdjourn), - XtRImmediate, (XtPointer) ZIPPY_ADJOURN }, - { "zippyAbort", "zippyAbort", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, zippyAbort), - XtRImmediate, (XtPointer) ZIPPY_ABORT }, - { "zippyVariants", "zippyVariants", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyVariants), XtRString, ZIPPY_VARIANTS }, - { "zippyMaxGames", "zippyMaxGames", XtRInt, sizeof(int), - XtOffset(AppDataPtr, zippyMaxGames), XtRImmediate, - (XtPointer) ZIPPY_MAX_GAMES }, - { "zippyReplayTimeout", "zippyReplayTimeout", XtRInt, sizeof(int), - XtOffset(AppDataPtr, zippyReplayTimeout), XtRImmediate, - (XtPointer) ZIPPY_REPLAY_TIMEOUT }, - { "zippyShortGame", "zippyShortGame", XtRInt, sizeof(int), - XtOffset(AppDataPtr, zippyShortGame), XtRImmediate, - (XtPointer) 0 }, - #endif { "flashCount", "flashCount", XtRInt, sizeof(int), XtOffset(AppDataPtr, flashCount), XtRImmediate, (XtPointer) FLASH_COUNT }, @@@ -1764,81 -852,88 +792,84 @@@ XtActionsRec boardActions[] = { "PastePositionProc", PastePositionProc }, { "CopyGameProc", CopyGameProc }, { "PasteGameProc", PasteGameProc }, - { "SaveGameProc", SaveGameProc }, - { "SavePositionProc", SavePositionProc }, + // { "SaveGameProc", SaveGameProc }, + // { "SavePositionProc", SavePositionProc }, { "MailMoveProc", MailMoveProc }, { "ReloadCmailMsgProc", ReloadCmailMsgProc }, - { "QuitProc", QuitProc }, - { "MachineWhiteProc", MachineWhiteProc }, - { "MachineBlackProc", MachineBlackProc }, - { "AnalysisModeProc", AnalyzeModeProc }, - { "AnalyzeFileProc", AnalyzeFileProc }, - { "TwoMachinesProc", TwoMachinesProc }, - { "IcsClientProc", IcsClientProc }, - { "EditGameProc", EditGameProc }, - { "EditPositionProc", EditPositionProc }, - { "TrainingProc", EditPositionProc }, + // { "MachineWhiteProc", MachineWhiteProc }, + // { "MachineBlackProc", MachineBlackProc }, + // { "AnalysisModeProc", AnalyzeModeProc }, + // { "AnalyzeFileProc", AnalyzeFileProc }, + // { "TwoMachinesProc", TwoMachinesProc }, + // { "IcsClientProc", IcsClientProc }, + // { "EditGameProc", EditGameProc }, + // { "EditPositionProc", EditPositionProc }, + // { "TrainingProc", EditPositionProc }, { "EngineOutputProc", EngineOutputProc}, // [HGM] Winboard_x engine-output window + { "EvalGraphProc", EvalGraphProc}, // [HGM] Winboard_x avaluation graph window { "ShowGameListProc", ShowGameListProc }, - { "ShowMoveListProc", HistoryShowProc}, - { "EditTagsProc", EditCommentProc }, + // { "ShowMoveListProc", HistoryShowProc}, + // { "EditTagsProc", EditCommentProc }, { "EditCommentProc", EditCommentProc }, - { "IcsAlarmProc", IcsAlarmProc }, + // { "IcsAlarmProc", IcsAlarmProc }, { "IcsInputBoxProc", IcsInputBoxProc }, - { "PauseProc", PauseProc }, - { "AcceptProc", AcceptProc }, - { "DeclineProc", DeclineProc }, - { "RematchProc", RematchProc }, - { "CallFlagProc", CallFlagProc }, - { "DrawProc", DrawProc }, - { "AdjournProc", AdjournProc }, - { "AbortProc", AbortProc }, - { "ResignProc", ResignProc }, - { "AdjuWhiteProc", AdjuWhiteProc }, - { "AdjuBlackProc", AdjuBlackProc }, - { "AdjuDrawProc", AdjuDrawProc }, + // { "AcceptProc", AcceptProc }, + // { "DeclineProc", DeclineProc }, + // { "RematchProc", RematchProc }, + // { "CallFlagProc", CallFlagProc }, + // { "DrawProc", DrawProc }, + // { "AdjournProc", AdjournProc }, + // { "AbortProc", AbortProc }, + // { "ResignProc", ResignProc }, + // { "AdjuWhiteProc", AdjuWhiteProc }, + // { "AdjuBlackProc", AdjuBlackProc }, + // { "AdjuDrawProc", AdjuDrawProc }, { "EnterKeyProc", EnterKeyProc }, - { "StopObservingProc", StopObservingProc }, - { "StopExaminingProc", StopExaminingProc }, - { "BackwardProc", BackwardProc }, - { "ForwardProc", ForwardProc }, - { "ToStartProc", ToStartProc }, - { "ToEndProc", ToEndProc }, - { "RevertProc", RevertProc }, - { "TruncateGameProc", TruncateGameProc }, - { "MoveNowProc", MoveNowProc }, - { "RetractMoveProc", RetractMoveProc }, - { "AlwaysQueenProc", AlwaysQueenProc }, - { "AnimateDraggingProc", AnimateDraggingProc }, - { "AnimateMovingProc", AnimateMovingProc }, - { "AutoflagProc", AutoflagProc }, - { "AutoflipProc", AutoflipProc }, - { "AutobsProc", AutobsProc }, - { "AutoraiseProc", AutoraiseProc }, - { "AutosaveProc", AutosaveProc }, - { "BlindfoldProc", BlindfoldProc }, - { "FlashMovesProc", FlashMovesProc }, - { "FlipViewProc", FlipViewProc }, - { "GetMoveListProc", GetMoveListProc }, + // { "StopObservingProc", StopObservingProc }, + // { "StopExaminingProc", StopExaminingProc }, + // { "BackwardProc", BackwardProc }, + // { "ForwardProc", ForwardProc }, + // { "ToStartProc", ToStartProc }, + // { "ToEndProc", ToEndProc }, + // { "RevertProc", RevertProc }, + // { "TruncateGameProc", TruncateGameProc }, + // { "MoveNowProc", MoveNowProc }, + // { "RetractMoveProc", RetractMoveProc }, + // { "AlwaysQueenProc", AlwaysQueenProc }, + // { "AnimateDraggingProc", AnimateDraggingProc }, + // { "AnimateMovingProc", AnimateMovingProc }, + // { "AutoflagProc", AutoflagProc }, + // { "AutoflipProc", AutoflipProc }, + // { "AutobsProc", AutobsProc }, + // { "AutoraiseProc", AutoraiseProc }, + // { "AutosaveProc", AutosaveProc }, + // { "BlindfoldProc", BlindfoldProc }, + // { "FlashMovesProc", FlashMovesProc }, + // { "FlipViewProc", FlipViewProc }, + // { "GetMoveListProc", GetMoveListProc }, #if HIGHDRAG - { "HighlightDraggingProc", HighlightDraggingProc }, + // { "HighlightDraggingProc", HighlightDraggingProc }, #endif - { "HighlightLastMoveProc", HighlightLastMoveProc }, - { "IcsAlarmProc", IcsAlarmProc }, - { "MoveSoundProc", MoveSoundProc }, - { "OldSaveStyleProc", OldSaveStyleProc }, - { "PeriodicUpdatesProc", PeriodicUpdatesProc }, - { "PonderNextMoveProc", PonderNextMoveProc }, - { "PopupExitMessageProc", PopupExitMessageProc }, - { "PopupMoveErrorsProc", PopupMoveErrorsProc }, - { "PremoveProc", PremoveProc }, - { "QuietPlayProc", QuietPlayProc }, - { "ShowCoordsProc", ShowCoordsProc }, - { "ShowThinkingProc", ShowThinkingProc }, - { "HideThinkingProc", HideThinkingProc }, - { "TestLegalityProc", TestLegalityProc }, + // { "HighlightLastMoveProc", HighlightLastMoveProc }, + // { "IcsAlarmProc", IcsAlarmProc }, + // { "MoveSoundProc", MoveSoundProc }, + // { "OldSaveStyleProc", OldSaveStyleProc }, + // { "PeriodicUpdatesProc", PeriodicUpdatesProc }, + // { "PonderNextMoveProc", PonderNextMoveProc }, + // { "PopupExitMessageProc", PopupExitMessageProc }, + // { "PopupMoveErrorsProc", PopupMoveErrorsProc }, + // { "PremoveProc", PremoveProc }, + // { "QuietPlayProc", QuietPlayProc }, + // { "ShowThinkingProc", ShowThinkingProc }, + // { "HideThinkingProc", HideThinkingProc }, - { "TestLegalityProc", TestLegalityProc }, - // { "InfoProc", InfoProc }, - // { "ManProc", ManProc }, - // { "HintProc", HintProc }, - // { "BookProc", BookProc }, ++ // { "TestLegalityProc", TestLegalityProc }, + { "SaveSettingsProc", SaveSettingsProc }, + { "SaveOnExitProc", SaveOnExitProc }, - { "InfoProc", InfoProc }, - { "ManProc", ManProc }, - { "HintProc", HintProc }, - { "BookProc", BookProc }, ++// { "InfoProc", InfoProc }, ++// { "ManProc", ManProc }, ++// { "HintProc", HintProc }, ++// { "BookProc", BookProc }, { "AboutGameProc", AboutGameProc }, - { "AboutProc", AboutProc }, { "DebugProc", DebugProc }, { "NothingProc", NothingProc }, { "CommentPopDown", (XtActionProc) CommentPopDown }, @@@ -1850,8 -945,9 +881,9 @@@ { "AskQuestionPopDown", (XtActionProc) AskQuestionPopDown }, { "GameListPopDown", (XtActionProc) GameListPopDown }, { "PromotionPopDown", (XtActionProc) PromotionPopDown }, - { "HistoryPopDown", (XtActionProc) HistoryPopDown }, + // { "HistoryPopDown", (XtActionProc) HistoryPopDown }, { "EngineOutputPopDown", (XtActionProc) EngineOutputPopDown }, + { "EvalGraphPopDown", (XtActionProc) EvalGraphPopDown }, { "ShufflePopDown", (XtActionProc) ShufflePopDown }, { "EnginePopDown", (XtActionProc) EnginePopDown }, { "UciPopDown", (XtActionProc) UciPopDown }, @@@ -1961,11 -1236,265 +993,264 @@@ CatchDeleteWindow(Widget w, String proc void BoardToTop() { - Arg args[16]; - XtSetArg(args[0], XtNiconic, False); - XtSetValues(shellWidget, args, 1); - - XtPopup(shellWidget, XtGrabNone); /* Raise if lowered */ + /* this should raise the board to the top */ + gtk_window_present(GTK_WINDOW(GUI_Window)); + return; } + //--------------------------------------------------------------------------------------------------------- + // some symbol definitions to provide the proper (= XBoard) context for the code in args.h + #define XBOARD True + #define JAWS_ARGS + #define CW_USEDEFAULT (1<<31) + #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 MoveHistoryIsUp(); + Boolean GameListIsUp(); + + // The option definition and parsing code common to XBoard and WinBoard is collected in this file + #include "args.h" + + // front-end part of option handling + + // [HGM] This platform-dependent table provides the location for storing the color info + extern char *crWhite, * crBlack; + + void * + colorVariable[] = { + &appData.whitePieceColor, + &appData.blackPieceColor, + &appData.lightSquareColor, + &appData.darkSquareColor, + &appData.highlightSquareColor, + &appData.premoveHighlightColor, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + &crWhite, + &crBlack, + NULL + }; + + void + ParseFont(char *name, int number) + { // in XBoard, only 2 of the fonts are currently implemented, and we just copy their name + switch(number) { + case 0: // CLOCK_FONT + appData.clockFont = strdup(name); + break; + case 1: // MESSAGE_FONT + appData.font = strdup(name); + break; + case 2: // COORD_FONT + appData.coordFont = strdup(name); + break; + default: + return; + } + } + + void + SetFontDefaults() + { // only 2 fonts currently + appData.clockFont = CLOCK_FONT_NAME; + appData.coordFont = COORD_FONT_NAME; + appData.font = DEFAULT_FONT_NAME; + } + + void + CreateFonts() + { // no-op, until we identify the code for this already in XBoard and move it here + } + + void + ParseColor(int n, char *name) + { // in XBoard, just copy the color-name string + if(colorVariable[n]) *(char**)colorVariable[n] = strdup(name); + } + + void + ParseTextAttribs(ColorClass cc, char *s) + { + (&appData.colorShout)[cc] = strdup(s); + } + + void + ParseBoardSize(void *addr, char *name) + { + appData.boardSize = strdup(name); + } + + void + LoadAllSounds() + { // In XBoard the sound-playing program takes care of obtaining the actual sound + } + + void + SetCommPortDefaults() + { // for now, this is a no-op, as the corresponding option does not exist in XBoard + } + + // [HGM] args: these three cases taken out to stay in front-end + void + SaveFontArg(FILE *f, ArgDescriptor *ad) + { + char *name; + switch((int)ad->argLoc) { + case 0: // CLOCK_FONT + name = appData.clockFont; + break; + case 1: // MESSAGE_FONT + name = appData.font; + break; + case 2: // COORD_FONT + name = appData.coordFont; + break; + default: + return; + } + fprintf(f, OPTCHAR "%s" SEPCHAR "%s\n", ad->argName, name); + } + + void + ExportSounds() + { // nothing to do, as the sounds are at all times represented by their text-string names already + } + + void + SaveAttribsArg(FILE *f, ArgDescriptor *ad) + { // here the "argLoc" defines a table index. It could have contained the 'ta' pointer itself, though + 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, 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, OPTCHAR "%s" SEPCHAR "%s\n", name, appData.boardSize); + } + + void + ParseCommPortSettings(char *s) + { // 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?) + // In XBoard this will have to wait until awareness of window parameters is implemented + GetActualPlacement(shellWidget, &wpMain); + if(EngineOutputIsUp()) GetActualPlacement(engineOutputShell, &wpEngineOutput); else + if(MoveHistoryIsUp()) GetActualPlacement(historyShell, &wpMoveHistory); + if(EvalGraphIsUp()) GetActualPlacement(evalGraphShell, &wpEvalGraph); + if(GameListIsUp()) GetActualPlacement(gameListShell, &wpGameList); + if(commentShell) GetActualPlacement(commentShell, &wpComment); + else GetActualPlacement(editShell, &wpComment); + if(tagsShell) GetActualPlacement(tagsShell, &wpTags); + else GetActualPlacement(editTagsShell, &wpTags); + } + + void + PrintCommPortSettings(FILE *f, char *name) + { // This option does not exist in XBoard + } + + int + MySearchPath(char *installDir, char *name, char *fullname) + { // just append installDir and name. Perhaps ExpandPath should be used here? + name = ExpandPathName(name); + if(name && name[0] == '/') strcpy(fullname, name); else { + sprintf(fullname, "%s%c%s", installDir, '/', name); + } + return 1; + } + + int + MyGetFullPathName(char *name, char *fullname) + { // should use ExpandPath? + name = ExpandPathName(name); + strcpy(fullname, name); + return 1; + } + + void + EnsureOnScreen(int *x, int *y, int minX, int minY) + { + return; + } + + int + MainWindowUp() + { // [HGM] args: allows testing if main window is realized from back-end + return xBoardWindow != 0; + } + + void + PopUpStartupDialog() + { // start menu not implemented in XBoard + } + char * + ConvertToLine(int argc, char **argv) + { + static char line[128*1024], buf[1024]; + int i; + + line[0] = NULLCHAR; + for(i=1; i 1) + { + fprintf(stderr, _("%s: unrecognized argument %s\n"), + programName, argv[1]); + + fprintf(stderr, "Recognized options:\n"); + for(i = 0; i < XtNumber(shellOptions); i++) + { + /* print first column */ + j = fprintf(stderr, " %s%s", shellOptions[i].option, + (shellOptions[i].argKind == XrmoptionSepArg + ? " ARG" : "")); + /* print second column and end line */ + 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); + }; + p = getenv("HOME"); if (p == NULL) p = "/tmp"; i = strlen(p) + strlen("/.xboardXXXXXx.pgn") + 1; @@@ -2322,27 -1808,20 +1612,28 @@@ if (i < 5) fontPxlSize = nearest->fontPxlSize; if (i < 6) smallLayout = nearest->smallLayout; if (i < 7) tinyLayout = nearest->tinyLayout; - } - } else { + } + } + else + { SizeDefaults *szd = sizeDefaults; - if (*appData.boardSize == NULLCHAR) { - while (DisplayWidth(xDisplay, xScreen) < szd->minScreenSize || - DisplayHeight(xDisplay, xScreen) < szd->minScreenSize) { - szd++; - } + if (*appData.boardSize == NULLCHAR) + { + while (DisplayWidth(xDisplay, xScreen) < szd->minScreenSize + || DisplayHeight(xDisplay, xScreen) < szd->minScreenSize) + { + szd++; + } if (szd->name == NULL) szd--; + appData.boardSize = strdup(szd->name); // [HGM] settings: remember name for saving settings - } else { - while (szd->name != NULL && - StrCaseCmp(szd->name, appData.boardSize) != 0) szd++; - if (szd->name == NULL) { + } + else + { + while (szd->name != NULL + && StrCaseCmp(szd->name, appData.boardSize) != 0) + szd++; + if (szd->name == NULL) + { fprintf(stderr, _("%s: unrecognized boardSize name %s\n"), programName, appData.boardSize); exit(2); @@@ -2518,141 -2069,374 +1809,148 @@@ } if (appData.showButtonBar) { - widgetList[j++] = buttonBarWidget = CreateButtonBar(buttonBar); - XtSetArg(args[0], XtNleft, XtChainRight); // [HGM] glue to right window edge - XtSetArg(args[1], XtNright, XtChainRight); // for good run-time sizing - XtSetArg(args[2], XtNtop, XtChainTop); - XtSetArg(args[3], XtNbottom, XtChainTop); - XtSetValues(buttonBarWidget, args, 4); + /* TODO hide button bar if requested */ } - widgetList[j++] = messageWidget = - XtCreateWidget("message", labelWidgetClass, formWidget, - messageArgs, XtNumber(messageArgs)); - XtSetArg(args[0], XtNtop, XtChainTop); - XtSetArg(args[1], XtNbottom, XtChainTop); - XtSetValues(messageWidget, args, 2); - widgetList[j++] = boardWidget = - XtCreateWidget("board", widgetClass, formWidget, boardArgs, - XtNumber(boardArgs)); - - XtManageChildren(widgetList, j); + if (appData.titleInWindow) + { + if (smallLayout) + { + /* make it small */ + if (appData.showButtonBar) + { - timerWidth = (boardWidth - sep) / 2; - XtSetArg(args[0], XtNwidth, timerWidth); - XtSetValues(whiteTimerWidget, args, 1); - XtSetValues(blackTimerWidget, args, 1); + } + } + else + { + if (appData.showButtonBar) + { + } + } + } + else + { + } - XtSetArg(args[0], XtNbackground, &timerBackgroundPixel); - XtSetArg(args[1], XtNforeground, &timerForegroundPixel); - XtGetValues(whiteTimerWidget, args, 2); - if (appData.showButtonBar) { - XtSetArg(args[0], XtNbackground, &buttonBackgroundPixel); - XtSetArg(args[1], XtNforeground, &buttonForegroundPixel); - XtGetValues(XtNameToWidget(buttonBarWidget, PAUSE_BUTTON), args, 2); - } + /* set some checkboxes in the menu according to appData */ - /* - * formWidget uses these constraints but they are stored - * in the children. - */ - i = 0; - XtSetArg(args[i], XtNfromHoriz, 0); i++; - XtSetValues(menuBarWidget, args, i); - if (appData.titleInWindow) { - if (smallLayout) { - i = 0; - XtSetArg(args[i], XtNfromVert, menuBarWidget); i++; - XtSetValues(whiteTimerWidget, args, i); - i = 0; - XtSetArg(args[i], XtNfromVert, menuBarWidget); i++; - XtSetArg(args[i], XtNfromHoriz, whiteTimerWidget); i++; - XtSetValues(blackTimerWidget, args, i); - i = 0; - XtSetArg(args[i], XtNfromVert, whiteTimerWidget); i++; - XtSetArg(args[i], XtNjustify, XtJustifyLeft); i++; - XtSetValues(titleWidget, args, i); - i = 0; - XtSetArg(args[i], XtNfromVert, titleWidget); i++; - XtSetArg(args[i], XtNresizable, (XtArgVal) True); i++; - XtSetValues(messageWidget, args, i); - if (appData.showButtonBar) { - i = 0; - XtSetArg(args[i], XtNfromVert, titleWidget); i++; - XtSetArg(args[i], XtNfromHoriz, messageWidget); i++; - XtSetValues(buttonBarWidget, args, i); - } - } else { - i = 0; - XtSetArg(args[i], XtNfromVert, titleWidget); i++; - XtSetValues(whiteTimerWidget, args, i); - i = 0; - XtSetArg(args[i], XtNfromVert, titleWidget); i++; - XtSetArg(args[i], XtNfromHoriz, whiteTimerWidget); i++; - XtSetValues(blackTimerWidget, args, i); - i = 0; - XtSetArg(args[i], XtNfromHoriz, menuBarWidget); i++; - XtSetValues(titleWidget, args, i); - i = 0; - XtSetArg(args[i], XtNfromVert, whiteTimerWidget); i++; - XtSetArg(args[i], XtNresizable, (XtArgVal) True); i++; - XtSetValues(messageWidget, args, i); - if (appData.showButtonBar) { - i = 0; - XtSetArg(args[i], XtNfromVert, whiteTimerWidget); i++; - XtSetArg(args[i], XtNfromHoriz, messageWidget); i++; - XtSetValues(buttonBarWidget, args, i); - } - } - } else { - i = 0; - XtSetArg(args[i], XtNfromVert, menuBarWidget); i++; - XtSetValues(whiteTimerWidget, args, i); - i = 0; - XtSetArg(args[i], XtNfromVert, menuBarWidget); i++; - XtSetArg(args[i], XtNfromHoriz, whiteTimerWidget); i++; - XtSetValues(blackTimerWidget, args, i); - i = 0; - XtSetArg(args[i], XtNfromVert, whiteTimerWidget); i++; - XtSetArg(args[i], XtNresizable, (XtArgVal) True); i++; - XtSetValues(messageWidget, args, i); - if (appData.showButtonBar) { - i = 0; - XtSetArg(args[i], XtNfromVert, whiteTimerWidget); i++; - XtSetArg(args[i], XtNfromHoriz, messageWidget); i++; - XtSetValues(buttonBarWidget, args, i); - } - } - i = 0; - XtSetArg(args[0], XtNfromVert, messageWidget); - XtSetArg(args[1], XtNtop, XtChainTop); - XtSetArg(args[2], XtNbottom, XtChainBottom); - XtSetArg(args[3], XtNleft, XtChainLeft); - XtSetArg(args[4], XtNright, XtChainRight); - XtSetValues(boardWidget, args, 5); - - XtRealizeWidget(shellWidget); - - if(wpMain.x > 0) { - XtSetArg(args[0], XtNx, wpMain.x); - XtSetArg(args[1], XtNy, wpMain.y); - XtSetValues(shellWidget, args, 2); - } + if (appData.alwaysPromoteToQueen) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Always Queen")),TRUE); - /* - * Correct the width of the message and title widgets. - * It is not known why some systems need the extra fudge term. - * The value "2" is probably larger than needed. - */ - XawFormDoLayout(formWidget, False); + if (appData.animateDragging) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Animate Dragging")),TRUE); -#define WIDTH_FUDGE 2 - i = 0; - XtSetArg(args[i], XtNborderWidth, &bor); i++; - XtSetArg(args[i], XtNheight, &h); i++; - XtGetValues(messageWidget, args, i); - if (appData.showButtonBar) { - i = 0; - XtSetArg(args[i], XtNwidth, &w); i++; - XtGetValues(buttonBarWidget, args, i); - w = boardWidth - w - sep - 2*bor - WIDTH_FUDGE; - } else { - w = boardWidth - 2*bor + 1; /*!! +1 compensates for kludge below */ - } + if (appData.animate) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Animate Moving")),TRUE); - gres = XtMakeResizeRequest(messageWidget, w, h, &wr, &hr); - if (gres != XtGeometryYes && appData.debugMode) { - fprintf(stderr, _("%s: messageWidget geometry error %d %d %d %d %d\n"), - programName, gres, w, h, wr, hr); - } + if (appData.autoComment) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Auto Comment")),TRUE); - /* !! Horrible hack to work around bug in XFree86 4.0.1 (X11R6.4.3) */ - /* The size used for the child widget in layout lags one resize behind - its true size, so we resize a second time, 1 pixel smaller. Yeech! */ - w--; - gres = XtMakeResizeRequest(messageWidget, w, h, &wr, &hr); - if (gres != XtGeometryYes && appData.debugMode) { - fprintf(stderr, _("%s: messageWidget geometry error %d %d %d %d %d\n"), - programName, gres, w, h, wr, hr); - } - /* !! end hack */ - XtSetArg(args[0], XtNleft, XtChainLeft); // [HGM] glue ends for good run-time sizing - XtSetArg(args[1], XtNright, XtChainRight); - XtSetValues(messageWidget, args, 2); + if (appData.autoCallFlag) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Auto Flag")),TRUE); - if (appData.titleInWindow) { - i = 0; - XtSetArg(args[i], XtNborderWidth, &bor); i++; - XtSetArg(args[i], XtNheight, &h); i++; - XtGetValues(titleWidget, args, i); - if (smallLayout) { - w = boardWidth - 2*bor; - } else { - XtSetArg(args[0], XtNwidth, &w); - XtGetValues(menuBarWidget, args, 1); - w = boardWidth - w - sep - 2*bor - WIDTH_FUDGE; - } + if (appData.autoFlipView) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Auto Flip View")),TRUE); - gres = XtMakeResizeRequest(titleWidget, w, h, &wr, &hr); - if (gres != XtGeometryYes && appData.debugMode) { - fprintf(stderr, - _("%s: titleWidget geometry error %d %d %d %d %d\n"), - programName, gres, w, h, wr, hr); - } - } - XawFormDoLayout(formWidget, True); + if (appData.autoObserve) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Auto Observe")),TRUE); - xBoardWindow = XtWindow(boardWidget); + if (appData.autoRaiseBoard) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Auto Raise Board")),TRUE); - // [HGM] it seems the layout code ends here, but perhaps the color stuff is size independent and would - // not need to go into InitDrawingSizes(). -#endif + if (appData.autoSaveGames) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Auto Save")),TRUE); - /* - * Create X checkmark bitmap and initialize option menu checks. - */ - ReadBitmap(&xMarkPixmap, "checkmark.bm", - checkmark_bits, checkmark_width, checkmark_height); - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - if (appData.alwaysPromoteToQueen) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Always Queen"), - args, 1); - } - if (appData.animateDragging) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Animate Dragging"), - args, 1); - } - if (appData.animate) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Animate Moving"), - args, 1); - } - if (appData.autoComment) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Comment"), - args, 1); - } - if (appData.autoCallFlag) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Flag"), - args, 1); - } - if (appData.autoFlipView) { - XtSetValues(XtNameToWidget(menuBarWidget,"menuOptions.Auto Flip View"), - args, 1); - } - if (appData.autoObserve) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Observe"), - args, 1); - } - if (appData.autoRaiseBoard) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Auto Raise Board"), args, 1); - } - if (appData.autoSaveGames) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Save"), - args, 1); - } - if (appData.saveGameFile[0] != NULLCHAR) { + if (appData.saveGameFile[0] != NULLCHAR) + { /* Can't turn this off from menu */ - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Save"), - args, 1); - XtSetSensitive(XtNameToWidget(menuBarWidget, "menuOptions.Auto Save"), - False); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Auto Save")),TRUE); + gtk_action_set_sensitive(GTK_ACTION (gtk_builder_get_object (builder, "menuOptions.Auto Save")),FALSE); + } + + if (appData.blindfold) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Blindfold")),TRUE); + + if (appData.flashCount > 0) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Flash Moves")),TRUE); + + if (appData.getMoveList) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Get Move List")),TRUE); - } - if (appData.blindfold) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Blindfold"), args, 1); - } - if (appData.flashCount > 0) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Flash Moves"), - args, 1); - } - if (appData.getMoveList) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Get Move List"), - args, 1); - } #if HIGHDRAG - if (appData.highlightDragging) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Highlight Dragging"), - args, 1); - } + if (appData.highlightDragging) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Highlight Dragging")),TRUE); #endif - if (appData.highlightLastMove) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Highlight Last Move"), - args, 1); - } - if (appData.icsAlarm) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.ICS Alarm"), - args, 1); - } - if (appData.ringBellAfterMoves) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Move Sound"), - args, 1); - } - if (appData.oldSaveStyle) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Old Save Style"), args, 1); - } - if (appData.periodicUpdates) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Periodic Updates"), args, 1); - } - if (appData.ponderNextMove) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Ponder Next Move"), args, 1); - } - if (appData.popupExitMessage) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Popup Exit Message"), args, 1); - } - if (appData.popupMoveErrors) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Popup Move Errors"), args, 1); - } - if (appData.premove) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Premove"), args, 1); - } - if (appData.quietPlay) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Quiet Play"), args, 1); - } - if (appData.showCoords) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Show Coords"), - args, 1); - } - if (appData.hideThinkingFromHuman) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Hide Thinking"), - args, 1); - } - if (appData.testLegality) { - XtSetValues(XtNameToWidget(menuBarWidget,"menuOptions.Test Legality"), - args, 1); - } - if (saveSettingsOnExit) { - XtSetValues(XtNameToWidget(menuBarWidget,"menuOptions.Save Settings on Exit"), - args, 1); - } - /* - * Create an icon. - */ - ReadBitmap(&wIconPixmap, "icon_white.bm", - icon_white_bits, icon_white_width, icon_white_height); - ReadBitmap(&bIconPixmap, "icon_black.bm", - icon_black_bits, icon_black_width, icon_black_height); - iconPixmap = wIconPixmap; - i = 0; - XtSetArg(args[i], XtNiconPixmap, iconPixmap); i++; - XtSetValues(shellWidget, args, i); + if (appData.highlightLastMove) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Highlight Last Move")),TRUE); - /* - * Create a cursor for the board widget. - */ - window_attributes.cursor = XCreateFontCursor(xDisplay, XC_hand2); - XChangeWindowAttributes(xDisplay, xBoardWindow, - CWCursor, &window_attributes); + if (appData.icsAlarm) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.ICS Alarm")),TRUE); - /* - * Inhibit shell resizing. - */ - shellArgs[0].value = (XtArgVal) &w; - shellArgs[1].value = (XtArgVal) &h; - XtGetValues(shellWidget, shellArgs, 2); - shellArgs[4].value = shellArgs[2].value = w; - shellArgs[5].value = shellArgs[3].value = h; - XtSetValues(shellWidget, &shellArgs[2], 4); - marginW = w - boardWidth; // [HGM] needed to set new shellWidget size when we resize board - marginH = h - boardHeight; + if (appData.ringBellAfterMoves) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Move Sound")),TRUE); - CatchDeleteWindow(shellWidget, "QuitProc"); + if (appData.oldSaveStyle) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Old Save Style")),TRUE); - CreateGCs(); - CreateGrid(); -#if HAVE_LIBXPM - if (appData.bitmapDirectory[0] != NULLCHAR) { - CreatePieces(); - } else { - CreateXPMPieces(); - } -#else - CreateXIMPieces(); - /* Create regular pieces */ - if (!useImages) CreatePieces(); -#endif + if (appData.periodicUpdates) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Periodic Updates")),TRUE); + + if (appData.ponderNextMove) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Ponder Next Move")),TRUE); + + if (appData.popupExitMessage) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Popup Exit Message")),TRUE); + + if (appData.popupMoveErrors) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Popup Move Errors")),TRUE); + + if (appData.premove) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Premove")),TRUE); + + if (appData.quietPlay) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Quit Play")),TRUE); + + if (appData.showCoords) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Show Coords")),TRUE); + + if (appData.showThinking) - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Show Thinking")),TRUE); ++ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Hide Thinking")),TRUE); + + if (appData.testLegality) + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Test Legality")),TRUE); ++ // TODO: add ++ // if (saveSettingsOnExit) { ++ // XtSetValues(XtNameToWidget(menuBarWidget,"menuOptions.Save Settings on Exit"), ++ // args, 1); ++ // } ++ ++ + /* end setting check boxes */ + + /* load square colors */ + SVGLightSquare = load_pixbuf("svg/LightSquare.svg",squareSize); + SVGDarkSquare = load_pixbuf("svg/DarkSquare.svg",squareSize); + SVGNeutralSquare = load_pixbuf("svg/NeutralSquare.svg",squareSize); + + /* use two icons to indicate if it is white's or black's turn */ + WhiteIcon = load_pixbuf("svg/icon_white.svg",0); + BlackIcon = load_pixbuf("svg/icon_black.svg",0); + WindowIcon = WhiteIcon; + gtk_window_set_icon(GTK_WINDOW(GUI_Window),WindowIcon); + + + /* realize window */ + gtk_widget_show (GUI_Window); + + /* recalc boardsize */ + CreateGCs(); + CreatePieces(); CreatePieceMenus(); if (appData.animate || appData.animateDragging) @@@ -4999,13 -5768,159 +4307,41 @@@ void PasteGameProc(w, event, prms, nprm return; } - -void AutoSaveGame() -{ - SaveGameProc(NULL, NULL, NULL, NULL); -} - - -void QuitProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ - ExitEvent(0); -} - -void PauseProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ - PauseEvent(); -} - - -void MachineBlackProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ - MachineBlackEvent(); -} - -void MachineWhiteProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ - MachineWhiteEvent(); -} - -void AnalyzeModeProc(w, event, prms, nprms) ++void SaveOnExitProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { - char buf[MSG_SIZ]; - - if (!first.analysisSupport) { - snprintf(buf, sizeof(buf), _("%s does not support analysis"), first.tidy); - DisplayError(buf, 0); - return; - } - /* [DM] icsEngineAnalyze [HGM] This is horrible code; reverse the gameMode and isEngineAnalyze tests! */ - if (appData.icsActive) { - if (gameMode != IcsObserving) { - sprintf(buf,_("You are not observing a game")); - DisplayError(buf, 0); - /* secure check */ - if (appData.icsEngineAnalyze) { - if (appData.debugMode) - fprintf(debugFP, _("Found unexpected active ICS engine analyze \n")); - ExitAnalyzeMode(); - ModeHighlight(); - } - return; - } - /* if enable, use want disable icsEngineAnalyze */ - if (appData.icsEngineAnalyze) { - ExitAnalyzeMode(); - ModeHighlight(); - return; - } - appData.icsEngineAnalyze = TRUE; - if (appData.debugMode) - fprintf(debugFP, _("ICS engine analyze starting... \n")); - } - if (!appData.showThinking) - ShowThinkingProc(w,event,prms,nprms); ++ Arg args[16]; + - AnalyzeModeEvent(); -} ++ saveSettingsOnExit = !saveSettingsOnExit; + -void AnalyzeFileProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ - if (!first.analysisSupport) { - char buf[MSG_SIZ]; - snprintf(buf, sizeof(buf), _("%s does not support analysis"), first.tidy); - DisplayError(buf, 0); - return; ++ if (saveSettingsOnExit) { ++ XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); ++ } else { ++ XtSetArg(args[0], XtNleftBitmap, None); + } - Reset(FALSE, TRUE); - - if (!appData.showThinking) - ShowThinkingProc(w,event,prms,nprms); - - AnalyzeFileEvent(); - FileNamePopUp(_("File to analyze"), "", LoadGamePopUp, "rb"); - AnalysisPeriodicEvent(1); -} - -void TwoMachinesProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ - TwoMachinesEvent(); ++ XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Save Settings on Exit"), ++ args, 1); + } + -void IcsClientProc(w, event, prms, nprms) ++void SaveSettingsProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { - IcsClientEvent(); ++ SaveSettings(settingsFileName); + } + -void EditGameProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ - EditGameEvent(); -} -void EditPositionProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; +void AutoSaveGame() { - EditPositionEvent(); + SaveGameProc(NULL, NULL); + return; } -void TrainingProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ - TrainingEvent(); -} void EditCommentProc(w, event, prms, nprms) Widget w; diff --cc xedittags.c index 5542d25,63be84e..27c3e9c --- a/xedittags.c +++ b/xedittags.c @@@ -53,10 -83,6 +53,11 @@@ extern char *getenv() #include "xedittags.h" #include "gettext.h" +extern GtkWidget *GUI_EditTags; +extern GtkWidget *GUI_EditTagsTextArea; + ++Widget tagsShell, editTagsShell; + #ifdef ENABLE_NLS # define _(s) gettext (s) # define N_(s) gettext_noop (s) diff --cc xedittags.h index e27da9e,0459c16..79a225f --- a/xedittags.h +++ b/xedittags.h @@@ -24,7 -24,8 +24,8 @@@ #ifndef _XEDITTAGS_H #define _XEDITTAGS_H 1 -void EditTagsProc P((Widget w, XEvent *event, - String *prms, Cardinal *nprms)); +void EditTagsProc P((GtkObject *object, gpointer user_data)); +void EditTagsHideProc P((GtkObject *object, gpointer user_data)); + extern Widget editTagsShell, tagsShell; #endif diff --cc xhistory.c index 2b861eb,dca9319..c220e9a --- a/xhistory.c +++ b/xhistory.c @@@ -59,20 -76,54 +59,20 @@@ extern char *getenv() # define N_(s) s #endif -#define _LL_ 100 - -extern Widget formWidget, shellWidget, boardWidget, menuBarWidget, historyShell; -extern Display *xDisplay; -extern int squareSize; -extern Pixmap xMarkPixmap; -extern char *layoutName; - -struct History{ - String *Nr,*white,*black; - int aNr; /* space actually alocated */ - Widget mvn,mvw,mvb,vbox,viewport,sh; - char Up; -}; +extern GtkWidget *GUI_History; +extern GtkListStore *LIST_MoveHistory; -struct History *hist=0; String dots=" ... "; Position gameHistoryX, gameHistoryY; - Dimension gameHistoryW; + Dimension gameHistoryW, gameHistoryH; void -HistoryPopDown(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; +HistoryPopDown(object, user_data) + GtkObject *object; + gpointer user_data; { - Arg args[16]; - int j; - if(hist) { - - // [HGM] remember old position - j = 0; - XtSetArg(args[j], XtNx, &gameHistoryX); j++; - XtSetArg(args[j], XtNy, &gameHistoryY); j++; - XtSetArg(args[j], XtNwidth, &gameHistoryW); j++; - XtSetArg(args[j], XtNheight, &gameHistoryH); j++; - XtGetValues(hist->sh, args, j); - wpMoveHistory.x = gameHistoryX - 4; - wpMoveHistory.y = gameHistoryY - 23; - wpMoveHistory.width = gameHistoryW; - wpMoveHistory.height = gameHistoryH; - - XtPopdown(hist->sh); - hist->Up=False; - } - j=0; - XtSetArg(args[j], XtNleftBitmap, None); j++; - XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Move History"), - args, j); + gtk_widget_hide (GUI_History); + return; } void HistoryMoveProc(Widget w, XtPointer closure, XtPointer call_data) @@@ -88,224 -138,295 +88,234 @@@ to=2*R->list_index; ToNrEvent(to); } + */ } -void HistoryAlloc(int len){ - int i; - if(hist){ - free(hist->Nr[0]);free(hist->white[0]);free(hist->black[0]); - free(hist->Nr);free(hist->white);free(hist->black); - } - else{ - hist=(struct History*)malloc(sizeof(struct History)); - } - hist->aNr=len; - hist->Nr=(String*)malloc(hist->aNr*sizeof(String*)); - hist->white=(String*)malloc(hist->aNr*sizeof(String*)); - hist->black=(String*)malloc(hist->aNr*sizeof(String*)); - - hist->Nr[0]=(String)malloc(hist->aNr*6); - hist->white[0]=(String)malloc(hist->aNr*MOVE_LEN); - hist->black[0]=(String)malloc(hist->aNr*MOVE_LEN); - sprintf(hist->Nr[0]," "); - sprintf(hist->white[0],_("White ")); - sprintf(hist->black[0],_("Black ")); - for(i=1;iaNr;i++){ - hist->Nr[i]= hist->Nr[i-1]+6; - hist->white[i]= hist->white[i-1]+MOVE_LEN; - hist->black[i]= hist->black[i-1]+MOVE_LEN; - sprintf(hist->Nr[i],"%i.",i); - sprintf(hist->white[i],"-----"); - sprintf(hist->black[i],"-----"); - } -} - - -/* Find empty space inside vbox form widget and redistribute it amongst - the list widgets inside it. */ -/* This version sort of works */ -void -HistoryFill() +void HistorySet(char movelist[][2*MOVE_LEN],int first,int last,int current) { - Dimension w, bw; - long extra; - Position x, x1, x2; - int j, dd; - Arg args[16]; - - j = 0; - XtSetArg(args[j], XtNx, &x); j++; - XtSetArg(args[j], XtNwidth, &w); j++; - XtSetArg(args[j], XtNborderWidth, &bw); j++; - XtGetValues(hist->mvb, args, j); - x1 = x + w + 2*bw; - - j = 0; - XtSetArg(args[j], XtNwidth, &w); j++; - XtSetArg(args[j], XtNdefaultDistance, &dd); j++; - XtGetValues(hist->vbox, args, j); - x2 = w - dd; + int i,b,m; + char movewhite[2*MOVE_LEN],moveblack[2*MOVE_LEN],move[2*MOVE_LEN]; + GtkTreeIter iter; - extra = x2 - x1; - if (extra < 0) { - extra = -((-extra)/2); - } else { - extra = extra/2; - } + /* TODO need to add highlights for current move */ + /* TODO need to add navigation by keyboard or mouse (double click on move) */ - j = 0; - XtSetArg(args[j], XtNwidth, &w); j++; - XtGetValues(hist->mvw, args, j); - w += extra; - j = 0; - XtSetArg(args[j], XtNwidth, w); j++; - XtSetValues(hist->mvw, args, j); + /* first clear everything, do we need this? */ + gtk_list_store_clear(LIST_MoveHistory); - j = 0; - XtSetArg(args[j], XtNwidth, &w); j++; - XtGetValues(hist->mvb, args, j); - w += extra; - j = 0; - XtSetArg(args[j], XtNwidth, w); j++; - XtSetValues(hist->mvb, args, j); -} + /* copy move list into history window */ -void HistorySet(char movelist[][2*MOVE_LEN],int first,int last,int current){ - int i,b,m; - if(hist){ - if(last >= hist->aNr) HistoryAlloc(last+_LL_); - for(i=0;iwhite[i/2+1], movelist[i], p-movelist[i]); - hist->white[i/2+1][p-movelist[i]] = NULLCHAR; - } else { - strcpy(hist->white[i/2+1],movelist[i]); - } - } else { - strcpy(hist->white[i/2+1],dots); - } - } else { - if(movelist[i][0]) { + /* go through all moves */ + for(i=0;iblack[i/2+1], movelist[i], p-movelist[i]); - hist->black[i/2+1][p-movelist[i]] = NULLCHAR; - } else { - strcpy(hist->black[i/2+1],movelist[i]); - } - } else { - strcpy(hist->black[i/2+1],""); - } - } - } - strcpy(hist->black[last/2+1],""); - b=first/2; - m=(last+3)/2-b; - XawFormDoLayout(hist->vbox, False); - XawListChange(hist->mvn,hist->Nr+b,m,0,True); - XawListChange(hist->mvw,hist->white+b,m,0,True); - XawListChange(hist->mvb,hist->black+b,m,0,True); - HistoryFill(); - XawFormDoLayout(hist->vbox, True); - if(current<0){ - XawListUnhighlight(hist->mvw); - XawListUnhighlight(hist->mvb); + if (p) + { + strncpy(move, movelist[i], p-movelist[i]); + move[p-movelist[i]] = NULLCHAR; + } + else + { + strcpy(move,movelist[i]); + } + } + else + strcpy(move,dots); + + if((i%2)==0) + { + /* white move */ + strcpy(movewhite,move); + } + else + { + /* black move */ + strcpy(moveblack,move); + + /* save move */ + gtk_list_store_append (LIST_MoveHistory, &iter); + gtk_list_store_set (LIST_MoveHistory, &iter, + 0, i, + 1, movewhite, + 2, moveblack, + -1); + + strcpy(movewhite,""); + strcpy(moveblack,""); + }; } - else if((current%2)==0){ - XawListHighlight(hist->mvw, current/2+1); - XawListUnhighlight(hist->mvb); - } - else{ - XawListUnhighlight(hist->mvw); - if(current) XawListHighlight(hist->mvb, current/2+1); - else XawListUnhighlight(hist->mvb); - } - } - EvalGraphSet( first, last, current, pvInfoList ); // piggy-backed ++ + /* check if ther is a white move left */ + if(movewhite[0]) + { + i++; + strcpy(moveblack,""); + /* save move */ + gtk_list_store_append (LIST_MoveHistory, &iter); + gtk_list_store_set (LIST_MoveHistory, &iter, + 0, i, + 1, movewhite, + 2, moveblack, + -1); + }; ++ ++ //TODO ++ // EvalGraphSet( first, last, current, pvInfoList ); // piggy-backed + + return; } -Widget HistoryCreate() +void HistoryCreate() { - Arg args[16]; - int i,j; - - Widget layout,form,b_close; String trstr= "Up: BackwardProc() \n \ Left: BackwardProc() \n \ Down: ForwardProc() \n \ Right: ForwardProc() \n"; - /*--- allocate memory for move-strings ---*/ - HistoryAlloc(_LL_); + return; /*-------- create the widgets ---------------*/ - j = 0; - XtSetArg(args[j], XtNresizable, True); j++; - XtSetArg(args[j], XtNallowShellResize, True); j++; -#if TOPLEVEL - hist->sh = historyShell = - XtCreatePopupShell(_("Move list"), topLevelShellWidgetClass, - shellWidget, args, j); -#else - hist->sh = historyShell = - XtCreatePopupShell(_("Move list"), transientShellWidgetClass, - shellWidget, args, j); -#endif - j = 0; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNdefaultDistance, 0); j++; - layout = - XtCreateManagedWidget(layoutName, formWidgetClass, hist->sh, - args, j); - - j = 0; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNresizable, True); j++; - - form = - XtCreateManagedWidget("form", formWidgetClass, layout, args, j); - - j = 0; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; - - XtSetArg(args[j], XtNborderWidth, 1); j++; - XtSetArg(args[j], XtNresizable, False); j++; - XtSetArg(args[j], XtNallowVert, True); j++; - XtSetArg(args[j], XtNallowHoriz, True); j++; - XtSetArg(args[j], XtNforceBars, False); j++; - XtSetArg(args[j], XtNheight, 280); j++; - hist->viewport = - XtCreateManagedWidget("viewport", viewportWidgetClass, - form, args, j); - j=0; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNorientation,XtorientHorizontal);j++; - hist->vbox = - XtCreateManagedWidget("vbox", formWidgetClass, hist->viewport, args, j); - - j=0; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - - XtSetArg(args[j], XtNdefaultColumns, 1); j++; - XtSetArg(args[j], XtNforceColumns, True); j++; - XtSetArg(args[j], XtNverticalList, True); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNresizable,True);j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - hist->mvn = XtCreateManagedWidget("movesn", listWidgetClass, - hist->vbox, args, j); - XtAddCallback(hist->mvn, XtNcallback, HistoryMoveProc, (XtPointer) hist); - - j=0; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtRubber); j++; - - XtSetArg(args[j], XtNdefaultColumns, 1); j++; - XtSetArg(args[j], XtNforceColumns, True); j++; - XtSetArg(args[j], XtNverticalList, True); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNresizable,True);j++; - XtSetArg(args[j], XtNfromHoriz, hist->mvn); j++; - hist->mvw = XtCreateManagedWidget("movesw", listWidgetClass, - hist->vbox, args, j); - XtAddCallback(hist->mvw, XtNcallback, HistoryMoveProc, (XtPointer) hist); - - j=0; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtRubber); j++; - XtSetArg(args[j], XtNright, XtRubber); j++; - - XtSetArg(args[j], XtNdefaultColumns, 1); j++; - XtSetArg(args[j], XtNforceColumns, True); j++; - XtSetArg(args[j], XtNverticalList, True); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNresizable,True);j++; - XtSetArg(args[j], XtNfromHoriz, hist->mvw); j++; - hist->mvb = XtCreateManagedWidget("movesb", listWidgetClass, - hist->vbox, args, j); - XtAddCallback(hist->mvb, XtNcallback, HistoryMoveProc, (XtPointer) hist); - - j=0; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - XtSetArg(args[j], XtNfromVert, hist->viewport); j++; - b_close= XtCreateManagedWidget(_("Close"), commandWidgetClass, - form, args, j); - XtAddCallback(b_close, XtNcallback, HistoryPopDown, (XtPointer) 0); - - XtAugmentTranslations(hist->sh,XtParseTranslationTable (trstr)); - - XtRealizeWidget(hist->sh); - CatchDeleteWindow(hist->sh, "HistoryPopDown"); - - for(i=1;iaNr;i++){ - strcpy(hist->white[i],dots); - strcpy(hist->black[i],""); - } - - if(wpMoveHistory.width > 0) { - gameHistoryW = wpMoveHistory.width; - gameHistoryH = wpMoveHistory.height; - gameHistoryX = wpMoveHistory.x; - gameHistoryY = wpMoveHistory.y; - } - - // [HGM] restore old position - if(gameHistoryW > 0) { - j = 0; - XtSetArg(args[j], XtNx, gameHistoryX); j++; - XtSetArg(args[j], XtNy, gameHistoryY); j++; - XtSetArg(args[j], XtNwidth, gameHistoryW); j++; - XtSetArg(args[j], XtNheight, gameHistoryH); j++; - XtSetValues(hist->sh, args, j); - } - XtRealizeWidget(hist->sh); - - return hist->sh; ++//<<<<<<< HEAD +// j = 0; +// XtSetArg(args[j], XtNresizable, True); j++; +// XtSetArg(args[j], XtNallowShellResize, True); j++; +//#if TOPLEVEL - // hist->sh = ++// hist->sh = historyShell = +// XtCreatePopupShell(_("Move list"), topLevelShellWidgetClass, +// shellWidget, args, j); +//#else - // hist->sh = ++// hist->sh = historyShell = +// XtCreatePopupShell(_("Move list"), transientShellWidgetClass, +// shellWidget, args, j); +//#endif +// j = 0; +// XtSetArg(args[j], XtNborderWidth, 0); j++; +// XtSetArg(args[j], XtNdefaultDistance, 0); j++; +// layout = +// XtCreateManagedWidget(layoutName, formWidgetClass, hist->sh, +// args, j); +// +// j = 0; +// XtSetArg(args[j], XtNborderWidth, 0); j++; +// XtSetArg(args[j], XtNresizable, True); j++; +// +// form = +// XtCreateManagedWidget("form", formWidgetClass, layout, args, j); - // j=0; +// +// j = 0; - // +// XtSetArg(args[j], XtNtop, XtChainTop); j++; +// XtSetArg(args[j], XtNbottom, XtChainBottom); j++; +// XtSetArg(args[j], XtNleft, XtChainLeft); j++; +// XtSetArg(args[j], XtNright, XtChainRight); j++; +// +// XtSetArg(args[j], XtNborderWidth, 1); j++; +// XtSetArg(args[j], XtNresizable, False); j++; +// XtSetArg(args[j], XtNallowVert, True); j++; +// XtSetArg(args[j], XtNallowHoriz, True); j++; +// XtSetArg(args[j], XtNforceBars, False); j++; +// XtSetArg(args[j], XtNheight, 280); j++; +// hist->viewport = +// XtCreateManagedWidget("viewport", viewportWidgetClass, +// form, args, j); +// j=0; +// XtSetArg(args[j], XtNborderWidth, 0); j++; +// XtSetArg(args[j], XtNorientation,XtorientHorizontal);j++; +// hist->vbox = +// XtCreateManagedWidget("vbox", formWidgetClass, hist->viewport, args, j); +// +// j=0; +// XtSetArg(args[j], XtNtop, XtChainTop); j++; +// XtSetArg(args[j], XtNbottom, XtChainTop); j++; +// XtSetArg(args[j], XtNleft, XtChainLeft); j++; +// XtSetArg(args[j], XtNright, XtChainLeft); j++; +// +// XtSetArg(args[j], XtNdefaultColumns, 1); j++; +// XtSetArg(args[j], XtNforceColumns, True); j++; +// XtSetArg(args[j], XtNverticalList, True); j++; +// XtSetArg(args[j], XtNborderWidth, 0); j++; +// XtSetArg(args[j], XtNresizable,True);j++; +// XtSetArg(args[j], XtNleft, XtChainLeft); j++; +// hist->mvn = XtCreateManagedWidget("movesn", listWidgetClass, +// hist->vbox, args, j); +// XtAddCallback(hist->mvn, XtNcallback, HistoryMoveProc, (XtPointer) hist); +// +// j=0; +// XtSetArg(args[j], XtNtop, XtChainTop); j++; +// XtSetArg(args[j], XtNbottom, XtChainTop); j++; +// XtSetArg(args[j], XtNleft, XtChainLeft); j++; +// XtSetArg(args[j], XtNright, XtRubber); j++; +// +// XtSetArg(args[j], XtNdefaultColumns, 1); j++; +// XtSetArg(args[j], XtNforceColumns, True); j++; +// XtSetArg(args[j], XtNverticalList, True); j++; +// XtSetArg(args[j], XtNborderWidth, 0); j++; +// XtSetArg(args[j], XtNresizable,True);j++; +// XtSetArg(args[j], XtNfromHoriz, hist->mvn); j++; +// hist->mvw = XtCreateManagedWidget("movesw", listWidgetClass, +// hist->vbox, args, j); +// XtAddCallback(hist->mvw, XtNcallback, HistoryMoveProc, (XtPointer) hist); +// +// j=0; +// XtSetArg(args[j], XtNtop, XtChainTop); j++; +// XtSetArg(args[j], XtNbottom, XtChainTop); j++; +// XtSetArg(args[j], XtNleft, XtRubber); j++; +// XtSetArg(args[j], XtNright, XtRubber); j++; +// +// XtSetArg(args[j], XtNdefaultColumns, 1); j++; +// XtSetArg(args[j], XtNforceColumns, True); j++; +// XtSetArg(args[j], XtNverticalList, True); j++; +// XtSetArg(args[j], XtNborderWidth, 0); j++; +// XtSetArg(args[j], XtNresizable,True);j++; +// XtSetArg(args[j], XtNfromHoriz, hist->mvw); j++; +// hist->mvb = XtCreateManagedWidget("movesb", listWidgetClass, +// hist->vbox, args, j); +// XtAddCallback(hist->mvb, XtNcallback, HistoryMoveProc, (XtPointer) hist); +// +// j=0; +// XtSetArg(args[j], XtNbottom, XtChainBottom); j++; +// XtSetArg(args[j], XtNtop, XtChainBottom); j++; +// XtSetArg(args[j], XtNleft, XtChainLeft); j++; +// XtSetArg(args[j], XtNright, XtChainLeft); j++; +// XtSetArg(args[j], XtNfromVert, hist->viewport); j++; +// b_close= XtCreateManagedWidget(_("Close"), commandWidgetClass, +// form, args, j); +// XtAddCallback(b_close, XtNcallback, HistoryPopDown, (XtPointer) 0); +// +// XtAugmentTranslations(hist->sh,XtParseTranslationTable (trstr)); +// +// XtRealizeWidget(hist->sh); +// CatchDeleteWindow(hist->sh, "HistoryPopDown"); +// +// for(i=1;iaNr;i++){ +// strcpy(hist->white[i],dots); +// strcpy(hist->black[i],""); +// } +// ++// if(wpMoveHistory.width > 0) { ++// gameHistoryW = wpMoveHistory.width; ++// gameHistoryH = wpMoveHistory.height; ++// gameHistoryX = wpMoveHistory.x; ++// gameHistoryY = wpMoveHistory.y; ++// } ++// +// // [HGM] restore old position ++// if(gameHistoryW > 0) { +// j = 0; - // XtSetArg(args[j], XtNx, &gameHistoryX); j++; - // XtSetArg(args[j], XtNy, &gameHistoryY); j++; - // XtSetArg(args[j], XtNwidth, &gameHistoryW); j++; - // XtGetValues(shellWidget, args, j); - // j = 0; - // XtSetArg(args[j], XtNx, gameHistoryX + gameHistoryW); j++; ++// XtSetArg(args[j], XtNx, gameHistoryX); j++; +// XtSetArg(args[j], XtNy, gameHistoryY); j++; ++// XtSetArg(args[j], XtNwidth, gameHistoryW); j++; ++// XtSetArg(args[j], XtNheight, gameHistoryH); j++; +// XtSetValues(hist->sh, args, j); ++// } +// XtRealizeWidget(hist->sh); +// +// return hist->sh; ++// } void @@@ -320,14 -448,25 +330,21 @@@ HistoryPopUp( void -HistoryShowProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; +HistoryShowProc(object, user_data) + GtkObject *object; + gpointer user_data; { - if (!hist) { - HistoryCreate(); - HistoryPopUp(); - } else if (hist->Up) { - HistoryPopDown(0,0,0); - } else { - HistoryPopUp(); - } - ToNrEvent(currentMove); + HistoryCreate(); + HistoryPopUp(); + //TODO: ToNrEvent(currentMove); + + return; } + Boolean + MoveHistoryIsUp() + { - return hist && hist->Up; ++ // TODO ++ return 0; ++ // return hist && hist->Up; + } diff --cc xhistory.h index 8e8c5d7,9c42c75..109e1bd --- a/xhistory.h +++ b/xhistory.h @@@ -23,9 -23,12 +23,12 @@@ #ifndef _XHISTL_H #define _XHISTL_H 1 -void HistoryShowProc P((Widget w, XEvent *event, - String *prms, Cardinal *nprms)); -void HistoryPopDown P((Widget w, XtPointer client_data, - XtPointer call_data)); +void HistoryShowProc P((GtkObject *object, gpointer user_data)); + +void HistoryPopDown P((GtkObject *object, gpointer user_data)); + + Boolean MoveHistoryIsUp P((void)); + + extern Widget historyShell; #endif /* _XHISTL_H */