Main Page | Alphabetical List | Data Structures | File List | Globals | Related Pages

gtalk.h

Go to the documentation of this file.
00001 
00007 /*
00008    Copyright (C) 1999-2004 Christian Claveleira (Christian.Claveleira@cru.fr)
00009 
00010    $Id: gtalk.h,v 1.22 2004/11/17 21:06:01 clavelei Exp $ 
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 // wrapper pour compatibilite 3.0 :
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 /* Debugging : */
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;   /* critere de tri */
00063 
00066 typedef struct
00067 {
00068     ItemToDisplay todisplay;           /* dernier type données affichées (bytes 1-2) */
00069     UInt logcategory;                  /* last log category    (bytes 3-4) */
00070     Boolean allowduplicate;            /* +sieurs noms identiques autorisés ? (byte 5) */
00071     WptSortCritType wptsortcrit;       /* critere de tri (byte 6) */
00072     DistanceUnit distunit;             /* unité d'affichage de distance (byte 7) */
00073     DisplayFormat displaymode;         /* mode d'affichage               */
00074     signed int utcoffset;              /* offset heure locale <-> UTC (mn)     */
00075     unsigned int datum;                /* datum index                     */
00076     unsigned long refptuid;            /* uid du point de reference       */
00077     unsigned int version;              /* version number                  */
00078     Personality emulatedgps;           /* emulated GPS                   */
00079     unsigned int loginterval;          /* logging interval in s              */
00080     UInt wptcategory;                  /* last waypoint category */
00081     UInt trkcategory;                  /* last track category */
00082     UInt rtecategory;                  /* last route category */
00083     Boolean selectmode;                /* selection mode */
00084     UInt32 portid;                     /* serial port id */
00085     char CurWptDBName [dmDBNameLength]; /* current waypoint data base name */
00086     char CurRteDBName [dmDBNameLength]; /* current route data base name */
00087     char CurTrkDBName [dmDBNameLength]; /* current track data base name */
00088     Word PermTrackIndex;               /* permanent track index + 1 */
00089     Boolean looseprotocol;             /* relaxed protocol */
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;  /* type d'operation d'edition */
00121 extern EditWptMode EditMode;
00122 extern const char *DistanceUnitNames[];      /* defini dans gtalk.c */
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;            /* length of next object */
00131 }
00132 RecordSeparator;
00133 
00134 #include "sections.h"
00135 
00136 /* Code d'erreurs : */
00137 #define GErrNoError 0
00138 #define GErrUnsupportedFmt appErrorClass + 1
00139 #define GErrProtocolError appErrorClass + 2
00140 #define GErrNoHandle appErrorClass + 3
00141 
00142 /* prototypes : */
00143 
00144 /* editwpt.c */
00145 
00146 extern Boolean EditFormHandleEvent (EventPtr e) EDIT_SECTION;
00147 
00148 /* gtalk.c */
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 //extern Boolean DrawRoute (UInt index, Boolean rescale, Semicircle_Type * position);
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);

Generated on Sun Mar 13 09:36:01 2005 for GPilotS by doxygen 1.3.6