2 * viking -- GPS Data and Topo Analyzer, Explorer, and Manager
4 * Copyright (C) 2003-2005, Evan Battaglia <gtoevan@gmx.net>
5 * Copyright (C) 2005, Alex Foobarian <foobarian@gmail.com>
6 * Copyright (C) 2015, Rob Norris <rw_norris@hotmail.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #ifndef _VIKING_BABEL_H
25 #define _VIKING_BABEL_H
29 #include "viktrwlayer.h"
36 * @BABEL_DIAG_OUTPUT: a line of diagnostic output is available. The pointer is to a
37 * NULL-terminated line of diagnostic output from gpsbabel.
38 * @BABEL_DONE: gpsbabel finished, or %NULL if no callback is needed.
40 * Used when calling #BabelStatusFunc.
52 typedef void (*BabelStatusFunc)(BabelProgressCode, gpointer, gpointer);
57 * All values are defaulted to NULL
59 * Need to specify at least one of babelargs, URL or shell_command
62 gchar* babelargs; // The standard initial arguments to gpsbabel (if gpsbabel is to be used) - normally should include the input file type (-i) option.
63 gchar* filename; // Input filename (or device port e.g. /dev/ttyS0)
64 gchar* input_file_type; // If NULL then uses internal file format handler (GPX only ATM), otherwise specify gpsbabel input type like "kml","tcx", etc...
65 gchar* url; // URL input rather than a filename
66 gchar* babel_filters; // Optional filter arguments to gpsbabel
67 gchar* shell_command; // Optional shell command to run instead of gpsbabel - but will be (Unix) platform specific
73 * Store the Read/Write support offered by gpsbabel for a given format.
76 unsigned waypointsRead : 1;
77 unsigned waypointsWrite : 1;
78 unsigned tracksRead : 1;
79 unsigned tracksWrite : 1;
80 unsigned routesRead : 1;
81 unsigned routesWrite : 1;
86 * @name: gpsbabel's identifier of the device
87 * @label: human readable label
89 * Representation of a supported device.
99 * @name: gpsbabel's identifier of the format
100 * @ext: file's extension for this format
101 * @label: human readable label
103 * Representation of a supported file format.
112 GList *a_babel_file_list;
113 GList *a_babel_device_list;
115 void a_babel_foreach_file_with_mode (BabelMode mode, GFunc func, gpointer user_data);
116 void a_babel_foreach_file_read_any (GFunc func, gpointer user_data);
118 // NB needs to match typedef VikDataSourceProcessFunc in acquire.h
119 gboolean a_babel_convert_from ( VikTrwLayer *vt, ProcessOptions *process_options, BabelStatusFunc cb, gpointer user_data, gpointer download_options );
121 gboolean a_babel_convert_to( VikTrwLayer *vt, VikTrack *track, const char *babelargs, const char *file, BabelStatusFunc cb, gpointer user_data );
123 void a_babel_init ();
124 void a_babel_post_init ();
125 void a_babel_uninit ();
127 gboolean a_babel_available ();