X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/bf5cef4139b16cc3d036bb3b7c3495e9653b0a18..4f14a010d0a7d09721c32f0d35ffbeae05ea994c:/src/modules.c diff --git a/src/modules.c b/src/modules.c index f1912b41..41818d5f 100644 --- a/src/modules.c +++ b/src/modules.c @@ -1,7 +1,7 @@ /* * viking -- GPS Data and Topo Analyzer, Explorer, and Manager * - * Copyright (C) 2006-2007, Guilhem Bonnefille + * Copyright (C) 2006-2010, Guilhem Bonnefille * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,21 +31,24 @@ #include "modules.h" +#include "bing.h" +#include "spotmaps.h" #include "google.h" #include "terraserver.h" #include "expedia.h" #include "osm.h" #include "osm-traces.h" #include "bluemarble.h" -#include "openaerial.h" #include "geonames.h" #include "file.h" #include "vikmapslayer.h" #include "vikexttools.h" +#include "vikgoto.h" #include "vikgobjectbuilder.h" #define VIKING_MAPS_FILE "maps.xml" #define VIKING_EXTTOOLS_FILE "external_tools.xml" +#define VIKING_GOTOTOOLS_FILE "goto_tools.xml" static void modules_register_map_source(VikGobjectBuilder *self, GObject *object) @@ -64,6 +67,14 @@ modules_register_exttools(VikGobjectBuilder *self, GObject *object) vik_ext_tools_register (tool); } +static void +modules_register_gototools(VikGobjectBuilder *self, GObject *object) +{ + g_debug (__FUNCTION__); + VikGotoTool *tool = VIK_GOTO_TOOL (object); + vik_goto_register (tool); +} + static void modules_load_config(void) { @@ -86,10 +97,23 @@ modules_load_config(void) vik_gobject_builder_parse (builder, tools); g_object_unref (builder); } + + /* Go-to search engines */ + gchar *go_to = g_build_filename(a_get_viking_dir(), VIKING_GOTOTOOLS_FILE, NULL); + if (g_access (go_to, R_OK) == 0) + { + VikGobjectBuilder *builder = vik_gobject_builder_new (); + g_signal_connect (builder, "new-object", G_CALLBACK (modules_register_gototools), NULL); + vik_gobject_builder_parse (builder, go_to); + g_object_unref (builder); + } } void modules_init() { +#ifdef VIK_CONFIG_BING + bing_init(); +#endif #ifdef VIK_CONFIG_GOOGLE google_init(); #endif @@ -106,13 +130,13 @@ void modules_init() #ifdef VIK_CONFIG_BLUEMARBLE bluemarble_init(); #endif -#ifdef VIK_CONFIG_OPENAERIAL - openaerial_init(); -#endif #ifdef VIK_CONFIG_GEONAMES geonames_init(); #endif - +#ifdef VIK_CONFIG_SPOTMAPS + spotmaps_init(); +#endif + /* As modules are loaded, we can load configuration files */ modules_load_config (); }