From 18832b2305675e930e775332a7c3ba6f1aa8eaa4 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Wed, 26 Jun 2013 22:41:10 +0200 Subject: [PATCH] [DEV] correction of the exml requested elements --- esvg/Base.cpp | 10 +++++++--- esvg/Circle.cpp | 2 ++ esvg/Ellipse.cpp | 3 +++ esvg/Group.cpp | 12 ++++++------ esvg/Line.cpp | 3 +++ esvg/Path.cpp | 3 +++ esvg/Polygon.cpp | 3 +++ esvg/Rectangle.cpp | 4 ++++ esvg/Renderer.cpp | 3 +++ esvg/Text.cpp | 3 +++ esvg/esvg.cpp | 16 +++++++++------- 11 files changed, 46 insertions(+), 16 deletions(-) diff --git a/esvg/Base.cpp b/esvg/Base.cpp index 9f20271..1f8c5a6 100644 --- a/esvg/Base.cpp +++ b/esvg/Base.cpp @@ -11,6 +11,10 @@ #include #include + +#undef __class__ +#define __class__ "Base" + esvg::Base::Base(PaintState _parentPaintState) { // copy the parent painting properties ... @@ -119,7 +123,7 @@ void esvg::Base::ParsePosition(const exml::Element *_element, etk::Vector2D ?? = " << n ); float font_size = 20.0f; - SVG_DEBUG(" lenght : '" << n << "' => unit=" << unit); + SVG_VERBOSE(" lenght : '" << n << "' => unit=" << unit); // note : ";" is for the parsing of the style elements ... if( unit.Size()==0 || unit[0] == ';' ) { @@ -388,7 +392,7 @@ draw::Color esvg::Base::ParseColor(const etk::UString& _inputData) } else { localColor = _inputData.c_str(); } - SVG_INFO("Parse color : \"" << _inputData << "\" ==> " << localColor); + SVG_VERBOSE("Parse color : \"" << _inputData << "\" ==> " << localColor); return localColor; } diff --git a/esvg/Circle.cpp b/esvg/Circle.cpp index fa00e28..679a84f 100644 --- a/esvg/Circle.cpp +++ b/esvg/Circle.cpp @@ -11,6 +11,8 @@ #include #include +#undef __class__ +#define __class__ "Circle" esvg::Circle::Circle(PaintState _parentPaintState) : esvg::Base(_parentPaintState) { diff --git a/esvg/Ellipse.cpp b/esvg/Ellipse.cpp index 0aa6515..1c1962b 100644 --- a/esvg/Ellipse.cpp +++ b/esvg/Ellipse.cpp @@ -11,6 +11,9 @@ #include #include +#undef __class__ +#define __class__ "Ellipse" + esvg::Ellipse::Ellipse(PaintState parentPaintState) : esvg::Base(parentPaintState) { diff --git a/esvg/Group.cpp b/esvg/Group.cpp index 119f0d4..dfa7f2f 100644 --- a/esvg/Group.cpp +++ b/esvg/Group.cpp @@ -20,6 +20,9 @@ #include #include +#undef __class__ +#define __class__ "Group" + esvg::Group::Group(PaintState _parentPaintState) : esvg::Base(_parentPaintState) { @@ -52,12 +55,9 @@ bool esvg::Group::Parse(exml::Element * _element, agg::trans_affine& _parentTran vec2 tmpPos(0,0); // parse all sub node : for(int32_t iii=0; iii<_element->Size() ; iii++) { - exml::Node* child = _element->Get(iii); + exml::Element* child = _element->GetElement(iii); if (NULL == child) { - continue; - } - if (!child->IsElement()) { - // nothing to do, just proceed to next step + // can be a comment ... continue; } esvg::Base *elementParser = NULL; @@ -87,7 +87,7 @@ bool esvg::Group::Parse(exml::Element * _element, agg::trans_affine& _parentTran if (NULL == elementParser) { SVG_ERROR("(l "<Pos()<<") error on node: \""<GetValue()<<"\" allocation error or not supported ..."); } else { - if (false == elementParser->Parse((exml::Element*)child, m_transformMatrix, tmpPos)) { + if (false == elementParser->Parse(child, m_transformMatrix, tmpPos)) { SVG_ERROR("(l "<Pos()<<") error on node: \""<GetValue()<<"\" Sub Parsing ERROR"); delete(elementParser); elementParser = NULL; diff --git a/esvg/Line.cpp b/esvg/Line.cpp index 736ce88..cd32694 100644 --- a/esvg/Line.cpp +++ b/esvg/Line.cpp @@ -11,6 +11,9 @@ #include #include +#undef __class__ +#define __class__ "Line" + esvg::Line::Line(PaintState parentPaintState) : esvg::Base(parentPaintState) { m_startPos.setValue(0,0); diff --git a/esvg/Path.cpp b/esvg/Path.cpp index 7b40584..7058d48 100644 --- a/esvg/Path.cpp +++ b/esvg/Path.cpp @@ -14,6 +14,9 @@ #include #include +#undef __class__ +#define __class__ "Path" + esvg::Path::Path(PaintState _parentPaintState) : esvg::Base(_parentPaintState) { diff --git a/esvg/Polygon.cpp b/esvg/Polygon.cpp index b6c8721..b7f9d85 100644 --- a/esvg/Polygon.cpp +++ b/esvg/Polygon.cpp @@ -11,6 +11,9 @@ #include #include +#undef __class__ +#define __class__ "Polygon" + esvg::Polygon::Polygon(PaintState parentPaintState) : esvg::Base(parentPaintState) { diff --git a/esvg/Rectangle.cpp b/esvg/Rectangle.cpp index f1aa043..f41a266 100644 --- a/esvg/Rectangle.cpp +++ b/esvg/Rectangle.cpp @@ -11,6 +11,10 @@ #include #include +#undef __class__ +#define __class__ "Rectangle" + + esvg::Rectangle::Rectangle(PaintState _parentPaintState) : esvg::Base(_parentPaintState) { m_position.setValue(0,0); diff --git a/esvg/Renderer.cpp b/esvg/Renderer.cpp index 7157083..9d5bdbf 100644 --- a/esvg/Renderer.cpp +++ b/esvg/Renderer.cpp @@ -12,6 +12,9 @@ // 4 is for the RGBA ... #define DATA_ALLOCATION_ELEMENT (4) +#undef __class__ +#define __class__ "Renderer" + esvg::Renderer::Renderer(uint32_t width, uint32_t height) { m_allocatedSize = 0; diff --git a/esvg/Text.cpp b/esvg/Text.cpp index f8dceb9..c0dea2b 100644 --- a/esvg/Text.cpp +++ b/esvg/Text.cpp @@ -9,6 +9,9 @@ #include #include +#undef __class__ +#define __class__ "Text" + esvg::Text::Text(PaintState _parentPaintState) : esvg::Base(_parentPaintState) { diff --git a/esvg/esvg.cpp b/esvg/esvg.cpp index b1d8781..b478895 100644 --- a/esvg/esvg.cpp +++ b/esvg/esvg.cpp @@ -30,6 +30,11 @@ #include #include + +#undef __class__ +#define __class__ "Document" + + esvg::Document::Document(const etk::UString& _fileName) : m_renderedElement(NULL) { m_fileName = _fileName; @@ -76,15 +81,12 @@ esvg::Document::Document(const etk::UString& _fileName) : m_renderedElement(NULL vec2 size(0,0); // parse all sub node : for(int32_t iii=0; iii< root->Size(); iii++) { - exml::Node* child = root->Get(iii); + exml::Element* child = root->GetElement(iii); if (child==NULL) { + // comment trsh here... continue; } esvg::Base *elementParser = NULL; - if (!child->IsElement()) { - // nothing to do, just proceed to next step - continue; - } if (child->GetValue() == "g") { elementParser = new esvg::Group(m_paint); } else if (child->GetValue() == "a") { @@ -125,7 +127,7 @@ esvg::Document::Document(const etk::UString& _fileName) : m_renderedElement(NULL SVG_ERROR("(l "<Pos()<<") error on node: \""<GetValue()<<"\" allocation error or not supported ..."); continue; } - if (false == elementParser->Parse((exml::Element*)child, m_transformMatrix, size)) { + if (false == elementParser->Parse(child, m_transformMatrix, size)) { SVG_ERROR("(l "<Pos()<<") error on node: \""<GetValue()<<"\" Sub Parsing ERROR"); delete(elementParser); elementParser = NULL; @@ -145,7 +147,7 @@ esvg::Document::Document(const etk::UString& _fileName) : m_renderedElement(NULL } else { m_size.setValue((int32_t)m_size.x(), (int32_t)m_size.y()); } - DisplayDebug(); + //DisplayDebug(); } esvg::Document::~Document(void)