diff --git a/sources/appl/Buffer/Buffer.cpp b/sources/appl/Buffer/Buffer.cpp index 8e7e161..3f9f8cc 100644 --- a/sources/appl/Buffer/Buffer.cpp +++ b/sources/appl/Buffer/Buffer.cpp @@ -11,36 +11,29 @@ #include appl::Buffer::Buffer(void) : - m_cursorPos(0), - m_cursorPreferredCol(-1) -{ + m_cursorPos(0), + m_cursorPreferredCol(-1) { } -bool appl::Buffer::loadFile(const etk::UString& _name) -{ +bool appl::Buffer::loadFile(const etk::UString& _name) { APPL_DEBUG("Load file : '" << _name << "'"); m_fileName = _name; etk::FSNode file(m_fileName); - if (file.Exist() == false) { + if (file.exist() == false) { return false; } - if (true == m_data.DumpFrom(file) ) { + if (true == m_data.dumpFrom(file) ) { return true; } return false; } - - -void appl::Buffer::setFileName(const etk::UString& _name) -{ +void appl::Buffer::setFileName(const etk::UString& _name) { // TODO : ... } - -void appl::Buffer::MoveCursorRight(appl::Buffer::moveMode _mode) -{ +void appl::Buffer::moveCursorRight(appl::Buffer::moveMode _mode) { m_cursorPreferredCol = -1; etk::UniChar value; esize_t nbElement; @@ -62,8 +55,7 @@ void appl::Buffer::MoveCursorRight(appl::Buffer::moveMode _mode) } -void appl::Buffer::MoveCursorLeft(appl::Buffer::moveMode _mode) -{ +void appl::Buffer::moveCursorLeft(appl::Buffer::moveMode _mode) { m_cursorPreferredCol = -1; etk::UniChar value; esize_t nbElement; @@ -84,72 +76,67 @@ void appl::Buffer::MoveCursorLeft(appl::Buffer::moveMode _mode) } } -void appl::Buffer::MoveCursorUp(esize_t _nbLine) -{ +void appl::Buffer::moveCursorUp(esize_t _nbLine) { // find the position of the start of the line. - esize_t lineStartPos = StartLine(m_cursorPos); + esize_t lineStartPos = startLine(m_cursorPos); // check if we can go up ... if (lineStartPos == 0) { return; } // Decide what column to move to, if there's a preferred column use that if (m_cursorPreferredCol < 0) { - m_cursorPreferredCol = CountDispChars(lineStartPos, m_cursorPos); + m_cursorPreferredCol = countDispChars(lineStartPos, m_cursorPos); } EWOL_DEBUG("ploop : " << m_cursorPreferredCol); // get the previous line - esize_t prevLineStartPos = CountBackwardNLines(lineStartPos, _nbLine); + esize_t prevLineStartPos = countBackwardNLines(lineStartPos, _nbLine); //APPL_INFO("Move line UP result : prevLineStartPos=" << prevLineStartPos); // get the display char position - esize_t newPos = CountForwardDispChars(prevLineStartPos, m_cursorPreferredCol); + esize_t newPos = countForwardDispChars(prevLineStartPos, m_cursorPreferredCol); //APPL_INFO("Move to colomn : column=" << column << " newPos=" << newPos); //SetInsertPosition(newPos); m_cursorPos = newPos; } -void appl::Buffer::MoveCursorDown(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() ) { return; } // find the position of the start of the line. - esize_t lineStartPos = StartLine(m_cursorPos); + esize_t lineStartPos = startLine(m_cursorPos); if (m_cursorPreferredCol < 0) { - m_cursorPreferredCol = CountDispChars(lineStartPos, m_cursorPos); + m_cursorPreferredCol = countDispChars(lineStartPos, m_cursorPos); } EWOL_DEBUG("ploop : " << m_cursorPreferredCol); // get the next line : - esize_t nextLineStartPos = CountForwardNLines(lineStartPos, _nbLine); + esize_t nextLineStartPos = countForwardNLines(lineStartPos, _nbLine); //APPL_INFO("Move line DOWN result : nextLineStartPos=" << nextLineStartPos); // get the display char position - esize_t newPos = CountForwardDispChars(nextLineStartPos, m_cursorPreferredCol); + esize_t newPos = countForwardDispChars(nextLineStartPos, m_cursorPreferredCol); //APPL_INFO("Move to colomn : column=" << column << " newPos=" << newPos); //SetInsertPosition(newPos); m_cursorPos = newPos; } -esize_t appl::Buffer::StartLine(esize_t _pos) -{ +esize_t appl::Buffer::startLine(esize_t _pos) { esize_t startPos; - if (false == SearchBack(_pos, etk::UniChar::Return, startPos)) { + if (false == searchBack(_pos, etk::UniChar::Return, startPos)) { return 0; } return startPos + 1; } -esize_t appl::Buffer::EndLine(esize_t _pos) -{ +esize_t appl::Buffer::endLine(esize_t _pos) { esize_t endPos; - if (false == Search(_pos, etk::UniChar::Return, endPos)) { + if (false == search(_pos, etk::UniChar::Return, endPos)) { endPos = m_data.size(); } return endPos; } -bool appl::Buffer::Search(esize_t _pos, const etk::UniChar& _search, esize_t& _result) -{ +bool appl::Buffer::search(esize_t _pos, const etk::UniChar& _search, esize_t& _result) { // move in the string esize_t nbElementBuffer = 0; etk::UniChar value; @@ -167,8 +154,7 @@ bool appl::Buffer::Search(esize_t _pos, const etk::UniChar& _search, esize_t& _r return false; } -bool appl::Buffer::SearchBack(esize_t _pos, const etk::UniChar& _search, esize_t& _result) -{ +bool appl::Buffer::searchBack(esize_t _pos, const etk::UniChar& _search, esize_t& _result) { // move in the string esize_t nbElementBuffer = 0; etk::UniChar value; @@ -185,10 +171,8 @@ bool appl::Buffer::SearchBack(esize_t _pos, const etk::UniChar& _search, esize_t _result = 0; return false; } - - -bool appl::Buffer::onEventEntry(const ewol::EventEntry& _event) // TODO : , vec2 _displaySize) -{ +// TODO : vec2 _displaySize +bool appl::Buffer::onEventEntry(const ewol::EventEntry& _event, ewol::Text& _testDrawer) { //APPL_DEBUG(" event : " << _event); if (_event.getType() == ewol::keyEvent::keyboardChar) { //APPL_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent); @@ -219,13 +203,13 @@ bool appl::Buffer::onEventEntry(const ewol::EventEntry& _event) // TODO : , vec2 } else { // normal adding char ... char output[5]; - int32_t nbElement = _event.getChar().GetUtf8(output); + 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); - m_data.Replace(m_cursorPos, nbElementRemove, (int8_t*)output, nbElement); + m_data.replace(m_cursorPos, nbElementRemove, (int8_t*)output, nbElement); } m_cursorPos += nbElement; } @@ -238,19 +222,19 @@ bool appl::Buffer::onEventEntry(const ewol::EventEntry& _event) // TODO : , vec2 switch(_event.getType()) { case ewol::keyEvent::keyboardLeft: //APPL_INFO("keyEvent : "); - MoveCursorLeft(); + moveCursorLeft(); break; case ewol::keyEvent::keyboardRight: //APPL_INFO("keyEvent : "); - MoveCursorRight(); + moveCursorRight(); break; case ewol::keyEvent::keyboardUp: //APPL_INFO("keyEvent : "); - MoveCursorUp(1); + moveCursorUp(1); break; case ewol::keyEvent::keyboardDown: //APPL_INFO("keyEvent : "); - MoveCursorDown(1); + moveCursorDown(1); break; case ewol::keyEvent::keyboardPageUp: //APPL_INFO("keyEvent : "); @@ -262,11 +246,11 @@ bool appl::Buffer::onEventEntry(const ewol::EventEntry& _event) // TODO : , vec2 break; case ewol::keyEvent::keyboardStart: //APPL_INFO("keyEvent : "); - MoveCursorLeft(moveEnd); + moveCursorLeft(moveEnd); break; case ewol::keyEvent::keyboardEnd: //APPL_INFO("keyEvent : "); - MoveCursorRight(moveEnd); + moveCursorRight(moveEnd); break; default: break; @@ -282,8 +266,7 @@ 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 tmpVal && _pos-iii>0) { --pointerVal; @@ -336,8 +318,7 @@ static const char *ControlCodeTable[32] = { "NUL", "soh", "stx", "etx", "eot", "enq", "ack", "bel", "bs", "ht", "nl", "vt", "np", "cr", "so", "si", "dle", "dc1", "dc2", "dc3", "dc4", "nak", "syn", "etb", "can", "em", "sub", "esc", "fs", "gs", "rs", "us"}; -void appl::Buffer::Expand(esize_t& _indent, const etk::UniChar& _value, etk::UString& _out) const -{ +void appl::Buffer::expand(esize_t& _indent, const etk::UniChar& _value, etk::UString& _out) const { _out.clear(); int32_t tabDist = 4; if (_value == etk::UniChar::Tabulation) { @@ -383,8 +364,7 @@ void appl::Buffer::Expand(esize_t& _indent, const etk::UniChar& _value, etk::USt //APPL_DEBUG("plop : " << _out); } -int32_t appl::Buffer::CountDispChars(esize_t _posStart, esize_t _posEnd) -{ +int32_t appl::Buffer::countDispChars(esize_t _posStart, esize_t _posEnd) { int32_t charCount = 0; etk::UString expanded; esize_t bufferElementSize; @@ -394,7 +374,7 @@ int32_t appl::Buffer::CountDispChars(esize_t _posStart, esize_t _posEnd) // get the element value: bufferElementSize = get(iii, value); //APPL_DEBUG(" get : " << value << " size=" << bufferElementSize); - Expand(charCount, value, expanded); + expand(charCount, value, expanded); charCount += expanded.size(); if (bufferElementSize <= 0) { bufferElementSize = 1; @@ -404,8 +384,7 @@ int32_t appl::Buffer::CountDispChars(esize_t _posStart, esize_t _posEnd) return charCount; } -esize_t appl::Buffer::CountForwardDispChars(esize_t _posStart, int32_t _nChars) -{ +esize_t appl::Buffer::countForwardDispChars(esize_t _posStart, int32_t _nChars) { int32_t charCount = 0; etk::UString expanded; esize_t bufferElementSize; @@ -417,7 +396,7 @@ esize_t appl::Buffer::CountForwardDispChars(esize_t _posStart, int32_t _nChars) if (value == etk::UniChar::Return) { return iii; } - Expand(charCount, value, expanded); + expand(charCount, value, expanded); charCount += expanded.size(); if (bufferElementSize <= 0) { bufferElementSize = 1; @@ -427,8 +406,7 @@ esize_t appl::Buffer::CountForwardDispChars(esize_t _posStart, int32_t _nChars) return iii; } -esize_t appl::Buffer::CountForwardNLines(esize_t _startPos, int32_t _nLines) -{ +esize_t appl::Buffer::countForwardNLines(esize_t _startPos, int32_t _nLines) { if (_nLines <= 0) { return _startPos; } else if (_startPos > m_data.size() ) { @@ -456,8 +434,7 @@ esize_t appl::Buffer::CountForwardNLines(esize_t _startPos, int32_t _nLines) return m_data.size(); } -esize_t appl::Buffer::CountBackwardNLines(esize_t _startPos, int32_t _nLines) -{ +esize_t appl::Buffer::countBackwardNLines(esize_t _startPos, int32_t _nLines) { if (_startPos <= 0) { return 0; } else if (_startPos > m_data.size() ) { diff --git a/sources/appl/Buffer/Buffer.h b/sources/appl/Buffer/Buffer.h index fdbb1ef..f54c1ab 100644 --- a/sources/appl/Buffer/Buffer.h +++ b/sources/appl/Buffer/Buffer.h @@ -16,11 +16,10 @@ #include #include #include +#include -namespace appl -{ - class Buffer : public ewol::EObject - { +namespace appl { + class Buffer : public ewol::EObject { public: Buffer(void); ~Buffer(void) { }; @@ -30,13 +29,17 @@ namespace appl /** * @brief get the curent filename of the Buffer */ - const etk::UString& getFileName(void) { return m_fileName; } + 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,7 +49,8 @@ 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); + // note : We need the text drawer interface due to the fact that the move depend on the text display properties. + bool onEventEntry(const ewol::EventEntry& _event, ewol::Text& _testDrawer); /** * @brief get the next element in the buffer. * @param[in] _pos Position in the buffer @@ -69,7 +73,7 @@ namespace appl * @param[in] _value Current value to transform * @param[out] _out String that represent the curent value to display */ - void Expand(esize_t& _indent, const etk::UniChar& _value, etk::UString& _out) const; + void expand(esize_t& _indent, const etk::UniChar& _value, etk::UString& _out) const; private: enum moveMode { moveLetter, @@ -80,34 +84,34 @@ namespace appl * Move the cursor right in the line (no stop of a new line) * @param[in] _mode Moving mode char, word, ... */ - void MoveCursorRight(moveMode _mode = moveLetter); + void moveCursorRight(moveMode _mode = moveLetter); /** * Move the cursor left in the line (no stop of a new line) * @param[in] _mode Moving mode char, word, ... */ - void MoveCursorLeft(moveMode _mode = moveLetter); + void moveCursorLeft(moveMode _mode = moveLetter); /** * @brief Move the cursor at an other position upper. * @param[in] _nbLine number of up line that might be moved */ - void MoveCursorUp(esize_t _nbLine); + void moveCursorUp(esize_t _nbLine); /** * @brief Move the cursor at an other position under. * @param[in] _nbLine number of down line that might be moved */ - void MoveCursorDown(esize_t _nbLine); + void moveCursorDown(esize_t _nbLine); /** * @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); + esize_t startLine(esize_t _pos); /** * @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. */ - esize_t EndLine(esize_t _pos); + esize_t endLine(esize_t _pos); /** * @brief Search a character in the buffer. * @param[in] _pos Position to start the search of the element. @@ -115,7 +119,7 @@ namespace appl * @param[out] _result Research position. * @return true if pos if fined. */ - bool Search(esize_t _pos, const etk::UniChar& _search, esize_t& _result); + bool search(esize_t _pos, const etk::UniChar& _search, esize_t& _result); /** * @brief Search a character in the buffer in back mode. * @param[in] _pos Position to start the search of the element. @@ -123,7 +127,7 @@ namespace appl * @param[out] _result Research position. * @return true if pos if fined. */ - bool SearchBack(esize_t _pos, const etk::UniChar& _search, esize_t& _result); + bool searchBack(esize_t _pos, const etk::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 @@ -132,28 +136,28 @@ namespace appl * @param[in] _posEnd End position * @return the ID in the buffer of the requested char */ - int32_t CountDispChars(esize_t _posStart, esize_t _posEnd); + int32_t countDispChars(esize_t _posStart, esize_t _posEnd); /** * @brief Return the position of the nth diplaye char * @param[in] _posStart Position of the start * @param[in] _nChars search in the next nChars elements * @return position of the char i the buffer */ - esize_t CountForwardDispChars(esize_t _posStart, int32_t _nChars); + esize_t countForwardDispChars(esize_t _posStart, int32_t _nChars); /** * @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); + esize_t countForwardNLines(esize_t _startPos, int32_t _nLines); /** * @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) * @return position of the starting the line */ - esize_t CountBackwardNLines(esize_t _startPos, int32_t _nLines); + esize_t countBackwardNLines(esize_t _startPos, int32_t _nLines); }; }; diff --git a/sources/appl/Buffer/BufferManager.cpp b/sources/appl/Buffer/BufferManager.cpp index 7ee8ffa..5456bdf 100644 --- a/sources/appl/Buffer/BufferManager.cpp +++ b/sources/appl/Buffer/BufferManager.cpp @@ -14,9 +14,8 @@ #undef __class__ #define __class__ "classBufferManager" - -class classBufferManager: public ewol::EObject -{ +#if 0 +class classBufferManager: public ewol::EObject { public: // Constructeur classBufferManager(void); @@ -30,7 +29,7 @@ class classBufferManager: public ewol::EObject private: // return the ID of the buffer allocated // create a buffer with no element - int32_t Create(void); + int32_t create(void); // open curent filename int32_t open(etk::FSNode &myFile); bool remove(int32_t BufferID); @@ -38,13 +37,13 @@ class classBufferManager: public ewol::EObject 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); + 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 WitchBuffer(int32_t iEmeElement); + int32_t witchBuffer(int32_t iEmeElement); private: @@ -234,22 +233,7 @@ void classBufferManager::onReceiveMessage(const ewol::EMessage& _msg) */ } - - - - - - -/** - * @brief remove all buffer opened - * - * @param[in,out] --- - * - * @return --- - * - */ -void classBufferManager::removeAll(void) -{ +void classBufferManager::removeAll(void) { int32_t i; for (i=0; i= BufferID) { return NULL; @@ -324,9 +295,7 @@ BufferText * classBufferManager::get(int32_t BufferID) return NULL; } - -bool classBufferManager::Exist(int32_t BufferID) -{ +bool classBufferManager::exist(int32_t BufferID) { if (-1 >= BufferID) { return false; } @@ -340,18 +309,14 @@ bool classBufferManager::Exist(int32_t BufferID) return false; } - -bool classBufferManager::Exist(etk::FSNode &myFile ) -{ +bool classBufferManager::exist(etk::FSNode &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++) { @@ -367,14 +332,12 @@ 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) -{ +uint32_t classBufferManager::size(void) { 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; } @@ -427,15 +381,9 @@ bool classBufferManager::remove(int32_t BufferID) } /** - * @brief to get the element 14 in the buffer - * - * @param[in,out] --- - * - * @return --- - * + * @brief to get the element 14 in the buffer */ -int32_t classBufferManager::WitchBuffer(int32_t iEmeElement) -{ +int32_t classBufferManager::witchBuffer(int32_t iEmeElement) { int32_t i; for (i=0; i already exist, just unlink the previous ..."); localManager = NULL; @@ -467,88 +415,106 @@ void BufferManager::init(void) if (NULL == localManager) { EWOL_CRITICAL("Allocation of classBufferManager not done ..."); } + */ } -void BufferManager::UnInit(void) -{ +void BufferManager::unInit(void) { + /* if (NULL == localManager) { 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 ..."); return -1; } return localManager->getSelected(); + */ + return -1; } -BufferText * BufferManager::get(int32_t BufferID) -{ +appl::Buffer * BufferManager::get(int32_t BufferID) { + /* if (NULL == localManager) { EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ..."); return NULL; } return localManager->get(BufferID); + */ + return NULL; } -bool BufferManager::Exist(int32_t BufferID) -{ +bool BufferManager::exist(int32_t BufferID) { + /* if (NULL == localManager) { EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ..."); return false; } - return localManager->Exist(BufferID); + return localManager->exist(BufferID); + */ + return false; } -bool BufferManager::Exist(etk::FSNode &myFile) -{ +bool BufferManager::exist(etk::FSNode &myFile) { + /* if (NULL == localManager) { EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ..."); return false; } - return localManager->Exist(myFile); + return localManager->exist(myFile); + */ + return false; } -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 ..."); return -1; } return localManager->getId(myFile); + */ + return -1; } -uint32_t BufferManager::size(void) -{ +uint32_t BufferManager::size(void) { + /* if (NULL == localManager) { EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ..."); return 0; } return localManager->size(); + */ + return 0; } -uint32_t BufferManager::sizeOpen(void) -{ +uint32_t BufferManager::sizeOpen(void) { + /* if (NULL == localManager) { EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ..."); return 0; } return localManager->sizeOpen(); + */ + return 0; } -int32_t BufferManager::WitchBuffer(int32_t iEmeElement) -{ +int32_t BufferManager::witchBuffer(int32_t iEmeElement) { + /* if (NULL == localManager) { EWOL_ERROR("classBufferManager == > request UnInit, but does not exist ..."); return -1; } - return localManager->WitchBuffer(iEmeElement); + return localManager->witchBuffer(iEmeElement); + */ + return -1; } diff --git a/sources/appl/Buffer/BufferManager.h b/sources/appl/Buffer/BufferManager.h index 23f4cf3..5b7ea63 100644 --- a/sources/appl/Buffer/BufferManager.h +++ b/sources/appl/Buffer/BufferManager.h @@ -9,23 +9,23 @@ #ifndef __BUFFER_MANAGER_H__ #define __BUFFER_MANAGER_H__ -#include +#include #include #include namespace BufferManager { void init(void); - void UnInit(void); + void unInit(void); int32_t getSelected(void); - BufferText* get(int32_t BufferID); - bool Exist(int32_t BufferID); - bool Exist(etk::FSNode &myFile); + appl::Buffer* 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 WitchBuffer(int32_t iEmeElement); + int32_t witchBuffer(int32_t iEmeElement); }; #endif diff --git a/sources/appl/Colorize/ColorizeManager.cpp b/sources/appl/Colorize/ColorizeManager.cpp index b591eb7..02e6faf 100644 --- a/sources/appl/Colorize/ColorizeManager.cpp +++ b/sources/appl/Colorize/ColorizeManager.cpp @@ -16,8 +16,7 @@ #define PFX "ColorizeManager " -class classColorManager: public ewol::EObject -{ +class classColorManager: public ewol::EObject { private: etk::UString m_fileColor; etk::Vector listMyColor; //!< List of ALL Color @@ -26,12 +25,10 @@ class classColorManager: public ewol::EObject public: // Constructeur - classColorManager(void) - { + classColorManager(void) { //ewol::widgetMessageMultiCast::add(getWidgetId(), ednMsgGuiChangeColor); } - ~classColorManager(void) - { + ~classColorManager(void) { delete(errorColor); int32_t i; @@ -46,12 +43,10 @@ class classColorManager: public ewol::EObject 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) { @@ -68,8 +63,7 @@ class classColorManager: public ewol::EObject } public: void loadFile(const etk::UString& _xmlFilename); - Colorize* get(const etk::UString& _colorName) - { + Colorize* get(const etk::UString& _colorName) { int32_t i; for (i=0; igetName() == _colorName) { @@ -80,16 +74,14 @@ 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]; } else { return basicColors[0]; } } - bool Exist(const etk::UString& _colorName) - { + bool exist(const etk::UString& _colorName) { int32_t i; for (i=0; igetName() == _colorName) { @@ -98,8 +90,7 @@ class classColorManager: public ewol::EObject } return false; } - void displayListOfColor(void) - { + void displayListOfColor(void) { int32_t i; APPL_INFO(PFX"List of ALL COLOR : "); for (i=0; igetValue()!="color") { - APPL_ERROR("(l "<getPos()<<") node not suported : \""<GetValue()<<"\" must be [color]"); + APPL_ERROR("(l "<getPos()<<") node not suported : \""<getValue()<<"\" must be [color]"); continue; } //-------------------------------------------------------------------------------------------- @@ -205,7 +195,7 @@ void classColorManager::loadFile(const etk::UString& _xmlFilename) continue; } if (pGuiNode->getValue()!="color") { - APPL_ERROR(PFX"(l "<getPos()<<") node not suported : \""<GetValue()<<"\" must be [color]"); + APPL_ERROR(PFX"(l "<getPos()<<") node not suported : \""<getValue()<<"\" must be [color]"); continue; } //-------------------------------------------------------------------------------------------- @@ -253,8 +243,7 @@ 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 ..."); localManager = NULL; @@ -266,8 +255,7 @@ void ColorizeManager::init(void) } } -void ColorizeManager::UnInit(void) -{ +void ColorizeManager::unInit(void) { if (NULL == localManager) { EWOL_ERROR("ColorizeManager == > request UnInit, but does not exist ..."); return; @@ -276,16 +264,14 @@ void ColorizeManager::UnInit(void) localManager = NULL; } -void ColorizeManager::loadFile(const etk::UString& _xmlFilename) -{ +void ColorizeManager::loadFile(const etk::UString& _xmlFilename) { if (NULL == localManager) { return; } localManager->loadFile(_xmlFilename); } -Colorize* ColorizeManager::get(const etk::UString& _colorName) -{ +Colorize* ColorizeManager::get(const etk::UString& _colorName) { if (NULL == localManager) { return NULL; } @@ -293,8 +279,7 @@ Colorize* ColorizeManager::get(const etk::UString& _colorName) } -etk::Color<>& ColorizeManager::get(basicColor_te _myColor) -{ +etk::Color<>& ColorizeManager::get(basicColor_te _myColor) { static etk::Color<> errorColor; if (NULL == localManager) { return errorColor; @@ -302,16 +287,14 @@ etk::Color<>& ColorizeManager::get(basicColor_te _myColor) return localManager->get(_myColor); } -bool ColorizeManager::Exist(const etk::UString& _colorName) -{ +bool ColorizeManager::exist(const etk::UString& _colorName) { if (NULL == localManager) { return false; } - return localManager->Exist(_colorName); + return localManager->exist(_colorName); } -void ColorizeManager::displayListOfColor(void) -{ +void ColorizeManager::displayListOfColor(void) { if (NULL == localManager) { return; } diff --git a/sources/appl/Colorize/ColorizeManager.h b/sources/appl/Colorize/ColorizeManager.h index 6ba4097..8411ba9 100644 --- a/sources/appl/Colorize/ColorizeManager.h +++ b/sources/appl/Colorize/ColorizeManager.h @@ -36,11 +36,11 @@ typedef enum { namespace ColorizeManager { void init(void); - void UnInit(void); + void unInit(void); void loadFile(const etk::UString& _xmlFilename); Colorize * get(const etk::UString& _colorName); etk::Color<>& get(basicColor_te _myColor); - bool Exist(const etk::UString& _colorName); + bool exist(const etk::UString& _colorName); void displayListOfColor(void); }; diff --git a/sources/appl/Gui/BufferView.cpp b/sources/appl/Gui/BufferView.cpp index 2fd67e6..afa5bbe 100644 --- a/sources/appl/Gui/BufferView.cpp +++ b/sources/appl/Gui/BufferView.cpp @@ -15,50 +15,44 @@ #include #undef __class__ -#define __class__ "BufferView" +#define __class__ "BufferView" - - -static void SortElementList(etk::Vector &list) -{ - etk::Vector tmpList = list; - list.clear(); +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()) { - findPos = jjj+1; - } - } - } - //EWOL_DEBUG("position="<m_bufferName.getNameFile() > _list[jjj]->m_bufferName.getNameFile()) { + findPos = jjj+1; + } + } + //EWOL_DEBUG("position="<isModify(); @@ -89,6 +83,7 @@ void BufferView::onReceiveMessage(const ewol::EMessage& _msg) APPL_ERROR("Allocation error of the tmp buffer list element"); } } + */ } } if (true == globals::OrderTheBufferList() ) { @@ -102,7 +97,7 @@ void BufferView::onReceiveMessage(const ewol::EMessage& _msg) // 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(); @@ -110,29 +105,24 @@ void BufferView::onReceiveMessage(const ewol::EMessage& _msg) } -etk::Color<> BufferView::getBasicBG(void) -{ +etk::Color<> BufferView::getBasicBG(void) { 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) -{ - myTitle = "Buffers : "; +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(); } -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; @@ -140,49 +130,49 @@ bool BufferView::getElement(int32_t colomn, int32_t raw, etk::UString &myTextToW if (m_selectedIdRequested != -1) { m_selectedID = -1; } - if( raw >= 0 - && rawm_bufferName.getNameFile(); + if( _raw >= 0 + && _rawm_bufferName.getNameFile(); - if (true == m_list[raw]->m_isModify) { + 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; } // the buffer change of selection ... - if (m_selectedIdRequested == m_list[raw]->m_bufferID) { - m_selectedID = raw; + if (m_selectedIdRequested == m_list[_raw]->m_bufferID) { + m_selectedID = _raw; // stop searching m_selectedIdRequested = -1; // set the raw visible : setRawVisible(m_selectedID); } - if (m_selectedID == raw) { + if (m_selectedID == _raw) { selectBG = COLOR_LIST_BG_SELECTED; } } else { - myTextToWrite = "ERROR"; + _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 - && rawm_bufferID; - SendMultiCast(ednMsgBufferId, m_list[raw]->m_bufferID); + if (1 == _IdInput && _typeEvent == ewol::keyEvent::statusSingle) { + APPL_INFO("Event on List : IdInput=" << _IdInput << " colomn=" << _colomn << " raw=" << _raw ); + if( _raw >= 0 + && _rawm_bufferID; + sendMultiCast(ednMsgBufferId, m_list[_raw]->m_bufferID); } } markToRedraw(); diff --git a/sources/appl/Gui/BufferView.h b/sources/appl/Gui/BufferView.h index cc05846..43e324e 100644 --- a/sources/appl/Gui/BufferView.h +++ b/sources/appl/Gui/BufferView.h @@ -10,7 +10,6 @@ #define __BUFFER_VIEW_H__ #include -#include #include #include #include @@ -24,11 +23,10 @@ namespace appl etk::FSNode m_bufferName; uint32_t m_bufferID; bool m_isModify; - dataBufferStruct(etk::FSNode& bufferName, int32_t bufferID, bool isModify) : - m_bufferName(bufferName), - m_bufferID(bufferID), - m_isModify(isModify) - { + dataBufferStruct(etk::FSNode& _bufferName, int32_t _bufferID, bool _isModify) : + m_bufferName(_bufferName), + m_bufferID(_bufferID), + m_isModify(_isModify) { }; ~dataBufferStruct(void) { }; @@ -38,9 +36,9 @@ namespace appl class BufferView : public widget::List { private: - int32_t m_selectedIdRequested; - int32_t m_selectedID; - etk::Vector m_list; + int32_t m_selectedIdRequested; + int32_t m_selectedID; + etk::Vector m_list; public: // Constructeur BufferView(void); @@ -55,10 +53,10 @@ class BufferView : public widget::List 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 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 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/MainWindows.cpp b/sources/appl/Gui/MainWindows.cpp index 53e8140..c49f8b2 100644 --- a/sources/appl/Gui/MainWindows.cpp +++ b/sources/appl/Gui/MainWindows.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -55,12 +54,10 @@ namespace appl #include #include -class ParameterAboutGui : public widget::Sizer -{ +class ParameterAboutGui : public widget::Sizer { public : ParameterAboutGui(void) : - widget::Sizer(widget::Sizer::modeVert) - { + widget::Sizer(widget::Sizer::modeVert) { widget::Spacer* mySpacer = NULL; mySpacer = new widget::Spacer(); @@ -102,7 +99,9 @@ class ParameterAboutGui : public widget::Sizer } }; - ~ParameterAboutGui(void) { }; + ~ParameterAboutGui(void) { + + }; }; @@ -111,16 +110,14 @@ const char * l_smoothMin = "tmpEvent_minChange"; const char * l_smoothMax = "tmpEvent_maxChange"; #undef __class__ -#define __class__ "MainWindows" +#define __class__ "MainWindows" -MainWindows::MainWindows(void) -{ +MainWindows::MainWindows(void) { APPL_DEBUG("CREATE WINDOWS ... "); widget::Sizer * mySizerVert = NULL; widget::Sizer * mySizerVert2 = NULL; widget::Sizer * mySizerHori = NULL; //ewol::Button * myButton = NULL; - CodeView * myCodeView = NULL; appl::TextViewer * myTextView = NULL; BufferView * myBufferView = NULL; widget::Menu * myMenu = NULL; @@ -241,40 +238,39 @@ MainWindows::MainWindows(void) // add generic shortcut ... // (shift, control, alt, meta, uniChar_t unicodeValue, const char * generateEventId, etk::UString& data) - ShortCutAdd("ctrl+o", ednMsgGuiOpen, "", true); - ShortCutAdd("ctrl+n", ednMsgGuiNew, "", true); + shortCutAdd("ctrl+o", ednMsgGuiOpen, "", true); + shortCutAdd("ctrl+n", ednMsgGuiNew, "", true); - ShortCutAdd("ctrl+s", ednMsgGuiSave, "current", true); - ShortCutAdd("ctrl+shift+s", ednMsgGuiSave, "All", true); + shortCutAdd("ctrl+s", ednMsgGuiSave, "current", true); + shortCutAdd("ctrl+shift+s", ednMsgGuiSave, "All", true); - ShortCutAdd("ctrl+q", ednMsgGuiClose, "current", true); - ShortCutAdd("ctrl+shift+q", ednMsgGuiClose, "All", true); + shortCutAdd("ctrl+q", ednMsgGuiClose, "current", true); + shortCutAdd("ctrl+shift+q", ednMsgGuiClose, "All", true); - ShortCutAdd("ctrl+z", ednMsgGuiUndo, "", true); - ShortCutAdd("ctrl+shift+z", ednMsgGuiRedo, "", true); + shortCutAdd("ctrl+z", ednMsgGuiUndo, "", true); + shortCutAdd("ctrl+shift+z", ednMsgGuiRedo, "", true); - ShortCutAdd("ctrl+l", ednMsgGuiGotoLine, "???", true); + shortCutAdd("ctrl+l", ednMsgGuiGotoLine, "???", true); - ShortCutAdd("ctrl+f", ednMsgGuiSearch, "", true); - ShortCutAdd("F12", ednMsgGuiReloadShader, "", true); + shortCutAdd("ctrl+f", ednMsgGuiSearch, "", true); + shortCutAdd("F12", ednMsgGuiReloadShader, "", true); - ShortCutAdd("ctrl+d", ednMsgGuiCtags, "Jump", true); + shortCutAdd("ctrl+d", ednMsgGuiCtags, "Jump", true); // Generic event ... - RegisterMultiCast(ednMsgGuiSaveAs); - RegisterMultiCast(ednMsgProperties); - RegisterMultiCast(ednMsgGuiOpen); + registerMultiCast(ednMsgGuiSaveAs); + registerMultiCast(ednMsgProperties); + registerMultiCast(ednMsgGuiOpen); // to update the title ... - RegisterMultiCast(ednMsgBufferState); - RegisterMultiCast(ednMsgBufferId); - RegisterMultiCast(ednMsgGuiReloadShader); + registerMultiCast(ednMsgBufferState); + registerMultiCast(ednMsgBufferId); + registerMultiCast(ednMsgGuiReloadShader); } -MainWindows::~MainWindows(void) -{ +MainWindows::~MainWindows(void) { } @@ -283,28 +279,29 @@ 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); //APPL_INFO("Receive Event from the main windows ... : \"" << eventId << "\" == > data=\"" << data << "\"" ); // open file Section ... if (_msg.getMessage() == ednMsgGuiOpen) { - widget::fileChooser* tmpWidget = new widget::FileChooser(); + widget::FileChooser* tmpWidget = new widget::FileChooser(); tmpWidget->setTitle("Open files ..."); tmpWidget->setValidateLabel("Open"); if (BufferManager::getSelected()!=-1) { - BufferText * myBuffer = BufferManager::get(BufferManager::GetSelected()); + /* + BufferText * myBuffer = BufferManager::get(BufferManager::getSelected()); if (NULL!=myBuffer) { 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()); + sendMultiCast(ednMsgOpenFile, _msg.getData()); } else if (_msg.getMessage() == ednMsgGuiSaveAs) { if (_msg.getData() == "") { APPL_ERROR("Null data for Save As file ... "); @@ -316,11 +313,12 @@ void MainWindows::onReceiveMessage(const ewol::EMessage& _msg) sscanf(_msg.getData().c_str(), "%d", &m_currentSavingAsIdBuffer); } - if (false == BufferManager::Exist(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(); + widget::FileChooser* tmpWidget = new widget::FileChooser(); if (NULL == tmpWidget) { APPL_ERROR("Can not allocate widget == > display might be in error"); } else { @@ -338,6 +336,7 @@ void MainWindows::onReceiveMessage(const ewol::EMessage& _msg) popUpWidgetPush(tmpWidget); tmpWidget->registerOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSaveAs); } + */ } } } else if (_msg.getMessage() == ednEventPopUpFileSaveAs) { @@ -346,11 +345,12 @@ void MainWindows::onReceiveMessage(const ewol::EMessage& _msg) APPL_DEBUG("Request Saving As file : " << tmpData); BufferManager::get(m_currentSavingAsIdBuffer)->setFileName(tmpData); - SendMultiCast(ednMsgGuiSave, m_currentSavingAsIdBuffer); + sendMultiCast(ednMsgGuiSave, m_currentSavingAsIdBuffer); } 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(); @@ -369,6 +369,7 @@ void MainWindows::onReceiveMessage(const ewol::EMessage& _msg) m_widgetLabelFileName->setLabel(""); setTitle("edn"); } + */ return; // TODO : set the Title .... } else if (_msg.getMessage() == ednMsgProperties) { @@ -379,18 +380,18 @@ void MainWindows::onReceiveMessage(const ewol::EMessage& _msg) } else { tmpWidget->setTitle("Properties"); popUpWidgetPush(tmpWidget); - tmpWidget->MenuAddGroup("Editor"); + tmpWidget->menuAddGroup("Editor"); ewol::Widget* tmpSubWidget = new globals::ParameterGlobalsGui(); - tmpWidget->MenuAdd("Editor", "", tmpSubWidget); - tmpWidget->MenuAdd("Font & Color", "", NULL); - tmpWidget->MenuAdd("Highlight", "", NULL); - tmpWidget->MenuAddGroup("General"); - tmpWidget->MenuAdd("Display", "", NULL); + tmpWidget->menuAdd("Editor", "", tmpSubWidget); + tmpWidget->menuAdd("Font & Color", "", NULL); + tmpWidget->menuAdd("Highlight", "", NULL); + tmpWidget->menuAddGroup("General"); + tmpWidget->menuAdd("Display", "", NULL); tmpSubWidget = new ParameterAboutGui(); - tmpWidget->MenuAdd("About", "", tmpSubWidget); + tmpWidget->menuAdd("About", "", tmpSubWidget); } } else if (_msg.getMessage() == ednMsgGuiReloadShader) { - ewol::getContext().getResourcesManager().ReLoadResources(); + ewol::getContext().getResourcesManager().reLoadResources(); ewol::getContext().forceRedrawAll(); } else if (_msg.getMessage() == ednMsgGuiExit) { // TODO ... @@ -399,8 +400,7 @@ void MainWindows::onReceiveMessage(const ewol::EMessage& _msg) return; } -void MainWindows::onObjectRemove(ewol::EObject * _removeObject) -{ +void MainWindows::onObjectRemove(ewol::EObject * _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 b7e7f8a..ebe2b8a 100644 --- a/sources/appl/Gui/MainWindows.h +++ b/sources/appl/Gui/MainWindows.h @@ -12,13 +12,11 @@ #include #include -#include #include #include #include -class MainWindows : public ewol::Windows -{ +class MainWindows : public ewol::Windows { private: int32_t m_currentSavingAsIdBuffer; widget::Label* m_widgetLabelFileName; diff --git a/sources/appl/Gui/Search.cpp b/sources/appl/Gui/Search.cpp index 58d107c..9bee5fa 100644 --- a/sources/appl/Gui/Search.cpp +++ b/sources/appl/Gui/Search.cpp @@ -32,10 +32,9 @@ const char* const l_eventForwardCb = "appl-forward-CheckBox"; const char* const l_eventHideBt = "appl-hide-button"; Search::Search(void) : - widget::Sizer(widget::Sizer::modeHori), - m_searchEntry(NULL), - m_replaceEntry(NULL) -{ + widget::Sizer(widget::Sizer::modeHori), + m_searchEntry(NULL), + m_replaceEntry(NULL) { m_forward = false; // TODO : change the mode of creating interface : /* @@ -180,19 +179,17 @@ Search::Search(void) : subWidgetAdd(myButtonImage); } - RegisterMultiCast(ednMsgGuiSearch); + registerMultiCast(ednMsgGuiSearch); // basicly hiden ... - Hide(); + hide(); } -Search::~Search(void) -{ +Search::~Search(void) { } -void Search::onReceiveMessage(const ewol::EMessage& _msg) -{ +void Search::onReceiveMessage(const ewol::EMessage& _msg) { widget::Sizer::onReceiveMessage(_msg); //APPL_INFO("Search receive message : \"" << eventId << "\" data=\"" << data << "\""); if ( _msg.getMessage() == l_eventSearchEntry) { @@ -200,74 +197,73 @@ void Search::onReceiveMessage(const ewol::EMessage& _msg) } else if ( _msg.getMessage() == l_eventSearchEntryEnter) { SearchData::setSearch(_msg.getData()); if (true == m_forward) { - SendMultiCast(ednMsgGuiFind, "Previous"); + sendMultiCast(ednMsgGuiFind, "Previous"); } else { - SendMultiCast(ednMsgGuiFind, "Next"); + sendMultiCast(ednMsgGuiFind, "Next"); } } else if ( _msg.getMessage() == l_eventReplaceEntry) { SearchData::setReplace(_msg.getData()); } else if ( _msg.getMessage() == l_eventReplaceEntryEnter) { SearchData::setReplace(_msg.getData()); - SendMultiCast(ednMsgGuiReplace, "Normal"); + sendMultiCast(ednMsgGuiReplace, "Normal"); if (true == m_forward) { - SendMultiCast(ednMsgGuiFind, "Previous"); + sendMultiCast(ednMsgGuiFind, "Previous"); } else { - SendMultiCast(ednMsgGuiFind, "Next"); + sendMultiCast(ednMsgGuiFind, "Next"); } } else if ( _msg.getMessage() == l_eventSearchBt) { if (true == m_forward) { - SendMultiCast(ednMsgGuiFind, "Previous"); + sendMultiCast(ednMsgGuiFind, "Previous"); } else { - SendMultiCast(ednMsgGuiFind, "Next"); + sendMultiCast(ednMsgGuiFind, "Next"); } } else if ( _msg.getMessage() == l_eventReplaceBt) { - SendMultiCast(ednMsgGuiReplace, "Normal"); + sendMultiCast(ednMsgGuiReplace, "Normal"); if (true == m_forward) { - SendMultiCast(ednMsgGuiFind, "Previous"); + sendMultiCast(ednMsgGuiFind, "Previous"); } else { - SendMultiCast(ednMsgGuiFind, "Next"); + sendMultiCast(ednMsgGuiFind, "Next"); } } else if ( _msg.getMessage() == l_eventCaseCb) { - if (_msg.getData() == "1") { + if (_msg.getData() == "true") { SearchData::setCase(false); } else { SearchData::setCase(true); } } else if ( _msg.getMessage() == l_eventWrapCb) { - if (_msg.getData() == "1") { + if (_msg.getData() == "true") { SearchData::setWrap(false); } else { SearchData::setWrap(true); } } else if ( _msg.getMessage() == l_eventForwardCb) { - if (_msg.getData() == "1") { + if (_msg.getData() == "true") { m_forward = false; } else { m_forward = true; } } else if ( _msg.getMessage() == l_eventHideBt) { - Hide(); + hide(); } else if ( _msg.getMessage() == ednMsgGuiSearch) { if (true == isHide()) { - Show(); + show(); if (m_searchEntry!= NULL) { m_searchEntry->keepFocus(); } } else { if( (m_searchEntry!=NULL && true == m_searchEntry->getFocus()) || (m_replaceEntry!=NULL && true == m_replaceEntry->getFocus()) ) { - Hide(); + hide(); } else if (m_searchEntry!= NULL) { m_searchEntry->keepFocus(); } else { - Hide(); + hide(); } } } } -void Search::onObjectRemove(ewol::EObject * _removeObject) -{ +void Search::onObjectRemove(ewol::EObject * _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 e2c264f..a881a85 100644 --- a/sources/appl/Gui/Search.h +++ b/sources/appl/Gui/Search.h @@ -16,7 +16,7 @@ class Search : public widget::Sizer { private: - bool m_forward; + bool m_forward; widget::Entry * m_searchEntry; widget::Entry * m_replaceEntry; public: diff --git a/sources/appl/Gui/TagFileList.cpp b/sources/appl/Gui/TagFileList.cpp index d6c1422..770eba2 100644 --- a/sources/appl/Gui/TagFileList.cpp +++ b/sources/appl/Gui/TagFileList.cpp @@ -10,15 +10,13 @@ #include #undef __class__ -#define __class__ "TagFileList" +#define __class__ "TagFileList" extern const char * const applEventCtagsListSelect = "appl-event-ctags-list-select"; extern const char * const applEventCtagsListUnSelect = "appl-event-ctags-list-un-select"; extern const char * const applEventCtagsListValidate = "appl-event-ctags-list-validate"; - -appl::TagFileList::TagFileList(void) -{ +appl::TagFileList::TagFileList(void) { m_selectedLine = -1; addEventId(applEventCtagsListSelect); addEventId(applEventCtagsListValidate); @@ -26,8 +24,7 @@ appl::TagFileList::TagFileList(void) } -appl::TagFileList::~TagFileList(void) -{ +appl::TagFileList::~TagFileList(void) { for (int32_t iii=0; iii &fg, etk::Color<> &bg) { - myTitle = "title"; +bool appl::TagFileList::getTitle(int32_t _colomn, etk::UString& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg) { + _myTitle = "title"; return true; } @@ -53,51 +50,50 @@ 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) { - myTextToWrite = etk::UString(m_list[raw]->fileLine); +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; + _myTextToWrite = m_list[_raw]->filename; } } else { - myTextToWrite = "ERROR"; + _myTextToWrite = "ERROR"; } - fg = etk::color::black; - if (raw % 2) { - if (colomn%2 == 0) { - bg = 0xFFFFFF00; + _fg = etk::color::black; + if (_raw % 2) { + if (_colomn%2 == 0) { + _bg = 0xFFFFFF00; } else { - bg = 0xFFFFFF10; + _bg = 0xFFFFFF10; } } else { - if (colomn%2 == 0) { - bg = 0xBFBFBFFF; + if (_colomn%2 == 0) { + _bg = 0xBFBFBFFF; } else { - bg = 0xCFCFCFFF; + _bg = 0xCFCFCFFF; } } - if (m_selectedLine == raw) { - if (colomn%2 == 0) { - bg = 0x8F8FFFFF; + if (m_selectedLine == _raw) { + if (_colomn%2 == 0) { + _bg = 0x8F8FFFFF; } else { - bg = 0x7F7FFFFF; + _bg = 0x7F7FFFFF; } } return true; }; -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) { +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 (_IdInput == 1) { int32_t previousRaw = m_selectedLine; - if (raw > m_list.size() ) { + if (_raw > m_list.size() ) { m_selectedLine = -1; } else { - m_selectedLine = raw; + m_selectedLine = _raw; } const char * event = applEventCtagsListValidate; if (previousRaw != m_selectedLine) { @@ -106,7 +102,7 @@ bool appl::TagFileList::onItemEvent(int32_t IdInput, ewol::keyEvent::status_te t 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); } @@ -123,11 +119,9 @@ bool appl::TagFileList::onItemEvent(int32_t IdInput, ewol::keyEvent::status_te t * @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) -{ - appl::TagListElement *tmpFile = new appl::TagListElement(file, 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); } diff --git a/sources/appl/Gui/TagFileList.h b/sources/appl/Gui/TagFileList.h index b093bdb..3465529 100644 --- a/sources/appl/Gui/TagFileList.h +++ b/sources/appl/Gui/TagFileList.h @@ -22,11 +22,16 @@ namespace appl { public: etk::UString filename; int32_t fileLine; - TagListElement(etk::UString& file, int32_t line) : filename(file), fileLine(line) {}; - ~TagListElement(void) {}; + TagListElement(etk::UString& _file, int32_t _line) : + filename(_file), + fileLine(_line) { + + }; + ~TagListElement(void) { + + }; }; - class TagFileList : public widget::List - { + class TagFileList : public widget::List { private: int32_t m_selectedLine; etk::Vector m_list; @@ -36,19 +41,21 @@ namespace appl { // 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); + 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); + 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 "appl::TagFileList"; + }; public: /** * @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 db0ddde..d8e4f05 100644 --- a/sources/appl/Gui/TagFileSelection.cpp +++ b/sources/appl/Gui/TagFileSelection.cpp @@ -23,11 +23,11 @@ #undef __class__ -#define __class__ "TagFileSelection" +#define __class__ "TagFileSelection" -extern const char * const applEventctagsSelection = "appl-event-ctags-validate"; -extern const char * const applEventctagsCancel = "appl-event-ctags-cancel"; +extern const char * const applEventctagsSelection = "appl-event-ctags-validate"; +extern const char * const applEventctagsCancel = "appl-event-ctags-cancel"; appl::TagFileSelection::TagFileSelection(void) @@ -54,7 +54,7 @@ appl::TagFileSelection::TagFileSelection(void) if (NULL == mySizerVert) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { - mySizerVert->LockExpand(bvec2(true,true)); + mySizerVert->lockExpand(bvec2(true,true)); // set it in the pop-up-system : setSubWidget(mySizerVert); @@ -124,19 +124,17 @@ appl::TagFileSelection::TagFileSelection(void) } -appl::TagFileSelection::~TagFileSelection(void) -{ +appl::TagFileSelection::~TagFileSelection(void) { } -void appl::TagFileSelection::onReceiveMessage(const ewol::EMessage& _msg) -{ - EWOL_INFO("ctags LIST ... : \"" << _msg.getMessage() << "\" == > data=\"" << _msg.GetData() << "\"" ); +void appl::TagFileSelection::onReceiveMessage(const ewol::EMessage& _msg) { + EWOL_INFO("ctags LIST ... : " << _msg ); if (_msg.getMessage() == applEventctagsSelection) { if (m_eventNamed!="") { generateEventId(applEventctagsSelection, m_eventNamed); // == > Auto remove ... - AutoDestroy(); + autoDestroy(); } } else if (_msg.getMessage() == applEventCtagsListSelect) { m_eventNamed = _msg.getData(); @@ -146,11 +144,11 @@ void appl::TagFileSelection::onReceiveMessage(const ewol::EMessage& _msg) } else if (_msg.getMessage() == applEventCtagsListValidate) { generateEventId(applEventctagsSelection, _msg.getData()); // == > Auto remove ... - AutoDestroy(); + autoDestroy(); } else if (_msg.getMessage() == applEventctagsCancel) { generateEventId(applEventctagsCancel, ""); // == > Auto remove ... - AutoDestroy(); + autoDestroy(); } return; }; @@ -161,15 +159,13 @@ void appl::TagFileSelection::onReceiveMessage(const ewol::EMessage& _msg) * @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); // second step find if in all the elements ... diff --git a/sources/appl/Gui/TagFileSelection.h b/sources/appl/Gui/TagFileSelection.h index 515d338..b444258 100644 --- a/sources/appl/Gui/TagFileSelection.h +++ b/sources/appl/Gui/TagFileSelection.h @@ -17,11 +17,10 @@ extern const char * const applEventctagsSelection; extern const char * const applEventctagsCancel; namespace appl { - class TagFileSelection : public widget::PopUp - { + class TagFileSelection : public widget::PopUp { private: - appl::TagFileList* m_listTag; - etk::UString m_eventNamed; + appl::TagFileList* m_listTag; + etk::UString m_eventNamed; public: TagFileSelection(void); virtual ~TagFileSelection(void); diff --git a/sources/appl/Gui/TextViewer.cpp b/sources/appl/Gui/TextViewer.cpp index 0bd8d38..78a1f61 100644 --- a/sources/appl/Gui/TextViewer.cpp +++ b/sources/appl/Gui/TextViewer.cpp @@ -6,8 +6,6 @@ * @license GPL v3 (see license file) */ -#include - #include #include #include @@ -20,35 +18,34 @@ #include #undef __class__ -#define __class__ "TextViewer" +#define __class__ "TextViewer" appl::TextViewer::TextViewer(const etk::UString& _fontName, int32_t _fontSize) : - m_buffer(NULL), - m_displayText(_fontName, _fontSize), - m_insertMode(false) -{ + m_buffer(NULL), + m_displayText(_fontName, _fontSize), + m_insertMode(false) { setCanHaveFocus(true); - RegisterMultiCast(ednMsgBufferId); - RegisterMultiCast(ednMsgGuiCopy); - RegisterMultiCast(ednMsgGuiPaste); - RegisterMultiCast(ednMsgGuiCut); - RegisterMultiCast(ednMsgGuiRedo); - RegisterMultiCast(ednMsgGuiUndo); - RegisterMultiCast(ednMsgGuiRm); - RegisterMultiCast(ednMsgGuiSelect); - RegisterMultiCast(ednMsgGuiChangeCharset); - RegisterMultiCast(ednMsgGuiFind); - RegisterMultiCast(ednMsgGuiReplace); - RegisterMultiCast(ednMsgGuiGotoLine); + registerMultiCast(ednMsgBufferId); + registerMultiCast(ednMsgGuiCopy); + registerMultiCast(ednMsgGuiPaste); + registerMultiCast(ednMsgGuiCut); + registerMultiCast(ednMsgGuiRedo); + registerMultiCast(ednMsgGuiUndo); + registerMultiCast(ednMsgGuiRm); + registerMultiCast(ednMsgGuiSelect); + registerMultiCast(ednMsgGuiChangeCharset); + registerMultiCast(ednMsgGuiFind); + registerMultiCast(ednMsgGuiReplace); + registerMultiCast(ednMsgGuiGotoLine); setLimitScrolling(0.2); - ShortCutAdd("ctrl+w", ednMsgGuiRm, "Line"); - ShortCutAdd("ctrl+shift+w", ednMsgGuiRm, "Paragraph"); - ShortCutAdd("ctrl+x", ednMsgGuiCut, "STD"); - ShortCutAdd("ctrl+c", ednMsgGuiCopy, "STD"); - ShortCutAdd("ctrl+v", ednMsgGuiPaste, "STD"); - ShortCutAdd("ctrl+a", ednMsgGuiSelect, "ALL"); - ShortCutAdd("ctrl+shift+a", ednMsgGuiSelect, "NONE"); + shortCutAdd("ctrl+w", ednMsgGuiRm, "Line"); + shortCutAdd("ctrl+shift+w", ednMsgGuiRm, "Paragraph"); + shortCutAdd("ctrl+x", ednMsgGuiCut, "STD"); + shortCutAdd("ctrl+c", ednMsgGuiCopy, "STD"); + shortCutAdd("ctrl+v", ednMsgGuiPaste, "STD"); + shortCutAdd("ctrl+a", ednMsgGuiSelect, "ALL"); + shortCutAdd("ctrl+shift+a", ednMsgGuiSelect, "NONE"); // by default we load an example object: @@ -61,34 +58,27 @@ appl::TextViewer::TextViewer(const etk::UString& _fontName, int32_t _fontSize) : } -appl::TextViewer::~TextViewer(void) -{ +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(); } -void appl::TextViewer::onRegenerateDisplay(void) -{ +void appl::TextViewer::onRegenerateDisplay(void) { if (false == needRedraw()) { return; } @@ -157,7 +147,7 @@ void appl::TextViewer::onRegenerateDisplay(void) m_displayText.setPos(positionCurentDisplay); continue; } - m_buffer->Expand(countColomn, currentValue, stringToDisplay); + m_buffer->expand(countColomn, currentValue, stringToDisplay); //APPL_DEBUG("display : '" << currentValue << "' == > '" << stringToDisplay << "'"); //m_displayText.setPos(positionCurentDisplay); for (esize_t kkk=0; kkk manage directly in the buffer - if (m_buffer->onEventEntry(_event) == true) { + if (m_buffer->onEventEntry(_event, m_displayText) == 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()); if (m_buffer != NULL) { @@ -207,42 +193,34 @@ bool appl::TextViewer::onEventInput(const ewol::EventInput& _event) 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(); } -void appl::TextViewer::onReceiveMessage(const ewol::EMessage& _msg) -{ +void appl::TextViewer::onReceiveMessage(const ewol::EMessage& _msg) { // force redraw of the widget markToRedraw(); } - -void appl::TextViewer::onGetFocus(void) -{ - ShowKeyboard(); +void appl::TextViewer::onGetFocus(void) { + showKeyboard(); APPL_INFO("Focus - In"); } - -void appl::TextViewer::onLostFocus(void) -{ - HideKeyboard(); +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 ... } -void appl::TextViewer::setFontName(const etk::UString& _fontName) -{ +void appl::TextViewer::setFontName(const etk::UString& _fontName) { m_displayText.setFontName(_fontName); } diff --git a/sources/appl/Gui/TextViewer.h b/sources/appl/Gui/TextViewer.h index 0d36ba3..628b8cb 100644 --- a/sources/appl/Gui/TextViewer.h +++ b/sources/appl/Gui/TextViewer.h @@ -10,7 +10,6 @@ #define __APPL_TEXT_VIEWER_H__ #include -#include #include #include @@ -18,17 +17,15 @@ #include #include -namespace appl -{ - class TextViewer : public widget::WidgetScrooled - { +namespace appl { + class TextViewer : public widget::WidgetScrooled { public: TextViewer(const etk::UString& _fontName="", int32_t _fontSize=-1); virtual ~TextViewer(void); 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); diff --git a/sources/appl/Highlight/Highlight.cpp b/sources/appl/Highlight/Highlight.cpp index 1d518d1..7df9b5a 100644 --- a/sources/appl/Highlight/Highlight.cpp +++ b/sources/appl/Highlight/Highlight.cpp @@ -16,20 +16,16 @@ #define __class__ "Highlight" -void Highlight::ParseRules(exml::Element* child, etk::Vector &mListPatern, int32_t level) -{ +void Highlight::parseRules(exml::Element* _child, etk::Vector& _mListPatern, int32_t _level) { // Create the patern ... HighlightPattern *myPattern = new HighlightPattern(); // parse under Element - myPattern->ParseRules(child, level); + myPattern->parseRules(_child, _level); // add element in the list - mListPatern.pushBack(myPattern); + _mListPatern.pushBack(myPattern); } - - -Highlight::Highlight(const etk::UString& _xmlFilename) -{ +Highlight::Highlight(const etk::UString& _xmlFilename) { exml::Document doc; if (doc.load(_xmlFilename) == false) { APPL_ERROR(" can not load file XML : " << _xmlFilename); @@ -63,10 +59,10 @@ Highlight::Highlight(const etk::UString& _xmlFilename) continue; } if (passChild->getValue() != "rule") { - APPL_ERROR("(l "<< passChild->getPos() << ") node not suported : \""<< passChild->GetValue() << "\" must be [rule]" ); + APPL_ERROR("(l "<< passChild->getPos() << ") node not suported : \""<< passChild->getValue() << "\" must be [rule]" ); continue; } - ParseRules(passChild, m_listHighlightPass1, level1++); + parseRules(passChild, m_listHighlightPass1, level1++); } } else if (child->getValue() == "pass2") { // get sub Nodes ... @@ -76,19 +72,18 @@ Highlight::Highlight(const etk::UString& _xmlFilename) continue; } if (passChild->getValue() != "rule") { - APPL_ERROR("(l "<< passChild->getPos() << ") node not suported : \""<< passChild->GetValue() << "\" must be [rule]" ); + APPL_ERROR("(l "<< passChild->getPos() << ") node not suported : \""<< passChild->getValue() << "\" must be [rule]" ); continue; } - ParseRules(passChild, m_listHighlightPass2, level2++); + 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]" ); } } } -Highlight::~Highlight(void) -{ +Highlight::~Highlight(void) { int32_t i; // clean all Element for (i=0; i< m_listHighlightPass1.size(); i++) { @@ -103,23 +98,21 @@ Highlight::~Highlight(void) m_listExtentions.clear(); } -void Highlight::ReloadColor(void) -{ +void Highlight::reloadColor(void) { int32_t i; for (i=0; i< m_listHighlightPass1.size(); i++) { if (NULL != m_listHighlightPass1[i]) { - m_listHighlightPass1[i]->ReloadColor(); + m_listHighlightPass1[i]->reloadColor(); } } for (i=0; i< m_listHighlightPass2.size(); i++) { if (NULL != m_listHighlightPass2[i]) { - m_listHighlightPass2[i]->ReloadColor(); + m_listHighlightPass2[i]->reloadColor(); } } } -bool Highlight::hasExtention(const etk::UString& _ext) -{ +bool Highlight::hasExtention(const etk::UString& _ext) { for (int32_t iii=0; iii &metaData, int32_t addingPos, - etk::Buffer &buffer) -{ + etk::Buffer &buffer) { if (0 > addingPos) { addingPos = 0; } @@ -198,7 +188,7 @@ void Highlight::Parse(int32_t start, if (metaData[kkk].beginStart <= resultat.endStop) { // remove element //APPL_INFO("Erase element=" << kkk); - metaData.EraseLen(kkk, kkk+1); + metaData.eraseLen(kkk, kkk+1); // Increase the end of search if (kkk < metaData.size()) { // just befor the end of the next element @@ -233,11 +223,10 @@ void Highlight::Parse(int32_t start, * @brief second pass of the hightlight * */ -void Highlight::Parse2(int32_t start, +void Highlight::parse2(int32_t start, int32_t stop, etk::Vector &metaData, - etk::Buffer &buffer) -{ + etk::Buffer &buffer) { //APPL_DEBUG("Parse element 0 => " << m_listHighlightPass2.size() << " == > position search: (" << start << "," << stop << ")" ); int32_t elementStart = start; int32_t elementStop = stop; diff --git a/sources/appl/Highlight/Highlight.h b/sources/appl/Highlight/Highlight.h index a68e462..90d17d2 100644 --- a/sources/appl/Highlight/Highlight.h +++ b/sources/appl/Highlight/Highlight.h @@ -14,14 +14,13 @@ class Highlight; class HighlightPattern; extern "C" { - typedef struct - { - int32_t beginStart; - int32_t beginStop; - int32_t endStart; - int32_t endStop; - bool notEnded; - HighlightPattern * patern; // pointer on class : + typedef struct { + int32_t beginStart; + int32_t beginStop; + int32_t endStart; + int32_t endStop; + bool notEnded; + HighlightPattern* patern; // pointer on class : } colorInformation_ts; } @@ -39,18 +38,18 @@ class Highlight { bool hasExtention(const etk::UString& _ext); bool fileNameCompatible(etk::FSNode &_fileName); void display(void); - void ReloadColor(void); - void Parse(int32_t start, + void reloadColor(void); + void parse(int32_t start, int32_t stop, etk::Vector &metaData, int32_t addingPos, etk::Buffer &buffer); - void Parse2(int32_t start, + void parse2(int32_t start, int32_t stop, etk::Vector &metaData, etk::Buffer &buffer); private: - void ParseRules(exml::Element* child, etk::Vector &mListPatern, int32_t level); + 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) diff --git a/sources/appl/Highlight/HighlightManager.cpp b/sources/appl/Highlight/HighlightManager.cpp index 15c02d7..c42a3bb 100644 --- a/sources/appl/Highlight/HighlightManager.cpp +++ b/sources/appl/Highlight/HighlightManager.cpp @@ -13,12 +13,11 @@ #include #undef __class__ -#define __class__ "HighlightManager" +#define __class__ "HighlightManager" -class localClassHighlightManager: public ewol::EObject -{ +class localClassHighlightManager: public ewol::EObject { private: - etk::Vector listHighlight; //!< List of ALL hightlight modules + etk::Vector listHighlight; //!< List of ALL hightlight modules public: // Constructeur localClassHighlightManager(void) { @@ -38,14 +37,12 @@ class localClassHighlightManager: public ewol::EObject }; // 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) { @@ -61,31 +58,27 @@ 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]; } } return NULL; } - bool Exist(etk::FSNode &fileName) - { - if (NULL != get(fileName) ) { + bool exist(etk::FSNode& _fileName) { + if (NULL != get(_fileName) ) { return true; } return false; } - - void loadLanguages(void) - { + void loadLanguages(void) { etk::FSNode myFile("DATA:languages/"); // get the subfolder list : - etk::Vector list = myFile.FolderGetSubList(false, true, false,false); + etk::Vector list = myFile.folderGetSubList(false, true, false,false); for ( int32_t iii=0 ; iiigetNodeType() == etk::FSN_FOLDER) { @@ -98,15 +91,12 @@ class localClassHighlightManager: public ewol::EObject } //myHightline->display(); } - }; static localClassHighlightManager * localManager = NULL; - -void HighlightManager::init(void) -{ +void HighlightManager::init(void) { if (NULL != localManager) { APPL_ERROR("HighlightManager == > already exist, just unlink the previous ..."); localManager = NULL; @@ -118,8 +108,7 @@ void HighlightManager::init(void) } } -void HighlightManager::UnInit(void) -{ +void HighlightManager::unInit(void) { if (NULL == localManager) { APPL_ERROR("HighlightManager == > request UnInit, but does not exist ..."); return; @@ -128,28 +117,25 @@ void HighlightManager::UnInit(void) localManager = NULL; } -void HighlightManager::loadLanguages(void) -{ +void HighlightManager::loadLanguages(void) { if (NULL == localManager) { return; } 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) -{ +bool HighlightManager::exist(etk::FSNode& _fileName) { if (NULL == localManager) { return false; } - return localManager->Exist(fileName); + return localManager->exist(_fileName); } diff --git a/sources/appl/Highlight/HighlightManager.h b/sources/appl/Highlight/HighlightManager.h index 9fcb59a..e1654bc 100644 --- a/sources/appl/Highlight/HighlightManager.h +++ b/sources/appl/Highlight/HighlightManager.h @@ -16,11 +16,11 @@ #include namespace HighlightManager{ - void init(void); - void UnInit(void); - void loadLanguages(void); + void init(void); + void unInit(void); + void loadLanguages(void); Highlight* get(etk::FSNode &fileName); - bool Exist(etk::FSNode &fileName); + bool exist(etk::FSNode &fileName); }; diff --git a/sources/appl/Highlight/HighlightPattern.cpp b/sources/appl/Highlight/HighlightPattern.cpp index 3e52e43..86bad6a 100644 --- a/sources/appl/Highlight/HighlightPattern.cpp +++ b/sources/appl/Highlight/HighlightPattern.cpp @@ -11,14 +11,10 @@ #include #include - #undef __class__ -#define __class__ "HighlightPattern" +#define __class__ "HighlightPattern" - - -HighlightPattern::HighlightPattern(void) -{ +HighlightPattern::HighlightPattern(void) { m_haveStopPatern = false; m_multiline = false; m_color = ColorizeManager::get("normal"); @@ -27,64 +23,46 @@ HighlightPattern::HighlightPattern(void) m_escapeChar = 0; } -HighlightPattern::~HighlightPattern(void) -{ +HighlightPattern::~HighlightPattern(void) { delete(m_regExpStart); delete(m_regExpStop); } -void HighlightPattern::setPaternStart(etk::UString ®Exp) -{ - m_regExpStart->setRegExp(regExp); +void HighlightPattern::setPaternStart(etk::UString& _regExp) { + m_regExpStart->setRegExp(_regExp); } -void HighlightPattern::setPaternStop(etk::UString ®Exp) -{ - if (regExp.size() != 0) { - m_regExpStop->setRegExp(regExp); +void HighlightPattern::setPaternStop(etk::UString& _regExp) { + if (_regExp.size() != 0) { + m_regExpStop->setRegExp(_regExp); m_haveStopPatern = true; } else { m_haveStopPatern = false; } } -void HighlightPattern::setEscapeChar(etk::UString &EscapeChar) -{ - if (EscapeChar.size()>0) { - m_escapeChar = EscapeChar[0]; +void HighlightPattern::setEscapeChar(etk::UString& _EscapeChar) { + if (_EscapeChar.size()>0) { + m_escapeChar = _EscapeChar[0]; } else { m_escapeChar = 0; } } - -void HighlightPattern::setColor(etk::UString &colorName) -{ - m_colorName = colorName; +void HighlightPattern::setColor(etk::UString& _colorName) { + m_colorName = _colorName; m_color = ColorizeManager::get(m_colorName); } -bool HighlightPattern::isEnable(void) -{ +bool HighlightPattern::isEnable(void) { return true; } - -void HighlightPattern::ReloadColor(void) -{ +void HighlightPattern::reloadColor(void) { m_color = ColorizeManager::get(m_colorName); } -/** - * @brief - * - * @param[in,out] - * - * @eturn - * - */ -void HighlightPattern::display(void) -{ +void HighlightPattern::display(void) { /* APPL_INFO("patern : \"" << m_paternName << "\" level=" << m_level ); APPL_INFO(" == > colorName \"" << m_colorName << "\""); @@ -107,8 +85,8 @@ void HighlightPattern::display(void) m_subPatern[i]->display(); } } -void HighlightPattern::ParseRules(exml::Element *child, int32_t level) -{ + +void HighlightPattern::parseRules(exml::Element *child, int32_t level) { //-------------------------------------------------------------------------------------------- /* @@ -191,8 +169,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; resultat.beginStop = -1; @@ -203,22 +180,22 @@ resultFind_te HighlightPattern::find(int32_t start, int32_t stop, colorInformati // when we have only one element : if (false == m_haveStopPatern) { - if (true == m_regExpStart->ProcessOneElement(buffer, start, stop)) { - resultat.beginStart = m_regExpStart->Start(); - resultat.beginStop = m_regExpStart->Stop(); - resultat.endStart = m_regExpStart->Start(); - resultat.endStop = m_regExpStart->Stop(); + if (true == m_regExpStart->processOneElement(buffer, start, stop)) { + resultat.beginStart = m_regExpStart->start(); + resultat.beginStop = m_regExpStart->stop(); + resultat.endStart = m_regExpStart->start(); + resultat.endStop = m_regExpStart->stop(); return HLP_FIND_OK; } //APPL_DEBUG("NOT find hightlightpatern ..."); } else { // try while we find the first element - if (true == m_regExpStart->ProcessOneElement(buffer, start, stop, m_escapeChar)) { - resultat.beginStart = m_regExpStart->Start(); - resultat.beginStop = m_regExpStart->Stop(); - if (true == m_regExpStop->Process(buffer, resultat.beginStop, stop, m_escapeChar)) { - resultat.endStart = m_regExpStop->Start(); - resultat.endStop = m_regExpStop->Stop(); + if (true == m_regExpStart->processOneElement(buffer, start, stop, m_escapeChar)) { + resultat.beginStart = m_regExpStart->start(); + resultat.beginStop = m_regExpStart->stop(); + if (true == m_regExpStop->process(buffer, resultat.beginStop, stop, m_escapeChar)) { + resultat.endStart = m_regExpStop->start(); + resultat.endStop = m_regExpStop->stop(); return HLP_FIND_OK; } else { resultat.endStart = stop+1; diff --git a/sources/appl/Highlight/HighlightPattern.h b/sources/appl/Highlight/HighlightPattern.h index 7b378ba..e9ac82f 100644 --- a/sources/appl/Highlight/HighlightPattern.h +++ b/sources/appl/Highlight/HighlightPattern.h @@ -26,7 +26,6 @@ typedef enum { HLP_FIND_OK_NO_END, }resultFind_te; -class HighlightPattern; class HighlightPattern { public: @@ -34,38 +33,50 @@ 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& _regExp); + void setPaternStop(etk::UString& _regExp); + 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; }; - void ParseRules(exml::Element *child, int32_t 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; + }; + void parseRules(exml::Element* _child, int32_t _level); - void ReloadColor(void); + void reloadColor(void); private: - 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 - etk::RegExp * m_regExpStart; //!< Start of Regular expression - etk::RegExp * m_regExpStop; //!< Stop of Regular Expression - bool m_haveStopPatern; //!< Stop patern presence - bool m_multiline; //!< The patern is multiline - etk::UniChar m_escapeChar; //!< Escape char to prevent exeit of patern .... - etk::Vector m_subPatern; //!< Under patern of this one -// etk::Vector m_subColor; //!< Under Color in the start RegExp ... + 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 + etk::RegExp* m_regExpStart; //!< Start of Regular expression + etk::RegExp* m_regExpStop; //!< Stop of Regular Expression + bool m_haveStopPatern; //!< Stop patern presence + bool m_multiline; //!< The patern is multiline + etk::UniChar m_escapeChar; //!< Escape char to prevent exeit of patern .... + etk::Vector m_subPatern; //!< Under patern of this one +// etk::Vector m_subColor; //!< Under Color in the start RegExp ... }; #endif diff --git a/sources/appl/ctags/CTagsManager.cpp b/sources/appl/ctags/CTagsManager.cpp index 1d57257..f96d264 100644 --- a/sources/appl/ctags/CTagsManager.cpp +++ b/sources/appl/ctags/CTagsManager.cpp @@ -18,25 +18,23 @@ // TODO : The line ID is no more stored in the file system (FSNode) ... #undef __class__ -#define __class__ "CTagsManager" +#define __class__ "CTagsManager" -class CTagsManager: public ewol::EObject -{ +class CTagsManager: public ewol::EObject { public: // Constructeur CTagsManager(void); ~CTagsManager(void); - const char * const getObjectType(void) - { + const char * const getObjectType(void) { return "CTagsManager"; }; void onReceiveMessage(const ewol::EMessage& _msg); int32_t m_currentSelectedID; void loadTagFile(void); - int32_t MultipleJump(void); - void JumpTo(void); + int32_t multipleJump(void); + void jumpTo(void); void printTag(const tagEntry *entry); etk::UString getFolder(etk::UString &inputString); etk::UString m_tagFolderBase; @@ -45,12 +43,11 @@ class CTagsManager: public ewol::EObject // history system int32_t m_historyPos; etk::Vector m_historyList; - void RegisterHistory(void); + void registerHistory(void); }; 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 ...)"); @@ -60,8 +57,7 @@ void cTagsManager::init(void) EWOL_ERROR("Ctags manager error to instanciate ..."); } } -void cTagsManager::UnInit(void) -{ +void cTagsManager::unInit(void) { if (NULL != s_elementPointer) { delete(s_elementPointer); s_elementPointer = NULL; @@ -70,38 +66,18 @@ void cTagsManager::UnInit(void) } } - - -/** - * @brief - * - * @param[in,out] --- - * - * @return --- - * - */ -CTagsManager::CTagsManager(void) -{ +CTagsManager::CTagsManager(void) { m_tagFilename = ""; m_tagFolderBase = ""; m_ctagFile = NULL; m_historyPos = 0; - RegisterMultiCast(ednMsgGuiCtags); - RegisterMultiCast(ednMsgBufferId); - RegisterMultiCast(ednMsgCtagsLoadFile); + registerMultiCast(ednMsgGuiCtags); + registerMultiCast(ednMsgBufferId); + registerMultiCast(ednMsgCtagsLoadFile); EWOL_INFO("Ctags manager (INIT)"); } -/** - * @brief - * - * @param[in,out] --- - * - * @return --- - * - */ -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++) { @@ -113,8 +89,7 @@ CTagsManager::~CTagsManager(void) 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) { //m_currentSelectedID = dataID; @@ -129,7 +104,7 @@ void CTagsManager::onReceiveMessage(const ewol::EMessage& _msg) } 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"); } else { @@ -142,12 +117,12 @@ void CTagsManager::onReceiveMessage(const ewol::EMessage& _msg) APPL_INFO("Request re-load ctag file"); loadTagFile(); } else if (_msg.getData() == "Jump") { - JumpTo(); + 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()); + sendMultiCast(ednMsgOpenFile, m_historyList[id]->getName() ); + sendMultiCast(ednMsgGuiGotoLine, 0);// TODO : m_historyList[id]->getLineNumber()); // remove element .... delete(m_historyList[id]); m_historyList[id]=NULL; @@ -158,22 +133,20 @@ void CTagsManager::onReceiveMessage(const ewol::EMessage& _msg) } } else if (_msg.getMessage() == applEventctagsSelection) { // save the current file in the history - RegisterHistory(); + registerHistory(); // parse the input data char tmp[4096]; int32_t lineID; sscanf(_msg.getData().c_str(), "%d:%s", &lineID, tmp); // generate envents - SendMultiCast(ednMsgOpenFile, tmp); - SendMultiCast(ednMsgGuiGotoLine, lineID - 1); + sendMultiCast(ednMsgOpenFile, tmp); + sendMultiCast(ednMsgGuiGotoLine, lineID - 1); } } -void CTagsManager::loadTagFile(void) -{ +void CTagsManager::loadTagFile(void) { tagFileInfo info; - // close previous tag file if (NULL != m_ctagFile) { tagsClose(m_ctagFile); @@ -192,11 +165,10 @@ void CTagsManager::loadTagFile(void) } } - -void CTagsManager::RegisterHistory(void) -{ +void CTagsManager::registerHistory(void) { APPL_INFO("save curent filename and position : "); int32_t currentSelected = BufferManager::getSelected(); + /* BufferText* tmpBuf = BufferManager::get(currentSelected); if (NULL != tmpBuf) { etk::FSNode * bufferFilename = new etk::FSNode(); @@ -204,11 +176,10 @@ void CTagsManager::RegisterHistory(void) // TODO : bufferFilename->setLineNumber(tmpBuf->getCurrentLine()); m_historyList.pushBack(bufferFilename); } + */ } - -void CTagsManager::JumpTo(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); @@ -246,10 +217,10 @@ void CTagsManager::JumpTo(void) tmpWidget->registerOnEvent(this, applEventctagsSelection); } } else { - RegisterHistory(); + registerHistory(); APPL_INFO(" OPEN the TAG file Destination : " << tmpFile ); - SendMultiCast(ednMsgOpenFile, myfile.getName()); - SendMultiCast(ednMsgGuiGotoLine, lineID - 1); + sendMultiCast(ednMsgOpenFile, myfile.getName()); + sendMultiCast(ednMsgGuiGotoLine, lineID - 1); } } else { APPL_INFO("no tag find ..."); @@ -258,8 +229,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 << "\" at line="<< (int32_t)entry->address.lineNumber); diff --git a/sources/appl/ctags/CTagsManager.h b/sources/appl/ctags/CTagsManager.h index 2151ec5..667afb7 100644 --- a/sources/appl/ctags/CTagsManager.h +++ b/sources/appl/ctags/CTagsManager.h @@ -16,10 +16,9 @@ #define MAX_REG_EXP_SEARCH (1024) -namespace cTagsManager -{ +namespace cTagsManager { void init(void); - void UnInit(void); + void unInit(void); }; diff --git a/sources/appl/global.cpp b/sources/appl/global.cpp index 85bddf5..9e735dc 100644 --- a/sources/appl/global.cpp +++ b/sources/appl/global.cpp @@ -16,10 +16,9 @@ //#include #undef __class__ -#define __class__ "globals" +#define __class__ "globals" -class myParamGlobal : public ewol::EObject -{ +class myParamGlobal : public ewol::EObject { public: static const char * const configEOL; static const char * const configAutoIndent; @@ -44,8 +43,7 @@ class myParamGlobal : public ewol::EObject 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(); @@ -65,8 +63,7 @@ class myParamGlobal : public ewol::EObject } 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 ...) if (_config == configEOL) { if (true == m_displayEOL) { @@ -109,90 +106,69 @@ const char * const myParamGlobal::configAutoIndent = "auto-indent"; const char * const myParamGlobal::configShowTabChar = "display-tab"; const char * const myParamGlobal::configShowSpaceChar = "display-space"; -static myParamGlobal& l_obj(void) -{ +static myParamGlobal& l_obj(void) { static myParamGlobal s_obj; return s_obj; } - - -void globals::init(void) -{ +void globals::init(void) { //ewol::userConfig::addUserConfig(&l_obj()); } -void globals::UnInit(void) -{ +void globals::UnInit(void) { // nothing to do ... //ewol::userConfig::RmUserConfig(&l_obj()); } - // ----------------------------------------------------------- -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) -{ - l_obj().m_displaySpaceChar = 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) -{ - l_obj().m_displayTabChar = 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) -{ - l_obj().m_AutoIndent = newVal; +void globals::setAutoIndent(bool _newVal) { + l_obj().m_AutoIndent = _newVal; } // ----------------------------------------------------------- - - -bool globals::OrderTheBufferList(void) -{ +bool globals::OrderTheBufferList(void) { return true; } // ----------------------------------------------------------- - - -int32_t globals::getNbColoneBorder(void) -{ +int32_t globals::getNbColoneBorder(void) { return 6; } -int32_t globals::getNbLineBorder(void) -{ +int32_t globals::getNbLineBorder(void) { return 3; } @@ -206,8 +182,7 @@ static const char * const l_changeEndOfLine = "edn-event-change-endOfLine"; static const char * const l_changeRounded = "edn-event-change-rounded"; globals::ParameterGlobalsGui::ParameterGlobalsGui(void) : - widget::Sizer(widget::Sizer::modeVert) -{ + widget::Sizer(widget::Sizer::modeVert) { widget::CheckBox* myCheckbox = NULL; widget::Spacer* mySpacer = NULL; @@ -265,14 +240,12 @@ globals::ParameterGlobalsGui::ParameterGlobalsGui(void) : } } -globals::ParameterGlobalsGui::~ParameterGlobalsGui(void) -{ +globals::ParameterGlobalsGui::~ParameterGlobalsGui(void) { } -void globals::ParameterGlobalsGui::onReceiveMessage(const ewol::EMessage& _msg) -{ +void globals::ParameterGlobalsGui::onReceiveMessage(const ewol::EMessage& _msg) { widget::Sizer::onReceiveMessage(_msg); if (_msg.getMessage() == l_changeEndOfLine) { @@ -306,7 +279,7 @@ void globals::ParameterGlobalsGui::onReceiveMessage(const ewol::EMessage& _msg) etk::theme::setName("GUI", "default");; } // Reload shaders and graphic system ... - ewol::getContext().getResourcesManager().ReLoadResources(); + ewol::getContext().getResourcesManager().reLoadResources(); ewol::getContext().forceRedrawAll(); } diff --git a/sources/appl/global.h b/sources/appl/global.h index ead6843..79ab360 100644 --- a/sources/appl/global.h +++ b/sources/appl/global.h @@ -17,27 +17,26 @@ namespace globals { void init(void); void UnInit(void); - int32_t getNbColoneBorder(void); - int32_t getNbLineBorder(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); + void init2(void); - bool OrderTheBufferList(void); + bool OrderTheBufferList(void); - class ParameterGlobalsGui : public widget::Sizer - { + class ParameterGlobalsGui : public widget::Sizer { public : ParameterGlobalsGui(void); ~ParameterGlobalsGui(void); diff --git a/sources/appl/init.cpp b/sources/appl/init.cpp index b8d71eb..4027206 100644 --- a/sources/appl/init.cpp +++ b/sources/appl/init.cpp @@ -38,7 +38,7 @@ int main(int _argc, const char *_argv[]) { // only one things to do: - return ewol::Run(_argc, _argv); + return ewol::run(_argc, _argv); } @@ -47,7 +47,7 @@ int main(int _argc, const char *_argv[]) */ 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)); @@ -94,7 +94,7 @@ bool APP_Init(ewol::eContext& _context) if (NULL == basicWindows) { APPL_ERROR("Can not allocate the basic windows"); - _context.Stop(); + _context.stop(); return false; } // create the specific windows @@ -105,16 +105,16 @@ bool APP_Init(ewol::eContext& _context) 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); + 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); } } @@ -138,15 +138,15 @@ void APP_UnInit(ewol::eContext& _context) tmpWindows = NULL; } - cTagsManager::UnInit(); + cTagsManager::unInit(); APPL_INFO("Stop Hightlight"); - HighlightManager::UnInit(); + HighlightManager::unInit(); //Kill all singleton APPL_INFO("Stop BufferManager"); - BufferManager::UnInit(); + BufferManager::unInit(); APPL_INFO("Stop ColorizeManager"); - ColorizeManager::UnInit(); + ColorizeManager::unInit(); APPL_INFO(" == > Un-Init "PROJECT_NAME" (END)"); } diff --git a/sources/lutin_edn.py b/sources/lutin_edn.py index 72b8bae..cd5e67f 100755 --- a/sources/lutin_edn.py +++ b/sources/lutin_edn.py @@ -20,7 +20,6 @@ def Create(target): # Gui: myModule.AddSrcFile([ 'appl/Gui/BufferView.cpp', - 'appl/Gui/CodeView.cpp', 'appl/Gui/TextViewer.cpp', 'appl/Gui/MainWindows.cpp', 'appl/Gui/Search.cpp', @@ -31,12 +30,6 @@ def Create(target): # All needed for the buffer management : myModule.AddSrcFile([ 'appl/Buffer/Buffer.cpp', - 'appl/Buffer/EdnBuf/EdnBuf.cpp', - 'appl/Buffer/EdnBuf/EdnBuf_HighLight.cpp', - 'appl/Buffer/EdnBuf/EdnBuf_History.cpp', - 'appl/Buffer/EdnBuf/EdnBuf_Selection.cpp', - 'appl/Buffer/EdnBuf/EdnBufHistory.cpp', - 'appl/Buffer/BufferText.cpp', 'appl/Buffer/BufferManager.cpp']) # Generic color management for the text editor :