]> git.street.me.uk Git - andy/viking.git/blame - src/babel.h
Fix drawing of copied MBTiles map layers.
[andy/viking.git] / src / babel.h
CommitLineData
1d1bc3c1
EB
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
a25c4c50
GB
26#include <glib.h>
27
28#include "viktrwlayer.h"
512bc836 29#include "download.h"
a25c4c50 30
722b5481
RN
31G_BEGIN_DECLS
32
072cbb13
GB
33/**
34 * BabelProgressCode:
35 * @BABEL_DIAG_OUTPUT: a line of diagnostic output is available. The pointer is to a
36 * NULL-terminated line of diagnostic output from gpsbabel.
37 * @BABEL_DONE: gpsbabel finished, or %NULL if no callback is needed.
38 *
39 * Used when calling #BabelStatusFunc.
40 */
1d1bc3c1
EB
41typedef enum {
42 BABEL_DIAG_OUTPUT,
43 BABEL_DONE,
44} BabelProgressCode;
45
072cbb13
GB
46/**
47 * BabelStatusFunc:
48 *
49 * Callback function.
50 */
7b3479e3 51typedef void (*BabelStatusFunc)(BabelProgressCode, gpointer, gpointer);
1d1bc3c1 52
79e0f36e
GB
53/**
54 * BabelMode:
55 *
56 * Store the Read/Write support offered by gpsbabel for a given format.
57 */
58typedef struct {
59 unsigned waypointsRead : 1;
60 unsigned waypointsWrite : 1;
61 unsigned tracksRead : 1;
62 unsigned tracksWrite : 1;
63 unsigned routesRead : 1;
64 unsigned routesWrite : 1;
65} BabelMode;
66
67/**
68 * BabelDevice:
69 * @name: gpsbabel's identifier of the device
70 * @label: human readable label
71 *
72 * Representation of a supported device.
73 */
74typedef struct {
75 BabelMode mode;
76 gchar *name;
77 gchar *label;
78} BabelDevice;
79
80/**
81 * BabelFile:
c6acf18d 82 * @name: gpsbabel's identifier of the format
79e0f36e
GB
83 * @ext: file's extension for this format
84 * @label: human readable label
85 *
86 * Representation of a supported file format.
87 */
88typedef struct {
89 BabelMode mode;
90 gchar *name;
91 gchar *ext;
92 gchar *label;
93} BabelFile;
94
95GList *a_babel_file_list;
96GList *a_babel_device_list;
97
b666a8ba 98void a_babel_foreach_file_with_mode (BabelMode mode, GFunc func, gpointer user_data);
2f5f0fb8 99void a_babel_foreach_file_read_any (GFunc func, gpointer user_data);
b666a8ba 100
ed691ed1 101gboolean a_babel_convert( VikTrwLayer *vt, const char *babelargs, BabelStatusFunc cb, gpointer user_data, gpointer options );
ef466336 102gboolean a_babel_convert_from_filter( VikTrwLayer *vt, const char *babelargs, const char *file, const char *babelfilters, BabelStatusFunc cb, gpointer user_data, gpointer options );
ed691ed1
RN
103gboolean a_babel_convert_from( VikTrwLayer *vt, const char *babelargs, const char *file, BabelStatusFunc cb, gpointer user_data, gpointer options );
104gboolean a_babel_convert_from_shellcommand ( VikTrwLayer *vt, const char *input_cmd, const char *input_file_type, BabelStatusFunc cb, gpointer user_data, gpointer options );
ef466336 105gboolean a_babel_convert_from_url_filter ( VikTrwLayer *vt, const char *url, const char *input_type, const char *filter, BabelStatusFunc cb, gpointer user_data, DownloadMapOptions *options );
ed691ed1 106gboolean a_babel_convert_from_url ( VikTrwLayer *vt, const char *url, const char *input_type, BabelStatusFunc cb, gpointer user_data, DownloadMapOptions *options );
7f95fd54 107gboolean a_babel_convert_from_url_or_shell ( VikTrwLayer *vt, const char *input, const char *input_type, BabelStatusFunc cb, gpointer user_data, DownloadMapOptions *options );
6f94db6d 108gboolean a_babel_convert_to( VikTrwLayer *vt, VikTrack *track, const char *babelargs, const char *file, BabelStatusFunc cb, gpointer user_data );
8cf048bd 109
18ec873d
GB
110void a_babel_init ();
111void a_babel_uninit ();
112
430a37a9
GB
113gboolean a_babel_available ();
114
722b5481
RN
115G_END_DECLS
116
1d1bc3c1 117#endif