#include "maptapClient.h" // maptapClient.c version 1.0, 15 August 2003. // Copyright (c) 2003 Mobile Geographics LLC. // Permission granted to use this code in any PalmOS application. Boolean MaptapDefineMap(float x, float y, float scaleInverse, MaptapAtlasSelectionType atlas) { MapTapClientPoint thePoint; MemPtr ftrP; Err err; thePoint.x = x; thePoint.y = y; if (err = FtrPtrNew(MapTapAtlasCreator, MapTapCenterFtr, sizeof(MapTapClientPoint), &ftrP)) return false; if (err = DmWrite(ftrP, 0, &thePoint, sizeof(MapTapClientPoint))) return false; if (err = FtrSet(MapTapAtlasCreator, MapTapScaleFtr, (UInt32) scaleInverse)) return false; if (err = FtrSet(MapTapAtlasCreator, MapTapAtlasSelFtr, (UInt32) atlas)) return false; return true; } Boolean MaptapSetTitle(Char* textP) { MemPtr ftrP; Err err; if (err = FtrPtrNew(MapTapAtlasCreator, MapTapTitleFtr, StrLen(textP)+1, &ftrP)) return false; if (err = DmWrite(ftrP, 0, textP, StrLen(textP)+1)) return false; return true; } Boolean MaptapLaunchAtlas(UInt32 callerCode) { LocalID theDBID; UInt16 theCardNo; DmSearchStateType theSearchState; Err err; FtrSet(MapTapAtlasCreator, MapTapCallerFtr, callerCode); err = DmGetNextDatabaseByTypeCreator(true, &theSearchState, sysFileTApplication, MapTapAtlasCreator, true, &theCardNo, &theDBID); if (!err && theDBID) { SysUIAppSwitch(theCardNo, theDBID, sysAppLaunchCmdNormalLaunch, NULL ); return true; } else return false; } Boolean MaptapAtlasPresent(void) { LocalID theDBID; UInt16 theCardNo; DmSearchStateType theSearchState; Err err; err = DmGetNextDatabaseByTypeCreator(true, &theSearchState, sysFileTApplication, MapTapAtlasCreator, true, &theCardNo, &theDBID); if (!err && theDBID) return true; else return false; }