index bc65ad5b9f04cfee115f4d3a3995ba975e4092e6..4f296f2abf36e136d4e3a80aa867d55fc6e860b3 100644 (file)
\r
#include <stdio.h>\r
\r
-#include "libwpg.h"\r
-#include "WPGStreamImplementation.h"\r
+#include "libwpg/libwpg.h"\r
+#include "libwpg/WPGStreamImplementation.h"\r
\r
using namespace libwpg;\r
\r
-class SvgPainter : public libwpg::WPGPaintInterface {\r
+class InkscapePainter : public libwpg::WPGPaintInterface {\r
public:\r
- SvgPainter();\r
+ InkscapePainter();\r
\r
void startDocument(double imageWidth, double imageHeight);\r
void endDocument();\r
void writeStyle();\r
};\r
\r
-SvgPainter::SvgPainter(): m_fillRule(AlternatingFill), m_gradientIndex(1)\r
+InkscapePainter::InkscapePainter(): m_fillRule(AlternatingFill), m_gradientIndex(1)\r
{\r
}\r
\r
-void SvgPainter::startDocument(double width, double height) \r
+void InkscapePainter::startDocument(double width, double height) \r
{\r
printf("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n");\r
printf("<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"");\r
m_gradientIndex = 1;\r
}\r
\r
-void SvgPainter::endDocument()\r
+void InkscapePainter::endDocument()\r
{\r
printf("</svg>\n");\r
}\r
\r
-void SvgPainter::setPen(const WPGPen& pen)\r
+void InkscapePainter::setPen(const WPGPen& pen)\r
{\r
m_pen = pen;\r
}\r
\r
-void SvgPainter::setBrush(const WPGBrush& brush)\r
+void InkscapePainter::setBrush(const WPGBrush& brush)\r
{\r
m_brush = brush;\r
\r
}\r
}\r
\r
-void SvgPainter::setFillRule(FillRule rule)\r
+void InkscapePainter::setFillRule(FillRule rule)\r
{\r
m_fillRule = rule;\r
}\r
\r
-void SvgPainter::startLayer(unsigned int id)\r
+void InkscapePainter::startLayer(unsigned int id)\r
{\r
printf("<g id=\"Layer%d\" >\n", id);\r
}\r
\r
-void SvgPainter::endLayer(unsigned int)\r
+void InkscapePainter::endLayer(unsigned int)\r
{\r
printf("</g>\n");\r
}\r
\r
-void SvgPainter::drawRectangle(const WPGRect& rect, double rx, double ry)\r
+void InkscapePainter::drawRectangle(const WPGRect& rect, double rx, double ry)\r
{\r
printf("<rect ");\r
printf("x=\"%f\" y=\"%f\" ", 72*rect.x1, 72*rect.y1);\r
printf("/>\n");\r
}\r
\r
-void SvgPainter::drawEllipse(const WPGPoint& center, double rx, double ry)\r
+void InkscapePainter::drawEllipse(const WPGPoint& center, double rx, double ry)\r
{\r
printf("<ellipse ");\r
printf("cx=\"%f\" cy=\"%f\" ", 72*center.x, 72*center.y);\r
printf("/>\n");\r
}\r
\r
-void SvgPainter::drawPolygon(const WPGPointArray& vertices)\r
+void InkscapePainter::drawPolygon(const WPGPointArray& vertices)\r
{\r
if(vertices.count() < 2)\r
return;\r
}\r
}\r
\r
-void SvgPainter::drawPath(const WPGPath& path)\r
+void InkscapePainter::drawPath(const WPGPath& path)\r
{\r
printf("<path d=\"");\r
for(unsigned i = 0; i < path.count(); i++)\r
}\r
\r
// create "style" attribute based on current pen and brush\r
-void SvgPainter::writeStyle()\r
+void InkscapePainter::writeStyle()\r
{\r
printf("style=\"");\r
\r
if(m_brush.style == WPGBrush::NoBrush)\r
printf("fill: none; ");\r
\r
- if(m_fillRule == SvgPainter::WindingFill)\r
+ if(m_fillRule == InkscapePainter::WindingFill)\r
printf("fill-rule: nonzero; ");\r
- else if(m_fillRule == SvgPainter::AlternatingFill)\r
+ else if(m_fillRule == InkscapePainter::AlternatingFill)\r
printf("fill-rule: evenodd; ");\r
\r
if(m_brush.style == WPGBrush::Gradient)\r
return 1;\r
}\r
\r
- SvgPainter painter;\r
+ InkscapePainter painter;\r
WPGraphics::parse(input, &painter);\r
\r
return 0;\r