From a196c615bfa54b42cba69ac8be5ca521c4a902cc Mon Sep 17 00:00:00 2001 From: Edouard Dupin Date: Mon, 8 Aug 2011 14:06:11 +0200 Subject: [PATCH] Remove std::vector and std::string from the sources for reson of portability --- Sources/Buffer/BufferText.h | 2 - Sources/Colorize/ColorizeManager.cpp | 21 +++- Sources/Colorize/ColorizeManager.h | 25 ++--- Sources/CustumWidget/BufferView/BufferView.h | 2 - .../MainAreaView/MainAreaView.cpp | 3 +- Sources/GuiTools/Search/Search.h | 2 - Sources/Highlight/Highlight.cpp | 72 +++++++----- Sources/Highlight/Highlight.h | 19 ++-- Sources/Highlight/HighlightManager.cpp | 25 +++-- Sources/Highlight/HighlightManager.h | 4 +- Sources/tools/Display/Display.h | 8 +- Sources/tools/EdnBuf/EdnBuf.h | 106 +++++++++--------- Sources/tools/EdnBuf/EdnBuf_HighLight.cpp | 52 ++++----- Sources/tools/globals/tools_globals.cpp | 36 ------ Sources/tools/globals/tools_globals.h | 43 ++++--- 15 files changed, 199 insertions(+), 221 deletions(-) diff --git a/Sources/Buffer/BufferText.h b/Sources/Buffer/BufferText.h index 2fc3ae5..85bd5de 100644 --- a/Sources/Buffer/BufferText.h +++ b/Sources/Buffer/BufferText.h @@ -26,8 +26,6 @@ #ifndef __BUFFER_TEXT_H__ #define __BUFFER_TEXT_H__ -#include -#include #include "ColorizeManager.h" #include "Buffer.h" #include "EdnBuf.h" diff --git a/Sources/Colorize/ColorizeManager.cpp b/Sources/Colorize/ColorizeManager.cpp index a55d27e..5b2073c 100644 --- a/Sources/Colorize/ColorizeManager.cpp +++ b/Sources/Colorize/ColorizeManager.cpp @@ -37,8 +37,17 @@ ColorizeManager::ColorizeManager(void) ColorizeManager::~ColorizeManager(void) { delete(errorColor); - // TODO : delete all color previously - listMyColor.clear(); + + uint32_t i; + // clean all Element + for (i=0; i< listMyColor.Size(); i++) { + if (NULL != listMyColor[i]) { + delete(listMyColor[i]); + listMyColor[i] = NULL; + } + } + // clear the compleate list + listMyColor.Clear(); } @@ -181,7 +190,7 @@ void ColorizeManager::LoadFile(const char * xmlFilename) myNewColor->SetItalic(true); } } - listMyColor.push_back(myNewColor); + listMyColor.PushBack(myNewColor); } else { EDN_ERROR(PFX"(l "<Row()<<") node not suported : \""<Value()<<"\" must be [color]"); } @@ -199,7 +208,7 @@ void ColorizeManager::LoadFile(const char * xmlFilename) Colorize *ColorizeManager::Get(const char *colorName) { uint32_t i; - for (i=0; iGetName(); if (elementName == colorName) { return listMyColor[i]; @@ -228,7 +237,7 @@ color_ts & ColorizeManager::Get(basicColor_te myColor) bool ColorizeManager::Exist(const char *colorName) { uint32_t i; - for (i=0; iGetName(); if (elementName == colorName) { return true; @@ -245,7 +254,7 @@ void ColorizeManager::DisplayListOfColor(void) { uint32_t i; EDN_INFO(PFX"List of ALL COLOR : "); - for (i=0; iGetName(); //EDN_INFO(i << " : \"" << elementName.c_str() << "\"" ); listMyColor[i]->Display(i); diff --git a/Sources/Colorize/ColorizeManager.h b/Sources/Colorize/ColorizeManager.h index cca6f34..02ef292 100644 --- a/Sources/Colorize/ColorizeManager.h +++ b/Sources/Colorize/ColorizeManager.h @@ -27,9 +27,8 @@ #define __COLORIZE_MANAGER_H__ #include "Singleton.h" -#include -#include #include "Colorize.h" +#include "Edn.h" typedef enum { // BASIC color for codeViewer @@ -59,19 +58,19 @@ class ColorizeManager: public Singleton ColorizeManager(void); ~ColorizeManager(void); public: - void LoadFile(Edn::String &xmlFilename); - void LoadFile(const char * xmlFilename); - Colorize * Get(const char *colorName); - Colorize * Get(Edn::String &colorName); - color_ts & Get(basicColor_te myColor); - bool Exist(Edn::String &colorName); - bool Exist(const char *colorName); - void DisplayListOfColor(void); + void LoadFile(Edn::String &xmlFilename); + void LoadFile(const char * xmlFilename); + Colorize * Get(const char *colorName); + Colorize * Get(Edn::String &colorName); + color_ts & Get(basicColor_te myColor); + bool Exist(Edn::String &colorName); + bool Exist(const char *colorName); + void DisplayListOfColor(void); private: - std::vector listMyColor; //!< List of ALL Color - Colorize* errorColor; - color_ts basicColors[COLOR_NUMBER_MAX]; + Edn::VectorType listMyColor; //!< List of ALL Color + Colorize * errorColor; + color_ts basicColors[COLOR_NUMBER_MAX]; }; #endif diff --git a/Sources/CustumWidget/BufferView/BufferView.h b/Sources/CustumWidget/BufferView/BufferView.h index 2a0ef36..52fd407 100644 --- a/Sources/CustumWidget/BufferView/BufferView.h +++ b/Sources/CustumWidget/BufferView/BufferView.h @@ -26,8 +26,6 @@ #define __BUFFER_VIEW_H__ #include "tools_debug.h" -#include -#include #include "Singleton.h" #include "CodeView.h" #include "BufferManager.h" diff --git a/Sources/CustumWidget/MainAreaView/MainAreaView.cpp b/Sources/CustumWidget/MainAreaView/MainAreaView.cpp index ce57162..964e32e 100644 --- a/Sources/CustumWidget/MainAreaView/MainAreaView.cpp +++ b/Sources/CustumWidget/MainAreaView/MainAreaView.cpp @@ -28,8 +28,7 @@ #include "tools_debug.h" #include "Singleton.h" -#include -#include + class MainAreaView: public Singleton diff --git a/Sources/GuiTools/Search/Search.h b/Sources/GuiTools/Search/Search.h index 7982285..38dcba4 100644 --- a/Sources/GuiTools/Search/Search.h +++ b/Sources/GuiTools/Search/Search.h @@ -28,8 +28,6 @@ #include "tools_debug.h" #include "Singleton.h" -#include -#include class Search: public Singleton diff --git a/Sources/Highlight/Highlight.cpp b/Sources/Highlight/Highlight.cpp index e062744..067d618 100644 --- a/Sources/Highlight/Highlight.cpp +++ b/Sources/Highlight/Highlight.cpp @@ -33,14 +33,14 @@ #define __class__ "Highlight" -void Highlight::ParseRules(TiXmlNode *child, std::vector &mListPatern, int32_t level) +void Highlight::ParseRules(TiXmlNode *child, Edn::VectorType &mListPatern, int32_t level) { // Create the patern ... HighlightPattern *myPattern = new HighlightPattern(); // parse under Element myPattern->ParseRules(child, level); // add element in the list - mListPatern.push_back(myPattern); + mListPatern.PushBack(myPattern); } @@ -72,8 +72,8 @@ Highlight::Highlight(Edn::String &xmlFilename) const char *myData = child->ToElement()->GetText(); if (NULL != myData) { //EDN_INFO(PFX"(l %d) node fined : %s=\"%s\"", child->Row(), child->Value() , myData); - Edn::String myEdnData = myData; - m_listExtentions.push_back(myEdnData); + Edn::String * myEdnData = new Edn::String(myData); + m_listExtentions.PushBack(myEdnData); } } else if (!strcmp(child->Value(), "pass1")) { // Get sub Nodes ... @@ -113,21 +113,34 @@ Highlight::Highlight(Edn::String &xmlFilename) Highlight::~Highlight(void) { - uint32_t i; + int32_t i; // clean all Element - for (i=0; i< m_listHighlightPass1.size(); i++) { - delete(m_listHighlightPass1[i]); + for (i=0; i< m_listHighlightPass1.Size(); i++) { + if (NULL != m_listHighlightPass1[i]) { + delete(m_listHighlightPass1[i]); + m_listHighlightPass1[i] = NULL; + } } // clear the compleate list - m_listHighlightPass1.clear(); + m_listHighlightPass1.Clear(); + + // clean all Element + for (i=0; i< m_listExtentions.Size(); i++) { + if (NULL != m_listExtentions[i]) { + delete(m_listExtentions[i]); + m_listExtentions[i] = NULL; + } + } + // clear the compleate list + m_listExtentions.Clear(); } bool Highlight::HasExtention(Edn::String &ext) { - uint32_t i; - for (i=0; iGetName() ); //m_listHighlightPass1[i]->Display(); } // Display all elements - for (i=0; i< m_listHighlightPass2.size(); i++) { + for (i=0; i< m_listHighlightPass2.Size(); i++) { EDN_INFO(" " << i << " Pass 2 : " << m_listHighlightPass2[i]->GetName() ); //m_listHighlightPass2[i]->Display(); } @@ -178,14 +191,14 @@ void Highlight::Display(void) // TODO : Celui qui appelle suprime des element pour rien ... Enfin c'est pas tr\Uffffffffgrave... Il suffirait juste de suprimer celuis d'avant si il n'est pas terminer... void Highlight::Parse(int32_t start, int32_t stop, - std::vector &metaData, + Edn::VectorType &metaData, int32_t addingPos, EdnVectorBuf &buffer) { if (0 > addingPos) { addingPos = 0; } - //EDN_DEBUG("Parse element 0 => " << m_listHighlightPass1.size() << " ==> position search: (" << start << "," << stop << ")" ); + //EDN_DEBUG("Parse element 0 => " << m_listHighlightPass1.Size() << " ==> position search: (" << start << "," << stop << ")" ); int32_t elementStart = start; int32_t elementStop = stop; colorInformation_ts resultat; @@ -193,7 +206,7 @@ void Highlight::Parse(int32_t start, //EDN_DEBUG("Parse element in the buffer id=" << elementStart); //try to fond the HL in ALL of we have int32_t jjj; - for (jjj=0; jjj " << m_listHighlightPass2.size() << " ==> position search: (" << start << "," << stop << ")" ); int32_t elementStart = start; int32_t elementStop = stop; @@ -254,7 +266,7 @@ void Highlight::Parse2(int32_t start, //EDN_DEBUG("Parse element in the buffer id=" << elementStart); //try to fond the HL in ALL of we have int32_t jjj; - for (jjj=0; jjj #include "HighlightPattern.h" #include "Colorize.h" -#include "Edn.h" #include "EdnVectorBuf.h" #include "tinyxml.h" @@ -59,19 +58,19 @@ class Highlight { void Display(void); void Parse(int32_t start, int32_t stop, - std::vector &metaData, + Edn::VectorType &metaData, int32_t addingPos, EdnVectorBuf &buffer); void Parse2(int32_t start, int32_t stop, - std::vector &metaData, + Edn::VectorType &metaData, EdnVectorBuf &buffer); private: - void ParseRules(TiXmlNode *child, std::vector &mListPatern, int32_t level); - Edn::String m_styleName; //!< curent style name (like "c++" or "c" or "script Bash") - std::vector m_listExtentions; //!< List of possible extention for this high-light, like : ".c", ".cpp", ".h" - std::vector m_listHighlightPass1; //!< List of ALL hightlight modules (pass 1 ==> when we load and wride data on the buffer) - std::vector m_listHighlightPass2; //!< List of ALL hightlight modules (pass 2 ==> When we display the buffer( only the display area (100 lines)) ) + void ParseRules(TiXmlNode *child, Edn::VectorType &mListPatern, int32_t level); + Edn::String m_styleName; //!< curent style name (like "c++" or "c" or "script Bash") + Edn::VectorType m_listExtentions; //!< List of possible extention for this high-light, like : ".c", ".cpp", ".h" + Edn::VectorType m_listHighlightPass1; //!< List of ALL hightlight modules (pass 1 ==> when we load and wride data on the buffer) + Edn::VectorType m_listHighlightPass2; //!< List of ALL hightlight modules (pass 2 ==> When we display the buffer( only the display area (100 lines)) ) }; diff --git a/Sources/Highlight/HighlightManager.cpp b/Sources/Highlight/HighlightManager.cpp index 0153a63..1c72e83 100644 --- a/Sources/Highlight/HighlightManager.cpp +++ b/Sources/Highlight/HighlightManager.cpp @@ -37,14 +37,23 @@ HighlightManager::HighlightManager(void) HighlightManager::~HighlightManager(void) { - listHighlight.clear(); + uint32_t i; + // clean all Element + for (i=0; i< listHighlight.Size(); i++) { + if (NULL != listHighlight[i]) { + delete(listHighlight[i]); + listHighlight[i] = NULL; + } + } + // clear the compleate list + listHighlight.Clear(); } Highlight *HighlightManager::Get(Edn::File &fileName) { uint32_t i; - for (i=0; iFileNameCompatible(fileName) ) { return listHighlight[i]; } @@ -73,32 +82,32 @@ void HighlightManager::loadLanguages(void) Edn::String xmlFilename = homedir; xmlFilename += "lang_c.xml"; Highlight *myHightline = new Highlight(xmlFilename); - listHighlight.push_back(myHightline); + listHighlight.PushBack(myHightline); xmlFilename = homedir; xmlFilename += "lang_boo.xml"; myHightline = new Highlight(xmlFilename); - listHighlight.push_back(myHightline); + listHighlight.PushBack(myHightline); xmlFilename = homedir; xmlFilename += "lang_Makefile.xml"; myHightline = new Highlight(xmlFilename); - listHighlight.push_back(myHightline); + listHighlight.PushBack(myHightline); xmlFilename = homedir; xmlFilename += "lang_asm.xml"; myHightline = new Highlight(xmlFilename); - listHighlight.push_back(myHightline); + listHighlight.PushBack(myHightline); xmlFilename = homedir; xmlFilename += "lang_xml.xml"; myHightline = new Highlight(xmlFilename); - listHighlight.push_back(myHightline); + listHighlight.PushBack(myHightline); xmlFilename = homedir; xmlFilename += "lang_php.xml"; myHightline = new Highlight(xmlFilename); - listHighlight.push_back(myHightline); + listHighlight.PushBack(myHightline); myHightline->Display(); } diff --git a/Sources/Highlight/HighlightManager.h b/Sources/Highlight/HighlightManager.h index c9f6c82..673dd61 100644 --- a/Sources/Highlight/HighlightManager.h +++ b/Sources/Highlight/HighlightManager.h @@ -29,8 +29,6 @@ class HighlightManager; #include "Singleton.h" -#include -#include #include "Highlight.h" @@ -49,7 +47,7 @@ class HighlightManager: public Singleton bool Exist(Edn::File &fileName); private: - std::vector listHighlight; //!< List of ALL hightlight modules + Edn::VectorType listHighlight; //!< List of ALL hightlight modules }; #endif diff --git a/Sources/tools/Display/Display.h b/Sources/tools/Display/Display.h index 2c5b20b..c98ceb7 100644 --- a/Sources/tools/Display/Display.h +++ b/Sources/tools/Display/Display.h @@ -26,11 +26,9 @@ #ifndef __TOOLS_DISPLAY_H__ #define __TOOLS_DISPLAY_H__ - #include "tools_debug.h" - #include "Colorize.h" - #include "ColorizeManager.h" - #include - #include +#include "tools_debug.h" +#include "Colorize.h" +#include "ColorizeManager.h" /** diff --git a/Sources/tools/EdnBuf/EdnBuf.h b/Sources/tools/EdnBuf/EdnBuf.h index 7fc087c..224d9fe 100644 --- a/Sources/tools/EdnBuf/EdnBuf.h +++ b/Sources/tools/EdnBuf/EdnBuf.h @@ -49,13 +49,13 @@ end *************** ************* */ typedef struct { - bool selected; //!< True if the selection is active - bool rectangular; //!< True if the selection is rectangular - bool zeroWidth; //!< Width 0 selections aren't "real" selections, but they can be useful when creating rectangular selections from the keyboard. - int32_t start; //!< Pos. of start of selection, or if rectangular start of line containing it. - int32_t end; //!< Pos. of end of selection, or if rectangular end of line containing it. - int32_t rectStart; //!< Indent of left edge of rect. selection - int32_t rectEnd; //!< Indent of right edge of rect. selection + bool selected; //!< True if the selection is active + bool rectangular; //!< True if the selection is rectangular + bool zeroWidth; //!< Width 0 selections aren't "real" selections, but they can be useful when creating rectangular selections from the keyboard. + int32_t start; //!< Pos. of start of selection, or if rectangular start of line containing it. + int32_t end; //!< Pos. of end of selection, or if rectangular end of line containing it. + int32_t rectStart; //!< Indent of left edge of rect. selection + int32_t rectEnd; //!< Indent of right edge of rect. selection } selection; typedef enum{ @@ -67,10 +67,10 @@ typedef enum{ typedef struct { - std::vector HLData; - int32_t idSequence; - int32_t posHLPass1; - int32_t posHLPass2; + Edn::VectorType HLData; + int32_t idSequence; + int32_t posHLPass1; + int32_t posHLPass2; }displayHLData_ts; @@ -125,54 +125,54 @@ class EdnBuf { // selection remember... // ----------------------------------------- public: - bool SelectHasSelection( selectionType_te select); - void Select( selectionType_te select, int32_t start, int32_t end); - void Unselect( selectionType_te select); - void RectSelect( selectionType_te select, int32_t start, int32_t end, int32_t rectStart, int32_t rectEnd); - bool GetSelectionPos( selectionType_te select, int32_t &start, int32_t &end, bool &isRect, int32_t &rectStart, int32_t &rectEnd); - void GetSelectionText( selectionType_te select, Edn::VectorType &text); - void RemoveSelected( selectionType_te select); - void ReplaceSelected( selectionType_te select, Edn::VectorType &text); + bool SelectHasSelection( selectionType_te select); + void Select( selectionType_te select, int32_t start, int32_t end); + void Unselect( selectionType_te select); + void RectSelect( selectionType_te select, int32_t start, int32_t end, int32_t rectStart, int32_t rectEnd); + bool GetSelectionPos( selectionType_te select, int32_t &start, int32_t &end, bool &isRect, int32_t &rectStart, int32_t &rectEnd); + void GetSelectionText( selectionType_te select, Edn::VectorType &text); + void RemoveSelected( selectionType_te select); + void ReplaceSelected( selectionType_te select, Edn::VectorType &text); private: // current selection of the buffer - selection m_selectionList[SELECTION_SIZE]; //!< Selection area of the buffer - void UpdateSelection( selectionType_te select, int32_t pos, int32_t nDeleted, int32_t nInserted); - void UpdateSelections( int32_t pos, int32_t nDeleted, int32_t nInserted); + selection m_selectionList[SELECTION_SIZE]; //!< Selection area of the buffer + void UpdateSelection( selectionType_te select, int32_t pos, int32_t nDeleted, int32_t nInserted); + void UpdateSelections( int32_t pos, int32_t nDeleted, int32_t nInserted); // ----------------------------------------- // History section : // ----------------------------------------- public: - int32_t Undo( void); - int32_t Redo( void); + int32_t Undo(void); + int32_t Redo(void); private: - bool m_isUndoProcessing; - bool m_isRedoProcessing; - Edn::VectorType m_historyUndo; - Edn::VectorType m_historyRedo; + bool m_isUndoProcessing; + bool m_isRedoProcessing; + Edn::VectorType m_historyUndo; + Edn::VectorType m_historyRedo; // ----------------------------------------- // hightlight section : // ----------------------------------------- private: - Highlight * m_Highlight; //!< internal link with the Highlight system - std::vector m_HLDataPass1; //!< colorisation position in the current buffer pass 1 - int32_t m_HLDataSequence; //!< position of the start of line requested by the screen viewer - void RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdded); - void GenerateHighLightAt(int32_t pos, int32_t endPos, int32_t addinPos=0); - void CleanHighLight(void); - void FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t &startId, int32_t &stopId, bool backPreviousNotEnded); + Highlight * m_Highlight; //!< internal link with the Highlight system + Edn::VectorType m_HLDataPass1; //!< colorisation position in the current buffer pass 1 + int32_t m_HLDataSequence; //!< position of the start of line requested by the screen viewer + void RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdded); + void GenerateHighLightAt(int32_t pos, int32_t endPos, int32_t addinPos=0); + void CleanHighLight(void); + void FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t &startId, int32_t &stopId, bool backPreviousNotEnded); public: - void SetHLSystem( Highlight * newHLSystem); - void HightlightGenerateLines(displayHLData_ts & MData, int32_t startPos, int32_t nbLines); - colorInformation_ts * GetElementColorAtPosition(displayHLData_ts & MData, int32_t pos); + void SetHLSystem( Highlight * newHLSystem); + void HightlightGenerateLines(displayHLData_ts & MData, int32_t startPos, int32_t nbLines); + colorInformation_ts * GetElementColorAtPosition(displayHLData_ts & MData, int32_t pos); private: - colorInformation_ts * GetElementColorAtPosition(int32_t pos, int32_t &starPos); + colorInformation_ts * GetElementColorAtPosition(int32_t pos, int32_t &starPos); private: - EdnVectorBuf m_data; //!< buffer of the data in the mode int8_t - void CountNumberOfLines(void); - int32_t m_nbLine; //!< Number of line in the biffer + EdnVectorBuf m_data; //!< buffer of the data in the mode int8_t + void CountNumberOfLines(void); + int32_t m_nbLine; //!< Number of line in the biffer // ----------------------------------------- // Display property and charset ... @@ -186,27 +186,27 @@ class EdnBuf { void SetUTF8Mode(bool newOne) { m_isUtf8 = newOne; m_charsetType=EDN_CHARSET_UTF8; }; private: // Special mode of the buffer : - bool m_isUtf8; //!< true if we are in UTF8 mode ==> if true the size of a char is 0, otherwise .. 1->4 ( TODO : not now) - charset_te m_charsetType; //!< if UTF8 mode is at false : the charset type of the buffer + bool m_isUtf8; //!< true if we are in UTF8 mode ==> if true the size of a char is 0, otherwise .. 1->4 ( TODO : not now) + charset_te m_charsetType; //!< if UTF8 mode is at false : the charset type of the buffer // Local Tabulation policies - int32_t m_tabDist; //!< equiv. number of characters in a tab - bool m_useTabs; //!< True if buffer routines are allowed to use tabs for padding in rectangular operations + int32_t m_tabDist; //!< equiv. number of characters in a tab + bool m_useTabs; //!< True if buffer routines are allowed to use tabs for padding in rectangular operations // ----------------------------------------- // Local function : // ----------------------------------------- private: - void findRectSelBoundariesForCopy( int32_t lineStartPos, int32_t rectStart, int32_t rectEnd, int32_t *selStart, int32_t *selEnd); - char *getSelectionText( selection &sel); - void removeSelected( selection &sel); - void replaceSelected( selection &sel, const char *text); + void findRectSelBoundariesForCopy( int32_t lineStartPos, int32_t rectStart, int32_t rectEnd, int32_t *selStart, int32_t *selEnd); + char * getSelectionText( selection &sel); + void removeSelected( selection &sel); + void replaceSelected( selection &sel, const char *text); - void eventModification( int32_t pos, int32_t nInserted, Edn::VectorType &deletedText); + void eventModification( int32_t pos, int32_t nInserted, Edn::VectorType &deletedText); - int32_t insert( int32_t pos, Edn::VectorType &insertText); + int32_t insert( int32_t pos, Edn::VectorType &insertText); - bool charMatch( char first, char second, bool caseSensitive = true); + bool charMatch( char first, char second, bool caseSensitive = true); }; #endif diff --git a/Sources/tools/EdnBuf/EdnBuf_HighLight.cpp b/Sources/tools/EdnBuf/EdnBuf_HighLight.cpp index ea1bc1f..d86a122 100644 --- a/Sources/tools/EdnBuf/EdnBuf_HighLight.cpp +++ b/Sources/tools/EdnBuf/EdnBuf_HighLight.cpp @@ -35,7 +35,7 @@ void EdnBuf::SetHLSystem(Highlight * newHLSystem) { if (m_Highlight != newHLSystem) { m_Highlight = newHLSystem; - m_HLDataPass1.clear(); + m_HLDataPass1.Clear(); RegenerateHighLightAt(0, 0, m_data.Size()); } } @@ -67,7 +67,7 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd int32_t startId; int32_t stopId; // clean data if needed - if (0 != m_HLDataPass1.size()) { + if (0 != m_HLDataPass1.Size()) { // find element previous FindMainHighLightPosition(pos, posEnd, startId, stopId, true); @@ -75,19 +75,19 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd if( -1 == startId && -1 == stopId) { - m_HLDataPass1.clear(); + m_HLDataPass1.Clear(); } else if(-1 == startId) { if (0 == stopId){ - m_HLDataPass1.erase(m_HLDataPass1.begin()); + m_HLDataPass1.Erase(0); } else { - m_HLDataPass1.erase(m_HLDataPass1.begin(),m_HLDataPass1.begin()+stopId); + m_HLDataPass1.Erase(0,stopId); } } else if(-1 == stopId) { - m_HLDataPass1.erase(m_HLDataPass1.begin()+startId+1,m_HLDataPass1.end()); + m_HLDataPass1.Erase(startId+1, m_HLDataPass1.Size()); } else { - m_HLDataPass1.erase(m_HLDataPass1.begin()+startId+1,m_HLDataPass1.begin()+stopId); + m_HLDataPass1.Erase(startId+1, stopId); } - EDN_DEBUG("new size=" << (int32_t)m_HLDataPass1.size()-1); + EDN_DEBUG("new size=" << (int32_t)m_HLDataPass1.Size()-1); // update position after the range position : int32_t elemStart; if(-1 == startId) { @@ -95,7 +95,7 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd } else { elemStart = startId+1; } - for (i=elemStart; i< (int32_t)m_HLDataPass1.size(); i++) { + for (i=elemStart; i< (int32_t)m_HLDataPass1.Size(); i++) { //EDN_DEBUG("move element=" << i); m_HLDataPass1[i].beginStart += nbAdded - nbDeleted; m_HLDataPass1[i].beginStop += nbAdded - nbDeleted; @@ -113,7 +113,7 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd GenerateHighLightAt(0, m_HLDataPass1[0].beginStart, 0); } else if(-1 == stopId) { //EDN_DEBUG("******* Regenerate STOP"); - GenerateHighLightAt(m_HLDataPass1[m_HLDataPass1.size() -1].endStop, m_data.Size(), m_HLDataPass1.size()); + GenerateHighLightAt(m_HLDataPass1[m_HLDataPass1.Size() -1].endStop, m_data.Size(), m_HLDataPass1.Size()); } else { //EDN_DEBUG("******* Regenerate RANGE"); GenerateHighLightAt(m_HLDataPass1[startId].endStop, m_HLDataPass1[startId+1].beginStart, startId+1); @@ -123,7 +123,7 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd //GenerateHighLightAt(pos, nbAdded); GenerateHighLightAt(0, m_data.Size()); } - for (i=0; i< (int32_t)m_HLDataPass1.size(); i++) { + for (i=0; i< (int32_t)m_HLDataPass1.Size(); i++) { Edn::String ploppp; if (NULL != m_HLDataPass1[i].patern ) { ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->GetName(); @@ -177,7 +177,7 @@ void EdnBuf::FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t S=-1 *************** E */ int32_t i; - for (i=0; i< (int32_t)m_HLDataPass1.size(); i++) { + for (i=0; i< (int32_t)m_HLDataPass1.Size(); i++) { if (m_HLDataPass1[i].endStop > startPos) { break; } @@ -198,7 +198,7 @@ void EdnBuf::FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t } else { elemStart = startId+1; } - for (i=elemStart; i< (int32_t)m_HLDataPass1.size(); i++) { + for (i=elemStart; i< (int32_t)m_HLDataPass1.Size(); i++) { if (m_HLDataPass1[i].beginStart > endPos) { stopId = i; @@ -206,13 +206,13 @@ void EdnBuf::FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t } } /* - if (-1 != startId && startId < (int32_t)m_HLDataPass1.size()) { - EDN_DEBUG("==> BEGIN : start="< BEGIN : start="< BEGIN : start=???, stop=??? id=" << startId); } - if (-1 != stopId && stopId < (int32_t)m_HLDataPass1.size()) { - EDN_DEBUG("==> END : start="< END : start="< END : start=???, stop=??? id=" << stopId); } @@ -228,7 +228,7 @@ void EdnBuf::GenerateHighLightAt(int32_t pos, int32_t endPos, int32_t addinPos) return; } //EDN_DEBUG("area : ("<ParseOneElement(pos, endPos, m_HLDataPass1, addinPos, m_data); + m_Highlight->Parse(pos, endPos, m_HLDataPass1, addinPos, m_data); } @@ -236,7 +236,7 @@ void EdnBuf::GenerateHighLightAt(int32_t pos, int32_t endPos, int32_t addinPos) void EdnBuf::CleanHighLight(void) { // Remove all element in the list... - m_HLDataPass1.clear(); + m_HLDataPass1.Clear(); } @@ -244,7 +244,7 @@ colorInformation_ts *EdnBuf::GetElementColorAtPosition(int32_t pos, int32_t &sta { int32_t i; int32_t start = edn_max(0, starPos-1); - for (i=start; i<(int32_t)m_HLDataPass1.size(); i++) { + for (i=start; i<(int32_t)m_HLDataPass1.Size(); i++) { starPos = i; if( m_HLDataPass1[i].beginStart <= pos && m_HLDataPass1[i].endStop > pos) @@ -272,7 +272,7 @@ void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart, g_get_current_time(&timeStart); MData.idSequence = m_HLDataSequence; HLStart = StartOfLine(HLStart); - MData.HLData.clear(); + MData.HLData.Clear(); int32_t HLStop = CountForwardNLines(HLStart, nbLines); int32_t startId, stopId; // find element previous @@ -282,7 +282,7 @@ void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart, //EDN_DEBUG("List of section between : "<< startId << " & " << stopId); int32_t endSearch = stopId+1; if (-1 == stopId) { - endSearch = m_HLDataPass1.size(); + endSearch = m_HLDataPass1.Size(); } for (k=edn_max(startId, 0); k (under section ) k="< (empty section 3 ) k="< #undef __class__ #define __class__ "globals" -// Variables privé du namespace -static std::string curentFileName = "???"; erreurCode_te globals::init(void) @@ -201,36 +198,3 @@ bool globals::IsSetInsert(void) - -/* - * Basic GUI system : - * - * - * - * - */ - - - -void globals::DisplaySystemString(std::vector &data) -{ - // Display the copyed data ... - uint32_t i; - EDN_INFO("Display Data : "); - printf(" ========================================================\n"); - for(i=0; i -#include namespace globals { - erreurCode_te init(void); - int32_t getNbColoneBorder(void); - int32_t getNbLineBorder(void); + erreurCode_te init(void); + int32_t getNbColoneBorder(void); + int32_t getNbLineBorder(void); bool IsSetDisplayEndOfLine(void); void SetDisplayEndOfLine(bool newVal); @@ -45,25 +43,24 @@ namespace globals bool IsSetAutoIndent(void); void SetAutoIndent(bool newVal); - void init2(void); + void init2(void); - void SetShift(void); - void UnSetShift(void); - bool IsSetShift(void); - void SetAlt(void); - void UnSetAlt(void); - bool IsSetAlt(void); - void SetCtrl(void); - void UnSetCtrl(void); - bool IsSetCtrl(void); - void SetPomme(void); - void UnSetPomme(void); - bool IsSetPomme(void); - void SetInsert(void); - void UnSetInsert(void); - void ToggleInsert(void); - bool IsSetInsert(void); - void DisplaySystemString(std::vector &data); + void SetShift(void); + void UnSetShift(void); + bool IsSetShift(void); + void SetAlt(void); + void UnSetAlt(void); + bool IsSetAlt(void); + void SetCtrl(void); + void UnSetCtrl(void); + bool IsSetCtrl(void); + void SetPomme(void); + void UnSetPomme(void); + bool IsSetPomme(void); + void SetInsert(void); + void UnSetInsert(void); + void ToggleInsert(void); + bool IsSetInsert(void); } #endif