From: H.G. Muller Date: Thu, 19 Apr 2012 08:39:12 +0000 (+0200) Subject: Solve WinBoard name clashes, fix zippy-analyze menu graying X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=7c9ee0544821f7981792be03e90ba15e9a8aeada;p=xboard.git Solve WinBoard name clashes, fix zippy-analyze menu graying Some of the function names used in the refactored X11 front-end collided with Windows system names from winboard.h, or with names of internal routines in WinBoard front-end files (so they could not be declared in frontend.h). These were renamed. Some prototypes in engineoutput.h contained X11 types, and they were moved to xboard.h. In addition, two menu-item names were corrected to two-part names. --- diff --git a/dialogs.c b/dialogs.c index 9783679..e0d1c4e 100644 --- a/dialogs.c +++ b/dialogs.c @@ -736,7 +736,7 @@ static void Test (int n) { GenericReadout(soundOptions, 2); - if(soundFiles[values[3]]) PlaySound(soundFiles[values[3]]); + if(soundFiles[values[3]]) PlaySoundFile(soundFiles[values[3]]); } void diff --git a/engineoutput.h b/engineoutput.h index bab71f8..7007c16 100644 --- a/engineoutput.h +++ b/engineoutput.h @@ -72,10 +72,6 @@ void DoClearMemo(int which); void ResizeWindowControls( int mode ); int EngineOutputDialogExists(); void SetEngineOutputTitle( char *title ); -void InitializeEngineOutput P((Option *opt, Option *memo2)); -void DrawIcon P((Option *opt, int nIcon)); - -// front-end shared with xboard.c -void SelectPV P((Widget w, XEvent * event, String * params, Cardinal * nParams)); -void StopPV P((Widget w, XEvent * event, String * params, Cardinal * nParams)); +void InitEngineOutput P((Option *opt, Option *memo2)); // XB only +void DrawWidgetIcon P((Option *opt, int nIcon)); // XB only diff --git a/frontend.h b/frontend.h index 913dd55..3f239a1 100644 --- a/frontend.h +++ b/frontend.h @@ -106,7 +106,7 @@ void PlayIcsDrawSound P((void)); void PlayIcsUnfinishedSound P((void)); void PlayAlarmSound P((void)); void PlayTellSound P((void)); -void PlaySound P((char *name)); +void PlaySoundFile P((char *name)); void PlaySoundByColor P((void)); void EchoOn P((void)); void EchoOff P((void)); @@ -218,7 +218,7 @@ extern char *firstChessProgramNames; void GreyRevert P((Boolean grey)); void MarkMenuItem P((char *menuRef, int state)); -void EnableMenuItem P((char *menuRef, int state)); +void EnableNamedMenuItem P((char *menuRef, int state)); typedef struct FrontEndProgramStats_TAG { int which; diff --git a/menus.c b/menus.c index 304d3c4..5d8d65e 100644 --- a/menus.c +++ b/menus.c @@ -1080,8 +1080,8 @@ SetICSMode () #if ZIPPY if (appData.zippyPlay && !appData.noChessProgram) { /* [DM] icsEngineAnalyze */ - EnableMenuItem("Analysis Mode", True); - EnableMenuItem("Engine #1 Settings", True); + EnableNamedMenuItem("Mode.AnalysisMode", True); + EnableNamedMenuItem("Engine.Engine#1Settings", True); } #endif } @@ -1139,7 +1139,7 @@ SetMachineThinkingEnables () case MachinePlaysBlack: case MachinePlaysWhite: case TwoMachinesPlay: - EnableMenuItem(ModeToWidgetName(gameMode), True); + EnableNamedMenuItem(ModeToWidgetName(gameMode), True); break; default: break; diff --git a/nengineoutput.c b/nengineoutput.c index 201eb3d..31bdbe5 100644 --- a/nengineoutput.c +++ b/nengineoutput.c @@ -89,7 +89,7 @@ Option engoutOptions[] = { void SetIcon (int which, int field, int nIcon) { // first call into xengineoutput.c to pick up icon pixmap - if( nIcon ) DrawIcon(&engoutOptions[STRIDE*which + field - 1], nIcon); + if( nIcon ) DrawWidgetIcon(&engoutOptions[STRIDE*which + field - 1], nIcon); } void @@ -123,7 +123,7 @@ EngineOutputPopUp () AddHandler(&engoutOptions[MEMO], 6); AddHandler(&engoutOptions[MEMO+STRIDE], 6); if( needInit ) { - InitializeEngineOutput(&engoutOptions[0], &engoutOptions[MEMO]); // make icon bitmaps + InitEngineOutput(&engoutOptions[0], &engoutOptions[MEMO]); // make icon bitmaps needInit = FALSE; } SetEngineColorIcon( 0 ); diff --git a/usounds.c b/usounds.c index aabb9ee..4b9ea00 100644 --- a/usounds.c +++ b/usounds.c @@ -77,7 +77,7 @@ extern char *getenv(); void -PlaySound (char *name) +PlaySoundFile (char *name) { if (*name == NULLCHAR) { return; @@ -96,43 +96,43 @@ PlaySound (char *name) void RingBell () { - PlaySound(appData.soundMove); + PlaySoundFile(appData.soundMove); } void PlayIcsWinSound () { - PlaySound(appData.soundIcsWin); + PlaySoundFile(appData.soundIcsWin); } void PlayIcsLossSound () { - PlaySound(appData.soundIcsLoss); + PlaySoundFile(appData.soundIcsLoss); } void PlayIcsDrawSound () { - PlaySound(appData.soundIcsDraw); + PlaySoundFile(appData.soundIcsDraw); } void PlayIcsUnfinishedSound () { - PlaySound(appData.soundIcsUnfinished); + PlaySoundFile(appData.soundIcsUnfinished); } void PlayAlarmSound () { - PlaySound(appData.soundIcsAlarm); + PlaySoundFile(appData.soundIcsAlarm); } void PlayTellSound () { - PlaySound(appData.soundTell); + PlaySoundFile(appData.soundTell); } void @@ -140,31 +140,31 @@ PlaySoundForColor (ColorClass cc) { switch (cc) { case ColorShout: - PlaySound(appData.soundShout); + PlaySoundFile(appData.soundShout); break; case ColorSShout: - PlaySound(appData.soundSShout); + PlaySoundFile(appData.soundSShout); break; case ColorChannel1: - PlaySound(appData.soundChannel1); + PlaySoundFile(appData.soundChannel1); break; case ColorChannel: - PlaySound(appData.soundChannel); + PlaySoundFile(appData.soundChannel); break; case ColorKibitz: - PlaySound(appData.soundKibitz); + PlaySoundFile(appData.soundKibitz); break; case ColorTell: - PlaySound(appData.soundTell); + PlaySoundFile(appData.soundTell); break; case ColorChallenge: - PlaySound(appData.soundChallenge); + PlaySoundFile(appData.soundChallenge); break; case ColorRequest: - PlaySound(appData.soundRequest); + PlaySoundFile(appData.soundRequest); break; case ColorSeek: - PlaySound(appData.soundSeek); + PlaySoundFile(appData.soundSeek); break; case ColorNormal: case ColorNone: diff --git a/winboard/winboard.c b/winboard/winboard.c index f263124..a9d7454 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -102,6 +102,8 @@ Boolean flipClock = FALSE; extern HANDLE chatHandle[]; extern int ics_type; +int MySearchPath P((char *installDir, char *name, char *fullname)); +int MyGetFullPathName P((char *name, char *fullname)); void DisplayHoldingsCount(HDC hdc, int x, int y, int align, int copyNumber); VOID NewVariantPopup(HWND hwnd); int FinishMove P((ChessMove moveType, int fromX, int fromY, int toX, int toY, diff --git a/xboard.c b/xboard.c index 863119e..a661d53 100644 --- a/xboard.c +++ b/xboard.c @@ -2277,7 +2277,7 @@ MarkMenuItem (char *menuRef, int state) } void -EnableMenuItem (char *menuRef, int state) +EnableNamedMenuItem (char *menuRef, int state) { MenuItem *item = MenuNameToItem(menuRef); @@ -2295,7 +2295,7 @@ void SetMenuEnables (Enables *enab) { while (enab->name != NULL) { - EnableMenuItem(enab->name, enab->value); + EnableNamedMenuItem(enab->name, enab->value); enab++; } } @@ -2861,7 +2861,7 @@ ModeHighlight () MarkMenuItem("Mode.MachineMatch", matchMode && matchGame < appData.matchGames); /* Maybe all the enables should be handled here, not just this one */ - EnableMenuItem("Mode.Training", gameMode == Training || gameMode == PlayFromGameFile); + EnableNamedMenuItem("Mode.Training", gameMode == Training || gameMode == PlayFromGameFile); } diff --git a/xboard.h b/xboard.h index b6709d7..5a6587e 100644 --- a/xboard.h +++ b/xboard.h @@ -146,6 +146,9 @@ void TabProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); void GenericMenu P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); // from xengineoutput.c +void SelectPV P((Widget w, XEvent * event, String * params, Cardinal * nParams)); +void StopPV P((Widget w, XEvent * event, String * params, Cardinal * nParams)); + extern char memoTranslations[]; diff --git a/xengineoutput.c b/xengineoutput.c index b25fb84..5221e6a 100644 --- a/xengineoutput.c +++ b/xengineoutput.c @@ -117,7 +117,7 @@ ReadIcon (char *pixData[], int iconNr, Widget w) } void -InitializeEngineOutput (Option *opt, Option *memo2) +InitEngineOutput (Option *opt, Option *memo2) { // front-end, because it must have access to the pixmaps Widget w = opt->handle; memoWidget = memo2->handle; @@ -133,7 +133,7 @@ InitializeEngineOutput (Option *opt, Option *memo2) } void -DrawIcon (Option *opt, int nIcon) +DrawWidgetIcon (Option *opt, int nIcon) { // as we are already in X front-end, so do X-stuff here Arg arg; XtSetArg(arg, XtNleftBitmap, (XtArgVal) icons[nIcon]);