]> git.street.me.uk Git - andy/viking.git/blobdiff - src/acquire.h
Add a preference to control the number of recent files made available.
[andy/viking.git] / src / acquire.h
index e5fffb1051afe5183cc65a401e51aad70456431d..731a7bbec4b8eceeb8e5c03bf7d20e1e6402f7c2 100644 (file)
@@ -33,6 +33,13 @@ G_BEGIN_DECLS
 
 typedef struct _VikDataSourceInterface VikDataSourceInterface;
 
 
 typedef struct _VikDataSourceInterface VikDataSourceInterface;
 
+typedef struct {
+  VikWindow *vw;
+  VikLayersPanel *vlp;
+  VikViewport *vvp;
+  gpointer userdata;
+} acq_vik_t;
+
 /**
  * acq_dialog_widgets_t:
  *
 /**
  * acq_dialog_widgets_t:
  *
@@ -44,14 +51,15 @@ typedef struct {
   VikLayersPanel *vlp;
   VikViewport *vvp;
   GtkWidget *dialog;
   VikLayersPanel *vlp;
   VikViewport *vvp;
   GtkWidget *dialog;
-  gboolean ok; /* if OK is false when we exit, we MUST free w */
+  gboolean running;
   VikDataSourceInterface *source_interface;
   gpointer user_data;
 } acq_dialog_widgets_t;
 
 typedef enum {
   VIK_DATASOURCE_CREATENEWLAYER,
   VikDataSourceInterface *source_interface;
   gpointer user_data;
 } acq_dialog_widgets_t;
 
 typedef enum {
   VIK_DATASOURCE_CREATENEWLAYER,
-  VIK_DATASOURCE_ADDTOLAYER
+  VIK_DATASOURCE_ADDTOLAYER,
+  VIK_DATASOURCE_MANUAL_LAYER_MANAGEMENT,
 } vik_datasource_mode_t;
 /* TODO: replace track/layer? */
 
 } vik_datasource_mode_t;
 /* TODO: replace track/layer? */
 
@@ -67,7 +75,7 @@ typedef enum {
  * 
  * Returns: pointer to state if OK, otherwise %NULL
  */
  * 
  * Returns: pointer to state if OK, otherwise %NULL
  */
-typedef gpointer (*VikDataSourceInitFunc) ();
+typedef gpointer (*VikDataSourceInitFunc) ( acq_vik_t *avt );
 
 /**
  * VikDataSourceCheckExistenceFunc:
 
 /**
  * VikDataSourceCheckExistenceFunc:
@@ -88,20 +96,27 @@ typedef void (*VikDataSourceAddSetupWidgetsFunc) ( GtkWidget *dialog, VikViewpor
  * @user_data: provided by #VikDataSourceInterface.init_func or dialog with params
  * @args: the arguments computed for #VikDataSourceInterface.process_func
  * @extra: extra arguments for #VikDataSourceInterface.process_func
  * @user_data: provided by #VikDataSourceInterface.init_func or dialog with params
  * @args: the arguments computed for #VikDataSourceInterface.process_func
  * @extra: extra arguments for #VikDataSourceInterface.process_func
+ * @options: even more options for #VikDataSourceInterface.process_func
  * 
  * set both to %NULL to signal refusal (ie already downloading).
  */
  * 
  * set both to %NULL to signal refusal (ie already downloading).
  */
-typedef void (*VikDataSourceGetCmdStringFunc) ( gpointer user_data, gchar **args, gchar **extra );
+typedef void (*VikDataSourceGetCmdStringFunc) ( gpointer user_data, gchar **args, gchar **extra, gpointer options );
 
 typedef void (*VikDataSourceGetCmdStringFuncWithInput) ( gpointer user_data, gchar **babelargs_or_shellcmd, gchar **inputfile_or_inputtype, const gchar *input_file_name );
 typedef void (*VikDataSourceGetCmdStringFuncWithInputInput) ( gpointer user_data, gchar **babelargs_or_shellcmd, gchar **inputfile_or_inputtype, const gchar *input_file_name, const gchar *input_track_file_name );
 
 /**
  * VikDataSourceProcessFunc:
 
 typedef void (*VikDataSourceGetCmdStringFuncWithInput) ( gpointer user_data, gchar **babelargs_or_shellcmd, gchar **inputfile_or_inputtype, const gchar *input_file_name );
 typedef void (*VikDataSourceGetCmdStringFuncWithInputInput) ( gpointer user_data, gchar **babelargs_or_shellcmd, gchar **inputfile_or_inputtype, const gchar *input_file_name, const gchar *input_track_file_name );
 
 /**
  * VikDataSourceProcessFunc:
+ * @vtl:
+ * @cmd: the arguments computed by #VikDataSourceInterface.get_cmd_string_func
+ * @extra: the extra arguments computed by #VikDataSourceInterface.get_cmd_string_func
+ * @status_cb: the #VikDataSourceInterface.progress_func
+ * @adw: the widgets and data used by #VikDataSourceInterface.progress_func
+ * @options: more options returned by #VikDataSourceInterface.get_cmd_string_func
  * 
  * The actual function to do stuff - must report success/failure.
  */
  * 
  * The actual function to do stuff - must report success/failure.
  */
-typedef gboolean (*VikDataSourceProcessFunc)  ( gpointer vtl, const gchar *cmd, const gchar *extra, BabelStatusFunc status_cb, acq_dialog_widgets_t *adw );
+typedef gboolean (*VikDataSourceProcessFunc)  ( gpointer vtl, const gchar *cmd, const gchar *extra, BabelStatusFunc status_cb, acq_dialog_widgets_t *adw, gpointer options );
 
 /* */
 typedef void  (*VikDataSourceProgressFunc)  ( BabelProgressCode c, gpointer data, acq_dialog_widgets_t *w );
 
 /* */
 typedef void  (*VikDataSourceProgressFunc)  ( BabelProgressCode c, gpointer data, acq_dialog_widgets_t *w );
@@ -122,6 +137,11 @@ typedef void (*VikDataSourceCleanupFunc) ( gpointer user_data );
 
 typedef void (*VikDataSourceOffFunc) ( gpointer user_data, gchar **babelargs_or_shellcmd, gchar **inputfile_or_inputtype );;
 
 
 typedef void (*VikDataSourceOffFunc) ( gpointer user_data, gchar **babelargs_or_shellcmd, gchar **inputfile_or_inputtype );;
 
+/**
+ * VikDataSourceInterface:
+ * 
+ * Main interface.
+ */
 struct _VikDataSourceInterface {
   const gchar *window_title;
   const gchar *layer_title;
 struct _VikDataSourceInterface {
   const gchar *window_title;
   const gchar *layer_title;
@@ -130,6 +150,7 @@ struct _VikDataSourceInterface {
   gboolean autoview;
   gboolean keep_dialog_open; /* when done */
 
   gboolean autoview;
   gboolean keep_dialog_open; /* when done */
 
+  gboolean is_thread;
 
   /*** Manual UI Building ***/
   VikDataSourceInitFunc init_func;
 
   /*** Manual UI Building ***/
   VikDataSourceInitFunc init_func;
@@ -156,11 +177,10 @@ struct _VikDataSourceInterface {
 
 };
 
 
 };
 
-/**********************************/
-/**********************************/
 /**********************************/
 
 /**********************************/
 
-void a_acquire ( VikWindow *vw, VikLayersPanel *vlp, VikViewport *vvp, VikDataSourceInterface *source_interface );
+void a_acquire ( VikWindow *vw, VikLayersPanel *vlp, VikViewport *vvp, VikDataSourceInterface *source_interface,
+                 gpointer userdata, VikDataSourceCleanupFunc cleanup_function );
 
 GtkWidget *a_acquire_trwlayer_menu (VikWindow *vw, VikLayersPanel *vlp, VikViewport *vvp, VikTrwLayer *vtl);
 
 
 GtkWidget *a_acquire_trwlayer_menu (VikWindow *vw, VikLayersPanel *vlp, VikViewport *vvp, VikTrwLayer *vtl);