]> git.street.me.uk Git - andy/viking.git/blobdiff - src/modules.c
Enable the escape key to remove/reset the ruler tool.
[andy/viking.git] / src / modules.c
index fcd0c5d0fe09d0aac3b4bc6909de5c665ff2e738..41818d5fe68b560381c90d649e9d544c76f45028 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * viking -- GPS Data and Topo Analyzer, Explorer, and Manager
  *
 /*
  * viking -- GPS Data and Topo Analyzer, Explorer, and Manager
  *
- * Copyright (C) 2006-2007, Guilhem Bonnefille <guilhem.bonnefille@gmail.com>
+ * Copyright (C) 2006-2010, Guilhem Bonnefille <guilhem.bonnefille@gmail.com>
  *
  * 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
  *
  * 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
 
 #include "modules.h"
 
 
 #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 "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 "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"
 #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)
 
 static void
 modules_register_map_source(VikGobjectBuilder *self, GObject *object)
@@ -63,6 +67,14 @@ modules_register_exttools(VikGobjectBuilder *self, GObject *object)
   vik_ext_tools_register (tool);
 }
 
   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)
 {
 static void
 modules_load_config(void)
 {
@@ -85,10 +97,23 @@ modules_load_config(void)
        vik_gobject_builder_parse (builder, tools);
        g_object_unref (builder);
   }
        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()
 {
 }
 
 void modules_init()
 {
+#ifdef VIK_CONFIG_BING
+  bing_init();
+#endif
 #ifdef VIK_CONFIG_GOOGLE 
   google_init();
 #endif
 #ifdef VIK_CONFIG_GOOGLE 
   google_init();
 #endif
@@ -105,10 +130,13 @@ void modules_init()
 #ifdef VIK_CONFIG_BLUEMARBLE
   bluemarble_init();
 #endif
 #ifdef VIK_CONFIG_BLUEMARBLE
   bluemarble_init();
 #endif
-#ifdef VIK_CONFIG_OPENAERIAL
-  openaerial_init();
+#ifdef VIK_CONFIG_GEONAMES
+  geonames_init();
+#endif
+#ifdef VIK_CONFIG_SPOTMAPS
+  spotmaps_init();
 #endif
 #endif
-  
+
   /* As modules are loaded, we can load configuration files */
   modules_load_config ();
 }
   /* As modules are loaded, we can load configuration files */
   modules_load_config ();
 }