[DEV] exml update and tested

This commit is contained in:
Edouard DUPIN 2013-06-26 23:20:24 +02:00
parent 8a159b8ca3
commit da97bea5df
12 changed files with 39 additions and 48 deletions

2
external/etk vendored

@ -1 +1 @@
Subproject commit 2cac9e69dd5c890ad403e62ecae5e48da2a6d027
Subproject commit d2099c51e917243edd4bb808f66a32e9df69aa30

2
external/parsersvg vendored

@ -1 +1 @@
Subproject commit 7081b72812e2e9e9603bd2d37dae5acae5b2c827
Subproject commit 18832b2305675e930e775332a7c3ba6f1aa8eaa4

View File

@ -112,19 +112,16 @@ bool ewol::userConfig::Load(void)
return false;
}
for(int32_t iii=0; iii< root->Size(); iii++) {
exml::Node* child = root->Get(iii);
exml::Element* child = root->GetElement(iii);
if (child==NULL) {
continue;
}
if (!child->IsElement()) {
// nothing to do, just proceed to next step
// other than element is trash here
continue;
}
bool elementFound = false;
for (int32_t iii=0; iii<l_obj().List().Size() ; iii++) {
if (l_obj().List()[iii] != NULL) {
if (l_obj().List()[iii]->GetName() == child->GetValue()) {
l_obj().List()[iii]->LoadXML((exml::Element*)child);
l_obj().List()[iii]->LoadXML(child);
elementFound = true;
break;
}

View File

@ -402,7 +402,7 @@ void ewol::Drawing::LineTo(const vec3& _dest)
{
ResetCount();
InternalSetColor(m_color);
EWOL_DEBUG("DrawLine : " << m_position << " to " << _dest);
EWOL_VERBOSE("DrawLine : " << m_position << " to " << _dest);
if (m_position.x() == _dest.x() && m_position.y() == _dest.y() && m_position.z() == _dest.z()) {
EWOL_WARNING("Try to draw an line width 0");
return;

View File

@ -10,6 +10,10 @@
#include <ewol/compositing/Text.h>
#include <ewol/config.h>
#undef __class__
#define __class__ "ewol::Text"
ewol::Text::Text(void) :
m_position(0.0, 0.0, 0.0),
m_clippingPosStart(0.0, 0.0, 0.0),
@ -441,20 +445,19 @@ void ewol::Text::ParseHtmlNode(exml::Element* _element)
EWOL_ERROR( "Error Input node does not existed ...");
}
for(int32_t iii=0; iii< _element->Size(); iii++) {
exml::Node* child = _element->Get(iii);
if (child==NULL) {
continue;
}
if (child->GetType()==exml::typeComment) {
if (_element->GetType(iii)==exml::typeComment) {
// nothing to do ...
} else if (child->GetType()==exml::typeText) {
} else if (_element->GetType(iii)==exml::typeText) {
exml::Node* child = _element->GetNode(iii);
HtmlAddData(child->GetValue() );
EWOL_VERBOSE("XML Add : " << child->GetValue());
} else if (child->GetType()!=exml::typeElement) {
EWOL_ERROR("(l "<< child->Pos() << ") node not suported type : " << child->GetType() << " val=\""<< child->GetValue() << "\"" );
continue;
} else if (_element->GetType(iii)!=exml::typeElement) {
EWOL_ERROR("(l "<< _element->GetNode(iii)->Pos() << ") node not suported type : " << _element->GetType(iii) << " val=\""<< _element->GetNode(iii)->GetValue() << "\"" );
continue;
}
exml::Element* elem = (exml::Element*)child;
exml::Element* elem = _element->GetElement(iii);
if (elem==NULL) {
EWOL_ERROR("Cast error ...");
continue;
@ -538,9 +541,9 @@ void ewol::Text::ParseHtmlNode(exml::Element* _element)
void ewol::Text::PrintDecorated(const etk::UString& _text)
{
etk::UString tmpData("<html><body>\n");
etk::UString tmpData("<html>\n<body>\n");
tmpData+=_text;
tmpData+="\n</body></html>\n";
tmpData+="\n</body>\n</html>\n";
//EWOL_DEBUG("plop : " << tmpData);
PrintHTML(tmpData);
}
@ -562,6 +565,7 @@ void ewol::Text::PrintHTML(const etk::UString& _text)
exml::Element* root = (exml::Element*)doc.GetNamed( "html" );
if (NULL == root) {
EWOL_ERROR( "can not load XML: main node not find: \"html\"");
doc.Display();
return;
}
exml::Element* bodyNode = (exml::Element*)root->GetNamed( "body" );

View File

@ -443,12 +443,9 @@ bool widget::Button::LoadXML(exml::Element* _node)
// parse all the elements :
for(int32_t iii=0; iii< _node->Size(); iii++) {
exml::Node* pNode = _node->Get(iii);
exml::Element* pNode = _node->GetElement(iii);
if (pNode==NULL) {
continue;
}
if (!pNode->IsElement()) {
// nothing to do, just proceed to next step
// trash here all that is not element
continue;
}
etk::UString widgetName = pNode->GetValue();
@ -477,7 +474,7 @@ bool widget::Button::LoadXML(exml::Element* _node)
SetToggleMode(true);
SetSubWidgetToggle(tmpWidget);
}
if (false == tmpWidget->LoadXML((exml::Element*)pNode)) {
if (false == tmpWidget->LoadXML(pNode)) {
EWOL_ERROR ("(l "<<pNode->Pos()<<") can not load widget properties : \"" << widgetName << "\"");
return false;
}

View File

@ -178,12 +178,9 @@ bool widget::Container::LoadXML(exml::Element* _node)
// parse all the elements :
for(int32_t iii=0; iii< _node->Size(); iii++) {
exml::Node* pNode = _node->Get(iii);
exml::Element* pNode = _node->GetElement(iii);
if (pNode==NULL) {
continue;
}
if (!pNode->IsElement()) {
// nothing to do, just proceed to next step
// trash here all that is not element
continue;
}
etk::UString widgetName = pNode->GetValue();
@ -203,7 +200,7 @@ bool widget::Container::LoadXML(exml::Element* _node)
}
// add widget :
SetSubWidget(tmpWidget);
if (false == tmpWidget->LoadXML((exml::Element*)pNode)) {
if (false == tmpWidget->LoadXML(pNode)) {
EWOL_ERROR ("(l "<<pNode->Pos()<<") can not load widget properties : \"" << widgetName << "\"");
return false;
}

View File

@ -304,12 +304,9 @@ bool widget::ContainerN::LoadXML(exml::Element* _node)
}
// parse all the elements :
for(int32_t iii=0; iii< _node->Size(); iii++) {
exml::Node* pNode = _node->Get(iii);
exml::Element* pNode = _node->GetElement(iii);
if (pNode==NULL) {
continue;
}
if (!pNode->IsElement()) {
// nothing to do, just proceed to next step
// trash here all that is not element
continue;
}
etk::UString widgetName = pNode->GetValue();
@ -329,7 +326,7 @@ bool widget::ContainerN::LoadXML(exml::Element* _node)
} else {
SubWidgetAddStart(subWidget);
}
if (false == subWidget->LoadXML((exml::Element*)pNode)) {
if (false == subWidget->LoadXML(pNode)) {
EWOL_ERROR ("[" << GetId() << "] {" << GetObjectType() << "} (l "<<pNode->Pos()<<") can not load widget properties : \"" << widgetName << "\"");
return false;
}

View File

@ -142,8 +142,7 @@ bool widget::Label::LoadXML(exml::Element* _node)
}
ewol::Widget::LoadXML(_node);
// get internal data :
// TODO : Unparse data type XML ...
EWOL_DEBUG("Load label:" << _node->GetValue());
SetLabel(_node->GetValue());
EWOL_DEBUG("Load label:" << _node->GetText());
SetLabel(_node->GetText());
return true;
}

View File

@ -98,7 +98,7 @@ int32_t widget::Menu::Add(int32_t parent, etk::UString label, etk::UString image
" <image src=\"" + tmpObject->m_image + "\" size=\"8,8mm\"/>\n"
" <label>" + label + "</label>\n"
" </sizer>\n"
"</composer\n"));
"</composer>\n"));
} else {
myButton->SetSubWidget( new widget::Label(label) );
}
@ -205,7 +205,7 @@ void widget::Menu::OnReceiveMessage(const ewol::EMessage& _msg)
etk::UString("<composer expand=\"true,false\" fill=\"true,true\">\n") +
" <sizer mode=\"hori\" expand=\"true,false\" fill=\"true,true\" lock=\"true\">\n"
" <image src=\"" + m_listElement[jjj]->m_image + "\" size=\"8,8mm\"/>\n"
" <label exand=\"true,true\" fill=\"true,true\"><![CDATA[" + m_listElement[jjj]->m_label + "]]></label>\n"
" <label exand=\"true,true\" fill=\"true,true\"><![CDATA[" + m_listElement[jjj]->m_label + " ]]></label>\n"
" </sizer>\n"
"</composer>\n"));
} else {
@ -219,7 +219,7 @@ void widget::Menu::OnReceiveMessage(const ewol::EMessage& _msg)
" </sizer>\n"
"</composer>\n"));
} else {
widget::Label* tmpLabel = new widget::Label(etk::UString("<left>") + m_listElement[jjj]->m_label + "</left>");
widget::Label* tmpLabel = new widget::Label(etk::UString("<left>") + m_listElement[jjj]->m_label + "</left>\n");
if (NULL != tmpLabel) {
tmpLabel->SetExpand(bvec2(true,false));
tmpLabel->SetFill(bvec2(true,true));

View File

@ -154,7 +154,7 @@ widget::FileChooser::FileChooser(void)
" <image src=\"THEME:GUI:Load.svg\" expand=\"true\" size=\"8,8mm\"/>\n"
" <label>Validate</label>\n"
" </sizer>\n"
"</composer\n"));
"</composer>\n"));
m_widgetValidate->RegisterOnEvent(this, widget::Button::eventPressed, ewolEventFileChooserValidate);
mySizerHori->SubWidgetAdd(m_widgetValidate);
}
@ -169,7 +169,7 @@ widget::FileChooser::FileChooser(void)
" <image src=\"THEME:GUI:Remove.svg\" expand=\"true\" size=\"8,8mm\"/>\n"
" <label>Cancel</label>\n"
" </sizer>\n"
"</composer\n"));
"</composer>\n"));
m_widgetCancel->RegisterOnEvent(this, widget::Button::eventPressed, ewolEventFileChooserCancel);
mySizerHori->SubWidgetAdd(m_widgetCancel);
}

View File

@ -80,7 +80,7 @@ widget::Parameter::Parameter(void) :
" <image src=\"THEME:GUI:Save.svg\" expand=\"true\" size=\"8,8mm\"/>\n"
" <label>Save</label>\n"
" </sizer>\n"
"</composer\n"));
"</composer llll>\n"));
tmpButton->RegisterOnEvent(this, widget::Button::eventPressed, ewolEventParameterSave);
mySizerHori->SubWidgetAdd(tmpButton);
}
@ -105,7 +105,7 @@ widget::Parameter::Parameter(void) :
" <image src=\"THEME:GUI:Remove.svg\" expand=\"true\" size=\"8,8mm\"/>\n"
" <label>Close</label>\n"
" </sizer>\n"
"</composer\n"));
"</composer>\n"));
tmpButton->RegisterOnEvent(this, widget::Button::eventPressed, ewolEventParameterClose);
mySizerHori->SubWidgetAdd(tmpButton);
}