[DEV] remove unneded debug log
This commit is contained in:
parent
13802b799c
commit
90ca5367e8
2
external/etk
vendored
2
external/etk
vendored
@ -1 +1 @@
|
||||
Subproject commit 7dca8979c6548a6d0f355c2c33535c3a553ef8a0
|
||||
Subproject commit 8acac8918b8899a4ededb35e99469ac7227465fe
|
@ -121,7 +121,7 @@ void ewol::Dimension::Set(etk::UString _config)
|
||||
}
|
||||
vec2 tmp = _config;
|
||||
Set(tmp, type);
|
||||
EWOL_ERROR(" config dimention : \"" << _config << "\" ==> " << *this );
|
||||
EWOL_VERBOSE(" config dimention : \"" << _config << "\" ==> " << *this );
|
||||
}
|
||||
|
||||
ewol::Dimension::~Dimension(void)
|
||||
@ -309,8 +309,8 @@ etk::CCout& ewol::operator <<(etk::CCout &os, const ewol::Dimension::distance_te
|
||||
return os;
|
||||
}
|
||||
|
||||
etk::CCout& ewol::operator <<(etk::CCout &os, const ewol::Dimension& obj)
|
||||
etk::CCout& ewol::operator <<(etk::CCout& _os, const ewol::Dimension& _obj)
|
||||
{
|
||||
os << obj.Get(obj.GetType()) << obj.GetType();
|
||||
return os;
|
||||
_os << _obj.Get(_obj.GetType()) << _obj.GetType();
|
||||
return _os;
|
||||
}
|
||||
|
@ -215,9 +215,9 @@ void ewol::Text::Clear(void)
|
||||
|
||||
void ewol::Text::Reset(void)
|
||||
{
|
||||
m_position = vec3(0.0, 0.0, 0.0);
|
||||
m_clippingPosStart = vec3(0.0, 0.0, 0.0);
|
||||
m_clippingPosStop = vec3(0.0, 0.0, 0.0);
|
||||
m_position = vec3(0,0,0);
|
||||
m_clippingPosStart = vec3(0,0,0);
|
||||
m_clippingPosStop = vec3(0,0,0);
|
||||
m_sizeDisplayStart = m_position;
|
||||
m_sizeDisplayStop = m_position;
|
||||
m_nbCharDisplayed = 0;
|
||||
@ -470,8 +470,12 @@ void ewol::Text::ParseHtmlNode(void* element2)
|
||||
{
|
||||
// get the static real pointer
|
||||
TiXmlNode* element = static_cast<TiXmlNode*>(element2);
|
||||
if (NULL != element) {
|
||||
for (TiXmlNode * child = element->FirstChild(); NULL != child ; child = child->NextSibling() ) {
|
||||
if (NULL == element) {
|
||||
EWOL_ERROR( "Error Input node does not existed ...");
|
||||
}
|
||||
for( TiXmlNode * child = element->FirstChild() ;
|
||||
NULL != child ;
|
||||
child = child->NextSibling() ) {
|
||||
if (child->Type()==TiXmlNode::TINYXML_COMMENT) {
|
||||
// nothing to do ...
|
||||
} else if (child->Type()==TiXmlNode::TINYXML_TEXT) {
|
||||
@ -554,18 +558,17 @@ void ewol::Text::ParseHtmlNode(void* element2)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ewol::Text::PrintDecorated(etk::UString& text)
|
||||
void ewol::Text::PrintDecorated(const etk::UString& _text)
|
||||
{
|
||||
etk::UString tmpData("<html><body>\n");
|
||||
tmpData+=text;
|
||||
tmpData+=_text;
|
||||
tmpData+="\n</body></html>\n";
|
||||
//EWOL_DEBUG("plop : " << tmpData);
|
||||
PrintHTML(tmpData);
|
||||
}
|
||||
|
||||
void ewol::Text::PrintHTML(etk::UString text)
|
||||
void ewol::Text::PrintHTML(const etk::UString& _text)
|
||||
{
|
||||
TiXmlDocument XmlDocument;
|
||||
|
||||
@ -574,20 +577,24 @@ void ewol::Text::PrintHTML(etk::UString text)
|
||||
m_htmlDecoTmp.m_colorFg = draw::color::black;
|
||||
m_htmlDecoTmp.m_mode = ewol::font::Regular;
|
||||
|
||||
|
||||
etk::Char tmpChar = _text.c_str();
|
||||
// load the XML from the memory
|
||||
bool loadError = XmlDocument.Parse((const char*)text.c_str(), 0, TIXML_ENCODING_UTF8);
|
||||
bool loadError = XmlDocument.Parse(tmpChar, 0, TIXML_ENCODING_UTF8);
|
||||
if (false == loadError) {
|
||||
EWOL_ERROR( "can not load Hightlight XML: PARSING error: Decorated text ");
|
||||
EWOL_ERROR( "can not load XML: PARSING error: Decorated text ");
|
||||
return;
|
||||
}
|
||||
|
||||
TiXmlElement* root = XmlDocument.FirstChildElement( "html" );
|
||||
if (NULL == root) {
|
||||
EWOL_ERROR( "can not load Hightlight XML: main node not find: \"html\"");
|
||||
EWOL_ERROR( "can not load XML: main node not find: \"html\"");
|
||||
return;
|
||||
}
|
||||
TiXmlElement* bodyNode = root->FirstChildElement( "body" );
|
||||
if (NULL == root) {
|
||||
EWOL_ERROR( "can not load XML: main node not find: \"body\"");
|
||||
return;
|
||||
}
|
||||
(void)ParseHtmlNode(bodyNode);
|
||||
HtmlFlush();
|
||||
}
|
||||
@ -601,6 +608,8 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector<TextDecoratio
|
||||
draw::Color tmpFg(m_color);
|
||||
draw::Color tmpBg(m_colorBg);
|
||||
if (m_alignement == ewol::Text::alignDisable) {
|
||||
//EWOL_DEBUG(" 1 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position);
|
||||
// display the cursor if needed (if it is at the start position...)
|
||||
if (true == m_needDisplay) {
|
||||
if (0==m_cursorPos) {
|
||||
m_vectorialDraw.SetPos(m_position);
|
||||
@ -610,11 +619,13 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector<TextDecoratio
|
||||
}
|
||||
// note this is faster when nothing is requested ...
|
||||
for(int32_t iii=0; iii<text.Size(); iii++) {
|
||||
// check if ve have decoration
|
||||
if (iii<decoration.Size()) {
|
||||
tmpFg = decoration[iii].m_colorFg;
|
||||
tmpBg = decoration[iii].m_colorBg;
|
||||
SetFontMode(decoration[iii].m_mode);
|
||||
}
|
||||
// if real display : ( not display is for size calculation)
|
||||
if (true == m_needDisplay) {
|
||||
if( ( m_selectionStartPos-1<iii
|
||||
&& iii <=m_cursorPos-1)
|
||||
@ -639,6 +650,7 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector<TextDecoratio
|
||||
Print(text[iii]);
|
||||
m_nbCharDisplayed++;
|
||||
}
|
||||
// display the cursor if needed (if it is at the other position...)
|
||||
if (true == m_needDisplay) {
|
||||
if (iii==m_cursorPos-1) {
|
||||
m_vectorialDraw.SetPos(m_position);
|
||||
@ -647,7 +659,9 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector<TextDecoratio
|
||||
}
|
||||
}
|
||||
}
|
||||
//EWOL_DEBUG(" 2 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position);
|
||||
} else {
|
||||
//EWOL_DEBUG(" 3 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position);
|
||||
// special start case at the right of the endpoint :
|
||||
if (m_stopTextPos < m_position.x()) {
|
||||
ForceLineReturn();
|
||||
@ -773,11 +787,12 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector<TextDecoratio
|
||||
currentId = stop;
|
||||
}
|
||||
}
|
||||
//EWOL_DEBUG(" 4 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ewol::Text::Print(const uniChar_t charcode)
|
||||
void ewol::Text::Print(const uniChar_t& charcode)
|
||||
{
|
||||
if (NULL==m_font) {
|
||||
EWOL_ERROR("Font Id is not corectly defined");
|
||||
@ -793,11 +808,11 @@ void ewol::Text::Print(const uniChar_t charcode)
|
||||
int32_t fontHeigh = m_font->GetHeight(m_mode);
|
||||
|
||||
// Get the kerning ofset :
|
||||
float kerningOffset = 0.0;
|
||||
float kerningOffset = 0;
|
||||
if (true==m_kerning) {
|
||||
kerningOffset = myGlyph->KerningGet(m_previousCharcode);
|
||||
if (kerningOffset != 0) {
|
||||
//EWOL_DEBUG("Kerning between : '" << (char)m_previousCharcode << "'&'" << (char)myGlyph->m_UVal << "' value : " << kerningOffset);
|
||||
//EWOL_DEBUG("Kerning between : '" << m_previousCharcode << "'&'" << myGlyph->m_UVal << "' value : " << kerningOffset);
|
||||
}
|
||||
}
|
||||
// 0x01 == 0x20 == ' ';
|
||||
@ -941,7 +956,9 @@ void ewol::Text::Print(const uniChar_t charcode)
|
||||
}
|
||||
}
|
||||
// move the position :
|
||||
//EWOL_DEBUG(" 5 pos=" << m_position << " advance=" << myGlyph->m_advance.x() << " kerningOffset=" << kerningOffset);
|
||||
m_position.setX(m_position.x() + myGlyph->m_advance.x() + kerningOffset);
|
||||
//EWOL_DEBUG(" 6 print '" << charcode << "' : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position);
|
||||
// Register the previous character
|
||||
m_previousCharcode = charcode;
|
||||
return;
|
||||
@ -981,13 +998,16 @@ vec3 ewol::Text::CalculateSizeHTML(const etk::UString& text)
|
||||
{
|
||||
// remove intermediate result
|
||||
Reset();
|
||||
|
||||
//EWOL_DEBUG(" 0 size for=\n" << text);
|
||||
// disable display system
|
||||
m_needDisplay = false;
|
||||
|
||||
SetPos(vec3(0,0,0) );
|
||||
// same as print without the end display ...
|
||||
PrintHTML(text);
|
||||
//EWOL_DEBUG(" 1 Start pos=" << m_sizeDisplayStart);
|
||||
//EWOL_DEBUG(" 1 Stop pos=" << m_sizeDisplayStop);
|
||||
|
||||
// get the last elements
|
||||
m_sizeDisplayStop.setValue(etk_max(m_position.x(), m_sizeDisplayStop.x()) ,
|
||||
etk_max(m_position.y(), m_sizeDisplayStop.y()) ,
|
||||
@ -996,6 +1016,8 @@ vec3 ewol::Text::CalculateSizeHTML(const etk::UString& text)
|
||||
etk_min(m_position.y(), m_sizeDisplayStart.y()) ,
|
||||
0);
|
||||
|
||||
//EWOL_DEBUG(" 2 Start pos=" << m_sizeDisplayStart);
|
||||
//EWOL_DEBUG(" 2 Stop pos=" << m_sizeDisplayStop);
|
||||
// set back the display system
|
||||
m_needDisplay = true;
|
||||
|
||||
@ -1006,6 +1028,9 @@ vec3 ewol::Text::CalculateSizeHTML(const etk::UString& text)
|
||||
|
||||
vec3 ewol::Text::CalculateSizeDecorated(const etk::UString& text)
|
||||
{
|
||||
if (text.Size()==0) {
|
||||
return vec3(0,0,0);
|
||||
}
|
||||
etk::UString tmpData("<html><body>\n");
|
||||
tmpData+=text;
|
||||
tmpData+="\n</body></html>\n";
|
||||
|
@ -254,7 +254,7 @@ namespace ewol
|
||||
* @param[in] text The string to display.
|
||||
* @TODO : implementation not done ....
|
||||
*/
|
||||
void PrintDecorated(etk::UString& text);
|
||||
void PrintDecorated(const etk::UString& text);
|
||||
/**
|
||||
* @brief Display a compleat string in the current element with the generic decoration specification. (basic html data)
|
||||
* <pre>
|
||||
@ -286,7 +286,7 @@ namespace ewol
|
||||
* @param[in] text The string to display.
|
||||
* @TODO : implementation not done ....
|
||||
*/
|
||||
void PrintHTML(etk::UString text);
|
||||
void PrintHTML(const etk::UString& text);
|
||||
/**
|
||||
* @brief Display a compleat string in the current element whith specific decorations (advence mode).
|
||||
* @param[in] text The string to display.
|
||||
@ -297,7 +297,7 @@ namespace ewol
|
||||
* @brief Display the current char in the current element (note that the kerning is availlable if the position is not changed)
|
||||
* @param[in] char that might be dispalyed
|
||||
*/
|
||||
void Print(const uniChar_t charcode);
|
||||
void Print(const uniChar_t& charcode);
|
||||
/**
|
||||
* @brief This Generate the line return ==> it return to the alignement position start and at the correct line position ==> it might be use to not know the line height
|
||||
*/
|
||||
|
@ -16,6 +16,29 @@
|
||||
#include <ewol/renderer/resources/font/FontBase.h>
|
||||
#include <ewol/renderer/resources/TexturedFont.h>
|
||||
|
||||
|
||||
etk::CCout& ewol::operator <<(etk::CCout& _os, const ewol::font::mode_te& _obj)
|
||||
{
|
||||
switch(_obj) {
|
||||
default :
|
||||
_os << "error";
|
||||
break;
|
||||
case ewol::font::Regular:
|
||||
_os << "Regular";
|
||||
break;
|
||||
case ewol::font::Italic:
|
||||
_os << "Italic";
|
||||
break;
|
||||
case ewol::font::Bold:
|
||||
_os << "Bold";
|
||||
break;
|
||||
case ewol::font::BoldItalic:
|
||||
_os << "BoldItalic";
|
||||
break;
|
||||
}
|
||||
return _os;
|
||||
}
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "TexturedFont"
|
||||
|
||||
@ -154,13 +177,14 @@ ewol::TexturedFont::TexturedFont(etk::UString fontName) :
|
||||
// try to find the reference mode :
|
||||
ewol::font::mode_te refMode = ewol::font::Regular;
|
||||
for(int32_t iii=3; iii>=0; iii--) {
|
||||
if (m_fileName[iii] != "") {
|
||||
if (m_fileName[iii].IsEmpty()==false) {
|
||||
refMode = (ewol::font::mode_te)iii;
|
||||
}
|
||||
}
|
||||
EWOL_DEBUG(" Set reference mode : " << refMode);
|
||||
// generate the wrapping on the preventing error
|
||||
for(int32_t iii=3; iii>=0; iii--) {
|
||||
if (m_fileName[iii] != "") {
|
||||
if (m_fileName[iii].IsEmpty()==false) {
|
||||
m_modeWraping[iii] = (ewol::font::mode_te)iii;
|
||||
} else {
|
||||
m_modeWraping[iii] = refMode;
|
||||
@ -168,8 +192,8 @@ ewol::TexturedFont::TexturedFont(etk::UString fontName) :
|
||||
}
|
||||
|
||||
for (int32_t iiiFontId=0; iiiFontId<4 ; iiiFontId++) {
|
||||
if (m_fileName[iiiFontId] == "") {
|
||||
EWOL_CRITICAL("can not load FONT [" << iiiFontId << "] name : \"" << m_fileName[iiiFontId] << "\" ==> size=" << m_size );
|
||||
if (m_fileName[iiiFontId].IsEmpty()==false) {
|
||||
EWOL_DEBUG("can not load FONT [" << iiiFontId << "] name : \"" << m_fileName[iiiFontId] << "\" ==> size=" << m_size );
|
||||
m_font[iiiFontId] = NULL;
|
||||
continue;
|
||||
}
|
||||
@ -275,6 +299,11 @@ ewol::TexturedFont::TexturedFont(etk::UString fontName) :
|
||||
EWOL_DEBUG("End generation of the Fond bitmap, start adding texture");
|
||||
//m_data.DistanceField();
|
||||
Flush();
|
||||
EWOL_DEBUG("Wrapping properties : ");
|
||||
EWOL_DEBUG(" " << ewol::font::Regular << "==>" << GetWrappingMode(ewol::font::Regular));
|
||||
EWOL_DEBUG(" " << ewol::font::Italic << "==>" << GetWrappingMode(ewol::font::Italic));
|
||||
EWOL_DEBUG(" " << ewol::font::Bold << "==>" << GetWrappingMode(ewol::font::Bold));
|
||||
EWOL_DEBUG(" " << ewol::font::BoldItalic << "==>" << GetWrappingMode(ewol::font::BoldItalic));
|
||||
}
|
||||
|
||||
ewol::TexturedFont::~TexturedFont(void)
|
||||
@ -298,7 +327,7 @@ bool ewol::TexturedFont::HasName(const etk::UString& fileName)
|
||||
}
|
||||
|
||||
|
||||
int32_t ewol::TexturedFont::GetIndex(const uniChar_t charcode, const ewol::font::mode_te displayMode) const
|
||||
int32_t ewol::TexturedFont::GetIndex(const uniChar_t& charcode, const ewol::font::mode_te displayMode) const
|
||||
{
|
||||
if (charcode < 0x20) {
|
||||
return 0;
|
||||
@ -306,7 +335,7 @@ int32_t ewol::TexturedFont::GetIndex(const uniChar_t charcode, const ewol::font:
|
||||
return charcode.Get() - 0x1F;
|
||||
} else {
|
||||
for (int32_t iii=0x80-0x20; iii < m_listElement[displayMode].Size(); iii++) {
|
||||
if ((m_listElement[displayMode])[iii].m_UVal == charcode) {
|
||||
if (charcode == (m_listElement[displayMode])[iii].m_UVal) {
|
||||
return iii;
|
||||
}
|
||||
}
|
||||
@ -315,8 +344,22 @@ int32_t ewol::TexturedFont::GetIndex(const uniChar_t charcode, const ewol::font:
|
||||
}
|
||||
|
||||
|
||||
ewol::GlyphProperty* ewol::TexturedFont::GetGlyphPointer(const uniChar_t charcode, const ewol::font::mode_te displayMode)
|
||||
ewol::GlyphProperty* ewol::TexturedFont::GetGlyphPointer(const uniChar_t& _charcode, const ewol::font::mode_te _displayMode)
|
||||
{
|
||||
int32_t index = GetIndex(charcode, displayMode);
|
||||
return &((m_listElement[displayMode])[index]);
|
||||
//EWOL_DEBUG("Get glyph property for mode: " << _displayMode << " ==> wrapping index : " << m_modeWraping[_displayMode]);
|
||||
int32_t index = GetIndex(_charcode, _displayMode);
|
||||
if( index <0
|
||||
|| index >=m_listElement[_displayMode].Size() ) {
|
||||
EWOL_ERROR(" Try to get glyph index inexistant ... ==> return the index 0 ... id=" << index);
|
||||
if (m_listElement[_displayMode].Size()>=0) {
|
||||
return &((m_listElement[_displayMode])[0]);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
//EWOL_ERROR(" index=" << index);
|
||||
//EWOL_ERROR(" m_UVal=" << m_listElement[_displayMode][index].m_UVal);
|
||||
//EWOL_ERROR(" m_glyphIndex=" << m_listElement[_displayMode][index].m_glyphIndex);
|
||||
//EWOL_ERROR(" m_advance=" << m_listElement[_displayMode][index].m_advance);
|
||||
//EWOL_ERROR(" m_bearing=" << m_listElement[_displayMode][index].m_bearing);
|
||||
return &((m_listElement[_displayMode])[index]);
|
||||
}
|
||||
|
@ -25,6 +25,8 @@ namespace ewol
|
||||
BoldItalic,
|
||||
} mode_te;
|
||||
};
|
||||
etk::CCout& operator <<(etk::CCout& _os, const ewol::font::mode_te& _obj);
|
||||
|
||||
class TexturedFont : public ewol::Texture {
|
||||
|
||||
private:
|
||||
@ -65,14 +67,14 @@ namespace ewol
|
||||
* @param[in] displayMode Mode to display the currrent font
|
||||
* @return The ID in the table (if it does not exist : return 0)
|
||||
*/
|
||||
int32_t GetIndex(const uniChar_t charcode, const ewol::font::mode_te displayMode) const;
|
||||
int32_t GetIndex(const uniChar_t& charcode, const ewol::font::mode_te displayMode) const;
|
||||
/**
|
||||
* @brief Get the pointer on the coresponding glyph
|
||||
* @param[in] charcode The unicodeValue
|
||||
* @param[in] displayMode Mode to display the currrent font
|
||||
* @return The pointer on the glyph ==> never NULL
|
||||
*/
|
||||
ewol::GlyphProperty* GetGlyphPointer(const uniChar_t charcode, const ewol::font::mode_te displayMode);
|
||||
ewol::GlyphProperty* GetGlyphPointer(const uniChar_t& charcode, const ewol::font::mode_te displayMode);
|
||||
/**
|
||||
* @brief The wrapping mode is used to prevent the non existance of a specific mode.
|
||||
* For exemple when a blod mode does not exist, this resend a regular mode.
|
||||
|
@ -62,6 +62,15 @@ namespace ewol
|
||||
private:
|
||||
etk::Vector<ewol::Kerning> m_kerning; //!< kerning values of link of all elements
|
||||
public:
|
||||
GlyphProperty(void) :
|
||||
m_UVal(0),
|
||||
m_glyphIndex(0),
|
||||
m_sizeTexture(0,0),
|
||||
m_bearing(0,0),
|
||||
m_advance(0,0),
|
||||
m_texturePosStart(0,0),
|
||||
m_texturePosStop(0,0)
|
||||
{ };
|
||||
float KerningGet(const uniChar_t charcode)
|
||||
{
|
||||
for(int32_t iii=0; iii<m_kerning.Size(); iii++ ) {
|
||||
|
@ -135,10 +135,12 @@ void widget::Button::CalculateSize(const vec2& _availlable)
|
||||
// set minimal size
|
||||
m_size = m_minSize;
|
||||
|
||||
/*
|
||||
if (m_origin.x()<0) {
|
||||
EWOL_ERROR("[" << GetId() << "] position error ori=" << m_origin << " size=" << m_size);
|
||||
etk::DisplayBacktrace();
|
||||
}
|
||||
*/
|
||||
|
||||
vec2 minimumSizeBase(0,0);
|
||||
vec2 minimumSizeToggle(0,0);
|
||||
@ -195,6 +197,7 @@ void widget::Button::CalculateMinMaxSize(void)
|
||||
m_minSize += padding*2.0f;
|
||||
// verify the min max of the min size ...
|
||||
CheckMinSize();
|
||||
//EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Result min size : " << m_minSize);
|
||||
MarkToRedraw();
|
||||
}
|
||||
|
||||
|
@ -44,22 +44,22 @@ bool widget::Composer::LoadFromFile(const etk::UString& _fileName)
|
||||
// open the curent File
|
||||
etk::FSNode fileName(_fileName);
|
||||
if (false == fileName.Exist()) {
|
||||
EWOL_ERROR("File Does not exist : " << fileName);
|
||||
EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} File Does not exist : " << fileName);
|
||||
return false;
|
||||
}
|
||||
int32_t fileSize = fileName.FileSize();
|
||||
if (0==fileSize) {
|
||||
EWOL_ERROR("This file is empty : " << fileName);
|
||||
EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} This file is empty : " << fileName);
|
||||
return false;
|
||||
}
|
||||
if (false == fileName.FileOpenRead()) {
|
||||
EWOL_ERROR("Can not open the file : " << fileName);
|
||||
EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Can not open the file : " << fileName);
|
||||
return false;
|
||||
}
|
||||
// allocate data
|
||||
char * fileBuffer = new char[fileSize+5];
|
||||
if (NULL == fileBuffer) {
|
||||
EWOL_ERROR("Error Memory allocation size=" << fileSize);
|
||||
EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Error Memory allocation size=" << fileSize);
|
||||
return false;
|
||||
}
|
||||
memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
|
||||
@ -93,7 +93,7 @@ bool widget::Composer::CommonLoadXML(const char* data)
|
||||
|
||||
TiXmlElement* root = XmlDocument.FirstChildElement("composer");
|
||||
if (NULL == root ) {
|
||||
EWOL_ERROR("(l ?) main node not find: \"composer\" ...");
|
||||
EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} (l ?) main node not find: \"composer\" ...");
|
||||
return false;
|
||||
}
|
||||
// call upper class to parse his elements ...
|
||||
@ -113,6 +113,6 @@ void widget::Composer::RegisterOnEventNameWidget(const etk::UString& _subWidgetN
|
||||
//EWOL_DEBUG("Find widget named : \"" << _subWidgetName << "\" register event=\"" << _eventId << "\"");
|
||||
tmpWidget->RegisterOnEvent(this, _eventId, _eventIdgenerated, _overloadData);
|
||||
} else {
|
||||
EWOL_WARNING("Can not register event : \"" << _eventId << "\" the widget named=\"" << _subWidgetName << "\" does not exist");
|
||||
EWOL_WARNING("[" << GetId() << "] {" << GetObjectType() << "} Can not register event : \"" << _eventId << "\" the widget named=\"" << _subWidgetName << "\" does not exist");
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ void widget::Container::SubWidgetRemove(void)
|
||||
delete(m_subWidget);
|
||||
// might have been destroy first here :
|
||||
if (m_subWidget!=NULL) {
|
||||
EWOL_ERROR("Composer : An error Occured when removing main node");
|
||||
EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} An error Occured when removing main node");
|
||||
}
|
||||
MarkToRedraw();
|
||||
ewol::RequestUpdateSize();
|
||||
@ -133,7 +133,7 @@ void widget::Container::CalculateMinMaxSize(void)
|
||||
vec2 min = m_subWidget->GetCalculateMinSize();
|
||||
m_minSize.setMax(min);
|
||||
}
|
||||
EWOL_ERROR("[" << GetId() << "] Result min size : " << m_minSize);
|
||||
//EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Result min size : " << m_minSize);
|
||||
}
|
||||
|
||||
void widget::Container::OnRegenerateDisplay(void)
|
||||
@ -174,23 +174,23 @@ bool widget::Container::LoadXML(TiXmlNode* _node)
|
||||
}
|
||||
etk::UString widgetName = pNode->Value();
|
||||
if (ewol::widgetManager::Exist(widgetName) == false) {
|
||||
EWOL_ERROR("(l "<<pNode->Row()<<") Unknown basic node=\"" << widgetName << "\" not in : [" << ewol::widgetManager::List() << "]" );
|
||||
EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} (l "<<pNode->Row()<<") Unknown basic node=\"" << widgetName << "\" not in : [" << ewol::widgetManager::List() << "]" );
|
||||
continue;
|
||||
}
|
||||
if (NULL != GetSubWidget()) {
|
||||
EWOL_ERROR("(l "<<pNode->Row()<<") " << __class__ << " Can only have one subWidget ??? node=\"" << widgetName << "\"" );
|
||||
EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} (l "<<pNode->Row()<<") " << __class__ << " Can only have one subWidget ??? node=\"" << widgetName << "\"" );
|
||||
continue;
|
||||
}
|
||||
EWOL_DEBUG("try to create subwidget : '" << widgetName << "'");
|
||||
EWOL_DEBUG("[" << GetId() << "] {" << GetObjectType() << "} try to create subwidget : '" << widgetName << "'");
|
||||
ewol::Widget* tmpWidget = ewol::widgetManager::Create(widgetName);
|
||||
if (tmpWidget == NULL) {
|
||||
EWOL_ERROR ("(l "<<pNode->Row()<<") Can not create the widget : \"" << widgetName << "\"");
|
||||
EWOL_ERROR ("[" << GetId() << "] {" << GetObjectType() << "} (l "<<pNode->Row()<<") Can not create the widget : \"" << widgetName << "\"");
|
||||
continue;
|
||||
}
|
||||
// add widget :
|
||||
SetSubWidget(tmpWidget);
|
||||
if (false == tmpWidget->LoadXML(pNode)) {
|
||||
EWOL_ERROR ("(l "<<pNode->Row()<<") can not load widget properties : \"" << widgetName << "\"");
|
||||
EWOL_ERROR ("[" << GetId() << "] {" << GetObjectType() << "} (l "<<pNode->Row()<<") can not load widget properties : \"" << widgetName << "\"");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ void widget::ContainerN::LockExpand(const bvec2& _lockExpand)
|
||||
void widget::ContainerN::SubWidgetAdd(ewol::Widget* _newWidget)
|
||||
{
|
||||
if (NULL == _newWidget) {
|
||||
EWOL_ERROR("[" << GetId() << "] Try to add An empty Widget ... ");
|
||||
EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Try to add An empty Widget ... ");
|
||||
return;
|
||||
}
|
||||
if (_newWidget!=NULL) {
|
||||
@ -72,7 +72,7 @@ void widget::ContainerN::SubWidgetAdd(ewol::Widget* _newWidget)
|
||||
void widget::ContainerN::SubWidgetAddStart(ewol::Widget* _newWidget)
|
||||
{
|
||||
if (NULL == _newWidget) {
|
||||
EWOL_ERROR("[" << GetId() << "] Try to add start An empty Widget ... ");
|
||||
EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Try to add start An empty Widget ... ");
|
||||
return;
|
||||
}
|
||||
if (_newWidget!=NULL) {
|
||||
@ -95,7 +95,7 @@ void widget::ContainerN::SubWidgetRemove(ewol::Widget* _newWidget)
|
||||
delete(m_subWidget[iii]);
|
||||
// no remove, this element is removed with the function OnObjectRemove ==> it does not exist anymore ...
|
||||
if (errorControl == m_subWidget.Size()) {
|
||||
EWOL_CRITICAL("[" << GetId() << "] The number of element might have been reduced ... ==> it is not the case ==> the herited class must call the \"OnObjectRemove\" function...");
|
||||
EWOL_CRITICAL("[" << GetId() << "] {" << GetObjectType() << "} The number of element might have been reduced ... ==> it is not the case ==> the herited class must call the \"OnObjectRemove\" function...");
|
||||
m_subWidget[iii] = NULL;
|
||||
m_subWidget.Erase(iii);
|
||||
}
|
||||
@ -133,11 +133,11 @@ void widget::ContainerN::SubWidgetRemoveAll(void)
|
||||
delete(m_subWidget[0]);
|
||||
// no remove, this element is removed with the function OnObjectRemove ==> it does not exist anymore ...
|
||||
if (errorControl == m_subWidget.Size()) {
|
||||
EWOL_CRITICAL("[" << GetId() << "] The number of element might have been reduced ... ==> it is not the case ==> the herited class must call the \"OnObjectRemove\" function...");
|
||||
EWOL_CRITICAL("[" << GetId() << "] {" << GetObjectType() << "} The number of element might have been reduced ... ==> it is not the case ==> the herited class must call the \"OnObjectRemove\" function...");
|
||||
m_subWidget[0] = NULL;
|
||||
}
|
||||
} else {
|
||||
EWOL_WARNING("[" << GetId() << "] Must not have null pointer on the subWidget list ...");
|
||||
EWOL_WARNING("[" << GetId() << "] {" << GetObjectType() << "} Must not have null pointer on the subWidget list ...");
|
||||
m_subWidget.Erase(0);
|
||||
}
|
||||
errorControl = m_subWidget.Size();
|
||||
@ -168,7 +168,7 @@ void widget::ContainerN::OnObjectRemove(ewol::EObject* _removeObject)
|
||||
// second step find if in all the elements ...
|
||||
for(int32_t iii=m_subWidget.Size()-1; iii>=0; iii--) {
|
||||
if(m_subWidget[iii] == _removeObject) {
|
||||
EWOL_VERBOSE("[" << GetId() << "]={" << GetObjectType() << "} Remove sizer sub Element [" << iii << "/" << m_subWidget.Size()-1 << "] ==> destroyed object");
|
||||
EWOL_VERBOSE("[" << GetId() << "] {" << GetObjectType() << "} Remove sizer sub Element [" << iii << "/" << m_subWidget.Size()-1 << "] ==> destroyed object");
|
||||
m_subWidget[iii] = NULL;
|
||||
m_subWidget.Erase(iii);
|
||||
}
|
||||
@ -210,6 +210,7 @@ void widget::ContainerN::CalculateMinMaxSize(void)
|
||||
m_subExpend.setValue(false, false);
|
||||
m_minSize.setValue(0,0);
|
||||
m_maxSize.setValue(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE);
|
||||
//EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Set min size : " << m_minSize);
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
m_subWidget[iii]->CalculateMinMaxSize();
|
||||
@ -225,6 +226,7 @@ void widget::ContainerN::CalculateMinMaxSize(void)
|
||||
etk_max(tmpSize.y(), m_minSize.y()) );
|
||||
}
|
||||
}
|
||||
//EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Result min size : " << m_minSize);
|
||||
}
|
||||
|
||||
void widget::ContainerN::OnRegenerateDisplay(void)
|
||||
@ -294,12 +296,12 @@ bool widget::ContainerN::LoadXML(TiXmlNode* _node)
|
||||
}
|
||||
etk::UString widgetName = pNode->Value();
|
||||
if (ewol::widgetManager::Exist(widgetName) == false) {
|
||||
EWOL_ERROR("(l "<<pNode->Row()<<") Unknown basic node=\"" << widgetName << "\" not in : [" << ewol::widgetManager::List() << "]" );
|
||||
EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} (l "<<pNode->Row()<<") Unknown basic node=\"" << widgetName << "\" not in : [" << ewol::widgetManager::List() << "]" );
|
||||
continue;
|
||||
}
|
||||
ewol::Widget *subWidget = ewol::widgetManager::Create(widgetName);
|
||||
if (subWidget == NULL) {
|
||||
EWOL_ERROR ("(l "<<pNode->Row()<<") Can not create the widget : \"" << widgetName << "\"");
|
||||
EWOL_ERROR ("[" << GetId() << "] {" << GetObjectType() << "} (l "<<pNode->Row()<<") Can not create the widget : \"" << widgetName << "\"");
|
||||
continue;
|
||||
}
|
||||
// add sub element :
|
||||
@ -309,7 +311,7 @@ bool widget::ContainerN::LoadXML(TiXmlNode* _node)
|
||||
SubWidgetAddStart(subWidget);
|
||||
}
|
||||
if (false == subWidget->LoadXML(pNode)) {
|
||||
EWOL_ERROR ("(l "<<pNode->Row()<<") can not load widget properties : \"" << widgetName << "\"");
|
||||
EWOL_ERROR ("[" << GetId() << "] {" << GetObjectType() << "} (l "<<pNode->Row()<<") can not load widget properties : \"" << widgetName << "\"");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -42,13 +42,17 @@ widget::Label::Label(etk::UString _newLabel)
|
||||
void widget::Label::CalculateMinMaxSize(void)
|
||||
{
|
||||
vec2 tmpMax = m_userMaxSize.GetPixel();
|
||||
//EWOL_DEBUG("[" << GetId() << "] {" << GetObjectType() << "} tmpMax : " << tmpMax);
|
||||
if (tmpMax.x() <= 999999) {
|
||||
m_text.SetTextAlignement(0, tmpMax.x()-4, ewol::Text::alignLeft);
|
||||
//EWOL_DEBUG("[" << GetId() << "] {" << GetObjectType() << "} Forcez Alignement ");
|
||||
}
|
||||
vec3 minSize = m_text.CalculateSizeDecorated(m_label);
|
||||
//EWOL_DEBUG("[" << GetId() << "] {" << GetObjectType() << "} minSize : " << minSize);
|
||||
|
||||
m_minSize.setX(etk_min(4 + minSize.x(), tmpMax.x()));
|
||||
m_minSize.setY(etk_min(4 + minSize.y(), tmpMax.y()));
|
||||
//EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Result min size : " << m_minSize);
|
||||
}
|
||||
|
||||
void widget::Label::SetLabel(const etk::UString& _newLabel)
|
||||
|
@ -34,35 +34,26 @@ widget::PopUp::~PopUp(void)
|
||||
void widget::PopUp::CalculateSize(const vec2& _availlable)
|
||||
{
|
||||
ewol::Widget::CalculateSize(_availlable);
|
||||
EWOL_DEBUG(" _availlable : " << _availlable);
|
||||
m_size = _availlable;
|
||||
if (NULL != m_subWidget) {
|
||||
vec2 subElementSize = m_minSize;
|
||||
EWOL_DEBUG("[" << GetId() << "] popUP: m_minSize : " << subElementSize);
|
||||
vec2 subElementOrigin = m_origin + (m_size-m_minSize)/2.0f;
|
||||
EWOL_DEBUG("[" << GetId() << "] popUP: subElementOrigin : " << subElementOrigin);
|
||||
|
||||
vec2 subWidgetSize = m_subWidget->GetCalculateMinSize();
|
||||
EWOL_DEBUG("[" << GetId() << "] popUP: subWidgetSize : " << subWidgetSize);
|
||||
if (true == m_subWidget->CanExpand().x()) {
|
||||
subWidgetSize.setX(m_minSize.x());
|
||||
}
|
||||
if (true == m_subWidget->CanExpand().y()) {
|
||||
subWidgetSize.setY(m_minSize.y());
|
||||
}
|
||||
EWOL_DEBUG("[" << GetId() << "] popUP: subWidgetSize : " << subWidgetSize);
|
||||
// limit the size of the element :
|
||||
subWidgetSize.setMin(m_minSize);
|
||||
EWOL_DEBUG("[" << GetId() << "] popUP: subWidgetSize : " << subWidgetSize);
|
||||
// posiition at a int32_t pos :
|
||||
subWidgetSize = vec2ClipInt32(subWidgetSize);
|
||||
EWOL_DEBUG("[" << GetId() << "] popUP: subWidgetSize : " << subWidgetSize);
|
||||
|
||||
// set config to the Sub-widget
|
||||
vec2 subWidgetOrigin = m_origin + (m_size-subWidgetSize)/2.0f;
|
||||
EWOL_DEBUG("[" << GetId() << "] popUP: subWidgetOrigin : " << subWidgetOrigin);
|
||||
subWidgetOrigin = vec2ClipInt32(subWidgetOrigin);
|
||||
EWOL_DEBUG("[" << GetId() << "] popUP: subWidgetOrigin : " << subWidgetOrigin);
|
||||
|
||||
m_subWidget->SetOrigin(subWidgetOrigin);
|
||||
m_subWidget->CalculateSize(subWidgetSize);
|
||||
|
@ -66,7 +66,7 @@ void widget::Sizer::CalculateSize(const vec2& _availlable)
|
||||
{
|
||||
ewol::Widget::CalculateSize(_availlable);
|
||||
vec2 tmpBorderSize = m_borderSize.GetPixel();
|
||||
EWOL_DEBUG("[" << GetId() << "] Update Size : " << _availlable << " nbElement : " << m_subWidget.Size() << " borderSize=" << tmpBorderSize << " from border=" << m_borderSize);
|
||||
//EWOL_DEBUG("[" << GetId() << "] Update Size : " << _availlable << " nbElement : " << m_subWidget.Size() << " borderSize=" << tmpBorderSize << " from border=" << m_borderSize);
|
||||
m_size -= tmpBorderSize*2;
|
||||
// calculate unExpandable Size :
|
||||
float unexpandableSize=0.0;
|
||||
@ -110,7 +110,7 @@ void widget::Sizer::CalculateSize(const vec2& _availlable)
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
vec2 tmpSize = m_subWidget[iii]->GetCalculateMinSize();
|
||||
// Set the origin :
|
||||
EWOL_DEBUG("[" << GetId() << "] Set iii=" << iii << " ORIGIN : " << tmpOrigin << " & offset=" << m_offset);
|
||||
//EWOL_DEBUG("[" << GetId() << "] Set iii=" << iii << " ORIGIN : " << tmpOrigin << " & offset=" << m_offset);
|
||||
m_subWidget[iii]->SetOrigin(vec2ClipInt32(tmpOrigin+m_offset));
|
||||
// Now Update his Size his size in X and the curent sizer size in Y:
|
||||
if (m_mode==widget::Sizer::modeVert) {
|
||||
@ -143,7 +143,7 @@ void widget::Sizer::CalculateMinMaxSize(void)
|
||||
m_subExpend.setValue(false, false);
|
||||
m_minSize = m_userMinSize.GetPixel();
|
||||
vec2 tmpBorderSize = m_borderSize.GetPixel();
|
||||
|
||||
//EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Set min size : " << m_minSize);
|
||||
m_minSize += tmpBorderSize*2;
|
||||
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
|
||||
if (NULL != m_subWidget[iii]) {
|
||||
@ -156,7 +156,7 @@ void widget::Sizer::CalculateMinMaxSize(void)
|
||||
}
|
||||
vec2 tmpSize = m_subWidget[iii]->GetCalculateMinSize();
|
||||
//EWOL_DEBUG("[" << GetId() << "] NewMinSize=" << tmpSize);
|
||||
//EWOL_DEBUG("[" << GetId() << "] Get minSize[" << iii << "] "<< tmpSize);
|
||||
//EWOL_DEBUG("[" << GetId() << "] {" << GetObjectType() << "} Get minSize[" << iii << "] "<< tmpSize);
|
||||
if (m_mode==widget::Sizer::modeVert) {
|
||||
m_minSize.setY(m_minSize.y() + tmpSize.y());
|
||||
if (tmpSize.x()>m_minSize.x()) {
|
||||
@ -170,6 +170,7 @@ void widget::Sizer::CalculateMinMaxSize(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
//EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Result min size : " << m_minSize);
|
||||
}
|
||||
|
||||
bool widget::Sizer::LoadXML(TiXmlNode* _node)
|
||||
|
@ -396,7 +396,7 @@ void ewol::Widget::SetOrigin(const vec2& _pos)
|
||||
#if DEBUG_LEVEL > 2
|
||||
if( m_origin.x() < -5000
|
||||
|| m_origin.y() < -5000) {
|
||||
EWOL_WARNING("[" << GetId() << "] Set origin < 5000 : " << m_origin);
|
||||
EWOL_WARNING("[" << GetId() << "] {" << GetObjectType() << "} Set origin < 5000 : " << m_origin);
|
||||
}
|
||||
#endif
|
||||
m_origin = _pos;
|
||||
@ -415,9 +415,9 @@ vec2 ewol::Widget::RelativePosition(const vec2& _pos)
|
||||
void ewol::Widget::CalculateMinMaxSize(void)
|
||||
{
|
||||
m_minSize = m_userMinSize.GetPixel();
|
||||
EWOL_ERROR("[" << GetId() << "] convert in min size : " << m_userMinSize << " out=" << m_minSize);
|
||||
m_maxSize = m_userMaxSize.GetPixel();
|
||||
MarkToRedraw();
|
||||
//EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} convert in min size : " << m_userMinSize << " out=" << m_minSize);
|
||||
}
|
||||
|
||||
vec2 ewol::Widget::GetCalculateMinSize(void)
|
||||
@ -449,7 +449,7 @@ void ewol::Widget::SetMinSize(const ewol::Dimension& _size)
|
||||
error=true;
|
||||
}
|
||||
if (error==true) {
|
||||
EWOL_ERROR("Can not set a 'min Size' > 'max size' set nothing ...");
|
||||
EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Can not set a 'min Size' > 'max size' set nothing ...");
|
||||
return;
|
||||
}
|
||||
m_userMinSize = _size;
|
||||
@ -481,7 +481,7 @@ void ewol::Widget::SetMaxSize(const ewol::Dimension& _size)
|
||||
error=true;
|
||||
}
|
||||
if (error==true) {
|
||||
EWOL_ERROR("Can not set a 'min Size' > 'max size' set nothing ...");
|
||||
EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} Can not set a 'min Size' > 'max size' set nothing ...");
|
||||
return;
|
||||
}
|
||||
m_userMaxSize = _size;
|
||||
@ -551,13 +551,13 @@ void ewol::Widget::ShortCutAdd(const char * _descriptiveString, const char * _ge
|
||||
if( NULL==_descriptiveString
|
||||
|| 0==strlen(_descriptiveString))
|
||||
{
|
||||
EWOL_ERROR("try to add shortcut with no descriptive string ...");
|
||||
EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} try to add shortcut with no descriptive string ...");
|
||||
return;
|
||||
}
|
||||
|
||||
EventShortCut* tmpElement = new EventShortCut();
|
||||
if (NULL == tmpElement) {
|
||||
EWOL_ERROR("allocation error ... Memory error ...");
|
||||
EWOL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} allocation error ... Memory error ...");
|
||||
return;
|
||||
}
|
||||
tmpElement->broadcastEvent = _broadcast;
|
||||
|
@ -52,7 +52,7 @@ ewol::Windows::~Windows(void)
|
||||
|
||||
void ewol::Windows::CalculateSize(const vec2& _availlable)
|
||||
{
|
||||
EWOL_DEBUG(" _availlable : " << _availlable);
|
||||
//EWOL_DEBUG(" _availlable : " << _availlable);
|
||||
m_size = _availlable;
|
||||
if (NULL != m_subWidget) {
|
||||
m_subWidget->CalculateMinMaxSize();
|
||||
|
Loading…
x
Reference in New Issue
Block a user