1#ifndef SOURCE_SVG_IMP_H
2#define SOURCE_SVG_IMP_H
3
4typedef struct svg_document_s svg_document;
5
6struct svg_document_s
7{
8 fz_document super;
9 fz_xml_doc *xml;
10 fz_xml *root;
11 fz_tree *idmap;
12 float width;
13 float height;
14 fz_archive *zip; /* for locating external resources */
15 char base_uri[2048];
16};
17
18const char *svg_lex_number(float *fp, const char *str);
19float svg_parse_number(const char *str, float min, float max, float inherit);
20float svg_parse_length(const char *str, float percent, float font_size);
21float svg_parse_angle(const char *str);
22
23void svg_parse_color_from_style(fz_context *ctx, svg_document *doc, const char *str,
24 int *fill_is_set, float fill[3], int *stroke_is_set, float stroke[3]);
25void svg_parse_color(fz_context *ctx, svg_document *doc, const char *str, float *rgb);
26fz_matrix svg_parse_transform(fz_context *ctx, svg_document *doc, const char *str, fz_matrix transform);
27
28int svg_is_whitespace_or_comma(int c);
29int svg_is_whitespace(int c);
30int svg_is_alpha(int c);
31int svg_is_digit(int c);
32
33void svg_parse_document_bounds(fz_context *ctx, svg_document *doc, fz_xml *root);
34void svg_run_document(fz_context *ctx, svg_document *doc, fz_xml *root, fz_device *dev, fz_matrix ctm);
35
36#endif
37