[DEV] update new exml interface

This commit is contained in:
Edouard DUPIN 2015-01-14 21:10:23 +01:00
parent 832d73d4da
commit 6caf433936
22 changed files with 63 additions and 68 deletions

View File

@ -18,10 +18,12 @@ branches:
before_script:
- git submodule init
- git submodule update
- if [ "$CXX" == "clang++" ]; then BUILDER=clang; else BUILDER=gcc; fi
install:
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- sudo apt-get update -qq
- sudo apt-get install -qq libstdc++-4.9-dev
- sudo apt-get install -qq g++-4.8
- sudo rm /usr/bin/gcc /usr/bin/g++
- sudo ln -s /usr/bin/gcc-4.8 /usr/bin/gcc
@ -29,16 +31,10 @@ install:
# build sequence with Lutin :
script:
- if [ "$CXX" == "clang++" ]; then ./build/lutin.py -C -P -cclang -mdebug -p ewol etk_test exmltest ejson_test enettest; fi
- if [ "$CXX" == "g++" ]; then ./build/lutin.py -C -P -cgcc -mdebug -p ewol etk_test exmltest ejson_test enettest; fi
after_script:
- if [ "$CXX" == "clang++" ]; then ./out/Linux_x86_64/debug/staging/clang/etktest/usr/bin/etk_test; fi
- if [ "$CXX" == "clang++" ]; then ./out/Linux_x86_64/debug/staging/clang/exmltest/usr/bin/exmltest; fi
- if [ "$CXX" == "clang++" ]; then ./out/Linux_x86_64/debug/staging/clang/ejsontest/usr/bin/ejson_test; fi
- if [ "$CXX" == "g++" ]; then ./out/Linux_x86_64/debug/staging/gcc/etktest/usr/bin/etk_test; fi
- if [ "$CXX" == "g++" ]; then ./out/Linux_x86_64/debug/staging/gcc/exmltest/usr/bin/exmltest; fi
- if [ "$CXX" == "g++" ]; then ./out/Linux_x86_64/debug/staging/gcc/ejsontest/usr/bin/ejson_test; fi
- ./build/lutin.py -C -P -c$BUILDER -mdebug -p ewol etk_test exml_test ejson_test enettest
- ./out/Linux_x86_64/debug/staging/$BUILDER/etk_test/usr/bin/etk_test
- ./out/Linux_x86_64/debug/staging/$BUILDER/ejson_test/usr/bin/ejson_test
- ./out/Linux_x86_64/debug/staging/$BUILDER/exml_test/usr/bin/exml_test
#send e-mail on compilation result:
notifications:

2
external/ege vendored

@ -1 +1 @@
Subproject commit 1cc5144acc846170090b8ef57185d9bf65f38d66
Subproject commit be7abd40a14ac37ca2afc8e8e14bc7f6f2ce7ba5

2
external/ejson vendored

@ -1 +1 @@
Subproject commit b3b7d90b418241bf05b32df14c9262d8a3f1ccf4
Subproject commit dd2c3b15e9def7818acc5ab42c43ba1d3f5569c1

2
external/esvg vendored

@ -1 +1 @@
Subproject commit 738ee25fb8016e9fd7a3d62ac28a85eb99b4f197
Subproject commit d61f0b9607fa31a0a817c350889b7259f4d1d516

2
external/exml vendored

@ -1 +1 @@
Subproject commit 479921d3475fe3fd7a72bbd9e1772f70d284f774
Subproject commit c3b20ceb8f78516bd29dd3fa02c4c5428e7e7a78

View File

@ -245,7 +245,7 @@ void ewol::compositing::TextBase::print(const std::string& _text) {
}
void ewol::compositing::TextBase::parseHtmlNode(exml::Element* _element) {
void ewol::compositing::TextBase::parseHtmlNode(const std::shared_ptr<const exml::Element>& _element) {
// get the static real pointer
if (_element == nullptr) {
EWOL_ERROR( "Error Input node does not existed ...");
@ -254,15 +254,15 @@ void ewol::compositing::TextBase::parseHtmlNode(exml::Element* _element) {
if (_element->getType(iii) == exml::typeComment) {
// nothing to do ...
} else if (_element->getType(iii) == exml::typeText) {
exml::Node* child = _element->getNode(iii);
std::shared_ptr<const exml::Node> child = _element->getNode(iii);
htmlAddData(etk::to_u32string(child->getValue()));
EWOL_VERBOSE("XML add : " << child->getValue());
continue;
} else if (_element->getType(iii)!=exml::typeElement) {
} else if (_element->getType(iii) != exml::typeElement) {
EWOL_ERROR("(l "<< _element->getNode(iii)->getPos() << ") node not suported type : " << _element->getType(iii) << " val=\""<< _element->getNode(iii)->getValue() << "\"" );
continue;
}
exml::Element* elem = _element->getElement(iii);
std::shared_ptr<const exml::Element> elem = _element->getElement(iii);
if (elem == nullptr) {
EWOL_ERROR("Cast error ...");
continue;
@ -373,13 +373,13 @@ void ewol::compositing::TextBase::printHTML(const std::string& _text) {
return;
}
exml::Element* root = (exml::Element*)doc.getNamed( "html" );
std::shared_ptr<const exml::Element> root = doc.getNamed( "html" );
if (root == nullptr) {
EWOL_ERROR( "can not load XML: main node not find: \"html\"");
doc.display();
return;
}
exml::Element* bodyNode = (exml::Element*)root->getNamed( "body" );
std::shared_ptr<const exml::Element> bodyNode = root->getNamed( "body" );
if (root == nullptr) {
EWOL_ERROR( "can not load XML: main node not find: \"body\"");
return;
@ -401,13 +401,13 @@ void ewol::compositing::TextBase::printHTML(const std::u32string& _text) {
return;
}
exml::Element* root = (exml::Element*)doc.getNamed( "html" );
std::shared_ptr<exml::Element> root = doc.getNamed( "html" );
if (root == nullptr) {
EWOL_ERROR( "can not load XML: main node not find: \"html\"");
doc.display();
return;
}
exml::Element* bodyNode = (exml::Element*)root->getNamed( "body" );
std::shared_ptr<exml::Element> bodyNode = root->getNamed( "body" );
if (root == nullptr) {
EWOL_ERROR( "can not load XML: main node not find: \"body\"");
return;

View File

@ -357,7 +357,7 @@ namespace ewol {
* @brief This parse a tinyXML node (void pointer to permit to hide tiny XML in include).
* @param[in] _element the exml element.
*/
void parseHtmlNode(exml::Element* _element);
void parseHtmlNode(const std::shared_ptr<const exml::Element>& _element);
public:
/**
* @brief This generate the possibility to generate the big text property

View File

@ -108,8 +108,8 @@ bool ewol::Object::isTypeCompatible(const std::string& _type) {
return false;
}
bool ewol::Object::loadXML(exml::Element* _node) {
if (nullptr == _node) {
bool ewol::Object::loadXML(const std::shared_ptr<const exml::Element>& _node) {
if (_node == nullptr) {
return false;
}
bool errorOccured = false;
@ -126,7 +126,7 @@ bool ewol::Object::loadXML(exml::Element* _node) {
return errorOccured;
}
bool ewol::Object::storeXML(exml::Element* _node) const {
bool ewol::Object::storeXML(const std::shared_ptr<exml::Element>& _node) const {
if (nullptr == _node) {
return false;
}

View File

@ -168,14 +168,14 @@ namespace ewol {
* @return true : All has been done corectly.
* @return false : An error occured.
*/
virtual bool loadXML(exml::Element* _node);
virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node);
/**
* @brief store properties in this XML node.
* @param[in,out] _node Pointer on the tinyXML node.
* @return true : All has been done corectly.
* @return false : An error occured.
*/
virtual bool storeXML(exml::Element* _node) const;
virtual bool storeXML(const std::shared_ptr<exml::Element>& _node) const;
public:
/**
* @breif get the current Object manager.

View File

@ -40,15 +40,15 @@ ewol::widget::Composer::~Composer() {
}
bool ewol::widget::Composer::loadFromFile(const std::string& _fileName) {
exml::Document doc;
if (doc.load(_fileName) == false) {
std::shared_ptr<exml::Document> doc = exml::Document::create();
if (doc->load(_fileName) == false) {
EWOL_ERROR(" can not load file XML : " << _fileName);
return false;
}
exml::Element* root = (exml::Element*)doc.getNamed("composer");
std::shared_ptr<const exml::Element> root = doc->getNamed("composer");
if (root == nullptr) {
// Maybe a multiple node XML for internal config:
root = doc.toElement();
root = doc->toElement();
if (root == nullptr) {
EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} (l ?) main node not find: \"composer\" ...");
return false;
@ -65,15 +65,15 @@ bool ewol::widget::Composer::loadFromFile(const std::string& _fileName) {
}
bool ewol::widget::Composer::loadFromString(const std::string& _composerXmlString) {
exml::Document doc;
if (doc.parse(_composerXmlString) == false) {
std::shared_ptr<exml::Document> doc = exml::Document::create();
if (doc->parse(_composerXmlString) == false) {
EWOL_ERROR(" can not load file XML string...");
return false;
}
exml::Element* root = (exml::Element*)doc.getNamed("composer");
std::shared_ptr<const exml::Element> root = doc->getNamed("composer");
if (root == nullptr) {
// Maybe a multiple node XML for internal config:
root = doc.toElement();
root = doc->toElement();
if (root == nullptr) {
EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} (l ?) main node not find: \"composer\" ...");
return false;

View File

@ -143,18 +143,17 @@ std::shared_ptr<ewol::Widget> ewol::widget::Container::getWidgetAtPos(const vec2
};
bool ewol::widget::Container::loadXML(exml::Element* _node) {
if (nullptr == _node) {
bool ewol::widget::Container::loadXML(const std::shared_ptr<const exml::Element>& _node) {
if (_node == nullptr) {
return false;
}
// parse generic properties :
ewol::Widget::loadXML(_node);
// remove previous element :
subWidgetRemove();
// parse all the elements :
for(size_t iii=0; iii< _node->size(); iii++) {
exml::Element* pNode = _node->getElement(iii);
std::shared_ptr<const exml::Element> pNode = _node->getElement(iii);
if (pNode == nullptr) {
// trash here all that is not element
continue;

View File

@ -59,7 +59,7 @@ namespace ewol {
virtual void calculateMinMaxSize();
virtual std::shared_ptr<ewol::Widget> getWidgetAtPos(const vec2& _pos);
virtual std::shared_ptr<ewol::Object> getSubObjectNamed(const std::string& _objectName);
virtual bool loadXML(exml::Element* _node);
virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node);
virtual void setOffset(const vec2& _newVal);
virtual void requestDestroyFromChild(const std::shared_ptr<Object>& _child);
};

View File

@ -176,8 +176,8 @@ std::shared_ptr<ewol::Widget> ewol::widget::Container2::getWidgetAtPos(const vec
}
*/
bool ewol::widget::Container2::loadXML(exml::Element* _node) {
if (nullptr == _node) {
bool ewol::widget::Container2::loadXML(const std::shared_ptr<const exml::Element>& _node) {
if (_node == nullptr) {
return false;
}
// parse generic properties :
@ -187,7 +187,7 @@ bool ewol::widget::Container2::loadXML(exml::Element* _node) {
// parse all the elements :
for(size_t iii=0; iii< _node->size(); iii++) {
exml::Element* pNode = _node->getElement(iii);
std::shared_ptr<const exml::Element> pNode = _node->getElement(iii);
if (pNode == nullptr) {
// trash here all that is not element
continue;
@ -198,9 +198,9 @@ bool ewol::widget::Container2::loadXML(exml::Element* _node) {
continue;
}
bool toogleMode=false;
if (nullptr != getSubWidget()) {
if (getSubWidget() != nullptr) {
toogleMode=true;
if (nullptr != getSubWidgetToggle()) {
if (getSubWidgetToggle() != nullptr) {
EWOL_ERROR("(l "<<pNode->getPos()<<") " << __class__ << " Can only have one subWidget ??? node=\"" << widgetName << "\"" );
continue;
}
@ -217,7 +217,7 @@ bool ewol::widget::Container2::loadXML(exml::Element* _node) {
} else {
setSubWidgetToggle(tmpWidget);
}
if (false == tmpWidget->loadXML(pNode)) {
if (tmpWidget->loadXML(pNode) == false) {
EWOL_ERROR ("(l "<<pNode->getPos()<<") can not load widget properties : \"" << widgetName << "\"");
return false;
}

View File

@ -162,7 +162,7 @@ namespace ewol {
}
//virtual std::shared_ptr<ewol::Widget> getWidgetAtPos(const vec2& _pos);
virtual std::shared_ptr<ewol::Object> getSubObjectNamed(const std::string& _objectName);
virtual bool loadXML(exml::Element* _node);
virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node);
virtual void setOffset(const vec2& _newVal);
virtual void requestDestroyFromChild(const std::shared_ptr<Object>& _child);
};

View File

@ -238,8 +238,8 @@ std::shared_ptr<ewol::Widget> ewol::widget::ContainerN::getWidgetAtPos(const vec
};
bool ewol::widget::ContainerN::loadXML(exml::Element* _node) {
if (nullptr == _node) {
bool ewol::widget::ContainerN::loadXML(const std::shared_ptr<const exml::Element>& _node) {
if (_node == nullptr) {
return false;
}
// parse generic properties :
@ -258,7 +258,7 @@ bool ewol::widget::ContainerN::loadXML(exml::Element* _node) {
}
// parse all the elements :
for (size_t iii=0; iii < _node->size(); iii++) {
exml::Element* pNode = _node->getElement(iii);
std::shared_ptr<const exml::Element> pNode = _node->getElement(iii);
if (pNode == nullptr) {
// trash here all that is not element
continue;
@ -275,12 +275,12 @@ bool ewol::widget::ContainerN::loadXML(exml::Element* _node) {
continue;
}
// add sub element :
if (false == invertAdding) {
if (invertAdding == false) {
subWidgetAdd(subWidget);
} else {
subWidgetAddStart(subWidget);
}
if (false == subWidget->loadXML(pNode)) {
if (subWidget->loadXML(pNode) == false) {
EWOL_ERROR ("[" << getId() << "] {" << getObjectType() << "} (l "<<pNode->getPos()<<") can not load widget properties : \"" << widgetName << "\"");
return false;
}

View File

@ -95,7 +95,7 @@ namespace ewol {
virtual void calculateMinMaxSize();
virtual std::shared_ptr<ewol::Widget> getWidgetAtPos(const vec2& _pos);
virtual std::shared_ptr<ewol::Object> getSubObjectNamed(const std::string& _objectName);
virtual bool loadXML(exml::Element* _node);
virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node);
virtual void setOffset(const vec2& _newVal);
virtual void requestDestroyFromChild(const std::shared_ptr<Object>& _child);
};

View File

@ -131,7 +131,7 @@ void ewol::widget::Image::calculateMinMaxSize() {
bool ewol::widget::Image::onEventInput(const ewol::event::Input& _event) {
//EWOL_DEBUG("Event on BT ...");
if (1 == _event.getId()) {
if (_event.getId() == 1) {
if(ewol::key::statusSingle == _event.getStatus()) {
signalPressed.emit();
return true;
@ -140,15 +140,15 @@ bool ewol::widget::Image::onEventInput(const ewol::event::Input& _event) {
return false;
}
bool ewol::widget::Image::loadXML(exml::Element* _node) {
if (nullptr == _node) {
bool ewol::widget::Image::loadXML(const std::shared_ptr<const exml::Element>& _node) {
if (_node == nullptr) {
return false;
}
ewol::Widget::loadXML(_node);
// get internal data :
std::string tmpAttributeValue = _node->getAttribute("ratio");
if (tmpAttributeValue.size()!=0) {
if (tmpAttributeValue.size() != 0) {
if (etk::compare_no_case(tmpAttributeValue, "true") == true) {
m_keepRatio = true;
} else if (tmpAttributeValue == "1") {
@ -158,21 +158,21 @@ bool ewol::widget::Image::loadXML(exml::Element* _node) {
}
}
tmpAttributeValue = _node->getAttribute("size");
if (tmpAttributeValue.size()!=0) {
if (tmpAttributeValue.size() != 0) {
//EWOL_CRITICAL(" Parse SIZE : " << tmpAttributeValue);
m_imageSize = tmpAttributeValue;
//EWOL_CRITICAL(" == > " << m_imageSize);
}
tmpAttributeValue = _node->getAttribute("border");
if (tmpAttributeValue.size()!=0) {
if (tmpAttributeValue.size() != 0) {
m_border = tmpAttributeValue;
}
//EWOL_DEBUG("Load label:" << node->ToElement()->getText());
if (_node->size()!=0) {
if (_node->size() != 0) {
setFile(_node->getText());
} else {
tmpAttributeValue = _node->getAttribute("src");
if (tmpAttributeValue.size()!=0) {
if (tmpAttributeValue.size() != 0) {
setFile(tmpAttributeValue);
}
}

View File

@ -166,7 +166,7 @@ namespace ewol {
virtual void calculateMinMaxSize();
virtual void onRegenerateDisplay();
virtual bool onEventInput(const ewol::event::Input& _event);
virtual bool loadXML(exml::Element* _node);
virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node);
};
};
};

View File

@ -131,8 +131,8 @@ bool ewol::widget::Label::onEventInput(const ewol::event::Input& _event) {
return false;
}
bool ewol::widget::Label::loadXML(exml::Element* _node) {
if (nullptr == _node) {
bool ewol::widget::Label::loadXML(const std::shared_ptr<const exml::Element>& _node) {
if (_node == nullptr) {
return false;
}
ewol::Widget::loadXML(_node);

View File

@ -74,7 +74,7 @@ namespace ewol {
virtual void calculateMinMaxSize();
virtual void onRegenerateDisplay();
virtual bool onEventInput(const ewol::event::Input& _event);
virtual bool loadXML(exml::Element* _node);
virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node);
};
};
};

View File

@ -591,7 +591,7 @@ enum ewol::context::cursorDisplay ewol::Widget::getCursor() {
return m_cursorDisplay;
}
bool ewol::Widget::loadXML(exml::Element* _node) {
bool ewol::Widget::loadXML(const std::shared_ptr<const exml::Element>& _node) {
ewol::Object::loadXML(_node);
markToRedraw();
return true;

View File

@ -663,7 +663,7 @@ namespace ewol {
*/
virtual enum ewol::context::cursorDisplay getCursor();
public: // Derived function
virtual bool loadXML(exml::Element* _node);
virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node);
protected: // Derived function
virtual void onParameterChangeValue(const ewol::parameter::Ref& _paramPointer);
public: