Code

Filters. Custom predefined filters update and new ABC filters.
[inkscape.git] / src / svg / svg.h
1 #ifndef SEEN_SP_SVG_H
2 #define SEEN_SP_SVG_H
4 /*
5  * SVG data parser
6  *
7  * Authors:
8  *   Lauris Kaplinski <lauris@kaplinski.com>
9  *
10  * Copyright (C) 1999-2002 Lauris Kaplinski
11  *
12  * Released under GNU GPL, read the file 'COPYING' for more information
13  */
14 #include <glib/gtypes.h>
15 #include <vector>
16 #include <cstring>
17 #include <string>
19 #include "svg/svg-length.h"
20 #include "libnr/nr-forward.h"
21 #include <2geom/forward.h>
23 /* Generic */
25 /*
26  * These are very-very simple:
27  * - they accept everything libc strtod accepts
28  * - no valid end character checking
29  * Return FALSE and let val untouched on error
30  */
32 unsigned int sp_svg_number_read_f( const gchar *str, float *val );
33 unsigned int sp_svg_number_read_d( const gchar *str, double *val );
35 /*
36  * No buffer overflow checking is done, so better wrap them if needed
37  */
38 unsigned int sp_svg_number_write_de( gchar *buf, int bufLen, double val, unsigned int tprec, int min_exp );
40 /* Length */
42 /*
43  * Parse number with optional unit specifier:
44  * - for px, pt, pc, mm, cm, computed is final value accrding to SVG spec
45  * - for em, ex, and % computed is left untouched
46  * - % is divided by 100 (i.e. 100% is 1.0)
47  * !isalnum check is done at the end
48  * Any return value pointer can be NULL
49  */
51 unsigned int sp_svg_length_read_computed_absolute( const gchar *str, float *length );
52 std::vector<SVGLength> sp_svg_length_list_read( const gchar *str );
53 unsigned int sp_svg_length_read_ldd( const gchar *str, SVGLength::Unit *unit, double *value, double *computed );
55 std::string sp_svg_length_write_with_units(SVGLength const &length);
57 bool sp_svg_transform_read(gchar const *str, Geom::Matrix *transform);
59 gchar *sp_svg_transform_write(Geom::Matrix const &transform);
60 gchar *sp_svg_transform_write(Geom::Matrix const *transform);
62 double sp_svg_read_percentage( const char * str, double def );
64 /* NB! As paths can be long, we use here dynamic string */
66 Geom::PathVector sp_svg_read_pathv( char const * str );
67 gchar * sp_svg_write_path( Geom::PathVector const &p );
68 gchar * sp_svg_write_path( Geom::Path const &p );
70 #endif // SEEN_SP_SVG_H
72 /*
73   Local Variables:
74   mode:c++
75   c-file-style:"stroustrup"
76   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
77   indent-tabs-mode:nil
78   fill-column:99
79   End:
80 */
81 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :