Code

r13107@tres: ted | 2006-07-30 11:47:41 -0700
[inkscape.git] / src / extension / internal / wpg-input.cpp
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
@@ -56,11 +56,11 @@ private:
        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
@@ -75,17 +75,17 @@ void SvgPainter::startDocument(double width, double height)
        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
@@ -121,22 +121,22 @@ void SvgPainter::setBrush(const WPGBrush& brush)
        }\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
@@ -147,7 +147,7 @@ void SvgPainter::drawRectangle(const WPGRect& rect, double rx, double ry)
        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
@@ -156,7 +156,7 @@ void SvgPainter::drawEllipse(const WPGPoint& center, double rx, double ry)
        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
@@ -186,7 +186,7 @@ void SvgPainter::drawPolygon(const WPGPointArray& vertices)
        }\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
@@ -220,7 +220,7 @@ void SvgPainter::drawPath(const WPGPath& path)
 }\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
@@ -249,9 +249,9 @@ void SvgPainter::writeStyle()
        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
@@ -291,7 +291,7 @@ int main(int argc, char *argv[])
                return 1;\r
        }\r
        \r
-       SvgPainter painter;\r
+       InkscapePainter painter;\r
        WPGraphics::parse(input, &painter);\r
        \r
        return 0;\r