Top | ![]() |
![]() |
![]() |
![]() |
void | (*BabelStatusFunc) () |
void | a_babel_foreach_file_with_mode () |
void | a_babel_foreach_file_read_any () |
gboolean | a_babel_convert_from () |
gboolean | a_babel_convert_to () |
void | a_babel_init () |
void | a_babel_post_init () |
void | a_babel_uninit () |
gboolean | a_babel_available () |
GPSBabel may not be necessary for everything, one can use shell_command option but this will be OS platform specific
void (*BabelStatusFunc) (BabelProgressCode Param1
,gpointer Param2
,gpointer Param3
);
Callback function.
void a_babel_foreach_file_with_mode (BabelMode mode
,GFunc func
,gpointer user_data
);
void a_babel_foreach_file_read_any (GFunc func
,gpointer user_data
);
Run a function on all file formats with any kind of read method (which is almost all but not quite - e.g. with GPSBabel v1.4.4 - PalmDoc is write only waypoints)
gboolean a_babel_convert_from (VikTrwLayer *vt
,ProcessOptions *process_options
,BabelStatusFunc cb
,gpointer user_data
,DownloadFileOptions *download_options
);
Loads data into a trw layer from a file, using gpsbabel. This routine is synchronous; that is, it will block the calling program until the conversion is done. To avoid blocking, call this routine from a worker thread.
vt |
The TRW layer to place data into. Duplicate items will be overwritten. |
|
process_options |
The options to control the appropriate processing function. See ProcessOptions for more detail |
|
cb |
Optional callback function. Same usage as in |
|
user_data |
passed along to cb |
|
download_options |
If downloading from a URL use these options (may be NULL) |
gboolean a_babel_convert_to (VikTrwLayer *vt
,VikTrack *track
,const char *babelargs
,const char *file
,BabelStatusFunc cb
,gpointer user_data
);
Exports data using gpsbabel. This routine is synchronous; that is, it will block the calling program until the conversion is done. To avoid blocking, call this routine from a worker thread.
vt |
The TRW layer from which data is taken. |
|
track |
Operate on the individual track if specified. Use NULL when operating on a TRW layer |
|
babelargs |
A string containing gpsbabel output command line options. (i.e. must the contain '-o' file type and possibly any filter parameters) |
|
to |
Filename or device the data is written to. |
|
cb |
Optional callback function. Same usage as in a_babel_convert. |
|
user_data |
passed along to cb |
void
a_babel_post_init ();
Initialises babel module. Mainly check existence of gpsbabel progam and load all features available in that version.
Used when calling BabelStatusFunc.
a line of diagnostic output is available. The pointer is to a NULL-terminated line of diagnostic output from gpsbabel. |
||
gpsbabel finished, or |
typedef struct { gchar* babelargs; // The standard initial arguments to gpsbabel (if gpsbabel is to be used) - normally should include the input file type (-i) option. gchar* filename; // Input filename (or device port e.g. /dev/ttyS0) gchar* input_file_type; // If NULL then uses internal file format handler (GPX only ATM), otherwise specify gpsbabel input type like "kml","tcx", etc... gchar* url; // URL input rather than a filename gchar* babel_filters; // Optional filter arguments to gpsbabel gchar* shell_command; // Optional shell command to run instead of gpsbabel - but will be (Unix) platform specific } ProcessOptions;
All values are defaulted to NULL
Need to specify at least one of babelargs, URL or shell_command
typedef struct { unsigned waypointsRead : 1; unsigned waypointsWrite : 1; unsigned tracksRead : 1; unsigned tracksWrite : 1; unsigned routesRead : 1; unsigned routesWrite : 1; } BabelMode;
Store the Read/Write support offered by gpsbabel for a given format.
typedef struct { BabelMode mode; gchar *name; gchar *label; } BabelDevice;
Representation of a supported device.