]> mj.ucw.cz Git - leo.git/blobdiff - map.h
TODO
[leo.git] / map.h
diff --git a/map.h b/map.h
index 127d30ac4cb8294a2b61d6ab730a379107a44e28..8478af133c8244faae014e2bda4a3ef09a96a485 100644 (file)
--- a/map.h
+++ b/map.h
@@ -1,23 +1,52 @@
 /*
  *     Hic Est Leo -- Global Map Operations
  *
- *     (c) 2014 Martin Mares <mj@ucw.cz>
+ *     (c) 2014--2015 Martin Mares <mj@ucw.cz>
  */
 
 #ifndef _LEO_MAP_H
 #define _LEO_MAP_H
 
+#include "svg.h"
+
 /* Map configuration */
 
 extern double map_min_x, map_min_y;
 extern double map_max_x, map_max_y;
 extern double page_width, page_height;
 extern uns map_clip, map_rotate, map_draw_border;
-extern char *map_xml_input;
 extern char *map_projection;
-extern char *map_style_sheet;
 extern char *map_svg_output;
 
+// Remember to update map.c:map_formats
+enum data_source_type {
+  DATA_SOURCE_INVALID,
+  DATA_SOURCE_OSMXML,
+  DATA_SOURCE_FIXED,
+  DATA_SOURCE_SHAPE,
+};
+
+struct data_source {
+  cnode n;
+  // Configuration
+  char *file;
+  int format;
+  clist styles;                // of data_source_style
+  int inline_styles;
+  // Runtime
+  struct osm *osm;
+};
+
+struct data_source_style {
+  cnode n;
+  // Configuration
+  char *name;
+  // Runtime
+  struct css_sheet *css;
+};
+
+extern clist map_sources;
+
 /* Calculated by map_set_scale() */
 
 extern double map_scale;
@@ -27,4 +56,8 @@ extern double page_map_width, page_map_height;
 void map_set_scale(void);
 bool map_object_visible_p(struct osm_object *o);
 
+void map_load_styles(void);
+void map_load_sources(void);
+void map_apply_styles(struct svg *svg);
+
 #endif