]> mj.ucw.cz Git - leo.git/blob - map.h
f031f7b65fdfd5d74c932bbb0f888fedbc3aa8c3
[leo.git] / map.h
1 /*
2  *      Hic Est Leo -- Global Map Operations
3  *
4  *      (c) 2014 Martin Mares <mj@ucw.cz>
5  */
6
7 #ifndef _LEO_MAP_H
8 #define _LEO_MAP_H
9
10 #include "svg.h"
11
12 /* Map configuration */
13
14 extern double map_min_x, map_min_y;
15 extern double map_max_x, map_max_y;
16 extern double page_width, page_height;
17 extern uns map_clip, map_rotate, map_draw_border;
18 extern char *map_projection;
19 extern char *map_svg_output;
20
21 // Remember to update map.c:map_formats
22 enum data_source_type {
23   DATA_SOURCE_INVALID,
24   DATA_SOURCE_OSMXML,
25 };
26
27 struct data_source {
28   cnode n;
29   // Configuration
30   char *file;
31   int format;
32   clist styles;         // of data_source_style
33   // Runtime
34   struct osm *osm;
35 };
36
37 struct data_source_style {
38   cnode n;
39   // Configuration
40   char *name;
41   // Runtime
42   struct css_sheet *css;
43 };
44
45 extern clist map_sources;
46
47 /* Calculated by map_set_scale() */
48
49 extern double map_scale;
50 extern double page_offset_x, page_offset_y;
51 extern double page_map_width, page_map_height;
52
53 void map_set_scale(void);
54 bool map_object_visible_p(struct osm_object *o);
55
56 void map_load_styles(void);
57 void map_load_sources(void);
58 void map_apply_styles(struct svg *svg);
59
60 #endif