From: Krzysztof K. <twe...@gm...> - 2013-08-15 17:20:29
|
2013/8/15 Vinícius dos Santos Oliveira <vin...@gm...> > Should Inkscape::SVG::PathString become a wrapper around the Geom::PathSink... like SPCurve is a wrapper around Geom::PathVector? More or less. Ideally the only specific functionality of Inkscape::SVG::PathString would be to read Inkscape preferences and set the path data output parameters based on them. > class SVGPathSink { > public: > // ... > > // This function will read \p svgpath and make some calls to the virtual methods > // moveTo, hlineTo, vlineTo... > void read(const Geom::PathVector &svgpath); > > } Yes, this is what I had in mind, though a better name would be "process" or "sink". This method should be virtual, but unlike the other virtual methods in this lass it should have a default implementation defined. > 2. Derive from SVGPathSink and implement SVGPathDataBuilder, a class > based on the code in src/svg/path-string.cpp. > > > I'll start from this. > > The name DataBuilder is a bit generic. What do you think about SVGPathTextBuilder? The name clearly exposes the intent. "Path data" is the name used for the command string in the SVG specification, so I would recommend sticking to that. "Path text" does not appear in the specification. You could also use "SVGPathCommandStringBuilder", but that's a little too long. One possible way to disambiguate is to remove the "SVG" prefix on SVGPathSink, because it doesn't have any SVG-specific functionality. (I can handle that since it involves regenerating svg-path-builder.cpp using Ragel.) Regards, Krzysztof |