#include <PalmOS.h>
#include <PalmCompatibility.h>
#include <string.h>
#include <stdio.h>
#include "gtalkRsc.h"
#include "latlong.h"
#include "MathLib.h"
#include "gpslib.h"
#include "gtalk.h"
#include "route.h"
#include "gpsutil.h"
#include "log.h"
#include "map.h"
#include "gpsio.h"
#include "memo.h"
#include "dbio.h"
#include "track.h"
#include <LstGlue.h>
#include <TxtGlue.h>
Defines | |
#define | ALLOW_ACCESS_TO_INTERNALS_OF_LISTS |
#define | ourMinVersion sysMakeROMVersion(3,0,0,sysROMStageRelease,0) |
#define | MaxDBNames 10 /* maximum data bases names managed by SetPreferences */ |
#define | SymbH 14 |
#define | SymbW 16 |
#define | SymbO 2 |
#define | XName 1 /* coord. aff. nom */ |
#define | XCmnt 48 /* coord. aff. commentaire */ |
#define | XBear 105 /* coord. aff. bearing */ |
#define | XSymb 136 /* coord. aff. symbole */ |
#define | XEnd 150 |
Functions | |
char * | GetCharEncoding (void) |
Boolean | MainFormHandleEvent (EventPtr e) |
Event handler of main form. | |
Boolean | ApplicationHandleEvent (EventPtr e) |
frmLoadEvent event handler | |
Word | StartApplication (void) |
Open application data bases and retrieves preferences. | |
void | StopApplication (void) |
Save preferences, close forms, close app database. | |
void | EventLoop (void) |
The main event loop. | |
DWord | PilotMain (Word cmd, Ptr cmdPBP, Word launchFlags) |
Main entry point. | |
Err | OpenOrCreateDB (DmOpenRef *DBP, char *DBName, ULong DBType, ULong creator) |
Opens or creates GPilotS data base. | |
void | UpdateMainForm (void) |
Updates variables and list display of main form. | |
void | AlarmProc (void) |
Alarm callback. | |
Err | RomVersionCompatible (UInt32 requiredVersion, UInt16 launchFlags) |
Test PalmOs version compatibility. | |
Boolean | CatFormHandleEvent (EventPtr e) |
Category change form event handler. | |
Err | RecSetSecret (DmOpenRef *DBP, UInt16 index, Boolean value) |
Sets the secret attribute of a record. | |
void | NewDB (void) |
Displays a form to ask a new data base name to create and to switch to. | |
UInt16 | FindDBNames (UInt32 type, UInt32 creator, char *namep, Int16 *matched, char *bufp, char **bufpp, UInt16 bufpsize) |
Returns the number of data bases of given type and creator and, optionaly, a list of their names. | |
Err | SwitchDB (DmOpenRef *DBP, char *DBName, ULong DBType) |
Switch from current data base to the one whose name is given. | |
void | ChangeDB (void) |
Moves selected records from current data base to another. | |
void | SetDebug (void) |
Debug form handler. | |
void | DrawSymbol (unsigned int lid, int x, int y) |
Draws a waypoint symbol centered at given coordinates. | |
Int | CompareWpt (void *p1, void *p2, Int other, SortRecordInfoPtr sp1, SortRecordInfoPtr sp2, VoidHand aph) |
Compares two waypoints features according to Prefs.wptsortcrit. | |
void | SortWpts (WptSortCritType s) |
Sort waypoints according to given criteria. | |
long | SearchWptByName (char *name, Boolean exact, Boolean all) |
Search waypoint by name. | |
void | MainListDraw (Int16 itemNum, RectanglePtr bounds, CharPtr *itemsText) |
Draws an item of the main page's list. | |
int | SetReferencePt (UInt index, Boolean ask) |
Set reference point to waypoint whose index is passed if user confirms. | |
void | UpdateScrollBar (ListPtr LstPtr, Word ScrollId) |
Updates scrollbar of main list. | |
void | ScrollLines (ListPtr LstPtr, Word ScrollId, int numLinesToScroll, Boolean redraw) |
Scroll lines of a list and updates associated scrollbar. | |
void | SetPreferences () |
Display and setting of preferences with a modal form. | |
Boolean | RecIsSecret (DmOpenRef *DBP, UInt16 index) |
Tests if a record has secret attribute. | |
Err | SetBackupBit (DmOpenRef *DBP) |
Set the backup flag of the given data base. | |
Variables | |
char | rcsid [] = "$Id: gtalk.c,v 1.41 2004/11/17 21:11:32 clavelei Exp $" |
PrefType | Prefs |
int | DebugLevel |
const char * | DistanceUnitNames [] = { "km", "nm", "mi" } |
char * | BeamTypes [] = { "Un", "Wp", "Rt", "Tk" } |
EditWptMode | EditMode |
Semicircle_Type | ReferencePt = { 0, 0 } |
char | ReferencePtName [32] = "" |
UInt | CurrentRecordIndex |
UInt | CurrentRouteIndex |
UInt * | CurrentCategory |
UInt | New |
UInt | Replaced |
UInt | Sent |
char | gbuf1 [512] |
char | gbuf2 [128] |
char | search_buf [6] |
Semicircle_Type | CurrentWGS84Pos |
Boolean | MustCallGpslibTicks = 0 |
Boolean | OnlyNews |
Boolean | Furuno |
Boolean | CompactTracks = 0 |
Boolean | MainListDirty = 1 |
DmOpenRef | CurrentDB |
DmOpenRef | WptDB |
DmOpenRef | TrkDB |
DmOpenRef | RteDB |
DmOpenRef | LogDB |
UInt | lastrecordindex |
UInt | lastitemnum = -2 |
ULong | CurrentRecordID |
char | CategoryName [dmCategoryLength] |
WinHandle | SymbolsWH |
|
Alarm callback. Called on alarm wakeup.
|
|
frmLoadEvent event handler
|
|
Category change form event handler.
|
|
Moves selected records from current data base to another. Lets the user choose the new data base
|
|
Compares two waypoints features according to Prefs.wptsortcrit. Used as callback.
|
|
Draws a waypoint symbol centered at given coordinates.
|
|
The main event loop.
|
|
Returns the number of data bases of given type and creator and, optionaly, a list of their names.
|
|
Event handler of main form.
|
|
Draws an item of the main page's list. Take appropriate actions given the type of the object concerned and the display and sort options.
|
|
Displays a form to ask a new data base name to create and to switch to.
|
|
Opens or creates GPilotS data base.
|
|
Main entry point.
|
|
Tests if a record has secret attribute.
|
|
Sets the secret attribute of a record.
|
|
Test PalmOs version compatibility.
|
|
Scroll lines of a list and updates associated scrollbar.
|
|
Search waypoint by name.
|
|
Set the backup flag of the given data base.
|
|
Debug form handler. Displays a form to select debug levels of differents parts of GPilotS
|
|
Display and setting of preferences with a modal form.
|
|
Set reference point to waypoint whose index is passed if user confirms.
|
|
Sort waypoints according to given criteria. If allready sorted following given criteria nothing is done except if s == Current.
|
|
Open application data bases and retrieves preferences. Also loads MathLib library.
|
|
Save preferences, close forms, close app database.
|
|
Switch from current data base to the one whose name is given. If it doesn't exist the new data base is created. Displays message if error.
|
|
Updates variables and list display of main form. Takes into account changes of categories, of items to display,... Updates menus, buttons, title,...
|
|
Updates scrollbar of main list.
|
|
Initial value:
{ DispWpt, dmAllCategories, 0, Alpha, metric, DMM, 0, WGS84Index, 0, DBVersion, GIIPlus, 10,
dmAllCategories, dmAllCategories, dmAllCategories, false, 0, WptDBName, RteDBName, TrkDBName, 0
}
|