From b9a1c026fabb31941f481df441138f90d358657e Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Thu, 3 Jul 2014 21:03:26 +0200 Subject: [PATCH] [DEV] remove etk_min and etk_max & etk::Color<> interface --- sources/appl/Buffer.cpp | 7 ++++--- sources/appl/Buffer.h | 4 ++-- sources/appl/Gui/TextViewer.cpp | 8 ++++---- sources/tag | 6 +----- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/sources/appl/Buffer.cpp b/sources/appl/Buffer.cpp index ef6d87c..99e7d9f 100644 --- a/sources/appl/Buffer.cpp +++ b/sources/appl/Buffer.cpp @@ -8,6 +8,7 @@ #include +#include #include #include #include @@ -871,7 +872,7 @@ void appl::Buffer::cleanHighLight() { appl::HighlightInfo* appl::Buffer::getElementColorAtPosition(int64_t _pos, int64_t &_starPos) { - int32_t start = etk_max(0, _starPos-1); + int32_t start = std::max((int64_t)0, _starPos-1); for (size_t iii = start; iii < m_HLDataPass1.size(); ++iii) { _starPos = iii; if ( m_HLDataPass1[iii].beginStart <= _pos @@ -909,7 +910,7 @@ void appl::Buffer::hightlightGenerateLines(appl::DisplayHLData& _MData, const ap endSearch = m_HLDataPass1.size(); } int64_t kkk; - for (kkk = etk_max(startId, 0); kkk < endSearch; ++kkk) { + for (kkk = std::max(startId, (int64_t)0); kkk < endSearch; ++kkk) { // empty section : if (kkk == 0) { if (HLStartPos < m_HLDataPass1[kkk].beginStart) { @@ -961,7 +962,7 @@ void appl::Buffer::hightlightGenerateLines(appl::DisplayHLData& _MData, const ap appl::HighlightInfo* appl::Buffer::getElementColorAtPosition(appl::DisplayHLData& _MData, int64_t _pos) { - int64_t start = etk_max(0, _MData.posHLPass2-1); + int64_t start = std::max((int64_t)0, _MData.posHLPass2-1); for (int64_t iii=start; iii<(int32_t)_MData.HLData.size(); iii++) { _MData.posHLPass2 = iii; if( _MData.HLData[iii].beginStart <= _pos diff --git a/sources/appl/Buffer.h b/sources/appl/Buffer.h index c3894c9..cc746a6 100644 --- a/sources/appl/Buffer.h +++ b/sources/appl/Buffer.h @@ -381,14 +381,14 @@ namespace appl { * @return position of the start selection. */ int64_t getStartSelectionPos() { - return etk_min(m_cursorPos, m_cursorSelectPos); + return std::min(m_cursorPos, m_cursorSelectPos); } /** * @brief Get the Stop position of the selection. * @return position of the stop selection. */ int64_t getStopSelectionPos() { - return etk_max(m_cursorPos, m_cursorSelectPos); + return std::max(m_cursorPos, m_cursorSelectPos); } protected: float m_cursorPreferredCol; //!< position of the cursor when up and down is done. diff --git a/sources/appl/Gui/TextViewer.cpp b/sources/appl/Gui/TextViewer.cpp index 3069ef5..546442b 100644 --- a/sources/appl/Gui/TextViewer.cpp +++ b/sources/appl/Gui/TextViewer.cpp @@ -138,7 +138,7 @@ void appl::TextViewer::onRegenerateDisplay() { vec3 tmpCursorPosition(0, 0, -1); float tmpCursorLenght = -1.0; // real display ... - m_displayText.setColor(etk::Color<>(0, 0, 0, 256)); + m_displayText.setColor(etk::Color<>(0, 0, 0, 255)); float countNbLine = 1; int32_t countColomn = 0; // the siplay string : @@ -220,12 +220,12 @@ void appl::TextViewer::onRegenerateDisplay() { if (*it == u32char::Return) { countNbLine += 1; countColomn = 0; - maxSizeX = etk_max(m_displayText.getPos().x(), maxSizeX); + maxSizeX = std::max(m_displayText.getPos().x(), maxSizeX); // Display the end line position only if we have the focus ... if (DisplayCursorAndSelection == true) { if (it >= selectPosStart && it < selectPosStop) { ewol::compositing::Drawing& draw = m_displayText.getDrawing(); - draw.setColor(etk::Color<>(0xFF0000FF)); + draw.setColor(etk::Color<>(0xFF, 0x00, 0x00, 0xFF)); draw.setPos(m_displayText.getPos() + tmpLetterSize/4.0f); draw.rectangle(m_displayText.getPos() + tmpLetterSize*3.0f/4.0f); } @@ -281,7 +281,7 @@ void appl::TextViewer::onRegenerateDisplay() { tmpCursorPosition = m_displayText.getPos(); tmpCursorLenght = 5; } - maxSizeX = etk_max(m_displayText.getPos().x(), maxSizeX); + maxSizeX = std::max(m_displayText.getPos().x(), maxSizeX); // Display cursor only if we have the focus ... if ( tmpCursorPosition.z() != -1 && getFocus() == true) { diff --git a/sources/tag b/sources/tag index ca97c40..d67bbfe 100644 --- a/sources/tag +++ b/sources/tag @@ -1,5 +1 @@ -<<<<<<< HEAD -1.1.1 -======= -1.2-dev ->>>>>>> 2939038... [TAG] create 1.2-dev tag +1.2-dev \ No newline at end of file