return 1;
}
+static struct symbol *sym_line_clone(struct symbol *src)
+{
+ struct sym_line *s = (struct sym_line *) src;
+ struct sym_line *d = sym_line_new(s->s.o);
+ memcpy((byte *)d + sizeof(struct symbol), (byte *)s + sizeof(struct symbol), sizeof(struct sym_line) - sizeof(struct symbol));
+ return &d->s;
+}
+
struct symbolizer symbolizer_line = {
.name = "line",
.draw = sym_line_draw,
.gen = sym_line_gen,
.same_p = sym_line_same_p,
+ .clone = sym_line_clone,
};
struct sym_line *sym_line_new(struct osm_object *o)
sym_draw(sym_planned[i].sym, sym_planned[i].zindex, svg);
}
-void sym_for_all_planned(void (*callback)(struct symbol *s))
+void sym_for_all_planned(void (*callback)(struct symbol *s, z_index_t zindex))
{
for (uns i = 0; i < GARY_SIZE(sym_planned); i++)
- callback(sym_planned[i].sym);
+ callback(sym_planned[i].sym, sym_planned[i].zindex);
}
bool sym_same_attrs_p(struct symbol *x, struct symbol *y)
{
sym->type = SYMBOLIZER_DISABLED;
}
+
+struct symbol *sym_clone(struct symbol *s)
+{
+ ASSERT(symbolizers[s->type]->clone);
+ return symbolizers[s->type]->clone(s);
+}
void (*gen)(struct osm_object *o, struct style_info *si, struct svg *svg);
void (*init)(void);
bool (*same_p)(struct symbol *x, struct symbol *y);
+ struct symbol *(*clone)(struct symbol *src);
};
extern struct mempool *sym_mp;
void *sym_new(enum symbolizer_type type, struct osm_object *o, size_t size);
void sym_plan(struct symbol *sym, z_index_t zindex);
void sym_draw_all(struct svg *svg);
-void sym_for_all_planned(void (*callback)(struct symbol *s));
+void sym_for_all_planned(void (*callback)(struct symbol *s, z_index_t zindex));
void sym_from_style(struct osm_object *o, struct style_results *sr, struct svg *svg);
z_index_t sym_zindex(struct osm_object *o, struct style_info *si, double default_mzi);
bool sym_same_attrs_p(struct symbol *x, struct symbol *y);
void sym_disable(struct symbol *s);
+struct symbol *sym_clone(struct symbol *s);
/* sym-point.c handles point symbols and icons */