From e6ec7903052865e5e9e53ff9143a8379eb08255c Mon Sep 17 00:00:00 2001 From: ehouse Date: Sat, 3 Feb 2007 17:41:46 +0000 Subject: [PATCH] eType_2str replaces logEvent. Only effects debug builds. --- xwords4/palm/palmdbg.c | 84 ++++++++++++++++++++++++++++++++++++++ xwords4/palm/palmdbg.h | 4 +- xwords4/palm/palmutil.c | 89 ----------------------------------------- xwords4/palm/palmutil.h | 3 -- 4 files changed, 87 insertions(+), 93 deletions(-) diff --git a/xwords4/palm/palmdbg.c b/xwords4/palm/palmdbg.c index b237c67a9..0f0f5023d 100644 --- a/xwords4/palm/palmdbg.c +++ b/xwords4/palm/palmdbg.c @@ -20,6 +20,7 @@ #ifdef DEBUG #include "palmdbg.h" +#include "palmmain.h" #include "xwords4defines.h" #define CASESTR(s) case s: return #s @@ -216,6 +217,89 @@ frmObjId_2str( XP_U16 id ) } } +const char* +eType_2str( eventsEnum eType ) +{ + switch( eType ) { + CASESTR(nilEvent); + CASESTR(penDownEvent); + CASESTR(penUpEvent); + CASESTR(penMoveEvent); + CASESTR(keyDownEvent); + CASESTR(winEnterEvent); + CASESTR(winExitEvent); + CASESTR(ctlEnterEvent); + CASESTR(ctlExitEvent); + CASESTR(ctlSelectEvent); + CASESTR(ctlRepeatEvent); + CASESTR(lstEnterEvent); + CASESTR(lstSelectEvent); + CASESTR(lstExitEvent); + CASESTR(popSelectEvent); + CASESTR(fldEnterEvent); + CASESTR(fldHeightChangedEvent); + CASESTR(fldChangedEvent); + CASESTR(tblEnterEvent); + CASESTR(tblSelectEvent); + CASESTR(daySelectEvent); + CASESTR(menuEvent); + CASESTR(appStopEvent); + CASESTR(frmLoadEvent); + CASESTR(frmOpenEvent); + CASESTR(frmGotoEvent); + CASESTR(frmUpdateEvent); + CASESTR(frmSaveEvent); + CASESTR(frmCloseEvent); + CASESTR(frmTitleEnterEvent); + CASESTR(frmTitleSelectEvent); + CASESTR(tblExitEvent); + CASESTR(sclEnterEvent); + CASESTR(sclExitEvent); + CASESTR(sclRepeatEvent); + CASESTR(tsmConfirmEvent); + CASESTR(tsmFepButtonEvent); + CASESTR(tsmFepModeEvent); + CASESTR(attnIndicatorEnterEvent); + CASESTR(attnIndicatorSelectEvent); + CASESTR(menuCmdBarOpenEvent); + CASESTR(menuOpenEvent); + CASESTR(menuCloseEvent); + CASESTR(frmGadgetEnterEvent); + CASESTR(frmGadgetMiscEvent); + + CASESTR(firstINetLibEvent); + CASESTR(firstWebLibEvent); + CASESTR(telAsyncReplyEvent); + + CASESTR(keyUpEvent); + CASESTR(keyHoldEvent); + CASESTR(frmObjectFocusTakeEvent); + CASESTR(frmObjectFocusLostEvent); + + CASESTR(firstLicenseeEvent); + CASESTR(lastLicenseeEvent); + + CASESTR(lastUserEvent); + + CASESTR( dictSelectedEvent ); + CASESTR( newGameOkEvent ); + CASESTR( newGameCancelEvent); + CASESTR( loadGameEvent); + CASESTR( prefsChangedEvent); + CASESTR( openSavedGameEvent); + CASESTR( updateAfterFocusEvent); +#if defined XWFEATURE_BLUETOOTH || defined XWFEATURE_RELAY + CASESTR( connsSettingChgEvent); +#endif +#ifdef FEATURE_SILK + CASESTR( doResizeWinEvent ); +#endif + default: + return ""; + break; + } +} /* eType_2str */ + #undef CASESTR #undef FUNC diff --git a/xwords4/palm/palmdbg.h b/xwords4/palm/palmdbg.h index 3dd2048ed..b67066527 100644 --- a/xwords4/palm/palmdbg.h +++ b/xwords4/palm/palmdbg.h @@ -20,8 +20,10 @@ #ifndef _PALMDBG_H_ #define _PALMDBG_H_ -#include "board.h" +#include "comtypes.h" +#include const char* frmObjId_2str( XP_U16 id ); +const char* eType_2str( eventsEnum eType ); #endif diff --git a/xwords4/palm/palmutil.c b/xwords4/palm/palmutil.c index 4a69112cf..92a6dabcb 100644 --- a/xwords4/palm/palmutil.c +++ b/xwords4/palm/palmutil.c @@ -570,95 +570,6 @@ doNothing( EventPtr event ) #endif #ifdef DEBUG -void -logEvent( eventsEnum eType ) -{ - char* name = NULL; -#define CASE_STR(e) case e: name = #e; break - switch( eType ) { - CASE_STR(nilEvent); - CASE_STR(penDownEvent); - CASE_STR(penUpEvent); - CASE_STR(penMoveEvent); - CASE_STR(keyDownEvent); - CASE_STR(winEnterEvent); - CASE_STR(winExitEvent); - CASE_STR(ctlEnterEvent); - CASE_STR(ctlExitEvent); - CASE_STR(ctlSelectEvent); - CASE_STR(ctlRepeatEvent); - CASE_STR(lstEnterEvent); - CASE_STR(lstSelectEvent); - CASE_STR(lstExitEvent); - CASE_STR(popSelectEvent); - CASE_STR(fldEnterEvent); - CASE_STR(fldHeightChangedEvent); - CASE_STR(fldChangedEvent); - CASE_STR(tblEnterEvent); - CASE_STR(tblSelectEvent); - CASE_STR(daySelectEvent); - CASE_STR(menuEvent); - CASE_STR(appStopEvent); - CASE_STR(frmLoadEvent); - CASE_STR(frmOpenEvent); - CASE_STR(frmGotoEvent); - CASE_STR(frmUpdateEvent); - CASE_STR(frmSaveEvent); - CASE_STR(frmCloseEvent); - CASE_STR(frmTitleEnterEvent); - CASE_STR(frmTitleSelectEvent); - CASE_STR(tblExitEvent); - CASE_STR(sclEnterEvent); - CASE_STR(sclExitEvent); - CASE_STR(sclRepeatEvent); - CASE_STR(tsmConfirmEvent); - CASE_STR(tsmFepButtonEvent); - CASE_STR(tsmFepModeEvent); - CASE_STR(attnIndicatorEnterEvent); - CASE_STR(attnIndicatorSelectEvent); - CASE_STR(menuCmdBarOpenEvent); - CASE_STR(menuOpenEvent); - CASE_STR(menuCloseEvent); - CASE_STR(frmGadgetEnterEvent); - CASE_STR(frmGadgetMiscEvent); - - CASE_STR(firstINetLibEvent); - CASE_STR(firstWebLibEvent); - CASE_STR(telAsyncReplyEvent); - - CASE_STR(keyUpEvent); - CASE_STR(keyHoldEvent); - CASE_STR(frmObjectFocusTakeEvent); - CASE_STR(frmObjectFocusLostEvent); - - CASE_STR(firstLicenseeEvent); - CASE_STR(lastLicenseeEvent); - - CASE_STR(lastUserEvent); - - CASE_STR( dictSelectedEvent ); - CASE_STR( newGameOkEvent ); - CASE_STR( newGameCancelEvent); - CASE_STR( loadGameEvent); - CASE_STR( prefsChangedEvent); - CASE_STR( openSavedGameEvent); - CASE_STR( updateAfterFocusEvent); -#if defined XWFEATURE_BLUETOOTH || defined XWFEATURE_RELAY - CASE_STR( connsSettingChgEvent); -#endif -#ifdef FEATURE_SILK - CASE_STR( doResizeWinEvent ); -#endif - default: - name = ""; - break; - } -#undef CASE_STR - if ( !!name ) { - XP_LOGF( "eType = %s", name ); - } -} /* logEvent */ - void palm_warnf( char* format, ... ) { diff --git a/xwords4/palm/palmutil.h b/xwords4/palm/palmutil.h index e57e388fd..01664f029 100644 --- a/xwords4/palm/palmutil.h +++ b/xwords4/palm/palmutil.h @@ -92,9 +92,6 @@ void fitButtonToString( XP_U16 id ); #ifdef DEBUG void PalmClearLogs( void ); -void logEvent( eventsEnum eType ); -#else -# define logEvent(e) #endif #endif