diff --git a/esvg/Base.cpp b/esvg/Base.cpp index dadbf1d..b9b3d69 100644 --- a/esvg/Base.cpp +++ b/esvg/Base.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -13,9 +13,6 @@ const float esvg::kappa90(0.5522847493f); -#undef __class__ -#define __class__ "PaintState" - esvg::PaintState::PaintState() : fill(std::pair, std::string>(etk::color::black, "")), stroke(std::pair, std::string>(etk::color::none, "")), @@ -43,10 +40,6 @@ void esvg::PaintState::clear() { } -#undef __class__ -#define __class__ "Base" - - esvg::Base::Base(PaintState _parentPaintState) { // copy the parent painting properties ... m_paint = _parentPaintState; @@ -86,11 +79,11 @@ std::string extractTransformData(const std::string& _value, const std::string& _ return std::string(_value.begin()+posStart, _value.begin()+posEnd); } -void esvg::Base::parseTransform(const std::shared_ptr& _element) { - if (_element == nullptr) { +void esvg::Base::parseTransform(const exml::Element& _element) { + if (_element.exist() == false) { return; } - std::string inputString = _element->getAttribute("transform"); + std::string inputString = _element.attributes["transform"]; if (inputString.size() == 0) { return; } @@ -179,26 +172,26 @@ void esvg::Base::parseTransform(const std::shared_ptr& _element) } } -void esvg::Base::parsePosition(const std::shared_ptr& _element, vec2 &_pos, vec2 &_size) { +void esvg::Base::parsePosition(const exml::Element& _element, vec2 &_pos, vec2 &_size) { _pos.setValue(0,0); _size.setValue(0,0); - if (_element == nullptr) { + if (_element.exist() == false) { return; } - std::string content = _element->getAttribute("x"); + std::string content = _element.attributes["x"]; if (content.size()!=0) { _pos.setX(parseLength(content)); } - content = _element->getAttribute("y"); + content = _element.attributes["y"]; if (content.size()!=0) { _pos.setY(parseLength(content)); } - content = _element->getAttribute("width"); + content = _element.attributes["width"]; if (content.size()!=0) { _size.setX(parseLength(content)); } - content = _element->getAttribute("height"); + content = _element.attributes["height"]; if (content.size()!=0) { _size.setY(parseLength(content)); } @@ -281,8 +274,8 @@ float esvg::Base::parseLength(const std::string& _dataInput) { return 0.0f; } -void esvg::Base::parsePaintAttr(const std::shared_ptr& _element) { - if (_element == nullptr) { +void esvg::Base::parsePaintAttr(const exml::Element& _element) { + if (_element.exist() == false) { return; } /* @@ -291,27 +284,27 @@ void esvg::Base::parsePaintAttr(const std::shared_ptr& _ele */ std::string content; // ---------------- get unique ID ---------------- - m_id = _element->getAttribute("id"); + m_id = _element.attributes["id"]; // ---------------- stroke ---------------- - content = _element->getAttribute("stroke"); + content = _element.attributes["stroke"]; if (content == "none") { m_paint.stroke = std::pair, std::string>(etk::color::none, ""); } else { if (content.size()!=0) { m_paint.stroke = parseColor(content); } - content = _element->getAttribute("stroke-width"); + content = _element.attributes["stroke-width"]; if (content.size()!=0) { m_paint.strokeWidth = parseLength(content); } - content = _element->getAttribute("stroke-opacity"); + content = _element.attributes["stroke-opacity"]; if (content.size()!=0) { float opacity = parseLength(content); opacity = std::avg(0.0f, opacity, 1.0f); m_paint.stroke.first.setA(opacity); } - content = _element->getAttribute("stroke-dasharray"); + content = _element.attributes["stroke-dasharray"]; if (content.size()!=0) { if (content == "none" ) { // OK, Nothing to do ... @@ -319,7 +312,7 @@ void esvg::Base::parsePaintAttr(const std::shared_ptr& _ele ESVG_TODO(" 'stroke-dasharray' not implemented ..."); } } - content = _element->getAttribute("stroke-linecap"); + content = _element.attributes["stroke-linecap"]; if (content.size()!=0) { if (content == "butt" ) { m_paint.lineCap = esvg::cap_butt; @@ -332,7 +325,7 @@ void esvg::Base::parsePaintAttr(const std::shared_ptr& _ele ESVG_ERROR("not know stroke-linecap value : \"" << content << "\", not in [butt,round,square]"); } } - content = _element->getAttribute("stroke-linejoin"); + content = _element.attributes["stroke-linejoin"]; if (content.size()!=0) { if (content == "miter" ) { m_paint.lineJoin = esvg::join_miter; @@ -345,27 +338,27 @@ void esvg::Base::parsePaintAttr(const std::shared_ptr& _ele ESVG_ERROR("not know stroke-linejoin value : \"" << content << "\", not in [miter,round,bevel]"); } } - content = _element->getAttribute("stroke-miterlimit"); + content = _element.attributes["stroke-miterlimit"]; if (content.size()!=0) { float tmp = parseLength(content); m_paint.miterLimit = std::max(0.0f, tmp); } } // ---------------- FILL ---------------- - content = _element->getAttribute("fill"); + content = _element.attributes["fill"]; if (content == "none") { m_paint.fill = std::pair, std::string>(etk::color::none, ""); } else { if (content.size()!=0) { m_paint.fill = parseColor(content); } - content = _element->getAttribute("fill-opacity"); + content = _element.attributes["fill-opacity"]; if (content.size()!=0) { float opacity = parseLength(content); opacity = std::avg(0.0f, opacity, 1.0f); m_paint.fill.first.setA(opacity); } - content = _element->getAttribute("fill-rule"); + content = _element.attributes["fill-rule"]; if (content.size()!=0) { if (content == "nonzero") { m_paint.flagEvenOdd = false; @@ -376,7 +369,7 @@ void esvg::Base::parsePaintAttr(const std::shared_ptr& _ele } } // ---------------- opacity ---------------- - content = _element->getAttribute("opacity"); + content = _element.attributes["opacity"]; if (content.size()!=0) { m_paint.opacity = parseLength(content); m_paint.opacity = std::avg(0.0f, m_paint.opacity, 1.0f); @@ -405,10 +398,10 @@ std::pair, std::string> esvg::Base::parseColor(const std::st return localColor; } -bool esvg::Base::parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax) { +bool esvg::Base::parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax) { // TODO : UNDERSTAND why nothing is done here ... // Parse basic elements (ID...): - m_id = _element->getAttribute("id"); + m_id = _element.attributes["id"]; _sizeMax = vec2(0.0f, 0.0f); return false; } diff --git a/esvg/Base.h b/esvg/Base.h index 53fb2ae..d7b13aa 100644 --- a/esvg/Base.h +++ b/esvg/Base.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -64,19 +64,19 @@ namespace esvg { * @param[in] _element standart XML node * @return true if no problem arrived */ - virtual bool parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax); + virtual bool parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax); virtual void draw(esvg::Renderer& _myRenderer, mat2& _basicTrans, int32_t _level=1); virtual void display(int32_t _spacing) { }; - void parseTransform(const std::shared_ptr& _element); + void parseTransform(const exml::Element& _element); /** * @brief parse x, y, width, height attribute of the xml node * @param[in] _element XML node * @param[out] _pos parsed position * @param[out] _size parsed dimention */ - void parsePosition(const std::shared_ptr& _element, vec2 &_pos, vec2 &_size); + void parsePosition(const exml::Element& _element, vec2 &_pos, vec2 &_size); /** * @brief parse a lenght of the xml element * @param[in] _dataInput Data C String with the printed lenght @@ -88,7 +88,7 @@ namespace esvg { * @brief parse a Painting attribute of a specific node * @param[in] _element Basic node of the XML that might be parsed */ - void parsePaintAttr(const std::shared_ptr& _element); + void parsePaintAttr(const exml::Element& _element); /** * @brief parse a color specification from the svg file * @param[in] _inputData Data C String with the xml definition diff --git a/esvg/Circle.cpp b/esvg/Circle.cpp index 31a7eba..c472064 100644 --- a/esvg/Circle.cpp +++ b/esvg/Circle.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -11,9 +11,6 @@ #include #include -#undef __class__ -#define __class__ "Circle" - esvg::Circle::Circle(PaintState _parentPaintState) : esvg::Base(_parentPaintState) { } @@ -22,10 +19,10 @@ esvg::Circle::~Circle() { } -bool esvg::Circle::parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax) { +bool esvg::Circle::parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax) { m_radius = 0.0; m_position.setValue(0,0); - if (_element == nullptr) { + if (_element.exist() == false) { return false; } parseTransform(_element); @@ -34,24 +31,24 @@ bool esvg::Circle::parseXML(const std::shared_ptr& _element, mat2 // add the property of the parrent modifications ... m_transformMatrix *= _parentTrans; - std::string content = _element->getAttribute("cx"); + std::string content = _element.attributes["cx"]; if (content.size()!=0) { m_position.setX(parseLength(content)); } - content = _element->getAttribute("cy"); + content = _element.attributes["cy"]; if (content.size()!=0) { m_position.setY(parseLength(content)); } - content = _element->getAttribute("r"); + content = _element.attributes["r"]; if (content.size()!=0) { m_radius = parseLength(content); } else { - ESVG_ERROR("(l "<<_element->getPos()<<") Circle \"r\" is not present"); + ESVG_ERROR("(l "<<_element.getPos()<<") Circle \"r\" is not present"); return false; } if (0 > m_radius) { m_radius = 0; - ESVG_ERROR("(l "<<_element->getPos()<<") Circle \"r\" is negative"); + ESVG_ERROR("(l "<<_element.getPos()<<") Circle \"r\" is negative"); return false; } _sizeMax.setValue(m_position.x() + m_radius, m_position.y() + m_radius); diff --git a/esvg/Circle.h b/esvg/Circle.h index 934e60b..08f9c8b 100644 --- a/esvg/Circle.h +++ b/esvg/Circle.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -17,7 +17,7 @@ namespace esvg { public: Circle(PaintState _parentPaintState); ~Circle(); - virtual bool parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax); + virtual bool parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax); virtual void display(int32_t _spacing); virtual void draw(esvg::Renderer& _myRenderer, mat2& _basicTrans, int32_t _level); }; diff --git a/esvg/Dimension.cpp b/esvg/Dimension.cpp index 1e06bff..8c738d3 100644 --- a/esvg/Dimension.cpp +++ b/esvg/Dimension.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -9,9 +9,6 @@ #include #include -#undef __class__ -#define __class__ "Dimension" - static const float inchToMillimeter = 1.0f/25.4f; static const float footToMillimeter = 1.0f/304.8f; static const float meterToMillimeter = 1.0f/1000.0f; @@ -282,10 +279,6 @@ namespace etk { } }; - -#undef __class__ -#define __class__ "Dimension1D" - esvg::Dimension1D::Dimension1D() : m_data(0.0f), m_type(esvg::distance_pixel) { diff --git a/esvg/Dimension.h b/esvg/Dimension.h index 58998e6..8d0da09 100644 --- a/esvg/Dimension.h +++ b/esvg/Dimension.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/Ellipse.cpp b/esvg/Ellipse.cpp index 9e65ee9..e2d0a40 100644 --- a/esvg/Ellipse.cpp +++ b/esvg/Ellipse.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -11,9 +11,6 @@ #include #include -#undef __class__ -#define __class__ "Ellipse" - esvg::Ellipse::Ellipse(PaintState _parentPaintState) : esvg::Base(_parentPaintState) { } @@ -22,8 +19,8 @@ esvg::Ellipse::~Ellipse() { } -bool esvg::Ellipse::parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax) { - if (_element == nullptr) { +bool esvg::Ellipse::parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax) { + if (_element.exist() == false) { return false; } parseTransform(_element); @@ -35,26 +32,26 @@ bool esvg::Ellipse::parseXML(const std::shared_ptr& _element, mat m_c.setValue(0,0); m_r.setValue(0,0); - std::string content = _element->getAttribute("cx"); + std::string content = _element.attributes["cx"]; if (content.size()!=0) { m_c.setX(parseLength(content)); } - content = _element->getAttribute("cy"); + content = _element.attributes["cy"]; if (content.size()!=0) { m_c.setY(parseLength(content)); } - content = _element->getAttribute("rx"); + content = _element.attributes["rx"]; if (content.size()!=0) { m_r.setX(parseLength(content)); } else { - ESVG_ERROR("(l "<<_element->getPos()<<") Ellipse \"rx\" is not present"); + ESVG_ERROR("(l "<<_element.getPos()<<") Ellipse \"rx\" is not present"); return false; } - content = _element->getAttribute("ry"); + content = _element.attributes["ry"]; if (content.size()!=0) { m_r.setY(parseLength(content)); } else { - ESVG_ERROR("(l "<<_element->getPos()<<") Ellipse \"ry\" is not present"); + ESVG_ERROR("(l "<<_element.getPos()<<") Ellipse \"ry\" is not present"); return false; } _sizeMax.setValue(m_c.x() + m_r.x(), m_c.y() + m_r.y()); diff --git a/esvg/Ellipse.h b/esvg/Ellipse.h index d00f83c..0081b51 100644 --- a/esvg/Ellipse.h +++ b/esvg/Ellipse.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -17,7 +17,7 @@ namespace esvg { public: Ellipse(PaintState _parentPaintState); ~Ellipse(); - virtual bool parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax); + virtual bool parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax); virtual void display(int32_t _spacing); virtual void draw(esvg::Renderer& _myRenderer, mat2& _basicTrans, int32_t _level); }; diff --git a/esvg/Group.cpp b/esvg/Group.cpp index 5c04b5d..85bcaef 100644 --- a/esvg/Group.cpp +++ b/esvg/Group.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -20,9 +20,6 @@ #include #include -#undef __class__ -#define __class__ "Group" - esvg::Group::Group(PaintState _parentPaintState) : esvg::Base(_parentPaintState) { } @@ -31,8 +28,8 @@ esvg::Group::~Group() { } -bool esvg::Group::parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax) { - if (_element == nullptr) { +bool esvg::Group::parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax) { + if (_element.exist() == false) { return false; } // parse ... @@ -51,42 +48,42 @@ bool esvg::Group::parseXML(const std::shared_ptr& _element, mat2& _sizeMax.setValue(0,0); vec2 tmpPos(0,0); // parse all sub node : - for(int32_t iii=0; iii<_element->size() ; iii++) { - std::shared_ptr child = _element->getElement(iii); - if (child == nullptr) { + for(const auto it : _element.nodes) { + exml::Element child = _element.toElement(); + if (child.exist() == false) { // can be a comment ... continue; } std::shared_ptr elementParser; - if (child->getValue() == "g") { + if (child.getValue() == "g") { elementParser = std::make_shared(m_paint); - } else if (child->getValue() == "a") { + } else if (child.getValue() == "a") { // TODO ... - } else if (child->getValue() == "path") { + } else if (child.getValue() == "path") { elementParser = std::make_shared(m_paint); - } else if (child->getValue() == "rect") { + } else if (child.getValue() == "rect") { elementParser = std::make_shared(m_paint); - } else if (child->getValue() == "circle") { + } else if (child.getValue() == "circle") { elementParser = std::make_shared(m_paint); - } else if (child->getValue() == "ellipse") { + } else if (child.getValue() == "ellipse") { elementParser = std::make_shared(m_paint); - } else if (child->getValue() == "line") { + } else if (child.getValue() == "line") { elementParser = std::make_shared(m_paint); - } else if (child->getValue() == "polyline") { + } else if (child.getValue() == "polyline") { elementParser = std::make_shared(m_paint); - } else if (child->getValue() == "polygon") { + } else if (child.getValue() == "polygon") { elementParser = std::make_shared(m_paint); - } else if (child->getValue() == "text") { + } else if (child.getValue() == "text") { elementParser = std::make_shared(m_paint); } else { - ESVG_ERROR("(l "<getPos()<<") node not suported : \""<getValue()<<"\" must be [g,a,path,rect,circle,ellipse,line,polyline,polygon,text]"); + ESVG_ERROR("(l " << child.getPos() << ") node not suported : '" << child.getValue() << "' must be [g,a,path,rect,circle,ellipse,line,polyline,polygon,text]"); } if (elementParser == nullptr) { - ESVG_ERROR("(l "<getPos()<<") error on node: \""<getValue()<<"\" allocation error or not supported ..."); + ESVG_ERROR("(l " << child.getPos() << ") error on node: '" << child.getValue() << "' allocation error or not supported ..."); continue; } if (elementParser->parseXML(child, m_transformMatrix, tmpPos) == false) { - ESVG_ERROR("(l "<getPos()<<") error on node: \""<getValue()<<"\" Sub Parsing ERROR"); + ESVG_ERROR("(l " << child.getPos() << ") error on node: '" << child.getValue() << "' Sub Parsing ERROR"); elementParser.reset(); continue; } diff --git a/esvg/Group.h b/esvg/Group.h index c063b5a..7e47cc8 100644 --- a/esvg/Group.h +++ b/esvg/Group.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -17,7 +17,7 @@ namespace esvg { public: Group(PaintState _parentPaintState); ~Group(); - virtual bool parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax); + virtual bool parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax); virtual void display(int32_t spacing); virtual void draw(esvg::Renderer& _myRenderer, mat2& _basicTrans, int32_t _level); }; diff --git a/esvg/Line.cpp b/esvg/Line.cpp index 2f18111..003a360 100644 --- a/esvg/Line.cpp +++ b/esvg/Line.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -11,9 +11,6 @@ #include #include -#undef __class__ -#define __class__ "Line" - esvg::Line::Line(PaintState _parentPaintState) : esvg::Base(_parentPaintState) { m_startPos.setValue(0,0); m_stopPos.setValue(0,0); @@ -23,10 +20,10 @@ esvg::Line::~Line() { } -bool esvg::Line::parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax) { +bool esvg::Line::parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax) { // line must have a minimum size... m_paint.strokeWidth = 1; - if (_element == nullptr) { + if (_element.exist() == false) { return false; } parseTransform(_element); @@ -35,20 +32,20 @@ bool esvg::Line::parseXML(const std::shared_ptr& _element, mat2& // add the property of the parrent modifications ... m_transformMatrix *= _parentTrans; - std::string content = _element->getAttribute("x1"); - if (content.size()!=0) { + std::string content = _element.attributes["x1"]; + if (content.size() != 0) { m_startPos.setX(parseLength(content)); } - content = _element->getAttribute("y1"); - if (content.size()!=0) { + content = _element.attributes["y1"]; + if (content.size() != 0) { m_startPos.setY(parseLength(content)); } - content = _element->getAttribute("x2"); - if (content.size()!=0) { + content = _element.attributes["x2"]; + if (content.size() != 0) { m_stopPos.setX(parseLength(content)); } - content = _element->getAttribute("y2"); - if (content.size()!=0) { + content = _element.attributes["y2"]; + if (content.size() != 0) { m_stopPos.setY(parseLength(content)); } _sizeMax.setValue(std::max(m_startPos.x(), m_stopPos.x()), diff --git a/esvg/Line.h b/esvg/Line.h index 442292c..3540140 100644 --- a/esvg/Line.h +++ b/esvg/Line.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -17,7 +17,7 @@ namespace esvg { public: Line(PaintState _parentPaintState); ~Line(); - virtual bool parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax); + virtual bool parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax); virtual void display(int32_t _spacing); virtual void draw(esvg::Renderer& _myRenderer, mat2& _basicTrans, int32_t _level); }; diff --git a/esvg/LinearGradient.cpp b/esvg/LinearGradient.cpp index 76d8b50..19b2d79 100644 --- a/esvg/LinearGradient.cpp +++ b/esvg/LinearGradient.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -13,9 +13,6 @@ #include #include -#undef __class__ -#define __class__ "LinearGradient" - esvg::LinearGradient::LinearGradient(PaintState _parentPaintState) : esvg::Base(_parentPaintState), m_pos1(vec2(50,50), esvg::distance_pourcent), @@ -30,15 +27,15 @@ esvg::LinearGradient::~LinearGradient() { } -bool esvg::LinearGradient::parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax) { +bool esvg::LinearGradient::parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax) { // line must have a minimum size... //m_paint.strokeWidth = 1; - if (_element == nullptr) { + if (_element.exist() == false) { return false; } // ---------------- get unique ID ---------------- - m_id = _element->getAttribute("id"); + m_id = _element.attributes["id"]; //parseTransform(_element); //parsePaintAttr(_element); @@ -46,19 +43,19 @@ bool esvg::LinearGradient::parseXML(const std::shared_ptr& _eleme // add the property of the parrent modifications ... m_transformMatrix *= _parentTrans; - std::string contentX = _element->getAttribute("x1"); - std::string contentY = _element->getAttribute("y1"); + std::string contentX = _element.attributes["x1"]; + std::string contentY = _element.attributes["y1"]; if ( contentX != "" && contentY != "") { m_pos1.set(contentX, contentY); } - contentX = _element->getAttribute("x2"); - contentY = _element->getAttribute("y2"); + contentX = _element.attributes["x2"]; + contentY = _element.attributes["y2"]; if ( contentX != "" && contentY != "") { m_pos2.set(contentX, contentY); } - contentX = _element->getAttribute("gradientUnits"); + contentX = _element.attributes["gradientUnits"]; if (contentX == "userSpaceOnUse") { m_unit = gradientUnits_userSpaceOnUse; } else { @@ -68,7 +65,7 @@ bool esvg::LinearGradient::parseXML(const std::shared_ptr& _eleme ESVG_ERROR("Parsing error of 'gradientUnits' ==> not suported value: '" << contentX << "' not in : {userSpaceOnUse/objectBoundingBox} use objectBoundingBox"); } } - contentX = _element->getAttribute("spreadMethod"); + contentX = _element.attributes["spreadMethod"]; if (contentX == "reflect") { m_spread = spreadMethod_reflect; } else if (contentX == "repeat") { @@ -81,21 +78,21 @@ bool esvg::LinearGradient::parseXML(const std::shared_ptr& _eleme } } // note: xlink:href is incompatible with subNode "stop" - m_href = _element->getAttribute("xlink:href"); + m_href = _element.attributes["xlink:href"]; if (m_href.size() != 0) { m_href = std::string(m_href.begin()+1, m_href.end()); } // parse all sub node : - for(int32_t iii=0; iii<_element->size() ; iii++) { - std::shared_ptr child = _element->getElement(iii); - if (child == nullptr) { + for(const auto it : _element.nodes) { + exml::Element child = it.toElement(); + if (child.exist() == false) { // can be a comment ... continue; } - if (child->getValue() == "stop") { + if (child.getValue() == "stop") { float offset = 100; etk::Color stopColor = etk::color::none; - std::string content = child->getAttribute("offset"); + std::string content = child.attributes["offset"]; if (content.size()!=0) { std::pair tmp = parseLength2(content); if (tmp.second == esvg::distance_pixel) { @@ -107,26 +104,26 @@ bool esvg::LinearGradient::parseXML(const std::shared_ptr& _eleme offset = tmp.first; } } - content = child->getAttribute("stop-color"); + content = child.attributes["stop-color"]; if (content.size()!=0) { stopColor = parseColor(content).first; - ESVG_VERBOSE(" color : \"" << content << "\" == > " << stopColor); + ESVG_VERBOSE(" color : '" << content << "' == > " << stopColor); } - content = child->getAttribute("stop-opacity"); + content = child.attributes["stop-opacity"]; if (content.size()!=0) { float opacity = parseLength(content); opacity = std::avg(0.0f, opacity, 1.0f); stopColor.setA(opacity); - ESVG_VERBOSE(" opacity : \"" << content << "\" == > " << stopColor); + ESVG_VERBOSE(" opacity : '" << content << "' == > " << stopColor); } m_data.push_back(std::pair>(offset, stopColor)); } else { - ESVG_ERROR("(l " << child->getPos() << ") node not suported : \"" << child->getValue() << "\" must be [stop]"); + ESVG_ERROR("(l " << child.getPos() << ") node not suported : '" << child.getValue() << "' must be [stop]"); } } if (m_data.size() != 0) { if (m_href != "") { - ESVG_ERROR("(l " << _element->getPos() << ") node can not have an xlink:href element with sub node named: stop ==> removing href"); + ESVG_ERROR("(l " << _element.getPos() << ") node can not have an xlink:href element with sub node named: stop ==> removing href"); m_href = ""; } } diff --git a/esvg/LinearGradient.h b/esvg/LinearGradient.h index af7f519..55b82ae 100644 --- a/esvg/LinearGradient.h +++ b/esvg/LinearGradient.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -26,7 +26,7 @@ namespace esvg { public: LinearGradient(PaintState _parentPaintState); ~LinearGradient(); - virtual bool parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax); + virtual bool parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax); virtual void display(int32_t _spacing); virtual void draw(esvg::Renderer& _myRenderer, mat2& _basicTrans, int32_t _level); public: diff --git a/esvg/Path.cpp b/esvg/Path.cpp index 5c0eb21..9943a76 100644 --- a/esvg/Path.cpp +++ b/esvg/Path.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -11,9 +11,6 @@ #include #include -#undef __class__ -#define __class__ "Path" - esvg::Path::Path(PaintState _parentPaintState) : esvg::Base(_parentPaintState) { } @@ -81,8 +78,8 @@ std::string cleanBadSpaces(const std::string& _input) { return out; } -bool esvg::Path::parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax) { - if (_element == nullptr) { +bool esvg::Path::parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax) { + if (_element.exist() == false) { return false; } parseTransform(_element); @@ -92,9 +89,9 @@ bool esvg::Path::parseXML(const std::shared_ptr& _element, mat2& m_transformMatrix *= _parentTrans; - std::string elementXML1 = _element->getAttribute("d"); + std::string elementXML1 = _element.attributes["d"]; if (elementXML1.size() == 0) { - ESVG_WARNING("(l "<<_element->getPos()<<") path: missing 'd' attribute or empty"); + ESVG_WARNING("(l "<<_element.getPos()<<") path: missing 'd' attribute or empty"); return false; } ESVG_VERBOSE("Parse Path : \"" << elementXML1 << "\""); diff --git a/esvg/Path.h b/esvg/Path.h index fb46acd..0465334 100644 --- a/esvg/Path.h +++ b/esvg/Path.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -17,7 +17,7 @@ namespace esvg { public: Path(PaintState _parentPaintState); ~Path(); - virtual bool parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax); + virtual bool parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax); virtual void display(int32_t _spacing); virtual void draw(esvg::Renderer& _myRenderer, mat2& _basicTrans, int32_t _level); }; diff --git a/esvg/Polygon.cpp b/esvg/Polygon.cpp index 97137c7..e46d756 100644 --- a/esvg/Polygon.cpp +++ b/esvg/Polygon.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -11,9 +11,6 @@ #include #include -#undef __class__ -#define __class__ "Polygon" - esvg::Polygon::Polygon(PaintState parentPaintState) : esvg::Base(parentPaintState) { } @@ -22,8 +19,8 @@ esvg::Polygon::~Polygon() { } -bool esvg::Polygon::parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax) { - if (_element == nullptr) { +bool esvg::Polygon::parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax) { + if (_element.exist() == false) { return false; } parseTransform(_element); @@ -36,7 +33,7 @@ bool esvg::Polygon::parseXML(const std::shared_ptr& _element, mat ESVG_VERBOSE("parsed P2. trans: " << m_transformMatrix); - const std::string sss1 = _element->getAttribute("points"); + const std::string sss1 = _element.attributes["points"]; if (sss1.size() == 0) { ESVG_ERROR("(l "/*<<_element->Pos()*/<<") polygon: missing points attribute"); return false; diff --git a/esvg/Polygon.h b/esvg/Polygon.h index c3e21df..8ed2e22 100644 --- a/esvg/Polygon.h +++ b/esvg/Polygon.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -24,7 +24,7 @@ namespace esvg { public: Polygon(PaintState parentPaintState); ~Polygon(); - virtual bool parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax); + virtual bool parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax); virtual void display(int32_t _spacing); virtual void draw(esvg::Renderer& _myRenderer, mat2& _basicTrans, int32_t _level); }; diff --git a/esvg/Polyline.cpp b/esvg/Polyline.cpp index b1ff9ab..acaeb2b 100644 --- a/esvg/Polyline.cpp +++ b/esvg/Polyline.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -11,9 +11,6 @@ #include #include -#undef __class__ -#define __class__ "Polyline" - esvg::Polyline::Polyline(PaintState _parentPaintState) : esvg::Base(_parentPaintState) { } @@ -22,10 +19,10 @@ esvg::Polyline::~Polyline() { } -bool esvg::Polyline::parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax) { +bool esvg::Polyline::parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax) { // line must have a minimum size... m_paint.strokeWidth = 1; - if (_element == nullptr) { + if (_element.exist() == false) { return false; } parseTransform(_element); @@ -34,9 +31,9 @@ bool esvg::Polyline::parseXML(const std::shared_ptr& _element, ma // add the property of the parrent modifications ... m_transformMatrix *= _parentTrans; - std::string sss1 = _element->getAttribute("points"); + std::string sss1 = _element.attributes["points"]; if (sss1.size() == 0) { - ESVG_ERROR("(l "<<_element->getPos()<<") polyline: missing points attribute"); + ESVG_ERROR("(l "<<_element.getPos()<<") polyline: missing points attribute"); return false; } _sizeMax.setValue(0,0); diff --git a/esvg/Polyline.h b/esvg/Polyline.h index 6378166..90a8d30 100644 --- a/esvg/Polyline.h +++ b/esvg/Polyline.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -17,7 +17,7 @@ namespace esvg { public: Polyline(PaintState _parentPaintState); ~Polyline(); - virtual bool parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax); + virtual bool parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax); virtual void display(int32_t _spacing); virtual void draw(esvg::Renderer& _myRenderer, mat2& _basicTrans, int32_t _level); }; diff --git a/esvg/RadialGradient.cpp b/esvg/RadialGradient.cpp index acf330c..ed09146 100644 --- a/esvg/RadialGradient.cpp +++ b/esvg/RadialGradient.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -13,9 +13,6 @@ #include #include -#undef __class__ -#define __class__ "RadialGradient" - esvg::RadialGradient::RadialGradient(PaintState _parentPaintState) : esvg::Base(_parentPaintState), m_center(vec2(50,50), esvg::distance_pourcent), @@ -31,15 +28,15 @@ esvg::RadialGradient::~RadialGradient() { } -bool esvg::RadialGradient::parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax) { +bool esvg::RadialGradient::parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax) { // line must have a minimum size... //m_paint.strokeWidth = 1; - if (_element == nullptr) { + if (_element.exist() == false) { return false; } // ---------------- get unique ID ---------------- - m_id = _element->getAttribute("id"); + m_id = _element.attributes["id"]; //parseTransform(_element); //parsePaintAttr(_element); @@ -47,23 +44,23 @@ bool esvg::RadialGradient::parseXML(const std::shared_ptr& _eleme // add the property of the parrent modifications ... m_transformMatrix *= _parentTrans; - std::string contentX = _element->getAttribute("cx"); - std::string contentY = _element->getAttribute("cy"); + std::string contentX = _element.attributes["cx"]; + std::string contentY = _element.attributes["cy"]; if ( contentX != "" && contentY != "") { m_center.set(contentX, contentY); } - contentX = _element->getAttribute("r"); + contentX = _element.attributes["r"]; if (contentX != "") { m_radius.set(contentX); } - contentX = _element->getAttribute("fx"); - contentY = _element->getAttribute("fy"); + contentX = _element.attributes["fx"]; + contentY = _element.attributes["fy"]; if ( contentX != "" && contentY != "") { m_focal.set(contentX, contentY); } - contentX = _element->getAttribute("gradientUnits"); + contentX = _element.attributes["gradientUnits"]; if (contentX == "userSpaceOnUse") { m_unit = gradientUnits_userSpaceOnUse; } else { @@ -73,7 +70,7 @@ bool esvg::RadialGradient::parseXML(const std::shared_ptr& _eleme ESVG_ERROR("Parsing error of 'gradientUnits' ==> not suported value: '" << contentX << "' not in : {userSpaceOnUse/objectBoundingBox} use objectBoundingBox"); } } - contentX = _element->getAttribute("spreadMethod"); + contentX = _element.attributes["spreadMethod"]; if (contentX == "reflect") { m_spread = spreadMethod_reflect; } else if (contentX == "repeat") { @@ -86,21 +83,21 @@ bool esvg::RadialGradient::parseXML(const std::shared_ptr& _eleme } } // note: xlink:href is incompatible with subNode "stop" - m_href = _element->getAttribute("xlink:href"); + m_href = _element.attributes["xlink:href"]; if (m_href.size() != 0) { m_href = std::string(m_href.begin()+1, m_href.end()); } // parse all sub node : - for(int32_t iii=0; iii<_element->size() ; iii++) { - std::shared_ptr child = _element->getElement(iii); - if (child == nullptr) { + for(auto it : _element.nodes) { + exml::Element child = it.toElement(); + if (child.exist() == false) { // can be a comment ... continue; } - if (child->getValue() == "stop") { + if (child.getValue() == "stop") { float offset = 100; etk::Color stopColor = etk::color::none; - std::string content = child->getAttribute("offset"); + std::string content = child.attributes["offset"]; if (content.size()!=0) { std::pair tmp = parseLength2(content); if (tmp.second == esvg::distance_pixel) { @@ -112,26 +109,26 @@ bool esvg::RadialGradient::parseXML(const std::shared_ptr& _eleme offset = tmp.first; } } - content = child->getAttribute("stop-color"); + content = child.attributes["stop-color"]; if (content.size()!=0) { stopColor = parseColor(content).first; ESVG_VERBOSE(" color : \"" << content << "\" == > " << stopColor); } - content = child->getAttribute("stop-opacity"); + content = child.attributes["stop-opacity"]; if (content.size()!=0) { float opacity = parseLength(content); opacity = std::avg(0.0f, opacity, 1.0f); stopColor.setA(opacity); - ESVG_VERBOSE(" opacity : \"" << content << "\" == > " << stopColor); + ESVG_VERBOSE(" opacity : '" << content << "' == > " << stopColor); } m_data.push_back(std::pair>(offset, stopColor)); } else { - ESVG_ERROR("(l " << child->getPos() << ") node not suported : \"" << child->getValue() << "\" must be [stop]"); + ESVG_ERROR("(l " << child.getPos() << ") node not suported : '" << child.getValue() << "' must be [stop]"); } } if (m_data.size() != 0) { if (m_href != "") { - ESVG_ERROR("(l " << _element->getPos() << ") node can not have an xlink:href element with sub node named: stop ==> removing href"); + ESVG_ERROR("(l " << _element.getPos() << ") node can not have an xlink:href element with sub node named: stop ==> removing href"); m_href = ""; } } diff --git a/esvg/RadialGradient.h b/esvg/RadialGradient.h index e9d1521..aa9436b 100644 --- a/esvg/RadialGradient.h +++ b/esvg/RadialGradient.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -27,7 +27,7 @@ namespace esvg { public: RadialGradient(PaintState _parentPaintState); ~RadialGradient(); - virtual bool parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax); + virtual bool parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax); virtual void display(int32_t _spacing); virtual void draw(esvg::Renderer& _myRenderer, mat2& _basicTrans, int32_t _level); public: diff --git a/esvg/Rectangle.cpp b/esvg/Rectangle.cpp index 87ea8e1..1e8fee7 100644 --- a/esvg/Rectangle.cpp +++ b/esvg/Rectangle.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -11,10 +11,6 @@ #include #include -#undef __class__ -#define __class__ "Rectangle" - - esvg::Rectangle::Rectangle(PaintState _parentPaintState) : esvg::Base(_parentPaintState) { m_position.setValue(0,0); m_size.setValue(0,0); @@ -25,8 +21,8 @@ esvg::Rectangle::~Rectangle() { } -bool esvg::Rectangle::parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax) { - if (_element == nullptr) { +bool esvg::Rectangle::parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax) { + if (_element.exist() == false) { return false; } m_position.setValue(0.0f, 0.0f); @@ -41,11 +37,11 @@ bool esvg::Rectangle::parseXML(const std::shared_ptr& _element, m parsePosition(_element, m_position, m_size); - std::string content = _element->getAttribute("rx"); + std::string content = _element.attributes["rx"]; if (content.size()!=0) { m_roundedCorner.setX(parseLength(content)); } - content = _element->getAttribute("ry"); + content = _element.attributes["ry"]; if (content.size()!=0) { m_roundedCorner.setY(parseLength(content)); } diff --git a/esvg/Rectangle.h b/esvg/Rectangle.h index f7b8062..fc16e1d 100644 --- a/esvg/Rectangle.h +++ b/esvg/Rectangle.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -18,7 +18,7 @@ namespace esvg { public: Rectangle(PaintState _parentPaintState); ~Rectangle(); - virtual bool parseXML(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax); + virtual bool parseXML(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax); virtual void display(int32_t _spacing); virtual void draw(esvg::Renderer& _myRenderer, mat2& _basicTrans, int32_t _level); }; diff --git a/esvg/Renderer.cpp b/esvg/Renderer.cpp index 3a7aca9..60850e1 100644 --- a/esvg/Renderer.cpp +++ b/esvg/Renderer.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -10,9 +10,6 @@ #include #include -#undef __class__ -#define __class__ "Renderer" - esvg::Renderer::Renderer(const ivec2& _size, esvg::Document* _document, bool _visualDebug) : #ifdef DEBUG m_visualDebug(_visualDebug), diff --git a/esvg/Renderer.h b/esvg/Renderer.h index 8e8281f..6b656e2 100644 --- a/esvg/Renderer.h +++ b/esvg/Renderer.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/Stroking.cpp b/esvg/Stroking.cpp index e56e13a..ab5bbba 100644 --- a/esvg/Stroking.cpp +++ b/esvg/Stroking.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/Stroking.h b/esvg/Stroking.h index 8390edf..6a2eb7a 100644 --- a/esvg/Stroking.h +++ b/esvg/Stroking.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/Text.cpp b/esvg/Text.cpp index 26848ff..734d2e8 100644 --- a/esvg/Text.cpp +++ b/esvg/Text.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -9,9 +9,6 @@ #include #include -#undef __class__ -#define __class__ "Text" - esvg::Text::Text(PaintState _parentPaintState) : esvg::Base(_parentPaintState) { } @@ -20,7 +17,7 @@ esvg::Text::~Text() { } -bool esvg::Text::parse(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax) { +bool esvg::Text::parse(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax) { _sizeMax.setValue(0,0); ESVG_ERROR("NOT IMPLEMENTED"); return false; diff --git a/esvg/Text.h b/esvg/Text.h index 1b1b0d7..f35e08e 100644 --- a/esvg/Text.h +++ b/esvg/Text.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -14,7 +14,7 @@ namespace esvg { public: Text(PaintState _parentPaintState); ~Text(); - virtual bool parse(const std::shared_ptr& _element, mat2& _parentTrans, vec2& _sizeMax); + virtual bool parse(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax); virtual void display(int32_t _spacing); }; } diff --git a/esvg/cap.cpp b/esvg/cap.cpp index 3757c7d..e24bef7 100644 --- a/esvg/cap.cpp +++ b/esvg/cap.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/cap.h b/esvg/cap.h index 6d4cd98..38ce57d 100644 --- a/esvg/cap.h +++ b/esvg/cap.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/debug.cpp b/esvg/debug.cpp index dd4ee73..1122678 100644 --- a/esvg/debug.cpp +++ b/esvg/debug.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/debug.h b/esvg/debug.h index e059d27..26cc67e 100644 --- a/esvg/debug.h +++ b/esvg/debug.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/esvg.cpp b/esvg/esvg.cpp index db727a7..3787ab8 100644 --- a/esvg/esvg.cpp +++ b/esvg/esvg.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -21,10 +21,6 @@ #include #include -#undef __class__ -#define __class__ "Document" - - esvg::Document::Document() { m_fileName = ""; m_version = "0.0"; @@ -158,18 +154,18 @@ bool esvg::Document::parse(const std::string& _data) { clear(); exml::Document doc; if (doc.parse(_data) == false) { - ESVG_ERROR("Error occured when loading SVG : " << m_fileName); + ESVG_ERROR("Error occured when loading SVG: " << m_fileName); m_loadOK = false; return m_loadOK; } - if (doc.size() == 0) { - ESVG_ERROR("(l ?) No nodes in the SVG file ... \"" << m_fileName << "\""); + if (doc.nodes.size() == 0) { + ESVG_ERROR("(l ?) No nodes in the SVG file ... '" << m_fileName << "'"); m_loadOK = false; return m_loadOK; } - std::shared_ptr root = doc.getNamed("svg" ); - if (root == nullptr) { - ESVG_ERROR("(l ?) main node not find: \"svg\" in \"" << m_fileName << "\""); + exml::Element root = doc.nodes["svg"]; + if (root.exist() == false) { + ESVG_ERROR("(l ?) main node not find: 'svg' in '" << m_fileName << "'"); m_loadOK = false; return m_loadOK; } @@ -191,14 +187,14 @@ bool esvg::Document::load(const std::string& _file) { m_loadOK = false; return m_loadOK; } - if (doc.size() == 0) { - ESVG_ERROR("(l ?) No nodes in the SVG file ... \"" << m_fileName << "\""); + if (doc.nodes.size() == 0) { + ESVG_ERROR("(l ?) No nodes in the SVG file ... '" << m_fileName << "'"); m_loadOK = false; return m_loadOK; } - std::shared_ptr root = doc.getNamed("svg"); - if (root == nullptr) { - ESVG_ERROR("(l ?) main node not find: \"svg\" in \"" << m_fileName << "\""); + exml::Element root = doc.nodes["svg"]; + if (root.exist() == false) { + ESVG_ERROR("(l ?) main node not find: 'svg' in '" << m_fileName << "'"); m_loadOK = false; return m_loadOK; } @@ -211,16 +207,16 @@ bool esvg::Document::store(const std::string& _file) { return false; } -bool esvg::Document::cleanStyleProperty(const std::shared_ptr& _root) { +bool esvg::Document::cleanStyleProperty(const exml::Element& _root) { // for each nodes: - for(int32_t iii=0; iii< _root->size(); iii++) { - std::shared_ptr child = _root->getElement(iii); - if (child == nullptr) { + for(auto it: _root.nodes) { + exml::Element child = it.toElement(); + if (child.exist() == false) { continue; } // get attribute style: - if (child->existAttribute("style") == true) { - std::string content = child->getAttribute("style"); + if (child.attributes.exist("style") == true) { + std::string content = child.attributes["style"]; if (content.size() != 0) { std::vector listStyle = etk::split(content, ';'); for (auto &it : listStyle) { @@ -230,11 +226,11 @@ bool esvg::Document::cleanStyleProperty(const std::shared_ptr& _r continue; } // TODO : Check if the attibute already exist ... - child->setAttribute(value[0], value[1]); + child.attributes.set(value[0], value[1]); } } // remove attribute style: - child->removeAttribute("style"); + child.attributes.remove("style"); } // sub-parsing ... cleanStyleProperty(child); @@ -242,9 +238,9 @@ bool esvg::Document::cleanStyleProperty(const std::shared_ptr& _r return true; } -bool esvg::Document::parseXMLData(const std::shared_ptr& _root, bool _isReference) { +bool esvg::Document::parseXMLData(const exml::Element& _root, bool _isReference) { // get the svg version : - m_version = _root->getAttribute("version"); + m_version = _root.attributes["version"]; // parse ... vec2 pos(0,0); if (_isReference == false) { @@ -258,75 +254,75 @@ bool esvg::Document::parseXMLData(const std::shared_ptr& _root, b vec2 maxSize(0,0); vec2 size(0,0); // parse all sub node: - for(int32_t iii=0; iii< _root->size(); iii++) { - std::shared_ptr child = _root->getElement(iii); - if (child == nullptr) { + for(auto it : _root.nodes) { + exml::Element child = it.toElement(); + if (child.exist() == false) { // comment can be here... continue; } std::shared_ptr elementParser; - if (child->getValue() == "g") { + if (child.getValue() == "g") { elementParser = std::make_shared(m_paint); - } else if (child->getValue() == "a") { + } else if (child.getValue() == "a") { ESVG_INFO("Note : 'a' balise is parsed like a g balise ..."); elementParser = std::make_shared(m_paint); - } else if (child->getValue() == "title") { + } else if (child.getValue() == "title") { m_title = "TODO : set the title here ..."; continue; - } else if (child->getValue() == "path") { + } else if (child.getValue() == "path") { elementParser = std::make_shared(m_paint); - } else if (child->getValue() == "rect") { + } else if (child.getValue() == "rect") { elementParser = std::make_shared(m_paint); - } else if (child->getValue() == "circle") { + } else if (child.getValue() == "circle") { elementParser = std::make_shared(m_paint); - } else if (child->getValue() == "ellipse") { + } else if (child.getValue() == "ellipse") { elementParser = std::make_shared(m_paint); - } else if (child->getValue() == "line") { + } else if (child.getValue() == "line") { elementParser = std::make_shared(m_paint); - } else if (child->getValue() == "polyline") { + } else if (child.getValue() == "polyline") { elementParser = std::make_shared(m_paint); - } else if (child->getValue() == "polygon") { + } else if (child.getValue() == "polygon") { elementParser = std::make_shared(m_paint); - } else if (child->getValue() == "text") { + } else if (child.getValue() == "text") { elementParser = std::make_shared(m_paint); - } else if (child->getValue() == "radialGradient") { + } else if (child.getValue() == "radialGradient") { if (_isReference == false) { - ESVG_ERROR("'" << child->getValue() << "' node must not be defined outside a defs Section"); + ESVG_ERROR("'" << child.getValue() << "' node must not be defined outside a defs Section"); continue; } else { elementParser = std::make_shared(m_paint); } - } else if (child->getValue() == "linearGradient") { + } else if (child.getValue() == "linearGradient") { if (_isReference == false) { - ESVG_ERROR("'" << child->getValue() << "' node must not be defined outside a defs Section"); + ESVG_ERROR("'" << child.getValue() << "' node must not be defined outside a defs Section"); continue; } else { elementParser = std::make_shared(m_paint); } - } else if (child->getValue() == "defs") { + } else if (child.getValue() == "defs") { if (_isReference == true) { - ESVG_ERROR("'" << child->getValue() << "' node must not be defined in a defs Section"); + ESVG_ERROR("'" << child.getValue() << "' node must not be defined in a defs Section"); continue; } else { bool retRefs = parseXMLData(child, true); // TODO : Use retRefs ... continue; } - } else if (child->getValue() == "sodipodi:namedview") { + } else if (child.getValue() == "sodipodi:namedview") { // Node ignore : generaly inkscape data continue; - } else if (child->getValue() == "metadata") { + } else if (child.getValue() == "metadata") { // Node ignore : generaly inkscape data continue; } else { - ESVG_ERROR("(l "<getPos()<<") node not suported : \""<getValue()<<"\" must be [title,g,a,path,rect,circle,ellipse,line,polyline,polygon,text,metadata]"); + ESVG_ERROR("(l " << child.getPos() << ") node not suported : '" << child.getValue() << "' must be [title,g,a,path,rect,circle,ellipse,line,polyline,polygon,text,metadata]"); } if (elementParser == nullptr) { - ESVG_ERROR("(l "<getPos()<<") error on node: \""<getValue()<<"\" allocation error or not supported ..."); + ESVG_ERROR("(l " << child.getPos() << ") error on node: '" << child.getValue() << "' allocation error or not supported ..."); continue; } if (elementParser->parseXML(child, m_transformMatrix, size) == false) { - ESVG_ERROR("(l "<getPos()<<") error on node: \""<getValue()<<"\" Sub Parsing ERROR"); + ESVG_ERROR("(l " << child.getPos() << ") error on node: '" << child.getValue() << "' Sub Parsing ERROR"); elementParser.reset(); continue; } @@ -343,7 +339,8 @@ bool esvg::Document::parseXMLData(const std::shared_ptr& _root, b m_refList.push_back(elementParser); } } - if (m_size.x() == 0 || m_size.y()==0) { + if ( m_size.x() == 0 + || m_size.y()==0) { m_size.setValue((int32_t)maxSize.x(), (int32_t)maxSize.y()); } else { m_size.setValue((int32_t)m_size.x(), (int32_t)m_size.y()); diff --git a/esvg/esvg.h b/esvg/esvg.h index 3f86a42..925e2a3 100644 --- a/esvg/esvg.h +++ b/esvg/esvg.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -60,8 +60,8 @@ namespace esvg { /** * @brief change all style in a xml atribute */ - virtual bool cleanStyleProperty(const std::shared_ptr& _root); - virtual bool parseXMLData(const std::shared_ptr& _root, bool _isReference = false); + virtual bool cleanStyleProperty(const exml::Element& _root); + virtual bool parseXMLData(const exml::Element& _root, bool _isReference = false); public: bool isLoadOk() { return m_loadOK; diff --git a/esvg/gradientUnits.cpp b/esvg/gradientUnits.cpp index 48231ac..5ac4d8f 100644 --- a/esvg/gradientUnits.cpp +++ b/esvg/gradientUnits.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/gradientUnits.h b/esvg/gradientUnits.h index c45c991..6185b38 100644 --- a/esvg/gradientUnits.h +++ b/esvg/gradientUnits.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/join.cpp b/esvg/join.cpp index 8dc9ed7..1d80af9 100644 --- a/esvg/join.cpp +++ b/esvg/join.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/join.h b/esvg/join.h index be9659d..eaae1f6 100644 --- a/esvg/join.h +++ b/esvg/join.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/DynamicColor.cpp b/esvg/render/DynamicColor.cpp index 65d672a..553e7e8 100644 --- a/esvg/render/DynamicColor.cpp +++ b/esvg/render/DynamicColor.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -12,9 +12,6 @@ #include #include -#undef __class__ -#define __class__ "render::DynamicColorSpecial" - esvg::render::DynamicColorSpecial::DynamicColorSpecial(const std::string& _link, const mat2& _mtx) : m_linear(true), m_colorName(_link), @@ -444,9 +441,6 @@ void esvg::render::DynamicColorSpecial::generate(esvg::Document* _document) { } } -#undef __class__ -#define __class__ "render:DynamicColor" - std::shared_ptr esvg::render::createColor(std::pair, std::string> _color, const mat2& _mtx) { // Check if need to create a color: if ( _color.first.a() == 0x00 diff --git a/esvg/render/DynamicColor.h b/esvg/render/DynamicColor.h index 3df825e..6b6bf98 100644 --- a/esvg/render/DynamicColor.h +++ b/esvg/render/DynamicColor.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/Element.cpp b/esvg/render/Element.cpp index d970896..0ad3f32 100644 --- a/esvg/render/Element.cpp +++ b/esvg/render/Element.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -9,9 +9,6 @@ #include #include -#undef __class__ -#define __class__ "rerder::Element" - std::ostream& esvg::operator <<(std::ostream& _os, enum esvg::render::path _obj) { switch (_obj) { case esvg::render::path_stop: diff --git a/esvg/render/Element.h b/esvg/render/Element.h index dba16f5..e466140 100644 --- a/esvg/render/Element.h +++ b/esvg/render/Element.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/ElementBezierCurveTo.cpp b/esvg/render/ElementBezierCurveTo.cpp index 4b2bcac..4810658 100644 --- a/esvg/render/ElementBezierCurveTo.cpp +++ b/esvg/render/ElementBezierCurveTo.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -9,10 +9,6 @@ #include #include -#undef __class__ -#define __class__ "rerder::ElementBezierCurveTo" - - esvg::render::ElementBezierCurveTo::ElementBezierCurveTo(bool _relative, const vec2& _pos1, const vec2& _pos): Element(esvg::render::path_bezierCurveTo, _relative) { m_pos = _pos; diff --git a/esvg/render/ElementBezierCurveTo.h b/esvg/render/ElementBezierCurveTo.h index 0ce91f9..e4de14b 100644 --- a/esvg/render/ElementBezierCurveTo.h +++ b/esvg/render/ElementBezierCurveTo.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/ElementBezierSmoothCurveTo.cpp b/esvg/render/ElementBezierSmoothCurveTo.cpp index b200efc..62c9e53 100644 --- a/esvg/render/ElementBezierSmoothCurveTo.cpp +++ b/esvg/render/ElementBezierSmoothCurveTo.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -9,10 +9,6 @@ #include #include - -#undef __class__ -#define __class__ "rerder::ElementBezierSmoothCurveTo" - esvg::render::ElementBezierSmoothCurveTo::ElementBezierSmoothCurveTo(bool _relative, const vec2& _pos): Element(esvg::render::path_bezierSmoothCurveTo, _relative) { m_pos = _pos; diff --git a/esvg/render/ElementBezierSmoothCurveTo.h b/esvg/render/ElementBezierSmoothCurveTo.h index 3a67fe9..4e90c43 100644 --- a/esvg/render/ElementBezierSmoothCurveTo.h +++ b/esvg/render/ElementBezierSmoothCurveTo.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/ElementClose.cpp b/esvg/render/ElementClose.cpp index 4ed6d0c..5ffdecb 100644 --- a/esvg/render/ElementClose.cpp +++ b/esvg/render/ElementClose.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -9,10 +9,6 @@ #include #include - -#undef __class__ -#define __class__ "rerder::ElementClose" - esvg::render::ElementClose::ElementClose(bool _relative): Element(esvg::render::path_close, _relative) { diff --git a/esvg/render/ElementClose.h b/esvg/render/ElementClose.h index 5c5f04b..3724062 100644 --- a/esvg/render/ElementClose.h +++ b/esvg/render/ElementClose.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/ElementCurveTo.cpp b/esvg/render/ElementCurveTo.cpp index fb229c1..ad8041e 100644 --- a/esvg/render/ElementCurveTo.cpp +++ b/esvg/render/ElementCurveTo.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -9,10 +9,6 @@ #include #include -#undef __class__ -#define __class__ "rerder::ElementCurveTo" - - esvg::render::ElementCurveTo::ElementCurveTo(bool _relative, const vec2& _pos1, const vec2& _pos2, const vec2& _pos): Element(esvg::render::path_curveTo, _relative) { m_pos = _pos; diff --git a/esvg/render/ElementCurveTo.h b/esvg/render/ElementCurveTo.h index b48ac12..b84f616 100644 --- a/esvg/render/ElementCurveTo.h +++ b/esvg/render/ElementCurveTo.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -6,7 +6,6 @@ * @license APACHE v2.0 (see license file) */ - #include #include #include diff --git a/esvg/render/ElementElliptic.cpp b/esvg/render/ElementElliptic.cpp index eb57f8c..42a2ffa 100644 --- a/esvg/render/ElementElliptic.cpp +++ b/esvg/render/ElementElliptic.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -9,10 +9,6 @@ #include #include - -#undef __class__ -#define __class__ "rerder::ElementElliptic" - esvg::render::ElementElliptic::ElementElliptic(bool _relative, const vec2& _radius, // in m_vec1 float _angle, diff --git a/esvg/render/ElementElliptic.h b/esvg/render/ElementElliptic.h index 7ebb149..17d3415 100644 --- a/esvg/render/ElementElliptic.h +++ b/esvg/render/ElementElliptic.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/ElementLineTo.cpp b/esvg/render/ElementLineTo.cpp index cbe3a74..7abc886 100644 --- a/esvg/render/ElementLineTo.cpp +++ b/esvg/render/ElementLineTo.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -9,10 +9,6 @@ #include #include - -#undef __class__ -#define __class__ "rerder::ElementLineTo" - esvg::render::ElementLineTo::ElementLineTo(bool _relative, const vec2& _pos): Element(esvg::render::path_lineTo, _relative) { m_pos = _pos; diff --git a/esvg/render/ElementLineTo.h b/esvg/render/ElementLineTo.h index 260cd3c..bb703dd 100644 --- a/esvg/render/ElementLineTo.h +++ b/esvg/render/ElementLineTo.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/ElementLineToH.cpp b/esvg/render/ElementLineToH.cpp index 2fb2ada..75fb128 100644 --- a/esvg/render/ElementLineToH.cpp +++ b/esvg/render/ElementLineToH.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -9,10 +9,6 @@ #include #include -#undef __class__ -#define __class__ "rerder::ElementLineToH" - - esvg::render::ElementLineToH::ElementLineToH(bool _relative, float _posX): Element(esvg::render::path_lineToH, _relative) { m_pos = vec2(_posX, 0.0f); diff --git a/esvg/render/ElementLineToH.h b/esvg/render/ElementLineToH.h index 8a5edc5..0aa3fa9 100644 --- a/esvg/render/ElementLineToH.h +++ b/esvg/render/ElementLineToH.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/ElementLineToV.cpp b/esvg/render/ElementLineToV.cpp index 7623f33..04338fc 100644 --- a/esvg/render/ElementLineToV.cpp +++ b/esvg/render/ElementLineToV.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -9,10 +9,6 @@ #include #include -#undef __class__ -#define __class__ "rerder::ElementLineToV" - - esvg::render::ElementLineToV::ElementLineToV(bool _relative, float _posY): Element(esvg::render::path_lineToV, _relative) { m_pos = vec2(0.0f, _posY); diff --git a/esvg/render/ElementLineToV.h b/esvg/render/ElementLineToV.h index a0b785c..f535a12 100644 --- a/esvg/render/ElementLineToV.h +++ b/esvg/render/ElementLineToV.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/ElementMoveTo.cpp b/esvg/render/ElementMoveTo.cpp index aae2989..2b2324f 100644 --- a/esvg/render/ElementMoveTo.cpp +++ b/esvg/render/ElementMoveTo.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -9,9 +9,6 @@ #include #include -#undef __class__ -#define __class__ "rerder::ElementMoveTo" - esvg::render::ElementMoveTo::ElementMoveTo(bool _relative, const vec2& _pos): Element(esvg::render::path_moveTo, _relative) { m_pos = _pos; diff --git a/esvg/render/ElementMoveTo.h b/esvg/render/ElementMoveTo.h index c5b4450..96f1398 100644 --- a/esvg/render/ElementMoveTo.h +++ b/esvg/render/ElementMoveTo.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/ElementSmoothCurveTo.cpp b/esvg/render/ElementSmoothCurveTo.cpp index 88e8d65..e88810c 100644 --- a/esvg/render/ElementSmoothCurveTo.cpp +++ b/esvg/render/ElementSmoothCurveTo.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -9,10 +9,6 @@ #include #include - -#undef __class__ -#define __class__ "rerder::ElementSmoothCurveTo" - esvg::render::ElementSmoothCurveTo::ElementSmoothCurveTo(bool _relative, const vec2& _pos2, const vec2& _pos): Element(esvg::render::path_smoothCurveTo, _relative) { m_pos = _pos; diff --git a/esvg/render/ElementSmoothCurveTo.h b/esvg/render/ElementSmoothCurveTo.h index 584a998..e868a66 100644 --- a/esvg/render/ElementSmoothCurveTo.h +++ b/esvg/render/ElementSmoothCurveTo.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/ElementStop.cpp b/esvg/render/ElementStop.cpp index e806a37..c8e7e68 100644 --- a/esvg/render/ElementStop.cpp +++ b/esvg/render/ElementStop.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -9,10 +9,6 @@ #include #include - -#undef __class__ -#define __class__ "rerder::ElementStop" - esvg::render::ElementStop::ElementStop(): Element(esvg::render::path_stop) { diff --git a/esvg/render/ElementStop.h b/esvg/render/ElementStop.h index a7718f6..39468f4 100644 --- a/esvg/render/ElementStop.h +++ b/esvg/render/ElementStop.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/Path.cpp b/esvg/render/Path.cpp index e322a87..c50ee2b 100644 --- a/esvg/render/Path.cpp +++ b/esvg/render/Path.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -9,9 +9,6 @@ #include #include -#undef __class__ -#define __class__ "rerder::Path" - void esvg::render::Path::clear() { m_listElement.clear(); } diff --git a/esvg/render/Path.h b/esvg/render/Path.h index b3eda53..5acf849 100644 --- a/esvg/render/Path.h +++ b/esvg/render/Path.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/Point.cpp b/esvg/render/Point.cpp index c45e618..cc2eb56 100644 --- a/esvg/render/Point.cpp +++ b/esvg/render/Point.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -9,9 +9,6 @@ #include #include -#undef __class__ -#define __class__ "rerder::Point" - void esvg::render::Point::setEndPath() { if (m_type == esvg::render::Point::type_interpolation) { ESVG_WARNING("Request stop path of an interpolate Point"); diff --git a/esvg/render/Point.h b/esvg/render/Point.h index 4b960fa..f781acc 100644 --- a/esvg/render/Point.h +++ b/esvg/render/Point.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/PointList.cpp b/esvg/render/PointList.cpp index 4733a5c..88c1e66 100644 --- a/esvg/render/PointList.cpp +++ b/esvg/render/PointList.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/PointList.h b/esvg/render/PointList.h index 71aca00..aed59dd 100644 --- a/esvg/render/PointList.h +++ b/esvg/render/PointList.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/Scanline.cpp b/esvg/render/Scanline.cpp index 92cc571..f344448 100644 --- a/esvg/render/Scanline.cpp +++ b/esvg/render/Scanline.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -9,9 +9,6 @@ #include #include -#undef __class__ -#define __class__ "rerder::Scanline" - esvg::render::Scanline::Scanline(size_t _size) { float tmp(0); m_data.resize(_size, tmp); diff --git a/esvg/render/Scanline.h b/esvg/render/Scanline.h index dcd357c..eac36f6 100644 --- a/esvg/render/Scanline.h +++ b/esvg/render/Scanline.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/Segment.cpp b/esvg/render/Segment.cpp index 2a12efc..10e031a 100644 --- a/esvg/render/Segment.cpp +++ b/esvg/render/Segment.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -9,9 +9,6 @@ #include #include -#undef __class__ -#define __class__ "rerder::Segment" - esvg::render::Segment::Segment(const vec2& _p0, const vec2& _p1) { // segment register all time the lower at P0n then we need to register the sens of the path p0 = _p0; diff --git a/esvg/render/Segment.h b/esvg/render/Segment.h index ab82967..ec244a8 100644 --- a/esvg/render/Segment.h +++ b/esvg/render/Segment.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/SegmentList.cpp b/esvg/render/SegmentList.cpp index c3ce342..e471f00 100644 --- a/esvg/render/SegmentList.cpp +++ b/esvg/render/SegmentList.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -10,11 +10,6 @@ #include #include - - -#undef __class__ -#define __class__ "rerder::SegmentList" - esvg::render::SegmentList::SegmentList() { } diff --git a/esvg/render/SegmentList.h b/esvg/render/SegmentList.h index a863465..165d73d 100644 --- a/esvg/render/SegmentList.h +++ b/esvg/render/SegmentList.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/render/Weight.cpp b/esvg/render/Weight.cpp index 4685199..a4f5461 100644 --- a/esvg/render/Weight.cpp +++ b/esvg/render/Weight.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved @@ -9,10 +9,6 @@ #include #include -#undef __class__ -#define __class__ "render::Weight" - - esvg::render::Weight::Weight() : m_size(0,0) { diff --git a/esvg/render/Weight.h b/esvg/render/Weight.h index 395a075..d6731f5 100644 --- a/esvg/render/Weight.h +++ b/esvg/render/Weight.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/spreadMethod.cpp b/esvg/spreadMethod.cpp index 62402d0..7555b66 100644 --- a/esvg/spreadMethod.cpp +++ b/esvg/spreadMethod.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/esvg/spreadMethod.h b/esvg/spreadMethod.h index d0d5dfd..bc4ece7 100644 --- a/esvg/spreadMethod.h +++ b/esvg/spreadMethod.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved diff --git a/test/main.cpp b/test/main.cpp index 6a26dc2..72410ba 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2014, Edouard DUPIN, all right reserved @@ -11,9 +11,6 @@ #include #include -#undef __class__ -#define __class__ "esvg::test" - bool g_visualDebug = false; diff --git a/test/main.h b/test/main.h index c414359..c81b4f8 100644 --- a/test/main.h +++ b/test/main.h @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2014, Edouard DUPIN, all right reserved diff --git a/test/testCap.cpp b/test/testCap.cpp index 03f601e..07ebdc0 100644 --- a/test/testCap.cpp +++ b/test/testCap.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2014, Edouard DUPIN, all right reserved @@ -10,9 +10,6 @@ #include #include "main.h" -#undef __class__ -#define __class__ "TestLine" - TEST(TestCap, butt) { std::string data("" "" diff --git a/test/testCircle.cpp b/test/testCircle.cpp index 740a923..514a424 100644 --- a/test/testCircle.cpp +++ b/test/testCircle.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2014, Edouard DUPIN, all right reserved @@ -10,9 +10,6 @@ #include #include "main.h" -#undef __class__ -#define __class__ "TestCircle" - TEST(TestCircle, fill) { std::string data("" "" diff --git a/test/testColor.cpp b/test/testColor.cpp index e5d4883..b700d44 100644 --- a/test/testColor.cpp +++ b/test/testColor.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2014, Edouard DUPIN, all right reserved @@ -10,9 +10,6 @@ #include #include "main.h" -#undef __class__ -#define __class__ "TestColor" - TEST(TestColor, blending) { std::string data("" "" diff --git a/test/testEllipse.cpp b/test/testEllipse.cpp index cc71d65..e8495f8 100644 --- a/test/testEllipse.cpp +++ b/test/testEllipse.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2014, Edouard DUPIN, all right reserved @@ -10,9 +10,6 @@ #include #include "main.h" -#undef __class__ -#define __class__ "TestEllipse" - TEST(TestEllipse, fill) { std::string data("" "" diff --git a/test/testGradientLinear.cpp b/test/testGradientLinear.cpp index 6663aa8..db22fc8 100644 --- a/test/testGradientLinear.cpp +++ b/test/testGradientLinear.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2014, Edouard DUPIN, all right reserved @@ -10,9 +10,6 @@ #include #include "main.h" -#undef __class__ -#define __class__ "TestGradientLinear" - TEST(TestGradientLinear, horizontal) { std::string data("\n" "\n" diff --git a/test/testGradientRadial.cpp b/test/testGradientRadial.cpp index 906fcce..fe80c9a 100644 --- a/test/testGradientRadial.cpp +++ b/test/testGradientRadial.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2014, Edouard DUPIN, all right reserved @@ -10,9 +10,6 @@ #include #include "main.h" -#undef __class__ -#define __class__ "TestGradientRadial" - TEST(TestGradientRadial, circle) { std::string data("\n" "\n" diff --git a/test/testJoin.cpp b/test/testJoin.cpp index e2d91e0..9a67e6c 100644 --- a/test/testJoin.cpp +++ b/test/testJoin.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2014, Edouard DUPIN, all right reserved @@ -10,8 +10,6 @@ #include #include "main.h" -#undef __class__ -#define __class__ "TestJoin" // ------------------------------------------------------ Miter test ----------------------------------------------------- TEST(TestJoin, miterRight1) { diff --git a/test/testLine.cpp b/test/testLine.cpp index 936c840..4c093fd 100644 --- a/test/testLine.cpp +++ b/test/testLine.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2014, Edouard DUPIN, all right reserved @@ -10,9 +10,6 @@ #include #include "main.h" -#undef __class__ -#define __class__ "TestLine" - TEST(TestLine, stroke) { std::string data("" "" diff --git a/test/testPath.cpp b/test/testPath.cpp index 4e8b135..61cbfda 100644 --- a/test/testPath.cpp +++ b/test/testPath.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2014, Edouard DUPIN, all right reserved @@ -10,9 +10,6 @@ #include #include "main.h" -#undef __class__ -#define __class__ "TestPath" - TEST(TestPath, fill) { std::string data("" "" diff --git a/test/testPolygon.cpp b/test/testPolygon.cpp index 8ed3e4d..896a88a 100644 --- a/test/testPolygon.cpp +++ b/test/testPolygon.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2014, Edouard DUPIN, all right reserved @@ -10,9 +10,6 @@ #include #include "main.h" -#undef __class__ -#define __class__ "TestPolygon" - TEST(TestPolygon, fill) { std::string data("" "" diff --git a/test/testPolyline.cpp b/test/testPolyline.cpp index bbb2621..28d0e58 100644 --- a/test/testPolyline.cpp +++ b/test/testPolyline.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2014, Edouard DUPIN, all right reserved @@ -10,9 +10,6 @@ #include #include "main.h" -#undef __class__ -#define __class__ "TestLine" - TEST(TestPolyLine, fill) { std::string data("" "" diff --git a/test/testRectangle.cpp b/test/testRectangle.cpp index f085b6e..77794c2 100644 --- a/test/testRectangle.cpp +++ b/test/testRectangle.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2014, Edouard DUPIN, all right reserved @@ -10,9 +10,6 @@ #include #include "main.h" -#undef __class__ -#define __class__ "TestRectangle" - TEST(TestRectangle, fill) { std::string data("" "" diff --git a/test/testStyle.cpp b/test/testStyle.cpp index 71ded98..12fdc75 100644 --- a/test/testStyle.cpp +++ b/test/testStyle.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2014, Edouard DUPIN, all right reserved @@ -10,9 +10,6 @@ #include #include "main.h" -#undef __class__ -#define __class__ "TestRectangle" - TEST(TestExtern, worddown) { std::string data("\n" "\n" diff --git a/tools/converter.cpp b/tools/converter.cpp index 2446a16..6357ebb 100644 --- a/tools/converter.cpp +++ b/tools/converter.cpp @@ -1,4 +1,4 @@ -/** +/** @file * @author Edouard DUPIN * * @copyright 2014, Edouard DUPIN, all right reserved @@ -11,9 +11,6 @@ #include #include -#undef __class__ -#define __class__ "converter" - static void usage() { TEST_PRINT(etk::getApplicationName() << " - help : "); TEST_PRINT(" " << etk::getApplicationName() << " [options]");