[DEV] update new exml interface (removing visibility of shared_ptr

This commit is contained in:
Edouard DUPIN 2016-04-17 22:42:13 +02:00
parent 67a6da6099
commit f9c000e603
98 changed files with 289 additions and 461 deletions

View File

@ -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<etk::Color<float,4>, std::string>(etk::color::black, "")),
stroke(std::pair<etk::Color<float,4>, 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<exml::Element>& _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<exml::Element>& _element)
}
}
void esvg::Base::parsePosition(const std::shared_ptr<const exml::Element>& _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<const exml::Element>& _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<const exml::Element>& _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<etk::Color<float,4>, 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<const exml::Element>& _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<const exml::Element>& _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<const exml::Element>& _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<etk::Color<float,4>, 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<const exml::Element>& _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<etk::Color<float,4>, std::string> esvg::Base::parseColor(const std::st
return localColor;
}
bool esvg::Base::parseXML(const std::shared_ptr<exml::Element>& _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;
}

View File

@ -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<exml::Element>& _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<exml::Element>& _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<const exml::Element>& _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<const exml::Element>& _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

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -11,9 +11,6 @@
#include <esvg/render/Path.h>
#include <esvg/render/Weight.h>
#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<exml::Element>& _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<exml::Element>& _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);

View File

@ -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<exml::Element>& _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);
};

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -9,9 +9,6 @@
#include <esvg/Dimension.h>
#include <esvg/debug.h>
#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) {

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -11,9 +11,6 @@
#include <esvg/render/Path.h>
#include <esvg/render/Weight.h>
#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<exml::Element>& _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<exml::Element>& _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());

View File

@ -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<exml::Element>& _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);
};

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -20,9 +20,6 @@
#include <esvg/Text.h>
#include <esvg/Group.h>
#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<exml::Element>& _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<exml::Element>& _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<exml::Element> 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<esvg::Base> elementParser;
if (child->getValue() == "g") {
if (child.getValue() == "g") {
elementParser = std::make_shared<esvg::Group>(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<esvg::Path>(m_paint);
} else if (child->getValue() == "rect") {
} else if (child.getValue() == "rect") {
elementParser = std::make_shared<esvg::Rectangle>(m_paint);
} else if (child->getValue() == "circle") {
} else if (child.getValue() == "circle") {
elementParser = std::make_shared<esvg::Circle>(m_paint);
} else if (child->getValue() == "ellipse") {
} else if (child.getValue() == "ellipse") {
elementParser = std::make_shared<esvg::Ellipse>(m_paint);
} else if (child->getValue() == "line") {
} else if (child.getValue() == "line") {
elementParser = std::make_shared<esvg::Line>(m_paint);
} else if (child->getValue() == "polyline") {
} else if (child.getValue() == "polyline") {
elementParser = std::make_shared<esvg::Polyline>(m_paint);
} else if (child->getValue() == "polygon") {
} else if (child.getValue() == "polygon") {
elementParser = std::make_shared<esvg::Polygon>(m_paint);
} else if (child->getValue() == "text") {
} else if (child.getValue() == "text") {
elementParser = std::make_shared<esvg::Text>(m_paint);
} else {
ESVG_ERROR("(l "<<child->getPos()<<") node not suported : \""<<child->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 "<<child->getPos()<<") error on node: \""<<child->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 "<<child->getPos()<<") error on node: \""<<child->getValue()<<"\" Sub Parsing ERROR");
ESVG_ERROR("(l " << child.getPos() << ") error on node: '" << child.getValue() << "' Sub Parsing ERROR");
elementParser.reset();
continue;
}

View File

@ -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<exml::Element>& _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);
};

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -11,9 +11,6 @@
#include <esvg/render/Path.h>
#include <esvg/render/Weight.h>
#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<exml::Element>& _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<exml::Element>& _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()),

View File

@ -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<exml::Element>& _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);
};

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -13,9 +13,6 @@
#include <esvg/render/Weight.h>
#include <esvg/esvg.h>
#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<exml::Element>& _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<exml::Element>& _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<exml::Element>& _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<exml::Element>& _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<exml::Element> 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<float,4> stopColor = etk::color::none;
std::string content = child->getAttribute("offset");
std::string content = child.attributes["offset"];
if (content.size()!=0) {
std::pair<float, enum esvg::distance> tmp = parseLength2(content);
if (tmp.second == esvg::distance_pixel) {
@ -107,26 +104,26 @@ bool esvg::LinearGradient::parseXML(const std::shared_ptr<exml::Element>& _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<float, etk::Color<float,4>>(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 = "";
}
}

View File

@ -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<exml::Element>& _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:

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -11,9 +11,6 @@
#include <esvg/render/PointList.h>
#include <esvg/render/Weight.h>
#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<exml::Element>& _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<exml::Element>& _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 << "\"");

View File

@ -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<exml::Element>& _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);
};

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -11,9 +11,6 @@
#include <esvg/render/Path.h>
#include <esvg/render/Weight.h>
#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<exml::Element>& _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<exml::Element>& _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;

View File

@ -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<exml::Element>& _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);
};

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -11,9 +11,6 @@
#include <esvg/render/Path.h>
#include <esvg/render/Weight.h>
#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<exml::Element>& _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<exml::Element>& _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);

View File

@ -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<exml::Element>& _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);
};

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -13,9 +13,6 @@
#include <esvg/render/Weight.h>
#include <esvg/esvg.h>
#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<exml::Element>& _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<exml::Element>& _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<exml::Element>& _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<exml::Element>& _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<exml::Element> 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<float,4> stopColor = etk::color::none;
std::string content = child->getAttribute("offset");
std::string content = child.attributes["offset"];
if (content.size()!=0) {
std::pair<float, enum esvg::distance> tmp = parseLength2(content);
if (tmp.second == esvg::distance_pixel) {
@ -112,26 +109,26 @@ bool esvg::RadialGradient::parseXML(const std::shared_ptr<exml::Element>& _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<float, etk::Color<float,4>>(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 = "";
}
}

View File

@ -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<exml::Element>& _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:

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -11,10 +11,6 @@
#include <esvg/render/Path.h>
#include <esvg/render/Weight.h>
#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<exml::Element>& _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<exml::Element>& _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));
}

View File

@ -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<exml::Element>& _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);
};

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -10,9 +10,6 @@
#include <esvg/Renderer.h>
#include <etk/os/FSNode.h>
#undef __class__
#define __class__ "Renderer"
esvg::Renderer::Renderer(const ivec2& _size, esvg::Document* _document, bool _visualDebug) :
#ifdef DEBUG
m_visualDebug(_visualDebug),

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -9,9 +9,6 @@
#include <esvg/debug.h>
#include <esvg/Text.h>
#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<exml::Element>& _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;

View File

@ -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<exml::Element>& _element, mat2& _parentTrans, vec2& _sizeMax);
virtual bool parse(const exml::Element& _element, mat2& _parentTrans, vec2& _sizeMax);
virtual void display(int32_t _spacing);
};
}

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -21,10 +21,6 @@
#include <esvg/LinearGradient.h>
#include <esvg/RadialGradient.h>
#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<exml::Element> 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<exml::Element> 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<exml::Element>& _root) {
bool esvg::Document::cleanStyleProperty(const exml::Element& _root) {
// for each nodes:
for(int32_t iii=0; iii< _root->size(); iii++) {
std::shared_ptr<exml::Element> 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<std::string> listStyle = etk::split(content, ';');
for (auto &it : listStyle) {
@ -230,11 +226,11 @@ bool esvg::Document::cleanStyleProperty(const std::shared_ptr<exml::Element>& _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<exml::Element>& _r
return true;
}
bool esvg::Document::parseXMLData(const std::shared_ptr<exml::Element>& _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<exml::Element>& _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<exml::Element> 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<esvg::Base> elementParser;
if (child->getValue() == "g") {
if (child.getValue() == "g") {
elementParser = std::make_shared<esvg::Group>(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<esvg::Group>(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<esvg::Path>(m_paint);
} else if (child->getValue() == "rect") {
} else if (child.getValue() == "rect") {
elementParser = std::make_shared<esvg::Rectangle>(m_paint);
} else if (child->getValue() == "circle") {
} else if (child.getValue() == "circle") {
elementParser = std::make_shared<esvg::Circle>(m_paint);
} else if (child->getValue() == "ellipse") {
} else if (child.getValue() == "ellipse") {
elementParser = std::make_shared<esvg::Ellipse>(m_paint);
} else if (child->getValue() == "line") {
} else if (child.getValue() == "line") {
elementParser = std::make_shared<esvg::Line>(m_paint);
} else if (child->getValue() == "polyline") {
} else if (child.getValue() == "polyline") {
elementParser = std::make_shared<esvg::Polyline>(m_paint);
} else if (child->getValue() == "polygon") {
} else if (child.getValue() == "polygon") {
elementParser = std::make_shared<esvg::Polygon>(m_paint);
} else if (child->getValue() == "text") {
} else if (child.getValue() == "text") {
elementParser = std::make_shared<esvg::Text>(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<esvg::RadialGradient>(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<esvg::LinearGradient>(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 "<<child->getPos()<<") node not suported : \""<<child->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 "<<child->getPos()<<") error on node: \""<<child->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 "<<child->getPos()<<") error on node: \""<<child->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<exml::Element>& _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());

View File

@ -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<exml::Element>& _root);
virtual bool parseXMLData(const std::shared_ptr<exml::Element>& _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;

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -12,9 +12,6 @@
#include <esvg/RadialGradient.h>
#include <esvg/esvg.h>
#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::DynamicColor> esvg::render::createColor(std::pair<etk::Color<float,4>, std::string> _color, const mat2& _mtx) {
// Check if need to create a color:
if ( _color.first.a() == 0x00

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -9,9 +9,6 @@
#include <esvg/render/Element.h>
#include <esvg/debug.h>
#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:

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -9,10 +9,6 @@
#include <esvg/render/Element.h>
#include <esvg/debug.h>
#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;

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -9,10 +9,6 @@
#include <esvg/render/Element.h>
#include <esvg/debug.h>
#undef __class__
#define __class__ "rerder::ElementBezierSmoothCurveTo"
esvg::render::ElementBezierSmoothCurveTo::ElementBezierSmoothCurveTo(bool _relative, const vec2& _pos):
Element(esvg::render::path_bezierSmoothCurveTo, _relative) {
m_pos = _pos;

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -9,10 +9,6 @@
#include <esvg/render/Element.h>
#include <esvg/debug.h>
#undef __class__
#define __class__ "rerder::ElementClose"
esvg::render::ElementClose::ElementClose(bool _relative):
Element(esvg::render::path_close, _relative) {

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -9,10 +9,6 @@
#include <esvg/render/Element.h>
#include <esvg/debug.h>
#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;

View File

@ -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 <etk/types.h>
#include <etk/math/Vector2D.h>
#include <esvg/render/Element.h>

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -9,10 +9,6 @@
#include <esvg/render/Element.h>
#include <esvg/debug.h>
#undef __class__
#define __class__ "rerder::ElementElliptic"
esvg::render::ElementElliptic::ElementElliptic(bool _relative,
const vec2& _radius, // in m_vec1
float _angle,

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -9,10 +9,6 @@
#include <esvg/render/Element.h>
#include <esvg/debug.h>
#undef __class__
#define __class__ "rerder::ElementLineTo"
esvg::render::ElementLineTo::ElementLineTo(bool _relative, const vec2& _pos):
Element(esvg::render::path_lineTo, _relative) {
m_pos = _pos;

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -9,10 +9,6 @@
#include <esvg/render/Element.h>
#include <esvg/debug.h>
#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);

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -9,10 +9,6 @@
#include <esvg/render/Element.h>
#include <esvg/debug.h>
#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);

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -9,9 +9,6 @@
#include <esvg/render/Element.h>
#include <esvg/debug.h>
#undef __class__
#define __class__ "rerder::ElementMoveTo"
esvg::render::ElementMoveTo::ElementMoveTo(bool _relative, const vec2& _pos):
Element(esvg::render::path_moveTo, _relative) {
m_pos = _pos;

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -9,10 +9,6 @@
#include <esvg/render/Element.h>
#include <esvg/debug.h>
#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;

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -9,10 +9,6 @@
#include <esvg/render/Element.h>
#include <esvg/debug.h>
#undef __class__
#define __class__ "rerder::ElementStop"
esvg::render::ElementStop::ElementStop():
Element(esvg::render::path_stop) {

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -9,9 +9,6 @@
#include <esvg/render/Path.h>
#include <esvg/render/Element.h>
#undef __class__
#define __class__ "rerder::Path"
void esvg::render::Path::clear() {
m_listElement.clear();
}

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -9,9 +9,6 @@
#include <esvg/render/Point.h>
#include <esvg/debug.h>
#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");

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -9,9 +9,6 @@
#include <esvg/render/Scanline.h>
#include <esvg/debug.h>
#undef __class__
#define __class__ "rerder::Scanline"
esvg::render::Scanline::Scanline(size_t _size) {
float tmp(0);
m_data.resize(_size, tmp);

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -9,9 +9,6 @@
#include <esvg/render/Segment.h>
#include <esvg/debug.h>
#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;

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -10,11 +10,6 @@
#include <esvg/debug.h>
#include <etk/math/Matrix2.h>
#undef __class__
#define __class__ "rerder::SegmentList"
esvg::render::SegmentList::SegmentList() {
}

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
@ -9,10 +9,6 @@
#include <esvg/render/Weight.h>
#include <esvg/debug.h>
#undef __class__
#define __class__ "render::Weight"
esvg::render::Weight::Weight() :
m_size(0,0) {

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
@ -11,9 +11,6 @@
#include <gtest/gtest.h>
#include <etk/etk.h>
#undef __class__
#define __class__ "esvg::test"
bool g_visualDebug = false;

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
@ -10,9 +10,6 @@
#include <esvg/esvg.h>
#include "main.h"
#undef __class__
#define __class__ "TestLine"
TEST(TestCap, butt) {
std::string data("<?xml version='1.0' encoding='UTF-8' standalone='no'?>"
"<svg height='100' width='100'>"

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
@ -10,9 +10,6 @@
#include <esvg/esvg.h>
#include "main.h"
#undef __class__
#define __class__ "TestCircle"
TEST(TestCircle, fill) {
std::string data("<?xml version='1.0' encoding='UTF-8' standalone='no'?>"
"<svg height='100' width='100'>"

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
@ -10,9 +10,6 @@
#include <esvg/esvg.h>
#include "main.h"
#undef __class__
#define __class__ "TestColor"
TEST(TestColor, blending) {
std::string data("<?xml version='1.0' encoding='UTF-8' standalone='no'?>"
"<svg height='100' width='100'>"

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
@ -10,9 +10,6 @@
#include <esvg/esvg.h>
#include "main.h"
#undef __class__
#define __class__ "TestEllipse"
TEST(TestEllipse, fill) {
std::string data("<?xml version='1.0' encoding='UTF-8' standalone='no'?>"
"<svg height='100' width='100'>"

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
@ -10,9 +10,6 @@
#include <esvg/esvg.h>
#include "main.h"
#undef __class__
#define __class__ "TestGradientLinear"
TEST(TestGradientLinear, horizontal) {
std::string data("<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n"
"<svg height='100' width='100'>\n"

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
@ -10,9 +10,6 @@
#include <esvg/esvg.h>
#include "main.h"
#undef __class__
#define __class__ "TestGradientRadial"
TEST(TestGradientRadial, circle) {
std::string data("<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n"
"<svg height='100' width='100'>\n"

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
@ -10,8 +10,6 @@
#include <esvg/esvg.h>
#include "main.h"
#undef __class__
#define __class__ "TestJoin"
// ------------------------------------------------------ Miter test -----------------------------------------------------
TEST(TestJoin, miterRight1) {

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
@ -10,9 +10,6 @@
#include <esvg/esvg.h>
#include "main.h"
#undef __class__
#define __class__ "TestLine"
TEST(TestLine, stroke) {
std::string data("<?xml version='1.0' encoding='UTF-8' standalone='no'?>"
"<svg height='100' width='100'>"

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
@ -10,9 +10,6 @@
#include <esvg/esvg.h>
#include "main.h"
#undef __class__
#define __class__ "TestPath"
TEST(TestPath, fill) {
std::string data("<?xml version='1.0' encoding='UTF-8' standalone='no'?>"
"<svg height='100' width='100'>"

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
@ -10,9 +10,6 @@
#include <esvg/esvg.h>
#include "main.h"
#undef __class__
#define __class__ "TestPolygon"
TEST(TestPolygon, fill) {
std::string data("<?xml version='1.0' encoding='UTF-8' standalone='no'?>"
"<svg height='100' width='100'>"

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
@ -10,9 +10,6 @@
#include <esvg/esvg.h>
#include "main.h"
#undef __class__
#define __class__ "TestLine"
TEST(TestPolyLine, fill) {
std::string data("<?xml version='1.0' encoding='UTF-8' standalone='no'?>"
"<svg height='100' width='100'>"

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
@ -10,9 +10,6 @@
#include <esvg/esvg.h>
#include "main.h"
#undef __class__
#define __class__ "TestRectangle"
TEST(TestRectangle, fill) {
std::string data("<?xml version='1.0' encoding='UTF-8' standalone='no'?>"
"<svg height='100' width='100'>"

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
@ -10,9 +10,6 @@
#include <esvg/esvg.h>
#include "main.h"
#undef __class__
#define __class__ "TestRectangle"
TEST(TestExtern, worddown) {
std::string data("<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n"
"<!-- Created with Inkscape (http://www.inkscape.org/) -->\n"

View File

@ -1,4 +1,4 @@
/**
/** @file
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
@ -11,9 +11,6 @@
#include <etk/etk.h>
#include <esvg/esvg.h>
#undef __class__
#define __class__ "converter"
static void usage() {
TEST_PRINT(etk::getApplicationName() << " - help : ");
TEST_PRINT(" " << etk::getApplicationName() << " [options]");