[DEV] update to the etk normalisation

This commit is contained in:
2013-12-28 14:23:25 +01:00
parent 2fc47723f0
commit db8f379e30
15 changed files with 86 additions and 108 deletions

View File

@@ -89,7 +89,7 @@ void BufferView::insertAlphabetic(appl::dataBufferStruct* _dataStruct, bool _sel
if (m_list[iii] == NULL) {
continue;
}
if (to_lower(m_list[iii]->m_bufferName.getNameFile()) > to_lower(_dataStruct->m_bufferName.getNameFile())) {
if (std::tolower(m_list[iii]->m_bufferName.getNameFile()) > std::tolower(_dataStruct->m_bufferName.getNameFile())) {
m_list.insert(m_list.begin() + iii, _dataStruct);
_dataStruct = NULL;
if (_selectNewPosition == true) {

View File

@@ -386,10 +386,10 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
m_bufferManager->open(_msg.getData());
} else if (_msg.getMessage() == ednMsgGuiSave) {
APPL_DEBUG("Request saving the file : " << _msg.getData());
if (to_lower(_msg.getData()) == "current") {
if (std::tolower(_msg.getData()) == "current") {
appl::WorkerSaveFile* tmpWorker = new appl::WorkerSaveFile("", false);
return;
} else if (to_lower(_msg.getData()) == "all") {
} else if (std::tolower(_msg.getData()) == "all") {
appl::WorkerSaveAllFile* tmpWorker = new appl::WorkerSaveAllFile();
return;
} else {

View File

@@ -136,11 +136,11 @@ void Search::onReceiveMessage(const ewol::object::Message& _msg) {
replace();
find();
} else if ( _msg.getMessage() == l_eventCaseCb) {
m_caseSensitive = stobool(_msg.getData());
m_caseSensitive = std::stob(_msg.getData());
} else if ( _msg.getMessage() == l_eventWrapCb) {
m_wrap = stobool(_msg.getData());
m_wrap = std::stob(_msg.getData());
} else if ( _msg.getMessage() == l_eventForwardCb) {
m_forward = stobool(_msg.getData());
m_forward = std::stob(_msg.getData());
} else if ( _msg.getMessage() == l_eventHideBt) {
hide();
} else if ( _msg.getMessage() == ednMsgGuiSearch) {

View File

@@ -146,7 +146,7 @@ void appl::TextViewer::onRegenerateDisplay(void) {
for (startingIt = m_buffer->begin();
(bool)startingIt == true;
++startingIt) {
if (*startingIt == etk::UChar::Return) {
if (*startingIt == u32char::Return) {
++startLineId;
m_displayText.forceLineReturn();
if (m_size.y() >= m_displayText.getPos().y()) {
@@ -206,7 +206,7 @@ void appl::TextViewer::onRegenerateDisplay(void) {
}
//APPL_DEBUG("display element '" << currentValue << "'at pos : " << m_displayText.getPos() );
//APPL_DEBUG(" element size : " << iii << " : " << bufferElementSize);
if (*it == etk::UChar::Return) {
if (*it == u32char::Return) {
countNbLine += 1;
countColomn = 0;
maxSizeX = etk_max(m_displayText.getPos().x(), maxSizeX);
@@ -245,9 +245,9 @@ void appl::TextViewer::onRegenerateDisplay(void) {
m_displayText.setColor((*m_paintingProperties)[m_colorNormal].getForeground());
}
if (haveBackground == false) {
if (*it == etk::UChar::Space) {
if (*it == u32char::Space) {
m_displayText.setColorBg((*m_paintingProperties)[m_colorSpace].getForeground());
} else if (*it == etk::UChar::Tabulation) {
} else if (*it == u32char::Tabulation) {
m_displayText.setColorBg((*m_paintingProperties)[m_colorTabulation].getForeground());
}
}
@@ -317,11 +317,11 @@ bool appl::TextViewer::onEventEntry(const ewol::event::Entry& _event) {
return false;
}
char32_t localValue = _event.getChar();
if (localValue == etk::UChar::Return) {
if (localValue == u32char::Return) {
if (true == _event.getSpecialKey().getShift()) {
localValue = etk::UChar::CarrierReturn;
localValue = u32char::CarrierReturn;
}
} else if (localValue == etk::UChar::Suppress ) {
} else if (localValue == u32char::Suppress ) {
//APPL_INFO("keyEvent : <suppr> pos=" << m_cursorPos);
if (m_buffer->hasTextSelected()) {
remove();
@@ -332,7 +332,7 @@ bool appl::TextViewer::onEventEntry(const ewol::event::Entry& _event) {
replace("", pos, posEnd);
}
return true;
} else if (localValue == etk::UChar::Delete) {
} else if (localValue == u32char::Delete) {
//APPL_INFO("keyEvent : <del> pos=" << m_cursorPos);
if (m_buffer->hasTextSelected()) {
remove();
@@ -347,7 +347,7 @@ bool appl::TextViewer::onEventEntry(const ewol::event::Entry& _event) {
m_buffer->setSelectMode(false);
// normal adding char ...
char output[5];
int32_t nbElement = etk::getUtf8(localValue, output);
int32_t nbElement = u32char::convertUtf8(localValue, output);
if ( m_buffer->hasTextSelected() == false
&& _event.getSpecialKey().getInsert() == true) {
appl::Buffer::Iterator pos = m_buffer->cursor();
@@ -560,14 +560,14 @@ appl::Buffer::Iterator appl::TextViewer::getMousePosition(const vec2& _relativeP
(bool)it == true;
++it) {
currentValue = *it;
if (currentValue == etk::UChar::Return) {
if (currentValue == u32char::Return) {
m_displayText.forceLineReturn();
countColomn = 0;
} else {
if (-_relativePos.y() >= positionCurentDisplay.y()) {
m_buffer->expand(countColomn, currentValue, stringToDisplay);
for (size_t kkk=0; kkk<stringToDisplay.size(); ++kkk) {
if (stringToDisplay[kkk] == etk::UChar::Return) {
if (stringToDisplay[kkk] == u32char::Return) {
m_displayText.forceLineReturn();
countColomn = 0;
} else {
@@ -939,7 +939,7 @@ appl::Buffer::Iterator appl::TextViewer::getPosSize(const appl::Buffer::Iterator
currentValue = *it;
m_buffer->expand(countColomn, currentValue, stringToDisplay);
for (size_t kkk=0; kkk<stringToDisplay.size(); ++kkk) {
if (stringToDisplay[kkk] == etk::UChar::Return) {
if (stringToDisplay[kkk] == u32char::Return) {
return it;
} else {
m_displayText.print(stringToDisplay[kkk]);
@@ -968,7 +968,7 @@ float appl::TextViewer::getScreenSize(const appl::Buffer::Iterator& _startLinePo
//APPL_DEBUG("parse : " << currentValue);
m_buffer->expand(countColomn, currentValue, stringToDisplay);
for (size_t kkk=0; kkk<stringToDisplay.size(); ++kkk) {
if (stringToDisplay[kkk] == etk::UChar::Return) {
if (stringToDisplay[kkk] == u32char::Return) {
return m_displayText.getPos().x() + 2; // TODO : Add the +2 for the end of line ...
} else {
m_displayText.print(stringToDisplay[kkk]);

View File

@@ -83,7 +83,7 @@ namespace appl {
bool replace(const std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd);
bool replace(const std::string& _data);
bool replace(const std::u32string& _data) {
return replace(to_u8string(_data));
return replace(std::to_string(_data));
}
/**
* @brief Remove selected data ...