2 * Hic Est Leo -- Symbolizers
4 * (c) 2014--2015 Martin Mares <mj@ucw.cz>
14 enum symbolizer_type {
27 enum symbolizer_type type;
29 // Symbolizer-dependent data follow
34 void (*draw)(struct symbol *sym, struct svg *svg);
35 void (*gen)(struct osm_object *o, struct style_info *si, struct svg *svg);
37 osm_val_t special; // Generated automatically only upon request
40 extern struct mempool *sym_mp;
43 * Default values for major-z-index:
47 * 2.1 left/right casing
54 typedef u32 z_index_t;
57 void *sym_new(enum symbolizer_type type, struct osm_object *o, size_t size);
58 void sym_plan(struct symbol *sym, z_index_t zindex);
59 void sym_draw_all(struct svg *svg);
60 void sym_from_style(struct osm_object *o, struct style_results *sr, struct svg *svg);
61 z_index_t sym_zindex(struct osm_object *o, struct style_info *si, double default_mzi);
63 /* sym-point.c handles point symbols and icons */
71 double stroke_opacity;
78 // FIXME: Make sym_*_new() and symbolizer structs internal
79 extern struct symbolizer symbolizer_point;
80 struct sym_point *sym_point_new(struct osm_object *o);
84 struct svg_icon_request sir;
87 extern struct symbolizer symbolizer_icon;
88 struct sym_icon *sym_icon_new(struct osm_object *o);
90 /* sym-line.c handles lines and areas */
100 double *dash_pattern; // Growing array
104 extern struct symbolizer symbolizer_line;
105 struct sym_line *sym_line_new(struct osm_object *o);
111 struct svg_pattern *fill_pattern;
114 extern struct symbolizer symbolizer_area;
115 struct sym_area *sym_area_new(struct osm_object *o);
117 struct sym_lineimg { // Images along line
119 struct svg_icon_request sir;
126 extern struct symbolizer symbolizer_lineimg;
127 struct sym_lineimg *sym_lineimg_new(struct osm_object *o);
137 double rotate; // Rotation in degrees CCW
138 struct text_font *font;
143 struct sym_text *next_in_tile; // See text_by_tile[]
144 struct sym_text *next_duplicate;
148 extern struct symbolizer symbolizer_text;
149 struct sym_text *sym_text_new(struct osm_object *o);
151 void scale_text(struct svg *svg, double x, double y, osm_val_t text);
160 color_t casing_color;
164 extern struct symbolizer symbolizer_scale;
165 struct sym_scale *sym_scale_new(struct osm_object *o);