2 * viking -- GPS Data and Topo Analyzer, Explorer, and Manager
4 * Copyright (C) 2003-2005, Evan Battaglia <gtoevan@gmx.net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef _VIKING_ACQUIRE_H
23 #define _VIKING_ACQUIRE_H
25 /* global data structure used to expose the progress dialog to the worker thread */
32 gboolean ok; /* if OK is false when we exit, we MUST free w */
33 gpointer specific_data;
34 } acq_dialog_widgets_t;
36 typedef enum { VIK_DATASOURCE_GPSBABEL_DIRECT, VIK_DATASOURCE_SHELL_CMD } vik_datasource_type_t;
38 typedef gpointer (*VikDataSourceAddWidgetsFunc) ( GtkWidget *dialog );
40 /* if VIK_DATASOURCE_GPSBABEL_DIRECT, babelargs and inputfile.
41 if VIK_DATASOURCE_SHELL_CMD, shellcmd and inputtype.
42 set both to NULL to signal refusal (ie already downloading) */
43 typedef void (*VikDataSourceGetCmdStringFunc) ( gpointer widgets_data, gchar **babelargs_or_shellcmd, gchar **inputfile_or_inputtype );
44 typedef void (*VikDataSourceFirstCleanupFunc) ( gpointer widgets_data );
45 typedef void (*VikDataSourceProgressFunc) (gpointer c, gpointer data, acq_dialog_widgets_t *w);
46 typedef gpointer (*VikDataSourceAddProgressWidgetsFunc) ( GtkWidget *dialog );
47 typedef void (*VikDataSourceCleanupFunc) ( gpointer progress_widgets_data );
50 const gchar *layer_title;
51 vik_datasource_type_t type;
53 VikDataSourceAddWidgetsFunc add_widgets_func; /* NULL if no first dialog */
54 VikDataSourceGetCmdStringFunc get_cmd_string_func; /* passed rv from above */
55 VikDataSourceFirstCleanupFunc first_cleanup_func; /* frees rv from addwidgets */
57 VikDataSourceProgressFunc progress_func;
58 VikDataSourceAddProgressWidgetsFunc add_progress_widgets_func;
59 VikDataSourceCleanupFunc cleanup_func;
60 } VikDataSourceInterface;
63 void a_acquire ( VikWindow *vw, VikLayersPanel *vlp, VikViewport *vvp, VikDataSourceInterface *interface );