eType_2str replaces logEvent. Only effects debug builds.

This commit is contained in:
ehouse 2007-02-03 17:41:46 +00:00
parent 1fb61d9a7f
commit e6ec790305
4 changed files with 87 additions and 93 deletions

View file

@ -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 "<unknown>";
break;
}
} /* eType_2str */
#undef CASESTR
#undef FUNC

View file

@ -20,8 +20,10 @@
#ifndef _PALMDBG_H_
#define _PALMDBG_H_
#include "board.h"
#include "comtypes.h"
#include <Event.h>
const char* frmObjId_2str( XP_U16 id );
const char* eType_2str( eventsEnum eType );
#endif

View file

@ -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 = "<unknown>";
break;
}
#undef CASE_STR
if ( !!name ) {
XP_LOGF( "eType = %s", name );
}
} /* logEvent */
void
palm_warnf( char* format, ... )
{

View file

@ -92,9 +92,6 @@ void fitButtonToString( XP_U16 id );
#ifdef DEBUG
void PalmClearLogs( void );
void logEvent( eventsEnum eType );
#else
# define logEvent(e)
#endif
#endif