2 * This file is part of Libsvgtiny
3 * Licensed under the MIT License,
4 * http://opensource.org/licenses/mit-license.php
5 * Copyright 2008 James Bursa <james@semichrome.net>
8 #ifndef SVGTINY_INTERNAL_H
9 #define SVGTINY_INTERNAL_H
11 struct svgtiny_gradient_stop
{
16 #define svgtiny_MAX_STOPS 10
17 #define svgtiny_LINEAR_GRADIENT 0x2000000
19 struct svgtiny_parse_state
{
20 struct svgtiny_diagram
*diagram
;
24 float viewport_height
;
26 /* current transformation matrix */
28 float a
, b
, c
, d
, e
, f
;
31 /*struct css_style style;*/
33 /* paint attributes */
35 svgtiny_colour stroke
;
39 unsigned int linear_gradient_stop_count
;
40 struct svgtiny_gradient_stop gradient_stop
[svgtiny_MAX_STOPS
];
45 void svgtiny_transform_path(float *p
, unsigned int n
,
46 struct svgtiny_parse_state
*state
);
47 void svgtiny_parse_color(const char *s
, svgtiny_colour
*c
,
48 struct svgtiny_parse_state
*state
);
49 struct svgtiny_shape
*svgtiny_add_shape(struct svgtiny_parse_state
*state
);
51 /* svgtiny_gradient.c */
52 void svgtiny_find_gradient(const char *id
, struct svgtiny_parse_state
*state
);
53 svgtiny_code
svgtiny_add_path_linear_gradient(float *p
, unsigned int n
,
54 struct svgtiny_parse_state
*state
);
55 xmlNode
*svgtiny_find_element_by_id(xmlNode
*node
, const char *id
);
58 const struct svgtiny_named_color
*
59 svgtiny_color_lookup(register const char *str
,
60 register unsigned int len
);