00001
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "types.h"
00016
00017 #define GPilotSID 'GPil' // creator ID
00018 #define WptDBType 'Wpts' // type data base de wpts
00019 #define TrkDBType 'Trks' // type data base de rtackpoints
00020 #define RteDBType 'Rtes' // type data base de routes
00021 #define LogDBType 'Logs' // type data base de paquets
00022 #define WptDBName "WptDB-GPil" // nom data base de wpts
00023 #define TrkDBName "TrkDB-GPil" // nom data base de trackpoints
00024 #define RteDBName "RteDB-GPil" // nom data base de routes
00025 #define LogDBName "LogDB-GPil" // nom data base de paquets
00026 #define GPilotSPrefID 0 // preferences ID
00027
00028 #define DBVersion 2 // version number of data bases
00029
00030 #define MaxRecordSize 62000 // taille max que l'on peut raisonablement espérer loger
00031
00032
00033 #define WinDrawChar(theChar, x, y) do{char mw_buf[1];mw_buf[0]=(theChar);WinDrawChars (mw_buf, 1 , (x), (y));}while(0)
00034
00035
00036 #define GTALKDBG_INFOS 128 // informational
00037 #define GTALKDBG_CALLS 32 // procedures calls/exits
00038 #define GTALKDBG_UNEXP 8 // unexpected things
00039
00040 #define LATMAX 0x3fffffffL // latitude max (90°)
00041 #define LATMIN 0xC0000000L // latitude min (-90°)
00042 #define LONMAX 0x7fffffffL // longitude max (180°)
00043 #define LONMIN 0x80000000L // longitude min (-180°)
00044 #define LONMAX23 0x55555554L // 2*180°/3
00045 #define LONMIN23 0xAAAAAAACL // 2*-180°/3
00046 #define DELTALONMAX 0X38E38E38 // 80°
00047
00050 enum ItemToDisplay
00051 {
00052 DispUnknown, DispWpt, DispRte, DispTrk
00053 };
00054 typedef enum ItemToDisplay ItemToDisplay;
00055
00058 enum WptSortCritType
00059 {
00060 Alpha, Dist, Lat, Lon, Symbol, Alt, Bear, Current
00061 };
00062 typedef enum WptSortCritType WptSortCritType;
00063
00066 typedef struct
00067 {
00068 ItemToDisplay todisplay;
00069 UInt logcategory;
00070 Boolean allowduplicate;
00071 WptSortCritType wptsortcrit;
00072 DistanceUnit distunit;
00073 DisplayFormat displaymode;
00074 signed int utcoffset;
00075 unsigned int datum;
00076 unsigned long refptuid;
00077 unsigned int version;
00078 Personality emulatedgps;
00079 unsigned int loginterval;
00080 UInt wptcategory;
00081 UInt trkcategory;
00082 UInt rtecategory;
00083 Boolean selectmode;
00084 UInt32 portid;
00085 char CurWptDBName [dmDBNameLength];
00086 char CurRteDBName [dmDBNameLength];
00087 char CurTrkDBName [dmDBNameLength];
00088 Word PermTrackIndex;
00089 Boolean looseprotocol;
00090 }
00091 PrefType;
00092 extern PrefType Prefs;
00093
00094 extern DmOpenRef CurrentDB,
00095 WptDB,
00096 TrkDB,
00097 RteDB
00098 #ifdef EVENTS
00099 ,LogDB
00100 #endif
00101 ;
00102
00103 extern UInt CurrentRecordIndex;
00104 extern UInt *CurrentCategory;
00105 extern Semicircle_Type CurrentWGS84Pos;
00106 extern char ReferencePtName[];
00107 extern char * BeamTypes[];
00108 extern Semicircle_Type ReferencePt;
00109 extern Boolean OnlyNews,
00110 Furuno,
00111 CompactTracks;
00112
00113 extern Boolean MainListDirty;
00114
00115
00116 enum EditWptMode
00117 {
00118 EditWpt, NewWpt, MarkWpt, FromRefWpt
00119 };
00120 typedef enum EditWptMode EditWptMode;
00121 extern EditWptMode EditMode;
00122 extern const char *DistanceUnitNames[];
00123 extern char gbuf1[512],
00124 gbuf2[128];
00125 extern Boolean MustCallGpslibTicks;
00126
00127 typedef struct
00128 {
00129 unsigned int reserved:16;
00130 unsigned int length:16;
00131 }
00132 RecordSeparator;
00133
00134 #include "sections.h"
00135
00136
00137 #define GErrNoError 0
00138 #define GErrUnsupportedFmt appErrorClass + 1
00139 #define GErrProtocolError appErrorClass + 2
00140 #define GErrNoHandle appErrorClass + 3
00141
00142
00143
00144
00145
00146 extern Boolean EditFormHandleEvent (EventPtr e) EDIT_SECTION;
00147
00148
00149 extern Int CompareWpt (void *p1, void *p2, Int other, SortRecordInfoPtr sp1,
00150 SortRecordInfoPtr sp2, VoidHand aph);
00151 extern void SortWpts (WptSortCritType s);
00152 extern long SearchWptByName (char *name, Boolean exact, Boolean all);
00153 extern int SetReferencePt (UInt index, Boolean ask);
00154
00155 extern void DrawSymbol (unsigned int lid, int x, int y);
00156 extern void MainListDraw (Int16 itemNum, RectanglePtr bounds, CharPtr * itemsText);
00157 extern void SetPreferences (void);
00158 extern Boolean RecIsSecret (DmOpenRef * DBP, UInt16 index);
00159 extern Err SetBackupBit (DmOpenRef * DBP);