2 * Hic Est Leo -- Symbolizers
4 * (c) 2014 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 bool (*same_p)(struct symbol *x, struct symbol *y);
38 struct symbol *(*clone)(struct symbol *src);
41 extern struct mempool *sym_mp;
44 * Default values for major-z-index:
48 * 2.1 left/right casing
55 typedef u32 z_index_t;
58 void *sym_new(enum symbolizer_type type, struct osm_object *o, size_t size);
59 void sym_plan(struct symbol *sym, z_index_t zindex);
60 void sym_draw_all(struct svg *svg);
61 void sym_for_all_planned(void (*callback)(struct symbol *s, z_index_t zindex));
62 void sym_from_style(struct osm_object *o, struct style_results *sr, struct svg *svg);
63 z_index_t sym_zindex(struct osm_object *o, struct style_info *si, double default_mzi);
64 bool sym_same_attrs_p(struct symbol *x, struct symbol *y);
65 void sym_disable(struct symbol *s);
66 struct symbol *sym_clone(struct symbol *s);
68 /* sym-point.c handles point symbols and icons */
76 double stroke_opacity;
83 // FIXME: Make sym_*_new() and symbolizer structs internal
84 extern struct symbolizer symbolizer_point;
85 struct sym_point *sym_point_new(struct osm_object *o);
89 struct svg_icon_request sir;
92 extern struct symbolizer symbolizer_icon;
93 struct sym_icon *sym_icon_new(struct osm_object *o);
95 /* sym-line.c handles lines and areas */
105 double *dash_pattern; // Growing array
109 extern struct symbolizer symbolizer_line;
110 struct sym_line *sym_line_new(struct osm_object *o);
116 struct svg_pattern *fill_pattern;
119 extern struct symbolizer symbolizer_area;
120 struct sym_area *sym_area_new(struct osm_object *o);
122 struct sym_lineimg { // Images along line
124 struct svg_icon_request sir;
131 extern struct symbolizer symbolizer_lineimg;
132 struct sym_lineimg *sym_lineimg_new(struct osm_object *o);
142 double rotate; // Rotation in degrees CCW
143 struct text_font *font;
148 struct sym_text *next_in_tile; // See text_by_tile[]
149 struct sym_text *next_duplicate;
153 extern struct symbolizer symbolizer_text;
154 struct sym_text *sym_text_new(struct osm_object *o);
156 void scale_text(struct svg *svg, double x, double y, osm_val_t text);