cleanup unrelated to pnolet work

This commit is contained in:
ehouse 2004-09-21 04:57:00 +00:00
parent 0f71b4fb61
commit 50598c3293
2 changed files with 17 additions and 31 deletions

View file

@ -58,6 +58,7 @@
#include "LocalizedStrIncludes.h" #include "LocalizedStrIncludes.h"
#include "callback.h" #include "callback.h"
#include "pace_man.h" /* for crash() macro */
#ifdef SUPPORT_SONY_JOGDIAL #ifdef SUPPORT_SONY_JOGDIAL
#include "SonyChars.h" #include "SonyChars.h"
@ -177,9 +178,6 @@ static void initAndStartBoard( PalmAppGlobals* globals, XP_Bool newGame );
UInt32 UInt32
PilotMain( UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags) PilotMain( UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
{ {
#ifdef XW_TARGET_PNO
XP_LOGF( "ARM PilotMain called" );
#else
PalmAppGlobals* globals; PalmAppGlobals* globals;
if ( cmd == sysAppLaunchCmdNormalLaunch ) { if ( cmd == sysAppLaunchCmdNormalLaunch ) {
if ( ((launchFlags & sysAppLaunchFlagNewGlobals) != 0) if ( ((launchFlags & sysAppLaunchFlagNewGlobals) != 0)
@ -206,7 +204,6 @@ PilotMain( UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
} }
#endif #endif
} }
#endif
return 0; return 0;
} /* PilotMain */ } /* PilotMain */
@ -736,6 +733,7 @@ openXWPrefsDB( PalmAppGlobals* globals )
err = DmCreateDatabase( CARD_0, XW_PREFS_DBNAME, err = DmCreateDatabase( CARD_0, XW_PREFS_DBNAME,
APPID, XWORDS_PREFS_TYPE, true ); APPID, XWORDS_PREFS_TYPE, true );
XP_ASSERT( err == errNone || err == dmErrAlreadyExists );
globals->boardDBID = DmFindDatabase( CARD_0, XW_PREFS_DBNAME ); globals->boardDBID = DmFindDatabase( CARD_0, XW_PREFS_DBNAME );
globals->boardDBP = DmOpenDatabase( CARD_0, globals->boardDBID, globals->boardDBP = DmOpenDatabase( CARD_0, globals->boardDBID,
dmModeWrite ); dmModeWrite );
@ -801,9 +799,11 @@ findXWPrefsRsrc( PalmAppGlobals* globals, UInt32 resType, UInt16 resID )
} }
builtinH = DmGetResource( resType, resID ); builtinH = DmGetResource( resType, resID );
XP_ASSERT( !!builtinH );
size = MemHandleSize( builtinH ); size = MemHandleSize( builtinH );
newH = DmNewResource( globals->boardDBP, resType, newH = DmNewResource( globals->boardDBP, resType,
resID, size ); resID, size );
XP_ASSERT( !!newH );
DmWrite( MemHandleLock( newH ), 0, MemHandleLock(builtinH), DmWrite( MemHandleLock( newH ), 0, MemHandleLock(builtinH),
size ); size );
MemHandleUnlock( newH ); MemHandleUnlock( newH );
@ -1089,9 +1089,7 @@ startApplication( PalmAppGlobals** globalsP )
initUtilFuncs( globals ); initUtilFuncs( globals );
#ifdef NODE_CAN_4
offerConvertOldDicts( globals ); offerConvertOldDicts( globals );
#endif
globals->dictList = DictListMake( MPPARM_NOCOMMA(globals->mpool) ); globals->dictList = DictListMake( MPPARM_NOCOMMA(globals->mpool) );
if ( DictListCount( globals->dictList ) == 0 ) { if ( DictListCount( globals->dictList ) == 0 ) {
@ -1373,7 +1371,6 @@ static void
eventLoop( PalmAppGlobals* globals ) eventLoop( PalmAppGlobals* globals )
{ {
EventType event; EventType event;
UInt16 error;
do { do {
#ifdef BEYOND_IR #ifdef BEYOND_IR
@ -1406,7 +1403,8 @@ eventLoop( PalmAppGlobals* globals )
/* Give the system a chance to handle the event. */ /* Give the system a chance to handle the event. */
if ( !SysHandleEvent(&event)) { if ( !SysHandleEvent(&event)) {
if ( !MenuHandleEvent(0, &event, &error)) { UInt16 error;
if ( !MenuHandleEvent( NULL, &event, &error)) {
if ( !applicationHandleEvent( globals, &event )) { if ( !applicationHandleEvent( globals, &event )) {
FrmDispatchEvent(&event); FrmDispatchEvent(&event);
} }
@ -1426,8 +1424,7 @@ applicationHandleEvent( PalmAppGlobals* globals, EventPtr event )
Boolean result = false; Boolean result = false;
FormEventHandlerType* handler = NULL; FormEventHandlerType* handler = NULL;
switch ( event->eType ) { if ( event->eType == frmLoadEvent ) {
case frmLoadEvent:
/*Load the form resource specified in the event then activate the /*Load the form resource specified in the event then activate the
form.*/ form.*/
formId = event->data.frmLoad.formID; formId = event->data.frmLoad.formID;
@ -1438,41 +1435,32 @@ applicationHandleEvent( PalmAppGlobals* globals, EventPtr event )
case XW_MAIN_FORM: case XW_MAIN_FORM:
setFormRefcon( globals ); setFormRefcon( globals );
handler = mainViewHandleEvent; handler = mainViewHandleEvent;
result = true;
break; break;
case XW_NEWGAMES_FORM: case XW_NEWGAMES_FORM:
handler = newGameHandleEvent; handler = newGameHandleEvent;
result = true;
break; break;
case XW_DICTINFO_FORM: case XW_DICTINFO_FORM:
handler = dictFormHandleEvent; handler = dictFormHandleEvent;
result = true;
break; break;
case XW_PREFS_FORM: case XW_PREFS_FORM:
handler = PrefsFormHandleEvent; handler = PrefsFormHandleEvent;
result = true;
break; break;
#ifdef BEYOND_IR #ifdef BEYOND_IR
case XW_CONNS_FORM: case XW_CONNS_FORM:
handler = ConnsFormHandleEvent; handler = ConnsFormHandleEvent;
result = true;
break; break;
#endif #endif
#if defined OWNER_HASH || defined NO_REG_REQUIRED #if defined OWNER_HASH || defined NO_REG_REQUIRED
case XW_SAVEDGAMES_DIALOG_ID: case XW_SAVEDGAMES_DIALOG_ID:
handler = savedGamesHandleEvent; handler = savedGamesHandleEvent;
result = true;
break; break;
#endif #endif
} }
break; if ( !!handler ) {
default: XP_ASSERT( !!frm );
break; result = true;
} FrmSetEventHandler( frm, handler );
}
if ( result ) {
XP_ASSERT( !!frm );
FrmSetEventHandler( frm, handler );
} }
return result; return result;
@ -2099,10 +2087,6 @@ mainViewHandleEvent( EventPtr event )
draw = true; draw = true;
XP_ASSERT( !!globals->game.board ); XP_ASSERT( !!globals->game.board );
case boardRedrawEvt:
draw = true;
break;
#ifdef FEATURE_HIGHRES #ifdef FEATURE_HIGHRES
case doResizeWinEvent: case doResizeWinEvent:
getSizes( globals ); getSizes( globals );
@ -2774,8 +2758,11 @@ Boolean
palmaskFromStrId( PalmAppGlobals* globals, XP_U16 strId, XP_S16 titleID, palmaskFromStrId( PalmAppGlobals* globals, XP_U16 strId, XP_S16 titleID,
XP_S16 altButtonID ) XP_S16 altButtonID )
{ {
XP_UCHAR* message = getResString( globals, strId ); XP_UCHAR* message;
XP_UCHAR* alt = altButtonID < 0? NULL: getResString( globals, altButtonID ); XP_UCHAR* alt;
message = getResString( globals, strId );
XP_ASSERT( !!message );
alt = altButtonID < 0? NULL: getResString( globals, altButtonID );
return palmask( globals, message, alt, titleID ); return palmask( globals, message, alt, titleID );
} /* palmaskFromStrId */ } /* palmaskFromStrId */

View file

@ -312,7 +312,6 @@ enum { dictSelectedEvent = firstUserEvent /* 0x6000 */
,newGameOkEvent ,newGameOkEvent
,newGameCancelEvent ,newGameCancelEvent
,loadGameEvent ,loadGameEvent
,boardRedrawEvt
,prefsChangedEvent ,prefsChangedEvent
,openSavedGameEvent ,openSavedGameEvent
#ifdef BEYOND_IR #ifdef BEYOND_IR