diff --git a/ewol/DrawProperty.cpp b/ewol/DrawProperty.cpp index 30733944..2efe3b0b 100644 --- a/ewol/DrawProperty.cpp +++ b/ewol/DrawProperty.cpp @@ -7,7 +7,7 @@ #include #include -std::ostream& ewol::operator <<(std::ostream& _os, const ewol::DrawProperty& _obj) { +etk::Stream& ewol::operator <<(etk::Stream& _os, const ewol::DrawProperty& _obj) { _os << "{ windowsSize=" << _obj.m_windowsSize << " start=" << _obj.m_origin << " stop=" << (_obj.m_origin+_obj.m_size) << "}"; return _os; } diff --git a/ewol/DrawProperty.hpp b/ewol/DrawProperty.hpp index 6226b1c2..659bad6a 100644 --- a/ewol/DrawProperty.hpp +++ b/ewol/DrawProperty.hpp @@ -43,6 +43,6 @@ namespace ewol { ivec2 m_size; //!< Windows clipping upper widget (can not be <0 and >m_windowsSize) void limit(const vec2& _origin, const vec2& _size); }; - std::ostream& operator <<(std::ostream& _os, const ewol::DrawProperty& _obj); + etk::Stream& operator <<(etk::Stream& _os, const ewol::DrawProperty& _obj); } diff --git a/ewol/Padding.cpp b/ewol/Padding.cpp index e5ba1be9..941b88e1 100644 --- a/ewol/Padding.cpp +++ b/ewol/Padding.cpp @@ -76,7 +76,7 @@ ewol::Padding ewol::Padding::operator+(const Padding& _v) { m_value[3] + _v.m_value[3]); } -std::ostream& ewol::operator <<(std::ostream& _os, const ewol::Padding& _obj) { +etk::Stream& ewol::operator <<(etk::Stream& _os, const ewol::Padding& _obj) { _os << "{"; _os << _obj.xLeft(); _os << ","; diff --git a/ewol/Padding.hpp b/ewol/Padding.hpp index 8854bef8..b4d604eb 100644 --- a/ewol/Padding.hpp +++ b/ewol/Padding.hpp @@ -37,6 +37,6 @@ namespace ewol { Padding operator+(const Padding& _v); }; - std::ostream& operator <<(std::ostream& _os, const ewol::Padding& _obj); + etk::Stream& operator <<(etk::Stream& _os, const ewol::Padding& _obj); }; diff --git a/ewol/compositing/Area.cpp b/ewol/compositing/Area.cpp index bd66ff59..d51da785 100644 --- a/ewol/compositing/Area.cpp +++ b/ewol/compositing/Area.cpp @@ -44,7 +44,7 @@ ewol::compositing::Area::~Area() { void ewol::compositing::Area::loadProgram() { // get the shader resource : m_GLPosition = 0; - m_GLprogram = gale::resource::Program::create(std::string("{ewol}DATA:textured3D.prog")); + m_GLprogram = gale::resource::Program::create(etk::String("{ewol}DATA:textured3D.prog")); if (m_GLprogram != nullptr) { m_GLPosition = m_GLprogram->getAttribute("EW_coord3d"); m_GLColor = m_GLprogram->getAttribute("EW_color"); diff --git a/ewol/compositing/Drawing.cpp b/ewol/compositing/Drawing.cpp index f72ba7d1..ee62cfde 100644 --- a/ewol/compositing/Drawing.cpp +++ b/ewol/compositing/Drawing.cpp @@ -14,21 +14,21 @@ const int32_t ewol::compositing::Drawing::m_vboIdColor(1); #if 0 -static void generatePolyGone(std::vector & input, std::vector & output ) +static void generatePolyGone(etk::Vector & input, etk::Vector & output ) { if (input.size()<3) { return; } // TODO : Regenerate a linear poligone generation for (int32_t iii=1; iii " << output.size() ); } -static void SutherlandHodgman(std::vector & input, std::vector & output, float sx, float sy, float ex, float ey) +static void SutherlandHodgman(etk::Vector & input, etk::Vector & output, float sx, float sy, float ex, float ey) { // with Sutherland-Hodgman-Algorithm if (input.size() <0) { @@ -53,7 +53,7 @@ static void SutherlandHodgman(std::vector & input, std::vector & o float bbb = lastElement.y - (aaa*lastElement.x); destPoint.y = aaa*sx + bbb; destPoint.x = sx; - output.push_back(destPoint); + output.pushBack(destPoint); } else { //EWOL_DEBUG("element OUT == > OUT "); } @@ -61,7 +61,7 @@ static void SutherlandHodgman(std::vector & input, std::vector & o } else { if(true == inside) { //EWOL_DEBUG("element IN == > IN "); - output.push_back(input[iii]); + output.pushBack(input[iii]); } else { //EWOL_DEBUG("element OUT == > IN "); //new point intersection ... @@ -70,8 +70,8 @@ static void SutherlandHodgman(std::vector & input, std::vector & o float bbb = lastElement.y - (aaa*lastElement.x); destPoint.y = aaa*sx + bbb; destPoint.x = sx; - output.push_back(destPoint); - output.push_back(input[iii]); + output.pushBack(destPoint); + output.pushBack(input[iii]); } inside = true; } @@ -98,7 +98,7 @@ static void SutherlandHodgman(std::vector & input, std::vector & o float bbb = lastElement.x - (aaa*lastElement.y); destPoint.y = sy; destPoint.x = sy*aaa + bbb; - output.push_back(destPoint); + output.pushBack(destPoint); } else { //EWOL_DEBUG("element OUT == > OUT "); } @@ -106,7 +106,7 @@ static void SutherlandHodgman(std::vector & input, std::vector & o } else { if(true == inside) { //EWOL_DEBUG("element IN == > IN "); - output.push_back(input[iii]); + output.pushBack(input[iii]); } else { //EWOL_DEBUG("element OUT == > IN "); //new point intersection ... @@ -115,8 +115,8 @@ static void SutherlandHodgman(std::vector & input, std::vector & o float bbb = lastElement.x - (aaa*lastElement.y); destPoint.y = sy; destPoint.x = sy*aaa + bbb; - output.push_back(destPoint); - output.push_back(input[iii]); + output.pushBack(destPoint); + output.pushBack(input[iii]); } inside = true; } @@ -143,7 +143,7 @@ static void SutherlandHodgman(std::vector & input, std::vector & o float bbb = lastElement.y - (aaa*lastElement.x); destPoint.y = aaa*ex + bbb; destPoint.x = ex; - output.push_back(destPoint); + output.pushBack(destPoint); } else { //EWOL_DEBUG("element OUT == > OUT "); } @@ -151,7 +151,7 @@ static void SutherlandHodgman(std::vector & input, std::vector & o } else { if(true == inside) { //EWOL_DEBUG("element IN == > IN "); - output.push_back(input[iii]); + output.pushBack(input[iii]); } else { //EWOL_DEBUG("element OUT == > IN "); //new point intersection ... @@ -160,8 +160,8 @@ static void SutherlandHodgman(std::vector & input, std::vector & o float bbb = lastElement.y - (aaa*lastElement.x); destPoint.y = aaa*ex + bbb; destPoint.x = ex; - output.push_back(destPoint); - output.push_back(input[iii]); + output.pushBack(destPoint); + output.pushBack(input[iii]); } inside = true; } @@ -187,7 +187,7 @@ static void SutherlandHodgman(std::vector & input, std::vector & o float bbb = lastElement.x - (aaa*lastElement.y); destPoint.y = ey; destPoint.x = ey*aaa + bbb; - output.push_back(destPoint); + output.pushBack(destPoint); } else { //EWOL_DEBUG("element OUT == > OUT "); } @@ -195,7 +195,7 @@ static void SutherlandHodgman(std::vector & input, std::vector & o } else { if(true == inside) { //EWOL_DEBUG("element IN == > IN "); - output.push_back(input[iii]); + output.pushBack(input[iii]); } else { //EWOL_DEBUG("element OUT == > IN "); //new point intersection ... @@ -204,8 +204,8 @@ static void SutherlandHodgman(std::vector & input, std::vector & o float bbb = lastElement.x - (aaa*lastElement.y); destPoint.y = ey; destPoint.x = ey*aaa + bbb; - output.push_back(destPoint); - output.push_back(input[iii]); + output.pushBack(destPoint); + output.pushBack(input[iii]); } inside = true; } diff --git a/ewol/compositing/Image.cpp b/ewol/compositing/Image.cpp index 18ea306c..e0e9be6d 100644 --- a/ewol/compositing/Image.cpp +++ b/ewol/compositing/Image.cpp @@ -15,7 +15,7 @@ const int32_t ewol::compositing::Image::m_vboIdCoordTex(1); const int32_t ewol::compositing::Image::m_vboIdColor(2); #define NB_VBO (3) -ewol::compositing::Image::Image(const std::string& _imageName, +ewol::compositing::Image::Image(const etk::String& _imageName, bool _df, int32_t _size) : m_filename(_imageName), @@ -268,7 +268,7 @@ void ewol::compositing::Image::printPart(const vec2& _size, m_VBO->flush(); } -void ewol::compositing::Image::setSource(const std::string& _newFile, const vec2& _size) { +void ewol::compositing::Image::setSource(const etk::String& _newFile, const vec2& _size) { clear(); if ( m_filename == _newFile && m_requestSize == _size) { diff --git a/ewol/compositing/Image.hpp b/ewol/compositing/Image.hpp index cccf9027..e1d1bc44 100644 --- a/ewol/compositing/Image.hpp +++ b/ewol/compositing/Image.hpp @@ -17,7 +17,7 @@ namespace ewol { public: static const int32_t sizeAuto; private: - std::string m_filename; + etk::String m_filename; ivec2 m_requestSize; vec3 m_position; //!< The current position to draw vec3 m_clippingPosStart; //!< Clipping start position @@ -54,7 +54,7 @@ namespace ewol { * @param[in] _df enable distance field mode * @param[in] _size for the image when Verctorial image loading is requested */ - Image(const std::string& _imageName="", + Image(const etk::String& _imageName="", bool _df=false, int32_t _size=ewol::compositing::Image::sizeAuto); /** @@ -159,10 +159,10 @@ namespace ewol { * @param[in] _newFile New file of the Image * @param[in] _size for the image when Verctorial image loading is requested */ - void setSource(const std::string& _newFile, int32_t _size=32) { + void setSource(const etk::String& _newFile, int32_t _size=32) { setSource(_newFile, vec2(_size,_size)); }; - void setSource(const std::string& _newFile, const vec2& _size); + void setSource(const etk::String& _newFile, const vec2& _size); void setSource(egami::Image _image); /** * @brief Sometimes the user declare an image but not allocate the ressources all the time, this is to know it .. diff --git a/ewol/compositing/Shaper.cpp b/ewol/compositing/Shaper.cpp index c4f33a26..b678c5af 100644 --- a/ewol/compositing/Shaper.cpp +++ b/ewol/compositing/Shaper.cpp @@ -13,7 +13,7 @@ const int32_t ewol::compositing::Shaper::m_vboIdCoord(0); const int32_t ewol::compositing::Shaper::m_vboIdPos(1); #define NB_VBO (2) -ewol::compositing::Shaper::Shaper(const std::string& _shaperName) : +ewol::compositing::Shaper::Shaper(const etk::String& _shaperName) : m_name(_shaperName), m_config(nullptr), m_confIdMode(-1), @@ -106,10 +106,10 @@ void ewol::compositing::Shaper::loadProgram() { m_confImageFile = m_config->request("image"); m_confColorFile = m_config->request("color"); } - std::string basicShaderFile = m_config->getString(m_confProgramFile); + etk::String basicShaderFile = m_config->getString(m_confProgramFile); if (basicShaderFile != "") { - std::string tmpFilename(basicShaderFile); - if (tmpFilename.find(':') == std::string::npos) { + etk::String tmpFilename(basicShaderFile); + if (tmpFilename.find(':') == etk::String::npos) { // get the relative position of the current file ... etk::FSNode file(m_name); tmpFilename = file.getRelativeFolder() + basicShaderFile; @@ -133,10 +133,10 @@ void ewol::compositing::Shaper::loadProgram() { // for the texture ID : m_GLtexID = m_GLprogram->getUniform("EW_texID"); } - std::string basicImageFile = m_config->getString(m_confImageFile); + etk::String basicImageFile = m_config->getString(m_confImageFile); if (basicImageFile != "") { - std::string tmpFilename(basicImageFile); - if (tmpFilename.find(':') == std::string::npos) { + etk::String tmpFilename(basicImageFile); + if (tmpFilename.find(':') == etk::String::npos) { // get the relative position of the current file ... etk::FSNode file(m_name); tmpFilename = file.getRelativeFolder() + basicImageFile; @@ -148,10 +148,10 @@ void ewol::compositing::Shaper::loadProgram() { m_resourceTexture = ewol::resource::TextureFile::create(tmpFilename, size); } } - std::string basicColorFile = m_config->getString(m_confColorFile); + etk::String basicColorFile = m_config->getString(m_confColorFile); if (basicColorFile != "") { - std::string tmpFilename(basicColorFile); - if (tmpFilename.find(':') == std::string::npos) { + etk::String tmpFilename(basicColorFile); + if (tmpFilename.find(':') == etk::String::npos) { // get the relative position of the current file ... etk::FSNode file(m_name); tmpFilename = file.getRelativeFolder() + basicColorFile; @@ -162,11 +162,11 @@ void ewol::compositing::Shaper::loadProgram() { m_colorProperty = ewol::resource::ColorFile::create(tmpFilename); if ( m_GLprogram != nullptr && m_colorProperty != nullptr) { - std::vector listColor = m_colorProperty->getColors(); + etk::Vector listColor = m_colorProperty->getColors(); for (auto tmpColor : listColor) { int32_t glId = m_GLprogram->getUniform(tmpColor); int32_t colorID = m_colorProperty->request(tmpColor); - m_listAssiciatedId.push_back(ivec2(glId, colorID)); + m_listAssiciatedId.pushBack(ivec2(glId, colorID)); } } } @@ -275,7 +275,7 @@ bool ewol::compositing::Shaper::periodicCall(const ewol::event::Time& _event) { } m_stateTransition += _event.getDeltaCall() / timeRelativity; //m_stateTransition += _event.getDeltaCall(); - m_stateTransition = std::avg(0.0f, m_stateTransition, 1.0f); + m_stateTransition = etk::avg(0.0f, m_stateTransition, 1.0f); EWOL_VERBOSE("relative=" << timeRelativity << " Transition : " << m_stateTransition); } return true; @@ -478,10 +478,10 @@ void ewol::compositing::Shaper::setShape(const vec2& _origin, const vec2& _size, border.yTop() - borderTmp.yTop(), border.xRight() - borderTmp.xRight(), border.yButtom() + borderTmp.yButtom()); - ewol::Padding inside(insideBorder.xLeft() + std::max(0.0f, paddingIn.xLeft()), - insideBorder.yTop() - std::max(0.0f, paddingIn.yTop()), - insideBorder.xRight() - std::max(0.0f, paddingIn.xRight()), - insideBorder.yButtom() + std::max(0.0f, paddingIn.yButtom())); + ewol::Padding inside(insideBorder.xLeft() + etk::max(0.0f, paddingIn.xLeft()), + insideBorder.yTop() - etk::max(0.0f, paddingIn.yTop()), + insideBorder.xRight() - etk::max(0.0f, paddingIn.xRight()), + insideBorder.yButtom() + etk::max(0.0f, paddingIn.yButtom())); #endif /* @@ -624,7 +624,7 @@ ewol::Padding ewol::compositing::Shaper::getBorder() { return padding; } -void ewol::compositing::Shaper::setSource(const std::string& _newFile) { +void ewol::compositing::Shaper::setSource(const etk::String& _newFile) { clear(); unLoadProgram(); m_name = _newFile; @@ -645,7 +645,7 @@ const etk::Color& ewol::compositing::Shaper::getColor(int32_t _id) { return m_colorProperty->get(_id); } -int32_t ewol::compositing::Shaper::requestColor(const std::string& _name) { +int32_t ewol::compositing::Shaper::requestColor(const etk::String& _name) { if (m_colorProperty == nullptr) { EWOL_WARNING("nullptr of m_colorProperty ==> return -1 for name " << _name); return -1; @@ -653,7 +653,7 @@ int32_t ewol::compositing::Shaper::requestColor(const std::string& _name) { return m_colorProperty->request(_name); } -int32_t ewol::compositing::Shaper::requestConfig(const std::string& _name) { +int32_t ewol::compositing::Shaper::requestConfig(const etk::String& _name) { if (m_config == nullptr) { EWOL_WARNING("nullptr of m_config ==> return -1 for name " << _name); return -1; @@ -672,17 +672,17 @@ double ewol::compositing::Shaper::getConfigNumber(int32_t _id) { namespace etk { - template<> std::string to_string(const ewol::compositing::Shaper& _obj) { + template<> etk::String toString(const ewol::compositing::Shaper& _obj) { return _obj.getSource(); } - template<> std::u32string to_u32string(const ewol::compositing::Shaper& _obj) { - return etk::to_u32string(etk::to_string(_obj)); + template<> etk::UString toUString(const ewol::compositing::Shaper& _obj) { + return etk::toUString(etk::toString(_obj)); } - template<> bool from_string(ewol::compositing::Shaper& _variableRet, const std::string& _value) { + template<> bool from_string(ewol::compositing::Shaper& _variableRet, const etk::String& _value) { _variableRet.setSource(_value); return true; } - template<> bool from_string(ewol::compositing::Shaper& _variableRet, const std::u32string& _value) { - return from_string(_variableRet, etk::to_string(_value)); + template<> bool from_string(ewol::compositing::Shaper& _variableRet, const etk::UString& _value) { + return from_string(_variableRet, etk::toString(_value)); } }; \ No newline at end of file diff --git a/ewol/compositing/Shaper.hpp b/ewol/compositing/Shaper.hpp index aaed8c6d..0910b422 100644 --- a/ewol/compositing/Shaper.hpp +++ b/ewol/compositing/Shaper.hpp @@ -38,7 +38,7 @@ namespace ewol { // TODO : Abstaraction between states (call by name and the system greate IDs class Shaper : public ewol::Compositing { private: - std::string m_name; //!< Name of the configuration of the shaper. + etk::String m_name; //!< Name of the configuration of the shaper. // External theme config: ememory::SharedPtr m_config; //!< pointer on the config file resources int32_t m_confIdPaddingOut[shaperPosCount]; //!< Padding out property : X-left X-right Y-top Y-buttom @@ -75,7 +75,7 @@ namespace ewol { int32_t m_nbVertexToDisplay; // color management theme: ememory::SharedPtr m_colorProperty; //!< input resource for color management - std::vector m_listAssiciatedId; //!< Corellation ID between ColorProperty (Y) and OpenGL Program (X) + etk::Vector m_listAssiciatedId; //!< Corellation ID between ColorProperty (Y) and OpenGL Program (X) protected: static const int32_t m_vboIdCoord; static const int32_t m_vboIdPos; @@ -94,7 +94,7 @@ namespace ewol { * @brief generic constructor * @param[in] _shaperName Name of the file that might be loaded */ - Shaper(const std::string& _shaperName=""); + Shaper(const etk::String& _shaperName=""); /** * @brief generic destructor */ @@ -166,12 +166,12 @@ namespace ewol { * @brief change the shaper Source * @param[in] _newFile New file of the shaper */ - void setSource(const std::string& _newFile); + void setSource(const etk::String& _newFile); /** * @brief get the shaper file Source * @return the shapper file name */ - const std::string& getSource() const { + const etk::String& getSource() const { return m_name; }; /** @@ -236,7 +236,7 @@ namespace ewol { * @param[in] _name Name of the element requested * @return The Id of the color */ - int32_t requestColor(const std::string& _name); + int32_t requestColor(const etk::String& _name); /** * @brief Get The color associated at an ID. * @param[in] _id Id of the color @@ -249,7 +249,7 @@ namespace ewol { * @param[in] _name Name of the element requested * @return The Id of the element */ - int32_t requestConfig(const std::string& _name); + int32_t requestConfig(const etk::String& _name); /** * @brief Get The number associated at an ID. * @param[in] _id Id of the parameter diff --git a/ewol/compositing/Sprite.cpp b/ewol/compositing/Sprite.cpp index f334de3f..5bf6fc9c 100644 --- a/ewol/compositing/Sprite.cpp +++ b/ewol/compositing/Sprite.cpp @@ -7,7 +7,7 @@ #include #include -ewol::compositing::Sprite::Sprite(const std::string& _imageName, const ivec2& _nbSprite, int32_t _size) : +ewol::compositing::Sprite::Sprite(const etk::String& _imageName, const ivec2& _nbSprite, int32_t _size) : ewol::compositing::Image(_imageName, false, _size), m_nbSprite(_nbSprite), m_unitarySpriteSize(0,0) { diff --git a/ewol/compositing/Sprite.hpp b/ewol/compositing/Sprite.hpp index 9e31af0f..d2b5231f 100644 --- a/ewol/compositing/Sprite.hpp +++ b/ewol/compositing/Sprite.hpp @@ -15,7 +15,7 @@ namespace ewol { ivec2 m_nbSprite; //!< number of sprite in vertical and horizontal vec2 m_unitarySpriteSize; //!< size of a unique sprite public: - Sprite(const std::string& _imageName, + Sprite(const etk::String& _imageName, const ivec2& _nbSprite, int32_t _size=ewol::compositing::Image::sizeAuto); virtual ~Sprite() {}; diff --git a/ewol/compositing/Text.cpp b/ewol/compositing/Text.cpp index 1595dc2a..03544769 100644 --- a/ewol/compositing/Text.cpp +++ b/ewol/compositing/Text.cpp @@ -9,7 +9,7 @@ #include #include -ewol::compositing::Text::Text(const std::string& _fontName, int32_t _fontSize) : +ewol::compositing::Text::Text(const etk::String& _fontName, int32_t _fontSize) : m_font(nullptr) { setFont(_fontName, _fontSize); } @@ -124,7 +124,7 @@ ewol::GlyphProperty * ewol::compositing::Text::getGlyphPointer(char32_t _charcod void ewol::compositing::Text::setFontSize(int32_t _fontSize) { // get old size - std::string fontName = ""; + etk::String fontName = ""; if (m_font != nullptr) { fontName = m_font->getName(); // Remove the :XX for the size ... @@ -134,7 +134,7 @@ void ewol::compositing::Text::setFontSize(int32_t _fontSize) { setFont(fontName, _fontSize); } -void ewol::compositing::Text::setFontName(const std::string& _fontName) { +void ewol::compositing::Text::setFontName(const etk::String& _fontName) { // get old size int32_t fontSize = -1; if (m_font != nullptr) { @@ -143,7 +143,7 @@ void ewol::compositing::Text::setFontName(const std::string& _fontName) { setFont(_fontName, fontSize); } -void ewol::compositing::Text::setFont(std::string _fontName, int32_t _fontSize) { +void ewol::compositing::Text::setFont(etk::String _fontName, int32_t _fontSize) { clear(); // remove old one ememory::SharedPtr previousFont = m_font; @@ -154,7 +154,7 @@ void ewol::compositing::Text::setFont(std::string _fontName, int32_t _fontSize) _fontName = ewol::getContext().getFontDefault().getName(); } _fontName += ":"; - _fontName += etk::to_string(_fontSize); + _fontName += etk::toString(_fontSize); EWOL_VERBOSE("plop : " << _fontName << " size=" << _fontSize << " result :" << _fontName); // link to new one m_font = ewol::resource::TexturedFont::create(_fontName); diff --git a/ewol/compositing/Text.hpp b/ewol/compositing/Text.hpp index 88e7cc4b..8e9d3ac7 100644 --- a/ewol/compositing/Text.hpp +++ b/ewol/compositing/Text.hpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include @@ -28,7 +28,7 @@ namespace ewol { * @param[in] _fontName Name of the font that might be loaded * @param[in] _fontSize size of the font that might be loaded */ - Text(const std::string& _fontName="", int32_t _fontSize=-1); + Text(const etk::String& _fontName="", int32_t _fontSize=-1); /** * @brief generic destructor */ @@ -45,8 +45,8 @@ namespace ewol { public: virtual void setFontSize(int32_t _fontSize); - virtual void setFontName(const std::string& _fontName); - virtual void setFont(std::string _fontName, int32_t _fontSize); + virtual void setFontName(const etk::String& _fontName); + virtual void setFont(etk::String _fontName, int32_t _fontSize); virtual void setFontMode(enum ewol::font::mode _mode); virtual void printChar(const char32_t& _charcode); virtual vec3 calculateSizeChar(const char32_t& _charcode); diff --git a/ewol/compositing/TextBase.cpp b/ewol/compositing/TextBase.cpp index 78d3e8b4..b20af85d 100644 --- a/ewol/compositing/TextBase.cpp +++ b/ewol/compositing/TextBase.cpp @@ -16,7 +16,7 @@ const int32_t ewol::compositing::TextBase::m_vboIdColor(2); const int32_t ewol::compositing::TextBase::m_vboIdGlyphLevel(3); #define NB_VBO (4) -ewol::compositing::TextBase::TextBase(const std::string& _shaderName, bool _loadProgram) : +ewol::compositing::TextBase::TextBase(const etk::String& _shaderName, bool _loadProgram) : m_position(0.0, 0.0, 0.0), m_clippingPosStart(0.0, 0.0, 0.0), m_clippingPosStop(0.0, 0.0, 0.0), @@ -59,7 +59,7 @@ ewol::compositing::TextBase::~TextBase() { } -void ewol::compositing::TextBase::loadProgram(const std::string& _shaderName) { +void ewol::compositing::TextBase::loadProgram(const etk::String& _shaderName) { // get the shader resource: m_GLPosition = 0; ememory::SharedPtr old = m_GLprogram; @@ -132,10 +132,10 @@ void ewol::compositing::TextBase::setPos(const vec3& _pos) { // check min max for display area if (m_nbCharDisplayed != 0) { EWOL_VERBOSE("update size 1 " << m_sizeDisplayStart << " " << m_sizeDisplayStop); - m_sizeDisplayStop.setX(std::max(m_position.x(), m_sizeDisplayStop.x())); - m_sizeDisplayStop.setY(std::max(m_position.y(), m_sizeDisplayStop.y())); - m_sizeDisplayStart.setX(std::min(m_position.x(), m_sizeDisplayStart.x())); - m_sizeDisplayStart.setY(std::min(m_position.y(), m_sizeDisplayStart.y())); + m_sizeDisplayStop.setX(etk::max(m_position.x(), m_sizeDisplayStop.x())); + m_sizeDisplayStop.setY(etk::max(m_position.y(), m_sizeDisplayStop.y())); + m_sizeDisplayStart.setX(etk::min(m_position.x(), m_sizeDisplayStart.x())); + m_sizeDisplayStart.setY(etk::min(m_position.y(), m_sizeDisplayStart.y())); EWOL_VERBOSE("update size 2 " << m_sizeDisplayStart << " " << m_sizeDisplayStop); } // update position @@ -150,10 +150,10 @@ void ewol::compositing::TextBase::setPos(const vec3& _pos) { EWOL_VERBOSE("update size 0 " << m_sizeDisplayStart << " " << m_sizeDisplayStop); } else { EWOL_VERBOSE("update size 3 " << m_sizeDisplayStart << " " << m_sizeDisplayStop); - m_sizeDisplayStop.setX(std::max(m_position.x(), m_sizeDisplayStop.x())); - m_sizeDisplayStop.setY(std::max(m_position.y(), m_sizeDisplayStop.y())); - m_sizeDisplayStart.setX(std::min(m_position.x(), m_sizeDisplayStart.x())); - m_sizeDisplayStart.setY(std::min(m_position.y(), m_sizeDisplayStart.y())); + m_sizeDisplayStop.setX(etk::max(m_position.x(), m_sizeDisplayStop.x())); + m_sizeDisplayStop.setY(etk::max(m_position.y(), m_sizeDisplayStop.y())); + m_sizeDisplayStart.setX(etk::min(m_position.x(), m_sizeDisplayStart.x())); + m_sizeDisplayStart.setY(etk::min(m_position.y(), m_sizeDisplayStart.y())); EWOL_VERBOSE("update size 4 " << m_sizeDisplayStart << " " << m_sizeDisplayStop); } } @@ -241,13 +241,13 @@ void ewol::compositing::TextBase::setKerningMode(bool _newMode) { m_kerning = _newMode; } -void ewol::compositing::TextBase::print(const std::u32string& _text) { - std::vector decorationEmpty; +void ewol::compositing::TextBase::print(const etk::UString& _text) { + etk::Vector decorationEmpty; print(_text, decorationEmpty); } -void ewol::compositing::TextBase::print(const std::string& _text) { - std::vector decorationEmpty; +void ewol::compositing::TextBase::print(const etk::String& _text) { + etk::Vector decorationEmpty; print(_text, decorationEmpty); } @@ -263,7 +263,7 @@ void ewol::compositing::TextBase::parseHtmlNode(const exml::Element& _element) { // nothing to do ... continue; } else if (it.isText() == true) { - htmlAddData(etk::to_u32string(it.getValue())); + htmlAddData(etk::toUString(it.getValue())); EWOL_VERBOSE("XML add : " << it.getValue()); continue; } else if (it.isElement() == false) { @@ -282,7 +282,7 @@ void ewol::compositing::TextBase::parseHtmlNode(const exml::Element& _element) { } else if (etk::compare_no_case(elem.getValue(), "font") == true) { EWOL_VERBOSE("XML Font ..."); TextDecoration tmpDeco = m_htmlDecoTmp; - std::string colorValue = elem.attributes["color"]; + etk::String colorValue = elem.attributes["color"]; if (colorValue.size() != 0) { m_htmlDecoTmp.m_colorFg = colorValue; } @@ -352,23 +352,23 @@ void ewol::compositing::TextBase::parseHtmlNode(const exml::Element& _element) { } } -void ewol::compositing::TextBase::printDecorated(const std::string& _text) { - std::string tmpData("\n\n"); +void ewol::compositing::TextBase::printDecorated(const etk::String& _text) { + etk::String tmpData("\n\n"); tmpData += _text; tmpData += "\n\n\n"; //EWOL_DEBUG("plop : " << tmpData); printHTML(tmpData); } -void ewol::compositing::TextBase::printDecorated(const std::u32string& _text) { - std::u32string tmpData(U"\n\n"); +void ewol::compositing::TextBase::printDecorated(const etk::UString& _text) { + etk::UString tmpData(U"\n\n"); tmpData += _text; tmpData += U"\n\n\n"; //EWOL_DEBUG("plop : " << tmpData); printHTML(tmpData); } -void ewol::compositing::TextBase::printHTML(const std::string& _text) { +void ewol::compositing::TextBase::printHTML(const etk::String& _text) { exml::Document doc; // reset parameter : @@ -396,15 +396,15 @@ void ewol::compositing::TextBase::printHTML(const std::string& _text) { htmlFlush(); } -void ewol::compositing::TextBase::printHTML(const std::u32string& _text) { +void ewol::compositing::TextBase::printHTML(const etk::UString& _text) { exml::Document doc; // reset parameter : m_htmlDecoTmp.m_colorBg = m_defaultColorBg; m_htmlDecoTmp.m_colorFg = m_defaultColorFg; m_htmlDecoTmp.m_mode = ewol::font::Regular; - // TODO : Create an instance of xml parser to manage std::u32string... - if (doc.parse(etk::to_string(_text)) == false) { + // TODO : Create an instance of xml parser to manage etk::UString... + if (doc.parse(etk::toString(_text)) == false) { EWOL_ERROR( "can not load XML: PARSING error: Decorated text "); return; } @@ -424,7 +424,7 @@ void ewol::compositing::TextBase::printHTML(const std::u32string& _text) { htmlFlush(); } -void ewol::compositing::TextBase::print(const std::string& _text, const std::vector& _decoration) { +void ewol::compositing::TextBase::print(const etk::String& _text, const etk::Vector& _decoration) { etk::Color<> tmpFg(m_color); etk::Color<> tmpBg(m_colorBg); if (m_alignement == alignDisable) { @@ -609,7 +609,7 @@ void ewol::compositing::TextBase::print(const std::string& _text, const std::vec } } -void ewol::compositing::TextBase::print(const std::u32string& _text, const std::vector& _decoration) { +void ewol::compositing::TextBase::print(const etk::UString& _text, const etk::Vector& _decoration) { etk::Color<> tmpFg(m_color); etk::Color<> tmpBg(m_colorBg); if (m_alignement == alignDisable) { @@ -820,7 +820,7 @@ void ewol::compositing::TextBase::disableAlignement() { m_alignement = alignDisable; } -vec3 ewol::compositing::TextBase::calculateSizeHTML(const std::string& _text) { +vec3 ewol::compositing::TextBase::calculateSizeHTML(const etk::String& _text) { // remove intermediate result reset(); //EWOL_DEBUG(" 0 size for=\n" << text); @@ -834,11 +834,11 @@ vec3 ewol::compositing::TextBase::calculateSizeHTML(const std::string& _text) { //EWOL_DEBUG(" 1 Stop pos=" << m_sizeDisplayStop); // get the last elements - m_sizeDisplayStop.setValue(std::max(m_position.x(), m_sizeDisplayStop.x()) , - std::max(m_position.y(), m_sizeDisplayStop.y()) , + m_sizeDisplayStop.setValue(etk::max(m_position.x(), m_sizeDisplayStop.x()) , + etk::max(m_position.y(), m_sizeDisplayStop.y()) , 0); - m_sizeDisplayStart.setValue(std::min(m_position.x(), m_sizeDisplayStart.x()) , - std::min(m_position.y(), m_sizeDisplayStart.y()) , + m_sizeDisplayStart.setValue(etk::min(m_position.x(), m_sizeDisplayStart.x()) , + etk::min(m_position.y(), m_sizeDisplayStart.y()) , 0); //EWOL_DEBUG(" 2 Start pos=" << m_sizeDisplayStart); @@ -851,7 +851,7 @@ vec3 ewol::compositing::TextBase::calculateSizeHTML(const std::string& _text) { m_sizeDisplayStop.z()-m_sizeDisplayStart.z()); } -vec3 ewol::compositing::TextBase::calculateSizeHTML(const std::u32string& _text) { +vec3 ewol::compositing::TextBase::calculateSizeHTML(const etk::UString& _text) { // remove intermediate result reset(); //EWOL_DEBUG(" 0 size for=\n" << text); @@ -865,11 +865,11 @@ vec3 ewol::compositing::TextBase::calculateSizeHTML(const std::u32string& _text) //EWOL_DEBUG(" 1 Stop pos=" << m_sizeDisplayStop); // get the last elements - m_sizeDisplayStop.setValue(std::max(m_position.x(), m_sizeDisplayStop.x()) , - std::max(m_position.y(), m_sizeDisplayStop.y()) , + m_sizeDisplayStop.setValue(etk::max(m_position.x(), m_sizeDisplayStop.x()) , + etk::max(m_position.y(), m_sizeDisplayStop.y()) , 0); - m_sizeDisplayStart.setValue(std::min(m_position.x(), m_sizeDisplayStart.x()) , - std::min(m_position.y(), m_sizeDisplayStart.y()) , + m_sizeDisplayStart.setValue(etk::min(m_position.x(), m_sizeDisplayStart.x()) , + etk::min(m_position.y(), m_sizeDisplayStart.y()) , 0); //EWOL_DEBUG(" 2 Start pos=" << m_sizeDisplayStart); @@ -882,29 +882,29 @@ vec3 ewol::compositing::TextBase::calculateSizeHTML(const std::u32string& _text) m_sizeDisplayStop.z()-m_sizeDisplayStart.z()); } -vec3 ewol::compositing::TextBase::calculateSizeDecorated(const std::string& _text) { +vec3 ewol::compositing::TextBase::calculateSizeDecorated(const etk::String& _text) { if (_text.size() == 0) { return vec3(0,0,0); } - std::string tmpData("\n"); + etk::String tmpData("\n"); tmpData+=_text; tmpData+="\n\n"; vec3 tmpVal = calculateSizeHTML(tmpData); return tmpVal; } -vec3 ewol::compositing::TextBase::calculateSizeDecorated(const std::u32string& _text) { +vec3 ewol::compositing::TextBase::calculateSizeDecorated(const etk::UString& _text) { if (_text.size() == 0) { return vec3(0,0,0); } - std::u32string tmpData(U"\n"); + etk::UString tmpData(U"\n"); tmpData += _text; tmpData += U"\n\n"; vec3 tmpVal = calculateSizeHTML(tmpData); return tmpVal; } -vec3 ewol::compositing::TextBase::calculateSize(const std::string& _text) { +vec3 ewol::compositing::TextBase::calculateSize(const etk::String& _text) { vec3 outputSize(0, 0, 0); for(auto element : _text) { vec3 tmpp = calculateSize(element); @@ -916,7 +916,7 @@ vec3 ewol::compositing::TextBase::calculateSize(const std::string& _text) { return outputSize; } -vec3 ewol::compositing::TextBase::calculateSize(const std::u32string& _text) { +vec3 ewol::compositing::TextBase::calculateSize(const etk::UString& _text) { vec3 outputSize(0, 0, 0); for(auto element : _text) { vec3 tmpp = calculateSize(element); @@ -939,7 +939,7 @@ void ewol::compositing::TextBase::printCursor(bool _isInsertMode, float _cursorS } } -bool ewol::compositing::TextBase::extrapolateLastId(const std::string& _text, +bool ewol::compositing::TextBase::extrapolateLastId(const etk::String& _text, const int32_t _start, int32_t& _stop, int32_t& _space, @@ -1002,7 +1002,7 @@ bool ewol::compositing::TextBase::extrapolateLastId(const std::string& _text, } } -bool ewol::compositing::TextBase::extrapolateLastId(const std::u32string& _text, +bool ewol::compositing::TextBase::extrapolateLastId(const etk::UString& _text, const int32_t _start, int32_t& _stop, int32_t& _space, @@ -1065,20 +1065,20 @@ bool ewol::compositing::TextBase::extrapolateLastId(const std::u32string& _text, } } -void ewol::compositing::TextBase::htmlAddData(const std::u32string& _data) { +void ewol::compositing::TextBase::htmlAddData(const etk::UString& _data) { if( m_htmlCurrrentLine.size()>0 && m_htmlCurrrentLine[m_htmlCurrrentLine.size()-1] != ' ') { m_htmlCurrrentLine += U" "; if(m_htmlDecoration.size()>0) { TextDecoration tmp = m_htmlDecoration[m_htmlDecoration.size()-1]; - m_htmlDecoration.push_back(tmp); + m_htmlDecoration.pushBack(tmp); } else { - m_htmlDecoration.push_back(m_htmlDecoTmp); + m_htmlDecoration.pushBack(m_htmlDecoTmp); } } m_htmlCurrrentLine += _data; for(size_t iii=0; iii<_data.size() ; iii++) { - m_htmlDecoration.push_back(m_htmlDecoTmp); + m_htmlDecoration.pushBack(m_htmlDecoTmp); } } diff --git a/ewol/compositing/TextBase.hpp b/ewol/compositing/TextBase.hpp index ae464d47..0e0d393f 100644 --- a/ewol/compositing/TextBase.hpp +++ b/ewol/compositing/TextBase.hpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include namespace ewol { namespace compositing { @@ -94,12 +94,12 @@ namespace ewol { /** * @brief load the openGL program and get all the ID needed */ - virtual void loadProgram(const std::string& _shaderName); + virtual void loadProgram(const etk::String& _shaderName); public: /** * @brief generic constructor */ - TextBase(const std::string& _shaderName = "{ewol}DATA:text.prog", bool _loadProgram = true); + TextBase(const etk::String& _shaderName = "{ewol}DATA:text.prog", bool _loadProgram = true); /** * @brief generic destructor */ @@ -221,13 +221,13 @@ namespace ewol { * @brief Specify the font name (this reset the internal element of the current text (system requirement) * @param[in] _fontName Current name of the selected font */ - virtual void setFontName(const std::string& _fontName) = 0; + virtual void setFontName(const etk::String& _fontName) = 0; /** * @brief Specify the font property (this reset the internal element of the current text (system requirement) * @param[in] fontName Current name of the selected font * @param[in] fontSize New font size */ - virtual void setFont(std::string _fontName, int32_t _fontSize) = 0; + virtual void setFont(etk::String _fontName, int32_t _fontSize) = 0; /** * @brief Specify the font mode for the next @ref print * @param[in] mode The font mode requested @@ -262,9 +262,9 @@ namespace ewol { * @brief display a compleat string in the current element. * @param[in] _text The string to display. */ - void print(const std::string& _text); + void print(const etk::String& _text); //! @previous - void print(const std::u32string& _text); + void print(const etk::UString& _text); /** * @brief display a compleat string in the current element with the generic decoration specification. (basic html data) * @@ -294,9 +294,9 @@ namespace ewol { * @param[in] _text The string to display. * @TODO : implementation not done .... */ - void printDecorated(const std::string& _text); + void printDecorated(const etk::String& _text); //! @previous - void printDecorated(const std::u32string& _text); + void printDecorated(const etk::UString& _text); /** * @brief display a compleat string in the current element with the generic decoration specification. (basic html data) * @@ -330,17 +330,17 @@ namespace ewol { * @param[in] _text The string to display. * @TODO : implementation not done .... */ - void printHTML(const std::string& _text); + void printHTML(const etk::String& _text); //! @previous - void printHTML(const std::u32string& _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. * @param[in] _decoration The text decoration for the text that might be display (if the vector is smaller, the last parameter is get) */ - void print(const std::string& _text, const std::vector& _decoration); + void print(const etk::String& _text, const etk::Vector& _decoration); //! @previous - void print(const std::u32string& _text, const std::vector& _decoration); + void print(const etk::UString& _text, const etk::Vector& _decoration); /** * @brief display the current char in the current element (note that the kerning is availlable if the position is not changed) * @param[in] _charcode Char that might be dispalyed @@ -379,25 +379,25 @@ namespace ewol { * @param[in] _text The string to calculate dimention. * @return The theoric size used. */ - vec3 calculateSizeHTML(const std::string& _text); + vec3 calculateSizeHTML(const etk::String& _text); //! @previous - vec3 calculateSizeHTML(const std::u32string& _text); + vec3 calculateSizeHTML(const etk::UString& _text); /** * @brief calculate a theoric text size * @param[in] _text The string to calculate dimention. * @return The theoric size used. */ - vec3 calculateSizeDecorated(const std::string& _text); + vec3 calculateSizeDecorated(const etk::String& _text); //! @previous - vec3 calculateSizeDecorated(const std::u32string& _text); + vec3 calculateSizeDecorated(const etk::UString& _text); /** * @brief calculate a theoric text size * @param[in] _text The string to calculate dimention. * @return The theoric size used. */ - vec3 calculateSize(const std::string& _text); + vec3 calculateSize(const etk::String& _text); //! @previous - vec3 calculateSize(const std::u32string& _text); + vec3 calculateSize(const etk::UString& _text); /** * @brief calculate a theoric charcode size * @param[in] _charcode The ľUnicode value to calculate dimention. @@ -428,19 +428,19 @@ namespace ewol { * @return true if the rifht has free space that can be use for jystify. * @return false if we find '\n' */ - bool extrapolateLastId(const std::string& _text, const int32_t _start, int32_t& _stop, int32_t& _space, int32_t& _freeSpace); + bool extrapolateLastId(const etk::String& _text, const int32_t _start, int32_t& _stop, int32_t& _space, int32_t& _freeSpace); //! @previous - bool extrapolateLastId(const std::u32string& _text, const int32_t _start, int32_t& _stop, int32_t& _space, int32_t& _freeSpace); + bool extrapolateLastId(const etk::UString& _text, const int32_t _start, int32_t& _stop, int32_t& _space, int32_t& _freeSpace); protected: // this section is reserved for HTML parsing and display: - std::u32string m_htmlCurrrentLine; //!< current line for HTML display - std::vector m_htmlDecoration; //!< current decoration for the HTML display + etk::UString m_htmlCurrrentLine; //!< current line for HTML display + etk::Vector m_htmlDecoration; //!< current decoration for the HTML display TextDecoration m_htmlDecoTmp; //!< current decoration /** * @brief add a line with the current m_htmlDecoTmp decoration * @param[in] _data The cuurent data to add. */ - void htmlAddData(const std::u32string& _data); + void htmlAddData(const etk::UString& _data); /** * @brief draw the current line */ diff --git a/ewol/compositing/TextDF.cpp b/ewol/compositing/TextDF.cpp index 03a6ad72..c0088d35 100644 --- a/ewol/compositing/TextDF.cpp +++ b/ewol/compositing/TextDF.cpp @@ -9,7 +9,7 @@ #include #include -ewol::compositing::TextDF::TextDF(const std::string& _fontName, int32_t _fontSize) : +ewol::compositing::TextDF::TextDF(const etk::String& _fontName, int32_t _fontSize) : ewol::compositing::TextBase("", false), m_fontDF(nullptr), m_GLglyphLevel(-1), @@ -23,7 +23,7 @@ ewol::compositing::TextDF::~TextDF() { } void ewol::compositing::TextDF::updateSizeToRender(const vec2& _size) { - float minSize = std::min(_size.x(), _size.y()); + float minSize = etk::min(_size.x(), _size.y()); if (m_fontDF != nullptr) { setFontSize(m_fontDF->getSize(minSize)); } @@ -106,7 +106,7 @@ void ewol::compositing::TextDF::drawD(bool _disableDepthTest) { m_GLprogram->unUse(); } -void ewol::compositing::TextDF::loadProgram(const std::string& _shaderName) { +void ewol::compositing::TextDF::loadProgram(const etk::String& _shaderName) { ewol::compositing::TextBase::loadProgram(_shaderName); if (m_GLprogram != nullptr) { m_GLglyphLevel = m_GLprogram->getAttribute("EW_glyphLevel"); @@ -140,11 +140,11 @@ void ewol::compositing::TextDF::setFontSize(int32_t _fontSize) { } } -void ewol::compositing::TextDF::setFontName(const std::string& _fontName) { +void ewol::compositing::TextDF::setFontName(const etk::String& _fontName) { clear(); // remove old one ememory::SharedPtr previousFont = m_fontDF; - std::string fontName; + etk::String fontName; if (_fontName == "") { fontName = ewol::getContext().getFontDefault().getName(); } else { @@ -159,7 +159,7 @@ void ewol::compositing::TextDF::setFontName(const std::string& _fontName) { } } -void ewol::compositing::TextDF::setFont(std::string _fontName, int32_t _fontSize) { +void ewol::compositing::TextDF::setFont(etk::String _fontName, int32_t _fontSize) { setFontSize(_fontSize); setFontName(_fontName); } diff --git a/ewol/compositing/TextDF.hpp b/ewol/compositing/TextDF.hpp index b5bb1ccc..6bc6ba79 100644 --- a/ewol/compositing/TextDF.hpp +++ b/ewol/compositing/TextDF.hpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include namespace ewol { namespace compositing { @@ -28,7 +28,7 @@ namespace ewol { * @param[in] _fontName Name of the font that might be loaded * @param[in] _fontSize size of the font that might be loaded */ - TextDF(const std::string& _fontName="", int32_t _fontSize=-1); + TextDF(const etk::String& _fontName="", int32_t _fontSize=-1); /** * @brief generic destructor */ @@ -56,10 +56,10 @@ namespace ewol { virtual ewol::GlyphProperty * getGlyphPointer(char32_t _charcode); public: - virtual void loadProgram(const std::string& _shaderName); + virtual void loadProgram(const etk::String& _shaderName); virtual void setFontSize(int32_t _fontSize); - virtual void setFontName(const std::string& _fontName); - virtual void setFont(std::string _fontName, int32_t _fontSize); + virtual void setFontName(const etk::String& _fontName); + virtual void setFont(etk::String _fontName, int32_t _fontSize); virtual void setFontMode(enum ewol::font::mode _mode); virtual void printChar(const char32_t& _charcode); virtual vec3 calculateSizeChar(const char32_t& _charcode); diff --git a/ewol/context/ConfigFont.cpp b/ewol/context/ConfigFont.cpp index 8372735a..08f771c4 100644 --- a/ewol/context/ConfigFont.cpp +++ b/ewol/context/ConfigFont.cpp @@ -23,7 +23,7 @@ ewol::context::ConfigFont::~ConfigFont() { ewol::resource::freeTypeUnInit(); } -void ewol::context::ConfigFont::set(const std::string& _fontName, int32_t _size) { +void ewol::context::ConfigFont::set(const etk::String& _fontName, int32_t _size) { m_name = _fontName; m_size = _size; EWOL_INFO("Set default Font : '" << m_name << "' size=" << m_size); @@ -34,7 +34,7 @@ void ewol::context::ConfigFont::setSize(int32_t _size) { EWOL_INFO("Set default Font : '" << m_name << "' size=" << m_size << " (change size only)"); } -void ewol::context::ConfigFont::setName(const std::string& _fontName) { +void ewol::context::ConfigFont::setName(const etk::String& _fontName) { m_name = _fontName; EWOL_INFO("Set default Font : '" << m_name << "' size=" << m_size << " (change name only)"); } diff --git a/ewol/context/ConfigFont.hpp b/ewol/context/ConfigFont.hpp index eba49cf5..4132c434 100644 --- a/ewol/context/ConfigFont.hpp +++ b/ewol/context/ConfigFont.hpp @@ -17,24 +17,24 @@ namespace ewol { ConfigFont(); virtual ~ConfigFont(); private: - std::string m_folder; + etk::String m_folder; public: /** * @brief Specify the default font folder for the Ewol search system (only needed when embended font) * @param[in] _folder basic folder of the font (ex: DATA:fonts) */ - void setFolder(const std::string& _folder) { + void setFolder(const etk::String& _folder) { m_folder = _folder; }; /** * @brief get the default font folder. * @return The default font folder. */ - const std::string& getFolder() { + const etk::String& getFolder() { return m_folder; }; private: - std::string m_name; + etk::String m_name; int32_t m_size; public: /** @@ -42,19 +42,19 @@ namespace ewol { * @param[in] _fontName The font name requested (not case sensitive) ex "Arial" or multiple separate by ';' ex : "Arial;Helvetica". * @param[in] _size The default size of the font default=10. */ - void set(const std::string& _fontName, int32_t _size); + void set(const etk::String& _fontName, int32_t _size); /** * @brief get the current default font name * @raturn a reference on the font name string */ - const std::string& getName() { + const etk::String& getName() { return m_name; }; /** * @brief Set the current default font name * @param[in] _fontName The font name requested (not case sensitive) ex "Arial" or multiple separate by ';' ex : "Arial;Helvetica". */ - void setName(const std::string& _fontName); + void setName(const etk::String& _fontName); /** * @brief get the default font size. * @return the font size. diff --git a/ewol/context/Context.cpp b/ewol/context/Context.cpp index 89fa155f..b9c62de8 100644 --- a/ewol/context/Context.cpp +++ b/ewol/context/Context.cpp @@ -41,7 +41,7 @@ ewol::Context& ewol::getContext() { } -void ewol::Context::setInitImage(const std::string& _fileName) { +void ewol::Context::setInitImage(const etk::String& _fileName) { //m_initDisplayImageName = _fileName; } diff --git a/ewol/context/Context.hpp b/ewol/context/Context.hpp index 415a8865..70e96875 100644 --- a/ewol/context/Context.hpp +++ b/ewol/context/Context.hpp @@ -142,7 +142,7 @@ namespace ewol { * @brief Special for init (main) set the start image when loading data * @param[in] _fileName Name of the image to load */ - void setInitImage(const std::string& _fileName); + void setInitImage(const etk::String& _fileName); public: /** * @brief Request a display after call a resize diff --git a/ewol/context/InputManager.cpp b/ewol/context/InputManager.cpp index 914c2996..f895a60a 100644 --- a/ewol/context/InputManager.cpp +++ b/ewol/context/InputManager.cpp @@ -174,7 +174,7 @@ int32_t ewol::context::InputManager::localGetDestinationId(enum gale::key::type ewol::WidgetShared tmpWidget = m_eventInputSaved[iii].curentWidgetEvent.lock(); if (tmpWidget == _destWidget) { if (iii != _realInputId) { - lastMinimum = std::max(lastMinimum, m_eventInputSaved[iii].destinationInputId); + lastMinimum = etk::max(lastMinimum, m_eventInputSaved[iii].destinationInputId); } } } diff --git a/ewol/event/Entry.cpp b/ewol/event/Entry.cpp index e7bd309e..10eb5727 100644 --- a/ewol/event/Entry.cpp +++ b/ewol/event/Entry.cpp @@ -6,7 +6,7 @@ #include -std::ostream& ewol::event::operator <<(std::ostream& _os, const ewol::event::Entry& _obj) { +etk::Stream& ewol::event::operator <<(etk::Stream& _os, const ewol::event::Entry& _obj) { _os << "{type=" << _obj.getType(); _os << " status=" << _obj.getStatus(); if (_obj.getType() == gale::key::keyboard::character) { @@ -16,7 +16,7 @@ std::ostream& ewol::event::operator <<(std::ostream& _os, const ewol::event::Ent return _os; } -std::ostream& ewol::event::operator <<(std::ostream& _os, const ewol::event::EntrySystem& _obj) { +etk::Stream& ewol::event::operator <<(etk::Stream& _os, const ewol::event::EntrySystem& _obj) { _os << _obj.m_event; return _os; } diff --git a/ewol/event/Entry.hpp b/ewol/event/Entry.hpp index 5c185104..427e060b 100644 --- a/ewol/event/Entry.hpp +++ b/ewol/event/Entry.hpp @@ -52,7 +52,7 @@ namespace ewol { return m_unicodeData; }; }; - std::ostream& operator <<(std::ostream& _os, const ewol::event::Entry& _obj); + etk::Stream& operator <<(etk::Stream& _os, const ewol::event::Entry& _obj); class EntrySystem { public: @@ -65,6 +65,6 @@ namespace ewol { }; ewol::event::Entry m_event; }; - std::ostream& operator <<(std::ostream& _os, const ewol::event::EntrySystem& _obj); + etk::Stream& operator <<(etk::Stream& _os, const ewol::event::EntrySystem& _obj); }; }; diff --git a/ewol/event/Input.cpp b/ewol/event/Input.cpp index 79a0a872..12259485 100644 --- a/ewol/event/Input.cpp +++ b/ewol/event/Input.cpp @@ -6,16 +6,16 @@ #include -std::ostream& ewol::event::operator <<(std::ostream& _os, const ewol::event::Input& _obj) { +etk::Stream& ewol::event::operator <<(etk::Stream& _os, const ewol::event::Input& _obj) { _os << "{type=" << _obj.getType(); _os << " status=" << _obj.getStatus(); - _os << " id=" << etk::to_string(_obj.getId()); + _os << " id=" << etk::toString(_obj.getId()); _os << " pos=" << _obj.getPos(); _os << "}"; return _os; } -std::ostream& ewol::event::operator <<(std::ostream& _os, const ewol::event::InputSystem& _obj) { +etk::Stream& ewol::event::operator <<(etk::Stream& _os, const ewol::event::InputSystem& _obj) { _os << _obj.m_event; return _os; } diff --git a/ewol/event/Input.hpp b/ewol/event/Input.hpp index d2034f50..05e6557e 100644 --- a/ewol/event/Input.hpp +++ b/ewol/event/Input.hpp @@ -66,7 +66,7 @@ namespace ewol { // TODO : Call the entry element ant rest it ... } }; - std::ostream& operator <<(std::ostream& _os, const ewol::event::Input& _obj); + etk::Stream& operator <<(etk::Stream& _os, const ewol::event::Input& _obj); class InputSystem { public: @@ -98,7 +98,7 @@ namespace ewol { return m_realIdEvent; }; }; - std::ostream& operator <<(std::ostream& _os, const ewol::event::InputSystem& _obj); + etk::Stream& operator <<(etk::Stream& _os, const ewol::event::InputSystem& _obj); }; }; diff --git a/ewol/event/Time.cpp b/ewol/event/Time.cpp index 25ae1c46..4c7c6701 100644 --- a/ewol/event/Time.cpp +++ b/ewol/event/Time.cpp @@ -6,7 +6,7 @@ #include -std::ostream& ewol::event::operator <<(std::ostream& _os, const ewol::event::Time& _obj) { +etk::Stream& ewol::event::operator <<(etk::Stream& _os, const ewol::event::Time& _obj) { _os << "{time=" << _obj.getTime(); _os << " uptime=" << _obj.getApplUpTime(); _os << " delta=" << _obj.getDelta(); @@ -16,12 +16,12 @@ std::ostream& ewol::event::operator <<(std::ostream& _os, const ewol::event::Tim } namespace etk { - template<> std::string to_string(ewol::event::Time const& _obj) { - std::string out; - out = "{[ewol::event::Time]time=" + etk::to_string(_obj.getTime()); - out += ";uptime=" + etk::to_string(_obj.getApplUpTime()); - out += ";delta=" + etk::to_string(_obj.getDelta()); - out += ";deltaCall=" + etk::to_string(_obj.getDeltaCall()); + template<> etk::String toString(ewol::event::Time const& _obj) { + etk::String out; + out = "{[ewol::event::Time]time=" + etk::toString(_obj.getTime()); + out += ";uptime=" + etk::toString(_obj.getApplUpTime()); + out += ";delta=" + etk::toString(_obj.getDelta()); + out += ";deltaCall=" + etk::toString(_obj.getDeltaCall()); out += "}"; return out; } diff --git a/ewol/event/Time.hpp b/ewol/event/Time.hpp index aa8c6a35..de66d183 100644 --- a/ewol/event/Time.hpp +++ b/ewol/event/Time.hpp @@ -63,7 +63,7 @@ namespace ewol { return m_timeDeltaCall.toSeconds(); }; }; - std::ostream& operator <<(std::ostream& _os, const ewol::event::Time& _obj); + etk::Stream& operator <<(etk::Stream& _os, const ewol::event::Time& _obj); } } diff --git a/ewol/ewol.cpp b/ewol/ewol.cpp index f7fca9e9..f8def8f8 100644 --- a/ewol/ewol.cpp +++ b/ewol/ewol.cpp @@ -18,7 +18,7 @@ #define EWOL_VERSION "0.0.0" #endif -std::string ewol::getVersion() { +etk::String ewol::getVersion() { return EWOL_VERSION; } diff --git a/ewol/ewol.hpp b/ewol/ewol.hpp index ac6ff5d7..1524ec02 100644 --- a/ewol/ewol.hpp +++ b/ewol/ewol.hpp @@ -26,5 +26,5 @@ namespace ewol { * @brief get EWOL version * @return The string that describe ewol version */ - std::string getVersion(); + etk::String getVersion(); }; diff --git a/ewol/gravity.cpp b/ewol/gravity.cpp index 163c22f4..2531852f 100644 --- a/ewol/gravity.cpp +++ b/ewol/gravity.cpp @@ -7,7 +7,7 @@ #include #include -std::string ewol::gravityToString(const enum ewol::gravity _obj) { +etk::String ewol::gravityToString(const enum ewol::gravity _obj) { switch(_obj) { case ewol::gravity_center: return "center"; @@ -31,7 +31,7 @@ std::string ewol::gravityToString(const enum ewol::gravity _obj) { return "unknow"; } -enum ewol::gravity ewol::stringToGravity(const std::string& _obj) { +enum ewol::gravity ewol::stringToGravity(const etk::String& _obj) { if (_obj == "center") { return ewol::gravity_center; } else if (_obj == "top-left") { @@ -76,7 +76,7 @@ vec2 ewol::gravityGenerateDelta(const enum ewol::gravity _gravity, const vec2& _ return out; } -std::ostream& ewol::operator <<(std::ostream& _os, const enum ewol::gravity _obj) { +etk::Stream& ewol::operator <<(etk::Stream& _os, const enum ewol::gravity _obj) { _os << ewol::gravityToString(_obj); return _os; } diff --git a/ewol/gravity.hpp b/ewol/gravity.hpp index f4ad4625..e1cec791 100644 --- a/ewol/gravity.hpp +++ b/ewol/gravity.hpp @@ -24,8 +24,8 @@ namespace ewol { gravity_buttomRight = gravity_buttom|gravity_right, //!< gravity is in buttom-right gravity_buttomLeft = gravity_buttom|gravity_left, //!< gravity is in buttom-left }; - std::ostream& operator <<(std::ostream& _os, const enum ewol::gravity _obj); - std::string gravityToString(const enum ewol::gravity _obj); - enum ewol::gravity stringToGravity(const std::string& _obj); + etk::Stream& operator <<(etk::Stream& _os, const enum ewol::gravity _obj); + etk::String gravityToString(const enum ewol::gravity _obj); + enum ewol::gravity stringToGravity(const etk::String& _obj); vec2 gravityGenerateDelta(const enum ewol::gravity _gravity, const vec2& _deltas); } diff --git a/ewol/object/Manager.cpp b/ewol/object/Manager.cpp index 307d080f..d946b998 100644 --- a/ewol/object/Manager.cpp +++ b/ewol/object/Manager.cpp @@ -71,7 +71,7 @@ void ewol::object::Manager::add(const ewol::ObjectShared& _object) { if (_object == nullptr) { EWOL_ERROR("try to add an inexistant Object in manager"); } - m_eObjectList.push_back(_object); + m_eObjectList.pushBack(_object); } int32_t ewol::object::Manager::getNumberObject() { @@ -97,7 +97,7 @@ void ewol::object::Manager::cleanInternalRemoved() { } } -ewol::ObjectShared ewol::object::Manager::get(const std::string& _name) { +ewol::ObjectShared ewol::object::Manager::get(const etk::String& _name) { std::unique_lock lock(m_mutex); if (_name == "") { return nullptr; @@ -113,7 +113,7 @@ ewol::ObjectShared ewol::object::Manager::get(const std::string& _name) { } -ewol::ObjectShared ewol::object::Manager::getObjectNamed(const std::string& _name) { +ewol::ObjectShared ewol::object::Manager::getObjectNamed(const etk::String& _name) { std::unique_lock lock(m_mutex); return ewol::object::Manager::get(_name); } @@ -121,7 +121,7 @@ ewol::ObjectShared ewol::object::Manager::getObjectNamed(const std::string& _nam void ewol::object::Manager::workerAdd(const ewol::ObjectShared& _worker) { std::unique_lock lock(m_mutex); - m_workerList.push_back(_worker); + m_workerList.pushBack(_worker); } void ewol::object::Manager::workerRemove(const ewol::ObjectShared& _worker) { diff --git a/ewol/object/Manager.hpp b/ewol/object/Manager.hpp index 1904c211..47314de4 100644 --- a/ewol/object/Manager.hpp +++ b/ewol/object/Manager.hpp @@ -19,7 +19,7 @@ namespace ewol { protected: std::recursive_mutex m_mutex; private: - std::vector m_eObjectList; // all widget allocated == > all time increment ... never removed ... + etk::Vector m_eObjectList; // all widget allocated == > all time increment ... never removed ... Context& m_context; public: Manager(Context& _context); @@ -56,16 +56,16 @@ namespace ewol { * @param[in] _name Name of the Object * @return Pointer on the finded Object. */ - ewol::ObjectShared get(const std::string& _name); + ewol::ObjectShared get(const etk::String& _name); public: /** * @brief retrive an object with his name * @param[in] _name Name of the object * @return the requested object or nullptr */ - ewol::ObjectShared getObjectNamed(const std::string& _name); + ewol::ObjectShared getObjectNamed(const etk::String& _name); private: - std::vector m_workerList; + etk::Vector m_workerList; public: /** * @brief Add a worker on the system list. diff --git a/ewol/object/Object.cpp b/ewol/object/Object.cpp index 4aa4ce46..76f17dd8 100644 --- a/ewol/object/Object.cpp +++ b/ewol/object/Object.cpp @@ -88,10 +88,10 @@ void ewol::Object::addObjectType(const char* _type) { EWOL_ERROR(" try to add a type with no value..."); return; } - m_listType.push_back(_type); + m_listType.pushBack(_type); } -std::string ewol::Object::getTypeDescription() const { - std::string ret("ewol::Object"); +etk::String ewol::Object::getTypeDescription() const { + etk::String ret("ewol::Object"); for(auto element : m_listType) { ret += "|"; ret += element; @@ -99,7 +99,7 @@ std::string ewol::Object::getTypeDescription() const { return ret; } -bool ewol::Object::isTypeCompatible(const std::string& _type) const { +bool ewol::Object::isTypeCompatible(const etk::String& _type) const { if (_type == "ewol::Object") { return true; } @@ -144,7 +144,7 @@ bool ewol::Object::storeXML(exml::Element& _node) const { return errorOccured; } -bool ewol::Object::propertySetOnWidgetNamed(const std::string& _objectName, const std::string& _config, const std::string& _value) { +bool ewol::Object::propertySetOnWidgetNamed(const etk::String& _objectName, const etk::String& _config, const etk::String& _value) { ewol::ObjectShared object = getObjectManager().get(_objectName); if (object == nullptr) { return false; @@ -161,11 +161,11 @@ ewol::Context& ewol::Object::getContext() { return ewol::getContext(); } -ewol::ObjectShared ewol::Object::getObjectNamed(const std::string& _objectName) { +ewol::ObjectShared ewol::Object::getObjectNamed(const etk::String& _objectName) { return getObjectManager().getObjectNamed(_objectName); } -ewol::ObjectShared ewol::Object::getSubObjectNamed(const std::string& _objectName) { +ewol::ObjectShared ewol::Object::getSubObjectNamed(const etk::String& _objectName) { EWOL_VERBOSE("check if name : " << _objectName << " ?= " << propertyName.get()); if (_objectName == propertyName.get()) { return sharedFromThis(); @@ -174,7 +174,7 @@ ewol::ObjectShared ewol::Object::getSubObjectNamed(const std::string& _objectNam } -bool ewol::propertySetOnObjectNamed(const std::string& _objectName, const std::string& _config, const std::string& _value) { +bool ewol::propertySetOnObjectNamed(const etk::String& _objectName, const etk::String& _config, const etk::String& _value) { ewol::ObjectShared object = ewol::getContext().getEObjectManager().get(_objectName); if (object == nullptr) { return false; diff --git a/ewol/object/Object.hpp b/ewol/object/Object.hpp index 8edc6efb..68bf8bb2 100644 --- a/ewol/object/Object.hpp +++ b/ewol/object/Object.hpp @@ -6,7 +6,7 @@ #pragma once #include -#include +#include #include #include #include @@ -35,7 +35,7 @@ template static void baseInit(const ememory::SharedPtr static void baseInit(const ememory::SharedPtr& _object, const std::string& _name, const TYPE_VAL& _val, TYPE&& ... _all ) { +template static void baseInit(const ememory::SharedPtr& _object, const etk::String& _name, const TYPE_VAL& _val, TYPE&& ... _all ) { eproperty::Property* prop(nullptr); eproperty::PropertyType* propType(nullptr); if (_object == nullptr) { @@ -108,7 +108,7 @@ exit_on_error: EWOL_ERROR("Factory error"); \ return nullptr; \ } \ - baseInit(object, "name", std::string(uniqueName), _all... ); \ + baseInit(object, "name", etk::String(uniqueName), _all... ); \ object->init(); \ if (object->objectHasBeenCorectlyInit() == false) { \ EWOL_CRITICAL("Object Is not correctly init : " << #className ); \ @@ -129,7 +129,7 @@ namespace ewol { public: // Event list public: // propertie list - eproperty::Value propertyName; //!< name of the element ... + eproperty::Value propertyName; //!< name of the element ... private: static size_t m_valUID; //!< Static used for the unique ID definition private: @@ -187,7 +187,7 @@ namespace ewol { */ virtual void removeParent(); private: - std::vector m_listType; + etk::Vector m_listType; public: /** * @brief get the current Object type of the Object @@ -198,13 +198,13 @@ namespace ewol { * @brief Get the herarchie of the Object type. * @return descriptive string. */ - std::string getTypeDescription() const; + etk::String getTypeDescription() const; /** * @brief check if the element herited from a specific type * @param[in] _type Type to check. * @return true if the element is compatible. */ - bool isTypeCompatible(const std::string& _type) const; + bool isTypeCompatible(const etk::String& _type) const; protected: /** * @brief Add a type of the list of Object. @@ -233,7 +233,7 @@ namespace ewol { }; public: // TODO : Rework the position on this function ... This is a convignent function ... - bool propertySetOnWidgetNamed(const std::string& _objectName, const std::string& _config, const std::string& _value); + bool propertySetOnWidgetNamed(const etk::String& _objectName, const etk::String& _config, const etk::String& _value); public: /** * @brief load attribute properties with an XML node. @@ -290,13 +290,13 @@ namespace ewol { * @param[in] _name Name of the object * @return the requested object or nullptr */ - static ewol::ObjectShared getObjectNamed(const std::string& _objectName); + static ewol::ObjectShared getObjectNamed(const etk::String& _objectName); /** * @brief Retrive an object with his name (in the global list) * @param[in] _name Name of the object * @return the requested object or nullptr */ - virtual ewol::ObjectShared getSubObjectNamed(const std::string& _objectName); + virtual ewol::ObjectShared getSubObjectNamed(const etk::String& _objectName); protected: // TODO : Create a template ... /** @@ -317,11 +317,11 @@ namespace ewol { EWOL_ERROR("Can not connect signal ..."); return; } - m_callerList.push_back(std::make_pair(ewol::ObjectWeak(_obj), std::connect(_func, obj2.get()))); + m_callerList.pushBack(etk::makePair(ewol::ObjectWeak(_obj), std::connect(_func, obj2.get()))); } */ }; - bool propertySetOnObjectNamed(const std::string& _objectName, const std::string& _config, const std::string& _value); + bool propertySetOnObjectNamed(const etk::String& _objectName, const etk::String& _config, const etk::String& _value); }; /** diff --git a/ewol/resource/ColorFile.cpp b/ewol/resource/ColorFile.cpp index 15129006..bcf0a35d 100644 --- a/ewol/resource/ColorFile.cpp +++ b/ewol/resource/ColorFile.cpp @@ -16,7 +16,7 @@ ewol::resource::ColorFile::ColorFile() : addResourceType("ewol::ColorFile"); } -void ewol::resource::ColorFile::init(const std::string& _filename) { +void ewol::resource::ColorFile::init(const etk::String& _filename) { std::unique_lock lock(m_mutex); gale::Resource::init(_filename); EWOL_DEBUG("CF : load \"" << _filename << "\""); @@ -56,8 +56,8 @@ void ewol::resource::ColorFile::reload() { findError = true; continue; } - std::string name = tmpObj["name"].toString().get(); - std::string color = tmpObj["color"].toString().get(m_errorColor.getHexString()); + etk::String name = tmpObj["name"].toString().get(); + etk::String color = tmpObj["color"].toString().get(m_errorColor.getHexString()); EWOL_DEBUG("find new color : '" << name << "' color='" << color << "'"); if (name.size() == 0) { EWOL_ERROR("Drop an empty name"); @@ -73,7 +73,7 @@ void ewol::resource::ColorFile::reload() { } -int32_t ewol::resource::ColorFile::request(const std::string& _paramName) { +int32_t ewol::resource::ColorFile::request(const etk::String& _paramName) { std::unique_lock lock(m_mutex); // check if the parameters existed : if (m_list.exist(_paramName) == false) { diff --git a/ewol/resource/ColorFile.hpp b/ewol/resource/ColorFile.hpp index 96123b89..2d61ad95 100644 --- a/ewol/resource/ColorFile.hpp +++ b/ewol/resource/ColorFile.hpp @@ -26,7 +26,7 @@ namespace ewol { * @param[in] _filename Name of the file needed */ ColorFile(); - void init(const std::string& _filename); + void init(const etk::String& _filename); public: DECLARE_RESOURCE_NAMED_FACTORY(ColorFile); /** @@ -46,7 +46,7 @@ namespace ewol { * @param[in] _paramName Name of the color. * @return A unique ID of the color (or -1 if an error occured). */ - int32_t request(const std::string& _paramName); + int32_t request(const etk::String& _paramName); /** * @brief Get the associated color of the ID. * @param[in] _Id Id of the color. @@ -62,7 +62,7 @@ namespace ewol { * @brief Get All color name * @return list of all color existing */ - std::vector getColors() const { + etk::Vector getColors() const { return m_list.getKeys(); } public: // herited function: diff --git a/ewol/resource/Colored3DObject.cpp b/ewol/resource/Colored3DObject.cpp index 779fcc16..f814c856 100644 --- a/ewol/resource/Colored3DObject.cpp +++ b/ewol/resource/Colored3DObject.cpp @@ -34,7 +34,7 @@ ewol::resource::Colored3DObject::~Colored3DObject() { } -void ewol::resource::Colored3DObject::draw(const std::vector& _vertices, +void ewol::resource::Colored3DObject::draw(const etk::Vector& _vertices, const etk::Color& _color, bool _updateDepthBuffer, bool _depthtest) { @@ -76,7 +76,7 @@ void ewol::resource::Colored3DObject::draw(const std::vector& _vertices, } } -void ewol::resource::Colored3DObject::draw(const std::vector& _vertices, +void ewol::resource::Colored3DObject::draw(const etk::Vector& _vertices, const etk::Color& _color, mat4& _transformationMatrix, bool _updateDepthBuffer, @@ -116,7 +116,7 @@ void ewol::resource::Colored3DObject::draw(const std::vector& _vertices, } } -void ewol::resource::Colored3DObject::drawLine(std::vector& _vertices, +void ewol::resource::Colored3DObject::drawLine(etk::Vector& _vertices, const etk::Color& _color, mat4& _transformationMatrix, bool _updateDepthBuffer, @@ -163,44 +163,44 @@ void ewol::resource::Colored3DObject::drawCubeLine(const vec3& _min, mat4& _transformationMatrix, bool _updateDepthBuffer, bool _depthtest) { - std::vector vertices; - vertices.push_back(vec3(_min.x(), _min.y(),_min.z())); - vertices.push_back(vec3(_max.x(), _min.y(),_min.z())); + etk::Vector vertices; + vertices.pushBack(vec3(_min.x(), _min.y(),_min.z())); + vertices.pushBack(vec3(_max.x(), _min.y(),_min.z())); - vertices.push_back(vec3(_max.x(), _min.y(),_min.z())); - vertices.push_back(vec3(_max.x(), _min.y(),_max.z())); + vertices.pushBack(vec3(_max.x(), _min.y(),_min.z())); + vertices.pushBack(vec3(_max.x(), _min.y(),_max.z())); - vertices.push_back(vec3(_max.x(), _min.y(),_max.z())); - vertices.push_back(vec3(_min.x(), _min.y(),_max.z())); + vertices.pushBack(vec3(_max.x(), _min.y(),_max.z())); + vertices.pushBack(vec3(_min.x(), _min.y(),_max.z())); - vertices.push_back(vec3(_min.x(), _min.y(),_max.z())); - vertices.push_back(vec3(_min.x(), _min.y(),_min.z())); + vertices.pushBack(vec3(_min.x(), _min.y(),_max.z())); + vertices.pushBack(vec3(_min.x(), _min.y(),_min.z())); - vertices.push_back(vec3(_min.x(), _max.y(),_min.z())); - vertices.push_back(vec3(_max.x(), _max.y(),_min.z())); + vertices.pushBack(vec3(_min.x(), _max.y(),_min.z())); + vertices.pushBack(vec3(_max.x(), _max.y(),_min.z())); - vertices.push_back(vec3(_max.x(), _max.y(),_min.z())); - vertices.push_back(vec3(_max.x(), _max.y(),_max.z())); + vertices.pushBack(vec3(_max.x(), _max.y(),_min.z())); + vertices.pushBack(vec3(_max.x(), _max.y(),_max.z())); - vertices.push_back(vec3(_max.x(), _max.y(),_max.z())); - vertices.push_back(vec3(_min.x(), _max.y(),_max.z())); + vertices.pushBack(vec3(_max.x(), _max.y(),_max.z())); + vertices.pushBack(vec3(_min.x(), _max.y(),_max.z())); - vertices.push_back(vec3(_min.x(), _max.y(),_max.z())); - vertices.push_back(vec3(_min.x(), _max.y(),_min.z())); + vertices.pushBack(vec3(_min.x(), _max.y(),_max.z())); + vertices.pushBack(vec3(_min.x(), _max.y(),_min.z())); - vertices.push_back(vec3(_min.x(), _min.y(),_min.z())); - vertices.push_back(vec3(_min.x(), _max.y(),_min.z())); + vertices.pushBack(vec3(_min.x(), _min.y(),_min.z())); + vertices.pushBack(vec3(_min.x(), _max.y(),_min.z())); - vertices.push_back(vec3(_max.x(), _min.y(),_min.z())); - vertices.push_back(vec3(_max.x(), _max.y(),_min.z())); + vertices.pushBack(vec3(_max.x(), _min.y(),_min.z())); + vertices.pushBack(vec3(_max.x(), _max.y(),_min.z())); - vertices.push_back(vec3(_max.x(), _min.y(),_max.z())); - vertices.push_back(vec3(_max.x(), _max.y(),_max.z())); + vertices.pushBack(vec3(_max.x(), _min.y(),_max.z())); + vertices.pushBack(vec3(_max.x(), _max.y(),_max.z())); - vertices.push_back(vec3(_min.x(), _min.y(),_max.z())); - vertices.push_back(vec3(_min.x(), _max.y(),_max.z())); + vertices.pushBack(vec3(_min.x(), _min.y(),_max.z())); + vertices.pushBack(vec3(_min.x(), _max.y(),_max.z())); drawLine(vertices, _color, _transformationMatrix, _updateDepthBuffer, _depthtest); } @@ -208,7 +208,7 @@ void ewol::resource::Colored3DObject::drawCubeLine(const vec3& _min, void ewol::resource::Colored3DObject::drawSquare(const vec3& _size, mat4& _transformationMatrix, const etk::Color& _tmpColor) { - std::vector tmpVertices; + etk::Vector tmpVertices; static int indices[36] = { 0,1,2, 3,2,1, 4,0,6, 6,0,2, 5,1,4, 4,1,0, 7,3,1, 7,1,5, 5,4,7, @@ -226,9 +226,9 @@ void ewol::resource::Colored3DObject::drawSquare(const vec3& _size, // normal calculation : //btVector3 normal = (vertices[indices[iii+2]]-vertices[indices[iii]]).cross(vertices[indices[iii+1]]-vertices[indices[iii]]); //normal.normalize (); - tmpVertices.push_back(vertices[indices[iii]]); - tmpVertices.push_back(vertices[indices[iii+1]]); - tmpVertices.push_back(vertices[indices[iii+2]]); + tmpVertices.pushBack(vertices[indices[iii]]); + tmpVertices.pushBack(vertices[indices[iii+1]]); + tmpVertices.pushBack(vertices[indices[iii+2]]); } draw(tmpVertices, _tmpColor, _transformationMatrix); } @@ -238,7 +238,7 @@ void ewol::resource::Colored3DObject::drawSphere(float _radius, int _longs, mat4& _transformationMatrix, const etk::Color& _tmpColor) { - std::vector tmpVertices; + etk::Vector tmpVertices; for(int32_t iii=0; iii<=_lats; ++iii) { float lat0 = M_PI * (-0.5f + float(iii - 1) / _lats); float z0 = _radius*sin(lat0); @@ -261,13 +261,13 @@ void ewol::resource::Colored3DObject::drawSphere(float _radius, vec3 v2 = vec3(x * zr1, y * zr1, z1); vec3 v3 = vec3(x * zr0, y * zr0, z0); - tmpVertices.push_back(v1); - tmpVertices.push_back(v2); - tmpVertices.push_back(v3); + tmpVertices.pushBack(v1); + tmpVertices.pushBack(v2); + tmpVertices.pushBack(v3); - tmpVertices.push_back(v1); - tmpVertices.push_back(v3); - tmpVertices.push_back(v4); + tmpVertices.pushBack(v1); + tmpVertices.pushBack(v3); + tmpVertices.pushBack(v4); } } draw(tmpVertices, _tmpColor, _transformationMatrix); @@ -278,7 +278,7 @@ void ewol::resource::Colored3DObject::drawCylinder(float _radius, int _longs, mat4& _transformationMatrix, const etk::Color& _tmpColor) { - std::vector tmpVertices; + etk::Vector tmpVertices; // center to border (TOP) // center to border (TOP) @@ -296,9 +296,9 @@ void ewol::resource::Colored3DObject::drawCylinder(float _radius, x = cos(lng)*_radius; y = sin(lng)*_radius; vec3 v3 = vec3(x, y, z); - tmpVertices.push_back(v1); - tmpVertices.push_back(v3); - tmpVertices.push_back(v2); + tmpVertices.pushBack(v1); + tmpVertices.pushBack(v3); + tmpVertices.pushBack(v2); } // Cylinder for(int32_t jjj=0; jjj<_longs; ++jjj) { @@ -317,13 +317,13 @@ void ewol::resource::Colored3DObject::drawCylinder(float _radius, vec3 v3 = vec3(x, y, z); vec3 v3b = vec3(x, y, -z); - tmpVertices.push_back(v2); - tmpVertices.push_back(v3); - tmpVertices.push_back(v3b); + tmpVertices.pushBack(v2); + tmpVertices.pushBack(v3); + tmpVertices.pushBack(v3b); - tmpVertices.push_back(v2); - tmpVertices.push_back(v3b); - tmpVertices.push_back(v2b); + tmpVertices.pushBack(v2); + tmpVertices.pushBack(v3b); + tmpVertices.pushBack(v2b); } // center to border (BUTTOM) for(int32_t jjj=0; jjj<_longs; ++jjj) { @@ -340,9 +340,9 @@ void ewol::resource::Colored3DObject::drawCylinder(float _radius, x = cos(lng)*_radius; y = sin(lng)*_radius; vec3 v3 = vec3(x, y, z); - tmpVertices.push_back(v1); - tmpVertices.push_back(v2); - tmpVertices.push_back(v3); + tmpVertices.pushBack(v1); + tmpVertices.pushBack(v2); + tmpVertices.pushBack(v3); } draw(tmpVertices, _tmpColor, _transformationMatrix); } @@ -352,7 +352,7 @@ void ewol::resource::Colored3DObject::drawCapsule(float _radius, int _longs, mat4& _transformationMatrix, const etk::Color& _tmpColor) { - std::vector tmpVertices; + etk::Vector tmpVertices; _lats = int32_t(_lats / 2)*2; // center to border (TOP) @@ -378,13 +378,13 @@ void ewol::resource::Colored3DObject::drawCapsule(float _radius, y = sin(lng); vec3 v2 = vec3(x * zr1, y * zr1, z1+offset); vec3 v3 = vec3(x * zr0, y * zr0, z0+offset); - tmpVertices.push_back(v1); - tmpVertices.push_back(v2); - tmpVertices.push_back(v3); + tmpVertices.pushBack(v1); + tmpVertices.pushBack(v2); + tmpVertices.pushBack(v3); - tmpVertices.push_back(v1); - tmpVertices.push_back(v3); - tmpVertices.push_back(v4); + tmpVertices.pushBack(v1); + tmpVertices.pushBack(v3); + tmpVertices.pushBack(v4); } } // Cylinder @@ -404,13 +404,13 @@ void ewol::resource::Colored3DObject::drawCapsule(float _radius, vec3 v3 = vec3(x, y, z); vec3 v3b = vec3(x, y, -z); - tmpVertices.push_back(v2); - tmpVertices.push_back(v3); - tmpVertices.push_back(v3b); + tmpVertices.pushBack(v2); + tmpVertices.pushBack(v3); + tmpVertices.pushBack(v3b); - tmpVertices.push_back(v2); - tmpVertices.push_back(v3b); - tmpVertices.push_back(v2b); + tmpVertices.pushBack(v2); + tmpVertices.pushBack(v3b); + tmpVertices.pushBack(v2b); } // center to border (BUTTOM) offset = -_size*0.5f; @@ -435,13 +435,13 @@ void ewol::resource::Colored3DObject::drawCapsule(float _radius, y = sin(lng); vec3 v2 = vec3(x * zr1, y * zr1, z1+offset); vec3 v3 = vec3(x * zr0, y * zr0, z0+offset); - tmpVertices.push_back(v1); - tmpVertices.push_back(v2); - tmpVertices.push_back(v3); + tmpVertices.pushBack(v1); + tmpVertices.pushBack(v2); + tmpVertices.pushBack(v3); - tmpVertices.push_back(v1); - tmpVertices.push_back(v3); - tmpVertices.push_back(v4); + tmpVertices.pushBack(v1); + tmpVertices.pushBack(v3); + tmpVertices.pushBack(v4); } } draw(tmpVertices, _tmpColor, _transformationMatrix); @@ -453,7 +453,7 @@ void ewol::resource::Colored3DObject::drawCone(float _radius, int _longs, mat4& _transformationMatrix, const etk::Color& _tmpColor) { - std::vector tmpVertices; + etk::Vector tmpVertices; // center to border (TOP) for(int32_t jjj=0; jjj<_longs; ++jjj) { float lng = 2.0f * M_PI * float(jjj - 1) / _longs; @@ -467,9 +467,9 @@ void ewol::resource::Colored3DObject::drawCone(float _radius, x = cos(lng)*_radius; y = sin(lng)*_radius; vec3 v3 = vec3(x, y, _size/2); - tmpVertices.push_back(v1); - tmpVertices.push_back(v3); - tmpVertices.push_back(v2); + tmpVertices.pushBack(v1); + tmpVertices.pushBack(v3); + tmpVertices.pushBack(v2); } // center to border (BUTTOM) for(int32_t jjj=0; jjj<_longs; ++jjj) { @@ -485,23 +485,23 @@ void ewol::resource::Colored3DObject::drawCone(float _radius, x = cos(lng)*_radius; y = sin(lng)*_radius; vec3 v3 = vec3(x, y, _size/2); - tmpVertices.push_back(v1); - tmpVertices.push_back(v2); - tmpVertices.push_back(v3); + tmpVertices.pushBack(v1); + tmpVertices.pushBack(v2); + tmpVertices.pushBack(v3); } draw(tmpVertices, _tmpColor, _transformationMatrix); } -void ewol::resource::Colored3DObject::drawTriangles(const std::vector& _vertex, - const std::vector& _indice, +void ewol::resource::Colored3DObject::drawTriangles(const etk::Vector& _vertex, + const etk::Vector& _indice, mat4& _transformationMatrix, const etk::Color& _tmpColor, const vec3& _offset) { - std::vector tmpVertices; + etk::Vector tmpVertices; for (size_t iii=0; iii<_indice.size()/3; ++iii) { - tmpVertices.push_back(_vertex[_indice[iii*3 + 0]]+_offset); - tmpVertices.push_back(_vertex[_indice[iii*3 + 1]]+_offset); - tmpVertices.push_back(_vertex[_indice[iii*3 + 2]]+_offset); + tmpVertices.pushBack(_vertex[_indice[iii*3 + 0]]+_offset); + tmpVertices.pushBack(_vertex[_indice[iii*3 + 1]]+_offset); + tmpVertices.pushBack(_vertex[_indice[iii*3 + 2]]+_offset); //EWOL_INFO(" indices " << _indice[iii*3 + 0] << " " << _indice[iii*3 + 1] << " " << _indice[iii*3 + 2]); //EWOL_INFO(" triangle " << _vertex[_indice[iii*3 + 0]] << " " << _vertex[_indice[iii*3 + 1]] << " " << _vertex[_indice[iii*3 + 2]]); } @@ -510,7 +510,7 @@ void ewol::resource::Colored3DObject::drawTriangles(const std::vector& _ve } namespace etk { - template<> std::string to_string(ewol::resource::Colored3DObject const&) { + template<> etk::String toString(ewol::resource::Colored3DObject const&) { return "!!ewol::resource::Colored3DObject!ERROR!CAN_NOT_BE_CONVERT!!"; } } diff --git a/ewol/resource/Colored3DObject.hpp b/ewol/resource/Colored3DObject.hpp index e6e466b1..e955a564 100644 --- a/ewol/resource/Colored3DObject.hpp +++ b/ewol/resource/Colored3DObject.hpp @@ -30,16 +30,16 @@ namespace ewol { DECLARE_RESOURCE_FACTORY(Colored3DObject); virtual ~Colored3DObject(); public: - virtual void draw(const std::vector& _vertices, + virtual void draw(const etk::Vector& _vertices, const etk::Color& _color, bool _updateDepthBuffer=true, bool _depthtest=true); - virtual void draw(const std::vector& _vertices, + virtual void draw(const etk::Vector& _vertices, const etk::Color& _color, mat4& _transformationMatrix, bool _updateDepthBuffer=true, bool _depthtest=true); - virtual void drawLine(std::vector& _vertices, + virtual void drawLine(etk::Vector& _vertices, const etk::Color& _color, mat4& _transformationMatrix, bool _updateDepthBuffer=true, @@ -77,8 +77,8 @@ namespace ewol { int _longs, mat4& _transformationMatrix, const etk::Color& _tmpColor); - void drawTriangles(const std::vector& _vertex, - const std::vector& _indice, + void drawTriangles(const etk::Vector& _vertex, + const etk::Vector& _indice, mat4& _transformationMatrix, const etk::Color& _tmpColor, const vec3& _offset=vec3(0,0,0.1)); diff --git a/ewol/resource/ConfigFile.cpp b/ewol/resource/ConfigFile.cpp index 0379e18f..075766cb 100644 --- a/ewol/resource/ConfigFile.cpp +++ b/ewol/resource/ConfigFile.cpp @@ -18,7 +18,7 @@ ewol::resource::ConfigFile::ConfigFile() : addResourceType("ewol::ConfigFile"); } -void ewol::resource::ConfigFile::init(const std::string& _filename) { +void ewol::resource::ConfigFile::init(const etk::String& _filename) { std::unique_lock lock(m_mutex); gale::Resource::init(_filename); EWOL_DEBUG("SFP : load \"" << _filename << "\""); @@ -48,7 +48,7 @@ void ewol::resource::ConfigFile::reload() { } -int32_t ewol::resource::ConfigFile::request(const std::string& _paramName) { +int32_t ewol::resource::ConfigFile::request(const etk::String& _paramName) { std::unique_lock lock(m_mutex); // check if the parameters existed : if (m_list.exist(_paramName) == false) { @@ -70,7 +70,7 @@ double ewol::resource::ConfigFile::getNumber(int32_t _id) { return m_list[_id].toNumber().get(); } -std::string ewol::resource::ConfigFile::getString(int32_t _id) { +etk::String ewol::resource::ConfigFile::getString(int32_t _id) { std::unique_lock lock(m_mutex); if ( _id < 0 || m_list[_id].exist() == false) { diff --git a/ewol/resource/ConfigFile.hpp b/ewol/resource/ConfigFile.hpp index 174ca347..05bc16cd 100644 --- a/ewol/resource/ConfigFile.hpp +++ b/ewol/resource/ConfigFile.hpp @@ -19,17 +19,17 @@ namespace ewol { etk::Hash m_list; protected: ConfigFile(); - void init(const std::string& _filename); + void init(const etk::String& _filename); public: virtual ~ConfigFile(); DECLARE_RESOURCE_NAMED_FACTORY(ConfigFile); public: void reload(); - int32_t request(const std::string& _paramName); + int32_t request(const etk::String& _paramName); double getNumber(int32_t _id); - std::string getString(int32_t _id); + etk::String getString(int32_t _id); bool getBoolean(int32_t _id); public: /** @@ -38,7 +38,7 @@ namespace ewol { * @param[in] _filename Name of the configuration file. * @return pointer on the resource or nullptr if an error occured. */ - static ememory::SharedPtr keep(const std::string& _filename); + static ememory::SharedPtr keep(const etk::String& _filename); }; }; }; diff --git a/ewol/resource/DistanceFieldFont.cpp b/ewol/resource/DistanceFieldFont.cpp index 99e78199..bef1548a 100644 --- a/ewol/resource/DistanceFieldFont.cpp +++ b/ewol/resource/DistanceFieldFont.cpp @@ -31,29 +31,29 @@ ewol::resource::DistanceFieldFont::DistanceFieldFont() : m_sizeRatio = 1.0f; } -void ewol::resource::DistanceFieldFont::init(const std::string& _fontName) { +void ewol::resource::DistanceFieldFont::init(const etk::String& _fontName) { std::unique_lock lock(m_mutex); ewol::resource::Texture::init(_fontName); - std::string localName = _fontName; - std::vector folderList; + etk::String localName = _fontName; + etk::Vector folderList; if (true == ewol::getContext().getFontDefault().getUseExternal()) { #if defined(__TARGET_OS__Android) - folderList.push_back("ROOT:system/fonts"); + folderList.pushBack("ROOT:system/fonts"); #elif defined(__TARGET_OS__Linux) - folderList.push_back("ROOT:usr/share/fonts/truetype"); + folderList.pushBack("ROOT:usr/share/fonts/truetype"); #endif } - std::string applicationBaseFont = ewol::getContext().getFontDefault().getFolder(); - std::vector applicationBaseFontList = etk::FSNodeExplodeMultiplePath(applicationBaseFont); + etk::String applicationBaseFont = ewol::getContext().getFontDefault().getFolder(); + etk::Vector applicationBaseFontList = etk::FSNodeExplodeMultiplePath(applicationBaseFont); for (auto &it : applicationBaseFontList) { - folderList.push_back(it); + folderList.pushBack(it); } for (size_t folderID = 0; folderID < folderList.size() ; folderID++) { etk::FSNode myFolder(folderList[folderID]); // find the real Font name : - std::vector output; + etk::Vector output; myFolder.folderGetRecursiveFiles(output); - std::vector split = etk::split(localName, ';'); + etk::Vector split = etk::split(localName, ';'); EWOL_INFO("try to find font named : " << split << " in: " << myFolder); //EWOL_CRITICAL("parse string : " << split); bool hasFindAFont = false; @@ -139,13 +139,13 @@ float ewol::resource::DistanceFieldFont::getDisplayRatio(float _size) { void ewol::resource::DistanceFieldFont::generateDistanceField(const egami::ImageMono& _input, egami::Image& _output) { std::unique_lock lock(m_mutex); int32_t size = _input.getSize().x() * _input.getSize().y(); - std::vector xdist(size); - std::vector ydist(size); - std::vector gx(size); - std::vector gy(size); - std::vector data(size); - std::vector outside(size); - std::vector inside(size); + etk::Vector xdist(size); + etk::Vector ydist(size); + etk::Vector gx(size); + etk::Vector gy(size); + etk::Vector data(size); + etk::Vector outside(size); + etk::Vector inside(size); // Convert img into double (data) double img_min = 255, img_max = -255; for (int32_t yyy = 0; yyy < _input.getSize().y(); ++yyy) { @@ -284,7 +284,7 @@ bool ewol::resource::DistanceFieldFont::addGlyph(const char32_t& _val) { EWOL_WARNING("Did not find char : '" << _val << "'=" << _val); tmpchar.setNotExist(); } - m_listElement.push_back(tmpchar); + m_listElement.pushBack(tmpchar); //m_font[iii]->display(); // generate the kerning for all the characters : if (tmpchar.exist() == true) { @@ -352,13 +352,13 @@ void ewol::resource::DistanceFieldFont::exportOnFile() { ejson::Array tmpList; for (size_t iii=0; iii otherwise I can just generate italic ... // == > Bold is a little more complicated (maybe with the bordersize) ememory::SharedPtr m_font; public: - std::vector m_listElement; + etk::Vector m_listElement; private: // for the texture generation : ivec2 m_lastGlyphPos; int32_t m_lastRawHeigh; protected: DistanceFieldFont(); - void init(const std::string& _fontName); + void init(const etk::String& _fontName); public: DECLARE_RESOURCE_NAMED_FACTORY(DistanceFieldFont); virtual ~DistanceFieldFont(); @@ -68,7 +68,7 @@ namespace ewol { * @param[in] _filename Name of the texture font. * @return pointer on the resource or nullptr if an error occured. */ - static ememory::SharedPtr keep(const std::string& _filename); + static ememory::SharedPtr keep(const etk::String& _filename); private: /** * @brief add a glyph in a texture font. diff --git a/ewol/resource/FontFreeType.cpp b/ewol/resource/FontFreeType.cpp index b1e14ed5..20f59899 100644 --- a/ewol/resource/FontFreeType.cpp +++ b/ewol/resource/FontFreeType.cpp @@ -5,7 +5,7 @@ */ #include -#include +#include #include @@ -54,7 +54,7 @@ ewol::resource::FontFreeType::FontFreeType() { m_FileSize = 0; } -void ewol::resource::FontFreeType::init(const std::string& _fontName) { +void ewol::resource::FontFreeType::init(const etk::String& _fontName) { std::unique_lock lock(m_mutex); ewol::resource::FontBase::init(_fontName); etk::FSNode myfile(_fontName); @@ -106,7 +106,7 @@ ewol::resource::FontFreeType::~FontFreeType() { FT_Done_Face( m_fftFace ); } -vec2 ewol::resource::FontFreeType::getSize(int32_t _fontSize, const std::string& _unicodeString) { +vec2 ewol::resource::FontFreeType::getSize(int32_t _fontSize, const etk::String& _unicodeString) { std::unique_lock lock(m_mutex); if(false == m_init) { return vec2(0,0); @@ -276,7 +276,7 @@ bool ewol::resource::FontFreeType::drawGlyph(egami::ImageMono& _imageOut, } -void ewol::resource::FontFreeType::generateKerning(int32_t fontSize, std::vector& listGlyph) { +void ewol::resource::FontFreeType::generateKerning(int32_t fontSize, etk::Vector& listGlyph) { std::unique_lock lock(m_mutex); if(m_init == false) { return; diff --git a/ewol/resource/FontFreeType.hpp b/ewol/resource/FontFreeType.hpp index 65b6c461..340ad3b0 100644 --- a/ewol/resource/FontFreeType.hpp +++ b/ewol/resource/FontFreeType.hpp @@ -26,7 +26,7 @@ namespace ewol { void display(); protected: FontFreeType(); - void init(const std::string& _fontName); + void init(const etk::String& _fontName); public: DECLARE_RESOURCE_NAMED_FACTORY(FontFreeType); virtual ~FontFreeType(); @@ -46,12 +46,12 @@ namespace ewol { ewol::GlyphProperty& _property, int32_t _borderSize = 0); - vec2 getSize(int32_t _fontSize, const std::string& _unicodeString); + vec2 getSize(int32_t _fontSize, const etk::String& _unicodeString); int32_t getHeight(int32_t _fontSize); float getSizeWithHeight(float _fontHeight); - void generateKerning(int32_t _fontSize, std::vector& _listGlyph); + void generateKerning(int32_t _fontSize, etk::Vector& _listGlyph); }; void freeTypeInit(); void freeTypeUnInit(); diff --git a/ewol/resource/Image.cpp b/ewol/resource/Image.cpp index 2286cdd9..2316e0bb 100644 --- a/ewol/resource/Image.cpp +++ b/ewol/resource/Image.cpp @@ -43,7 +43,7 @@ void ewol::resource::TextureFile::init() { ewol::resource::Texture::init(); } -void ewol::resource::TextureFile::init(std::string _genName, const std::string& _tmpFilename, const ivec2& _size) { +void ewol::resource::TextureFile::init(etk::String _genName, const etk::String& _tmpFilename, const ivec2& _size) { std::unique_lock lock(m_mutex); ewol::resource::Texture::init(_genName); EWOL_DEBUG("create a new resource::Image : _genName=" << _genName << " _tmpFilename=" << _tmpFilename << " size=" << _size); @@ -61,13 +61,13 @@ void ewol::resource::TextureFile::init(std::string _genName, const std::string& } m_lastSize = m_realImageSize; #ifdef GENERATE_DISTANCE_FIELD_MODE - //egami::generateDistanceFieldFile(_tmpFilename, std::string(_tmpFilename, 0, _tmpFilename.size()-4) + ".bmp"); - egami::generateDistanceFieldFile(_tmpFilename, std::string(_tmpFilename, 0, _tmpFilename.size()-4) + ".edf"); + //egami::generateDistanceFieldFile(_tmpFilename, etk::String(_tmpFilename, 0, _tmpFilename.size()-4) + ".bmp"); + egami::generateDistanceFieldFile(_tmpFilename, etk::String(_tmpFilename, 0, _tmpFilename.size()-4) + ".edf"); #endif flush(); } -ememory::SharedPtr ewol::resource::TextureFile::create(const std::string& _filename, ivec2 _size, ivec2 _sizeRegister) { +ememory::SharedPtr ewol::resource::TextureFile::create(const etk::String& _filename, ivec2 _size, ivec2 _sizeRegister) { EWOL_VERBOSE("KEEP: TextureFile: '" << _filename << "' size=" << _size << " sizeRegister=" << _sizeRegister); if (_filename == "") { ememory::SharedPtr object(new ewol::resource::TextureFile()); @@ -87,7 +87,7 @@ ememory::SharedPtr ewol::resource::TextureFile::cre _size.setY(-1); //EWOL_ERROR("Error Request the image size.y() =0 ???"); } - std::string tmpFilename = _filename; + etk::String tmpFilename = _filename; if (etk::end_with(_filename, ".svg") == false) { _size = ewol::resource::TextureFile::sizeAuto; } @@ -97,9 +97,9 @@ ememory::SharedPtr ewol::resource::TextureFile::cre if (_sizeRegister != ewol::resource::TextureFile::sizeAuto) { if (_sizeRegister != ewol::resource::TextureFile::sizeDefault) { tmpFilename += ":"; - tmpFilename += etk::to_string(_size.x()); + tmpFilename += etk::toString(_size.x()); tmpFilename += "x"; - tmpFilename += etk::to_string(_size.y()); + tmpFilename += etk::toString(_size.y()); } } } diff --git a/ewol/resource/Image.hpp b/ewol/resource/Image.hpp index fafa414d..33f93667 100644 --- a/ewol/resource/Image.hpp +++ b/ewol/resource/Image.hpp @@ -24,7 +24,7 @@ namespace ewol { protected: TextureFile(); void init(); - void init(std::string _genName, const std::string& _fileName, const ivec2& _size); + void init(etk::String _genName, const etk::String& _fileName, const ivec2& _size); public: virtual ~TextureFile() { }; public: @@ -40,7 +40,7 @@ namespace ewol { * @param[in] _sizeRegister size register in named (When you preaload the images the size write here will be ) * @return pointer on the resource or nullptr if an error occured. */ - static ememory::SharedPtr create(const std::string& _filename, + static ememory::SharedPtr create(const etk::String& _filename, ivec2 _size=ewol::resource::TextureFile::sizeAuto, ivec2 _sizeRegister=ewol::resource::TextureFile::sizeAuto); }; diff --git a/ewol/resource/ImageDF.cpp b/ewol/resource/ImageDF.cpp index 23131cdf..ff3fd0e0 100644 --- a/ewol/resource/ImageDF.cpp +++ b/ewol/resource/ImageDF.cpp @@ -22,7 +22,7 @@ void ewol::resource::ImageDF::init() { ewol::resource::Texture::init(); } -void ewol::resource::ImageDF::init(std::string _genName, const std::string& _tmpfileName, const ivec2& _size) { +void ewol::resource::ImageDF::init(etk::String _genName, const etk::String& _tmpfileName, const ivec2& _size) { std::unique_lock lock(m_mutex); ewol::resource::Texture::init(_genName); EWOL_DEBUG("create a new resource::Image : _genName=" << _genName << " _tmpfileName=" << _tmpfileName << " size=" << _size); @@ -51,13 +51,13 @@ void ewol::resource::ImageDF::init(std::string _genName, const std::string& _tmp void ewol::resource::ImageDF::generateDistanceField(const egami::ImageMono& _input, egami::Image& _output) { std::unique_lock lock(m_mutex); int32_t size = _input.getSize().x() * _input.getSize().y(); - std::vector xdist(size); - std::vector ydist(size); - std::vector gx(size); - std::vector gy(size); - std::vector data(size); - std::vector outside(size); - std::vector inside(size); + etk::Vector xdist(size); + etk::Vector ydist(size); + etk::Vector gx(size); + etk::Vector gy(size); + etk::Vector data(size); + etk::Vector outside(size); + etk::Vector inside(size); // Convert img into double (data) double img_min = 255, img_max = -255; for (int32_t yyy = 0; yyy < _input.getSize().y(); ++yyy) { @@ -150,7 +150,7 @@ static int32_t nextP2(int32_t _value) { -ememory::SharedPtr ewol::resource::ImageDF::create(const std::string& _filename, ivec2 _size) { +ememory::SharedPtr ewol::resource::ImageDF::create(const etk::String& _filename, ivec2 _size) { EWOL_VERBOSE("KEEP: TextureFile: '" << _filename << "' size=" << _size); if (_filename == "") { ememory::SharedPtr object(new ewol::resource::ImageDF()); @@ -170,7 +170,7 @@ ememory::SharedPtr ewol::resource::ImageDF::create(cons _size.setY(-1); //EWOL_ERROR("Error Request the image size.y() =0 ???"); } - std::string TmpFilename = _filename; + etk::String TmpFilename = _filename; if (etk::end_with(_filename, ".svg") == false) { _size = ivec2(-1,-1); } @@ -185,9 +185,9 @@ ememory::SharedPtr ewol::resource::ImageDF::create(cons _size.setValue(nextP2(_size.x()), nextP2(_size.y())); #endif TmpFilename += ":"; - TmpFilename += etk::to_string(_size.x()); + TmpFilename += etk::toString(_size.x()); TmpFilename += "x"; - TmpFilename += etk::to_string(_size.y()); + TmpFilename += etk::toString(_size.y()); } EWOL_VERBOSE("KEEP: TextureFile: '" << TmpFilename << "' new size=" << _size); diff --git a/ewol/resource/ImageDF.hpp b/ewol/resource/ImageDF.hpp index 438ab87b..a1a8cef1 100644 --- a/ewol/resource/ImageDF.hpp +++ b/ewol/resource/ImageDF.hpp @@ -18,7 +18,7 @@ namespace ewol { protected: ImageDF(); void init(); - void init(std::string _genName, const std::string& _fileName, const ivec2& _size); + void init(etk::String _genName, const etk::String& _fileName, const ivec2& _size); public: virtual ~ImageDF() { }; protected: @@ -40,7 +40,7 @@ namespace ewol { * @param[in] _requested size of the image (usefull when loading .svg to automatic rescale) * @return pointer on the resource or nullptr if an error occured. */ - static ememory::SharedPtr create(const std::string& _filename, ivec2 _size=ivec2(-1,-1)); + static ememory::SharedPtr create(const etk::String& _filename, ivec2 _size=ivec2(-1,-1)); }; }; }; diff --git a/ewol/resource/Texture.cpp b/ewol/resource/Texture.cpp index 6f713f34..34d2f21a 100644 --- a/ewol/resource/Texture.cpp +++ b/ewol/resource/Texture.cpp @@ -29,7 +29,7 @@ static int32_t nextP2(int32_t _value) { return val; } -void ewol::resource::Texture::init(const std::string& _filename) { +void ewol::resource::Texture::init(const etk::String& _filename) { gale::Resource::init(_filename); } void ewol::resource::Texture::init() { @@ -45,7 +45,9 @@ ewol::resource::Texture::Texture() : m_lastSize(1,1), m_loaded(false), m_lastTypeObject(0), - m_lastSizeObject(0) { + m_lastSizeObject(0), + m_repeat(false), + m_filter(ewol::resource::TextureFilter::linear) { addResourceType("ewol::compositing::Texture"); } @@ -53,6 +55,15 @@ ewol::resource::Texture::~Texture() { removeContext(); } + +void ewol::resource::Texture::setRepeat(bool _value) { + m_repeat = _value; +} + +void ewol::resource::Texture::setFilterMode(enum ewol::resource::TextureFilter _filter) { + m_filter = _filter; +} + #include bool ewol::resource::Texture::updateContext() { @@ -71,37 +82,27 @@ bool ewol::resource::Texture::updateContext() { } int32_t typeObject = GL_RGBA; int32_t sizeObject = GL_UNSIGNED_BYTE; - #ifdef EWOL_USE_FBO - int32_t sizeByte = 1; - #endif + int32_t sizeByte = 1; switch (m_data.getType()) { case egami::colorType::RGBA8: typeObject = GL_RGBA; sizeObject = GL_UNSIGNED_BYTE; - #ifdef EWOL_USE_FBO - sizeByte = 4; - #endif + sizeByte = 4; break; case egami::colorType::RGB8: typeObject = GL_RGB; sizeObject = GL_UNSIGNED_BYTE; - #ifdef EWOL_USE_FBO - sizeByte = 3; - #endif + sizeByte = 3; break; case egami::colorType::RGBAf: typeObject = GL_RGBA; sizeObject = GL_FLOAT; - #ifdef EWOL_USE_FBO - sizeByte = 16; - #endif + sizeByte = 16; break; case egami::colorType::RGBf: typeObject = GL_RGBA; sizeObject = GL_FLOAT; - #ifdef EWOL_USE_FBO - sizeByte = 12; - #endif + sizeByte = 12; break; case egami::colorType::unsignedInt16: case egami::colorType::unsignedInt32: @@ -145,29 +146,32 @@ bool ewol::resource::Texture::updateContext() { // TODO : check error ??? glBindTexture(GL_TEXTURE_2D, m_texId); if (m_loaded == false) { - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); - // TODO : Check error ??? - //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - //--- mode nearest - //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); // 18/20 - //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - //--- Mode linear - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // 16/17 - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + if (m_repeat == false) { + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE); + } else { + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); + } + if (m_filter == ewol::resource::TextureFilter::linear) { + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + } else { + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + } } //glPixelStorei(GL_UNPACK_ALIGNMENT,1); echrono::Steady toc1 = echrono::Steady::now(); EWOL_VERBOSE(" BIND ==> " << (toc1 - tic)); - //egami::store(m_data, std::string("~/texture_") + etk::to_string(getId()) + ".bmp"); + //egami::store(m_data, etk::String("~/texture_") + etk::toString(getId()) + ".bmp"); #if defined(__TARGET_OS__Android) \ || defined(__TARGET_OS__IOs) // On some embended target, the texture size must be square of 2: if (m_loaded == false) { // 1: Create the square 2 texture: int32_t bufferSize = m_data.getGPUSize().x() * m_data.getGPUSize().y() * 8; - static std::vector tmpData; + static etk::Vector tmpData; if (tmpData.size() < bufferSize) { tmpData.resize(bufferSize, 0.0f); } @@ -217,6 +221,7 @@ bool ewol::resource::Texture::updateContext() { glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); #else //3 Flush all time the data: + echrono::Steady tic1 = echrono::Steady::now(); glTexSubImage2D(GL_TEXTURE_2D, // Target 0, // Level 0, // x offset @@ -225,7 +230,9 @@ bool ewol::resource::Texture::updateContext() { m_data.getHeight(), typeObject, // format sizeObject, // type - m_data.getTextureDataPointer() ); + (void*)((char*)m_data.getTextureDataPointer()) ); + echrono::Steady toc2 = echrono::Steady::now(); + EWOL_INFO(" updateContext [STOP] ==> " << (toc2 - tic1)); #endif #else // This is the normal case ==> set the image and after set just the update of the data @@ -254,7 +261,7 @@ bool ewol::resource::Texture::updateContext() { // now the data is loaded m_loaded = true; echrono::Steady toc = echrono::Steady::now(); - EWOL_VERBOSE(" updateContext [STOP] ==> " << (toc - toc1)); + //EWOL_ERROR(" updateContext [STOP] ==> " << (toc - toc1)); return true; } diff --git a/ewol/resource/Texture.hpp b/ewol/resource/Texture.hpp index ca588ef2..3357cbd2 100644 --- a/ewol/resource/Texture.hpp +++ b/ewol/resource/Texture.hpp @@ -14,6 +14,10 @@ namespace ewol { namespace resource { + enum class TextureFilter { + nearest, + linear + }; class Texture : public gale::Resource { protected: uint32_t m_texId; //!< openGl textureID. @@ -28,9 +32,25 @@ namespace ewol { bool m_loaded; int32_t m_lastTypeObject; int32_t m_lastSizeObject; + protected: + bool m_repeat; //!< repeate mode of the image (repeat the image if out of range [0..1] + public: + /** + * @brief Set the repeate mode of the images if UV range is out of [0..1] + * @param[in] _value Value of the new repeate mode + */ + void setRepeat(bool _value); + protected: + enum ewol::resource::TextureFilter m_filter; //!< Filter apply at the image when rendering it + public: + /** + * @brief Set the Filter mode to apply at the image when display with a scale (not 1:1 ratio) + * @param[in] _value Value of the new filter mode + */ + void setFilterMode(enum ewol::resource::TextureFilter _filter); // Public API: protected: - void init(const std::string& _filename); + void init(const etk::String& _filename); void init(); Texture(); public: diff --git a/ewol/resource/TexturedFont.cpp b/ewol/resource/TexturedFont.cpp index 68223e1f..b5d36c58 100644 --- a/ewol/resource/TexturedFont.cpp +++ b/ewol/resource/TexturedFont.cpp @@ -16,7 +16,7 @@ #include -std::ostream& ewol::operator <<(std::ostream& _os, enum ewol::font::mode _obj) { +etk::Stream& ewol::operator <<(etk::Stream& _os, enum ewol::font::mode _obj) { switch(_obj) { default : _os << "error"; @@ -42,7 +42,7 @@ ewol::resource::TexturedFont::TexturedFont(): addResourceType("ewol::resource::TexturedFont"); } -void ewol::resource::TexturedFont::init(const std::string& _fontName) { +void ewol::resource::TexturedFont::init(const etk::String& _fontName) { std::unique_lock lock(m_mutex); ewol::resource::Texture::init(_fontName); EWOL_DEBUG("Load font : '" << _fontName << "'" ); @@ -83,32 +83,32 @@ void ewol::resource::TexturedFont::init(const std::string& _fontName) { return; } } - std::string localName(_fontName, 0, (tmpPos - tmpData)); + etk::String localName(_fontName, 0, (tmpPos - tmpData)); if (tmpSize>400) { EWOL_ERROR("Font size too big ==> limit at 400 when exxeed ==> error : " << tmpSize << "==>30"); tmpSize = 30; } m_size = tmpSize; - std::vector folderList; + etk::Vector folderList; if (ewol::getContext().getFontDefault().getUseExternal() == true) { #if defined(__TARGET_OS__Android) - folderList.push_back("ROOT:system/fonts"); + folderList.pushBack("ROOT:system/fonts"); #elif defined(__TARGET_OS__Linux) - folderList.push_back("ROOT:usr/share/fonts"); + folderList.pushBack("ROOT:usr/share/fonts"); #endif } - std::string applicationBaseFont = ewol::getContext().getFontDefault().getFolder(); - std::vector applicationBaseFontList = etk::FSNodeExplodeMultiplePath(applicationBaseFont); + etk::String applicationBaseFont = ewol::getContext().getFontDefault().getFolder(); + etk::Vector applicationBaseFontList = etk::FSNodeExplodeMultiplePath(applicationBaseFont); for (auto &it : applicationBaseFontList) { - folderList.push_back(it); + folderList.pushBack(it); } for (size_t folderID=0; folderID output; + etk::Vector output; myFolder.folderGetRecursiveFiles(output); - std::vector split = etk::split(localName, ';'); + etk::Vector split = etk::split(localName, ';'); EWOL_INFO("try to find font named : " << split << " in: " << myFolder); //EWOL_CRITICAL("parse string : " << split); bool hasFindAFont = false; @@ -286,7 +286,7 @@ bool ewol::resource::TexturedFont::addGlyph(const char32_t& _val) { EWOL_WARNING("Did not find char : '" << _val << "'=" << _val); tmpchar.setNotExist(); } - m_listElement[iii].push_back(tmpchar); + m_listElement[iii].pushBack(tmpchar); //m_font[iii]->display(); // generate the kerning for all the characters : if (tmpchar.exist() == true) { diff --git a/ewol/resource/TexturedFont.hpp b/ewol/resource/TexturedFont.hpp index d9df7901..da1ffed2 100644 --- a/ewol/resource/TexturedFont.hpp +++ b/ewol/resource/TexturedFont.hpp @@ -20,12 +20,12 @@ namespace ewol { BoldItalic, }; } - std::ostream& operator <<(std::ostream& _os, enum ewol::font::mode _obj); + etk::Stream& operator <<(etk::Stream& _os, enum ewol::font::mode _obj); namespace resource { class TexturedFont : public ewol::resource::Texture { private: - std::string m_fileName[4]; + etk::String m_fileName[4]; int32_t m_size; int32_t m_height[4]; // specific element to have the the know if the specify element is known... @@ -35,14 +35,14 @@ namespace ewol { enum ewol::font::mode m_modeWraping[4]; //!< This is a wrapping mode to prevent the fact that no font is define for a specific mode public: GlyphProperty m_emptyGlyph; - std::vector m_listElement[4]; + etk::Vector m_listElement[4]; private: // for the texture generation : ivec2 m_lastGlyphPos[4]; int32_t m_lastRawHeigh[4]; protected: TexturedFont(); - void init(const std::string& _fontName); + void init(const etk::String& _fontName); public: DECLARE_RESOURCE_NAMED_FACTORY(TexturedFont); virtual ~TexturedFont(); diff --git a/ewol/resource/font/FontBase.hpp b/ewol/resource/font/FontBase.hpp index a6127fb9..06c3ce92 100644 --- a/ewol/resource/font/FontBase.hpp +++ b/ewol/resource/font/FontBase.hpp @@ -21,7 +21,7 @@ namespace ewol { FontBase() { addResourceType("ewol::FontFreeType"); } - void init(const std::string& _fontName) { + void init(const etk::String& _fontName) { gale::Resource::init(_fontName); }; @@ -41,12 +41,12 @@ namespace ewol { ewol::GlyphProperty& _property, int32_t _borderSize = 0) = 0; - virtual vec2 getSize(int32_t _fontSize, const std::string& _unicodeString) = 0; + virtual vec2 getSize(int32_t _fontSize, const etk::String& _unicodeString) = 0; virtual float getSizeWithHeight(float _fontHeight) = 0; virtual int32_t getHeight(int32_t _fontSize) = 0; - virtual void generateKerning(int32_t _fontSize, std::vector& _listGlyph) { }; + virtual void generateKerning(int32_t _fontSize, etk::Vector& _listGlyph) { }; virtual void display() {}; }; diff --git a/ewol/resource/font/GlyphProperty.hpp b/ewol/resource/font/GlyphProperty.hpp index 5ca68853..39a78767 100644 --- a/ewol/resource/font/GlyphProperty.hpp +++ b/ewol/resource/font/GlyphProperty.hpp @@ -58,7 +58,7 @@ namespace ewol { vec2 m_texturePosStart; //!< Texture normalized position (START) vec2 m_texturePosSize; //!< Texture normalized position (SIZE) private: - std::vector m_kerning; //!< kerning values of link of all elements + etk::Vector m_kerning; //!< kerning values of link of all elements public: GlyphProperty() : m_UVal(0), @@ -80,7 +80,7 @@ namespace ewol { return 0; }; void kerningAdd(const char32_t _charcode, float _value) { - m_kerning.push_back(ewol::Kerning(_charcode, _value)); + m_kerning.pushBack(ewol::Kerning(_charcode, _value)); }; void kerningClear() { m_kerning.clear(); diff --git a/ewol/resource/font/Kerning.hpp b/ewol/resource/font/Kerning.hpp index 0b8caa56..061e683b 100644 --- a/ewol/resource/font/Kerning.hpp +++ b/ewol/resource/font/Kerning.hpp @@ -43,7 +43,7 @@ namespace ewol { float m_value; //!< kerning real offset public: /** - * @brief Simple constructor that allow to allocate the std::vector element + * @brief Simple constructor that allow to allocate the etk::Vector element */ Kerning() : m_UVal(0), diff --git a/ewol/tools/message.cpp b/ewol/tools/message.cpp index 8aa63079..f8e62742 100644 --- a/ewol/tools/message.cpp +++ b/ewol/tools/message.cpp @@ -13,7 +13,7 @@ #include #include -void ewol::tools::message::create(enum ewol::tools::message::type _type, const std::string& _message) { +void ewol::tools::message::create(enum ewol::tools::message::type _type, const etk::String& _message) { ewol::widget::StdPopUpShared tmpPopUp = widget::StdPopUp::create(); if (tmpPopUp == nullptr) { EWOL_ERROR("Can not create a simple pop-up"); @@ -46,19 +46,19 @@ void ewol::tools::message::create(enum ewol::tools::message::type _type, const s windows->popUpWidgetPush(tmpPopUp); } -void ewol::tools::message::displayInfo(const std::string& _message) { +void ewol::tools::message::displayInfo(const etk::String& _message) { ewol::tools::message::create(ewol::tools::message::type::info, _message); } -void ewol::tools::message::displayWarning(const std::string& _message) { +void ewol::tools::message::displayWarning(const etk::String& _message) { ewol::tools::message::create(ewol::tools::message::type::warning, _message); } -void ewol::tools::message::displayError(const std::string& _message) { +void ewol::tools::message::displayError(const etk::String& _message) { ewol::tools::message::create(ewol::tools::message::type::error, _message); } -void ewol::tools::message::displayCritical(const std::string& _message) { +void ewol::tools::message::displayCritical(const etk::String& _message) { ewol::tools::message::create(ewol::tools::message::type::critical, _message); } diff --git a/ewol/tools/message.hpp b/ewol/tools/message.hpp index 7b3cb767..245266a9 100644 --- a/ewol/tools/message.hpp +++ b/ewol/tools/message.hpp @@ -26,27 +26,27 @@ namespace ewol { * @param[in] _type Type of the error. * @param[in] _message message to display (decorated text) */ - void create(enum ewol::tools::message::type _type, const std::string& _message); + void create(enum ewol::tools::message::type _type, const etk::String& _message); /** * @brief Create a simple information message * @param[in] _message message to display (decorated text) */ - void displayInfo(const std::string& _message); + void displayInfo(const etk::String& _message); /** * @brief Create a simple warning message * @param[in] _message message to display (decorated text) */ - void displayWarning(const std::string& _message); + void displayWarning(const etk::String& _message); /** * @brief Create a simple error message * @param[in] _message message to display (decorated text) */ - void displayError(const std::string& _message); + void displayError(const etk::String& _message); /** * @brief Create a simple critical message * @param[in] _message message to display (decorated text) */ - void displayCritical(const std::string& _message); + void displayCritical(const etk::String& _message); } } } diff --git a/ewol/translate.cpp b/ewol/translate.cpp index e89e20bc..8b832d5b 100644 --- a/ewol/translate.cpp +++ b/ewol/translate.cpp @@ -6,18 +6,18 @@ #include #include -#include +#include #include #include class LocalInstanceTranslation { private: - std::map m_listPath; - std::string m_major; - std::string m_languageDefault; - std::string m_language; + etk::Map m_listPath; + etk::String m_major; + etk::String m_languageDefault; + etk::String m_language; bool m_translateLoadad; - std::map m_translate; + etk::Map m_translate; public: LocalInstanceTranslation() : m_major("ewol"), @@ -27,7 +27,7 @@ class LocalInstanceTranslation { // nothing to do ... } public: - void addPath(const std::string& _lib, const std::string& _path, bool _major) { + void addPath(const etk::String& _lib, const etk::String& _path, bool _major) { auto it = m_listPath.find(_lib); if (it == m_listPath.end()) { m_listPath.insert(make_pair(_lib, _path)); @@ -42,16 +42,16 @@ class LocalInstanceTranslation { m_translate.clear(); }; - const std::string& getPaths(const std::string& _lib) { + const etk::String& getPaths(const etk::String& _lib) { auto it = m_listPath.find(_lib); if (it == m_listPath.end()) { - static const std::string g_error(""); + static const etk::String g_error(""); return g_error; } return it->second; }; - void setLanguageDefault(const std::string& _lang) { + void setLanguageDefault(const etk::String& _lang) { if (m_languageDefault == _lang) { return; } @@ -61,11 +61,11 @@ class LocalInstanceTranslation { m_translate.clear(); }; - const std::string& getLanguageDefault() { + const etk::String& getLanguageDefault() { return m_languageDefault; }; - void setLanguage(const std::string& _lang) { + void setLanguage(const etk::String& _lang) { if (m_language == _lang) { return; } @@ -97,29 +97,29 @@ class LocalInstanceTranslation { } }; - const std::string& getLanguage() { + const etk::String& getLanguage() { return m_language; }; - std::string get(const std::string& _instance) { + etk::String get(const etk::String& _instance) { loadTranslation(); EWOL_VERBOSE("Request translate: '" << _instance << "'"); // find all iterance of '_T{' ... '}' - std::string out; + etk::String out; auto itOld = _instance.begin(); size_t pos = _instance.find("_T{"); - while (pos != std::string::npos) { + while (pos != etk::String::npos) { out.append(itOld, _instance.begin() + pos); auto it = _instance.begin() + pos + 3; itOld = it; pos = _instance.find("}", pos); - if (pos == std::string::npos) { + if (pos == etk::String::npos) { EWOL_WARNING("missing end translation '}' in: '" << _instance << "'"); it = _instance.end(); } else { it = _instance.begin() + pos; } - std::string basicEmptyValue = std::string(itOld, it); + etk::String basicEmptyValue = etk::String(itOld, it); auto itTranslate = m_translate.find(basicEmptyValue); if (itTranslate == m_translate.end()) { EWOL_DEBUG("Can not find tranlation : '" << _instance << "'"); @@ -149,17 +149,17 @@ class LocalInstanceTranslation { // start parse language for Major: auto itMajor = m_listPath.find(m_major); if (itMajor != m_listPath.end()) { - std::string filename(itMajor->second + "/" + m_language + ".json"); + etk::String filename(itMajor->second + "/" + m_language + ".json"); ejson::Document doc; doc.load(filename); for (auto element : doc.getKeys()) { - std::string val = doc[element].toString().get(); + etk::String val = doc[element].toString().get(); m_translate.insert(make_pair(element, val)); } filename = itMajor->second + "/" + m_languageDefault + ".json"; doc.load(filename); for (auto element : doc.getKeys()) { - std::string val = doc[element].toString().get(); + etk::String val = doc[element].toString().get(); auto itTrans = m_translate.find(element); if (itTrans == m_translate.end()) { m_translate.insert(make_pair(element, val)); @@ -171,14 +171,14 @@ class LocalInstanceTranslation { if (it.first == m_major) { continue; } - std::string filename(it.second + "/" + m_languageDefault + ".json"); + etk::String filename(it.second + "/" + m_languageDefault + ".json"); if (etk::FSNodeExist(filename) == false) { continue; } ejson::Document doc; doc.load(filename); for (auto element : doc.getKeys()) { - std::string val = doc[element].toString().get(); + etk::String val = doc[element].toString().get(); auto itTrans = m_translate.find(element); if (itTrans == m_translate.end()) { m_translate.insert(make_pair(element, val)); @@ -190,14 +190,14 @@ class LocalInstanceTranslation { if (it.first == m_major) { continue; } - std::string filename(it.second + "/" + m_languageDefault + ".json"); + etk::String filename(it.second + "/" + m_languageDefault + ".json"); if (etk::FSNodeExist(filename) == false) { continue; } ejson::Document doc; doc.load(filename); for (auto element : doc.getKeys()) { - std::string val = doc[element].toString().get(); + etk::String val = doc[element].toString().get(); auto itTrans = m_translate.find(element); if (itTrans == m_translate.end()) { m_translate.insert(make_pair(element, val)); @@ -213,35 +213,35 @@ static LocalInstanceTranslation& getInstanceTranslation() { return g_val; } -void etranslate::addPath(const std::string& _lib, const std::string& _path, bool _major) { +void etranslate::addPath(const etk::String& _lib, const etk::String& _path, bool _major) { getInstanceTranslation().addPath(_lib, _path, _major); } -const std::string& etranslate::getPaths(const std::string& _lib) { +const etk::String& etranslate::getPaths(const etk::String& _lib) { return getInstanceTranslation().getPaths(_lib); } -void etranslate::setLanguageDefault(const std::string& _lang) { +void etranslate::setLanguageDefault(const etk::String& _lang) { getInstanceTranslation().setLanguageDefault(_lang); } -const std::string& etranslate::getLanguageDefault() { +const etk::String& etranslate::getLanguageDefault() { return getInstanceTranslation().getLanguageDefault(); } -void etranslate::setLanguage(const std::string& _lang) { +void etranslate::setLanguage(const etk::String& _lang) { getInstanceTranslation().setLanguage(_lang); } -const std::string& etranslate::getLanguage() { +const etk::String& etranslate::getLanguage() { return getInstanceTranslation().getLanguage(); } void etranslate::autoDetectLanguage() { EWOL_VERBOSE("Auto-detect language of system"); - std::string nonameLocalName; - std::string userLocalName; - std::string globalLocalName; + etk::String nonameLocalName; + etk::String userLocalName; + etk::String globalLocalName; try { nonameLocalName = std::locale(std::locale(), new std::ctype).name(); userLocalName = std::locale("").name(); @@ -255,7 +255,7 @@ void etranslate::autoDetectLanguage() { userLocalName = "EN"; globalLocalName = "EN"; } - std::string lang = nonameLocalName; + etk::String lang = nonameLocalName; if ( lang == "*" || lang == "") { lang = userLocalName; @@ -269,7 +269,7 @@ void etranslate::autoDetectLanguage() { || lang.size() < 2) { lang = "EN"; } - lang = std::string(lang.begin(), lang.begin()+2); + lang = etk::String(lang.begin(), lang.begin()+2); lang = etk::toupper(lang); EWOL_INFO("Select Language : '" << lang << "'"); getInstanceTranslation().setLanguage(lang); @@ -280,7 +280,7 @@ void etranslate::autoDetectLanguage() { if (s == nullptr || strlen(s) < 2) { EWOL_INFO("Try to determine system language FAIL ..."); } else { - std::string lang; + etk::String lang; lang += s[0]; lang += s[1]; lang = etk::toupper(lang); @@ -292,7 +292,7 @@ void etranslate::autoDetectLanguage() { #endif } -std::string etranslate::get(const std::string& _instance) { +etk::String etranslate::get(const etk::String& _instance) { return getInstanceTranslation().get(_instance); } diff --git a/ewol/translate.hpp b/ewol/translate.hpp index d7c5c1d6..fcd38926 100644 --- a/ewol/translate.hpp +++ b/ewol/translate.hpp @@ -30,33 +30,33 @@ namespace ewol { * @param[in] _path ETK generic path (DATA:... or /xxx) * @param[in] _major This path is the major path (The last loaded, the one which overload all) */ - void addPath(const std::string& _lib, const std::string& _path, bool _major = false); + void addPath(const etk::String& _lib, const etk::String& _path, bool _major = false); /** * @brief Get the current paths of the library * @param[in] _lib Library name that the path depend * @return Path name. */ - const std::string& getPaths(const std::string& _lib); + const etk::String& getPaths(const etk::String& _lib); /** * @brief Set the default language to load data (the default language might contain all internal data for the basic application) * @param[in] _lang Language to load : ("EN" for english, "FR" for french, "DE" for German, "SP" for spanish ...) */ - void setLanguageDefault(const std::string& _lang); + void setLanguageDefault(const etk::String& _lang); /** * @brief Get the current language selected * @return The 2/3 char defining the language */ - const std::string& getLanguageDefault(); + const etk::String& getLanguageDefault(); /** * @brief Set the language to load data. when no data availlable, we get the default language. * @param[in] _lang Language to load : ("EN" for english, "FR" for french, "DE" for German, "SP" for spanish ...) */ - void setLanguage(const std::string& _lang); + void setLanguage(const etk::String& _lang); /** * @brief Get the current language loaded * @return The 2/3 char defining the language */ - const std::string& getLanguage(); + const etk::String& getLanguage(); /** * @brief Automatic detection of the system language */ @@ -66,7 +66,7 @@ namespace ewol { * @param[in] _instance Text to translate. * @return The tranlated text. */ - std::string get(const std::string& _instance); + etk::String get(const etk::String& _instance); }; }; // Here we define a simple macro to Translate all string simply: diff --git a/ewol/widget/Button.hpp b/ewol/widget/Button.hpp index c8795ad6..769f12b4 100644 --- a/ewol/widget/Button.hpp +++ b/ewol/widget/Button.hpp @@ -41,7 +41,7 @@ namespace ewol { esignal::Signal<> signalLeave; esignal::Signal signalValue; public: // propertie list - eproperty::Value propertyShape; //!< shaper name property + eproperty::Value propertyShape; //!< shaper name property eproperty::Value propertyValue; //!< Current state of the button. eproperty::List propertyLock; //!< Current lock state of the button. eproperty::Value propertyToggleMode; //!< The button is able to toggle. diff --git a/ewol/widget/ButtonColor.cpp b/ewol/widget/ButtonColor.cpp index c70b23cb..b61c81ad 100644 --- a/ewol/widget/ButtonColor.cpp +++ b/ewol/widget/ButtonColor.cpp @@ -44,7 +44,7 @@ ewol::widget::ButtonColor::~ButtonColor() { void ewol::widget::ButtonColor::calculateMinMaxSize() { ewol::Padding padding = m_shaper.getPadding(); - std::string label = propertyValue.getString(); + etk::String label = propertyValue.getString(); vec3 minSize = m_text.calculateSize(label); m_minSize.setX(padding.x()*2 + minSize.x() + 7); m_minSize.setY(padding.y()*2 + minSize.y() ); @@ -69,7 +69,7 @@ void ewol::widget::ButtonColor::onRegenerateDisplay() { ewol::Padding padding = m_shaper.getPadding(); - std::string label = propertyValue.getString(); + etk::String label = propertyValue.getString(); ivec2 localSize = m_minSize; diff --git a/ewol/widget/ButtonColor.hpp b/ewol/widget/ButtonColor.hpp index 67ae5931..2f698ef9 100644 --- a/ewol/widget/ButtonColor.hpp +++ b/ewol/widget/ButtonColor.hpp @@ -25,7 +25,7 @@ namespace ewol { esignal::Signal> signalChange; public: // properties eproperty::Value> propertyValue; //!< Current color. - eproperty::Value propertyShape; //!< Current color. + eproperty::Value propertyShape; //!< Current color. private: ewol::compositing::Shaper m_shaper; //!< Compositing theme. ewol::compositing::Text m_text; //!< Compositing Test display. diff --git a/ewol/widget/CheckBox.hpp b/ewol/widget/CheckBox.hpp index 4efae076..5fb6e577 100644 --- a/ewol/widget/CheckBox.hpp +++ b/ewol/widget/CheckBox.hpp @@ -27,7 +27,7 @@ namespace ewol { esignal::Signal signalValue; public: // propertie list eproperty::Value propertyValue; //!< Current state of the checkbox. - eproperty::Value propertyShape; //!< shape of the widget + eproperty::Value propertyShape; //!< shape of the widget private: ewol::compositing::Shaper m_shaper; //!< Compositing theme. bool m_mouseHover; //!< Flag to know where the mouse is (inside the displayed widget (if not fill)). diff --git a/ewol/widget/ColorBar.cpp b/ewol/widget/ColorBar.cpp index ff334276..c8d0c160 100644 --- a/ewol/widget/ColorBar.cpp +++ b/ewol/widget/ColorBar.cpp @@ -159,8 +159,8 @@ bool ewol::widget::ColorBar::onEventInput(const ewol::event::Input& _event) { vec2 relativePos = relativePosition(_event.getPos()); //EWOL_DEBUG("Event on BT ..."); if (1 == _event.getId()) { - relativePos.setValue( std::avg(0.0f, m_size.x(),relativePos.x()), - std::avg(0.0f, m_size.y(),relativePos.y()) ); + relativePos.setValue( etk::avg(0.0f, m_size.x(),relativePos.x()), + etk::avg(0.0f, m_size.y(),relativePos.y()) ); if( gale::key::status::pressSingle == _event.getStatus() || gale::key::status::move == _event.getStatus()) { // nothing to do ... diff --git a/ewol/widget/Composer.cpp b/ewol/widget/Composer.cpp index e527b249..df83ea3d 100644 --- a/ewol/widget/Composer.cpp +++ b/ewol/widget/Composer.cpp @@ -18,21 +18,21 @@ ewol::widget::Composer::Composer() : // nothing to do ... } -ewol::WidgetShared ewol::widget::composerGenerateFile(const std::string& _fileName, uint64_t _id) { - std::string tmpData = etk::FSNodeReadAllData(_fileName); +ewol::WidgetShared ewol::widget::composerGenerateFile(const etk::String& _fileName, uint64_t _id) { + etk::String tmpData = etk::FSNodeReadAllData(_fileName); return ewol::widget::composerGenerateString(tmpData, _id); } -ewol::WidgetShared ewol::widget::composerGenerateString(const std::string& _data, uint64_t _id) { +ewol::WidgetShared ewol::widget::composerGenerateString(const etk::String& _data, uint64_t _id) { ewol::widget::Manager& widgetManager = ewol::getContext().getWidgetManager(); if (_data == "") { return nullptr; } exml::Document doc; - std::string tmpData = _data; + etk::String tmpData = _data; // replace all elements: if (_id != 0) { - tmpData = etk::replace(tmpData, "{ID}", etk::to_string(_id)); + tmpData = etk::replace(tmpData, "{ID}", etk::toString(_id)); } if (doc.parse(tmpData) == false) { EWOL_ERROR(" can not load file XML string..."); @@ -51,7 +51,7 @@ ewol::WidgetShared ewol::widget::composerGenerateString(const std::string& _data EWOL_ERROR(" (l ?) No node in the XML file/string. {2}"); return nullptr; } - std::string widgetName = pNode.getValue(); + etk::String widgetName = pNode.getValue(); if (widgetManager.exist(widgetName) == false) { EWOL_ERROR("(l " << pNode.getPos() << ") Unknown basic node='" << widgetName << "' not in : [" << widgetManager.list() << "]" ); return nullptr; @@ -72,17 +72,17 @@ ewol::widget::Composer::~Composer() { } -bool ewol::widget::Composer::loadFromFile(const std::string& _fileName, uint64_t _id) { - std::string tmpData = etk::FSNodeReadAllData(_fileName); +bool ewol::widget::Composer::loadFromFile(const etk::String& _fileName, uint64_t _id) { + etk::String tmpData = etk::FSNodeReadAllData(_fileName); return loadFromString(tmpData, _id); } -bool ewol::widget::Composer::loadFromString(const std::string& _composerXmlString, uint64_t _id) { +bool ewol::widget::Composer::loadFromString(const etk::String& _composerXmlString, uint64_t _id) { exml::Document doc; - std::string tmpData = _composerXmlString; + etk::String tmpData = _composerXmlString; // replace all elements: if (_id != 0) { - tmpData = etk::replace(tmpData, "{ID}", etk::to_string(_id)); + tmpData = etk::replace(tmpData, "{ID}", etk::toString(_id)); } if (doc.parse(tmpData) == false) { EWOL_ERROR(" can not load file XML string..."); diff --git a/ewol/widget/Composer.hpp b/ewol/widget/Composer.hpp index 5cdc02db..be47a813 100644 --- a/ewol/widget/Composer.hpp +++ b/ewol/widget/Composer.hpp @@ -21,7 +21,7 @@ namespace ewol { class Composer : public ewol::widget::Container { public: eproperty::Value propertyRemoveIfUnderRemove; //!< Remove the composer if sub element request a remove - eproperty::Value propertySubFile; //!< If loading a sub-file, we must do it here ==> permit to con,figure it in the xml and not have wrong display + eproperty::Value propertySubFile; //!< If loading a sub-file, we must do it here ==> permit to con,figure it in the xml and not have wrong display protected: /** * @brief Constructor @@ -40,7 +40,7 @@ namespace ewol { * @return true == > all done OK * @return false == > some error occured */ - bool loadFromFile(const std::string& _fileName, uint64_t _id=0); + bool loadFromFile(const etk::String& _fileName, uint64_t _id=0); /** * @brief load a composition with a file * @param[in] _composerXmlString xml to parse directly @@ -48,7 +48,7 @@ namespace ewol { * @return true == > all done OK * @return false == > some error occured */ - bool loadFromString(const std::string& _composerXmlString, uint64_t _id=0); + bool loadFromString(const etk::String& _composerXmlString, uint64_t _id=0); private: void requestDestroyFromChild(const ewol::ObjectShared& _child) override; public: @@ -56,7 +56,7 @@ namespace ewol { protected: virtual void onChangePropertySubFile(); }; - ewol::WidgetShared composerGenerateString(const std::string& _data = "", uint64_t _id=0); - ewol::WidgetShared composerGenerateFile(const std::string& _data = "", uint64_t _id=0); + ewol::WidgetShared composerGenerateString(const etk::String& _data = "", uint64_t _id=0); + ewol::WidgetShared composerGenerateFile(const etk::String& _data = "", uint64_t _id=0); }; }; diff --git a/ewol/widget/Container.cpp b/ewol/widget/Container.cpp index 2e1fa762..fd5bd647 100644 --- a/ewol/widget/Container.cpp +++ b/ewol/widget/Container.cpp @@ -67,7 +67,7 @@ void ewol::widget::Container::subWidgetUnLink() { m_subWidget.reset(); } -ewol::ObjectShared ewol::widget::Container::getSubObjectNamed(const std::string& _objectName) { +ewol::ObjectShared ewol::widget::Container::getSubObjectNamed(const etk::String& _objectName) { ewol::ObjectShared tmpObject = ewol::Widget::getSubObjectNamed(_objectName); if (tmpObject != nullptr) { return tmpObject; @@ -153,7 +153,7 @@ bool ewol::widget::Container::loadXML(const exml::Element& _node) { // trash here all that is not element continue; } - std::string widgetName = pNode.getValue(); + etk::String widgetName = pNode.getValue(); EWOL_VERBOSE("[" << getId() << "] t=" << getObjectType() << " Load node name : '" << widgetName << "'"); if (getWidgetManager().exist(widgetName) == false) { EWOL_ERROR("(l " << pNode.getPos() << ") Unknown basic node='" << widgetName << "' not in : [" << getWidgetManager().list() << "]" ); diff --git a/ewol/widget/Container.hpp b/ewol/widget/Container.hpp index f4fae973..12aae486 100644 --- a/ewol/widget/Container.hpp +++ b/ewol/widget/Container.hpp @@ -63,7 +63,7 @@ namespace ewol { void onChangeSize() override; void calculateMinMaxSize() override; ewol::WidgetShared getWidgetAtPos(const vec2& _pos) override; - ewol::ObjectShared getSubObjectNamed(const std::string& _objectName) override; + ewol::ObjectShared getSubObjectNamed(const etk::String& _objectName) override; bool loadXML(const exml::Element& _node) override; void setOffset(const vec2& _newVal) override; void requestDestroyFromChild(const ewol::ObjectShared& _child) override; diff --git a/ewol/widget/Container2.cpp b/ewol/widget/Container2.cpp index 3c2c01fa..ce153c29 100644 --- a/ewol/widget/Container2.cpp +++ b/ewol/widget/Container2.cpp @@ -72,7 +72,7 @@ void ewol::widget::Container2::subWidgetUnLink(int32_t _idWidget) { m_subWidget[_idWidget].reset(); } -ewol::ObjectShared ewol::widget::Container2::getSubObjectNamed(const std::string& _widgetName) { +ewol::ObjectShared ewol::widget::Container2::getSubObjectNamed(const etk::String& _widgetName) { ewol::ObjectShared tmpObject = ewol::Widget::getSubObjectNamed(_widgetName); if (tmpObject != nullptr) { return tmpObject; @@ -186,7 +186,7 @@ bool ewol::widget::Container2::loadXML(const exml::Element& _node) { // trash here all that is not element continue; } - std::string widgetName = pNode.getValue(); + etk::String widgetName = pNode.getValue(); if (getWidgetManager().exist(widgetName) == false) { EWOL_ERROR("(l " << pNode.getPos() << ") Unknown basic node='" << widgetName << "' not in: [" << getWidgetManager().list() << "]" ); continue; diff --git a/ewol/widget/Container2.hpp b/ewol/widget/Container2.hpp index 6defba40..1862bfd4 100644 --- a/ewol/widget/Container2.hpp +++ b/ewol/widget/Container2.hpp @@ -164,7 +164,7 @@ namespace ewol { void calculateMinMaxSize() override { calculateMinMaxSizePadded(); } - ewol::ObjectShared getSubObjectNamed(const std::string& _objectName) override; + ewol::ObjectShared getSubObjectNamed(const etk::String& _objectName) override; bool loadXML(const exml::Element& _node) override; void setOffset(const vec2& _newVal) override; void requestDestroyFromChild(const ewol::ObjectShared& _child) override; diff --git a/ewol/widget/ContainerN.cpp b/ewol/widget/ContainerN.cpp index 239a1147..6e0a1075 100644 --- a/ewol/widget/ContainerN.cpp +++ b/ewol/widget/ContainerN.cpp @@ -74,7 +74,7 @@ int32_t ewol::widget::ContainerN::subWidgetAdd(ewol::WidgetShared _newWidget) { return -1; } _newWidget->setParent(sharedFromThis()); - m_subWidget.push_back(_newWidget); + m_subWidget.pushBack(_newWidget); markToRedraw(); requestUpdateSize(); // added at the last eelement : @@ -148,7 +148,7 @@ void ewol::widget::ContainerN::subWidgetRemoveAllDelayed() { subWidgetRemoveAll(); } -ewol::ObjectShared ewol::widget::ContainerN::getSubObjectNamed(const std::string& _objectName) { +ewol::ObjectShared ewol::widget::ContainerN::getSubObjectNamed(const etk::String& _objectName) { ewol::ObjectShared tmpObject = ewol::Widget::getSubObjectNamed(_objectName); if (tmpObject != nullptr) { return tmpObject; @@ -209,8 +209,8 @@ void ewol::widget::ContainerN::calculateMinMaxSize() { m_subExpend.setY(true); } vec2 tmpSize = it->getCalculateMinSize(); - m_minSize.setValue( std::max(tmpSize.x(), m_minSize.x()), - std::max(tmpSize.y(), m_minSize.y()) ); + m_minSize.setValue( etk::max(tmpSize.x(), m_minSize.x()), + etk::max(tmpSize.y(), m_minSize.y()) ); } } //EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} Result min size : " << m_minSize); @@ -257,7 +257,7 @@ bool ewol::widget::ContainerN::loadXML(const exml::Element& _node) { // remove previous element : subWidgetRemoveAll(); - std::string tmpAttributeValue = _node.attributes["lock"]; + etk::String tmpAttributeValue = _node.attributes["lock"]; if (tmpAttributeValue.size()!=0) { propertyLockExpand.set(tmpAttributeValue); } @@ -273,7 +273,7 @@ bool ewol::widget::ContainerN::loadXML(const exml::Element& _node) { // trash here all that is not element continue; } - std::string widgetName = pNode.getValue(); + etk::String widgetName = pNode.getValue(); EWOL_VERBOSE(" t=" << getObjectType() << " Load node name : '" << widgetName << "'"); if (getWidgetManager().exist(widgetName) == false) { EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} (l " << pNode.getPos() << ") Unknown basic node='" << widgetName << "' not in : [" << getWidgetManager().list() << "]" ); diff --git a/ewol/widget/ContainerN.hpp b/ewol/widget/ContainerN.hpp index 64a4b40e..3e91a780 100644 --- a/ewol/widget/ContainerN.hpp +++ b/ewol/widget/ContainerN.hpp @@ -94,7 +94,7 @@ namespace ewol { void onChangeSize() override; void calculateMinMaxSize() override; ewol::WidgetShared getWidgetAtPos(const vec2& _pos) override; - ewol::ObjectShared getSubObjectNamed(const std::string& _objectName) override; + ewol::ObjectShared getSubObjectNamed(const etk::String& _objectName) override; bool loadXML(const exml::Element& _node) override; void setOffset(const vec2& _newVal) override; void requestDestroyFromChild(const ewol::ObjectShared& _child) override; diff --git a/ewol/widget/ContextMenu.cpp b/ewol/widget/ContextMenu.cpp index 17c7312d..03252916 100644 --- a/ewol/widget/ContextMenu.cpp +++ b/ewol/widget/ContextMenu.cpp @@ -70,8 +70,8 @@ void ewol::widget::ContextMenu::onChangeSize() { } int32_t minWidth = 100; int32_t maxWidth = 300; - subWidgetSize.setX((int32_t)std::max(minWidth, (int32_t)subWidgetSize.x())); - subWidgetSize.setX((int32_t)std::min(maxWidth, (int32_t)subWidgetSize.x())); + subWidgetSize.setX((int32_t)etk::max(minWidth, (int32_t)subWidgetSize.x())); + subWidgetSize.setX((int32_t)etk::min(maxWidth, (int32_t)subWidgetSize.x())); subWidgetSize.setY((int32_t)subWidgetSize.y()); // set config to the Sub-widget @@ -92,9 +92,9 @@ void ewol::widget::ContextMenu::onChangeSize() { break; } // set the widget position at the border of the screen - subWidgetOrigin.setX( (int32_t)( std::max(0, (int32_t)(subWidgetOrigin.x()-padding.x())) + subWidgetOrigin.setX( (int32_t)( etk::max(0, (int32_t)(subWidgetOrigin.x()-padding.x())) + padding.x()) ); - subWidgetOrigin.setY( (int32_t)( std::max(0, (int32_t)(subWidgetOrigin.y()-padding.y())) + subWidgetOrigin.setY( (int32_t)( etk::max(0, (int32_t)(subWidgetOrigin.y()-padding.y())) + padding.y()) ); switch (propertyArrawBorder.get()) { default: diff --git a/ewol/widget/ContextMenu.hpp b/ewol/widget/ContextMenu.hpp index 49ff16bd..23faaec5 100644 --- a/ewol/widget/ContextMenu.hpp +++ b/ewol/widget/ContextMenu.hpp @@ -31,7 +31,7 @@ namespace ewol { markNone }; public: // properties - eproperty::Value propertyShape; //!< shape of the widget. + eproperty::Value propertyShape; //!< shape of the widget. eproperty::Value propertyArrowPos; eproperty::List propertyArrawBorder; protected: diff --git a/ewol/widget/Entry.cpp b/ewol/widget/Entry.cpp index 66575d0a..33877d67 100644 --- a/ewol/widget/Entry.cpp +++ b/ewol/widget/Entry.cpp @@ -78,7 +78,7 @@ ewol::widget::Entry::~Entry() { } -void ewol::widget::Entry::onCallbackShortCut(const std::string& _value) { +void ewol::widget::Entry::onCallbackShortCut(const etk::String& _value) { if (_value == "clean") { onCallbackEntryClean(); } else if (_value == "cut") { @@ -161,7 +161,7 @@ void ewol::widget::Entry::onRegenerateDisplay() { } else { m_text.setCursorPos(m_displayCursorPos); } - std::string valueToDisplay = *propertyValue; + etk::String valueToDisplay = *propertyValue; if (*propertyPassword == true) { for (auto &it: valueToDisplay) { it = '*'; @@ -188,13 +188,13 @@ void ewol::widget::Entry::updateCursorPosition(const vec2& _pos, bool _selection vec2 relPos = relativePosition(_pos); relPos.setX(relPos.x()-m_displayStartPosition - padding.xLeft()); // try to find the new cursor position : - std::string tmpDisplay = std::string(propertyValue, 0, m_displayStartPosition); + etk::String tmpDisplay = etk::String(propertyValue, 0, m_displayStartPosition); int32_t displayHidenSize = m_text.calculateSize(tmpDisplay).x(); //EWOL_DEBUG("hidenSize : " << displayHidenSize); int32_t newCursorPosition = -1; int32_t tmpTextOriginX = padding.xLeft(); for (size_t iii=0; iiisize(); iii++) { - tmpDisplay = std::string(propertyValue, 0, iii); + tmpDisplay = etk::String(propertyValue, 0, iii); int32_t tmpWidth = m_text.calculateSize(tmpDisplay).x() - displayHidenSize; if (tmpWidth >= relPos.x()-tmpTextOriginX) { newCursorPosition = iii; @@ -250,7 +250,7 @@ void ewol::widget::Entry::copySelectionToClipBoard(enum gale::context::clipBoard pos1 = m_displayCursorPos; } // Copy - std::string tmpData = std::string(propertyValue, pos1, pos2); + etk::String tmpData = etk::String(propertyValue, pos1, pos2); gale::context::clipBoard::set(_clipboardID, tmpData); } @@ -362,7 +362,7 @@ bool ewol::widget::Entry::onEventEntry(const ewol::event::Entry& _event) { // SUPPR : if (propertyValue->size() > 0 && m_displayCursorPos < (int64_t)propertyValue->size()) { propertyValue.getDirect().erase(m_displayCursorPos, 1); - m_displayCursorPos = std::max(m_displayCursorPos, 0); + m_displayCursorPos = etk::max(m_displayCursorPos, 0); m_displayCursorPosSelection = m_displayCursorPos; } } else if (_event.getChar() == 0x08) { @@ -370,14 +370,14 @@ bool ewol::widget::Entry::onEventEntry(const ewol::event::Entry& _event) { if (propertyValue->size() > 0 && m_displayCursorPos != 0) { propertyValue.getDirect().erase(m_displayCursorPos-1, 1); m_displayCursorPos--; - m_displayCursorPos = std::max(m_displayCursorPos, 0); + m_displayCursorPos = etk::max(m_displayCursorPos, 0); m_displayCursorPosSelection = m_displayCursorPos; } } else if(_event.getChar() >= 20) { if ((int64_t)propertyValue->size() > propertyMaxCharacter) { EWOL_INFO("Reject data for entry : '" << _event.getChar() << "'"); } else { - std::string newData = propertyValue; + etk::String newData = propertyValue; newData.insert(newData.begin()+m_displayCursorPos, _event.getChar()); setInternalValue(newData); if (propertyValue.get() == newData) { @@ -409,7 +409,7 @@ bool ewol::widget::Entry::onEventEntry(const ewol::event::Entry& _event) { default: return false; } - m_displayCursorPos = std::avg(0, m_displayCursorPos, (int32_t)propertyValue->size()); + m_displayCursorPos = etk::avg(0, m_displayCursorPos, (int32_t)propertyValue->size()); m_displayCursorPosSelection = m_displayCursorPos; markToRedraw(); return true; @@ -418,8 +418,8 @@ bool ewol::widget::Entry::onEventEntry(const ewol::event::Entry& _event) { return false; } -void ewol::widget::Entry::setInternalValue(const std::string& _newData) { - std::string previous = propertyValue; +void ewol::widget::Entry::setInternalValue(const etk::String& _newData) { + etk::String previous = propertyValue; // check the RegExp : if (_newData.size()>0) { std::smatch resultMatch; @@ -445,10 +445,10 @@ void ewol::widget::Entry::onEventClipboard(enum gale::context::clipBoard::clipbo // remove curent selected data ... removeSelected(); // get current selection / Copy : - std::string tmpData = get(_clipboardID); + etk::String tmpData = get(_clipboardID); // add it on the current display : if (tmpData.size() != 0) { - std::string newData = propertyValue; + etk::String newData = propertyValue; newData.insert(m_displayCursorPos, &tmpData[0]); setInternalValue(newData); if (propertyValue.get() == newData) { @@ -518,17 +518,17 @@ void ewol::widget::Entry::updateTextPosition() { m_displayStartPosition = 0; } else { // all can not be set : - std::string tmpDisplay = std::string(propertyValue, 0, m_displayCursorPos); + etk::String tmpDisplay = etk::String(propertyValue, 0, m_displayCursorPos); int32_t pixelCursorPos = m_text.calculateSize(tmpDisplay).x(); // check if the Cussor is visible at 10px nearest the border : int32_t tmp1 = pixelCursorPos+m_displayStartPosition; EWOL_DEBUG("cursorPos=" << pixelCursorPos << "px maxSize=" << tmpUserSize << "px tmp1=" << tmp1); if (tmp1<10) { // set the cursor on le left - m_displayStartPosition = std::min(-pixelCursorPos+10, 0); + m_displayStartPosition = etk::min(-pixelCursorPos+10, 0); } else if (tmp1>tmpUserSize-10) { // set the cursor of the Right - m_displayStartPosition = std::min(-pixelCursorPos + tmpUserSize - 10, 0); + m_displayStartPosition = etk::min(-pixelCursorPos + tmpUserSize - 10, 0); } // else : the cursor is inside the display //m_displayStartPosition = -totalWidth + tmpUserSize; @@ -576,10 +576,10 @@ void ewol::widget::Entry::onChangePropertyShaper() { } void ewol::widget::Entry::onChangePropertyValue() { - std::string newData = propertyValue.get(); + etk::String newData = propertyValue.get(); if ((int64_t)newData.size() > propertyMaxCharacter) { - newData = std::string(newData, 0, propertyMaxCharacter); - EWOL_DEBUG("Limit entry set of data... " << std::string(newData, propertyMaxCharacter)); + newData = etk::String(newData, 0, propertyMaxCharacter); + EWOL_DEBUG("Limit entry set of data... " << etk::String(newData, propertyMaxCharacter)); } // set the value with the check of the RegExp ... setInternalValue(newData); diff --git a/ewol/widget/Entry.hpp b/ewol/widget/Entry.hpp index 7ea88c93..0f54b161 100644 --- a/ewol/widget/Entry.hpp +++ b/ewol/widget/Entry.hpp @@ -34,15 +34,15 @@ namespace ewol { class Entry : public ewol::Widget { public: // Event list esignal::Signal<> signalClick; //!< bang on click the entry box - esignal::Signal signalEnter; //!< Enter key is pressed - esignal::Signal signalModify; //!< data change + esignal::Signal signalEnter; //!< Enter key is pressed + esignal::Signal signalModify; //!< data change public: // propertie list eproperty::Value propertyPassword; //!< Disable display of the content of the entry - eproperty::Value propertyShape; - eproperty::Value propertyValue; //!< string that must be displayed + eproperty::Value propertyShape; + eproperty::Value propertyValue; //!< string that must be displayed eproperty::Range propertyMaxCharacter; //!< number max of xharacter in the list - eproperty::Value propertyRegex; //!< regular expression value - eproperty::Value propertyTextWhenNothing; //!< Text to display when nothing in in the entry (decorated text...) + eproperty::Value propertyRegex; //!< regular expression value + eproperty::Value propertyTextWhenNothing; //!< Text to display when nothing in in the entry (decorated text...) private: ewol::compositing::Shaper m_shaper; int32_t m_colorIdTextFg; //!< color property of the text foreground @@ -68,7 +68,7 @@ namespace ewol { * @brief internal check the value with RegExp checking * @param[in] _newData The new string to display */ - void setInternalValue(const std::string& _newData); + void setInternalValue(const etk::String& _newData); private: std::regex m_regex; //!< regular expression to check content private: @@ -123,7 +123,7 @@ namespace ewol { */ void periodicCall(const ewol::event::Time& _event); private: // callback functions - void onCallbackShortCut(const std::string& _value); + void onCallbackShortCut(const etk::String& _value); void onCallbackEntryClean(); void onCallbackCut(); void onCallbackCopy(); diff --git a/ewol/widget/Gird.cpp b/ewol/widget/Gird.cpp index c02e3a37..7f512b01 100644 --- a/ewol/widget/Gird.cpp +++ b/ewol/widget/Gird.cpp @@ -96,10 +96,10 @@ void ewol::widget::Gird::calculateMinMaxSize() { vec2 tmpSize = m_subWidget[iii].widget->getCalculateMinSize(); EWOL_DEBUG(" [" << iii << "] subWidgetMinSize=" << tmpSize); // for all we get the max size : - m_uniformSizeRow = std::max((int32_t)tmpSize.y(), m_uniformSizeRow); + m_uniformSizeRow = etk::max((int32_t)tmpSize.y(), m_uniformSizeRow); // for the colomn size : We set the autamatic value in negative : if (m_sizeCol[m_subWidget[iii].col] <= 0) { - m_sizeCol[m_subWidget[iii].col] = std::min(m_sizeCol[m_subWidget[iii].col], (int32_t)-tmpSize.x() ); + m_sizeCol[m_subWidget[iii].col] = etk::min(m_sizeCol[m_subWidget[iii].col], (int32_t)-tmpSize.x() ); } } } @@ -145,7 +145,7 @@ void ewol::widget::Gird::setColNumber(int32_t _colNumber) { } else { // just add the col size: for (int32_t iii=m_sizeCol.size()-1; iii<_colNumber-1 ; iii++) { - m_sizeCol.push_back(0); + m_sizeCol.pushBack(0); } } } @@ -224,7 +224,7 @@ void ewol::widget::Gird::subWidgetAdd(int32_t _colId, int32_t _rowId, ewol::Widg } } // not find == > just adding it ... - m_subWidget.push_back(prop); + m_subWidget.pushBack(prop); } void ewol::widget::Gird::subWidgetRemove(ewol::WidgetShared _newWidget) { diff --git a/ewol/widget/Gird.hpp b/ewol/widget/Gird.hpp index d92c65f3..aa07daf1 100644 --- a/ewol/widget/Gird.hpp +++ b/ewol/widget/Gird.hpp @@ -6,7 +6,7 @@ #pragma once #include -#include +#include #include #include #include @@ -29,8 +29,8 @@ namespace ewol { }; int32_t m_sizeRow; //!< size of all lines (row) (if set (otherwise 0)) == > we have a only one size ==> multiple size will have no use ... int32_t m_uniformSizeRow; - std::vector m_sizeCol; //!< size of all colomn (if set (otherwise 0)) - std::vector m_subWidget; //!< all sub widget are contained in this element + etk::Vector m_sizeCol; //!< size of all colomn (if set (otherwise 0)) + etk::Vector m_subWidget; //!< all sub widget are contained in this element ewol::WidgetShared m_tmpWidget; //!< use when replace a widget ... bool m_gavityButtom; protected: diff --git a/ewol/widget/Image.cpp b/ewol/widget/Image.cpp index 9a074685..de39376e 100644 --- a/ewol/widget/Image.cpp +++ b/ewol/widget/Image.cpp @@ -41,7 +41,7 @@ void ewol::widget::Image::init() { } } -void ewol::widget::Image::set(const std::string& _file, const gale::Dimension& _border) { +void ewol::widget::Image::set(const etk::String& _file, const gale::Dimension& _border) { EWOL_VERBOSE("Set Image : " << _file << " border=" << _border); propertyBorder.set(_border); propertySource.set(_file); @@ -158,7 +158,7 @@ bool ewol::widget::Image::loadXML(const exml::Element& _node) { ewol::Widget::loadXML(_node); // get internal data : - std::string tmpAttributeValue = _node.attributes["ratio"]; + etk::String tmpAttributeValue = _node.attributes["ratio"]; if (tmpAttributeValue.size() != 0) { if (etk::compare_no_case(tmpAttributeValue, "true") == true) { propertyKeepRatio.setDirect(true); diff --git a/ewol/widget/Image.hpp b/ewol/widget/Image.hpp index ee7e7a34..58fecbda 100644 --- a/ewol/widget/Image.hpp +++ b/ewol/widget/Image.hpp @@ -25,7 +25,7 @@ namespace ewol { public: // signals esignal::Signal<> signalPressed; public: // properties - eproperty::Value propertySource; //!< file name of the image. + eproperty::Value propertySource; //!< file name of the image. eproperty::Value propertyBorder; //!< border to add at the image. eproperty::Value propertyImageSize; //!< border to add at the image. eproperty::Value propertyKeepRatio; //!< keep the image ratio between width and hight @@ -55,7 +55,7 @@ namespace ewol { * @param[in] _file Filaneme of the new image * @param[in] _border New border size to set */ - void set(const std::string& _file, const gale::Dimension& _border); + void set(const etk::String& _file, const gale::Dimension& _border); protected: vec2 m_imageRenderSize; //!< size of the image when we render it protected: diff --git a/ewol/widget/Joystick.cpp b/ewol/widget/Joystick.cpp index a6771930..64824642 100644 --- a/ewol/widget/Joystick.cpp +++ b/ewol/widget/Joystick.cpp @@ -11,8 +11,8 @@ #include static bool l_displayBackground(true); -static std::string l_background(""); -static std::string l_foreground(""); +static etk::String l_background(""); +static etk::String l_foreground(""); static float l_ratio(1.0/7.0); ewol::widget::Joystick::Joystick() : @@ -129,7 +129,7 @@ bool ewol::widget::Joystick::onEventInput(const ewol::event::Input& _event) { if(gale::key::status::down == typeEvent) { signalEnable.emit(); } else { - std::string tmp = std::string("distance=") + std::string(m_distance) + std::string("angle=") + std::string(m_angle+M_PI/2); + etk::String tmp = etk::String("distance=") + etk::String(m_distance) + std::string("angle=") + std::string(m_angle+M_PI/2); signalMove.emit(m_angle+M_PI/2); } //teta += M_PI/2; @@ -165,7 +165,7 @@ void ewol::widget::Joystick::ratio(float newRatio) { } -void ewol::widget::Joystick::background(std::string imageNameInData, bool display) { +void ewol::widget::Joystick::background(etk::String imageNameInData, bool display) { // TODO : check if it existed m_background = imageNameInData; m_displayBackground = display; @@ -173,7 +173,7 @@ void ewol::widget::Joystick::background(std::string imageNameInData, bool displa } -void ewol::widget::Joystick::foreground(std::string imageNameInData) { +void ewol::widget::Joystick::foreground(etk::String imageNameInData) { // TODO : check if it existed m_foreground = imageNameInData; EWOL_INFO("Set default Joystick Foreground at " << m_foreground); diff --git a/ewol/widget/Joystick.hpp b/ewol/widget/Joystick.hpp index 848e0e39..bba67c5d 100644 --- a/ewol/widget/Joystick.hpp +++ b/ewol/widget/Joystick.hpp @@ -43,8 +43,8 @@ namespace ewol { private: // generic property of the joystick: bool m_displayBackground; - std::string m_background; - std::string m_foreground; + etk::String m_background; + etk::String m_foreground; float m_ratio; protected: Joystick(); @@ -68,12 +68,12 @@ namespace ewol { * @param[in] _imageNameInData the new rbackground that might be set * @param[in] _display */ - void background(std::string _imageNameInData, bool _display=true); + void background(etk::String _imageNameInData, bool _display=true); /** * @brief set the Foreground of the widget joystick * @param[in] _imageNameInData the new Foreground that might be set */ - void foreground(std::string _imageNameInData); + void foreground(etk::String _imageNameInData); /** * @brief get the property of the joystick * @param[out] _distance distance to the center diff --git a/ewol/widget/Label.cpp b/ewol/widget/Label.cpp index c0c0acbc..ebe62be2 100644 --- a/ewol/widget/Label.cpp +++ b/ewol/widget/Label.cpp @@ -57,8 +57,8 @@ void ewol::widget::Label::calculateMinMaxSize() { vec3 minSize = m_text.calculateSizeDecorated(m_value); //EWOL_DEBUG("[" << getId() << "] {" << getObjectType() << "} minSize : " << minSize); - m_minSize.setX(std::avg(tmpMin.x(), 4 + minSize.x(), tmpMax.x())); - m_minSize.setY(std::avg(tmpMin.y(), 4 + minSize.y(), tmpMax.y())); + m_minSize.setX(etk::avg(tmpMin.x(), 4 + minSize.x(), tmpMax.x())); + m_minSize.setY(etk::avg(tmpMin.y(), 4 + minSize.y(), tmpMax.y())); EWOL_VERBOSE("[" << getId() << "] {" << getObjectType() << "} Result min size : " << tmpMin << " < " << m_minSize << " < " << tmpMax); } @@ -77,8 +77,8 @@ void ewol::widget::Label::onRegenerateDisplay() { // to know the size of one line : vec3 minSize = m_text.calculateSize(char32_t('A')); - //minSize.setX(std::max(minSize.x(), m_minSize.x())); - //minSize.setY(std::max(minSize.y(), m_minSize.y())); + //minSize.setX(etk::max(minSize.x(), m_minSize.x())); + //minSize.setY(etk::max(minSize.y(), m_minSize.y())); if (tmpMax.x() <= 999999) { m_text.setTextAlignement(0, tmpMax.x()-2*paddingSize, ewol::compositing::alignLeft); } @@ -149,9 +149,9 @@ bool ewol::widget::Label::loadXML(const exml::Element& _node) { void ewol::widget::Label::onChangePropertyValue() { if (*propertyAutoTranslate == true) { - m_value = etk::to_u32string(etranslate::get(*propertyValue)); + m_value = etk::toUString(etranslate::get(*propertyValue)); } else { - m_value = etk::to_u32string(*propertyValue); + m_value = etk::toUString(*propertyValue); } markToRedraw(); requestUpdateSize(); diff --git a/ewol/widget/Label.hpp b/ewol/widget/Label.hpp index fdaef3a6..35129b35 100644 --- a/ewol/widget/Label.hpp +++ b/ewol/widget/Label.hpp @@ -26,10 +26,10 @@ namespace ewol { esignal::Signal<> signalPressed; public: // properties eproperty::Value propertyAutoTranslate; //!< if at true the data is translate automaticaly translate. - eproperty::Value propertyValue; //!< decorated text to display. + eproperty::Value propertyValue; //!< decorated text to display. private: ewol::compositing::Text m_text; //!< Compositing text element. - std::u32string m_value; + etk::UString m_value; ememory::SharedPtr m_colorProperty; //!< theme color property int32_t m_colorDefaultFgText; //!< Default color of the text int32_t m_colorDefaultBgText; //!< Default Background color of the text diff --git a/ewol/widget/List.cpp b/ewol/widget/List.cpp index e232af61..36854e78 100644 --- a/ewol/widget/List.cpp +++ b/ewol/widget/List.cpp @@ -73,7 +73,7 @@ void ewol::widget::List::addOObject(ewol::Compositing* _newObject, int32_t _pos) return; } if (_pos < 0 || (size_t)_pos >= m_listOObject.size() ) { - m_listOObject.push_back(_newObject); + m_listOObject.pushBack(_newObject); } else { m_listOObject.insert(m_listOObject.begin()+_pos, _newObject); } @@ -123,7 +123,7 @@ void ewol::widget::List::onRegenerateDisplay() { (minHeight + 2*m_paddingSizeY) * nbRaw ); - std::vector listSizeColomn; + etk::Vector listSizeColomn; ewol::compositing::Drawing * BGOObjects = new ewol::compositing::Drawing(); etk::Color<> basicBG = getBasicBG(); @@ -154,7 +154,7 @@ void ewol::widget::List::onRegenerateDisplay() { int32_t displayPositionX = 0; ivec2 tmpRegister(startRaw, displayPositionY); // add the default position raw : - m_lineSize.push_back(tmpRegister); + m_lineSize.pushBack(tmpRegister); for (size_t jjj=0; jjj= 0; iii++) { m_nbVisibleRaw++; - std::string myTextToWrite; + etk::String myTextToWrite; etk::Color<> fg; etk::Color<> bg; getElement(jjj, iii, myTextToWrite, fg, bg); @@ -179,7 +179,7 @@ void ewol::widget::List::onRegenerateDisplay() { // get the maximum size of the colomn : vec3 textSize = tmpText->calculateSize(myTextToWrite); - sizeColom = std::max(sizeColom, (int32_t)textSize.x()); + sizeColom = etk::max(sizeColom, (int32_t)textSize.x()); tmpText->setColor(fg); tmpText->setPos(vec3(tmpOriginX + displayPositionX, displayPositionY, 0) ); @@ -191,14 +191,14 @@ void ewol::widget::List::onRegenerateDisplay() { // add the raw position to remember it ... tmpRegister.setX(tmpRegister.x()+1); tmpRegister.setY(displayPositionY); - m_lineSize.push_back(tmpRegister); + m_lineSize.pushBack(tmpRegister); //EWOL_DEBUG("List indexation:" << tmpRegister); } } displayPositionX += sizeColom; tmpOriginX += m_paddingSizeX*2*2; } - //m_lineSize.push_back(tmpOriginY); + //m_lineSize.pushBack(tmpOriginY); addOObject(BGOObjects, 0); // call the herited class... diff --git a/ewol/widget/List.hpp b/ewol/widget/List.hpp index 4ffd0cfe..7525614a 100644 --- a/ewol/widget/List.hpp +++ b/ewol/widget/List.hpp @@ -25,11 +25,11 @@ namespace ewol { public: virtual ~List(); void calculateMinMaxSize() override; - void setLabel(std::string _newLabel); + void setLabel(etk::String _newLabel); // drawing capabilities .... private: - std::vector m_listOObject; //!< generic element to display... - std::vector m_lineSize; + etk::Vector m_listOObject; //!< generic element to display... + etk::Vector m_lineSize; public: void addOObject(ewol::Compositing* _newObject, int32_t _pos=-1); void clearOObjectList(); @@ -48,14 +48,14 @@ namespace ewol { virtual uint32_t getNuberOfColomn() { return 1; }; - virtual bool getTitle(int32_t _colomn, std::string& _myTitle, etk::Color<> &_fg, etk::Color<> &_bg) { + virtual bool getTitle(int32_t _colomn, etk::String& _myTitle, etk::Color<> &_fg, etk::Color<> &_bg) { _myTitle = ""; return false; }; virtual uint32_t getNuberOfRaw() { return 0; }; - virtual bool getElement(int32_t _colomn, int32_t _raw, std::string &_myTextToWrite, etk::Color<> &_fg, etk::Color<> &_bg) { + virtual bool getElement(int32_t _colomn, int32_t _raw, etk::String &_myTextToWrite, etk::Color<> &_fg, etk::Color<> &_bg) { _myTextToWrite = ""; _bg = etk::Color<>(0xFF, 0xFF, 0xFF, 0xFF); _fg = etk::Color<>(0x00, 0x00, 0x00, 0xFF); diff --git a/ewol/widget/ListFileSystem.cpp b/ewol/widget/ListFileSystem.cpp index 6e6830e7..1e109da2 100644 --- a/ewol/widget/ListFileSystem.cpp +++ b/ewol/widget/ListFileSystem.cpp @@ -82,8 +82,8 @@ void ewol::widget::ListFileSystem::regenerateView() { markToRedraw(); } -std::string ewol::widget::ListFileSystem::getSelect() const { - std::string tmpVal = ""; +etk::String ewol::widget::ListFileSystem::getSelect() const { + etk::String tmpVal = ""; if (m_selectedLine >= 0) { if (m_list[m_selectedLine] != nullptr) { tmpVal = m_list[m_selectedLine]->getNameFile(); @@ -93,7 +93,7 @@ std::string ewol::widget::ListFileSystem::getSelect() const { } // select the specific file -void ewol::widget::ListFileSystem::setSelect(const std::string& _data) { +void ewol::widget::ListFileSystem::setSelect(const etk::String& _data) { // remove selected line m_selectedLine = -1; // search the coresponding file : @@ -113,7 +113,7 @@ uint32_t ewol::widget::ListFileSystem::getNuberOfColomn() { return 1; } -bool ewol::widget::ListFileSystem::getTitle(int32_t _colomn, std::string &_myTitle, etk::Color<>& _fg, etk::Color<>& _bg) { +bool ewol::widget::ListFileSystem::getTitle(int32_t _colomn, etk::String &_myTitle, etk::Color<>& _fg, etk::Color<>& _bg) { _myTitle = "title"; return true; } @@ -130,7 +130,7 @@ uint32_t ewol::widget::ListFileSystem::getNuberOfRaw() { return m_list.size() + offset; } -bool ewol::widget::ListFileSystem::getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) { +bool ewol::widget::ListFileSystem::getElement(int32_t _colomn, int32_t _raw, etk::String& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) { int32_t offset = 0; if (*propertyShowFolder == true) { if (*propertyPath == "/") { diff --git a/ewol/widget/ListFileSystem.hpp b/ewol/widget/ListFileSystem.hpp index 10c7993e..e5dc56e4 100644 --- a/ewol/widget/ListFileSystem.hpp +++ b/ewol/widget/ListFileSystem.hpp @@ -20,17 +20,17 @@ namespace ewol { */ class ListFileSystem : public ewol::widget::List { public: // signals - esignal::Signal signalFileSelect; //!< @event "file-select" Generated when a file is selected. - esignal::Signal signalFileValidate; //!< @event "file-validate" Generate when the user validate (return) or double click on the element - esignal::Signal signalFolderSelect; - esignal::Signal signalFolderValidate; + esignal::Signal signalFileSelect; //!< @event "file-select" Generated when a file is selected. + esignal::Signal signalFileValidate; //!< @event "file-validate" Generate when the user validate (return) or double click on the element + esignal::Signal signalFolderSelect; + esignal::Signal signalFolderValidate; public: // properties - eproperty::Value propertyPath; //!< Current folder that display point on. - eproperty::Value propertyFile; //!< current selected file + eproperty::Value propertyPath; //!< Current folder that display point on. + eproperty::Value propertyFile; //!< current selected file eproperty::Value propertyShowFile; //!< Show files elements eproperty::Value propertyShowFolder; //!< Display the folders elements eproperty::Value propertyShowHidden; //!< Display hidden elements - eproperty::Value propertyFilter; //!< Regular expression to filter the view (for temporary file:".*(~|.bck|.pyc)\e") + eproperty::Value propertyFilter; //!< Regular expression to filter the view (for temporary file:".*(~|.bck|.pyc)\e") protected: ListFileSystem(); public: @@ -45,13 +45,13 @@ namespace ewol { protected: etk::Color<> getBasicBG() override; uint32_t getNuberOfColomn() override; - bool getTitle(int32_t _colomn, std::string& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg) override; + bool getTitle(int32_t _colomn, etk::String& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg) override; uint32_t getNuberOfRaw() override; - bool getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) override; + bool getElement(int32_t _colomn, int32_t _raw, etk::String& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) override; bool onItemEvent(int32_t _IdInput, enum gale::key::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y) override; protected: // TODO: use shred_ptr - std::vector m_list; //!< List of all element in the path. (they are filtered) + etk::Vector m_list; //!< List of all element in the path. (they are filtered) /** * @brief Clean the list of element. */ @@ -67,12 +67,12 @@ namespace ewol { * @brief Select a specific file in the path * @param[in] _data File to selested. */ - virtual void setSelect(const std::string& _data); + virtual void setSelect(const etk::String& _data); /** * @brief Get the current selected file/folder/... in the list * @return the String of the element selected. */ - std::string getSelect() const ; + etk::String getSelect() const ; protected: virtual void onChangePropertyPath(); virtual void onChangePropertyFile(); diff --git a/ewol/widget/Manager.cpp b/ewol/widget/Manager.cpp index aafa6db7..ec7f996f 100644 --- a/ewol/widget/Manager.cpp +++ b/ewol/widget/Manager.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include ewol::widget::Manager::Manager() : m_haveRedraw(true) { @@ -164,7 +164,7 @@ bool ewol::widget::Manager::isDrawingNeeded() { } // element that generate the list of elements -void ewol::widget::Manager::addWidgetCreator(const std::string& _name, +void ewol::widget::Manager::addWidgetCreator(const etk::String& _name, ewol::widget::Manager::widgetCreatorFunction _pointer, ewol::widget::Manager::widgetCreatorFunctionXml _pointerXml) { if ( _pointer == nullptr @@ -172,7 +172,7 @@ void ewol::widget::Manager::addWidgetCreator(const std::string& _name, return; } //Keep name in lower case : - std::string nameLower = etk::tolower(_name); + etk::String nameLower = etk::tolower(_name); bool find = false; { auto it = m_creatorList.find(nameLower); @@ -198,8 +198,8 @@ void ewol::widget::Manager::addWidgetCreator(const std::string& _name, m_creatorListXml.insert(make_pair(nameLower, _pointerXml)); } -ewol::WidgetShared ewol::widget::Manager::create(const std::string& _name) { - std::string nameLower = etk::tolower(_name); +ewol::WidgetShared ewol::widget::Manager::create(const etk::String& _name) { + etk::String nameLower = etk::tolower(_name); auto it = m_creatorList.find(nameLower); if (it != m_creatorList.end()) { if (it->second != nullptr) { @@ -210,8 +210,8 @@ ewol::WidgetShared ewol::widget::Manager::create(const std::string& _name) { return nullptr; } -ewol::WidgetShared ewol::widget::Manager::create(const std::string& _name, const exml::Element& _node) { - std::string nameLower = etk::tolower(_name); +ewol::WidgetShared ewol::widget::Manager::create(const etk::String& _name, const exml::Element& _node) { + etk::String nameLower = etk::tolower(_name); auto it = m_creatorListXml.find(nameLower); if (it != m_creatorListXml.end()) { if (it->second != nullptr) { @@ -222,8 +222,8 @@ ewol::WidgetShared ewol::widget::Manager::create(const std::string& _name, const return nullptr; } -bool ewol::widget::Manager::exist(const std::string& _name) { - std::string nameLower = etk::tolower(_name); +bool ewol::widget::Manager::exist(const etk::String& _name) { + etk::String nameLower = etk::tolower(_name); auto it = m_creatorList.find(nameLower); if (it == m_creatorList.end()) { return false; @@ -231,8 +231,8 @@ bool ewol::widget::Manager::exist(const std::string& _name) { return true; } -std::string ewol::widget::Manager::list() { - std::string tmpVal; +etk::String ewol::widget::Manager::list() { + etk::String tmpVal; for (auto &it : m_creatorList) { if (tmpVal.size() != 0) { tmpVal += ","; diff --git a/ewol/widget/Manager.hpp b/ewol/widget/Manager.hpp index 39b15e34..03351a46 100644 --- a/ewol/widget/Manager.hpp +++ b/ewol/widget/Manager.hpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include @@ -50,8 +50,8 @@ namespace ewol { using widgetCreatorFunction = std::function; //!< funtion factory basic definition using widgetCreatorFunctionXml = std::function; //!< funtion factory basic definition private: - std::unordered_map m_creatorList; //!< List of factory of a widget - std::unordered_map m_creatorListXml; //!< List of factory of a widget + std::unordered_map m_creatorList; //!< List of factory of a widget + std::unordered_map m_creatorListXml; //!< List of factory of a widget public: /** * @brief add a factory of a specific widget. @@ -59,32 +59,32 @@ namespace ewol { * @param[in] _factory Function pointer to create the widget * @param[in] _factoryXml Function pointer to create the widget with XML node for parsing of XML */ - void addWidgetCreator(const std::string& _name, widgetCreatorFunction _factory, widgetCreatorFunctionXml _factoryXml); + void addWidgetCreator(const etk::String& _name, widgetCreatorFunction _factory, widgetCreatorFunctionXml _factoryXml); /** * @brief Create a widget with his name. * @param[in] _name Name of the widget to create. * @return The widget created (nullptr if it does not exist). */ - ewol::WidgetShared create(const std::string& _name); + ewol::WidgetShared create(const etk::String& _name); /** * @brief Create a widget with his name. * @param[in] _name Name of the widget to create. * @param[in] _node Reference on the XML node. * @return The widget created (nullptr if it does not exist). */ - ewol::WidgetShared create(const std::string& _name, const exml::Element& _node); + ewol::WidgetShared create(const etk::String& _name, const exml::Element& _node); /** * @brief Check if an Widget exist * @param[in] _name Name of the widget to check. * @return true The Widget exist. * @return false The Widget Does NOT exist. */ - bool exist(const std::string& _name); + bool exist(const etk::String& _name); /** * @brief Get the list of all Widget that can be created. * @return Separate with ',' string list. */ - std::string list(); + etk::String list(); // --------------------------------------------- // -- Something change area (TODO: maybe set it in the windows) // --------------------------------------------- diff --git a/ewol/widget/Menu.cpp b/ewol/widget/Menu.cpp index 1c281ddf..aa0c6562 100644 --- a/ewol/widget/Menu.cpp +++ b/ewol/widget/Menu.cpp @@ -47,15 +47,15 @@ void ewol::widget::Menu::clear() { m_listElement.clear(); } -int32_t ewol::widget::Menu::addTitle(const std::string& _label, - const std::string& _image, - const std::string& _message) { +int32_t ewol::widget::Menu::addTitle(const etk::String& _label, + const etk::String& _image, + const etk::String& _message) { return add(-1, _label, _image, _message); } static const char* eventButtonPressed = "menu-local-pressed"; -int32_t ewol::widget::Menu::get(const std::string& _label) { +int32_t ewol::widget::Menu::get(const etk::String& _label) { for (auto &it : m_listElement) { if (it.m_label == _label) { return it.m_localId; @@ -65,9 +65,9 @@ int32_t ewol::widget::Menu::get(const std::string& _label) { } int32_t ewol::widget::Menu::add(int32_t _parent, - const std::string& _label, - const std::string& _image, - const std::string& _message) { + const etk::String& _label, + const etk::String& _image, + const etk::String& _message) { // try to find one already created: int32_t previous = get(_label); if (previous != -1) { @@ -86,7 +86,7 @@ int32_t ewol::widget::Menu::add(int32_t _parent, return tmpObject.m_localId; } if (tmpObject.m_image.size()!=0) { - std::string composeString ="\n"; + etk::String composeString ="\n"; if (etk::end_with(tmpObject.m_image, ".edf") == true) { composeString+=" \n"; } else { @@ -106,7 +106,7 @@ int32_t ewol::widget::Menu::add(int32_t _parent, myButton->signalPressed.connect(sharedFromThis(), &ewol::widget::Menu::onButtonPressed, ewol::widget::ButtonWeak(myButton)); tmpObject.m_widgetPointer = myButton; } - m_listElement.push_back(tmpObject); + m_listElement.pushBack(tmpObject); return tmpObject.m_localId; } @@ -136,7 +136,7 @@ int32_t ewol::widget::Menu::addSpacer(int32_t _parent) { // add it in the widget list ewol::widget::Sizer::subWidgetAdd(mySpacer); } - m_listElement.push_back(tmpObject); + m_listElement.pushBack(tmpObject); return tmpObject.m_localId; } @@ -240,7 +240,7 @@ void ewol::widget::Menu::onButtonPressed(ewol::widget::ButtonWeak _button) { // add it in the widget list mySizer->subWidgetAdd(myButton); if (it2->m_image.size() != 0) { - std::string composeString; + etk::String composeString; composeString+= " \n"; if (etk::end_with(it2->m_image, ".edf") == true) { composeString+=" \n"; @@ -253,7 +253,7 @@ void ewol::widget::Menu::onButtonPressed(ewol::widget::ButtonWeak _button) { } else { if (menuHaveImage == true) { myButton->setSubWidget(ewol::widget::composerGenerateString( - std::string() + + etk::String() + " \n" " \n" " \n" @@ -262,7 +262,7 @@ void ewol::widget::Menu::onButtonPressed(ewol::widget::ButtonWeak _button) { } else { ewol::widget::LabelShared tmpLabel = widget::Label::create(); if (tmpLabel != nullptr) { - tmpLabel->propertyValue.set(std::string("") + it2->m_label + "\n"); + tmpLabel->propertyValue.set(etk::String("") + it2->m_label + "\n"); tmpLabel->propertyExpand.set(bvec2(true,false)); tmpLabel->propertyFill.set(bvec2(true,true)); myButton->setSubWidget(tmpLabel); @@ -296,7 +296,7 @@ bool ewol::widget::Menu::loadXML(const exml::Element& _node) { // trash here all that is not element continue; } - std::string widgetName = pNode.getValue(); + etk::String widgetName = pNode.getValue(); EWOL_INFO("Get node : " << pNode); if (widgetName == "elem") { // @@ -308,7 +308,7 @@ bool ewol::widget::Menu::loadXML(const exml::Element& _node) { // trash here all that is not element continue; } - std::string widgetName2 = pNode2.getValue(); + etk::String widgetName2 = pNode2.getValue(); if (widgetName2 == "elem") { // add(idMenu, pNode2.attributes["title"], pNode2.attributes["image"], pNode2.attributes["event"]); diff --git a/ewol/widget/Menu.hpp b/ewol/widget/Menu.hpp index 98eba58c..c5e10a2a 100644 --- a/ewol/widget/Menu.hpp +++ b/ewol/widget/Menu.hpp @@ -20,9 +20,9 @@ namespace ewol { int32_t m_localId; int32_t m_parentId; ewol::WidgetWeak m_widgetPointer; - std::string m_label; - std::string m_image; - std::string m_message; + etk::String m_label; + etk::String m_image; + etk::String m_message; }; class Menu; using MenuShared = ememory::SharedPtr; @@ -32,7 +32,7 @@ namespace ewol { */ class Menu :public ewol::widget::Sizer { public: - esignal::Signal signalSelect; // event on a menu button or ... + esignal::Signal signalSelect; // event on a menu button or ... protected: Menu(); public: @@ -45,14 +45,14 @@ namespace ewol { void subWidgetUnLink(ewol::WidgetShared _newWidget) override; bool loadXML(const exml::Element& _node) override; private: - std::vector m_listElement; + etk::Vector m_listElement; int32_t m_staticId; // unique ID for every element of the menu ... ewol::widget::ContextMenuWeak m_widgetContextMenu; - int32_t get(const std::string& _label); + int32_t get(const etk::String& _label); public: void clear(); - int32_t addTitle(const std::string& _label, const std::string& _image="", const std::string& _message = ""); - int32_t add(int32_t _parent, const std::string& _label, const std::string& _image="", const std::string& _message = ""); + int32_t addTitle(const etk::String& _label, const etk::String& _image="", const etk::String& _message = ""); + int32_t add(int32_t _parent, const etk::String& _label, const etk::String& _image="", const etk::String& _message = ""); int32_t addSpacer(int32_t _parent=-1); void remove(int32_t _id); private: diff --git a/ewol/widget/PopUp.hpp b/ewol/widget/PopUp.hpp index 56a901d1..18e3822d 100644 --- a/ewol/widget/PopUp.hpp +++ b/ewol/widget/PopUp.hpp @@ -23,7 +23,7 @@ namespace ewol { */ class PopUp : public ewol::widget::Container { public: // properties - eproperty::Value propertyShape; //!< Compositing theme. + eproperty::Value propertyShape; //!< Compositing theme. eproperty::Value propertyLockExpand; //!< Lock the expend of the sub widget to this one == > this permit to limit bigger subWidget eproperty::Value propertyCloseOutEvent; //!< ratio progression of a sliding protected: diff --git a/ewol/widget/ProgressBar.cpp b/ewol/widget/ProgressBar.cpp index db85022f..4ba106ac 100644 --- a/ewol/widget/ProgressBar.cpp +++ b/ewol/widget/ProgressBar.cpp @@ -42,8 +42,8 @@ ewol::widget::ProgressBar::~ProgressBar() { void ewol::widget::ProgressBar::calculateMinMaxSize() { vec2 tmpMin = propertyMinSize->getPixel(); - m_minSize.setValue( std::max(tmpMin.x(), 40.0f), - std::max(tmpMin.y(), dotRadius*2.0f) ); + m_minSize.setValue( etk::max(tmpMin.x(), 40.0f), + etk::max(tmpMin.y(), dotRadius*2.0f) ); markToRedraw(); } diff --git a/ewol/widget/Scroll.cpp b/ewol/widget/Scroll.cpp index 6be7872c..4fc2edad 100644 --- a/ewol/widget/Scroll.cpp +++ b/ewol/widget/Scroll.cpp @@ -161,9 +161,9 @@ void ewol::widget::Scroll::onRegenerateDisplay() { if( m_size.y() < scrollSize.y() || scrollOffset.y() != 0) { float lenScrollBar = m_size.y()*m_size.y() / scrollSize.y(); - lenScrollBar = std::avg(10.0f, lenScrollBar, m_size.y()); + lenScrollBar = etk::avg(10.0f, lenScrollBar, m_size.y()); float originScrollBar = scrollOffset.y() / (scrollSize.y()-m_size.y()*propertyLimit->y()); - originScrollBar = std::avg(0.0f, originScrollBar, 1.0f); + originScrollBar = etk::avg(0.0f, originScrollBar, 1.0f); originScrollBar *= (m_size.y()-lenScrollBar); m_shaperV.setShape(vec2(m_size.x() - paddingVert.x(), 0), vec2(paddingVert.x(), m_size.y()), @@ -173,9 +173,9 @@ void ewol::widget::Scroll::onRegenerateDisplay() { if( m_size.x() < scrollSize.x() || scrollOffset.x() != 0) { float lenScrollBar = (m_size.x()-paddingHori.xLeft())*(m_size.x()-paddingVert.x()) / scrollSize.x(); - lenScrollBar = std::avg(10.0f, lenScrollBar, (m_size.x()-paddingVert.x())); + lenScrollBar = etk::avg(10.0f, lenScrollBar, (m_size.x()-paddingVert.x())); float originScrollBar = scrollOffset.x() / (scrollSize.x()-m_size.x()*propertyLimit->x()); - originScrollBar = std::avg(0.0f, originScrollBar, 1.0f); + originScrollBar = etk::avg(0.0f, originScrollBar, 1.0f); originScrollBar *= (m_size.x()-paddingHori.xRight()-lenScrollBar); m_shaperH.setShape(vec2(0, 0), vec2(m_size.x()-paddingVert.x(), paddingHori.y()), @@ -212,7 +212,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { m_highSpeedButton = 1; // force direct scrolling in this case scrollOffset.setY((int32_t)(scrollSize.y() * (relativePos.y()-SCROLL_BAR_SPACE) / (m_size.y()-SCROLL_BAR_SPACE*2))); - scrollOffset.setY(std::avg(0.0f, scrollOffset.y(), (scrollSize.y() - m_size.y()*propertyLimit->y()))); + scrollOffset.setY(etk::avg(0.0f, scrollOffset.y(), (scrollSize.y() - m_size.y()*propertyLimit->y()))); markToRedraw(); if (m_subWidget != nullptr) { m_subWidget->setOffset(scrollOffset); @@ -229,7 +229,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { m_highSpeedButton = 1; // force direct scrolling in this case scrollOffset.setX((int32_t)(scrollSize.x() * (relativePos.x()-SCROLL_BAR_SPACE) / (m_size.x()-SCROLL_BAR_SPACE*2))); - scrollOffset.setY(std::avg(0.0f, scrollOffset.x(), (scrollSize.x() - m_size.x()*propertyLimit->x()))); + scrollOffset.setY(etk::avg(0.0f, scrollOffset.x(), (scrollSize.x() - m_size.x()*propertyLimit->x()))); markToRedraw(); if (m_subWidget != nullptr) { m_subWidget->setOffset(scrollOffset); @@ -243,7 +243,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { EWOL_VERBOSE(" mode UP " << m_size.y() << "<" << scrollSize.y()); if(m_size.y() < scrollSize.y()) { scrollOffset.setY(scrollOffset.y()-m_pixelScrolling); - scrollOffset.setY(std::avg(0.0f, scrollOffset.y(), (scrollSize.y() - m_size.y()*propertyLimit->y()))); + scrollOffset.setY(etk::avg(0.0f, scrollOffset.y(), (scrollSize.y() - m_size.y()*propertyLimit->y()))); markToRedraw(); if (m_subWidget != nullptr) { m_subWidget->setOffset(scrollOffset); @@ -255,7 +255,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { EWOL_VERBOSE(" mode DOWN " << m_size.y() << "<" << scrollSize.y()); if(m_size.y() < scrollSize.y()) { scrollOffset.setY(scrollOffset.y()+m_pixelScrolling); - scrollOffset.setY(std::avg(0.0f, scrollOffset.y(), (scrollSize.y() - m_size.y()*propertyLimit->y()))); + scrollOffset.setY(etk::avg(0.0f, scrollOffset.y(), (scrollSize.y() - m_size.y()*propertyLimit->y()))); markToRedraw(); if (m_subWidget != nullptr) { m_subWidget->setOffset(scrollOffset); @@ -325,7 +325,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { } markToRedraw(); } - scrollOffset.setY(std::avg(0.0f, scrollOffset.y(), (scrollSize.y() - m_size.y()*propertyLimit->y()))); + scrollOffset.setY(etk::avg(0.0f, scrollOffset.y(), (scrollSize.y() - m_size.y()*propertyLimit->y()))); if (m_subWidget != nullptr) { m_subWidget->setOffset(scrollOffset); } @@ -334,7 +334,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { if( m_highSpeedMode == speedModeEnableHorizontal && _event.getStatus() == gale::key::status::move) { scrollOffset.setX((int32_t)(scrollSize.x() * (relativePos.x()-SCROLL_BAR_SPACE) / (m_size.x()-SCROLL_BAR_SPACE*2))); - scrollOffset.setX(std::avg(0.0f, scrollOffset.x(), (scrollSize.x() - m_size.x()*propertyLimit->x() ))); + scrollOffset.setX(etk::avg(0.0f, scrollOffset.x(), (scrollSize.x() - m_size.x()*propertyLimit->x() ))); markToRedraw(); if (m_subWidget != nullptr) { m_subWidget->setOffset(scrollOffset); @@ -344,7 +344,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { if( m_highSpeedMode == speedModeEnableVertical && _event.getStatus() == gale::key::status::move) { scrollOffset.setY((int32_t)(scrollSize.y() * (relativePos.y()-SCROLL_BAR_SPACE) / (m_size.y()-SCROLL_BAR_SPACE*2))); - scrollOffset.setY(std::avg(0.0f, scrollOffset.y(), (scrollSize.y() - m_size.y()*propertyLimit->x()))); + scrollOffset.setY(etk::avg(0.0f, scrollOffset.y(), (scrollSize.y() - m_size.y()*propertyLimit->x()))); markToRedraw(); if (m_subWidget != nullptr) { m_subWidget->setOffset(scrollOffset); @@ -388,11 +388,11 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { //scrollOffset.x = (int32_t)(scrollSize.x * x / m_size.x); if (propertyLimit->x() != 0.0f) { scrollOffset.setX(scrollOffset.x() + (relativePos.x() - m_highSpeedStartPos.x())); - scrollOffset.setX(std::avg(0.0f, scrollOffset.x(), (scrollSize.x() - m_size.x()*propertyLimit->x()))); + scrollOffset.setX(etk::avg(0.0f, scrollOffset.x(), (scrollSize.x() - m_size.x()*propertyLimit->x()))); } if (propertyLimit->y() != 0.0f) { scrollOffset.setY(scrollOffset.y() - (relativePos.y() - m_highSpeedStartPos.y())); - scrollOffset.setY(std::avg(0.0f, scrollOffset.y(), (scrollSize.y() - m_size.y()*propertyLimit->y()))); + scrollOffset.setY(etk::avg(0.0f, scrollOffset.y(), (scrollSize.y() - m_size.y()*propertyLimit->y()))); } // update current position: m_highSpeedStartPos = relativePos; diff --git a/ewol/widget/Scroll.hpp b/ewol/widget/Scroll.hpp index 12eb78b7..c5681425 100644 --- a/ewol/widget/Scroll.hpp +++ b/ewol/widget/Scroll.hpp @@ -20,8 +20,8 @@ namespace ewol { class Scroll : public ewol::widget::Container { public: // properties eproperty::Range propertyLimit; //!< Set the limitation of the ratio in the sreen - eproperty::Value propertyShapeVert; //!< Vertical shaper name - eproperty::Value propertyShapeHori; //!< Horizontal shaper name + eproperty::Value propertyShapeVert; //!< Vertical shaper name + eproperty::Value propertyShapeHori; //!< Horizontal shaper name eproperty::Value propertyHover; //!< Horizontal shaper name public: enum highSpeedMode { diff --git a/ewol/widget/Select.cpp b/ewol/widget/Select.cpp index 473affa6..2be5c090 100644 --- a/ewol/widget/Select.cpp +++ b/ewol/widget/Select.cpp @@ -10,7 +10,7 @@ #include #include -ewol::widget::Select::Element::Element(int32_t _value, std::string _name, bool _selected): +ewol::widget::Select::Element::Element(int32_t _value, etk::String _name, bool _selected): m_value(_value), m_name(_name), m_selected(_selected) { @@ -91,14 +91,14 @@ void ewol::widget::Select::optionClear() { optionSelectDefault(); } -void ewol::widget::Select::optionAdd(int32_t _value, std::string _data) { +void ewol::widget::Select::optionAdd(int32_t _value, etk::String _data) { for (auto &it : m_listElement) { if (_value == it.m_value) { EWOL_DEBUG("replace element: " << _value << " with: '" << _data << "'"); it.m_name = _data; } } - m_listElement.push_back(ewol::widget::Select::Element(_value, _data, false)); + m_listElement.pushBack(ewol::widget::Select::Element(_value, _data, false)); } bool ewol::widget::Select::loadXML(const exml::Element& _node) { @@ -120,9 +120,9 @@ bool ewol::widget::Select::loadXML(const exml::Element& _node) { EWOL_ERROR("(l " << pNode.getPos() << ") Unknown basic node='" << pNode.getValue() << "' not in : [option]" ); continue; } - std::string valId = pNode.attributes["id"]; - std::string valIsSelected = pNode.attributes["select"]; - std::string valText = pNode.getText(); + etk::String valId = pNode.attributes["id"]; + etk::String valIsSelected = pNode.attributes["select"]; + etk::String valText = pNode.getText(); int32_t id = etk::string_to_int32_t(valId); bool select = etk::string_to_bool(valIsSelected); optionAdd(id, valText); @@ -180,7 +180,7 @@ void ewol::widget::Select::onCallbackOpenMenu() { continue; } if (it.m_selected == true) { - myLabel->propertyValue.set(std::string("") + it.m_name + ""); + myLabel->propertyValue.set(etk::String("") + it.m_name + ""); } else { myLabel->propertyValue.set(it.m_name); } diff --git a/ewol/widget/Select.hpp b/ewol/widget/Select.hpp index 4c039e86..eff203ea 100644 --- a/ewol/widget/Select.hpp +++ b/ewol/widget/Select.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include #include #include @@ -39,17 +39,17 @@ namespace ewol { class Element { public: int32_t m_value; - std::string m_name; + etk::String m_name; bool m_selected; public: - Element(int32_t _value, std::string _name, bool _selected=false); + Element(int32_t _value, etk::String _name, bool _selected=false); }; - std::vector m_listElement; + etk::Vector m_listElement; public: void optionSelectDefault(); void optionRemove(int32_t _value); void optionClear(); - void optionAdd(int32_t _value, std::string _name); + void optionAdd(int32_t _value, etk::String _name); protected: bool loadXML(const exml::Element& _node) override; void updateGui() override; diff --git a/ewol/widget/Sizer.cpp b/ewol/widget/Sizer.cpp index 5c9fdc5d..cd04c8a7 100644 --- a/ewol/widget/Sizer.cpp +++ b/ewol/widget/Sizer.cpp @@ -52,11 +52,11 @@ void ewol::widget::Sizer::onChangeSize() { } vec2 tmpSize = it->getCalculateMinSize(); if (*propertyMode == ewol::widget::Sizer::modeVert) { - minSize = vec2(std::max(minSize.x(), tmpSize.x()), + minSize = vec2(etk::max(minSize.x(), tmpSize.x()), minSize.y() + tmpSize.y()); } else { minSize = vec2(minSize.x() + tmpSize.x(), - std::max(minSize.y(), tmpSize.y())); + etk::max(minSize.y(), tmpSize.y())); } bvec2 expand = it->canExpand(); nbWidgetExpand += ivec2(expand.x()==true?1:0, @@ -150,14 +150,14 @@ void ewol::widget::Sizer::onChangeSize() { continue; } vec2 tmpSizeMin = it->getSize(); - tmpSizeMin.setX(std::avg(tmpSizeMin.x(), localWidgetSize.x(), it->getCalculateMaxSize().x())); + tmpSizeMin.setX(etk::avg(tmpSizeMin.x(), localWidgetSize.x(), it->getCalculateMaxSize().x())); it->setSize(tmpSizeMin); } else { if (it->canExpand().y() == false) { continue; } vec2 tmpSizeMin = it->getSize(); - tmpSizeMin.setY(std::avg(tmpSizeMin.y(), localWidgetSize.y(), it->getCalculateMaxSize().y())); + tmpSizeMin.setY(etk::avg(tmpSizeMin.y(), localWidgetSize.y(), it->getCalculateMaxSize().y())); it->setSize(tmpSizeMin); } } @@ -177,10 +177,10 @@ void ewol::widget::Sizer::onChangeSize() { vec2 size = it->getSize(); if (*propertyMode == ewol::widget::Sizer::modeVert) { underSize += vec2(0.0f, size.y()); - underSize.setX(std::max(underSize.x(), size.x())); + underSize.setX(etk::max(underSize.x(), size.x())); } else { underSize += vec2(size.x(), 0.0f); - underSize.setY(std::max(underSize.y(), size.y())); + underSize.setY(etk::max(underSize.y(), size.y())); } } vec2 deltas = localWidgetSize - underSize; diff --git a/ewol/widget/Slider.cpp b/ewol/widget/Slider.cpp index 4b257483..015e6d87 100644 --- a/ewol/widget/Slider.cpp +++ b/ewol/widget/Slider.cpp @@ -46,8 +46,8 @@ ewol::widget::Slider::~Slider() { void ewol::widget::Slider::calculateMinMaxSize() { vec2 minTmp = propertyMinSize->getPixel(); - m_minSize.setValue(std::max(minTmp.x(), 40.0f), - std::max(minTmp.y(), dotRadius*2.0f) ); + m_minSize.setValue(etk::max(minTmp.x(), 40.0f), + etk::max(minTmp.y(), dotRadius*2.0f) ); markToRedraw(); } @@ -98,7 +98,7 @@ bool ewol::widget::Slider::onEventInput(const ewol::event::Input& _event) { } void ewol::widget::Slider::updateValue(float _newValue) { - _newValue = std::max(std::min(_newValue, *propertyMaximum), *propertyMinimum); + _newValue = etk::max(etk::min(_newValue, *propertyMaximum), *propertyMinimum); if (*propertyStep == 0.0f) { propertyValue.setDirect(_newValue); } else { diff --git a/ewol/widget/Slider.hpp b/ewol/widget/Slider.hpp index f55b3644..3ef18747 100644 --- a/ewol/widget/Slider.hpp +++ b/ewol/widget/Slider.hpp @@ -24,7 +24,7 @@ namespace ewol { public: // signals esignal::Signal signalChange; public: - //eproperty::Value propertyShape; //!< name of the shape used + //eproperty::Value propertyShape; //!< name of the shape used eproperty::Value propertyValue; //!< current value of the Slider eproperty::Value propertyMinimum; //!< minimum value of the slider eproperty::Value propertyMaximum; //!< maximum value of the slider diff --git a/ewol/widget/Spin.cpp b/ewol/widget/Spin.cpp index 0ad689bd..bd07811f 100644 --- a/ewol/widget/Spin.cpp +++ b/ewol/widget/Spin.cpp @@ -88,9 +88,9 @@ void ewol::widget::Spin::updateGui() { } void ewol::widget::Spin::checkValue(int64_t _value) { - _value = std::avg(propertyMin.get(), _value, propertyMax.get()); + _value = etk::avg(propertyMin.get(), _value, propertyMax.get()); propertyValue.setDirect(_value); - m_widgetEntry->propertyValue.set(etk::to_string(_value)); + m_widgetEntry->propertyValue.set(etk::toString(_value)); } void ewol::widget::Spin::onCallbackUp() { diff --git a/ewol/widget/Spin.hpp b/ewol/widget/Spin.hpp index cacf61f7..5fbe49ed 100644 --- a/ewol/widget/Spin.hpp +++ b/ewol/widget/Spin.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include #include #include diff --git a/ewol/widget/WSlider.cpp b/ewol/widget/WSlider.cpp index e8e39407..260599de 100644 --- a/ewol/widget/WSlider.cpp +++ b/ewol/widget/WSlider.cpp @@ -14,7 +14,7 @@ static const char* l_listsladingMode[ewol::widget::WSlider::sladingTransition_co "transition horisantal" }; -std::ostream& operator <<(std::ostream& _os, const enum ewol::widget::WSlider::sladingMode _obj) { +etk::Stream& operator <<(etk::Stream& _os, const enum ewol::widget::WSlider::sladingMode _obj) { _os << l_listsladingMode[_obj]; return _os; } @@ -161,7 +161,7 @@ void ewol::widget::WSlider::subWidgetSelectSet(const ewol::WidgetShared& _widget EWOL_ERROR("Can not change to a widget not present"); } -void ewol::widget::WSlider::subWidgetSelectSet(const std::string& _widgetName) { +void ewol::widget::WSlider::subWidgetSelectSet(const etk::String& _widgetName) { if (_widgetName == "") { EWOL_ERROR("Can not change to a widget with no name (input)"); return; @@ -210,7 +210,7 @@ void ewol::widget::WSlider::periodicCall(const ewol::event::Time& _event) { } } m_slidingProgress += _event.getDeltaCall()/propertyTransitionSpeed; - m_slidingProgress = std::avg(0.0f, m_slidingProgress, 1.0f); + m_slidingProgress = etk::avg(0.0f, m_slidingProgress, 1.0f); } onChangeSize(); } diff --git a/ewol/widget/WSlider.hpp b/ewol/widget/WSlider.hpp index 27544f17..e64b10b2 100644 --- a/ewol/widget/WSlider.hpp +++ b/ewol/widget/WSlider.hpp @@ -32,7 +32,7 @@ namespace ewol { public: // properties: eproperty::Range propertyTransitionSpeed; //!< speed of the transition (default 1 == > 1s) eproperty::List propertyTransitionMode; //!< mode to slide the widgets - eproperty::Value propertySelectWidget; //!< current select configuration + eproperty::Value propertySelectWidget; //!< current select configuration protected: WSlider(); public: @@ -64,7 +64,7 @@ namespace ewol { * @brief Select a new subwidget to display * @param[in] _widgetName Name of the subwidget name */ - void subWidgetSelectSet(const std::string& _widgetName); + void subWidgetSelectSet(const etk::String& _widgetName); public: void onChangeSize() override; void systemDraw(const ewol::DrawProperty& _displayProp) override; @@ -82,6 +82,6 @@ namespace ewol { virtual void onChangePropertyTransitionMode(); }; } - std::ostream& operator <<(std::ostream& _os, const enum ewol::widget::WSlider::sladingMode _obj); + etk::Stream& operator <<(etk::Stream& _os, const enum ewol::widget::WSlider::sladingMode _obj); } diff --git a/ewol/widget/Widget.cpp b/ewol/widget/Widget.cpp index 83d32b77..5a2076d7 100644 --- a/ewol/widget/Widget.cpp +++ b/ewol/widget/Widget.cpp @@ -50,7 +50,7 @@ ewol::Widget::Widget() : m_origin(0,0), m_hasFocus(false), m_limitMouseEvent(3), - m_allowRepeateKeyboardEvent(true), + m_allowRepeatKeyboardEvent(true), signalShortcut(this, "shortcut", ""), m_needRegenerateDisplay(true), m_grabCursor(false), @@ -189,15 +189,15 @@ void ewol::Widget::systemDraw(const ewol::DrawProperty& _displayProp) { if( (_displayProp.m_origin.x() > m_origin.x()) || (_displayProp.m_origin.x() + _displayProp.m_size.x() < m_size.x() + m_origin.x()) ) { // here we invert the reference of the standard openGl view because the reference in the common display is Top left and not buttom left - int32_t tmpOriginX = std::max(_displayProp.m_origin.x(), m_origin.x()); + int32_t tmpOriginX = etk::max(_displayProp.m_origin.x(), m_origin.x()); int32_t tmppp1 = _displayProp.m_origin.x() + _displayProp.m_size.x(); int32_t tmppp2 = m_origin.x() + m_size.x(); - int32_t tmpclipX = std::min(tmppp1, tmppp2) - tmpOriginX; + int32_t tmpclipX = etk::min(tmppp1, tmppp2) - tmpOriginX; - int32_t tmpOriginY = std::max(_displayProp.m_origin.y(), m_origin.y()); + int32_t tmpOriginY = etk::max(_displayProp.m_origin.y(), m_origin.y()); tmppp1 = _displayProp.m_origin.y() + _displayProp.m_size.y(); tmppp2 = m_origin.y() + m_size.y(); - //int32_t tmpclipY = std::min(tmppp1, tmppp2) - tmpOriginX; + //int32_t tmpclipY = etk::min(tmppp1, tmppp2) - tmpOriginX; glViewport( tmpOriginX, tmpOriginY, @@ -247,7 +247,7 @@ void ewol::Widget::setZoom(float _newVal) { if (m_zoom == _newVal) { return; } - m_zoom = std::avg(0.0000001f,_newVal,1000000.0f); + m_zoom = etk::avg(0.0000001f,_newVal,1000000.0f); markToRedraw(); } @@ -300,8 +300,8 @@ void ewol::Widget::setNoMinSize() { void ewol::Widget::checkMinSize() { vec2 pixelSize = propertyMinSize->getPixel(); - m_minSize.setX(std::max(m_minSize.x(), pixelSize.x())); - m_minSize.setY(std::max(m_minSize.y(), pixelSize.y())); + m_minSize.setX(etk::max(m_minSize.x(), pixelSize.x())); + m_minSize.setY(etk::max(m_minSize.y(), pixelSize.y())); } void ewol::Widget::setNoMaxSize() { @@ -310,8 +310,8 @@ void ewol::Widget::setNoMaxSize() { void ewol::Widget::checkMaxSize() { vec2 pixelSize = propertyMaxSize->getPixel(); - m_maxSize.setX(std::min(m_maxSize.x(), pixelSize.x())); - m_maxSize.setY(std::min(m_maxSize.y(), pixelSize.y())); + m_maxSize.setX(etk::min(m_maxSize.x(), pixelSize.x())); + m_maxSize.setY(etk::min(m_maxSize.y(), pixelSize.y())); } vec2 ewol::Widget::getSize() { @@ -336,7 +336,7 @@ const bvec2& ewol::Widget::canFill() { // -- Shortcut : management of the shortcut // ---------------------------------------------------------------------------------------------------------------- -void ewol::Widget::shortCutAdd(const std::string& _descriptiveString, const std::string& _message) { +void ewol::Widget::shortCutAdd(const etk::String& _descriptiveString, const etk::String& _message) { if (_descriptiveString.size() == 0) { EWOL_ERROR("try to add shortcut with no descriptive string ..."); return; @@ -349,80 +349,80 @@ void ewol::Widget::shortCutAdd(const std::string& _descriptiveString, const std: } // parsing of the string: //"ctrl+shift+alt+meta+s" - if(_descriptiveString.find("ctrl") != std::string::npos) { + if(_descriptiveString.find("ctrl") != etk::String::npos) { tmpElement.specialKey.setCtrlLeft(true); } - if(_descriptiveString.find("shift") != std::string::npos) { + if(_descriptiveString.find("shift") != etk::String::npos) { tmpElement.specialKey.setShiftLeft(true); } - if(_descriptiveString.find("alt") != std::string::npos) { + if(_descriptiveString.find("alt") != etk::String::npos) { tmpElement.specialKey.setAltLeft(true); } - if(_descriptiveString.find("meta") != std::string::npos) { + if(_descriptiveString.find("meta") != etk::String::npos) { tmpElement.specialKey.setMetaLeft(true); } - if(_descriptiveString.find("F12") != std::string::npos) { + if(_descriptiveString.find("F12") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::f12; - } else if(_descriptiveString.find("F11") != std::string::npos) { + } else if(_descriptiveString.find("F11") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::f11; - } else if(_descriptiveString.find("F10") != std::string::npos) { + } else if(_descriptiveString.find("F10") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::f10; - } else if(_descriptiveString.find("F9") != std::string::npos) { + } else if(_descriptiveString.find("F9") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::f9; - } else if(_descriptiveString.find("F8") != std::string::npos) { + } else if(_descriptiveString.find("F8") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::f8; - } else if(_descriptiveString.find("F7") != std::string::npos) { + } else if(_descriptiveString.find("F7") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::f7; - } else if(_descriptiveString.find("F6") != std::string::npos) { + } else if(_descriptiveString.find("F6") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::f6; - } else if(_descriptiveString.find("F5") != std::string::npos) { + } else if(_descriptiveString.find("F5") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::f5; - } else if(_descriptiveString.find("F4") != std::string::npos) { + } else if(_descriptiveString.find("F4") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::f4; - } else if(_descriptiveString.find("F3") != std::string::npos) { + } else if(_descriptiveString.find("F3") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::f3; - } else if(_descriptiveString.find("F2") != std::string::npos) { + } else if(_descriptiveString.find("F2") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::f2; - } else if(_descriptiveString.find("F1") != std::string::npos) { + } else if(_descriptiveString.find("F1") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::f1; - } else if(_descriptiveString.find("LEFT") != std::string::npos) { + } else if(_descriptiveString.find("LEFT") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::left; - } else if(_descriptiveString.find("RIGHT") != std::string::npos) { + } else if(_descriptiveString.find("RIGHT") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::right; - } else if(_descriptiveString.find("UP") != std::string::npos) { + } else if(_descriptiveString.find("UP") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::up; - } else if(_descriptiveString.find("DOWN") != std::string::npos) { + } else if(_descriptiveString.find("DOWN") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::down; - } else if(_descriptiveString.find("PAGE_UP") != std::string::npos) { + } else if(_descriptiveString.find("PAGE_UP") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::pageUp; - } else if(_descriptiveString.find("PAGE_DOWN") != std::string::npos) { + } else if(_descriptiveString.find("PAGE_DOWN") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::pageDown; - } else if(_descriptiveString.find("START") != std::string::npos) { + } else if(_descriptiveString.find("START") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::start; - } else if(_descriptiveString.find("END") != std::string::npos) { + } else if(_descriptiveString.find("END") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::end; - } else if(_descriptiveString.find("PRINT") != std::string::npos) { + } else if(_descriptiveString.find("PRINT") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::print; - } else if(_descriptiveString.find("ARRET_DEFIL") != std::string::npos) { + } else if(_descriptiveString.find("ARRET_DEFIL") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::stopDefil; - } else if(_descriptiveString.find("WAIT") != std::string::npos) { + } else if(_descriptiveString.find("WAIT") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::wait; - } else if(_descriptiveString.find("INSERT") != std::string::npos) { + } else if(_descriptiveString.find("INSERT") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::insert; - } else if(_descriptiveString.find("CAPLOCK") != std::string::npos) { + } else if(_descriptiveString.find("CAPLOCK") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::capLock; - } else if(_descriptiveString.find("CONTEXT_MENU") != std::string::npos) { + } else if(_descriptiveString.find("CONTEXT_MENU") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::contextMenu; - } else if(_descriptiveString.find("NUM_LOCK") != std::string::npos) { + } else if(_descriptiveString.find("NUM_LOCK") != etk::String::npos) { tmpElement.keyboardMoveValue = gale::key::keyboard::numLock; } else { tmpElement.unicodeValue = _descriptiveString[_descriptiveString.size() -1]; } // add it on the List ... - m_localShortcut.push_back(std::move(tmpElement)); + m_localShortcut.pushBack(etk::move(tmpElement)); } -void ewol::Widget::shortCutRemove(const std::string& _message) { +void ewol::Widget::shortCutRemove(const etk::String& _message) { auto it(m_localShortcut.begin()); while(it != m_localShortcut.end()) { if (it->message != _message) { @@ -626,7 +626,7 @@ void ewol::Widget::hideKeyboard() { } void ewol::Widget::drawWidgetTree(int32_t _level) { - std::string space; + etk::String space; for (int32_t iii=0; iii<_level; ++iii) { space += " "; } diff --git a/ewol/widget/Widget.hpp b/ewol/widget/Widget.hpp index f7ea1d55..d2b44b2b 100644 --- a/ewol/widget/Widget.hpp +++ b/ewol/widget/Widget.hpp @@ -5,7 +5,7 @@ */ #pragma once -#include +#include #include #include @@ -55,7 +55,7 @@ namespace ewol { // TODO: change position of this ... class EventShortCut { public: - std::string message; //!< data link with the event + etk::String message; //!< data link with the event gale::key::Special specialKey; //!< special board key char32_t unicodeValue; //!< 0 if not used enum gale::key::keyboard keyboardMoveValue; //!< ewol::EVENT_KB_MOVE_TYPE_NONE if not used @@ -71,7 +71,7 @@ namespace ewol { virtual ~EventShortCut() { }; }; /** - * @brief Widget class is the main widget interface, it hase some generic properties: + * @brief Widget class is the main widget interface, it has some generic properties: * :** known his parent * :** Can be display at a special position with a special scale * :** Can get focus @@ -85,14 +85,14 @@ namespace ewol { eproperty::Value propertyMinSize; //!< user define the minimum size of the widget eproperty::Value propertyMaxSize; //!< user define the maximum size of the widget eproperty::Value propertyExpand; //!< the widget will expand if possible - eproperty::Value propertyFill; //!< the widget will fill all the space provided by the parrent. + eproperty::Value propertyFill; //!< the widget will fill all the space provided by the parent. eproperty::Value propertyHide; //!< hide a widget on the display eproperty::List propertyGravity; //!< Gravity of the widget eproperty::Value propertyCanFocus; //!< the focus can be done on this widget protected: /** * @brief Constructor of the widget classes - * @return (no execption generated (not managed in embended platform)) + * @return (no exception generated (not managed in embedded platform)) */ Widget(); public: @@ -109,14 +109,14 @@ namespace ewol { vec2 m_maxSize; //!< internal: maximum size of the widget public: /** - * @brief convert the absolute position in the local Position (Relative) - * @param[in] _pos Absolute position that you request convertion - * @return the relative position + * @brief Convert the absolute position in the local Position (Relative) + * @param[in] _pos Absolute position that you request conversion. + * @return The relative position. */ virtual vec2 relativePosition(const vec2& _pos); /** - * @brief Parent have set the size and the origin. the container need to update the subwidget property - * @note : INTERNAL EWOL SYSTEM + * @brief Parent have set the size and the origin. The container need to update the child widget property + * @note INTERNAL EWOL SYSTEM */ virtual void onChangeSize(); virtual void calculateSize() {}; @@ -152,7 +152,7 @@ namespace ewol { */ virtual vec2 getCalculateMaxSize(); protected: - vec2 m_offset; //!< Offset of the display in the viewport + vec2 m_offset; //!< Offset of the display in the view-port public: /** * @brief set the zoom property of the widget. @@ -189,15 +189,15 @@ namespace ewol { vec2 m_origin; //!< internal ... I do not really known how if can use it ... public: /** - * @brief set origin at the widget (must be an parrent widget that set this parameter). - * This represent the absolute origin in the program windows - * @param[in] _pos Position of the origin + * @brief Set origin at the widget (must be an parent widget that set this parameter). + * This represent the absolute origin in the program windows. + * @param[in] _pos Position of the origin. * @note : INTERNAL EWOL SYSTEM */ virtual void setOrigin(const vec2& _pos); /** - * @brief get the origin (obsolute position in the windows) - * @return coordonate of the origin requested + * @brief Get the origin (absolute position in the windows). + * @return Coordinate of the origin requested. */ virtual vec2 getOrigin(); public: @@ -227,7 +227,7 @@ namespace ewol { public: /** * @brief get the expend capabilities (x&y) - * @return 2D boolean repensent the capacity to expend + * @return 2D boolean represents the capacity to expend * @note : INTERNAL EWOL SYSTEM */ virtual bvec2 canExpand(); @@ -268,7 +268,7 @@ namespace ewol { virtual void keepFocus(); protected: /** - * @brief Event of the focus has been grep by the current widget + * @brief Event of the focus has been grabed by the current widget */ virtual void onGetFocus() {}; /** @@ -300,23 +300,23 @@ namespace ewol { // -- keyboard event properties Area // ---------------------------------------------------------------------------------------------------------------- private: - bool m_allowRepeateKeyboardEvent; //!< This remove the repeating keybord event due to the constant pressing key. + bool m_allowRepeatKeyboardEvent; //!< This remove the repeating keybord event due to the constant pressing key. public: /** * @brief get the keyboard repeating event supporting. * @return true : the event can be repeated. * @return false : the event must not be repeated. */ - virtual bool getKeyboardRepeate() { - return m_allowRepeateKeyboardEvent; + virtual bool getKeyboardRepeat() { + return m_allowRepeatKeyboardEvent; }; protected: /** * @brief set the keyboard repeating event supporting. * @param[in] _state The repeating status (true: enable, false disable). */ - virtual void setKeyboardRepeate(bool _state) { - m_allowRepeateKeyboardEvent = _state; + virtual void setKeyboardRepeat(bool _state) { + m_allowRepeatKeyboardEvent = _state; }; /** * @brief display the virtual keyboard (if needed) @@ -352,7 +352,7 @@ namespace ewol { virtual bool systemEventInput(ewol::event::InputSystem& _event); protected: /** - * @brief Event on an input of this Widget (finger, mouse, stilet) + * @brief Event on an input of this Widget (finger, mouse, stylet) * @param[in] _event Event properties * @return true the event is used * @return false the event is not used @@ -384,7 +384,7 @@ namespace ewol { }; public: /** - * @brief Event on a past event == > this event is asynchronous due to all system does not support direct getting datas + * @brief Event on a past event == > this event is asynchronous due to all system does not support direct getting data. * @note : need to have focus ... * @param[in] mode Mode of data requested */ @@ -394,26 +394,26 @@ namespace ewol { // -- Shortcut : management of the shortcut // ---------------------------------------------------------------------------------------------------------------- public: - esignal::Signal signalShortcut; //!< signal handle of the message + esignal::Signal signalShortcut; //!< signal handle of the message private: - std::vector m_localShortcut; //!< list of all shortcut in the widget + etk::Vector m_localShortcut; //!< list of all shortcut in the widget protected: /** * @brief add a specific shortcut with his description * @param[in] _descriptiveString Description string of the shortcut * @param[in] _message massage to generate (or shortcut name) */ - virtual void shortCutAdd(const std::string& _descriptiveString, - const std::string& _message=""); + virtual void shortCutAdd(const etk::String& _descriptiveString, + const etk::String& _message=""); /** - * @brief remove all curent shortCut + * @brief remove all current shortCut */ virtual void shortCutClean(); /** - * @brief remove a specific shortCut whith his event name - * @param[in] _message renerated event name + * @brief remove a specific shortCut with his event name + * @param[in] _message generated event name */ - virtual void shortCutRemove(const std::string& _message); + virtual void shortCutRemove(const etk::String& _message); public: /** * @brief Event on a short-cut of this Widget (in case of return false, the event on the keyevent will arrive in the function @ref onEventKb). @@ -422,7 +422,7 @@ namespace ewol { * @param[in] _kbMove Special key of the keyboard. * @return true if the event has been used. * @return false if the event has not been used. - * @note To prevent some error when you get an event get it if it is down and Up ... == > like this it could not generate some ununderstanding error. + * @note To prevent some error when you get an event get it if it is down and Up ... ==> like this it could not generate some mistake in the error. */ virtual bool onEventShortCut(const gale::key::Special& _special, char32_t _unicodeValue, @@ -452,8 +452,8 @@ namespace ewol { public: /** * @brief {SYSTEM} extern interface to request a draw ... (called by the drawing thread [Android, X11, ...]) - * This function generate a clipping with the viewport openGL system. Like this a widget draw can not draw over an other widget - * @note This function is virtual for the scrolled widget, and the more complicated openGl widget + * This function generate a clipping with the view-port openGL system. Like this a widget draw can not draw over an other widget + * @note This function is virtual for the scrolled widget, and the more complicated openGL widget * @param[in] _displayProp properties of the current display * @note : INTERNAL EWOL SYSTEM */ @@ -473,7 +473,7 @@ namespace ewol { bool m_grabCursor; public: /** - * @brief Grab the cursor : This get all the mouvement of the mouse in PC mode, and generate an ofset instead of a position. + * @brief Grab the cursor : This get all the movement of the mouse in PC mode, and generate an offset instead of a position. * @note : the generation of the offset is due to the fact the cursor position is forced at the center of the widget. * @note This done nothing in "Finger" or "Stylet" mode. */ @@ -484,7 +484,7 @@ namespace ewol { virtual void unGrabCursor(); /** * @brief get the grabbing status of the cursor. - * @return true if the cursor is curently grabbed + * @return true if the cursor is currently grabbed */ virtual bool getGrabStatus(); private: @@ -496,7 +496,7 @@ namespace ewol { */ virtual void setCursor(enum gale::context::cursor _newCursor); /** - * @brief get the currrent cursor. + * @brief get the current cursor. * @return the type of the cursor. */ virtual enum gale::context::cursor getCursor(); @@ -504,15 +504,15 @@ namespace ewol { virtual bool loadXML(const exml::Element& _node) override; public: /** - * @brief need to be call When the size of the current widget have change ==> this force the system to recalculate all the widget positions + * @brief Need to be call When the size of the current widget have change ==> this force the system to recalculate all the widget positions. */ void requestUpdateSize(); /** - * @brief get the current Widget Manager + * @brief Get the current Widget Manager. */ ewol::widget::Manager& getWidgetManager(); /** - * @brief get the curent Windows + * @brief Get the current Windows. */ ememory::SharedPtr getWindows(); protected: diff --git a/ewol/widget/WidgetScrolled.cpp b/ewol/widget/WidgetScrolled.cpp index e158c84a..207a09ab 100644 --- a/ewol/widget/WidgetScrolled.cpp +++ b/ewol/widget/WidgetScrolled.cpp @@ -60,9 +60,9 @@ void ewol::widget::WidgetScrolled::onRegenerateDisplay() { if( m_size.y() < m_maxSize.y() || m_originScrooled.y()!=0) { float lenScrollBar = m_size.y()*m_size.y() / m_maxSize.y(); - lenScrollBar = std::avg(10.0f, lenScrollBar, m_size.y()); + lenScrollBar = etk::avg(10.0f, lenScrollBar, m_size.y()); float originScrollBar = m_originScrooled.y() / (m_maxSize.y()-m_size.y()*m_limitScrolling.y()); - originScrollBar = std::avg(0.0f, originScrollBar, 1.0f); + originScrollBar = etk::avg(0.0f, originScrollBar, 1.0f); originScrollBar *= (m_size.y()-lenScrollBar); m_shaperV.setShape(vec2(m_size.x() - paddingVert.x(), 0), vec2(paddingVert.x(), m_size.y()), @@ -72,9 +72,9 @@ void ewol::widget::WidgetScrolled::onRegenerateDisplay() { if( m_size.x() < m_maxSize.x() || m_originScrooled.x()!=0) { float lenScrollBar = (m_size.x()-paddingHori.xLeft())*(m_size.x()-paddingVert.x()) / m_maxSize.x(); - lenScrollBar = std::avg(10.0f, lenScrollBar, (m_size.x()-paddingVert.x())); + lenScrollBar = etk::avg(10.0f, lenScrollBar, (m_size.x()-paddingVert.x())); float originScrollBar = m_originScrooled.x() / (m_maxSize.x()-m_size.x()*m_limitScrolling.x()); - originScrollBar = std::avg(0.0f, originScrollBar, 1.0f); + originScrollBar = etk::avg(0.0f, originScrollBar, 1.0f); originScrollBar *= (m_size.x()-paddingHori.xRight()-lenScrollBar); m_shaperH.setShape(vec2(0, 0), vec2(m_size.x()-paddingVert.x(), paddingHori.y()), @@ -107,7 +107,7 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event m_highSpeedButton = 1; // force direct scrolling in this case m_originScrooled.setY((int32_t)(m_maxSize.y() * (relativePos.y()-paddingV.yButtom()) / (m_size.y()-paddingV.yButtom()*2))); - m_originScrooled.setY(std::avg(0.0f, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling.y()))); + m_originScrooled.setY(etk::avg(0.0f, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling.y()))); markToRedraw(); return true; } @@ -121,7 +121,7 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event m_highSpeedButton = 1; // force direct scrolling in this case m_originScrooled.setX((int32_t)(m_maxSize.x() * (relativePos.x()-paddingH.xLeft()) / (m_size.x()-paddingH.xLeft()*2))); - m_originScrooled.setX(std::avg(0.0f, m_originScrooled.x(), (m_maxSize.x() - m_size.x()*m_limitScrolling.x()))); + m_originScrooled.setX(etk::avg(0.0f, m_originScrooled.x(), (m_maxSize.x() - m_size.x()*m_limitScrolling.x()))); markToRedraw(); return true; } @@ -133,7 +133,7 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event changeZoom(1); /* float zoom = getZoom()*1.1; - zoom = std::avg(0.1f, zoom, 5000.0f); + zoom = etk::avg(0.1f, zoom, 5000.0f); setZoom(zoom); */ } else { @@ -141,7 +141,7 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event || m_originScrooled.y() != 0 || m_size.y()*m_limitScrolling.y() < m_maxSize.y() ) { m_originScrooled.setY(m_originScrooled.y()-m_pixelScrolling); - m_originScrooled.setY(std::avg(0.0f, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling.y()))); + m_originScrooled.setY(etk::avg(0.0f, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling.y()))); markToRedraw(); return true; } @@ -152,7 +152,7 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event changeZoom(-1); /* float zoom = getZoom()*0.9; - zoom = std::avg(0.1f, zoom, 5000.0f); + zoom = etk::avg(0.1f, zoom, 5000.0f); setZoom(zoom); */ } else { @@ -160,7 +160,7 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event || m_originScrooled.y()!=0 || m_size.y()*m_limitScrolling.y() < m_maxSize.y() ) { m_originScrooled.setY(m_originScrooled.y()+m_pixelScrolling); - m_originScrooled.setY(std::avg(0.0f, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling.y()))); + m_originScrooled.setY(etk::avg(0.0f, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling.y()))); markToRedraw(); return true; } @@ -172,7 +172,7 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event || m_originScrooled.x()!=0 || m_size.x()*m_limitScrolling.x() < m_maxSize.x() ) { m_originScrooled.setX(m_originScrooled.x()-m_pixelScrolling); - m_originScrooled.setX(std::avg(0.0f, m_originScrooled.x(), (m_maxSize.x() - m_size.x()*m_limitScrolling.x()))); + m_originScrooled.setX(etk::avg(0.0f, m_originScrooled.x(), (m_maxSize.x() - m_size.x()*m_limitScrolling.x()))); markToRedraw(); return true; } @@ -183,7 +183,7 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event || m_originScrooled.x()!=0 || m_size.x()*m_limitScrolling.x() < m_maxSize.x() ) { m_originScrooled.setX(m_originScrooled.x()+m_pixelScrolling); - m_originScrooled.setX(std::avg(0.0f, m_originScrooled.x(), (m_maxSize.x() - m_size.x()*m_limitScrolling.x()))); + m_originScrooled.setX(etk::avg(0.0f, m_originScrooled.x(), (m_maxSize.x() - m_size.x()*m_limitScrolling.x()))); markToRedraw(); return true; } @@ -252,20 +252,20 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event } markToRedraw(); } - m_originScrooled.setY(std::avg(0.0f, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling.y()))); + m_originScrooled.setY(etk::avg(0.0f, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling.y()))); return true; } if ( m_highSpeedMode == ewol::widget::Scroll::speedModeEnableHorizontal && _event.getStatus() == gale::key::status::move) { m_originScrooled.setX((int32_t)(m_maxSize.x() * (relativePos.x()-paddingH.xLeft()) / (m_size.x()-paddingH.x()))); - m_originScrooled.setX(std::avg(0.0f, m_originScrooled.x(), (m_maxSize.x() - m_size.x()*m_limitScrolling.x()))); + m_originScrooled.setX(etk::avg(0.0f, m_originScrooled.x(), (m_maxSize.x() - m_size.x()*m_limitScrolling.x()))); markToRedraw(); return true; } if ( m_highSpeedMode == ewol::widget::Scroll::speedModeEnableVertical && _event.getStatus() == gale::key::status::move) { m_originScrooled.setY((int32_t)(m_maxSize.y() * (relativePos.y()-paddingV.yButtom()) / (m_size.y()-paddingV.y()))); - m_originScrooled.setY(std::avg(0.0f, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling.y()))); + m_originScrooled.setY(etk::avg(0.0f, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling.y()))); markToRedraw(); return true; } @@ -301,8 +301,8 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event if (_event.getStatus() == gale::key::status::move) { m_originScrooled.setX(m_originScrooled.x() - (relativePos.x() - m_fingerMoveStartPos[idTable].x())*0.5f); m_originScrooled.setY(m_originScrooled.y() - (relativePos.y() - m_fingerMoveStartPos[idTable].y())*0.5f); - m_originScrooled.setX(std::avg(0.0f, m_originScrooled.x(), (m_maxSize.x() - m_size.x()*m_limitScrolling.x()))); - m_originScrooled.setY(std::avg(0.0f, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling.y()))); + m_originScrooled.setX(etk::avg(0.0f, m_originScrooled.x(), (m_maxSize.x() - m_size.x()*m_limitScrolling.x()))); + m_originScrooled.setY(etk::avg(0.0f, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling.y()))); m_fingerMoveStartPos[idTable] = relativePos; EWOL_VERBOSE("SCROOL == > MOVE m_originScrooled=" << m_originScrooled << " " << relativePos << " " << m_highSpeedStartPos); markToRedraw(); @@ -360,8 +360,8 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event //m_originScrooled.x = (int32_t)(m_maxSize.x * x / m_size.x); m_originScrooled.setX(m_originScrooled.x() - (relativePos.x() - m_highSpeedStartPos.x())); m_originScrooled.setY(m_originScrooled.y() - (relativePos.y() - m_highSpeedStartPos.y())); - m_originScrooled.setX(std::avg(0.0f, m_originScrooled.x(), (m_maxSize.x() - m_size.x()*m_limitScrolling.x()))); - m_originScrooled.setY(std::avg(0.0f, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling.y()))); + m_originScrooled.setX(etk::avg(0.0f, m_originScrooled.x(), (m_maxSize.x() - m_size.x()*m_limitScrolling.x()))); + m_originScrooled.setY(etk::avg(0.0f, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling.y()))); m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y()); EWOL_VERBOSE("SCROOL == > MOVE m_originScrooled=" << m_originScrooled << " " << relativePos << " " << m_highSpeedStartPos); markToRedraw(); @@ -382,14 +382,14 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event float tmp1=m_size.x() / m_maxSize.y(); float tmp2=m_size.y() / m_maxSize.x(); //EWOL_INFO(" elements Zoom : " << tmp1 << " " << tmp2); - tmp1 = std::min(tmp1, tmp2); + tmp1 = etk::min(tmp1, tmp2); if ( _event.getId() == 4 && _event.getStatus() == gale::key::status::up) { m_zoom -= 0.1; if (tmp1 < 1.0) { - m_zoom = std::max(tmp1, m_zoom); + m_zoom = etk::max(tmp1, m_zoom); } else { - m_zoom = std::max(1.0f, m_zoom); + m_zoom = etk::max(1.0f, m_zoom); } markToRedraw(); return true; @@ -397,9 +397,9 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event && _event.getStatus() == gale::key::status::up) { m_zoom += 0.1; if (tmp1 > 1.0) { - m_zoom = std::min(tmp1, m_zoom); + m_zoom = etk::min(tmp1, m_zoom); } else { - m_zoom = std::min(1.0f, m_zoom); + m_zoom = etk::min(1.0f, m_zoom); } markToRedraw(); return true; @@ -456,18 +456,18 @@ void ewol::widget::WidgetScrolled::setScrollingPositionDynamic(vec2 _borderWidth // check scrooling in X if (_currentPosition.x() < (m_originScrooled.x() + _borderWidth.x()) ) { m_originScrooled.setX(_currentPosition.x() - _borderWidth.x()); - m_originScrooled.setX(std::max(0.0f, m_originScrooled.x())); + m_originScrooled.setX(etk::max(0.0f, m_originScrooled.x())); } else if (_currentPosition.x() > (m_originScrooled.x()+m_size.x()-2*_borderWidth.x()) ) { m_originScrooled.setX(_currentPosition.x() - m_size.x() + 2*_borderWidth.x()); - m_originScrooled.setX(std::max(0.0f, m_originScrooled.x())); + m_originScrooled.setX(etk::max(0.0f, m_originScrooled.x())); } // check scrooling in Y if (_currentPosition.y() < (m_originScrooled.y() + _borderWidth.y()) ) { m_originScrooled.setY(_currentPosition.y() - _borderWidth.y()); - m_originScrooled.setY(std::max(0.0f, m_originScrooled.y())); + m_originScrooled.setY(etk::max(0.0f, m_originScrooled.y())); } else if (_currentPosition.y() > (m_originScrooled.y()+m_size.y()-2*_borderWidth.y()) ) { m_originScrooled.setY(_currentPosition.y() - m_size.y() + 2*_borderWidth.y()); - m_originScrooled.setY(std::max(0.0f, m_originScrooled.y())); + m_originScrooled.setY(etk::max(0.0f, m_originScrooled.y())); } } @@ -475,7 +475,7 @@ void ewol::widget::WidgetScrolled::scroolingMode(enum scrollingMode _newMode) { m_scroollingMode = _newMode; if (m_scroollingMode == scroolModeGame) { // set the scene maximum size : - m_maxSize.setValue(std::max(m_size.x(), m_size.y()), + m_maxSize.setValue(etk::max(m_size.x(), m_size.y()), m_maxSize.x()); m_zoom = 1; } diff --git a/ewol/widget/WidgetScrolled.hpp b/ewol/widget/WidgetScrolled.hpp index cbabe019..aab1d17e 100644 --- a/ewol/widget/WidgetScrolled.hpp +++ b/ewol/widget/WidgetScrolled.hpp @@ -23,8 +23,8 @@ namespace ewol { */ class WidgetScrolled : public ewol::Widget { public: // properties: - eproperty::Value propertyShapeVert; //!< Vertical shaper name - eproperty::Value propertyShapeHori; //!< Horizontal shaper name + eproperty::Value propertyShapeVert; //!< Vertical shaper name + eproperty::Value propertyShapeHori; //!< Horizontal shaper name // TODO : All property public: enum scrollingMode { @@ -123,7 +123,7 @@ namespace ewol { * @param[in] _poucentageLimit pourcent of the limit of view nothing in the widget when arriving at the end ... */ void setLimitScrolling(float _poucentageLimit) { - _poucentageLimit = std::avg(0.1f, _poucentageLimit,1.0f); + _poucentageLimit = etk::avg(0.1f, _poucentageLimit,1.0f); m_limitScrolling = vec2(_poucentageLimit, _poucentageLimit); }; /** @@ -131,7 +131,7 @@ namespace ewol { * @param[in] _poucentageLimit pourcent of the limit of view nothing in the widget when arriving at the end for axis specific... */ void setLimitScrolling(const vec2& _poucentageLimit) { - m_limitScrolling = vec2(std::avg(0.1f, _poucentageLimit.x(),1.0f), std::avg(0.1f, _poucentageLimit.y(),1.0f)); + m_limitScrolling = vec2(etk::avg(0.1f, _poucentageLimit.x(),1.0f), etk::avg(0.1f, _poucentageLimit.y(),1.0f)); }; protected: virtual void onChangePropertyShapeVert(); diff --git a/ewol/widget/Windows.cpp b/ewol/widget/Windows.cpp index aea889bb..1883d2e7 100644 --- a/ewol/widget/Windows.cpp +++ b/ewol/widget/Windows.cpp @@ -174,7 +174,7 @@ void ewol::widget::Windows::popUpWidgetPush(ewol::WidgetShared _widget) { EWOL_ERROR("can not set widget pop-up (null pointer)"); return; } - m_popUpWidgetList.push_back(_widget); + m_popUpWidgetList.pushBack(_widget); _widget->setParent(sharedFromThis()); // force the focus on the basic widget ==> this remove many time the virual keyboard area _widget->keepFocus(); @@ -188,7 +188,7 @@ void ewol::widget::Windows::popUpWidgetPop() { if (m_popUpWidgetList.size() == 0) { return; } - m_popUpWidgetList.pop_back(); + m_popUpWidgetList.popBack(); } void ewol::widget::Windows::onChangePropertyColor() { @@ -238,7 +238,7 @@ void ewol::widget::Windows::requestDestroyFromChild(const ewol::ObjectShared& _c } } -ewol::ObjectShared ewol::widget::Windows::getSubObjectNamed(const std::string& _objectName) { +ewol::ObjectShared ewol::widget::Windows::getSubObjectNamed(const etk::String& _objectName) { ewol::ObjectShared tmpObject = ewol::Widget::getSubObjectNamed(_objectName); if (tmpObject != nullptr) { return tmpObject; diff --git a/ewol/widget/Windows.hpp b/ewol/widget/Windows.hpp index 022261e7..b7dcc558 100644 --- a/ewol/widget/Windows.hpp +++ b/ewol/widget/Windows.hpp @@ -22,8 +22,8 @@ namespace ewol { */ class Windows : public ewol::Widget { public: - eproperty::Value propertyColorConfiguration; //!< Configuration file of the windows theme - eproperty::Value propertyTitle; //!< Current title of the windows + eproperty::Value propertyColorConfiguration; //!< Configuration file of the windows theme + eproperty::Value propertyTitle; //!< Current title of the windows protected: ememory::SharedPtr m_resourceColor; //!< theme color property (name of file in @ref propertyColorConfiguration) int32_t m_colorBg; //!< Default background color of the windows @@ -69,7 +69,7 @@ namespace ewol { void onChangeSize() override; ewol::WidgetShared getWidgetAtPos(const vec2& _pos) override; void requestDestroyFromChild(const ewol::ObjectShared& _child) override; - ewol::ObjectShared getSubObjectNamed(const std::string& _objectName) override; + ewol::ObjectShared getSubObjectNamed(const etk::String& _objectName) override; void drawWidgetTree(int32_t _level=0) override; protected: /** diff --git a/ewol/widget/meta/ColorChooser.cpp b/ewol/widget/meta/ColorChooser.cpp index 49ecb7ab..3db95e7a 100644 --- a/ewol/widget/meta/ColorChooser.cpp +++ b/ewol/widget/meta/ColorChooser.cpp @@ -9,8 +9,8 @@ #include #include #include -//#include -#include +//#include +#include extern "C" { // file browsing ... diff --git a/ewol/widget/meta/FileChooser.cpp b/ewol/widget/meta/FileChooser.cpp index 95d7b70e..cf9185d5 100644 --- a/ewol/widget/meta/FileChooser.cpp +++ b/ewol/widget/meta/FileChooser.cpp @@ -16,8 +16,8 @@ #include #include #include -//#include -#include +//#include +#include #include #include @@ -59,21 +59,21 @@ void ewol::widget::FileChooser::init() { // Load file with replacing the "{ID}" with the local ID of the widget ==> obtain unique ID loadFromFile("{ewol}DATA:ewol-gui-file-chooser.xml", getId()); // Basic replacement of labels - propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:title-label", "value", propertyLabelTitle); - propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:validate-label", "value", propertyLabelValidate); - propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:cancel-label", "value", propertyLabelCancel); + propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:title-label", "value", propertyLabelTitle); + propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:validate-label", "value", propertyLabelValidate); + propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:cancel-label", "value", propertyLabelCancel); - subBind(ewol::widget::CheckBox, "[" + etk::to_string(getId()) + "]file-shooser:show-hiden-file", signalValue, sharedFromThis(), &ewol::widget::FileChooser::onCallbackHidenFileChangeChangeValue); - subBind(ewol::widget::Button, "[" + etk::to_string(getId()) + "]file-shooser:button-validate", signalPressed, sharedFromThis(), &ewol::widget::FileChooser::onCallbackListValidate); - subBind(ewol::widget::Button, "[" + etk::to_string(getId()) + "]file-shooser:button-cancel", signalPressed, sharedFromThis(), &ewol::widget::FileChooser::onCallbackButtonCancelPressed); - subBind(ewol::widget::ListFileSystem, "[" + etk::to_string(getId()) + "]file-shooser:list-folder", signalFolderValidate, sharedFromThis(), &ewol::widget::FileChooser::onCallbackListFolderSelectChange); - subBind(ewol::widget::ListFileSystem, "[" + etk::to_string(getId()) + "]file-shooser:list-files", signalFileSelect, sharedFromThis(), &ewol::widget::FileChooser::onCallbackListFileSelectChange); - subBind(ewol::widget::ListFileSystem, "[" + etk::to_string(getId()) + "]file-shooser:list-files", signalFileValidate, sharedFromThis(), &ewol::widget::FileChooser::onCallbackListFileValidate); - subBind(ewol::widget::Entry, "[" + etk::to_string(getId()) + "]file-shooser:entry-file", signalModify, sharedFromThis(), &ewol::widget::FileChooser::onCallbackEntryFileChangeValue); - subBind(ewol::widget::Entry, "[" + etk::to_string(getId()) + "]file-shooser:entry-file", signalEnter, sharedFromThis(), &ewol::widget::FileChooser::onCallbackListFileValidate); - subBind(ewol::widget::Entry, "[" + etk::to_string(getId()) + "]file-shooser:entry-folder", signalModify, sharedFromThis(), &ewol::widget::FileChooser::onCallbackEntryFolderChangeValue); - //composerBind(ewol::widget::CheckBox, "[" + etk::to_string(getId()) + "]file-shooser:entry-folder", signalEnter, sharedFromThis(), &ewol::widget::FileChooser::); - subBind(ewol::widget::Image, "[" + etk::to_string(getId()) + "]file-shooser:img-home", signalPressed, sharedFromThis(), &ewol::widget::FileChooser::onCallbackHomePressed); + subBind(ewol::widget::CheckBox, "[" + etk::toString(getId()) + "]file-shooser:show-hiden-file", signalValue, sharedFromThis(), &ewol::widget::FileChooser::onCallbackHidenFileChangeChangeValue); + subBind(ewol::widget::Button, "[" + etk::toString(getId()) + "]file-shooser:button-validate", signalPressed, sharedFromThis(), &ewol::widget::FileChooser::onCallbackListValidate); + subBind(ewol::widget::Button, "[" + etk::toString(getId()) + "]file-shooser:button-cancel", signalPressed, sharedFromThis(), &ewol::widget::FileChooser::onCallbackButtonCancelPressed); + subBind(ewol::widget::ListFileSystem, "[" + etk::toString(getId()) + "]file-shooser:list-folder", signalFolderValidate, sharedFromThis(), &ewol::widget::FileChooser::onCallbackListFolderSelectChange); + subBind(ewol::widget::ListFileSystem, "[" + etk::toString(getId()) + "]file-shooser:list-files", signalFileSelect, sharedFromThis(), &ewol::widget::FileChooser::onCallbackListFileSelectChange); + subBind(ewol::widget::ListFileSystem, "[" + etk::toString(getId()) + "]file-shooser:list-files", signalFileValidate, sharedFromThis(), &ewol::widget::FileChooser::onCallbackListFileValidate); + subBind(ewol::widget::Entry, "[" + etk::toString(getId()) + "]file-shooser:entry-file", signalModify, sharedFromThis(), &ewol::widget::FileChooser::onCallbackEntryFileChangeValue); + subBind(ewol::widget::Entry, "[" + etk::toString(getId()) + "]file-shooser:entry-file", signalEnter, sharedFromThis(), &ewol::widget::FileChooser::onCallbackListFileValidate); + subBind(ewol::widget::Entry, "[" + etk::toString(getId()) + "]file-shooser:entry-folder", signalModify, sharedFromThis(), &ewol::widget::FileChooser::onCallbackEntryFolderChangeValue); + //composerBind(ewol::widget::CheckBox, "[" + etk::toString(getId()) + "]file-shooser:entry-folder", signalEnter, sharedFromThis(), &ewol::widget::FileChooser::); + subBind(ewol::widget::Image, "[" + etk::toString(getId()) + "]file-shooser:img-home", signalPressed, sharedFromThis(), &ewol::widget::FileChooser::onCallbackHomePressed); // set the default Folder properties: updateCurrentFolder(); propertyCanFocus.set(true); @@ -81,7 +81,7 @@ void ewol::widget::FileChooser::init() { void ewol::widget::FileChooser::onGetFocus() { // transfert focus on a specific widget... - propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:entry-file", "focus", "true"); + propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:entry-file", "focus", "true"); } ewol::widget::FileChooser::~FileChooser() { @@ -94,32 +94,32 @@ void ewol::widget::FileChooser::onChangePropertyPath() { } void ewol::widget::FileChooser::onChangePropertyFile() { - propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:entry-file", "value", propertyFile); + propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:entry-file", "value", propertyFile); //updateCurrentFolder(); } void ewol::widget::FileChooser::onChangePropertyLabelTitle() { - propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:title-label", "value", propertyLabelTitle); + propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:title-label", "value", propertyLabelTitle); } void ewol::widget::FileChooser::onChangePropertyLabelValidate() { - propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:validate-label", "value", propertyLabelValidate); + propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:validate-label", "value", propertyLabelValidate); } void ewol::widget::FileChooser::onChangePropertyLabelCancel() { - propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:cancel-label", "value", propertyLabelCancel); + propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:cancel-label", "value", propertyLabelCancel); } -void ewol::widget::FileChooser::onCallbackEntryFolderChangeValue(const std::string& _value) { +void ewol::widget::FileChooser::onCallbackEntryFolderChangeValue(const etk::String& _value) { // == > change the folder name // TODO : change the folder, if it exit ... } -void ewol::widget::FileChooser::onCallbackEntryFileChangeValue(const std::string& _value) { +void ewol::widget::FileChooser::onCallbackEntryFileChangeValue(const etk::String& _value) { // == > change the file name propertyFile.setDirect(_value); // update the selected file in the list : - propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:list-files", "select", propertyFile); + propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-files", "select", propertyFile); } void ewol::widget::FileChooser::onCallbackButtonCancelPressed() { @@ -130,15 +130,15 @@ void ewol::widget::FileChooser::onCallbackButtonCancelPressed() { void ewol::widget::FileChooser::onCallbackHidenFileChangeChangeValue(const bool& _value) { if (_value == true) { - propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:list-folder", "show-hidden", "true"); - propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:list-files", "show-hidden", "true"); + propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-folder", "show-hidden", "true"); + propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-files", "show-hidden", "true"); } else { - propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:list-folder", "show-hidden", "false"); - propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:list-files", "show-hidden", "false"); + propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-folder", "show-hidden", "false"); + propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-files", "show-hidden", "false"); } } -void ewol::widget::FileChooser::onCallbackListFolderSelectChange(const std::string& _value) { +void ewol::widget::FileChooser::onCallbackListFolderSelectChange(const etk::String& _value) { // == > this is an internal event ... EWOL_DEBUG(" old PATH: '" << *propertyPath << "' + '" << _value << "'"); propertyPath.setDirect(propertyPath.get() + _value); @@ -148,16 +148,16 @@ void ewol::widget::FileChooser::onCallbackListFolderSelectChange(const std::stri updateCurrentFolder(); } -void ewol::widget::FileChooser::onCallbackListFileSelectChange(const std::string& _value) { +void ewol::widget::FileChooser::onCallbackListFileSelectChange(const etk::String& _value) { propertyFile.set(_value); /* - std::string tmpFileCompleatName = m_folder; + etk::String tmpFileCompleatName = m_folder; tmpFileCompleatName += m_file; // TODO : generateEventId(_msg.getMessage(), tmpFileCompleatName); */ } -void ewol::widget::FileChooser::onCallbackListFileValidate(const std::string& _value) { +void ewol::widget::FileChooser::onCallbackListFileValidate(const etk::String& _value) { // select the file == > generate a validate propertyFile.set(_value); EWOL_VERBOSE(" generate a fiel opening : '" << propertyPath << "' / '" << propertyFile << "'"); @@ -176,7 +176,7 @@ void ewol::widget::FileChooser::onCallbackListValidate() { } void ewol::widget::FileChooser::onCallbackHomePressed() { - std::string tmpUserFolder = etk::getUserHomeFolder(); + etk::String tmpUserFolder = etk::getUserHomeFolder(); EWOL_DEBUG("new PATH : \"" << tmpUserFolder << "\""); propertyPath.setDirect(etk::simplifyPath(tmpUserFolder)); @@ -191,14 +191,14 @@ void ewol::widget::FileChooser::updateCurrentFolder() { propertyPath.getDirect() += "/"; } } - propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:list-files", "path", propertyPath); - propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:list-folder", "path", propertyPath); - propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:entry-folder", "value", propertyPath); + propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-files", "path", propertyPath); + propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-folder", "path", propertyPath); + propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:entry-folder", "value", propertyPath); markToRedraw(); } -std::string ewol::widget::FileChooser::getCompleateFileName() { - std::string tmpString = propertyPath; +etk::String ewol::widget::FileChooser::getCompleateFileName() { + etk::String tmpString = propertyPath; tmpString += "/"; tmpString += propertyFile; etk::FSNode node(tmpString); diff --git a/ewol/widget/meta/FileChooser.hpp b/ewol/widget/meta/FileChooser.hpp index 7724bab8..9d485ebc 100644 --- a/ewol/widget/meta/FileChooser.hpp +++ b/ewol/widget/meta/FileChooser.hpp @@ -54,7 +54,7 @@ namespace ewol { * Now we just need to wait the the open event message. * * [code style=c++] - * void ****::onCallbackOpenFile(const std::string& _value) { + * void ****::onCallbackOpenFile(const etk::String& _value) { * APPL_INFO("Request open file : '" << _value << "'"); * } * void ****::onCallbackClosePopUp() { @@ -66,13 +66,13 @@ namespace ewol { class FileChooser : public ewol::widget::Composer { public: // signals esignal::Signal<> signalCancel; //!< abort the display of the pop-up or press cancel button - esignal::Signal signalValidate; //!< select file(s) + esignal::Signal signalValidate; //!< select file(s) public: // properties - eproperty::Value propertyPath; //!< Current path to explore - eproperty::Value propertyFile; //!< Selected file - eproperty::Value propertyLabelTitle; //!< Label of the pop-up (can use translation) - eproperty::Value propertyLabelValidate; //!< Label of validate button of the pop-up (can use translation) - eproperty::Value propertyLabelCancel; //!< Label of cancel/close button of the pop-up (can use translation) + eproperty::Value propertyPath; //!< Current path to explore + eproperty::Value propertyFile; //!< Selected file + eproperty::Value propertyLabelTitle; //!< Label of the pop-up (can use translation) + eproperty::Value propertyLabelValidate; //!< Label of validate button of the pop-up (can use translation) + eproperty::Value propertyLabelCancel; //!< Label of cancel/close button of the pop-up (can use translation) protected: FileChooser(); void init() override; @@ -80,19 +80,19 @@ namespace ewol { DECLARE_WIDGET_FACTORY(FileChooser, "FileChooser"); virtual ~FileChooser(); private: - std::string getCompleateFileName(); + etk::String getCompleateFileName(); void updateCurrentFolder(); public: void onGetFocus() override; private: // callback functions: - void onCallbackEntryFolderChangeValue(const std::string& _value); - void onCallbackEntryFileChangeValue(const std::string& _value); + void onCallbackEntryFolderChangeValue(const etk::String& _value); + void onCallbackEntryFileChangeValue(const etk::String& _value); void onCallbackButtonCancelPressed(); void onCallbackHidenFileChangeChangeValue(const bool& _value); - void onCallbackListFolderSelectChange(const std::string& _value); - void onCallbackListFileSelectChange(const std::string& _value); - void onCallbackListFileValidate(const std::string& _value); + void onCallbackListFolderSelectChange(const etk::String& _value); + void onCallbackListFileSelectChange(const etk::String& _value); + void onCallbackListFileValidate(const etk::String& _value); void onCallbackListValidate(); void onCallbackHomePressed(); protected: diff --git a/ewol/widget/meta/Parameter.cpp b/ewol/widget/meta/Parameter.cpp index 910172ff..bd152edc 100644 --- a/ewol/widget/meta/Parameter.cpp +++ b/ewol/widget/meta/Parameter.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include @@ -206,7 +206,7 @@ void ewol::widget::Parameter::onCallbackMenuSelected(const int32_t& _value) { } } -void ewol::widget::Parameter::menuAdd(std::string _label, std::string _image, ewol::WidgetShared _associateWidget) { +void ewol::widget::Parameter::menuAdd(etk::String _label, etk::String _image, ewol::WidgetShared _associateWidget) { if (m_paramList != nullptr) { m_paramList->menuAdd(_label, m_currentIdList, _image); if (m_wSlider != nullptr) { @@ -218,7 +218,7 @@ void ewol::widget::Parameter::menuAdd(std::string _label, std::string _image, ew if (myLabel == nullptr) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { - myLabel->propertyValue.set(std::string("No widget for : ") + _label); + myLabel->propertyValue.set(etk::String("No widget for : ") + _label); myLabel->propertyExpand.set(bvec2(true,true)); m_wSlider->subWidgetAdd(myLabel); } @@ -230,7 +230,7 @@ void ewol::widget::Parameter::menuAdd(std::string _label, std::string _image, ew m_currentIdList++; } } -void ewol::widget::Parameter::menuAddGroup(std::string _label) { +void ewol::widget::Parameter::menuAddGroup(etk::String _label) { if (m_paramList != nullptr) { m_paramList->menuSeparator(); m_paramList->menuAddGroup(_label); diff --git a/ewol/widget/meta/Parameter.hpp b/ewol/widget/meta/Parameter.hpp index 5efd7455..44dbbbf2 100644 --- a/ewol/widget/meta/Parameter.hpp +++ b/ewol/widget/meta/Parameter.hpp @@ -29,7 +29,7 @@ namespace ewol { public: // signals esignal::Signal<> signalClose; public: // properties - eproperty::Value propertyLabelTitle; + eproperty::Value propertyLabelTitle; protected: Parameter(); void init(); @@ -37,8 +37,8 @@ namespace ewol { DECLARE_WIDGET_FACTORY(Parameter, "Parameter"); virtual ~Parameter(); public: - void menuAdd(std::string _label, std::string _image, ewol::WidgetShared _associateWidget); - void menuAddGroup(std::string _label); + void menuAdd(etk::String _label, etk::String _image, ewol::WidgetShared _associateWidget); + void menuAddGroup(etk::String _label); void menuClear(); void menuSeparator(); private: diff --git a/ewol/widget/meta/ParameterList.cpp b/ewol/widget/meta/ParameterList.cpp index c9749f1a..a8df31a7 100644 --- a/ewol/widget/meta/ParameterList.cpp +++ b/ewol/widget/meta/ParameterList.cpp @@ -54,7 +54,7 @@ void ewol::widget::ParameterList::addOObject(const ememory::SharedPtr= m_listOObject.size() ) { - m_listOObject.push_back(_newObject); + m_listOObject.pushBack(_newObject); } else { m_listOObject.insert(m_listOObject.begin()+_pos, _newObject); } @@ -106,7 +106,7 @@ void ewol::widget::ParameterList::onRegenerateDisplay() { (minHeight + 2*m_paddingSizeY) * nbRaw ); - std::vector listSizeColomn; + etk::Vector listSizeColomn; // set background color : ememory::SharedPtr tmpDraw = ememory::makeShared(); @@ -131,7 +131,7 @@ void ewol::widget::ParameterList::onRegenerateDisplay() { tmpOriginY = m_size.y() - (-m_originScrooled.y() + (startRaw+1)*(minHeight + 2*m_paddingSizeY)); for (int32_t iii=startRaw; iii fg(0x00, 0x00, 0x00, 0xFF); if (m_list[iii] != nullptr) { myTextToWrite = TRANSLATE(m_list[iii]->m_label); @@ -200,27 +200,27 @@ void ewol::widget::ParameterList::onLostFocus() { EWOL_DEBUG("Ewol::List Lost focus"); } -void ewol::widget::ParameterList::menuAdd(std::string& _label, int32_t _refId, std::string& _image) { +void ewol::widget::ParameterList::menuAdd(etk::String& _label, int32_t _refId, etk::String& _image) { ememory::SharedPtr tmpEmement = ememory::makeShared(_label, _refId, _image, false); if (tmpEmement == nullptr) { EWOL_ERROR("Can not allocacte menu parameter"); return; } - m_list.push_back(tmpEmement); + m_list.pushBack(tmpEmement); if (m_idSelected == -1 && _label != "---" && _refId>0) { m_idSelected = m_list.size()-1; } markToRedraw(); } -void ewol::widget::ParameterList::menuAddGroup(std::string& _label) { - std::string image = ""; +void ewol::widget::ParameterList::menuAddGroup(etk::String& _label) { + etk::String image = ""; ememory::SharedPtr tmpEmement = ememory::makeShared(_label, -1, image, true); if (tmpEmement == nullptr) { EWOL_ERROR("Can not allocacte menu parameter"); return; } - m_list.push_back(tmpEmement); + m_list.pushBack(tmpEmement); markToRedraw(); } @@ -231,8 +231,8 @@ void ewol::widget::ParameterList::menuClear() { void ewol::widget::ParameterList::menuSeparator() { if (m_list.size()>0) { - std::string label = ""; - std::string image = ""; + etk::String label = ""; + etk::String image = ""; menuAdd(label, -1, image); } } diff --git a/ewol/widget/meta/ParameterList.hpp b/ewol/widget/meta/ParameterList.hpp index 0b97e70a..fec2cf33 100644 --- a/ewol/widget/meta/ParameterList.hpp +++ b/ewol/widget/meta/ParameterList.hpp @@ -15,10 +15,10 @@ namespace ewol { class elementPL { public : bool m_group; - std::string m_label; + etk::String m_label; int32_t m_refId; - std::string m_image; - elementPL(std::string& _label, int32_t _refId, std::string& _image, bool _isGroup) : + etk::String m_image; + elementPL(etk::String& _label, int32_t _refId, etk::String& _image, bool _isGroup) : m_group(_isGroup), m_label(_label), m_refId(_refId), @@ -40,17 +40,17 @@ namespace ewol { private: int32_t m_idSelected; - std::vector> m_list; + etk::Vector> m_list; protected: ParameterList(); void init() override; public: DECLARE_WIDGET_FACTORY(ParameterList, "ParameterList"); virtual ~ParameterList(); - void setLabel(std::string _newLabel); + void setLabel(etk::String _newLabel); // drawing capabilities .... private: - std::vector> m_listOObject; //!< generic element to display... + etk::Vector> m_listOObject; //!< generic element to display... public: void addOObject(const ememory::SharedPtr& _newObject, int32_t _pos=-1); void clearOObjectList(); @@ -61,8 +61,8 @@ namespace ewol { int32_t m_displayStartRaw; //!< Current starting diaplayed raw int32_t m_displayCurrentNbLine; //!< Number of line in the display public: - void menuAdd(std::string& _label, int32_t _refId, std::string& _image); - void menuAddGroup(std::string& _label); + void menuAdd(etk::String& _label, int32_t _refId, etk::String& _image); + void menuAddGroup(etk::String& _label); void menuClear(); void menuSeparator(); diff --git a/ewol/widget/meta/SpinBase.cpp b/ewol/widget/meta/SpinBase.cpp index 9438c84a..bc4396fe 100644 --- a/ewol/widget/meta/SpinBase.cpp +++ b/ewol/widget/meta/SpinBase.cpp @@ -68,7 +68,7 @@ void ewol::widget::SpinBase::updateGui() { markToRedraw(); requestUpdateSize(); if (m_widgetEntry == nullptr) { - std::string shaper; + etk::String shaper; if (m_config != nullptr) { shaper = m_config->getString(m_confIdEntryShaper); EWOL_VERBOSE("shaper entry : " << shaper); @@ -80,7 +80,7 @@ void ewol::widget::SpinBase::updateGui() { } } if (m_widgetButtonDown == nullptr) { - std::string shaper; + etk::String shaper; if (m_config != nullptr) { shaper = m_config->getString(m_confIdDownShaper); EWOL_VERBOSE("shaper button DOWN : " << shaper); @@ -89,13 +89,13 @@ void ewol::widget::SpinBase::updateGui() { if (m_widgetButtonDown != nullptr) { m_widgetButtonDown->propertyExpand.set(bvec2(false,false)); m_widgetButtonDown->propertyFill.set(bvec2(true,true)); - std::string data = m_config->getString(m_confIdDownData); + etk::String data = m_config->getString(m_confIdDownData); ewol::WidgetShared widget = ewol::widget::composerGenerateString(data); m_widgetButtonDown->setSubWidget(widget); } } if (m_widgetButtonUp == nullptr) { - std::string shaper; + etk::String shaper; if (m_config != nullptr) { shaper = m_config->getString(m_confIdUpShaper); EWOL_VERBOSE("shaper button UP : " << shaper); @@ -104,7 +104,7 @@ void ewol::widget::SpinBase::updateGui() { if (m_widgetButtonUp != nullptr) { m_widgetButtonUp->propertyExpand.set(bvec2(false,false)); m_widgetButtonUp->propertyFill.set(bvec2(true,true)); - std::string data = m_config->getString(m_confIdUpData); + etk::String data = m_config->getString(m_confIdUpData); ewol::WidgetShared widget = ewol::widget::composerGenerateString(data); m_widgetButtonUp->setSubWidget(widget); } diff --git a/ewol/widget/meta/SpinBase.hpp b/ewol/widget/meta/SpinBase.hpp index 57611cb9..48c440c6 100644 --- a/ewol/widget/meta/SpinBase.hpp +++ b/ewol/widget/meta/SpinBase.hpp @@ -63,7 +63,7 @@ namespace ewol { */ class SpinBase : public ewol::widget::Sizer { public: // properties list: - eproperty::Value propertyShape; //!< Shape of the widget + eproperty::Value propertyShape; //!< Shape of the widget eproperty::List propertySpinMode; //!< How to display the spin base public: UN_DECLARE_FACTORY(SpinBase); diff --git a/ewol/widget/meta/StdPopUp.cpp b/ewol/widget/meta/StdPopUp.cpp index 7a555754..e49ae9c3 100644 --- a/ewol/widget/meta/StdPopUp.cpp +++ b/ewol/widget/meta/StdPopUp.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include ewol::widget::StdPopUp::StdPopUp() : propertyTitle(this, "title", @@ -99,7 +99,7 @@ void ewol::widget::StdPopUp::onChangePropertyComment() { markToRedraw(); } -ewol::widget::ButtonShared ewol::widget::StdPopUp::addButton(const std::string& _text, bool _autoExit) { +ewol::widget::ButtonShared ewol::widget::StdPopUp::addButton(const etk::String& _text, bool _autoExit) { if (m_subBar == nullptr) { EWOL_ERROR("button-bar does not existed ..."); return nullptr; diff --git a/ewol/widget/meta/StdPopUp.hpp b/ewol/widget/meta/StdPopUp.hpp index 2a0edc42..76d01e03 100644 --- a/ewol/widget/meta/StdPopUp.hpp +++ b/ewol/widget/meta/StdPopUp.hpp @@ -40,8 +40,8 @@ namespace ewol { */ class StdPopUp : public ewol::widget::PopUp { public: // properties: - eproperty::Value propertyTitle; //!< Title of the pop-up - eproperty::Value propertyComment; //!< comment in the pop-up (can be decorated text) + eproperty::Value propertyTitle; //!< Title of the pop-up + eproperty::Value propertyComment; //!< comment in the pop-up (can be decorated text) protected: /** * @brief std-pop-up constructor. @@ -72,7 +72,7 @@ namespace ewol { * @brief Add a buttom button. * @param[in] _text Decorated text to diplay in button. */ - ewol::widget::ButtonShared addButton(const std::string& _text, bool _autoExit=false); + ewol::widget::ButtonShared addButton(const etk::String& _text, bool _autoExit=false); public: virtual void onCallBackButtonExit(); }; diff --git a/lutin_ewol.py b/lutin_ewol.py index 80127139..6ec5995d 100644 --- a/lutin_ewol.py +++ b/lutin_ewol.py @@ -241,7 +241,7 @@ def configure(target, my_module): my_module.add_path(".") my_module.add_flag('c++', [ - "-DEWOL_VERSION=\"\\\"" + tools.version_to_string(my_module.get_pkg("VERSION")) + "\\\"\"" + "-DEWOL_VERSION=\"\\\"" + tools.version_toString(my_module.get_pkg("VERSION")) + "\\\"\"" ]) return True diff --git a/sample/CustomWidgets/appl/Main.cpp b/sample/CustomWidgets/appl/Main.cpp index 06103455..75c1ee40 100644 --- a/sample/CustomWidgets/appl/Main.cpp +++ b/sample/CustomWidgets/appl/Main.cpp @@ -22,7 +22,7 @@ class MainApplication : public ewol::context::Application { void onCreate(ewol::Context& _context) override { APPL_INFO(" == > CREATE ... " << PROJECT_NAME << " v" << APPL_VERSION << " (START) [" << gale::getBoardType() << "] (" << gale::getCompilationMode() << ") (BEGIN)"); for( int32_t iii=0 ; iii<_context.getCmd().size(); iii++) { - std::string tmpppp = _context.getCmd().get(iii); + etk::String tmpppp = _context.getCmd().get(iii); if ( tmpppp == "-h" || tmpppp == "--help") { APPL_INFO(" -h/--help display this help" ); diff --git a/sample/CustomWidgets/appl/Windows.cpp b/sample/CustomWidgets/appl/Windows.cpp index fe0971b5..49a46261 100644 --- a/sample/CustomWidgets/appl/Windows.cpp +++ b/sample/CustomWidgets/appl/Windows.cpp @@ -15,12 +15,12 @@ appl::Windows::Windows() : m_composer(nullptr) { addObjectType("appl::Windows"); - propertyTitle.setDirectCheck(std::string("sample ") + PROJECT_NAME); + propertyTitle.setDirectCheck(etk::String("sample ") + PROJECT_NAME); } void appl::Windows::init() { ewol::widget::Windows::init(); - std::string composition = std::string(""); + etk::String composition = etk::String(""); composition += "\n"; composition += " \n"; composition += "