[DEV] UniChar ==> UChar & Hach ==> Hash

This commit is contained in:
Edouard DUPIN 2013-10-18 21:15:02 +02:00
parent 16f78eaef2
commit cf8a720924
10 changed files with 89 additions and 89 deletions

View File

@ -36,7 +36,7 @@ void appl::Buffer::setFileName(const etk::UString& _name) {
}
void appl::Buffer::moveCursorRight(appl::Buffer::moveMode _mode) {
etk::UniChar value;
etk::UChar value;
esize_t nbElement;
switch (_mode) {
default:
@ -59,7 +59,7 @@ void appl::Buffer::moveCursorRight(appl::Buffer::moveMode _mode) {
}
void appl::Buffer::moveCursorLeft(appl::Buffer::moveMode _mode) {
etk::UniChar value;
etk::UChar value;
esize_t nbElement;
switch (_mode) {
default:
@ -129,7 +129,7 @@ void appl::Buffer::moveCursorDown(esize_t _nbLine, ewol::Text& _textDrawer) {
esize_t appl::Buffer::startLine(esize_t _pos) {
esize_t startPos;
if (false == searchBack(_pos, etk::UniChar::Return, startPos)) {
if (false == searchBack(_pos, etk::UChar::Return, startPos)) {
return 0;
}
return startPos + 1;
@ -137,16 +137,16 @@ esize_t appl::Buffer::startLine(esize_t _pos) {
esize_t appl::Buffer::endLine(esize_t _pos) {
esize_t endPos;
if (false == search(_pos, etk::UniChar::Return, endPos)) {
if (false == search(_pos, etk::UChar::Return, endPos)) {
endPos = m_data.size();
}
return endPos;
}
bool appl::Buffer::search(esize_t _pos, const etk::UniChar& _search, esize_t& _result) {
bool appl::Buffer::search(esize_t _pos, const etk::UChar& _search, esize_t& _result) {
// move in the string
esize_t nbElementBuffer = 0;
etk::UniChar value;
etk::UChar value;
for(esize_t iii=_pos ; iii<m_data.size() ; iii+=nbElementBuffer ) {
nbElementBuffer = get(iii, value);
if (value == _search) {
@ -161,10 +161,10 @@ bool appl::Buffer::search(esize_t _pos, const etk::UniChar& _search, esize_t& _r
return false;
}
bool appl::Buffer::searchBack(esize_t _pos, const etk::UniChar& _search, esize_t& _result) {
bool appl::Buffer::searchBack(esize_t _pos, const etk::UChar& _search, esize_t& _result) {
// move in the string
esize_t nbElementBuffer = 0;
etk::UniChar value;
etk::UChar value;
for(esize_t iii=_pos-1 ; iii >= 0 ; iii-=nbElementBuffer ) {
nbElementBuffer = getBack(iii, value);
if (value == _search) {
@ -188,8 +188,8 @@ bool appl::Buffer::onEventEntry(const ewol::EventEntry& _event, ewol::Text& _tes
if (_event.getStatus() != ewol::keyEvent::statusDown) {
return false;
}
etk::UniChar localValue = _event.getChar();
if (localValue == etk::UniChar::Tabulation) {
etk::UChar localValue = _event.getChar();
if (localValue == etk::UChar::Tabulation) {
if (hasTextSelected()) {
// TODO : Special tabulation multiline indentation ...
/*
@ -204,9 +204,9 @@ bool appl::Buffer::onEventEntry(const ewol::EventEntry& _event, ewol::Text& _tes
*/
return true;
}
} else if (localValue == etk::UniChar::Return) {
} else if (localValue == etk::UChar::Return) {
if (true == _event.getSpecialKey().isSetShift()) {
localValue = etk::UniChar::CarrierReturn;
localValue = etk::UChar::CarrierReturn;
} else {
/*
m_data.insert(m_cursorPos, '\n');
@ -234,7 +234,7 @@ bool appl::Buffer::onEventEntry(const ewol::EventEntry& _event, ewol::Text& _tes
return true;
*/
}
} else if (localValue == etk::UniChar::Suppress ) {
} else if (localValue == etk::UChar::Suppress ) {
//APPL_INFO("keyEvent : <suppr> pos=" << m_cursorPos);
if (hasTextSelected()) {
esize_t startPos = getStartSelectionPos();
@ -243,14 +243,14 @@ bool appl::Buffer::onEventEntry(const ewol::EventEntry& _event, ewol::Text& _tes
m_selectMode = false;
moveCursor(startPos);
} else {
etk::UniChar value;
etk::UChar value;
esize_t nbElement = get(m_cursorPos, value);
if (nbElement>0) {
m_data.remove(m_cursorPos, nbElement);
}
}
return true;
} else if (localValue == etk::UniChar::Delete) {
} else if (localValue == etk::UChar::Delete) {
//APPL_INFO("keyEvent : <del> pos=" << m_cursorPos);
if (hasTextSelected()) {
esize_t startPos = getStartSelectionPos();
@ -259,7 +259,7 @@ bool appl::Buffer::onEventEntry(const ewol::EventEntry& _event, ewol::Text& _tes
m_selectMode = false;
moveCursor(startPos);
} else {
etk::UniChar value;
etk::UChar value;
esize_t nbElement = getBack(m_cursorPos-1, value);
if (nbElement>0) {
m_data.remove(m_cursorPos-nbElement, nbElement);
@ -282,7 +282,7 @@ bool appl::Buffer::onEventEntry(const ewol::EventEntry& _event, ewol::Text& _tes
if (_event.getSpecialKey().isSetInsert() == false) {
m_data.insert(m_cursorPos, (int8_t*)output, nbElement);
} else {
etk::UniChar value;
etk::UChar value;
esize_t nbElementRemove = get(m_cursorPos, value);
m_data.replace(m_cursorPos, nbElementRemove, (int8_t*)output, nbElement);
}
@ -410,10 +410,10 @@ void appl::Buffer::moveCursor(esize_t _pos) {
bool appl::Buffer::selectAround(int32_t _startPos, int32_t &_beginPos, int32_t &_endPos) {
esize_t bufferElementSize;
esize_t previousElementSize;
etk::UniChar currentValue;
etk::UChar currentValue;
get(_startPos, currentValue);
if ( currentValue == etk::UniChar::Tabulation
|| currentValue == etk::UniChar::Space) {
if ( currentValue == etk::UChar::Tabulation
|| currentValue == etk::UChar::Space) {
APPL_DEBUG("select spacer");
// special case we are looking for separation
for (_beginPos=_startPos;
@ -421,8 +421,8 @@ bool appl::Buffer::selectAround(int32_t _startPos, int32_t &_beginPos, int32_t &
previousElementSize = bufferElementSize,
_beginPos-=bufferElementSize) {
bufferElementSize = getBack(_beginPos, currentValue);
if ( currentValue != etk::UniChar::Tabulation
&& currentValue != etk::UniChar::Space) {
if ( currentValue != etk::UChar::Tabulation
&& currentValue != etk::UChar::Space) {
_beginPos += previousElementSize;
break;
}
@ -432,8 +432,8 @@ bool appl::Buffer::selectAround(int32_t _startPos, int32_t &_beginPos, int32_t &
_endPos<m_data.size();
_endPos+=bufferElementSize) {
bufferElementSize = get(_endPos, currentValue);
if ( currentValue != etk::UniChar::Tabulation
&& currentValue != etk::UniChar::Space) {
if ( currentValue != etk::UChar::Tabulation
&& currentValue != etk::UChar::Space) {
break;
}
}
@ -464,7 +464,7 @@ bool appl::Buffer::selectAround(int32_t _startPos, int32_t &_beginPos, int32_t &
}
return true;
} else {
etk::UniChar comparechar = currentValue;
etk::UChar comparechar = currentValue;
APPL_DEBUG("select same char");
// Search back
for (_beginPos=_startPos;
@ -514,7 +514,7 @@ void appl::Buffer::mouseEventTriple(void) {
esize_t appl::Buffer::getPosSize(esize_t _startLinePos, float _distance, ewol::Text& _textDrawer)
{
esize_t bufferElementSize;
etk::UniChar currentValue;
etk::UChar currentValue;
esize_t countColomn = 0;
etk::UString stringToDisplay;
_textDrawer.clear();
@ -531,7 +531,7 @@ esize_t appl::Buffer::getPosSize(esize_t _startLinePos, float _distance, ewol::T
//APPL_DEBUG("display : '" << currentValue << "' == > '" << stringToDisplay << "'");
//m_displayText.setPos(positionCurentDisplay);
for (esize_t kkk=0; kkk<stringToDisplay.size(); ++kkk) {
if (stringToDisplay[kkk] == etk::UniChar::Return) {
if (stringToDisplay[kkk] == etk::UChar::Return) {
return iii;
} else {
_textDrawer.print(stringToDisplay[kkk]);
@ -550,7 +550,7 @@ float appl::Buffer::getScreenSize(esize_t _startLinePos, esize_t _stopPos, ewol:
{
float ret = 0;
esize_t bufferElementSize;
etk::UniChar currentValue;
etk::UChar currentValue;
esize_t countColomn = 0;
etk::UString stringToDisplay;
_textDrawer.clear();
@ -569,7 +569,7 @@ float appl::Buffer::getScreenSize(esize_t _startLinePos, esize_t _stopPos, ewol:
//APPL_DEBUG("display : '" << currentValue << "' == > '" << stringToDisplay << "'");
//m_displayText.setPos(positionCurentDisplay);
for (esize_t kkk=0; kkk<stringToDisplay.size(); ++kkk) {
if (stringToDisplay[kkk] == etk::UniChar::Return) {
if (stringToDisplay[kkk] == etk::UChar::Return) {
APPL_DEBUG("find \n");
return _textDrawer.getPos().x() + 2; // TODO : Add the +2 for the end of line ...
} else {
@ -587,8 +587,8 @@ float appl::Buffer::getScreenSize(esize_t _startLinePos, esize_t _stopPos, ewol:
esize_t appl::Buffer::getMousePosition(const vec2& _relativePos, ewol::Text& _textDrawer)
{
esize_t bufferElementSize;
etk::UniChar currentValue;
vec3 tmpLetterSize = _textDrawer.calculateSize((etk::UniChar)'A');
etk::UChar currentValue;
vec3 tmpLetterSize = _textDrawer.calculateSize((etk::UChar)'A');
vec3 positionCurentDisplay(0,0,0);
esize_t countColomn = 0;
etk::UString stringToDisplay;
@ -604,7 +604,7 @@ esize_t appl::Buffer::getMousePosition(const vec2& _relativePos, ewol::Text& _te
//APPL_DEBUG("display : '" << currentValue << "' == > '" << stringToDisplay << "'");
//m_displayText.setPos(positionCurentDisplay);
for (esize_t kkk=0; kkk<stringToDisplay.size(); ++kkk) {
if (stringToDisplay[kkk] == etk::UniChar::Return) {
if (stringToDisplay[kkk] == etk::UChar::Return) {
// TODO : Remove this, use the automatic line manager ...
_textDrawer.forceLineReturn();
countColomn = 0;
@ -631,7 +631,7 @@ esize_t appl::Buffer::getMousePosition(const vec2& _relativePos, ewol::Text& _te
return m_data.size();
}
esize_t appl::Buffer::get(esize_t _pos, etk::UniChar& _value, unicode::charset_te _charset) const {
esize_t appl::Buffer::get(esize_t _pos, etk::UChar& _value, unicode::charset_te _charset) const {
_value = '\0';
if (_pos<0 && _pos<m_data.size()) {
return 0;
@ -640,7 +640,7 @@ esize_t appl::Buffer::get(esize_t _pos, etk::UniChar& _value, unicode::charset_t
char tmpVal[5];
memset(tmpVal, 0, sizeof(tmpVal));
tmpVal[0] = m_data[_pos];
int8_t nbChar = etk::UniChar::theoricUTF8Len(tmpVal[0]);
int8_t nbChar = etk::UChar::theoricUTF8Len(tmpVal[0]);
for (int32_t iii=1; iii<nbChar && _pos+iii<m_data.size(); ++iii) {
tmpVal[iii] = m_data[_pos+iii];
}
@ -653,7 +653,7 @@ esize_t appl::Buffer::get(esize_t _pos, etk::UniChar& _value, unicode::charset_t
return 1;
}
esize_t appl::Buffer::getBack(esize_t _pos, etk::UniChar& _value, unicode::charset_te _charset) const {
esize_t appl::Buffer::getBack(esize_t _pos, etk::UChar& _value, unicode::charset_te _charset) const {
_value = '\0';
if (_pos<0 && _pos<m_data.size()) {
return 0;
@ -664,7 +664,7 @@ esize_t appl::Buffer::getBack(esize_t _pos, etk::UniChar& _value, unicode::chars
memset(tmpVal, 0, sizeof(tmpVal));
*pointerVal = m_data[_pos];
int32_t iii=0;
while( etk::UniChar::theoricUTF8First(*pointerVal) == false
while( etk::UChar::theoricUTF8First(*pointerVal) == false
&& pointerVal > tmpVal
&& _pos-iii>0) {
--pointerVal;
@ -683,46 +683,46 @@ static const char *ControlCodeTable[32] = {
"NUL", "soh", "stx", "etx", "eot", "enq", "ack", "bel", "bs", "ht", "nl", "vt", "np", "cr", "so", "si",
"dle", "dc1", "dc2", "dc3", "dc4", "nak", "syn", "etb", "can", "em", "sub", "esc", "fs", "gs", "rs", "us"};
void appl::Buffer::expand(esize_t& _indent, const etk::UniChar& _value, etk::UString& _out) const {
void appl::Buffer::expand(esize_t& _indent, const etk::UChar& _value, etk::UString& _out) const {
_out.clear();
int32_t tabDist = 4;
if (_value == etk::UniChar::Tabulation) {
if (_value == etk::UChar::Tabulation) {
int32_t nSpaces = tabDist - (_indent % tabDist);
for (int32_t iii=0; iii<nSpaces; iii++) {
_out.append(etk::UniChar::Space);
_out.append(etk::UChar::Space);
}
return;
}
// convert ASCII control codes to readable character sequences
if (_value == etk::UniChar::Null) {
_out.append(etk::UniChar('<'));
_out.append(etk::UniChar('n'));
_out.append(etk::UniChar('u'));
_out.append(etk::UniChar('l'));
_out.append(etk::UniChar('>'));
if (_value == etk::UChar::Null) {
_out.append(etk::UChar('<'));
_out.append(etk::UChar('n'));
_out.append(etk::UChar('u'));
_out.append(etk::UChar('l'));
_out.append(etk::UChar('>'));
return;
}
if (_value == etk::UniChar::Return) {
if (_value == etk::UChar::Return) {
// nothing to display...
_out.append(etk::UniChar::Return);
_out.append(etk::UChar::Return);
return;
}
if (_value.get() <= 31) {
_out.append(etk::UniChar('<'));
_out.append(etk::UChar('<'));
const char * tmp = ControlCodeTable[_value.get()];
while (*tmp!='\0') {
_out.append(etk::UniChar(*tmp));
_out.append(etk::UChar(*tmp));
tmp++;
}
_out.append(etk::UniChar('>'));
_out.append(etk::UChar('>'));
return;
}
if (_value == etk::UniChar::Delete) {
_out.append(etk::UniChar('<'));
_out.append(etk::UniChar('d'));
_out.append(etk::UniChar('e'));
_out.append(etk::UniChar('l'));
_out.append(etk::UniChar('>'));
if (_value == etk::UChar::Delete) {
_out.append(etk::UChar('<'));
_out.append(etk::UChar('d'));
_out.append(etk::UChar('e'));
_out.append(etk::UChar('l'));
_out.append(etk::UChar('>'));
return;
}
// nothing to do ...
@ -735,7 +735,7 @@ int32_t appl::Buffer::countDispChars(esize_t _posStart, esize_t _posEnd) {
int32_t charCount = 0;
etk::UString expanded;
esize_t bufferElementSize;
etk::UniChar value;
etk::UChar value;
//APPL_DEBUG("_posStart="<< _posStart << " _posEnd=" << _posEnd);
for(int32_t iii=_posStart; iii<_posEnd && iii<m_data.size() ; iii+=bufferElementSize ) {
// get the element value:
@ -756,12 +756,12 @@ esize_t appl::Buffer::countForwardDispChars(esize_t _posStart, int32_t _nChars)
int32_t charCount = 0;
etk::UString expanded;
esize_t bufferElementSize;
etk::UniChar value;
etk::UChar value;
int32_t iii;
for(iii = _posStart; charCount<_nChars && iii<m_data.size() ; iii+=bufferElementSize ) {
// get the element value:
bufferElementSize = get(iii, value);
if (value == etk::UniChar::Return) {
if (value == etk::UChar::Return) {
return iii;
}
expand(charCount, value, expanded);
@ -781,13 +781,13 @@ esize_t appl::Buffer::countForwardNLines(esize_t _startPos, int32_t _nLines) {
return m_data.size();
}
esize_t bufferElementSize;
etk::UniChar value;
etk::UChar value;
int32_t lineCount = 0;
//APPL_INFO("startPos=" << startPos << " nLines=" << nLines);
for(int32_t iii = _startPos+1; iii<m_data.size() ; iii+=bufferElementSize ) {
// get the element value:
bufferElementSize = get(iii, value);
if (value == etk::UniChar::Return) {
if (value == etk::UChar::Return) {
lineCount++;
if (lineCount == _nLines) {
//APPL_INFO(" == > (1) at position=" << myPosIt.Position()+1 );
@ -810,12 +810,12 @@ esize_t appl::Buffer::countBackwardNLines(esize_t _startPos, int32_t _nLines) {
}
//APPL_INFO("startPos=" << startPos << " nLines=" << nLines);
esize_t bufferElementSize;
etk::UniChar value;
etk::UChar value;
int32_t lineCount = 0;
for(int32_t iii = _startPos-1; iii >= 0 ; iii-=bufferElementSize ) {
// get the element value:
bufferElementSize = getBack(iii, value);
if (value == etk::UniChar::Return) {
if (value == etk::UChar::Return) {
lineCount++;
if (lineCount >= _nLines) {
//APPL_INFO(" == > (1) at position=" << myPosIt.Position()+1 );
@ -838,7 +838,7 @@ bool appl::Buffer::copy(etk::UString& _data) {
esize_t startPos = getStartSelectionPos();
esize_t endPos = getStopSelectionPos();
esize_t bufferElementSize;
etk::UniChar value;
etk::UChar value;
for(int32_t iii = startPos; iii < endPos ; iii+=bufferElementSize ) {
// get the element value:
bufferElementSize = get(iii, value);

View File

@ -109,7 +109,7 @@ namespace appl {
* @param[in] _charset Charset used to parse the current buffer
* @return number ofelement read in the buffer (to increment the position)
*/
esize_t get(esize_t _pos, etk::UniChar& _value, unicode::charset_te _charset = unicode::EDN_CHARSET_UTF8) const;
esize_t get(esize_t _pos, etk::UChar& _value, unicode::charset_te _charset = unicode::EDN_CHARSET_UTF8) const;
/**
* @brief get the previous element in the buffer.
* @param[in] _pos Position in the buffer (last element of the element)
@ -117,14 +117,14 @@ namespace appl {
* @param[in] _charset Charset used to parse the current buffer
* @return number of element read in the buffer (to increment the position)
*/
esize_t getBack(esize_t _pos, etk::UniChar& _value, unicode::charset_te _charset = unicode::EDN_CHARSET_UTF8) const;
esize_t getBack(esize_t _pos, etk::UChar& _value, unicode::charset_te _charset = unicode::EDN_CHARSET_UTF8) const;
/**
* @brief Expand the specify char to have a user frendly display for special char and tabs
* @param[in] _indent Curent indentation in the line
* @param[in] _value Current value to transform
* @param[out] _out String that represent the curent value to display
*/
void expand(esize_t& _indent, const etk::UniChar& _value, etk::UString& _out) const;
void expand(esize_t& _indent, const etk::UChar& _value, etk::UString& _out) const;
private:
enum moveMode {
moveLetter,
@ -170,7 +170,7 @@ namespace appl {
* @param[out] _result Research position.
* @return true if pos if fined.
*/
bool search(esize_t _pos, const etk::UniChar& _search, esize_t& _result);
bool search(esize_t _pos, const etk::UChar& _search, esize_t& _result);
/**
* @brief Search a character in the buffer in back mode.
* @param[in] _pos Position to start the search of the element.
@ -178,7 +178,7 @@ namespace appl {
* @param[out] _result Research position.
* @return true if pos if fined.
*/
bool searchBack(esize_t _pos, const etk::UniChar& _search, esize_t& _result);
bool searchBack(esize_t _pos, const etk::UChar& _search, esize_t& _result);
/**
* @brief Count the number of displayed characters between buffer position
* displayed characters are the characters shown on the screen to represent characters in the

View File

@ -310,7 +310,7 @@ int32_t BufferText::display(ewol::Text& OOText,
bool selIsRect;
int32_t selHave;
vec3 tmpLetterSize = OOText.calculateSize((uniChar_t)'A');
vec3 tmpLetterSize = OOText.calculateSize((etk::UChar)'A');
int32_t letterWidth = tmpLetterSize.x();
int32_t letterHeight = tmpLetterSize.y();
@ -355,8 +355,8 @@ int32_t BufferText::display(ewol::Text& OOText,
int64_t stopTime = ewol::getTime();
APPL_DEBUG("Parsing Highlight = " << stopTime - startTime << " micro-s");
uniChar_t displayChar[MAX_EXP_CHAR_LEN];
memset(displayChar, 0, sizeof(uniChar_t)*MAX_EXP_CHAR_LEN);
etk::UChar displayChar[MAX_EXP_CHAR_LEN];
memset(displayChar, 0, sizeof(etk::UChar)*MAX_EXP_CHAR_LEN);
etk::UString myStringToDisplay;
// draw the lineNumber :
int32_t currentLineID = displayStartLineId+1;
@ -925,7 +925,7 @@ vec2 BufferText::getPosition(int32_t fontId, bool& centerRequested)
* @return ---
*
*/
void BufferText::addChar(uniChar_t unicodeData)
void BufferText::addChar(etk::UChar unicodeData)
{
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
bool SelectionIsRect;
@ -1049,7 +1049,7 @@ int32_t BufferText::findLine(etk::UString &data)
return 0;
}
APPL_INFO("Search data line : \"" << data << "\"");
etk::Vector<uniChar_t> mVectSearch;
etk::Vector<etk::UChar> mVectSearch;
mVectSearch = data.getVector();
//APPL_INFO("search data Forward : startSearchPos=" << startSearchPos );
/*

View File

@ -95,7 +95,7 @@ class BufferText
int32_t display(ewol::Text& OOText,
int32_t offsetX, int32_t offsetY,
int32_t sizeX, int32_t sizeY);
void addChar(uniChar_t unicodeData);
void addChar(etk::UChar unicodeData);
void cursorMove(ewol::keyEvent::keyboard_te moveTypeEvent);
void MouseSelectFromCursorTo(vec2 pos);
void MouseEvent(vec2 pos);

View File

@ -151,7 +151,7 @@ void EdnBuf::getRange(int32_t start, int32_t end, etk::UString &output)
localOutput.pushBack('\0');
output = (char*)&localOutput[0];
} else {
etk::Vector<uniChar_t> tmpUnicodeData;
etk::Vector<etk::UChar> tmpUnicodeData;
// transform in unicode :
convertIsoToUnicode(m_charsetType, localOutput, tmpUnicodeData);
output = tmpUnicodeData;
@ -247,7 +247,7 @@ int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::UString &insertText)
tmpInsertText.pushBack(*tmpPointer++);
}
} else {
etk::Vector<uniChar_t> tmppp = insertText.getVector();
etk::Vector<etk::UChar> tmppp = insertText.getVector();
convertUnicodeToIso(m_charsetType, tmppp, tmpInsertText);
}
if (tmpInsertText.size()>0) {
@ -544,7 +544,7 @@ int32_t EdnBuf::getExpandedChar(int32_t &pos, int32_t indent, char outUTF8[MAX_E
* @return number of displayable char (display char width)
*
*/
int32_t EdnBuf::getExpandedChar(int32_t &pos, int32_t indent, uniChar_t outUnicode[MAX_EXP_CHAR_LEN], uint32_t &currentChar)
int32_t EdnBuf::getExpandedChar(int32_t &pos, int32_t indent, etk::UChar outUnicode[MAX_EXP_CHAR_LEN], uint32_t &currentChar)
{
int32_t i, nSpaces;
char c = m_data.get(pos);
@ -601,7 +601,7 @@ int32_t EdnBuf::getExpandedChar(int32_t &pos, int32_t indent, uniChar_t outUnico
return 5;
}
// clear all the data ...
memset(outUnicode, 0, sizeof(uniChar_t)*MAX_EXP_CHAR_LEN);
memset(outUnicode, 0, sizeof(etk::UChar)*MAX_EXP_CHAR_LEN);
// Otherwise, just return the character
if (false == m_isUtf8) {
@ -940,7 +940,7 @@ bool EdnBuf::SearchForward(int32_t startPos, etk::UString &search, int32_t *foun
searchVect.pushBack(*tmpPointer++);
}
} else {
etk::Vector<etk::UniChar> tmppp = search.getVector();
etk::Vector<etk::UChar> tmppp = search.getVector();
convertUnicodeToIso(m_charsetType, tmppp, searchVect);
}
// remove the '\0' at the end of the string ...
@ -996,7 +996,7 @@ bool EdnBuf::SearchBackward(int32_t startPos, etk::UString &search, int32_t *fou
searchVect.pushBack(*tmpPointer++);
}
} else {
etk::Vector<etk::UniChar> tmppp = search.getVector();
etk::Vector<etk::UChar> tmppp = search.getVector();
convertUnicodeToIso(m_charsetType, tmppp, searchVect);
}
// remove the '\0' at the end of the string ...
@ -1147,7 +1147,7 @@ int32_t EdnBuf::LocalInsert(int32_t pos, etk::UString &insertText)
tmpInsertText.pushBack(*tmpPointer++);
}
} else {
etk::Vector<etk::UniChar> tmppp = insertText.getVector();
etk::Vector<etk::UChar> tmppp = insertText.getVector();
convertUnicodeToIso(m_charsetType, tmppp, tmpInsertText);
}
if (tmpInsertText.size()>0) {

View File

@ -77,7 +77,7 @@ class EdnBuf {
int32_t StartOfLine(int32_t _pos);
int32_t EndOfLine(int32_t _pos);
int32_t getExpandedChar(int32_t& _pos, int32_t _indent, uniChar_t _outUnicode[MAX_EXP_CHAR_LEN], uint32_t& _currentChar);
int32_t getExpandedChar(int32_t& _pos, int32_t _indent, etk::UChar _outUnicode[MAX_EXP_CHAR_LEN], uint32_t& _currentChar);
int32_t getExpandedChar(int32_t& _pos, int32_t _indent, char _outUTF8[MAX_EXP_CHAR_LEN], uint32_t& _currentChar);
int32_t ExpandCharacter(char _c, int32_t _indent, char _outUTF8[MAX_EXP_CHAR_LEN]); // TODO : remove
int32_t CharWidth(char _c, int32_t _indent); // TODO : rework this

View File

@ -103,7 +103,7 @@ bool CodeView::calculateMinSize(void)
void CodeView::calculateMaxSize(void)
{
m_maxSize.setX(2048);
int32_t letterHeight = m_displayText.calculateSize(etk::UniChar('A')).y();
int32_t letterHeight = m_displayText.calculateSize(etk::UChar('A')).y();
BufferText* tmpBuffer = BufferManager::get(m_bufferID);
if (NULL!=tmpBuffer) {
m_maxSize.setY(tmpBuffer->getNumberOfLine() * letterHeight);

View File

@ -237,7 +237,7 @@ MainWindows::MainWindows(void) {
// add generic shortcut ...
// (shift, control, alt, meta, uniChar_t unicodeValue, const char * generateEventId, etk::UString& data)
// (shift, control, alt, meta, etk::UChar unicodeValue, const char * generateEventId, etk::UString& data)
shortCutAdd("ctrl+o", ednMsgGuiOpen, "", true);
shortCutAdd("ctrl+n", ednMsgGuiNew, "", true);

View File

@ -122,13 +122,13 @@ void appl::TextViewer::onRegenerateDisplay(void) {
m_displayText.setColor(etk::Color<>(0, 0, 0, 256));
float countNbLine = 1;
esize_t countColomn = 0;
vec3 tmpLetterSize = m_displayText.calculateSize((uniChar_t)'A');
vec3 tmpLetterSize = m_displayText.calculateSize((etk::UChar)'A');
vec3 positionCurentDisplay(0.0f, m_size.y()-tmpLetterSize.y(), 0.0f);
m_displayText.setPos(positionCurentDisplay);
// the siplay string :
etk::UString stringToDisplay;
esize_t bufferElementSize = 0;
etk::UniChar currentValue;
etk::UChar currentValue;
bool isSelect = false;
int32_t selectPosStart = etk_min(m_buffer->m_cursorPos, m_buffer->m_cursorSelectPos);
int32_t selectPosStop = etk_max(m_buffer->m_cursorPos, m_buffer->m_cursorSelectPos);
@ -148,7 +148,7 @@ void appl::TextViewer::onRegenerateDisplay(void) {
}
bufferElementSize = m_buffer->get(iii, currentValue);
//APPL_DEBUG(" element size : " << iii << " : " << bufferElementSize);
if (currentValue == etk::UniChar::Return) {
if (currentValue == etk::UChar::Return) {
countNbLine += 1;
countColomn = 0;
if (bufferElementSize == 0) {

View File

@ -74,7 +74,7 @@ class HighlightPattern {
etk::RegExp<etk::Buffer>* m_regExpStop; //!< Stop of Regular Expression
bool m_haveStopPatern; //!< Stop patern presence
bool m_multiline; //!< The patern is multiline
etk::UniChar m_escapeChar; //!< Escape char to prevent exeit of patern ....
etk::UChar m_escapeChar; //!< Escape char to prevent exeit of patern ....
etk::Vector<HighlightPattern*> m_subPatern; //!< Under patern of this one
// etk::Vector<HighlightPattern*> m_subColor; //!< Under Color in the start RegExp ...
};