VikDataSource

VikDataSource

Functions

Types and Values

Description

Functions

VikDataSourceInitFunc ()

gpointer
(*VikDataSourceInitFunc) (acq_vik_t *avt);

Returns

pointer to state if OK, otherwise NULL


VikDataSourceCheckExistenceFunc ()

gchar *
(*VikDataSourceCheckExistenceFunc) ();

Returns

NULL if OK, otherwise returns an error message.


VikDataSourceAddSetupWidgetsFunc ()

void
(*VikDataSourceAddSetupWidgetsFunc) (GtkWidget *dialog,
                                     VikViewport *vvp,
                                     gpointer user_data);

Create widgets to show in a setup dialog, set up state via user_data.


VikDataSourceGetProcessOptionsFunc ()

void
(*VikDataSourceGetProcessOptionsFunc) (gpointer user_data,
                                       ProcessOptions *process_options,
                                       gpointer download_options,
                                       const gchar *input_file_name,
                                       const gchar *input_track_file_name);

set both to NULL to signal refusal (ie already downloading).

Parameters

user_data

provided by VikDataSourceInterface.init_func or dialog with params

 

process_options

main options controlling the behaviour of VikDataSourceInterface.process_func

 

download_options

optional options for downloads from URLs for VikDataSourceInterface.process_func

 

VikDataSourceProcessFunc ()

gboolean
(*VikDataSourceProcessFunc) (gpointer vtl,
                             ProcessOptions *process_options,
                             BabelStatusFunc Param3,
                             acq_dialog_widgets_t *adw,
                             gpointer download_options);

The actual function to do stuff - must report success/failure.

Parameters

process_options

options to control the behaviour of this function (see ProcessOptions)

 

status_cb

the VikDataSourceInterface.progress_func

 

adw

the widgets and data used by VikDataSourceInterface.progress_func

 

download_options

Optional options used if downloads from URLs is used.

 

VikDataSourceProgressFunc ()

void
(*VikDataSourceProgressFunc) (BabelProgressCode c,
                              gpointer data,
                              acq_dialog_widgets_t *w);

VikDataSourceAddProgressWidgetsFunc ()

void
(*VikDataSourceAddProgressWidgetsFunc)
                               (GtkWidget *dialog,
                                gpointer user_data);

Creates widgets to show in a progress dialog, may set up state via user_data.


VikDataSourceCleanupFunc ()

void
(*VikDataSourceCleanupFunc) (gpointer user_data);

Frees any widgets created for the setup or progress dialogs, any allocated state, etc.


VikDataSourceOffFunc ()

void
(*VikDataSourceOffFunc) (gpointer user_data,
                         gchar **babelargs,
                         gchar **file_descriptor);

a_acquire ()

void
a_acquire (VikWindow *vw,
           VikLayersPanel *vlp,
           VikViewport *vvp,
           vik_datasource_mode_t mode,
           VikDataSourceInterface *source_interface,
           gpointer userdata,
           VikDataSourceCleanupFunc cleanup_function);

Process the given VikDataSourceInterface for sources with no input data.

Parameters

vw

The VikWindow to work with

 

vlp

The VikLayersPanel in which a VikTrwLayer layer may be created/appended

 

vvp

The VikViewport defining the current view

 

mode

How layers should be managed

 

source_interface

The VikDataSourceInterface determining how and what actions to take

 

userdata

External data to be passed into the VikDataSourceInterface

 

cleanup_function

The function to dispose the VikDataSourceInterface if necessary

 

a_acquire_trwlayer_menu ()

GtkWidget *
a_acquire_trwlayer_menu (VikWindow *vw,
                         VikLayersPanel *vlp,
                         VikViewport *vvp,
                         VikTrwLayer *vtl);

Create a sub menu intended for rightclicking on a TRWLayer's menu called "Filter".

Returns

NULL if no filters.


a_acquire_trwlayer_track_menu ()

GtkWidget *
a_acquire_trwlayer_track_menu (VikWindow *vw,
                               VikLayersPanel *vlp,
                               VikViewport *vvp,
                               VikTrwLayer *vtl);

Create a sub menu intended for rightclicking on a TRWLayer's menu called "Filter with Track "TRACKNAME"...".

Returns

NULL if no filters or no filter track has been set.


a_acquire_track_menu ()

GtkWidget *
a_acquire_track_menu (VikWindow *vw,
                      VikLayersPanel *vlp,
                      VikViewport *vvp,
                      VikTrack *tr);

Create a sub menu intended for rightclicking on a track's menu called "Filter".

Returns

NULL if no applicable filters


a_acquire_set_filter_track ()

void
a_acquire_set_filter_track (VikTrack *tr);

Sets application-wide track to use with filter. references the track.

Types and Values

acq_vik_t

typedef struct {
  VikWindow *vw;
  VikLayersPanel *vlp;
  VikViewport *vvp;
  gpointer userdata;
} acq_vik_t;

acq_dialog_widgets_t

typedef struct {
  GtkWidget *status;
  VikWindow *vw;
  VikLayersPanel *vlp;
  VikViewport *vvp;
  GtkWidget *dialog;
  gboolean running;
  VikDataSourceInterface *source_interface;
  gpointer user_data;
} acq_dialog_widgets_t;

global data structure used to expose the progress dialog to the worker thread.


enum vik_datasource_mode_t

Members

VIK_DATASOURCE_CREATENEWLAYER

   

VIK_DATASOURCE_ADDTOLAYER

   

VIK_DATASOURCE_AUTO_LAYER_MANAGEMENT

   

VIK_DATASOURCE_MANUAL_LAYER_MANAGEMENT

   

enum vik_datasource_inputtype_t

Members

VIK_DATASOURCE_INPUTTYPE_NONE

   

VIK_DATASOURCE_INPUTTYPE_TRWLAYER

   

VIK_DATASOURCE_INPUTTYPE_TRACK

   

VIK_DATASOURCE_INPUTTYPE_TRWLAYER_TRACK

   

struct VikDataSourceInterface

struct VikDataSourceInterface {
  const gchar *window_title;
  const gchar *layer_title;
  vik_datasource_mode_t mode;
  vik_datasource_inputtype_t inputtype;
  gboolean autoview;
  gboolean keep_dialog_open; /* when done */

  gboolean is_thread;

  /*** Manual UI Building ***/
  VikDataSourceInitFunc init_func;
  VikDataSourceCheckExistenceFunc check_existence_func;
  VikDataSourceAddSetupWidgetsFunc add_setup_widgets_func;

  /***                    ***/

  VikDataSourceGetProcessOptionsFunc get_process_options_func;

  VikDataSourceProcessFunc process_func;

  VikDataSourceProgressFunc progress_func;
  VikDataSourceAddProgressWidgetsFunc add_progress_widgets_func;
  VikDataSourceCleanupFunc cleanup_func;
  VikDataSourceOffFunc off_func;

  /*** UI Building        ***/
  VikLayerParam *                   params;
  guint16                           params_count;
  VikLayerParamData *               params_defaults;
  gchar **                          params_groups;
  guint8                            params_groups_count;
};

Main interface.