]> git.street.me.uk Git - andy/viking.git/blob - src/babel.h
Tidy up variable names
[andy/viking.git] / src / babel.h
1 /*
2  * viking -- GPS Data and Topo Analyzer, Explorer, and Manager
3  *
4  * Copyright (C) 2003-2005, Evan Battaglia <gtoevan@gmx.net>
5  * Copyright (C) 2005, Alex Foobarian <foobarian@gmail.com>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  *
21  */
22
23 #ifndef _VIKING_BABEL_H
24 #define _VIKING_BABEL_H
25
26 #include <glib.h>
27
28 #include "viktrwlayer.h"
29
30 /**
31  * BabelProgressCode:
32  * @BABEL_DIAG_OUTPUT: a line of diagnostic output is available. The pointer is to a 
33  *                     NULL-terminated line of diagnostic output from gpsbabel.
34  * @BABEL_DONE: gpsbabel finished, or %NULL if no callback is needed.
35  *
36  * Used when calling #BabelStatusFunc.
37  */
38 typedef enum {
39   BABEL_DIAG_OUTPUT,
40   BABEL_DONE,
41 } BabelProgressCode;
42
43 /**
44  * BabelStatusFunc:
45  *
46  * Callback function.
47  */
48 typedef void (*BabelStatusFunc)(BabelProgressCode, gpointer, gpointer);
49
50 /**
51  * BabelMode:
52  * 
53  * Store the Read/Write support offered by gpsbabel for a given format.
54  */
55 typedef struct {
56     unsigned waypointsRead : 1;
57     unsigned waypointsWrite : 1;
58     unsigned tracksRead : 1;
59     unsigned tracksWrite : 1;
60     unsigned routesRead : 1;
61     unsigned routesWrite : 1;
62 } BabelMode;
63
64 /**
65  * BabelDevice:
66  * @name: gpsbabel's identifier of the device
67  * @label: human readable label
68  * 
69  * Representation of a supported device.
70  */
71 typedef struct {
72     BabelMode mode;
73     gchar *name;
74     gchar *label;
75 } BabelDevice;
76
77 /**
78  * BabelFile:
79  * @name: gpsbabel's identifier of the device
80  * @ext: file's extension for this format
81  * @label: human readable label
82  * 
83  * Representation of a supported file format.
84  */
85 typedef struct {
86     BabelMode mode;
87     gchar *name;
88     gchar *ext;
89     gchar *label;
90 } BabelFile;
91
92 GList *a_babel_file_list;
93 GList *a_babel_device_list;
94
95 gboolean a_babel_convert( VikTrwLayer *vt, const char *babelargs, BabelStatusFunc cb, gpointer user_data );
96 gboolean a_babel_convert_from( VikTrwLayer *vt, const char *babelargs, const char *file, BabelStatusFunc cb, gpointer user_data );
97 gboolean a_babel_convert_from_shellcommand ( VikTrwLayer *vt, const char *input_cmd, const char *input_file_type, BabelStatusFunc cb, gpointer user_data );
98 gboolean a_babel_convert_from_url ( VikTrwLayer *vt, const char *url, const char *input_type, BabelStatusFunc cb, gpointer user_data );
99 gboolean a_babel_convert_to( VikTrwLayer *vt, const char *babelargs, const char *file, BabelStatusFunc cb, gpointer user_data );
100
101 void a_babel_init ();
102 void a_babel_uninit ();
103
104 #endif