From: Fridrich S. <str...@us...> - 2008-11-27 22:07:12
|
Update of /cvsroot/libwpg/libwpg/src/lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18112/src/lib Modified Files: WPG2Parser.cpp WPG2Parser.h WPGBrush.cpp WPGBrush.h WPGGradient.cpp WPGGradient.h WPGPaintInterface.h WPGPen.cpp WPGPen.h WPGSVGGenerator.cpp WPGSVGGenerator.h Log Message: some more api change (and more to come) Index: WPGBrush.h =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPGBrush.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- WPGBrush.h 11 Jul 2008 22:19:09 -0000 1.6 +++ WPGBrush.h 27 Nov 2008 21:42:16 -0000 1.7 @@ -54,9 +54,9 @@ WPGBrush(WPGBrushStyle brushStyle); - explicit WPGBrush(const WPGColor& fore); +// explicit WPGBrush(const WPGColor& fore); - WPGBrush(const WPGColor& fore, const WPGColor& back); +// WPGBrush(const WPGColor& fore, const WPGColor& back); WPGBrush(const WPGBrush& brush); Index: WPG2Parser.h =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPG2Parser.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- WPG2Parser.h 27 Nov 2008 16:33:00 -0000 1.29 +++ WPG2Parser.h 27 Nov 2008 21:42:16 -0000 1.30 @@ -167,7 +167,7 @@ void handleCompoundPolygon(); void handlePenStyleDefinition(); - void handlePatternDefinition(); +// void handlePatternDefinition(); void handleColorPalette(); void handleDPColorPalette(); void handlePenForeColor(); Index: WPGGradient.cpp =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPGGradient.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- WPGGradient.cpp 9 May 2007 22:34:09 -0000 1.5 +++ WPGGradient.cpp 27 Nov 2008 21:42:16 -0000 1.6 @@ -103,10 +103,12 @@ return d->gradientStops[index].color; } +#if 0 void libwpg::WPGGradient::clear() { d->gradientStops.clear(); } +#endif void libwpg::WPGGradient::addStop(double offset, const libwpg::WPGColor& color) { Index: WPGSVGGenerator.h =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPGSVGGenerator.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- WPGSVGGenerator.h 27 Nov 2008 16:33:00 -0000 1.14 +++ WPGSVGGenerator.h 27 Nov 2008 21:42:16 -0000 1.15 @@ -49,7 +49,7 @@ void setPen(const libwpg::WPGPen& pen); void setBrush(const libwpg::WPGBrush& brush); - void setFillRule(FillRule rule); + void setFillRule(const ::WPXPropertyList &propList); void drawRectangle(const ::WPXPropertyList& propList); void drawEllipse(const ::WPXPropertyList& propList); @@ -62,7 +62,7 @@ private: libwpg::WPGPen m_pen; libwpg::WPGBrush m_brush; - FillRule m_fillRule; + ::WPXPropertyList m_fillRule; int m_gradientIndex; void writeStyle(); void drawPolySomething(const ::WPXPropertyListVector& vertices, bool isClosed); Index: WPGBrush.cpp =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPGBrush.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- WPGBrush.cpp 11 Jul 2008 22:19:09 -0000 1.3 +++ WPGBrush.cpp 27 Nov 2008 21:42:16 -0000 1.4 @@ -39,6 +39,7 @@ gradient() {} +#if 0 libwpg::WPGBrush::WPGBrush(const WPGColor& fore): style(Solid), foreColor(fore), @@ -52,6 +53,7 @@ backColor(back), gradient() {} +#endif libwpg::WPGBrush::WPGBrush(const WPGBrush& brush): style(brush.style), Index: WPGSVGGenerator.cpp =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPGSVGGenerator.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- WPGSVGGenerator.cpp 27 Nov 2008 16:33:00 -0000 1.20 +++ WPGSVGGenerator.cpp 27 Nov 2008 21:42:16 -0000 1.21 @@ -47,7 +47,7 @@ } -libwpg::WPGSVGGenerator::WPGSVGGenerator(std::ostream & output_sink): m_pen(libwpg::WPGPen()), m_brush(libwpg::WPGBrush()), m_fillRule(AlternatingFill), m_gradientIndex(1), m_outputSink(output_sink) +libwpg::WPGSVGGenerator::WPGSVGGenerator(std::ostream & output_sink): m_pen(libwpg::WPGPen()), m_brush(libwpg::WPGBrush()), m_fillRule(), m_gradientIndex(1), m_outputSink(output_sink) { } @@ -131,9 +131,9 @@ } } -void libwpg::WPGSVGGenerator::setFillRule(FillRule rule) +void libwpg::WPGSVGGenerator::setFillRule(const ::WPXPropertyList &propList) { - m_fillRule = rule; + m_fillRule = propList; } void libwpg::WPGSVGGenerator::startLayer(const ::WPXPropertyList& propList) @@ -306,10 +306,8 @@ if(m_brush.style == libwpg::WPGBrush::Pattern) { - if(m_fillRule == WPGSVGGenerator::WindingFill) - m_outputSink << "fill-rule: nonzero; "; - else if(m_fillRule == WPGSVGGenerator::AlternatingFill) - m_outputSink << "fill-rule: evenodd; "; + if(m_fillRule["svg:fill-rule"]) + m_outputSink << "fill-rule: " << m_fillRule["svg:fill-rule"]->getStr().cstr() << "; "; } if(m_brush.style == libwpg::WPGBrush::Gradient) Index: WPGPaintInterface.h =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPGPaintInterface.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- WPGPaintInterface.h 27 Nov 2008 16:33:00 -0000 1.14 +++ WPGPaintInterface.h 27 Nov 2008 21:42:16 -0000 1.15 @@ -46,8 +46,7 @@ virtual void setBrush(const WPGBrush& brush) = 0; - typedef enum { AlternatingFill, WindingFill } FillRule; - virtual void setFillRule(FillRule rule ) = 0; + virtual void setFillRule(const ::WPXPropertyList &propList) = 0; virtual void startLayer(const ::WPXPropertyList& propList) = 0; Index: WPGPen.cpp =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPGPen.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- WPGPen.cpp 11 Jul 2008 22:19:09 -0000 1.7 +++ WPGPen.cpp 27 Nov 2008 21:42:16 -0000 1.8 @@ -83,6 +83,7 @@ { } +#if 0 libwpg::WPGPen::WPGPen(const WPGColor& fore): foreColor(fore), backColor(0xFF,0xFF,0xFF), @@ -102,6 +103,7 @@ dashArray() { } +#endif libwpg::WPGPen::WPGPen(const WPGPen& pen): foreColor(pen.foreColor), Index: WPGGradient.h =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPGGradient.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- WPGGradient.h 8 Jul 2006 10:26:14 -0000 1.2 +++ WPGGradient.h 27 Nov 2008 21:42:16 -0000 1.3 @@ -55,7 +55,7 @@ WPGColor stopColor(unsigned index) const; - void clear(); +// void clear(); void addStop(double offset, const WPGColor& color); Index: WPG2Parser.cpp =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPG2Parser.cpp,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -r1.86 -r1.87 --- WPG2Parser.cpp 27 Nov 2008 16:33:00 -0000 1.86 +++ WPG2Parser.cpp 27 Nov 2008 21:42:16 -0000 1.87 @@ -610,10 +610,12 @@ m_painter->setBrush( context.compoundFilled ? m_brush : libwpg::WPGBrush() ); m_painter->setPen( context.compoundFramed ? m_pen : libwpg::WPGPen() ); + ::WPXPropertyList fillRule; if(context.compoundWindingRule) - m_painter->setFillRule(libwpg::WPGPaintInterface::WindingFill); + fillRule.insert("svg:fill-rule", "nonzero"); else - m_painter->setFillRule(libwpg::WPGPaintInterface::AlternatingFill); + fillRule.insert("svg:fill-rule", "evenodd"); + m_painter->setFillRule(fillRule); if (context.compoundClosed) { WPXPropertyList element; @@ -644,6 +646,7 @@ WPG_DEBUG_MSG((" Segment pairs : %d\n", segments)); } +#if 0 // TODO void WPG2Parser::handlePatternDefinition() { @@ -651,6 +654,7 @@ return; WPG_DEBUG_MSG(("PatternDefinition\n")); } +#endif void WPG2Parser::handleColorPalette() { @@ -1190,10 +1194,12 @@ // otherwise draw directly m_painter->setBrush( objCh.filled ? m_brush : libwpg::WPGBrush() ); m_painter->setPen( objCh.framed ? m_pen : libwpg::WPGPen() ); + ::WPXPropertyList fillRule; if(objCh.windingRule) - m_painter->setFillRule(libwpg::WPGPaintInterface::WindingFill); + fillRule.insert("svg:fill-rule", "nonzero"); else - m_painter->setFillRule(libwpg::WPGPaintInterface::AlternatingFill); + fillRule.insert("svg:fill-rule", "evenodd"); + m_painter->setFillRule(fillRule); if (objCh.filled || objCh.closed) m_painter->drawPolygon(points); else @@ -1283,10 +1289,12 @@ // otherwise draw directly m_painter->setBrush( objCh.filled ? m_brush : libwpg::WPGBrush() ); m_painter->setPen( objCh.framed ? m_pen : libwpg::WPGPen() ); + ::WPXPropertyList fillRule; if(objCh.windingRule) - m_painter->setFillRule(libwpg::WPGPaintInterface::WindingFill); + fillRule.insert("svg:fill-rule", "nonzero"); else - m_painter->setFillRule(libwpg::WPGPaintInterface::AlternatingFill); + fillRule.insert("svg:fill-rule", "evenodd"); + m_painter->setFillRule(fillRule); m_painter->drawPath(path); } } Index: WPGPen.h =================================================================== RCS file: /cvsroot/libwpg/libwpg/src/lib/WPGPen.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- WPGPen.h 14 Dec 2006 14:39:57 -0000 1.3 +++ WPGPen.h 27 Nov 2008 21:42:16 -0000 1.4 @@ -59,8 +59,10 @@ WPGDashArray dashArray; WPGPen(); +#if 0 WPGPen(const WPGColor& fore); WPGPen(const WPGColor& fore, const WPGColor& back); +#endif WPGPen(const WPGPen& pen); WPGPen& operator=(const WPGPen& pen); |