diff --git a/sources/ewol/compositing/Area.cpp b/sources/ewol/compositing/Area.cpp index f1338fcf..24e50187 100644 --- a/sources/ewol/compositing/Area.cpp +++ b/sources/ewol/compositing/Area.cpp @@ -15,13 +15,13 @@ ewol::compositing::Area::Area(const ivec2& _size) : m_position(0.0, 0.0, 0.0), m_color(etk::color::white), - m_GLprogram(NULL), + m_GLprogram(nullptr), m_GLPosition(-1), m_GLMatrix(-1), m_GLColor(-1), m_GLtexture(-1), m_GLtexID(-1), - m_resource(NULL) { + m_resource(nullptr) { m_resource = ewol::resource::Texture::keep(); m_resource->setImageSize(_size); m_resource->flush(); @@ -37,7 +37,7 @@ void ewol::compositing::Area::loadProgram() { // get the shader resource : m_GLPosition = 0; m_GLprogram = ewol::resource::Program::keep("DATA:textured3D.prog"); - if (NULL != m_GLprogram) { + if (nullptr != m_GLprogram) { m_GLPosition = m_GLprogram->getAttribute("EW_coord3d"); m_GLColor = m_GLprogram->getAttribute("EW_color"); m_GLtexture = m_GLprogram->getAttribute("EW_texture2d"); @@ -51,11 +51,11 @@ void ewol::compositing::Area::draw(bool _disableDepthTest) { //EWOL_WARNING("Nothink to draw..."); return; } - if (m_resource == NULL) { + if (m_resource == nullptr) { // this is a normale case ... the user can choice to have no image ... return; } - if (m_GLprogram == NULL) { + if (m_GLprogram == nullptr) { EWOL_ERROR("No shader ..."); return; } diff --git a/sources/ewol/compositing/Drawing.cpp b/sources/ewol/compositing/Drawing.cpp index 1f2e5aed..ccbcb5a6 100644 --- a/sources/ewol/compositing/Drawing.cpp +++ b/sources/ewol/compositing/Drawing.cpp @@ -224,7 +224,7 @@ ewol::compositing::Drawing::Drawing() : m_clippingEnable(false), m_color(etk::color::black), m_colorBg(etk::color::none), - m_GLprogram(NULL), + m_GLprogram(nullptr), m_GLPosition(-1), m_GLMatrix(-1), m_GLColor(-1), @@ -286,7 +286,7 @@ void ewol::compositing::Drawing::loadProgram() { // oad the new ... m_GLprogram = ewol::resource::Program::keep("DATA:color3.prog"); // get the shader resource : - if (NULL != m_GLprogram ) { + if (nullptr != m_GLprogram ) { m_GLPosition = m_GLprogram->getAttribute("EW_coord3d"); m_GLColor = m_GLprogram->getAttribute("EW_color"); m_GLMatrix = m_GLprogram->getUniform("EW_MatrixTransformation"); @@ -299,7 +299,7 @@ void ewol::compositing::Drawing::draw(bool _disableDepthTest) { //EWOL_WARNING("Nothink to draw..."); return; } - if (m_GLprogram == NULL) { + if (m_GLprogram == nullptr) { EWOL_ERROR("No shader ..."); return; } diff --git a/sources/ewol/compositing/Image.cpp b/sources/ewol/compositing/Image.cpp index 7eabd9f2..ea713d4e 100644 --- a/sources/ewol/compositing/Image.cpp +++ b/sources/ewol/compositing/Image.cpp @@ -21,15 +21,15 @@ ewol::compositing::Image::Image(const std::string& _imageName, bool _df) : m_clippingEnable(false), m_color(etk::color::white), m_angle(0.0), - m_GLprogram(NULL), + m_GLprogram(nullptr), m_GLPosition(-1), m_GLMatrix(-1), m_GLColor(-1), m_GLtexture(-1), m_GLtexID(-1), m_distanceFieldMode(_df), - m_resource(NULL), - m_resourceDF(NULL) { + m_resource(nullptr), + m_resourceDF(nullptr) { setSource(_imageName); loadProgram(); } @@ -49,7 +49,7 @@ void ewol::compositing::Image::loadProgram() { } else { m_GLprogram = ewol::resource::Program::keep("DATA:textured3D.prog"); } - if (m_GLprogram != NULL) { + if (m_GLprogram != nullptr) { m_GLPosition = m_GLprogram->getAttribute("EW_coord3d"); m_GLColor = m_GLprogram->getAttribute("EW_color"); m_GLtexture = m_GLprogram->getAttribute("EW_texture2d"); @@ -63,12 +63,12 @@ void ewol::compositing::Image::draw(bool _disableDepthTest) { //EWOL_WARNING("Nothink to draw..."); return; } - if ( m_resource == NULL - && m_resourceDF == NULL) { + if ( m_resource == nullptr + && m_resourceDF == nullptr) { // this is a normale case ... the user can choice to have no image ... return; } - if (m_GLprogram == NULL) { + if (m_GLprogram == nullptr) { EWOL_ERROR("No shader ..."); return; } @@ -82,7 +82,7 @@ void ewol::compositing::Image::draw(bool _disableDepthTest) { m_GLprogram->use(); m_GLprogram->uniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat); // TextureID - if (m_resource != NULL) { + if (m_resource != nullptr) { if (m_distanceFieldMode == true) { EWOL_ERROR("FONT type error Request distance field and display normal ..."); } @@ -253,31 +253,31 @@ void ewol::compositing::Image::setSource(const std::string& _newFile, const vec2 ewol::resource::ImageDF* resourceDF = m_resourceDF; m_filename = _newFile; m_requestSize = _size; - m_resource = NULL; - m_resourceDF = NULL; + m_resource = nullptr; + m_resourceDF = nullptr; ivec2 tmpSize(_size.x(),_size.y()); // note that no image can be loaded... if (_newFile != "") { // link to new one if (m_distanceFieldMode == false) { m_resource = ewol::resource::TextureFile::keep(m_filename, tmpSize); - if (NULL == m_resource) { + if (nullptr == m_resource) { EWOL_ERROR("Can not get Image resource"); } } else { m_resourceDF = ewol::resource::ImageDF::keep(m_filename, tmpSize); - if (NULL == m_resourceDF) { + if (nullptr == m_resourceDF) { EWOL_ERROR("Can not get Image resource DF"); } } } - if ( m_resource == NULL - && m_resourceDF == NULL) { - if (resource != NULL) { + if ( m_resource == nullptr + && m_resourceDF == nullptr) { + if (resource != nullptr) { EWOL_WARNING("Retrive previous resource"); m_resource = resource; } - if (resourceDF != NULL) { + if (resourceDF != nullptr) { EWOL_WARNING("Retrive previous resource (DF)"); m_resourceDF = resourceDF; } @@ -288,19 +288,19 @@ void ewol::compositing::Image::setSource(const std::string& _newFile, const vec2 } bool ewol::compositing::Image::hasSources() { - return (m_resource != NULL || m_resourceDF != NULL); + return (m_resource != nullptr || m_resourceDF != NULL); } vec2 ewol::compositing::Image::getRealSize() { - if ( m_resource == NULL - && m_resourceDF == NULL) { + if ( m_resource == nullptr + && m_resourceDF == nullptr) { return vec2(0,0); } - if (m_resource != NULL) { + if (m_resource != nullptr) { return m_resource->getRealSize(); } - if (m_resourceDF != NULL) { + if (m_resourceDF != nullptr) { return m_resourceDF->getRealSize(); } return vec2(0,0); diff --git a/sources/ewol/compositing/Shaper.cpp b/sources/ewol/compositing/Shaper.cpp index e972462a..ac74a6f4 100644 --- a/sources/ewol/compositing/Shaper.cpp +++ b/sources/ewol/compositing/Shaper.cpp @@ -15,21 +15,21 @@ ewol::compositing::Shaper::Shaper(const std::string& _shaperName) : m_name(_shaperName), - m_config(NULL), + m_config(nullptr), m_confIdMode(-1), m_confIdDisplayOutside(-1), m_confIdChangeTime(-1), m_confProgramFile(-1), m_confColorFile(-1), m_confImageFile(-1), - m_GLprogram(NULL), + m_GLprogram(nullptr), m_GLPosition(-1), m_GLMatrix(-1), m_GLStateActivate(-1), m_GLStateOld(-1), m_GLStateNew(-1), m_GLStateTransition(-1), - m_resourceTexture(NULL), + m_resourceTexture(nullptr), m_nextStatusRequested(-1), m_propertyOrigin(0,0), m_propertySize(0,0), @@ -85,7 +85,7 @@ void ewol::compositing::Shaper::loadProgram() { return; } m_config = ewol::resource::ConfigFile::keep(m_name); - if (NULL != m_config) { + if (nullptr != m_config) { m_confIdMode = m_config->request("mode"); m_confIdDisplayOutside = m_config->request("display-outside"); m_confIdPaddingOut[shaperPosLeft] = m_config->request("padding-out-left"); @@ -119,7 +119,7 @@ void ewol::compositing::Shaper::loadProgram() { // get the shader resource : m_GLPosition = 0; m_GLprogram = ewol::resource::Program::keep(tmpFilename); - if (m_GLprogram != NULL) { + if (m_GLprogram != nullptr) { m_GLPosition = m_GLprogram->getAttribute("EW_coord2d"); m_GLMatrix = m_GLprogram->getUniform("EW_MatrixTransformation"); // Widget property == > for the Vertex shader @@ -159,8 +159,8 @@ void ewol::compositing::Shaper::loadProgram() { EWOL_DEBUG("Shaper try load colorFile : '" << tmpFilename << "'"); } m_colorProperty = ewol::resource::ColorFile::keep(tmpFilename); - if ( m_GLprogram != NULL - && m_colorProperty != NULL) { + if ( m_GLprogram != nullptr + && m_colorProperty != nullptr) { std::vector listColor = m_colorProperty->getColors(); for (auto tmpColor : listColor) { int32_t glId = m_GLprogram->getUniform(tmpColor); @@ -172,11 +172,11 @@ void ewol::compositing::Shaper::loadProgram() { } void ewol::compositing::Shaper::draw(bool _disableDepthTest) { - if (m_config == NULL) { + if (m_config == nullptr) { // this is a normale case ... the user can choice to have no config basic file ... return; } - if (m_GLprogram == NULL) { + if (m_GLprogram == nullptr) { EWOL_ERROR("No shader ..."); return; } @@ -197,7 +197,7 @@ void ewol::compositing::Shaper::draw(bool _disableDepthTest) { for (auto element : m_listAssiciatedId) { m_GLprogram->uniform(element.x(), m_colorProperty->get(element.y())); } - if (NULL!=m_resourceTexture) { + if (nullptr!=m_resourceTexture) { // TextureID m_GLprogram->setTexture0(m_GLtexID, m_resourceTexture->getId()); } @@ -471,7 +471,7 @@ void ewol::compositing::Shaper::setShape(const vec2& _origin, const vec2& _size, EWOL_ERROR(" inside = " << inside); */ int32_t mode = 0; - if (m_config != NULL) { + if (m_config != nullptr) { mode = m_config->getNumber(m_confIdMode); } bool displayOutside = m_config->getBoolean(m_confIdDisplayOutside); @@ -572,7 +572,7 @@ ewol::Padding ewol::compositing::Shaper::getPadding() { ewol::Padding ewol::compositing::Shaper::getPaddingIn() { ewol::Padding padding(0,0,0,0); - if (m_config != NULL) { + if (m_config != nullptr) { padding.setValue(m_config->getNumber(m_confIdPaddingIn[shaperPosLeft]), m_config->getNumber(m_confIdPaddingIn[shaperPosTop]), m_config->getNumber(m_confIdPaddingIn[shaperPosRight]), @@ -583,7 +583,7 @@ ewol::Padding ewol::compositing::Shaper::getPaddingIn() { ewol::Padding ewol::compositing::Shaper::getPaddingOut() { ewol::Padding padding(0,0,0,0); - if (m_config != NULL) { + if (m_config != nullptr) { padding.setValue(m_config->getNumber(m_confIdPaddingOut[shaperPosLeft]), m_config->getNumber(m_confIdPaddingOut[shaperPosTop]), m_config->getNumber(m_confIdPaddingOut[shaperPosRight]), @@ -594,7 +594,7 @@ ewol::Padding ewol::compositing::Shaper::getPaddingOut() { ewol::Padding ewol::compositing::Shaper::getBorder() { ewol::Padding padding(0,0,0,0); - if (m_config != NULL) { + if (m_config != nullptr) { padding.setValue(m_config->getNumber(m_confIdBorder[shaperPosLeft]), m_config->getNumber(m_confIdBorder[shaperPosTop]), m_config->getNumber(m_confIdBorder[shaperPosRight]), @@ -611,13 +611,13 @@ void ewol::compositing::Shaper::setSource(const std::string& _newFile) { } bool ewol::compositing::Shaper::hasSources() { - return m_GLprogram!=NULL; + return m_GLprogram!=nullptr; } const etk::Color& ewol::compositing::Shaper::getColor(int32_t _id) { static const etk::Color errorValue(0,0,0,0); - if (m_colorProperty == NULL) { + if (m_colorProperty == nullptr) { return errorValue; } return m_colorProperty->get(_id); diff --git a/sources/ewol/compositing/Shaper.h b/sources/ewol/compositing/Shaper.h index 2a57c434..f79f2809 100644 --- a/sources/ewol/compositing/Shaper.h +++ b/sources/ewol/compositing/Shaper.h @@ -233,7 +233,7 @@ namespace ewol { * @return The Id of the color */ int32_t requestColor(const std::string& _name) { - if (m_colorProperty == NULL) { + if (m_colorProperty == nullptr) { return -1; } return m_colorProperty->request(_name); @@ -251,7 +251,7 @@ namespace ewol { * @return The Id of the element */ int32_t requestConfig(const std::string& _name) { - if (m_config == NULL) { + if (m_config == nullptr) { return -1; } return m_config->request(_name); @@ -263,7 +263,7 @@ namespace ewol { */ double getConfigNumber(int32_t _id) { if ( _id == -1 - || m_config == NULL) { + || m_config == nullptr) { return 0.0; } return m_config->getNumber(_id); diff --git a/sources/ewol/compositing/Text.cpp b/sources/ewol/compositing/Text.cpp index c7a160ea..6f72d269 100644 --- a/sources/ewol/compositing/Text.cpp +++ b/sources/ewol/compositing/Text.cpp @@ -16,7 +16,7 @@ ewol::compositing::Text::Text(const std::string& _fontName, int32_t _fontSize) : - m_font(NULL) { + m_font(nullptr) { setFont(_fontName, _fontSize); } @@ -30,16 +30,16 @@ void ewol::compositing::Text::drawMT(const mat4& _transformationMatrix, bool _en // draw BG in any case: m_vectorialDraw.draw(); - if (m_coord.size() <= 0 || m_font == NULL) { + if (m_coord.size() <= 0 || m_font == nullptr) { // TODO : a remĂtre ... //EWOL_WARNING("Nothink to draw..."); return; } - if (m_font == NULL) { + if (m_font == nullptr) { EWOL_WARNING("no font..."); return; } - if (m_GLprogram == NULL) { + if (m_GLprogram == nullptr) { EWOL_ERROR("No shader ..."); return; } @@ -74,16 +74,16 @@ void ewol::compositing::Text::drawD(bool _disableDepthTest) { // draw BG in any case: m_vectorialDraw.draw(); - if (m_coord.size() <= 0 || m_font == NULL) { + if (m_coord.size() <= 0 || m_font == nullptr) { // TODO : a remče ... //EWOL_WARNING("Nothink to draw..."); return; } - if (m_font == NULL) { + if (m_font == nullptr) { EWOL_WARNING("no font..."); return; } - if (m_GLprogram == NULL) { + if (m_GLprogram == nullptr) { EWOL_ERROR("No shader ..."); return; } @@ -107,23 +107,23 @@ void ewol::compositing::Text::drawD(bool _disableDepthTest) { } float ewol::compositing::Text::getSize() { - if (m_font == NULL) { + if (m_font == nullptr) { EWOL_WARNING("no font..."); return 1.0f; } return m_font->getFontSize(); } float ewol::compositing::Text::getHeight() { - if (m_font == NULL) { + if (m_font == nullptr) { EWOL_WARNING("no font..."); return 10.0f; } return m_font->getHeight(m_mode); } ewol::GlyphProperty * ewol::compositing::Text::getGlyphPointer(char32_t _charcode) { - if (m_font == NULL) { + if (m_font == nullptr) { EWOL_WARNING("no font..."); - return NULL; + return nullptr; } return m_font->getGlyphPointer(_charcode, m_mode); } @@ -131,7 +131,7 @@ ewol::GlyphProperty * ewol::compositing::Text::getGlyphPointer(char32_t _charcod void ewol::compositing::Text::setFontSize(int32_t _fontSize) { // get old size std::string fontName = ""; - if (m_font != NULL) { + if (m_font != nullptr) { fontName = m_font->getName(); // Remove the :XX for the size ... size_t pos = fontName.rfind(':'); @@ -143,7 +143,7 @@ void ewol::compositing::Text::setFontSize(int32_t _fontSize) { void ewol::compositing::Text::setFontName(const std::string& _fontName) { // get old size int32_t fontSize = -1; - if (m_font != NULL) { + if (m_font != nullptr) { fontSize = m_font->getFontSize(); } setFont(_fontName, fontSize); @@ -164,7 +164,7 @@ void ewol::compositing::Text::setFont(std::string _fontName, int32_t _fontSize) EWOL_VERBOSE("plop : " << _fontName << " size=" << _fontSize << " result :" << _fontName); // link to new one m_font = ewol::resource::TexturedFont::keep(_fontName); - if (m_font == NULL) { + if (m_font == nullptr) { EWOL_ERROR("Can not get font resource"); m_font = previousFont; } else { @@ -173,7 +173,7 @@ void ewol::compositing::Text::setFont(std::string _fontName, int32_t _fontSize) } void ewol::compositing::Text::setFontMode(enum ewol::font::mode _mode) { - if (m_font != NULL) { + if (m_font != nullptr) { m_mode = m_font->getWrappingMode(_mode); } } @@ -181,7 +181,7 @@ void ewol::compositing::Text::setFontMode(enum ewol::font::mode _mode) { void ewol::compositing::Text::printChar(const char32_t& _charcode) { // get a pointer on the glyph property : ewol::GlyphProperty* myGlyph = getGlyphPointer(_charcode); - if (NULL == myGlyph) { + if (nullptr == myGlyph) { EWOL_ERROR(" font does not really existed ..."); return; } diff --git a/sources/ewol/compositing/TextBase.cpp b/sources/ewol/compositing/TextBase.cpp index 0a28774a..fe224779 100644 --- a/sources/ewol/compositing/TextBase.cpp +++ b/sources/ewol/compositing/TextBase.cpp @@ -32,7 +32,7 @@ ewol::compositing::TextBase::TextBase(const std::string& _shaderName, bool _load m_startTextpos(0), m_stopTextPos(0), m_alignement(alignDisable), - m_GLprogram(NULL), + m_GLprogram(nullptr), m_GLPosition(-1), m_GLMatrix(-1), m_GLColor(-1), @@ -55,7 +55,7 @@ void ewol::compositing::TextBase::loadProgram(const std::string& _shaderName) { m_GLPosition = 0; ewol::resource::Program* old = m_GLprogram; m_GLprogram = ewol::resource::Program::keep(_shaderName); - if (m_GLprogram != NULL) { + if (m_GLprogram != nullptr) { m_GLPosition = m_GLprogram->getAttribute("EW_coord3d"); m_GLColor = m_GLprogram->getAttribute("EW_color"); m_GLtexture = m_GLprogram->getAttribute("EW_texture2d"); @@ -66,7 +66,7 @@ void ewol::compositing::TextBase::loadProgram(const std::string& _shaderName) { } else { EWOL_ERROR("Can not load the program => keep previous one..."); m_GLprogram = old; - old = NULL; + old = nullptr; } // Release old program if needed ... ewol::resource::Program::release(old); @@ -249,7 +249,7 @@ void ewol::compositing::TextBase::print(const std::string& _text) { void ewol::compositing::TextBase::parseHtmlNode(exml::Element* _element) { // get the static real pointer - if (_element == NULL) { + if (_element == nullptr) { EWOL_ERROR( "Error Input node does not existed ..."); } for(size_t iii=0; iii< _element->size(); iii++) { @@ -265,7 +265,7 @@ void ewol::compositing::TextBase::parseHtmlNode(exml::Element* _element) { continue; } exml::Element* elem = _element->getElement(iii); - if (elem == NULL) { + if (elem == nullptr) { EWOL_ERROR("Cast error ..."); continue; } @@ -372,13 +372,13 @@ void ewol::compositing::TextBase::printHTML(const std::string& _text) { } exml::Element* root = (exml::Element*)doc.getNamed( "html" ); - if (root == NULL) { + if (root == nullptr) { EWOL_ERROR( "can not load XML: main node not find: \"html\""); doc.display(); return; } exml::Element* bodyNode = (exml::Element*)root->getNamed( "body" ); - if (root == NULL) { + if (root == nullptr) { EWOL_ERROR( "can not load XML: main node not find: \"body\""); return; } @@ -400,13 +400,13 @@ void ewol::compositing::TextBase::printHTML(const std::u32string& _text) { } exml::Element* root = (exml::Element*)doc.getNamed( "html" ); - if (root == NULL) { + if (root == nullptr) { EWOL_ERROR( "can not load XML: main node not find: \"html\""); doc.display(); return; } exml::Element* bodyNode = (exml::Element*)root->getNamed( "body" ); - if (root == NULL) { + if (root == nullptr) { EWOL_ERROR( "can not load XML: main node not find: \"body\""); return; } diff --git a/sources/ewol/compositing/TextDF.cpp b/sources/ewol/compositing/TextDF.cpp index b574dc5f..c16c825e 100644 --- a/sources/ewol/compositing/TextDF.cpp +++ b/sources/ewol/compositing/TextDF.cpp @@ -17,7 +17,7 @@ ewol::compositing::TextDF::TextDF(const std::string& _fontName, int32_t _fontSize) : ewol::compositing::TextBase("", false), - m_fontDF(NULL), + m_fontDF(nullptr), m_GLglyphLevel(-1), m_size(12.0) { setFont(_fontName, _fontSize); @@ -31,7 +31,7 @@ ewol::compositing::TextDF::~TextDF() { void ewol::compositing::TextDF::updateSizeToRender(const vec2& _size) { float minSize = etk_min(_size.x(), _size.y()); - if (m_fontDF != NULL) { + if (m_fontDF != nullptr) { setFontSize(m_fontDF->getSize(minSize)); } } @@ -42,15 +42,15 @@ void ewol::compositing::TextDF::drawMT(const mat4& _transformationMatrix, bool _ // draw BG in any case: m_vectorialDraw.draw(); - if (m_coord.size() <= 0 || m_fontDF == NULL) { + if (m_coord.size() <= 0 || m_fontDF == nullptr) { //EWOL_WARNING("Nothink to draw..."); return; } - if (m_fontDF == NULL) { + if (m_fontDF == nullptr) { EWOL_WARNING("no font..."); return; } - if (m_GLprogram == NULL) { + if (m_GLprogram == nullptr) { EWOL_ERROR("No shader ..."); return; } @@ -84,16 +84,16 @@ void ewol::compositing::TextDF::drawD(bool _disableDepthTest) { // draw BG in any case: m_vectorialDraw.draw(); - if (m_coord.size() <= 0 || m_fontDF == NULL) { + if (m_coord.size() <= 0 || m_fontDF == nullptr) { // TODO : a remètre ... //EWOL_WARNING("Nothink to draw..."); return; } - if (m_fontDF == NULL) { + if (m_fontDF == nullptr) { EWOL_WARNING("no font..."); return; } - if (m_GLprogram == NULL) { + if (m_GLprogram == nullptr) { EWOL_ERROR("No shader ..."); return; } @@ -120,14 +120,14 @@ void ewol::compositing::TextDF::clear() { } void ewol::compositing::TextDF::loadProgram(const std::string& _shaderName) { ewol::compositing::TextBase::loadProgram(_shaderName); - if (m_GLprogram != NULL) { + if (m_GLprogram != nullptr) { m_GLglyphLevel = m_GLprogram->getAttribute("EW_glyphLevel"); } } float ewol::compositing::TextDF::getHeight() { - if (m_fontDF == NULL) { + if (m_fontDF == nullptr) { EWOL_WARNING("no font..."); return 1; } @@ -135,9 +135,9 @@ float ewol::compositing::TextDF::getHeight() { } ewol::GlyphProperty * ewol::compositing::TextDF::getGlyphPointer(char32_t _charcode) { - if (m_fontDF == NULL) { + if (m_fontDF == nullptr) { EWOL_WARNING("no font..."); - return NULL; + return nullptr; } return m_fontDF->getGlyphPointer(_charcode); } @@ -165,7 +165,7 @@ void ewol::compositing::TextDF::setFontName(const std::string& _fontName) { EWOL_VERBOSE("Set font name: '" << fontName << "'"); // link to new one m_fontDF = ewol::resource::DistanceFieldFont::keep(fontName); - if (m_fontDF == NULL) { + if (m_fontDF == nullptr) { EWOL_ERROR("Can not get find resource"); m_fontDF = previousFont; } else { @@ -189,7 +189,7 @@ void ewol::compositing::TextDF::setFontMode(enum ewol::font::mode _mode) { void ewol::compositing::TextDF::printChar(const char32_t& _charcode) { // get a pointer on the glyph property : ewol::GlyphProperty* myGlyph = getGlyphPointer(_charcode); - if (NULL == myGlyph) { + if (nullptr == myGlyph) { EWOL_ERROR(" font does not really existed ..."); return; } diff --git a/sources/ewol/context/Android/Context.cpp b/sources/ewol/context/Android/Context.cpp index 2336932f..e2650b68 100644 --- a/sources/ewol/context/Android/Context.cpp +++ b/sources/ewol/context/Android/Context.cpp @@ -23,7 +23,7 @@ int64_t ewol::getTime() { struct timeval now; - gettimeofday(&now, NULL); + gettimeofday(&now, nullptr); //EWOL_VERBOSE("current time : " << now.tv_sec << "s " << now.tv_usec << "us"); return (int64_t)((int64_t)now.tv_sec*(int64_t)1000000 + (int64_t)now.tv_usec); } @@ -31,7 +31,7 @@ int64_t ewol::getTime() { // jni doc : /usr/lib/jvm/java-1.6.0-openjdk/include -static JavaVM* g_JavaVM=NULL; // global acces on the unique JVM !!! +static JavaVM* g_JavaVM=nullptr; // global acces on the unique JVM !!! etk::Mutex g_interfaceMutex; etk::Mutex g_interfaceAudioMutex; @@ -78,10 +78,10 @@ class AndroidContext : public ewol::Context { private: bool safeInitMethodID(jmethodID& _mid, jclass& _cls, const char* _name, const char* _sign) { _mid = m_JavaVirtualMachinePointer->GetMethodID(_cls, _name, _sign); - if(_mid == NULL) { + if(_mid == nullptr) { EWOL_ERROR("C->java : Can't find the method " << _name); /* remove access on the virtual machine : */ - m_JavaVirtualMachinePointer = NULL; + m_JavaVirtualMachinePointer = nullptr; return false; } return true; @@ -89,7 +89,7 @@ class AndroidContext : public ewol::Context { public: AndroidContext(JNIEnv* _env, jclass _classBase, jobject _objCallback, enum application _typeAPPL) : m_javaApplicationType(_typeAPPL), - m_JavaVirtualMachinePointer(NULL), + m_JavaVirtualMachinePointer(nullptr), m_javaClassEwol(0), m_javaClassEwolCallback(0), m_javaObjectEwolCallback(0), @@ -108,8 +108,8 @@ class AndroidContext : public ewol::Context { m_javaDefaultClassString(0), m_currentHeight(0), m_clipBoardOwnerStd(false), - m_audioCallBack(NULL), - m_audioCallBackUserData(NULL) { + m_audioCallBack(nullptr), + m_audioCallBackUserData(nullptr) { EWOL_DEBUG("*******************************************"); if (m_javaApplicationType == appl_application) { EWOL_DEBUG("** set JVM Pointer (application) **"); @@ -119,21 +119,21 @@ class AndroidContext : public ewol::Context { EWOL_DEBUG("*******************************************"); m_JavaVirtualMachinePointer = _env; // get default needed all time elements : - if (NULL != m_JavaVirtualMachinePointer) { + if (nullptr != m_JavaVirtualMachinePointer) { EWOL_DEBUG("C->java : try load org/ewol/Ewol class"); m_javaClassEwol = m_JavaVirtualMachinePointer->FindClass("org/ewol/Ewol" ); if (m_javaClassEwol == 0) { EWOL_ERROR("C->java : Can't find org/ewol/Ewol class"); // remove access on the virtual machine : - m_JavaVirtualMachinePointer = NULL; + m_JavaVirtualMachinePointer = nullptr; return; } /* The object field extends Activity and implement EwolCallback */ m_javaClassEwolCallback = m_JavaVirtualMachinePointer->GetObjectClass(_objCallback); - if(m_javaClassEwolCallback == NULL) { + if(m_javaClassEwolCallback == nullptr) { EWOL_ERROR("C->java : Can't find org/ewol/EwolCallback class"); // remove access on the virtual machine : - m_JavaVirtualMachinePointer = NULL; + m_JavaVirtualMachinePointer = nullptr; return; } bool functionCallbackIsMissing = false; @@ -258,7 +258,7 @@ class AndroidContext : public ewol::Context { m_javaObjectEwolCallback = _env->NewGlobalRef(_objCallback); //javaObjectEwolCallbackAndActivity = objCallback; - if (m_javaObjectEwolCallback == NULL) { + if (m_javaObjectEwolCallback == nullptr) { functionCallbackIsMissing = true; } @@ -266,7 +266,7 @@ class AndroidContext : public ewol::Context { if (m_javaDefaultClassString == 0) { EWOL_ERROR("C->java : Can't find java/lang/String" ); // remove access on the virtual machine : - m_JavaVirtualMachinePointer = NULL; + m_JavaVirtualMachinePointer = nullptr; functionCallbackIsMissing = true; } if (functionCallbackIsMissing == true) { @@ -281,7 +281,7 @@ class AndroidContext : public ewol::Context { void unInit(JNIEnv* _env) { _env->DeleteGlobalRef(m_javaObjectEwolCallback); - m_javaObjectEwolCallback = NULL; + m_javaObjectEwolCallback = nullptr; } int32_t run() { @@ -387,7 +387,7 @@ class AndroidContext : public ewol::Context { } //Call java ... jstring returnString = (jstring) m_JavaVirtualMachinePointer->CallObjectMethod(m_javaObjectEwolCallback, m_javaMethodEwolActivityAudioGetDeviceProperty, _idDevice); - const char *js = m_JavaVirtualMachinePointer->GetStringUTFChars(returnString, NULL); + const char *js = m_JavaVirtualMachinePointer->GetStringUTFChars(returnString, nullptr); std::string retString(js); m_JavaVirtualMachinePointer->ReleaseStringUTFChars(returnString, js); //m_JavaVirtualMachinePointer->DeleteLocalRef(returnString); @@ -410,7 +410,7 @@ class AndroidContext : public ewol::Context { int32_t _format, AndroidAudioCallback _callback, void* _userData) { - if (m_audioCallBack != NULL) { + if (m_audioCallBack != nullptr) { EWOL_ERROR("AudioCallback already started ..."); return false; } @@ -437,7 +437,7 @@ class AndroidContext : public ewol::Context { return false; } bool audioCloseDevice(int32_t _idDevice) { - if (m_audioCallBack == NULL) { + if (m_audioCallBack == nullptr) { EWOL_ERROR("AudioCallback Not started ..."); return false; } @@ -453,8 +453,8 @@ class AndroidContext : public ewol::Context { // manage execption : java_check_exception(m_JavaVirtualMachinePointer); java_detach_current_thread(status); - m_audioCallBack = NULL; - m_audioCallBackUserData = NULL; + m_audioCallBack = nullptr; + m_audioCallBackUserData = nullptr; return (bool)ret; } else { EWOL_ERROR("C->java : can not get audio device count"); @@ -464,9 +464,9 @@ class AndroidContext : public ewol::Context { private: bool java_attach_current_thread(int *_rstatus) { EWOL_DEBUG("C->java : call java"); - if (g_JavaVM == NULL) { + if (g_JavaVM == nullptr) { EWOL_ERROR("C->java : JVM not initialised"); - m_JavaVirtualMachinePointer = NULL; + m_JavaVirtualMachinePointer = nullptr; return false; } *_rstatus = g_JavaVM->GetEnv((void **) &m_JavaVirtualMachinePointer, JNI_VERSION_1_6); @@ -474,12 +474,12 @@ class AndroidContext : public ewol::Context { JavaVMAttachArgs lJavaVMAttachArgs; lJavaVMAttachArgs.version = JNI_VERSION_1_6; lJavaVMAttachArgs.name = "EwolNativeThread"; - lJavaVMAttachArgs.group = NULL; + lJavaVMAttachArgs.group = nullptr; int status = g_JavaVM->AttachCurrentThread(&m_JavaVirtualMachinePointer, &lJavaVMAttachArgs); java_check_exception(m_JavaVirtualMachinePointer); if (status != JNI_OK) { EWOL_ERROR("C->java : AttachCurrentThread failed : " << status); - m_JavaVirtualMachinePointer = NULL; + m_JavaVirtualMachinePointer = nullptr; return false; } } @@ -489,7 +489,7 @@ class AndroidContext : public ewol::Context { void java_detach_current_thread(int _status) { if(_status == JNI_EDETACHED) { g_JavaVM->DetachCurrentThread(); - m_JavaVirtualMachinePointer = NULL; + m_JavaVirtualMachinePointer = nullptr; } } @@ -568,7 +568,7 @@ class AndroidContext : public ewol::Context { return; } EWOL_DEBUG("C->java : 222"); - if (NULL == _dataString) { + if (nullptr == _dataString) { EWOL_ERROR("C->java : No data to send ..."); return; } @@ -631,7 +631,7 @@ class AndroidContext : public ewol::Context { } void audioPlayback(void* _dataOutput, int32_t _frameRate) { - if (m_audioCallBack != NULL) { + if (m_audioCallBack != nullptr) { //EWOL_DEBUG("IO Audio event request: Frames=" << _frameRate); m_audioCallBack(_dataOutput, _frameRate, m_audioCallBackUserData); } @@ -654,7 +654,7 @@ extern "C" { JNIEXPORT void JNICALL JNI_OnUnload(JavaVM* _vm, void *_reserved) { etk::AutoLockMutex myLock(g_interfaceMutex); etk::AutoLockMutex myLock2(g_interfaceAudioMutex); - g_JavaVM = NULL; + g_JavaVM = nullptr; EWOL_DEBUG("JNI-> Un-load the jvm ..." ); } @@ -667,7 +667,7 @@ extern "C" { etk::AutoLockMutex myLock(g_interfaceMutex); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -680,7 +680,7 @@ extern "C" { if (isCopy == JNI_TRUE) { // from here str is reset ... _env->ReleaseStringUTFChars(_myString, str); - str = NULL; + str = nullptr; } } @@ -692,7 +692,7 @@ extern "C" { EWOL_DEBUG("*******************************************"); EWOL_DEBUG("** Creating EWOL context **"); EWOL_DEBUG("*******************************************"); - AndroidContext* tmpContext = NULL; + AndroidContext* tmpContext = nullptr; if (org_ewol_EwolConstants_EWOL_APPL_TYPE_ACTIVITY == _typeApplication) { tmpContext = new AndroidContext(_env, _classBase, _objCallback, AndroidContext::appl_application); } else if (org_ewol_EwolConstants_EWOL_APPL_TYPE_WALLPAPER == _typeApplication) { @@ -701,7 +701,7 @@ extern "C" { EWOL_CRITICAL(" try to create an instance with no apply type: " << _typeApplication); return -1; } - if (NULL == tmpContext) { + if (nullptr == tmpContext) { EWOL_ERROR("Can not allocate the main context instance _id=" << (s_listInstance.size()-1)); return -1; } @@ -721,20 +721,20 @@ extern "C" { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); return; } - if (NULL == s_listInstance[_id]) { + if (nullptr == s_listInstance[_id]) { EWOL_ERROR("the requested instance _id=" << (int32_t)_id << " is already removed ..."); return; } s_listInstance[_id]->unInit(_env); delete(s_listInstance[_id]); - s_listInstance[_id]=NULL; + s_listInstance[_id]=nullptr; } void Java_org_ewol_Ewol_EWtouchEvent(JNIEnv* _env, jobject _thiz, jint _id) { etk::AutoLockMutex myLock(g_interfaceMutex); EWOL_DEBUG(" == > Touch Event"); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -749,7 +749,7 @@ extern "C" { EWOL_DEBUG("*******************************************"); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -764,7 +764,7 @@ extern "C" { EWOL_DEBUG("*******************************************"); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -778,7 +778,7 @@ extern "C" { EWOL_DEBUG("*******************************************"); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -791,7 +791,7 @@ extern "C" { EWOL_DEBUG("*******************************************"); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -805,7 +805,7 @@ extern "C" { EWOL_DEBUG("*******************************************"); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -821,7 +821,7 @@ extern "C" { EWOL_DEBUG("*******************************************"); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -835,7 +835,7 @@ extern "C" { EWOL_DEBUG("*******************************************"); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -857,7 +857,7 @@ extern "C" { etk::AutoLockMutex myLock(g_interfaceMutex); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -875,7 +875,7 @@ extern "C" { etk::AutoLockMutex myLock(g_interfaceMutex); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -892,7 +892,7 @@ extern "C" { etk::AutoLockMutex myLock(g_interfaceMutex); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -910,7 +910,7 @@ extern "C" { etk::AutoLockMutex myLock(g_interfaceMutex); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -925,7 +925,7 @@ extern "C" { etk::AutoLockMutex myLock(g_interfaceMutex); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -941,7 +941,7 @@ extern "C" { etk::AutoLockMutex myLock(g_interfaceMutex); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -958,7 +958,7 @@ extern "C" { etk::AutoLockMutex myLock(g_interfaceMutex); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -975,7 +975,7 @@ extern "C" { etk::AutoLockMutex myLock(g_interfaceMutex); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -993,7 +993,7 @@ extern "C" { etk::AutoLockMutex myLock(g_interfaceMutex); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return false; @@ -1037,7 +1037,7 @@ extern "C" { etk::AutoLockMutex myLock(g_interfaceMutex); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -1052,7 +1052,7 @@ extern "C" { etk::AutoLockMutex myLock(g_interfaceMutex); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -1067,7 +1067,7 @@ extern "C" { etk::AutoLockMutex myLock(g_interfaceMutex); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -1084,7 +1084,7 @@ extern "C" { etk::AutoLockMutex myLock(g_interfaceAudioMutex); if( _id >= s_listInstance.size() || _id<0 - || NULL == s_listInstance[_id] ) { + || nullptr == s_listInstance[_id] ) { EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id); // TODO : generate error in java to stop the current instance return; @@ -1092,7 +1092,7 @@ extern "C" { // get the short* pointer from the Java array jboolean isCopy; jshort* dst = _env->GetShortArrayElements(_location, &isCopy); - if (NULL != dst) { + if (nullptr != dst) { memset(dst, sizeof(jshort), _frameRate*_nbChannels); //EWOL_DEBUG("IO Audio event request: Frames=" << _frameRate << " channels=" << _nbChannels); s_listInstance[_id]->audioPlayback(dst, _frameRate); diff --git a/sources/ewol/context/Context.cpp b/sources/ewol/context/Context.cpp index 72d7d333..183ba2b4 100644 --- a/sources/ewol/context/Context.cpp +++ b/sources/ewol/context/Context.cpp @@ -45,10 +45,10 @@ static etk::Mutex& mutexInterface() { } -static ewol::Context* l_curentInterface=NULL; +static ewol::Context* l_curentInterface=nullptr; ewol::Context& ewol::getContext() { #if DEBUG_LEVEL > 2 - if(NULL == l_curentInterface){ + if(nullptr == l_curentInterface){ EWOL_CRITICAL("[CRITICAL] try acces at an empty interface"); } #endif @@ -73,11 +73,11 @@ void ewol::Context::lockContext() { } /** - * @brief set the curent interface at NULL. + * @brief set the curent interface at nullptr. * @note this un-lock the main mutex */ void ewol::Context::unLockContext() { - l_curentInterface = NULL; + l_curentInterface = nullptr; mutexInterface().unLock(); } @@ -152,12 +152,12 @@ void ewol::Context::inputEventUnGrabPointer() { void ewol::Context::processEvents() { int32_t nbEvent = 0; //EWOL_DEBUG(" ******** Event"); - ewol::eSystemMessage* data = NULL; + ewol::eSystemMessage* data = nullptr; while (m_msgSystem.count()>0) { nbEvent++; - if (data != NULL) { + if (data != nullptr) { delete(data); - data = NULL; + data = nullptr; } m_msgSystem.wait(data); //EWOL_DEBUG("EVENT"); @@ -190,14 +190,14 @@ void ewol::Context::processEvents() { //EWOL_DEBUG("Receive MSG : THREAD_KEYBORAD_KEY"); // store the keyboard special key status for mouse event... m_input.setLastKeyboardSpecial(data->keyboardSpecial); - if (NULL != m_windowsCurrent) { + if (nullptr != m_windowsCurrent) { if (false == m_windowsCurrent->onEventShortCut(data->keyboardSpecial, data->keyboardChar, data->keyboardMove, data->stateIsDown) ) { // get the current focused Widget : ewol::object::Shared tmpWidget = m_widgetManager.focusGet(); - if (NULL != tmpWidget) { + if (nullptr != tmpWidget) { // check if the widget allow repeating key events. //EWOL_DEBUG("repeating test :" << data->repeateKey << " widget=" << tmpWidget->getKeyboardRepeate() << " state=" << data->stateIsDown); if( false == data->repeateKey @@ -240,7 +240,7 @@ void ewol::Context::processEvents() { case eSystemMessage::msgClipboardArrive: { ewol::object::Shared tmpWidget = m_widgetManager.focusGet(); - if (tmpWidget != NULL) { + if (tmpWidget != nullptr) { tmpWidget->onEventClipboard(data->clipboardID); } } @@ -299,7 +299,7 @@ ewol::Context::Context(int32_t _argc, const char* _argv[]) : m_FpsSystemContext("Context ", false), m_FpsSystem( "Draw ", true), m_FpsFlush( "Flush ", false), - m_windowsCurrent(NULL), + m_windowsCurrent(nullptr), m_windowsSize(320,480), m_initStepId(0), m_initTotalStep(1) { @@ -354,7 +354,7 @@ ewol::Context::Context(int32_t _argc, const char* _argv[]) : // request the init of the application in the main context of openGL ... { ewol::eSystemMessage *data = new ewol::eSystemMessage(); - if (data == NULL) { + if (data == nullptr) { EWOL_ERROR("allocationerror of message"); } else { data->TypeMessage = eSystemMessage::msgInit; @@ -399,7 +399,7 @@ ewol::Context::~Context() { void ewol::Context::requestUpdateSize() { ewol::eSystemMessage *data = new ewol::eSystemMessage(); - if (data == NULL) { + if (data == nullptr) { EWOL_ERROR("allocationerror of message"); return; } @@ -411,7 +411,7 @@ void ewol::Context::OS_Resize(const vec2& _size) { // TODO : Better in the thread ... == > but generate some init error ... ewol::Dimension::setPixelWindowsSize(_size); ewol::eSystemMessage *data = new ewol::eSystemMessage(); - if (data == NULL) { + if (data == nullptr) { EWOL_ERROR("allocationerror of message"); return; } @@ -431,7 +431,7 @@ void ewol::Context::OS_Move(const vec2& _pos) { void ewol::Context::OS_SetInputMotion(int _pointerID, const vec2& _pos ) { ewol::eSystemMessage *data = new ewol::eSystemMessage(); - if (data == NULL) { + if (data == nullptr) { EWOL_ERROR("allocationerror of message"); return; } @@ -444,7 +444,7 @@ void ewol::Context::OS_SetInputMotion(int _pointerID, const vec2& _pos ) { void ewol::Context::OS_SetInputState(int _pointerID, bool _isDown, const vec2& _pos ) { ewol::eSystemMessage *data = new ewol::eSystemMessage(); - if (data == NULL) { + if (data == nullptr) { EWOL_ERROR("allocationerror of message"); return; } @@ -458,7 +458,7 @@ void ewol::Context::OS_SetInputState(int _pointerID, bool _isDown, const vec2& _ void ewol::Context::OS_SetMouseMotion(int _pointerID, const vec2& _pos ) { ewol::eSystemMessage *data = new ewol::eSystemMessage(); - if (data == NULL) { + if (data == nullptr) { EWOL_ERROR("allocationerror of message"); return; } @@ -471,7 +471,7 @@ void ewol::Context::OS_SetMouseMotion(int _pointerID, const vec2& _pos ) { void ewol::Context::OS_SetMouseState(int _pointerID, bool _isDown, const vec2& _pos ) { ewol::eSystemMessage *data = new ewol::eSystemMessage(); - if (data == NULL) { + if (data == nullptr) { EWOL_ERROR("allocationerror of message"); return; } @@ -488,7 +488,7 @@ void ewol::Context::OS_SetKeyboard(ewol::key::Special& _special, bool _isDown, bool _isARepeateKey) { ewol::eSystemMessage *data = new ewol::eSystemMessage(); - if (data == NULL) { + if (data == nullptr) { EWOL_ERROR("allocationerror of message"); return; } @@ -505,7 +505,7 @@ void ewol::Context::OS_SetKeyboardMove(ewol::key::Special& _special, bool _isDown, bool _isARepeateKey) { ewol::eSystemMessage *data = new ewol::eSystemMessage(); - if (data == NULL) { + if (data == nullptr) { EWOL_ERROR("allocationerror of message"); return; } @@ -519,7 +519,7 @@ void ewol::Context::OS_SetKeyboardMove(ewol::key::Special& _special, void ewol::Context::OS_Hide() { ewol::eSystemMessage *data = new ewol::eSystemMessage(); - if (data == NULL) { + if (data == nullptr) { EWOL_ERROR("allocationerror of message"); return; } @@ -529,7 +529,7 @@ void ewol::Context::OS_Hide() { void ewol::Context::OS_Show() { ewol::eSystemMessage *data = new ewol::eSystemMessage(); - if (data == NULL) { + if (data == nullptr) { EWOL_ERROR("allocationerror of message"); return; } @@ -540,7 +540,7 @@ void ewol::Context::OS_Show() { void ewol::Context::OS_ClipBoardArrive(enum ewol::context::clipBoard::clipboardListe _clipboardID) { ewol::eSystemMessage *data = new ewol::eSystemMessage(); - if (data == NULL) { + if (data == nullptr) { EWOL_ERROR("allocationerror of message"); return; } @@ -572,7 +572,7 @@ bool ewol::Context::OS_Draw(bool _displayEveryTime) { processEvents(); if (m_initStepId < m_initTotalStep) { ewol::eSystemMessage *data = new ewol::eSystemMessage(); - if (data == NULL) { + if (data == nullptr) { EWOL_ERROR("allocation error of message"); } else { data->TypeMessage = eSystemMessage::msgInit; @@ -586,7 +586,7 @@ bool ewol::Context::OS_Draw(bool _displayEveryTime) { //! ewol::object::SharedManager::removeAllAutoRemove(); m_objectManager.removeAllAutoRemove(); // check if the user selected a windows - if (NULL != m_windowsCurrent) { + if (nullptr != m_windowsCurrent) { // Redraw all needed elements m_windowsCurrent->onRegenerateDisplay(); } @@ -607,7 +607,7 @@ bool ewol::Context::OS_Draw(bool _displayEveryTime) { if (m_displayFps == true) { m_FpsSystemContext.tic(); } - if (NULL != m_windowsCurrent) { + if (nullptr != m_windowsCurrent) { if( true == needRedraw || true == _displayEveryTime) { m_resourceManager.updateContext(); @@ -620,7 +620,7 @@ bool ewol::Context::OS_Draw(bool _displayEveryTime) { m_FpsSystemContext.toc(); m_FpsSystem.tic(); } - if (NULL != m_windowsCurrent) { + if (nullptr != m_windowsCurrent) { if( true == needRedraw || true == _displayEveryTime) { m_FpsSystem.incrementCounter(); @@ -680,7 +680,7 @@ ewol::object::Shared ewol::Context::getWindows() { }; void ewol::Context::forceRedrawAll() { - if (m_windowsCurrent == NULL) { + if (m_windowsCurrent == nullptr) { return; } m_windowsCurrent->calculateSize(vec2(m_windowsSize.x(), m_windowsSize.y())); @@ -690,7 +690,7 @@ void ewol::Context::OS_Stop() { // set the curent interface : lockContext(); EWOL_INFO("OS_Stop..."); - if (m_windowsCurrent != NULL) { + if (m_windowsCurrent != nullptr) { m_windowsCurrent->sysOnKill(); } // release the curent interface : @@ -702,7 +702,7 @@ void ewol::Context::OS_Suspend() { lockContext(); EWOL_INFO("OS_Suspend..."); m_previousDisplayTime = -1; - if (m_windowsCurrent != NULL) { + if (m_windowsCurrent != nullptr) { m_windowsCurrent->onStateSuspend(); } // release the curent interface : @@ -715,7 +715,7 @@ void ewol::Context::OS_Resume() { EWOL_INFO("OS_Resume..."); m_previousDisplayTime = ewol::getTime(); m_widgetManager.periodicCallResume(m_previousDisplayTime); - if (m_windowsCurrent != NULL) { + if (m_windowsCurrent != nullptr) { m_windowsCurrent->onStateResume(); } // release the curent interface : @@ -725,7 +725,7 @@ void ewol::Context::OS_Foreground() { // set the curent interface : lockContext(); EWOL_INFO("OS_Foreground..."); - if (m_windowsCurrent != NULL) { + if (m_windowsCurrent != nullptr) { m_windowsCurrent->onStateForeground(); } // release the curent interface : @@ -736,7 +736,7 @@ void ewol::Context::OS_Background() { // set the curent interface : lockContext(); EWOL_INFO("OS_Background..."); - if (m_windowsCurrent != NULL) { + if (m_windowsCurrent != nullptr) { m_windowsCurrent->onStateBackground(); } // release the curent interface : @@ -779,7 +779,7 @@ void ewol::Context::keyboardHide() { bool ewol::Context::systemKeyboradEvent(enum ewol::key::keyboardSystem _key, bool _down) { - if (m_windowsCurrent == NULL) { + if (m_windowsCurrent == nullptr) { return false; } lockContext(); diff --git a/sources/ewol/context/Context.h b/sources/ewol/context/Context.h index 7c13efb1..14693ead 100644 --- a/sources/ewol/context/Context.h +++ b/sources/ewol/context/Context.h @@ -69,7 +69,7 @@ namespace ewol { return m_resourceManager; }; public: - Context(int32_t _argc=0, const char* _argv[]=NULL); + Context(int32_t _argc=0, const char* _argv[]=nullptr); virtual ~Context(); protected: /** @@ -78,7 +78,7 @@ namespace ewol { */ void lockContext(); /** - * @brief set the curent interface at NULL. + * @brief set the curent interface at nullptr. * @note this un-lock the main mutex */ void unLockContext(); diff --git a/sources/ewol/context/IOs/Context.cpp b/sources/ewol/context/IOs/Context.cpp index 1a01affe..5e4ee0eb 100644 --- a/sources/ewol/context/IOs/Context.cpp +++ b/sources/ewol/context/IOs/Context.cpp @@ -128,19 +128,19 @@ public: }; -MacOSInterface* interface = NULL; +MacOSInterface* interface = nullptr; bool IOs::draw(bool _displayEveryTime) { - if (interface == NULL) { + if (interface == nullptr) { return false; } return interface->MAC_Draw(_displayEveryTime); } void IOs::resize(float _x, float _y) { - if (interface == NULL) { + if (interface == nullptr) { return; } interface->MAC_Resize(_x, _y); @@ -148,82 +148,82 @@ void IOs::resize(float _x, float _y) { void IOs::setMouseState(int32_t _id, bool _isDown, float _x, float _y) { - if (interface == NULL) { + if (interface == nullptr) { return; } interface->MAC_SetMouseState(_id, _isDown, _x, _y); } void IOs::setMouseMotion(int32_t _id, float _x, float _y) { - if (interface == NULL) { + if (interface == nullptr) { return; } interface->MAC_SetMouseMotion(_id, _x, _y); } void IOs::setInputState(int32_t _id, bool _isDown, float _x, float _y) { - if (interface == NULL) { + if (interface == nullptr) { return; } interface->MAC_SetInputState(_id, _isDown, _x, _y); } void IOs::setInputMotion(int32_t _id, float _x, float _y) { - if (interface == NULL) { + if (interface == nullptr) { return; } interface->MAC_SetInputMotion(_id, _x, _y); } void IOs::setKeyboard(ewol::key::Special _keyboardMode, int32_t _unichar, bool _isDown, bool _isAReapeateKey) { - if (interface == NULL) { + if (interface == nullptr) { return; } interface->MAC_SetKeyboard(_keyboardMode, _unichar, _isDown, _isAReapeateKey); } void IOs::setKeyboardMove(ewol::key::Special& _keyboardMode, enum ewol::key::keyboard _move, bool _isDown) { - if (interface == NULL) { + if (interface == nullptr) { return; } interface->MAC_SetKeyboardMove(_keyboardMode, _move, _isDown); } void IOs::start() { - if (interface == NULL) { + if (interface == nullptr) { return; } //interface->OS_Start(); } void IOs::resume() { - if (interface == NULL) { + if (interface == nullptr) { return; } interface->OS_Resume(); } void IOs::suspend() { - if (interface == NULL) { + if (interface == nullptr) { return; } interface->OS_Suspend(); } void IOs::stop() { - if (interface == NULL) { + if (interface == nullptr) { return; } interface->OS_Stop(); } void IOs::background() { - if (interface == NULL) { + if (interface == nullptr) { return; } interface->OS_Background(); } void IOs::foreground() { - if (interface == NULL) { + if (interface == nullptr) { return; } interface->OS_Foreground(); @@ -231,7 +231,7 @@ void IOs::foreground() { static int l_argc = 0; -static const char **l_argv = NULL; +static const char **l_argv = nullptr; /** * @brief Main of the program * @param std IO @@ -248,19 +248,19 @@ void IOs::createInterface() { etk::setArgZero(l_argv[0]); EWOL_INFO("Create new interface"); interface = new MacOSInterface(l_argc, l_argv); - if (NULL == interface) { + if (nullptr == interface) { EWOL_CRITICAL("Can not create the X11 interface ... MEMORY allocation error"); return; } } void IOs::releaseInterface() { - if (interface == NULL) { + if (interface == nullptr) { return; } EWOL_INFO("Remove interface"); delete(interface); - interface = NULL; + interface = nullptr; } diff --git a/sources/ewol/context/InputManager.cpp b/sources/ewol/context/InputManager.cpp index abc98083..d7748184 100644 --- a/sources/ewol/context/InputManager.cpp +++ b/sources/ewol/context/InputManager.cpp @@ -46,7 +46,7 @@ bool ewol::context::InputManager::localEventInput(enum ewol::key::type _type, int32_t _IdInput, enum ewol::key::status _status, vec2 _pos) { - if (NULL != _destWidget) { + if (nullptr != _destWidget) { if (_type == ewol::key::typeMouse || _type == ewol::key::typeFinger) { // create the system Event : ewol::event::InputSystem tmpEventSystem(_type, _status, _IdInput, _pos, _destWidget, 0, m_specialKey); // TODO : set the real ID ... @@ -62,7 +62,7 @@ bool ewol::context::InputManager::localEventInput(enum ewol::key::type _type, void ewol::context::InputManager::abortElement(InputPoperty *_eventTable, int32_t _idInput, enum ewol::key::type _type) { - if (NULL == _eventTable) { + if (nullptr == _eventTable) { return; } if (_eventTable[_idInput].isUsed == true) { @@ -76,14 +76,14 @@ void ewol::context::InputManager::abortElement(InputPoperty *_eventTable, void ewol::context::InputManager::cleanElement(InputPoperty *_eventTable, int32_t _idInput) { - if (NULL == _eventTable) { + if (nullptr == _eventTable) { return; } //EWOL_INFO("CleanElement[" << idInput << "] = @" << (int64_t)eventTable); _eventTable[_idInput].isUsed = false; _eventTable[_idInput].destinationInputId = 0; _eventTable[_idInput].lastTimeEvent = 0; - _eventTable[_idInput].curentWidgetEvent = NULL; + _eventTable[_idInput].curentWidgetEvent = nullptr; _eventTable[_idInput].origin.setValue(0,0); _eventTable[_idInput].size.setValue(99999999,99999999); _eventTable[_idInput].downStart.setValue(0,0); @@ -124,7 +124,7 @@ void ewol::context::InputManager::transfertEvent(ewol::object::Shared _widget) { - if(NULL == _widget) { + if(nullptr == _widget) { return; } m_grabWidget = _widget; @@ -134,7 +134,7 @@ void ewol::context::InputManager::grabPointer(ewol::object::Shared } void ewol::context::InputManager::unGrabPointer() { - m_grabWidget = NULL; + m_grabWidget = nullptr; m_context.grabPointerEvents(false, vec2(0,0)); } @@ -162,7 +162,7 @@ void ewol::context::InputManager::newLayerSet() { } ewol::context::InputManager::InputManager(ewol::Context& _context) : - m_grabWidget(NULL), + m_grabWidget(nullptr), m_context(_context) { setDpi(200); EWOL_INFO("Init (start)"); @@ -207,7 +207,7 @@ void ewol::context::InputManager::motion(enum ewol::key::type _type, // reject pointer == > out of IDs... return; } - InputPoperty *eventTable = NULL; + InputPoperty *eventTable = nullptr; if (_type == ewol::key::typeMouse) { eventTable = m_eventMouseSaved; } else if (_type == ewol::key::typeFinger) { @@ -226,12 +226,12 @@ void ewol::context::InputManager::motion(enum ewol::key::type _type, if (_type == ewol::key::typeMouse && _pointerID == 0) { // this event is all time on the good widget ... and manage the enter and leave ... // NOTE : the "layer widget" force us to get the widget at the specific position all the time : - ewol::object::Shared tmpWidget = NULL; - if (m_grabWidget != NULL) { + ewol::object::Shared tmpWidget = nullptr; + if (m_grabWidget != nullptr) { // grab all events ... tmpWidget = m_grabWidget; } else { - if (NULL != tmpWindows) { + if (nullptr != tmpWindows) { tmpWidget = tmpWindows->getWidgetAtPos(_pos); } } @@ -255,10 +255,10 @@ void ewol::context::InputManager::motion(enum ewol::key::type _type, eventTable[_pointerID].isInside = true; // get destination widget : eventTable[_pointerID].curentWidgetEvent = tmpWidget; - if (NULL == eventTable[_pointerID].curentWidgetEvent) { + if (nullptr == eventTable[_pointerID].curentWidgetEvent) { eventTable[_pointerID].isInside = false; } - if (NULL != eventTable[_pointerID].curentWidgetEvent) { + if (nullptr != eventTable[_pointerID].curentWidgetEvent) { eventTable[_pointerID].origin = eventTable[_pointerID].curentWidgetEvent->getOrigin(); eventTable[_pointerID].size = eventTable[_pointerID].curentWidgetEvent->getSize(); } @@ -339,7 +339,7 @@ void ewol::context::InputManager::state(enum ewol::key::type _type, } EVENT_DEBUG("event pointerId=" << _pointerID); // convert position in open-GL coordonates ... - InputPoperty *eventTable = NULL; + InputPoperty *eventTable = nullptr; InputLimit localLimit; if (_type == ewol::key::typeMouse) { eventTable = m_eventMouseSaved; @@ -396,16 +396,16 @@ void ewol::context::InputManager::state(enum ewol::key::type _type, // set the element inside ... eventTable[_pointerID].isInside = true; // get destination widget : - if(NULL != tmpWindows) { - if (m_grabWidget != NULL && _type == ewol::key::typeMouse) { + if(nullptr != tmpWindows) { + if (m_grabWidget != nullptr && _type == ewol::key::typeMouse) { eventTable[_pointerID].curentWidgetEvent = m_grabWidget; } else { eventTable[_pointerID].curentWidgetEvent = tmpWindows->getWidgetAtPos(_pos); } } else { - eventTable[_pointerID].curentWidgetEvent = NULL; + eventTable[_pointerID].curentWidgetEvent = nullptr; } - if (NULL != eventTable[_pointerID].curentWidgetEvent) { + if (nullptr != eventTable[_pointerID].curentWidgetEvent) { eventTable[_pointerID].origin = eventTable[_pointerID].curentWidgetEvent->getOrigin(); eventTable[_pointerID].size = eventTable[_pointerID].curentWidgetEvent->getSize(); eventTable[_pointerID].destinationInputId = localGetDestinationId(_type, eventTable[_pointerID].curentWidgetEvent, _pointerID); @@ -433,7 +433,7 @@ void ewol::context::InputManager::state(enum ewol::key::type _type, // Mark it un-used : eventTable[_pointerID].isUsed = false; // revove the widget ... - eventTable[_pointerID].curentWidgetEvent = NULL; + eventTable[_pointerID].curentWidgetEvent = nullptr; } else { // generate UP Event EVENT_DEBUG("GUI : Input ID=" << _pointerID @@ -454,14 +454,14 @@ void ewol::context::InputManager::state(enum ewol::key::type _type, // save start time eventTable[_pointerID].lastTimeEvent = currentTime; int32_t nbClickMax = 0; - if(eventTable[_pointerID].curentWidgetEvent != NULL) { + if(eventTable[_pointerID].curentWidgetEvent != nullptr) { nbClickMax = eventTable[_pointerID].curentWidgetEvent->getMouseLimit(); if (nbClickMax>5) { nbClickMax = 5; } } // in grab mode the single to quinte event are not generated .... - if( ( m_grabWidget == NULL + if( ( m_grabWidget == nullptr || _type != ewol::key::typeMouse ) && eventTable[_pointerID].nbClickEvent < nbClickMax) { // generate event SINGLE : diff --git a/sources/ewol/context/MacOs/Context.cpp b/sources/ewol/context/MacOs/Context.cpp index 868401b8..01ec1aac 100644 --- a/sources/ewol/context/MacOs/Context.cpp +++ b/sources/ewol/context/MacOs/Context.cpp @@ -119,19 +119,19 @@ class MacOSInterface : public ewol::Context { }; -MacOSInterface* interface = NULL; +MacOSInterface* interface = nullptr; bool MacOs::draw(bool _displayEveryTime) { - if (interface == NULL) { + if (interface == nullptr) { return false; } return interface->MAC_Draw(_displayEveryTime); } void MacOs::resize(float _x, float _y) { - if (interface == NULL) { + if (interface == nullptr) { return; } interface->MAC_Resize(_x, _y); @@ -139,28 +139,28 @@ void MacOs::resize(float _x, float _y) { void MacOs::setMouseState(int32_t _id, bool _isDown, float _x, float _y) { - if (interface == NULL) { + if (interface == nullptr) { return; } interface->MAC_SetMouseState(_id, _isDown, _x, _y); } void MacOs::setMouseMotion(int32_t _id, float _x, float _y) { - if (interface == NULL) { + if (interface == nullptr) { return; } interface->MAC_SetMouseMotion(_id, _x, _y); } void MacOs::setKeyboard(ewol::key::Special _keyboardMode, int32_t _unichar, bool _isDown, bool _isAReapeateKey) { - if (interface == NULL) { + if (interface == nullptr) { return; } interface->MAC_SetKeyboard(_keyboardMode, _unichar, _isDown, _isAReapeateKey); } void MacOs::setKeyboardMove(ewol::key::Special& _keyboardMode, enum ewol::key::keyboard _move, bool _isDown) { - if (interface == NULL) { + if (interface == nullptr) { return; } interface->MAC_SetKeyboardMove(_keyboardMode, _move, _isDown); @@ -175,14 +175,14 @@ void MacOs::setKeyboardMove(ewol::key::Special& _keyboardMode, enum ewol::key::k int ewol::run(int _argc, const char *_argv[]) { etk::setArgZero(_argv[0]); interface = new MacOSInterface(_argc, _argv); - if (NULL == interface) { + if (nullptr == interface) { EWOL_CRITICAL("Can not create the X11 interface ... MEMORY allocation error"); return -2; } int32_t retValue = interface->Run(); delete(interface); - interface = NULL; + interface = nullptr; return retValue; } diff --git a/sources/ewol/context/Windows/Context.cpp b/sources/ewol/context/Windows/Context.cpp index dfc1031e..5e2579d9 100644 --- a/sources/ewol/context/Windows/Context.cpp +++ b/sources/ewol/context/Windows/Context.cpp @@ -29,7 +29,7 @@ int64_t ewol::getTime() { struct timeval now; - gettimeofday(&now, NULL); + gettimeofday(&now, nullptr); //EWOL_VERBOSE("current time : " << now.tv_sec << "s " << now.tv_usec << "us"); return (int64_t)((int64_t)now.tv_sec*(int64_t)1000000 + (int64_t)now.tv_usec); } @@ -72,10 +72,10 @@ class WindowsContext : public ewol::eContext { wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; - wc.hIcon = loadIcon( NULL, IDI_APPLICATION ); - wc.hCursor = loadCursor( NULL, IDC_ARROW ); + wc.hIcon = loadIcon( nullptr, IDI_APPLICATION ); + wc.hCursor = loadCursor( nullptr, IDC_ARROW ); wc.hbrBackground = (HBRUSH)GetStockObject( BLACK_BRUSH ); - wc.lpszMenuName = NULL; + wc.lpszMenuName = nullptr; wc.lpszClassName = "EwolMainWindows"; RegisterClass( &wc ); @@ -83,7 +83,7 @@ class WindowsContext : public ewol::eContext { hWnd = CreateWindow( "EwolMainWindows", "Ewol ... TODO Title", WS_CAPTION | WS_POPUPWINDOW | WS_VISIBLE | WS_SIZEBOX, 0, 0, 800, 600, - NULL, NULL, hInstance, NULL ); + nullptr, NULL, hInstance, NULL ); int border_thickness = getSystemMetrics(SM_CXSIZEFRAME); int title_size = getSystemMetrics(SM_CYCAPTION); m_currentHeight = 600-2*border_thickness -title_size; @@ -95,7 +95,7 @@ class WindowsContext : public ewol::eContext { // program main loop while(true == m_run) { // check for messages - if ( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE )) { + if ( PeekMessage( &msg, nullptr, 0, 0, PM_REMOVE )) { // handle or dispatch messages if ( msg.message == WM_QUIT ) { m_run = false; @@ -204,7 +204,7 @@ class WindowsContext : public ewol::eContext { // disable openGL void disableOpenGL(HWND _hWnd, HDC _hDC, HGLRC _hRC) { - wglMakeCurrent( NULL, NULL ); + wglMakeCurrent( nullptr, NULL ); wglDeleteContext( _hRC ); releaseDC( _hWnd, _hDC ); } @@ -256,7 +256,7 @@ class WindowsContext : public ewol::eContext { */ case WM_WINDOWPOSCHANGING: { WINDOWPOS* tmpVal = (WINDOWPOS*)_lParam; - if (NULL != tmpVal) { + if (nullptr != tmpVal) { //EWOL_DEBUG("WM_WINDOWPOSCHANGING : : (" << tmpVal->x << "," << tmpVal->y << ") ( " << tmpVal->cx << "," << tmpVal->cy << ")"); // in windows system, we need to remove the size of the border elements : int border_thickness = getSystemMetrics(SM_CXSIZEFRAME); @@ -465,14 +465,14 @@ int ewol::Run(int _argc, const char *_argv[]) { //return 1; } WindowsContext* interface = new WindowsContext(_argc, _argv); - if (NULL == interface) { + if (nullptr == interface) { EWOL_CRITICAL("Can not create the X11 interface ... MEMORY allocation error"); return -2; } int32_t retValue = interface->Run(); delete(interface); - interface = NULL; + interface = nullptr; return retValue; } diff --git a/sources/ewol/context/X11/Context.cpp b/sources/ewol/context/X11/Context.cpp index 3a09d844..8b50d314 100644 --- a/sources/ewol/context/X11/Context.cpp +++ b/sources/ewol/context/X11/Context.cpp @@ -58,7 +58,7 @@ int64_t ewol::getTime() { int ret = clock_gettime(CLOCK_REALTIME, &now); if (ret != 0) { // Error to get the time ... - now.tv_sec = time(NULL); + now.tv_sec = time(nullptr); now.tv_nsec = 0; } //EWOL_VERBOSE("current time : " << now.tv_sec << "s " << now.tv_usec << "us"); @@ -144,14 +144,14 @@ class X11Interface : public ewol::Context { public: X11Interface(int32_t _argc, const char* _argv[]) : ewol::Context(_argc, _argv), - m_display(NULL), + m_display(nullptr), m_originX(0), m_originY(0), m_cursorEventX(0), m_cursorEventY(0), m_currentHeight(0), m_currentWidth(0), - m_visual(NULL), + m_visual(nullptr), m_doubleBuffered(0), m_run(false), m_grabAllEvent(false), @@ -225,21 +225,21 @@ class X11Interface : public ewol::Context { { XSelectionRequestEvent *req=&(event.xselectionrequest); if (req->property == 0) { - EWOL_ERROR("Get NULL ATOM ... property"); + EWOL_ERROR("Get nullptr ATOM ... property"); break; } if (req->target == 0) { - EWOL_ERROR("Get NULL ATOM ... target"); + EWOL_ERROR("Get nullptr ATOM ... target"); break; } char * atomNameProperty = XGetAtomName(m_display, req->property); char * atomNameTarget = XGetAtomName(m_display, req->target); EWOL_INFO("X11 property: \"" << atomNameProperty << "\""); EWOL_INFO("X11 target: \"" << atomNameTarget << "\""); - if (atomNameProperty != NULL) { + if (atomNameProperty != nullptr) { XFree(atomNameProperty); } - if (atomNameTarget != NULL) { + if (atomNameTarget != nullptr) { XFree(atomNameTarget); } } @@ -294,24 +294,24 @@ class X11Interface : public ewol::Context { #ifdef DEBUG_X11_EVENT { if (req->property == 0) { - EWOL_ERROR("Get NULL ATOM ... property"); + EWOL_ERROR("Get nullptr ATOM ... property"); break; } if (req->selection == 0) { - EWOL_ERROR("Get NULL ATOM ... selection"); + EWOL_ERROR("Get nullptr ATOM ... selection"); break; } if (req->target == 0) { - EWOL_ERROR("Get NULL ATOM ... target"); + EWOL_ERROR("Get nullptr ATOM ... target"); break; } char * atomNameProperty = XGetAtomName(m_display, req->property); char * atomNameSelection = XGetAtomName(m_display, req->selection); char * atomNameTarget = XGetAtomName(m_display, req->target); EWOL_INFO(" from: " << atomNameProperty << " request=" << atomNameSelection << " in " << atomNameTarget); - if (NULL != atomNameProperty) { XFree(atomNameProperty); } - if (NULL != atomNameSelection) { XFree(atomNameSelection); } - if (NULL != atomNameTarget) { XFree(atomNameTarget); } + if (nullptr != atomNameProperty) { XFree(atomNameProperty); } + if (nullptr != atomNameSelection) { XFree(atomNameSelection); } + if (nullptr != atomNameTarget) { XFree(atomNameTarget); } } #endif @@ -920,8 +920,8 @@ class X11Interface : public ewol::Context { static char *title = (char*)"Ewol"; // Connect to the X server - m_display = XOpenDisplay(NULL); - if(NULL == m_display) { + m_display = XOpenDisplay(nullptr); + if(nullptr == m_display) { EWOL_CRITICAL("Could not open display X."); exit(-1); } else { @@ -934,7 +934,7 @@ class X11Interface : public ewol::Context { ewol::Dimension::Millimeter); // get an appropriate visual m_visual = glXChooseVisual(m_display, Xscreen, attrListDbl); - if (NULL == m_visual) { + if (nullptr == m_visual) { m_visual = glXChooseVisual(m_display, Xscreen, attrListSgl); m_doubleBuffered = false; EWOL_INFO("GL-X singlebuffered rendering will be used, no doublebuffering available"); @@ -1012,10 +1012,10 @@ class X11Interface : public ewol::Context { StartupState->flags = StateHint; XSetWMProperties(m_display, m_WindowHandle,&textprop, &textprop,/* Window title/icon title*/ - NULL, 0,/* Argv[], argc for program*/ + nullptr, 0,/* Argv[], argc for program*/ &hints, /* Start position/size*/ StartupState,/* Iconised/not flag */ - NULL); + nullptr); XFree(StartupState); @@ -1024,15 +1024,15 @@ class X11Interface : public ewol::Context { //XIfEvent(m_display, &event, WaitForMapNotify, (char*)&m_WindowHandle); - m_xim = XOpenIM(m_display, NULL, NULL, NULL); - if (m_xim == NULL) { + m_xim = XOpenIM(m_display, nullptr, NULL, NULL); + if (m_xim == nullptr) { EWOL_ERROR("Could not open input method"); return false; } /* - XIMStyles *styles=NULL; - char* failed_arg = XGetIMValues(m_xim, XNQueryInputStyle, &styles, NULL); - if (failed_arg != NULL) { + XIMStyles *styles=nullptr; + char* failed_arg = XGetIMValues(m_xim, XNQueryInputStyle, &styles, nullptr); + if (failed_arg != nullptr) { EWOL_ERROR("XIM Can't get styles"); return false; } @@ -1040,8 +1040,8 @@ class X11Interface : public ewol::Context { EWOL_INFO("style " << styles->supported_styles[iii]); } */ - m_xic = XCreateIC(m_xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, XNClientWindow, m_WindowHandle, NULL); - if (m_xic == NULL) { + m_xic = XCreateIC(m_xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, XNClientWindow, m_WindowHandle, nullptr); + if (m_xic == nullptr) { EWOL_ERROR("Could not open IC"); return false; } @@ -1083,7 +1083,7 @@ class X11Interface : public ewol::Context { return; } char* tmpVal = new char[4*dataImage.getWidth()*dataImage.getHeight()]; - if (NULL == tmpVal) { + if (nullptr == tmpVal) { EWOL_CRITICAL("Allocation error ..."); return; } @@ -1191,7 +1191,7 @@ class X11Interface : public ewol::Context { // Note when we free the pixmap ... the icon is removed ... == > this is a real memory leek ... //XFreePixmap(m_display, tmpPixmap); - myImage->data = NULL; + myImage->data = nullptr; XDestroyImage(myImage); delete[] tmpVal; @@ -1346,12 +1346,12 @@ class X11Interface : public ewol::Context { int ewol::run(int _argc, const char *_argv[]) { etk::setArgZero(_argv[0]); X11Interface* interface = new X11Interface(_argc, _argv); - if (NULL == interface) { + if (nullptr == interface) { EWOL_CRITICAL("Can not create the X11 interface ... MEMORY allocation error"); return -2; } int32_t retValue = interface->run(); delete(interface); - interface = NULL; + interface = nullptr; return retValue; } diff --git a/sources/ewol/context/directFB/Context.cpp b/sources/ewol/context/directFB/Context.cpp index 04caf7e4..70686c15 100644 --- a/sources/ewol/context/directFB/Context.cpp +++ b/sources/ewol/context/directFB/Context.cpp @@ -52,7 +52,7 @@ int64_t guiInterface::getTime() { int ret = clock_gettime(CLOCK_REALTIME, &now); if (ret != 0) { // Error to get the time ... - now.tv_sec = time(NULL); + now.tv_sec = time(nullptr); now.tv_nsec = 0; } //EWOL_VERBOSE("current time : " << now.tv_sec << "s " << now.tv_usec << "us"); @@ -71,16 +71,16 @@ bool m_grabAllEvent = false; // the super interface -IDirectFB *dfb = NULL; +IDirectFB *dfb = nullptr; // the primary surface (surface of primary layer) -IDirectFBSurface *primary = NULL; +IDirectFBSurface *primary = nullptr; // the GL context -IDirectFBGL *primary_gl = NULL; +IDirectFBGL *primary_gl = nullptr; // event buffer -IDirectFBEventBuffer *events = NULL; +IDirectFBEventBuffer *events = nullptr; static int screen_width =800; static int screen_height = 600; @@ -152,7 +152,7 @@ void DirectFB_Init(int argc, const char *argv[]) { primary->setDstBlendFunction(primary, DSBF_SRCALPHA); primary->setDrawingFlags(primary, DSDRAW_BLEND); - primary->Blit(primary, primary, NULL, 0, 0); + primary->Blit(primary, primary, nullptr, 0, 0); EWOL_INFO("call getSize"); @@ -175,7 +175,7 @@ void DirectFB_Init(int argc, const char *argv[]) { } EWOL_INFO("call Flip"); - primary->Flip(primary, NULL, (DFBSurfaceFlipFlags)0);//DSFLIP_ONSYNC); + primary->Flip(primary, nullptr, (DFBSurfaceFlipFlags)0);//DSFLIP_ONSYNC); // NOTE : we need to force it on X11 display ... EWOL_INFO("call getGL"); @@ -212,7 +212,7 @@ void DirectFB_Run() { primary->FillRectangle(primary, 0, 0, screen_width, screen_height); primary->setColor (primary, 0xFF, (uint8_t)position, 0x00, 0xFF); primary->FillRectangle(primary, position, position, 300, 300); - primary->Flip(primary, NULL, (DFBSurfaceFlipFlags)0);//DSFLIP_ONSYNC); + primary->Flip(primary, nullptr, (DFBSurfaceFlipFlags)0);//DSFLIP_ONSYNC); position++; if (position>600) { position = 0; @@ -234,7 +234,7 @@ void DirectFB_Run() { EWOL_ERROR("primary_gl->Unlock"); DirectFBErrorFatal("primary_gl->Unlock", err); } - primary->Flip(primary, NULL, (DFBSurfaceFlipFlags)0);//DSFLIP_ONSYNC); + primary->Flip(primary, nullptr, (DFBSurfaceFlipFlags)0);//DSFLIP_ONSYNC); } while (events->getEvent(events, DFB_EVENT(&evt)) == DFB_OK) { diff --git a/sources/ewol/object/ConfigElement.cpp b/sources/ewol/object/ConfigElement.cpp index 783cbebc..81f88f95 100644 --- a/sources/ewol/object/ConfigElement.cpp +++ b/sources/ewol/object/ConfigElement.cpp @@ -13,19 +13,19 @@ std::ostream& ewol::operator <<(std::ostream& _os, const ewol::object::ConfigElement& _obj) { _os << "{"; - if (NULL != _obj.getConfig()) { + if (nullptr != _obj.getConfig()) { _os << "config=\"" << _obj.getConfig() << "\""; } - if (NULL != _obj.getType()) { + if (nullptr != _obj.getType()) { _os << " type=\"" << _obj.getType() << "\""; } - if (NULL != _obj.getControl()) { + if (nullptr != _obj.getControl()) { _os << " ctrl=\"" << _obj.getControl() << "\""; } - if (NULL != _obj.getDescription()) { + if (nullptr != _obj.getDescription()) { _os << " desc=\"" << _obj.getDescription() << "\""; } - if (NULL != _obj.getDefault()) { + if (nullptr != _obj.getDefault()) { _os << " default=\"" << _obj.getDefault() << "\""; } _os << "}"; diff --git a/sources/ewol/object/ConfigElement.h b/sources/ewol/object/ConfigElement.h index 2bac67de..9e6ab808 100644 --- a/sources/ewol/object/ConfigElement.h +++ b/sources/ewol/object/ConfigElement.h @@ -22,11 +22,11 @@ namespace ewol { const char* m_default; //!< default value ... public: // note : no parameter capability is needed to create element in case of vector stoarage. - ConfigElement(const char* _config = NULL, - const char* _type = NULL, - const char* _control = NULL, - const char* _description = NULL, - const char* _default = NULL) : + ConfigElement(const char* _config = nullptr, + const char* _type = nullptr, + const char* _control = nullptr, + const char* _description = nullptr, + const char* _default = nullptr) : m_config(_config), m_type(_type), m_control(_control), diff --git a/sources/ewol/object/Manager.cpp b/sources/ewol/object/Manager.cpp index b9efba4a..25ac9599 100644 --- a/sources/ewol/object/Manager.cpp +++ b/sources/ewol/object/Manager.cpp @@ -42,14 +42,14 @@ void ewol::object::Manager::unInit() { EWOL_INFO(" remove missing user widget"); size_t iii=0; while(iii < m_eObjectList.size()) { - if (m_eObjectList[iii] != NULL) { + if (m_eObjectList[iii] != nullptr) { if ( m_eObjectList[iii]->getStatic() == true || m_eObjectList[iii]->getStatusResource() == true) { iii++; } else { EWOL_WARNING("Un-INIT : remove Object type=\"" << m_eObjectList[iii]->getObjectType() << "\""); m_eObjectList[iii].reset(); - m_eObjectList[iii] = NULL; + m_eObjectList[iii] = nullptr; } } else { m_eObjectList.erase(m_eObjectList.begin()+iii); @@ -58,7 +58,7 @@ void ewol::object::Manager::unInit() { removeAllAutoRemove(); EWOL_INFO(" remove resources user widgets"); while(iii < m_eObjectList.size()) { - if (m_eObjectList[iii] != NULL) { + if (m_eObjectList[iii] != nullptr) { if (m_eObjectList[iii]->getStatic() == true) { iii++; } else { @@ -72,7 +72,7 @@ void ewol::object::Manager::unInit() { removeAllAutoRemove(); EWOL_INFO(" remove static user widgets"); while(iii < m_eObjectList.size()) { - if (m_eObjectList[iii] != NULL) { + if (m_eObjectList[iii] != nullptr) { EWOL_WARNING("Un-INIT : remove Object type=\"" << m_eObjectList[iii]->getObjectType() << "\""); m_eObjectList[iii].reset(); } else { @@ -82,7 +82,7 @@ void ewol::object::Manager::unInit() { } void ewol::object::Manager::add(ewol::object::Shared _object) { - if (_object == NULL) { + if (_object == nullptr) { EWOL_ERROR("try to add an inexistant Object in manager"); } // ! < it might benerate a shared object !!! @@ -96,7 +96,7 @@ int32_t ewol::object::Manager::getNumberObject() { void ewol::object::Manager::informOneObjectIsRemoved(ewol::object::Shared _object) { size_t mbElement = m_eObjectList.size(); for (int64_t iii=0; iii<(int64_t)m_eObjectList.size(); ++iii) { - if ( m_eObjectList[iii] != NULL + if ( m_eObjectList[iii] != nullptr && m_eObjectList[iii] != _object) { //EWOL_DEBUG("inform " << iii+1 << "/" << m_eObjectList.size()); //EWOL_DEBUG(" id=" << m_eObjectList[iii]->getId() << " named '" << m_eObjectList[iii]->getName() << "' type=" << m_eObjectList[iii]->getObjectType()); @@ -110,7 +110,7 @@ void ewol::object::Manager::informOneObjectIsRemoved(ewol::object::SharedonObjectRemove(_object); @@ -126,14 +126,14 @@ void ewol::object::Manager::informOneObjectIsRemoved(ewol::object::Shared _object) { - if (_object == NULL) { - EWOL_ERROR("Try to remove (NULL) Object"); + if (_object == nullptr) { + EWOL_ERROR("Try to remove (nullptr) Object"); return; } for (size_t iii=0; iii _object) { } // check if the object has not been auto removed ... or remove in defered time ... for (size_t iii=0; iii _object) { } void ewol::object::Manager::autoRemove(ewol::object::Shared _object) { - if (NULL == _object) { - EWOL_ERROR("Try to Auto-Remove (NULL) Object"); + if (nullptr == _object) { + EWOL_ERROR("Try to Auto-Remove (nullptr) Object"); return; } for (size_t iii=0; iiigetId() << "] type='" << _object->getObjectType() << "'"); if (_object->getStatusResource() == false) { @@ -177,7 +177,7 @@ void ewol::object::Manager::autoRemove(ewol::object::Shared _objec void ewol::object::Manager::removeAllAutoRemove() { //EWOL_DEBUG("Auto-Remove Object section : " << m_eObjectAutoRemoveList.size() << " elemeents"); while(0getId() << "]type='" << m_eObjectAutoRemoveList[0]->getObjectType() << "'"); } m_eObjectAutoRemoveList.erase(m_eObjectAutoRemoveList.begin()); @@ -187,15 +187,15 @@ void ewol::object::Manager::removeAllAutoRemove() { ewol::object::Shared ewol::object::Manager::get(const std::string& _name) { if (_name == "") { - return NULL; + return nullptr; } for (size_t iii=0; iiigetName() == _name) { return m_eObjectList[iii].get(); } } } - return NULL; + return nullptr; } diff --git a/sources/ewol/object/Message.cpp b/sources/ewol/object/Message.cpp index 8481598f..e6db8c6b 100644 --- a/sources/ewol/object/Message.cpp +++ b/sources/ewol/object/Message.cpp @@ -13,10 +13,10 @@ std::ostream& ewol::object::operator <<(std::ostream& _os, const ewol::object::Message& _obj) { _os << "{"; - if (NULL != _obj.getMessage()) { + if (nullptr != _obj.getMessage()) { _os << "msg=\"" << _obj.getMessage() << "\""; } else { - _os << "msg={NULL}"; + _os << "msg={nullptr}"; } _os << " data=\"" << _obj.getData() << "\"}"; return _os; diff --git a/sources/ewol/object/MultiCast.cpp b/sources/ewol/object/MultiCast.cpp index 6d824205..c202006d 100644 --- a/sources/ewol/object/MultiCast.cpp +++ b/sources/ewol/object/MultiCast.cpp @@ -25,12 +25,12 @@ ewol::object::MultiCast::~MultiCast() { void ewol::object::MultiCast::add(ewol::object::Shared _object, const char* const _message) { - if (NULL == _object) { - EWOL_ERROR("Add with NULL object"); + if (nullptr == _object) { + EWOL_ERROR("Add with nullptr object"); return; } - if (NULL == _message) { - EWOL_ERROR("Add with NULL Message"); + if (nullptr == _message) { + EWOL_ERROR("Add with nullptr Message"); return; } m_messageList.push_back(MessageList(_message, _object)); @@ -39,16 +39,16 @@ void ewol::object::MultiCast::add(ewol::object::Shared _object, co void ewol::object::MultiCast::rm(ewol::object::Shared _object) { - if (NULL == _object) { - EWOL_ERROR("Rm with NULL object"); + if (nullptr == _object) { + EWOL_ERROR("Rm with nullptr object"); return; } // send the message at all registered widget ... for (int32_t iii=m_messageList.size()-1; iii >= 0; iii--) { if(m_messageList[iii].m_object == _object) { EWOL_DEBUG("SendMulticast RM listener :" << _object->getId()); - m_messageList[iii].m_message = NULL; - m_messageList[iii].m_object = NULL; + m_messageList[iii].m_message = nullptr; + m_messageList[iii].m_object = nullptr; m_messageList.erase(m_messageList.begin()+iii); } } @@ -62,7 +62,7 @@ void ewol::object::MultiCast::send(ewol::object::Shared _object, c if( m_messageList[iii].m_message == _message && m_messageList[iii].m_object != _object) { - if (NULL != m_messageList[iii].m_object) { + if (nullptr != m_messageList[iii].m_object) { EWOL_VERBOSE(" id = " << m_messageList[iii].m_object->getId() << " type=" << m_messageList[iii].m_object->getObjectType()); // generate event ... (create message before ... ewol::object::Message tmpMsg(_object, m_messageList[iii].m_message, _data); diff --git a/sources/ewol/object/MultiCast.h b/sources/ewol/object/MultiCast.h index 485f8fa8..cfd2b92b 100644 --- a/sources/ewol/object/MultiCast.h +++ b/sources/ewol/object/MultiCast.h @@ -22,7 +22,7 @@ namespace ewol { private: class MessageList { public: - MessageList(const char* _message=NULL, ewol::object::Shared _object=NULL) : + MessageList(const char* _message=nullptr, ewol::object::Shared _object=nullptr) : m_message(_message), m_object(_object) { } @@ -34,7 +34,7 @@ namespace ewol { MultiCast(); ~MultiCast(); void anonymousSend(const char* const _messageId, const std::string& _data) { - send(NULL, _messageId, _data); + send(nullptr, _messageId, _data); }; void send(ewol::object::Shared _object, const char* const _message, const std::string& _data); void rm(ewol::object::Shared _object); diff --git a/sources/ewol/object/Object.cpp b/sources/ewol/object/Object.cpp index b75fb847..b48f2728 100644 --- a/sources/ewol/object/Object.cpp +++ b/sources/ewol/object/Object.cpp @@ -79,7 +79,7 @@ ewol::Object::Object() : m_uniqueId = m_valUID++; EWOL_DEBUG("new Object : [" << m_uniqueId << "]"); getObjectManager().add(this); - registerConfig(configName, "string", NULL, "Object name, might be a unique reference in all the program"); + registerConfig(configName, "string", nullptr, "Object name, might be a unique reference in all the program"); } ewol::Object::Object(const std::string& _name) : m_objRefCount(1), @@ -90,7 +90,7 @@ ewol::Object::Object(const std::string& _name) : m_uniqueId = m_valUID++; EWOL_DEBUG("new Object : [" << m_uniqueId << "]"); getObjectManager().add(this); - registerConfig(configName, "string", NULL, "Object name, might be a unique reference in all the program"); + registerConfig(configName, "string", nullptr, "Object name, might be a unique reference in all the program"); } ewol::Object::~Object() { @@ -98,9 +98,9 @@ ewol::Object::~Object() { getObjectManager().rm(this); getMultiCast().rm(this); for (size_t iii=0; iiilocalEventId << "' != '" << _generateEventId << "'"); continue; } - if (m_externEvent[iii]->destObject == NULL) { - EWOL_VERBOSE(" NULL dest"); + if (m_externEvent[iii]->destObject == nullptr) { + EWOL_VERBOSE(" nullptr dest"); continue; } if (m_externEvent[iii]->overloadData.size() <= 0){ @@ -207,12 +207,12 @@ void ewol::Object::registerOnEvent(ewol::object::Shared _destinati const char * _eventId, const char * _eventIdgenerated, const std::string& _overloadData) { - if (NULL == _destinationObject) { - EWOL_ERROR("Input ERROR NULL pointer Object ..."); + if (nullptr == _destinationObject) { + EWOL_ERROR("Input ERROR nullptr pointer Object ..."); return; } - if (NULL == _eventId) { - EWOL_ERROR("Input ERROR NULL pointer Event Id..."); + if (nullptr == _eventId) { + EWOL_ERROR("Input ERROR nullptr pointer Event Id..."); return; } if ( _eventId[0] == '*' @@ -220,14 +220,14 @@ void ewol::Object::registerOnEvent(ewol::object::Shared _destinati EWOL_VERBOSE("Register on all event ..."); for(size_t iii=0; iiilocalEventId = m_availlableEventId[iii]; tmpEvent->destObject = _destinationObject; tmpEvent->overloadData = _overloadData; - if (NULL != _eventIdgenerated) { + if (nullptr != _eventIdgenerated) { tmpEvent->destEventId = _eventIdgenerated; } else { tmpEvent->destEventId = m_availlableEventId[iii]; @@ -260,14 +260,14 @@ void ewol::Object::registerOnEvent(ewol::object::Shared _destinati return; } ewol::object::EventExtGen * tmpEvent = new ewol::object::EventExtGen(); - if (NULL == tmpEvent) { + if (nullptr == tmpEvent) { EWOL_ERROR("Allocation error in Register Event..."); return; } tmpEvent->localEventId = _eventId; tmpEvent->destObject = _destinationObject; tmpEvent->overloadData = _overloadData; - if (NULL != _eventIdgenerated) { + if (nullptr != _eventIdgenerated) { tmpEvent->destEventId = _eventIdgenerated; } else { tmpEvent->destEventId = _eventId; @@ -277,19 +277,19 @@ void ewol::Object::registerOnEvent(ewol::object::Shared _destinati void ewol::Object::unRegisterOnEvent(ewol::object::Shared _destinationObject, const char * _eventId) { - if (NULL == _destinationObject) { - EWOL_ERROR("Input ERROR NULL pointer Object ..."); + if (nullptr == _destinationObject) { + EWOL_ERROR("Input ERROR nullptr pointer Object ..."); return; } // check if event existed : for(int64_t iii = m_externEvent.size()-1; iii >= 0; --iii) { - if (m_externEvent[iii] == NULL) { + if (m_externEvent[iii] == nullptr) { continue; } if (m_externEvent[iii]->destObject != _destinationObject) { continue; } - if (_eventId == NULL) { + if (_eventId == nullptr) { m_externEvent.erase(m_externEvent.begin()+iii); } else if (m_externEvent[iii]->localEventId == _eventId) { m_externEvent.erase(m_externEvent.begin()+iii); @@ -312,12 +312,12 @@ void ewol::Object::registerConfig(const char* _config, const char* _control, const char* _description, const char* _default) { - if (NULL == _config) { - EWOL_ERROR("Try to add NULL config"); + if (nullptr == _config) { + EWOL_ERROR("Try to add nullptr config"); return; } for(size_t iii=0 ; iii object = getObjectManager().get(_objectName); - if (object == NULL) { + if (object == nullptr) { return false; } return object->setConfig(_conf); @@ -432,7 +432,7 @@ bool ewol::Object::setConfigNamed(const std::string& _objectName, const ewol::ob bool ewol::Object::setConfigNamed(const std::string& _objectName, const std::string& _config, const std::string& _value) { ewol::object::Shared object = getObjectManager().get(_objectName); - if (object == NULL) { + if (object == nullptr) { return false; } return object->setConfig(_config, _value); diff --git a/sources/ewol/object/Object.h b/sources/ewol/object/Object.h index 9aacd4a7..fd774eb1 100644 --- a/sources/ewol/object/Object.h +++ b/sources/ewol/object/Object.h @@ -184,15 +184,15 @@ namespace ewol { */ void registerOnEvent(ewol::object::Shared _destinationObject, const char * _eventId, - const char * _eventIdgenerated = NULL, + const char * _eventIdgenerated = nullptr, const std::string& _overloadData = ""); /** * @brief Un-Register an Object over an other. * @param[in] _destinationObject pointer on the object that might be call when an event is generated - * @param[in] _eventId Event generate inside the object (NULL to remove all event on this object) + * @param[in] _eventId Event generate inside the object (nullptr to remove all event on this object) */ void unRegisterOnEvent(ewol::object::Shared _destinationObject, - const char * _eventId = NULL); + const char * _eventId = nullptr); /** * @brief Inform object that an other object is removed ... * @note : Sub classes must call this class @@ -217,10 +217,10 @@ namespace ewol { * @param[in] _default Default value of this parameter. */ void registerConfig(const char* _config, - const char* _type = NULL, - const char* _control = NULL, - const char* _description = NULL, - const char* _default = NULL); + const char* _type = nullptr, + const char* _control = nullptr, + const char* _description = nullptr, + const char* _default = nullptr); /** * @brief Configuration requested to the curent Object * @param[in] _conf Configuration handle. diff --git a/sources/ewol/object/Owner.h b/sources/ewol/object/Owner.h index bbe3fc9c..65a2a43f 100644 --- a/sources/ewol/object/Owner.h +++ b/sources/ewol/object/Owner.h @@ -103,12 +103,12 @@ namespace ewol { //! @not in doc template inline bool operator==(const object::Owner& _obj, std::nullptr_t) noexcept { - return _obj.get() == NULL; + return _obj.get() == nullptr; } //! @not in doc template inline bool operator==(std::nullptr_t, const object::Owner& _obj) noexcept { - return _obj.get() == NULL; + return _obj.get() == nullptr; } //! @not in doc template inline bool operator!=(const object::Owner& _obj, std::nullptr_t) noexcept { - return _obj.get() != NULL; + return _obj.get() != nullptr; } //! @not in doc template inline bool operator!=(std::nullptr_t, const object::Owner& _obj) noexcept { - return _obj.get() != NULL; + return _obj.get() != nullptr; } //! @not in doc template inline bool operator==(const object::Shared& _obj, std::nullptr_t) noexcept { - return _obj.get() == NULL; + return _obj.get() == nullptr; } //! @not in doc template inline bool operator==(std::nullptr_t, const object::Shared& _obj) noexcept { - return _obj.get() == NULL; + return _obj.get() == nullptr; } //! @not in doc template inline bool operator!=(const object::Shared& _obj, std::nullptr_t) noexcept { - return _obj.get() != NULL; + return _obj.get() != nullptr; } //! @not in doc template inline bool operator!=(std::nullptr_t, const object::Shared& _obj) noexcept { - return _obj.get() != NULL; + return _obj.get() != nullptr; } //! @not in doc templatesize(); ++iii) { ejson::Object* tmpObj = baseArray->getObject(iii); - if (tmpObj == NULL) { + if (tmpObj == nullptr) { EWOL_DEBUG(" can not get object in 'color' id=" << iii); continue; } @@ -77,35 +77,35 @@ int32_t ewol::resource::ColorFile::request(const std::string& _paramName) { ewol::resource::ColorFile* ewol::resource::ColorFile::keep(const std::string& _filename) { EWOL_INFO("KEEP : ColorFile : file : \"" << _filename << "\""); - ewol::resource::ColorFile* object = NULL; + ewol::resource::ColorFile* object = nullptr; ewol::Resource* object2 = getManager().localKeep(_filename); - if (NULL != object2) { + if (nullptr != object2) { object = dynamic_cast(object2); - if (NULL == object) { + if (nullptr == object) { EWOL_CRITICAL("Request resource file : '" << _filename << "' With the wrong type (dynamic cast error)"); - return NULL; + return nullptr; } } - if (NULL != object) { + if (nullptr != object) { return object; } // this element create a new one every time .... object = new ewol::resource::ColorFile(_filename); - if (NULL == object) { + if (nullptr == object) { EWOL_ERROR("allocation error of a resource : " << _filename); - return NULL; + return nullptr; } getManager().localAdd(object); return object; } void ewol::resource::ColorFile::release(ewol::resource::ColorFile*& _object) { - if (NULL == _object) { + if (nullptr == _object) { return; } ewol::Resource* object2 = static_cast(_object); getManager().release(object2); - _object = NULL; + _object = nullptr; } diff --git a/sources/ewol/resource/ColorFile.h b/sources/ewol/resource/ColorFile.h index e6f05042..cffa6a25 100644 --- a/sources/ewol/resource/ColorFile.h +++ b/sources/ewol/resource/ColorFile.h @@ -73,7 +73,7 @@ namespace ewol { * @brief keep the resource pointer. * @note Never free this pointer by your own... * @param[in] _filename Name of the configuration file. - * @return pointer on the resource or NULL if an error occured. + * @return pointer on the resource or nullptr if an error occured. */ static ewol::resource::ColorFile* keep(const std::string& _filename); /** diff --git a/sources/ewol/resource/Colored3DObject.cpp b/sources/ewol/resource/Colored3DObject.cpp index fe29992b..0a4ba246 100644 --- a/sources/ewol/resource/Colored3DObject.cpp +++ b/sources/ewol/resource/Colored3DObject.cpp @@ -15,12 +15,12 @@ ewol::resource::Colored3DObject::Colored3DObject() : - m_GLprogram(NULL) { + m_GLprogram(nullptr) { addObjectType("ewol::Colored3DObject"); // get the shader resource : m_GLPosition = 0; m_GLprogram = ewol::resource::Program::keep("DATA:simple3D.prog"); - if (NULL != m_GLprogram ) { + if (nullptr != m_GLprogram ) { m_GLPosition = m_GLprogram->getAttribute("EW_coord3d"); m_GLColor = m_GLprogram->getUniform("EW_color"); m_GLMatrix = m_GLprogram->getUniform("EW_MatrixTransformation"); @@ -40,7 +40,7 @@ void ewol::resource::Colored3DObject::draw(std::vector& _vertices, if (_vertices.size() <= 0) { return; } - if (m_GLprogram == NULL) { + if (m_GLprogram == nullptr) { EWOL_ERROR("No shader ..."); return; } @@ -83,7 +83,7 @@ void ewol::resource::Colored3DObject::draw(std::vector& _vertices, if (_vertices.size() <= 0) { return; } - if (m_GLprogram == NULL) { + if (m_GLprogram == nullptr) { EWOL_ERROR("No shader ..."); return; } @@ -123,7 +123,7 @@ void ewol::resource::Colored3DObject::drawLine(std::vector& _vertices, if (_vertices.size() <= 0) { return; } - if (m_GLprogram == NULL) { + if (m_GLprogram == nullptr) { EWOL_ERROR("No shader ..."); return; } @@ -159,19 +159,19 @@ ewol::resource::Colored3DObject* ewol::resource::Colored3DObject::keep() { EWOL_VERBOSE("KEEP : direct Colored3DObject"); // need to crate a new one ... ewol::resource::Colored3DObject* object = new ewol::resource::Colored3DObject(); - if (NULL == object) { + if (nullptr == object) { EWOL_ERROR("allocation error of a resource : ???Colored3DObject??? "); - return NULL; + return nullptr; } getManager().localAdd(object); return object; } void ewol::resource::Colored3DObject::release(ewol::resource::Colored3DObject*& _object) { - if (NULL == _object) { + if (nullptr == _object) { return; } ewol::Resource* object2 = static_cast(_object); getManager().release(object2); - _object = NULL; + _object = nullptr; } diff --git a/sources/ewol/resource/Colored3DObject.h b/sources/ewol/resource/Colored3DObject.h index d1de6869..89499b6b 100644 --- a/sources/ewol/resource/Colored3DObject.h +++ b/sources/ewol/resource/Colored3DObject.h @@ -45,7 +45,7 @@ namespace ewol { /** * @brief keep the resource pointer. * @note Never free this pointer by your own... - * @return pointer on the resource or NULL if an error occured. + * @return pointer on the resource or nullptr if an error occured. */ static ewol::resource::Colored3DObject* keep(); /** diff --git a/sources/ewol/resource/ConfigFile.cpp b/sources/ewol/resource/ConfigFile.cpp index 0509de91..6e6189a3 100644 --- a/sources/ewol/resource/ConfigFile.cpp +++ b/sources/ewol/resource/ConfigFile.cpp @@ -30,9 +30,9 @@ ewol::resource::ConfigFile::ConfigFile(const std::string& _filename) : ewol::resource::ConfigFile::~ConfigFile() { // remove all element for (size_t iii=0; iiitoNumber(); - if (tmp == NULL) { + if (tmp == nullptr) { return 0.0; } return tmp->get(); @@ -82,11 +82,11 @@ double ewol::resource::ConfigFile::getNumber(int32_t _id) { const std::string& ewol::resource::ConfigFile::getString(int32_t _id) { static const std::string& errorString(""); if ( _id < 0 - || m_list[_id] == NULL) { + || m_list[_id] == nullptr) { return errorString; } ejson::String* tmp = m_list[_id]->toString(); - if (tmp == NULL) { + if (tmp == nullptr) { return errorString; } return tmp->get(); @@ -94,11 +94,11 @@ const std::string& ewol::resource::ConfigFile::getString(int32_t _id) { bool ewol::resource::ConfigFile::getBoolean(int32_t _id) { if ( _id < 0 - || m_list[_id] == NULL) { + || m_list[_id] == nullptr) { return false; } ejson::Boolean* tmp = m_list[_id]->toBoolean(); - if (tmp == NULL) { + if (tmp == nullptr) { return false; } return tmp->get(); @@ -106,35 +106,35 @@ bool ewol::resource::ConfigFile::getBoolean(int32_t _id) { ewol::resource::ConfigFile* ewol::resource::ConfigFile::keep(const std::string& _filename) { EWOL_INFO("KEEP : SimpleConfig : file : \"" << _filename << "\""); - ewol::resource::ConfigFile* object = NULL; + ewol::resource::ConfigFile* object = nullptr; ewol::Resource* object2 = getManager().localKeep(_filename); - if (NULL != object2) { + if (nullptr != object2) { object = dynamic_cast(object2); - if (NULL == object) { + if (nullptr == object) { EWOL_CRITICAL("Request resource file : '" << _filename << "' With the wrong type (dynamic cast error)"); - return NULL; + return nullptr; } } - if (NULL != object) { + if (nullptr != object) { return object; } // this element create a new one every time .... object = new ewol::resource::ConfigFile(_filename); - if (NULL == object) { + if (nullptr == object) { EWOL_ERROR("allocation error of a resource : '" << _filename << "'"); - return NULL; + return nullptr; } getManager().localAdd(object); return object; } void ewol::resource::ConfigFile::release(ewol::resource::ConfigFile*& _object) { - if (NULL == _object) { + if (nullptr == _object) { return; } ewol::Resource* object2 = static_cast(_object); getManager().release(object2); - _object = NULL; + _object = nullptr; } diff --git a/sources/ewol/resource/ConfigFile.h b/sources/ewol/resource/ConfigFile.h index 33af6bc0..8d1a08f1 100644 --- a/sources/ewol/resource/ConfigFile.h +++ b/sources/ewol/resource/ConfigFile.h @@ -37,7 +37,7 @@ namespace ewol { * @brief keep the resource pointer. * @note Never free this pointer by your own... * @param[in] _filename Name of the configuration file. - * @return pointer on the resource or NULL if an error occured. + * @return pointer on the resource or nullptr if an error occured. */ static ewol::resource::ConfigFile* keep(const std::string& _filename); /** diff --git a/sources/ewol/resource/DistanceFieldFont.cpp b/sources/ewol/resource/DistanceFieldFont.cpp index b34e3046..1f2395ea 100644 --- a/sources/ewol/resource/DistanceFieldFont.cpp +++ b/sources/ewol/resource/DistanceFieldFont.cpp @@ -29,7 +29,7 @@ ewol::resource::DistanceFieldFont::DistanceFieldFont(const std::string& _fontNam m_borderSize(10), m_textureBorderSize(0,0) { addObjectType("ewol::resource::DistanceFieldFont"); - m_font = NULL; + m_font = nullptr; m_lastGlyphPos.setValue(1,1); m_lastRawHeigh = 0; m_sizeRatio = 1.0f; @@ -84,18 +84,18 @@ ewol::resource::DistanceFieldFont::DistanceFieldFont(const std::string& _fontNam if (m_fileName.size() == 0) { EWOL_ERROR("can not load FONT name : '" << m_fileName << "'" ); - m_font = NULL; + m_font = nullptr; return; } EWOL_INFO("Load FONT name : '" << m_fileName << "'"); m_font = ewol::resource::FontFreeType::keep(m_fileName); - if (m_font == NULL) { + if (m_font == nullptr) { EWOL_ERROR("Pb Loading FONT name : '" << m_fileName << "'" ); } // set the bassic charset: m_listElement.clear(); - if (m_font == NULL) { + if (m_font == nullptr) { return; } if (importFromFile() == true) { @@ -211,7 +211,7 @@ void ewol::resource::DistanceFieldFont::generateDistanceField(const egami::Image bool ewol::resource::DistanceFieldFont::addGlyph(const char32_t& _val) { bool hasChange = false; - if (m_font == NULL) { + if (m_font == nullptr) { return false; } // add the curent "char" @@ -325,7 +325,7 @@ ewol::GlyphProperty* ewol::resource::DistanceFieldFont::getGlyphPointer(const ch if (m_listElement.size() > 0) { return &((m_listElement)[0]); } - return NULL; + return nullptr; } //EWOL_ERROR(" index=" << index); //EWOL_ERROR(" m_UVal=" << m_listElement[_displayMode][index].m_UVal); @@ -337,31 +337,31 @@ ewol::GlyphProperty* ewol::resource::DistanceFieldFont::getGlyphPointer(const ch ewol::resource::DistanceFieldFont* ewol::resource::DistanceFieldFont::keep(const std::string& _filename) { EWOL_VERBOSE("KEEP : DistanceFieldFont : file : '" << _filename << "'"); - ewol::resource::DistanceFieldFont* object = NULL; + ewol::resource::DistanceFieldFont* object = nullptr; ewol::Resource* object2 = getManager().localKeep(_filename); - if (NULL != object2) { + if (nullptr != object2) { object = dynamic_cast(object2); - if (NULL == object) { + if (nullptr == object) { EWOL_CRITICAL("Request resource file : '" << _filename << "' With the wrong type (dynamic cast error)"); - return NULL; + return nullptr; } } - if (NULL != object) { + if (nullptr != object) { return object; } // need to crate a new one ... EWOL_DEBUG("CREATE: DistanceFieldFont : file : '" << _filename << "'"); object = new ewol::resource::DistanceFieldFont(_filename); - if (NULL == object) { + if (nullptr == object) { EWOL_ERROR("allocation error of a resource : " << _filename); - return NULL; + return nullptr; } getManager().localAdd(object); return object; } void ewol::resource::DistanceFieldFont::release(ewol::resource::DistanceFieldFont*& _object) { - if (NULL == _object) { + if (nullptr == _object) { return; } std::string name = _object->getName(); @@ -371,20 +371,20 @@ void ewol::resource::DistanceFieldFont::release(ewol::resource::DistanceFieldFon EWOL_DEBUG("REMOVE: DistanceFieldFont : file : '" << name << "' count=" << count); //etk::displayBacktrace(false); } - _object = NULL; + _object = nullptr; } void ewol::resource::DistanceFieldFont::exportOnFile() { EWOL_DEBUG("EXPORT: DistanceFieldFont : file : '" << m_fileName << ".json'"); ejson::Document doc; ejson::Array* tmpList = new ejson::Array(); - if (tmpList == NULL) { - EWOL_ERROR("NULL pointer"); + if (tmpList == nullptr) { + EWOL_ERROR("nullptr pointer"); return; } for (size_t iii=0; iiiaddString("m_UVal", std::to_string(m_listElement[iii].m_UVal)); @@ -427,14 +427,14 @@ bool ewol::resource::DistanceFieldFont::importFromFile() { m_borderSize = doc.getNumberValue("m_borderSize", 2); m_textureBorderSize = doc.addString("m_textureBorderSize", "0,0"); ejson::Array* tmpList = doc.getArray("m_listElement"); - if (tmpList == NULL) { - EWOL_ERROR("NULL pointer array"); + if (tmpList == nullptr) { + EWOL_ERROR("nullptr pointer array"); return false; } m_listElement.clear(); for (size_t iii=0; iiisize(); ++iii) { ejson::Object* tmpObj = tmpList->getObject(iii); - if (tmpObj == NULL) { + if (tmpObj == nullptr) { continue; } GlyphProperty prop; diff --git a/sources/ewol/resource/DistanceFieldFont.h b/sources/ewol/resource/DistanceFieldFont.h index 1a87396a..b1c42c56 100644 --- a/sources/ewol/resource/DistanceFieldFont.h +++ b/sources/ewol/resource/DistanceFieldFont.h @@ -60,7 +60,7 @@ namespace ewol { /** * @brief get the pointer on the coresponding glyph * @param[in] _charcode The unicodeValue - * @return The pointer on the glyph == > never NULL + * @return The pointer on the glyph == > never nullptr */ ewol::GlyphProperty* getGlyphPointer(const char32_t& _charcode); public: @@ -68,7 +68,7 @@ namespace ewol { * @brief keep the resource pointer. * @note Never free this pointer by your own... * @param[in] _filename Name of the texture font. - * @return pointer on the resource or NULL if an error occured. + * @return pointer on the resource or nullptr if an error occured. */ static ewol::resource::DistanceFieldFont* keep(const std::string& _filename); /** diff --git a/sources/ewol/resource/FontFreeType.cpp b/sources/ewol/resource/FontFreeType.cpp index 39b0ed53..96250879 100644 --- a/sources/ewol/resource/FontFreeType.cpp +++ b/sources/ewol/resource/FontFreeType.cpp @@ -46,7 +46,7 @@ void ewol::resource::freeTypeUnInit() { return; } int32_t error = FT_Done_FreeType( library ); - library = NULL; + library = nullptr; if(0 != error) { EWOL_CRITICAL(" when Un-loading FreeType Librairy ..."); } @@ -56,7 +56,7 @@ ewol::resource::FontFreeType::FontFreeType(const std::string& _fontName) : FontBase(_fontName) { addObjectType("ewol::FontFreeType"); m_init = false; - m_FileBuffer = NULL; + m_FileBuffer = nullptr; m_FileSize = 0; etk::FSNode myfile(_fontName); @@ -75,7 +75,7 @@ ewol::resource::FontFreeType::FontFreeType(const std::string& _fontName) : } // allocate data m_FileBuffer = new FT_Byte[m_FileSize]; - if (NULL == m_FileBuffer) { + if (nullptr == m_FileBuffer) { EWOL_ERROR("Error Memory allocation size=" << _fontName); return; } @@ -99,9 +99,9 @@ ewol::resource::FontFreeType::FontFreeType(const std::string& _fontName) : ewol::resource::FontFreeType::~FontFreeType() { // clean the tmp memory - if (NULL != m_FileBuffer) { + if (nullptr != m_FileBuffer) { delete[] m_FileBuffer; - m_FileBuffer = NULL; + m_FileBuffer = nullptr; } // must be deleted fftFace FT_Done_Face( m_fftFace ); @@ -392,34 +392,34 @@ void ewol::resource::FontFreeType::display() { ewol::resource::FontBase* ewol::resource::FontFreeType::keep(const std::string& _filename) { EWOL_VERBOSE("KEEP : Font : file : \"" << _filename << "\""); - ewol::resource::FontBase* object = NULL; + ewol::resource::FontBase* object = nullptr; ewol::Resource* object2 = getManager().localKeep(_filename); - if (NULL != object2) { + if (nullptr != object2) { object = dynamic_cast(object2); - if (NULL == object) { + if (nullptr == object) { EWOL_CRITICAL("Request resource file : '" << _filename << "' With the wrong type (dynamic cast error)"); - return NULL; + return nullptr; } } - if (NULL != object) { + if (nullptr != object) { return object; } // need to crate a new one ... object = new ewol::resource::FontFreeType(_filename); - if (NULL == object) { + if (nullptr == object) { EWOL_ERROR("allocation error of a resource : " << _filename); - return NULL; + return nullptr; } getManager().localAdd(object); return object; } void ewol::resource::FontFreeType::release(ewol::resource::FontBase*& _object) { - if (NULL == _object) { + if (nullptr == _object) { return; } ewol::Resource* object2 = static_cast(_object); getManager().release(object2); - _object = NULL; + _object = nullptr; } diff --git a/sources/ewol/resource/FontFreeType.h b/sources/ewol/resource/FontFreeType.h index 26889a18..46dc453a 100644 --- a/sources/ewol/resource/FontFreeType.h +++ b/sources/ewol/resource/FontFreeType.h @@ -58,7 +58,7 @@ namespace ewol { * @brief keep the resource pointer. * @note Never free this pointer by your own... * @param[in] _filename Name of the base font. - * @return pointer on the resource or NULL if an error occured. + * @return pointer on the resource or nullptr if an error occured. */ static ewol::resource::FontBase* keep(const std::string& _filename); /** diff --git a/sources/ewol/resource/Image.cpp b/sources/ewol/resource/Image.cpp index a859d54f..0089e3c0 100644 --- a/sources/ewol/resource/Image.cpp +++ b/sources/ewol/resource/Image.cpp @@ -66,9 +66,9 @@ ewol::resource::TextureFile* ewol::resource::TextureFile::keep(const std::string EWOL_VERBOSE("KEEP: TextureFile: '" << _filename << "' size=" << _size); if (_filename == "") { ewol::resource::TextureFile* object = new ewol::resource::TextureFile(""); - if (NULL == object) { + if (nullptr == object) { EWOL_ERROR("allocation error of a resource : ??TEX??"); - return NULL; + return nullptr; } getManager().localAdd(object); return object; @@ -101,24 +101,24 @@ ewol::resource::TextureFile* ewol::resource::TextureFile::keep(const std::string } EWOL_VERBOSE("KEEP: TextureFile: '" << TmpFilename << "' new size=" << _size); - ewol::resource::TextureFile* object = NULL; + ewol::resource::TextureFile* object = nullptr; ewol::Resource* object2 = getManager().localKeep(TmpFilename); - if (NULL != object2) { + if (nullptr != object2) { object = dynamic_cast(object2); - if (NULL == object) { + if (nullptr == object) { EWOL_CRITICAL("Request resource file : '" << TmpFilename << "' With the wrong type (dynamic cast error)"); - return NULL; + return nullptr; } } - if (NULL != object) { + if (nullptr != object) { return object; } EWOL_INFO("CREATE: TextureFile: '" << TmpFilename << "' size=" << _size); // need to crate a new one ... object = new ewol::resource::TextureFile(TmpFilename, _filename, _size); - if (NULL == object) { + if (nullptr == object) { EWOL_ERROR("allocation error of a resource : " << _filename); - return NULL; + return nullptr; } getManager().localAdd(object); return object; @@ -126,11 +126,11 @@ ewol::resource::TextureFile* ewol::resource::TextureFile::keep(const std::string void ewol::resource::TextureFile::release(ewol::resource::TextureFile*& _object) { - if (NULL == _object) { + if (nullptr == _object) { return; } ewol::Resource* object2 = static_cast(_object); getManager().release(object2); - _object = NULL; + _object = nullptr; } diff --git a/sources/ewol/resource/Image.h b/sources/ewol/resource/Image.h index 2966e09f..6db3e60b 100644 --- a/sources/ewol/resource/Image.h +++ b/sources/ewol/resource/Image.h @@ -34,7 +34,7 @@ namespace ewol { * @note Never free this pointer by your own... * @param[in] _filename Name of the image file. * @param[in] _requested size of the image (usefull when loading .svg to automatic rescale) - * @return pointer on the resource or NULL if an error occured. + * @return pointer on the resource or nullptr if an error occured. */ static ewol::resource::TextureFile* keep(const std::string& _filename, ivec2 _size=ivec2(-1,-1)); /** diff --git a/sources/ewol/resource/ImageDF.cpp b/sources/ewol/resource/ImageDF.cpp index 5bb9ffe3..ed82a2d4 100644 --- a/sources/ewol/resource/ImageDF.cpp +++ b/sources/ewol/resource/ImageDF.cpp @@ -155,9 +155,9 @@ ewol::resource::ImageDF* ewol::resource::ImageDF::keep(const std::string& _filen EWOL_VERBOSE("KEEP: TextureFile: '" << _filename << "' size=" << _size); if (_filename == "") { ewol::resource::ImageDF* object = new ewol::resource::ImageDF(""); - if (NULL == object) { + if (nullptr == object) { EWOL_ERROR("allocation error of a resource : ??TEX??"); - return NULL; + return nullptr; } getManager().localAdd(object); return object; @@ -190,24 +190,24 @@ ewol::resource::ImageDF* ewol::resource::ImageDF::keep(const std::string& _filen } EWOL_VERBOSE("KEEP: TextureFile: '" << TmpFilename << "' new size=" << _size); - ewol::resource::ImageDF* object = NULL; + ewol::resource::ImageDF* object = nullptr; ewol::Resource* object2 = getManager().localKeep("DF__" + TmpFilename); - if (NULL != object2) { + if (nullptr != object2) { object = dynamic_cast(object2); - if (NULL == object) { + if (nullptr == object) { EWOL_CRITICAL("Request resource file : '" << TmpFilename << "' With the wrong type (dynamic cast error)"); - return NULL; + return nullptr; } } - if (NULL != object) { + if (nullptr != object) { return object; } EWOL_INFO("CREATE: ImageDF: '" << TmpFilename << "' size=" << _size); // need to crate a new one ... object = new ewol::resource::ImageDF("DF__" + TmpFilename, _filename, _size); - if (NULL == object) { + if (nullptr == object) { EWOL_ERROR("allocation error of a resource : " << _filename); - return NULL; + return nullptr; } getManager().localAdd(object); return object; @@ -215,11 +215,11 @@ ewol::resource::ImageDF* ewol::resource::ImageDF::keep(const std::string& _filen void ewol::resource::ImageDF::release(ewol::resource::ImageDF*& _object) { - if (NULL == _object) { + if (nullptr == _object) { return; } ewol::Resource* object2 = static_cast(_object); getManager().release(object2); - _object = NULL; + _object = nullptr; } diff --git a/sources/ewol/resource/ImageDF.h b/sources/ewol/resource/ImageDF.h index 2c739bc7..4cd0983c 100644 --- a/sources/ewol/resource/ImageDF.h +++ b/sources/ewol/resource/ImageDF.h @@ -41,7 +41,7 @@ namespace ewol { * @note Never free this pointer by your own... * @param[in] _filename Name of the image file. * @param[in] _requested size of the image (usefull when loading .svg to automatic rescale) - * @return pointer on the resource or NULL if an error occured. + * @return pointer on the resource or nullptr if an error occured. */ static ewol::resource::ImageDF* keep(const std::string& _filename, ivec2 _size=ivec2(-1,-1)); /** diff --git a/sources/ewol/resource/Manager.cpp b/sources/ewol/resource/Manager.cpp index f8387366..298888f9 100644 --- a/sources/ewol/resource/Manager.cpp +++ b/sources/ewol/resource/Manager.cpp @@ -41,12 +41,12 @@ void ewol::resource::Manager::unInit() { m_resourceListToUpdate.clear(); // remove all resources ... for (int64_t iii=m_resourceList.size()-1; iii >= 0; iii--) { - if (m_resourceList[iii] != NULL) { + if (m_resourceList[iii] != nullptr) { EWOL_WARNING("Find a resource that is not removed : [" << m_resourceList[iii]->getId() << "]" << "=\"" << m_resourceList[iii]->getName() << "\" " << m_resourceList[iii]->getCounter() << " elements"); delete(m_resourceList[iii]); - m_resourceList[iii] = NULL; + m_resourceList[iii] = nullptr; } } m_resourceList.clear(); @@ -56,7 +56,7 @@ void ewol::resource::Manager::display() { EWOL_INFO("Resources loaded : "); // remove all resources ... for (int64_t iii=m_resourceList.size()-1; iii >= 0; iii--) { - if (m_resourceList[iii] != NULL) { + if (m_resourceList[iii] != nullptr) { EWOL_INFO(" [" << m_resourceList[iii]->getId() << "]" << m_resourceList[iii]->getObjectType() << "=\"" << m_resourceList[iii]->getName() << "\" " @@ -73,7 +73,7 @@ void ewol::resource::Manager::reLoadResources() { for (size_t jjj=0; jjj= 0; iii--) { - if(m_resourceList[iii] != NULL) { + if(m_resourceList[iii] != nullptr) { if (jjj == m_resourceList[iii]->getResourceLevel()) { m_resourceList[iii]->reload(); EWOL_INFO(" [" << m_resourceList[iii]->getId() << "]="<< m_resourceList[iii]->getObjectType()); @@ -90,7 +90,7 @@ void ewol::resource::Manager::reLoadResources() { void ewol::resource::Manager::update(ewol::Resource* _object) { // chek if not added before for (size_t iii=0; iiigetResourceLevel()) { //EWOL_DEBUG("Update context of " << iii << " named : " << l_resourceList[iii]->getName()); m_resourceList[iii]->updateContext(); @@ -124,7 +124,7 @@ void ewol::resource::Manager::updateContext() { for (size_t jjj=0; jjjgetResourceLevel()) { m_resourceListToUpdate[iii]->updateContext(); } @@ -140,7 +140,7 @@ void ewol::resource::Manager::updateContext() { // in this case, it is really too late ... void ewol::resource::Manager::contextHasBeenDestroyed() { for (size_t iii=0; iiiremoveContextToLate(); } } @@ -152,7 +152,7 @@ void ewol::resource::Manager::contextHasBeenDestroyed() { ewol::Resource* ewol::resource::Manager::localKeep(const std::string& _filename) { EWOL_VERBOSE("KEEP (DEFAULT) : file : \"" << _filename << "\""); for (size_t iii=0; iiigetName() == _filename) { m_resourceList[iii]->increment(); return m_resourceList[iii]; @@ -160,14 +160,14 @@ ewol::Resource* ewol::resource::Manager::localKeep(const std::string& _filename) } } // we did not find it ... - return NULL; + return nullptr; } // internal generic keeper ... void ewol::resource::Manager::localAdd(ewol::Resource* _object) { //Add ... find empty slot for (size_t iii=0; iiigetName() << "\""); for (int64_t iii=m_resourceList.size()-1; iii >= 0; iii--) { - if (m_resourceList[iii] == NULL) { + if (m_resourceList[iii] == nullptr) { continue; } if(m_resourceList[iii] != _object) { @@ -197,20 +197,20 @@ bool ewol::resource::Manager::release(ewol::Resource*& _object) { } if (m_resourceList[iii]->decrement() == true) { // remove element from the list : - m_resourceList[iii] = NULL; + m_resourceList[iii] = nullptr; // delete element _object->removeObject(); // insidiously remove the pointer for the caller ... - _object = NULL; + _object = nullptr; return true; // object really removed } // insidiously remove the pointer for the caller ... - _object = NULL; + _object = nullptr; return false; // just decrement ... } EWOL_ERROR("Can not find the resources in the list : " << (int64_t)_object); // insidiously remove the pointer for the caller ... - _object = NULL; + _object = nullptr; return false; } @@ -219,13 +219,13 @@ void ewol::resource::Manager::onObjectRemove(ewol::object::Shared for (size_t iii=0; iii is return at NULL value. + * @param[in,out] _object element to realease == > is return at nullptr value. * @return true, if element is removed, and false for just decreasing counter */ bool release(ewol::Resource*& _object); diff --git a/sources/ewol/resource/Program.cpp b/sources/ewol/resource/Program.cpp index 82f17934..402c9d9c 100644 --- a/sources/ewol/resource/Program.cpp +++ b/sources/ewol/resource/Program.cpp @@ -37,7 +37,7 @@ ewol::resource::Program::Program(const std::string& _filename) : // remove extention ... tmpFilename.erase(tmpFilename.size()-4, 4); ewol::resource::Shader* tmpShader = ewol::resource::Shader::keep(tmpFilename+"vert"); - if (NULL == tmpShader) { + if (nullptr == tmpShader) { EWOL_CRITICAL("Error while getting a specific shader filename : " << tmpFilename); return; } else { @@ -45,7 +45,7 @@ ewol::resource::Program::Program(const std::string& _filename) : m_shaderList.push_back(tmpShader); } tmpShader = ewol::resource::Shader::keep(tmpFilename+"frag"); - if (NULL == tmpShader) { + if (nullptr == tmpShader) { EWOL_CRITICAL("Error while getting a specific shader filename : " << tmpFilename); return; } else { @@ -64,7 +64,7 @@ ewol::resource::Program::Program(const std::string& _filename) : } #define MAX_LINE_SIZE (2048) char tmpData[MAX_LINE_SIZE]; - while (file.fileGets(tmpData, MAX_LINE_SIZE) != NULL) { + while (file.fileGets(tmpData, MAX_LINE_SIZE) != nullptr) { int32_t len = strlen(tmpData); if( tmpData[len-1] == '\n' || tmpData[len-1] == '\r') { @@ -81,7 +81,7 @@ ewol::resource::Program::Program(const std::string& _filename) : // get it with relative position : std::string tmpFilename = file.getRelativeFolder() + tmpData; ewol::resource::Shader* tmpShader = ewol::resource::Shader::keep(tmpFilename); - if (NULL == tmpShader) { + if (nullptr == tmpShader) { EWOL_CRITICAL("Error while getting a specific shader filename : " << tmpFilename); } else { EWOL_DEBUG("Add shader on program : "<< tmpFilename); @@ -173,7 +173,7 @@ void ewol::resource::Program::updateContext() { EWOL_DEBUG("Create program with oglID=" << m_program); // first attach vertex shader, and after fragment shader for (size_t iii=0; iiigetShaderType() == GL_VERTEX_SHADER) { glAttachShader(m_program, m_shaderList[iii]->getGL_ID()); checkGlError("glAttachShader", __LINE__); @@ -181,7 +181,7 @@ void ewol::resource::Program::updateContext() { } } for (size_t iii=0; iiigetShaderType() == GL_FRAGMENT_SHADER) { glAttachShader(m_program, m_shaderList[iii]->getGL_ID()); checkGlError("glAttachShader", __LINE__); @@ -280,13 +280,13 @@ void ewol::resource::Program::reload() { return; } // remove previous data ... - if (NULL != m_fileData) { + if (nullptr != m_fileData) { delete[] m_fileData; m_fileData = 0; } // allocate data m_fileData = new char[fileSize+5]; - if (NULL == m_fileData) { + if (nullptr == m_fileData) { EWOL_ERROR("Error Memory allocation size=" << fileSize); return; } @@ -514,8 +514,8 @@ void ewol::resource::Program::uniform1fv(int32_t _idElem, int32_t _nbElement, co EWOL_ERROR("No element to send at open GL ..."); return; } - if (NULL == _value) { - EWOL_ERROR("NULL Input pointer to send at open GL ..."); + if (nullptr == _value) { + EWOL_ERROR("nullptr Input pointer to send at open GL ..."); return; } glUniform1fv(m_elementList[_idElem].m_elementId, _nbElement, _value); @@ -536,8 +536,8 @@ void ewol::resource::Program::uniform2fv(int32_t _idElem, int32_t _nbElement, co EWOL_ERROR("No element to send at open GL ..."); return; } - if (NULL == _value) { - EWOL_ERROR("NULL Input pointer to send at open GL ..."); + if (nullptr == _value) { + EWOL_ERROR("nullptr Input pointer to send at open GL ..."); return; } glUniform2fv(m_elementList[_idElem].m_elementId, _nbElement, _value); @@ -558,8 +558,8 @@ void ewol::resource::Program::uniform3fv(int32_t _idElem, int32_t _nbElement, co EWOL_ERROR("No element to send at open GL ..."); return; } - if (NULL == _value) { - EWOL_ERROR("NULL Input pointer to send at open GL ..."); + if (nullptr == _value) { + EWOL_ERROR("nullptr Input pointer to send at open GL ..."); return; } glUniform3fv(m_elementList[_idElem].m_elementId, _nbElement, _value); @@ -580,8 +580,8 @@ void ewol::resource::Program::uniform4fv(int32_t _idElem, int32_t _nbElement, co EWOL_ERROR("No element to send at open GL ..."); return; } - if (NULL == _value) { - EWOL_ERROR("NULL Input pointer to send at open GL ..."); + if (nullptr == _value) { + EWOL_ERROR("nullptr Input pointer to send at open GL ..."); return; } glUniform4fv(m_elementList[_idElem].m_elementId, _nbElement, _value); @@ -605,8 +605,8 @@ void ewol::resource::Program::uniform1iv(int32_t _idElem, int32_t _nbElement, co EWOL_ERROR("No element to send at open GL ..."); return; } - if (NULL == _value) { - EWOL_ERROR("NULL Input pointer to send at open GL ..."); + if (nullptr == _value) { + EWOL_ERROR("nullptr Input pointer to send at open GL ..."); return; } glUniform1iv(m_elementList[_idElem].m_elementId, _nbElement, _value); @@ -627,8 +627,8 @@ void ewol::resource::Program::uniform2iv(int32_t _idElem, int32_t _nbElement, co EWOL_ERROR("No element to send at open GL ..."); return; } - if (NULL == _value) { - EWOL_ERROR("NULL Input pointer to send at open GL ..."); + if (nullptr == _value) { + EWOL_ERROR("nullptr Input pointer to send at open GL ..."); return; } glUniform2iv(m_elementList[_idElem].m_elementId, _nbElement, _value); @@ -649,8 +649,8 @@ void ewol::resource::Program::uniform3iv(int32_t _idElem, int32_t _nbElement, co EWOL_ERROR("No element to send at open GL ..."); return; } - if (NULL == _value) { - EWOL_ERROR("NULL Input pointer to send at open GL ..."); + if (nullptr == _value) { + EWOL_ERROR("nullptr Input pointer to send at open GL ..."); return; } glUniform3iv(m_elementList[_idElem].m_elementId, _nbElement, _value); @@ -671,8 +671,8 @@ void ewol::resource::Program::uniform4iv(int32_t _idElem, int32_t _nbElement, co EWOL_ERROR("No element to send at open GL ..."); return; } - if (NULL == _value) { - EWOL_ERROR("NULL Input pointer to send at open GL ..."); + if (nullptr == _value) { + EWOL_ERROR("nullptr Input pointer to send at open GL ..."); return; } glUniform4iv(m_elementList[_idElem].m_elementId, _nbElement, _value); @@ -777,23 +777,23 @@ void ewol::resource::Program::unUse() { ewol::resource::Program* ewol::resource::Program::keep(const std::string& _filename) { EWOL_VERBOSE("KEEP : Program : file : \"" << _filename << "\""); - ewol::resource::Program* object = NULL; + ewol::resource::Program* object = nullptr; ewol::Resource* object2 = getManager().localKeep(_filename); - if (NULL != object2) { + if (nullptr != object2) { object = dynamic_cast(object2); - if (NULL == object) { + if (nullptr == object) { EWOL_CRITICAL("Request resource file : '" << _filename << "' With the wrong type (dynamic cast error)"); - return NULL; + return nullptr; } } - if (NULL != object) { + if (nullptr != object) { return object; } // need to crate a new one ... object = new ewol::resource::Program(_filename); - if (NULL == object) { + if (nullptr == object) { EWOL_ERROR("allocation error of a resource : " << _filename); - return NULL; + return nullptr; } getManager().localAdd(object); return object; @@ -801,10 +801,10 @@ ewol::resource::Program* ewol::resource::Program::keep(const std::string& _filen void ewol::resource::Program::release(ewol::resource::Program*& _object) { - if (NULL == _object) { + if (nullptr == _object) { return; } ewol::Resource* object2 = static_cast(_object); getManager().release(object2); - _object = NULL; + _object = nullptr; } \ No newline at end of file diff --git a/sources/ewol/resource/Program.h b/sources/ewol/resource/Program.h index a17595c4..7dc272d3 100644 --- a/sources/ewol/resource/Program.h +++ b/sources/ewol/resource/Program.h @@ -297,7 +297,7 @@ namespace ewol { * @brief keep the resource pointer. * @note Never free this pointer by your own... * @param[in] _filename Name of the openGL program. - * @return pointer on the resource or NULL if an error occured. + * @return pointer on the resource or nullptr if an error occured. */ static ewol::resource::Program* keep(const std::string& _filename); /** diff --git a/sources/ewol/resource/Shader.cpp b/sources/ewol/resource/Shader.cpp index 29629af2..76307607 100644 --- a/sources/ewol/resource/Shader.cpp +++ b/sources/ewol/resource/Shader.cpp @@ -18,7 +18,7 @@ ewol::resource::Shader::Shader(const std::string& _filename) : ewol::Resource(_filename), m_exist(false), - m_fileData(NULL), + m_fileData(nullptr), m_shader(0), m_type(0) { addObjectType("ewol::Shader"); @@ -38,9 +38,9 @@ ewol::resource::Shader::Shader(const std::string& _filename) : } ewol::resource::Shader::~Shader() { - if (NULL != m_fileData) { + if (nullptr != m_fileData) { delete [] m_fileData; - m_fileData = NULL; + m_fileData = nullptr; } if (0!=m_shader) { glDeleteShader(m_shader); @@ -62,7 +62,7 @@ void ewol::resource::Shader::updateContext() { // Do nothing == > too dangerous ... } else { // create the Shader - if (NULL == m_fileData) { + if (nullptr == m_fileData) { m_shader = 0; return; } @@ -73,7 +73,7 @@ void ewol::resource::Shader::updateContext() { return; } else { //EWOL_INFO("Creater shader with GLID=" << m_shader); - glShaderSource(m_shader, 1, (const char**)&m_fileData, NULL); + glShaderSource(m_shader, 1, (const char**)&m_fileData, nullptr); glCompileShader(m_shader); GLint compiled = 0; glGetShaderiv(m_shader, GL_COMPILE_STATUS, &compiled); @@ -128,13 +128,13 @@ void ewol::resource::Shader::reload() { return; } // remove previous data ... - if (NULL != m_fileData) { + if (nullptr != m_fileData) { delete[] m_fileData; m_fileData = 0; } // allocate data m_fileData = new char[fileSize+5]; - if (NULL == m_fileData) { + if (nullptr == m_fileData) { EWOL_ERROR("Error Memory allocation size=" << fileSize); return; } @@ -151,33 +151,33 @@ void ewol::resource::Shader::reload() { ewol::resource::Shader* ewol::resource::Shader::keep(const std::string& _filename) { EWOL_VERBOSE("KEEP : Simpleshader : file : \"" << _filename << "\""); - ewol::resource::Shader* object = NULL; + ewol::resource::Shader* object = nullptr; ewol::Resource* object2 = getManager().localKeep(_filename); - if (NULL != object2) { + if (nullptr != object2) { object = dynamic_cast(object2); - if (NULL == object) { + if (nullptr == object) { EWOL_CRITICAL("Request resource file : '" << _filename << "' With the wrong type (dynamic cast error)"); - return NULL; + return nullptr; } } - if (NULL != object) { + if (nullptr != object) { return object; } // need to crate a new one ... object = new ewol::resource::Shader(_filename); - if (NULL == object) { + if (nullptr == object) { EWOL_ERROR("allocation error of a resource : " << _filename); - return NULL; + return nullptr; } getManager().localAdd(object); return object; } void ewol::resource::Shader::release(ewol::resource::Shader*& _object) { - if (NULL == _object) { + if (nullptr == _object) { return; } ewol::Resource* object2 = static_cast(_object); getManager().release(object2); - _object = NULL; + _object = nullptr; } diff --git a/sources/ewol/resource/Shader.h b/sources/ewol/resource/Shader.h index c24bd55e..077079a3 100644 --- a/sources/ewol/resource/Shader.h +++ b/sources/ewol/resource/Shader.h @@ -72,7 +72,7 @@ namespace ewol { * @brief keep the resource pointer. * @note Never free this pointer by your own... * @param[in] _filename Name of the openGL Shader. - * @return pointer on the resource or NULL if an error occured. + * @return pointer on the resource or nullptr if an error occured. */ static ewol::resource::Shader* keep(const std::string& _filename); /** diff --git a/sources/ewol/resource/Texture.cpp b/sources/ewol/resource/Texture.cpp index 250e2be9..b633dce3 100644 --- a/sources/ewol/resource/Texture.cpp +++ b/sources/ewol/resource/Texture.cpp @@ -110,19 +110,19 @@ void ewol::resource::Texture::setImageSize(ivec2 _newSize) { ewol::resource::Texture* ewol::resource::Texture::keep() { // this element create a new one every time .... ewol::resource::Texture* object = new ewol::resource::Texture(); - if (NULL == object) { + if (nullptr == object) { EWOL_ERROR("allocation error of a resource : ??TEX??"); - return NULL; + return nullptr; } getManager().localAdd(object); return object; } void ewol::resource::Texture::release(ewol::resource::Texture*& _object) { - if (NULL == _object) { + if (nullptr == _object) { return; } ewol::Resource* object2 = static_cast(_object); getManager().release(object2); - _object = NULL; + _object = nullptr; } diff --git a/sources/ewol/resource/Texture.h b/sources/ewol/resource/Texture.h index ac13ca95..6604c218 100644 --- a/sources/ewol/resource/Texture.h +++ b/sources/ewol/resource/Texture.h @@ -61,7 +61,7 @@ namespace ewol { /** * @brief keep the resource pointer. * @note Never free this pointer by your own... - * @return pointer on the resource or NULL if an error occured. + * @return pointer on the resource or nullptr if an error occured. */ static ewol::resource::Texture* keep(); /** diff --git a/sources/ewol/resource/TexturedFont.cpp b/sources/ewol/resource/TexturedFont.cpp index 8db88e88..70a97aa2 100644 --- a/sources/ewol/resource/TexturedFont.cpp +++ b/sources/ewol/resource/TexturedFont.cpp @@ -47,10 +47,10 @@ ewol::resource::TexturedFont::TexturedFont(const std::string& _fontName) : addObjectType("ewol::resource::TexturedFont"); EWOL_DEBUG("Load font : '" << _fontName << "'" ); - m_font[0] = NULL; - m_font[1] = NULL; - m_font[2] = NULL; - m_font[3] = NULL; + m_font[0] = nullptr; + m_font[1] = nullptr; + m_font[2] = nullptr; + m_font[3] = nullptr; m_modeWraping[0] = ewol::font::Regular; m_modeWraping[1] = ewol::font::Regular; @@ -72,7 +72,7 @@ ewol::resource::TexturedFont::TexturedFont(const std::string& _fontName) : const char * tmpData = _fontName.c_str(); const char * tmpPos = strchr(tmpData, ':'); - if (tmpPos == NULL) { + if (tmpPos == nullptr) { m_size = 1; EWOL_CRITICAL("Can not parse the font name : \"" << _fontName << "\" ??? ':' " ); return; @@ -188,19 +188,19 @@ ewol::resource::TexturedFont::TexturedFont(const std::string& _fontName) : for (int32_t iiiFontId=0; iiiFontId<4 ; iiiFontId++) { if (m_fileName[iiiFontId].size() == 0) { EWOL_DEBUG("can not load FONT [" << iiiFontId << "] name : \"" << m_fileName[iiiFontId] << "\" == > size=" << m_size ); - m_font[iiiFontId] = NULL; + m_font[iiiFontId] = nullptr; continue; } EWOL_INFO("Load FONT [" << iiiFontId << "] name : \"" << m_fileName[iiiFontId] << "\" == > size=" << m_size); m_font[iiiFontId] = ewol::resource::FontFreeType::keep(m_fileName[iiiFontId]); - if (m_font[iiiFontId] == NULL) { + if (m_font[iiiFontId] == nullptr) { EWOL_DEBUG("error in loading FONT [" << iiiFontId << "] name : \"" << m_fileName[iiiFontId] << "\" == > size=" << m_size ); } } for (int32_t iiiFontId=0; iiiFontId<4 ; iiiFontId++) { // set the bassic charset: m_listElement[iiiFontId].clear(); - if (m_font[iiiFontId] == NULL) { + if (m_font[iiiFontId] == nullptr) { continue; } m_height[iiiFontId] = m_font[iiiFontId]->getHeight(m_size); @@ -234,7 +234,7 @@ bool ewol::resource::TexturedFont::addGlyph(const char32_t& _val) { bool hasChange = false; // for each font : for (int32_t iii=0; iii<4 ; iii++) { - if (m_font[iii] == NULL) { + if (m_font[iii] == nullptr) { continue; } // add the curent "char" @@ -333,7 +333,7 @@ ewol::GlyphProperty* ewol::resource::TexturedFont::getGlyphPointer(const char32_ if (m_listElement[_displayMode].size() > 0) { return &((m_listElement[_displayMode])[0]); } - return NULL; + return nullptr; } //EWOL_ERROR(" index=" << index); //EWOL_ERROR(" m_UVal=" << m_listElement[_displayMode][index].m_UVal); @@ -345,31 +345,31 @@ ewol::GlyphProperty* ewol::resource::TexturedFont::getGlyphPointer(const char32_ ewol::resource::TexturedFont* ewol::resource::TexturedFont::keep(const std::string& _filename) { EWOL_VERBOSE("KEEP : TexturedFont : file : '" << _filename << "'"); - ewol::resource::TexturedFont* object = NULL; + ewol::resource::TexturedFont* object = nullptr; ewol::Resource* object2 = getManager().localKeep(_filename); - if (NULL != object2) { + if (nullptr != object2) { object = dynamic_cast(object2); - if (NULL == object) { + if (nullptr == object) { EWOL_CRITICAL("Request resource file : '" << _filename << "' With the wrong type (dynamic cast error)"); - return NULL; + return nullptr; } } - if (NULL != object) { + if (nullptr != object) { return object; } // need to crate a new one ... EWOL_INFO("CREATE: TexturedFont : file : '" << _filename << "'"); object = new ewol::resource::TexturedFont(_filename); - if (NULL == object) { + if (nullptr == object) { EWOL_ERROR("allocation error of a resource : " << _filename); - return NULL; + return nullptr; } getManager().localAdd(object); return object; } void ewol::resource::TexturedFont::release(ewol::resource::TexturedFont*& _object) { - if (NULL == _object) { + if (nullptr == _object) { return; } EWOL_VERBOSE("RELEASE: TexturedFont : file : '" << _object->getName() << "' count=" << _object->getCounter()); @@ -380,5 +380,5 @@ void ewol::resource::TexturedFont::release(ewol::resource::TexturedFont*& _objec EWOL_ERROR("REMOVE: TexturedFont : file : '" << name << "' count=" << count); //etk::displayBacktrace(false); } - _object = NULL; + _object = nullptr; } diff --git a/sources/ewol/resource/TexturedFont.h b/sources/ewol/resource/TexturedFont.h index a9c7d994..38172085 100644 --- a/sources/ewol/resource/TexturedFont.h +++ b/sources/ewol/resource/TexturedFont.h @@ -74,7 +74,7 @@ namespace ewol { * @brief get the pointer on the coresponding glyph * @param[in] _charcode The unicodeValue * @param[in] _displayMode Mode to display the currrent font - * @return The pointer on the glyph == > never NULL + * @return The pointer on the glyph == > never nullptr */ ewol::GlyphProperty* getGlyphPointer(const char32_t& _charcode, const enum ewol::font::mode _displayMode); /** @@ -91,7 +91,7 @@ namespace ewol { * @brief keep the resource pointer. * @note Never free this pointer by your own... * @param[in] _filename Name of the texture font. - * @return pointer on the resource or NULL if an error occured. + * @return pointer on the resource or nullptr if an error occured. */ static ewol::resource::TexturedFont* keep(const std::string& _filename); /** diff --git a/sources/ewol/resource/VirtualBufferObject.cpp b/sources/ewol/resource/VirtualBufferObject.cpp index e83550f4..d57102a1 100644 --- a/sources/ewol/resource/VirtualBufferObject.cpp +++ b/sources/ewol/resource/VirtualBufferObject.cpp @@ -126,19 +126,19 @@ int32_t ewol::resource::VirtualBufferObject::sizeOnBufferVec2(int32_t _id) { ewol::resource::VirtualBufferObject* ewol::resource::VirtualBufferObject::keep(int32_t _number) { // this element create a new one every time .... ewol::resource::VirtualBufferObject* object = new ewol::resource::VirtualBufferObject(_number); - if (NULL == object) { + if (nullptr == object) { EWOL_ERROR("allocation error of a resource : ??VBO??"); - return NULL; + return nullptr; } getManager().localAdd(object); return object; } void ewol::resource::VirtualBufferObject::release(ewol::resource::VirtualBufferObject*& _object) { - if (NULL == _object) { + if (nullptr == _object) { return; } ewol::Resource* object2 = static_cast(_object); getManager().release(object2); - _object = NULL; + _object = nullptr; } diff --git a/sources/ewol/resource/VirtualBufferObject.h b/sources/ewol/resource/VirtualBufferObject.h index 6da6e5cc..bb4fb827 100644 --- a/sources/ewol/resource/VirtualBufferObject.h +++ b/sources/ewol/resource/VirtualBufferObject.h @@ -97,7 +97,7 @@ namespace ewol { * @brief keep the resource pointer. * @note Never free this pointer by your own... * @param[in] _number Number of VBO needed - * @return pointer on the resource or NULL if an error occured. + * @return pointer on the resource or nullptr if an error occured. */ static ewol::resource::VirtualBufferObject* keep(int32_t _number); /** diff --git a/sources/ewol/translate.cpp b/sources/ewol/translate.cpp index 5ca2147e..38885e83 100644 --- a/sources/ewol/translate.cpp +++ b/sources/ewol/translate.cpp @@ -212,7 +212,7 @@ void ewol::translate::autoDetectLanguage() { EWOL_INFO("Auto-detect language of system"); #if defined(__TARGET_OS__Linux) char *s = getenv("LANG"); - if (s == NULL || strlen(s) < 2) { + if (s == nullptr || strlen(s) < 2) { EWOL_INFO("Try to determine system language FAIL ..."); } else { std::string lang; diff --git a/sources/ewol/widget/Button.cpp b/sources/ewol/widget/Button.cpp index 3679958c..a1f96774 100644 --- a/sources/ewol/widget/Button.cpp +++ b/sources/ewol/widget/Button.cpp @@ -60,10 +60,10 @@ ewol::widget::Button::Button(const std::string& _shaperName) : addEventId(eventLeave); addEventId(eventValue); // add configuration - registerConfig(configToggle, "bool", NULL, "The Button can toogle"); - registerConfig(configValue, "bool", NULL, "Basic value of the widget"); + registerConfig(configToggle, "bool", nullptr, "The Button can toogle"); + registerConfig(configValue, "bool", nullptr, "Basic value of the widget"); registerConfig(configLock, "list", "none;true;released;pressed", "Lock the button in a special state to permit changing state only by the coder"); - registerConfig(configShaper, "string", NULL, "the display name for config file"); + registerConfig(configShaper, "string", nullptr, "the display name for config file"); // shaper satatus update: CheckStatus(); diff --git a/sources/ewol/widget/ButtonColor.cpp b/sources/ewol/widget/ButtonColor.cpp index 261542e5..8570dbf4 100644 --- a/sources/ewol/widget/ButtonColor.cpp +++ b/sources/ewol/widget/ButtonColor.cpp @@ -41,7 +41,7 @@ void ewol::widget::ButtonColor::init(ewol::widget::Manager& _widgetManager) { ewol::widget::ButtonColor::ButtonColor(etk::Color<> _baseColor, std::string _shaperName) : m_shaper(_shaperName), m_textColorFg(_baseColor), - m_widgetContextMenu(NULL) { + m_widgetContextMenu(nullptr) { addObjectType("ewol::widget::ButtonColor"); addEventId(eventChange); changeStatusIn(STATUS_UP); @@ -177,7 +177,7 @@ bool ewol::widget::ButtonColor::onEventInput(const ewol::event::Input& _event) { m_mouseHover = false; // create a context menu : m_widgetContextMenu = new ewol::widget::ContextMenu(); - if (NULL == m_widgetContextMenu) { + if (nullptr == m_widgetContextMenu) { EWOL_ERROR("Allocation Error"); return true; } diff --git a/sources/ewol/widget/CheckBox.cpp b/sources/ewol/widget/CheckBox.cpp index 90a7565a..7ecab819 100644 --- a/sources/ewol/widget/CheckBox.cpp +++ b/sources/ewol/widget/CheckBox.cpp @@ -52,8 +52,8 @@ ewol::widget::CheckBox::CheckBox(const std::string& _shaperName) : addEventId(eventEnter); addEventId(eventValue); // add configuration - registerConfig(configValue, "bool", NULL, "Basic value of the widget"); - registerConfig(configShaper, "string", NULL, "the display name for config file"); + registerConfig(configValue, "bool", nullptr, "Basic value of the widget"); + registerConfig(configShaper, "string", nullptr, "the display name for config file"); m_shaperIdSize = m_shaper.requestConfig("box-size"); m_shaperIdSizeInsize = m_shaper.requestConfig("box-inside"); diff --git a/sources/ewol/widget/Composer.cpp b/sources/ewol/widget/Composer.cpp index 94e842c6..caffaf64 100644 --- a/sources/ewol/widget/Composer.cpp +++ b/sources/ewol/widget/Composer.cpp @@ -45,10 +45,10 @@ bool ewol::widget::Composer::loadFromFile(const std::string& _fileName) { return false; } exml::Element* root = (exml::Element*)doc.getNamed("composer"); - if (NULL == root ) { + if (nullptr == root ) { // Maybe a multiple node XML for internal config: root = doc.toElement(); - if (NULL == root ) { + if (nullptr == root ) { EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} (l ?) main node not find: \"composer\" ..."); return false; } @@ -70,10 +70,10 @@ bool ewol::widget::Composer::loadFromString(const std::string& _composerXmlStrin return false; } exml::Element* root = (exml::Element*)doc.getNamed("composer"); - if (NULL == root ) { + if (nullptr == root ) { // Maybe a multiple node XML for internal config: root = doc.toElement(); - if (NULL == root ) { + if (nullptr == root ) { EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} (l ?) main node not find: \"composer\" ..."); return false; } @@ -102,7 +102,7 @@ void ewol::widget::Composer::registerOnEventNameWidget(ewol::object::Shared tmpWidget = getWidgetNamed(_subWidgetName); - if (NULL != tmpWidget) { + if (nullptr != tmpWidget) { EWOL_DEBUG("Find widget named : \"" << _subWidgetName << "\" register event=\"" << _eventId << "\""); tmpWidget->registerOnEvent(_destinationObject, _eventId, _eventIdgenerated, _overloadData); } else { diff --git a/sources/ewol/widget/Composer.h b/sources/ewol/widget/Composer.h index 93462924..44736bd3 100644 --- a/sources/ewol/widget/Composer.h +++ b/sources/ewol/widget/Composer.h @@ -66,7 +66,7 @@ namespace ewol { */ void registerOnEventNameWidget(const std::string& _subWidgetName, const char * _eventId, - const char * _eventIdgenerated = NULL, + const char * _eventIdgenerated = nullptr, const std::string& _overloadData=""); public: /** @@ -81,7 +81,7 @@ namespace ewol { void registerOnEventNameWidget(ewol::object::Shared _destinationObject, const std::string& _subWidgetName, const char * _eventId, - const char * _eventIdgenerated = NULL, + const char * _eventIdgenerated = nullptr, const std::string& _overloadData=""); }; }; diff --git a/sources/ewol/widget/Container.cpp b/sources/ewol/widget/Container.cpp index 83fa7a19..22ec6f07 100644 --- a/sources/ewol/widget/Container.cpp +++ b/sources/ewol/widget/Container.cpp @@ -31,12 +31,12 @@ ewol::object::Shared ewol::widget::Container::getSubWidget() { } void ewol::widget::Container::setSubWidget(ewol::object::Shared _newWidget) { - if (NULL == _newWidget) { + if (nullptr == _newWidget) { return; } subWidgetRemove(); m_subWidget = _newWidget; - if (m_subWidget!=NULL) { + if (m_subWidget!=nullptr) { m_subWidget->setUpperWidget(this); } markToRedraw(); @@ -44,36 +44,36 @@ void ewol::widget::Container::setSubWidget(ewol::object::Shared _n } void ewol::widget::Container::subWidgetRemove() { - if (NULL != m_subWidget) { + if (nullptr != m_subWidget) { m_subWidget->removeUpperWidget(); m_subWidget->removeObject(); - m_subWidget=NULL; + m_subWidget=nullptr; markToRedraw(); requestUpdateSize(); } } void ewol::widget::Container::subWidgetUnLink() { - if (NULL != m_subWidget) { + if (nullptr != m_subWidget) { m_subWidget->removeUpperWidget(); } - m_subWidget=NULL; + m_subWidget=nullptr; } ewol::object::Shared ewol::widget::Container::getWidgetNamed(const std::string& _widgetName) { ewol::object::Shared tmpUpperWidget = ewol::Widget::getWidgetNamed(_widgetName); - if (NULL!=tmpUpperWidget) { + if (nullptr!=tmpUpperWidget) { return tmpUpperWidget; } - if (NULL != m_subWidget) { + if (nullptr != m_subWidget) { return m_subWidget->getWidgetNamed(_widgetName); } - return NULL; + return nullptr; } void ewol::widget::Container::onObjectRemove(ewol::object::Shared _removeObject) { if (m_subWidget == _removeObject) { - m_subWidget=NULL; + m_subWidget=nullptr; markToRedraw(); requestUpdateSize(); } @@ -85,7 +85,7 @@ void ewol::widget::Container::systemDraw(const ewol::DrawProperty& _displayProp) return; } ewol::Widget::systemDraw(_displayProp); - if (NULL!=m_subWidget) { + if (nullptr!=m_subWidget) { ewol::DrawProperty prop = _displayProp; prop.limit(m_origin, m_size); m_subWidget->systemDraw(prop); @@ -93,7 +93,7 @@ void ewol::widget::Container::systemDraw(const ewol::DrawProperty& _displayProp) } void ewol::widget::Container::calculateSize(const vec2& _availlable) { - if (NULL!=m_subWidget) { + if (nullptr!=m_subWidget) { vec2 origin = m_origin+m_offset; vec2 minSize = m_subWidget->getCalculateMinSize(); bvec2 expand = m_subWidget->getExpand(); @@ -123,7 +123,7 @@ void ewol::widget::Container::calculateMinMaxSize() { // call main class ewol::Widget::calculateMinMaxSize(); // call sub classes - if (NULL!=m_subWidget) { + if (nullptr!=m_subWidget) { m_subWidget->calculateMinMaxSize(); vec2 min = m_subWidget->getCalculateMinSize(); m_minSize.setMax(min); @@ -132,23 +132,23 @@ void ewol::widget::Container::calculateMinMaxSize() { } void ewol::widget::Container::onRegenerateDisplay() { - if (NULL!=m_subWidget) { + if (nullptr!=m_subWidget) { m_subWidget->onRegenerateDisplay(); } } ewol::object::Shared ewol::widget::Container::getWidgetAtPos(const vec2& _pos) { if (false == isHide()) { - if (NULL!=m_subWidget) { + if (nullptr!=m_subWidget) { return m_subWidget->getWidgetAtPos(_pos); } } - return NULL; + return nullptr; }; bool ewol::widget::Container::loadXML(exml::Element* _node) { - if (NULL == _node) { + if (nullptr == _node) { return false; } // parse generic properties : @@ -159,7 +159,7 @@ bool ewol::widget::Container::loadXML(exml::Element* _node) { // parse all the elements : for(size_t iii=0; iii< _node->size(); iii++) { exml::Element* pNode = _node->getElement(iii); - if (pNode == NULL) { + if (pNode == nullptr) { // trash here all that is not element continue; } @@ -168,13 +168,13 @@ bool ewol::widget::Container::loadXML(exml::Element* _node) { EWOL_ERROR("(l "<getPos()<<") Unknown basic node=\"" << widgetName << "\" not in : [" << getWidgetManager().list() << "]" ); continue; } - if (NULL != getSubWidget()) { + if (nullptr != getSubWidget()) { EWOL_ERROR("(l "<getPos()<<") " << __class__ << " Can only have one subWidget ??? node=\"" << widgetName << "\"" ); continue; } EWOL_DEBUG("try to create subwidget : '" << widgetName << "'"); ewol::object::Shared tmpWidget = getWidgetManager().create(widgetName); - if (tmpWidget == NULL) { + if (tmpWidget == nullptr) { EWOL_ERROR ("(l "<getPos()<<") Can not create the widget : \"" << widgetName << "\""); continue; } diff --git a/sources/ewol/widget/Container.h b/sources/ewol/widget/Container.h index efd4880c..0f45b9a8 100644 --- a/sources/ewol/widget/Container.h +++ b/sources/ewol/widget/Container.h @@ -26,7 +26,7 @@ namespace ewol { /** * @brief Constructor */ - Container(ewol::object::Shared _subElement=NULL); + Container(ewol::object::Shared _subElement=nullptr); /** * @brief Destructor */ diff --git a/sources/ewol/widget/Container2.cpp b/sources/ewol/widget/Container2.cpp index 99922f58..1aeb8981 100644 --- a/sources/ewol/widget/Container2.cpp +++ b/sources/ewol/widget/Container2.cpp @@ -32,7 +32,7 @@ ewol::widget::Container2::~Container2() { void ewol::widget::Container2::setSubWidget(ewol::object::Shared _newWidget, int32_t _idWidget) { subWidgetRemove(_idWidget); m_subWidget[_idWidget] = _newWidget; - if (m_subWidget[_idWidget] != NULL) { + if (m_subWidget[_idWidget] != nullptr) { EWOL_VERBOSE("Add widget : " << _idWidget); m_subWidget[_idWidget]->setUpperWidget(this); } @@ -42,46 +42,46 @@ void ewol::widget::Container2::setSubWidget(ewol::object::Shared _ void ewol::widget::Container2::subWidgetRemove(int32_t _idWidget) { - if (m_subWidget[_idWidget] != NULL) { + if (m_subWidget[_idWidget] != nullptr) { EWOL_VERBOSE("Remove widget : " << _idWidget); m_subWidget[_idWidget]->removeUpperWidget(); m_subWidget[_idWidget]->removeObject(); - m_subWidget[_idWidget] = NULL; + m_subWidget[_idWidget] = nullptr; markToRedraw(); requestUpdateSize(); } } void ewol::widget::Container2::subWidgetUnLink(int32_t _idWidget) { - if (m_subWidget[_idWidget] != NULL) { + if (m_subWidget[_idWidget] != nullptr) { m_subWidget[_idWidget]->removeUpperWidget(); EWOL_VERBOSE("Unlink widget : " << _idWidget); } - m_subWidget[_idWidget] = NULL; + m_subWidget[_idWidget] = nullptr; } ewol::object::Shared ewol::widget::Container2::getWidgetNamed(const std::string& _widgetName) { ewol::object::Shared tmpUpperWidget = ewol::Widget::getWidgetNamed(_widgetName); - if (tmpUpperWidget != NULL) { + if (tmpUpperWidget != nullptr) { return tmpUpperWidget; } - if (m_subWidget[0] != NULL) { + if (m_subWidget[0] != nullptr) { return m_subWidget[0]->getWidgetNamed(_widgetName); } - if (m_subWidget[1] != NULL) { + if (m_subWidget[1] != nullptr) { return m_subWidget[1]->getWidgetNamed(_widgetName); } - return NULL; + return nullptr; } void ewol::widget::Container2::onObjectRemove(ewol::object::Shared _removeObject) { if (m_subWidget[0] == _removeObject) { - m_subWidget[0] = NULL; + m_subWidget[0] = nullptr; markToRedraw(); requestUpdateSize(); } if (m_subWidget[1] == _removeObject) { - m_subWidget[1] = NULL; + m_subWidget[1] = nullptr; markToRedraw(); requestUpdateSize(); } @@ -93,7 +93,7 @@ void ewol::widget::Container2::systemDraw(const ewol::DrawProperty& _displayProp return; } ewol::Widget::systemDraw(_displayProp); - if (m_subWidget[m_idWidgetDisplayed] != NULL) { + if (m_subWidget[m_idWidgetDisplayed] != nullptr) { m_subWidget[m_idWidgetDisplayed]->systemDraw(_displayProp); } } @@ -119,7 +119,7 @@ ewol::Padding ewol::widget::Container2::calculateSizePadded(const vec2& _availla vec2 origin = (m_size - subElementSize)*0.5f + vec2(_padding.xLeft(), _padding.yButtom()); subElementSize -= vec2(_padding.x(), _padding.y()); for (size_t iii = 0; iii < 2; ++iii) { - if (m_subWidget[iii] != NULL) { + if (m_subWidget[iii] != nullptr) { vec2 origin2 = origin+m_offset; vec2 minSize = m_subWidget[iii]->getCalculateMinSize(); bvec2 expand = m_subWidget[iii]->getExpand(); @@ -154,7 +154,7 @@ void ewol::widget::Container2::calculateMinMaxSizePadded(const ewol::Padding& _p m_minSize = vec2(0,0); // call sub classes for (size_t iii = 0; iii < 2; ++iii) { - if (m_subWidget[iii] != NULL) { + if (m_subWidget[iii] != nullptr) { m_subWidget[iii]->calculateMinMaxSize(); vec2 min = m_subWidget[iii]->getCalculateMinSize(); m_minSize.setMax(min); @@ -168,23 +168,23 @@ void ewol::widget::Container2::calculateMinMaxSizePadded(const ewol::Padding& _p } void ewol::widget::Container2::onRegenerateDisplay() { - if (m_subWidget[m_idWidgetDisplayed] != NULL) { + if (m_subWidget[m_idWidgetDisplayed] != nullptr) { m_subWidget[m_idWidgetDisplayed]->onRegenerateDisplay(); } } /* ewol::object::Shared ewol::widget::Container2::getWidgetAtPos(const vec2& _pos) { if (isHide() == false) { - if (m_subWidget[m_idWidgetDisplayed] != NULL) { + if (m_subWidget[m_idWidgetDisplayed] != nullptr) { return m_subWidget[m_idWidgetDisplayed]->getWidgetAtPos(_pos); } } - return NULL; + return nullptr; } */ bool ewol::widget::Container2::loadXML(exml::Element* _node) { - if (NULL == _node) { + if (nullptr == _node) { return false; } // parse generic properties : @@ -195,7 +195,7 @@ bool ewol::widget::Container2::loadXML(exml::Element* _node) { // parse all the elements : for(size_t iii=0; iii< _node->size(); iii++) { exml::Element* pNode = _node->getElement(iii); - if (pNode == NULL) { + if (pNode == nullptr) { // trash here all that is not element continue; } @@ -205,16 +205,16 @@ bool ewol::widget::Container2::loadXML(exml::Element* _node) { continue; } bool toogleMode=false; - if (NULL != getSubWidget()) { + if (nullptr != getSubWidget()) { toogleMode=true; - if (NULL != getSubWidgetToggle()) { + if (nullptr != getSubWidgetToggle()) { EWOL_ERROR("(l "<getPos()<<") " << __class__ << " Can only have one subWidget ??? node=\"" << widgetName << "\"" ); continue; } } EWOL_DEBUG("try to create subwidget : '" << widgetName << "'"); ewol::object::Shared tmpWidget = getWidgetManager().create(widgetName); - if (tmpWidget == NULL) { + if (tmpWidget == nullptr) { EWOL_ERROR ("(l "<getPos()<<") Can not create the widget : \"" << widgetName << "\""); continue; } diff --git a/sources/ewol/widget/Container2.h b/sources/ewol/widget/Container2.h index 6206f47f..217357e8 100644 --- a/sources/ewol/widget/Container2.h +++ b/sources/ewol/widget/Container2.h @@ -144,7 +144,7 @@ namespace ewol { * @return the id of the widget displayable */ int32_t convertId(int32_t _id) { - if (m_subWidget[_id] == NULL) { + if (m_subWidget[_id] == nullptr) { return (_id+1)%2; } return _id; diff --git a/sources/ewol/widget/ContainerN.cpp b/sources/ewol/widget/ContainerN.cpp index 74ecab6b..62edeede 100644 --- a/sources/ewol/widget/ContainerN.cpp +++ b/sources/ewol/widget/ContainerN.cpp @@ -53,11 +53,11 @@ void ewol::widget::ContainerN::lockExpand(const bvec2& _lockExpand) { int32_t ewol::widget::ContainerN::subWidgetAdd(ewol::object::Shared _newWidget) { - if (NULL == _newWidget) { + if (nullptr == _newWidget) { EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} Try to add An empty Widget ... "); return -1; } - if (_newWidget!=NULL) { + if (_newWidget!=nullptr) { _newWidget->setUpperWidget(this); } m_subWidget.push_back(_newWidget); @@ -68,11 +68,11 @@ int32_t ewol::widget::ContainerN::subWidgetAdd(ewol::object::Shared _newWidget) { - if (NULL == _newWidget) { + if (nullptr == _newWidget) { EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} Try to add start An empty Widget ... "); return -1; } - if (_newWidget!=NULL) { + if (_newWidget!=nullptr) { _newWidget->setUpperWidget(this); } m_subWidget.insert(m_subWidget.begin(), _newWidget); @@ -82,7 +82,7 @@ int32_t ewol::widget::ContainerN::subWidgetAddStart(ewol::object::Shared _newWidget) { - if (NULL == _newWidget) { + if (nullptr == _newWidget) { return; } size_t errorControl = m_subWidget.size(); @@ -93,7 +93,7 @@ void ewol::widget::ContainerN::subWidgetRemove(ewol::object::Shared it does not exist anymore ... if (errorControl == m_subWidget.size()) { EWOL_CRITICAL("[" << getId() << "] {" << getObjectType() << "} The number of element might have been reduced ... == > it is not the case ==> the herited class must call the \"OnObjectRemove\" function..."); - m_subWidget[iii] = NULL; + m_subWidget[iii] = nullptr; m_subWidget.erase(m_subWidget.begin()+iii); } markToRedraw(); @@ -104,13 +104,13 @@ void ewol::widget::ContainerN::subWidgetRemove(ewol::object::Shared _newWidget) { - if (NULL == _newWidget) { + if (nullptr == _newWidget) { return; } for (size_t iii=0; iiiremoveUpperWidget(); - m_subWidget[iii] = NULL; + m_subWidget[iii] = nullptr; m_subWidget.erase(m_subWidget.begin()+iii); markToRedraw(); requestUpdateSize(); @@ -123,13 +123,13 @@ void ewol::widget::ContainerN::subWidgetRemoveAll() { size_t errorControl = m_subWidget.size(); // the size automaticly decrement with the auto call of the onObjectRemove function while (m_subWidget.size() > 0 ) { - if (NULL != m_subWidget[0]) { + if (nullptr != m_subWidget[0]) { m_subWidget[0]->removeUpperWidget(); m_subWidget[0]->removeObject(); // no remove, this element is removed with the function onObjectRemove == > it does not exist anymore ... if (errorControl == m_subWidget.size()) { EWOL_CRITICAL("[" << getId() << "] {" << getObjectType() << "} The number of element might have been reduced ... == > it is not the case ==> the herited class must call the \"OnObjectRemove\" function..."); - m_subWidget[0] = NULL; + m_subWidget[0] = nullptr; } } else { EWOL_WARNING("[" << getId() << "] {" << getObjectType() << "} Must not have null pointer on the subWidget list ..."); @@ -143,10 +143,10 @@ void ewol::widget::ContainerN::subWidgetRemoveAll() { void ewol::widget::ContainerN::subWidgetRemoveAllDelayed() { // the size automaticly decrement with the auto call of the onObjectRemove function for (size_t iii=0; iiiremoveUpperWidget(); m_subWidget[iii]->removeObject(); - m_subWidget[iii] = NULL; + m_subWidget[iii] = nullptr; } else { EWOL_WARNING("[" << getId() << "] {" << getObjectType() << "} Must not have null pointer on the subWidget list ..."); } @@ -156,18 +156,18 @@ void ewol::widget::ContainerN::subWidgetRemoveAllDelayed() { ewol::object::Shared ewol::widget::ContainerN::getWidgetNamed(const std::string& _widgetName) { ewol::object::Shared tmpUpperWidget = ewol::Widget::getWidgetNamed(_widgetName); - if (NULL!=tmpUpperWidget) { + if (nullptr!=tmpUpperWidget) { return tmpUpperWidget; } for (size_t iii=0; iii tmpWidget = m_subWidget[iii]->getWidgetNamed(_widgetName); - if (NULL != tmpWidget) { + if (nullptr != tmpWidget) { return tmpWidget; } } } - return NULL; + return nullptr; } void ewol::widget::ContainerN::onObjectRemove(ewol::object::Shared _removeObject) { @@ -177,7 +177,7 @@ void ewol::widget::ContainerN::onObjectRemove(ewol::object::Shared for (int64_t iii=m_subWidget.size()-1; iii >= 0; iii--) { if(m_subWidget[iii] == _removeObject) { EWOL_VERBOSE("[" << getId() << "] {" << getObjectType() << "} remove sizer sub Element [" << iii << "/" << m_subWidget.size()-1 << "] == > destroyed object"); - m_subWidget[iii] = NULL; + m_subWidget[iii] = nullptr; m_subWidget.erase(m_subWidget.begin()+iii); } } @@ -194,7 +194,7 @@ void ewol::widget::ContainerN::systemDraw(const ewol::DrawProperty& _displayProp ewol::DrawProperty prop = _displayProp; prop.limit(m_origin, m_size); for (int64_t iii=m_subWidget.size()-1; iii >= 0; iii--) { - if (NULL != m_subWidget[iii]) { + if (nullptr != m_subWidget[iii]) { m_subWidget[iii]->systemDraw(prop); } } @@ -203,7 +203,7 @@ void ewol::widget::ContainerN::systemDraw(const ewol::DrawProperty& _displayProp void ewol::widget::ContainerN::calculateSize(const vec2& _availlable) { m_size = _availlable; for (size_t iii=0; iiisetOrigin(m_origin+m_offset); m_subWidget[iii]->calculateSize(m_size); } @@ -217,7 +217,7 @@ void ewol::widget::ContainerN::calculateMinMaxSize() { m_maxSize.setValue(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE); //EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} set min size : " << m_minSize); for (size_t iii=0; iiicalculateMinMaxSize(); bvec2 subExpendProp = m_subWidget[iii]->canExpand(); if (true == subExpendProp.x()) { @@ -236,7 +236,7 @@ void ewol::widget::ContainerN::calculateMinMaxSize() { void ewol::widget::ContainerN::onRegenerateDisplay() { for (size_t iii=0; iiionRegenerateDisplay(); } } @@ -244,18 +244,18 @@ void ewol::widget::ContainerN::onRegenerateDisplay() { ewol::object::Shared ewol::widget::ContainerN::getWidgetAtPos(const vec2& _pos) { if (true == isHide()) { - return NULL; + return nullptr; } // for all element in the sizer ... for (size_t iii=0; iiigetSize(); vec2 tmpOrigin = m_subWidget[iii]->getOrigin(); if( (tmpOrigin.x() <= _pos.x() && tmpOrigin.x() + tmpSize.x() >= _pos.x()) && (tmpOrigin.y() <= _pos.y() && tmpOrigin.y() + tmpSize.y() >= _pos.y()) ) { ewol::object::Shared tmpWidget = m_subWidget[iii]->getWidgetAtPos(_pos); - if (NULL != tmpWidget) { + if (nullptr != tmpWidget) { return tmpWidget; } // stop searching @@ -263,12 +263,12 @@ ewol::object::Shared ewol::widget::ContainerN::getWidgetAtPos(cons } } } - return NULL; + return nullptr; }; bool ewol::widget::ContainerN::loadXML(exml::Element* _node) { - if (NULL == _node) { + if (nullptr == _node) { return false; } // parse generic properties : @@ -288,7 +288,7 @@ bool ewol::widget::ContainerN::loadXML(exml::Element* _node) { // parse all the elements : for (size_t iii=0; iii < _node->size(); iii++) { exml::Element* pNode = _node->getElement(iii); - if (pNode == NULL) { + if (pNode == nullptr) { // trash here all that is not element continue; } @@ -299,7 +299,7 @@ bool ewol::widget::ContainerN::loadXML(exml::Element* _node) { } EWOL_DEBUG("[" << getId() << "] {" << getObjectType() << "} load new element : \"" << widgetName << "\""); ewol::object::Shared subWidget = getWidgetManager().create(widgetName); - if (subWidget == NULL) { + if (subWidget == nullptr) { EWOL_ERROR ("[" << getId() << "] {" << getObjectType() << "} (l "<getPos()<<") Can not create the widget : \"" << widgetName << "\""); continue; } diff --git a/sources/ewol/widget/ContextMenu.cpp b/sources/ewol/widget/ContextMenu.cpp index a4e0ab3b..f5298d24 100644 --- a/sources/ewol/widget/ContextMenu.cpp +++ b/sources/ewol/widget/ContextMenu.cpp @@ -35,9 +35,9 @@ ewol::widget::ContextMenu::ContextMenu(const std::string& _shaperName) : m_shaper(_shaperName) { addObjectType("ewol::widget::ContextMenu"); // add basic configurations : - registerConfig(configArrowPosition, "vec2", NULL, "position of the arrow"); + registerConfig(configArrowPosition, "vec2", nullptr, "position of the arrow"); registerConfig(configArrowMode, "list", "none;left;buttom;right;top", "Position of the arrow in the pop-up"); - registerConfig(configShaper, "string", NULL, "the display name for config file"); + registerConfig(configShaper, "string", nullptr, "the display name for config file"); m_userExpand.setValue(false,false); @@ -69,7 +69,7 @@ void ewol::widget::ContextMenu::calculateSize(const vec2& _availlable) { m_size = _availlable; ewol::Padding padding = m_shaper.getPadding(); EWOL_VERBOSE("our origin=" << m_origin << " size=" << m_size); - if (NULL != m_subWidget) { + if (nullptr != m_subWidget) { vec2 subWidgetSize; vec2 subWidgetOrigin; subWidgetSize = m_subWidget->getCalculateMinSize(); @@ -158,7 +158,7 @@ void ewol::widget::ContextMenu::onRegenerateDisplay() { m_shaper.clear(); ewol::Padding padding = m_shaper.getPadding(); - if (m_subWidget == NULL) { + if (m_subWidget == nullptr) { return; } vec2 tmpSize = m_subWidget->getSize(); @@ -216,7 +216,7 @@ void ewol::widget::ContextMenu::onRegenerateDisplay() { bool ewol::widget::ContextMenu::onEventInput(const ewol::event::Input& _event) { if (_event.getId() > 0) { - if (NULL != ewol::widget::Container::getWidgetAtPos(_event.getPos())) { + if (nullptr != ewol::widget::Container::getWidgetAtPos(_event.getPos())) { return false; } if( _event.getStatus() == ewol::key::statusDown @@ -243,7 +243,7 @@ void ewol::widget::ContextMenu::setPositionMark(enum markPosition _position, vec ewol::object::Shared ewol::widget::ContextMenu::getWidgetAtPos(const vec2& _pos) { ewol::object::Shared val = ewol::widget::Container::getWidgetAtPos(_pos); - if (NULL != val) { + if (nullptr != val) { return val; } return this; diff --git a/sources/ewol/widget/Entry.cpp b/sources/ewol/widget/Entry.cpp index 958fb6b0..f2373a27 100644 --- a/sources/ewol/widget/Entry.cpp +++ b/sources/ewol/widget/Entry.cpp @@ -73,10 +73,10 @@ ewol::widget::Entry::Entry(std::string _newData) : shortCutAdd("ctrl+a", ewolEventEntrySelect, "ALL"); shortCutAdd("ctrl+shift+a", ewolEventEntrySelect, "NONE"); - registerConfig(configMaxChar, "int", NULL, "Maximum cgar that can be set on the Entry"); - registerConfig(configRegExp, "string", NULL, "Control what it is write with a regular expression"); - registerConfig(configEmptyMessage, "string", NULL, "Text that is displayed when the Entry is empty (decorated text)"); - registerConfig(configValue, "string", NULL, "Value display in the entry (decorated text)"); + registerConfig(configMaxChar, "int", nullptr, "Maximum cgar that can be set on the Entry"); + registerConfig(configRegExp, "string", nullptr, "Control what it is write with a regular expression"); + registerConfig(configEmptyMessage, "string", nullptr, "Text that is displayed when the Entry is empty (decorated text)"); + registerConfig(configValue, "string", nullptr, "Value display in the entry (decorated text)"); setValue(_newData); markToRedraw(); diff --git a/sources/ewol/widget/Gird.cpp b/sources/ewol/widget/Gird.cpp index 0e019134..55f7079d 100644 --- a/sources/ewol/widget/Gird.cpp +++ b/sources/ewol/widget/Gird.cpp @@ -26,7 +26,7 @@ void ewol::widget::Gird::init(ewol::widget::Manager& _widgetManager) { ewol::widget::Gird::Gird(int32_t _colNumber) : m_sizeRow(0), - m_tmpWidget(NULL), + m_tmpWidget(nullptr), m_gavityButtom(true), m_borderSize(0,0) { addObjectType("ewol::widget::Gird"); @@ -59,7 +59,7 @@ void ewol::widget::Gird::calculateSize(const vec2& _availlable) { m_size -= m_borderSize*2; for (size_t iii=0; iiicalculateMinMaxSize(); vec2 tmpSize = m_subWidget[iii].widget->getCalculateMinSize(); EWOL_DEBUG(" [" << iii << "] subWidgetMinSize=" << tmpSize); @@ -144,7 +144,7 @@ void ewol::widget::Gird::setColNumber(int32_t _colNumber) { for (int64_t iii=m_subWidget.size(); iii >= 0; iii--) { if (m_subWidget[iii].col>(_colNumber-1)) { // out of bounds : must remove it ... - if (m_subWidget[iii].widget != NULL) { + if (m_subWidget[iii].widget != nullptr) { m_subWidget[iii].widget.reset(); // no remove, this element is removed with the function onObjectRemove == > it does not exist anymore ... if (errorControl == m_subWidget.size()) { @@ -200,7 +200,7 @@ void ewol::widget::Gird::subWidgetRemoveAll() { size_t errorControl = m_subWidget.size(); // the size automaticly decrement with the auto call of the onObjectRemove function while (m_subWidget.size() > 0 ) { - if (NULL != m_subWidget[0].widget) { + if (nullptr != m_subWidget[0].widget) { m_subWidget[0].widget.reset(); // no remove, this element is removed with the function onObjectRemove == > it does not exist anymore ... if (errorControl == m_subWidget.size()) { @@ -217,7 +217,7 @@ void ewol::widget::Gird::subWidgetRemoveAll() { void ewol::widget::Gird::subWidgetAdd(int32_t _colId, int32_t _rowId, ewol::object::Shared _newWidget) { - if (NULL == _newWidget) { + if (nullptr == _newWidget) { return; } GirdProperties prop; @@ -244,11 +244,11 @@ void ewol::widget::Gird::subWidgetAdd(int32_t _colId, int32_t _rowId, ewol::obje // The element already exist == > replace it ... m_tmpWidget = m_subWidget[iii].widget; m_subWidget[iii].widget = _newWidget; - if (NULL != m_tmpWidget) { + if (nullptr != m_tmpWidget) { m_tmpWidget.reset(); - if (m_tmpWidget != NULL) { + if (m_tmpWidget != nullptr) { EWOL_CRITICAL("[" << getId() << "] Error while replacing a widget ... == > never call when free"); - m_tmpWidget = NULL; + m_tmpWidget = nullptr; } } } @@ -286,7 +286,7 @@ void ewol::widget::Gird::subWidgetRemove(int32_t _colId, int32_t _rowId) { } void ewol::widget::Gird::subWidgetUnLink(ewol::object::Shared _newWidget) { - if (NULL == _newWidget) { + if (nullptr == _newWidget) { return; } for (size_t iii=0; iiisystemDraw(_displayProp); } } @@ -324,7 +324,7 @@ void ewol::widget::Gird::systemDraw(const ewol::DrawProperty& _displayProp) { void ewol::widget::Gird::onRegenerateDisplay() { for (size_t iii=0; iiionRegenerateDisplay(); } } @@ -332,18 +332,18 @@ void ewol::widget::Gird::onRegenerateDisplay() { ewol::object::Shared ewol::widget::Gird::getWidgetAtPos(const vec2& _pos) { if (true == isHide()) { - return NULL; + return nullptr; } // for all element in the sizer ... for (size_t iii=0; iiigetSize(); vec2 tmpOrigin = m_subWidget[iii].widget->getOrigin(); if( (tmpOrigin.x() <= _pos.x() && tmpOrigin.x() + tmpSize.x() >= _pos.x()) && (tmpOrigin.y() <= _pos.y() && tmpOrigin.y() + tmpSize.y() >= _pos.y()) ) { ewol::object::Shared tmpWidget = m_subWidget[iii].widget->getWidgetAtPos(_pos); - if (NULL != tmpWidget) { + if (nullptr != tmpWidget) { return tmpWidget; } // stop searching @@ -351,7 +351,7 @@ ewol::object::Shared ewol::widget::Gird::getWidgetAtPos(const vec2 } } } - return NULL; + return nullptr; } void ewol::widget::Gird::onObjectRemove(ewol::object::Shared _removeObject) { @@ -361,11 +361,11 @@ void ewol::widget::Gird::onObjectRemove(ewol::object::Shared _remo for(int32_t iii=m_subWidget.size()-1; iii >= 0; iii--) { if(m_subWidget[iii].widget == _removeObject) { EWOL_VERBOSE("[" << getId() << "]={" << getObjectType() << "} remove sizer sub Element [" << iii << "/" << m_subWidget.size()-1 << "] == > destroyed object"); - m_subWidget[iii].widget = NULL; + m_subWidget[iii].widget = nullptr; m_subWidget.erase(m_subWidget.begin()+iii); } } if (m_tmpWidget == _removeObject) { - m_tmpWidget = NULL; + m_tmpWidget = nullptr; } } diff --git a/sources/ewol/widget/Image.cpp b/sources/ewol/widget/Image.cpp index 09b06240..a3a64ce9 100644 --- a/sources/ewol/widget/Image.cpp +++ b/sources/ewol/widget/Image.cpp @@ -36,7 +36,7 @@ const char * const ewol::widget::Image::configPartStart = "part-start"; const char * const ewol::widget::Image::configPartStop = "part-stop"; ewol::widget::Image::Image(const std::string& _file, const ewol::Dimension& _border) : - m_colorProperty(NULL), + m_colorProperty(nullptr), m_colorId(-1), m_imageSize(vec2(0.0f,0.0f)), m_keepRatio(true), @@ -44,15 +44,15 @@ ewol::widget::Image::Image(const std::string& _file, const ewol::Dimension& _bor m_posStop(1.0f,1.0f) { addObjectType("ewol::widget::Image"); addEventId(eventPressed); - registerConfig(configRatio, "bool", NULL, "Keep ratio of the image"); - registerConfig(configSize, "Dimension", NULL, "Basic display size of the image"); - registerConfig(configBorder, "Dimension", NULL, "Border of the image"); + registerConfig(configRatio, "bool", nullptr, "Keep ratio of the image"); + registerConfig(configSize, "Dimension", nullptr, "Basic display size of the image"); + registerConfig(configBorder, "Dimension", nullptr, "Border of the image"); registerConfig(configSource, "string", "Image source path"); registerConfig(configDistanceField, "bool", "Distance field mode"); - registerConfig(configPartStart, "vec2", NULL, "Start display position in the image [0.0 .. 1.0]"); - registerConfig(configPartStop, "vec2", NULL, "Stop display position in the image [0.0 .. 1.0]"); + registerConfig(configPartStart, "vec2", nullptr, "Start display position in the image [0.0 .. 1.0]"); + registerConfig(configPartStop, "vec2", nullptr, "Stop display position in the image [0.0 .. 1.0]"); m_colorProperty = ewol::resource::ColorFile::keep("THEME:COLOR:Image.json"); - if (m_colorProperty != NULL) { + if (m_colorProperty != nullptr) { m_colorId = m_colorProperty->request("foreground"); } set(_file, _border); @@ -147,7 +147,7 @@ void ewol::widget::Image::onRegenerateDisplay() { if (true == needRedraw()) { // remove data of the previous composition : m_compositing.clear(); - if (m_colorProperty != NULL) { + if (m_colorProperty != nullptr) { m_compositing.setColor(m_colorProperty->get(m_colorId)); } // calculate the new position and size : @@ -230,7 +230,7 @@ bool ewol::widget::Image::onEventInput(const ewol::event::Input& _event) { } bool ewol::widget::Image::loadXML(exml::Element* _node) { - if (NULL == _node) { + if (nullptr == _node) { return false; } ewol::Widget::loadXML(_node); diff --git a/sources/ewol/widget/Joystick.cpp b/sources/ewol/widget/Joystick.cpp index 3a0490b3..44b5057b 100644 --- a/sources/ewol/widget/Joystick.cpp +++ b/sources/ewol/widget/Joystick.cpp @@ -67,9 +67,9 @@ void ewol::widget::Joystick::onRegenerateDisplay() { // clean the object list ... /* - ewol::OObject2DColored * tmpOObjects = NULL; - ewol::OObject2DTextured * tmpOOtexBg = NULL; - ewol::OObject2DTextured * tmpOOtexFg = NULL; + ewol::OObject2DColored * tmpOObjects = nullptr; + ewol::OObject2DTextured * tmpOOtexBg = nullptr; + ewol::OObject2DTextured * tmpOOtexFg = nullptr; // set background if (true == m_displayBackground) { if (m_background == "") { @@ -84,7 +84,7 @@ void ewol::widget::Joystick::onRegenerateDisplay() { // set cursor point float sizeElement = m_size.x*m_ratio; if (m_foreground == "") { - if (NULL == tmpOObjects) { + if (nullptr == tmpOObjects) { tmpOObjects = new ewol::OObject2DColored; } tmpOObjects->setColor(m_colorFg); @@ -96,13 +96,13 @@ void ewol::widget::Joystick::onRegenerateDisplay() { ((m_displayPos.y+1.0)/2.0)*(m_size.y-2*sizeElement), sizeElement*2, sizeElement*2); } // add all needed objects ... - if (NULL != tmpOObjects) { + if (nullptr != tmpOObjects) { addOObject(tmpOObjects); } - if (NULL != tmpOOtexBg) { + if (nullptr != tmpOOtexBg) { addOObject(tmpOOtexBg); } - if (NULL != tmpOOtexFg) { + if (nullptr != tmpOOtexFg) { addOObject(tmpOOtexFg); } */ diff --git a/sources/ewol/widget/Label.cpp b/sources/ewol/widget/Label.cpp index fbff21cd..aa5ad487 100644 --- a/sources/ewol/widget/Label.cpp +++ b/sources/ewol/widget/Label.cpp @@ -27,12 +27,12 @@ void ewol::widget::Label::init(ewol::widget::Manager& _widgetManager) { } // TODO : Remove the label name in the constructor ... ewol::widget::Label::Label(std::string _newLabel) : - m_colorProperty(NULL), + m_colorProperty(nullptr), m_colorDefaultFgText(-1), m_colorDefaultBgText(-1){ addObjectType("ewol::widget::Label"); m_colorProperty = ewol::resource::ColorFile::keep("THEME:COLOR:Label.json"); - if (m_colorProperty != NULL) { + if (m_colorProperty != nullptr) { m_colorDefaultFgText = m_colorProperty->request("foreground"); m_colorDefaultBgText = m_colorProperty->request("background"); } @@ -40,7 +40,7 @@ ewol::widget::Label::Label(std::string _newLabel) : addEventId(eventPressed); setCanHaveFocus(false); setMouseLimit(1); - registerConfig(configValue, "string", NULL, "displayed value string"); // TODO : do not store in attibute... + registerConfig(configValue, "string", nullptr, "displayed value string"); // TODO : do not store in attibute... } ewol::widget::Label::~Label() { @@ -124,7 +124,7 @@ void ewol::widget::Label::onRegenerateDisplay() { // clean the element m_text.reset(); - if (m_colorProperty != NULL) { + if (m_colorProperty != nullptr) { m_text.setDefaultColorFg(m_colorProperty->get(m_colorDefaultFgText)); m_text.setDefaultColorBg(m_colorProperty->get(m_colorDefaultBgText)); } @@ -148,7 +148,7 @@ bool ewol::widget::Label::onEventInput(const ewol::event::Input& _event) { } bool ewol::widget::Label::loadXML(exml::Element* _node) { - if (NULL == _node) { + if (nullptr == _node) { return false; } ewol::Widget::loadXML(_node); diff --git a/sources/ewol/widget/Layer.cpp b/sources/ewol/widget/Layer.cpp index 8b2ddaba..3e610a43 100644 --- a/sources/ewol/widget/Layer.cpp +++ b/sources/ewol/widget/Layer.cpp @@ -31,24 +31,24 @@ ewol::widget::Layer::~Layer() { ewol::object::Shared ewol::widget::Layer::getWidgetAtPos(const vec2& _pos) { if (true == isHide()) { - return NULL; + return nullptr; } // for all element in the sizer ... for (size_t iii=0; iiigetSize(); vec2 tmpOrigin = m_subWidget[iii]->getOrigin(); if( (tmpOrigin.x() <= _pos.x() && tmpOrigin.x() + tmpSize.x() >= _pos.x()) && (tmpOrigin.y() <= _pos.y() && tmpOrigin.y() + tmpSize.y() >= _pos.y()) ) { ewol::object::Shared tmpWidget = m_subWidget[iii]->getWidgetAtPos(_pos); - if (NULL != tmpWidget) { + if (nullptr != tmpWidget) { return tmpWidget; } // parse the next layer ... } } } - return NULL; + return nullptr; }; diff --git a/sources/ewol/widget/List.cpp b/sources/ewol/widget/List.cpp index 6b791e21..a7089290 100644 --- a/sources/ewol/widget/List.cpp +++ b/sources/ewol/widget/List.cpp @@ -32,7 +32,7 @@ ewol::widget::List::~List() { //clean all the object for (size_t iii=0; iiidraw(); } } @@ -174,7 +174,7 @@ void ewol::widget::List::onRegenerateDisplay() { getElement(jjj, iii, myTextToWrite, fg, bg); ewol::compositing::Text * tmpText = new ewol::compositing::Text(); - if (NULL != tmpText) { + if (nullptr != tmpText) { // get font size : int32_t tmpFontHeight = tmpText->calculateSize(char32_t('A')).y(); displayPositionY-=(tmpFontHeight+m_paddingSizeY); diff --git a/sources/ewol/widget/ListFileSystem.cpp b/sources/ewol/widget/ListFileSystem.cpp index 09567ecd..cc5a8db8 100644 --- a/sources/ewol/widget/ListFileSystem.cpp +++ b/sources/ewol/widget/ListFileSystem.cpp @@ -47,7 +47,7 @@ ewol::widget::ListFileSystem::ListFileSystem() : m_folder = "c:/"; #endif m_colorProperty = ewol::resource::ColorFile::keep("THEME:COLOR:ListFileSystem.json"); - if (m_colorProperty != NULL) { + if (m_colorProperty != nullptr) { m_colorIdText = m_colorProperty->request("text"); m_colorIdBackground1 = m_colorProperty->request("background1"); m_colorIdBackground2 = m_colorProperty->request("background2"); @@ -58,12 +58,12 @@ ewol::widget::ListFileSystem::ListFileSystem() : addEventId(eventFolderSelect); addEventId(eventFolderValidate); - registerConfig(configShowHidden, "bool", NULL, "Show the hidden element (file, folder, ...)"); - registerConfig(configShowFile, "bool", NULL, "display files"); - registerConfig(configShowFolder, "bool", NULL, "display folders"); - registerConfig(configShowTemporary, "bool", NULL, "display temporary files"); - registerConfig(configPath, "string", NULL, "Path to display"); - registerConfig(configSelect, "string", NULL, "selection af a specific file"); + registerConfig(configShowHidden, "bool", nullptr, "Show the hidden element (file, folder, ...)"); + registerConfig(configShowFile, "bool", nullptr, "display files"); + registerConfig(configShowFolder, "bool", nullptr, "display folders"); + registerConfig(configShowTemporary, "bool", nullptr, "display temporary files"); + registerConfig(configPath, "string", nullptr, "Path to display"); + registerConfig(configSelect, "string", nullptr, "selection af a specific file"); setMouseLimit(1); }; @@ -75,9 +75,9 @@ ewol::widget::ListFileSystem::~ListFileSystem() { void ewol::widget::ListFileSystem::clearList() { for (size_t iii=0; iii= 0) { - if (m_list[m_selectedLine] != NULL) { + if (m_list[m_selectedLine] != nullptr) { tmpVal = m_list[m_selectedLine]->getNameFile(); } } @@ -115,7 +115,7 @@ void ewol::widget::ListFileSystem::setSelect(const std::string& _data) { m_selectedLine = -1; // search the coresponding file : for (size_t iii=0; iiigetNameFile() == _data) { // we find the line : m_selectedLine = iii; @@ -164,7 +164,7 @@ bool ewol::widget::ListFileSystem::getElement(int32_t _colomn, int32_t _raw, std } if( _raw-offset >= 0 && _raw-offset < (int32_t)m_list.size() - && NULL != m_list[_raw-offset]) { + && nullptr != m_list[_raw-offset]) { _myTextToWrite = m_list[_raw-offset]->getNameFile(); EWOL_VERBOSE("get filename for : '" << *m_list[_raw-offset] << ":'" << _myTextToWrite << "'"); } @@ -215,7 +215,7 @@ bool ewol::widget::ListFileSystem::onItemEvent(int32_t _IdInput, generateEventId(eventFolderSelect, ".."); } else if( m_selectedLine-offset >= 0 && m_selectedLine-offset < (int32_t)m_list.size() - && NULL != m_list[m_selectedLine-offset] ) { + && nullptr != m_list[m_selectedLine-offset] ) { // generate event extern : switch(m_list[m_selectedLine-offset]->getNodeType()) { case etk::FSN_FILE : @@ -240,7 +240,7 @@ bool ewol::widget::ListFileSystem::onItemEvent(int32_t _IdInput, generateEventId(eventFolderValidate, ".."); } else if( m_selectedLine-offset >= 0 && m_selectedLine-offset < (int32_t)m_list.size() - && NULL != m_list[m_selectedLine-offset] ) { + && nullptr != m_list[m_selectedLine-offset] ) { switch(m_list[m_selectedLine-offset]->getNodeType()) { case etk::FSN_FILE : diff --git a/sources/ewol/widget/Manager.cpp b/sources/ewol/widget/Manager.cpp index d4715c78..b84877bd 100644 --- a/sources/ewol/widget/Manager.cpp +++ b/sources/ewol/widget/Manager.cpp @@ -32,8 +32,8 @@ #define __class__ "ewol::widget::Manager" ewol::widget::Manager::Manager() : - m_focusWidgetDefault(NULL), - m_focusWidgetCurrent(NULL), + m_focusWidgetDefault(nullptr), + m_focusWidgetCurrent(nullptr), m_havePeriodic(false), m_haveRedraw(true), m_applWakeUpTime(0), @@ -65,7 +65,7 @@ ewol::widget::Manager::Manager() : ewol::widget::Manager::~Manager() { EWOL_DEBUG(" == > Un-Init Widget-Manager"); EWOL_INFO("Realease all FOCUS"); - focusSetDefault(NULL); + focusSetDefault(nullptr); focusRelease(); m_listOfPeriodicWidget.clear(); @@ -82,7 +82,7 @@ void ewol::widget::Manager::rm(ewol::object::Shared _newWidget) { * *************************************************************************/ void ewol::widget::Manager::focusKeep(ewol::object::Shared _newWidget) { - if (NULL == _newWidget) { + if (nullptr == _newWidget) { // nothing to do ... return; } @@ -90,35 +90,35 @@ void ewol::widget::Manager::focusKeep(ewol::object::Shared _newWid // nothing to do ... return; } - if (NULL != m_focusWidgetCurrent) { + if (nullptr != m_focusWidgetCurrent) { EWOL_DEBUG("Rm focus on WidgetID=" << m_focusWidgetCurrent->getId() ); m_focusWidgetCurrent->rmFocus(); - m_focusWidgetCurrent = NULL; + m_focusWidgetCurrent = nullptr; } if (false == _newWidget->canHaveFocus()) { EWOL_VERBOSE("Widget can not have focus, id=" << _newWidget->getId() ); return; } m_focusWidgetCurrent = _newWidget; - if (NULL != m_focusWidgetCurrent) { + if (nullptr != m_focusWidgetCurrent) { EWOL_DEBUG("Set focus on WidgetID=" << m_focusWidgetCurrent->getId() ); m_focusWidgetCurrent->setFocus(); } } void ewol::widget::Manager::focusSetDefault(ewol::object::Shared _newWidget) { - if( NULL != _newWidget + if( nullptr != _newWidget && false == _newWidget->canHaveFocus() ) { EWOL_VERBOSE("Widget can not have focus, id=" << _newWidget->getId() ); return; } if (m_focusWidgetDefault == m_focusWidgetCurrent) { - if (NULL != m_focusWidgetCurrent) { + if (nullptr != m_focusWidgetCurrent) { EWOL_DEBUG("Rm focus on WidgetID=" << m_focusWidgetCurrent->getId() ); m_focusWidgetCurrent->rmFocus(); } m_focusWidgetCurrent = _newWidget; - if (NULL != m_focusWidgetCurrent) { + if (nullptr != m_focusWidgetCurrent) { EWOL_DEBUG("Set focus on WidgetID=" << m_focusWidgetCurrent->getId() ); m_focusWidgetCurrent->setFocus(); } @@ -131,12 +131,12 @@ void ewol::widget::Manager::focusRelease() { // nothink to do ... return; } - if (NULL != m_focusWidgetCurrent) { + if (nullptr != m_focusWidgetCurrent) { EWOL_DEBUG("Rm focus on WidgetID=" << m_focusWidgetCurrent->getId() ); m_focusWidgetCurrent->rmFocus(); } m_focusWidgetCurrent = m_focusWidgetDefault; - if (NULL != m_focusWidgetCurrent) { + if (nullptr != m_focusWidgetCurrent) { EWOL_DEBUG("Set focus on WidgetID=" << m_focusWidgetCurrent->getId() ); m_focusWidgetCurrent->setFocus(); } @@ -154,7 +154,7 @@ void ewol::widget::Manager::focusRemoveIfRemove(ewol::object::Shared _ } } for (size_t iii=0; iii < m_listOfPeriodicWidget.size(); iii++) { - if (NULL == m_listOfPeriodicWidget[iii]) { + if (nullptr == m_listOfPeriodicWidget[iii]) { m_listOfPeriodicWidget[iii] = _pWidget; return; } @@ -178,7 +178,7 @@ void ewol::widget::Manager::periodicCallRm(ewol::object::Shared _p int32_t nbElement = 0; for (int32_t iii=m_listOfPeriodicWidget.size()-1; iii >= 0 ; iii--) { if (m_listOfPeriodicWidget[iii] == _pWidget) { - m_listOfPeriodicWidget[iii] = NULL; + m_listOfPeriodicWidget[iii] = nullptr; } else { nbElement++; } @@ -204,7 +204,7 @@ void ewol::widget::Manager::periodicCall(int64_t _localTime) { EWOL_VERBOSE("periodic : " << _localTime); for (int32_t iii=m_listOfPeriodicWidget.size()-1; iii >= 0 ; iii--) { - if (NULL != m_listOfPeriodicWidget[iii]) { + if (nullptr != m_listOfPeriodicWidget[iii]) { int64_t deltaTimeCallUser = m_listOfPeriodicWidget[iii]->systemGetCallDeltaTime(); if (deltaTimeCallUser <= 0) { myTime.setDeltaCall(deltaTime); @@ -245,7 +245,7 @@ bool ewol::widget::Manager::isDrawingNeeded() { // element that generate the list of elements void ewol::widget::Manager::addWidgetCreator(const std::string& _name, ewol::widget::Manager::creator_tf _pointer) { - if (NULL == _pointer) { + if (nullptr == _pointer) { return; } //Keep name in lower case : @@ -268,7 +268,7 @@ ewol::object::Shared ewol::widget::Manager::create(const std::stri } } EWOL_WARNING("try to create an UnExistant widget : " << nameLower); - return NULL; + return nullptr; } bool ewol::widget::Manager::exist(const std::string& _name) { diff --git a/sources/ewol/widget/Menu.cpp b/sources/ewol/widget/Menu.cpp index aea322ca..73eb631d 100644 --- a/sources/ewol/widget/Menu.cpp +++ b/sources/ewol/widget/Menu.cpp @@ -21,7 +21,7 @@ ewol::widget::Menu::Menu() { addObjectType("ewol::widget::Menu"); m_staticId = 0; - m_widgetContextMenu = NULL; + m_widgetContextMenu = nullptr; } ewol::widget::Menu::~Menu() { @@ -48,9 +48,9 @@ void ewol::widget::Menu::subWidgetUnLink(ewol::object::Shared _new void ewol::widget::Menu::clear() { for (size_t iii=0; iii < m_listElement.size(); iii++) { - if (m_listElement[iii] != NULL) { + if (m_listElement[iii] != nullptr) { delete(m_listElement[iii]); - m_listElement[iii] = NULL; + m_listElement[iii] = nullptr; } } m_listElement.clear(); @@ -69,22 +69,22 @@ int32_t ewol::widget::Menu::add(int32_t _parent, const char *_generateEvent, const std::string _message) { ewol::widget::MenuElement *tmpObject = new ewol::widget::MenuElement(); - if (NULL == tmpObject) { + if (nullptr == tmpObject) { EWOL_ERROR("Allocation problem"); return -1; } tmpObject->m_localId = m_staticId++; tmpObject->m_parentId = _parent; - tmpObject->m_widgetPointer = NULL; + tmpObject->m_widgetPointer = nullptr; tmpObject->m_label = std::string("") + _label + ""; tmpObject->m_image = _image; tmpObject->m_generateEvent = _generateEvent; tmpObject->m_message = _message; m_listElement.push_back(tmpObject); if (-1 == tmpObject->m_parentId) { - ewol::widget::Button *myButton = NULL; + ewol::widget::Button *myButton = nullptr; myButton = new ewol::widget::Button(); - if (NULL == myButton) { + if (nullptr == myButton) { EWOL_ERROR("Allocation button error"); return tmpObject->m_localId; } @@ -127,14 +127,14 @@ void ewol::widget::Menu::onReceiveMessage(const ewol::object::Message& _msg) { for (size_t iii=0; iiim_widgetPointer) { // 2 posible case (have a message or have a child ... - if (m_listElement[iii]->m_generateEvent != NULL) { + if (m_listElement[iii]->m_generateEvent != nullptr) { EWOL_DEBUG("Menu == > generate Event"); // Send a multicast event ... sendMultiCast(m_listElement[iii]->m_generateEvent, m_listElement[iii]->m_message); - if (NULL != m_widgetContextMenu) { + if (nullptr != m_widgetContextMenu) { EWOL_DEBUG("Mark the menu to remove ..."); m_widgetContextMenu->removeObject(); - m_widgetContextMenu = NULL; + m_widgetContextMenu = nullptr; } return; } else{ @@ -152,7 +152,7 @@ void ewol::widget::Menu::onReceiveMessage(const ewol::object::Message& _msg) { } // create a context menu : m_widgetContextMenu = new ewol::widget::ContextMenu(); - if (NULL == m_widgetContextMenu) { + if (nullptr == m_widgetContextMenu) { EWOL_ERROR("Allocation Error"); return; } @@ -161,7 +161,7 @@ void ewol::widget::Menu::onReceiveMessage(const ewol::object::Message& _msg) { // TODO : Set it back : /* ewol::object::Shared eventFromWidget = static_cast>(_msg.getCaller()); - if (NULL != eventFromWidget) { + if (nullptr != eventFromWidget) { vec2 tmpOri = eventFromWidget->getOrigin(); vec2 tmpSize = eventFromWidget->getSize(); // calculate the correct position @@ -171,18 +171,18 @@ void ewol::widget::Menu::onReceiveMessage(const ewol::object::Message& _msg) { */ m_widgetContextMenu->setPositionMark(ewol::widget::ContextMenu::markTop, newPosition ); - ewol::widget::Sizer * mySizer = NULL; - ewol::widget::Button * myButton = NULL; + ewol::widget::Sizer * mySizer = nullptr; + ewol::widget::Button * myButton = nullptr; mySizer = new ewol::widget::Sizer(widget::Sizer::modeVert); - if (NULL != mySizer) { + if (nullptr != mySizer) { mySizer->lockExpand(vec2(true,true)); // set it in the pop-up-system : m_widgetContextMenu->setSubWidget(mySizer); bool menuHaveImage = false; for (int64_t jjj=m_listElement.size()-1; jjj >= 0; jjj--) { - if (m_listElement[iii]!=NULL) { + if (m_listElement[iii]!=nullptr) { if (m_listElement[iii]->m_localId == m_listElement[jjj]->m_parentId) { if (m_listElement[jjj]->m_image.size()!=0) { menuHaveImage = true; @@ -192,10 +192,10 @@ void ewol::widget::Menu::onReceiveMessage(const ewol::object::Message& _msg) { } } for (int64_t jjj=m_listElement.size()-1; jjj >= 0; jjj--) { - if (m_listElement[iii]!=NULL) { + if (m_listElement[iii]!=nullptr) { if (m_listElement[iii]->m_localId == m_listElement[jjj]->m_parentId) { myButton = new ewol::widget::Button(); - if (NULL == myButton) { + if (nullptr == myButton) { EWOL_ERROR("Allocation Error"); } else { if (m_listElement[jjj]->m_image.size()!=0) { @@ -223,7 +223,7 @@ void ewol::widget::Menu::onReceiveMessage(const ewol::object::Message& _msg) { "\n")); } else { ewol::widget::Label* tmpLabel = new widget::Label(std::string("") + m_listElement[jjj]->m_label + "\n"); - if (NULL != tmpLabel) { + if (nullptr != tmpLabel) { tmpLabel->setExpand(bvec2(true,false)); tmpLabel->setFill(bvec2(true,true)); myButton->setSubWidget(tmpLabel); @@ -246,7 +246,7 @@ void ewol::widget::Menu::onReceiveMessage(const ewol::object::Message& _msg) { if (currentWindows == nullptr) { EWOL_ERROR("Can not get the curent Windows..."); m_widgetContextMenu->removeObject(); - m_widgetContextMenu = NULL; + m_widgetContextMenu = nullptr; } else { currentWindows->popUpWidgetPush(m_widgetContextMenu); } @@ -262,10 +262,10 @@ void ewol::widget::Menu::onObjectRemove(ewol::object::Shared _remo ewol::widget::Sizer::onObjectRemove(_removeObject); if (m_widgetContextMenu == _removeObject) { delete(m_widgetContextMenu); - m_widgetContextMenu = NULL; + m_widgetContextMenu = nullptr; } for (size_t jjj=0; jjjm_widgetPointer == _removeObject) { m_listElement[jjj]->m_widgetPointer.reset(); } diff --git a/sources/ewol/widget/Menu.h b/sources/ewol/widget/Menu.h index 3ca58c6a..aad50f2b 100644 --- a/sources/ewol/widget/Menu.h +++ b/sources/ewol/widget/Menu.h @@ -20,7 +20,7 @@ namespace ewol { namespace widget { class MenuElement { public : - MenuElement() : m_widgetPointer(NULL) { }; + MenuElement() : m_widgetPointer(nullptr) { }; int32_t m_localId; int32_t m_parentId; ewol::object::Shared m_widgetPointer; @@ -47,8 +47,8 @@ namespace ewol { ewol::widget::ContextMenu* m_widgetContextMenu; public: void clear(); - int32_t addTitle(std::string _label, std::string _image="", const char * _generateEvent = NULL, const std::string _message = ""); - int32_t add(int32_t parent, std::string _label, std::string _image="", const char * _generateEvent = NULL, const std::string _message = ""); + int32_t addTitle(std::string _label, std::string _image="", const char * _generateEvent = nullptr, const std::string _message = ""); + int32_t add(int32_t parent, std::string _label, std::string _image="", const char * _generateEvent = nullptr, const std::string _message = ""); void addSpacer(); // Derived function virtual void onReceiveMessage(const ewol::object::Message& _msg); diff --git a/sources/ewol/widget/PopUp.cpp b/sources/ewol/widget/PopUp.cpp index df4f68d9..c99e1f88 100644 --- a/sources/ewol/widget/PopUp.cpp +++ b/sources/ewol/widget/PopUp.cpp @@ -37,9 +37,9 @@ ewol::widget::PopUp::PopUp(const std::string& _shaperName) : addObjectType("ewol::widget::PopUp"); m_userExpand.setValue(false, false); setMinSize(ewol::Dimension(vec2(80,80),ewol::Dimension::Pourcent)); - registerConfig(configShaper, "string", NULL, "The shaper properties"); - registerConfig(configRemoveOnExternClick, "bool", NULL, "Remove the widget if the use click outside"); - registerConfig(configLockExpand, "bool", NULL, "Lock expand contamination"); + registerConfig(configShaper, "string", nullptr, "The shaper properties"); + registerConfig(configRemoveOnExternClick, "bool", nullptr, "Remove the widget if the use click outside"); + registerConfig(configLockExpand, "bool", nullptr, "Lock expand contamination"); registerConfig(configAnimation, "list", "none;increase", "Annimation type"); // Add annimations : @@ -65,7 +65,7 @@ void ewol::widget::PopUp::setShaperName(const std::string& _shaperName) { void ewol::widget::PopUp::calculateSize(const vec2& _available) { ewol::Widget::calculateSize(_available); - if (NULL != m_subWidget) { + if (nullptr != m_subWidget) { ewol::Padding padding = m_shaper.getPadding(); vec2 subWidgetSize = m_subWidget->getCalculateMinSize(); if (true == m_subWidget->canExpand().x()) { @@ -103,7 +103,7 @@ void ewol::widget::PopUp::systemDraw(const ewol::DrawProperty& _displayProp) { return; } ewol::Widget::systemDraw(_displayProp); - if (NULL!=m_subWidget) { + if (nullptr!=m_subWidget) { if( m_shaper.getNextDisplayedStatus() == -1 && m_shaper.getTransitionStatus() >= 1.0) { ewol::DrawProperty prop = _displayProp; @@ -130,7 +130,7 @@ void ewol::widget::PopUp::onRegenerateDisplay() { if (fill.y()) { tmpSize.setY(m_size.y()-padding.y()); } - if (NULL != m_subWidget) { + if (nullptr != m_subWidget) { vec2 tmpSize = m_subWidget->getSize(); } tmpSize.setMax(m_minSize); @@ -142,14 +142,14 @@ void ewol::widget::PopUp::onRegenerateDisplay() { vec2ClipInt32(tmpSize + vec2(padding.x(), padding.y()))); } // SUBwIDGET GENERATION ... - if (NULL != m_subWidget) { + if (nullptr != m_subWidget) { m_subWidget->onRegenerateDisplay(); } } ewol::object::Shared ewol::widget::PopUp::getWidgetAtPos(const vec2& _pos) { ewol::object::Shared val = ewol::widget::Container::getWidgetAtPos(_pos); - if (NULL != val) { + if (nullptr != val) { return val; } return this; @@ -198,7 +198,7 @@ bool ewol::widget::PopUp::onEventInput(const ewol::event::Input& _event) { if (true == m_closeOutEvent) { ewol::Padding padding = m_shaper.getPadding(); vec2 tmpSize(0,0); - if (NULL != m_subWidget) { + if (nullptr != m_subWidget) { vec2 tmpSize = m_subWidget->getSize(); } tmpSize.setMax(m_minSize); diff --git a/sources/ewol/widget/ProgressBar.cpp b/sources/ewol/widget/ProgressBar.cpp index d62fb8a2..583289e0 100644 --- a/sources/ewol/widget/ProgressBar.cpp +++ b/sources/ewol/widget/ProgressBar.cpp @@ -40,10 +40,10 @@ ewol::widget::ProgressBar::ProgressBar() { m_textColorBgOff = etk::color::black; m_textColorBgOff.setA(0x3F); setCanHaveFocus(true); - registerConfig(configColorBg, "color", NULL, "Background color"); - registerConfig(configColorFgOn, "color", NULL, "Corlor of the true value"); - registerConfig(configColorFgOff, "color", NULL, "Corlor of the false value"); - registerConfig(configValue, "integer", NULL, "Value of the progress bar"); + registerConfig(configColorBg, "color", nullptr, "Background color"); + registerConfig(configColorFgOn, "color", nullptr, "Corlor of the true value"); + registerConfig(configColorFgOff, "color", nullptr, "Corlor of the false value"); + registerConfig(configValue, "integer", nullptr, "Value of the progress bar"); } diff --git a/sources/ewol/widget/Scroll.cpp b/sources/ewol/widget/Scroll.cpp index d708b4dd..ff5e3a0d 100644 --- a/sources/ewol/widget/Scroll.cpp +++ b/sources/ewol/widget/Scroll.cpp @@ -34,7 +34,7 @@ ewol::widget::Scroll::Scroll(const std::string& _shaperName) : m_highSpeedButton(-1), m_highSpeedType(ewol::key::typeUnknow) { addObjectType("ewol::widget::Scroll"); - registerConfig(configLimit, "vec2", NULL, "Limit the scroll maximum position [0..1]% represent the free space in the scoll when arrive at the end"); + registerConfig(configLimit, "vec2", nullptr, "Limit the scroll maximum position [0..1]% represent the free space in the scoll when arrive at the end"); } ewol::widget::Scroll::~Scroll() { @@ -52,7 +52,7 @@ void ewol::widget::Scroll::calculateMinMaxSize() { // call main class !! and not containter class ... ewol::Widget::calculateMinMaxSize(); // call sub classes - if (NULL!=m_subWidget) { + if (nullptr!=m_subWidget) { m_subWidget->calculateMinMaxSize(); } } @@ -61,7 +61,7 @@ void ewol::widget::Scroll::systemDraw(const ewol::DrawProperty& _displayProp) { if (m_hide == true) { return; } - if (NULL!=m_subWidget) { + if (nullptr!=m_subWidget) { ewol::DrawProperty prop = _displayProp; prop.limit(m_origin, m_size); m_subWidget->systemDraw(prop); @@ -87,7 +87,7 @@ void ewol::widget::Scroll::onRegenerateDisplay() { ewol::Padding paddingHori = m_shaperH.getPadding(); vec2 scrollOffset(0,0); vec2 scrollSize(0,0); - if (NULL!=m_subWidget) { + if (nullptr!=m_subWidget) { scrollOffset = m_subWidget->getOffset(); scrollSize = m_subWidget->getSize(); } @@ -123,7 +123,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { vec2 relativePos = relativePosition(_event.getPos()); vec2 scrollOffset(0,0); vec2 scrollSize(0,0); - if (NULL!=m_subWidget) { + if (nullptr!=m_subWidget) { scrollOffset = m_subWidget->getOffset(); scrollSize = m_subWidget->getSize(); } @@ -147,7 +147,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { scrollOffset.setY((int32_t)(scrollSize.y() * (relativePos.y()-SCROLL_BAR_SPACE) / (m_size.y()-SCROLL_BAR_SPACE*2))); scrollOffset.setY(etk_avg(0, scrollOffset.y(), (scrollSize.y() - m_size.y()*m_limit.y()))); markToRedraw(); - if (NULL!=m_subWidget) { + if (nullptr!=m_subWidget) { m_subWidget->setOffset(scrollOffset); } return true; @@ -164,7 +164,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { scrollOffset.setX((int32_t)(scrollSize.x() * (relativePos.x()-SCROLL_BAR_SPACE) / (m_size.x()-SCROLL_BAR_SPACE*2))); scrollOffset.setY(etk_avg(0, scrollOffset.x(), (scrollSize.x() - m_size.x()*m_limit.x()))); markToRedraw(); - if (NULL!=m_subWidget) { + if (nullptr!=m_subWidget) { m_subWidget->setOffset(scrollOffset); } return true; @@ -177,7 +177,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { scrollOffset.setY(scrollOffset.y()-m_pixelScrolling); scrollOffset.setY(etk_avg(0, scrollOffset.y(), (scrollSize.y() - m_size.y()*m_limit.y()))); markToRedraw(); - if (NULL!=m_subWidget) { + if (nullptr!=m_subWidget) { m_subWidget->setOffset(scrollOffset); } return true; @@ -188,7 +188,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { scrollOffset.setY(scrollOffset.y()+m_pixelScrolling); scrollOffset.setY(etk_avg(0, scrollOffset.y(), (scrollSize.y() - m_size.y()*m_limit.y()))); markToRedraw(); - if (NULL!=m_subWidget) { + if (nullptr!=m_subWidget) { m_subWidget->setOffset(scrollOffset); } return true; @@ -257,7 +257,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { markToRedraw(); } scrollOffset.setY(etk_avg(0, scrollOffset.y(), (scrollSize.y() - m_size.y()*m_limit.y()))); - if (NULL!=m_subWidget) { + if (nullptr!=m_subWidget) { m_subWidget->setOffset(scrollOffset); } return true; @@ -267,7 +267,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { scrollOffset.setX((int32_t)(scrollSize.x() * (relativePos.x()-SCROLL_BAR_SPACE) / (m_size.x()-SCROLL_BAR_SPACE*2))); scrollOffset.setX(etk_avg(0, scrollOffset.x(), (scrollSize.x() - m_size.x()*m_limit.x() ))); markToRedraw(); - if (NULL!=m_subWidget) { + if (nullptr!=m_subWidget) { m_subWidget->setOffset(scrollOffset); } return true; @@ -277,7 +277,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { scrollOffset.setY((int32_t)(scrollSize.y() * (relativePos.y()-SCROLL_BAR_SPACE) / (m_size.y()-SCROLL_BAR_SPACE*2))); scrollOffset.setY(etk_avg(0, scrollOffset.y(), (scrollSize.y() - m_size.y()*m_limit.x()))); markToRedraw(); - if (NULL!=m_subWidget) { + if (nullptr!=m_subWidget) { m_subWidget->setOffset(scrollOffset); } return true; @@ -329,7 +329,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { m_highSpeedStartPos = relativePos; EWOL_VERBOSE("SCROOL == > MOVE " << scrollOffset); markToRedraw(); - if (NULL!=m_subWidget) { + if (nullptr!=m_subWidget) { m_subWidget->setOffset(scrollOffset); } return true; @@ -351,7 +351,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { ewol::object::Shared ewol::widget::Scroll::getWidgetAtPos(const vec2& _pos) { ewol::object::Shared tmpWidget = ewol::widget::Container::getWidgetAtPos(_pos); - if (NULL != tmpWidget) { + if (nullptr != tmpWidget) { return tmpWidget; } return this; diff --git a/sources/ewol/widget/Sizer.cpp b/sources/ewol/widget/Sizer.cpp index 3cd7b079..293936ed 100644 --- a/sources/ewol/widget/Sizer.cpp +++ b/sources/ewol/widget/Sizer.cpp @@ -31,7 +31,7 @@ ewol::widget::Sizer::Sizer(enum displayMode _mode): m_animation(animationNone), m_animationTime(0) { addObjectType("ewol::widget::Sizer"); - registerConfig(configBorder, "dimension", NULL, "The sizer border size"); + registerConfig(configBorder, "dimension", nullptr, "The sizer border size"); registerConfig(configMode, "list", "{vert,hori}", "The display mode"); } @@ -66,7 +66,7 @@ void ewol::widget::Sizer::calculateSize(const vec2& _availlable) { int32_t nbWidgetFixedSize=0; int32_t nbWidgetNotFixedSize=0; for (size_t iii=0; iiigetCalculateMinSize(); if (m_mode == ewol::widget::Sizer::modeVert) { unexpandableSize += tmpSize.y(); @@ -100,7 +100,7 @@ void ewol::widget::Sizer::calculateSize(const vec2& _availlable) { } vec2 tmpOrigin = m_origin + tmpBorderSize; for (size_t iii=0; iiigetCalculateMinSize(); // set the origin : EWOL_VERBOSE("[" << getId() << "] set iii=" << iii << " ORIGIN : " << tmpOrigin << " & offset=" << m_offset); @@ -137,7 +137,7 @@ void ewol::widget::Sizer::calculateMinMaxSize() { EWOL_VERBOSE("[" << getId() << "] {" << getObjectType() << "} set min size : " << m_minSize); m_minSize += tmpBorderSize*2; for (int32_t iii=0; iiicalculateMinMaxSize(); if (true == m_subWidget[iii]->canExpand().x()) { m_subExpend.setX(true); diff --git a/sources/ewol/widget/Spacer.cpp b/sources/ewol/widget/Spacer.cpp index 1a54c861..323f6603 100644 --- a/sources/ewol/widget/Spacer.cpp +++ b/sources/ewol/widget/Spacer.cpp @@ -30,7 +30,7 @@ ewol::widget::Spacer::Spacer() { setCanHaveFocus(false); m_color = etk::color::black; m_color.setA(0); - registerConfig(configColor, "color", NULL, "background of the spacer"); + registerConfig(configColor, "color", nullptr, "background of the spacer"); } ewol::widget::Spacer::~Spacer() { diff --git a/sources/ewol/widget/Spacer.h b/sources/ewol/widget/Spacer.h index 3ed894b2..765a8777 100644 --- a/sources/ewol/widget/Spacer.h +++ b/sources/ewol/widget/Spacer.h @@ -46,7 +46,7 @@ namespace ewol { */ void setColor(etk::Color<> _newColor) { m_color = _newColor; markToRedraw(); }; public: // Derived function - virtual ewol::object::Shared getWidgetAtPos(const vec2& _pos) { return NULL; }; + virtual ewol::object::Shared getWidgetAtPos(const vec2& _pos) { return nullptr; }; virtual void onRegenerateDisplay(); virtual void onDraw(); virtual bool onSetConfig(const ewol::object::Config& _conf); diff --git a/sources/ewol/widget/WSlider.cpp b/sources/ewol/widget/WSlider.cpp index 27b521db..9b20c8a0 100644 --- a/sources/ewol/widget/WSlider.cpp +++ b/sources/ewol/widget/WSlider.cpp @@ -50,7 +50,7 @@ ewol::widget::WSlider::WSlider() : addEventId(eventStopSlide); // add configuration registerConfig(configMode, "list", "vert;hori", "Transition mode of the slider"); - registerConfig(configSpeed, "float", NULL, "Transition speed of the slider"); + registerConfig(configSpeed, "float", nullptr, "Transition speed of the slider"); } ewol::widget::WSlider::~WSlider() { @@ -65,7 +65,7 @@ void ewol::widget::WSlider::calculateSize(const vec2& _availlable) { if (m_windowsDestination == m_windowsSources) { int32_t iii = m_windowsDestination; if (iii < (int32_t)m_subWidget.size()) { - if (NULL != m_subWidget[iii]) { + if (nullptr != m_subWidget[iii]) { m_subWidget[iii]->setOrigin(m_origin+m_offset); m_subWidget[iii]->calculateSize(m_size); } @@ -77,7 +77,7 @@ void ewol::widget::WSlider::calculateSize(const vec2& _availlable) { } int32_t iii = m_windowsSources; if (iii < (int32_t)m_subWidget.size()) { - if (NULL != m_subWidget[iii]) { + if (nullptr != m_subWidget[iii]) { if (m_transitionSlide == sladingTransitionHori) { m_subWidget[iii]->setOrigin( vec2(m_origin.x() + factor*(m_size.x()*m_slidingProgress), m_origin.y()) @@ -92,7 +92,7 @@ void ewol::widget::WSlider::calculateSize(const vec2& _availlable) { } iii = m_windowsDestination; if (iii < (int32_t)m_subWidget.size()) { - if (NULL != m_subWidget[iii]) { + if (nullptr != m_subWidget[iii]) { if (m_transitionSlide == sladingTransitionHori) { m_subWidget[iii]->setOrigin( vec2(m_origin.x() + factor*(m_size.x()*m_slidingProgress - m_size.x()), m_origin.y()) @@ -126,7 +126,7 @@ void ewol::widget::WSlider::subWidgetSelectSet(int32_t _id) { int32_t elementID = -1; // search element in the list : for (size_t iii=0 ; iiigetId() == _id) { elementID = iii; break; @@ -137,12 +137,12 @@ void ewol::widget::WSlider::subWidgetSelectSet(int32_t _id) { } void ewol::widget::WSlider::subWidgetSelectSet(ewol::object::Shared _widgetPointer) { - if (_widgetPointer == NULL) { - EWOL_ERROR("Can not change to a widget NULL"); + if (_widgetPointer == nullptr) { + EWOL_ERROR("Can not change to a widget nullptr"); return; } for (size_t iii=0; iiigetName() == _widgetName) { subWidgetSelectSetVectorId(iii); return; @@ -224,7 +224,7 @@ void ewol::widget::WSlider::systemDraw(const ewol::DrawProperty& _displayProp) { //EWOL_DEBUG("Draw : " << m_windowsDestination); int32_t iii = m_windowsDestination; if (iii >= 0 || (size_t)iii < m_subWidget.size()) { - if (NULL != m_subWidget[iii]) { + if (nullptr != m_subWidget[iii]) { m_subWidget[iii]->systemDraw(prop); } } @@ -233,14 +233,14 @@ void ewol::widget::WSlider::systemDraw(const ewol::DrawProperty& _displayProp) { // draw Sources : int32_t iii = m_windowsSources; if (iii >= 0 || (size_t)iii < m_subWidget.size()) { - if (NULL != m_subWidget[iii]) { + if (nullptr != m_subWidget[iii]) { m_subWidget[iii]->systemDraw(prop); } } // draw Destination : iii = m_windowsDestination; if (iii >= 0 || (size_t)iii < m_subWidget.size()) { - if (NULL != m_subWidget[iii]) { + if (nullptr != m_subWidget[iii]) { m_subWidget[iii]->systemDraw(prop); } } @@ -251,20 +251,20 @@ void ewol::widget::WSlider::onRegenerateDisplay() { if (m_windowsDestination == m_windowsSources) { int32_t iii = m_windowsDestination; if (iii >= 0 || (size_t)iii < m_subWidget.size()) { - if (NULL != m_subWidget[iii]) { + if (nullptr != m_subWidget[iii]) { m_subWidget[iii]->onRegenerateDisplay(); } } } else { int32_t iii = m_windowsSources; if (iii >= 0 || (size_t)iii < m_subWidget.size()) { - if (NULL != m_subWidget[iii]) { + if (nullptr != m_subWidget[iii]) { m_subWidget[iii]->onRegenerateDisplay(); } } iii = m_windowsDestination; if (iii >= 0 || (size_t)iii < m_subWidget.size()) { - if (NULL != m_subWidget[iii]) { + if (nullptr != m_subWidget[iii]) { m_subWidget[iii]->onRegenerateDisplay(); } } @@ -317,7 +317,7 @@ bool ewol::widget::WSlider::onGetConfig(const char* _config, std::string& _resul ewol::object::Shared ewol::widget::WSlider::getWidgetAtPos(const vec2& _pos) { if (true == isHide()) { - return NULL; + return nullptr; } if (m_windowsDestination == m_windowsSources) { if (m_windowsDestination < (int64_t)m_subWidget.size()) { @@ -327,10 +327,10 @@ ewol::object::Shared ewol::widget::WSlider::getWidgetAtPos(const v && (tmpOrigin.y() <= _pos.y() && tmpOrigin.y() + tmpSize.y() >= _pos.y()) ) { ewol::object::Shared tmpWidget = m_subWidget[m_windowsDestination]->getWidgetAtPos(_pos); - if (NULL != tmpWidget) { + if (nullptr != tmpWidget) { return tmpWidget; } - return NULL; + return nullptr; } } } else { @@ -341,10 +341,10 @@ ewol::object::Shared ewol::widget::WSlider::getWidgetAtPos(const v && (tmpOrigin.y() <= _pos.y() && tmpOrigin.y() + tmpSize.y() >= _pos.y()) ) { ewol::object::Shared tmpWidget = m_subWidget[m_windowsDestination]->getWidgetAtPos(_pos); - if (NULL != tmpWidget) { + if (nullptr != tmpWidget) { return tmpWidget; } - return NULL; + return nullptr; } } if (m_windowsSources < (int64_t)m_subWidget.size()) { @@ -354,13 +354,13 @@ ewol::object::Shared ewol::widget::WSlider::getWidgetAtPos(const v && (tmpOrigin.y() <= _pos.y() && tmpOrigin.y() + tmpSize.y() >= _pos.y()) ) { ewol::object::Shared tmpWidget = m_subWidget[m_windowsSources]->getWidgetAtPos(_pos); - if (NULL != tmpWidget) { + if (nullptr != tmpWidget) { return tmpWidget; } - return NULL; + return nullptr; } } } - return NULL; + return nullptr; } diff --git a/sources/ewol/widget/Widget.cpp b/sources/ewol/widget/Widget.cpp index 79f3fc59..7c5daa54 100644 --- a/sources/ewol/widget/Widget.cpp +++ b/sources/ewol/widget/Widget.cpp @@ -105,7 +105,7 @@ const char* const ewol::Widget::eventAnnimationRatio = "annimation-ratio"; const char* const ewol::Widget::eventAnnimationStop = "annimation-stop"; ewol::Widget::Widget() : - m_up(NULL), + m_up(nullptr), m_size(10,10), m_minSize(0,0), m_maxSize(vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE)), @@ -129,23 +129,23 @@ ewol::Widget::Widget() : m_cursorDisplay(ewol::context::cursorArrow), m_annimationMode(annimationModeDisable), m_annimationratio(0.0f) { - m_annimationType[0] = NULL; - m_annimationType[1] = NULL; + m_annimationType[0] = nullptr; + m_annimationType[1] = nullptr; m_annimationTime[0] = 0.1f; // annimation will be 100ms at the first state m_annimationTime[1] = 0.1f; // annimation will be 100ms at the first state addObjectType("ewol::object::Shared"); // set all the config in the list : - registerConfig(ewol::Widget::configFill, "bvec2", NULL, "Fill the widget available size"); - registerConfig(ewol::Widget::configExpand, "bvec2", NULL, "Request the widget Expand size wile space is available"); - registerConfig(ewol::Widget::configHide, "bool", NULL, "The widget start hided"); - registerConfig(ewol::Widget::configFocus, "bool", NULL, "The widget request focus"); - registerConfig(ewol::Widget::configMinSize, "dimension", NULL, "User minimum size"); - registerConfig(ewol::Widget::configMaxSize, "dimension", NULL, "User maximum size"); + registerConfig(ewol::Widget::configFill, "bvec2", nullptr, "Fill the widget available size"); + registerConfig(ewol::Widget::configExpand, "bvec2", nullptr, "Request the widget Expand size wile space is available"); + registerConfig(ewol::Widget::configHide, "bool", nullptr, "The widget start hided"); + registerConfig(ewol::Widget::configFocus, "bool", nullptr, "The widget request focus"); + registerConfig(ewol::Widget::configMinSize, "dimension", nullptr, "User minimum size"); + registerConfig(ewol::Widget::configMaxSize, "dimension", nullptr, "User maximum size"); registerConfig(ewol::Widget::configGravity, "list", "center;top-left;top;top-right;right;buttom-right;buttom;buttom-left;left", "User maximum size"); - registerConfig(ewol::Widget::configAnnimationAddType, "list", NULL /* no control */, "Annimation type, when adding/show a widget"); - registerConfig(ewol::Widget::configAnnimationAddTime, "float", NULL /* no control */, "Annimation time in second, when adding/show a widget"); - registerConfig(ewol::Widget::configAnnimationRemoveType, "list", NULL /* no control */, "Annimation type, when removing/hide a widget"); - registerConfig(ewol::Widget::configAnnimationRemoveTime, "float", NULL /* no control */, "Annimation time in second, when removing/hide a widget"); + registerConfig(ewol::Widget::configAnnimationAddType, "list", nullptr /* no control */, "Annimation type, when adding/show a widget"); + registerConfig(ewol::Widget::configAnnimationAddTime, "float", nullptr /* no control */, "Annimation time in second, when adding/show a widget"); + registerConfig(ewol::Widget::configAnnimationRemoveType, "list", nullptr /* no control */, "Annimation type, when removing/hide a widget"); + registerConfig(ewol::Widget::configAnnimationRemoveTime, "float", nullptr /* no control */, "Annimation time in second, when removing/hide a widget"); addEventId(eventAnnimationStart); addEventId(eventAnnimationRatio); addEventId(eventAnnimationStop); @@ -544,13 +544,13 @@ void ewol::Widget::shortCutAdd(const char * _descriptiveString, const char * _generateEventId, std::string _data, bool _broadcast) { - if ( _descriptiveString == NULL + if ( _descriptiveString == nullptr || strlen(_descriptiveString) == 0) { EWOL_ERROR("try to add shortcut with no descriptive string ..."); return; } EventShortCut* tmpElement = new EventShortCut(); - if (NULL == tmpElement) { + if (nullptr == tmpElement) { EWOL_ERROR("allocation error ... Memory error ..."); return; } @@ -560,74 +560,74 @@ void ewol::Widget::shortCutAdd(const char * _descriptiveString, // parsing of the string : //"ctrl+shift+alt+meta+s" const char * tmp = strstr(_descriptiveString, "ctrl"); - if(NULL != tmp) { + if(nullptr != tmp) { tmpElement->specialKey.setCtrl(true); } tmp = strstr(_descriptiveString, "shift"); - if(NULL != tmp) { + if(nullptr != tmp) { tmpElement->specialKey.setShift(true); } tmp = strstr(_descriptiveString, "alt"); - if(NULL != tmp) { + if(nullptr != tmp) { tmpElement->specialKey.setAlt(true); } tmp = strstr(_descriptiveString, "meta"); - if(NULL != tmp) { + if(nullptr != tmp) { tmpElement->specialKey.setMeta(true); } - if(NULL != strstr(_descriptiveString, "F12") ) { + if(nullptr != strstr(_descriptiveString, "F12") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardF12; - } else if(NULL != strstr(_descriptiveString, "F11") ) { + } else if(nullptr != strstr(_descriptiveString, "F11") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardF11; - } else if(NULL != strstr(_descriptiveString, "F10") ) { + } else if(nullptr != strstr(_descriptiveString, "F10") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardF10; - } else if(NULL != strstr(_descriptiveString, "F9") ) { + } else if(nullptr != strstr(_descriptiveString, "F9") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardF9; - } else if(NULL != strstr(_descriptiveString, "F8") ) { + } else if(nullptr != strstr(_descriptiveString, "F8") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardF8; - } else if(NULL != strstr(_descriptiveString, "F7") ) { + } else if(nullptr != strstr(_descriptiveString, "F7") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardF7; - } else if(NULL != strstr(_descriptiveString, "F6") ) { + } else if(nullptr != strstr(_descriptiveString, "F6") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardF6; - } else if(NULL != strstr(_descriptiveString, "F5") ) { + } else if(nullptr != strstr(_descriptiveString, "F5") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardF5; - } else if(NULL != strstr(_descriptiveString, "F4") ) { + } else if(nullptr != strstr(_descriptiveString, "F4") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardF4; - } else if(NULL != strstr(_descriptiveString, "F3") ) { + } else if(nullptr != strstr(_descriptiveString, "F3") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardF3; - } else if(NULL != strstr(_descriptiveString, "F2") ) { + } else if(nullptr != strstr(_descriptiveString, "F2") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardF2; - } else if(NULL != strstr(_descriptiveString, "F1") ) { + } else if(nullptr != strstr(_descriptiveString, "F1") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardF1; - } else if(NULL != strstr(_descriptiveString, "LEFT") ) { + } else if(nullptr != strstr(_descriptiveString, "LEFT") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardLeft; - } else if(NULL != strstr(_descriptiveString, "RIGHT") ) { + } else if(nullptr != strstr(_descriptiveString, "RIGHT") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardRight; - } else if(NULL != strstr(_descriptiveString, "UP") ) { + } else if(nullptr != strstr(_descriptiveString, "UP") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardUp; - } else if(NULL != strstr(_descriptiveString, "DOWN") ) { + } else if(nullptr != strstr(_descriptiveString, "DOWN") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardDown; - } else if(NULL != strstr(_descriptiveString, "PAGE_UP") ) { + } else if(nullptr != strstr(_descriptiveString, "PAGE_UP") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardPageUp; - } else if(NULL != strstr(_descriptiveString, "PAGE_DOWN") ) { + } else if(nullptr != strstr(_descriptiveString, "PAGE_DOWN") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardPageDown; - } else if(NULL != strstr(_descriptiveString, "START") ) { + } else if(nullptr != strstr(_descriptiveString, "START") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardStart; - } else if(NULL != strstr(_descriptiveString, "END") ) { + } else if(nullptr != strstr(_descriptiveString, "END") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardEnd; - } else if(NULL != strstr(_descriptiveString, "PRINT") ) { + } else if(nullptr != strstr(_descriptiveString, "PRINT") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardPrint; - } else if(NULL != strstr(_descriptiveString, "ARRET_DEFIL") ) { + } else if(nullptr != strstr(_descriptiveString, "ARRET_DEFIL") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardStopDefil; - } else if(NULL != strstr(_descriptiveString, "WAIT") ) { + } else if(nullptr != strstr(_descriptiveString, "WAIT") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardWait; - } else if(NULL != strstr(_descriptiveString, "INSERT") ) { + } else if(nullptr != strstr(_descriptiveString, "INSERT") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardInsert; - } else if(NULL != strstr(_descriptiveString, "CAPLOCK") ) { + } else if(nullptr != strstr(_descriptiveString, "CAPLOCK") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardCapLock; - } else if(NULL != strstr(_descriptiveString, "CONTEXT_MENU") ) { + } else if(nullptr != strstr(_descriptiveString, "CONTEXT_MENU") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardContextMenu; - } else if(NULL != strstr(_descriptiveString, "NUM_LOCK") ) { + } else if(nullptr != strstr(_descriptiveString, "NUM_LOCK") ) { tmpElement->keyboardMoveValue = ewol::key::keyboardNumLock; } else { tmpElement->unicodeValue = _descriptiveString[strlen(_descriptiveString) -1]; @@ -638,9 +638,9 @@ void ewol::Widget::shortCutAdd(const char * _descriptiveString, void ewol::Widget::shortCutClean() { for (size_t iii=0; iii= 0; iii--) { - if(NULL != m_localShortcut[iii]) { + if(nullptr != m_localShortcut[iii]) { if( m_localShortcut[iii]->specialKey.getShift() == _special.getShift() && m_localShortcut[iii]->specialKey.getCtrl() == _special.getCtrl() && m_localShortcut[iii]->specialKey.getAlt() == _special.getAlt() @@ -722,11 +722,11 @@ ewol::object::Shared ewol::Widget::getWidgetNamed(const std::strin if (getName() == _widgetName) { return this; } - return NULL; + return nullptr; } bool ewol::Widget::systemEventEntry(ewol::event::EntrySystem& _event) { - if (NULL != m_up) { + if (nullptr != m_up) { if (true == m_up->systemEventEntry(_event)) { return true; } @@ -735,7 +735,7 @@ bool ewol::Widget::systemEventEntry(ewol::event::EntrySystem& _event) { } bool ewol::Widget::systemEventInput(ewol::event::InputSystem& _event) { - if (NULL != m_up) { + if (nullptr != m_up) { if (true == m_up->systemEventInput(_event)) { return true; } @@ -837,7 +837,7 @@ bool ewol::Widget::onGetConfig(const char* _config, std::string& _result) const } if (_config == ewol::Widget::configAnnimationAddType) { const char* type = m_annimationType[ewol::Widget::annimationModeEnableAdd]; - if (type == NULL) { + if (type == nullptr) { _result = ""; } else { _result = type; @@ -850,7 +850,7 @@ bool ewol::Widget::onGetConfig(const char* _config, std::string& _result) const } if (_config == ewol::Widget::configAnnimationRemoveType) { const char* type = m_annimationType[ewol::Widget::annimationModeEnableRemove]; - if (type == NULL) { + if (type == nullptr) { _result = ""; } else { _result = type; diff --git a/sources/ewol/widget/Widget.h b/sources/ewol/widget/Widget.h index f1e27e3c..7c2cd74a 100644 --- a/sources/ewol/widget/Widget.h +++ b/sources/ewol/widget/Widget.h @@ -101,7 +101,7 @@ namespace ewol { enum ewol::key::keyboard keyboardMoveValue; //!< ewol::EVENT_KB_MOVE_TYPE_NONE if not used EventShortCut() { broadcastEvent = false; - generateEventId = NULL; + generateEventId = nullptr; eventData = ""; unicodeValue = 0; keyboardMoveValue = ewol::key::keyboardUnknow; @@ -144,18 +144,18 @@ namespace ewol { public: /** * @brief set the upper widget of this widget. - * @param[in] _upper Father widget (only keep the last and write error if a previous was set) == > disable with NULL. + * @param[in] _upper Father widget (only keep the last and write error if a previous was set) == > disable with nullptr. */ void setUpperWidget(ewol::object::Shared _upper); /** * @brief remove the upper widget of this widget. */ void removeUpperWidget() { - setUpperWidget(NULL); + setUpperWidget(nullptr); }; /** * @brief get the upper widget (father). - * @ return the requested widget (if NULL , 2 case : root widget or error implementation). + * @ return the requested widget (if nullptr , 2 case : root widget or error implementation). */ ewol::object::Shared getUpperWidget() { return m_up; @@ -528,7 +528,7 @@ namespace ewol { /** * @brief get the widget at the specific windows absolute position * @param[in] _pos gAbsolute position of the requested widget knowledge - * @return NULL No widget found + * @return nullptr No widget found * @return pointer on the widget found * @note : INTERNAL EWOL SYSTEM */ @@ -536,12 +536,12 @@ namespace ewol { if (false == isHide()) { return this; } - return NULL; + return nullptr; }; /** * @brief get the widget if it have this name or one of the subwidget with the same name * @param[in] _widgetName name of the widget - * @return the requested pointer on the node (or NULL pointer) + * @return the requested pointer on the node (or nullptr pointer) */ virtual ewol::object::Shared getWidgetNamed(const std::string& _widgetName); @@ -741,7 +741,7 @@ namespace ewol { private: std::vector m_annimationList[2]; //!< List of all annimation type ADD protected: - const char* m_annimationType[2]; //!< type of start annimation (default NULL ==> no annimation) + const char* m_annimationType[2]; //!< type of start annimation (default nullptr ==> no annimation) float m_annimationTime[2]; //!< time to produce start annimation protected: /** diff --git a/sources/ewol/widget/Windows.cpp b/sources/ewol/widget/Windows.cpp index 445e044e..57e412b1 100644 --- a/sources/ewol/widget/Windows.cpp +++ b/sources/ewol/widget/Windows.cpp @@ -24,14 +24,14 @@ extern const char * const ewolEventWindowsHideKeyboard = "ewol Windows hideKey ewol::widget::Windows::Windows() : - m_colorProperty(NULL), + m_colorProperty(nullptr), m_colorBg(-1) { addObjectType("ewol::widget::Windows"); setCanHaveFocus(true); - m_subWidget = NULL; + m_subWidget = nullptr; setDecorationDisable(); m_colorProperty = ewol::resource::ColorFile::keep("THEME:COLOR:Windows.json"); - if (m_colorProperty != NULL) { + if (m_colorProperty != nullptr) { m_colorBg = m_colorProperty->request("background"); } //KeyboardShow(KEYBOARD_MODE_CODE); @@ -45,14 +45,14 @@ ewol::widget::Windows::~Windows() { void ewol::widget::Windows::calculateSize(const vec2& _availlable) { //EWOL_DEBUG(" _availlable : " << _availlable); m_size = _availlable; - if (NULL != m_subWidget) { + if (nullptr != m_subWidget) { m_subWidget->calculateMinMaxSize(); // TODO : Check if min size is possible ... // TODO : Herited from MinSize .. and expand ??? m_subWidget->calculateSize(m_size); } for (size_t iii=0; iiicalculateMinMaxSize(); m_popUpWidgetList[iii]->calculateSize(m_size); } @@ -64,13 +64,13 @@ ewol::object::Shared ewol::widget::Windows::getWidgetAtPos(const v vec2 relativePos = relativePosition(_pos); // event go directly on the pop-up if (0 < m_popUpWidgetList.size()) { - if (NULL == m_popUpWidgetList[m_popUpWidgetList.size()-1]) { + if (nullptr == m_popUpWidgetList[m_popUpWidgetList.size()-1]) { m_popUpWidgetList.pop_back(); } else { return m_popUpWidgetList[m_popUpWidgetList.size()-1]->getWidgetAtPos(_pos); } // otherwise in the normal windows - } else if (NULL != m_subWidget) { + } else if (nullptr != m_subWidget) { return m_subWidget->getWidgetAtPos(_pos); } // otherwise the event go to this widget ... @@ -110,11 +110,11 @@ void ewol::widget::Windows::sysDraw() { } void ewol::widget::Windows::onRegenerateDisplay() { - if (NULL != m_subWidget) { + if (nullptr != m_subWidget) { m_subWidget->onRegenerateDisplay(); } for (size_t iii=0; iiionRegenerateDisplay(); } } @@ -130,7 +130,7 @@ void ewol::widget::Windows::systemDraw(const ewol::DrawProperty& _displayProp) { // clear the screen with transparency ... etk::Color colorBg(0.5, 0.5, 0.5, 0.5); - if (m_colorProperty != NULL) { + if (m_colorProperty != nullptr) { colorBg = m_colorProperty->get(m_colorBg); } glClearColor(colorBg.r(), colorBg.g(), colorBg.b(), colorBg.a()); @@ -143,7 +143,7 @@ void ewol::widget::Windows::systemDraw(const ewol::DrawProperty& _displayProp) { #endif //EWOL_WARNING(" WINDOWS draw on " << m_currentDrawId); // first display the windows on the display - if (NULL != m_subWidget) { + if (nullptr != m_subWidget) { m_subWidget->systemDraw(_displayProp); //EWOL_DEBUG("Draw Windows"); } @@ -155,7 +155,7 @@ void ewol::widget::Windows::systemDraw(const ewol::DrawProperty& _displayProp) { #endif // second display the pop-up for (size_t iii=0; iiisystemDraw(_displayProp); //EWOL_DEBUG("Draw Pop-up"); } @@ -167,7 +167,7 @@ void ewol::widget::Windows::systemDraw(const ewol::DrawProperty& _displayProp) { } void ewol::widget::Windows::setSubWidget(ewol::object::Shared _widget) { - if (m_subWidget != NULL) { + if (m_subWidget != nullptr) { EWOL_INFO("Remove current main windows Widget..."); m_subWidget.reset(); } @@ -177,7 +177,7 @@ void ewol::widget::Windows::setSubWidget(ewol::object::Shared _wid } void ewol::widget::Windows::popUpWidgetPush(ewol::object::Shared _widget) { - if (_widget == NULL) { + if (_widget == nullptr) { // nothing to do an error appear : EWOL_ERROR("can not set widget pop-up (null pointer)"); return; @@ -196,7 +196,7 @@ void ewol::widget::Windows::popUpWidgetPop() { return; } ewol::object::Shared widget = m_popUpWidgetList[m_popUpWidgetList.size()-1]; - if (widget == NULL) { + if (widget == nullptr) { return; } widget->removeObject(); @@ -209,12 +209,12 @@ void ewol::widget::Windows::onObjectRemove(ewol::object::Shared _r if (m_subWidget == _removeObject) { EWOL_DEBUG("Remove main element of the windows == > destroyed object"); - m_subWidget = NULL; + m_subWidget = nullptr; } for(int32_t iii=m_popUpWidgetList.size()-1; iii >= 0; --iii) { if(m_popUpWidgetList[iii] == _removeObject) { EWOL_DEBUG("Remove Pop-up [" << iii << "] element of the windows == > destroyed object"); - m_popUpWidgetList[iii] = NULL; + m_popUpWidgetList[iii] = nullptr; m_popUpWidgetList.erase(m_popUpWidgetList.begin()+iii); } } @@ -237,7 +237,7 @@ void ewol::widget::Windows::setTitle(const std::string& _title) { void ewol::widget::Windows::createPopUpMessage(enum popUpMessageType _type, const std::string& _message) { ewol::widget::StdPopUp* tmpPopUp = new widget::StdPopUp(); - if (tmpPopUp == NULL) { + if (tmpPopUp == nullptr) { EWOL_ERROR("Can not create a simple pop-up"); return; } diff --git a/sources/ewol/widget/meta/ColorChooser.cpp b/sources/ewol/widget/meta/ColorChooser.cpp index bdb06fee..235620ab 100644 --- a/sources/ewol/widget/meta/ColorChooser.cpp +++ b/sources/ewol/widget/meta/ColorChooser.cpp @@ -34,11 +34,11 @@ ewol::widget::ColorChooser::ColorChooser() : ewol::widget::Sizer(ewol::widget::Sizer::modeVert) { addObjectType("ewol::widget::ColorChooser"); addEventId(eventChange); - m_widgetColorBar = NULL; - m_widgetRed = NULL; - m_widgetGreen = NULL; - m_widgetBlue = NULL; - m_widgetAlpha = NULL; + m_widgetColorBar = nullptr; + m_widgetRed = nullptr; + m_widgetGreen = nullptr; + m_widgetBlue = nullptr; + m_widgetAlpha = nullptr; lockExpand(bvec2(true,true)); m_widgetColorBar = new ewol::widget::ColorBar(); m_widgetColorBar->registerOnEvent(this, "change", eventColorBarHasChange); @@ -98,19 +98,19 @@ ewol::widget::ColorChooser::~ColorChooser() { void ewol::widget::ColorChooser::setColor(etk::Color<> _newColor) { m_currentColor = _newColor; - if (NULL != m_widgetRed) { + if (nullptr != m_widgetRed) { m_widgetRed->setValue(m_currentColor.r()); } - if (NULL != m_widgetGreen) { + if (nullptr != m_widgetGreen) { m_widgetGreen->setValue(m_currentColor.g()); } - if (NULL != m_widgetBlue) { + if (nullptr != m_widgetBlue) { m_widgetBlue->setValue(m_currentColor.b()); } - if (NULL != m_widgetAlpha) { + if (nullptr != m_widgetAlpha) { m_widgetAlpha->setValue(m_currentColor.a()); } - if (NULL != m_widgetColorBar) { + if (nullptr != m_widgetColorBar) { m_widgetColorBar->setCurrentColor(m_currentColor); } } @@ -122,7 +122,7 @@ etk::Color<> ewol::widget::ColorChooser::getColor() { void ewol::widget::ColorChooser::onReceiveMessage(const ewol::object::Message& _msg) { - if (NULL == _msg.getCaller()) { + if (nullptr == _msg.getCaller()) { return; } //EWOL_INFO("Receive Extern Event ... : widgetPointer=" << CallerObject << "\"" << eventId << "\" == > data=\"" << data << "\"" ); @@ -130,20 +130,20 @@ void ewol::widget::ColorChooser::onReceiveMessage(const ewol::object::Message& _ // == > colorBar has change ... uint8_t tmpAlpha = m_currentColor.a(); // the colorbar has no notion of the alpha == > keep it ... - if (NULL != m_widgetColorBar) { + if (nullptr != m_widgetColorBar) { m_currentColor = m_widgetColorBar->getCurrentColor(); } m_currentColor.setA(tmpAlpha); - if (NULL != m_widgetRed) { + if (nullptr != m_widgetRed) { m_widgetRed->setValue(m_currentColor.r()); } - if (NULL != m_widgetGreen) { + if (nullptr != m_widgetGreen) { m_widgetGreen->setValue(m_currentColor.g()); } - if (NULL != m_widgetBlue) { + if (nullptr != m_widgetBlue) { m_widgetBlue->setValue(m_currentColor.b()); } - if (NULL != m_widgetAlpha) { + if (nullptr != m_widgetAlpha) { m_widgetAlpha->setValue(m_currentColor.a()); } generateEventId(eventChange, m_currentColor.getString()); @@ -161,7 +161,7 @@ void ewol::widget::ColorChooser::onReceiveMessage(const ewol::object::Message& _ if (_msg.getCaller() == m_widgetAlpha) { m_currentColor.setA(m_widgetAlpha->getValue()); } - if (NULL != m_widgetColorBar) { + if (nullptr != m_widgetColorBar) { m_widgetColorBar->setCurrentColor(m_currentColor); } generateEventId(eventChange, m_currentColor.getString()); diff --git a/sources/ewol/widget/meta/FileChooser.h b/sources/ewol/widget/meta/FileChooser.h index 014a4b97..ca295183 100644 --- a/sources/ewol/widget/meta/FileChooser.h +++ b/sources/ewol/widget/meta/FileChooser.h @@ -30,7 +30,7 @@ namespace ewol { * The first step is to create the file chooser pop-up : * [code style=c++] * ewol::widget::FileChooser* tmpWidget = new ewol::Widget::FileChooser(); - * if (tmpWidget == NULL) { + * if (tmpWidget == nullptr) { * APPL_ERROR("Can not open File chooser !!! "); * return -1; * } @@ -46,7 +46,7 @@ namespace ewol { * //tmpWidget->setFolder("/home/me"); * // add the widget as windows pop-up ... * ewol::widget::Windows* tmpWindows = getWindows(); - * if (tmpWindows == NULL) { + * if (tmpWindows == nullptr) { * APPL_ERROR("Can not get the current windows !!! "); * return -1; * } diff --git a/sources/ewol/widget/meta/Parameter.cpp b/sources/ewol/widget/meta/Parameter.cpp index db1c5fb9..72a78fd1 100644 --- a/sources/ewol/widget/meta/Parameter.cpp +++ b/sources/ewol/widget/meta/Parameter.cpp @@ -29,14 +29,14 @@ static const char * const l_eventMenuSelected = "local-event-menu-selected"; ewol::widget::Parameter::Parameter() : m_currentIdList(0), - m_widgetTitle(NULL), - m_paramList(NULL) { + m_widgetTitle(nullptr), + m_paramList(nullptr) { addObjectType("ewol::widget::Parameter"); addEventId(eventClose); - ewol::widget::Sizer * mySizerVert = NULL; - ewol::widget::Sizer * mySizerHori = NULL; - ewol::widget::Spacer * mySpacer = NULL; + ewol::widget::Sizer * mySizerVert = nullptr; + ewol::widget::Sizer * mySizerHori = nullptr; + ewol::widget::Spacer * mySpacer = nullptr; #ifdef __TARGET_OS__Android setMinSize(ewol::Dimension(vec2(90, 90), ewol::Dimension::Pourcent)); #else @@ -44,7 +44,7 @@ ewol::widget::Parameter::Parameter() : #endif mySizerVert = new ewol::widget::Sizer(widget::Sizer::modeVert); - if (NULL == mySizerVert) { + if (nullptr == mySizerVert) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { EWOL_INFO("add widget"); @@ -54,13 +54,13 @@ ewol::widget::Parameter::Parameter() : setSubWidget(mySizerVert); mySizerHori = new ewol::widget::Sizer(widget::Sizer::modeHori); - if (NULL == mySizerHori) { + if (nullptr == mySizerHori) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { mySizerVert->subWidgetAdd(mySizerHori); mySpacer = new ewol::widget::Spacer(); - if (NULL == mySpacer) { + if (nullptr == mySpacer) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { mySpacer->setExpand(bvec2(true,false)); @@ -68,7 +68,7 @@ ewol::widget::Parameter::Parameter() : } ewol::widget::Button* tmpButton = new widget::Button(); - if (NULL == tmpButton) { + if (nullptr == tmpButton) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { tmpButton->setSubWidget( @@ -84,7 +84,7 @@ ewol::widget::Parameter::Parameter() : } mySpacer = new ewol::widget::Spacer(); - if (NULL == mySpacer) { + if (nullptr == mySpacer) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { mySpacer->setExpand(bvec2(false,false)); @@ -93,7 +93,7 @@ ewol::widget::Parameter::Parameter() : } tmpButton = new ewol::widget::Button(); - if (NULL == tmpButton) { + if (nullptr == tmpButton) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { tmpButton->setSubWidget( @@ -110,13 +110,13 @@ ewol::widget::Parameter::Parameter() : } mySizerHori = new ewol::widget::Sizer(widget::Sizer::modeHori); - if (NULL == mySizerHori) { + if (nullptr == mySizerHori) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { mySizerVert->subWidgetAdd(mySizerHori); m_paramList = new ewol::widget::ParameterList(); - if (NULL == m_paramList) { + if (nullptr == m_paramList) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { @@ -126,7 +126,7 @@ ewol::widget::Parameter::Parameter() : mySizerHori->subWidgetAdd(m_paramList.get()); } mySpacer = new ewol::widget::Spacer(); - if (NULL == mySpacer) { + if (nullptr == mySpacer) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { mySpacer->setFill(bvec2(false,true)); @@ -136,13 +136,13 @@ ewol::widget::Parameter::Parameter() : } ewol::widget::Sizer * mySizerVert2 = new widget::Sizer(widget::Sizer::modeVert); - if (NULL == mySizerVert2) { + if (nullptr == mySizerVert2) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { mySizerHori->subWidgetAdd(mySizerVert2); mySpacer = new ewol::widget::Spacer(); - if (NULL == mySpacer) { + if (nullptr == mySpacer) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { mySpacer->setExpand(bvec2(true,false)); @@ -152,7 +152,7 @@ ewol::widget::Parameter::Parameter() : } m_wSlider = new ewol::widget::WSlider(); - if (NULL == m_wSlider) { + if (nullptr == m_wSlider) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { m_wSlider->setTransitionSpeed(0.5); @@ -164,7 +164,7 @@ ewol::widget::Parameter::Parameter() : } mySpacer = new ewol::widget::Spacer(); - if (NULL == mySpacer) { + if (nullptr == mySpacer) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { mySpacer->setExpand(bvec2(true,false)); @@ -174,7 +174,7 @@ ewol::widget::Parameter::Parameter() : } m_widgetTitle = new ewol::widget::Label("File chooser ..."); - if (NULL == m_widgetTitle) { + if (nullptr == m_widgetTitle) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { m_widgetTitle->setExpand(bvec2(true,false)); @@ -189,7 +189,7 @@ ewol::widget::Parameter::~Parameter() { } void ewol::widget::Parameter::setTitle(std::string _label) { - if (NULL == m_widgetTitle) { + if (nullptr == m_widgetTitle) { return; } m_widgetTitle->setLabel(_label); @@ -207,7 +207,7 @@ void ewol::widget::Parameter::onReceiveMessage(const ewol::object::Message& _msg //ewol::userConfig::Save(); EWOL_TODO("Save Parameter !!! "); } else if (_msg.getMessage() == l_eventMenuSelected) { - if (NULL != m_wSlider) { + if (nullptr != m_wSlider) { int32_t value = 0; sscanf(_msg.getData().c_str(), "%d", &value); EWOL_DEBUG("event on the parameter : " << _msg.getMessage() << " select ID=" << value << ""); @@ -222,26 +222,26 @@ void ewol::widget::Parameter::onObjectRemove(ewol::object::Shared ewol::widget::PopUp::onObjectRemove(_removeObject); // second step find if in all the elements ... if(_removeObject == m_widgetTitle) { - m_widgetTitle = NULL; + m_widgetTitle = nullptr; } if(_removeObject == m_paramList) { - m_paramList = NULL; + m_paramList = nullptr; } if(_removeObject == m_wSlider) { - m_wSlider = NULL; + m_wSlider = nullptr; } } void ewol::widget::Parameter::menuAdd(std::string _label, std::string _image, ewol::object::Shared _associateWidget) { - if (NULL != m_paramList) { + if (nullptr != m_paramList) { m_paramList->menuAdd(_label, m_currentIdList, _image); - if (NULL != m_wSlider) { - if (NULL != _associateWidget) { + if (nullptr != m_wSlider) { + if (nullptr != _associateWidget) { m_wSlider->subWidgetAdd(_associateWidget); } else { EWOL_DEBUG("Associate an empty widget on it ..."); ewol::widget::Label * myLabel = new widget::Label((std::string("No widget for : ") + _label)); - if (NULL == myLabel) { + if (nullptr == myLabel) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { myLabel->setExpand(bvec2(true,true)); @@ -256,21 +256,21 @@ void ewol::widget::Parameter::menuAdd(std::string _label, std::string _image, ew } } void ewol::widget::Parameter::menuAddGroup(std::string _label) { - if (NULL != m_paramList) { + if (nullptr != m_paramList) { m_paramList->menuSeparator(); m_paramList->menuAddGroup(_label); } } void ewol::widget::Parameter::menuClear() { - if (NULL != m_paramList) { + if (nullptr != m_paramList) { m_paramList->menuClear(); m_currentIdList = 0; } } void ewol::widget::Parameter::menuSeparator() { - if (NULL != m_paramList) { + if (nullptr != m_paramList) { m_paramList->menuSeparator(); } } diff --git a/sources/ewol/widget/meta/ParameterList.cpp b/sources/ewol/widget/meta/ParameterList.cpp index 7cec54f5..c50ece50 100644 --- a/sources/ewol/widget/meta/ParameterList.cpp +++ b/sources/ewol/widget/meta/ParameterList.cpp @@ -39,7 +39,7 @@ ewol::widget::ParameterList::~ParameterList() { //clean all the object for (size_t iii=0; iiidraw(); } } @@ -141,7 +141,7 @@ void ewol::widget::ParameterList::onRegenerateDisplay() { for (int32_t iii=startRaw; iii fg(0x000000FF); - if (m_list[iii] != NULL) { + if (m_list[iii] != nullptr) { myTextToWrite = m_list[iii]->m_label; } @@ -187,7 +187,7 @@ bool ewol::widget::ParameterList::onEventInput(const ewol::event::Input& _event) int32_t rawID = (relativePos.y()+m_originScrooled.y()) / (minHeight + 2*m_paddingSizeY); // generate an event on a rawId if the element request change and Select it ... if (rawID >= 0 && (size_t)rawID < m_list.size()) { - if (m_list[rawID]!=NULL) { + if (m_list[rawID]!=nullptr) { if (m_list[rawID]->m_refId >= 0) { generateEventId(eventSelect, std::to_string(m_list[rawID]->m_refId)); m_idSelected = rawID; @@ -210,7 +210,7 @@ void ewol::widget::ParameterList::onLostFocus() { void ewol::widget::ParameterList::menuAdd(std::string& _label, int32_t _refId, std::string& _image) { ewol::widget::elementPL* tmpEmement = new widget::elementPL(_label, _refId, _image, false); - if (NULL != tmpEmement) { + if (nullptr != tmpEmement) { m_list.push_back(tmpEmement); if (m_idSelected == -1 && _label != "---" && _refId>0) { m_idSelected = m_list.size()-1; @@ -222,7 +222,7 @@ void ewol::widget::ParameterList::menuAdd(std::string& _label, int32_t _refId, s void ewol::widget::ParameterList::menuAddGroup(std::string& _label) { std::string image = ""; ewol::widget::elementPL* tmpEmement = new widget::elementPL(_label, -1, image, true); - if (NULL != tmpEmement) { + if (nullptr != tmpEmement) { m_list.push_back(tmpEmement); markToRedraw(); } @@ -231,9 +231,9 @@ void ewol::widget::ParameterList::menuAddGroup(std::string& _label) { void ewol::widget::ParameterList::menuClear() { m_idSelected = -1; for (size_t iii=0; iiisetLabel(_text); @@ -85,7 +85,7 @@ void ewol::widget::StdPopUp::setTitle(const std::string& _text) { } void ewol::widget::StdPopUp::setComment(const std::string& _text) { - if (m_comment == NULL) { + if (m_comment == nullptr) { return; } m_comment->setLabel(_text); @@ -93,14 +93,14 @@ void ewol::widget::StdPopUp::setComment(const std::string& _text) { } ewol::object::Shared ewol::widget::StdPopUp::addButton(const std::string& _text, bool _autoExit) { - if (m_subBar == NULL) { + if (m_subBar == nullptr) { EWOL_ERROR("button-bar does not existed ..."); - return NULL; + return nullptr; } ewol::widget::Button* myButton = new widget::Button(); - if (myButton == NULL) { + if (myButton == nullptr) { EWOL_ERROR("Can not allocate new button ..."); - return NULL; + return nullptr; } myButton->setSubWidget(new ewol::widget::Label(_text)); if(_autoExit == true) { @@ -115,17 +115,17 @@ void ewol::widget::StdPopUp::onObjectRemove(ewol::object::Shared _ // call parent: ewol::widget::PopUp::onObjectRemove(_removeObject); if (_removeObject == m_subBar) { - m_subBar = NULL; + m_subBar = nullptr; markToRedraw(); return; } if (_removeObject == m_comment) { - m_comment = NULL; + m_comment = nullptr; markToRedraw(); return; } if (_removeObject == m_title) { - m_title = NULL; + m_title = nullptr; markToRedraw(); return; }