Normalisation with etk application

This commit is contained in:
2012-04-23 10:15:43 +02:00
parent 247aac0684
commit 5d1837eb69
56 changed files with 446 additions and 576 deletions

View File

@@ -28,7 +28,6 @@ LOCAL_CFLAGS := -D__PLATFORM__Android \
-DEWOL_USE_FREE_TYPE \ -DEWOL_USE_FREE_TYPE \
-DETK_DEBUG_LEVEL=3 \ -DETK_DEBUG_LEVEL=3 \
-DAPPL_DEBUG_LEVEL=3 \ -DAPPL_DEBUG_LEVEL=3 \
-DEDN_DEBUG_LEVEL=3 \
-DDATA_IN_APK \ -DDATA_IN_APK \
-frtti -frtti

View File

@@ -23,7 +23,7 @@
******************************************************************************* *******************************************************************************
*/ */
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <Buffer.h> #include <Buffer.h>
#include <BufferManager.h> #include <BufferManager.h>

View File

@@ -77,7 +77,7 @@ class Buffer {
bool IsModify(void); bool IsModify(void);
protected: protected:
void SetModify(bool status); void SetModify(bool status);
virtual void NameChange(void) { /*EDN_DEBUG("check name change ==> no HL change possible");*/}; virtual void NameChange(void) { /*APPL_DEBUG("check name change ==> no HL change possible");*/};
public: public:
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate); virtual void GetInfo(infoStatBuffer_ts &infoToUpdate);
virtual void SetLineDisplay(uint32_t lineNumber); virtual void SetLineDisplay(uint32_t lineNumber);

View File

@@ -23,7 +23,7 @@
******************************************************************************* *******************************************************************************
*/ */
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <BufferEmpty.h> #include <BufferEmpty.h>
#include <ColorizeManager.h> #include <ColorizeManager.h>

View File

@@ -24,7 +24,7 @@
*/ */
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <BufferManager.h> #include <BufferManager.h>
#include <ewol/EObject.h> #include <ewol/EObject.h>
@@ -150,12 +150,12 @@ classBufferManager::classBufferManager(void)
classBufferManager::~classBufferManager(void) classBufferManager::~classBufferManager(void)
{ {
//clean All Buffer //clean All Buffer
EDN_INFO("~classBufferManager::RemoveAll();"); APPL_INFO("~classBufferManager::RemoveAll();");
RemoveAll(); RemoveAll();
// clear The list of Buffer // clear The list of Buffer
EDN_INFO("~classBufferManager::listBuffer.Clear();"); APPL_INFO("~classBufferManager::listBuffer.Clear();");
listBuffer.Clear(); listBuffer.Clear();
EDN_INFO("~classBufferManager::delete(BufferNotExiste);"); APPL_INFO("~classBufferManager::delete(BufferNotExiste);");
delete(BufferNotExiste); delete(BufferNotExiste);
} }
@@ -174,7 +174,7 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
if (eventId == ednMsgBufferId) { if (eventId == ednMsgBufferId) {
// select a new buffer ID : // select a new buffer ID :
if (data == "") { if (data == "") {
EDN_ERROR("Request select buffer ID = \"\" "); APPL_ERROR("Request select buffer ID = \"\" ");
} else { } else {
int32_t newID = -1; int32_t newID = -1;
sscanf(data.Utf8Data(), "%d", &newID); sscanf(data.Utf8Data(), "%d", &newID);
@@ -182,7 +182,7 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
m_idSelected = newID; m_idSelected = newID;
} else { } else {
m_idSelected = -1; m_idSelected = -1;
EDN_ERROR("Request a non existant ID : " << newID << " reset to -1..."); APPL_ERROR("Request a non existant ID : " << newID << " reset to -1...");
} }
} }
} else if (eventId == ednMsgGuiNew) { } else if (eventId == ednMsgGuiNew) {
@@ -204,7 +204,7 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
} }
} else if (eventId == ednMsgGuiSave) { } else if (eventId == ednMsgGuiSave) {
if (data == "") { if (data == "") {
EDN_ERROR("Null data for close file ... "); APPL_ERROR("Null data for close file ... ");
} else { } else {
if (data == "current") { if (data == "current") {
// Check buffer existence // Check buffer existence
@@ -220,7 +220,7 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
int32_t newId; int32_t newId;
sscanf(data.Utf8Data(), "%d", &newId); sscanf(data.Utf8Data(), "%d", &newId);
if (false == Exist(newId)) { if (false == Exist(newId)) {
EDN_ERROR("Request a save As with a non existant ID=" << newId); APPL_ERROR("Request a save As with a non existant ID=" << newId);
} else { } else {
// If no name ==> request a Gui display ... // If no name ==> request a Gui display ...
if (Get(newId)->HaveName() == false) { if (Get(newId)->HaveName() == false) {
@@ -234,7 +234,7 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
} }
} else if (eventId == ednMsgGuiClose) { } else if (eventId == ednMsgGuiClose) {
if (data == "") { if (data == "") {
EDN_ERROR("Null data for close file ... "); APPL_ERROR("Null data for close file ... ");
} else { } else {
if (data == "All") { if (data == "All") {
@@ -242,11 +242,11 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
int32_t closeID = -1; int32_t closeID = -1;
if (data == "current") { if (data == "current") {
closeID = m_idSelected; closeID = m_idSelected;
EDN_DEBUG("Close specific buffer ID" << closeID); APPL_DEBUG("Close specific buffer ID" << closeID);
} else { } else {
// close specific buffer ... // close specific buffer ...
sscanf(data.Utf8Data(), "%d", &closeID); sscanf(data.Utf8Data(), "%d", &closeID);
EDN_DEBUG("Close specific buffer ID="<< closeID); APPL_DEBUG("Close specific buffer ID="<< closeID);
} }
if(true == Exist(closeID)) { if(true == Exist(closeID)) {
// Get the new display buffer // Get the new display buffer
@@ -276,21 +276,21 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
Remove(closeID); Remove(closeID);
SendMultiCast(ednMsgBufferListChange); SendMultiCast(ednMsgBufferListChange);
} else { } else {
EDN_ERROR("Request Close of a non existant ID : " << closeID); APPL_ERROR("Request Close of a non existant ID : " << closeID);
} }
} }
} }
} else if (eventId == ednMsgCodeViewSelectedId) { } else if (eventId == ednMsgCodeViewSelectedId) {
//Change the selected buffer //Change the selected buffer
if (data == "") { if (data == "") {
EDN_ERROR("Null data for changing buffer ID file ... "); APPL_ERROR("Null data for changing buffer ID file ... ");
} else { } else {
int32_t newId; int32_t newId;
sscanf(data.Utf8Data(), "%d", &newId); sscanf(data.Utf8Data(), "%d", &newId);
if (true == Exist(newId)) { if (true == Exist(newId)) {
m_idSelected = newId; m_idSelected = newId;
} else { } else {
EDN_ERROR("code biew request the selection of an non -existant buffer ==> reset to -1"); APPL_ERROR("code biew request the selection of an non -existant buffer ==> reset to -1");
m_idSelected = -1; m_idSelected = -1;
} }
SendMultiCast(ednMsgBufferId, m_idSelected); SendMultiCast(ednMsgBufferId, m_idSelected);
@@ -304,7 +304,7 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
if(true == Exist(dataID)) { if(true == Exist(dataID)) {
// If no name ==> request a Gui display ... // If no name ==> request a Gui display ...
if (Get(dataID)->HaveName() == false) { if (Get(dataID)->HaveName() == false) {
SendMessage(EDN_MSG__GUI_SHOW_SAVE_AS, dataID); SendMessage(APPL_MSG__GUI_SHOW_SAVE_AS, dataID);
} else { } else {
Get(dataID)->Save(); Get(dataID)->Save();
} }
@@ -392,10 +392,10 @@ Buffer * classBufferManager::Get(int32_t BufferID)
if (NULL != listBuffer[BufferID]) { if (NULL != listBuffer[BufferID]) {
return listBuffer[BufferID]; return listBuffer[BufferID];
} else { } else {
EDN_ERROR("non existing Buffer " << BufferID); APPL_ERROR("non existing Buffer " << BufferID);
} }
} else { } else {
EDN_ERROR("call an non existing Buffer number too hight : " << BufferID << " > " << listBuffer.Size()); APPL_ERROR("call an non existing Buffer number too hight : " << BufferID << " > " << listBuffer.Size());
} }
return BufferNotExiste; return BufferNotExiste;
} }
@@ -482,7 +482,7 @@ bool classBufferManager::Remove(int32_t BufferID)
// TODO : Check if it saved... // TODO : Check if it saved...
/* /*
if (false == IsSaved(BufferID) ) { if (false == IsSaved(BufferID) ) {
EDN_INFO("Buffer " << BufferID << " : Not Saved", BufferID); APPL_INFO("Buffer " << BufferID << " : Not Saved", BufferID);
} }
*/ */
// Delete the Buffer // Delete the Buffer
@@ -493,11 +493,11 @@ bool classBufferManager::Remove(int32_t BufferID)
*/ */
return true; return true;
} else { } else {
EDN_INFO("non existing Buffer " << BufferID); APPL_INFO("non existing Buffer " << BufferID);
return false; return false;
} }
} else { } else {
EDN_INFO("call an non existing Buffer number too hight : " << BufferID << " > " << listBuffer.Size()); APPL_INFO("call an non existing Buffer number too hight : " << BufferID << " > " << listBuffer.Size());
return false; return false;
} }
} }

View File

@@ -23,7 +23,7 @@
******************************************************************************* *******************************************************************************
*/ */
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <BufferText.h> #include <BufferText.h>
#include <toolsMemory.h> #include <toolsMemory.h>
@@ -81,7 +81,7 @@ void BufferText::BasicInit(void)
void BufferText::NameChange(void) void BufferText::NameChange(void)
{ {
// Find HL system // Find HL system
//EDN_DEBUG("check name change"); //APPL_DEBUG("check name change");
if (true == HighlightManager::Exist(m_fileName)) { if (true == HighlightManager::Exist(m_fileName)) {
Highlight * myHL = HighlightManager::Get(m_fileName); Highlight * myHL = HighlightManager::Get(m_fileName);
// Set the new HL // Set the new HL
@@ -105,7 +105,7 @@ BufferText::BufferText()
{ {
BasicInit(); BasicInit();
SetModify(true); SetModify(true);
EDN_INFO("New(Empty-Buffer)"); APPL_INFO("New(Empty-Buffer)");
} }
@@ -121,7 +121,7 @@ BufferText::BufferText(etk::File &fileName) : Buffer(fileName)
{ {
BasicInit(); BasicInit();
NameChange(); NameChange();
EDN_INFO("Add Data from file(" << GetFileName() << ")"); APPL_INFO("Add Data from file(" << GetFileName() << ")");
FILE * myFile = NULL; FILE * myFile = NULL;
// try to open the file. if not existed, new file // try to open the file. if not existed, new file
@@ -133,7 +133,7 @@ BufferText::BufferText(etk::File &fileName) : Buffer(fileName)
SetModify(false); SetModify(false);
} else { } else {
// fichier inexistant... creation d'un nouveaux // fichier inexistant... creation d'un nouveaux
EDN_WARNING("No File ==> created a new one(" << GetFileName() << ")"); APPL_WARNING("No File ==> created a new one(" << GetFileName() << ")");
SetModify(true); SetModify(true);
} }
RequestPositionUpdate(); RequestPositionUpdate();
@@ -150,7 +150,7 @@ BufferText::BufferText(etk::File &fileName) : Buffer(fileName)
*/ */
void BufferText::Save(void) void BufferText::Save(void)
{ {
EDN_INFO("Save File : \"" << GetFileName() << "\"" ); APPL_INFO("Save File : \"" << GetFileName() << "\"" );
FILE * myFile = NULL; FILE * myFile = NULL;
myFile = fopen(GetFileName().GetCompleateName().Utf8Data(), "w"); myFile = fopen(GetFileName().GetCompleateName().Utf8Data(), "w");
if (NULL != myFile) { if (NULL != myFile) {
@@ -158,7 +158,7 @@ void BufferText::Save(void)
fclose(myFile); fclose(myFile);
SetModify(false); SetModify(false);
} else { } else {
EDN_ERROR("Can not open in writing the specify file"); APPL_ERROR("Can not open in writing the specify file");
} }
} }
@@ -174,7 +174,7 @@ void BufferText::Save(void)
*/ */
BufferText::~BufferText(void) BufferText::~BufferText(void)
{ {
EDN_INFO("Delete(BufferText)"); APPL_INFO("Delete(BufferText)");
} }
@@ -303,7 +303,7 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
// update the number of element that can be displayed // update the number of element that can be displayed
m_displaySize.x = (sizeX/letterWidth) + 1 - nbColoneForLineNumber; m_displaySize.x = (sizeX/letterWidth) + 1 - nbColoneForLineNumber;
m_displaySize.y = (sizeY/letterHeight) + 1; m_displaySize.y = (sizeY/letterHeight) + 1;
EDN_VERBOSE("main DIPLAY " << m_displaySize.x << " char * " << m_displaySize.y << " char"); APPL_VERBOSE("main DIPLAY " << m_displaySize.x << " char * " << m_displaySize.y << " char");
selHave = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, selStart, selEnd, selIsRect, selRectStart, selRectEnd); selHave = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, selStart, selEnd, selIsRect, selRectStart, selRectEnd);
@@ -333,15 +333,15 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
m_EdnBuf.HightlightGenerateLines(m_displayLocalSyntax, displayStartBufferPos, m_displaySize.y); m_EdnBuf.HightlightGenerateLines(m_displayLocalSyntax, displayStartBufferPos, m_displaySize.y);
int64_t stopTime = GetCurrentTime(); int64_t stopTime = GetCurrentTime();
EDN_DEBUG("Parsing Highlight = " << stopTime - startTime << " milli-s"); APPL_DEBUG("Parsing Highlight = " << stopTime - startTime << " milli-s");
uniChar_t displayChar[MAX_EXP_CHAR_LEN]; uniChar_t displayChar[MAX_EXP_CHAR_LEN];
memset(displayChar, 0, sizeof(uniChar_t)*MAX_EXP_CHAR_LEN); memset(displayChar, 0, sizeof(uniChar_t)*MAX_EXP_CHAR_LEN);
etk::UString myStringToDisplay; etk::UString myStringToDisplay;
// draw the lineNumber : // draw the lineNumber :
int32_t currentLineID = displayStartLineId+1; int32_t currentLineID = displayStartLineId+1;
EDN_VERBOSE("Start display of text buffer [" << displayStartBufferPos<< ".." << mylen << "]"); APPL_VERBOSE("Start display of text buffer [" << displayStartBufferPos<< ".." << mylen << "]");
EDN_VERBOSE("cursor Pos : " << m_cursorPos << "start at pos=" << displayStartBufferPos); APPL_VERBOSE("cursor Pos : " << m_cursorPos << "start at pos=" << displayStartBufferPos);
OOTextNormal.clippingDisable(); OOTextNormal.clippingDisable();
@@ -368,13 +368,13 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
OOColored.clippingSet(drawClippingTextArea); OOColored.clippingSet(drawClippingTextArea);
for (iii=displayStartBufferPos; iii<mylen && displayLines < m_displaySize.y ; iii = new_i) { for (iii=displayStartBufferPos; iii<mylen && displayLines < m_displaySize.y ; iii = new_i) {
//EDN_DEBUG("diplay element=" << iii); //APPL_DEBUG("diplay element=" << iii);
int displaywidth; int displaywidth;
uint32_t currentChar = '\0'; uint32_t currentChar = '\0';
new_i = iii; new_i = iii;
displaywidth = m_EdnBuf.GetExpandedChar(new_i, idX, displayChar, currentChar); displaywidth = m_EdnBuf.GetExpandedChar(new_i, idX, displayChar, currentChar);
int32_t drawSize = 0; int32_t drawSize = 0;
//EDN_INFO("diplay element=" << new_i); //APPL_INFO("diplay element=" << new_i);
if (currentChar!='\n') { if (currentChar!='\n') {
selectColor = myColor; selectColor = myColor;
HLColor = m_EdnBuf.GetElementColorAtPosition(m_displayLocalSyntax, iii); HLColor = m_EdnBuf.GetElementColorAtPosition(m_displayLocalSyntax, iii);
@@ -459,7 +459,7 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
} }
int64_t stopTime2 = GetCurrentTime(); int64_t stopTime2 = GetCurrentTime();
EDN_DEBUG("DRAW text (brut) = " << stopTime2 - stopTime << " milli-s"); APPL_DEBUG("DRAW text (brut) = " << stopTime2 - stopTime << " milli-s");
return ERR_NONE; return ERR_NONE;
} }
@@ -491,11 +491,11 @@ int32_t BufferText::GetMousePosition(int32_t fontId, int32_t width, int32_t heig
int32_t pixelX = 0; int32_t pixelX = 0;
int32_t startLinePosition = m_EdnBuf.CountForwardNLines(0, lineOffset); int32_t startLinePosition = m_EdnBuf.CountForwardNLines(0, lineOffset);
if (width <= 0) { if (width <= 0) {
EDN_DEBUG(" Element : Befor the start of the line ... ==> END"); APPL_DEBUG(" Element : Befor the start of the line ... ==> END");
return startLinePosition; return startLinePosition;
} }
EDN_VERBOSE("Get id element : x=" << width << "px y=" << height << "px"); APPL_VERBOSE("Get id element : x=" << width << "px y=" << height << "px");
EDN_VERBOSE(" line offset = " << lineOffset); APPL_VERBOSE(" line offset = " << lineOffset);
for (iii=startLinePosition; iii<mylen; iii = new_i) { for (iii=startLinePosition; iii<mylen; iii = new_i) {
int displaywidth; int displaywidth;
uint32_t currentChar = '\0'; uint32_t currentChar = '\0';
@@ -503,21 +503,21 @@ int32_t BufferText::GetMousePosition(int32_t fontId, int32_t width, int32_t heig
displaywidth = m_EdnBuf.GetExpandedChar(new_i, idX, displayChar, currentChar); displaywidth = m_EdnBuf.GetExpandedChar(new_i, idX, displayChar, currentChar);
if (currentChar!='\n') { if (currentChar!='\n') {
int32_t drawSize = ewol::GetWidth(fontId, displayChar); int32_t drawSize = ewol::GetWidth(fontId, displayChar);
EDN_VERBOSE(" Element : " << currentChar << "=\"" << (char)currentChar << "\" display offset=" << pixelX << "px width=" << drawSize << "px"); APPL_VERBOSE(" Element : " << currentChar << "=\"" << (char)currentChar << "\" display offset=" << pixelX << "px width=" << drawSize << "px");
pixelX += drawSize; pixelX += drawSize;
if (width <= pixelX) { if (width <= pixelX) {
EDN_VERBOSE(" Find IT ==> END"); APPL_VERBOSE(" Find IT ==> END");
// find position ... // find position ...
break; break;
} }
} else { } else {
EDN_VERBOSE(" Element : \"\\n\" display width=---px ==> end of line ==> END"); APPL_VERBOSE(" Element : \"\\n\" display width=---px ==> end of line ==> END");
// end of line ... exit cycle // end of line ... exit cycle
break; break;
} }
idX += displaywidth; idX += displaywidth;
} }
EDN_VERBOSE("BufferText::GetMousePosition(" << width << "," << height << "); ==> " << iii ); APPL_VERBOSE("BufferText::GetMousePosition(" << width << "," << height << "); ==> " << iii );
return iii; return iii;
} }
@@ -570,7 +570,7 @@ void BufferText::MouseSelectFromCursorTo(int32_t fontId, int32_t width, int32_t
int32_t selStart, selEnd, selRectStart, selRectEnd; int32_t selStart, selEnd, selRectStart, selRectEnd;
bool selIsRect; bool selIsRect;
int32_t selHave = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, selStart, selEnd, selIsRect, selRectStart, selRectEnd); int32_t selHave = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, selStart, selEnd, selIsRect, selRectStart, selRectEnd);
//EDN_DEBUG("BufferText:: " << selHave << " = BufGetSelectionPos(SELECTION_PRIMARY," << selStart << "," << selEnd << "," << selIsRect << "," << selRectStart << "," << selRectEnd << ");" ); //APPL_DEBUG("BufferText:: " << selHave << " = BufGetSelectionPos(SELECTION_PRIMARY," << selStart << "," << selEnd << "," << selIsRect << "," << selRectStart << "," << selRectEnd << ");" );
int32_t rememberCursorPos = m_cursorPos; int32_t rememberCursorPos = m_cursorPos;
// move the cursor // move the cursor
SetInsertPosition(newPos); SetInsertPosition(newPos);
@@ -666,7 +666,7 @@ void BufferText::SetInsertPosition(int32_t newPos, bool insertChar)
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd); bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
int32_t rememberCursorPos = m_cursorPos; int32_t rememberCursorPos = m_cursorPos;
//EDN_DEBUG("newPos=" << newPos); //APPL_DEBUG("newPos=" << newPos);
// unselect buffer: // unselect buffer:
m_EdnBuf.Unselect(SELECTION_PRIMARY); m_EdnBuf.Unselect(SELECTION_PRIMARY);
@@ -724,10 +724,10 @@ bool BufferText::TextDMoveUp(int32_t offset)
// Get the previous line // Get the previous line
prevLineStartPos = m_EdnBuf.CountBackwardNLines(lineStartPos, offset); prevLineStartPos = m_EdnBuf.CountBackwardNLines(lineStartPos, offset);
//EDN_INFO("Move Line UP result : prevLineStartPos=" << prevLineStartPos); //APPL_INFO("Move Line UP result : prevLineStartPos=" << prevLineStartPos);
// Get the display char position // Get the display char position
newPos = m_EdnBuf.CountForwardDispChars(prevLineStartPos, column); newPos = m_EdnBuf.CountForwardDispChars(prevLineStartPos, column);
//EDN_INFO("Move to colomn : column=" << column << " newPos=" << newPos); //APPL_INFO("Move to colomn : column=" << column << " newPos=" << newPos);
// move the cursor // move the cursor
SetInsertPosition(newPos); SetInsertPosition(newPos);
@@ -758,10 +758,10 @@ bool BufferText::TextDMoveDown(int32_t offset)
} }
// get the next line : // get the next line :
nextLineStartPos = m_EdnBuf.CountForwardNLines(lineStartPos, offset); nextLineStartPos = m_EdnBuf.CountForwardNLines(lineStartPos, offset);
//EDN_INFO("Move Line DOWN result : nextLineStartPos=" << nextLineStartPos); //APPL_INFO("Move Line DOWN result : nextLineStartPos=" << nextLineStartPos);
// Get the display char position // Get the display char position
newPos = m_EdnBuf.CountForwardDispChars(nextLineStartPos, column); newPos = m_EdnBuf.CountForwardDispChars(nextLineStartPos, column);
//EDN_INFO("Move to colomn : column=" << column << " newPos=" << newPos); //APPL_INFO("Move to colomn : column=" << column << " newPos=" << newPos);
SetInsertPosition(newPos); SetInsertPosition(newPos);
// if a preferred column wasn't aleady established, establish it // if a preferred column wasn't aleady established, establish it
@@ -786,40 +786,40 @@ void BufferText::cursorMove(ewol::eventKbMoveType_te moveTypeEvent)
// check selection event ... // check selection event ...
switch(moveTypeEvent) { switch(moveTypeEvent) {
case ewol::EVENT_KB_MOVE_TYPE_LEFT: case ewol::EVENT_KB_MOVE_TYPE_LEFT:
//EDN_INFO("keyEvent : <LEFT>"); //APPL_INFO("keyEvent : <LEFT>");
if (m_cursorPos > 0) { if (m_cursorPos > 0) {
SetInsertPosition(m_cursorPos - 1); SetInsertPosition(m_cursorPos - 1);
} }
break; break;
case ewol::EVENT_KB_MOVE_TYPE_RIGHT: case ewol::EVENT_KB_MOVE_TYPE_RIGHT:
//EDN_INFO("keyEvent : <RIGHT>"); //APPL_INFO("keyEvent : <RIGHT>");
if (m_cursorPos < m_EdnBuf.Size() ) { if (m_cursorPos < m_EdnBuf.Size() ) {
SetInsertPosition(m_cursorPos + 1); SetInsertPosition(m_cursorPos + 1);
} }
break; break;
case ewol::EVENT_KB_MOVE_TYPE_UP: case ewol::EVENT_KB_MOVE_TYPE_UP:
//EDN_INFO("keyEvent : <UP>"); //APPL_INFO("keyEvent : <UP>");
TextDMoveUp(1); TextDMoveUp(1);
break; break;
case ewol::EVENT_KB_MOVE_TYPE_DOWN: case ewol::EVENT_KB_MOVE_TYPE_DOWN:
//EDN_INFO("keyEvent : <DOWN>"); //APPL_INFO("keyEvent : <DOWN>");
// check if we have enought line ... // check if we have enought line ...
TextDMoveDown(1); TextDMoveDown(1);
break; break;
case ewol::EVENT_KB_MOVE_TYPE_PAGE_UP: case ewol::EVENT_KB_MOVE_TYPE_PAGE_UP:
//EDN_INFO("keyEvent : <PAGE-UP>"); //APPL_INFO("keyEvent : <PAGE-UP>");
TextDMoveUp(m_displaySize.y); TextDMoveUp(m_displaySize.y);
break; break;
case ewol::EVENT_KB_MOVE_TYPE_PAGE_DOWN: case ewol::EVENT_KB_MOVE_TYPE_PAGE_DOWN:
//EDN_INFO("keyEvent : <PAGE-DOWN>"); //APPL_INFO("keyEvent : <PAGE-DOWN>");
TextDMoveDown(m_displaySize.y); TextDMoveDown(m_displaySize.y);
break; break;
case ewol::EVENT_KB_MOVE_TYPE_START: case ewol::EVENT_KB_MOVE_TYPE_START:
//EDN_INFO("keyEvent : <Start of line>"); //APPL_INFO("keyEvent : <Start of line>");
SetInsertPosition(m_EdnBuf.StartOfLine(m_cursorPos) ); SetInsertPosition(m_EdnBuf.StartOfLine(m_cursorPos) );
break; break;
case ewol::EVENT_KB_MOVE_TYPE_END: case ewol::EVENT_KB_MOVE_TYPE_END:
//EDN_INFO("keyEvent : <End of line>"); //APPL_INFO("keyEvent : <End of line>");
SetInsertPosition(m_EdnBuf.EndOfLine(m_cursorPos) ); SetInsertPosition(m_EdnBuf.EndOfLine(m_cursorPos) );
break; break;
default: default:
@@ -869,12 +869,12 @@ void BufferText::RequestPositionUpdate(bool centerPage)
if (centerPage == false) { if (centerPage == false) {
/* /*
// Display position (Y mode): // Display position (Y mode):
//EDN_INFO("BufferText::RequestPositionUpdate() m_displayStart(" << m_displayStartPixelX << "px," << m_displayStartLineId << "id) m_displaySize(" << m_displaySize.x << "," <<m_displaySize.y << ")"); //APPL_INFO("BufferText::RequestPositionUpdate() m_displayStart(" << m_displayStartPixelX << "px," << m_displayStartLineId << "id) m_displaySize(" << m_displaySize.x << "," <<m_displaySize.y << ")");
coord2D_ts cursorPosition; coord2D_ts cursorPosition;
cursorPosition.y = m_EdnBuf.CountLines(0, m_cursorPos); cursorPosition.y = m_EdnBuf.CountLines(0, m_cursorPos);
int32_t lineStartPos = m_EdnBuf.StartOfLine(m_cursorPos); int32_t lineStartPos = m_EdnBuf.StartOfLine(m_cursorPos);
cursorPosition.x = m_EdnBuf.CountDispChars(lineStartPos, m_cursorPos); cursorPosition.x = m_EdnBuf.CountDispChars(lineStartPos, m_cursorPos);
//EDN_INFO("BufferText::RequestPositionUpdate() curent cursor position : (" << cursorPosition.x << "," << cursorPosition.y << ")"); //APPL_INFO("BufferText::RequestPositionUpdate() curent cursor position : (" << cursorPosition.x << "," << cursorPosition.y << ")");
if (m_displayStartLineId > (int32_t)cursorPosition.y - globals::getNbLineBorder() ) { if (m_displayStartLineId > (int32_t)cursorPosition.y - globals::getNbLineBorder() ) {
m_displayStartLineId = cursorPosition.y - globals::getNbLineBorder(); m_displayStartLineId = cursorPosition.y - globals::getNbLineBorder();
@@ -885,7 +885,7 @@ void BufferText::RequestPositionUpdate(bool centerPage)
m_displayStartLineId = cursorPosition.y - m_displaySize.y + globals::getNbLineBorder() + 1; m_displayStartLineId = cursorPosition.y - m_displaySize.y + globals::getNbLineBorder() + 1;
} }
// Display position (X mode): // Display position (X mode):
//EDN_INFO("cursorPosition X : " << cursorPosition.y << " windows " << m_displayStartLineId << "=>" << m_displayStartPixelX + m_displaySize.x); //APPL_INFO("cursorPosition X : " << cursorPosition.y << " windows " << m_displayStartLineId << "=>" << m_displayStartPixelX + m_displaySize.x);
if (m_displayStartPixelX > cursorPosition.x - globals::getNbColoneBorder() ) { if (m_displayStartPixelX > cursorPosition.x - globals::getNbColoneBorder() ) {
m_displayStartPixelX = cursorPosition.x - globals::getNbColoneBorder(); m_displayStartPixelX = cursorPosition.x - globals::getNbColoneBorder();
if (m_displayStartPixelX < 0) { if (m_displayStartPixelX < 0) {
@@ -901,19 +901,19 @@ void BufferText::RequestPositionUpdate(bool centerPage)
} else { } else {
// center the line at the middle of the screen : // center the line at the middle of the screen :
coord2D_ts cursorPosition; coord2D_ts cursorPosition;
//EDN_DEBUG(" -------------------------------------------------"); //APPL_DEBUG(" -------------------------------------------------");
cursorPosition.y = m_EdnBuf.CountLines(0, m_cursorPos); cursorPosition.y = m_EdnBuf.CountLines(0, m_cursorPos);
//EDN_DEBUG(" cursor position : " << m_cursorPos << " ==> ligne=" << cursorPosition.y); //APPL_DEBUG(" cursor position : " << m_cursorPos << " ==> ligne=" << cursorPosition.y);
cursorPosition.x = 0; cursorPosition.x = 0;
m_displayStartPixelX = 0; m_displayStartPixelX = 0;
//EDN_DEBUG(" display size : " << m_displaySize.y); //APPL_DEBUG(" display size : " << m_displaySize.y);
m_displayStartLineId = cursorPosition.y - m_displaySize.y/2; m_displayStartLineId = cursorPosition.y - m_displaySize.y/2;
m_displayStartLineId = edn_max(m_displayStartLineId, 0); m_displayStartLineId = edn_max(m_displayStartLineId, 0);
m_displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, m_displayStartLineId); m_displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, m_displayStartLineId);
//EDN_DEBUG(" display start : " << m_displayStartPixelX << "x" << m_displayStartLineId); //APPL_DEBUG(" display start : " << m_displayStartPixelX << "x" << m_displayStartLineId);
//EDN_DEBUG(" -------------------------------------------------"); //APPL_DEBUG(" -------------------------------------------------");
} }
#endif #endif
} }
@@ -991,7 +991,7 @@ void BufferText::AddChar(uniChar_t unicodeData)
SetInsertPosition(SelectionStart+tmpVect.Size(), true); SetInsertPosition(SelectionStart+tmpVect.Size(), true);
} }
} else if (unicodeData == 0x7F ) { } else if (unicodeData == 0x7F ) {
//EDN_INFO("keyEvent : <Suppr> pos=" << m_cursorPos); //APPL_INFO("keyEvent : <Suppr> pos=" << m_cursorPos);
if (false == haveSelectionActive) { if (false == haveSelectionActive) {
m_EdnBuf.Remove(m_cursorPos, m_cursorPos+1); m_EdnBuf.Remove(m_cursorPos, m_cursorPos+1);
} else { } else {
@@ -999,7 +999,7 @@ void BufferText::AddChar(uniChar_t unicodeData)
SetInsertPosition(SelectionStart, true); SetInsertPosition(SelectionStart, true);
} }
} else if (unicodeData == 0x08) { } else if (unicodeData == 0x08) {
//EDN_INFO("keyEvent : <Del> pos=" << m_cursorPos); //APPL_INFO("keyEvent : <Del> pos=" << m_cursorPos);
if (false == haveSelectionActive) { if (false == haveSelectionActive) {
m_EdnBuf.Remove(m_cursorPos-1, m_cursorPos); m_EdnBuf.Remove(m_cursorPos-1, m_cursorPos);
SetInsertPosition(m_cursorPos-1, true); SetInsertPosition(m_cursorPos-1, true);
@@ -1047,13 +1047,13 @@ void BufferText::AddChar(uniChar_t unicodeData)
int32_t BufferText::FindLine(etk::UString &data) int32_t BufferText::FindLine(etk::UString &data)
{ {
if ( 0 == data.Size()) { if ( 0 == data.Size()) {
EDN_WARNING("no search data"); APPL_WARNING("no search data");
return 0; return 0;
} }
EDN_INFO("Search data line : \"" << data << "\""); APPL_INFO("Search data line : \"" << data << "\"");
etk::VectorType<uniChar_t> mVectSearch; etk::VectorType<uniChar_t> mVectSearch;
mVectSearch = data.GetVector(); mVectSearch = data.GetVector();
//EDN_INFO("search data Forward : startSearchPos=" << startSearchPos ); //APPL_INFO("search data Forward : startSearchPos=" << startSearchPos );
/* /*
int32_t foundPos; int32_t foundPos;
bool findSomething = m_EdnBuf.SearchForward(0, mVectSearch, &foundPos, true); bool findSomething = m_EdnBuf.SearchForward(0, mVectSearch, &foundPos, true);
@@ -1064,7 +1064,7 @@ int32_t BufferText::FindLine(etk::UString &data)
return 0; return 0;
} }
*/ */
EDN_TODO("Remove for now ..."); APPL_TODO("Remove for now ...");
return 0; return 0;
} }
@@ -1072,7 +1072,7 @@ void BufferText::JumpAtLine(int32_t newLine)
{ {
int32_t positionLine = m_EdnBuf.CountForwardNLines(0, newLine); int32_t positionLine = m_EdnBuf.CountForwardNLines(0, newLine);
m_EdnBuf.Unselect(SELECTION_PRIMARY); m_EdnBuf.Unselect(SELECTION_PRIMARY);
EDN_DEBUG("jump at the line : " << newLine ); APPL_DEBUG("jump at the line : " << newLine );
SetInsertPosition(positionLine); SetInsertPosition(positionLine);
RequestPositionUpdate(true); RequestPositionUpdate(true);
} }
@@ -1094,7 +1094,7 @@ int32_t BufferText::GetCurrentLine(void)
void BufferText::Search(etk::UString &data, bool back, bool caseSensitive, bool wrap, bool regExp) void BufferText::Search(etk::UString &data, bool back, bool caseSensitive, bool wrap, bool regExp)
{ {
EDN_INFO("Search data : \"" << data << "\""); APPL_INFO("Search data : \"" << data << "\"");
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd; int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
bool SelectionIsRect; bool SelectionIsRect;
@@ -1110,21 +1110,21 @@ void BufferText::Search(etk::UString &data, bool back, bool caseSensitive, bool
} }
if ( 0 == data.Size()) { if ( 0 == data.Size()) {
EDN_WARNING("no search data"); APPL_WARNING("no search data");
return; return;
} }
etk::VectorType<uniChar_t> mVectSearch; etk::VectorType<uniChar_t> mVectSearch;
mVectSearch = data.GetVector(); mVectSearch = data.GetVector();
EDN_TODO("Remove for now ..."); APPL_TODO("Remove for now ...");
/* /*
if (false == back) { if (false == back) {
//EDN_INFO("search data Forward : startSearchPos=" << startSearchPos ); //APPL_INFO("search data Forward : startSearchPos=" << startSearchPos );
int32_t foundPos; int32_t foundPos;
bool findSomething = m_EdnBuf.SearchForward(startSearchPos, mVectSearch, &foundPos, caseSensitive); bool findSomething = m_EdnBuf.SearchForward(startSearchPos, mVectSearch, &foundPos, caseSensitive);
if( false == findSomething if( false == findSomething
&& true == wrap) && true == wrap)
{ {
//EDN_INFO("WrapMode !!! 0 ==> end"); //APPL_INFO("WrapMode !!! 0 ==> end");
findSomething = m_EdnBuf.SearchForward(0, mVectSearch, &foundPos, caseSensitive); findSomething = m_EdnBuf.SearchForward(0, mVectSearch, &foundPos, caseSensitive);
} }
// if find data : // if find data :
@@ -1136,13 +1136,13 @@ void BufferText::Search(etk::UString &data, bool back, bool caseSensitive, bool
RequestPositionUpdate(); RequestPositionUpdate();
} }
} else { } else {
//EDN_INFO("search data Backward : " << data.GetDirectPointer() ); //APPL_INFO("search data Backward : " << data.GetDirectPointer() );
int32_t foundPos; int32_t foundPos;
bool findSomething = m_EdnBuf.SearchBackward(startSearchPos, mVectSearch, &foundPos, caseSensitive); bool findSomething = m_EdnBuf.SearchBackward(startSearchPos, mVectSearch, &foundPos, caseSensitive);
if( false == findSomething if( false == findSomething
&& true == wrap) && true == wrap)
{ {
//EDN_INFO("WrapMode !!! end ==> 0"); //APPL_INFO("WrapMode !!! end ==> 0");
findSomething = m_EdnBuf.SearchBackward(m_EdnBuf.Size(), mVectSearch, &foundPos, caseSensitive); findSomething = m_EdnBuf.SearchBackward(m_EdnBuf.Size(), mVectSearch, &foundPos, caseSensitive);
} }
// if find data : // if find data :
@@ -1211,7 +1211,7 @@ void BufferText::Cut(int8_t clipboardID)
Copy(clipboardID); Copy(clipboardID);
// remove data : // remove data :
if (true == haveSelectionActive ) { if (true == haveSelectionActive ) {
EDN_INFO("REMOVE SELECTION"); APPL_INFO("REMOVE SELECTION");
m_EdnBuf.RemoveSelected(SELECTION_PRIMARY); m_EdnBuf.RemoveSelected(SELECTION_PRIMARY);
m_cursorPos = SelectionStart; m_cursorPos = SelectionStart;
} }

View File

@@ -23,7 +23,7 @@
******************************************************************************* *******************************************************************************
*/ */
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <Colorize.h> #include <Colorize.h>
@@ -49,7 +49,7 @@ Colorize::Colorize( etk::UString &newColorName)
haveFG = false; haveFG = false;
haveBG = false; haveBG = false;
SetName(newColorName); SetName(newColorName);
//EDN_INFO("New(Colorise)"); //APPL_INFO("New(Colorise)");
} }
Colorize::Colorize(void) Colorize::Colorize(void)
@@ -70,7 +70,7 @@ Colorize::Colorize(void)
haveFG = false; haveFG = false;
haveBG = false; haveBG = false;
//EDN_INFO("New(Colorise)"); //APPL_INFO("New(Colorise)");
} }
Colorize::~Colorize(void) Colorize::~Colorize(void)
@@ -81,13 +81,13 @@ Colorize::~Colorize(void)
void Colorize::SetName(const char *newColorName) void Colorize::SetName(const char *newColorName)
{ {
//EDN_INFO("color change name : \"%s\" ==> \"%s\"",ColorName.c_str(), newColorName); //APPL_INFO("color change name : \"%s\" ==> \"%s\"",ColorName.c_str(), newColorName);
ColorName = newColorName; ColorName = newColorName;
} }
void Colorize::SetName(etk::UString &newColorName) void Colorize::SetName(etk::UString &newColorName)
{ {
//EDN_INFO("color change name : \"%s\" ==> \"%s\"",ColorName.c_str(), newColorName.c_str()); //APPL_INFO("color change name : \"%s\" ==> \"%s\"",ColorName.c_str(), newColorName.c_str());
ColorName = newColorName; ColorName = newColorName;
} }
@@ -114,7 +114,7 @@ void Colorize::SetFgColor(const char *myColor)
} else { } else {
m_colorFG.alpha = (float)a/255.0; m_colorFG.alpha = (float)a/255.0;
} }
//EDN_INFO(myColor << " ==> r="<< r <<" v="<< v <<" b="<< b ); //APPL_INFO(myColor << " ==> r="<< r <<" v="<< v <<" b="<< b );
} }
void Colorize::SetBgColor(const char *myColor) void Colorize::SetBgColor(const char *myColor)
@@ -146,9 +146,9 @@ void Colorize::SetItalic(bool enable)
italic = enable; italic = enable;
/* /*
if (true == enable) { if (true == enable) {
EDN_INFO("color : \"%s\" enable italic", ColorName.c_str()); APPL_INFO("color : \"%s\" enable italic", ColorName.c_str());
} else { } else {
EDN_INFO("color : \"%s\" disable italic", ColorName.c_str()); APPL_INFO("color : \"%s\" disable italic", ColorName.c_str());
} }
*/ */
} }
@@ -164,9 +164,9 @@ void Colorize::SetBold(bool enable)
bold = enable; bold = enable;
/* /*
if (true == enable) { if (true == enable) {
EDN_INFO("color : \"%s\" enable bold", ColorName.c_str()); APPL_INFO("color : \"%s\" enable bold", ColorName.c_str());
} else { } else {
EDN_INFO("color : \"%s\" disable bold", ColorName.c_str()); APPL_INFO("color : \"%s\" disable bold", ColorName.c_str());
} }
*/ */
} }

View File

@@ -25,7 +25,7 @@
#ifndef __COLORIZE_H__ #ifndef __COLORIZE_H__
#define __COLORIZE_H__ #define __COLORIZE_H__
#include <etk/UString.h>
class Colorize { class Colorize {
public: public:
@@ -50,7 +50,7 @@ class Colorize {
bool GetItalic(void); bool GetItalic(void);
bool GetBold(void); bool GetBold(void);
void Display(int32_t i) { EDN_INFO(" " << i << " : \"" << ColorName << "\"" << " fg="<< m_colorFG.red <<","<< m_colorFG.green <<","<< m_colorFG.blue <<","<< m_colorFG.alpha /*<<" bg="<< m_colorBG.red <<","<< m_colorBG.green <<","<< m_colorBG.blue*/ ); }; void Display(int32_t i) { APPL_INFO(" " << i << " : \"" << ColorName << "\"" << " fg="<< m_colorFG); };
private: private:
etk::UString ColorName; //!< curent color Name etk::UString ColorName; //!< curent color Name

View File

@@ -22,7 +22,7 @@
* *
******************************************************************************* *******************************************************************************
*/ */
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <ColorizeManager.h> #include <ColorizeManager.h>
#include <tinyXML/tinyxml.h> #include <tinyXML/tinyxml.h>
@@ -128,7 +128,7 @@ void classColorManager::OnReceiveMessage(ewol::EObject * CallerObject, const cha
/* /*
switch (id) switch (id)
{ {
case EDN_MSG__RELOAD_COLOR_FILE: case APPL_MSG__RELOAD_COLOR_FILE:
{ {
// Reaload File // Reaload File
// TODO : Check this : Pb in the recopy etk::UString element // TODO : Check this : Pb in the recopy etk::UString element
@@ -163,7 +163,7 @@ void classColorManager::LoadFile(const char * xmlFilename)
listMyColor.Clear(); listMyColor.Clear();
m_fileColor = xmlFilename; m_fileColor = xmlFilename;
EDN_DEBUG("open file (COLOR) \"" << xmlFilename << "\" ? = \"" << m_fileColor << "\""); APPL_DEBUG("open file (COLOR) \"" << xmlFilename << "\" ? = \"" << m_fileColor << "\"");
errorColor = new Colorize(); errorColor = new Colorize();
errorColor->SetBgColor("#000000"); errorColor->SetBgColor("#000000");
errorColor->SetFgColor("#FFFFFF"); errorColor->SetFgColor("#FFFFFF");
@@ -173,22 +173,22 @@ void classColorManager::LoadFile(const char * xmlFilename)
// open the curent File // open the curent File
etk::File fileName(xmlFilename, etk::FILE_TYPE_DATA); etk::File fileName(xmlFilename, etk::FILE_TYPE_DATA);
if (false == fileName.Exist()) { if (false == fileName.Exist()) {
EDN_ERROR("File Does not exist : " << fileName); APPL_ERROR("File Does not exist : " << fileName);
return; return;
} }
int32_t fileSize = fileName.Size(); int32_t fileSize = fileName.Size();
if (0==fileSize) { if (0==fileSize) {
EDN_ERROR("This file is empty : " << fileName); APPL_ERROR("This file is empty : " << fileName);
return; return;
} }
if (false == fileName.fOpenRead()) { if (false == fileName.fOpenRead()) {
EDN_ERROR("Can not open the file : " << fileName); APPL_ERROR("Can not open the file : " << fileName);
return; return;
} }
// allocate data // allocate data
char * fileBuffer = new char[fileSize+5]; char * fileBuffer = new char[fileSize+5];
if (NULL == fileBuffer) { if (NULL == fileBuffer) {
EDN_ERROR("Error Memory allocation size=" << fileSize); APPL_ERROR("Error Memory allocation size=" << fileSize);
return; return;
} }
memset(fileBuffer, 0, (fileSize+5)*sizeof(char)); memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
@@ -201,7 +201,7 @@ void classColorManager::LoadFile(const char * xmlFilename)
TiXmlElement* root = XmlDocument.FirstChildElement( "EdnColor" ); TiXmlElement* root = XmlDocument.FirstChildElement( "EdnColor" );
if (NULL == root ) { if (NULL == root ) {
EDN_ERROR(PFX"(l ?) main node not find: \"EdnColor\" in \"" << xmlFilename << "\""); APPL_ERROR(PFX"(l ?) main node not find: \"EdnColor\" in \"" << xmlFilename << "\"");
return; return;
} else { } else {
TiXmlNode * pNode = root->FirstChild(); TiXmlNode * pNode = root->FirstChild();
@@ -220,7 +220,7 @@ void classColorManager::LoadFile(const char * xmlFilename)
const char *colorName = pGuiNode->ToElement()->Attribute("name"); const char *colorName = pGuiNode->ToElement()->Attribute("name");
int32_t id = 0; int32_t id = 0;
if (NULL == colorName) { if (NULL == colorName) {
EDN_ERROR("(l "<< pGuiNode->Row() <<") node with no name"); APPL_ERROR("(l "<< pGuiNode->Row() <<") node with no name");
// get next node element // get next node element
pGuiNode = pGuiNode->NextSibling(); pGuiNode = pGuiNode->NextSibling();
continue; continue;
@@ -246,7 +246,7 @@ void classColorManager::LoadFile(const char * xmlFilename)
} else if (!strcmp(colorName, "LIST_textModify")) { } else if (!strcmp(colorName, "LIST_textModify")) {
id = COLOR_LIST_TEXT_MODIFY; id = COLOR_LIST_TEXT_MODIFY;
} else { } else {
EDN_ERROR("(l "<<pGuiNode->Row()<<") Unknown basic gui color : \"" << colorName << "\"" ); APPL_ERROR("(l "<<pGuiNode->Row()<<") Unknown basic gui color : \"" << colorName << "\"" );
// get next node element // get next node element
pGuiNode = pGuiNode->NextSibling(); pGuiNode = pGuiNode->NextSibling();
continue; continue;
@@ -267,13 +267,13 @@ void classColorManager::LoadFile(const char * xmlFilename)
basicColors[id].alpha = (float)a/255.0; basicColors[id].alpha = (float)a/255.0;
} }
/* /*
EDN_INFO(" Specify color for system ID="<< id ); APPL_INFO(" Specify color for system ID="<< id );
EDN_INFO(" " << color << " ==> r="<< r <<" v="<< v <<" b="<< b ); APPL_INFO(" " << color << " ==> r="<< r <<" v="<< v <<" b="<< b );
EDN_INFO(" " << color << " ==> r="<< basicColors[id].red <<" v="<< basicColors[id].green <<" b="<< basicColors[id].blue ); APPL_INFO(" " << color << " ==> r="<< basicColors[id].red <<" v="<< basicColors[id].green <<" b="<< basicColors[id].blue );
*/ */
} }
} else { } else {
EDN_ERROR("(l "<<pGuiNode->Row()<<") node not suported : \""<<pGuiNode->Value()<<"\" must be [color]"); APPL_ERROR("(l "<<pGuiNode->Row()<<") node not suported : \""<<pGuiNode->Value()<<"\" must be [color]");
} }
// get next node element // get next node element
pGuiNode = pGuiNode->NextSibling(); pGuiNode = pGuiNode->NextSibling();
@@ -292,13 +292,13 @@ void classColorManager::LoadFile(const char * xmlFilename)
// get the name of the Chaine // get the name of the Chaine
const char *colorName = pGuiNode->ToElement()->Attribute("name"); const char *colorName = pGuiNode->ToElement()->Attribute("name");
if (NULL == colorName) { if (NULL == colorName) {
EDN_ERROR(PFX"(l "<< pGuiNode->Row() <<") node with no name"); APPL_ERROR(PFX"(l "<< pGuiNode->Row() <<") node with no name");
// get next node element // get next node element
pGuiNode = pGuiNode->NextSibling(); pGuiNode = pGuiNode->NextSibling();
continue; continue;
} else { } else {
myNewColor->SetName(colorName); myNewColor->SetName(colorName);
//EDN_INFO(PFX"Add a new color in the panel : \"%s\"", colorName); //APPL_INFO(PFX"Add a new color in the panel : \"%s\"", colorName);
} }
const char *colorBG = pGuiNode->ToElement()->Attribute("BG"); const char *colorBG = pGuiNode->ToElement()->Attribute("BG");
@@ -326,12 +326,12 @@ void classColorManager::LoadFile(const char * xmlFilename)
} }
listMyColor.PushBack(myNewColor); listMyColor.PushBack(myNewColor);
} else { } else {
EDN_ERROR(PFX"(l "<<pNode->Row()<<") node not suported : \""<<pNode->Value()<<"\" must be [color]"); APPL_ERROR(PFX"(l "<<pNode->Row()<<") node not suported : \""<<pNode->Value()<<"\" must be [color]");
} }
pGuiNode = pGuiNode->NextSibling(); pGuiNode = pGuiNode->NextSibling();
} }
} else { } else {
EDN_ERROR(PFX"(l "<<pNode->Row()<<") node not suported : \""<<pNode->Value()<<"\" must be [gui,syntax]"); APPL_ERROR(PFX"(l "<<pNode->Row()<<") node not suported : \""<<pNode->Value()<<"\" must be [gui,syntax]");
} }
// get next node element // get next node element
pNode = pNode->NextSibling(); pNode = pNode->NextSibling();
@@ -340,8 +340,8 @@ void classColorManager::LoadFile(const char * xmlFilename)
if (NULL != fileBuffer) { if (NULL != fileBuffer) {
delete[] fileBuffer; delete[] fileBuffer;
} }
//SendMessage(EDN_MSG__COLOR_HAS_CHANGE); //SendMessage(APPL_MSG__COLOR_HAS_CHANGE);
//SendMessage(EDN_MSG__USER_DISPLAY_CHANGE); //SendMessage(APPL_MSG__USER_DISPLAY_CHANGE);
} }
// TODO : Remove this ... // TODO : Remove this ...
@@ -354,7 +354,7 @@ Colorize *classColorManager::Get(const char *colorName)
return listMyColor[i]; return listMyColor[i];
} }
} }
EDN_ERROR(PFX"Color does not Existed ["<< colorName<<"]" ); APPL_ERROR(PFX"Color does not Existed ["<< colorName<<"]" );
// an error // an error
return errorColor; return errorColor;
} }
@@ -397,10 +397,10 @@ bool classColorManager::Exist(etk::UString &colorName)
void classColorManager::DisplayListOfColor(void) void classColorManager::DisplayListOfColor(void)
{ {
int32_t i; int32_t i;
EDN_INFO(PFX"List of ALL COLOR : "); APPL_INFO(PFX"List of ALL COLOR : ");
for (i=0; i<listMyColor.Size(); i++) { for (i=0; i<listMyColor.Size(); i++) {
//etk::UString elementName = listMyColor[i]->GetName(); //etk::UString elementName = listMyColor[i]->GetName();
//EDN_INFO(i << " : \"" << elementName.c_str() << "\"" ); //APPL_INFO(i << " : \"" << elementName.c_str() << "\"" );
listMyColor[i]->Display(i); listMyColor[i]->Display(i);
} }
} }

View File

@@ -1,6 +1,6 @@
/** /**
******************************************************************************* *******************************************************************************
* @file tools_debug.h * @file Debug.h
* @brief Editeur De N'ours : log implementation * @brief Editeur De N'ours : log implementation
* @author Edouard DUPIN * @author Edouard DUPIN
* @date 08/06/2010 * @date 08/06/2010
@@ -24,4 +24,4 @@
*/ */
const char * ednLog = "edn "; const char * applLog = "edn ";

View File

@@ -29,44 +29,44 @@
#include <etk/Types.h> #include <etk/Types.h>
#include <etk/Debug.h> #include <etk/Debug.h>
extern const char * ednLog; extern const char * applLog;
#define APPL_CRITICAL(data) ETK_CRITICAL(ednLog, data) #define APPL_CRITICAL(data) ETK_CRITICAL(applLog, data)
// General // General
#if APPL_DEBUG_LEVEL > 0 #if APPL_DEBUG_LEVEL > 0
# define APPL_WARNING(data) ETK_WARNING(ednLog, data) # define APPL_WARNING(data) ETK_WARNING(applLog, data)
# define APPL_ERROR(data) ETK_ERROR(ednLog, data) # define APPL_ERROR(data) ETK_ERROR(applLog, data)
#else #else
# define APPL_WARNING(data) do {}while(0) # define APPL_WARNING(data) do {}while(0)
# define APPL_ERROR(data) do {}while(0) # define APPL_ERROR(data) do {}while(0)
#endif #endif
#if APPL_DEBUG_LEVEL > 1 #if APPL_DEBUG_LEVEL > 1
# define APPL_INFO(data) ETK_INFO(ednLog, data) # define APPL_INFO(data) ETK_INFO(applLog, data)
#else #else
# define APPL_INFO(data) do {}while(0) # define APPL_INFO(data) do {}while(0)
#endif #endif
#if APPL_DEBUG_LEVEL > 2 #if APPL_DEBUG_LEVEL > 2
# define APPL_DEBUG(data) ETK_DEBUG(ednLog, data) # define APPL_DEBUG(data) ETK_DEBUG(applLog, data)
#else #else
# define APPL_DEBUG(data) do {}while(0) # define APPL_DEBUG(data) do {}while(0)
#endif #endif
#if APPL_DEBUG_LEVEL > 3 #if APPL_DEBUG_LEVEL > 3
# define APPL_VERBOSE(data) ETK_VERBOSE(ednLog, data) # define APPL_VERBOSE(data) ETK_VERBOSE(applLog, data)
#else #else
# define APPL_VERBOSE(data) do {}while(0) # define APPL_VERBOSE(data) do {}while(0)
#endif #endif
#define APPL_TODO(data) ETK_WARNING(ednLog, "TODO : " << data) #define APPL_TODO(data) ETK_WARNING(applLog, "TODO : " << data)
#define APPL_ASSERT(cond, data) ETK_ASSERT(ednLog, cond, data) #define APPL_ASSERT(cond, data) ETK_ASSERT(applLog, cond, data)
#if APPL_DEBUG_LEVEL > 1 #if APPL_DEBUG_LEVEL > 1
# define APPL_CHECK_INOUT(cond) ETK_CHECK_INOUT_ASSERT(ednLog, cond) # define APPL_CHECK_INOUT(cond) ETK_CHECK_INOUT_ASSERT(applLog, cond)
#elif APPL_DEBUG_LEVEL > 0 #elif APPL_DEBUG_LEVEL > 0
# define APPL_CHECK_INOUT(cond) ETK_CHECK_INOUT_WARNING(ednLog, cond) # define APPL_CHECK_INOUT(cond) ETK_CHECK_INOUT_WARNING(applLog, cond)
#else #else
# define APPL_CHECK_INOUT(cond) do { } while (0) # define APPL_CHECK_INOUT(cond) do { } while (0)
#endif #endif

View File

@@ -23,7 +23,7 @@
******************************************************************************* *******************************************************************************
*/ */
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <Display.h> #include <Display.h>
#include <BufferView.h> #include <BufferView.h>
@@ -174,7 +174,7 @@ bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToW
bool BufferView::OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y) bool BufferView::OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y)
{ {
if (1 == IdInput && typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) { if (1 == IdInput && typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) {
EDN_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw ); APPL_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw );
int32_t selectBuf = BufferManager::WitchBuffer(raw+1); int32_t selectBuf = BufferManager::WitchBuffer(raw+1);
if ( 0 <= selectBuf) { if ( 0 <= selectBuf) {
m_selectedID = raw; m_selectedID = raw;

View File

@@ -25,7 +25,7 @@
#ifndef __BUFFER_VIEW_H__ #ifndef __BUFFER_VIEW_H__
#define __BUFFER_VIEW_H__ #define __BUFFER_VIEW_H__
#include <tools_debug.h> #include <appl/Debug.h>
#include <CodeView.h> #include <CodeView.h>
#include <BufferManager.h> #include <BufferManager.h>
#include <Display.h> #include <Display.h>

View File

@@ -26,7 +26,7 @@
#include <CodeView.h> #include <CodeView.h>
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <Display.h> #include <Display.h>
#include <CodeView.h> #include <CodeView.h>
@@ -172,7 +172,7 @@ void CodeView::OnRegenerateDisplay(void)
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y); m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
int64_t stopTime = GetCurrentTime(); int64_t stopTime = GetCurrentTime();
EDN_DEBUG("Display Code Generation = " << stopTime - startTime << " milli-s"); APPL_DEBUG("Display Code Generation = " << stopTime - startTime << " milli-s");
// call the herited class... // call the herited class...
WidgetScrooled::OnRegenerateDisplay(); WidgetScrooled::OnRegenerateDisplay();
@@ -183,7 +183,7 @@ void CodeView::OnRegenerateDisplay(void)
bool CodeView::OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData) bool CodeView::OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData)
{ {
//EDN_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent); //APPL_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent);
if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) { if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) {
BufferManager::Get(m_bufferID)->AddChar(unicodeData); BufferManager::Get(m_bufferID)->AddChar(unicodeData);
MarkToReedraw(); MarkToReedraw();
@@ -259,7 +259,7 @@ bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent,
if (yyy<0) { if (yyy<0) {
yyy = 0; yyy = 0;
} }
//EDN_INFO("mouse-motion BT1 %d, %d", xxx, yyy); //APPL_INFO("mouse-motion BT1 %d, %d", xxx, yyy);
BufferManager::Get(m_bufferID)->MouseSelectFromCursorTo(m_fontNormal, xxx+m_originScrooled.x, yyy+m_originScrooled.y); BufferManager::Get(m_bufferID)->MouseSelectFromCursorTo(m_fontNormal, xxx+m_originScrooled.x, yyy+m_originScrooled.y);
MarkToReedraw(); MarkToReedraw();
} }
@@ -287,12 +287,12 @@ bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent,
void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data) void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
{ {
ewol::WidgetScrooled::OnReceiveMessage(CallerObject, eventId, data); ewol::WidgetScrooled::OnReceiveMessage(CallerObject, eventId, data);
EDN_DEBUG("Extern Event : " << CallerObject << " type : " << eventId << " data=\"" << data << "\""); APPL_DEBUG("Extern Event : " << CallerObject << " type : " << eventId << " data=\"" << data << "\"");
if(eventId == ednMsgBufferId) { if(eventId == ednMsgBufferId) {
int32_t bufferID = 0; int32_t bufferID = 0;
sscanf(data.Utf8Data(), "%d", &bufferID); sscanf(data.Utf8Data(), "%d", &bufferID);
EDN_INFO("Select a new Buffer ... " << bufferID); APPL_INFO("Select a new Buffer ... " << bufferID);
m_bufferID = bufferID; m_bufferID = bufferID;
// TODO : need to update the state of the file and the filenames ... // TODO : need to update the state of the file and the filenames ...
} else if (eventId == ednMsgGuiCopy) { } else if (eventId == ednMsgGuiCopy) {
@@ -308,13 +308,13 @@ void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * event
} else if (eventId == ednMsgGuiRm) { } else if (eventId == ednMsgGuiRm) {
// data : "Word" "Line" "Paragraph" // data : "Word" "Line" "Paragraph"
if (data == "Word") { if (data == "Word") {
EDN_WARNING(" on event " << eventId << " data=\"" << data << "\" ==> not coded" ); APPL_WARNING(" on event " << eventId << " data=\"" << data << "\" ==> not coded" );
} else if (data == "Line") { } else if (data == "Line") {
BufferManager::Get(m_bufferID)->RemoveLine(); BufferManager::Get(m_bufferID)->RemoveLine();
} else if (data == "Paragraph") { } else if (data == "Paragraph") {
EDN_WARNING(" on event " << eventId << " data=\"" << data << "\" ==> not coded" ); APPL_WARNING(" on event " << eventId << " data=\"" << data << "\" ==> not coded" );
} else { } else {
EDN_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" ); APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
} }
} else if (eventId == ednMsgGuiSelect) { } else if (eventId == ednMsgGuiSelect) {
// data : "ALL" "NONE" // data : "ALL" "NONE"
@@ -323,7 +323,7 @@ void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * event
} else if (data == "NONE") { } else if (data == "NONE") {
BufferManager::Get(m_bufferID)->SelectNone(); BufferManager::Get(m_bufferID)->SelectNone();
} else { } else {
EDN_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" ); APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
} }
} else if (eventId == ednMsgGuiChangeCharset) { } else if (eventId == ednMsgGuiChangeCharset) {
// data : "UTF-8" "ISO-8859-1" "ISO-8859-15" // data : "UTF-8" "ISO-8859-1" "ISO-8859-15"
@@ -334,42 +334,42 @@ void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * event
} else if (data == "ISO-8859-15") { } else if (data == "ISO-8859-15") {
BufferManager::Get(m_bufferID)->SetCharset(unicode::EDN_CHARSET_ISO_8859_15); BufferManager::Get(m_bufferID)->SetCharset(unicode::EDN_CHARSET_ISO_8859_15);
} else { } else {
EDN_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" ); APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
} }
} }
/* /*
switch (id) switch (id)
{ {
case EDN_MSG__CURRENT_FIND_PREVIOUS: case APPL_MSG__CURRENT_FIND_PREVIOUS:
{ {
etk::UString myDataString; etk::UString myDataString;
SearchData::GetSearch(myDataString); SearchData::GetSearch(myDataString);
BufferManager::Get(m_bufferID)->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() ); BufferManager::Get(m_bufferID)->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
} }
break; break;
case EDN_MSG__CURRENT_FIND_NEXT: case APPL_MSG__CURRENT_FIND_NEXT:
{ {
etk::UString myDataString; etk::UString myDataString;
SearchData::GetSearch(myDataString); SearchData::GetSearch(myDataString);
BufferManager::Get(m_bufferID)->Search(myDataString, false, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() ); BufferManager::Get(m_bufferID)->Search(myDataString, false, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
} }
break; break;
case EDN_MSG__CURRENT_REPLACE: case APPL_MSG__CURRENT_REPLACE:
{ {
etk::UString myDataString; etk::UString myDataString;
SearchData::GetReplace(myDataString); SearchData::GetReplace(myDataString);
BufferManager::Get(m_bufferID)->Replace(myDataString); BufferManager::Get(m_bufferID)->Replace(myDataString);
} }
break; break;
case EDN_MSG__CURRENT_REPLACE_ALL: case APPL_MSG__CURRENT_REPLACE_ALL:
break; break;
case EDN_MSG__CURRENT_GOTO_LINE: case APPL_MSG__CURRENT_GOTO_LINE:
if (dataID<0) { if (dataID<0) {
dataID = 0; dataID = 0;
} }
BufferManager::Get(m_bufferID)->JumpAtLine(dataID); BufferManager::Get(m_bufferID)->JumpAtLine(dataID);
break; break;
case EDN_MSG__CURRENT_SET_CHARSET: case APPL_MSG__CURRENT_SET_CHARSET:
BufferManager::Get(m_bufferID)->SetCharset((unicode::charset_te)dataID); BufferManager::Get(m_bufferID)->SetCharset((unicode::charset_te)dataID);
break; break;
} }
@@ -385,14 +385,14 @@ void CodeView::OnGetFocus(void)
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_bufferID); ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_bufferID);
*/ */
ewol::KeyboardShow(ewol::KEYBOARD_MODE_CODE); ewol::KeyboardShow(ewol::KEYBOARD_MODE_CODE);
EDN_INFO("Focus - In"); APPL_INFO("Focus - In");
} }
void CodeView::OnLostFocus(void) void CodeView::OnLostFocus(void)
{ {
ewol::KeyboardHide(); ewol::KeyboardHide();
EDN_INFO("Focus - out"); APPL_INFO("Focus - out");
} }
void CodeView::SetFontSize(int32_t size) void CodeView::SetFontSize(int32_t size)

View File

@@ -26,7 +26,7 @@
#ifndef __CODE_VIEW_H__ #ifndef __CODE_VIEW_H__
#define __CODE_VIEW_H__ #define __CODE_VIEW_H__
#include <tools_debug.h> #include <appl/Debug.h>
#include <CodeView.h> #include <CodeView.h>
#include <BufferManager.h> #include <BufferManager.h>
#include <Display.h> #include <Display.h>

View File

@@ -23,7 +23,7 @@
******************************************************************************* *******************************************************************************
*/ */
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <MainWindows.h> #include <MainWindows.h>
#include <CodeView.h> #include <CodeView.h>
@@ -51,7 +51,7 @@ extern const char * const TYPE_EOBJECT_EDN_MAIN_WINDOWS = "MainWindows";
MainWindows::MainWindows(void) MainWindows::MainWindows(void)
{ {
EDN_DEBUG("CREATE WINDOWS ... "); APPL_DEBUG("CREATE WINDOWS ... ");
ewol::SizerVert * mySizerVert = NULL; ewol::SizerVert * mySizerVert = NULL;
ewol::SizerHori * mySizerHori = NULL; ewol::SizerHori * mySizerHori = NULL;
//ewol::Button * myButton = NULL; //ewol::Button * myButton = NULL;
@@ -168,7 +168,7 @@ MainWindows::~MainWindows(void)
bool MainWindows::CheckObjectType(const char * const objectType) bool MainWindows::CheckObjectType(const char * const objectType)
{ {
if (NULL == objectType) { if (NULL == objectType) {
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_MAIN_WINDOWS << "\" != NULL(pointer) "); APPL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_MAIN_WINDOWS << "\" != NULL(pointer) ");
return false; return false;
} }
if (objectType == TYPE_EOBJECT_EDN_MAIN_WINDOWS) { if (objectType == TYPE_EOBJECT_EDN_MAIN_WINDOWS) {
@@ -177,7 +177,7 @@ bool MainWindows::CheckObjectType(const char * const objectType)
if(true == ewol::Windows::CheckObjectType(objectType)) { if(true == ewol::Windows::CheckObjectType(objectType)) {
return true; return true;
} }
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_MAIN_WINDOWS << "\" != \"" << objectType << "\""); APPL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_MAIN_WINDOWS << "\" != \"" << objectType << "\"");
return false; return false;
} }
} }
@@ -208,7 +208,7 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
{ {
ewol::Windows::OnReceiveMessage(CallerObject, eventId, data); ewol::Windows::OnReceiveMessage(CallerObject, eventId, data);
//EDN_INFO("Receive Event from the main windows ... : widgetid=" << CallerObject << "\"" << eventId << "\" ==> data=\"" << data << "\"" ); //APPL_INFO("Receive Event from the main windows ... : widgetid=" << CallerObject << "\"" << eventId << "\" ==> data=\"" << data << "\"" );
// Open file Section ... // Open file Section ...
if (eventId == ednMsgGuiOpen) { if (eventId == ednMsgGuiOpen) {
ewol::FileChooser* tmpWidget = new ewol::FileChooser(); ewol::FileChooser* tmpWidget = new ewol::FileChooser();
@@ -222,16 +222,16 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
// get widget: // get widget:
ewol::FileChooser * tmpWidget = EWOL_CAST_WIDGET_FILE_CHOOSER(CallerObject); ewol::FileChooser * tmpWidget = EWOL_CAST_WIDGET_FILE_CHOOSER(CallerObject);
if (NULL == tmpWidget) { if (NULL == tmpWidget) {
EDN_ERROR("impossible to get pop_upWidget " << CallerObject); APPL_ERROR("impossible to get pop_upWidget " << CallerObject);
return; return;
} }
// get the filename : // get the filename :
etk::UString tmpData = tmpWidget->GetCompleateFileName(); etk::UString tmpData = tmpWidget->GetCompleateFileName();
EDN_DEBUG("Request opening the file : " << tmpData); APPL_DEBUG("Request opening the file : " << tmpData);
SendMultiCast(ednMsgOpenFile, tmpData); SendMultiCast(ednMsgOpenFile, tmpData);
} else if (eventId == ednMsgGuiSaveAs) { } else if (eventId == ednMsgGuiSaveAs) {
if (data == "") { if (data == "") {
EDN_ERROR("Null data for Save As file ... "); APPL_ERROR("Null data for Save As file ... ");
} else { } else {
m_currentSavingAsIdBuffer = -1; m_currentSavingAsIdBuffer = -1;
if (data == "current") { if (data == "current") {
@@ -241,7 +241,7 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
} }
if (false == BufferManager::Exist(m_currentSavingAsIdBuffer)) { if (false == BufferManager::Exist(m_currentSavingAsIdBuffer)) {
EDN_ERROR("Request saveAs on non existant Buffer ID=" << m_currentSavingAsIdBuffer); APPL_ERROR("Request saveAs on non existant Buffer ID=" << m_currentSavingAsIdBuffer);
} else { } else {
Buffer * myBuffer = BufferManager::Get(m_currentSavingAsIdBuffer); Buffer * myBuffer = BufferManager::Get(m_currentSavingAsIdBuffer);
ewol::FileChooser* tmpWidget = new ewol::FileChooser(); ewol::FileChooser* tmpWidget = new ewol::FileChooser();
@@ -264,12 +264,12 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
// get widget: // get widget:
ewol::FileChooser * tmpWidget = EWOL_CAST_WIDGET_FILE_CHOOSER(CallerObject); ewol::FileChooser * tmpWidget = EWOL_CAST_WIDGET_FILE_CHOOSER(CallerObject);
if (NULL == tmpWidget) { if (NULL == tmpWidget) {
EDN_ERROR("impossible to get pop_upWidget " << CallerObject); APPL_ERROR("impossible to get pop_upWidget " << CallerObject);
return; return;
} }
// get the filename : // get the filename :
etk::UString tmpData = tmpWidget->GetCompleateFileName(); etk::UString tmpData = tmpWidget->GetCompleateFileName();
EDN_DEBUG("Request Saving As file : " << tmpData); APPL_DEBUG("Request Saving As file : " << tmpData);
BufferManager::Get(m_currentSavingAsIdBuffer)->SetFileName(tmpData); BufferManager::Get(m_currentSavingAsIdBuffer)->SetFileName(tmpData);
SendMultiCast(ednMsgGuiSave, m_currentSavingAsIdBuffer); SendMultiCast(ednMsgGuiSave, m_currentSavingAsIdBuffer);

View File

@@ -25,7 +25,7 @@
#ifndef __MAIN_WINDOWS_H__ #ifndef __MAIN_WINDOWS_H__
#define __MAIN_WINDOWS_H__ #define __MAIN_WINDOWS_H__
#include <tools_debug.h> #include <appl/Debug.h>
#include <MsgBroadcast.h> #include <MsgBroadcast.h>
#include <CodeView.h> #include <CodeView.h>

View File

@@ -183,7 +183,7 @@ void Search::Display(GtkWindow *parent)
gtk_widget_show_all(m_localDialog); gtk_widget_show_all(m_localDialog);
} }
if(NULL == m_localDialog) { if(NULL == m_localDialog) {
EDN_ERROR("No search-dialog instance"); APPL_ERROR("No search-dialog instance");
} else { } else {
// update datas : // update datas :
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_CkWrapAround), SearchData::GetWrap()); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_CkWrapAround), SearchData::GetWrap());
@@ -251,39 +251,39 @@ void Search::Hide(void)
/* /*
void Search::OnButtonPrevious(GtkWidget *widget, gpointer data) void Search::OnButtonPrevious(GtkWidget *widget, gpointer data)
{ {
//EDN_INFO("CALLBACK"); //APPL_INFO("CALLBACK");
GeneralSendMessage(EDN_MSG__CURRENT_FIND_PREVIOUS); GeneralSendMessage(APPL_MSG__CURRENT_FIND_PREVIOUS);
} }
void Search::OnButtonNext(GtkWidget *widget, gpointer data) void Search::OnButtonNext(GtkWidget *widget, gpointer data)
{ {
//EDN_INFO("CALLBACK"); //APPL_INFO("CALLBACK");
GeneralSendMessage(EDN_MSG__CURRENT_FIND_NEXT); GeneralSendMessage(APPL_MSG__CURRENT_FIND_NEXT);
} }
void Search::OnButtonReplace(GtkWidget *widget, gpointer data) void Search::OnButtonReplace(GtkWidget *widget, gpointer data)
{ {
//EDN_INFO("CALLBACK"); //APPL_INFO("CALLBACK");
GeneralSendMessage(EDN_MSG__CURRENT_REPLACE); GeneralSendMessage(APPL_MSG__CURRENT_REPLACE);
} }
void Search::OnButtonReplaceAndNext(GtkWidget *widget, gpointer data) void Search::OnButtonReplaceAndNext(GtkWidget *widget, gpointer data)
{ {
//EDN_INFO("CALLBACK"); //APPL_INFO("CALLBACK");
GeneralSendMessage(EDN_MSG__CURRENT_REPLACE); GeneralSendMessage(APPL_MSG__CURRENT_REPLACE);
GeneralSendMessage(EDN_MSG__CURRENT_FIND_NEXT); GeneralSendMessage(APPL_MSG__CURRENT_FIND_NEXT);
} }
void Search::OnButtonQuit(GtkWidget *widget, gpointer data) void Search::OnButtonQuit(GtkWidget *widget, gpointer data)
{ {
//EDN_INFO("CALLBACK"); //APPL_INFO("CALLBACK");
Search * self = static_cast<Search*>(data); Search * self = static_cast<Search*>(data);
self->Destroy(); self->Destroy();
} }
void Search::OnCheckBoxEventWrap(GtkWidget *widget, gpointer data) void Search::OnCheckBoxEventWrap(GtkWidget *widget, gpointer data)
{ {
//EDN_INFO("CALLBACK"); //APPL_INFO("CALLBACK");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
SearchData::SetWrap(true); SearchData::SetWrap(true);
} else { } else {
@@ -293,7 +293,7 @@ void Search::OnCheckBoxEventWrap(GtkWidget *widget, gpointer data)
void Search::OnCheckBoxEventCase(GtkWidget *widget, gpointer data) void Search::OnCheckBoxEventCase(GtkWidget *widget, gpointer data)
{ {
//EDN_INFO("CALLBACK"); //APPL_INFO("CALLBACK");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
SearchData::SetCase(true); SearchData::SetCase(true);
} else { } else {
@@ -303,7 +303,7 @@ void Search::OnCheckBoxEventCase(GtkWidget *widget, gpointer data)
void Search::OnCheckBoxEventRegExp(GtkWidget *widget, gpointer data) void Search::OnCheckBoxEventRegExp(GtkWidget *widget, gpointer data)
{ {
//EDN_INFO("CALLBACK"); //APPL_INFO("CALLBACK");
Search * self = static_cast<Search*>(data); Search * self = static_cast<Search*>(data);
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
SearchData::SetRegExp(true); SearchData::SetRegExp(true);
@@ -316,7 +316,7 @@ void Search::OnCheckBoxEventRegExp(GtkWidget *widget, gpointer data)
void Search::OnEntrySearchChange(GtkWidget *widget, gpointer data) void Search::OnEntrySearchChange(GtkWidget *widget, gpointer data)
{ {
//EDN_INFO("CALLBACK"); //APPL_INFO("CALLBACK");
Search * self = static_cast<Search*>(data); Search * self = static_cast<Search*>(data);
// update research data // update research data
const char *testData = gtk_entry_get_text(GTK_ENTRY(widget)); const char *testData = gtk_entry_get_text(GTK_ENTRY(widget));
@@ -342,7 +342,7 @@ void Search::OnEntrySearchChange(GtkWidget *widget, gpointer data)
void Search::OnEntryReplaceChange(GtkWidget *widget, gpointer data) void Search::OnEntryReplaceChange(GtkWidget *widget, gpointer data)
{ {
//EDN_INFO("CALLBACK"); //APPL_INFO("CALLBACK");
Search * self = static_cast<Search*>(data); Search * self = static_cast<Search*>(data);
// update replace data // update replace data
const char *testData = gtk_entry_get_text(GTK_ENTRY(widget)); const char *testData = gtk_entry_get_text(GTK_ENTRY(widget));

View File

@@ -26,7 +26,7 @@
#ifndef __SEARCH_H__ #ifndef __SEARCH_H__
#define __SEARCH_H__ #define __SEARCH_H__
#include <tools_debug.h> #include <appl/Debug.h>
class Search class Search

View File

@@ -26,7 +26,8 @@
#ifndef __SEARCH_DATA_H__ #ifndef __SEARCH_DATA_H__
#define __SEARCH_DATA_H__ #define __SEARCH_DATA_H__
#include <tools_debug.h> #include <etk/UString.h>
#include <appl/Debug.h>
namespace SearchData namespace SearchData
{ {

View File

@@ -23,7 +23,7 @@
******************************************************************************* *******************************************************************************
*/ */
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <Highlight.h> #include <Highlight.h>
#include <tinyXML/tinyxml.h> #include <tinyXML/tinyxml.h>
@@ -51,22 +51,22 @@ Highlight::Highlight(etk::UString &xmlFilename)
etk::File fileName(xmlFilename, etk::FILE_TYPE_DATA); etk::File fileName(xmlFilename, etk::FILE_TYPE_DATA);
if (false == fileName.Exist()) { if (false == fileName.Exist()) {
EWOL_ERROR("File Does not exist : " << fileName); APPL_ERROR("File Does not exist : " << fileName);
return; return;
} }
int32_t fileSize = fileName.Size(); int32_t fileSize = fileName.Size();
if (0==fileSize) { if (0==fileSize) {
EWOL_ERROR("This file is empty : " << fileName); APPL_ERROR("This file is empty : " << fileName);
return; return;
} }
if (false == fileName.fOpenRead()) { if (false == fileName.fOpenRead()) {
EWOL_ERROR("Can not open the file : " << fileName); APPL_ERROR("Can not open the file : " << fileName);
return; return;
} }
// allocate data // allocate data
char * fileBuffer = new char[fileSize+5]; char * fileBuffer = new char[fileSize+5];
if (NULL == fileBuffer) { if (NULL == fileBuffer) {
EWOL_ERROR("Error Memory allocation size=" << fileSize); APPL_ERROR("Error Memory allocation size=" << fileSize);
return; return;
} }
memset(fileBuffer, 0, (fileSize+5)*sizeof(char)); memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
@@ -77,14 +77,14 @@ Highlight::Highlight(etk::UString &xmlFilename)
// load the XML from the memory // load the XML from the memory
bool loadError = XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8); bool loadError = XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8);
if (false == loadError) { if (false == loadError) {
EDN_ERROR( "can not load Hightlight XML: PARSING error: \"" << xmlFilename << "\""); APPL_ERROR( "can not load Hightlight XML: PARSING error: \"" << xmlFilename << "\"");
return; return;
} }
TiXmlElement* root = XmlDocument.FirstChildElement( "EdnLang" ); TiXmlElement* root = XmlDocument.FirstChildElement( "EdnLang" );
if (NULL == root) { if (NULL == root) {
EDN_ERROR( "can not load Hightlight XML: main node not find: \"EdnLang\""); APPL_ERROR( "can not load Hightlight XML: main node not find: \"EdnLang\"");
return; return;
} }
@@ -98,7 +98,7 @@ Highlight::Highlight(etk::UString &xmlFilename)
} else if (!strcmp(child->Value(), "ext")) { } else if (!strcmp(child->Value(), "ext")) {
const char *myData = child->ToElement()->GetText(); const char *myData = child->ToElement()->GetText();
if (NULL != myData) { if (NULL != myData) {
//EDN_INFO(PFX"(l %d) node fined : %s=\"%s\"", child->Row(), child->Value() , myData); //APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", child->Row(), child->Value() , myData);
etk::UString * myEdnData = new etk::UString(myData); etk::UString * myEdnData = new etk::UString(myData);
m_listExtentions.PushBack(myEdnData); m_listExtentions.PushBack(myEdnData);
} }
@@ -111,7 +111,7 @@ Highlight::Highlight(etk::UString &xmlFilename)
} else if (!strcmp(passChild->Value(), "rule")) { } else if (!strcmp(passChild->Value(), "rule")) {
ParseRules(passChild, m_listHighlightPass1, level1++); ParseRules(passChild, m_listHighlightPass1, level1++);
} else { } else {
EDN_ERROR("(l "<< passChild->Row() << ") node not suported : \""<< passChild->Value() << "\" must be [rule]" ); APPL_ERROR("(l "<< passChild->Row() << ") node not suported : \""<< passChild->Value() << "\" must be [rule]" );
} }
// get the next node element : // get the next node element :
passChild = passChild->NextSibling(); passChild = passChild->NextSibling();
@@ -125,13 +125,13 @@ Highlight::Highlight(etk::UString &xmlFilename)
} else if (!strcmp(passChild->Value(), "rule")) { } else if (!strcmp(passChild->Value(), "rule")) {
ParseRules(passChild, m_listHighlightPass2, level2++); ParseRules(passChild, m_listHighlightPass2, level2++);
} else { } else {
EDN_ERROR("(l "<< passChild->Row() << ") node not suported : \""<< passChild->Value() << "\" must be [rule]" ); APPL_ERROR("(l "<< passChild->Row() << ") node not suported : \""<< passChild->Value() << "\" must be [rule]" );
} }
// get the next node element : // get the next node element :
passChild = passChild->NextSibling(); passChild = passChild->NextSibling();
} }
} else { } else {
EDN_ERROR("(l "<< child->Row() << ") node not suported : \""<< child->Value() << "\" must be [ext,pass1,pass2]" ); APPL_ERROR("(l "<< child->Row() << ") node not suported : \""<< child->Value() << "\" must be [ext,pass1,pass2]" );
} }
// get the next node element : // get the next node element :
child = child->NextSibling(); child = child->NextSibling();
@@ -201,7 +201,7 @@ bool Highlight::FileNameCompatible(etk::File &fileName)
} else { } else {
extention = fileName.GetShortFilename(); extention = fileName.GetShortFilename();
} }
EDN_DEBUG(" try to find : in \"" << fileName << "\" extention:\"" << extention << "\" "); APPL_DEBUG(" try to find : in \"" << fileName << "\" extention:\"" << extention << "\" ");
for (i=0; i<m_listExtentions.Size(); i++) { for (i=0; i<m_listExtentions.Size(); i++) {
if (extention == *m_listExtentions[i] ) { if (extention == *m_listExtentions[i] ) {
@@ -215,18 +215,18 @@ bool Highlight::FileNameCompatible(etk::File &fileName)
void Highlight::Display(void) void Highlight::Display(void)
{ {
int32_t i; int32_t i;
EDN_INFO("List of ALL Highlight : "); APPL_INFO("List of ALL Highlight : ");
for (i=0; i< m_listExtentions.Size(); i++) { for (i=0; i< m_listExtentions.Size(); i++) {
EDN_INFO(" Extention : " << i << " : " << *m_listExtentions[i] ); APPL_INFO(" Extention : " << i << " : " << *m_listExtentions[i] );
} }
// Display all elements // Display all elements
for (i=0; i< m_listHighlightPass1.Size(); i++) { for (i=0; i< m_listHighlightPass1.Size(); i++) {
EDN_INFO(" " << i << " Pass 1 : " << m_listHighlightPass1[i]->GetName() ); APPL_INFO(" " << i << " Pass 1 : " << m_listHighlightPass1[i]->GetName() );
//m_listHighlightPass1[i]->Display(); //m_listHighlightPass1[i]->Display();
} }
// Display all elements // 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() ); APPL_INFO(" " << i << " Pass 2 : " << m_listHighlightPass2[i]->GetName() );
//m_listHighlightPass2[i]->Display(); //m_listHighlightPass2[i]->Display();
} }
} }
@@ -243,26 +243,26 @@ void Highlight::Parse(int32_t start,
if (0 > addingPos) { if (0 > addingPos) {
addingPos = 0; addingPos = 0;
} }
//EDN_DEBUG("Parse element 0 => " << m_listHighlightPass1.Size() << " ==> position search: (" << start << "," << stop << ")" ); //APPL_DEBUG("Parse element 0 => " << m_listHighlightPass1.Size() << " ==> position search: (" << start << "," << stop << ")" );
int32_t elementStart = start; int32_t elementStart = start;
int32_t elementStop = stop; int32_t elementStop = stop;
colorInformation_ts resultat; colorInformation_ts resultat;
while (elementStart<elementStop) { while (elementStart<elementStop) {
//EDN_DEBUG("Parse element in the buffer id=" << elementStart); //APPL_DEBUG("Parse element in the buffer id=" << elementStart);
//try to fond the HL in ALL of we have //try to fond the HL in ALL of we have
for (int32_t jjj=0; jjj<m_listHighlightPass1.Size(); jjj++){ for (int32_t jjj=0; jjj<m_listHighlightPass1.Size(); jjj++){
resultFind_te ret = HLP_FIND_OK; resultFind_te ret = HLP_FIND_OK;
//EDN_DEBUG("Parse HL id=" << jjj << " position search: (" << start << "," << buffer.Size() << ")" ); //APPL_DEBUG("Parse HL id=" << jjj << " position search: (" << start << "," << buffer.Size() << ")" );
// Stop the search to the end (to get the end of the pattern) // Stop the search to the end (to get the end of the pattern)
ret = m_listHighlightPass1[jjj]->Find(elementStart, buffer.Size(), resultat, buffer); ret = m_listHighlightPass1[jjj]->Find(elementStart, buffer.Size(), resultat, buffer);
if (HLP_FIND_ERROR != ret) { if (HLP_FIND_ERROR != ret) {
//EDN_INFO("Find Pattern in the Buffer : (" << resultat.beginStart << "," << resultat.endStop << ")" ); //APPL_INFO("Find Pattern in the Buffer : (" << resultat.beginStart << "," << resultat.endStop << ")" );
// Remove element in the current List where the current Element have a end inside the next... // Remove element in the current List where the current Element have a end inside the next...
int32_t kkk=addingPos; int32_t kkk=addingPos;
while(kkk < metaData.Size() ) { while(kkk < metaData.Size() ) {
if (metaData[kkk].beginStart <= resultat.endStop) { if (metaData[kkk].beginStart <= resultat.endStop) {
// Remove element // Remove element
//EDN_INFO("Erase element=" << kkk); //APPL_INFO("Erase element=" << kkk);
metaData.EraseLen(kkk, kkk+1); metaData.EraseLen(kkk, kkk+1);
// Increase the end of search // Increase the end of search
if (kkk < metaData.Size()) { if (kkk < metaData.Size()) {
@@ -279,7 +279,7 @@ void Highlight::Parse(int32_t start,
} }
// Add curent element in the list ... // Add curent element in the list ...
metaData.Insert(addingPos, resultat); metaData.Insert(addingPos, resultat);
//EDN_DEBUG("INSERT at "<< addingPos << " S=" << resultat.beginStart << " E=" << resultat.endStop ); //APPL_DEBUG("INSERT at "<< addingPos << " S=" << resultat.beginStart << " E=" << resultat.endStop );
// Update the current research starting element: (Set position at the end of the current element // Update the current research starting element: (Set position at the end of the current element
elementStart = resultat.endStop-1; elementStart = resultat.endStop-1;
// increment the position of insertion: // increment the position of insertion:
@@ -303,21 +303,21 @@ void Highlight::Parse2(int32_t start,
etk::VectorType<colorInformation_ts> &metaData, etk::VectorType<colorInformation_ts> &metaData,
EdnVectorBuf &buffer) EdnVectorBuf &buffer)
{ {
//EDN_DEBUG("Parse element 0 => " << m_listHighlightPass2.size() << " ==> position search: (" << start << "," << stop << ")" ); //APPL_DEBUG("Parse element 0 => " << m_listHighlightPass2.size() << " ==> position search: (" << start << "," << stop << ")" );
int32_t elementStart = start; int32_t elementStart = start;
int32_t elementStop = stop; int32_t elementStop = stop;
colorInformation_ts resultat; colorInformation_ts resultat;
while (elementStart<elementStop) { while (elementStart<elementStop) {
//EDN_DEBUG("Parse element in the buffer id=" << elementStart); //APPL_DEBUG("Parse element in the buffer id=" << elementStart);
//try to fond the HL in ALL of we have //try to fond the HL in ALL of we have
int32_t jjj; int32_t jjj;
for (jjj=0; jjj<m_listHighlightPass2.Size(); jjj++){ for (jjj=0; jjj<m_listHighlightPass2.Size(); jjj++){
resultFind_te ret = HLP_FIND_OK; resultFind_te ret = HLP_FIND_OK;
//EDN_DEBUG("Parse HL id=" << jjj << " position search: (" << start << "," << buffer.Size() << ")" ); //APPL_DEBUG("Parse HL id=" << jjj << " position search: (" << start << "," << buffer.Size() << ")" );
// Stop the search to the end (to get the end of the pattern) // Stop the search to the end (to get the end of the pattern)
ret = m_listHighlightPass2[jjj]->Find(elementStart, elementStop, resultat, buffer); ret = m_listHighlightPass2[jjj]->Find(elementStart, elementStop, resultat, buffer);
if (HLP_FIND_ERROR != ret) { if (HLP_FIND_ERROR != ret) {
//EDN_INFO("Find Pattern in the Buffer : (" << resultat.beginStart << "," << resultat.endStop << ")" ); //APPL_INFO("Find Pattern in the Buffer : (" << resultat.beginStart << "," << resultat.endStop << ")" );
// Add curent element in the list ... // Add curent element in the list ...
metaData.PushBack(resultat); metaData.PushBack(resultat);
elementStart = resultat.endStop-1; elementStart = resultat.endStop-1;

View File

@@ -42,6 +42,7 @@ extern "C" {
} colorInformation_ts; } colorInformation_ts;
} }
#include <etk/File.h>
#include <HighlightPattern.h> #include <HighlightPattern.h>
#include <Colorize.h> #include <Colorize.h>
#include <EdnVectorBuf.h> #include <EdnVectorBuf.h>

View File

@@ -23,7 +23,7 @@
******************************************************************************* *******************************************************************************
*/ */
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <HighlightManager.h> #include <HighlightManager.h>
#include <ewol/EObject.h> #include <ewol/EObject.h>
@@ -67,7 +67,7 @@ class localClassHighlightManager: public ewol::EObject
bool CheckObjectType(const char * const objectType) bool CheckObjectType(const char * const objectType)
{ {
if (NULL == objectType) { if (NULL == objectType) {
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_HIGHLIGHT_MANAGER << "\" != NULL(pointer) "); APPL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_HIGHLIGHT_MANAGER << "\" != NULL(pointer) ");
return false; return false;
} }
if (objectType == TYPE_EOBJECT_EDN_HIGHLIGHT_MANAGER) { if (objectType == TYPE_EOBJECT_EDN_HIGHLIGHT_MANAGER) {
@@ -76,7 +76,7 @@ class localClassHighlightManager: public ewol::EObject
if(true == ewol::EObject::CheckObjectType(objectType)) { if(true == ewol::EObject::CheckObjectType(objectType)) {
return true; return true;
} }
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_HIGHLIGHT_MANAGER << "\" != \"" << objectType << "\""); APPL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_HIGHLIGHT_MANAGER << "\" != \"" << objectType << "\"");
return false; return false;
} }
} }
@@ -104,8 +104,8 @@ class localClassHighlightManager: public ewol::EObject
/* /*
switch (id) switch (id)
{ {
case EDN_MSG__COLOR_HAS_CHANGE: case APPL_MSG__COLOR_HAS_CHANGE:
EDN_INFO("UPDATE the color pointer on the HL"); APPL_INFO("UPDATE the color pointer on the HL");
for (int32_t i=0; i<listHighlight.Size(); i++) { for (int32_t i=0; i<listHighlight.Size(); i++) {
if (NULL != listHighlight[i]) { if (NULL != listHighlight[i]) {
listHighlight[i]->ReloadColor(); listHighlight[i]->ReloadColor();
@@ -188,20 +188,20 @@ static localClassHighlightManager * localManager = NULL;
void HighlightManager::Init(void) void HighlightManager::Init(void)
{ {
if (NULL == localManager) { if (NULL == localManager) {
EWOL_ERROR("HighlightManager ==> already exist, just unlink the previous ..."); APPL_ERROR("HighlightManager ==> already exist, just unlink the previous ...");
localManager = NULL; localManager = NULL;
} }
localManager = new localClassHighlightManager(); localManager = new localClassHighlightManager();
if (NULL == localManager) { if (NULL == localManager) {
EWOL_CRITICAL("Allocation of HighlightManager not done ..."); APPL_CRITICAL("Allocation of HighlightManager not done ...");
} }
} }
void HighlightManager::UnInit(void) void HighlightManager::UnInit(void)
{ {
if (NULL == localManager) { if (NULL == localManager) {
EWOL_ERROR("HighlightManager ==> request UnInit, but does not exist ..."); APPL_ERROR("HighlightManager ==> request UnInit, but does not exist ...");
return; return;
} }
ewol::EObjectManager::MarkToRemoved(localManager); ewol::EObjectManager::MarkToRemoved(localManager);

View File

@@ -22,7 +22,7 @@
* *
******************************************************************************* *******************************************************************************
*/ */
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <HighlightPattern.h> #include <HighlightPattern.h>
#include <ColorizeManager.h> #include <ColorizeManager.h>
@@ -102,24 +102,24 @@ void HighlightPattern::ReloadColor(void)
void HighlightPattern::Display(void) void HighlightPattern::Display(void)
{ {
/* /*
EDN_INFO("patern : \"" << m_paternName << "\" level=" << m_level ); APPL_INFO("patern : \"" << m_paternName << "\" level=" << m_level );
EDN_INFO(" ==> colorName \"" << m_colorName << "\""); APPL_INFO(" ==> colorName \"" << m_colorName << "\"");
EDN_INFO(" ==> regExpStart \"" << m_regExpStart->GetRegExp() << "\""); APPL_INFO(" ==> regExpStart \"" << m_regExpStart->GetRegExp() << "\"");
EDN_INFO(" ==> regExpStop \"" << m_regExpStop->GetRegExp() << "\""); APPL_INFO(" ==> regExpStop \"" << m_regExpStop->GetRegExp() << "\"");
if (true == m_haveStopPatern) { if (true == m_haveStopPatern) {
EDN_INFO(" ==> stop pattern: YES"); APPL_INFO(" ==> stop pattern: YES");
} else { } else {
EDN_INFO(" ==> stop pattern: NO"); APPL_INFO(" ==> stop pattern: NO");
} }
if (true == m_multiline) { if (true == m_multiline) {
EDN_INFO(" ==> multiline pattern: YES"); APPL_INFO(" ==> multiline pattern: YES");
} else { } else {
EDN_INFO(" ==> multiline pattern: NO"); APPL_INFO(" ==> multiline pattern: NO");
} }
*/ */
// Display all elements // Display all elements
for (int32_t i=0; i< m_subPatern.Size(); i++) { for (int32_t i=0; i< m_subPatern.Size(); i++) {
EDN_INFO(" " << i << " SubPattern : " << m_subPatern[i]->GetName() ); APPL_INFO(" " << i << " SubPattern : " << m_subPatern[i]->GetName() );
m_subPatern[i]->Display(); m_subPatern[i]->Display();
} }
} }
@@ -148,7 +148,7 @@ void HighlightPattern::ParseRules(TiXmlNode *child, int32_t level)
if (NULL != xChild) { if (NULL != xChild) {
const char *myData = xChild->GetText(); const char *myData = xChild->GetText();
if (myData) { if (myData) {
//EDN_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData); //APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
etk::UString myEdnData = myData; etk::UString myEdnData = myData;
SetColor(myEdnData); SetColor(myEdnData);
} }
@@ -157,7 +157,7 @@ void HighlightPattern::ParseRules(TiXmlNode *child, int32_t level)
if (NULL != xChild) { if (NULL != xChild) {
const char *myData = xChild->GetText(); const char *myData = xChild->GetText();
if (myData) { if (myData) {
//EDN_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData); //APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
etk::UString myEdnData = myData; etk::UString myEdnData = myData;
SetPaternStart(myEdnData); SetPaternStart(myEdnData);
} }
@@ -166,7 +166,7 @@ void HighlightPattern::ParseRules(TiXmlNode *child, int32_t level)
if (NULL != xChild) { if (NULL != xChild) {
const char *myData = xChild->GetText(); const char *myData = xChild->GetText();
if (myData) { if (myData) {
//EDN_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData); //APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
etk::UString myEdnData = myData; etk::UString myEdnData = myData;
SetPaternStop(myEdnData); SetPaternStop(myEdnData);
} }
@@ -175,7 +175,7 @@ void HighlightPattern::ParseRules(TiXmlNode *child, int32_t level)
if (NULL != xChild) { if (NULL != xChild) {
const char *myData = xChild->GetText(); const char *myData = xChild->GetText();
if (myData) { if (myData) {
//EDN_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData); //APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
etk::UString myEdnData = myData; etk::UString myEdnData = myData;
SetEscapeChar(myEdnData); SetEscapeChar(myEdnData);
} }
@@ -209,7 +209,7 @@ void HighlightPattern::ParseRules(TiXmlNode *child, int32_t level)
*/ */
resultFind_te HighlightPattern::Find(int32_t start, int32_t stop, colorInformation_ts &resultat, EdnVectorBuf &buffer) resultFind_te HighlightPattern::Find(int32_t start, int32_t stop, colorInformation_ts &resultat, EdnVectorBuf &buffer)
{ {
//EDN_DEBUG(" try to find the element"); //APPL_DEBUG(" try to find the element");
resultat.beginStart = -1; resultat.beginStart = -1;
resultat.beginStop = -1; resultat.beginStop = -1;
resultat.endStart = -1; resultat.endStart = -1;
@@ -226,7 +226,7 @@ resultFind_te HighlightPattern::Find(int32_t start, int32_t stop, colorInformati
resultat.endStop = m_regExpStart->Stop(); resultat.endStop = m_regExpStart->Stop();
return HLP_FIND_OK; return HLP_FIND_OK;
} }
//EDN_DEBUG("NOT find hightlightpatern ..."); //APPL_DEBUG("NOT find hightlightpatern ...");
} else { } else {
// try while we find the first element // try while we find the first element
if (true == m_regExpStart->ProcessOneElement(buffer, start, stop, m_escapeChar)) { if (true == m_regExpStart->ProcessOneElement(buffer, start, stop, m_escapeChar)) {
@@ -243,7 +243,7 @@ resultFind_te HighlightPattern::Find(int32_t start, int32_t stop, colorInformati
return HLP_FIND_OK_NO_END; return HLP_FIND_OK_NO_END;
} }
} }
//EDN_DEBUG("NOT find start hightlightpatern ..."); //APPL_DEBUG("NOT find start hightlightpatern ...");
} }
return HLP_FIND_ERROR; return HLP_FIND_ERROR;
} }

View File

@@ -23,7 +23,7 @@
******************************************************************************* *******************************************************************************
*/ */
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <CTagsManager.h> #include <CTagsManager.h>
#include <BufferManager.h> #include <BufferManager.h>
@@ -98,11 +98,11 @@ bool CTagsManager::OnEventAreaExternal(int32_t widgetID, const char * generateEv
/* /*
switch (id) switch (id)
{ {
case EDN_MSG__BUFFER_CHANGE_CURRENT: case APPL_MSG__BUFFER_CHANGE_CURRENT:
m_currentSelectedID = dataID; m_currentSelectedID = dataID;
break; break;
case EDN_MSG__OPEN_CTAGS: case APPL_MSG__OPEN_CTAGS:
EDN_INFO("Request opening ctag file"); APPL_INFO("Request opening ctag file");
{ {
GtkWidget *dialog = gtk_file_chooser_dialog_new( "Open Exuberant Ctags File", NULL, GtkWidget *dialog = gtk_file_chooser_dialog_new( "Open Exuberant Ctags File", NULL,
GTK_FILE_CHOOSER_ACTION_OPEN, GTK_FILE_CHOOSER_ACTION_OPEN,
@@ -119,24 +119,24 @@ bool CTagsManager::OnEventAreaExternal(int32_t widgetID, const char * generateEv
gtk_widget_destroy(dialog); gtk_widget_destroy(dialog);
} }
break; break;
case EDN_MSG__RELOAD_CTAGS: case APPL_MSG__RELOAD_CTAGS:
LoadTagFile(); LoadTagFile();
break; break;
case EDN_MSG__JUMP_TO_CURRENT_SELECTION: case APPL_MSG__JUMP_TO_CURRENT_SELECTION:
JumpTo(); JumpTo();
break; break;
case EDN_MSG__JUMP_BACK: case APPL_MSG__JUMP_BACK:
if (m_historyList.Size() > 0) { if (m_historyList.Size() > 0) {
BufferManager *myBufferManager = BufferManager::getInstance(); BufferManager *myBufferManager = BufferManager::getInstance();
int32_t id = m_historyList.Size()-1; int32_t id = m_historyList.Size()-1;
if (false == myBufferManager->Exist(*m_historyList[id]) ) { if (false == myBufferManager->Exist(*m_historyList[id]) ) {
// need to open the file : // need to open the file :
int32_t openID = myBufferManager->Open(*m_historyList[id]); int32_t openID = myBufferManager->Open(*m_historyList[id]);
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, openID); SendMessage(APPL_MSG__CURRENT_CHANGE_BUFFER_ID, openID);
} else { } else {
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, myBufferManager->GetId(*m_historyList[id])); SendMessage(APPL_MSG__CURRENT_CHANGE_BUFFER_ID, myBufferManager->GetId(*m_historyList[id]));
} }
SendMessage(EDN_MSG__CURRENT_GOTO_LINE, m_historyList[id]->GetLineNumber()); SendMessage(APPL_MSG__CURRENT_GOTO_LINE, m_historyList[id]->GetLineNumber());
// Remove element .... // Remove element ....
delete(m_historyList[id]); delete(m_historyList[id]);
m_historyList[id]=NULL; m_historyList[id]=NULL;
@@ -163,12 +163,12 @@ void CTagsManager::LoadTagFile(void)
return; return;
} }
// load (open) the tag file : // load (open) the tag file :
EDN_INFO("try to open tag file : " << m_tagFilename); APPL_INFO("try to open tag file : " << m_tagFilename);
m_ctagFile = tagsOpen(m_tagFilename.c_str(), &info); m_ctagFile = tagsOpen(m_tagFilename.c_str(), &info);
if (NULL != m_ctagFile) { if (NULL != m_ctagFile) {
EDN_INFO("open exuberant Ctags file is OK ..."); APPL_INFO("open exuberant Ctags file is OK ...");
} else { } else {
EDN_INFO("Error to open ctags file ..."); APPL_INFO("Error to open ctags file ...");
} }
*/ */
} }
@@ -201,7 +201,7 @@ void CTagsManager::cb_row(GtkTreeView *p_treeview,
GtkTreeViewColumn * p_column, GtkTreeViewColumn * p_column,
gpointer data) gpointer data)
{ {
EDN_DEBUG("event"); APPL_DEBUG("event");
CTagsManager * self = static_cast<CTagsManager*>(data); CTagsManager * self = static_cast<CTagsManager*>(data);
gchar * p_file=NULL; gchar * p_file=NULL;
@@ -216,7 +216,7 @@ void CTagsManager::cb_row(GtkTreeView *p_treeview,
CTAGS_COL_FILE, &p_file, CTAGS_COL_FILE, &p_file,
CTAGS_COL_LINE_NUMBER, &lineNumber, CTAGS_COL_LINE_NUMBER, &lineNumber,
-1 ); -1 );
EDN_DEBUG("find : " << p_file << ":" << lineNumber); APPL_DEBUG("find : " << p_file << ":" << lineNumber);
for (int32_t iii = 0; iii < self->m_currentList.Size() ; iii++) { for (int32_t iii = 0; iii < self->m_currentList.Size() ; iii++) {
if( self->m_currentList[iii].lineID == lineNumber if( self->m_currentList[iii].lineID == lineNumber
&& strcmp(self->m_currentList[iii].filename, p_file)==0) && strcmp(self->m_currentList[iii].filename, p_file)==0)
@@ -317,7 +317,7 @@ void CTagsManager::JumpAtID(int32_t selectID)
/* /*
BufferManager *myBufferManager = BufferManager::getInstance(); BufferManager *myBufferManager = BufferManager::getInstance();
etk::File myFile = m_currentList[selectID].filename; etk::File myFile = m_currentList[selectID].filename;
EDN_INFO("save curent filename and position : "); APPL_INFO("save curent filename and position : ");
int32_t currentSelected = myBufferManager->GetSelected(); int32_t currentSelected = myBufferManager->GetSelected();
Buffer* tmpBuf = myBufferManager->Get(currentSelected); Buffer* tmpBuf = myBufferManager->Get(currentSelected);
if (NULL != tmpBuf) { if (NULL != tmpBuf) {
@@ -326,15 +326,15 @@ void CTagsManager::JumpAtID(int32_t selectID)
bufferFilename->SetLineNumber(tmpBuf->GetCurrentLine()); bufferFilename->SetLineNumber(tmpBuf->GetCurrentLine());
m_historyList.PushBack(bufferFilename); m_historyList.PushBack(bufferFilename);
} }
EDN_INFO(" OPEN the TAG file Destination : " << myFile ); APPL_INFO(" OPEN the TAG file Destination : " << myFile );
if (false == myBufferManager->Exist(myFile) ) { if (false == myBufferManager->Exist(myFile) ) {
// need to open the file : // need to open the file :
int32_t openID = myBufferManager->Open(myFile); int32_t openID = myBufferManager->Open(myFile);
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, openID); SendMessage(APPL_MSG__CURRENT_CHANGE_BUFFER_ID, openID);
} else { } else {
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, myBufferManager->GetId(myFile)); SendMessage(APPL_MSG__CURRENT_CHANGE_BUFFER_ID, myBufferManager->GetId(myFile));
} }
SendMessage(EDN_MSG__CURRENT_GOTO_LINE, m_currentList[selectID].lineID - 1); SendMessage(APPL_MSG__CURRENT_GOTO_LINE, m_currentList[selectID].lineID - 1);
*/ */
} }
@@ -348,11 +348,11 @@ void CTagsManager::JumpTo(void)
// get the middle button of the clipboard ==> represent the current selection ... // get the middle button of the clipboard ==> represent the current selection ...
ClipBoard::Get(COPY_MIDDLE_BUTTON, data); ClipBoard::Get(COPY_MIDDLE_BUTTON, data);
if (data.Size() == 0) { if (data.Size() == 0) {
EDN_INFO("No current Sélection"); APPL_INFO("No current Sélection");
} }
tagEntry entry; tagEntry entry;
data.PushBack('\0'); data.PushBack('\0');
EDN_INFO("try to find the tag : " << (const char *)&data[0]); APPL_INFO("try to find the tag : " << (const char *)&data[0]);
if (tagsFind (m_ctagFile, &entry, (const char *)&data[0], 0) == TagSuccess) { if (tagsFind (m_ctagFile, &entry, (const char *)&data[0], 0) == TagSuccess) {
tagEntry entrySave = entry; tagEntry entrySave = entry;
int32_t numberOfTags = 0; int32_t numberOfTags = 0;
@@ -382,7 +382,7 @@ void CTagsManager::JumpTo(void)
int32_t SelectID = MultipleJump(); int32_t SelectID = MultipleJump();
} }
} else { } else {
EDN_INFO("no tag find ..."); APPL_INFO("no tag find ...");
} }
} }
*/ */
@@ -391,23 +391,23 @@ void CTagsManager::JumpTo(void)
void CTagsManager::PrintTag (const tagEntry *entry, bool small) void CTagsManager::PrintTag (const tagEntry *entry, bool small)
{ {
if (small==true) { if (small==true) {
EDN_INFO("find Tag file : name=\"" << entry->name << "\" in file=\"" << entry->file APPL_INFO("find Tag file : name=\"" << entry->name << "\" in file=\"" << entry->file
<< "\" at line="<< entry->address.lineNumber); << "\" at line="<< entry->address.lineNumber);
} else { } else {
int i; int i;
EDN_INFO("find Tag file : name=\"" << entry->name << "\" in file=\"" << entry->file APPL_INFO("find Tag file : name=\"" << entry->name << "\" in file=\"" << entry->file
<< "\" pattern=\"" <<entry->address.pattern << "\" pattern=\"" <<entry->address.pattern
<< "\" at line="<<entry->address.lineNumber); << "\" at line="<<entry->address.lineNumber);
EDN_INFO("Extention field : "); APPL_INFO("Extention field : ");
if (entry->kind != NULL && entry->kind [0] != '\0') { if (entry->kind != NULL && entry->kind [0] != '\0') {
EDN_INFO(" kind : " << entry->kind); APPL_INFO(" kind : " << entry->kind);
} }
if (entry->fileScope) { if (entry->fileScope) {
EDN_INFO(" file : "); APPL_INFO(" file : ");
} }
for (i = 0 ; i < entry->fields.count ; ++i) { for (i = 0 ; i < entry->fields.count ; ++i) {
EDN_INFO(" " << entry->fields.list[i].key << ":" << entry->fields.list[i].value ); APPL_INFO(" " << entry->fields.list[i].key << ":" << entry->fields.list[i].value );
} }
} }
} }

View File

@@ -23,7 +23,7 @@
******************************************************************************* *******************************************************************************
*/ */
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <etk/File.h> #include <etk/File.h>
#include <ewol/ewol.h> #include <ewol/ewol.h>
@@ -49,7 +49,7 @@ MainWindows * basicWindows = NULL;
*/ */
void APP_Init(void) void APP_Init(void)
{ {
EDN_INFO("==> Init Edn (START)"); APPL_INFO("==> Init Edn (START)");
ewol::ChangeSize(800, 600); ewol::ChangeSize(800, 600);
// set the default Path of the application : // set the default Path of the application :
@@ -104,12 +104,12 @@ void APP_Init(void)
return ; return ;
} }
cCurrentPath[FILENAME_MAX - 1] = '\0'; cCurrentPath[FILENAME_MAX - 1] = '\0';
//EDN_INFO("The current working directory is " << cCurrentPath); //APPL_INFO("The current working directory is " << cCurrentPath);
basicWindows = new MainWindows(); basicWindows = new MainWindows();
if (NULL == basicWindows) { if (NULL == basicWindows) {
EDN_ERROR("Can not allocate the basic windows"); APPL_ERROR("Can not allocate the basic windows");
ewol::Stop(); ewol::Stop();
return; return;
} }
@@ -142,15 +142,15 @@ void APP_Init(void)
// add files // add files
EDN_INFO("show list of files : "); APPL_INFO("show list of files : ");
for( int32_t iii=0 ; iii<ewol::CmdLineNb(); iii++) { for( int32_t iii=0 ; iii<ewol::CmdLineNb(); iii++) {
EDN_INFO("need load file : \"" << ewol::CmdLineGet(iii) << "\"" ); APPL_INFO("need load file : \"" << ewol::CmdLineGet(iii) << "\"" );
etk::UString tmpppp = ewol::CmdLineGet(iii); etk::UString tmpppp = ewol::CmdLineGet(iii);
ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgOpenFile, tmpppp); ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgOpenFile, tmpppp);
} }
EDN_INFO("==> Init Edn (END)"); APPL_INFO("==> Init Edn (END)");
} }
@@ -165,26 +165,26 @@ etk::File APP_Icon(void)
*/ */
void APP_UnInit(void) void APP_UnInit(void)
{ {
EDN_INFO("==> Un-Init Edn (START)"); APPL_INFO("==> Un-Init Edn (START)");
// Remove windows : // Remove windows :
ewol::DisplayWindows(NULL); ewol::DisplayWindows(NULL);
EDN_INFO("Stop Hightlight"); APPL_INFO("Stop Hightlight");
HighlightManager::UnInit(); HighlightManager::UnInit();
//Kill all singleton //Kill all singleton
EDN_INFO("Stop BufferManager"); APPL_INFO("Stop BufferManager");
BufferManager::UnInit(); BufferManager::UnInit();
EDN_INFO("Stop ColorizeManager"); APPL_INFO("Stop ColorizeManager");
ColorizeManager::UnInit(); ColorizeManager::UnInit();
EDN_INFO("Stop Search"); APPL_INFO("Stop Search");
//Search::Kill(); //Search::Kill();
//EDN_INFO("Stop Accel key"); //APPL_INFO("Stop Accel key");
//AccelKey::Kill(); //AccelKey::Kill();
if (NULL != basicWindows) { if (NULL != basicWindows) {
basicWindows->MarkToRemove(); basicWindows->MarkToRemove();
basicWindows = NULL; basicWindows = NULL;
} }
EDN_INFO("==> Un-Init Edn (END)"); APPL_INFO("==> Un-Init Edn (END)");
} }

View File

@@ -23,9 +23,10 @@
******************************************************************************* *******************************************************************************
*/ */
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <Display.h> #include <Display.h>
#include <ewol/ewol.h>
#undef __class__ #undef __class__
#define __class__ "Display" #define __class__ "Display"

View File

@@ -26,7 +26,7 @@
#ifndef __TOOLS_DISPLAY_H__ #ifndef __TOOLS_DISPLAY_H__
#define __TOOLS_DISPLAY_H__ #define __TOOLS_DISPLAY_H__
#include <tools_debug.h> #include <appl/Debug.h>
/** /**

View File

@@ -23,9 +23,10 @@
******************************************************************************* *******************************************************************************
*/ */
#include <tools_debug.h> #include <etk/Types.h>
#include <tools_globals.h>
#include <etk/unicode.h> #include <etk/unicode.h>
#include <appl/Debug.h>
#include <tools_globals.h>
#include <EdnBuf.h> #include <EdnBuf.h>
@@ -161,7 +162,7 @@ void EdnBuf::GetRange(int32_t start, int32_t end, etk::VectorType<int8_t> &outpu
output.Clear(); output.Clear();
// import data : // import data :
m_data.Get(start, end-start, output); m_data.Get(start, end-start, output);
//EDN_DEBUG("request start=" << start << " end="<< end << " size="<< end-start << " result size=" << output.Size() ); //APPL_DEBUG("request start=" << start << " end="<< end << " size="<< end-start << " result size=" << output.Size() );
} }
void EdnBuf::GetRange(int32_t start, int32_t end, etk::UString &output) void EdnBuf::GetRange(int32_t start, int32_t end, etk::UString &output)
@@ -181,7 +182,7 @@ void EdnBuf::GetRange(int32_t start, int32_t end, etk::UString &output)
convertIsoToUnicode(m_charsetType, localOutput, tmpUnicodeData); convertIsoToUnicode(m_charsetType, localOutput, tmpUnicodeData);
output = tmpUnicodeData; output = tmpUnicodeData;
} }
//EDN_DEBUG("request start=" << start << " end="<< end << " size="<< end-start << " result size=" << output.Size() ); //APPL_DEBUG("request start=" << start << " end="<< end << " size="<< end-start << " result size=" << output.Size() );
} }
@@ -212,7 +213,7 @@ int8_t EdnBuf::operator[] (int32_t pos)
int32_t EdnBuf::Insert(int32_t pos, etk::VectorType<int8_t> &insertText) int32_t EdnBuf::Insert(int32_t pos, etk::VectorType<int8_t> &insertText)
{ {
// if pos is not contiguous to existing text, make it // if pos is not contiguous to existing text, make it
pos = edn_average(0, pos, m_data.Size() ); pos = etk_avg(0, pos, m_data.Size() );
// insert Data // insert Data
int32_t sizeInsert=LocalInsert(pos, insertText); int32_t sizeInsert=LocalInsert(pos, insertText);
@@ -224,7 +225,7 @@ int32_t EdnBuf::Insert(int32_t pos, etk::VectorType<int8_t> &insertText)
int32_t EdnBuf::Insert(int32_t pos, etk::UString &insertText) int32_t EdnBuf::Insert(int32_t pos, etk::UString &insertText)
{ {
// if pos is not contiguous to existing text, make it // if pos is not contiguous to existing text, make it
pos = edn_average(0, pos, m_data.Size() ); pos = etk_avg(0, pos, m_data.Size() );
// insert Data // insert Data
int32_t sizeInsert=LocalInsert(pos, insertText); int32_t sizeInsert=LocalInsert(pos, insertText);
@@ -303,8 +304,8 @@ void EdnBuf::Remove(int32_t start, int32_t end)
start = end; start = end;
end = temp; end = temp;
} }
start = edn_average(0 , start, m_data.Size()); start = etk_avg(0 , start, m_data.Size());
end = edn_average(0 , end, m_data.Size()); end = etk_avg(0 , end, m_data.Size());
// Remove and redisplay // Remove and redisplay
GetRange(start, end, deletedText); GetRange(start, end, deletedText);
@@ -542,7 +543,7 @@ int32_t EdnBuf::GetExpandedChar(int32_t &pos, int32_t indent, char outUTF8[MAX_E
sprintf(outUTF8, "<? ? ? ?>"); sprintf(outUTF8, "<? ? ? ?>");
} }
if (0 == size) { if (0 == size) {
EDN_ERROR("plop"); APPL_ERROR("plop");
} }
pos+=size; pos+=size;
return strlen(outUTF8); return strlen(outUTF8);
@@ -651,7 +652,7 @@ int32_t EdnBuf::GetExpandedChar(int32_t &pos, int32_t indent, uniChar_t outUnico
outUnicode[5] = 0; outUnicode[5] = 0;
} }
if (0 == size) { if (0 == size) {
EDN_ERROR("plop"); APPL_ERROR("plop");
} }
pos+=size; pos+=size;
int32_t outSize = 0; int32_t outSize = 0;
@@ -767,14 +768,14 @@ int32_t EdnBuf::CountDispChars(int32_t lineStartPos, int32_t targetPos)
int32_t charCount = 0; int32_t charCount = 0;
char expandedChar[MAX_EXP_CHAR_LEN]; char expandedChar[MAX_EXP_CHAR_LEN];
//EDN_DEBUG("lineStartPos="<< lineStartPos << " targetPos=" << targetPos); //APPL_DEBUG("lineStartPos="<< lineStartPos << " targetPos=" << targetPos);
while( myPosIt while( myPosIt
&& myPosIt.Position() < targetPos ) && myPosIt.Position() < targetPos )
{ {
charCount += ExpandCharacter(*myPosIt, charCount, expandedChar); charCount += ExpandCharacter(*myPosIt, charCount, expandedChar);
myPosIt++; myPosIt++;
} }
//EDN_DEBUG(" result=" << charCount); //APPL_DEBUG(" result=" << charCount);
return charCount; return charCount;
} }
@@ -902,19 +903,19 @@ int32_t EdnBuf::CountForwardNLines(int32_t startPos, int32_t nLines)
} }
EdnVectorBuf::Iterator myPosIt = m_data.Position(startPos); EdnVectorBuf::Iterator myPosIt = m_data.Position(startPos);
int32_t lineCount = 0; int32_t lineCount = 0;
//EDN_INFO("startPos=" << startPos << " nLines=" << nLines); //APPL_INFO("startPos=" << startPos << " nLines=" << nLines);
while(myPosIt) while(myPosIt)
{ {
if ('\n' == *myPosIt) { if ('\n' == *myPosIt) {
lineCount++; lineCount++;
if (lineCount == nLines) { if (lineCount == nLines) {
//EDN_INFO(" ==> (1) at position=" << myPosIt.Position()+1 ); //APPL_INFO(" ==> (1) at position=" << myPosIt.Position()+1 );
return myPosIt.Position()+1; return myPosIt.Position()+1;
} }
} }
myPosIt++; myPosIt++;
} }
//EDN_INFO(" ==> (2) at position=" << myPosIt.Position() ); //APPL_INFO(" ==> (2) at position=" << myPosIt.Position() );
return myPosIt.Position(); return myPosIt.Position();
} }
@@ -935,7 +936,7 @@ int32_t EdnBuf::CountBackwardNLines(int32_t startPos, int32_t nLines)
} else if (startPos > m_data.Size() ) { } else if (startPos > m_data.Size() ) {
startPos = m_data.Size(); startPos = m_data.Size();
} }
//EDN_INFO("startPos=" << startPos << " nLines=" << nLines); //APPL_INFO("startPos=" << startPos << " nLines=" << nLines);
EdnVectorBuf::Iterator myPosIt = m_data.Position(startPos-1); EdnVectorBuf::Iterator myPosIt = m_data.Position(startPos-1);
int32_t lineCount = -1; int32_t lineCount = -1;
@@ -944,13 +945,13 @@ int32_t EdnBuf::CountBackwardNLines(int32_t startPos, int32_t nLines)
if ('\n' == *myPosIt) { if ('\n' == *myPosIt) {
lineCount++; lineCount++;
if (lineCount >= nLines) { if (lineCount >= nLines) {
//EDN_INFO(" ==> (1) at position=" << myPosIt.Position()+1 ); //APPL_INFO(" ==> (1) at position=" << myPosIt.Position()+1 );
return myPosIt.Position()+1; return myPosIt.Position()+1;
} }
} }
myPosIt--; myPosIt--;
} }
//EDN_INFO(" ==> (2) at position=0"); //APPL_INFO(" ==> (2) at position=0");
return 0; return 0;
} }
@@ -966,10 +967,10 @@ bool EdnBuf::charMatch(char first, char second, bool caseSensitive)
} }
} }
if(first == second) { if(first == second) {
//EDN_DEBUG("charMatch(" << first << ", " << second << ", " << caseSensitive << ") ==> true"); //APPL_DEBUG("charMatch(" << first << ", " << second << ", " << caseSensitive << ") ==> true");
return true; return true;
} else { } else {
//EDN_DEBUG("charMatch(" << first << ", " << second << ", " << caseSensitive << ") ==> false"); //APPL_DEBUG("charMatch(" << first << ", " << second << ", " << caseSensitive << ") ==> false");
return false; return false;
} }
} }
@@ -991,7 +992,7 @@ bool EdnBuf::SearchForward(int32_t startPos, etk::VectorType<int8_t> &searchVect
int32_t searchLen = searchVect.Size(); int32_t searchLen = searchVect.Size();
int32_t dataLen = m_data.Size(); int32_t dataLen = m_data.Size();
char currentChar = '\0'; char currentChar = '\0';
//EDN_INFO(" startPos=" << startPos << " searchLen=" << searchLen); //APPL_INFO(" startPos=" << startPos << " searchLen=" << searchLen);
for (position=startPos; position<dataLen - (searchLen-1); position++) { for (position=startPos; position<dataLen - (searchLen-1); position++) {
currentChar = m_data[position]; currentChar = m_data[position];
if (true == charMatch(currentChar, searchVect[0], caseSensitive)) { if (true == charMatch(currentChar, searchVect[0], caseSensitive)) {
@@ -1031,7 +1032,7 @@ bool EdnBuf::SearchBackward(int32_t startPos, etk::VectorType<int8_t> &searchVec
int32_t position; int32_t position;
int32_t searchLen = searchVect.Size(); int32_t searchLen = searchVect.Size();
char currentChar = '\0'; char currentChar = '\0';
//EDN_INFO(" startPos=" << startPos << " searchLen=" << searchLen); //APPL_INFO(" startPos=" << startPos << " searchLen=" << searchLen);
for (position=startPos; position>=searchLen-1; position--) { for (position=startPos; position>=searchLen-1; position--) {
currentChar = m_data[position]; currentChar = m_data[position];
if (true == charMatch(currentChar, searchVect[searchLen-1], caseSensitive)) { if (true == charMatch(currentChar, searchVect[searchLen-1], caseSensitive)) {
@@ -1062,10 +1063,10 @@ static bool isChar(char value)
|| '_' == value || '_' == value
|| '~' == value) || '~' == value)
{ {
//EDN_DEBUG(" is a char \"" << value << "\""); //APPL_DEBUG(" is a char \"" << value << "\"");
return true; return true;
} }
//EDN_DEBUG(" is NOT a char \"" << value << "\""); //APPL_DEBUG(" is NOT a char \"" << value << "\"");
return false; return false;
} }
@@ -1076,7 +1077,7 @@ bool EdnBuf::SelectAround(int32_t startPos, int32_t &beginPos, int32_t &endPos)
if( '\t' == currentChar if( '\t' == currentChar
|| ' ' == currentChar) || ' ' == currentChar)
{ {
EDN_DEBUG("select spacer"); APPL_DEBUG("select spacer");
// special case we are looking for separation // special case we are looking for separation
for (beginPos=startPos; beginPos>=0; beginPos--) { for (beginPos=startPos; beginPos>=0; beginPos--) {
currentChar = m_data[beginPos]; currentChar = m_data[beginPos];
@@ -1098,7 +1099,7 @@ bool EdnBuf::SelectAround(int32_t startPos, int32_t &beginPos, int32_t &endPos)
} }
return true; return true;
} else if( true == isChar(currentChar)){ } else if( true == isChar(currentChar)){
EDN_DEBUG("select normal Char"); APPL_DEBUG("select normal Char");
// Search back // Search back
for (beginPos=startPos; beginPos>=0; beginPos--) { for (beginPos=startPos; beginPos>=0; beginPos--) {
currentChar = m_data[beginPos]; currentChar = m_data[beginPos];
@@ -1117,7 +1118,7 @@ bool EdnBuf::SelectAround(int32_t startPos, int32_t &beginPos, int32_t &endPos)
return true; return true;
} else { } else {
char comparechar = currentChar; char comparechar = currentChar;
EDN_DEBUG("select same char"); APPL_DEBUG("select same char");
// Search back // Search back
for (beginPos=startPos; beginPos>=0; beginPos--) { for (beginPos=startPos; beginPos>=0; beginPos--) {
currentChar = m_data[beginPos]; currentChar = m_data[beginPos];
@@ -1198,13 +1199,13 @@ void EdnBuf::eventModification(int32_t pos, int32_t nInserted, etk::VectorType<i
&& 0 == nInserted) && 0 == nInserted)
{ {
// we do nothing ... // we do nothing ...
//EDN_INFO("EdnBuf::eventModification(pos="<<pos<<", ... , nRestyled=" << nRestyled << ", deletedText=\"" << textDisplay << "\");"); //APPL_INFO("EdnBuf::eventModification(pos="<<pos<<", ... , nRestyled=" << nRestyled << ", deletedText=\"" << textDisplay << "\");");
} else { } else {
EDN_INFO("(pos="<<pos<<", nDeleted="<<deletedText.Size()<<", nInserted=" << nInserted << ", deletedText=\"xx???xx\");"); APPL_INFO("(pos="<<pos<<", nDeleted="<<deletedText.Size()<<", nInserted=" << nInserted << ", deletedText=\"xx???xx\");");
// update the number of lines : // update the number of lines :
//CountNumberOfLines(); //==> not efficent methode ... //CountNumberOfLines(); //==> not efficent methode ...
// ==> better methode : just update the number of line added and removed ... // ==> better methode : just update the number of line added and removed ...
//EDN_INFO(" add=" << CountLines(pos, pos+nInserted) << " lines | remove="<< CountLines(deletedText) << " lines"); //APPL_INFO(" add=" << CountLines(pos, pos+nInserted) << " lines | remove="<< CountLines(deletedText) << " lines");
m_nbLine += CountLines(pos, pos+nInserted) - CountLines(deletedText); m_nbLine += CountLines(pos, pos+nInserted) - CountLines(deletedText);
// Update histories // Update histories
if (false == m_isUndoProcessing) { if (false == m_isUndoProcessing) {

View File

@@ -24,7 +24,7 @@
*/ */
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <EdnBufHistory.h> #include <EdnBufHistory.h>
@@ -34,14 +34,14 @@
EdnBufHistory::EdnBufHistory(void) EdnBufHistory::EdnBufHistory(void)
{ {
//EDN_INFO("EdnBufHistory new"); //APPL_INFO("EdnBufHistory new");
m_pos = 0; m_pos = 0;
m_nInserted = 0; m_nInserted = 0;
} }
EdnBufHistory::EdnBufHistory(int32_t pos, int32_t nInserted, etk::VectorType<int8_t> &deletedText) EdnBufHistory::EdnBufHistory(int32_t pos, int32_t nInserted, etk::VectorType<int8_t> &deletedText)
{ {
//EDN_INFO("EdnBufHistory new + data"); //APPL_INFO("EdnBufHistory new + data");
m_pos = pos; m_pos = pos;
m_nInserted = nInserted; m_nInserted = nInserted;
m_deletedText = deletedText; m_deletedText = deletedText;
@@ -49,7 +49,7 @@ EdnBufHistory::EdnBufHistory(int32_t pos, int32_t nInserted, etk::VectorType<int
void EdnBufHistory::Set(int32_t pos, int32_t nInserted, etk::VectorType<int8_t> &deletedText) void EdnBufHistory::Set(int32_t pos, int32_t nInserted, etk::VectorType<int8_t> &deletedText)
{ {
//EDN_INFO("EdnBufHistory new + data"); //APPL_INFO("EdnBufHistory new + data");
m_pos = pos; m_pos = pos;
m_nInserted = nInserted; m_nInserted = nInserted;
m_deletedText = deletedText; m_deletedText = deletedText;

View File

@@ -23,7 +23,7 @@
******************************************************************************* *******************************************************************************
*/ */
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <EdnBuf.h> #include <EdnBuf.h>
@@ -57,7 +57,7 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
return; return;
} }
// normal case // normal case
//EDN_INFO("(pos="<<pos<<", nbDeleted="<<nbDeleted<<", nbAdded=" << nbAdded << "\");"); //APPL_INFO("(pos="<<pos<<", nbDeleted="<<nbDeleted<<", nbAdded=" << nbAdded << "\");");
int32_t i; int32_t i;
/* /*
for (i=0; i< (int32_t)m_HLDataPass1.Size(); i++) { for (i=0; i< (int32_t)m_HLDataPass1.Size(); i++) {
@@ -65,7 +65,7 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
if (NULL != m_HLDataPass1[i].patern ) { if (NULL != m_HLDataPass1[i].patern ) {
ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->GetName(); ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->GetName();
} }
EDN_DEBUG("HighLight (previous) element id=" << i << " S=" << m_HLDataPass1[i].beginStart << " E=" << m_HLDataPass1[i].endStop << " patern name=" << ploppp ); APPL_DEBUG("HighLight (previous) element id=" << i << " S=" << m_HLDataPass1[i].beginStart << " E=" << m_HLDataPass1[i].endStop << " patern name=" << ploppp );
} }
*/ */
int32_t posEnd = pos + nbDeleted; int32_t posEnd = pos + nbDeleted;
@@ -85,31 +85,31 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
} else if(-1 == startId) { } else if(-1 == startId) {
if (0 == stopId){ if (0 == stopId){
m_HLDataPass1.Erase(0); m_HLDataPass1.Erase(0);
//EDN_DEBUG("1 * Erase 0"); //APPL_DEBUG("1 * Erase 0");
} else { } else {
m_HLDataPass1.EraseLen(0,stopId); m_HLDataPass1.EraseLen(0,stopId);
//EDN_DEBUG("2 * Erase 0->" << stopId); //APPL_DEBUG("2 * Erase 0->" << stopId);
} }
} else if(-1 == stopId) { } else if(-1 == stopId) {
//EDN_DEBUG("3 * Erase " << startId+1 << "-> end"); //APPL_DEBUG("3 * Erase " << startId+1 << "-> end");
m_HLDataPass1.EraseLen(startId+1, m_HLDataPass1.Size() - startId); m_HLDataPass1.EraseLen(startId+1, m_HLDataPass1.Size() - startId);
stopId = -1; stopId = -1;
} else { } else {
int32_t currentSize = m_HLDataPass1.Size(); int32_t currentSize = m_HLDataPass1.Size();
//EDN_DEBUG("4 * Erase " << startId+1 << "->" << stopId << " in " << currentSize << " elements" ); //APPL_DEBUG("4 * Erase " << startId+1 << "->" << stopId << " in " << currentSize << " elements" );
m_HLDataPass1.EraseLen(startId+1, stopId - startId); m_HLDataPass1.EraseLen(startId+1, stopId - startId);
if (stopId == currentSize-1) { if (stopId == currentSize-1) {
stopId = -1; stopId = -1;
} }
} }
//EDN_DEBUG("new size=" << (int32_t)m_HLDataPass1.Size()-1); //APPL_DEBUG("new size=" << (int32_t)m_HLDataPass1.Size()-1);
/* /*
for (i=0; i< (int32_t)m_HLDataPass1.Size(); i++) { for (i=0; i< (int32_t)m_HLDataPass1.Size(); i++) {
etk::UString ploppp; etk::UString ploppp;
if (NULL != m_HLDataPass1[i].patern ) { if (NULL != m_HLDataPass1[i].patern ) {
ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->GetName(); ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->GetName();
} }
EDN_DEBUG("HighLight (Middle) element id=" << i << " S=" << m_HLDataPass1[i].beginStart << " E=" << m_HLDataPass1[i].endStop << " patern name=" << ploppp ); APPL_DEBUG("HighLight (Middle) element id=" << i << " S=" << m_HLDataPass1[i].beginStart << " E=" << m_HLDataPass1[i].endStop << " patern name=" << ploppp );
} }
*/ */
// update position after the range position : // update position after the range position :
@@ -120,7 +120,7 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
elemStart = startId+1; 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); //APPL_DEBUG("move element=" << i);
m_HLDataPass1[i].beginStart += nbAdded - nbDeleted; m_HLDataPass1[i].beginStart += nbAdded - nbDeleted;
m_HLDataPass1[i].beginStop += nbAdded - nbDeleted; m_HLDataPass1[i].beginStop += nbAdded - nbDeleted;
m_HLDataPass1[i].endStart += nbAdded - nbDeleted; m_HLDataPass1[i].endStart += nbAdded - nbDeleted;
@@ -130,16 +130,16 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
if( -1 == startId if( -1 == startId
&& -1 == stopId) && -1 == stopId)
{ {
//EDN_DEBUG("******* Regenerate ALL"); //APPL_DEBUG("******* Regenerate ALL");
GenerateHighLightAt(0, m_data.Size()); GenerateHighLightAt(0, m_data.Size());
} else if(-1 == startId) { } else if(-1 == startId) {
//EDN_DEBUG("******* Regenerate START"); //APPL_DEBUG("******* Regenerate START");
GenerateHighLightAt(0, m_HLDataPass1[0].beginStart, 0); GenerateHighLightAt(0, m_HLDataPass1[0].beginStart, 0);
} else if(-1 == stopId) { } else if(-1 == stopId) {
//EDN_DEBUG("******* Regenerate STOP"); //APPL_DEBUG("******* Regenerate STOP");
GenerateHighLightAt(m_HLDataPass1[m_HLDataPass1.Size() -1].endStop, m_data.Size(), m_HLDataPass1.Size()); GenerateHighLightAt(m_HLDataPass1[m_HLDataPass1.Size() -1].endStop, m_data.Size(), m_HLDataPass1.Size());
} else { } else {
//EDN_DEBUG("******* Regenerate RANGE"); //APPL_DEBUG("******* Regenerate RANGE");
GenerateHighLightAt(m_HLDataPass1[startId].endStop, m_HLDataPass1[startId+1].beginStart, startId+1); GenerateHighLightAt(m_HLDataPass1[startId].endStop, m_HLDataPass1[startId+1].beginStart, startId+1);
} }
} else { } else {
@@ -152,12 +152,12 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
if (NULL != m_HLDataPass1[i].patern ) { if (NULL != m_HLDataPass1[i].patern ) {
ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->GetName(); ploppp = ((HighlightPattern*)m_HLDataPass1[i].patern)->GetName();
} }
EDN_DEBUG("HighLight (end) element id=" << i << " S=" << m_HLDataPass1[i].beginStart << " E=" << m_HLDataPass1[i].endStop << " patern name=" << ploppp ); APPL_DEBUG("HighLight (end) element id=" << i << " S=" << m_HLDataPass1[i].beginStart << " E=" << m_HLDataPass1[i].endStop << " patern name=" << ploppp );
} }
*/ */
//GTimeVal timeStop; //GTimeVal timeStop;
//g_get_current_time(&timeStop); //g_get_current_time(&timeStop);
//EDN_DEBUG("HL General = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s"); //APPL_DEBUG("HL General = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s");
} }
void EdnBuf::FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t &startId, int32_t &stopId, bool backPreviousNotEnded) void EdnBuf::FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t &startId, int32_t &stopId, bool backPreviousNotEnded)
@@ -232,14 +232,14 @@ void EdnBuf::FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t
} }
/* /*
if (-1 != startId && startId < (int32_t)m_HLDataPass1.Size()) { if (-1 != startId && startId < (int32_t)m_HLDataPass1.Size()) {
EDN_DEBUG("==> BEGIN : start="<<m_HLDataPass1[startId].beginStart<<", stop="<<m_HLDataPass1[startId].endStop<<" id=" << startId << "/" << (int32_t)m_HLDataPass1.Size()-1); APPL_DEBUG("==> BEGIN : start="<<m_HLDataPass1[startId].beginStart<<", stop="<<m_HLDataPass1[startId].endStop<<" id=" << startId << "/" << (int32_t)m_HLDataPass1.Size()-1);
} else { } else {
EDN_DEBUG("==> BEGIN : start=???, stop=??? id=" << startId); APPL_DEBUG("==> BEGIN : start=???, stop=??? id=" << startId);
} }
if (-1 != stopId && stopId < (int32_t)m_HLDataPass1.Size()) { if (-1 != stopId && stopId < (int32_t)m_HLDataPass1.Size()) {
EDN_DEBUG("==> END : start="<<m_HLDataPass1[stopId].beginStart<<", stop="<<m_HLDataPass1[stopId].endStop<<" id=" << stopId<< "/" << (int32_t)m_HLDataPass1.Size()-1); APPL_DEBUG("==> END : start="<<m_HLDataPass1[stopId].beginStart<<", stop="<<m_HLDataPass1[stopId].endStop<<" id=" << stopId<< "/" << (int32_t)m_HLDataPass1.Size()-1);
} else { } else {
EDN_DEBUG("==> END : start=???, stop=??? id=" << stopId); APPL_DEBUG("==> END : start=???, stop=??? id=" << stopId);
} }
*/ */
} }
@@ -252,7 +252,7 @@ void EdnBuf::GenerateHighLightAt(int32_t pos, int32_t endPos, int32_t addinPos)
if (NULL == m_Highlight) { if (NULL == m_Highlight) {
return; return;
} }
//EDN_DEBUG("area : ("<<pos<<","<<endPos<<") insert at : " << addinPos); //APPL_DEBUG("area : ("<<pos<<","<<endPos<<") insert at : " << addinPos);
m_Highlight->Parse(pos, endPos, m_HLDataPass1, addinPos, m_data); m_Highlight->Parse(pos, endPos, m_HLDataPass1, addinPos, m_data);
} }
@@ -268,7 +268,7 @@ void EdnBuf::CleanHighLight(void)
colorInformation_ts *EdnBuf::GetElementColorAtPosition(int32_t pos, int32_t &starPos) colorInformation_ts *EdnBuf::GetElementColorAtPosition(int32_t pos, int32_t &starPos)
{ {
int32_t i; int32_t i;
int32_t start = edn_max(0, starPos-1); int32_t start = etk_max(0, starPos-1);
for (i=start; i<(int32_t)m_HLDataPass1.Size(); i++) { for (i=start; i<(int32_t)m_HLDataPass1.Size(); i++) {
starPos = i; starPos = i;
if( m_HLDataPass1[i].beginStart <= pos if( m_HLDataPass1[i].beginStart <= pos
@@ -301,42 +301,42 @@ void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart,
FindMainHighLightPosition(HLStart, HLStop, startId, stopId, true); FindMainHighLightPosition(HLStart, HLStop, startId, stopId, true);
int32_t k; int32_t k;
//EDN_DEBUG("List of section between : "<< startId << " & " << stopId); //APPL_DEBUG("List of section between : "<< startId << " & " << stopId);
int32_t endSearch = stopId+1; int32_t endSearch = stopId+1;
if (-1 == stopId) { if (-1 == stopId) {
endSearch = m_HLDataPass1.Size(); endSearch = m_HLDataPass1.Size();
} }
for (k=edn_max(startId, 0); k<endSearch; k++) { for (k=etk_max(startId, 0); k<endSearch; k++) {
// empty section : // empty section :
if (0==k) { if (0==k) {
if (HLStart < m_HLDataPass1[k].beginStart) { if (HLStart < m_HLDataPass1[k].beginStart) {
//EDN_DEBUG(" ==> (empty section 1 ) k="<<k<<" start="<<HLStart<<" stop="<<m_HLDataPass1[k].beginStart ); //APPL_DEBUG(" ==> (empty section 1 ) k="<<k<<" start="<<HLStart<<" stop="<<m_HLDataPass1[k].beginStart );
m_Highlight->Parse2(HLStart, m_Highlight->Parse2(HLStart,
m_HLDataPass1[k].beginStart, m_HLDataPass1[k].beginStart,
MData.HLData, MData.HLData,
m_data); m_data);
} // else : nothing to do ... } // else : nothing to do ...
} else { } else {
//EDN_DEBUG(" ==> (empty section 2 ) k="<<k<<" start="<<m_HLDataPass1[k-1].endStop<<" stop="<<m_HLDataPass1[k].beginStart ); //APPL_DEBUG(" ==> (empty section 2 ) k="<<k<<" start="<<m_HLDataPass1[k-1].endStop<<" stop="<<m_HLDataPass1[k].beginStart );
m_Highlight->Parse2(m_HLDataPass1[k-1].endStop, m_Highlight->Parse2(m_HLDataPass1[k-1].endStop,
m_HLDataPass1[k].beginStart, m_HLDataPass1[k].beginStart,
MData.HLData, MData.HLData,
m_data); m_data);
} }
// under section : // under section :
//EDN_DEBUG(" ==> (under section ) k="<<k<<" start="<<m_HLDataPass1[k].beginStart<<" stop="<<m_HLDataPass1[k].endStop << " subSectionOfID=" << 99999999); //APPL_DEBUG(" ==> (under section ) k="<<k<<" start="<<m_HLDataPass1[k].beginStart<<" stop="<<m_HLDataPass1[k].endStop << " subSectionOfID=" << 99999999);
// TODO : ... // TODO : ...
} }
if (endSearch == (int32_t)m_HLDataPass1.Size() ){ if (endSearch == (int32_t)m_HLDataPass1.Size() ){
//if( k < (int32_t)m_HLDataPass1.Size()) { //if( k < (int32_t)m_HLDataPass1.Size()) {
if (m_HLDataPass1.Size() != 0) { if (m_HLDataPass1.Size() != 0) {
//EDN_DEBUG(" ==> (empty section 3 ) k="<<k<<" start="<<m_HLDataPass1[k-1].endStop<<" stop="<<HLStop ); //APPL_DEBUG(" ==> (empty section 3 ) k="<<k<<" start="<<m_HLDataPass1[k-1].endStop<<" stop="<<HLStop );
m_Highlight->Parse2(m_HLDataPass1[k-1].endStop, m_Highlight->Parse2(m_HLDataPass1[k-1].endStop,
HLStop, HLStop,
MData.HLData, MData.HLData,
m_data); m_data);
} else { } else {
//EDN_DEBUG(" ==> (empty section 4 ) k="<<k<<" start=0 stop="<<HLStop ); //APPL_DEBUG(" ==> (empty section 4 ) k="<<k<<" start=0 stop="<<HLStop );
m_Highlight->Parse2(0, m_Highlight->Parse2(0,
HLStop, HLStop,
MData.HLData, MData.HLData,
@@ -346,7 +346,7 @@ void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart,
//GTimeVal timeStop; //GTimeVal timeStop;
//g_get_current_time(&timeStop); //g_get_current_time(&timeStop);
//EDN_DEBUG("Display reAnnalyse = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s"); //APPL_DEBUG("Display reAnnalyse = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s");
} }
@@ -354,7 +354,7 @@ void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart,
colorInformation_ts * EdnBuf::GetElementColorAtPosition(displayHLData_ts & MData, int32_t pos) colorInformation_ts * EdnBuf::GetElementColorAtPosition(displayHLData_ts & MData, int32_t pos)
{ {
int32_t i; int32_t i;
int32_t start = edn_max(0, MData.posHLPass2-1); int32_t start = etk_max(0, MData.posHLPass2-1);
for (i=start; i<(int32_t)MData.HLData.Size(); i++) { for (i=start; i<(int32_t)MData.HLData.Size(); i++) {
MData.posHLPass2 = i; MData.posHLPass2 = i;
if( MData.HLData[i].beginStart <= pos if( MData.HLData[i].beginStart <= pos

View File

@@ -23,7 +23,7 @@
******************************************************************************* *******************************************************************************
*/ */
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <EdnBuf.h> #include <EdnBuf.h>
@@ -37,16 +37,16 @@
int32_t EdnBuf::Undo(void) int32_t EdnBuf::Undo(void)
{ {
int32_t nbElement = m_historyUndo.Size(); int32_t nbElement = m_historyUndo.Size();
//EDN_DEBUG("EdnBuf::Undo Request id="<<nbElement); //APPL_DEBUG("EdnBuf::Undo Request id="<<nbElement);
int32_t posDest = -1; int32_t posDest = -1;
if (0 == nbElement) { if (0 == nbElement) {
// nothing to do ... // nothing to do ...
EDN_ERROR("EdnBuf::Undo No more History"); APPL_ERROR("EdnBuf::Undo No more History");
return -1; return -1;
} }
nbElement--; nbElement--;
if (m_historyUndo[nbElement] == NULL) { if (m_historyUndo[nbElement] == NULL) {
EDN_ERROR("EdnBuf::Undo Find empty history ==> remove it"); APPL_ERROR("EdnBuf::Undo Find empty history ==> remove it");
m_historyUndo.PopBack(); m_historyUndo.PopBack();
return -1; return -1;
} }
@@ -59,7 +59,7 @@ int32_t EdnBuf::Undo(void)
if (0 == nbInserted) { if (0 == nbInserted) {
// just add data at position ... // just add data at position ...
if (0 == nbDeleted) { if (0 == nbDeleted) {
EDN_ERROR("EdnBuf::Undo nothing to do in UNDO"); APPL_ERROR("EdnBuf::Undo nothing to do in UNDO");
} else { } else {
Insert(pos, deletedText); Insert(pos, deletedText);
posDest = pos + nbDeleted; posDest = pos + nbDeleted;
@@ -85,16 +85,16 @@ int32_t EdnBuf::Undo(void)
int32_t EdnBuf::Redo(void) int32_t EdnBuf::Redo(void)
{ {
int32_t nbElement = m_historyRedo.Size(); int32_t nbElement = m_historyRedo.Size();
//EDN_DEBUG("EdnBuf::Redo Request id="<<nbElement); //APPL_DEBUG("EdnBuf::Redo Request id="<<nbElement);
int32_t posDest = -1; int32_t posDest = -1;
if (0 == nbElement) { if (0 == nbElement) {
// nothing to do ... // nothing to do ...
EDN_ERROR("EdnBuf::Redo No more History"); APPL_ERROR("EdnBuf::Redo No more History");
return -1; return -1;
} }
nbElement--; nbElement--;
if (m_historyRedo[nbElement] == NULL) { if (m_historyRedo[nbElement] == NULL) {
EDN_ERROR("EdnBuf::Redo Find empty history ==> remove it"); APPL_ERROR("EdnBuf::Redo Find empty history ==> remove it");
m_historyRedo.PopBack(); m_historyRedo.PopBack();
return -1; return -1;
} }
@@ -107,7 +107,7 @@ int32_t EdnBuf::Redo(void)
if (0 == nbInserted) { if (0 == nbInserted) {
// just add data at position ... // just add data at position ...
if (0 == nbDeleted) { if (0 == nbDeleted) {
EDN_ERROR("EdnBuf::Redo nothing to do in REDO"); APPL_ERROR("EdnBuf::Redo nothing to do in REDO");
} else { } else {
Insert(pos, deletedText); Insert(pos, deletedText);
posDest = pos + nbDeleted; posDest = pos + nbDeleted;

View File

@@ -23,7 +23,7 @@
******************************************************************************* *******************************************************************************
*/ */
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <EdnBuf.h> #include <EdnBuf.h>
@@ -62,8 +62,8 @@ void EdnBuf::Select(selectionType_te select, int32_t start, int32_t end)
m_selectionList[select].selected = start != end; m_selectionList[select].selected = start != end;
m_selectionList[select].zeroWidth = (start == end) ? true : false; m_selectionList[select].zeroWidth = (start == end) ? true : false;
m_selectionList[select].rectangular = false; m_selectionList[select].rectangular = false;
m_selectionList[select].start = edn_min(start, end); m_selectionList[select].start = etk_min(start, end);
m_selectionList[select].end = edn_max(start, end); m_selectionList[select].end = etk_max(start, end);
} }

View File

@@ -23,7 +23,7 @@
******************************************************************************* *******************************************************************************
*/ */
#include <tools_debug.h> #include <appl/Debug.h>
#include <tools_globals.h> #include <tools_globals.h>
#include <toolsMemory.h> #include <toolsMemory.h>
#include <EdnVectorBuf.h> #include <EdnVectorBuf.h>
@@ -66,8 +66,8 @@ EdnVectorBuf::EdnVectorBuf(const EdnVectorBuf & Evb)
m_gapEnd = Evb.m_gapEnd; m_gapEnd = Evb.m_gapEnd;
// allocate all same data // allocate all same data
EDN_MALLOC(m_data, m_allocated, int8_t); APPL_MALLOC(m_data, m_allocated, int8_t);
EDN_ASSERT(NULL!=m_data, "Error in data allocation"); APPL_ASSERT(NULL!=m_data, "Error in data allocation");
// Copy all data ... // Copy all data ...
memcpy(m_data, Evb.m_data, m_allocated * sizeof(int8_t) ); memcpy(m_data, Evb.m_data, m_allocated * sizeof(int8_t) );
} }
@@ -84,7 +84,7 @@ EdnVectorBuf::EdnVectorBuf(const EdnVectorBuf & Evb)
EdnVectorBuf::~EdnVectorBuf() EdnVectorBuf::~EdnVectorBuf()
{ {
if (NULL!=m_data) { if (NULL!=m_data) {
EDN_FREE(m_data); APPL_FREE(m_data);
m_data = NULL; m_data = NULL;
m_allocated = 0; m_allocated = 0;
m_gapStart = 0; m_gapStart = 0;
@@ -146,10 +146,10 @@ bool EdnVectorBuf::DumpFrom(FILE *myFile)
// insert Data // insert Data
int32_t nbReadData = fread(&m_data[GAP_SIZE_MIN], sizeof(int8_t), length, myFile); int32_t nbReadData = fread(&m_data[GAP_SIZE_MIN], sizeof(int8_t), length, myFile);
EDN_INFO("load data : filesize=" << length << ", readData=" << nbReadData); APPL_INFO("load data : filesize=" << length << ", readData=" << nbReadData);
// check ERROR // check ERROR
if (nbReadData != length) { if (nbReadData != length) {
EDN_ERROR("load data pb : filesize=" << length << ", readData=" << nbReadData); APPL_ERROR("load data pb : filesize=" << length << ", readData=" << nbReadData);
ret = false; ret = false;
} }
// set the gapsize at the end ... // set the gapsize at the end ...
@@ -173,7 +173,7 @@ EdnVectorBuf& EdnVectorBuf::operator=(const EdnVectorBuf & Evb)
if( this != &Evb ) // avoid copy to itself if( this != &Evb ) // avoid copy to itself
{ {
if (NULL!=m_data) { if (NULL!=m_data) {
EDN_FREE(m_data); APPL_FREE(m_data);
m_data = NULL; m_data = NULL;
} }
// Set the new value // Set the new value
@@ -181,8 +181,8 @@ EdnVectorBuf& EdnVectorBuf::operator=(const EdnVectorBuf & Evb)
m_gapStart = Evb.m_gapStart; m_gapStart = Evb.m_gapStart;
m_gapEnd = Evb.m_gapEnd; m_gapEnd = Evb.m_gapEnd;
// allocate all same data // allocate all same data
EDN_MALLOC(m_data, m_allocated, int8_t); APPL_MALLOC(m_data, m_allocated, int8_t);
EDN_ASSERT(NULL!=m_data, "Error in data allocation"); APPL_ASSERT(NULL!=m_data, "Error in data allocation");
// Copy all data ... // Copy all data ...
memcpy(m_data, Evb.m_data, m_allocated * sizeof(int8_t) ); memcpy(m_data, Evb.m_data, m_allocated * sizeof(int8_t) );
} }
@@ -192,7 +192,7 @@ EdnVectorBuf& EdnVectorBuf::operator=(const EdnVectorBuf & Evb)
int8_t EdnVectorBuf::operator[] (int32_t pos) int8_t EdnVectorBuf::operator[] (int32_t pos)
{ {
EDN_ASSERT(0 <= pos || pos < Size(), "try to read an element non existing"); APPL_ASSERT(0 <= pos || pos < Size(), "try to read an element non existing");
if (pos < m_gapStart) { if (pos < m_gapStart) {
return m_data[pos]; return m_data[pos];
} }
@@ -210,7 +210,7 @@ int8_t EdnVectorBuf::operator[] (int32_t pos)
*/ */
int8_t& EdnVectorBuf::Get(int32_t pos) int8_t& EdnVectorBuf::Get(int32_t pos)
{ {
EDN_ASSERT(0 <= pos || pos < Size(), "try to read an element non existing"); APPL_ASSERT(0 <= pos || pos < Size(), "try to read an element non existing");
if (pos < m_gapStart) { if (pos < m_gapStart) {
return m_data[pos]; return m_data[pos];
} }
@@ -283,11 +283,11 @@ void EdnVectorBuf::Remove(int32_t pos, int32_t nbRemoveElement)
{ {
if( pos > Size() if( pos > Size()
|| pos < 0 ) { || pos < 0 ) {
EDN_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size()); APPL_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return; return;
} }
if( pos+nbRemoveElement > Size() ) { if( pos+nbRemoveElement > Size() ) {
EDN_ERROR("Request remove more element than expected in the buffer pos+nbRemoveElement="<<pos+nbRemoveElement<< " bufferSize="<<Size()); APPL_ERROR("Request remove more element than expected in the buffer pos+nbRemoveElement="<<pos+nbRemoveElement<< " bufferSize="<<Size());
return; return;
} }
if (false == GapMove(pos) ) { if (false == GapMove(pos) ) {
@@ -336,17 +336,17 @@ void EdnVectorBuf::ChangeAllocation(int32_t newSize)
if (newSize == m_allocated) { if (newSize == m_allocated) {
return; return;
} }
EDN_DEBUG("Change Allocation : " << m_allocated << " ==> " << newSize); APPL_DEBUG("Change Allocation : " << m_allocated << " ==> " << newSize);
// check if something is allocated : // check if something is allocated :
if (NULL == m_data) { if (NULL == m_data) {
// no data allocated ==> request an allocation (might be the first) // no data allocated ==> request an allocation (might be the first)
EDN_MALLOC(m_data, newSize, int8_t); APPL_MALLOC(m_data, newSize, int8_t);
} else { } else {
// move datas // move datas
EDN_REALLOC(m_data, newSize, int8_t); APPL_REALLOC(m_data, newSize, int8_t);
} }
// Check result with assert : // Check result with assert :
EDN_ASSERT(NULL!=m_data, "Error in data allocation"); APPL_ASSERT(NULL!=m_data, "Error in data allocation");
// set the new allocation size // set the new allocation size
m_allocated = newSize; m_allocated = newSize;
} }
@@ -364,7 +364,7 @@ void EdnVectorBuf::Insert(int32_t pos, const int8_t& item)
{ {
if( pos > Size() if( pos > Size()
|| pos < 0 ) { || pos < 0 ) {
EDN_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size()); APPL_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return; return;
} }
if( 0 == GapSize() ) { if( 0 == GapSize() ) {
@@ -402,7 +402,7 @@ void EdnVectorBuf::Insert(int32_t pos, etk::VectorType<int8_t>& items)
{ {
if( pos > Size() if( pos > Size()
|| pos < 0 ) { || pos < 0 ) {
EDN_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size()); APPL_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return; return;
} }
if( items.Size() > GapSize() ) { if( items.Size() > GapSize() ) {
@@ -434,7 +434,7 @@ void EdnVectorBuf::Replace(int32_t pos, const int8_t& item)
{ {
if( pos > Size() if( pos > Size()
|| pos < 0 ) { || pos < 0 ) {
EDN_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size()); APPL_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return; return;
} }
// just replace the element, not update Gap position // just replace the element, not update Gap position
@@ -458,11 +458,11 @@ void EdnVectorBuf::Replace(int32_t pos, int32_t nbRemoveElement, etk::VectorType
{ {
if( pos > Size() if( pos > Size()
|| pos < 0 ) { || pos < 0 ) {
EDN_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size()); APPL_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return; return;
} }
if( pos+nbRemoveElement > Size() ) { if( pos+nbRemoveElement > Size() ) {
EDN_ERROR("Request remove more element than expected in the buffer pos+nbRemoveElement="<<pos+nbRemoveElement<< " bufferSize="<<Size()); APPL_ERROR("Request remove more element than expected in the buffer pos+nbRemoveElement="<<pos+nbRemoveElement<< " bufferSize="<<Size());
return; return;
} }
if (false == GapMove(pos)) { if (false == GapMove(pos)) {
@@ -490,7 +490,7 @@ bool EdnVectorBuf::GapMove(int32_t pos)
{ {
if( pos > Size() if( pos > Size()
|| pos < 0 ) { || pos < 0 ) {
EDN_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size()); APPL_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return false; return false;
} }
int32_t gapLen = m_gapEnd - m_gapStart; int32_t gapLen = m_gapEnd - m_gapStart;
@@ -517,7 +517,7 @@ bool EdnVectorBuf::GapResize(int32_t pos, int32_t newGapLen)
{ {
if( pos > Size() if( pos > Size()
|| pos < 0 ) { || pos < 0 ) {
EDN_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size()); APPL_ERROR("Request higher than buffer size : pos="<<pos<< " bufferSize="<<Size());
return false; return false;
} }
int32_t previousSize = Size(); int32_t previousSize = Size();
@@ -590,12 +590,12 @@ void EdnVectorBuf::GapCheckMaxSize(void)
*/ */
void EdnVectorBuf::Display(void) void EdnVectorBuf::Display(void)
{ {
EDN_INFO(" Display Buffer : Size="<<Size()<<" m_allocated="<<m_allocated<<" m_gapStart="<<m_gapStart<<" m_gapEnd="<<m_gapEnd); APPL_INFO(" Display Buffer : Size="<<Size()<<" m_allocated="<<m_allocated<<" m_gapStart="<<m_gapStart<<" m_gapEnd="<<m_gapEnd);
for(int32_t i=0; i<m_allocated; i++) { for(int32_t i=0; i<m_allocated; i++) {
if (i>= m_gapStart && i< m_gapEnd) { if (i>= m_gapStart && i< m_gapEnd) {
EDN_INFO( "Element " << i << " : GAP"); APPL_INFO( "Element " << i << " : GAP");
} else { } else {
EDN_INFO( "Element " << i << " : " << m_data[i]); APPL_INFO( "Element " << i << " : " << m_data[i]);
} }
} }
} }

View File

@@ -226,7 +226,7 @@ class EdnVectorBuf
*/ */
int8_t & operator-> () const int8_t & operator-> () const
{ {
EDN_CHECK_INOUT(m_current >= 0 && m_current < m_EdnVectorBuf->Size()); APPL_CHECK_INOUT(m_current >= 0 && m_current < m_EdnVectorBuf->Size());
return m_EdnVectorBuf->Get(m_current); return m_EdnVectorBuf->Get(m_current);
} }
/** /**
@@ -235,7 +235,7 @@ class EdnVectorBuf
*/ */
int8_t & operator* () const int8_t & operator* () const
{ {
EDN_CHECK_INOUT(m_current >= 0 && m_current < m_EdnVectorBuf->Size()); APPL_CHECK_INOUT(m_current >= 0 && m_current < m_EdnVectorBuf->Size());
return m_EdnVectorBuf->Get(m_current); return m_EdnVectorBuf->Get(m_current);
} }
private: private:

View File

@@ -53,7 +53,7 @@ bool globals::IsSetDisplayEndOfLine(void)
void globals::SetDisplayEndOfLine(bool newVal) void globals::SetDisplayEndOfLine(bool newVal)
{ {
EDN_INFO("Set EndOfLine " << newVal); APPL_INFO("Set EndOfLine " << newVal);
displayEOL = newVal; displayEOL = newVal;
//ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange); //ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
} }
@@ -67,7 +67,7 @@ bool globals::IsSetDisplaySpaceChar(void)
void globals::SetDisplaySpaceChar(bool newVal) void globals::SetDisplaySpaceChar(bool newVal)
{ {
EDN_INFO("Set SpaceChar " << newVal); APPL_INFO("Set SpaceChar " << newVal);
displaySpaceChar = newVal; displaySpaceChar = newVal;
//ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange); //ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
} }
@@ -82,7 +82,7 @@ bool globals::IsSetAutoIndent(void)
void globals::SetAutoIndent(bool newVal) void globals::SetAutoIndent(bool newVal)
{ {
EDN_INFO("Set AutoIndent " << newVal); APPL_INFO("Set AutoIndent " << newVal);
AutoIndent = newVal; AutoIndent = newVal;
} }

View File

@@ -26,8 +26,8 @@
#ifndef __TOOLS_GLOBALS_H__ #ifndef __TOOLS_GLOBALS_H__
#define __TOOLS_GLOBALS_H__ #define __TOOLS_GLOBALS_H__
#include <tools_debug.h> #include <appl/Debug.h>
#include <types_generique.h> #include <etk/Types.h>
namespace globals namespace globals

View File

@@ -28,61 +28,61 @@
// General // General
#ifdef EDN_MEMORY_CHECKER #ifdef APPL_MEMORY_CHECKER
void EDN_MemFree( void * pointerData, const char * variableName, const char * functionName, int32_t line, const char * fileName ); void APPL_MemFree( void * pointerData, const char * variableName, const char * functionName, int32_t line, const char * fileName );
void * EDN_MemMalloc( size_t num, size_t size, uint8_t init, const char * variableName, const char * functionName, int32_t line, const char * fileName ); void * APPL_MemMalloc( size_t num, size_t size, uint8_t init, const char * variableName, const char * functionName, int32_t line, const char * fileName );
void EDN_MemShowLogs( void ); void APPL_MemShowLogs( void );
# define EDN_MALLOC(pointerData, nbElements, dataType) do { \ # define APPL_MALLOC(pointerData, nbElements, dataType) do { \
pointerData = (dataType *)EDN_MemMalloc( (nbElements), sizeof(dataType), 0, #pointerData, __func__, __LINE__, __FILE__); \ pointerData = (dataType *)APPL_MemMalloc( (nbElements), sizeof(dataType), 0, #pointerData, __func__, __LINE__, __FILE__); \
}while(0) }while(0)
# define EDN_MALLOC_CAST(pointerData, nbElements, dataType, cast) do { \ # define APPL_MALLOC_CAST(pointerData, nbElements, dataType, cast) do { \
pointerData = (cast)EDN_MemMalloc( (nbElements), sizeof(dataType), 0, #pointerData, __func__, __LINE__, __FILE__); \ pointerData = (cast)APPL_MemMalloc( (nbElements), sizeof(dataType), 0, #pointerData, __func__, __LINE__, __FILE__); \
}while(0) }while(0)
# define EDN_CALLOC(pointerData, nbElements, dataType) do { \ # define APPL_CALLOC(pointerData, nbElements, dataType) do { \
pointerData = (dataType *)EDN_MemMalloc( (nbElements), sizeof(dataType), 1, #pointerData, __func__, __LINE__, __FILE__); \ pointerData = (dataType *)APPL_MemMalloc( (nbElements), sizeof(dataType), 1, #pointerData, __func__, __LINE__, __FILE__); \
}while(0) }while(0)
# define EDN_CALLOC_CAST(pointerData, nbElements, dataType, cast) do { \ # define APPL_CALLOC_CAST(pointerData, nbElements, dataType, cast) do { \
pointerData = (cast)EDN_MemMalloc( (nbElements), sizeof(dataType), 1, #pointerData, __func__, __LINE__, __FILE__); \ pointerData = (cast)APPL_MemMalloc( (nbElements), sizeof(dataType), 1, #pointerData, __func__, __LINE__, __FILE__); \
}while(0) }while(0)
# define EDN_FREE(pointerData) do { \ # define APPL_FREE(pointerData) do { \
EDN_MemFree( (pointerData) , #pointerData, __func__, __LINE__, __FILE__); \ APPL_MemFree( (pointerData) , #pointerData, __func__, __LINE__, __FILE__); \
(pointerData) = NULL; \ (pointerData) = NULL; \
}while(0) }while(0)
# define EDN_MEM_SHOW_LOG() do { \ # define APPL_MEM_SHOW_LOG() do { \
EDN_MemShowLogs(); \ APPL_MemShowLogs(); \
}while(0) }while(0)
#else #else
# define EDN_MALLOC(pointerData, nbElements, dataType) do { \ # define APPL_MALLOC(pointerData, nbElements, dataType) do { \
(pointerData) = (dataType *)malloc( (nbElements) * sizeof(dataType) ); \ (pointerData) = (dataType *)malloc( (nbElements) * sizeof(dataType) ); \
}while(0) }while(0)
# define EDN_MALLOC_CAST(pointerData, nbElements, dataType, cast) do { \ # define APPL_MALLOC_CAST(pointerData, nbElements, dataType, cast) do { \
(pointerData) = (cast)malloc( (nbElements) * sizeof(dataType) ); \ (pointerData) = (cast)malloc( (nbElements) * sizeof(dataType) ); \
}while(0) }while(0)
# define EDN_CALLOC(pointerData, nbElements, dataType) do { \ # define APPL_CALLOC(pointerData, nbElements, dataType) do { \
(pointerData) = (dataType *)calloc( (nbElements), sizeof(dataType) ); \ (pointerData) = (dataType *)calloc( (nbElements), sizeof(dataType) ); \
}while(0) }while(0)
# define EDN_CALLOC_CAST(pointerData, nbElements, dataType, cast) do { \ # define APPL_CALLOC_CAST(pointerData, nbElements, dataType, cast) do { \
(pointerData) = (cast)calloc( (nbElements), sizeof(dataType) ); \ (pointerData) = (cast)calloc( (nbElements), sizeof(dataType) ); \
}while(0) }while(0)
# define EDN_REALLOC(pointerData, nbElements, dataType) do { \ # define APPL_REALLOC(pointerData, nbElements, dataType) do { \
(pointerData) = (dataType *)realloc( (pointerData), (nbElements)* sizeof(dataType) ); \ (pointerData) = (dataType *)realloc( (pointerData), (nbElements)* sizeof(dataType) ); \
}while(0) }while(0)
# define EDN_REALLOC_CAST(pointerData, nbElements, dataType, cast) do { \ # define APPL_REALLOC_CAST(pointerData, nbElements, dataType, cast) do { \
(pointerData) = (cast)realloc( (pointerData), (nbElements) * sizeof(dataType) ); \ (pointerData) = (cast)realloc( (pointerData), (nbElements) * sizeof(dataType) ); \
}while(0) }while(0)
# define EDN_FREE(pointerData) do { \ # define APPL_FREE(pointerData) do { \
free( pointerData ); \ free( pointerData ); \
(pointerData) = NULL; \ (pointerData) = NULL; \
}while(0) }while(0)
# define EDN_MEM_SHOW_LOG() do { \ # define APPL_MEM_SHOW_LOG() do { \
sup_system_diag("No Memory check availlable"); \ sup_system_diag("No Memory check availlable"); \
}while(0) }while(0)
#endif #endif

View File

@@ -1,78 +0,0 @@
/**
*******************************************************************************
* @file tools_debug.h
* @brief Editeur De N'ours : log implementation
* @author Edouard DUPIN
* @date 08/06/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __TOOLS_DEBUG_H__
#define __TOOLS_DEBUG_H__
#include <etk/Types.h>
#include <etk/Debug.h>
extern const char * ednLog;
#define EDN_CRITICAL(data) ETK_CRITICAL(ednLog, data)
// General
#if EDN_DEBUG_LEVEL > 0
# define EDN_WARNING(data) ETK_WARNING(ednLog, data)
# define EDN_ERROR(data) ETK_ERROR(ednLog, data)
#else
# define EDN_WARNING(data) do {}while(0)
# define EDN_ERROR(data) do {}while(0)
#endif
#if EDN_DEBUG_LEVEL > 1
# define EDN_INFO(data) ETK_INFO(ednLog, data)
#else
# define EDN_INFO(data) do {}while(0)
#endif
#if EDN_DEBUG_LEVEL > 2
# define EDN_DEBUG(data) ETK_DEBUG(ednLog, data)
#else
# define EDN_DEBUG(data) do {}while(0)
#endif
#if EDN_DEBUG_LEVEL > 3
# define EDN_VERBOSE(data) ETK_VERBOSE(ednLog, data)
#else
# define EDN_VERBOSE(data) do {}while(0)
#endif
#define EDN_TODO(data) ETK_WARNING(ednLog, "TODO : " << data)
#define EDN_ASSERT(cond, data) ETK_ASSERT(ednLog, cond, data)
#if EDN_DEBUG_LEVEL > 1
# define EDN_CHECK_INOUT(cond) ETK_CHECK_INOUT_ASSERT(ednLog, cond)
#elif EDN_DEBUG_LEVEL > 0
# define EDN_CHECK_INOUT(cond) ETK_CHECK_INOUT_WARNING(ednLog, cond)
#else
# define EDN_CHECK_INOUT(cond) do { } while (0)
#endif
#endif

View File

@@ -1,55 +0,0 @@
/**
*******************************************************************************
* @file types_generique.h
* @brief Editeur De N'ours : generique define type
* @author Edouard DUPIN
* @date 08/06/2010
* @par Project
* Edn
*
* @par Copyright
* Copyright 2010 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
* You can not earn money with this Software (if the source extract from Edn
* represent less than 50% of original Sources)
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __TOOLS_TYPES_GENERIQUE_H__
#define __TOOLS_TYPES_GENERIQUE_H__
// includes system, malloc, EXIT_SUCCESS
#include <stdlib.h>
// includes fopen, fwrite, fseek, ftell
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <assert.h>
#include <ewol/ewol.h>
typedef enum {
ERR_NONE = 0, //!< No error, luckily everything went fine
ERR_FAIL, //!< Miscellaneous failure
ERR_INVAL, //!< Invalid entry parameter
ERR_MEM, //!< Dynamic memory allocation failure
ERR_TIMEOUT, //!< Request time out
ERR_BUSY, //!< Element curently Busy
}erreurCode_te;
#define edn_min(elemA, elemB) ((elemA)<(elemB)) ? (elemA) : (elemB)
#define edn_max(elemA, elemB) ((elemA)<(elemB)) ? (elemB) : (elemA)
#define edn_average(minimim, elem, maximum) ((minimim)>(elem)) ? (minimim) : ((maximum)<(elem)) ? (maximum) : (elem)
#endif

View File

@@ -5,46 +5,46 @@
############################################################################### ###############################################################################
# ExuberantCtags reading file tools (extern OPEN Sources) : # ExuberantCtags reading file tools (extern OPEN Sources) :
FILE_LIST+= edn/ctags/readtags.cpp \ FILE_LIST+= appl/ctags/readtags.cpp \
edn/ctags/CTagsManager.cpp appl/ctags/CTagsManager.cpp
# Globals debug tool: # Globals debug tool:
FILE_LIST+= edn/tools/debug/tools_debug.cpp \ FILE_LIST+= appl/Debug.cpp \
edn/tools/globals/tools_globals.cpp \ appl/tools/globals/tools_globals.cpp \
edn/tools/memory/toolsMemory.cpp appl/tools/memory/toolsMemory.cpp
# Buffers internal: # Buffers internal:
FILE_LIST+= edn/tools/EdnTemplate/EdnVectorBuf.cpp \ FILE_LIST+= appl/tools/EdnTemplate/EdnVectorBuf.cpp \
edn/tools/EdnBuf/EdnBuf.cpp \ appl/tools/EdnBuf/EdnBuf.cpp \
edn/tools/EdnBuf/EdnBuf_HighLight.cpp \ appl/tools/EdnBuf/EdnBuf_HighLight.cpp \
edn/tools/EdnBuf/EdnBuf_History.cpp \ appl/tools/EdnBuf/EdnBuf_History.cpp \
edn/tools/EdnBuf/EdnBuf_Selection.cpp \ appl/tools/EdnBuf/EdnBuf_Selection.cpp \
edn/tools/EdnBuf/EdnBufHistory.cpp appl/tools/EdnBuf/EdnBufHistory.cpp
# Tools internal: # Tools internal:
FILE_LIST+= edn/tools/Display/Display.cpp \ FILE_LIST+= appl/tools/Display/Display.cpp \
edn/tools/MsgBroadcast/MsgBroadcast.cpp appl/tools/MsgBroadcast/MsgBroadcast.cpp
# Gui: # Gui:
FILE_LIST+= edn/Gui/BufferView.cpp \ FILE_LIST+= appl/Gui/BufferView.cpp \
edn/Gui/CodeView.cpp \ appl/Gui/CodeView.cpp \
edn/Gui/MainWindows.cpp \ appl/Gui/MainWindows.cpp \
edn/Gui/Search.cpp \ appl/Gui/Search.cpp \
edn/Gui/SearchData.cpp appl/Gui/SearchData.cpp
# Basic Interface : # Basic Interface :
FILE_LIST+= edn/Buffer/Buffer.cpp \ FILE_LIST+= appl/Buffer/Buffer.cpp \
edn/Buffer/BufferText.cpp \ appl/Buffer/BufferText.cpp \
edn/Buffer/BufferEmpty.cpp \ appl/Buffer/BufferEmpty.cpp \
edn/Buffer/BufferManager.cpp \ appl/Buffer/BufferManager.cpp \
edn/Colorize/Colorize.cpp \ appl/Colorize/Colorize.cpp \
edn/Colorize/ColorizeManager.cpp \ appl/Colorize/ColorizeManager.cpp \
edn/Highlight/HighlightPattern.cpp \ appl/Highlight/HighlightPattern.cpp \
edn/Highlight/Highlight.cpp \ appl/Highlight/Highlight.cpp \
edn/Highlight/HighlightManager.cpp appl/Highlight/HighlightManager.cpp
# Main entry file : # Main entry file :
FILE_LIST+= edn/init.cpp FILE_LIST+= appl/init.cpp