2 * viking -- GPS Data and Topo Analyzer, Explorer, and Manager
4 * Copyright (C) 2006-2007, Guilhem Bonnefille <guilhem.bonnefille@gmail.com>
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
27 #include <glib/gstdio.h>
35 #include "terraserver.h"
38 #include "osm-traces.h"
39 #include "bluemarble.h"
40 #include "openaerial.h"
43 #include "vikmapslayer.h"
44 #include "vikexttools.h"
45 #include "vikgobjectbuilder.h"
47 #define VIKING_MAPS_FILE "maps.xml"
48 #define VIKING_EXTTOOLS_FILE "external_tools.xml"
51 modules_register_map_source(VikGobjectBuilder *self, GObject *object)
53 g_debug (__FUNCTION__);
54 VikMapSource *mapsource = VIK_MAP_SOURCE (object);
55 /* FIXME label should be hosted by object */
56 maps_layer_register_map_source (mapsource);
60 modules_register_exttools(VikGobjectBuilder *self, GObject *object)
62 g_debug (__FUNCTION__);
63 VikExtTool *tool = VIK_EXT_TOOL (object);
64 vik_ext_tools_register (tool);
68 modules_load_config(void)
71 gchar *maps = g_build_filename(a_get_viking_dir(), VIKING_MAPS_FILE, NULL);
72 if (g_access (maps, R_OK) == 0)
74 VikGobjectBuilder *builder = vik_gobject_builder_new ();
75 g_signal_connect (builder, "new-object", G_CALLBACK (modules_register_map_source), NULL);
76 vik_gobject_builder_parse (builder, maps);
77 g_object_unref (builder);
81 gchar *tools = g_build_filename(a_get_viking_dir(), VIKING_EXTTOOLS_FILE, NULL);
82 if (g_access (tools, R_OK) == 0)
84 VikGobjectBuilder *builder = vik_gobject_builder_new ();
85 g_signal_connect (builder, "new-object", G_CALLBACK (modules_register_exttools), NULL);
86 vik_gobject_builder_parse (builder, tools);
87 g_object_unref (builder);
93 #ifdef VIK_CONFIG_GOOGLE
96 #ifdef VIK_CONFIG_EXPEDIA
99 #ifdef VIK_CONFIG_TERRASERVER
102 #ifdef VIK_CONFIG_OPENSTREETMAP
106 #ifdef VIK_CONFIG_BLUEMARBLE
109 #ifdef VIK_CONFIG_OPENAERIAL
112 #ifdef VIK_CONFIG_GEONAMES
116 /* As modules are loaded, we can load configuration files */
117 modules_load_config ();