diff --git a/sources/appl/Buffer/Buffer.cpp b/sources/appl/Buffer/Buffer.cpp index 8c032e7..8e7e161 100644 --- a/sources/appl/Buffer/Buffer.cpp +++ b/sources/appl/Buffer/Buffer.cpp @@ -17,7 +17,7 @@ appl::Buffer::Buffer(void) : } -bool appl::Buffer::LoadFile(const etk::UString& _name) +bool appl::Buffer::loadFile(const etk::UString& _name) { APPL_DEBUG("Load file : '" << _name << "'"); m_fileName = _name; @@ -33,7 +33,7 @@ bool appl::Buffer::LoadFile(const etk::UString& _name) -void appl::Buffer::SetFileName(const etk::UString& _name) +void appl::Buffer::setFileName(const etk::UString& _name) { // TODO : ... } @@ -47,7 +47,7 @@ void appl::Buffer::MoveCursorRight(appl::Buffer::moveMode _mode) switch (_mode) { default: case moveLetter: - nbElement = Get(m_cursorPos, value); + nbElement = get(m_cursorPos, value); if (nbElement>0) { m_cursorPos += nbElement; } @@ -70,7 +70,7 @@ void appl::Buffer::MoveCursorLeft(appl::Buffer::moveMode _mode) switch (_mode) { default: case moveLetter: - nbElement = GetBack(m_cursorPos-1, value); + nbElement = getBack(m_cursorPos-1, value); if (nbElement>0) { m_cursorPos -= nbElement; } @@ -86,7 +86,7 @@ void appl::Buffer::MoveCursorLeft(appl::Buffer::moveMode _mode) void appl::Buffer::MoveCursorUp(esize_t _nbLine) { - // Find the position of the start of the line. + // find the position of the start of the line. esize_t lineStartPos = StartLine(m_cursorPos); // check if we can go up ... if (lineStartPos == 0) { @@ -97,10 +97,10 @@ void appl::Buffer::MoveCursorUp(esize_t _nbLine) m_cursorPreferredCol = CountDispChars(lineStartPos, m_cursorPos); } EWOL_DEBUG("ploop : " << m_cursorPreferredCol); - // Get the previous line + // get the previous line esize_t prevLineStartPos = CountBackwardNLines(lineStartPos, _nbLine); - //APPL_INFO("Move Line UP result : prevLineStartPos=" << prevLineStartPos); - // Get the display char position + //APPL_INFO("Move line UP result : prevLineStartPos=" << prevLineStartPos); + // get the display char position esize_t newPos = CountForwardDispChars(prevLineStartPos, m_cursorPreferredCol); //APPL_INFO("Move to colomn : column=" << column << " newPos=" << newPos); //SetInsertPosition(newPos); @@ -110,10 +110,10 @@ void appl::Buffer::MoveCursorUp(esize_t _nbLine) void appl::Buffer::MoveCursorDown(esize_t _nbLine) { // check if we are not at the end of Buffer - if (m_cursorPos == m_data.Size() ) { + if (m_cursorPos == m_data.size() ) { return; } - // Find the position of the start of the line. + // find the position of the start of the line. esize_t lineStartPos = StartLine(m_cursorPos); if (m_cursorPreferredCol < 0) { @@ -122,8 +122,8 @@ void appl::Buffer::MoveCursorDown(esize_t _nbLine) EWOL_DEBUG("ploop : " << m_cursorPreferredCol); // get the next line : esize_t nextLineStartPos = CountForwardNLines(lineStartPos, _nbLine); - //APPL_INFO("Move Line DOWN result : nextLineStartPos=" << nextLineStartPos); - // Get the display char position + //APPL_INFO("Move line DOWN result : nextLineStartPos=" << nextLineStartPos); + // get the display char position esize_t newPos = CountForwardDispChars(nextLineStartPos, m_cursorPreferredCol); //APPL_INFO("Move to colomn : column=" << column << " newPos=" << newPos); //SetInsertPosition(newPos); @@ -143,7 +143,7 @@ esize_t appl::Buffer::EndLine(esize_t _pos) { esize_t endPos; if (false == Search(_pos, etk::UniChar::Return, endPos)) { - endPos = m_data.Size(); + endPos = m_data.size(); } return endPos; } @@ -153,17 +153,17 @@ bool appl::Buffer::Search(esize_t _pos, const etk::UniChar& _search, esize_t& _r // move in the string esize_t nbElementBuffer = 0; etk::UniChar value; - for(esize_t iii=_pos ; iii=0 ; iii-=nbElementBuffer ) { - nbElementBuffer = GetBack(iii, value); + for(esize_t iii=_pos-1 ; iii >= 0 ; iii-=nbElementBuffer ) { + nbElementBuffer = getBack(iii, value); if (value == _search) { _result = iii-nbElementBuffer; return true; } - if (nbElementBuffer<=0) { + if (nbElementBuffer <= 0) { nbElementBuffer = 1; } } @@ -187,44 +187,44 @@ bool appl::Buffer::SearchBack(esize_t _pos, const etk::UniChar& _search, esize_t } -bool appl::Buffer::OnEventEntry(const ewol::EventEntry& _event) // TODO : , vec2 _displaySize) +bool appl::Buffer::onEventEntry(const ewol::EventEntry& _event) // TODO : , vec2 _displaySize) { //APPL_DEBUG(" event : " << _event); - if (_event.GetType() == ewol::keyEvent::keyboardChar) { + if (_event.getType() == ewol::keyEvent::keyboardChar) { //APPL_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent); - if (_event.GetStatus() != ewol::keyEvent::statusDown) { + if (_event.getStatus() != ewol::keyEvent::statusDown) { return false; } - if (_event.GetChar() == etk::UniChar::Tabulation) { - m_data.Insert(m_cursorPos, '\t'); + if (_event.getChar() == etk::UniChar::Tabulation) { + m_data.insert(m_cursorPos, '\t'); m_cursorPos += 1; - } else if (_event.GetChar() == etk::UniChar::Return) { - m_data.Insert(m_cursorPos, '\n'); + } else if (_event.getChar() == etk::UniChar::Return) { + m_data.insert(m_cursorPos, '\n'); m_cursorPos += 1; - } else if (_event.GetChar() == etk::UniChar::Suppress ) { + } else if (_event.getChar() == etk::UniChar::Suppress ) { //APPL_INFO("keyEvent : pos=" << m_cursorPos); etk::UniChar value; - esize_t nbElement = Get(m_cursorPos, value); + esize_t nbElement = get(m_cursorPos, value); if (nbElement>0) { - m_data.Remove(m_cursorPos, nbElement); + m_data.remove(m_cursorPos, nbElement); } - } else if (_event.GetChar() == etk::UniChar::Delete) { + } else if (_event.getChar() == etk::UniChar::Delete) { //APPL_INFO("keyEvent : pos=" << m_cursorPos); etk::UniChar value; - esize_t nbElement = GetBack(m_cursorPos-1, value); + esize_t nbElement = getBack(m_cursorPos-1, value); if (nbElement>0) { m_cursorPos -= nbElement; - m_data.Remove(m_cursorPos, nbElement); + m_data.remove(m_cursorPos, nbElement); } } else { // normal adding char ... char output[5]; - int32_t nbElement = _event.GetChar().GetUtf8(output); - if (_event.GetSpecialKey().IsSetInsert() == false) { - m_data.Insert(m_cursorPos, (int8_t*)output, nbElement); + int32_t nbElement = _event.getChar().GetUtf8(output); + if (_event.getSpecialKey().isSetInsert() == false) { + m_data.insert(m_cursorPos, (int8_t*)output, nbElement); } else { etk::UniChar value; - esize_t nbElementRemove = Get(m_cursorPos, value); + esize_t nbElementRemove = get(m_cursorPos, value); m_data.Replace(m_cursorPos, nbElementRemove, (int8_t*)output, nbElement); } m_cursorPos += nbElement; @@ -232,10 +232,10 @@ bool appl::Buffer::OnEventEntry(const ewol::EventEntry& _event) // TODO : , vec2 return true; } // move events ... - if (_event.GetStatus() == ewol::keyEvent::statusDown) { + if (_event.getStatus() == ewol::keyEvent::statusDown) { bool needUpdatePosition = true; // check selection event ... - switch(_event.GetType()) { + switch(_event.getType()) { case ewol::keyEvent::keyboardLeft: //APPL_INFO("keyEvent : "); MoveCursorLeft(); @@ -282,10 +282,10 @@ bool appl::Buffer::OnEventEntry(const ewol::EventEntry& _event) // TODO : , vec2 } -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::UniChar& _value, unicode::charset_te _charset) const { _value = '\0'; - if (_pos<0 && _pos UNICODE ... - _value.Set(m_data[_pos]); + // TODO :: need to trancode iso == > UNICODE ... + _value.set(m_data[_pos]); 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::UniChar& _value, unicode::charset_te _charset) const { _value = '\0'; - if (_pos<0 && _pos')); + _out.append(etk::UniChar('<')); + _out.append(etk::UniChar('n')); + _out.append(etk::UniChar('u')); + _out.append(etk::UniChar('l')); + _out.append(etk::UniChar('>')); return; } if (_value == etk::UniChar::Return) { // nothing to display... return; } - if (_value.Get() <= 31) { - _out.Append(etk::UniChar('<')); - const char * tmp = ControlCodeTable[_value.Get()]; + if (_value.get() <= 31) { + _out.append(etk::UniChar('<')); + const char * tmp = ControlCodeTable[_value.get()]; while (*tmp!='\0') { - _out.Append(etk::UniChar(*tmp)); + _out.append(etk::UniChar(*tmp)); tmp++; } - _out.Append(etk::UniChar('>')); + _out.append(etk::UniChar('>')); 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('>')); + _out.append(etk::UniChar('<')); + _out.append(etk::UniChar('d')); + _out.append(etk::UniChar('e')); + _out.append(etk::UniChar('l')); + _out.append(etk::UniChar('>')); return; } // nothing to do ... - _out.Append(_value); + _out.append(_value); //APPL_DEBUG("plop : " << _out); } @@ -390,13 +390,13 @@ int32_t appl::Buffer::CountDispChars(esize_t _posStart, esize_t _posEnd) esize_t bufferElementSize; etk::UniChar value; //APPL_DEBUG("_posStart="<< _posStart << " _posEnd=" << _posEnd); - for(int32_t iii=_posStart; iii<_posEnd && iii (1) at position=" << myPosIt.Position()+1 ); + //APPL_INFO(" == > (1) at position=" << myPosIt.Position()+1 ); return iii+1; } } - if (bufferElementSize<=0) { + if (bufferElementSize <= 0) { bufferElementSize = 1; } } - //APPL_INFO(" ==> (2) at position=" << myPosIt.Position() ); - return m_data.Size(); + //APPL_INFO(" == > (2) at position=" << myPosIt.Position() ); + return m_data.size(); } esize_t appl::Buffer::CountBackwardNLines(esize_t _startPos, int32_t _nLines) { if (_startPos <= 0) { return 0; - } else if (_startPos > m_data.Size() ) { - _startPos = m_data.Size(); + } else if (_startPos > m_data.size() ) { + _startPos = m_data.size(); } //APPL_INFO("startPos=" << startPos << " nLines=" << nLines); esize_t bufferElementSize; etk::UniChar value; int32_t lineCount = 0; - for(int32_t iii = _startPos-1; iii>=0 ; iii-=bufferElementSize ) { + for(int32_t iii = _startPos-1; iii >= 0 ; iii-=bufferElementSize ) { // get the element value: - bufferElementSize = GetBack(iii, value); + bufferElementSize = getBack(iii, value); if (value == etk::UniChar::Return) { lineCount++; if (lineCount >= _nLines) { - //APPL_INFO(" ==> (1) at position=" << myPosIt.Position()+1 ); + //APPL_INFO(" == > (1) at position=" << myPosIt.Position()+1 ); return iii+1; } } - if (bufferElementSize<=0) { + if (bufferElementSize <= 0) { bufferElementSize = 1; } } - //APPL_INFO(" ==> (2) at position=0"); + //APPL_INFO(" == > (2) at position=0"); return 0; } diff --git a/sources/appl/Buffer/Buffer.h b/sources/appl/Buffer/Buffer.h index 6c166b3..fdbb1ef 100644 --- a/sources/appl/Buffer/Buffer.h +++ b/sources/appl/Buffer/Buffer.h @@ -28,15 +28,15 @@ namespace appl etk::UString m_fileName; //!< name of the file (with his path) public: /** - * @brief Get the curent filename of the Buffer + * @brief get the curent filename of the Buffer */ - const etk::UString& GetFileName(void) { return m_fileName; } - bool LoadFile(const etk::UString& _name); - void SetFileName(const etk::UString& _name); + const etk::UString& getFileName(void) { return m_fileName; } + bool loadFile(const etk::UString& _name); + void setFileName(const etk::UString& _name); bool m_isModify; //!< true if the file is modify etk::Buffer m_data; //!< copy of the file buffer public: - etk::Buffer& GetData(void) { return m_data; }; + etk::Buffer& getData(void) { return m_data; }; /* appl::History m_history; Highlight m_highlight; @@ -46,23 +46,23 @@ namespace appl public: esize_t m_cursorPos; //!< cursor position. int32_t m_cursorPreferredCol; //!< position of the cursor when up and down is done. - bool OnEventEntry(const ewol::EventEntry& _event); + bool onEventEntry(const ewol::EventEntry& _event); /** - * @brief Get the next element in the buffer. + * @brief get the next element in the buffer. * @param[in] _pos Position in the buffer * @param[out] _value Unicode value read in the buffer * @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::UniChar& _value, unicode::charset_te _charset = unicode::EDN_CHARSET_UTF8) const; /** - * @brief Get the previous element in the buffer. + * @brief get the previous element in the buffer. * @param[in] _pos Position in the buffer (last element of the element) * @param[out] _value Unicode value read in the buffer * @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::UniChar& _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 @@ -97,13 +97,13 @@ namespace appl */ void MoveCursorDown(esize_t _nbLine); /** - * @brief Get the start of a line with the position in the buffer. + * @brief get the start of a line with the position in the buffer. * @param[in] _pos position in the buffer. * @return The position in the buffer of the start of the line. */ esize_t StartLine(esize_t _pos); /** - * @brief Get the end of a line with the position in the buffer. + * @brief get the end of a line with the position in the buffer. * @param[in] _pos position in the buffer. * @return The position in the buffer of the end of the line. */ @@ -126,7 +126,7 @@ namespace appl bool SearchBack(esize_t _pos, const etk::UniChar& _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 + * displayed characters are the characters shown on the screen to represent characters in the * buffer, where tabs and control characters are expanded * @param[in] _posStart start position * @param[in] _posEnd End position @@ -141,16 +141,16 @@ namespace appl */ esize_t CountForwardDispChars(esize_t _posStart, int32_t _nChars); /** - * @brief Find the first character of the line "nLines" forward + * @brief find the first character of the line "nLines" forward * @param[in,out] _startPos Start position. * @param[in,out] _nLines Number of line to count. * @return position of the starting the line. */ esize_t CountForwardNLines(esize_t _startPos, int32_t _nLines); /** - * @brief Find the first character of the line "nLines" backwards + * @brief find the first character of the line "nLines" backwards * @param[in,out] _startPos Start position to count (this caracter is not counted) - * @param[in,out] _nLines Number of line to count (if ==0 means find the beginning of the line) + * @param[in,out] _nLines Number of line to count (if == 0 means find the beginning of the line) * @return position of the starting the line */ esize_t CountBackwardNLines(esize_t _startPos, int32_t _nLines); diff --git a/sources/appl/Buffer/BufferManager.cpp b/sources/appl/Buffer/BufferManager.cpp index 25b3df6..7ee8ffa 100644 --- a/sources/appl/Buffer/BufferManager.cpp +++ b/sources/appl/Buffer/BufferManager.cpp @@ -21,29 +21,29 @@ class classBufferManager: public ewol::EObject // Constructeur classBufferManager(void); ~classBufferManager(void); - const char * const GetObjectType(void) + const char * const getObjectType(void) { return "ApplBufferManager"; } public: - virtual void OnReceiveMessage(const ewol::EMessage& _msg); + virtual void onReceiveMessage(const ewol::EMessage& _msg); private: // return the ID of the buffer allocated // create a buffer with no element int32_t Create(void); // open curent filename - int32_t Open(etk::FSNode &myFile); - bool Remove(int32_t BufferID); + int32_t open(etk::FSNode &myFile); + bool remove(int32_t BufferID); public: - int32_t GetSelected(void) { return m_idSelected;}; - //void SetSelected(int32_t id) {m_idSelected = id;}; - BufferText* Get(int32_t BufferID); + int32_t getSelected(void) { return m_idSelected;}; + //void setSelected(int32_t id) {m_idSelected = id;}; + BufferText* get(int32_t BufferID); bool Exist(int32_t BufferID); bool Exist(etk::FSNode &myFile); - int32_t GetId(etk::FSNode &myFile); - // return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5 - uint32_t Size(void); - uint32_t SizeOpen(void); + int32_t getId(etk::FSNode &myFile); + // return the number of buffer (open in the past) if 5 buffer open and 4 close == > return 5 + uint32_t size(void); + uint32_t sizeOpen(void); int32_t WitchBuffer(int32_t iEmeElement); @@ -51,7 +51,7 @@ class classBufferManager: public ewol::EObject etk::Vector listBuffer; //!< element List of the char Elements - void RemoveAll(void); //!< remove all buffer + void removeAll(void); //!< remove all buffer int32_t m_idSelected; }; @@ -71,25 +71,25 @@ classBufferManager::classBufferManager(void) classBufferManager::~classBufferManager(void) { //clean All Buffer - APPL_INFO("~classBufferManager::RemoveAll();"); - RemoveAll(); + APPL_INFO("~classBufferManager::removeAll();"); + removeAll(); // clear The list of Buffer - APPL_INFO("~classBufferManager::listBuffer.Clear();"); - listBuffer.Clear(); + APPL_INFO("~classBufferManager::listBuffer.clear();"); + listBuffer.clear(); } -void classBufferManager::OnReceiveMessage(const ewol::EMessage& _msg) +void classBufferManager::onReceiveMessage(const ewol::EMessage& _msg) { - ewol::EObject::OnReceiveMessage(_msg); + ewol::EObject::onReceiveMessage(_msg); - if (_msg.GetMessage() == ednMsgBufferId) { + if (_msg.getMessage() == ednMsgBufferId) { // select a new buffer ID : - if (_msg.GetData() == "") { + if (_msg.getData() == "") { APPL_ERROR("Request select buffer ID = \"\" "); } else { int32_t newID = -1; - sscanf(_msg.GetData().c_str(), "%d", &newID); + sscanf(_msg.getData().c_str(), "%d", &newID); if(true == Exist(newID)) { m_idSelected = newID; } else { @@ -97,19 +97,19 @@ void classBufferManager::OnReceiveMessage(const ewol::EMessage& _msg) APPL_ERROR("Request a non existant ID : " << newID << " reset to -1..."); } } - } else if (_msg.GetMessage() == ednMsgGuiNew) { + } else if (_msg.getMessage() == ednMsgGuiNew) { int32_t newOne = Create(); if (-1 != newOne) { m_idSelected = newOne; SendMultiCast(ednMsgBufferId, m_idSelected); SendMultiCast(ednMsgBufferListChange); } - } else if (_msg.GetMessage() == ednMsgOpenFile) { - if (_msg.GetData() != "" ) { - etk::FSNode myFile(_msg.GetData()); - if (myFile.GetNodeType() == etk::FSN_FILE) { - APPL_DEBUG("request open file = \"" << _msg.GetData() << "\" ?= \"" << myFile << "\""); - int32_t newOne = Open(myFile); + } else if (_msg.getMessage() == ednMsgOpenFile) { + if (_msg.getData() != "" ) { + etk::FSNode myFile(_msg.getData()); + if (myFile.getNodeType() == etk::FSN_FILE) { + APPL_DEBUG("request open file = \"" << _msg.getData() << "\" ?= \"" << myFile << "\""); + int32_t newOne = open(myFile); if (-1 != newOne) { m_idSelected = newOne; SendMultiCast(ednMsgBufferId, m_idSelected); @@ -119,57 +119,57 @@ void classBufferManager::OnReceiveMessage(const ewol::EMessage& _msg) APPL_ERROR("Can not open the file : \"" << myFile << "\""); } } else { - APPL_ERROR("Request to open an Unknox element file : " << myFile << " type:" << myFile.GetNodeType()); + APPL_ERROR("Request to open an Unknox element file : " << myFile << " type:" << myFile.getNodeType()); } } - } else if (_msg.GetMessage() == ednMsgGuiSave) { - if (_msg.GetData() == "") { + } else if (_msg.getMessage() == ednMsgGuiSave) { + if (_msg.getData() == "") { APPL_ERROR("Null data for close file ... "); } else { - if (_msg.GetData() == "current") { + if (_msg.getData() == "current") { // Check buffer existence if(true == Exist(m_idSelected)) { - // If no name ==> request a Gui display ... - if (Get(m_idSelected)->HaveName() == false) { + // If no name == > request a Gui display ... + if (get(m_idSelected)->haveName() == false) { SendMultiCast(ednMsgGuiSaveAs, "current"); } else { - Get(m_idSelected)->Save(); + get(m_idSelected)->Save(); } } } else { int32_t newId; - sscanf(_msg.GetData().c_str(), "%d", &newId); + sscanf(_msg.getData().c_str(), "%d", &newId); if (false == Exist(newId)) { APPL_ERROR("Request a save As with a non existant ID=" << newId); } else { - // If no name ==> request a Gui display ... - if (Get(newId)->HaveName() == false) { + // If no name == > request a Gui display ... + if (get(newId)->haveName() == false) { SendMultiCast(ednMsgGuiSaveAs, newId); } else { - Get(m_idSelected)->Save(); + get(m_idSelected)->Save(); } } SendMultiCast(ednMsgBufferState, "saved"); } } - } else if (_msg.GetMessage() == ednMsgGuiClose) { - if (_msg.GetData() == "") { + } else if (_msg.getMessage() == ednMsgGuiClose) { + if (_msg.getData() == "") { APPL_ERROR("Null data for close file ... "); } else { - if (_msg.GetData() == "All") { + if (_msg.getData() == "All") { } else { int32_t closeID = -1; - if (_msg.GetData() == "current") { + if (_msg.getData() == "current") { closeID = m_idSelected; APPL_DEBUG("Close specific buffer ID" << closeID); } else { // close specific buffer ... - sscanf(_msg.GetData().c_str(), "%d", &closeID); + sscanf(_msg.getData().c_str(), "%d", &closeID); APPL_DEBUG("Close specific buffer ID="<< closeID); } if(true == Exist(closeID)) { - // Get the new display buffer + // get the new display buffer if (m_idSelected == closeID) { // Try previous buffer int32_t destBuffer = -1; @@ -181,7 +181,7 @@ void classBufferManager::OnReceiveMessage(const ewol::EMessage& _msg) } // try next buffer if (-1 == destBuffer) { - for(int32_t ii=closeID+1; ii < listBuffer.Size(); ii++) { + for(int32_t ii=closeID+1; ii < listBuffer.size(); ii++) { if (true == Exist(ii) ) { destBuffer = ii; break; @@ -192,25 +192,25 @@ void classBufferManager::OnReceiveMessage(const ewol::EMessage& _msg) m_idSelected = destBuffer; SendMultiCast(ednMsgBufferId, destBuffer); } - // Remove requested buffer - Remove(closeID); + // remove requested buffer + remove(closeID); SendMultiCast(ednMsgBufferListChange); } else { - APPL_ERROR("Request Close of a non existant ID : " << closeID); + APPL_ERROR("Request close of a non existant ID : " << closeID); } } } - } else if (_msg.GetMessage() == ednMsgCodeViewSelectedId) { + } else if (_msg.getMessage() == ednMsgCodeViewSelectedId) { //Change the selected buffer - if (_msg.GetData() == "") { + if (_msg.getData() == "") { APPL_ERROR("Null data for changing buffer ID file ... "); } else { int32_t newId; - sscanf(_msg.GetData().c_str(), "%d", &newId); + sscanf(_msg.getData().c_str(), "%d", &newId); if (true == Exist(newId)) { m_idSelected = newId; } else { - APPL_ERROR("code biew request the selection of an non -existant buffer ==> reset to -1"); + APPL_ERROR("code biew request the selection of an non -existant buffer == > reset to -1"); m_idSelected = -1; } SendMultiCast(ednMsgBufferId, m_idSelected); @@ -222,11 +222,11 @@ void classBufferManager::OnReceiveMessage(const ewol::EMessage& _msg) { // Check buffer existence if(true == Exist(dataID)) { - // If no name ==> request a Gui display ... - if (Get(dataID)->HaveName() == false) { + // If no name == > request a Gui display ... + if (get(dataID)->haveName() == false) { SendMessage(APPL_MSG__GUI_SHOW_SAVE_AS, dataID); } else { - Get(dataID)->Save(); + get(dataID)->Save(); } } break; @@ -241,18 +241,18 @@ void classBufferManager::OnReceiveMessage(const ewol::EMessage& _msg) /** - * @brief Remove all buffer opened + * @brief remove all buffer opened * * @param[in,out] --- * * @return --- * */ -void classBufferManager::RemoveAll(void) +void classBufferManager::removeAll(void) { int32_t i; - for (i=0; i we open it ... - return GetId(myFile); + // the buffer already existed == > we open it ... + return getId(myFile); } } -BufferText * classBufferManager::Get(int32_t BufferID) +BufferText * classBufferManager::get(int32_t BufferID) { // possible special case : -1; if (-1 >= BufferID) { return NULL; } // check if the Buffer existed - if (BufferID < listBuffer.Size()) { + if (BufferID < listBuffer.size()) { // check if the buffer already existed if (NULL != listBuffer[BufferID]) { return listBuffer[BufferID]; @@ -319,7 +319,7 @@ BufferText * classBufferManager::Get(int32_t BufferID) APPL_ERROR("non existing Buffer " << BufferID); } } else { - APPL_ERROR("call an non existing Buffer number too hight : " << BufferID << " > " << listBuffer.Size()); + APPL_ERROR("call an non existing Buffer number too hight : " << BufferID << " > " << listBuffer.size()); } return NULL; } @@ -331,7 +331,7 @@ bool classBufferManager::Exist(int32_t BufferID) return false; } // check if the Buffer existed - if (BufferID < listBuffer.Size()) { + if (BufferID < listBuffer.size()) { // check if the buffer already existed if (NULL != listBuffer[BufferID]) { return true; @@ -343,21 +343,21 @@ bool classBufferManager::Exist(int32_t BufferID) bool classBufferManager::Exist(etk::FSNode &myFile ) { - if (-1 == GetId(myFile)) { + if (-1 == getId(myFile)) { return false; } return true; } -int32_t classBufferManager::GetId(etk::FSNode &myFile) +int32_t classBufferManager::getId(etk::FSNode &myFile) { int32_t iii; // check if the Buffer existed - for (iii=0; iii < listBuffer.Size(); iii++) { + for (iii=0; iii < listBuffer.size(); iii++) { // check if the buffer already existed if (NULL != listBuffer[iii]) { - if ( listBuffer[iii]->GetFileName() == myFile) { + if ( listBuffer[iii]->getFileName() == myFile) { return iii; } } @@ -366,18 +366,18 @@ int32_t classBufferManager::GetId(etk::FSNode &myFile) } -// return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5 -uint32_t classBufferManager::Size(void) +// return the number of buffer (open in the past) if 5 buffer open and 4 close == > return 5 +uint32_t classBufferManager::size(void) { - return listBuffer.Size(); + return listBuffer.size(); } // nb of opens file Now ... -uint32_t classBufferManager::SizeOpen(void) +uint32_t classBufferManager::sizeOpen(void) { uint32_t jjj = 0; // check if the Buffer existed - for (int32_t iii=0; iii= BufferID) { return false; } // check if the Buffer existed - if (BufferID < listBuffer.Size()) { + if (BufferID < listBuffer.size()) { // check if the buffer already existed if (NULL != listBuffer[BufferID]) { // TODO : Check if it saved... /* - if (false == IsSaved(BufferID) ) { + if (false == isSaved(BufferID) ) { APPL_INFO("Buffer " << BufferID << " : Not Saved", BufferID); } */ @@ -413,7 +413,7 @@ bool classBufferManager::Remove(int32_t BufferID) delete( listBuffer[BufferID] ); listBuffer[BufferID] = NULL; /* - ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferListChange); + ewol::widgetMessageMultiCast::Send(getWidgetId(), ednMsgBufferListChange); */ return true; } else { @@ -421,7 +421,7 @@ bool classBufferManager::Remove(int32_t BufferID) return false; } } else { - APPL_INFO("call an non existing Buffer number too hight : " << BufferID << " > " << listBuffer.Size()); + APPL_INFO("call an non existing Buffer number too hight : " << BufferID << " > " << listBuffer.size()); return false; } } @@ -437,7 +437,7 @@ bool classBufferManager::Remove(int32_t BufferID) int32_t classBufferManager::WitchBuffer(int32_t iEmeElement) { int32_t i; - for (i=0; i already exist, just unlink the previous ..."); + EWOL_ERROR("classBufferManager == > already exist, just unlink the previous ..."); localManager = NULL; } localManager = new classBufferManager(); @@ -472,35 +472,35 @@ void BufferManager::Init(void) void BufferManager::UnInit(void) { if (NULL == localManager) { - EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ..."); + EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ..."); return; } delete(localManager); localManager = NULL; } -int32_t BufferManager::GetSelected(void) +int32_t BufferManager::getSelected(void) { if (NULL == localManager) { - EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ..."); + EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ..."); return -1; } - return localManager->GetSelected(); + return localManager->getSelected(); } -BufferText * BufferManager::Get(int32_t BufferID) +BufferText * BufferManager::get(int32_t BufferID) { if (NULL == localManager) { - EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ..."); + EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ..."); return NULL; } - return localManager->Get(BufferID); + return localManager->get(BufferID); } bool BufferManager::Exist(int32_t BufferID) { if (NULL == localManager) { - EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ..."); + EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ..."); return false; } return localManager->Exist(BufferID); @@ -509,43 +509,43 @@ bool BufferManager::Exist(int32_t BufferID) bool BufferManager::Exist(etk::FSNode &myFile) { if (NULL == localManager) { - EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ..."); + EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ..."); return false; } return localManager->Exist(myFile); } -int32_t BufferManager::GetId(etk::FSNode &myFile) +int32_t BufferManager::getId(etk::FSNode &myFile) { if (NULL == localManager) { - EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ..."); + EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ..."); return -1; } - return localManager->GetId(myFile); + return localManager->getId(myFile); } -uint32_t BufferManager::Size(void) +uint32_t BufferManager::size(void) { if (NULL == localManager) { - EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ..."); + EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ..."); return 0; } - return localManager->Size(); + return localManager->size(); } -uint32_t BufferManager::SizeOpen(void) +uint32_t BufferManager::sizeOpen(void) { if (NULL == localManager) { - EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ..."); + EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ..."); return 0; } - return localManager->SizeOpen(); + return localManager->sizeOpen(); } int32_t BufferManager::WitchBuffer(int32_t iEmeElement) { if (NULL == localManager) { - EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ..."); + EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ..."); return -1; } return localManager->WitchBuffer(iEmeElement); diff --git a/sources/appl/Buffer/BufferManager.h b/sources/appl/Buffer/BufferManager.h index 462cfdd..23f4cf3 100644 --- a/sources/appl/Buffer/BufferManager.h +++ b/sources/appl/Buffer/BufferManager.h @@ -15,16 +15,16 @@ namespace BufferManager { - void Init(void); + void init(void); void UnInit(void); - int32_t GetSelected(void); - BufferText* Get(int32_t BufferID); + int32_t getSelected(void); + BufferText* get(int32_t BufferID); bool Exist(int32_t BufferID); bool Exist(etk::FSNode &myFile); - int32_t GetId(etk::FSNode &myFile); - // return the number of buffer (open in the past) if 5 buffer open and 4 close ==> return 5 - uint32_t Size(void); - uint32_t SizeOpen(void); + int32_t getId(etk::FSNode &myFile); + // return the number of buffer (open in the past) if 5 buffer open and 4 close == > return 5 + uint32_t size(void); + uint32_t sizeOpen(void); int32_t WitchBuffer(int32_t iEmeElement); }; diff --git a/sources/appl/Buffer/BufferText.cpp b/sources/appl/Buffer/BufferText.cpp index b77972b..cda7448 100644 --- a/sources/appl/Buffer/BufferText.cpp +++ b/sources/appl/Buffer/BufferText.cpp @@ -61,13 +61,13 @@ void BufferText::BasicInit(void) */ void BufferText::NameChange(void) { - // Find HL system + // find HL system //APPL_DEBUG("check name change"); if (true == HighlightManager::Exist(m_fileName)) { - Highlight * myHL = HighlightManager::Get(m_fileName); - // Set the new HL + Highlight * myHL = HighlightManager::get(m_fileName); + // set the new HL if (NULL != myHL) { - m_EdnBuf.SetHLSystem(myHL); + m_EdnBuf.setHLSystem(myHL); } } @@ -82,18 +82,18 @@ void BufferText::NameChange(void) * @return --- * */ -bool BufferText::IsModify(void) +bool BufferText::isModify(void) { return m_fileModify; } -void BufferText::SetModify(bool status) +void BufferText::setModify(bool status) { if (status != m_fileModify) { m_fileModify = status; - // TODO : Remove from here + // TODO : remove from here etk::UString data = "Modify"; - ewol::GetContext().GetEObjectManager().MultiCast().AnonymousSend(ednMsgBufferState, data); + ewol::getContext().getEObjectManager().MultiCast().AnonymousSend(ednMsgBufferState, data); } } @@ -106,14 +106,14 @@ void BufferText::SetModify(bool status) * @return --- * */ -bool BufferText::NeedToUpdateDisplayPosition(void) +bool BufferText::needToUpdateDisplayPosition(void) { bool tmpVal = m_updatePositionRequested; m_updatePositionRequested = false; return tmpVal; } -vec2 BufferText::GetBorderSize(void) +vec2 BufferText::getBorderSize(void) { return vec2(30,30);; } @@ -139,12 +139,12 @@ BufferText::BufferText() etk::UString mString = "Untitle - "; mString += fileBasicID++; EWOL_DEBUG("Create buffer try name : \"" << mString << "\""); - SetFileName(mString); + setFileName(mString); m_haveName = false; EWOL_DEBUG("Create buffer with name : " << m_fileName ); BasicInit(); - SetModify(true); + setModify(true); APPL_INFO("New(Empty-Buffer)"); } @@ -161,26 +161,26 @@ BufferText::BufferText(etk::FSNode &fileName) { m_fileModify = false; EWOL_DEBUG("Create buffer try name : \"" << fileName << "\""); - SetFileName(fileName); + setFileName(fileName); EWOL_DEBUG("Create buffer with name : " << m_fileName ); BasicInit(); NameChange(); - APPL_INFO("Add Data from file(" << GetFileName() << ")"); + APPL_INFO("Add Data from file(" << getFileName() << ")"); etk::FSNode myFile(fileName); if (true == myFile.Exist()) { - if (false == myFile.FileOpenRead()) { + if (false == myFile.fileOpenRead()) { APPL_WARNING("File can not be open in read mode : " << myFile); - SetModify(true); + setModify(true); } else { m_EdnBuf.DumpFrom(myFile); - myFile.FileClose(); - SetModify(false); + myFile.fileClose(); + setModify(false); } } else { // fichier inexistant... creation d'un nouveaux - APPL_WARNING("No File ==> created a new one(" << GetFileName() << ")"); - SetModify(true); + APPL_WARNING("No file == > created a new one(" << getFileName() << ")"); + setModify(true); } RequestUpdateOfThePosition(); } @@ -196,14 +196,14 @@ BufferText::BufferText(etk::FSNode &fileName) */ void BufferText::Save(void) { - APPL_INFO("Save File : \"" << GetFileName() << "\"" ); - etk::FSNode myFile(GetFileName()); - if (false == myFile.FileOpenWrite()) { + APPL_INFO("Save file : \"" << getFileName() << "\"" ); + etk::FSNode myFile(getFileName()); + if (false == myFile.fileOpenWrite()) { APPL_ERROR("Can not open in writing the specify file"); } else { m_EdnBuf.DumpIn(myFile); - myFile.FileClose(); - SetModify(false); + myFile.fileClose(); + setModify(false); } } @@ -231,7 +231,7 @@ BufferText::~BufferText(void) * @return --- * */ -void BufferText::GetInfo(infoStatBuffer_ts &infoToUpdate) +void BufferText::getInfo(infoStatBuffer_ts &infoToUpdate) { } @@ -244,21 +244,21 @@ void BufferText::GetInfo(infoStatBuffer_ts &infoToUpdate) * @return --- * */ -void BufferText::SetLineDisplay(uint32_t lineNumber) +void BufferText::setLineDisplay(uint32_t lineNumber) { } #define SEPARATION_SIZE_LINE_NUMBER (3) -void BufferText::DrawLineNumber(ewol::Text* OOText, int32_t sizeX, int32_t sizeY, int32_t nbColomn, int32_t lineNumber, int32_t positionY) +void BufferText::drawLineNumber(ewol::Text* OOText, int32_t sizeX, int32_t sizeY, int32_t nbColomn, int32_t lineNumber, int32_t positionY) { char tmpLineNumber[50]; sprintf(tmpLineNumber, "%*d", nbColomn, lineNumber); - OOText->SetColorBg(ColorizeManager::Get(COLOR_LIST_BG_2)); - OOText->SetColor(ColorizeManager::Get(COLOR_CODE_LINE_NUMBER)); - OOText->SetPos(vec3(1.0f, (float)positionY, 0.0f) ); - OOText->Print(tmpLineNumber); + OOText->setColorBg(ColorizeManager::get(COLOR_LIST_BG_2)); + OOText->setColor(ColorizeManager::get(COLOR_CODE_LINE_NUMBER)); + OOText->setPos(vec3(1.0f, (float)positionY, 0.0f) ); + OOText->print(tmpLineNumber); } @@ -270,7 +270,7 @@ void BufferText::DrawLineNumber(ewol::Text* OOText, int32_t sizeX, int32_t sizeY * @return the number of colomn * */ -int32_t BufferText::GetLineNumberNumberOfElement(void) +int32_t BufferText::getLineNumberNumberOfElement(void) { int32_t nbColoneForLineNumber = 1; // get the number of line in the buffer @@ -289,20 +289,20 @@ int32_t BufferText::GetLineNumberNumberOfElement(void) return nbColoneForLineNumber; } -int32_t BufferText::GetNumberOfLine(void) +int32_t BufferText::getNumberOfLine(void) { return m_EdnBuf.CountLines(); } /** - * @brief Display the curent buffer with all the probematic imposed by the xharset and the user contraint. + * @brief display the curent buffer with all the probematic imposed by the xharset and the user contraint. * * @param[in,out] drawer the basic user drawer of EDN. * * @return * */ -int32_t BufferText::Display(ewol::Text& OOText, +int32_t BufferText::display(ewol::Text& OOText, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY) { @@ -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((uniChar_t)'A'); int32_t letterWidth = tmpLetterSize.x(); int32_t letterHeight = tmpLetterSize.y(); @@ -324,35 +324,35 @@ int32_t BufferText::Display(ewol::Text& OOText, vec2 maxSize; maxSize.setX(0); maxSize.setY(m_EdnBuf.NumberOfLines() * tmpLetterSize.y()); - int32_t nbColoneForLineNumber = GetLineNumberNumberOfElement(); + int32_t nbColoneForLineNumber = getLineNumberNumberOfElement(); // update the number of element that can be displayed m_displaySize.setX((sizeX/letterWidth) + 1 - nbColoneForLineNumber); m_displaySize.setY((sizeY/letterHeight) + 1); APPL_VERBOSE("main DIPLAY " << m_displaySize.x() << " char * " << m_displaySize.y() << " char"); - selHave = m_EdnBuf.GetSelectionPos(selStart, selEnd, selIsRect, selRectStart, selRectEnd); + selHave = m_EdnBuf.getSelectionPos(selStart, selEnd, selIsRect, selRectStart, selRectEnd); colorInformation_ts * HLColor = NULL; int32_t iii, new_i; - // Get color : - Colorize * myColor = ColorizeManager::Get("normal"); - Colorize * myColorSel = ColorizeManager::Get("SelectedText"); - etk::Color<> & myColorSpace = ColorizeManager::Get(COLOR_CODE_SPACE); - etk::Color<> & myColorTab = ColorizeManager::Get(COLOR_CODE_TAB); + // get color : + Colorize * myColor = ColorizeManager::get("normal"); + Colorize * myColorSel = ColorizeManager::get("SelectedText"); + etk::Color<> & myColorSpace = ColorizeManager::get(COLOR_CODE_SPACE); + etk::Color<> & myColorTab = ColorizeManager::get(COLOR_CODE_TAB); Colorize * selectColor = NULL; - int mylen = m_EdnBuf.Size(); + int mylen = m_EdnBuf.size(); int32_t x_base=nbColoneForLineNumber*letterWidth; int32_t idX = 0; - int64_t startTime = ewol::GetTime(); + int64_t startTime = ewol::getTime(); int displayLines = 0; // Regenerate the colorizing if necessary ... displayHLData_ts m_displayLocalSyntax; m_EdnBuf.HightlightGenerateLines(m_displayLocalSyntax, displayStartBufferPos, m_displaySize.y()); - int64_t stopTime = ewol::GetTime(); + int64_t stopTime = ewol::getTime(); APPL_DEBUG("Parsing Highlight = " << stopTime - startTime << " micro-s"); uniChar_t displayChar[MAX_EXP_CHAR_LEN]; @@ -367,36 +367,36 @@ int32_t BufferText::Display(ewol::Text& OOText, y = sizeY - y; y -= letterHeight; - OOText.SetClippingMode(false); - DrawLineNumber(&OOText, x_base, sizeY, nbColoneForLineNumber, currentLineID, y); + OOText.setClippingMode(false); + drawLineNumber(&OOText, x_base, sizeY, nbColoneForLineNumber, currentLineID, y); int32_t pixelX = x_base + SEPARATION_SIZE_LINE_NUMBER; vec3 drawClippingPos(0,0,-0.5); vec3 drawClippingSize(sizeX, sizeY, 1); - OOText.SetClippingWidth(vec3((float)pixelX, 0.0f, -0.5f), + OOText.setClippingWidth(vec3((float)pixelX, 0.0f, -0.5f), vec3((float)(sizeX - drawClippingPos.x()), (float)sizeY, 0.5f) ); - // Clear the line intexation : - m_elmentList.Clear(); + // clear the line intexation : + m_elmentList.clear(); // every char element is register to find the diplay pos when mouse event arrive CharElement tmpElementProperty; tmpElementProperty.m_yOffset = y; tmpElementProperty.m_xOffset = 0; tmpElementProperty.m_ySize = 10; tmpElementProperty.m_bufferPos = displayStartBufferPos; - m_elmentList.PushBack(tmpElementProperty); + m_elmentList.pushBack(tmpElementProperty); vec3 tmpCursorPosition(0, 0, -1); //Cursor is display only at the end to be all time over the background ... (-1 in z no cursor) float lineMaxSize = 0.0; - for (iii=displayStartBufferPos; iii=0 && y >= -2*letterHeight; iii = new_i) { + for (iii=displayStartBufferPos; iii= 0 && y >= -2*letterHeight; iii = new_i) { //APPL_DEBUG("display pos =" << y); int displaywidth; uint32_t currentChar = '\0'; new_i = iii; // update the element buffer pos: tmpElementProperty.m_bufferPos = new_i; - displaywidth = m_EdnBuf.GetExpandedChar(new_i, idX, displayChar, currentChar); + displaywidth = m_EdnBuf.getExpandedChar(new_i, idX, displayChar, currentChar); int32_t drawSize = 0; // update display position : @@ -408,46 +408,46 @@ int32_t BufferText::Display(ewol::Text& OOText, //APPL_INFO("diplay element=" << new_i); if (currentChar!='\n') { selectColor = myColor; - HLColor = m_EdnBuf.GetElementColorAtPosition(m_displayLocalSyntax, iii); + HLColor = m_EdnBuf.getElementColorAtPosition(m_displayLocalSyntax, iii); if (HLColor != NULL) { if (HLColor->patern != NULL) { - selectColor = HLColor->patern->GetColor(); + selectColor = HLColor->patern->getColor(); } } - OOText.SetColorBg(etk::color::none); + OOText.setColorBg(etk::color::none); if( true == selHave && selStart <= iii && selEnd > iii) { selectColor = myColorSel; - OOText.SetColorBg(selectColor->GetBG() ); + OOText.setColorBg(selectColor->getBG() ); } else { - if(false == selectColor->HaveBg()) { + if(false == selectColor->haveBg()) { if( currentChar == ' ' - && globals::IsSetDisplaySpaceChar() == true ) + && globals::isSetDisplaySpaceChar() == true ) { - OOText.SetColorBg(myColorSpace); + OOText.setColorBg(myColorSpace); } else if( currentChar == '\t' - && globals::IsSetDisplayTabChar() == true ) + && globals::isSetDisplayTabChar() == true ) { - OOText.SetColorBg(myColorTab); + OOText.setColorBg(myColorTab); } } else { - OOText.SetColorBg(selectColor->GetBG()); + OOText.setColorBg(selectColor->getBG()); } } - tmpElementProperty.m_ySize = 20;//OOText.GetHeight(); - OOText.SetColor(selectColor->GetFG() ); - //OOText.SetColorBg(selectColor->GetFG()); - OOText.SetFontBold(selectColor->GetBold()); - OOText.SetFontItalic(selectColor->GetItalic()); + tmpElementProperty.m_ySize = 20;//OOText.getHeight(); + OOText.setColor(selectColor->getFG() ); + //OOText.setColorBg(selectColor->getFG()); + OOText.setFontBold(selectColor->getBold()); + OOText.setFontItalic(selectColor->getItalic()); myStringToDisplay = displayChar; - OOText.SetPos(vec3(textPos.x(), textPos.y(), 0.0f) ); - OOText.Print(myStringToDisplay); + OOText.setPos(vec3(textPos.x(), textPos.y(), 0.0f) ); + OOText.print(myStringToDisplay); // To update the display position - drawSize = OOText.GetPos().x() - textPos.x(); + drawSize = OOText.getPos().x() - textPos.x(); //APPL_DEBUG("add element : " << tmpElementProperty.m_yOffset << "," << tmpElementProperty.m_xOffset); - m_elmentList.PushBack(tmpElementProperty); + m_elmentList.pushBack(tmpElementProperty); } idX += displaywidth; @@ -458,7 +458,7 @@ int32_t BufferText::Display(ewol::Text& OOText, lineMaxSize += drawSize; pixelX += drawSize; // move to next line ... - if (currentChar=='\n') { + if (currentChar == '\n') { maxSize.setX(etk_max(lineMaxSize, maxSize.x())); lineMaxSize = 0.0; idX =0; @@ -467,37 +467,37 @@ int32_t BufferText::Display(ewol::Text& OOText, //APPL_DEBUG("display pos =" << y); displayLines++; currentLineID++; - OOText.SetClippingMode(false); - OOText.SetFontBold(false); - OOText.SetFontItalic(false); - DrawLineNumber(&OOText, x_base, sizeY, nbColoneForLineNumber, currentLineID, y); - OOText.SetClippingMode(true); + OOText.setClippingMode(false); + OOText.setFontBold(false); + OOText.setFontItalic(false); + drawLineNumber(&OOText, x_base, sizeY, nbColoneForLineNumber, currentLineID, y); + OOText.setClippingMode(true); // add elements : - m_elmentList.PushBack(tmpElementProperty); + m_elmentList.pushBack(tmpElementProperty); } } - //APPL_DEBUG("end at pos buf =" << iii << " / " << m_EdnBuf.Size()); + //APPL_DEBUG("end at pos buf =" << iii << " / " << m_EdnBuf.size()); // special case : the cursor is at the end of the buffer... if (m_cursorPos == iii) { tmpCursorPosition = vec3(pixelX - offsetX, y, 0); } if (tmpCursorPosition.z()!=-1) { // display the cursor: - OOText.SetPos(tmpCursorPosition); - OOText.SetColor(ColorizeManager::Get(COLOR_CODE_CURSOR)); - OOText.SetColorBg(ColorizeManager::Get(COLOR_CODE_CURSOR)); - OOText.PrintCursor(false); + OOText.setPos(tmpCursorPosition); + OOText.setColor(ColorizeManager::get(COLOR_CODE_CURSOR)); + OOText.setColorBg(ColorizeManager::get(COLOR_CODE_CURSOR)); + OOText.printCursor(false); } - // Display the 80 colomn limit line : + // display the 80 colomn limit line : - OOText.SetClippingMode(false); - OOText.GetDrawing().SetThickness(2); - OOText.GetDrawing().SetColor(etk::Color<>(200,200,0,255)); - OOText.GetDrawing().SetPos(vec2((float)((nbColoneForLineNumber+80)*tmpLetterSize.x()), 0.0f)); - OOText.GetDrawing().LineRel(vec2(0.0f, 2500.0f)); + OOText.setClippingMode(false); + OOText.getDrawing().setThickness(2); + OOText.getDrawing().setColor(etk::Color<>(200,200,0,255)); + OOText.getDrawing().setPos(vec2((float)((nbColoneForLineNumber+80)*tmpLetterSize.x()), 0.0f)); + OOText.getDrawing().lineRel(vec2(0.0f, 2500.0f)); // set the maximum size for the display ... - SetMaximumSize(maxSize); - int64_t stopTime2 = ewol::GetTime(); + setMaximumSize(maxSize); + int64_t stopTime2 = ewol::getTime(); APPL_DEBUG("DRAW text (brut) = " << stopTime2 - stopTime << " micro-s"); return 0; @@ -505,37 +505,37 @@ int32_t BufferText::Display(ewol::Text& OOText, -int32_t BufferText::GetMousePosition(vec2 pos) +int32_t BufferText::getMousePosition(vec2 pos) { bool inLineDone=false; //APPL_DEBUG("try to find in : " << width << "," << height); - for(int32_t iii=0; iii=m_elmentList[iii].m_yOffset + if( pos.y() >= m_elmentList[iii].m_yOffset && pos.y() note : Some problem can appear here when the size are not the same ... + // we find the line (int theory) == > note : Some problem can appear here when the size are not the same ... // this is to prevent multiple size font ... inLineDone = true; - //APPL_DEBUG(" ==> " << m_elmentList[iii+1].m_xOffset << "> " << pos.x << " >=" << m_elmentList[iii].m_xOffset); + //APPL_DEBUG(" == > " << m_elmentList[iii+1].m_xOffset << "> " << pos.x << " >= " << m_elmentList[iii].m_xOffset); } } // we detected the line if(true == inLineDone) { - if( pos.x()>=m_elmentList[iii].m_xOffset + if( pos.x() >= m_elmentList[iii].m_xOffset && pos.x()=m_elmentList[iii+1].m_xOffset) { + } else if (m_elmentList[iii].m_xOffset >= m_elmentList[iii+1].m_xOffset) { // prevent "end of line" cursor pos ... return m_elmentList[iii].m_bufferPos; } } } - if (m_elmentList.Size()>0) { - if(pos.y()0) { + if(pos.y()"); if (m_cursorPos > 0) { - SetInsertPosition(m_cursorPos - 1); + setInsertPosition(m_cursorPos - 1); } break; case ewol::keyEvent::keyboardRight: //APPL_INFO("keyEvent : "); - if (m_cursorPos < m_EdnBuf.Size() ) { - SetInsertPosition(m_cursorPos + 1); + if (m_cursorPos < m_EdnBuf.size() ) { + setInsertPosition(m_cursorPos + 1); } break; case ewol::keyEvent::keyboardUp: @@ -841,11 +841,11 @@ void BufferText::cursorMove(ewol::keyEvent::keyboard_te moveTypeEvent) break; case ewol::keyEvent::keyboardStart: //APPL_INFO("keyEvent : "); - SetInsertPosition(m_EdnBuf.StartOfLine(m_cursorPos) ); + setInsertPosition(m_EdnBuf.StartOfLine(m_cursorPos) ); break; case ewol::keyEvent::keyboardEnd: //APPL_INFO("keyEvent : "); - SetInsertPosition(m_EdnBuf.EndOfLine(m_cursorPos) ); + setInsertPosition(m_EdnBuf.EndOfLine(m_cursorPos) ); break; default: //LastUpDownoutputPosition = -1; @@ -866,13 +866,13 @@ void BufferText::cursorMove(ewol::keyEvent::keyboard_te moveTypeEvent) * @return --- * */ -vec2 BufferText::GetPosition(int32_t fontId, bool& centerRequested) +vec2 BufferText::getPosition(int32_t fontId, bool& centerRequested) { centerRequested = m_centerRequested; m_centerRequested = false; vec2 outputPosition(0,0); - // Display position (Y mode): + // display position (Y mode): APPL_INFO("change the position : " << m_cursorPos); // get the line id of the curent position of the cursor : outputPosition.setY(m_EdnBuf.CountLines(0, m_cursorPos)); @@ -884,10 +884,10 @@ vec2 BufferText::GetPosition(int32_t fontId, bool& centerRequested) // get font porperties : // TODO : change this : - // TODO : Set it back ... + // TODO : set it back ... /* - float letterWidth = ewol::GetWidth(fontId, "A"); - float letterHeight = ewol::GetHeight(fontId); + float letterWidth = ewol::getWidth(fontId, "A"); + float letterHeight = ewol::getHeight(fontId); */ float letterWidth = 10; float letterHeight = 15; @@ -901,7 +901,7 @@ vec2 BufferText::GetPosition(int32_t fontId, bool& centerRequested) vec2 outputPosition(0,0); //APPL_DEBUG(" -------------------------------------------------"); outputPosition.y = m_EdnBuf.CountLines(0, m_cursorPos); - //APPL_DEBUG(" cursor position : " << m_cursorPos << " ==> ligne=" << outputPosition.y); + //APPL_DEBUG(" cursor position : " << m_cursorPos << " == > ligne=" << outputPosition.y); outputPosition.x = 0; m_displayStartPixelX = 0; @@ -925,28 +925,28 @@ vec2 BufferText::GetPosition(int32_t fontId, bool& centerRequested) * @return --- * */ -void BufferText::AddChar(uniChar_t unicodeData) +void BufferText::addChar(uniChar_t unicodeData) { int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd; bool SelectionIsRect; - bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); + bool haveSelectionActive = m_EdnBuf.getSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); if (unicodeData == 0x09) { if (false == haveSelectionActive) { etk::Vector tmpVect; - tmpVect.PushBack(0x09); - m_EdnBuf.Insert(m_cursorPos, tmpVect); - SetInsertPosition(m_cursorPos+1, true); + tmpVect.pushBack(0x09); + m_EdnBuf.insert(m_cursorPos, tmpVect); + setInsertPosition(m_cursorPos+1, true); } else { // Indent depend of the multiline in the selection ... // count the number of line : int32_t nbSelectedLines = m_EdnBuf.CountLines(SelectionStart, SelectionEnd); if (0 == nbSelectedLines) { etk::Vector tmpVect; - tmpVect.PushBack(0x09); + tmpVect.pushBack(0x09); m_EdnBuf.ReplaceSelected(tmpVect); - SetInsertPosition(SelectionStart+tmpVect.Size(), true); + setInsertPosition(SelectionStart+tmpVect.size(), true); } else { - if (true == false ) { //ewol::GetCurrentSpecialKeyStatus().IsSetShift() ) { + if (true == false ) { //ewol::getCurrentSpecialKeyStatus().isSetShift() ) { m_cursorPos = m_EdnBuf.UnIndent(); } else { m_cursorPos = m_EdnBuf.Indent(); @@ -955,14 +955,14 @@ void BufferText::AddChar(uniChar_t unicodeData) } } else if (unicodeData == '\n') { etk::Vector tmpVect; - if (true == false ) { //ewol::GetCurrentSpecialKeyStatus().IsSetShift()) { - tmpVect.PushBack('\r'); + if (true == false ) { //ewol::getCurrentSpecialKeyStatus().isSetShift()) { + tmpVect.pushBack('\r'); } else { - tmpVect.PushBack('\n'); - // if Auto indent Enable ==> we get the start of the previous line and add it to tne new one - if (true == globals::IsSetAutoIndent() ) { + tmpVect.pushBack('\n'); + // if Auto indent enable == > we get the start of the previous line and add it to tne new one + if (true == globals::isSetAutoIndent() ) { int32_t l_lineStart; - // Get the begin of the line or the begin of the line befor selection + // get the begin of the line or the begin of the line befor selection if (false == haveSelectionActive) { l_lineStart = m_EdnBuf.StartOfLine(m_cursorPos); } else { @@ -971,86 +971,86 @@ void BufferText::AddChar(uniChar_t unicodeData) // add same characters in the temporar buffer for (int32_t kk=l_lineStart; kk pos=" << m_cursorPos); if (false == haveSelectionActive) { - m_EdnBuf.Remove(m_cursorPos, m_cursorPos+1); + m_EdnBuf.remove(m_cursorPos, m_cursorPos+1); } else { - m_EdnBuf.RemoveSelected(); - SetInsertPosition(SelectionStart, true); + m_EdnBuf.removeSelected(); + setInsertPosition(SelectionStart, true); } } else if (unicodeData == 0x08) { //APPL_INFO("keyEvent : pos=" << m_cursorPos); if (false == haveSelectionActive) { - m_EdnBuf.Remove(m_cursorPos-1, m_cursorPos); - SetInsertPosition(m_cursorPos-1, true); + m_EdnBuf.remove(m_cursorPos-1, m_cursorPos); + setInsertPosition(m_cursorPos-1, true); } else { - m_EdnBuf.RemoveSelected(); - SetInsertPosition(SelectionStart, true); + m_EdnBuf.removeSelected(); + setInsertPosition(SelectionStart, true); } } else { // normal adding char ... - if (true == m_EdnBuf.GetUTF8Mode()) { + if (true == m_EdnBuf.getUTF8Mode()) { char tmpUTF8[16]; - unicodeData.GetUtf8(tmpUTF8); + unicodeData.getUtf8(tmpUTF8); etk::Vector tmpVect; int32_t localOfset = strlen(tmpUTF8); - tmpVect.PushBack((int8_t*)tmpUTF8, localOfset); + tmpVect.pushBack((int8_t*)tmpUTF8, localOfset); if (false == haveSelectionActive) { - m_EdnBuf.Insert(m_cursorPos, tmpVect); - SetInsertPosition(m_cursorPos+localOfset, true); + m_EdnBuf.insert(m_cursorPos, tmpVect); + setInsertPosition(m_cursorPos+localOfset, true); } else { m_EdnBuf.ReplaceSelected(tmpVect); - SetInsertPosition(SelectionStart+localOfset, true); + setInsertPosition(SelectionStart+localOfset, true); } } else { // convert in the Good ISO format : char output_ISO; - unicode::convertUnicodeToIso(m_EdnBuf.GetCharsetType(), unicodeData, output_ISO); - //printf(" insert : \"%s\"==> 0x%08x=%d ", UTF8data, (unsigned int)output_ISO, (int)output_ISO); + unicode::convertUnicodeToIso(m_EdnBuf.getCharsetType(), unicodeData, output_ISO); + //printf(" insert : \"%s\" == > 0x%08x=%d ", UTF8data, (unsigned int)output_ISO, (int)output_ISO); etk::Vector tmpVect; - tmpVect.PushBack(output_ISO); + tmpVect.pushBack(output_ISO); if (false == haveSelectionActive) { - m_EdnBuf.Insert(m_cursorPos, tmpVect); - SetInsertPosition(m_cursorPos+1, true); + m_EdnBuf.insert(m_cursorPos, tmpVect); + setInsertPosition(m_cursorPos+1, true); } else { m_EdnBuf.ReplaceSelected(tmpVect); - SetInsertPosition(SelectionStart+1, true); + setInsertPosition(SelectionStart+1, true); } } } - SetModify(true); + setModify(true); RequestUpdateOfThePosition(); } -int32_t BufferText::FindLine(etk::UString &data) +int32_t BufferText::findLine(etk::UString &data) { - if ( 0 == data.Size()) { + if ( 0 == data.size()) { APPL_WARNING("no search data"); return 0; } APPL_INFO("Search data line : \"" << data << "\""); etk::Vector mVectSearch; - mVectSearch = data.GetVector(); + mVectSearch = data.getVector(); //APPL_INFO("search data Forward : startSearchPos=" << startSearchPos ); /* int32_t foundPos; @@ -1071,20 +1071,20 @@ void BufferText::JumpAtLine(int32_t newLine) int32_t positionLine = m_EdnBuf.CountForwardNLines(0, newLine); m_EdnBuf.Unselect(); APPL_DEBUG("jump at the line : " << newLine ); - SetInsertPosition(positionLine); + setInsertPosition(positionLine); m_centerRequested = true; RequestUpdateOfThePosition(); } /** - * @brief Get the current line (to know where to jump) + * @brief get the current line (to know where to jump) * * @param --- * * @return Return the current line number * */ -int32_t BufferText::GetCurrentLine(void) +int32_t BufferText::getCurrentLine(void) { return m_EdnBuf.CountLines(0, m_cursorPos); } @@ -1097,7 +1097,7 @@ void BufferText::Search(etk::UString &data, bool back, bool caseSensitive, bool int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd; bool SelectionIsRect; - bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); + bool haveSelectionActive = m_EdnBuf.getSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); int32_t startSearchPos = m_cursorPos; if (true == haveSelectionActive) { @@ -1108,7 +1108,7 @@ void BufferText::Search(etk::UString &data, bool back, bool caseSensitive, bool } } - if ( 0 == data.Size()) { + if ( 0 == data.size()) { APPL_WARNING("no search data"); return; } @@ -1120,30 +1120,30 @@ void BufferText::Search(etk::UString &data, bool back, bool caseSensitive, bool if( false == findSomething && true == wrap) { - //APPL_INFO("WrapMode !!! 0 ==> end"); + //APPL_INFO("WrapMode !!! 0 == > end"); findSomething = m_EdnBuf.SearchForward(0, data, &foundPos, &foundPosEnd, caseSensitive); } // if find data : if (true == findSomething) { // select new position - SetInsertPosition(foundPosEnd); + setInsertPosition(foundPosEnd); m_EdnBuf.Select(foundPos, foundPosEnd); } } else { - //APPL_INFO("search data Backward : " << data.GetDirectPointer() ); + //APPL_INFO("search data Backward : " << data.getDirectPointer() ); int32_t foundPos; int32_t foundPosEnd; bool findSomething = m_EdnBuf.SearchBackward(startSearchPos, data, &foundPos, &foundPosEnd, caseSensitive); if( false == findSomething && true == wrap) { - //APPL_INFO("WrapMode !!! end ==> 0"); - findSomething = m_EdnBuf.SearchBackward(m_EdnBuf.Size(), data, &foundPos, &foundPosEnd, caseSensitive); + //APPL_INFO("WrapMode !!! end == > 0"); + findSomething = m_EdnBuf.SearchBackward(m_EdnBuf.size(), data, &foundPos, &foundPosEnd, caseSensitive); } // if find data : if (true == findSomething) { // select new position - SetInsertPosition(foundPos); + setInsertPosition(foundPos); m_EdnBuf.Select(foundPos, foundPosEnd); } } @@ -1156,13 +1156,13 @@ void BufferText::Replace(etk::UString &data) { int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd; bool SelectionIsRect; - bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); + bool haveSelectionActive = m_EdnBuf.getSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); if (true == haveSelectionActive) { // Replace Data : int32_t size = m_EdnBuf.ReplaceSelected(data); - SetInsertPosition(SelectionStart + size); + setInsertPosition(SelectionStart + size); } - SetModify(true); + setModify(true); } @@ -1179,10 +1179,10 @@ void BufferText::Copy(ewol::clipBoard::clipboardListe_te clipboardID) etk::UString mVect; // get the curent selected data if (true == m_EdnBuf.SelectHasSelection() ) { - m_EdnBuf.GetSelectionText(mVect); + m_EdnBuf.getSelectionText(mVect); } // copy data in the click board : - ewol::clipBoard::Set(clipboardID, mVect); + ewol::clipBoard::set(clipboardID, mVect); } @@ -1199,18 +1199,18 @@ void BufferText::Cut(ewol::clipBoard::clipboardListe_te clipboardID) int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd; bool SelectionIsRect; - bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); + bool haveSelectionActive = m_EdnBuf.getSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); // copy data Copy(clipboardID); // remove data : if (true == haveSelectionActive ) { APPL_INFO("REMOVE SELECTION"); - m_EdnBuf.RemoveSelected(); + m_EdnBuf.removeSelected(); m_cursorPos = SelectionStart; } RequestUpdateOfThePosition(); - SetModify(true); + setModify(true); } @@ -1226,11 +1226,11 @@ void BufferText::Paste(ewol::clipBoard::clipboardListe_te clipboardID) { etk::UString mVect; // copy data from the click board : - mVect = ewol::clipBoard::Get(clipboardID); + mVect = ewol::clipBoard::get(clipboardID); int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd; bool SelectionIsRect; - bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); + bool haveSelectionActive = m_EdnBuf.getSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); if (true == haveSelectionActive ) { // replace data @@ -1238,11 +1238,11 @@ void BufferText::Paste(ewol::clipBoard::clipboardListe_te clipboardID) m_cursorPos = SelectionStart + size; } else { // insert data - int32_t size = m_EdnBuf.Insert(m_cursorPos, mVect); + int32_t size = m_EdnBuf.insert(m_cursorPos, mVect); m_cursorPos += size; } RequestUpdateOfThePosition(); - SetModify(true); + setModify(true); } @@ -1250,9 +1250,9 @@ void BufferText::Undo(void) { int32_t newPos = m_EdnBuf.Undo(); if (newPos >= 0) { - SetInsertPosition(newPos, true); + setInsertPosition(newPos, true); RequestUpdateOfThePosition(); - SetModify(true); + setModify(true); } } @@ -1260,15 +1260,15 @@ void BufferText::Redo(void) { int32_t newPos = m_EdnBuf.Redo(); if (newPos >= 0) { - SetInsertPosition(newPos, true); + setInsertPosition(newPos, true); RequestUpdateOfThePosition(); - SetModify(true); + setModify(true); } } -void BufferText::SetCharset(unicode::charset_te newCharset) +void BufferText::setCharset(unicode::charset_te newCharset) { - m_EdnBuf.SetCharsetType(newCharset); + m_EdnBuf.setCharsetType(newCharset); } diff --git a/sources/appl/Buffer/BufferText.h b/sources/appl/Buffer/BufferText.h index 1c180b2..86c24ac 100644 --- a/sources/appl/Buffer/BufferText.h +++ b/sources/appl/Buffer/BufferText.h @@ -42,7 +42,7 @@ typedef struct{ uint32_t startLineDisplay; //!< First line display. uint32_t startColomnDisplay; //!< First Colomn displayed uint32_t diplayableColomn; //!< NB colomn that can be displayed - uint32_t diplayableLine; //!< NB Line that can be displayed + uint32_t diplayableLine; //!< NB line that can be displayed }infoStatBuffer_ts; @@ -56,31 +56,31 @@ class BufferText bool m_updatePositionRequested; //!< if a position xhange in the windows ... vec2 m_maximumSize; //!< current maxSize of the buffer public: - void SetModify(bool status); - virtual vec2 GetBorderSize(void); + void setModify(bool status); + virtual vec2 getBorderSize(void); void RequestUpdateOfThePosition(void) { m_updatePositionRequested = true; }; - void SetMaximumSize(vec2 maxSize) { m_maximumSize = maxSize; }; - bool NeedToUpdateDisplayPosition(void); - vec2 GetMaxSize(void) { return m_maximumSize; }; - bool IsModify(void); + void setMaximumSize(vec2 maxSize) { m_maximumSize = maxSize; }; + bool needToUpdateDisplayPosition(void); + vec2 getMaxSize(void) { return m_maximumSize; }; + bool isModify(void); public: - etk::FSNode GetFileName(void) { return m_fileName; }; + etk::FSNode getFileName(void) { return m_fileName; }; - void SetFileName(etk::FSNode &newName) + void setFileName(etk::FSNode &newName) { m_fileName = newName; m_haveName = true; NameChange(); }; - void SetFileName(etk::UString &newName) + void setFileName(etk::UString &newName) { - m_fileName.SetName(newName); + m_fileName.setName(newName); m_haveName = true; NameChange(); }; - bool HaveName(void) + bool haveName(void) { return m_haveName; } @@ -90,12 +90,12 @@ class BufferText virtual ~BufferText(void); void Save(void); - void GetInfo(infoStatBuffer_ts &infoToUpdate); - void SetLineDisplay(uint32_t lineNumber); - int32_t Display(ewol::Text& OOText, + void getInfo(infoStatBuffer_ts &infoToUpdate); + void setLineDisplay(uint32_t lineNumber); + 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(uniChar_t unicodeData); void cursorMove(ewol::keyEvent::keyboard_te moveTypeEvent); void MouseSelectFromCursorTo(vec2 pos); void MouseEvent(vec2 pos); @@ -108,22 +108,22 @@ class BufferText void Search(etk::UString &data, bool back, bool caseSensitive, bool wrap, bool regExp); void Replace(etk::UString &data); - int32_t FindLine(etk::UString &data); + int32_t findLine(etk::UString &data); void JumpAtLine(int32_t newLine); - int32_t GetCurrentLine(void); + int32_t getCurrentLine(void); - void RemoveLine(void); + void removeLine(void); void SelectAll(void); void SelectNone(void); void Undo(void); void Redo(void); - void SetCharset(unicode::charset_te newCharset); - int32_t GetNumberOfLine(void); + void setCharset(unicode::charset_te newCharset); + int32_t getNumberOfLine(void); protected: void NameChange(void); private: - int32_t GetLineNumberNumberOfElement(void); + int32_t getLineNumberNumberOfElement(void); // Direct buffer IO EdnBuf m_EdnBuf; //!< buffer associated on this displayer @@ -139,15 +139,15 @@ class BufferText private: bool m_centerRequested; public: - virtual vec2 GetPosition(int32_t fontId, bool& centerRequested); + virtual vec2 getPosition(int32_t fontId, bool& centerRequested); private: bool TextDMoveUp(int32_t offset); bool TextDMoveDown(int32_t offset); - void SetInsertPosition(int32_t newPosition, bool insertChar = false); + void setInsertPosition(int32_t newPosition, bool insertChar = false); - int32_t GetMousePosition(vec2 pos); + int32_t getMousePosition(vec2 pos); - void DrawLineNumber(ewol::Text* OOText, int32_t sizeX, int32_t sizeY, int32_t nbColomn, int32_t lineNumber, int32_t positionY); + void drawLineNumber(ewol::Text* OOText, int32_t sizeX, int32_t sizeY, int32_t nbColomn, int32_t lineNumber, int32_t positionY); }; diff --git a/sources/appl/Buffer/EdnBuf/EdnBuf.cpp b/sources/appl/Buffer/EdnBuf/EdnBuf.cpp index e932446..606eaaf 100644 --- a/sources/appl/Buffer/EdnBuf/EdnBuf.cpp +++ b/sources/appl/Buffer/EdnBuf/EdnBuf.cpp @@ -34,7 +34,7 @@ static const char *ControlCodeTable[32] = { */ EdnBuf::EdnBuf(void) { - // TODO : Set it configurable !!! + // TODO : set it configurable !!! m_tabDist = 8; m_useTabs = true; @@ -61,7 +61,7 @@ EdnBuf::EdnBuf(void) */ EdnBuf::~EdnBuf(void) { - // TODO : Remove history and Future + // TODO : remove history and Future } /** @@ -80,7 +80,7 @@ bool EdnBuf::DumpIn(etk::FSNode &file) /** - * @brief Load in the current file open + * @brief load in the current file open * * @param[in,out] myFile pointer on the file where data might be read * @@ -91,10 +91,10 @@ bool EdnBuf::DumpFrom(etk::FSNode &file) { if (true == m_data.DumpFrom(file) ) { // set no selection - UpdateSelection(0, 0, m_data.Size() ); + updateSelection(0, 0, m_data.size() ); // generate HighLight CleanHighLight(); - GenerateHighLightAt(0, m_data.Size()); + generateHighLightAt(0, m_data.size()); CountNumberOfLines(); return true; } @@ -102,53 +102,53 @@ bool EdnBuf::DumpFrom(etk::FSNode &file) } -void EdnBuf::GetAll(etk::Vector &text) +void EdnBuf::getAll(etk::Vector &text) { // Clean output vector - text.Clear(); - // Set data on the vector - text = m_data.Get(0, m_data.Size()); + text.clear(); + // set data on the vector + text = m_data.get(0, m_data.size()); } -void EdnBuf::SetAll(etk::Vector &text) +void EdnBuf::setAll(etk::Vector &text) { etk::Vector deletedText; // extract all data of the buffer : - GetAll(deletedText); + getAll(deletedText); - // Remove all data in the buffer: - m_data.Clear(); + // remove all data in the buffer: + m_data.clear(); // inset text data : - m_data.Insert(0, text); + m_data.insert(0, text); // Zero all of the existing selections - UpdateSelection(0, deletedText.Size(), 0); + updateSelection(0, deletedText.size(), 0); // Call the modification Event Manager - eventModification(0, m_data.Size(), deletedText); + eventModification(0, m_data.size(), deletedText); } -void EdnBuf::GetRange(int32_t start, int32_t end, etk::Vector &output) +void EdnBuf::getRange(int32_t start, int32_t end, etk::Vector &output) { - // Remove all data ... - output.Clear(); + // remove all data ... + output.clear(); // import data : - output = m_data.Get(start, end-start); - //APPL_DEBUG("request start=" << start << " end="<< end << " size="<< end-start << " result size=" << output.Size() ); + output = m_data.get(start, end-start); + //APPL_DEBUG("request start=" << start << " end="<< end << " size="<< end-start << " result size=" << output.size() ); } -void EdnBuf::GetRange(int32_t start, int32_t end, etk::UString &output) +void EdnBuf::getRange(int32_t start, int32_t end, etk::UString &output) { - // Remove all data ... + // remove all data ... output = ""; // import data : - etk::Vector localOutput = m_data.Get(start, end-start); + etk::Vector localOutput = m_data.get(start, end-start); // transcript in UNICODE ... if (true == m_isUtf8) { - localOutput.PushBack('\0'); + localOutput.pushBack('\0'); output = (char*)&localOutput[0]; } else { etk::Vector tmpUnicodeData; @@ -156,12 +156,12 @@ void EdnBuf::GetRange(int32_t start, int32_t end, etk::UString &output) convertIsoToUnicode(m_charsetType, localOutput, tmpUnicodeData); output = tmpUnicodeData; } - //APPL_DEBUG("request start=" << start << " end="<< end << " size="<< end-start << " result size=" << output.Size() ); + //APPL_DEBUG("request start=" << start << " end="<< end << " size="<< end-start << " result size=" << output.size() ); } /** - * @brief Get an element at the selected position + * @brief get an element at the selected position * * @param[in] pos Charecters Position, [0..n] * @@ -170,13 +170,13 @@ void EdnBuf::GetRange(int32_t start, int32_t end, etk::UString &output) */ int8_t EdnBuf::operator[] (int32_t pos) const { - int8_t res = m_data.Get(pos); + int8_t res = m_data.get(pos); return res; } /** - * @brief Insert Data in the Buffer + * @brief insert Data in the Buffer * * @param[in] pos Position in the Buffer * @param[in] insertText Text to insert @@ -184,28 +184,28 @@ int8_t EdnBuf::operator[] (int32_t pos) const * @return --- * */ -int32_t EdnBuf::Insert(int32_t pos, etk::Vector &insertText) +int32_t EdnBuf::insert(int32_t pos, etk::Vector &insertText) { // if pos is not contiguous to existing text, make it - pos = etk_avg(0, pos, m_data.Size() ); + pos = etk_avg(0, pos, m_data.size() ); // insert Data int32_t sizeInsert=LocalInsert(pos, insertText); // Call the redisplay ... etk::Vector deletedText; - eventModification(pos, insertText.Size(), deletedText); + eventModification(pos, insertText.size(), deletedText); return sizeInsert; } -int32_t EdnBuf::Insert(int32_t pos, etk::UString &insertText) +int32_t EdnBuf::insert(int32_t pos, etk::UString &insertText) { // if pos is not contiguous to existing text, make it - pos = etk_avg(0, pos, m_data.Size() ); + pos = etk_avg(0, pos, m_data.size() ); // insert Data int32_t sizeInsert=LocalInsert(pos, insertText); // Call the redisplay ... etk::Vector deletedText; - eventModification(pos, insertText.Size(), deletedText); + eventModification(pos, insertText.size(), deletedText); return sizeInsert; } @@ -225,11 +225,11 @@ int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::Vector &insertT return 0; } etk::Vector deletedText; - GetRange(start, end, deletedText); + getRange(start, end, deletedText); m_data.Replace(start, end-start, insertText); // update internal elements - eventModification(start, insertText.Size(), deletedText); - return insertText.Size(); + eventModification(start, insertText.size(), deletedText); + return insertText.size(); } int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::UString &insertText) @@ -238,37 +238,37 @@ int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::UString &insertText) return 0; } etk::Vector deletedText; - GetRange(start, end, deletedText); + getRange(start, end, deletedText); etk::Vector tmpInsertText; if (true == m_isUtf8) { etk::Char tmpChar = insertText.c_str(); const char * tmpPointer = tmpChar; while (*tmpPointer != '\0') { - tmpInsertText.PushBack(*tmpPointer++); + tmpInsertText.pushBack(*tmpPointer++); } } else { - etk::Vector tmppp = insertText.GetVector(); + etk::Vector tmppp = insertText.getVector(); convertUnicodeToIso(m_charsetType, tmppp, tmpInsertText); } - if (tmpInsertText.Size()>0) { - if (tmpInsertText[tmpInsertText.Size()-1] == '\0') { - tmpInsertText.PopBack(); + if (tmpInsertText.size()>0) { + if (tmpInsertText[tmpInsertText.size()-1] == '\0') { + tmpInsertText.popBack(); } } - if (tmpInsertText.Size()>0) { - if (tmpInsertText[tmpInsertText.Size()-1] == '\0') { - tmpInsertText.PopBack(); + if (tmpInsertText.size()>0) { + if (tmpInsertText[tmpInsertText.size()-1] == '\0') { + tmpInsertText.popBack(); } } m_data.Replace(start, end-start, tmpInsertText); // update internal elements - eventModification(start, tmpInsertText.Size(), deletedText); - return tmpInsertText.Size(); + eventModification(start, tmpInsertText.size(), deletedText); + return tmpInsertText.size(); } /** - * @brief Remove data between [start..end] + * @brief remove data between [start..end] * * @param[in] start Position started in the buffer * @param[in] end Position ended in the buffer @@ -276,7 +276,7 @@ int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::UString &insertText) * @return --- * */ -void EdnBuf::Remove(int32_t start, int32_t end) +void EdnBuf::remove(int32_t start, int32_t end) { etk::Vector deletedText; @@ -286,12 +286,12 @@ void EdnBuf::Remove(int32_t start, int32_t end) start = end; end = temp; } - start = etk_avg(0 , start, m_data.Size()); - end = etk_avg(0 , end, m_data.Size()); + start = etk_avg(0 , start, m_data.size()); + end = etk_avg(0 , end, m_data.size()); - // Remove and redisplay - GetRange(start, end, deletedText); - m_data.Remove(start, end - start); + // remove and redisplay + getRange(start, end, deletedText); + m_data.remove(start, end - start); eventModification(start, 0, deletedText); } @@ -300,27 +300,27 @@ int32_t EdnBuf::Indent(void) { int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd; bool SelectionIsRect; - bool haveSelectionActive = GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); + bool haveSelectionActive = getSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); if (false == haveSelectionActive) { return SelectionEnd; } - // Disable selection: + // disable selection: Unselect(); - // Get Range : + // get Range : int32_t l_start = StartOfLine(SelectionStart); int32_t l_end = EndOfLine(SelectionEnd); etk::Vector l_tmpData; - GetRange(l_start, l_end, l_tmpData); + getRange(l_start, l_end, l_tmpData); - l_tmpData.Insert(0, '\n'); - for (int32_t i=1; i l_tmpData; - GetRange(l_start, l_end, l_tmpData); + getRange(l_start, l_end, l_tmpData); - l_tmpData.Insert(0, '\n'); - for (int32_t i=1; i &text) +void EdnBuf::getLineText(int32_t pos, etk::Vector &text) { - GetRange( StartOfLine(pos), EndOfLine(pos), text); + getRange( StartOfLine(pos), EndOfLine(pos), text); } /** - * @brief Find the position of the start of the current line + * @brief find the position of the start of the current line * * @param[in] pos position inside the line whe we need to find the start * @@ -416,7 +416,7 @@ int32_t EdnBuf::StartOfLine(int32_t pos) /** - * @brief Find the position of the end of the current line + * @brief find the position of the end of the current line * * @param[in] pos position inside the line whe we need to find the end * @@ -427,7 +427,7 @@ int32_t EdnBuf::EndOfLine(int32_t pos) { int32_t endPos; if (false == SearchForward(pos, '\n', &endPos)) { - endPos = m_data.Size(); + endPos = m_data.size(); } return endPos; } @@ -444,12 +444,12 @@ int32_t EdnBuf::EndOfLine(int32_t pos) * @return number of displayable char (display char width) * */ -int32_t EdnBuf::GetExpandedChar(int32_t &pos, int32_t indent, char outUTF8[MAX_EXP_CHAR_LEN], uint32_t ¤tChar) +int32_t EdnBuf::getExpandedChar(int32_t &pos, int32_t indent, char outUTF8[MAX_EXP_CHAR_LEN], uint32_t ¤tChar) { int32_t i, nSpaces; - char c = m_data.Get(pos); + char c = m_data.get(pos); currentChar = (uint32_t)c & 0xFF; - /* Convert tabs to spaces */ + /* convert tabs to spaces */ if (c == '\t') { nSpaces = m_tabDist - (indent % m_tabDist); for (i=0; i 4 spaces or less ...) + * @brief generate the real display of character of the output (ex : \t == > 4 spaces or less ...) * * @param[in] c Char that might be converted * @param[in] indent Curent indentation befor the curent char @@ -661,7 +661,7 @@ int32_t EdnBuf::ExpandCharacter(char c, int32_t indent, char outUTF8[MAX_EXP_CHA { int32_t i, nSpaces; - /* Convert tabs to spaces */ + /* convert tabs to spaces */ if (c == '\t') { nSpaces = m_tabDist - (indent % m_tabDist); for (i=0; i m_data.Size() ) { - return m_data.Size(); + } else if (startPos > m_data.size() ) { + return m_data.size(); } int32_t lineCount = 0; //APPL_INFO("startPos=" << startPos << " nLines=" << nLines); int32_t iii = 0; - for(iii = startPos; iii (1) at position=" << myPosIt.Position()+1 ); + //APPL_INFO(" == > (1) at position=" << myPosIt.Position()+1 ); return iii+1; } } } - //APPL_INFO(" ==> (2) at position=" << myPosIt.Position() ); + //APPL_INFO(" == > (2) at position=" << myPosIt.Position() ); return iii; } /** - * @brief Find the first character of the line "nLines" backwards + * @brief find the first character of the line "nLines" backwards * * @param[in,out] startPos Start position to count (this caracter is not counted) - * @param[in,out] nLines number of line to count (if ==0 means find the beginning of the line) + * @param[in,out] nLines number of line to count (if == 0 means find the beginning of the line) * * @return position of the starting the line * @@ -880,22 +880,22 @@ int32_t EdnBuf::CountBackwardNLines(int32_t startPos, int32_t nLines) { if (startPos <= 0) { return 0; - } else if (startPos > m_data.Size() ) { - startPos = m_data.Size(); + } else if (startPos > m_data.size() ) { + startPos = m_data.size(); } //APPL_INFO("startPos=" << startPos << " nLines=" << nLines); int32_t lineCount = -1; - for(int32_t iii = startPos-1; iii>=0 ; iii-- ) { + for(int32_t iii = startPos-1; iii >= 0 ; iii-- ) { if ('\n' == m_data[iii]) { lineCount++; if (lineCount >= nLines) { - //APPL_INFO(" ==> (1) at position=" << myPosIt.Position()+1 ); + //APPL_INFO(" == > (1) at position=" << myPosIt.Position()+1 ); return iii+1; } } } - //APPL_INFO(" ==> (2) at position=0"); + //APPL_INFO(" == > (2) at position=0"); return 0; } @@ -911,10 +911,10 @@ bool EdnBuf::charMatch(char first, char second, bool caseSensitive) } } if(first == second) { - //APPL_DEBUG("charMatch(" << first << ", " << second << ", " << caseSensitive << ") ==> true"); + //APPL_DEBUG("charMatch(" << first << ", " << second << ", " << caseSensitive << ") == > true"); return true; } else { - //APPL_DEBUG("charMatch(" << first << ", " << second << ", " << caseSensitive << ") ==> false"); + //APPL_DEBUG("charMatch(" << first << ", " << second << ", " << caseSensitive << ") == > false"); return false; } } @@ -926,8 +926,8 @@ bool EdnBuf::charMatch(char first, char second, bool caseSensitive) * @param[in] searchVect String to search * @param[out] foundPos Current position founded * - * @return true ==> found data - * @return false ==> not found data + * @return true == > found data + * @return false == > not found data * */ bool EdnBuf::SearchForward(int32_t startPos, etk::UString &search, int32_t *foundPos, int32_t *foundPosEnd, bool caseSensitive) @@ -937,17 +937,17 @@ bool EdnBuf::SearchForward(int32_t startPos, etk::UString &search, int32_t *foun etk::Char tmpChar = search.c_str(); const char * tmpPointer = tmpChar; while (*tmpPointer != '\0') { - searchVect.PushBack(*tmpPointer++); + searchVect.pushBack(*tmpPointer++); } } else { - etk::Vector tmppp = search.GetVector(); + etk::Vector tmppp = search.getVector(); convertUnicodeToIso(m_charsetType, tmppp, searchVect); } // remove the '\0' at the end of the string ... - searchVect.PopBack(); + searchVect.popBack(); int32_t position; - int32_t searchLen = searchVect.Size(); - int32_t dataLen = m_data.Size(); + int32_t searchLen = searchVect.size(); + int32_t dataLen = m_data.size(); char currentChar = '\0'; APPL_INFO(" startPos=" << startPos << " searchLen=" << searchLen); for (position=startPos; position found data - * @return false ==> not found data + * @return true == > found data + * @return false == > not found data * */ bool EdnBuf::SearchBackward(int32_t startPos, etk::UString &search, int32_t *foundPos, int32_t *foundPosEnd, bool caseSensitive) @@ -993,25 +993,25 @@ bool EdnBuf::SearchBackward(int32_t startPos, etk::UString &search, int32_t *fou etk::Char tmpChar = search.c_str(); const char * tmpPointer = tmpChar; while (*tmpPointer != '\0') { - searchVect.PushBack(*tmpPointer++); + searchVect.pushBack(*tmpPointer++); } } else { - etk::Vector tmppp = search.GetVector(); + etk::Vector tmppp = search.getVector(); convertUnicodeToIso(m_charsetType, tmppp, searchVect); } // remove the '\0' at the end of the string ... - searchVect.PopBack(); + searchVect.popBack(); int32_t position; - int32_t searchLen = searchVect.Size(); + int32_t searchLen = searchVect.size(); char currentChar = '\0'; //APPL_INFO(" startPos=" << startPos << " searchLen=" << searchLen); - for (position=startPos; position>=searchLen-1; position--) { + for (position=startPos; position >= searchLen-1; position--) { currentChar = m_data[position]; if (true == charMatch(currentChar, searchVect[searchLen-1], caseSensitive)) { int32_t i; bool found = true; - for (i=searchLen-1; i>=0; i--) { + for (i=searchLen-1; i >= 0; i--) { currentChar = m_data[position - (searchLen-1) + i]; if (false == charMatch(currentChar, searchVect[i], caseSensitive)) { found = false; @@ -1020,13 +1020,13 @@ bool EdnBuf::SearchBackward(int32_t startPos, etk::UString &search, int32_t *fou } if (true == found) { *foundPos = position - (searchLen-1); - *foundPosEnd = position + searchVect.Size(); + *foundPosEnd = position + searchVect.size(); return true; } } } - *foundPos = m_data.Size(); - *foundPosEnd = m_data.Size(); + *foundPos = m_data.size(); + *foundPosEnd = m_data.size(); return false; } @@ -1054,7 +1054,7 @@ bool EdnBuf::SelectAround(int32_t startPos, int32_t &beginPos, int32_t &endPos) { APPL_DEBUG("select spacer"); // special case we are looking for separation - for (beginPos=startPos; beginPos>=0; beginPos--) { + for (beginPos=startPos; beginPos >= 0; beginPos--) { currentChar = m_data[beginPos]; if( '\t' != currentChar && ' ' != currentChar) @@ -1064,7 +1064,7 @@ bool EdnBuf::SelectAround(int32_t startPos, int32_t &beginPos, int32_t &endPos) } } // special case we are looking for separation - for (endPos=startPos; endPos=0; beginPos--) { + for (beginPos=startPos; beginPos >= 0; beginPos--) { currentChar = m_data[beginPos]; if( false == isChar(currentChar)) { beginPos++; @@ -1084,7 +1084,7 @@ bool EdnBuf::SelectAround(int32_t startPos, int32_t &beginPos, int32_t &endPos) } } // Search forward - for (endPos=startPos; endPos=0; beginPos--) { + for (beginPos=startPos; beginPos >= 0; beginPos--) { currentChar = m_data[beginPos]; if(comparechar != currentChar) { @@ -1104,7 +1104,7 @@ bool EdnBuf::SelectAround(int32_t startPos, int32_t &beginPos, int32_t &endPos) } } // Search forward - for (endPos=startPos; endPos &insertText) { - // Insert data in buffer - m_data.Insert(pos, insertText); + // insert data in buffer + m_data.insert(pos, insertText); // update the current selected area - UpdateSelection(pos, 0, insertText.Size() ); + updateSelection(pos, 0, insertText.size() ); // return the number of element inserted ... - return insertText.Size(); + return insertText.size(); } int32_t EdnBuf::LocalInsert(int32_t pos, etk::UString &insertText) { @@ -1144,15 +1144,15 @@ int32_t EdnBuf::LocalInsert(int32_t pos, etk::UString &insertText) etk::Char tmpChar = insertText.c_str(); const char * tmpPointer = tmpChar; while (*tmpPointer != '\0') { - tmpInsertText.PushBack(*tmpPointer++); + tmpInsertText.pushBack(*tmpPointer++); } } else { - etk::Vector tmppp = insertText.GetVector(); + etk::Vector tmppp = insertText.getVector(); convertUnicodeToIso(m_charsetType, tmppp, tmpInsertText); } - if (tmpInsertText.Size()>0) { - if (tmpInsertText[tmpInsertText.Size()-1] == '\0') { - tmpInsertText.PopBack(); + if (tmpInsertText.size()>0) { + if (tmpInsertText[tmpInsertText.size()-1] == '\0') { + tmpInsertText.popBack(); } } return LocalInsert(pos, tmpInsertText); @@ -1171,38 +1171,38 @@ int32_t EdnBuf::LocalInsert(int32_t pos, etk::UString &insertText) */ void EdnBuf::eventModification(int32_t pos, int32_t nInserted, etk::Vector &deletedText) { - if( 0 == deletedText.Size() + if( 0 == deletedText.size() && 0 == nInserted) { // we do nothing ... //APPL_INFO("EdnBuf::eventModification(pos="<=0; i--) { + for (i=m_historyRedo.size()-1; i >= 0; i--) { if (NULL != m_historyRedo[i]) { delete(m_historyRedo[i]); } - m_historyRedo.PopBack(); + m_historyRedo.popBack(); } } } else { - // undo processing ==> add element in Redo vector ... + // undo processing == > add element in Redo vector ... EdnBufHistory *exempleHistory = new EdnBufHistory(pos, nInserted, deletedText); - m_historyRedo.PushBack(exempleHistory); + m_historyRedo.pushBack(exempleHistory); } // Regenerate the Highlight : - RegenerateHighLightAt(pos, deletedText.Size(), nInserted); + RegenerateHighLightAt(pos, deletedText.size(), nInserted); } } @@ -1223,13 +1223,13 @@ void EdnBuf::eventModification(int32_t pos, int32_t nInserted, etk::Vector=0 ; iii-- ) { + for(int32_t iii=startPos-1 ; iii >= 0 ; iii-- ) { if (m_data[iii] == searchChar) { *foundPos = iii; return true; diff --git a/sources/appl/Buffer/EdnBuf/EdnBuf.h b/sources/appl/Buffer/EdnBuf/EdnBuf.h index 0d374a3..28c5ab1 100644 --- a/sources/appl/Buffer/EdnBuf/EdnBuf.h +++ b/sources/appl/Buffer/EdnBuf/EdnBuf.h @@ -49,37 +49,37 @@ typedef struct { }displayHLData_ts; class EdnBuf { - // TODO : Set an iterator to acces at every data without knowin the system ... + // TODO : set an iterator to acces at every data without knowin the system ... public: // constructer EdnBuf(void); // destructer ~EdnBuf(void); // public function : - void GetAll(etk::Vector& _text); - void SetAll(etk::Vector& _text); - void GetRange(int32_t _start, int32_t _end, etk::Vector& _output); - void GetRange(int32_t _start, int32_t _end, etk::UString& _output); + void getAll(etk::Vector& _text); + void setAll(etk::Vector& _text); + void getRange(int32_t _start, int32_t _end, etk::Vector& _output); + void getRange(int32_t _start, int32_t _end, etk::UString& _output); bool DumpIn(etk::FSNode& _file); bool DumpFrom(etk::FSNode& _file); // replace with operator [] ... int8_t operator[] (int32_t) const; - int32_t Insert(int32_t _pos, etk::Vector& _insertText); - int32_t Insert(int32_t _pos, etk::UString& _insertText); + int32_t insert(int32_t _pos, etk::Vector& _insertText); + int32_t insert(int32_t _pos, etk::UString& _insertText); int32_t Replace(int32_t _start, int32_t _end, etk::Vector& _insertText); int32_t Replace(int32_t _start, int32_t _end, etk::UString& _insertText); - void Remove(int32_t _start, int32_t _end); + void remove(int32_t _start, int32_t _end); int32_t Indent(void); int32_t UnIndent(void); - void GetLineText(int32_t _pos, etk::Vector& _text); + void getLineText(int32_t _pos, etk::Vector& _text); 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, 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 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, 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 int32_t CountDispChars(int32_t _lineStartPos, int32_t _targetPos); int32_t CountForwardDispChars(int32_t _lineStartPos, int32_t _nChars); @@ -95,8 +95,8 @@ class EdnBuf { bool SearchBackward(int32_t _startPos, char _searchChar, int32_t* _foundPos); bool SelectAround(int32_t _startPos, int32_t& _beginPos, int32_t& _endPos); - // Buffer Size system : - int32_t Size(void) { return m_data.Size(); }; + // Buffer size system : + int32_t size(void) { return m_data.size(); }; int32_t NumberOfLines(void) { return m_nbLine; }; // ----------------------------------------- @@ -107,16 +107,16 @@ class EdnBuf { void Select(int32_t _start, int32_t _end); void Unselect(void); void RectSelect(int32_t _start, int32_t _end, int32_t _rectStart, int32_t _rectEnd); - bool GetSelectionPos(int32_t& _start, int32_t& _end, bool& _isRect, int32_t& _rectStart, int32_t& _rectEnd); - void GetSelectionText(etk::Vector& _text); - void GetSelectionText(etk::UString& _text); - void RemoveSelected(void); + bool getSelectionPos(int32_t& _start, int32_t& _end, bool& _isRect, int32_t& _rectStart, int32_t& _rectEnd); + void getSelectionText(etk::Vector& _text); + void getSelectionText(etk::UString& _text); + void removeSelected(void); int32_t ReplaceSelected(etk::Vector& _text); int32_t ReplaceSelected(etk::UString& _text); private: // current selection of the buffer selection m_selectionList; //!< Selection area of the buffer - void UpdateSelection(int32_t _pos, int32_t _nDeleted, int32_t _nInserted); + void updateSelection(int32_t _pos, int32_t _nDeleted, int32_t _nInserted); // ----------------------------------------- // History section : @@ -137,15 +137,15 @@ class EdnBuf { Highlight * m_Highlight; //!< internal link with the Highlight system etk::Vector m_HLDataPass1; //!< colorisation position in the current buffer pass 1 void RegenerateHighLightAt(int32_t _pos, int32_t _nbDeleted, int32_t _nbAdded); - void GenerateHighLightAt(int32_t _pos, int32_t _endPos, int32_t _addinPos=0); + void generateHighLightAt(int32_t _pos, int32_t _endPos, int32_t _addinPos=0); void CleanHighLight(void); - void FindMainHighLightPosition(int32_t _startPos, int32_t _endPos, int32_t &_startId, int32_t &_stopId, bool _backPreviousNotEnded); + void findMainHighLightPosition(int32_t _startPos, int32_t _endPos, int32_t &_startId, int32_t &_stopId, bool _backPreviousNotEnded); public: - void SetHLSystem(Highlight* _newHLSystem); + void setHLSystem(Highlight* _newHLSystem); void HightlightGenerateLines(displayHLData_ts& _MData, int32_t _startPos, int32_t _nbLines); - colorInformation_ts* GetElementColorAtPosition(displayHLData_ts& _MData, int32_t _pos); + colorInformation_ts* getElementColorAtPosition(displayHLData_ts& _MData, int32_t _pos); private: - colorInformation_ts* GetElementColorAtPosition(int32_t _pos, int32_t &_starPos); + colorInformation_ts* getElementColorAtPosition(int32_t _pos, int32_t &_starPos); private: etk::Buffer m_data; //!< buffer of the data in the mode int8_t @@ -153,18 +153,18 @@ class EdnBuf { int32_t m_nbLine; //!< Number of line in the biffer // ----------------------------------------- - // Display property and charset ... + // display property and charset ... // ----------------------------------------- public: - int32_t GetTabDistance(void) { return m_tabDist; } ; - void SetTabDistance(int32_t _tabDist) { m_tabDist = _tabDist; }; - unicode::charset_te GetCharsetType(void) { return m_charsetType; }; - void SetCharsetType(unicode::charset_te _newOne) { m_charsetType = _newOne; if (unicode::EDN_CHARSET_UTF8==_newOne){m_isUtf8=true;} else {m_isUtf8=false;} }; - bool GetUTF8Mode(void) { return m_isUtf8; }; - void SetUTF8Mode(bool _newOne) { m_isUtf8 = _newOne; m_charsetType=unicode::EDN_CHARSET_UTF8; }; + int32_t getTabDistance(void) { return m_tabDist; } ; + void setTabDistance(int32_t _tabDist) { m_tabDist = _tabDist; }; + unicode::charset_te getCharsetType(void) { return m_charsetType; }; + void setCharsetType(unicode::charset_te _newOne) { m_charsetType = _newOne; if (unicode::EDN_CHARSET_UTF8 == _newOne){m_isUtf8=true;} else {m_isUtf8=false;} }; + bool getUTF8Mode(void) { return m_isUtf8; }; + void setUTF8Mode(bool _newOne) { m_isUtf8 = _newOne; m_charsetType=unicode::EDN_CHARSET_UTF8; }; private: // Special mode of the buffer : - bool m_isUtf8; //!< true if we are in UTF8 mode ==> if true the size of a char is 0, otherwise .. 1->4 ( TODO : not now) + bool m_isUtf8; //!< true if we are in UTF8 mode == > if true the size of a char is 0, otherwise .. 1->4 ( TODO : not now) unicode::charset_te m_charsetType; //!< if UTF8 mode is at false : the charset type of the buffer // Local Tabulation policies int32_t m_tabDist; //!< equiv. number of characters in a tab diff --git a/sources/appl/Buffer/EdnBuf/EdnBufHistory.cpp b/sources/appl/Buffer/EdnBuf/EdnBufHistory.cpp index f5e3903..11d8036 100644 --- a/sources/appl/Buffer/EdnBuf/EdnBufHistory.cpp +++ b/sources/appl/Buffer/EdnBuf/EdnBufHistory.cpp @@ -29,7 +29,7 @@ EdnBufHistory::EdnBufHistory(int32_t pos, int32_t nInserted, etk::Vector m_deletedText = deletedText; } -void EdnBufHistory::Set(int32_t pos, int32_t nInserted, etk::Vector &deletedText) +void EdnBufHistory::set(int32_t pos, int32_t nInserted, etk::Vector &deletedText) { //APPL_INFO("EdnBufHistory new + data"); m_pos = pos; @@ -49,7 +49,7 @@ int32_t EdnBufHistory::getPos(void) int32_t EdnBufHistory::getnbDeleted(void) { - return m_deletedText.Size(); + return m_deletedText.size(); } int32_t EdnBufHistory::getnbInserted(void) diff --git a/sources/appl/Buffer/EdnBuf/EdnBufHistory.h b/sources/appl/Buffer/EdnBuf/EdnBufHistory.h index 34c7420..5c25623 100644 --- a/sources/appl/Buffer/EdnBuf/EdnBufHistory.h +++ b/sources/appl/Buffer/EdnBuf/EdnBufHistory.h @@ -17,7 +17,7 @@ class EdnBufHistory{ EdnBufHistory(void); EdnBufHistory(int32_t pos, int32_t nInserted, etk::Vector &deletedText); ~EdnBufHistory(void); - void Set(int32_t pos, int32_t nInserted, etk::Vector &deletedText); + void set(int32_t pos, int32_t nInserted, etk::Vector &deletedText); int32_t getPos(void); int32_t getnbDeleted(void); int32_t getnbInserted(void); diff --git a/sources/appl/Buffer/EdnBuf/EdnBuf_HighLight.cpp b/sources/appl/Buffer/EdnBuf/EdnBuf_HighLight.cpp index 5996fbe..97a300c 100644 --- a/sources/appl/Buffer/EdnBuf/EdnBuf_HighLight.cpp +++ b/sources/appl/Buffer/EdnBuf/EdnBuf_HighLight.cpp @@ -14,16 +14,16 @@ #undef __class__ #define __class__ "EdnBuf{HighLight}" -void EdnBuf::SetHLSystem(Highlight * newHLSystem) +void EdnBuf::setHLSystem(Highlight * newHLSystem) { if (m_Highlight != newHLSystem) { m_Highlight = newHLSystem; - m_HLDataPass1.Clear(); - RegenerateHighLightAt(0, 0, m_data.Size()); + m_HLDataPass1.clear(); + RegenerateHighLightAt(0, 0, m_data.size()); } } -// TODO : Check this fuction it have too many conditionnal inside ==> can do a better algo +// TODO : Check this fuction it have too many conditionnal inside == > can do a better algo void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdded) { //GTimeVal timeStart; @@ -43,10 +43,10 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd //APPL_INFO("(pos="<GetName(); + ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->getName(); } APPL_DEBUG("HighLight (previous) element id=" << i << " S=" << m_HLDataPass1[i].beginStart << " E=" << m_HLDataPass1[i].endStop << " patern name=" << ploppp ); } @@ -56,15 +56,15 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd int32_t startId; int32_t stopId; // clean data if needed - if (0 != m_HLDataPass1.Size()) { + if (0 != m_HLDataPass1.size()) { // find element previous - FindMainHighLightPosition(pos, posEnd, startId, stopId, true); + findMainHighLightPosition(pos, posEnd, startId, stopId, true); - // Remove deprecated element + // remove deprecated element if( -1 == startId && -1 == stopId) { - m_HLDataPass1.Clear(); + m_HLDataPass1.clear(); } else if(-1 == startId) { if (0 == stopId){ m_HLDataPass1.Erase(0); @@ -75,22 +75,22 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd } } else if(-1 == stopId) { //APPL_DEBUG("3 * Erase " << startId+1 << "-> end"); - m_HLDataPass1.EraseLen(startId+1, m_HLDataPass1.Size() - startId); + m_HLDataPass1.EraseLen(startId+1, m_HLDataPass1.size() - startId); stopId = -1; } else { - int32_t currentSize = m_HLDataPass1.Size(); + int32_t currentSize = m_HLDataPass1.size(); //APPL_DEBUG("4 * Erase " << startId+1 << "->" << stopId << " in " << currentSize << " elements" ); m_HLDataPass1.EraseLen(startId+1, stopId - startId); if (stopId == currentSize-1) { stopId = -1; } } - //APPL_DEBUG("new size=" << (int32_t)m_HLDataPass1.Size()-1); + //APPL_DEBUG("new size=" << (int32_t)m_HLDataPass1.size()-1); /* - for (i=0; i< (int32_t)m_HLDataPass1.Size(); i++) { + for (i=0; i< (int32_t)m_HLDataPass1.size(); i++) { etk::UString ploppp; if (NULL != m_HLDataPass1[i].patern ) { - ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->GetName(); + ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->getName(); } APPL_DEBUG("HighLight (Middle) element id=" << i << " S=" << m_HLDataPass1[i].beginStart << " E=" << m_HLDataPass1[i].endStop << " patern name=" << ploppp ); } @@ -102,7 +102,7 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd } else { elemStart = startId+1; } - for (i=elemStart; i< (int32_t)m_HLDataPass1.Size(); i++) { + for (i=elemStart; i< (int32_t)m_HLDataPass1.size(); i++) { //APPL_DEBUG("move element=" << i); m_HLDataPass1[i].beginStart += nbAdded - nbDeleted; m_HLDataPass1[i].beginStop += nbAdded - nbDeleted; @@ -114,26 +114,26 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd && -1 == stopId) { //APPL_DEBUG("******* Regenerate ALL"); - GenerateHighLightAt(0, m_data.Size()); + generateHighLightAt(0, m_data.size()); } else if(-1 == startId) { //APPL_DEBUG("******* Regenerate START"); - GenerateHighLightAt(0, m_HLDataPass1[0].beginStart, 0); + generateHighLightAt(0, m_HLDataPass1[0].beginStart, 0); } else if(-1 == stopId) { //APPL_DEBUG("******* Regenerate STOP"); - GenerateHighLightAt(m_HLDataPass1[m_HLDataPass1.Size() -1].endStop, m_data.Size(), m_HLDataPass1.Size()); + generateHighLightAt(m_HLDataPass1[m_HLDataPass1.size() -1].endStop, m_data.Size(), m_HLDataPass1.Size()); } else { //APPL_DEBUG("******* Regenerate RANGE"); - GenerateHighLightAt(m_HLDataPass1[startId].endStop, m_HLDataPass1[startId+1].beginStart, startId+1); + generateHighLightAt(m_HLDataPass1[startId].endStop, m_HLDataPass1[startId+1].beginStart, startId+1); } } else { // Parse the new element ... - GenerateHighLightAt(0, m_data.Size()); + generateHighLightAt(0, m_data.size()); } /* - for (i=0; i< (int32_t)m_HLDataPass1.Size(); i++) { + for (i=0; i< (int32_t)m_HLDataPass1.size(); i++) { etk::UString ploppp; if (NULL != m_HLDataPass1[i].patern ) { - ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->GetName(); + ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->getName(); } APPL_DEBUG("HighLight (end) element id=" << i << " S=" << m_HLDataPass1[i].beginStart << " E=" << m_HLDataPass1[i].endStop << " patern name=" << ploppp ); } @@ -143,13 +143,13 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd //APPL_DEBUG("HL General = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s"); } -void EdnBuf::FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t &startId, int32_t &stopId, bool backPreviousNotEnded) +void EdnBuf::findMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t &startId, int32_t &stopId, bool backPreviousNotEnded) { startId = -1; stopId = -1; /* rules to start stop: HighLight data ---- - Remove area **** + remove area **** Start pos S End pos E @@ -185,7 +185,7 @@ void EdnBuf::FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t S=-1 *************** E */ int32_t i; - for (i=0; i< (int32_t)m_HLDataPass1.Size(); i++) { + for (i=0; i< (int32_t)m_HLDataPass1.size(); i++) { if (m_HLDataPass1[i].endStop > startPos) { break; } @@ -193,7 +193,7 @@ void EdnBuf::FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t } // go back while the previous element is not eneded if (true == backPreviousNotEnded) { - for (i=startId; i>=0; i--) { + for (i=startId; i >= 0; i--) { if (m_HLDataPass1[i].notEnded == false) { break; } @@ -206,7 +206,7 @@ void EdnBuf::FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t } else { elemStart = startId+1; } - for (i=elemStart; i< (int32_t)m_HLDataPass1.Size(); i++) { + for (i=elemStart; i< (int32_t)m_HLDataPass1.size(); i++) { if (m_HLDataPass1[i].beginStart > endPos) { stopId = i; @@ -214,15 +214,15 @@ void EdnBuf::FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t } } /* - if (-1 != startId && startId < (int32_t)m_HLDataPass1.Size()) { - APPL_DEBUG("==> BEGIN : start="< BEGIN : start="< BEGIN : start=???, stop=??? id=" << startId); + APPL_DEBUG(" == > BEGIN : start=???, stop=??? id=" << startId); } - if (-1 != stopId && stopId < (int32_t)m_HLDataPass1.Size()) { - APPL_DEBUG("==> END : start="< END : start="< END : start=???, stop=??? id=" << stopId); + APPL_DEBUG(" == > END : start=???, stop=??? id=" << stopId); } */ } @@ -230,7 +230,7 @@ void EdnBuf::FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t -void EdnBuf::GenerateHighLightAt(int32_t pos, int32_t endPos, int32_t addinPos) +void EdnBuf::generateHighLightAt(int32_t pos, int32_t endPos, int32_t addinPos) { if (NULL == m_Highlight) { return; @@ -243,16 +243,16 @@ void EdnBuf::GenerateHighLightAt(int32_t pos, int32_t endPos, int32_t addinPos) void EdnBuf::CleanHighLight(void) { - // Remove all element in the list... - m_HLDataPass1.Clear(); + // remove all element in the list... + m_HLDataPass1.clear(); } -colorInformation_ts *EdnBuf::GetElementColorAtPosition(int32_t pos, int32_t &starPos) +colorInformation_ts *EdnBuf::getElementColorAtPosition(int32_t pos, int32_t &starPos) { int32_t i; int32_t start = etk_max(0, starPos-1); - for (i=start; i<(int32_t)m_HLDataPass1.Size(); i++) { + for (i=start; i<(int32_t)m_HLDataPass1.size(); i++) { starPos = i; if( m_HLDataPass1[i].beginStart <= pos && m_HLDataPass1[i].endStop > pos) @@ -277,49 +277,49 @@ void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart, //GTimeVal timeStart; //g_get_current_time(&timeStart); HLStart = StartOfLine(HLStart); - MData.HLData.Clear(); + MData.HLData.clear(); int32_t HLStop = CountForwardNLines(HLStart, nbLines); int32_t startId, stopId; // find element previous - FindMainHighLightPosition(HLStart, HLStop, startId, stopId, true); + findMainHighLightPosition(HLStart, HLStop, startId, stopId, true); int32_t k; //APPL_DEBUG("List of section between : "<< startId << " & " << stopId); int32_t endSearch = stopId+1; if (-1 == stopId) { - endSearch = m_HLDataPass1.Size(); + endSearch = m_HLDataPass1.size(); } for (k=etk_max(startId, 0); k (empty section 1 ) k="< (empty section 1 ) k="< (empty section 2 ) k="< (empty section 2 ) k="< (under section ) k="< (under section ) k="< (empty section 3 ) k="< (empty section 3 ) k="< (empty section 4 ) k="< (empty section 4 ) k="< remove it"); - m_historyUndo.PopBack(); + APPL_ERROR("EdnBuf::Undo find empty history == > remove it"); + m_historyUndo.popBack(); return -1; } int32_t pos = m_historyUndo[nbElement]->getPos(); @@ -44,13 +44,13 @@ int32_t EdnBuf::Undo(void) if (0 == nbDeleted) { APPL_DEBUG("EdnBuf::Undo nothing to do in UNDO"); } else { - Insert(pos, deletedText); + insert(pos, deletedText); posDest = pos + nbDeleted; } } else { if (0 == nbDeleted) { // only remove data - Remove(pos, pos+nbInserted); + remove(pos, pos+nbInserted); posDest = pos; } else { // replace data @@ -60,14 +60,14 @@ int32_t EdnBuf::Undo(void) } // remove element in the list : delete(m_historyUndo[nbElement]); - m_historyUndo.PopBack(); + m_historyUndo.popBack(); m_isUndoProcessing = false; return posDest; } int32_t EdnBuf::Redo(void) { - int32_t nbElement = m_historyRedo.Size(); + int32_t nbElement = m_historyRedo.size(); //APPL_DEBUG("EdnBuf::Redo Request id="< remove it"); - m_historyRedo.PopBack(); + APPL_ERROR("EdnBuf::Redo find empty history == > remove it"); + m_historyRedo.popBack(); return -1; } int32_t pos = m_historyRedo[nbElement]->getPos(); @@ -92,13 +92,13 @@ int32_t EdnBuf::Redo(void) if (0 == nbDeleted) { APPL_ERROR("EdnBuf::Redo nothing to do in REDO"); } else { - Insert(pos, deletedText); + insert(pos, deletedText); posDest = pos + nbDeleted; } } else { if (0 == nbDeleted) { // only remove data - Remove(pos, pos+nbInserted); + remove(pos, pos+nbInserted); posDest = pos; } else { // replace data @@ -108,7 +108,7 @@ int32_t EdnBuf::Redo(void) } // remove element in the list : delete(m_historyRedo[nbElement]); - m_historyRedo.PopBack(); + m_historyRedo.popBack(); m_isRedoProcessing = false; return posDest; } diff --git a/sources/appl/Buffer/EdnBuf/EdnBuf_Selection.cpp b/sources/appl/Buffer/EdnBuf/EdnBuf_Selection.cpp index 28784c3..d20fdd0 100644 --- a/sources/appl/Buffer/EdnBuf/EdnBuf_Selection.cpp +++ b/sources/appl/Buffer/EdnBuf/EdnBuf_Selection.cpp @@ -97,7 +97,7 @@ void EdnBuf::RectSelect(int32_t start, int32_t end, int32_t rectStart, int32_t r * @return --- * */ -bool EdnBuf::GetSelectionPos(int32_t &start, int32_t &end, bool &isRect, int32_t &rectStart, int32_t &rectEnd) +bool EdnBuf::getSelectionPos(int32_t &start, int32_t &end, bool &isRect, int32_t &rectStart, int32_t &rectEnd) { /* Always fill in the parameters (zero-width can be requested too). */ isRect = m_selectionList.rectangular; @@ -119,14 +119,14 @@ bool EdnBuf::GetSelectionPos(int32_t &start, int32_t &end, bool &isRect, int32_t * @return --- * */ -void EdnBuf::GetSelectionText(etk::Vector &text) +void EdnBuf::getSelectionText(etk::Vector &text) { int32_t start, end, rectStart, rectEnd; bool isRect; // remove output data - text.Clear(); + text.clear(); - bool isSelected = GetSelectionPos(start, end, isRect, rectStart, rectEnd); + bool isSelected = getSelectionPos(start, end, isRect, rectStart, rectEnd); // No data selected ... if (false == isSelected) { @@ -138,17 +138,17 @@ void EdnBuf::GetSelectionText(etk::Vector &text) //GetTextInRect(start, end, rectStart, rectEnd, text); // TODO : ... } else { - GetRange(start, end, text); + getRange(start, end, text); } } -void EdnBuf::GetSelectionText(etk::UString &text) +void EdnBuf::getSelectionText(etk::UString &text) { int32_t start, end, rectStart, rectEnd; bool isRect; // remove output data text = ""; - bool isSelected = GetSelectionPos(start, end, isRect, rectStart, rectEnd); + bool isSelected = getSelectionPos(start, end, isRect, rectStart, rectEnd); // No data selected ... if (false == isSelected) { @@ -160,7 +160,7 @@ void EdnBuf::GetSelectionText(etk::UString &text) //GetTextInRect(start, end, rectStart, rectEnd, text); // TODO : ... } else { - GetRange(start, end, text); + getRange(start, end, text); } } @@ -173,12 +173,12 @@ void EdnBuf::GetSelectionText(etk::UString &text) * @return --- * */ -void EdnBuf::RemoveSelected(void) +void EdnBuf::removeSelected(void) { int32_t start, end; int32_t rectStart, rectEnd; bool isRect; - bool isSelected = GetSelectionPos(start, end, isRect, rectStart, rectEnd); + bool isSelected = getSelectionPos(start, end, isRect, rectStart, rectEnd); // No data selected ... if (false == isSelected) { @@ -189,7 +189,7 @@ void EdnBuf::RemoveSelected(void) //RemoveRect(start, end, rectStart, rectEnd); // TODO : ... } else { - Remove(start, end); + remove(start, end); } Unselect(); } @@ -207,7 +207,7 @@ int32_t EdnBuf::ReplaceSelected(etk::Vector &text) { int32_t start, end, rectStart, rectEnd; bool isRect; - bool isSelected = GetSelectionPos(start, end, isRect, rectStart, rectEnd); + bool isSelected = getSelectionPos(start, end, isRect, rectStart, rectEnd); // No data selected ... if (false == isSelected) { @@ -229,7 +229,7 @@ int32_t EdnBuf::ReplaceSelected(etk::UString &text) { int32_t start, end, rectStart, rectEnd; bool isRect; - bool isSelected = GetSelectionPos(start, end, isRect, rectStart, rectEnd); + bool isSelected = getSelectionPos(start, end, isRect, rectStart, rectEnd); // No data selected ... if (false == isSelected) { @@ -250,7 +250,7 @@ int32_t EdnBuf::ReplaceSelected(etk::UString &text) /* -** Update an individual selection for changes in the corresponding text +** update an individual selection for changes in the corresponding text */ /** * @brief @@ -260,7 +260,7 @@ int32_t EdnBuf::ReplaceSelected(etk::UString &text) * @return --- * */ -void EdnBuf::UpdateSelection(int32_t pos, int32_t nDeleted, int32_t nInserted) +void EdnBuf::updateSelection(int32_t pos, int32_t nDeleted, int32_t nInserted) { if( ( false == m_selectionList.selected && false == m_selectionList.zeroWidth) diff --git a/sources/appl/Colorize/Colorize.cpp b/sources/appl/Colorize/Colorize.cpp index c6460b4..331afe6 100644 --- a/sources/appl/Colorize/Colorize.cpp +++ b/sources/appl/Colorize/Colorize.cpp @@ -25,7 +25,7 @@ Colorize::Colorize(const etk::UString &_newColorName) : APPL_VERBOSE("New(Colorise)"); } -void Colorize::SetItalic(bool _enable) +void Colorize::setItalic(bool _enable) { m_italic = _enable; if (true == _enable) { @@ -35,7 +35,7 @@ void Colorize::SetItalic(bool _enable) } } -void Colorize::SetBold(bool _enable) +void Colorize::setBold(bool _enable) { m_bold = _enable; if (true == _enable) { diff --git a/sources/appl/Colorize/Colorize.h b/sources/appl/Colorize/Colorize.h index 32132ea..b7ff52e 100644 --- a/sources/appl/Colorize/Colorize.h +++ b/sources/appl/Colorize/Colorize.h @@ -20,32 +20,32 @@ class Colorize { private: etk::UString m_colorName; //!< curent color Name public: - void SetName(const etk::UString& _newColorName) { m_colorName = _newColorName; }; - const etk::UString& GetName(void) { return m_colorName; }; + void setName(const etk::UString& _newColorName) { m_colorName = _newColorName; }; + const etk::UString& getName(void) { return m_colorName; }; private: etk::Color<> m_colorFG; public: - void SetFgColor(const etk::UString& _myColor) { m_colorFG=_myColor; }; - const etk::Color<>& GetFG(void) { return m_colorFG; }; - bool HaveFg(void) { return m_colorFG.a()!=0; }; + void setFgColor(const etk::UString& _myColor) { m_colorFG=_myColor; }; + const etk::Color<>& getFG(void) { return m_colorFG; }; + bool haveFg(void) { return m_colorFG.a()!=0; }; private: etk::Color<> m_colorBG; public: - void SetBgColor(const etk::UString& _myColor) { m_colorBG=_myColor; }; - const etk::Color<>& GetBG(void) { return m_colorBG; }; - bool HaveBg(void) { return m_colorBG.a()!=0; }; + void setBgColor(const etk::UString& _myColor) { m_colorBG=_myColor; }; + const etk::Color<>& getBG(void) { return m_colorBG; }; + bool haveBg(void) { return m_colorBG.a()!=0; }; private: bool m_italic; public: - void SetItalic(bool _enable); - bool GetItalic(void) { return m_italic; }; + void setItalic(bool _enable); + bool getItalic(void) { return m_italic; }; private: bool m_bold; public: - void SetBold(bool _enable); - bool GetBold(void) { return m_bold; }; - void Display(int32_t _i) { APPL_INFO(" " << _i << " : fg="<< m_colorFG << " bold=" << m_italic << " bold=" << m_italic << "\"" << m_colorName << "\""); }; + void setBold(bool _enable); + bool getBold(void) { return m_bold; }; + void display(int32_t _i) { APPL_INFO(" " << _i << " : fg="<< m_colorFG << " bold=" << m_italic << " bold=" << m_italic << "\"" << m_colorName << "\""); }; }; #endif diff --git a/sources/appl/Colorize/ColorizeManager.cpp b/sources/appl/Colorize/ColorizeManager.cpp index cd2f0e8..b591eb7 100644 --- a/sources/appl/Colorize/ColorizeManager.cpp +++ b/sources/appl/Colorize/ColorizeManager.cpp @@ -28,7 +28,7 @@ class classColorManager: public ewol::EObject // Constructeur classColorManager(void) { - //ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiChangeColor); + //ewol::widgetMessageMultiCast::add(getWidgetId(), ednMsgGuiChangeColor); } ~classColorManager(void) { @@ -36,43 +36,43 @@ class classColorManager: public ewol::EObject int32_t i; // clean all Element - for (i=0; i< listMyColor.Size(); i++) { + for (i=0; i< listMyColor.size(); i++) { if (NULL != listMyColor[i]) { delete(listMyColor[i]); listMyColor[i] = NULL; } } // clear the compleate list - listMyColor.Clear(); + listMyColor.clear(); } - const char * const GetObjectType(void) + const char * const getObjectType(void) { return "Appl::ColorManager"; } - void OnReceiveMessage(const ewol::EMessage& _msg) + void onReceiveMessage(const ewol::EMessage& _msg) { /* switch (id) { case APPL_MSG__RELOAD_COLOR_FILE: { - // Reaload File + // Reaload file // TODO : Check this : Pb in the recopy etk::UString element etk::UString plop = m_fileColor; - LoadFile(plop); + loadFile(plop); } break; } */ } public: - void LoadFile(const etk::UString& _xmlFilename); - Colorize* Get(const etk::UString& _colorName) + void loadFile(const etk::UString& _xmlFilename); + Colorize* get(const etk::UString& _colorName) { int32_t i; - for (i=0; iGetName() == _colorName) { + for (i=0; igetName() == _colorName) { return listMyColor[i]; } } @@ -80,7 +80,7 @@ class classColorManager: public ewol::EObject // an error return errorColor; } - etk::Color<>& Get(basicColor_te _myColor) + etk::Color<>& get(basicColor_te _myColor) { if (_myColor < COLOR_NUMBER_MAX) { return basicColors[_myColor]; @@ -91,155 +91,155 @@ class classColorManager: public ewol::EObject bool Exist(const etk::UString& _colorName) { int32_t i; - for (i=0; iGetName() == _colorName) { + for (i=0; igetName() == _colorName) { return true; } } return false; } - void DisplayListOfColor(void) + void displayListOfColor(void) { int32_t i; APPL_INFO(PFX"List of ALL COLOR : "); - for (i=0; iGetName(); + for (i=0; igetName(); //APPL_INFO(i << " : \"" << elementName.c_str() << "\"" ); - listMyColor[i]->Display(i); + listMyColor[i]->display(i); } } }; -void classColorManager::LoadFile(const etk::UString& _xmlFilename) +void classColorManager::loadFile(const etk::UString& _xmlFilename) { - // Remove all old color : - for (int32_t iii=0; iii< listMyColor.Size(); iii++) { + // remove all old color : + for (int32_t iii=0; iii< listMyColor.size(); iii++) { if (NULL != listMyColor[iii]) { delete(listMyColor[iii]); listMyColor[iii] = NULL; } } // clear the compleate list - listMyColor.Clear(); + listMyColor.clear(); m_fileColor = _xmlFilename; APPL_DEBUG("open file (COLOR) \"" << _xmlFilename << "\" ? = \"" << m_fileColor << "\""); errorColor = new Colorize(); - errorColor->SetBgColor("#00FF00FF"); - errorColor->SetFgColor("#FF00FFFF"); + errorColor->setBgColor("#00FF00FF"); + errorColor->setFgColor("#FF00FFFF"); - // open the curent File + // open the curent file etk::UString fileName(etk::UString("DATA:color/") + _xmlFilename + etk::UString(".xml")); exml::Document doc; - if (doc.Load(fileName)==false) { + if (doc.load(fileName) == false) { APPL_ERROR(" can not load file XML : " << fileName); return; } - exml::Element* root = (exml::Element*)doc.GetNamed("EdnColor"); + exml::Element* root = (exml::Element*)doc.getNamed("EdnColor"); if (NULL == root ) { - APPL_ERROR("[" << GetId() << "] {" << GetObjectType() << "} (l ?) main node not find: \"EdnColor\" ..."); + APPL_ERROR("[" << getId() << "] {" << GetObjectType() << "} (l ?) main node not find: \"EdnColor\" ..."); return; } // parse all the elements : - for(int32_t iii=0; iii< root->Size(); iii++) { - exml::Element* pNode = root->GetElement(iii); - if (pNode==NULL) { + for(int32_t iii=0; iii< root->size(); iii++) { + exml::Element* pNode = root->getElement(iii); + if (pNode == NULL) { // trash here all that is not element. continue; } - if (pNode->GetValue()=="gui") { - for(int32_t iii=0; iii< pNode->Size(); iii++) { - exml::Element* pGuiNode = pNode->GetElement(iii); - if (pGuiNode==NULL) { + if (pNode->getValue() == "gui") { + for(int32_t iii=0; iii< pNode->size(); iii++) { + exml::Element* pGuiNode = pNode->getElement(iii); + if (pGuiNode == NULL) { // trash here all that is not element. continue; } - if (pGuiNode->GetValue()!="color") { - APPL_ERROR("(l "<GetPos()<<") node not suported : \""<GetValue()<<"\" must be [color]"); + if (pGuiNode->getValue()!="color") { + APPL_ERROR("(l "<getPos()<<") node not suported : \""<GetValue()<<"\" must be [color]"); continue; } //-------------------------------------------------------------------------------------------- // //-------------------------------------------------------------------------------------------- - etk::UString colorName = pGuiNode->GetAttribute("name"); - if (colorName.Size()==0) { - APPL_ERROR("(l "<< pGuiNode->GetPos() <<") node with no name"); + etk::UString colorName = pGuiNode->getAttribute("name"); + if (colorName.size() == 0) { + APPL_ERROR("(l "<< pGuiNode->getPos() <<") node with no name"); continue; } int32_t id = 0; - if (colorName=="CODE_space") { + if (colorName == "CODE_space") { id = COLOR_CODE_SPACE; - } else if (colorName=="CODE_tabulation") { + } else if (colorName == "CODE_tabulation") { id = COLOR_CODE_TAB; - } else if (colorName=="CODE_basicBackgroung") { + } else if (colorName == "CODE_basicBackgroung") { id = COLOR_CODE_BASIC_BG; - } else if (colorName=="CODE_cursor") { + } else if (colorName == "CODE_cursor") { id = COLOR_CODE_CURSOR; - } else if (colorName=="CODE_lineNumber") { + } else if (colorName == "CODE_lineNumber") { id = COLOR_CODE_LINE_NUMBER; - } else if (colorName=="LIST_backgroung1") { + } else if (colorName == "LIST_backgroung1") { id = COLOR_LIST_BG_1; - } else if (colorName=="LIST_backgroung2") { + } else if (colorName == "LIST_backgroung2") { id = COLOR_LIST_BG_2; - } else if (colorName=="LIST_backgroungSelected") { + } else if (colorName == "LIST_backgroungSelected") { id = COLOR_LIST_BG_SELECTED; - } else if (colorName=="LIST_textNormal") { + } else if (colorName == "LIST_textNormal") { id = COLOR_LIST_TEXT_NORMAL; - } else if (colorName=="LIST_textModify") { + } else if (colorName == "LIST_textModify") { id = COLOR_LIST_TEXT_MODIFY; } else { - APPL_ERROR("(l "<GetPos()<<") Unknown basic gui color : \"" << colorName << "\"" ); + APPL_ERROR("(l "<getPos()<<") Unknown basic gui color : \"" << colorName << "\"" ); continue; } - etk::UString color = pGuiNode->GetAttribute("val"); - if (color.Size()!=0) { + etk::UString color = pGuiNode->getAttribute("val"); + if (color.size()!=0) { basicColors[id] = color; } } - } else if (pNode->GetValue()=="syntax") { - for(int32_t iii=0; iii< pNode->Size(); iii++) { - exml::Element* pGuiNode = pNode->GetElement(iii); - if (pGuiNode==NULL) { + } else if (pNode->getValue() == "syntax") { + for(int32_t iii=0; iii< pNode->size(); iii++) { + exml::Element* pGuiNode = pNode->getElement(iii); + if (pGuiNode == NULL) { continue; } - if (pGuiNode->GetValue()!="color") { - APPL_ERROR(PFX"(l "<GetPos()<<") node not suported : \""<GetValue()<<"\" must be [color]"); + if (pGuiNode->getValue()!="color") { + APPL_ERROR(PFX"(l "<getPos()<<") node not suported : \""<GetValue()<<"\" must be [color]"); continue; } //-------------------------------------------------------------------------------------------- // //-------------------------------------------------------------------------------------------- // get the name of the Chaine - etk::UString colorName = pGuiNode->GetAttribute("name"); - if (colorName.Size()==0) { - APPL_ERROR(PFX"(l "<< pGuiNode->GetPos() <<") node with no name"); + etk::UString colorName = pGuiNode->getAttribute("name"); + if (colorName.size() == 0) { + APPL_ERROR(PFX"(l "<< pGuiNode->getPos() <<") node with no name"); continue; } Colorize* myNewColor = new Colorize(); - if (NULL==myNewColor) { - APPL_ERROR(PFX"(l "<< pGuiNode->GetPos() <<") ==> allocation error"); + if (NULL == myNewColor) { + APPL_ERROR(PFX"(l "<< pGuiNode->getPos() <<") == > allocation error"); continue; } - myNewColor->SetName(colorName); - etk::UString colorBG = pGuiNode->GetAttribute("BG"); - if (colorBG.Size()!=0) { - myNewColor->SetBgColor(colorBG); + myNewColor->setName(colorName); + etk::UString colorBG = pGuiNode->getAttribute("BG"); + if (colorBG.size()!=0) { + myNewColor->setBgColor(colorBG); } - etk::UString colorFG = pGuiNode->GetAttribute("FG"); - if (colorFG.Size()!=0) { - myNewColor->SetFgColor(colorFG); + etk::UString colorFG = pGuiNode->getAttribute("FG"); + if (colorFG.size()!=0) { + myNewColor->setFgColor(colorFG); } - etk::UString bold = pGuiNode->GetAttribute("bold"); - if (bold.Size()!=0) { - myNewColor->SetBold(bold.ToBool()); + etk::UString bold = pGuiNode->getAttribute("bold"); + if (bold.size()!=0) { + myNewColor->setBold(bold.toBool()); } - etk::UString italic = pGuiNode->GetAttribute("italic"); - if (italic.Size()!=0) { - myNewColor->SetItalic(italic.ToBool()); + etk::UString italic = pGuiNode->getAttribute("italic"); + if (italic.size()!=0) { + myNewColor->setItalic(italic.toBool()); } - listMyColor.PushBack(myNewColor); + listMyColor.pushBack(myNewColor); } } } @@ -253,10 +253,10 @@ void classColorManager::LoadFile(const etk::UString& _xmlFilename) static classColorManager * localManager = NULL; -void ColorizeManager::Init(void) +void ColorizeManager::init(void) { if (NULL != localManager) { - EWOL_ERROR("ColorizeManager ==> already exist, just unlink the previous ..."); + EWOL_ERROR("ColorizeManager == > already exist, just unlink the previous ..."); localManager = NULL; } localManager = new classColorManager(); @@ -269,37 +269,37 @@ void ColorizeManager::Init(void) void ColorizeManager::UnInit(void) { if (NULL == localManager) { - EWOL_ERROR("ColorizeManager ==> request UnInit, but does not exist ..."); + EWOL_ERROR("ColorizeManager == > request UnInit, but does not exist ..."); return; } delete(localManager); localManager = NULL; } -void ColorizeManager::LoadFile(const etk::UString& _xmlFilename) +void ColorizeManager::loadFile(const etk::UString& _xmlFilename) { if (NULL == localManager) { return; } - localManager->LoadFile(_xmlFilename); + localManager->loadFile(_xmlFilename); } -Colorize* ColorizeManager::Get(const etk::UString& _colorName) +Colorize* ColorizeManager::get(const etk::UString& _colorName) { if (NULL == localManager) { return NULL; } - return localManager->Get(_colorName); + return localManager->get(_colorName); } -etk::Color<>& ColorizeManager::Get(basicColor_te _myColor) +etk::Color<>& ColorizeManager::get(basicColor_te _myColor) { static etk::Color<> errorColor; if (NULL == localManager) { return errorColor; } - return localManager->Get(_myColor); + return localManager->get(_myColor); } bool ColorizeManager::Exist(const etk::UString& _colorName) @@ -310,12 +310,12 @@ bool ColorizeManager::Exist(const etk::UString& _colorName) return localManager->Exist(_colorName); } -void ColorizeManager::DisplayListOfColor(void) +void ColorizeManager::displayListOfColor(void) { if (NULL == localManager) { return; } - localManager->DisplayListOfColor(); + localManager->displayListOfColor(); } diff --git a/sources/appl/Colorize/ColorizeManager.h b/sources/appl/Colorize/ColorizeManager.h index 2ec272c..6ba4097 100644 --- a/sources/appl/Colorize/ColorizeManager.h +++ b/sources/appl/Colorize/ColorizeManager.h @@ -35,13 +35,13 @@ typedef enum { namespace ColorizeManager { - void Init(void); + void init(void); void UnInit(void); - void LoadFile(const etk::UString& _xmlFilename); - Colorize * Get(const etk::UString& _colorName); - etk::Color<>& Get(basicColor_te _myColor); + void loadFile(const etk::UString& _xmlFilename); + Colorize * get(const etk::UString& _colorName); + etk::Color<>& get(basicColor_te _myColor); bool Exist(const etk::UString& _colorName); - void DisplayListOfColor(void); + void displayListOfColor(void); }; #endif diff --git a/sources/appl/Gui/BufferView.cpp b/sources/appl/Gui/BufferView.cpp index 50ac70b..2fd67e6 100644 --- a/sources/appl/Gui/BufferView.cpp +++ b/sources/appl/Gui/BufferView.cpp @@ -22,20 +22,20 @@ static void SortElementList(etk::Vector &list) { etk::Vector tmpList = list; - list.Clear(); - for(int32_t iii=0; iiim_bufferName.GetNameFile() > list[jjj]->m_bufferName.GetNameFile()) { + if (tmpList[iii]->m_bufferName.getNameFile() > list[jjj]->m_bufferName.GetNameFile()) { findPos = jjj+1; } } } //EWOL_DEBUG("position="< &list) BufferView::BufferView(void) { - SetCanHaveFocus(true); + setCanHaveFocus(true); RegisterMultiCast(ednMsgBufferListChange); RegisterMultiCast(ednMsgBufferState); RegisterMultiCast(ednMsgBufferId); @@ -54,37 +54,37 @@ BufferView::BufferView(void) BufferView::~BufferView(void) { - RemoveAllElement(); + removeAllElement(); } -void BufferView::RemoveAllElement(void) +void BufferView::removeAllElement(void) { - for(int32_t iii=0; iiiIsModify(); - etk::FSNode name = tmpBuffer->GetFileName(); + bool isModify = tmpBuffer->isModify(); + etk::FSNode name = tmpBuffer->getFileName(); appl::dataBufferStruct* tmpElement = new appl::dataBufferStruct(name, iii, isModify); if (NULL != tmpElement) { - m_list.PushBack(tmpElement); + m_list.pushBack(tmpElement); } else { APPL_ERROR("Allocation error of the tmp buffer list element"); } @@ -94,63 +94,63 @@ void BufferView::OnReceiveMessage(const ewol::EMessage& _msg) if (true == globals::OrderTheBufferList() ) { SortElementList(m_list); } - MarkToRedraw(); - }else if (_msg.GetMessage() == ednMsgBufferId) { - m_selectedIdRequested = BufferManager::GetSelected(); - MarkToRedraw(); - }else if (_msg.GetMessage() == ednMsgBufferState) { - // Update list of modify section ... - for (int32_t iii=0; iiim_isModify = BufferManager::Get(m_list[iii]->m_bufferID)->IsModify(); + m_list[iii]->m_isModify = BufferManager::get(m_list[iii]->m_bufferID)->isModify(); } } - MarkToRedraw(); + markToRedraw(); } } -etk::Color<> BufferView::GetBasicBG(void) +etk::Color<> BufferView::getBasicBG(void) { - return ColorizeManager::Get(COLOR_LIST_BG_1); + return ColorizeManager::get(COLOR_LIST_BG_1); } -uint32_t BufferView::GetNuberOfColomn(void) +uint32_t BufferView::getNuberOfColomn(void) { return 1; } -bool BufferView::GetTitle(int32_t colomn, etk::UString &myTitle, etk::Color<> &fg, etk::Color<> &bg) +bool BufferView::getTitle(int32_t colomn, etk::UString &myTitle, etk::Color<> &fg, etk::Color<> &bg) { myTitle = "Buffers : "; return true; } -uint32_t BufferView::GetNuberOfRaw(void) +uint32_t BufferView::getNuberOfRaw(void) { - return m_list.Size(); + return m_list.size(); } -bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color<> &fg, etk::Color<> &bg) +bool BufferView::getElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color<> &fg, etk::Color<> &bg) { bool isModify; basicColor_te selectFG = COLOR_LIST_TEXT_NORMAL; basicColor_te selectBG = COLOR_LIST_BG_1; - // when requested a new display selection ==> reset the previous one ... + // when requested a new display selection == > reset the previous one ... if (m_selectedIdRequested != -1) { m_selectedID = -1; } - if( raw>=0 - && raw= 0 + && rawm_bufferName.GetNameFile(); + myTextToWrite = m_list[raw]->m_bufferName.getNameFile(); if (true == m_list[raw]->m_isModify) { selectFG = COLOR_LIST_TEXT_MODIFY; } else { selectFG = COLOR_LIST_TEXT_NORMAL; } - if (raw%2==0) { + if (raw%2 == 0) { selectBG = COLOR_LIST_BG_1; } else { selectBG = COLOR_LIST_BG_2; @@ -161,7 +161,7 @@ bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToW // stop searching m_selectedIdRequested = -1; // set the raw visible : - SetRawVisible(m_selectedID); + setRawVisible(m_selectedID); } if (m_selectedID == raw) { selectBG = COLOR_LIST_BG_SELECTED; @@ -169,23 +169,23 @@ bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToW } else { myTextToWrite = "ERROR"; } - fg = ColorizeManager::Get(selectFG); - bg = ColorizeManager::Get(selectBG); + fg = ColorizeManager::get(selectFG); + bg = ColorizeManager::get(selectBG); return true; } -bool BufferView::OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEvent, int32_t colomn, int32_t raw, float x, float y) +bool BufferView::onItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEvent, int32_t colomn, int32_t raw, float x, float y) { if (1 == IdInput && typeEvent == ewol::keyEvent::statusSingle) { APPL_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw ); - if( raw>=0 - && raw= 0 + && rawm_bufferID; SendMultiCast(ednMsgBufferId, m_list[raw]->m_bufferID); } } - MarkToRedraw(); + markToRedraw(); return false; } diff --git a/sources/appl/Gui/BufferView.h b/sources/appl/Gui/BufferView.h index fe6c1bd..cc05846 100644 --- a/sources/appl/Gui/BufferView.h +++ b/sources/appl/Gui/BufferView.h @@ -46,19 +46,19 @@ class BufferView : public widget::List BufferView(void); ~BufferView(void); // Derived function - const char * const GetObjectType(void) { return "ApplBufferView"; }; + const char * const getObjectType(void) { return "ApplBufferView"; }; // Derived function - virtual void OnReceiveMessage(const ewol::EMessage& _msg); + virtual void onReceiveMessage(const ewol::EMessage& _msg); protected: // function call to display the list : - virtual etk::Color<> GetBasicBG(void); - void RemoveAllElement(void); + virtual etk::Color<> getBasicBG(void); + void removeAllElement(void); // Derived function - virtual uint32_t GetNuberOfColomn(void); - virtual bool GetTitle(int32_t colomn, etk::UString &myTitle, etk::Color<> &fg, etk::Color<> &bg); - virtual uint32_t GetNuberOfRaw(void); - virtual bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color<> &fg, etk::Color<> &bg); - virtual bool OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEvent, int32_t colomn, int32_t raw, float x, float y); + virtual uint32_t getNuberOfColomn(void); + virtual bool getTitle(int32_t colomn, etk::UString &myTitle, etk::Color<> &fg, etk::Color<> &bg); + virtual uint32_t getNuberOfRaw(void); + virtual bool getElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color<> &fg, etk::Color<> &bg); + virtual bool onItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEvent, int32_t colomn, int32_t raw, float x, float y); }; diff --git a/sources/appl/Gui/CodeView.cpp b/sources/appl/Gui/CodeView.cpp index 4872282..1d63de0 100644 --- a/sources/appl/Gui/CodeView.cpp +++ b/sources/appl/Gui/CodeView.cpp @@ -23,20 +23,20 @@ #undef __class__ #define __class__ "CodeView" -void CodeView::Init(void) +void CodeView::init(void) { m_label = "CodeView is disable ..."; m_bufferID = -1; m_buttunOneSelected = false; - m_lineNumberList.Clear(); + m_lineNumberList.clear(); m_textColorFg = etk::color::black; m_textColorBg = etk::color::black; - m_textColorBg.SetA(0x40); - SetCanHaveFocus(true); + m_textColorBg.setA(0x40); + setCanHaveFocus(true); RegisterMultiCast(ednMsgBufferId); RegisterMultiCast(ednMsgGuiCopy); RegisterMultiCast(ednMsgGuiPaste); @@ -49,7 +49,7 @@ void CodeView::Init(void) RegisterMultiCast(ednMsgGuiFind); RegisterMultiCast(ednMsgGuiReplace); RegisterMultiCast(ednMsgGuiGotoLine); - SetLimitScrolling(0.2); + setLimitScrolling(0.2); ShortCutAdd("ctrl+w", ednMsgGuiRm, "Line"); ShortCutAdd("ctrl+shift+w", ednMsgGuiRm, "Paragraph"); @@ -63,12 +63,12 @@ void CodeView::Init(void) CodeView::CodeView(etk::UString fontName, int32_t fontSize) : m_displayText(fontName, fontSize) { - Init(); + init(); } CodeView::CodeView(void) { - Init(); + init(); } CodeView::~CodeView(void) @@ -81,78 +81,78 @@ CodeView::~CodeView(void) * @brief Check if the number of reference buffer is good or not ... * @param[in] bufferID id of the current Buffer that needed to have a reference */ -void CodeView::UpdateNumberOfLineReference(int32_t bufferID) +void CodeView::updateNumberOfLineReference(int32_t bufferID) { vec2 tmpCoord(0,0); - if (m_lineNumberList.Size()<=bufferID) { + if (m_lineNumberList.size() <= bufferID) { // update the number of elements : - for (int32_t iii=m_lineNumberList.Size(); iii <= bufferID; iii++) { + for (int32_t iii=m_lineNumberList.size(); iii <= bufferID; iii++) { // add start line at 0 : - m_lineNumberList.PushBack(tmpCoord); + m_lineNumberList.pushBack(tmpCoord); } } } -bool CodeView::CalculateMinSize(void) +bool CodeView::calculateMinSize(void) { m_minSize.setValue(50,50); return true; } -void CodeView::CalculateMaxSize(void) +void CodeView::calculateMaxSize(void) { m_maxSize.setX(2048); - int32_t letterHeight = m_displayText.CalculateSize(etk::UniChar('A')).y(); - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + int32_t letterHeight = m_displayText.calculateSize(etk::UniChar('A')).y(); + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { - m_maxSize.setY(tmpBuffer->GetNumberOfLine() * letterHeight); + m_maxSize.setY(tmpBuffer->getNumberOfLine() * letterHeight); } else { m_maxSize.setY(50); } } -void CodeView::OnDraw(void) +void CodeView::onDraw(void) { - m_displayDrawing.Draw(); - m_displayText.Draw(); - WidgetScrooled::OnDraw(); + m_displayDrawing.draw(); + m_displayText.draw(); + WidgetScrooled::onDraw(); } -void CodeView::OnRegenerateDisplay(void) +void CodeView::onRegenerateDisplay(void) { - if (true == NeedRedraw()) { - int64_t startTime = ewol::GetTime(); + if (true == needRedraw()) { + int64_t startTime = ewol::getTime(); // For the scrooling windows - CalculateMaxSize(); - m_displayDrawing.Clear(); - m_displayText.Clear(); + calculateMaxSize(); + m_displayDrawing.clear(); + m_displayText.clear(); - // Reset the background : - m_displayDrawing.SetPos(vec3(-2048, -2048, 0)); - m_displayDrawing.SetColor(ColorizeManager::Get(COLOR_CODE_BASIC_BG)); - m_displayDrawing.RectangleWidth(vec3(4096, 4096, 0) ); + // reset the background : + m_displayDrawing.setPos(vec3(-2048, -2048, 0)); + m_displayDrawing.setColor(ColorizeManager::get(COLOR_CODE_BASIC_BG)); + m_displayDrawing.rectangleWidth(vec3(4096, 4096, 0) ); - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if( NULL != tmpBuffer - && true == tmpBuffer->NeedToUpdateDisplayPosition() ) { - vec2 borderWidth = BufferManager::Get(m_bufferID)->GetBorderSize(); + && true == tmpBuffer->needToUpdateDisplayPosition() ) { + vec2 borderWidth = BufferManager::get(m_bufferID)->getBorderSize(); bool centerRequested = false; // TODO : set it back ... - vec2 currentPosition = BufferManager::Get(m_bufferID)->GetPosition(999/*m_OObjectTextNormal.GetFontID()*/, centerRequested); - SetScrollingPositionDynamic(borderWidth, currentPosition, centerRequested); + vec2 currentPosition = BufferManager::get(m_bufferID)->getPosition(999/*m_OObjectTextNormal.getFontID()*/, centerRequested); + setScrollingPositionDynamic(borderWidth, currentPosition, centerRequested); } // else : nothing to do ... // generate the objects : if (-1 == m_bufferID) { - m_displayText.SetTextAlignement(10, m_size.x()-20, ewol::Text::alignLeft); - m_displayDrawing.SetColor(0x00000022); - m_displayDrawing.SetPos(vec3(10, 0, 0)); - m_displayDrawing.Rectangle(vec3((int32_t)m_size.x()-20, 1500, 0) ); + m_displayText.setTextAlignement(10, m_size.x()-20, ewol::Text::alignLeft); + m_displayDrawing.setColor(0x00000022); + m_displayDrawing.setPos(vec3(10, 0, 0)); + m_displayDrawing.rectangle(vec3((int32_t)m_size.x()-20, 1500, 0) ); - m_displayText.SetRelPos(vec3(10, 0, 0)); + m_displayText.setRelPos(vec3(10, 0, 0)); // nothing to display : etk::UString tmpString("
\n" "\n" @@ -167,71 +167,71 @@ void CodeView::OnRegenerateDisplay(void) " No Buffer Availlable to display\n" " \n" "\n"); - m_displayText.SetPos(vec3(0.0f, m_size.y(), 0.0f) ); - m_displayText.ForceLineReturn(); - m_displayText.PrintDecorated(tmpString); + m_displayText.setPos(vec3(0.0f, m_size.y(), 0.0f) ); + m_displayText.forceLineReturn(); + m_displayText.printDecorated(tmpString); } else { - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { - tmpBuffer->Display(m_displayText, m_originScrooled.x(), m_originScrooled.y(), m_size.x(), m_size.y()); + tmpBuffer->display(m_displayText, m_originScrooled.x(), m_originScrooled.y(), m_size.x(), m_size.y()); } // set the current size of the windows - SetMaxSize(BufferManager::Get(m_bufferID)->GetMaxSize()); + setMaxSize(BufferManager::get(m_bufferID)->getMaxSize()); } - int64_t stopTime = ewol::GetTime(); + int64_t stopTime = ewol::getTime(); APPL_DEBUG("Display Code Generation = " << stopTime - startTime << " micro-s"); // call the herited class... - WidgetScrooled::OnRegenerateDisplay(); + WidgetScrooled::onRegenerateDisplay(); } } -bool CodeView::OnEventEntry(const ewol::EventEntry& _event) +bool CodeView::onEventEntry(const ewol::EventEntry& _event) { - if (_event.GetType() == ewol::keyEvent::keyboardChar) { + if (_event.getType() == ewol::keyEvent::keyboardChar) { //APPL_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent); - if (_event.GetStatus() == ewol::keyEvent::statusDown) { - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + if (_event.getStatus() == ewol::keyEvent::statusDown) { + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { - tmpBuffer->AddChar(_event.GetChar()); + tmpBuffer->addChar(_event.getChar()); } - MarkToRedraw(); + markToRedraw(); } return true; } // move events ... - if (_event.GetStatus() == ewol::keyEvent::statusDown) { - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + if (_event.getStatus() == ewol::keyEvent::statusDown) { + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { - tmpBuffer->cursorMove(_event.GetType()); + tmpBuffer->cursorMove(_event.getType()); } - MarkToRedraw(); + markToRedraw(); } return true; } -void CodeView::OnEventClipboard(ewol::clipBoard::clipboardListe_te _clipboardID) +void CodeView::onEventClipboard(ewol::clipBoard::clipboardListe_te _clipboardID) { - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { tmpBuffer->Paste(_clipboardID); } - MarkToRedraw(); + markToRedraw(); } -bool CodeView::OnEventInput(const ewol::EventInput& _event) +bool CodeView::onEventInput(const ewol::EventInput& _event) { - vec2 relativePos = RelativePosition(_event.GetPos()); - //APPL_DEBUG("Event at pos : " << _event.GetPos() << " ==> " << relativePos ); + vec2 relativePos = relativePosition(_event.getPos()); + //APPL_DEBUG("Event at pos : " << _event.getPos() << " == > " << relativePos ); // corection for the openGl abstraction //relativePos.y = m_size.y - relativePos.y; vec2 limitedPos = relativePos; limitedPos.setValue(etk_avg(1, limitedPos.x(), m_size.x()-1), etk_avg(1, limitedPos.y(), m_size.y()-1)); - if (true == WidgetScrooled::OnEventInput(_event)) { - KeepFocus(); + if (true == WidgetScrooled::onEventInput(_event)) { + keepFocus(); // nothing to do ... done on upper widget ... return true; } @@ -240,51 +240,51 @@ bool CodeView::OnEventInput(const ewol::EventInput& _event) return false; } - if (1 == _event.GetId()) { + if (1 == _event.getId()) { - if (ewol::keyEvent::typeMouse == _event.GetType()) { - if (ewol::keyEvent::statusDown == _event.GetStatus()) { + if (ewol::keyEvent::typeMouse == _event.getType()) { + if (ewol::keyEvent::statusDown == _event.getStatus()) { m_buttunOneSelected = true; - KeepFocus(); - // TODO : Set something good - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + keepFocus(); + // TODO : set something good + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { tmpBuffer->MouseEvent(limitedPos); } - MarkToRedraw(); - } else if (ewol::keyEvent::statusUp == _event.GetStatus()) { + markToRedraw(); + } else if (ewol::keyEvent::statusUp == _event.getStatus()) { m_buttunOneSelected = false; - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { tmpBuffer->Copy(ewol::clipBoard::clipboardSelection); } - MarkToRedraw(); + markToRedraw(); } } - if (ewol::keyEvent::statusSingle == _event.GetStatus()) { - if (ewol::keyEvent::typeMouse == _event.GetType()) { - KeepFocus(); - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + if (ewol::keyEvent::statusSingle == _event.getStatus()) { + if (ewol::keyEvent::typeMouse == _event.getType()) { + keepFocus(); + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { tmpBuffer->MouseEvent(limitedPos); } - MarkToRedraw(); + markToRedraw(); } else { // nothing to do ... } - } else if (ewol::keyEvent::statusDouble == _event.GetStatus()) { - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + } else if (ewol::keyEvent::statusDouble == _event.getStatus()) { + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { tmpBuffer->MouseEventDouble(); } - MarkToRedraw(); - } else if (ewol::keyEvent::statusTriple == _event.GetStatus()) { - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + markToRedraw(); + } else if (ewol::keyEvent::statusTriple == _event.getStatus()) { + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { tmpBuffer->MouseEventTriple(); } - MarkToRedraw(); - } else if (ewol::keyEvent::statusMove == _event.GetStatus()) { + markToRedraw(); + } else if (ewol::keyEvent::statusMove == _event.getStatus()) { if (true == m_buttunOneSelected) { int xxx, yyy; xxx = relativePos.x(); @@ -296,185 +296,185 @@ bool CodeView::OnEventInput(const ewol::EventInput& _event) yyy = 0; } //APPL_INFO("mouse-motion BT1 %d, %d", xxx, yyy); - // TODO : Set something good - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + // TODO : set something good + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { tmpBuffer->MouseSelectFromCursorTo(limitedPos); } - MarkToRedraw(); + markToRedraw(); } } - } else if (2 == _event.GetId()) { - if (ewol::keyEvent::statusSingle == _event.GetStatus()) { - // TODO : Set something good - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + } else if (2 == _event.getId()) { + if (ewol::keyEvent::statusSingle == _event.getStatus()) { + // TODO : set something good + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { tmpBuffer->MouseEvent(limitedPos); } ewol::clipBoard::Request(ewol::clipBoard::clipboardSelection); - KeepFocus(); + keepFocus(); } } return true; } -void CodeView::OnReceiveMessage(const ewol::EMessage& _msg) +void CodeView::onReceiveMessage(const ewol::EMessage& _msg) { - widget::WidgetScrooled::OnReceiveMessage(_msg); - APPL_DEBUG("Extern Event : " << _msg.GetCaller() << " type : " << _msg.GetMessage() << " data=\"" << _msg.GetData() << "\""); + widget::WidgetScrooled::onReceiveMessage(_msg); + APPL_DEBUG("Extern Event : " << _msg.getCaller() << " type : " << _msg.GetMessage() << " data=\"" << _msg.GetData() << "\""); - if(_msg.GetMessage() == ednMsgBufferId) { + if(_msg.getMessage() == ednMsgBufferId) { //keep the reference of the display offset : - if( m_bufferID >=0 - && m_bufferID < m_lineNumberList.Size()) { + if( m_bufferID >= 0 + && m_bufferID < m_lineNumberList.size()) { m_lineNumberList[m_bufferID] = m_originScrooled; } int32_t bufferID = 0; - sscanf(_msg.GetData().c_str(), "%d", &bufferID); + sscanf(_msg.getData().c_str(), "%d", &bufferID); APPL_INFO("Select a new Buffer ... " << bufferID); // set the new buffer ID m_bufferID = bufferID; // update the start display position... - UpdateNumberOfLineReference(m_bufferID); + updateNumberOfLineReference(m_bufferID); // set back if needed the display position ... - if( m_bufferID >=0 - && m_bufferID < m_lineNumberList.Size()) { + if( m_bufferID >= 0 + && m_bufferID < m_lineNumberList.size()) { m_originScrooled = m_lineNumberList[m_bufferID]; } - } else if (_msg.GetMessage() == ednMsgGuiCopy) { - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + } else if (_msg.getMessage() == ednMsgGuiCopy) { + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { tmpBuffer->Copy(ewol::clipBoard::clipboardStd); } - } else if (_msg.GetMessage() == ednMsgGuiCut) { - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + } else if (_msg.getMessage() == ednMsgGuiCut) { + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { tmpBuffer->Cut(ewol::clipBoard::clipboardStd); } - } else if (_msg.GetMessage() == ednMsgGuiPaste) { + } else if (_msg.getMessage() == ednMsgGuiPaste) { ewol::clipBoard::Request(ewol::clipBoard::clipboardStd); - } else if (_msg.GetMessage() == ednMsgGuiUndo) { - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + } else if (_msg.getMessage() == ednMsgGuiUndo) { + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { tmpBuffer->Undo(); } - } else if (_msg.GetMessage() == ednMsgGuiRedo) { - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + } else if (_msg.getMessage() == ednMsgGuiRedo) { + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { tmpBuffer->Redo(); } - } else if (_msg.GetMessage() == ednMsgGuiRm) { + } else if (_msg.getMessage() == ednMsgGuiRm) { // data : "Word" "Line" "Paragraph" - if (_msg.GetData() == "Word") { - APPL_WARNING(" on event " << _msg.GetMessage() << " data=\"" << _msg.GetData() << "\" ==> not coded" ); - } else if (_msg.GetData() == "Line") { - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + if (_msg.getData() == "Word") { + APPL_WARNING(" on event " << _msg.getMessage() << " data=\"" << _msg.GetData() << "\" == > not coded" ); + } else if (_msg.getData() == "Line") { + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { - tmpBuffer->RemoveLine(); + tmpBuffer->removeLine(); } - } else if (_msg.GetData() == "Paragraph") { - APPL_WARNING(" on event " << _msg.GetMessage() << " data=\"" << _msg.GetData() << "\" ==> not coded" ); + } else if (_msg.getData() == "Paragraph") { + APPL_WARNING(" on event " << _msg.getMessage() << " data=\"" << _msg.GetData() << "\" == > not coded" ); } else { - APPL_ERROR(" on event " << _msg.GetMessage() << " unknow data=\"" << _msg.GetData() << "\"" ); + APPL_ERROR(" on event " << _msg.getMessage() << " unknow data=\"" << _msg.GetData() << "\"" ); } - } else if (_msg.GetMessage() == ednMsgGuiSelect) { + } else if (_msg.getMessage() == ednMsgGuiSelect) { // data : "ALL" "NONE" - if (_msg.GetData() == "ALL") { - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + if (_msg.getData() == "ALL") { + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { tmpBuffer->SelectAll(); } - } else if (_msg.GetData() == "NONE") { - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + } else if (_msg.getData() == "NONE") { + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { tmpBuffer->SelectNone(); } } else { - APPL_ERROR(" on event " << _msg.GetMessage() << " unknow data=\"" << _msg.GetData() << "\"" ); + APPL_ERROR(" on event " << _msg.getMessage() << " unknow data=\"" << _msg.GetData() << "\"" ); } - } else if (_msg.GetMessage() == ednMsgGuiChangeCharset) { + } else if (_msg.getMessage() == ednMsgGuiChangeCharset) { // data : "UTF-8" "ISO-8859-1" "ISO-8859-15" - if (_msg.GetData() == "UTF-8") { - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + if (_msg.getData() == "UTF-8") { + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { - tmpBuffer->SetCharset(unicode::EDN_CHARSET_UTF8); + tmpBuffer->setCharset(unicode::EDN_CHARSET_UTF8); } - } else if (_msg.GetData() == "ISO-8859-1") { - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + } else if (_msg.getData() == "ISO-8859-1") { + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { - tmpBuffer->SetCharset(unicode::EDN_CHARSET_ISO_8859_1); + tmpBuffer->setCharset(unicode::EDN_CHARSET_ISO_8859_1); } - } else if (_msg.GetData() == "ISO-8859-15") { - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + } else if (_msg.getData() == "ISO-8859-15") { + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { - tmpBuffer->SetCharset(unicode::EDN_CHARSET_ISO_8859_15); + tmpBuffer->setCharset(unicode::EDN_CHARSET_ISO_8859_15); } } else { - APPL_ERROR(" on event " << _msg.GetMessage() << " unknow data=\"" << _msg.GetData() << "\"" ); + APPL_ERROR(" on event " << _msg.getMessage() << " unknow data=\"" << _msg.GetData() << "\"" ); } - } else if (_msg.GetMessage() == ednMsgGuiFind) { + } else if (_msg.getMessage() == ednMsgGuiFind) { etk::UString myDataString; - SearchData::GetSearch(myDataString); - if (_msg.GetData() == "Next") { - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + SearchData::getSearch(myDataString); + if (_msg.getData() == "Next") { + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { - tmpBuffer->Search(myDataString, false, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() ); + tmpBuffer->Search(myDataString, false, SearchData::getCase(), SearchData::GetWrap(), SearchData::GetRegExp() ); } - } else if (_msg.GetData() == "Previous") { - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + } else if (_msg.getData() == "Previous") { + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { - tmpBuffer->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() ); + tmpBuffer->Search(myDataString, true, SearchData::getCase(), SearchData::GetWrap(), SearchData::GetRegExp() ); } } - } else if (_msg.GetMessage() == ednMsgGuiReplace) { + } else if (_msg.getMessage() == ednMsgGuiReplace) { etk::UString myDataString; - SearchData::GetReplace(myDataString); - if (_msg.GetData() == "Normal") { - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + SearchData::getReplace(myDataString); + if (_msg.getData() == "Normal") { + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { tmpBuffer->Replace(myDataString); } - } else if (_msg.GetData() == "All") { + } else if (_msg.getData() == "All") { } - } else if (_msg.GetMessage() == ednMsgGuiGotoLine) { + } else if (_msg.getMessage() == ednMsgGuiGotoLine) { int32_t lineID = 0; - sscanf(_msg.GetData().c_str(), "%d", &lineID); + sscanf(_msg.getData().c_str(), "%d", &lineID); APPL_INFO("Goto line : " << lineID); - BufferText* tmpBuffer = BufferManager::Get(m_bufferID); + BufferText* tmpBuffer = BufferManager::get(m_bufferID); if (NULL!=tmpBuffer) { tmpBuffer->JumpAtLine(lineID); } } - // Force redraw of the widget - MarkToRedraw(); + // force redraw of the widget + markToRedraw(); } -void CodeView::OnGetFocus(void) +void CodeView::onGetFocus(void) { /* - ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_bufferID); + ewol::widgetMessageMultiCast::Send(getWidgetId(), ednMsgBufferId, m_bufferID); */ ShowKeyboard(); APPL_INFO("Focus - In"); } -void CodeView::OnLostFocus(void) +void CodeView::onLostFocus(void) { HideKeyboard(); APPL_INFO("Focus - out"); } -void CodeView::SetFontSize(int32_t size) +void CodeView::setFontSize(int32_t size) { - m_displayText.SetFontSize(size); - SetScrollingSize(size*3.0*1.46); // 1.46 is a magic nmber ... + m_displayText.setFontSize(size); + setScrollingSize(size*3.0*1.46); // 1.46 is a magic nmber ... } -void CodeView::SetFontName(etk::UString fontName) +void CodeView::setFontName(etk::UString fontName) { - m_displayText.SetFontName(fontName); + m_displayText.setFontName(fontName); } diff --git a/sources/appl/Gui/CodeView.h b/sources/appl/Gui/CodeView.h index a5c5160..df59f32 100644 --- a/sources/appl/Gui/CodeView.h +++ b/sources/appl/Gui/CodeView.h @@ -21,7 +21,7 @@ class CodeView :public widget::WidgetScrooled { public: - void Init(void); + void init(void); CodeView(etk::UString fontName, int32_t fontSize); CodeView(void); virtual ~CodeView(void); @@ -32,27 +32,27 @@ class CodeView :public widget::WidgetScrooled int32_t m_bufferID; bool m_buttunOneSelected; etk::Vector m_lineNumberList; - void UpdateNumberOfLineReference(int32_t bufferID); + void updateNumberOfLineReference(int32_t bufferID); // drawing elements : ewol::Text m_displayText; - ewol::Drawing m_displayDrawing; + ewol::drawing m_displayDrawing; public: - void SetFontSize(int32_t size); - void SetFontName(etk::UString fontName); + void setFontSize(int32_t size); + void setFontName(etk::UString fontName); private: - void CalculateMaxSize(void); + void calculateMaxSize(void); protected: // derived function - virtual void OnDraw(void); + virtual void onDraw(void); public: // Derived function - const char * const GetObjectType(void) { return "ApplCodeView"; }; - virtual bool CalculateMinSize(void); - virtual void OnRegenerateDisplay(void); - virtual void OnReceiveMessage(const ewol::EMessage& _msg); - virtual bool OnEventInput(const ewol::EventInput& _event); - virtual bool OnEventEntry(const ewol::EventEntry& _event); - virtual void OnEventClipboard(ewol::clipBoard::clipboardListe_te clipboardID); - virtual void OnGetFocus(void); - virtual void OnLostFocus(void); + const char * const getObjectType(void) { return "ApplCodeView"; }; + virtual bool calculateMinSize(void); + virtual void onRegenerateDisplay(void); + virtual void onReceiveMessage(const ewol::EMessage& _msg); + virtual bool onEventInput(const ewol::EventInput& _event); + virtual bool onEventEntry(const ewol::EventEntry& _event); + virtual void onEventClipboard(ewol::clipBoard::clipboardListe_te clipboardID); + virtual void onGetFocus(void); + virtual void onLostFocus(void); }; #endif diff --git a/sources/appl/Gui/MainWindows.cpp b/sources/appl/Gui/MainWindows.cpp index d0a76d7..53e8140 100644 --- a/sources/appl/Gui/MainWindows.cpp +++ b/sources/appl/Gui/MainWindows.cpp @@ -35,14 +35,14 @@ namespace appl { - etk::UString GetVersion(void) + etk::UString getVersion(void) { #define FIRST_YEAR (2010) - etk::UString tmpOutput = (date::GetYear()-FIRST_YEAR); + etk::UString tmpOutput = (date::getYear()-FIRST_YEAR); tmpOutput += "."; - tmpOutput += date::GetMonth(); + tmpOutput += date::getMonth(); tmpOutput += "."; - tmpOutput += date::GetDay(); + tmpOutput += date::getDay(); return tmpOutput; } @@ -65,25 +65,25 @@ class ParameterAboutGui : public widget::Sizer mySpacer = new widget::Spacer(); if (NULL == mySpacer) { - APPL_ERROR("Can not allocate widget ==> display might be in error"); + APPL_ERROR("Can not allocate widget == > display might be in error"); } else { - mySpacer->SetExpand(bvec2(true,true)); - SubWidgetAdd(mySpacer); + mySpacer->setExpand(bvec2(true,true)); + subWidgetAdd(mySpacer); } etk::UString tmpLabel = ""; tmpLabel += " Editeur De N'ours : v:"; - tmpLabel += appl::GetVersion(); + tmpLabel += appl::getVersion(); tmpLabel += "
"; tmpLabel += " Build Time : "; - tmpLabel += date::GetYear(); + tmpLabel += date::getYear(); tmpLabel += "/"; - tmpLabel += date::GetMonth(); + tmpLabel += date::getMonth(); tmpLabel += "/"; - tmpLabel += date::GetDay(); + tmpLabel += date::getDay(); tmpLabel += " "; - tmpLabel += date::GetHour(); + tmpLabel += date::getHour(); tmpLabel += "h"; - tmpLabel += date::GetMinute(); + tmpLabel += date::getMinute(); tmpLabel += "
"; tmpLabel += " Website : https://github.com/HeeroYui/edn
"; tmpLabel += " License : GPL v3
"; @@ -95,10 +95,10 @@ class ParameterAboutGui : public widget::Sizer tmpLabel += "
"; widget::Label* myLabel = new widget::Label(tmpLabel); if (NULL == myLabel) { - APPL_ERROR("Can not allocate widget ==> display might be in error"); + APPL_ERROR("Can not allocate widget == > display might be in error"); } else { - myLabel->SetExpand(bvec2(true,false)); - SubWidgetAdd(myLabel); + myLabel->setExpand(bvec2(true,false)); + subWidgetAdd(myLabel); } }; @@ -126,117 +126,117 @@ MainWindows::MainWindows(void) widget::Menu * myMenu = NULL; mySizerVert = new widget::Sizer(widget::Sizer::modeVert); - SetSubWidget(mySizerVert); + setSubWidget(mySizerVert); mySizerHori = new widget::Sizer(widget::Sizer::modeHori); - mySizerVert->SubWidgetAdd(mySizerHori); + mySizerVert->subWidgetAdd(mySizerHori); myBufferView = new BufferView(); - myBufferView->SetExpand(bvec2(false,true)); - myBufferView->SetFill(bvec2(true,true)); - mySizerHori->SubWidgetAdd(myBufferView); + myBufferView->setExpand(bvec2(false,true)); + myBufferView->setFill(bvec2(true,true)); + mySizerHori->subWidgetAdd(myBufferView); mySizerVert2 = new widget::Sizer(widget::Sizer::modeVert); - mySizerHori->SubWidgetAdd(mySizerVert2); + mySizerHori->subWidgetAdd(mySizerVert2); // main buffer Area : myTextView = new appl::TextViewer("FreeSerif;FreeMono;DejaVuSansMono", 11); - myTextView->SetExpand(bvec2(true,true)); - myTextView->SetFill(bvec2(true,true)); - mySizerVert2->SubWidgetAdd(myTextView); + myTextView->setExpand(bvec2(true,true)); + myTextView->setFill(bvec2(true,true)); + mySizerVert2->subWidgetAdd(myTextView); /* myCodeView = new CodeView("FreeMono;DejaVuSansMono", 11); - myCodeView->SetExpand(bvec2(true,true)); - myCodeView->SetFill(bvec2(true,true)); - mySizerVert2->SubWidgetAdd(myCodeView); + myCodeView->setExpand(bvec2(true,true)); + myCodeView->setFill(bvec2(true,true)); + mySizerVert2->subWidgetAdd(myCodeView); */ // search area : Search * mySearch = new Search(); - mySizerVert2->SubWidgetAdd(mySearch); + mySizerVert2->subWidgetAdd(mySearch); #ifdef APPL_BUFFER_FONT_DISTANCE_FIELD { widget::Sizer * mySizerHori2 = new widget::Sizer(widget::Sizer::modeHori); - mySizerVert2->SubWidgetAdd(mySizerHori2); + mySizerVert2->subWidgetAdd(mySizerHori2); widget::CheckBox* tmpCheck = new widget::CheckBox("smooth"); - mySizerHori2->SubWidgetAdd(tmpCheck); - tmpCheck->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_smoothChick); + mySizerHori2->subWidgetAdd(tmpCheck); + tmpCheck->registerOnEvent(this, ewolEventCheckBoxClicked, l_smoothChick); widget::Slider* tmpSlider = new widget::Slider(); - mySizerHori2->SubWidgetAdd(tmpSlider); - tmpSlider->RegisterOnEvent(this, ewolEventSliderChange, l_smoothMin); - tmpSlider->SetExpand(bvec2(true,false)); - tmpSlider->SetMin(0); - tmpSlider->SetMax(1000); - tmpSlider->SetValue(0450); + mySizerHori2->subWidgetAdd(tmpSlider); + tmpSlider->registerOnEvent(this, ewolEventSliderChange, l_smoothMin); + tmpSlider->setExpand(bvec2(true,false)); + tmpSlider->setMin(0); + tmpSlider->setMax(1000); + tmpSlider->setValue(0450); tmpSliderMin = tmpSlider; tmpSlider = new widget::Slider(); - mySizerHori2->SubWidgetAdd(tmpSlider); - tmpSlider->RegisterOnEvent(this, ewolEventSliderChange, l_smoothMax); - tmpSlider->SetExpand(bvec2(true,false)); - tmpSlider->SetMin(0); - tmpSlider->SetMax(1000); - tmpSlider->SetValue(0550); + mySizerHori2->subWidgetAdd(tmpSlider); + tmpSlider->registerOnEvent(this, ewolEventSliderChange, l_smoothMax); + tmpSlider->setExpand(bvec2(true,false)); + tmpSlider->setMin(0); + tmpSlider->setMax(1000); + tmpSlider->setValue(0550); tmpSliderMax = tmpSlider; } #endif mySizerHori = new widget::Sizer(widget::Sizer::modeHori); - mySizerVert->SubWidgetAdd(mySizerHori); + mySizerVert->subWidgetAdd(mySizerHori); myMenu = new widget::Menu(); - mySizerHori->SubWidgetAdd(myMenu); - int32_t idMenuFile = myMenu->AddTitle("File"); - (void)myMenu->Add(idMenuFile, "New", "", ednMsgGuiNew); - (void)myMenu->AddSpacer(); - (void)myMenu->Add(idMenuFile, "Open", "THEME:GUI:Load.svg", ednMsgGuiOpen); - (void)myMenu->Add(idMenuFile, "Close", "THEME:GUI:Close.svg", ednMsgGuiClose, "current"); - (void)myMenu->Add(idMenuFile, "Close (all)", "", ednMsgGuiClose, "All"); - (void)myMenu->Add(idMenuFile, "Save", "THEME:GUI:Save.svg", ednMsgGuiSave, "current"); - (void)myMenu->Add(idMenuFile, "Save As ...", "", ednMsgGuiSaveAs); - (void)myMenu->AddSpacer(); - //(void)myMenu->Add(idMenuFile, "Exit", "", ednMsgGuiExit); - (void)myMenu->AddSpacer(); - (void)myMenu->Add(idMenuFile, "Properties", "THEME:GUI:Parameter.svg", ednMsgProperties); - int32_t idMenuEdit = myMenu->AddTitle("Edit"); - (void)myMenu->Add(idMenuEdit, "Undo", "THEME:GUI:Undo.svg", ednMsgGuiUndo); - (void)myMenu->Add(idMenuEdit, "Redo", "THEME:GUI:Redo.svg", ednMsgGuiRedo); - (void)myMenu->AddSpacer(); - (void)myMenu->Add(idMenuEdit, "Copy", "", ednMsgGuiCopy, "STD"); - (void)myMenu->Add(idMenuEdit, "Cut", "", ednMsgGuiCut, "STD"); - (void)myMenu->Add(idMenuEdit, "Paste", "", ednMsgGuiPaste, "STD"); - (void)myMenu->Add(idMenuEdit, "Remove", "", ednMsgGuiRm); - (void)myMenu->AddSpacer(); - (void)myMenu->Add(idMenuEdit, "Select All","", ednMsgGuiSelect, "ALL"); - (void)myMenu->Add(idMenuEdit, "Un-Select","", ednMsgGuiSelect, "NONE"); - (void)myMenu->Add(idMenuEdit, "Goto line ...","", ednMsgGuiGotoLine, "???"); - int32_t idMenuSearch = myMenu->AddTitle("Search"); - (void)myMenu->Add(idMenuSearch, "Search", "THEME:GUI:Search.svg", ednMsgGuiSearch); - (void)myMenu->Add(idMenuSearch, "Replace", "THEME:GUI:Replace.svg", ednMsgGuiReplace); - (void)myMenu->AddSpacer(); - (void)myMenu->Add(idMenuSearch, "Find (previous)","", ednMsgGuiFind, "Previous"); - (void)myMenu->Add(idMenuSearch, "Find (next)", "", ednMsgGuiFind, "Next"); - (void)myMenu->Add(idMenuSearch, "Find (all)", "", ednMsgGuiFind, "All"); - (void)myMenu->Add(idMenuSearch, "Un-Select", "", ednMsgGuiFind, "None"); - int32_t idMenuCTags = myMenu->AddTitle("C-tags"); - (void)myMenu->Add(idMenuCTags, "Load", "", ednMsgGuiCtags, "Load"); - (void)myMenu->Add(idMenuCTags, "ReLoad", "", ednMsgGuiCtags, "ReLoad"); - (void)myMenu->Add(idMenuCTags, "Jump", "", ednMsgGuiCtags, "Jump"); - (void)myMenu->Add(idMenuCTags, "Back", "", ednMsgGuiCtags, "Back"); - int32_t idMenugDisplay = myMenu->AddTitle("Display"); - (void)myMenu->Add(idMenugDisplay, "Charset UTF-8", "", ednMsgGuiChangeCharset, "UTF-8"); - (void)myMenu->Add(idMenugDisplay, "Charset ISO-8859-1", "", ednMsgGuiChangeCharset, "ISO-8859-1"); - (void)myMenu->Add(idMenugDisplay, "Charset ISO-8859-15", "", ednMsgGuiChangeCharset, "ISO-8859-15"); - (void)myMenu->AddSpacer(); - (void)myMenu->Add(idMenugDisplay, "Color Black", "", ednMsgGuiChangeColor, "Black"); - (void)myMenu->Add(idMenugDisplay, "Color White", "", ednMsgGuiChangeColor, "White"); - (void)myMenu->AddSpacer(); - (void)myMenu->Add(idMenugDisplay, "Reload OpenGl Shader", "", ednMsgGuiReloadShader); + mySizerHori->subWidgetAdd(myMenu); + int32_t idMenuFile = myMenu->addTitle("File"); + (void)myMenu->add(idMenuFile, "New", "", ednMsgGuiNew); + (void)myMenu->addSpacer(); + (void)myMenu->add(idMenuFile, "Open", "THEME:GUI:Load.svg", ednMsgGuiOpen); + (void)myMenu->add(idMenuFile, "Close", "THEME:GUI:Close.svg", ednMsgGuiClose, "current"); + (void)myMenu->add(idMenuFile, "Close (all)", "", ednMsgGuiClose, "All"); + (void)myMenu->add(idMenuFile, "Save", "THEME:GUI:Save.svg", ednMsgGuiSave, "current"); + (void)myMenu->add(idMenuFile, "Save As ...", "", ednMsgGuiSaveAs); + (void)myMenu->addSpacer(); + //(void)myMenu->add(idMenuFile, "Exit", "", ednMsgGuiExit); + (void)myMenu->addSpacer(); + (void)myMenu->add(idMenuFile, "Properties", "THEME:GUI:Parameter.svg", ednMsgProperties); + int32_t idMenuEdit = myMenu->addTitle("Edit"); + (void)myMenu->add(idMenuEdit, "Undo", "THEME:GUI:Undo.svg", ednMsgGuiUndo); + (void)myMenu->add(idMenuEdit, "Redo", "THEME:GUI:Redo.svg", ednMsgGuiRedo); + (void)myMenu->addSpacer(); + (void)myMenu->add(idMenuEdit, "Copy", "", ednMsgGuiCopy, "STD"); + (void)myMenu->add(idMenuEdit, "Cut", "", ednMsgGuiCut, "STD"); + (void)myMenu->add(idMenuEdit, "Paste", "", ednMsgGuiPaste, "STD"); + (void)myMenu->add(idMenuEdit, "Remove", "", ednMsgGuiRm); + (void)myMenu->addSpacer(); + (void)myMenu->add(idMenuEdit, "Select All","", ednMsgGuiSelect, "ALL"); + (void)myMenu->add(idMenuEdit, "Un-Select","", ednMsgGuiSelect, "NONE"); + (void)myMenu->add(idMenuEdit, "Goto line ...","", ednMsgGuiGotoLine, "???"); + int32_t idMenuSearch = myMenu->addTitle("Search"); + (void)myMenu->add(idMenuSearch, "Search", "THEME:GUI:Search.svg", ednMsgGuiSearch); + (void)myMenu->add(idMenuSearch, "Replace", "THEME:GUI:Replace.svg", ednMsgGuiReplace); + (void)myMenu->addSpacer(); + (void)myMenu->add(idMenuSearch, "Find (previous)","", ednMsgGuiFind, "Previous"); + (void)myMenu->add(idMenuSearch, "Find (next)", "", ednMsgGuiFind, "Next"); + (void)myMenu->add(idMenuSearch, "Find (all)", "", ednMsgGuiFind, "All"); + (void)myMenu->add(idMenuSearch, "Un-Select", "", ednMsgGuiFind, "None"); + int32_t idMenuCTags = myMenu->addTitle("C-tags"); + (void)myMenu->add(idMenuCTags, "Load", "", ednMsgGuiCtags, "Load"); + (void)myMenu->add(idMenuCTags, "ReLoad", "", ednMsgGuiCtags, "ReLoad"); + (void)myMenu->add(idMenuCTags, "Jump", "", ednMsgGuiCtags, "Jump"); + (void)myMenu->add(idMenuCTags, "Back", "", ednMsgGuiCtags, "Back"); + int32_t idMenugDisplay = myMenu->addTitle("Display"); + (void)myMenu->add(idMenugDisplay, "Charset UTF-8", "", ednMsgGuiChangeCharset, "UTF-8"); + (void)myMenu->add(idMenugDisplay, "Charset ISO-8859-1", "", ednMsgGuiChangeCharset, "ISO-8859-1"); + (void)myMenu->add(idMenugDisplay, "Charset ISO-8859-15", "", ednMsgGuiChangeCharset, "ISO-8859-15"); + (void)myMenu->addSpacer(); + (void)myMenu->add(idMenugDisplay, "Color Black", "", ednMsgGuiChangeColor, "Black"); + (void)myMenu->add(idMenugDisplay, "Color White", "", ednMsgGuiChangeColor, "White"); + (void)myMenu->addSpacer(); + (void)myMenu->add(idMenugDisplay, "Reload openGl Shader", "", ednMsgGuiReloadShader); m_widgetLabelFileName = new widget::Label("FileName"); - m_widgetLabelFileName->SetExpand(bvec2(true,false)); - m_widgetLabelFileName->SetFill(bvec2(false,true));; - mySizerHori->SubWidgetAdd(m_widgetLabelFileName); + m_widgetLabelFileName->setExpand(bvec2(true,false)); + m_widgetLabelFileName->setFill(bvec2(false,true));; + mySizerHori->subWidgetAdd(m_widgetLabelFileName); // add generic shortcut ... @@ -283,102 +283,102 @@ const char *const ednEventPopUpFileSelected = "edn-mainWindows-openSelected"; const char *const ednEventPopUpFileSaveAs = "edn-mainWindows-saveAsSelected"; -void MainWindows::OnReceiveMessage(const ewol::EMessage& _msg) +void MainWindows::onReceiveMessage(const ewol::EMessage& _msg) { - ewol::Windows::OnReceiveMessage(_msg); + ewol::Windows::onReceiveMessage(_msg); - //APPL_INFO("Receive Event from the main windows ... : \"" << eventId << "\" ==> data=\"" << data << "\"" ); - // Open file Section ... - if (_msg.GetMessage() == ednMsgGuiOpen) { - widget::FileChooser* tmpWidget = new widget::FileChooser(); - tmpWidget->SetTitle("Open Files ..."); - tmpWidget->SetValidateLabel("Open"); - if (BufferManager::GetSelected()!=-1) { - BufferText * myBuffer = BufferManager::Get(BufferManager::GetSelected()); + //APPL_INFO("Receive Event from the main windows ... : \"" << eventId << "\" == > data=\"" << data << "\"" ); + // open file Section ... + if (_msg.getMessage() == ednMsgGuiOpen) { + widget::fileChooser* tmpWidget = new widget::FileChooser(); + tmpWidget->setTitle("Open files ..."); + tmpWidget->setValidateLabel("Open"); + if (BufferManager::getSelected()!=-1) { + BufferText * myBuffer = BufferManager::get(BufferManager::GetSelected()); if (NULL!=myBuffer) { - etk::FSNode tmpFile = myBuffer->GetFileName(); - tmpWidget->SetFolder(tmpFile.GetNameFolder()); + etk::FSNode tmpFile = myBuffer->getFileName(); + tmpWidget->setFolder(tmpFile.getNameFolder()); } } - PopUpWidgetPush(tmpWidget); - tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected); - } else if (_msg.GetMessage() == ednEventPopUpFileSelected) { - APPL_DEBUG("Request opening the file : " << _msg.GetData()); - SendMultiCast(ednMsgOpenFile, _msg.GetData()); - } else if (_msg.GetMessage() == ednMsgGuiSaveAs) { - if (_msg.GetData() == "") { + popUpWidgetPush(tmpWidget); + tmpWidget->registerOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected); + } else if (_msg.getMessage() == ednEventPopUpFileSelected) { + APPL_DEBUG("Request opening the file : " << _msg.getData()); + SendMultiCast(ednMsgOpenFile, _msg.getData()); + } else if (_msg.getMessage() == ednMsgGuiSaveAs) { + if (_msg.getData() == "") { APPL_ERROR("Null data for Save As file ... "); } else { m_currentSavingAsIdBuffer = -1; - if (_msg.GetData() == "current") { - m_currentSavingAsIdBuffer = BufferManager::GetSelected(); + if (_msg.getData() == "current") { + m_currentSavingAsIdBuffer = BufferManager::getSelected(); } else { - sscanf(_msg.GetData().c_str(), "%d", &m_currentSavingAsIdBuffer); + sscanf(_msg.getData().c_str(), "%d", &m_currentSavingAsIdBuffer); } if (false == BufferManager::Exist(m_currentSavingAsIdBuffer)) { APPL_ERROR("Request saveAs on non existant Buffer ID=" << m_currentSavingAsIdBuffer); } else { - BufferText* myBuffer = BufferManager::Get(m_currentSavingAsIdBuffer); - widget::FileChooser* tmpWidget = new widget::FileChooser(); + BufferText* myBuffer = BufferManager::get(m_currentSavingAsIdBuffer); + widget::fileChooser* tmpWidget = new widget::FileChooser(); if (NULL == tmpWidget) { - APPL_ERROR("Can not allocate widget ==> display might be in error"); + APPL_ERROR("Can not allocate widget == > display might be in error"); } else { - tmpWidget->SetTitle("Save Files As..."); - tmpWidget->SetValidateLabel("Save"); + tmpWidget->setTitle("Save files As..."); + tmpWidget->setValidateLabel("Save"); etk::UString folder = "/home/"; etk::UString fileName = ""; - if (true == myBuffer->HaveName()) { - etk::FSNode tmpName = myBuffer->GetFileName(); - folder = tmpName.GetNameFolder(); - fileName = tmpName.GetNameFile(); + if (true == myBuffer->haveName()) { + etk::FSNode tmpName = myBuffer->getFileName(); + folder = tmpName.getNameFolder(); + fileName = tmpName.getNameFile(); } - tmpWidget->SetFolder(folder); - tmpWidget->SetFileName(fileName); - PopUpWidgetPush(tmpWidget); - tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSaveAs); + tmpWidget->setFolder(folder); + tmpWidget->setFileName(fileName); + popUpWidgetPush(tmpWidget); + tmpWidget->registerOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSaveAs); } } } - } else if (_msg.GetMessage() == ednEventPopUpFileSaveAs) { + } else if (_msg.getMessage() == ednEventPopUpFileSaveAs) { // get the filename : - etk::UString tmpData = _msg.GetData(); + etk::UString tmpData = _msg.getData(); APPL_DEBUG("Request Saving As file : " << tmpData); - BufferManager::Get(m_currentSavingAsIdBuffer)->SetFileName(tmpData); + BufferManager::get(m_currentSavingAsIdBuffer)->setFileName(tmpData); SendMultiCast(ednMsgGuiSave, m_currentSavingAsIdBuffer); - } else if( _msg.GetMessage() == ednMsgBufferState - || _msg.GetMessage() == ednMsgBufferId) { + } else if( _msg.getMessage() == ednMsgBufferState + || _msg.getMessage() == ednMsgBufferId) { // the buffer change we need to update the widget string - BufferText* tmpBuffer = BufferManager::Get(BufferManager::GetSelected()); + BufferText* tmpBuffer = BufferManager::get(BufferManager::GetSelected()); if (NULL != tmpBuffer) { - etk::FSNode compleateName = tmpBuffer->GetFileName(); - bool isModify = tmpBuffer->IsModify(); - etk::UString directName = compleateName.GetName(); + etk::FSNode compleateName = tmpBuffer->getFileName(); + bool isModify = tmpBuffer->isModify(); + etk::UString directName = compleateName.getName(); if (true == isModify) { directName += " *"; } if (NULL != m_widgetLabelFileName) { - m_widgetLabelFileName->SetLabel(etk::UString("") + directName + ""); + m_widgetLabelFileName->setLabel(etk::UString("") + directName + ""); } etk::UString windowsTitle = "edn - "; windowsTitle += directName; - SetTitle(windowsTitle); + setTitle(windowsTitle); return; } else { - m_widgetLabelFileName->SetLabel(""); - SetTitle("edn"); + m_widgetLabelFileName->setLabel(""); + setTitle("edn"); } return; - // TODO : Set the Title .... - } else if (_msg.GetMessage() == ednMsgProperties) { + // TODO : set the Title .... + } else if (_msg.getMessage() == ednMsgProperties) { // Request the parameter GUI widget::Parameter* tmpWidget = new widget::Parameter(); if (NULL == tmpWidget) { - APPL_ERROR("Can not allocate widget ==> display might be in error"); + APPL_ERROR("Can not allocate widget == > display might be in error"); } else { - tmpWidget->SetTitle("Properties"); - PopUpWidgetPush(tmpWidget); + tmpWidget->setTitle("Properties"); + popUpWidgetPush(tmpWidget); tmpWidget->MenuAddGroup("Editor"); ewol::Widget* tmpSubWidget = new globals::ParameterGlobalsGui(); tmpWidget->MenuAdd("Editor", "", tmpSubWidget); @@ -389,19 +389,19 @@ void MainWindows::OnReceiveMessage(const ewol::EMessage& _msg) tmpSubWidget = new ParameterAboutGui(); tmpWidget->MenuAdd("About", "", tmpSubWidget); } - } else if (_msg.GetMessage() == ednMsgGuiReloadShader) { - ewol::GetContext().GetResourcesManager().ReLoadResources(); - ewol::GetContext().ForceRedrawAll(); - } else if (_msg.GetMessage() == ednMsgGuiExit) { + } else if (_msg.getMessage() == ednMsgGuiReloadShader) { + ewol::getContext().getResourcesManager().ReLoadResources(); + ewol::getContext().forceRedrawAll(); + } else if (_msg.getMessage() == ednMsgGuiExit) { // TODO ... } return; } -void MainWindows::OnObjectRemove(ewol::EObject * _removeObject) +void MainWindows::onObjectRemove(ewol::EObject * _removeObject) { - ewol::Windows::OnObjectRemove(_removeObject); + ewol::Windows::onObjectRemove(_removeObject); if (m_widgetLabelFileName == _removeObject) { m_widgetLabelFileName = NULL; } diff --git a/sources/appl/Gui/MainWindows.h b/sources/appl/Gui/MainWindows.h index b71b3ec..b7e7f8a 100644 --- a/sources/appl/Gui/MainWindows.h +++ b/sources/appl/Gui/MainWindows.h @@ -27,9 +27,9 @@ class MainWindows : public ewol::Windows MainWindows(void); ~MainWindows(void); public: // Derived function - virtual const char * const GetObjectType(void) { return "MainWindows"; }; - virtual void OnReceiveMessage(const ewol::EMessage& _msg); - virtual void OnObjectRemove(ewol::EObject * _removeObject); + virtual const char * const getObjectType(void) { return "MainWindows"; }; + virtual void onReceiveMessage(const ewol::EMessage& _msg); + virtual void onObjectRemove(ewol::EObject * _removeObject); }; #define EDN_CAST_MAIN_WINDOWS(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_MAIN_WINDOWS,MainWindows,curentPointer) diff --git a/sources/appl/Gui/Search.cpp b/sources/appl/Gui/Search.cpp index 32becd4..58d107c 100644 --- a/sources/appl/Gui/Search.cpp +++ b/sources/appl/Gui/Search.cpp @@ -37,7 +37,7 @@ Search::Search(void) : m_replaceEntry(NULL) { m_forward = false; - // TODO : Change the mode of creating interface : + // TODO : change the mode of creating interface : /* @@ -70,114 +70,114 @@ Search::Search(void) : widget::Button * myButtonImage = NULL; myButtonImage = new widget::Button(); if (NULL == myButtonImage) { - APPL_ERROR("Widget allocation error ==> it will missing in the display"); + APPL_ERROR("Widget allocation error == > it will missing in the display"); } else { widget::Image* tmpImage = new widget::Image("THEME:GUI:Remove.svg"); - tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter)); - myButtonImage->SetSubWidget(tmpImage); - myButtonImage->RegisterOnEvent(this, widget::Button::eventPressed, l_eventHideBt); - SubWidgetAdd(myButtonImage); + tmpImage->setImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter)); + myButtonImage->setSubWidget(tmpImage); + myButtonImage->registerOnEvent(this, widget::Button::eventPressed, l_eventHideBt); + subWidgetAdd(myButtonImage); } m_searchEntry = new widget::Entry(); if (NULL == m_searchEntry) { - APPL_ERROR("Widget allocation error ==> it will missing in the display"); + APPL_ERROR("Widget allocation error == > it will missing in the display"); } else { - m_searchEntry->RegisterOnEvent(this, widget::Entry::eventModify, l_eventSearchEntry); - m_searchEntry->RegisterOnEvent(this, widget::Entry::eventEnter, l_eventSearchEntryEnter); - m_searchEntry->SetExpand(bvec2(true,false)); - m_searchEntry->SetFill(bvec2(true,false)); - SubWidgetAdd(m_searchEntry); + m_searchEntry->registerOnEvent(this, widget::Entry::eventModify, l_eventSearchEntry); + m_searchEntry->registerOnEvent(this, widget::Entry::eventEnter, l_eventSearchEntryEnter); + m_searchEntry->setExpand(bvec2(true,false)); + m_searchEntry->setFill(bvec2(true,false)); + subWidgetAdd(m_searchEntry); } myButtonImage = new widget::Button(); if (NULL == myButtonImage) { - APPL_ERROR("Widget allocation error ==> it will missing in the display"); + APPL_ERROR("Widget allocation error == > it will missing in the display"); } else { widget::Image* tmpImage = new widget::Image("THEME:GUI:Search.svg"); - tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter)); - myButtonImage->SetSubWidget(tmpImage); - myButtonImage->RegisterOnEvent(this, widget::Button::eventPressed, l_eventSearchBt); - SubWidgetAdd(myButtonImage); + tmpImage->setImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter)); + myButtonImage->setSubWidget(tmpImage); + myButtonImage->registerOnEvent(this, widget::Button::eventPressed, l_eventSearchBt); + subWidgetAdd(myButtonImage); } m_replaceEntry = new widget::Entry(); if (NULL == m_replaceEntry) { - APPL_ERROR("Widget allocation error ==> it will missing in the display"); + APPL_ERROR("Widget allocation error == > it will missing in the display"); } else { - m_replaceEntry->RegisterOnEvent(this, widget::Entry::eventModify, l_eventReplaceEntry); - m_replaceEntry->RegisterOnEvent(this, widget::Entry::eventEnter, l_eventReplaceEntryEnter); - m_replaceEntry->SetExpand(bvec2(true,false)); - m_replaceEntry->SetFill(bvec2(true,false)); - SubWidgetAdd(m_replaceEntry); + m_replaceEntry->registerOnEvent(this, widget::Entry::eventModify, l_eventReplaceEntry); + m_replaceEntry->registerOnEvent(this, widget::Entry::eventEnter, l_eventReplaceEntryEnter); + m_replaceEntry->setExpand(bvec2(true,false)); + m_replaceEntry->setFill(bvec2(true,false)); + subWidgetAdd(m_replaceEntry); } myButtonImage = new widget::Button(); if (NULL == myButtonImage) { - APPL_ERROR("Widget allocation error ==> it will missing in the display"); + APPL_ERROR("Widget allocation error == > it will missing in the display"); } else { widget::Image* tmpImage = new widget::Image("THEME:GUI:Replace.svg"); - tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter)); - myButtonImage->SetSubWidget(tmpImage); - myButtonImage->RegisterOnEvent(this, widget::Button::eventPressed, l_eventReplaceBt); - SubWidgetAdd(myButtonImage); + tmpImage->setImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter)); + myButtonImage->setSubWidget(tmpImage); + myButtonImage->registerOnEvent(this, widget::Button::eventPressed, l_eventReplaceBt); + subWidgetAdd(myButtonImage); } myButtonImage = new widget::Button(); if (NULL == myButtonImage) { - APPL_ERROR("Widget allocation error ==> it will missing in the display"); + APPL_ERROR("Widget allocation error == > it will missing in the display"); } else { - myButtonImage->SetToggleMode(true); + myButtonImage->setToggleMode(true); widget::Image* tmpImage = new widget::Image("THEME:GUI:CaseSensitive.svg"); - tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter)); - myButtonImage->SetSubWidget(tmpImage); + tmpImage->setImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter)); + myButtonImage->setSubWidget(tmpImage); - tmpImage = new widget::Image("THEME:GUI:CaseSensitive.svg"); // TODO : Set color on Image .... 0xFFFFFF5F - tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter)); - myButtonImage->SetSubWidgetToggle(tmpImage); + tmpImage = new widget::Image("THEME:GUI:CaseSensitive.svg"); // TODO : set color on Image .... 0xFFFFFF5F + tmpImage->setImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter)); + myButtonImage->setSubWidgetToggle(tmpImage); - myButtonImage->SetValue(!SearchData::GetCase()); - myButtonImage->RegisterOnEvent(this, widget::Button::eventPressed, l_eventCaseCb); - SubWidgetAdd(myButtonImage); + myButtonImage->setValue(!SearchData::getCase()); + myButtonImage->registerOnEvent(this, widget::Button::eventPressed, l_eventCaseCb); + subWidgetAdd(myButtonImage); } myButtonImage = new widget::Button(); if (NULL == myButtonImage) { - APPL_ERROR("Widget allocation error ==> it will missing in the display"); + APPL_ERROR("Widget allocation error == > it will missing in the display"); } else { - myButtonImage->SetToggleMode(true); + myButtonImage->setToggleMode(true); widget::Image* tmpImage = new widget::Image("THEME:GUI:WrapAround.svg"); - tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter)); - myButtonImage->SetSubWidget(tmpImage); + tmpImage->setImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter)); + myButtonImage->setSubWidget(tmpImage); - tmpImage = new widget::Image("THEME:GUI:WrapAround.svg"); // TODO : Set color on Image .... 0xFFFFFF5F - tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter)); - myButtonImage->SetSubWidgetToggle(tmpImage); + tmpImage = new widget::Image("THEME:GUI:WrapAround.svg"); // TODO : set color on Image .... 0xFFFFFF5F + tmpImage->setImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter)); + myButtonImage->setSubWidgetToggle(tmpImage); - myButtonImage->SetValue(!SearchData::GetWrap()); - myButtonImage->RegisterOnEvent(this, widget::Button::eventPressed, l_eventWrapCb); - SubWidgetAdd(myButtonImage); + myButtonImage->setValue(!SearchData::getWrap()); + myButtonImage->registerOnEvent(this, widget::Button::eventPressed, l_eventWrapCb); + subWidgetAdd(myButtonImage); } myButtonImage = new widget::Button(); if (NULL == myButtonImage) { - APPL_ERROR("Widget allocation error ==> it will missing in the display"); + APPL_ERROR("Widget allocation error == > it will missing in the display"); } else { - myButtonImage->SetToggleMode(true); + myButtonImage->setToggleMode(true); widget::Image* tmpImage = new widget::Image("THEME:GUI:Up.svg"); - tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter)); - myButtonImage->SetSubWidget(tmpImage); + tmpImage->setImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter)); + myButtonImage->setSubWidget(tmpImage); tmpImage = new widget::Image("THEME:GUI:Down.svg"); - tmpImage->SetImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter)); - myButtonImage->SetSubWidgetToggle(tmpImage); + tmpImage->setImageSize(ewol::Dimension(vec2(8,8), ewol::Dimension::Millimeter)); + myButtonImage->setSubWidgetToggle(tmpImage); - myButtonImage->SetValue(!m_forward); - myButtonImage->RegisterOnEvent(this, widget::Button::eventPressed, l_eventForwardCb); - SubWidgetAdd(myButtonImage); + myButtonImage->setValue(!m_forward); + myButtonImage->registerOnEvent(this, widget::Button::eventPressed, l_eventForwardCb); + subWidgetAdd(myButtonImage); } RegisterMultiCast(ednMsgGuiSearch); @@ -191,74 +191,74 @@ Search::~Search(void) } -void Search::OnReceiveMessage(const ewol::EMessage& _msg) +void Search::onReceiveMessage(const ewol::EMessage& _msg) { - widget::Sizer::OnReceiveMessage(_msg); + widget::Sizer::onReceiveMessage(_msg); //APPL_INFO("Search receive message : \"" << eventId << "\" data=\"" << data << "\""); - if ( _msg.GetMessage() == l_eventSearchEntry) { - SearchData::SetSearch(_msg.GetData()); - } else if ( _msg.GetMessage() == l_eventSearchEntryEnter) { - SearchData::SetSearch(_msg.GetData()); - if (true==m_forward) { + if ( _msg.getMessage() == l_eventSearchEntry) { + SearchData::setSearch(_msg.getData()); + } else if ( _msg.getMessage() == l_eventSearchEntryEnter) { + SearchData::setSearch(_msg.getData()); + if (true == m_forward) { SendMultiCast(ednMsgGuiFind, "Previous"); } else { SendMultiCast(ednMsgGuiFind, "Next"); } - } else if ( _msg.GetMessage() == l_eventReplaceEntry) { - SearchData::SetReplace(_msg.GetData()); - } else if ( _msg.GetMessage() == l_eventReplaceEntryEnter) { - SearchData::SetReplace(_msg.GetData()); + } else if ( _msg.getMessage() == l_eventReplaceEntry) { + SearchData::setReplace(_msg.getData()); + } else if ( _msg.getMessage() == l_eventReplaceEntryEnter) { + SearchData::setReplace(_msg.getData()); SendMultiCast(ednMsgGuiReplace, "Normal"); - if (true==m_forward) { + if (true == m_forward) { SendMultiCast(ednMsgGuiFind, "Previous"); } else { SendMultiCast(ednMsgGuiFind, "Next"); } - } else if ( _msg.GetMessage() == l_eventSearchBt) { - if (true==m_forward) { + } else if ( _msg.getMessage() == l_eventSearchBt) { + if (true == m_forward) { SendMultiCast(ednMsgGuiFind, "Previous"); } else { SendMultiCast(ednMsgGuiFind, "Next"); } - } else if ( _msg.GetMessage() == l_eventReplaceBt) { + } else if ( _msg.getMessage() == l_eventReplaceBt) { SendMultiCast(ednMsgGuiReplace, "Normal"); - if (true==m_forward) { + if (true == m_forward) { SendMultiCast(ednMsgGuiFind, "Previous"); } else { SendMultiCast(ednMsgGuiFind, "Next"); } - } else if ( _msg.GetMessage() == l_eventCaseCb) { - if (_msg.GetData() == "1") { - SearchData::SetCase(false); + } else if ( _msg.getMessage() == l_eventCaseCb) { + if (_msg.getData() == "1") { + SearchData::setCase(false); } else { - SearchData::SetCase(true); + SearchData::setCase(true); } - } else if ( _msg.GetMessage() == l_eventWrapCb) { - if (_msg.GetData() == "1") { - SearchData::SetWrap(false); + } else if ( _msg.getMessage() == l_eventWrapCb) { + if (_msg.getData() == "1") { + SearchData::setWrap(false); } else { - SearchData::SetWrap(true); + SearchData::setWrap(true); } - } else if ( _msg.GetMessage() == l_eventForwardCb) { - if (_msg.GetData() == "1") { + } else if ( _msg.getMessage() == l_eventForwardCb) { + if (_msg.getData() == "1") { m_forward = false; } else { m_forward = true; } - } else if ( _msg.GetMessage() == l_eventHideBt) { + } else if ( _msg.getMessage() == l_eventHideBt) { Hide(); - } else if ( _msg.GetMessage() == ednMsgGuiSearch) { - if (true == IsHide()) { + } else if ( _msg.getMessage() == ednMsgGuiSearch) { + if (true == isHide()) { Show(); if (m_searchEntry!= NULL) { - m_searchEntry->KeepFocus(); + m_searchEntry->keepFocus(); } } else { - if( (m_searchEntry!=NULL && true==m_searchEntry->GetFocus()) - || (m_replaceEntry!=NULL && true==m_replaceEntry->GetFocus()) ) { + if( (m_searchEntry!=NULL && true == m_searchEntry->getFocus()) + || (m_replaceEntry!=NULL && true == m_replaceEntry->getFocus()) ) { Hide(); } else if (m_searchEntry!= NULL) { - m_searchEntry->KeepFocus(); + m_searchEntry->keepFocus(); } else { Hide(); } @@ -266,9 +266,9 @@ void Search::OnReceiveMessage(const ewol::EMessage& _msg) } } -void Search::OnObjectRemove(ewol::EObject * _removeObject) +void Search::onObjectRemove(ewol::EObject * _removeObject) { - widget::Sizer::OnObjectRemove(_removeObject); + widget::Sizer::onObjectRemove(_removeObject); if (_removeObject == m_searchEntry) { m_searchEntry = NULL; } diff --git a/sources/appl/Gui/Search.h b/sources/appl/Gui/Search.h index c912425..e2c264f 100644 --- a/sources/appl/Gui/Search.h +++ b/sources/appl/Gui/Search.h @@ -24,9 +24,9 @@ class Search : public widget::Sizer Search(void); ~Search(void); public: // derived function - virtual const char * const GetObjectType(void) { return "ApplSearch"; }; - virtual void OnReceiveMessage(const ewol::EMessage& _msg); - virtual void OnObjectRemove(ewol::EObject * _removeObject); + virtual const char * const getObjectType(void) { return "ApplSearch"; }; + virtual void onReceiveMessage(const ewol::EMessage& _msg); + virtual void onObjectRemove(ewol::EObject * _removeObject); }; #endif diff --git a/sources/appl/Gui/SearchData.cpp b/sources/appl/Gui/SearchData.cpp index b64b145..228d454 100644 --- a/sources/appl/Gui/SearchData.cpp +++ b/sources/appl/Gui/SearchData.cpp @@ -16,34 +16,34 @@ static etk::UString m_findRequest = ""; -void SearchData::SetSearch(const etk::UString &myData) +void SearchData::setSearch(const etk::UString &myData) { m_findRequest = myData; } -void SearchData::GetSearch(etk::UString &myData) +void SearchData::getSearch(etk::UString &myData) { myData = m_findRequest; } -bool SearchData::IsSearchEmpty(void) +bool SearchData::isSearchEmpty(void) { - if(m_findRequest.Size() > 0) { + if(m_findRequest.size() > 0) { return false; } return true; } static etk::UString m_replaceRequest = ""; -void SearchData::SetReplace(const etk::UString &myData) +void SearchData::setReplace(const etk::UString &myData) { m_replaceRequest = myData; } -void SearchData::GetReplace(etk::UString &myData) +void SearchData::getReplace(etk::UString &myData) { myData = m_replaceRequest; } -bool SearchData::IsReplaceEmpty(void) +bool SearchData::isReplaceEmpty(void) { - if(m_replaceRequest.Size() > 0) { + if(m_replaceRequest.size() > 0) { return false; } return true; @@ -51,33 +51,33 @@ bool SearchData::IsReplaceEmpty(void) static bool m_case = false; -void SearchData::SetCase(bool value) +void SearchData::setCase(bool value) { m_case = value; } -bool SearchData::GetCase(void) +bool SearchData::getCase(void) { return m_case; } static bool m_wrap = true; -void SearchData::SetWrap(bool value) +void SearchData::setWrap(bool value) { m_wrap = value; } -bool SearchData::GetWrap(void) +bool SearchData::getWrap(void) { return m_wrap; } static bool m_RegExp = false; -void SearchData::SetRegExp(bool value) +void SearchData::setRegExp(bool value) { m_RegExp = value; } -bool SearchData::GetRegExp(void) +bool SearchData::getRegExp(void) { return m_RegExp; } diff --git a/sources/appl/Gui/SearchData.h b/sources/appl/Gui/SearchData.h index 996f847..f91db95 100644 --- a/sources/appl/Gui/SearchData.h +++ b/sources/appl/Gui/SearchData.h @@ -14,18 +14,18 @@ namespace SearchData { - void SetSearch(const etk::UString &myData); - void GetSearch(etk::UString &myData); - bool IsSearchEmpty(void); - void SetReplace(const etk::UString &myData); - void GetReplace(etk::UString &myData); - bool IsReplaceEmpty(void); - void SetCase(bool value); - bool GetCase(void); - void SetWrap(bool value); - bool GetWrap(void); - void SetRegExp(bool value); - bool GetRegExp(void); + void setSearch(const etk::UString &myData); + void getSearch(etk::UString &myData); + bool isSearchEmpty(void); + void setReplace(const etk::UString &myData); + void getReplace(etk::UString &myData); + bool isReplaceEmpty(void); + void setCase(bool value); + bool getCase(void); + void setWrap(bool value); + bool getWrap(void); + void setRegExp(bool value); + bool getRegExp(void); } diff --git a/sources/appl/Gui/TagFileList.cpp b/sources/appl/Gui/TagFileList.cpp index 6216b3d..d6c1422 100644 --- a/sources/appl/Gui/TagFileList.cpp +++ b/sources/appl/Gui/TagFileList.cpp @@ -20,15 +20,15 @@ extern const char * const applEventCtagsListValidate = "appl-event-ctags-list- appl::TagFileList::TagFileList(void) { m_selectedLine = -1; - AddEventId(applEventCtagsListSelect); - AddEventId(applEventCtagsListValidate); - SetMouseLimit(1); + addEventId(applEventCtagsListSelect); + addEventId(applEventCtagsListValidate); + setMouseLimit(1); } appl::TagFileList::~TagFileList(void) { - for (int32_t iii=0; iii appl::TagFileList::GetBasicBG(void) { +etk::Color<> appl::TagFileList::getBasicBG(void) { return 0x00000010; } -uint32_t appl::TagFileList::GetNuberOfColomn(void) { +uint32_t appl::TagFileList::getNuberOfColomn(void) { return 2; } -bool appl::TagFileList::GetTitle(int32_t colomn, etk::UString &myTitle, etk::Color<> &fg, etk::Color<> &bg) { +bool appl::TagFileList::getTitle(int32_t colomn, etk::UString &myTitle, etk::Color<> &fg, etk::Color<> &bg) { myTitle = "title"; return true; } -uint32_t appl::TagFileList::GetNuberOfRaw(void) { - return m_list.Size(); +uint32_t appl::TagFileList::getNuberOfRaw(void) { + return m_list.size(); } -bool appl::TagFileList::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color<> &fg, etk::Color<> &bg) { - if (raw >= 0 && raw < m_list.Size() && NULL != m_list[raw]) { - if (0==colomn) { +bool appl::TagFileList::getElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color<> &fg, etk::Color<> &bg) { + if (raw >= 0 && raw < m_list.size() && NULL != m_list[raw]) { + if (0 == colomn) { myTextToWrite = etk::UString(m_list[raw]->fileLine); } else { myTextToWrite = m_list[raw]->filename; @@ -65,20 +65,20 @@ bool appl::TagFileList::GetElement(int32_t colomn, int32_t raw, etk::UString &my } fg = etk::color::black; if (raw % 2) { - if (colomn%2==0) { + if (colomn%2 == 0) { bg = 0xFFFFFF00; } else { bg = 0xFFFFFF10; } } else { - if (colomn%2==0) { + if (colomn%2 == 0) { bg = 0xBFBFBFFF; } else { bg = 0xCFCFCFFF; } } if (m_selectedLine == raw) { - if (colomn%2==0) { + if (colomn%2 == 0) { bg = 0x8F8FFFFF; } else { bg = 0x7F7FFFFF; @@ -88,13 +88,13 @@ bool appl::TagFileList::GetElement(int32_t colomn, int32_t raw, etk::UString &my }; -bool appl::TagFileList::OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEvent, int32_t colomn, int32_t raw, float x, float y) +bool appl::TagFileList::onItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEvent, int32_t colomn, int32_t raw, float x, float y) { if (typeEvent == ewol::keyEvent::statusSingle) { EWOL_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw ); if (1 == IdInput) { int32_t previousRaw = m_selectedLine; - if (raw > m_list.Size() ) { + if (raw > m_list.size() ) { m_selectedLine = -1; } else { m_selectedLine = raw; @@ -103,15 +103,15 @@ bool appl::TagFileList::OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te t if (previousRaw != m_selectedLine) { event = applEventCtagsListSelect; } - if( m_selectedLine >=0 - && m_selectedLine < m_list.Size() + if( m_selectedLine >= 0 + && m_selectedLine < m_list.size() && NULL != m_list[m_selectedLine] ) { - GenerateEventId(event, etk::UString(m_list[raw]->fileLine)+":"+m_list[m_selectedLine]->filename); + generateEventId(event, etk::UString(m_list[raw]->fileLine)+":"+m_list[m_selectedLine]->filename); } else { - GenerateEventId(applEventCtagsListUnSelect); + generateEventId(applEventCtagsListUnSelect); } // need to regenerate the display of the list : - MarkToRedraw(); + markToRedraw(); return true; } } @@ -120,18 +120,18 @@ bool appl::TagFileList::OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te t /** - * @brief Add a Ctags item on the curent list + * @brief add a Ctags item on the curent list * @param[in] file Compleate file name * @param[in] jump line id * @return --- */ -void appl::TagFileList::Add(etk::UString& file, int32_t line) +void appl::TagFileList::add(etk::UString& file, int32_t line) { appl::TagListElement *tmpFile = new appl::TagListElement(file, line); if (NULL != tmpFile) { - m_list.PushBack(tmpFile); + m_list.pushBack(tmpFile); } - MarkToRedraw(); + markToRedraw(); } diff --git a/sources/appl/Gui/TagFileList.h b/sources/appl/Gui/TagFileList.h index 2e3c16b..b093bdb 100644 --- a/sources/appl/Gui/TagFileList.h +++ b/sources/appl/Gui/TagFileList.h @@ -34,21 +34,21 @@ namespace appl { TagFileList(void); ~TagFileList(void); // display API : - virtual etk::Color<> GetBasicBG(void); - uint32_t GetNuberOfColomn(void); - bool GetTitle(int32_t colomn, etk::UString &myTitle, etk::Color<> &fg, etk::Color<> &bg); - uint32_t GetNuberOfRaw(void); - bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color<> &fg, etk::Color<> &bg); - bool OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEvent, int32_t colomn, int32_t raw, float x, float y); + virtual etk::Color<> getBasicBG(void); + uint32_t getNuberOfColomn(void); + bool getTitle(int32_t colomn, etk::UString &myTitle, etk::Color<> &fg, etk::Color<> &bg); + uint32_t getNuberOfRaw(void); + bool getElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color<> &fg, etk::Color<> &bg); + bool onItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEvent, int32_t colomn, int32_t raw, float x, float y); // derived function - const char * const GetObjectType(void) { return "TagFileList"; }; + const char * const getObjectType(void) { return "TagFileList"; }; public: /** - * @brief Add a Ctags item on the curent list + * @brief add a Ctags item on the curent list * @param[in] file Compleate file name * @param[in] jump line id */ - void Add(etk::UString& file, int32_t line); + void add(etk::UString& file, int32_t line); }; }; diff --git a/sources/appl/Gui/TagFileSelection.cpp b/sources/appl/Gui/TagFileSelection.cpp index 174ae78..db0ddde 100644 --- a/sources/appl/Gui/TagFileSelection.cpp +++ b/sources/appl/Gui/TagFileSelection.cpp @@ -32,8 +32,8 @@ extern const char * const applEventctagsCancel = "appl-event-ctags- appl::TagFileSelection::TagFileSelection(void) { - AddEventId(applEventctagsSelection); - AddEventId(applEventctagsCancel); + addEventId(applEventctagsSelection); + addEventId(applEventctagsCancel); widget::Label* myWidgetTitle = NULL; widget::Button* myWidgetValidate = NULL; @@ -43,38 +43,38 @@ appl::TagFileSelection::TagFileSelection(void) widget::Sizer * mySizerHori = NULL; widget::Spacer * mySpacer = NULL; #if defined(__TARGET_OS__Android) - SetMinSize(ewol::Dimension(vec2(90,90),ewol::Dimension::Pourcent)); + setMinSize(ewol::Dimension(vec2(90,90),ewol::Dimension::Pourcent)); #elif defined(__TARGET_OS__Windows) - SetMinSize(ewol::Dimension(vec2(80,80),ewol::Dimension::Pourcent)); + setMinSize(ewol::Dimension(vec2(80,80),ewol::Dimension::Pourcent)); #else - SetMinSize(ewol::Dimension(vec2(80,80),ewol::Dimension::Pourcent)); + setMinSize(ewol::Dimension(vec2(80,80),ewol::Dimension::Pourcent)); #endif mySizerVert = new widget::Sizer(widget::Sizer::modeVert); if (NULL == mySizerVert) { - EWOL_ERROR("Can not allocate widget ==> display might be in error"); + EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { mySizerVert->LockExpand(bvec2(true,true)); // set it in the pop-up-system : - SetSubWidget(mySizerVert); + setSubWidget(mySizerVert); mySizerHori = new widget::Sizer(widget::Sizer::modeHori); if (NULL == mySizerHori) { - EWOL_ERROR("Can not allocate widget ==> display might be in error"); + EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { - mySizerVert->SubWidgetAdd(mySizerHori); + mySizerVert->subWidgetAdd(mySizerHori); mySpacer = new widget::Spacer(); if (NULL == mySpacer) { - EWOL_ERROR("Can not allocate widget ==> display might be in error"); + EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { - mySpacer->SetExpand(bvec2(true,false)); - mySizerHori->SubWidgetAdd(mySpacer); + mySpacer->setExpand(bvec2(true,false)); + mySizerHori->subWidgetAdd(mySpacer); } myWidgetValidate = new widget::Button(); if (NULL == myWidgetValidate) { - EWOL_ERROR("Can not allocate widget ==> display might be in error"); + EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { - myWidgetValidate->SetSubWidget( + myWidgetValidate->setSubWidget( new widget::Composer(widget::Composer::String, "\n" " \n" @@ -83,14 +83,14 @@ appl::TagFileSelection::TagFileSelection(void) " \n" "RegisterOnEvent(this, widget::Button::eventPressed, applEventctagsSelection); - mySizerHori->SubWidgetAdd(myWidgetValidate); + myWidgetValidate->registerOnEvent(this, widget::Button::eventPressed, applEventctagsSelection); + mySizerHori->subWidgetAdd(myWidgetValidate); } myWidgetCancel = new widget::Button(); if (NULL == myWidgetCancel) { - EWOL_ERROR("Can not allocate widget ==> display might be in error"); + EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { - myWidgetCancel->SetSubWidget( + myWidgetCancel->setSubWidget( new widget::Composer(widget::Composer::String, "\n" " \n" @@ -98,27 +98,27 @@ appl::TagFileSelection::TagFileSelection(void) " \n" " \n" "RegisterOnEvent(this, widget::Button::eventPressed, applEventctagsCancel); - mySizerHori->SubWidgetAdd(myWidgetCancel); + myWidgetCancel->registerOnEvent(this, widget::Button::eventPressed, applEventctagsCancel); + mySizerHori->subWidgetAdd(myWidgetCancel); } } m_listTag = new appl::TagFileList(); if (NULL == m_listTag) { - EWOL_ERROR("Can not allocate widget ==> display might be in error"); + EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { - m_listTag->RegisterOnEvent(this, applEventCtagsListValidate); - m_listTag->RegisterOnEvent(this, applEventCtagsListSelect); - m_listTag->RegisterOnEvent(this, applEventCtagsListUnSelect); - m_listTag->SetExpand(bvec2(true,true)); - m_listTag->SetFill(bvec2(true,true)); - mySizerVert->SubWidgetAdd(m_listTag); + m_listTag->registerOnEvent(this, applEventCtagsListValidate); + m_listTag->registerOnEvent(this, applEventCtagsListSelect); + m_listTag->registerOnEvent(this, applEventCtagsListUnSelect); + m_listTag->setExpand(bvec2(true,true)); + m_listTag->setFill(bvec2(true,true)); + mySizerVert->subWidgetAdd(m_listTag); } myWidgetTitle = new widget::Label("Ctags Jump Selection ..."); if (NULL == myWidgetTitle) { - EWOL_ERROR("Can not allocate widget ==> display might be in error"); + EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { - mySizerVert->SubWidgetAdd(myWidgetTitle); + mySizerVert->subWidgetAdd(myWidgetTitle); } } } @@ -129,27 +129,27 @@ appl::TagFileSelection::~TagFileSelection(void) } -void appl::TagFileSelection::OnReceiveMessage(const ewol::EMessage& _msg) +void appl::TagFileSelection::onReceiveMessage(const ewol::EMessage& _msg) { - EWOL_INFO("ctags LIST ... : \"" << _msg.GetMessage() << "\" ==> data=\"" << _msg.GetData() << "\"" ); - if (_msg.GetMessage() == applEventctagsSelection) { + EWOL_INFO("ctags LIST ... : \"" << _msg.getMessage() << "\" == > data=\"" << _msg.GetData() << "\"" ); + if (_msg.getMessage() == applEventctagsSelection) { if (m_eventNamed!="") { - GenerateEventId(applEventctagsSelection, m_eventNamed); - //==> Auto remove ... + generateEventId(applEventctagsSelection, m_eventNamed); + // == > Auto remove ... AutoDestroy(); } - } else if (_msg.GetMessage() == applEventCtagsListSelect) { - m_eventNamed = _msg.GetData(); + } else if (_msg.getMessage() == applEventCtagsListSelect) { + m_eventNamed = _msg.getData(); - } else if (_msg.GetMessage() == applEventCtagsListUnSelect) { + } else if (_msg.getMessage() == applEventCtagsListUnSelect) { m_eventNamed = ""; - } else if (_msg.GetMessage() == applEventCtagsListValidate) { - GenerateEventId(applEventctagsSelection, _msg.GetData()); - //==> Auto remove ... + } else if (_msg.getMessage() == applEventCtagsListValidate) { + generateEventId(applEventctagsSelection, _msg.getData()); + // == > Auto remove ... AutoDestroy(); - } else if (_msg.GetMessage() == applEventctagsCancel) { - GenerateEventId(applEventctagsCancel, ""); - //==> Auto remove ... + } else if (_msg.getMessage() == applEventctagsCancel) { + generateEventId(applEventctagsCancel, ""); + // == > Auto remove ... AutoDestroy(); } return; @@ -157,21 +157,21 @@ void appl::TagFileSelection::OnReceiveMessage(const ewol::EMessage& _msg) /** - * @brief Add a Ctags item on the curent list + * @brief add a Ctags item on the curent list * @param[in] file Compleate file name * @param[in] jump line id */ -void appl::TagFileSelection::AddCtagsNewItem(etk::UString file, int32_t line) +void appl::TagFileSelection::addCtagsNewItem(etk::UString file, int32_t line) { if (NULL != m_listTag) { - m_listTag->Add(file, line); + m_listTag->add(file, line); } } -void appl::TagFileSelection::OnObjectRemove(ewol::EObject * _removeObject) +void appl::TagFileSelection::onObjectRemove(ewol::EObject * _removeObject) { // First step call parrent : - widget::PopUp::OnObjectRemove(_removeObject); + widget::PopUp::onObjectRemove(_removeObject); // second step find if in all the elements ... if(_removeObject == m_listTag) { m_listTag = NULL; diff --git a/sources/appl/Gui/TagFileSelection.h b/sources/appl/Gui/TagFileSelection.h index 75a761c..515d338 100644 --- a/sources/appl/Gui/TagFileSelection.h +++ b/sources/appl/Gui/TagFileSelection.h @@ -26,15 +26,15 @@ namespace appl { TagFileSelection(void); virtual ~TagFileSelection(void); /** - * @brief Add a Ctags item on the curent list + * @brief add a Ctags item on the curent list * @param[in] file Compleate file name * @param[in] jump line id */ - void AddCtagsNewItem(etk::UString file, int32_t line); + void addCtagsNewItem(etk::UString file, int32_t line); public: // herited function - const char * const GetObjectType(void) { return "EwolFileChooser"; }; - void OnReceiveMessage(const ewol::EMessage& _msg); - void OnObjectRemove(ewol::EObject * _removeObject); + const char * const getObjectType(void) { return "EwolFileChooser"; }; + void onReceiveMessage(const ewol::EMessage& _msg); + void onObjectRemove(ewol::EObject * _removeObject); }; }; diff --git a/sources/appl/Gui/TextViewer.cpp b/sources/appl/Gui/TextViewer.cpp index 86b12f3..0bd8d38 100644 --- a/sources/appl/Gui/TextViewer.cpp +++ b/sources/appl/Gui/TextViewer.cpp @@ -27,7 +27,7 @@ appl::TextViewer::TextViewer(const etk::UString& _fontName, int32_t _fontSize) : m_displayText(_fontName, _fontSize), m_insertMode(false) { - SetCanHaveFocus(true); + setCanHaveFocus(true); RegisterMultiCast(ednMsgBufferId); RegisterMultiCast(ednMsgGuiCopy); RegisterMultiCast(ednMsgGuiPaste); @@ -40,7 +40,7 @@ appl::TextViewer::TextViewer(const etk::UString& _fontName, int32_t _fontSize) : RegisterMultiCast(ednMsgGuiFind); RegisterMultiCast(ednMsgGuiReplace); RegisterMultiCast(ednMsgGuiGotoLine); - SetLimitScrolling(0.2); + setLimitScrolling(0.2); ShortCutAdd("ctrl+w", ednMsgGuiRm, "Line"); ShortCutAdd("ctrl+shift+w", ednMsgGuiRm, "Paragraph"); @@ -57,7 +57,7 @@ appl::TextViewer::TextViewer(const etk::UString& _fontName, int32_t _fontSize) : APPL_ERROR("can not create buffer ... "); return; } - m_buffer->LoadFile("./example.txt"); + m_buffer->loadFile("./example.txt"); } @@ -67,44 +67,44 @@ appl::TextViewer::~TextViewer(void) } -bool appl::TextViewer::CalculateMinSize(void) +bool appl::TextViewer::calculateMinSize(void) { m_minSize.setValue(50,50); return true; } -void appl::TextViewer::CalculateMaxSize(void) +void appl::TextViewer::calculateMaxSize(void) { m_maxSize.setX(256); m_maxSize.setY(256); } -void appl::TextViewer::OnDraw(void) +void appl::TextViewer::onDraw(void) { - m_displayDrawing.Draw(); - m_displayText.Draw(); - WidgetScrooled::OnDraw(); + m_displayDrawing.draw(); + m_displayText.draw(); + WidgetScrooled::onDraw(); } -void appl::TextViewer::OnRegenerateDisplay(void) +void appl::TextViewer::onRegenerateDisplay(void) { - if (false == NeedRedraw()) { + if (false == needRedraw()) { return; } // For the scrooling windows - CalculateMaxSize(); - m_displayDrawing.Clear(); - m_displayText.Clear(); + calculateMaxSize(); + m_displayDrawing.clear(); + m_displayText.clear(); - // Reset the background : - m_displayDrawing.SetPos(vec3(0, 0, 0)); - m_displayDrawing.SetColor(etk::Color<>(220, 220, 220, 256)); - m_displayDrawing.RectangleWidth(m_size); + // reset the background : + m_displayDrawing.setPos(vec3(0, 0, 0)); + m_displayDrawing.setColor(etk::Color<>(220, 220, 220, 256)); + m_displayDrawing.rectangleWidth(m_size); if (m_buffer == NULL) { - m_displayText.SetTextAlignement(10, m_size.x()-20, ewol::Text::alignLeft); - m_displayText.SetRelPos(vec3(10, 0, 0)); + m_displayText.setTextAlignement(10, m_size.x()-20, ewol::Text::alignLeft); + m_displayText.setRelPos(vec3(10, 0, 0)); etk::UString tmpString("
\n" "\n" " \n" @@ -118,131 +118,131 @@ void appl::TextViewer::OnRegenerateDisplay(void) " No Buffer Availlable to display\n" " \n" "\n"); - m_displayText.SetPos(vec3(0.0f, m_size.y(), 0.0f) ); - m_displayText.ForceLineReturn(); - m_displayText.PrintDecorated(tmpString); + m_displayText.setPos(vec3(0.0f, m_size.y(), 0.0f) ); + m_displayText.forceLineReturn(); + m_displayText.printDecorated(tmpString); // call the herited class... - WidgetScrooled::OnRegenerateDisplay(); + WidgetScrooled::onRegenerateDisplay(); return; } // normal displa of the buffer : vec3 tmpCursorPosition(0, 0, -1); // real display ... - etk::Buffer& buf = m_buffer->GetData(); - m_displayText.SetColor(etk::Color<>(0, 0, 0, 256)); + etk::Buffer& buf = m_buffer->getData(); + 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((uniChar_t)'A'); vec3 positionCurentDisplay(0.0f, m_size.y()-tmpLetterSize.y(), 0.0f); - m_displayText.SetPos(positionCurentDisplay); + m_displayText.setPos(positionCurentDisplay); // the siplay string : etk::UString stringToDisplay; esize_t bufferElementSize = 0; etk::UniChar currentValue; - for (int32_t iii=0; iiim_cursorPos) { + for (int32_t iii=0; iiim_cursorPos) { // need to display the cursor : tmpCursorPosition = positionCurentDisplay; } - bufferElementSize = m_buffer->Get(iii, currentValue); + bufferElementSize = m_buffer->get(iii, currentValue); //APPL_DEBUG(" element size : " << iii << " : " << bufferElementSize); if (currentValue == etk::UniChar::Return) { countNbLine += 1; countColomn = 0; - if (bufferElementSize ==0) { + if (bufferElementSize == 0) { bufferElementSize = 1; } positionCurentDisplay.setX(0); positionCurentDisplay.setY(positionCurentDisplay.y()-tmpLetterSize.y()); - m_displayText.SetPos(positionCurentDisplay); + m_displayText.setPos(positionCurentDisplay); continue; } m_buffer->Expand(countColomn, currentValue, stringToDisplay); - //APPL_DEBUG("display : '" << currentValue << "' ==> '" << stringToDisplay << "'"); - //m_displayText.SetPos(positionCurentDisplay); - for (esize_t kkk=0; kkk '" << stringToDisplay << "'"); + //m_displayText.setPos(positionCurentDisplay); + for (esize_t kkk=0; kkk(0xFF0000FF)); - m_displayText.SetColorBg(etk::Color<>(0xFF0000FF)); - m_displayText.PrintCursor(m_insertMode); + m_displayText.setPos(tmpCursorPosition); + m_displayText.setColor(etk::Color<>(0xFF0000FF)); + m_displayText.setColorBg(etk::Color<>(0xFF0000FF)); + m_displayText.printCursor(m_insertMode); } // call the herited class... - WidgetScrooled::OnRegenerateDisplay(); + WidgetScrooled::onRegenerateDisplay(); } -bool appl::TextViewer::OnEventEntry(const ewol::EventEntry& _event) +bool appl::TextViewer::onEventEntry(const ewol::EventEntry& _event) { if (m_buffer == NULL) { return false; } - // just forward event ==> manage directly in the buffer - if (m_buffer->OnEventEntry(_event) == true) { - MarkToRedraw(); + // just forward event == > manage directly in the buffer + if (m_buffer->onEventEntry(_event) == true) { + markToRedraw(); return true; } return false; } -bool appl::TextViewer::OnEventInput(const ewol::EventInput& _event) +bool appl::TextViewer::onEventInput(const ewol::EventInput& _event) { - vec2 relativePos = RelativePosition(_event.GetPos()); + vec2 relativePos = relativePosition(_event.getPos()); if (m_buffer != NULL) { } - KeepFocus(); + keepFocus(); return true; } -void appl::TextViewer::OnEventClipboard(ewol::clipBoard::clipboardListe_te _clipboardID) +void appl::TextViewer::onEventClipboard(ewol::clipBoard::clipboardListe_te _clipboardID) { if (m_buffer != NULL) { //tmpBuffer->Paste(_clipboardID); } - MarkToRedraw(); + markToRedraw(); } -void appl::TextViewer::OnReceiveMessage(const ewol::EMessage& _msg) +void appl::TextViewer::onReceiveMessage(const ewol::EMessage& _msg) { - // Force redraw of the widget - MarkToRedraw(); + // force redraw of the widget + markToRedraw(); } -void appl::TextViewer::OnGetFocus(void) +void appl::TextViewer::onGetFocus(void) { ShowKeyboard(); APPL_INFO("Focus - In"); } -void appl::TextViewer::OnLostFocus(void) +void appl::TextViewer::onLostFocus(void) { HideKeyboard(); APPL_INFO("Focus - out"); } -void appl::TextViewer::SetFontSize(int32_t _size) +void appl::TextViewer::setFontSize(int32_t _size) { - m_displayText.SetFontSize(_size); - SetScrollingSize(_size*3.0*1.46); // 1.46 is a magic number ... + m_displayText.setFontSize(_size); + setScrollingSize(_size*3.0*1.46); // 1.46 is a magic number ... } -void appl::TextViewer::SetFontName(const etk::UString& _fontName) +void appl::TextViewer::setFontName(const etk::UString& _fontName) { - m_displayText.SetFontName(_fontName); + m_displayText.setFontName(_fontName); } diff --git a/sources/appl/Gui/TextViewer.h b/sources/appl/Gui/TextViewer.h index 8528d69..0d36ba3 100644 --- a/sources/appl/Gui/TextViewer.h +++ b/sources/appl/Gui/TextViewer.h @@ -28,24 +28,24 @@ namespace appl private: appl::Buffer* m_buffer; //!< pointer on the current buffer to display (can be null if the buffer is remover or in state of changing buffer) ewol::Text m_displayText; //!< Text display properties. - ewol::Drawing m_displayDrawing; //!< Other diaplay requested. + ewol::drawing m_displayDrawing; //!< Other diaplay requested. public: - void SetFontSize(int32_t _size); - void SetFontName(const etk::UString& _fontName); + void setFontSize(int32_t _size); + void setFontName(const etk::UString& _fontName); private: - void CalculateMaxSize(void); + void calculateMaxSize(void); protected: // derived function - virtual void OnDraw(void); + virtual void onDraw(void); public: // Derived function - const char * const GetObjectType(void) { return "ApplCodeView"; }; - virtual bool CalculateMinSize(void); - virtual void OnRegenerateDisplay(void); - virtual void OnReceiveMessage(const ewol::EMessage& _msg); - virtual bool OnEventInput(const ewol::EventInput& _event); - virtual bool OnEventEntry(const ewol::EventEntry& _event); - virtual void OnEventClipboard(ewol::clipBoard::clipboardListe_te clipboardID); - virtual void OnGetFocus(void); - virtual void OnLostFocus(void); + const char * const getObjectType(void) { return "ApplCodeView"; }; + virtual bool calculateMinSize(void); + virtual void onRegenerateDisplay(void); + virtual void onReceiveMessage(const ewol::EMessage& _msg); + virtual bool onEventInput(const ewol::EventInput& _event); + virtual bool onEventEntry(const ewol::EventEntry& _event); + virtual void onEventClipboard(ewol::clipBoard::clipboardListe_te clipboardID); + virtual void onGetFocus(void); + virtual void onLostFocus(void); private: bool m_insertMode; //!< the insert mode is enable }; diff --git a/sources/appl/Highlight/Highlight.cpp b/sources/appl/Highlight/Highlight.cpp index bcf3c9a..1d518d1 100644 --- a/sources/appl/Highlight/Highlight.cpp +++ b/sources/appl/Highlight/Highlight.cpp @@ -23,7 +23,7 @@ void Highlight::ParseRules(exml::Element* child, etk::Vector // parse under Element myPattern->ParseRules(child, level); // add element in the list - mListPatern.PushBack(myPattern); + mListPatern.pushBack(myPattern); } @@ -31,11 +31,11 @@ void Highlight::ParseRules(exml::Element* child, etk::Vector Highlight::Highlight(const etk::UString& _xmlFilename) { exml::Document doc; - if (doc.Load(_xmlFilename)==false) { + if (doc.load(_xmlFilename) == false) { APPL_ERROR(" can not load file XML : " << _xmlFilename); return; } - exml::Element* root = (exml::Element*)doc.GetNamed("EdnLang"); + exml::Element* root = (exml::Element*)doc.getNamed("EdnLang"); if (NULL == root ) { APPL_ERROR("(l ?) main node not find: \"EdnLang\" ..."); return; @@ -43,46 +43,46 @@ Highlight::Highlight(const etk::UString& _xmlFilename) int32_t level1 = 0; int32_t level2 = 0; // parse all the elements : - for(int32_t iii=0; iii< root->Size(); iii++) { - exml::Element* child = root->GetElement(iii); - if (child==NULL) { + for(int32_t iii=0; iii< root->size(); iii++) { + exml::Element* child = root->getElement(iii); + if (child == NULL) { // trash here all that is not element ... continue; } - if (child->GetValue() == "ext") { - etk::UString myData = child->GetText(); - if (myData.Size()!=0) { + if (child->getValue() == "ext") { + etk::UString myData = child->getText(); + if (myData.size()!=0) { //APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", child->Row(), child->Value() , myData); - m_listExtentions.PushBack(myData); + m_listExtentions.pushBack(myData); } - } else if (child->GetValue()=="pass1") { - // Get sub Nodes ... - for(int32_t jjj=0; jjj< child->Size(); jjj++) { - exml::Element* passChild = child->GetElement(jjj); - if (passChild==NULL) { + } else if (child->getValue() == "pass1") { + // get sub Nodes ... + for(int32_t jjj=0; jjj< child->size(); jjj++) { + exml::Element* passChild = child->getElement(jjj); + if (passChild == NULL) { continue; } - if (passChild->GetValue() != "rule") { - APPL_ERROR("(l "<< passChild->GetPos() << ") node not suported : \""<< passChild->GetValue() << "\" must be [rule]" ); + if (passChild->getValue() != "rule") { + APPL_ERROR("(l "<< passChild->getPos() << ") node not suported : \""<< passChild->GetValue() << "\" must be [rule]" ); continue; } ParseRules(passChild, m_listHighlightPass1, level1++); } - } else if (child->GetValue() == "pass2") { - // Get sub Nodes ... - for(int32_t jjj=0; jjj< child->Size(); jjj++) { - exml::Element* passChild = child->GetElement(jjj); - if (passChild==NULL) { + } else if (child->getValue() == "pass2") { + // get sub Nodes ... + for(int32_t jjj=0; jjj< child->size(); jjj++) { + exml::Element* passChild = child->getElement(jjj); + if (passChild == NULL) { continue; } - if (passChild->GetValue() != "rule") { - APPL_ERROR("(l "<< passChild->GetPos() << ") node not suported : \""<< passChild->GetValue() << "\" must be [rule]" ); + if (passChild->getValue() != "rule") { + APPL_ERROR("(l "<< passChild->getPos() << ") node not suported : \""<< passChild->GetValue() << "\" must be [rule]" ); continue; } ParseRules(passChild, m_listHighlightPass2, level2++); } } else { - APPL_ERROR("(l "<< child->GetPos() << ") node not suported : \""<< child->GetValue() << "\" must be [ext,pass1,pass2]" ); + APPL_ERROR("(l "<< child->getPos() << ") node not suported : \""<< child->GetValue() << "\" must be [ext,pass1,pass2]" ); } } } @@ -91,36 +91,36 @@ Highlight::~Highlight(void) { int32_t i; // clean all Element - for (i=0; i< m_listHighlightPass1.Size(); i++) { + for (i=0; i< m_listHighlightPass1.size(); i++) { if (NULL != m_listHighlightPass1[i]) { delete(m_listHighlightPass1[i]); m_listHighlightPass1[i] = NULL; } } // clear the compleate list - m_listHighlightPass1.Clear(); + m_listHighlightPass1.clear(); // clear the compleate list - m_listExtentions.Clear(); + m_listExtentions.clear(); } void Highlight::ReloadColor(void) { int32_t i; - for (i=0; i< m_listHighlightPass1.Size(); i++) { + for (i=0; i< m_listHighlightPass1.size(); i++) { if (NULL != m_listHighlightPass1[i]) { m_listHighlightPass1[i]->ReloadColor(); } } - for (i=0; i< m_listHighlightPass2.Size(); i++) { + for (i=0; i< m_listHighlightPass2.size(); i++) { if (NULL != m_listHighlightPass2[i]) { m_listHighlightPass2[i]->ReloadColor(); } } } -bool Highlight::HasExtention(const etk::UString& _ext) +bool Highlight::hasExtention(const etk::UString& _ext) { - for (int32_t iii=0; iiiGetName() ); - //m_listHighlightPass1[i]->Display(); + // display all elements + for (int32_t iii=0; iii< m_listHighlightPass1.size(); iii++) { + APPL_INFO(" " << iii << " Pass 1 : " << m_listHighlightPass1[iii]->getName() ); + //m_listHighlightPass1[i]->display(); } - // Display all elements - for (int32_t iii=0; iii< m_listHighlightPass2.Size(); iii++) { - APPL_INFO(" " << iii << " Pass 2 : " << m_listHighlightPass2[iii]->GetName() ); - //m_listHighlightPass2[i]->Display(); + // display all elements + for (int32_t iii=0; iii< m_listHighlightPass2.size(); iii++) { + APPL_INFO(" " << iii << " Pass 2 : " << m_listHighlightPass2[iii]->getName() ); + //m_listHighlightPass2[i]->display(); } } -// 13h 46min 22s | (l= 214) Highlight::Parse | [II] Find Pattern in the Buffer : (2457,2479) +// 13h 46min 22s | (l= 214) Highlight::Parse | [II] find Pattern in the Buffer : (2457,2479) // TODO : Celui qui appelle suprime des element pour rien ... Enfin c'est pas trègrave... Il suffirait juste de suprimer celuis d'avant si il n'est pas terminer... @@ -178,48 +178,48 @@ void Highlight::Parse(int32_t start, if (0 > addingPos) { addingPos = 0; } - //APPL_DEBUG("Parse element 0 => " << m_listHighlightPass1.Size() << " ==> position search: (" << start << "," << stop << ")" ); + //APPL_DEBUG("Parse element 0 => " << m_listHighlightPass1.size() << " == > position search: (" << start << "," << stop << ")" ); int32_t elementStart = start; int32_t elementStop = stop; colorInformation_ts resultat; while (elementStartFind(elementStart, buffer.Size(), resultat, buffer); + ret = m_listHighlightPass1[jjj]->find(elementStart, buffer.size(), resultat, buffer); if (HLP_FIND_ERROR != ret) { //APPL_INFO("Find Pattern in the Buffer : (" << resultat.beginStart << "," << resultat.endStop << ")" ); - // Remove element in the current List where the current Element have a end inside the next... + // remove element in the current List where the current Element have a end inside the next... int32_t kkk=addingPos; - while(kkk < metaData.Size() ) { + while(kkk < metaData.size() ) { if (metaData[kkk].beginStart <= resultat.endStop) { - // Remove element + // remove element //APPL_INFO("Erase element=" << kkk); metaData.EraseLen(kkk, kkk+1); // Increase the end of search - if (kkk < metaData.Size()) { + if (kkk < metaData.size()) { // just befor the end of the next element elementStop = metaData[kkk].beginStart-1; } else { // end of the buffer - elementStop = buffer.Size(); + elementStop = buffer.size(); } } else { - // Not find ==> exit the cycle : + // Not find == > exit the cycle : break; } } - // Add curent element in the list ... - metaData.Insert(addingPos, resultat); + // add curent element in the list ... + metaData.insert(addingPos, resultat); //APPL_DEBUG("INSERT at "<< addingPos << " S=" << resultat.beginStart << " E=" << resultat.endStop ); - // Update the current research starting element: (Set position at the end of the current element + // update the current research starting element: (set position at the end of the current element elementStart = resultat.endStop-1; // increment the position of insertion: addingPos++; - // We find a pattern ==> Stop search for the current element + // We find a pattern == > Stop search for the current element break; } } @@ -238,7 +238,7 @@ void Highlight::Parse2(int32_t start, etk::Vector &metaData, etk::Buffer &buffer) { - //APPL_DEBUG("Parse element 0 => " << m_listHighlightPass2.size() << " ==> position search: (" << start << "," << stop << ")" ); + //APPL_DEBUG("Parse element 0 => " << m_listHighlightPass2.size() << " == > position search: (" << start << "," << stop << ")" ); int32_t elementStart = start; int32_t elementStop = stop; colorInformation_ts resultat; @@ -246,15 +246,15 @@ void Highlight::Parse2(int32_t start, //APPL_DEBUG("Parse element in the buffer id=" << elementStart); //try to fond the HL in ALL of we have int32_t jjj; - for (jjj=0; jjjFind(elementStart, elementStop, resultat, buffer); + ret = m_listHighlightPass2[jjj]->find(elementStart, elementStop, resultat, buffer); if (HLP_FIND_ERROR != ret) { //APPL_INFO("Find Pattern in the Buffer : (" << resultat.beginStart << "," << resultat.endStop << ")" ); - // Add curent element in the list ... - metaData.PushBack(resultat); + // add curent element in the list ... + metaData.pushBack(resultat); elementStart = resultat.endStop-1; // Exit current cycle break; diff --git a/sources/appl/Highlight/Highlight.h b/sources/appl/Highlight/Highlight.h index 1b7187f..a68e462 100644 --- a/sources/appl/Highlight/Highlight.h +++ b/sources/appl/Highlight/Highlight.h @@ -36,9 +36,9 @@ class Highlight { // Constructeur Highlight(const etk::UString& _xmlFilename); ~Highlight(void); - bool HasExtention(const etk::UString& _ext); - bool FileNameCompatible(etk::FSNode &_fileName); - void Display(void); + bool hasExtention(const etk::UString& _ext); + bool fileNameCompatible(etk::FSNode &_fileName); + void display(void); void ReloadColor(void); void Parse(int32_t start, int32_t stop, @@ -53,8 +53,8 @@ class Highlight { void ParseRules(exml::Element* child, etk::Vector &mListPatern, int32_t level); etk::UString m_styleName; //!< curent style name (like "c++" or "c" or "script Bash") etk::Vector m_listExtentions; //!< List of possible extention for this high-light, like : ".c", ".cpp", ".h" - etk::Vector m_listHighlightPass1; //!< List of ALL hightlight modules (pass 1 ==> when we load and wride data on the buffer) - etk::Vector m_listHighlightPass2; //!< List of ALL hightlight modules (pass 2 ==> When we display the buffer( only the display area (100 lines)) ) + etk::Vector m_listHighlightPass1; //!< List of ALL hightlight modules (pass 1 == > when we load and wride data on the buffer) + etk::Vector m_listHighlightPass2; //!< List of ALL hightlight modules (pass 2 == > When we display the buffer( only the display area (100 lines)) ) }; diff --git a/sources/appl/Highlight/HighlightManager.cpp b/sources/appl/Highlight/HighlightManager.cpp index a599e5f..15c02d7 100644 --- a/sources/appl/Highlight/HighlightManager.cpp +++ b/sources/appl/Highlight/HighlightManager.cpp @@ -22,36 +22,36 @@ class localClassHighlightManager: public ewol::EObject public: // Constructeur localClassHighlightManager(void) { - //ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferColor); + //ewol::widgetMessageMultiCast::add(getWidgetId(), ednMsgBufferColor); }; ~localClassHighlightManager(void) { int32_t i; // clean all Element - for (i=0; i< listHighlight.Size(); i++) { + for (i=0; i< listHighlight.size(); i++) { if (NULL != listHighlight[i]) { delete(listHighlight[i]); listHighlight[i] = NULL; } } // clear the compleate list - listHighlight.Clear(); + listHighlight.clear(); }; // herited function - const char * const GetObjectType(void) + const char * const getObjectType(void) { return "ApplHighlightManager"; } // herited function - virtual void OnReceiveMessage(const ewol::EMessage& _msg) + virtual void onReceiveMessage(const ewol::EMessage& _msg) { /* switch (id) { case APPL_MSG__COLOR_HAS_CHANGE: APPL_INFO("UPDATE the color pointer on the HL"); - for (int32_t i=0; iReloadColor(); } @@ -61,11 +61,11 @@ class localClassHighlightManager: public ewol::EObject */ } - Highlight* Get(etk::FSNode &fileName) + Highlight* get(etk::FSNode &fileName) { int32_t i; - for (i=0; iFileNameCompatible(fileName) ) { + for (i=0; ifileNameCompatible(fileName) ) { return listHighlight[i]; } } @@ -74,7 +74,7 @@ class localClassHighlightManager: public ewol::EObject bool Exist(etk::FSNode &fileName) { - if (NULL != Get(fileName) ) { + if (NULL != get(fileName) ) { return true; } return false; @@ -86,17 +86,17 @@ class localClassHighlightManager: public ewol::EObject etk::FSNode myFile("DATA:languages/"); // get the subfolder list : etk::Vector list = myFile.FolderGetSubList(false, true, false,false); - for ( int32_t iii=0 ; iiiGetNodeType()==etk::FSN_FOLDER) { - etk::UString filename = list[iii]->GetName() + "/highlight.xml"; + if (list[iii]->getNodeType() == etk::FSN_FOLDER) { + etk::UString filename = list[iii]->getName() + "/highlight.xml"; APPL_DEBUG("Load xml name : " << filename); Highlight *myHightline = new Highlight(filename); - listHighlight.PushBack(myHightline); + listHighlight.pushBack(myHightline); } } } - //myHightline->Display(); + //myHightline->display(); } }; @@ -105,10 +105,10 @@ static localClassHighlightManager * localManager = NULL; -void HighlightManager::Init(void) +void HighlightManager::init(void) { if (NULL != localManager) { - APPL_ERROR("HighlightManager ==> already exist, just unlink the previous ..."); + APPL_ERROR("HighlightManager == > already exist, just unlink the previous ..."); localManager = NULL; } localManager = new localClassHighlightManager(); @@ -121,7 +121,7 @@ void HighlightManager::Init(void) void HighlightManager::UnInit(void) { if (NULL == localManager) { - APPL_ERROR("HighlightManager ==> request UnInit, but does not exist ..."); + APPL_ERROR("HighlightManager == > request UnInit, but does not exist ..."); return; } delete(localManager); @@ -136,12 +136,12 @@ void HighlightManager::loadLanguages(void) localManager->loadLanguages(); } -Highlight* HighlightManager::Get(etk::FSNode &fileName) +Highlight* HighlightManager::get(etk::FSNode &fileName) { if (NULL == localManager) { return NULL; } - return localManager->Get(fileName); + return localManager->get(fileName); } bool HighlightManager::Exist(etk::FSNode &fileName) diff --git a/sources/appl/Highlight/HighlightManager.h b/sources/appl/Highlight/HighlightManager.h index 990896e..9fcb59a 100644 --- a/sources/appl/Highlight/HighlightManager.h +++ b/sources/appl/Highlight/HighlightManager.h @@ -16,10 +16,10 @@ #include namespace HighlightManager{ - void Init(void); + void init(void); void UnInit(void); void loadLanguages(void); - Highlight* Get(etk::FSNode &fileName); + Highlight* get(etk::FSNode &fileName); bool Exist(etk::FSNode &fileName); }; diff --git a/sources/appl/Highlight/HighlightPattern.cpp b/sources/appl/Highlight/HighlightPattern.cpp index cb1c78f..3e52e43 100644 --- a/sources/appl/Highlight/HighlightPattern.cpp +++ b/sources/appl/Highlight/HighlightPattern.cpp @@ -21,7 +21,7 @@ HighlightPattern::HighlightPattern(void) { m_haveStopPatern = false; m_multiline = false; - m_color = ColorizeManager::Get("normal"); + m_color = ColorizeManager::get("normal"); m_regExpStart = new etk::RegExp(); m_regExpStop = new etk::RegExp(); m_escapeChar = 0; @@ -33,24 +33,24 @@ HighlightPattern::~HighlightPattern(void) delete(m_regExpStop); } -void HighlightPattern::SetPaternStart(etk::UString ®Exp) +void HighlightPattern::setPaternStart(etk::UString ®Exp) { - m_regExpStart->SetRegExp(regExp); + m_regExpStart->setRegExp(regExp); } -void HighlightPattern::SetPaternStop(etk::UString ®Exp) +void HighlightPattern::setPaternStop(etk::UString ®Exp) { - if (regExp.Size() != 0) { - m_regExpStop->SetRegExp(regExp); + if (regExp.size() != 0) { + m_regExpStop->setRegExp(regExp); m_haveStopPatern = true; } else { m_haveStopPatern = false; } } -void HighlightPattern::SetEscapeChar(etk::UString &EscapeChar) +void HighlightPattern::setEscapeChar(etk::UString &EscapeChar) { - if (EscapeChar.Size()>0) { + if (EscapeChar.size()>0) { m_escapeChar = EscapeChar[0]; } else { m_escapeChar = 0; @@ -58,13 +58,13 @@ void HighlightPattern::SetEscapeChar(etk::UString &EscapeChar) } -void HighlightPattern::SetColor(etk::UString &colorName) +void HighlightPattern::setColor(etk::UString &colorName) { m_colorName = colorName; - m_color = ColorizeManager::Get(m_colorName); + m_color = ColorizeManager::get(m_colorName); } -bool HighlightPattern::IsEnable(void) +bool HighlightPattern::isEnable(void) { return true; } @@ -72,7 +72,7 @@ bool HighlightPattern::IsEnable(void) void HighlightPattern::ReloadColor(void) { - m_color = ColorizeManager::Get(m_colorName); + m_color = ColorizeManager::get(m_colorName); } /** @@ -83,28 +83,28 @@ void HighlightPattern::ReloadColor(void) * @eturn * */ -void HighlightPattern::Display(void) +void HighlightPattern::display(void) { /* APPL_INFO("patern : \"" << m_paternName << "\" level=" << m_level ); - APPL_INFO(" ==> colorName \"" << m_colorName << "\""); - APPL_INFO(" ==> regExpStart \"" << m_regExpStart->GetRegExp() << "\""); - APPL_INFO(" ==> regExpStop \"" << m_regExpStop->GetRegExp() << "\""); + APPL_INFO(" == > colorName \"" << m_colorName << "\""); + APPL_INFO(" == > regExpStart \"" << m_regExpStart->getRegExp() << "\""); + APPL_INFO(" == > regExpStop \"" << m_regExpStop->getRegExp() << "\""); if (true == m_haveStopPatern) { - APPL_INFO(" ==> stop pattern: YES"); + APPL_INFO(" == > stop pattern: YES"); } else { - APPL_INFO(" ==> stop pattern: NO"); + APPL_INFO(" == > stop pattern: NO"); } if (true == m_multiline) { - APPL_INFO(" ==> multiline pattern: YES"); + APPL_INFO(" == > multiline pattern: YES"); } else { - APPL_INFO(" ==> multiline pattern: NO"); + APPL_INFO(" == > multiline pattern: NO"); } */ - // Display all elements - for (int32_t i=0; i< m_subPatern.Size(); i++) { - APPL_INFO(" " << i << " SubPattern : " << m_subPatern[i]->GetName() ); - m_subPatern[i]->Display(); + // display all elements + for (int32_t i=0; i< m_subPatern.size(); i++) { + APPL_INFO(" " << i << " subPattern : " << m_subPatern[i]->getName() ); + m_subPatern[i]->display(); } } void HighlightPattern::ParseRules(exml::Element *child, int32_t level) @@ -120,51 +120,51 @@ void HighlightPattern::ParseRules(exml::Element *child, int32_t level) */ //-------------------------------------------------------------------------------------------- // process attribute - etk::UString highLightName = child->GetAttribute("name"); + etk::UString highLightName = child->getAttribute("name"); etk::UString myEdnDataTmp = "???"; - if (highLightName.Size()!=0) { + if (highLightName.size()!=0) { myEdnDataTmp = highLightName; } - SetName(myEdnDataTmp); - SetLevel(level); + setName(myEdnDataTmp); + setLevel(level); - exml::Element* xChild = (exml::Element*)child->GetNamed("color"); + exml::Element* xChild = (exml::Element*)child->getNamed("color"); if (NULL != xChild) { - etk::UString myData = xChild->GetText(); - if (myData.Size()!=0) { + etk::UString myData = xChild->getText(); + if (myData.size()!=0) { //APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData); etk::UString myEdnData = myData; - SetColor(myEdnData); + setColor(myEdnData); } } - xChild = (exml::Element*)child->GetNamed("start"); + xChild = (exml::Element*)child->getNamed("start"); if (NULL != xChild) { - etk::UString myData = xChild->GetText(); - if (myData.Size()!=0) { + etk::UString myData = xChild->getText(); + if (myData.size()!=0) { //APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData); etk::UString myEdnData = myData; - SetPaternStart(myEdnData); + setPaternStart(myEdnData); } } - xChild = (exml::Element*)child->GetNamed("end"); + xChild = (exml::Element*)child->getNamed("end"); if (NULL != xChild) { - etk::UString myData = xChild->GetText(); - if (myData.Size()!=0) { + etk::UString myData = xChild->getText(); + if (myData.size()!=0) { //APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData); etk::UString myEdnData = myData; - SetPaternStop(myEdnData); + setPaternStop(myEdnData); } } - xChild = (exml::Element*)child->GetNamed("EscapeChar"); + xChild = (exml::Element*)child->getNamed("EscapeChar"); if (NULL != xChild) { - etk::UString myData = xChild->GetText(); - if (myData.Size()!=0) { + etk::UString myData = xChild->getText(); + if (myData.size()!=0) { //APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData); etk::UString myEdnData = myData; - SetEscapeChar(myEdnData); + setEscapeChar(myEdnData); } } - xChild = (exml::Element*)child->GetNamed("rule"); + xChild = (exml::Element*)child->getNamed("rule"); if (NULL != xChild) { /* // Create the patern ... @@ -172,7 +172,7 @@ void HighlightPattern::ParseRules(exml::Element *child, int32_t level) // parse under Element myPattern->ParseRules(ruleChild, level+1); // add element in the list - m_subPatern.PushBack(myPattern); + m_subPatern.pushBack(myPattern); //ParseRules(passChild, m_listHighlightPass1, level1++); */ } @@ -180,7 +180,7 @@ void HighlightPattern::ParseRules(exml::Element *child, int32_t level) /** - * @brief Find Element only in the specify start characters and find the end with the range done + * @brief find Element only in the specify start characters and find the end with the range done * * @param[in] start First character to search data (if recognise it start here) * @param[in] stop End of the possibility whe search can continue @@ -191,7 +191,7 @@ void HighlightPattern::ParseRules(exml::Element *child, int32_t level) * @return HLP_FIND_OK_NO_END Xe find a partial pattern (missing end) * @return HLP_FIND_ERROR Not find the pattern */ -resultFind_te HighlightPattern::Find(int32_t start, int32_t stop, colorInformation_ts &resultat, etk::Buffer &buffer) +resultFind_te HighlightPattern::find(int32_t start, int32_t stop, colorInformation_ts &resultat, etk::Buffer &buffer) { //APPL_DEBUG(" try to find the element"); resultat.beginStart = -1; diff --git a/sources/appl/Highlight/HighlightPattern.h b/sources/appl/Highlight/HighlightPattern.h index 405305c..7b378ba 100644 --- a/sources/appl/Highlight/HighlightPattern.h +++ b/sources/appl/Highlight/HighlightPattern.h @@ -34,28 +34,28 @@ class HighlightPattern { HighlightPattern(void); ~HighlightPattern(void); - void SetName(etk::UString &name) { m_paternName = name;}; - etk::UString GetName(void) { return m_paternName;}; + void setName(etk::UString &name) { m_paternName = name;}; + etk::UString getName(void) { return m_paternName;}; - void SetPaternStart(etk::UString ®Exp); - void SetPaternStop(etk::UString ®Exp); - void SetColor(etk::UString &colorName); - void SetEscapeChar(etk::UString &EscapeChar); - void SetMultiline(bool enable) { m_multiline = enable; }; + void setPaternStart(etk::UString ®Exp); + void setPaternStop(etk::UString ®Exp); + void setColor(etk::UString &colorName); + void setEscapeChar(etk::UString &EscapeChar); + void setMultiline(bool enable) { m_multiline = enable; }; - void SetLevel(int32_t newLevel) { m_level = newLevel; }; - int32_t GetLevel(void) { return m_level; }; + void setLevel(int32_t newLevel) { m_level = newLevel; }; + int32_t getLevel(void) { return m_level; }; - bool IsEnable(void); - void Display(void); - resultFind_te Find(int32_t start, int32_t stop, colorInformation_ts &resultat, etk::Buffer &buffer); - Colorize * GetColor(void) { return m_color; }; + bool isEnable(void); + void display(void); + resultFind_te find(int32_t start, int32_t stop, colorInformation_ts &resultat, etk::Buffer &buffer); + Colorize * getColor(void) { return m_color; }; void ParseRules(exml::Element *child, int32_t level); void ReloadColor(void); private: - int32_t m_level; //!< Level of the pattern ==> this is to overwrite next pattern when we create an higher .... + int32_t m_level; //!< Level of the pattern == > this is to overwrite next pattern when we create an higher .... etk::UString m_paternName; //!< Current style name (like "c++" or "c" or "script Bash") etk::UString m_colorName; //!< Current color name Colorize * m_color; //!< Link to the color manager diff --git a/sources/appl/ctags/CTagsManager.cpp b/sources/appl/ctags/CTagsManager.cpp index 0e83224..1d57257 100644 --- a/sources/appl/ctags/CTagsManager.cpp +++ b/sources/appl/ctags/CTagsManager.cpp @@ -27,18 +27,18 @@ class CTagsManager: public ewol::EObject CTagsManager(void); ~CTagsManager(void); - const char * const GetObjectType(void) + const char * const getObjectType(void) { return "CTagsManager"; }; - void OnReceiveMessage(const ewol::EMessage& _msg); + void onReceiveMessage(const ewol::EMessage& _msg); int32_t m_currentSelectedID; - void LoadTagFile(void); + void loadTagFile(void); int32_t MultipleJump(void); void JumpTo(void); - void PrintTag(const tagEntry *entry); - etk::UString GetFolder(etk::UString &inputString); + void printTag(const tagEntry *entry); + etk::UString getFolder(etk::UString &inputString); etk::UString m_tagFolderBase; etk::UString m_tagFilename; tagFile * m_ctagFile; @@ -49,11 +49,11 @@ class CTagsManager: public ewol::EObject }; static CTagsManager* s_elementPointer = NULL; -void cTagsManager::Init(void) +void cTagsManager::init(void) { if (NULL != s_elementPointer) { s_elementPointer = NULL; - EWOL_WARNING("Ctags manager already instanciate ... ==> restart IT (can have memory leek ...)"); + EWOL_WARNING("Ctags manager already instanciate ... == > restart IT (can have memory leek ...)"); } s_elementPointer = new CTagsManager(); if (NULL == s_elementPointer) { @@ -66,7 +66,7 @@ void cTagsManager::UnInit(void) delete(s_elementPointer); s_elementPointer = NULL; } else { - EWOL_ERROR("Ctags manager not instanciate ... ==> can not remove it ..."); + EWOL_ERROR("Ctags manager not instanciate ... == > can not remove it ..."); } } @@ -103,66 +103,66 @@ CTagsManager::CTagsManager(void) CTagsManager::~CTagsManager(void) { EWOL_INFO("Ctags manager (Un-INIT)"); - if(0 != m_historyList.Size()) { - for (int32_t iii=0; iii< m_historyList.Size(); iii++) { + if(0 != m_historyList.size()) { + for (int32_t iii=0; iii< m_historyList.size(); iii++) { delete(m_historyList[iii]); } - m_historyList.Clear(); + m_historyList.clear(); } } const char * ednEventPopUpCtagsLoadFile = "edn-event-load-ctags"; -void CTagsManager::OnReceiveMessage(const ewol::EMessage& _msg) +void CTagsManager::onReceiveMessage(const ewol::EMessage& _msg) { - //EWOL_INFO("ctags manager event ... : \"" << eventId << "\" ==> data=\"" << data << "\"" ); - if (_msg.GetMessage() == ednMsgBufferId) { + //EWOL_INFO("ctags manager event ... : \"" << eventId << "\" == > data=\"" << data << "\"" ); + if (_msg.getMessage() == ednMsgBufferId) { //m_currentSelectedID = dataID; - } else if( _msg.GetMessage() == ednEventPopUpCtagsLoadFile - || _msg.GetMessage() == ednMsgCtagsLoadFile) { + } else if( _msg.getMessage() == ednEventPopUpCtagsLoadFile + || _msg.getMessage() == ednMsgCtagsLoadFile) { // open the new one : - etk::FSNode tmpFilename = _msg.GetData(); - m_tagFilename = tmpFilename.GetNameFile(); - m_tagFolderBase = tmpFilename.GetNameFolder(); + etk::FSNode tmpFilename = _msg.getData(); + m_tagFilename = tmpFilename.getNameFile(); + m_tagFolderBase = tmpFilename.getNameFolder(); APPL_DEBUG("Receive load Ctags file : " << m_tagFolderBase << "/" << m_tagFilename << " "); - LoadTagFile(); - } else if (_msg.GetMessage() == ednMsgGuiCtags) { - if (_msg.GetData() == "Load") { + loadTagFile(); + } else if (_msg.getMessage() == ednMsgGuiCtags) { + if (_msg.getData() == "Load") { APPL_INFO("Request opening ctag file"); - widget::FileChooser* tmpWidget = new widget::FileChooser(); + widget::fileChooser* tmpWidget = new widget::FileChooser(); if (NULL == tmpWidget) { - APPL_ERROR("Can not allocate widget ==> display might be in error"); + APPL_ERROR("Can not allocate widget == > display might be in error"); } else { - tmpWidget->SetTitle("Open Exuberant Ctags File"); - tmpWidget->SetValidateLabel("Open"); - ewol::GetContext().GetWindows()->PopUpWidgetPush(tmpWidget); - tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpCtagsLoadFile); + tmpWidget->setTitle("Open Exuberant Ctags file"); + tmpWidget->setValidateLabel("Open"); + ewol::getContext().getWindows()->popUpWidgetPush(tmpWidget); + tmpWidget->registerOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpCtagsLoadFile); } - } else if (_msg.GetData() == "ReLoad") { + } else if (_msg.getData() == "ReLoad") { APPL_INFO("Request re-load ctag file"); - LoadTagFile(); - } else if (_msg.GetData() == "Jump") { + loadTagFile(); + } else if (_msg.getData() == "Jump") { JumpTo(); - } else if (_msg.GetData() == "Back") { - if (m_historyList.Size() > 0) { - int32_t id = m_historyList.Size()-1; - SendMultiCast(ednMsgOpenFile, m_historyList[id]->GetName() ); - SendMultiCast(ednMsgGuiGotoLine, 0);// TODO : m_historyList[id]->GetLineNumber()); - // Remove element .... + } else if (_msg.getData() == "Back") { + if (m_historyList.size() > 0) { + int32_t id = m_historyList.size()-1; + SendMultiCast(ednMsgOpenFile, m_historyList[id]->getName() ); + SendMultiCast(ednMsgGuiGotoLine, 0);// TODO : m_historyList[id]->getLineNumber()); + // remove element .... delete(m_historyList[id]); m_historyList[id]=NULL; - m_historyList.PopBack(); + m_historyList.popBack(); } } else { } - } else if (_msg.GetMessage() == applEventctagsSelection) { + } else if (_msg.getMessage() == applEventctagsSelection) { // save the current file in the history RegisterHistory(); // parse the input data char tmp[4096]; int32_t lineID; - sscanf(_msg.GetData().c_str(), "%d:%s", &lineID, tmp); + sscanf(_msg.getData().c_str(), "%d:%s", &lineID, tmp); // generate envents SendMultiCast(ednMsgOpenFile, tmp); SendMultiCast(ednMsgGuiGotoLine, lineID - 1); @@ -170,7 +170,7 @@ void CTagsManager::OnReceiveMessage(const ewol::EMessage& _msg) } -void CTagsManager::LoadTagFile(void) +void CTagsManager::loadTagFile(void) { tagFileInfo info; @@ -196,13 +196,13 @@ void CTagsManager::LoadTagFile(void) void CTagsManager::RegisterHistory(void) { APPL_INFO("save curent filename and position : "); - int32_t currentSelected = BufferManager::GetSelected(); - BufferText* tmpBuf = BufferManager::Get(currentSelected); + int32_t currentSelected = BufferManager::getSelected(); + BufferText* tmpBuf = BufferManager::get(currentSelected); if (NULL != tmpBuf) { etk::FSNode * bufferFilename = new etk::FSNode(); - *bufferFilename = tmpBuf->GetFileName(); - // TODO : bufferFilename->SetLineNumber(tmpBuf->GetCurrentLine()); - m_historyList.PushBack(bufferFilename); + *bufferFilename = tmpBuf->getFileName(); + // TODO : bufferFilename->setLineNumber(tmpBuf->getCurrentLine()); + m_historyList.pushBack(bufferFilename); } } @@ -210,10 +210,10 @@ void CTagsManager::RegisterHistory(void) void CTagsManager::JumpTo(void) { if (NULL != m_ctagFile) { - // get the middle button of the clipboard ==> represent the current selection ... - etk::UString data = ewol::clipBoard::Get(ewol::clipBoard::clipboardSelection); + // get the middle button of the clipboard == > represent the current selection ... + etk::UString data = ewol::clipBoard::get(ewol::clipBoard::clipboardSelection); APPL_DEBUG("clipboard data : \"" << data << "\""); - if (data.Size() == 0) { + if (data.size() == 0) { APPL_INFO("No current selection"); } tagEntry entry; @@ -226,29 +226,29 @@ void CTagsManager::JumpTo(void) etk::UString tmpFile(m_tagFolderBase + "/" + entry.file); etk::FSNode myfile(tmpFile); int32_t lineID = entry.address.lineNumber; - PrintTag(&entry); + printTag(&entry); if (tagsFindNext (m_ctagFile, &entry) == TagSuccess) { APPL_INFO("Multiple file destination ..."); appl::TagFileSelection* tmpWidget = new appl::TagFileSelection(); if (NULL == tmpWidget) { - APPL_ERROR("Can not allocate widget ==> display might be in error"); + APPL_ERROR("Can not allocate widget == > display might be in error"); } else { - tmpWidget->AddCtagsNewItem(myfile.GetName(), lineID); + tmpWidget->addCtagsNewItem(myfile.getName(), lineID); do { tmpFile = m_tagFolderBase + "/" + entry.file; myfile = tmpFile; lineID = entry.address.lineNumber; - PrintTag(&entry); - tmpWidget->AddCtagsNewItem(myfile.GetName(), lineID); + printTag(&entry); + tmpWidget->addCtagsNewItem(myfile.getName(), lineID); } while (tagsFindNext (m_ctagFile, &entry) == TagSuccess); - ewol::GetContext().GetWindows()->PopUpWidgetPush(tmpWidget); - tmpWidget->RegisterOnEvent(this, applEventctagsSelection); + ewol::getContext().getWindows()->popUpWidgetPush(tmpWidget); + tmpWidget->registerOnEvent(this, applEventctagsSelection); } } else { RegisterHistory(); APPL_INFO(" OPEN the TAG file Destination : " << tmpFile ); - SendMultiCast(ednMsgOpenFile, myfile.GetName()); + SendMultiCast(ednMsgOpenFile, myfile.getName()); SendMultiCast(ednMsgGuiGotoLine, lineID - 1); } } else { @@ -258,7 +258,7 @@ void CTagsManager::JumpTo(void) } -void CTagsManager::PrintTag(const tagEntry *entry) +void CTagsManager::printTag(const tagEntry *entry) { #if 1 APPL_INFO("find Tag file : name=\"" << entry->name << "\" in file=\"" << entry->file diff --git a/sources/appl/ctags/CTagsManager.h b/sources/appl/ctags/CTagsManager.h index 7e5dde3..2151ec5 100644 --- a/sources/appl/ctags/CTagsManager.h +++ b/sources/appl/ctags/CTagsManager.h @@ -18,7 +18,7 @@ namespace cTagsManager { - void Init(void); + void init(void); void UnInit(void); }; diff --git a/sources/appl/ctags/readtags.h b/sources/appl/ctags/readtags.h index 724f250..483120e 100644 --- a/sources/appl/ctags/readtags.h +++ b/sources/appl/ctags/readtags.h @@ -201,7 +201,7 @@ extern tagResult tagsNext (tagFile *const file, tagEntry *const entry); extern const char *tagsField (const tagEntry *const entry, const char *const key); /* -* Find the first tag matching `name'. The structure pointed to by `entry' +* find the first tag matching `name'. The structure pointed to by `entry' * will be populated with information about the tag file entry. If a tag file * is sorted using the C locale, a binary search algorithm is used to search * the tag file, resulting in very fast tag lookups, even in huge tag files. @@ -212,7 +212,7 @@ extern const char *tagsField (const tagEntry *const entry, const char *const key * Tags whose leading characters match `name' will qualify. * * TAG_FULLMATCH -* Only tags whose full lengths match `name' will qualify. +* only tags whose full lengths match `name' will qualify. * * TAG_IGNORECASE * Matching will be performed in a case-insenstive manner. Note that @@ -228,7 +228,7 @@ extern const char *tagsField (const tagEntry *const entry, const char *const key extern tagResult tagsFind (tagFile *const file, tagEntry *const entry, const char *const name, const int options); /* -* Find the next tag matching the name and options supplied to the most recent +* find the next tag matching the name and options supplied to the most recent * call to tagsFind() for the same tag file. The structure pointed to by * `entry' will be populated with information about the tag file entry. The * function will return TagSuccess if another tag matching the name is found, diff --git a/sources/appl/global.cpp b/sources/appl/global.cpp index 949edf9..85bddf5 100644 --- a/sources/appl/global.cpp +++ b/sources/appl/global.cpp @@ -32,44 +32,44 @@ class myParamGlobal : public ewol::EObject bool m_displaySpaceChar; public : myParamGlobal(void) { - m_static = true; // Note : Set the object static notification( Must be set or assert at the end of process) - SetName("edn_global_param"); + m_static = true; // Note : set the object static notification( Must be set or assert at the end of process) + setName("edn_global_param"); m_displayEOL=false; m_AutoIndent = true; m_displayTabChar = true; m_displaySpaceChar = true; - RegisterConfig(configEOL, "bool", NULL, "Display end of line character"); - RegisterConfig(configAutoIndent, "bool", NULL, "Auto indent when create new line"); - RegisterConfig(configShowTabChar, "bool", NULL, "Display the Tab char"); - RegisterConfig(configShowSpaceChar, "bool", NULL, "Display the space char"); + registerConfig(configEOL, "bool", NULL, "Display end of line character"); + registerConfig(configAutoIndent, "bool", NULL, "Auto indent when create new line"); + registerConfig(configShowTabChar, "bool", NULL, "Display the Tab char"); + registerConfig(configShowSpaceChar, "bool", NULL, "Display the space char"); } - bool OnSetConfig(const ewol::EConfig& _conf) + bool onSetConfig(const ewol::EConfig& _conf) { - // Not set the EObject node parameter (name ==> not change ...) - if (_conf.GetConfig() == configEOL) { - m_displayEOL = _conf.GetData().ToBool(); + // Not set the EObject node parameter (name == > not change ...) + if (_conf.getConfig() == configEOL) { + m_displayEOL = _conf.getData().toBool(); return true; } - if (_conf.GetConfig() == configAutoIndent) { - m_AutoIndent = _conf.GetData().ToBool(); + if (_conf.getConfig() == configAutoIndent) { + m_AutoIndent = _conf.getData().toBool(); return true; } - if (_conf.GetConfig() == configShowTabChar) { - m_displayTabChar = _conf.GetData().ToBool(); + if (_conf.getConfig() == configShowTabChar) { + m_displayTabChar = _conf.getData().toBool(); return true; } - if (_conf.GetConfig() == configShowSpaceChar) { - m_displaySpaceChar = _conf.GetData().ToBool(); + if (_conf.getConfig() == configShowSpaceChar) { + m_displaySpaceChar = _conf.getData().toBool(); return true; } return false; } - bool OnGetConfig(const char* _config, etk::UString& _result) const + bool onGetConfig(const char* _config, etk::UString& _result) const { - // Not set the EObject node parameter (name ==> not change ...) + // Not set the EObject node parameter (name == > not change ...) if (_config == configEOL) { - if (true==m_displayEOL) { + if (true == m_displayEOL) { _result = "true"; } else { _result = "false"; @@ -77,7 +77,7 @@ class myParamGlobal : public ewol::EObject return true; } if (_config == configAutoIndent) { - if (true==m_AutoIndent) { + if (true == m_AutoIndent) { _result = "true"; } else { _result = "false"; @@ -85,7 +85,7 @@ class myParamGlobal : public ewol::EObject return true; } if (_config == configShowTabChar) { - if (true==m_displayTabChar) { + if (true == m_displayTabChar) { _result = "true"; } else { _result = "false"; @@ -93,7 +93,7 @@ class myParamGlobal : public ewol::EObject return true; } if (_config == configShowSpaceChar) { - if (true==m_displaySpaceChar) { + if (true == m_displaySpaceChar) { _result = "true"; } else { _result = "false"; @@ -117,9 +117,9 @@ static myParamGlobal& l_obj(void) -void globals::Init(void) +void globals::init(void) { - //ewol::userConfig::AddUserConfig(&l_obj()); + //ewol::userConfig::addUserConfig(&l_obj()); } void globals::UnInit(void) @@ -130,47 +130,47 @@ void globals::UnInit(void) // ----------------------------------------------------------- -bool globals::IsSetDisplayEndOfLine(void) +bool globals::isSetDisplayEndOfLine(void) { return l_obj().m_displayEOL; } -void globals::SetDisplayEndOfLine(bool newVal) +void globals::setDisplayEndOfLine(bool newVal) { l_obj().m_displayEOL = newVal; //ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange); } // ----------------------------------------------------------- -bool globals::IsSetDisplaySpaceChar(void) +bool globals::isSetDisplaySpaceChar(void) { return l_obj().m_displaySpaceChar; } -void globals::SetDisplaySpaceChar(bool newVal) +void globals::setDisplaySpaceChar(bool newVal) { l_obj().m_displaySpaceChar = newVal; //ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange); } // ----------------------------------------------------------- -bool globals::IsSetDisplayTabChar(void) +bool globals::isSetDisplayTabChar(void) { return l_obj().m_displayTabChar; } -void globals::SetDisplayTabChar(bool newVal) +void globals::setDisplayTabChar(bool newVal) { l_obj().m_displayTabChar = newVal; //ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange); } // ----------------------------------------------------------- -bool globals::IsSetAutoIndent(void) +bool globals::isSetAutoIndent(void) { return l_obj().m_AutoIndent; } -void globals::SetAutoIndent(bool newVal) +void globals::setAutoIndent(bool newVal) { l_obj().m_AutoIndent = newVal; } @@ -213,55 +213,55 @@ globals::ParameterGlobalsGui::ParameterGlobalsGui(void) : mySpacer = new widget::Spacer(); if (NULL == mySpacer) { - APPL_ERROR("Can not allocate widget ==> display might be in error"); + APPL_ERROR("Can not allocate widget == > display might be in error"); } else { - mySpacer->SetExpand(bvec2(true,true)); - SubWidgetAdd(mySpacer); + mySpacer->setExpand(bvec2(true,true)); + subWidgetAdd(mySpacer); } myCheckbox = new widget::CheckBox("Automatic Indentation"); if (NULL == myCheckbox) { - APPL_ERROR("Can not allocate widget ==> display might be in error"); + APPL_ERROR("Can not allocate widget == > display might be in error"); } else { - myCheckbox->SetExpand(bvec2(true,false)); - myCheckbox->SetValue(IsSetAutoIndent()); - myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeIndentation); - SubWidgetAdd(myCheckbox); + myCheckbox->setExpand(bvec2(true,false)); + myCheckbox->setValue(isSetAutoIndent()); + myCheckbox->registerOnEvent(this, ewolEventCheckBoxClicked, l_changeIndentation); + subWidgetAdd(myCheckbox); } myCheckbox = new widget::CheckBox("Display space char (' ')"); if (NULL == myCheckbox) { - APPL_ERROR("Can not allocate widget ==> display might be in error"); + APPL_ERROR("Can not allocate widget == > display might be in error"); } else { - myCheckbox->SetExpand(bvec2(true,false)); - myCheckbox->SetValue(IsSetDisplaySpaceChar()); - myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeSpace); - SubWidgetAdd(myCheckbox); + myCheckbox->setExpand(bvec2(true,false)); + myCheckbox->setValue(isSetDisplaySpaceChar()); + myCheckbox->registerOnEvent(this, ewolEventCheckBoxClicked, l_changeSpace); + subWidgetAdd(myCheckbox); } myCheckbox = new widget::CheckBox("Display tabulation char ('\\t')"); if (NULL == myCheckbox) { - APPL_ERROR("Can not allocate widget ==> display might be in error"); + APPL_ERROR("Can not allocate widget == > display might be in error"); } else { - myCheckbox->SetExpand(bvec2(true,false)); - myCheckbox->SetValue(IsSetDisplayTabChar()); - myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeTabulation); - SubWidgetAdd(myCheckbox); + myCheckbox->setExpand(bvec2(true,false)); + myCheckbox->setValue(isSetDisplayTabChar()); + myCheckbox->registerOnEvent(this, ewolEventCheckBoxClicked, l_changeTabulation); + subWidgetAdd(myCheckbox); } myCheckbox = new widget::CheckBox("Display end of line ('\\n')"); if (NULL == myCheckbox) { - APPL_ERROR("Can not allocate widget ==> display might be in error"); + APPL_ERROR("Can not allocate widget == > display might be in error"); } else { - myCheckbox->SetExpand(bvec2(true,false)); - myCheckbox->SetValue(IsSetDisplayEndOfLine()); - myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeEndOfLine); - SubWidgetAdd(myCheckbox); + myCheckbox->setExpand(bvec2(true,false)); + myCheckbox->setValue(isSetDisplayEndOfLine()); + myCheckbox->registerOnEvent(this, ewolEventCheckBoxClicked, l_changeEndOfLine); + subWidgetAdd(myCheckbox); } myCheckbox = new widget::CheckBox("switch Rounded/default"); if (NULL == myCheckbox) { - APPL_ERROR("Can not allocate widget ==> display might be in error"); + APPL_ERROR("Can not allocate widget == > display might be in error"); } else { - myCheckbox->SetExpand(bvec2(true,false)); - myCheckbox->SetValue(IsSetDisplayEndOfLine()); - myCheckbox->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_changeRounded); - SubWidgetAdd(myCheckbox); + myCheckbox->setExpand(bvec2(true,false)); + myCheckbox->setValue(isSetDisplayEndOfLine()); + myCheckbox->registerOnEvent(this, ewolEventCheckBoxClicked, l_changeRounded); + subWidgetAdd(myCheckbox); } } @@ -271,43 +271,43 @@ globals::ParameterGlobalsGui::~ParameterGlobalsGui(void) } -void globals::ParameterGlobalsGui::OnReceiveMessage(const ewol::EMessage& _msg) +void globals::ParameterGlobalsGui::onReceiveMessage(const ewol::EMessage& _msg) { - widget::Sizer::OnReceiveMessage(_msg); + widget::Sizer::onReceiveMessage(_msg); - if (_msg.GetMessage() == l_changeEndOfLine) { - if (_msg.GetData() == "true") { - SetDisplayEndOfLine(true); + if (_msg.getMessage() == l_changeEndOfLine) { + if (_msg.getData() == "true") { + setDisplayEndOfLine(true); } else { - SetDisplayEndOfLine(false); + setDisplayEndOfLine(false); } - } else if (_msg.GetMessage() == l_changeIndentation) { - if (_msg.GetData() == "true") { - SetAutoIndent(true); + } else if (_msg.getMessage() == l_changeIndentation) { + if (_msg.getData() == "true") { + setAutoIndent(true); } else { - SetAutoIndent(false); + setAutoIndent(false); } - } else if (_msg.GetMessage() == l_changeSpace) { - if (_msg.GetData() == "true") { - SetDisplaySpaceChar(true); + } else if (_msg.getMessage() == l_changeSpace) { + if (_msg.getData() == "true") { + setDisplaySpaceChar(true); } else { - SetDisplaySpaceChar(false); + setDisplaySpaceChar(false); } - } else if (_msg.GetMessage() == l_changeTabulation) { - if (_msg.GetData() == "true") { - SetDisplayTabChar(true); + } else if (_msg.getMessage() == l_changeTabulation) { + if (_msg.getData() == "true") { + setDisplayTabChar(true); } else { - SetDisplayTabChar(false); + setDisplayTabChar(false); } - } else if (_msg.GetMessage() == l_changeRounded) { - if (_msg.GetData() == "true") { - etk::theme::SetName("GUI", "rounded");; + } else if (_msg.getMessage() == l_changeRounded) { + if (_msg.getData() == "true") { + etk::theme::setName("GUI", "rounded");; } else { - etk::theme::SetName("GUI", "default");; + etk::theme::setName("GUI", "default");; } // Reload shaders and graphic system ... - ewol::GetContext().GetResourcesManager().ReLoadResources(); - ewol::GetContext().ForceRedrawAll(); + ewol::getContext().getResourcesManager().ReLoadResources(); + ewol::getContext().forceRedrawAll(); } } diff --git a/sources/appl/global.h b/sources/appl/global.h index d9963cc..ead6843 100644 --- a/sources/appl/global.h +++ b/sources/appl/global.h @@ -15,22 +15,22 @@ namespace globals { - void Init(void); + void init(void); void UnInit(void); int32_t getNbColoneBorder(void); int32_t getNbLineBorder(void); - bool IsSetDisplayEndOfLine(void); - void SetDisplayEndOfLine(bool newVal); + bool isSetDisplayEndOfLine(void); + void setDisplayEndOfLine(bool newVal); - bool IsSetDisplaySpaceChar(void); - void SetDisplaySpaceChar(bool newVal); + bool isSetDisplaySpaceChar(void); + void setDisplaySpaceChar(bool newVal); - bool IsSetDisplayTabChar(void); - void SetDisplayTabChar(bool newVal); + bool isSetDisplayTabChar(void); + void setDisplayTabChar(bool newVal); - bool IsSetAutoIndent(void); - void SetAutoIndent(bool newVal); + bool isSetAutoIndent(void); + void setAutoIndent(bool newVal); void init2(void); @@ -42,7 +42,7 @@ namespace globals ParameterGlobalsGui(void); ~ParameterGlobalsGui(void); // herited function - virtual void OnReceiveMessage(const ewol::EMessage& _msg); + virtual void onReceiveMessage(const ewol::EMessage& _msg); }; } diff --git a/sources/appl/init.cpp b/sources/appl/init.cpp index 0314196..b8d71eb 100644 --- a/sources/appl/init.cpp +++ b/sources/appl/init.cpp @@ -43,44 +43,44 @@ int main(int _argc, const char *_argv[]) /** - * @brief main application function Initialisation + * @brief main application function initialisation */ bool APP_Init(ewol::eContext& _context) { - APPL_INFO("==> Init APPL (START) [" << ewol::GetBoardType() << "] (" << ewol::GetCompilationMode() << ")"); + APPL_INFO(" == > init APPL (START) [" << ewol::getBoardType() << "] (" << ewol::GetCompilationMode() << ")"); - // TODO : Remove this : Move if in the windows properties - _context.SetSize(vec2(800, 600)); + // TODO : remove this : Move if in the windows properties + _context.setSize(vec2(800, 600)); // select internal data for font ... - _context.GetFontDefault().SetUseExternal(true); + _context.getFontDefault().setUseExternal(true); #ifdef __TARGET_OS__Android - _context.GetFontDefault().Set("FreeSerif", 19); + _context.getFontDefault().set("FreeSerif", 19); #else - _context.GetFontDefault().Set("FreeSerif;DejaVuSansMono",14); + _context.getFontDefault().set("FreeSerif;DejaVuSansMono",14); #endif // set the application icon ... - _context.SetIcon("DATA:icon.png"); + _context.setIcon("DATA:icon.png"); // init internal global value - globals::Init(); + globals::init(); // init ALL Singleton : //(void)CTagsManager::getInstance(); - BufferManager::Init(); + BufferManager::init(); // set color and other trucs... - ColorizeManager::Init(); - ColorizeManager::LoadFile( "white" ); - ColorizeManager::DisplayListOfColor(); + ColorizeManager::init(); + ColorizeManager::loadFile( "white" ); + ColorizeManager::displayListOfColor(); - HighlightManager::Init(); + HighlightManager::init(); HighlightManager::loadLanguages(); - cTagsManager::Init(); + cTagsManager::init(); // Request load of the user configuration ... - //ewol::userConfig::Load(); + //ewol::userConfig::load(); char cCurrentPath[FILENAME_MAX]; // get the curent program folder @@ -98,27 +98,27 @@ bool APP_Init(ewol::eContext& _context) return false; } // create the specific windows - _context.SetWindows(basicWindows); + _context.setWindows(basicWindows); // add files APPL_INFO("show list of files : "); bool ctagDetected = false; - for( int32_t iii=0 ; iii<_context.GetCmd().Size(); iii++) { - etk::UString tmpppp = _context.GetCmd().Get(iii); + for( int32_t iii=0 ; iii<_context.getCmd().size(); iii++) { + etk::UString tmpppp = _context.getCmd().Get(iii); if (tmpppp == "-t") { ctagDetected = true; } else if (true == ctagDetected) { APPL_INFO("Load ctag file : \"" << tmpppp << "\"" ); ctagDetected = false; - _context.GetEObjectManager().MultiCast().AnonymousSend(ednMsgCtagsLoadFile, tmpppp); + _context.getEObjectManager().MultiCast().AnonymousSend(ednMsgCtagsLoadFile, tmpppp); } else { APPL_INFO("need load file : \"" << tmpppp << "\"" ); - _context.GetEObjectManager().MultiCast().AnonymousSend(ednMsgOpenFile, tmpppp); + _context.getEObjectManager().MultiCast().AnonymousSend(ednMsgOpenFile, tmpppp); } } - APPL_INFO("==> Init "PROJECT_NAME" (END)"); + APPL_INFO(" == > init "PROJECT_NAME" (END)"); return true; } @@ -128,10 +128,10 @@ bool APP_Init(ewol::eContext& _context) */ void APP_UnInit(ewol::eContext& _context) { - APPL_INFO("==> Un-Init "PROJECT_NAME" (START)"); - ewol::Windows* tmpWindows = _context.GetWindows(); + APPL_INFO(" == > Un-Init "PROJECT_NAME" (START)"); + ewol::Windows* tmpWindows = _context.getWindows(); - _context.SetWindows(NULL); + _context.setWindows(NULL); if (NULL != tmpWindows) { delete(tmpWindows); @@ -147,6 +147,6 @@ void APP_UnInit(ewol::eContext& _context) BufferManager::UnInit(); APPL_INFO("Stop ColorizeManager"); ColorizeManager::UnInit(); - APPL_INFO("==> Un-Init "PROJECT_NAME" (END)"); + APPL_INFO(" == > Un-Init "PROJECT_NAME" (END)"); }