Normalisation with etk application

This commit is contained in:
Edouard Dupin 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 \
-DETK_DEBUG_LEVEL=3 \
-DAPPL_DEBUG_LEVEL=3 \
-DEDN_DEBUG_LEVEL=3 \
-DDATA_IN_APK \
-frtti

View File

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

View File

@ -77,7 +77,7 @@ class Buffer {
bool IsModify(void);
protected:
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:
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate);
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 <BufferEmpty.h>
#include <ColorizeManager.h>

View File

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

View File

@ -23,7 +23,7 @@
*******************************************************************************
*/
#include <tools_debug.h>
#include <appl/Debug.h>
#include <tools_globals.h>
#include <BufferText.h>
#include <toolsMemory.h>
@ -81,7 +81,7 @@ void BufferText::BasicInit(void)
void BufferText::NameChange(void)
{
// Find HL system
//EDN_DEBUG("check name change");
//APPL_DEBUG("check name change");
if (true == HighlightManager::Exist(m_fileName)) {
Highlight * myHL = HighlightManager::Get(m_fileName);
// Set the new HL
@ -105,7 +105,7 @@ BufferText::BufferText()
{
BasicInit();
SetModify(true);
EDN_INFO("New(Empty-Buffer)");
APPL_INFO("New(Empty-Buffer)");
}
@ -121,7 +121,7 @@ BufferText::BufferText(etk::File &fileName) : Buffer(fileName)
{
BasicInit();
NameChange();
EDN_INFO("Add Data from file(" << GetFileName() << ")");
APPL_INFO("Add Data from file(" << GetFileName() << ")");
FILE * myFile = NULL;
// try to open the file. if not existed, new file
@ -133,7 +133,7 @@ BufferText::BufferText(etk::File &fileName) : Buffer(fileName)
SetModify(false);
} else {
// 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);
}
RequestPositionUpdate();
@ -150,7 +150,7 @@ BufferText::BufferText(etk::File &fileName) : Buffer(fileName)
*/
void BufferText::Save(void)
{
EDN_INFO("Save File : \"" << GetFileName() << "\"" );
APPL_INFO("Save File : \"" << GetFileName() << "\"" );
FILE * myFile = NULL;
myFile = fopen(GetFileName().GetCompleateName().Utf8Data(), "w");
if (NULL != myFile) {
@ -158,7 +158,7 @@ void BufferText::Save(void)
fclose(myFile);
SetModify(false);
} 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)
{
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
m_displaySize.x = (sizeX/letterWidth) + 1 - nbColoneForLineNumber;
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);
@ -333,15 +333,15 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
m_EdnBuf.HightlightGenerateLines(m_displayLocalSyntax, displayStartBufferPos, m_displaySize.y);
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];
memset(displayChar, 0, sizeof(uniChar_t)*MAX_EXP_CHAR_LEN);
etk::UString myStringToDisplay;
// draw the lineNumber :
int32_t currentLineID = displayStartLineId+1;
EDN_VERBOSE("Start display of text buffer [" << displayStartBufferPos<< ".." << mylen << "]");
EDN_VERBOSE("cursor Pos : " << m_cursorPos << "start at pos=" << displayStartBufferPos);
APPL_VERBOSE("Start display of text buffer [" << displayStartBufferPos<< ".." << mylen << "]");
APPL_VERBOSE("cursor Pos : " << m_cursorPos << "start at pos=" << displayStartBufferPos);
OOTextNormal.clippingDisable();
@ -368,13 +368,13 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
OOColored.clippingSet(drawClippingTextArea);
for (iii=displayStartBufferPos; iii<mylen && displayLines < m_displaySize.y ; iii = new_i) {
//EDN_DEBUG("diplay element=" << iii);
//APPL_DEBUG("diplay element=" << iii);
int displaywidth;
uint32_t currentChar = '\0';
new_i = iii;
displaywidth = m_EdnBuf.GetExpandedChar(new_i, idX, displayChar, currentChar);
int32_t drawSize = 0;
//EDN_INFO("diplay element=" << new_i);
//APPL_INFO("diplay element=" << new_i);
if (currentChar!='\n') {
selectColor = myColor;
HLColor = m_EdnBuf.GetElementColorAtPosition(m_displayLocalSyntax, iii);
@ -459,7 +459,7 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
}
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;
}
@ -491,11 +491,11 @@ int32_t BufferText::GetMousePosition(int32_t fontId, int32_t width, int32_t heig
int32_t pixelX = 0;
int32_t startLinePosition = m_EdnBuf.CountForwardNLines(0, lineOffset);
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;
}
EDN_VERBOSE("Get id element : x=" << width << "px y=" << height << "px");
EDN_VERBOSE(" line offset = " << lineOffset);
APPL_VERBOSE("Get id element : x=" << width << "px y=" << height << "px");
APPL_VERBOSE(" line offset = " << lineOffset);
for (iii=startLinePosition; iii<mylen; iii = new_i) {
int displaywidth;
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);
if (currentChar!='\n') {
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;
if (width <= pixelX) {
EDN_VERBOSE(" Find IT ==> END");
APPL_VERBOSE(" Find IT ==> END");
// find position ...
break;
}
} 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
break;
}
idX += displaywidth;
}
EDN_VERBOSE("BufferText::GetMousePosition(" << width << "," << height << "); ==> " << iii );
APPL_VERBOSE("BufferText::GetMousePosition(" << width << "," << height << "); ==> " << iii );
return iii;
}
@ -570,7 +570,7 @@ void BufferText::MouseSelectFromCursorTo(int32_t fontId, int32_t width, int32_t
int32_t selStart, selEnd, selRectStart, selRectEnd;
bool selIsRect;
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;
// move the cursor
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);
int32_t rememberCursorPos = m_cursorPos;
//EDN_DEBUG("newPos=" << newPos);
//APPL_DEBUG("newPos=" << newPos);
// unselect buffer:
m_EdnBuf.Unselect(SELECTION_PRIMARY);
@ -724,10 +724,10 @@ bool BufferText::TextDMoveUp(int32_t offset)
// Get the previous line
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
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
SetInsertPosition(newPos);
@ -758,10 +758,10 @@ bool BufferText::TextDMoveDown(int32_t offset)
}
// get the next line :
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
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);
// if a preferred column wasn't aleady established, establish it
@ -786,40 +786,40 @@ void BufferText::cursorMove(ewol::eventKbMoveType_te moveTypeEvent)
// check selection event ...
switch(moveTypeEvent) {
case ewol::EVENT_KB_MOVE_TYPE_LEFT:
//EDN_INFO("keyEvent : <LEFT>");
//APPL_INFO("keyEvent : <LEFT>");
if (m_cursorPos > 0) {
SetInsertPosition(m_cursorPos - 1);
}
break;
case ewol::EVENT_KB_MOVE_TYPE_RIGHT:
//EDN_INFO("keyEvent : <RIGHT>");
//APPL_INFO("keyEvent : <RIGHT>");
if (m_cursorPos < m_EdnBuf.Size() ) {
SetInsertPosition(m_cursorPos + 1);
}
break;
case ewol::EVENT_KB_MOVE_TYPE_UP:
//EDN_INFO("keyEvent : <UP>");
//APPL_INFO("keyEvent : <UP>");
TextDMoveUp(1);
break;
case ewol::EVENT_KB_MOVE_TYPE_DOWN:
//EDN_INFO("keyEvent : <DOWN>");
//APPL_INFO("keyEvent : <DOWN>");
// check if we have enought line ...
TextDMoveDown(1);
break;
case ewol::EVENT_KB_MOVE_TYPE_PAGE_UP:
//EDN_INFO("keyEvent : <PAGE-UP>");
//APPL_INFO("keyEvent : <PAGE-UP>");
TextDMoveUp(m_displaySize.y);
break;
case ewol::EVENT_KB_MOVE_TYPE_PAGE_DOWN:
//EDN_INFO("keyEvent : <PAGE-DOWN>");
//APPL_INFO("keyEvent : <PAGE-DOWN>");
TextDMoveDown(m_displaySize.y);
break;
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) );
break;
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) );
break;
default:
@ -869,12 +869,12 @@ void BufferText::RequestPositionUpdate(bool centerPage)
if (centerPage == false) {
/*
// 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;
cursorPosition.y = m_EdnBuf.CountLines(0, m_cursorPos);
int32_t lineStartPos = m_EdnBuf.StartOfLine(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() ) {
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;
}
// 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() ) {
m_displayStartPixelX = cursorPosition.x - globals::getNbColoneBorder();
if (m_displayStartPixelX < 0) {
@ -901,19 +901,19 @@ void BufferText::RequestPositionUpdate(bool centerPage)
} else {
// center the line at the middle of the screen :
coord2D_ts cursorPosition;
//EDN_DEBUG(" -------------------------------------------------");
//APPL_DEBUG(" -------------------------------------------------");
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;
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 = edn_max(m_displayStartLineId, 0);
m_displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, m_displayStartLineId);
//EDN_DEBUG(" display start : " << m_displayStartPixelX << "x" << m_displayStartLineId);
//EDN_DEBUG(" -------------------------------------------------");
//APPL_DEBUG(" display start : " << m_displayStartPixelX << "x" << m_displayStartLineId);
//APPL_DEBUG(" -------------------------------------------------");
}
#endif
}
@ -991,7 +991,7 @@ void BufferText::AddChar(uniChar_t unicodeData)
SetInsertPosition(SelectionStart+tmpVect.Size(), true);
}
} else if (unicodeData == 0x7F ) {
//EDN_INFO("keyEvent : <Suppr> pos=" << m_cursorPos);
//APPL_INFO("keyEvent : <Suppr> pos=" << m_cursorPos);
if (false == haveSelectionActive) {
m_EdnBuf.Remove(m_cursorPos, m_cursorPos+1);
} else {
@ -999,7 +999,7 @@ void BufferText::AddChar(uniChar_t unicodeData)
SetInsertPosition(SelectionStart, true);
}
} else if (unicodeData == 0x08) {
//EDN_INFO("keyEvent : <Del> pos=" << m_cursorPos);
//APPL_INFO("keyEvent : <Del> pos=" << m_cursorPos);
if (false == haveSelectionActive) {
m_EdnBuf.Remove(m_cursorPos-1, m_cursorPos);
SetInsertPosition(m_cursorPos-1, true);
@ -1047,13 +1047,13 @@ void BufferText::AddChar(uniChar_t unicodeData)
int32_t BufferText::FindLine(etk::UString &data)
{
if ( 0 == data.Size()) {
EDN_WARNING("no search data");
APPL_WARNING("no search data");
return 0;
}
EDN_INFO("Search data line : \"" << data << "\"");
APPL_INFO("Search data line : \"" << data << "\"");
etk::VectorType<uniChar_t> mVectSearch;
mVectSearch = data.GetVector();
//EDN_INFO("search data Forward : startSearchPos=" << startSearchPos );
//APPL_INFO("search data Forward : startSearchPos=" << startSearchPos );
/*
int32_t foundPos;
bool findSomething = m_EdnBuf.SearchForward(0, mVectSearch, &foundPos, true);
@ -1064,7 +1064,7 @@ int32_t BufferText::FindLine(etk::UString &data)
return 0;
}
*/
EDN_TODO("Remove for now ...");
APPL_TODO("Remove for now ...");
return 0;
}
@ -1072,7 +1072,7 @@ void BufferText::JumpAtLine(int32_t newLine)
{
int32_t positionLine = m_EdnBuf.CountForwardNLines(0, newLine);
m_EdnBuf.Unselect(SELECTION_PRIMARY);
EDN_DEBUG("jump at the line : " << newLine );
APPL_DEBUG("jump at the line : " << newLine );
SetInsertPosition(positionLine);
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)
{
EDN_INFO("Search data : \"" << data << "\"");
APPL_INFO("Search data : \"" << data << "\"");
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
bool SelectionIsRect;
@ -1110,21 +1110,21 @@ void BufferText::Search(etk::UString &data, bool back, bool caseSensitive, bool
}
if ( 0 == data.Size()) {
EDN_WARNING("no search data");
APPL_WARNING("no search data");
return;
}
etk::VectorType<uniChar_t> mVectSearch;
mVectSearch = data.GetVector();
EDN_TODO("Remove for now ...");
APPL_TODO("Remove for now ...");
/*
if (false == back) {
//EDN_INFO("search data Forward : startSearchPos=" << startSearchPos );
//APPL_INFO("search data Forward : startSearchPos=" << startSearchPos );
int32_t foundPos;
bool findSomething = m_EdnBuf.SearchForward(startSearchPos, mVectSearch, &foundPos, caseSensitive);
if( false == findSomething
&& true == wrap)
{
//EDN_INFO("WrapMode !!! 0 ==> end");
//APPL_INFO("WrapMode !!! 0 ==> end");
findSomething = m_EdnBuf.SearchForward(0, mVectSearch, &foundPos, caseSensitive);
}
// if find data :
@ -1136,13 +1136,13 @@ void BufferText::Search(etk::UString &data, bool back, bool caseSensitive, bool
RequestPositionUpdate();
}
} else {
//EDN_INFO("search data Backward : " << data.GetDirectPointer() );
//APPL_INFO("search data Backward : " << data.GetDirectPointer() );
int32_t foundPos;
bool findSomething = m_EdnBuf.SearchBackward(startSearchPos, mVectSearch, &foundPos, caseSensitive);
if( false == findSomething
&& true == wrap)
{
//EDN_INFO("WrapMode !!! end ==> 0");
//APPL_INFO("WrapMode !!! end ==> 0");
findSomething = m_EdnBuf.SearchBackward(m_EdnBuf.Size(), mVectSearch, &foundPos, caseSensitive);
}
// if find data :
@ -1211,7 +1211,7 @@ void BufferText::Cut(int8_t clipboardID)
Copy(clipboardID);
// remove data :
if (true == haveSelectionActive ) {
EDN_INFO("REMOVE SELECTION");
APPL_INFO("REMOVE SELECTION");
m_EdnBuf.RemoveSelected(SELECTION_PRIMARY);
m_cursorPos = SelectionStart;
}

View File

@ -23,7 +23,7 @@
*******************************************************************************
*/
#include <tools_debug.h>
#include <appl/Debug.h>
#include <tools_globals.h>
#include <Colorize.h>
@ -49,7 +49,7 @@ Colorize::Colorize( etk::UString &newColorName)
haveFG = false;
haveBG = false;
SetName(newColorName);
//EDN_INFO("New(Colorise)");
//APPL_INFO("New(Colorise)");
}
Colorize::Colorize(void)
@ -70,7 +70,7 @@ Colorize::Colorize(void)
haveFG = false;
haveBG = false;
//EDN_INFO("New(Colorise)");
//APPL_INFO("New(Colorise)");
}
Colorize::~Colorize(void)
@ -81,13 +81,13 @@ Colorize::~Colorize(void)
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;
}
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;
}
@ -114,7 +114,7 @@ void Colorize::SetFgColor(const char *myColor)
} else {
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)
@ -146,9 +146,9 @@ void Colorize::SetItalic(bool enable)
italic = enable;
/*
if (true == enable) {
EDN_INFO("color : \"%s\" enable italic", ColorName.c_str());
APPL_INFO("color : \"%s\" enable italic", ColorName.c_str());
} 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;
/*
if (true == enable) {
EDN_INFO("color : \"%s\" enable bold", ColorName.c_str());
APPL_INFO("color : \"%s\" enable bold", ColorName.c_str());
} 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__
#define __COLORIZE_H__
#include <etk/UString.h>
class Colorize {
public:
@ -50,7 +50,7 @@ class Colorize {
bool GetItalic(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:
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 <ColorizeManager.h>
#include <tinyXML/tinyxml.h>
@ -128,7 +128,7 @@ void classColorManager::OnReceiveMessage(ewol::EObject * CallerObject, const cha
/*
switch (id)
{
case EDN_MSG__RELOAD_COLOR_FILE:
case APPL_MSG__RELOAD_COLOR_FILE:
{
// Reaload File
// TODO : Check this : Pb in the recopy etk::UString element
@ -163,7 +163,7 @@ void classColorManager::LoadFile(const char * xmlFilename)
listMyColor.Clear();
m_fileColor = xmlFilename;
EDN_DEBUG("open file (COLOR) \"" << xmlFilename << "\" ? = \"" << m_fileColor << "\"");
APPL_DEBUG("open file (COLOR) \"" << xmlFilename << "\" ? = \"" << m_fileColor << "\"");
errorColor = new Colorize();
errorColor->SetBgColor("#000000");
errorColor->SetFgColor("#FFFFFF");
@ -173,22 +173,22 @@ void classColorManager::LoadFile(const char * xmlFilename)
// open the curent File
etk::File fileName(xmlFilename, etk::FILE_TYPE_DATA);
if (false == fileName.Exist()) {
EDN_ERROR("File Does not exist : " << fileName);
APPL_ERROR("File Does not exist : " << fileName);
return;
}
int32_t fileSize = fileName.Size();
if (0==fileSize) {
EDN_ERROR("This file is empty : " << fileName);
APPL_ERROR("This file is empty : " << fileName);
return;
}
if (false == fileName.fOpenRead()) {
EDN_ERROR("Can not open the file : " << fileName);
APPL_ERROR("Can not open the file : " << fileName);
return;
}
// allocate data
char * fileBuffer = new char[fileSize+5];
if (NULL == fileBuffer) {
EDN_ERROR("Error Memory allocation size=" << fileSize);
APPL_ERROR("Error Memory allocation size=" << fileSize);
return;
}
memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
@ -201,7 +201,7 @@ void classColorManager::LoadFile(const char * xmlFilename)
TiXmlElement* root = XmlDocument.FirstChildElement( "EdnColor" );
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;
} else {
TiXmlNode * pNode = root->FirstChild();
@ -220,7 +220,7 @@ void classColorManager::LoadFile(const char * xmlFilename)
const char *colorName = pGuiNode->ToElement()->Attribute("name");
int32_t id = 0;
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
pGuiNode = pGuiNode->NextSibling();
continue;
@ -246,7 +246,7 @@ void classColorManager::LoadFile(const char * xmlFilename)
} else if (!strcmp(colorName, "LIST_textModify")) {
id = COLOR_LIST_TEXT_MODIFY;
} 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
pGuiNode = pGuiNode->NextSibling();
continue;
@ -267,13 +267,13 @@ void classColorManager::LoadFile(const char * xmlFilename)
basicColors[id].alpha = (float)a/255.0;
}
/*
EDN_INFO(" Specify color for system ID="<< id );
EDN_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(" Specify color for system ID="<< id );
APPL_INFO(" " << color << " ==> r="<< r <<" v="<< v <<" b="<< b );
APPL_INFO(" " << color << " ==> r="<< basicColors[id].red <<" v="<< basicColors[id].green <<" b="<< basicColors[id].blue );
*/
}
} 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
pGuiNode = pGuiNode->NextSibling();
@ -292,13 +292,13 @@ void classColorManager::LoadFile(const char * xmlFilename)
// get the name of the Chaine
const char *colorName = pGuiNode->ToElement()->Attribute("name");
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
pGuiNode = pGuiNode->NextSibling();
continue;
} else {
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");
@ -326,12 +326,12 @@ void classColorManager::LoadFile(const char * xmlFilename)
}
listMyColor.PushBack(myNewColor);
} 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();
}
} 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
pNode = pNode->NextSibling();
@ -340,8 +340,8 @@ void classColorManager::LoadFile(const char * xmlFilename)
if (NULL != fileBuffer) {
delete[] fileBuffer;
}
//SendMessage(EDN_MSG__COLOR_HAS_CHANGE);
//SendMessage(EDN_MSG__USER_DISPLAY_CHANGE);
//SendMessage(APPL_MSG__COLOR_HAS_CHANGE);
//SendMessage(APPL_MSG__USER_DISPLAY_CHANGE);
}
// TODO : Remove this ...
@ -354,7 +354,7 @@ Colorize *classColorManager::Get(const char *colorName)
return listMyColor[i];
}
}
EDN_ERROR(PFX"Color does not Existed ["<< colorName<<"]" );
APPL_ERROR(PFX"Color does not Existed ["<< colorName<<"]" );
// an error
return errorColor;
}
@ -397,10 +397,10 @@ bool classColorManager::Exist(etk::UString &colorName)
void classColorManager::DisplayListOfColor(void)
{
int32_t i;
EDN_INFO(PFX"List of ALL COLOR : ");
APPL_INFO(PFX"List of ALL COLOR : ");
for (i=0; i<listMyColor.Size(); i++) {
//etk::UString elementName = listMyColor[i]->GetName();
//EDN_INFO(i << " : \"" << elementName.c_str() << "\"" );
//APPL_INFO(i << " : \"" << elementName.c_str() << "\"" );
listMyColor[i]->Display(i);
}
}

View File

@ -1,6 +1,6 @@
/**
*******************************************************************************
* @file tools_debug.h
* @file Debug.h
* @brief Editeur De N'ours : log implementation
* @author Edouard DUPIN
* @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/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
#if APPL_DEBUG_LEVEL > 0
# define APPL_WARNING(data) ETK_WARNING(ednLog, data)
# define APPL_ERROR(data) ETK_ERROR(ednLog, data)
# define APPL_WARNING(data) ETK_WARNING(applLog, data)
# define APPL_ERROR(data) ETK_ERROR(applLog, data)
#else
# define APPL_WARNING(data) do {}while(0)
# define APPL_ERROR(data) do {}while(0)
#endif
#if APPL_DEBUG_LEVEL > 1
# define APPL_INFO(data) ETK_INFO(ednLog, data)
# define APPL_INFO(data) ETK_INFO(applLog, data)
#else
# define APPL_INFO(data) do {}while(0)
#endif
#if APPL_DEBUG_LEVEL > 2
# define APPL_DEBUG(data) ETK_DEBUG(ednLog, data)
# define APPL_DEBUG(data) ETK_DEBUG(applLog, data)
#else
# define APPL_DEBUG(data) do {}while(0)
#endif
#if APPL_DEBUG_LEVEL > 3
# define APPL_VERBOSE(data) ETK_VERBOSE(ednLog, data)
# define APPL_VERBOSE(data) ETK_VERBOSE(applLog, data)
#else
# define APPL_VERBOSE(data) do {}while(0)
#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
# 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
# define APPL_CHECK_INOUT(cond) ETK_CHECK_INOUT_WARNING(ednLog, cond)
# define APPL_CHECK_INOUT(cond) ETK_CHECK_INOUT_WARNING(applLog, cond)
#else
# define APPL_CHECK_INOUT(cond) do { } while (0)
#endif

View File

@ -23,7 +23,7 @@
*******************************************************************************
*/
#include <tools_debug.h>
#include <appl/Debug.h>
#include <tools_globals.h>
#include <Display.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)
{
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);
if ( 0 <= selectBuf) {
m_selectedID = raw;

View File

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

View File

@ -26,7 +26,7 @@
#include <CodeView.h>
#include <tools_debug.h>
#include <appl/Debug.h>
#include <tools_globals.h>
#include <Display.h>
#include <CodeView.h>
@ -172,7 +172,7 @@ void CodeView::OnRegenerateDisplay(void)
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
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...
WidgetScrooled::OnRegenerateDisplay();
@ -183,7 +183,7 @@ void CodeView::OnRegenerateDisplay(void)
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) {
BufferManager::Get(m_bufferID)->AddChar(unicodeData);
MarkToReedraw();
@ -259,7 +259,7 @@ bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent,
if (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);
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)
{
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) {
int32_t bufferID = 0;
sscanf(data.Utf8Data(), "%d", &bufferID);
EDN_INFO("Select a new Buffer ... " << bufferID);
APPL_INFO("Select a new Buffer ... " << bufferID);
m_bufferID = bufferID;
// TODO : need to update the state of the file and the filenames ...
} else if (eventId == ednMsgGuiCopy) {
@ -308,13 +308,13 @@ void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * event
} else if (eventId == ednMsgGuiRm) {
// data : "Word" "Line" "Paragraph"
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") {
BufferManager::Get(m_bufferID)->RemoveLine();
} else if (data == "Paragraph") {
EDN_WARNING(" on event " << eventId << " data=\"" << data << "\" ==> not coded" );
APPL_WARNING(" on event " << eventId << " data=\"" << data << "\" ==> not coded" );
} else {
EDN_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
}
} else if (eventId == ednMsgGuiSelect) {
// data : "ALL" "NONE"
@ -323,7 +323,7 @@ void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * event
} else if (data == "NONE") {
BufferManager::Get(m_bufferID)->SelectNone();
} else {
EDN_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
}
} else if (eventId == ednMsgGuiChangeCharset) {
// 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") {
BufferManager::Get(m_bufferID)->SetCharset(unicode::EDN_CHARSET_ISO_8859_15);
} else {
EDN_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
}
}
/*
switch (id)
{
case EDN_MSG__CURRENT_FIND_PREVIOUS:
case APPL_MSG__CURRENT_FIND_PREVIOUS:
{
etk::UString myDataString;
SearchData::GetSearch(myDataString);
BufferManager::Get(m_bufferID)->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
}
break;
case EDN_MSG__CURRENT_FIND_NEXT:
case APPL_MSG__CURRENT_FIND_NEXT:
{
etk::UString myDataString;
SearchData::GetSearch(myDataString);
BufferManager::Get(m_bufferID)->Search(myDataString, false, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
}
break;
case EDN_MSG__CURRENT_REPLACE:
case APPL_MSG__CURRENT_REPLACE:
{
etk::UString myDataString;
SearchData::GetReplace(myDataString);
BufferManager::Get(m_bufferID)->Replace(myDataString);
}
break;
case EDN_MSG__CURRENT_REPLACE_ALL:
case APPL_MSG__CURRENT_REPLACE_ALL:
break;
case EDN_MSG__CURRENT_GOTO_LINE:
case APPL_MSG__CURRENT_GOTO_LINE:
if (dataID<0) {
dataID = 0;
}
BufferManager::Get(m_bufferID)->JumpAtLine(dataID);
break;
case EDN_MSG__CURRENT_SET_CHARSET:
case APPL_MSG__CURRENT_SET_CHARSET:
BufferManager::Get(m_bufferID)->SetCharset((unicode::charset_te)dataID);
break;
}
@ -385,14 +385,14 @@ void CodeView::OnGetFocus(void)
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_bufferID);
*/
ewol::KeyboardShow(ewol::KEYBOARD_MODE_CODE);
EDN_INFO("Focus - In");
APPL_INFO("Focus - In");
}
void CodeView::OnLostFocus(void)
{
ewol::KeyboardHide();
EDN_INFO("Focus - out");
APPL_INFO("Focus - out");
}
void CodeView::SetFontSize(int32_t size)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -23,7 +23,7 @@
*******************************************************************************
*/
#include <tools_debug.h>
#include <appl/Debug.h>
#include <tools_globals.h>
#include <Highlight.h>
#include <tinyXML/tinyxml.h>
@ -51,22 +51,22 @@ Highlight::Highlight(etk::UString &xmlFilename)
etk::File fileName(xmlFilename, etk::FILE_TYPE_DATA);
if (false == fileName.Exist()) {
EWOL_ERROR("File Does not exist : " << fileName);
APPL_ERROR("File Does not exist : " << fileName);
return;
}
int32_t fileSize = fileName.Size();
if (0==fileSize) {
EWOL_ERROR("This file is empty : " << fileName);
APPL_ERROR("This file is empty : " << fileName);
return;
}
if (false == fileName.fOpenRead()) {
EWOL_ERROR("Can not open the file : " << fileName);
APPL_ERROR("Can not open the file : " << fileName);
return;
}
// allocate data
char * fileBuffer = new char[fileSize+5];
if (NULL == fileBuffer) {
EWOL_ERROR("Error Memory allocation size=" << fileSize);
APPL_ERROR("Error Memory allocation size=" << fileSize);
return;
}
memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
@ -77,14 +77,14 @@ Highlight::Highlight(etk::UString &xmlFilename)
// load the XML from the memory
bool loadError = XmlDocument.Parse((const char*)fileBuffer, 0, TIXML_ENCODING_UTF8);
if (false == loadError) {
EDN_ERROR( "can not load Hightlight XML: PARSING error: \"" << xmlFilename << "\"");
APPL_ERROR( "can not load Hightlight XML: PARSING error: \"" << xmlFilename << "\"");
return;
}
TiXmlElement* root = XmlDocument.FirstChildElement( "EdnLang" );
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;
}
@ -98,7 +98,7 @@ Highlight::Highlight(etk::UString &xmlFilename)
} else if (!strcmp(child->Value(), "ext")) {
const char *myData = child->ToElement()->GetText();
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);
m_listExtentions.PushBack(myEdnData);
}
@ -111,7 +111,7 @@ Highlight::Highlight(etk::UString &xmlFilename)
} else if (!strcmp(passChild->Value(), "rule")) {
ParseRules(passChild, m_listHighlightPass1, level1++);
} 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 :
passChild = passChild->NextSibling();
@ -125,13 +125,13 @@ Highlight::Highlight(etk::UString &xmlFilename)
} else if (!strcmp(passChild->Value(), "rule")) {
ParseRules(passChild, m_listHighlightPass2, level2++);
} 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 :
passChild = passChild->NextSibling();
}
} 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 :
child = child->NextSibling();
@ -201,7 +201,7 @@ bool Highlight::FileNameCompatible(etk::File &fileName)
} else {
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++) {
if (extention == *m_listExtentions[i] ) {
@ -215,18 +215,18 @@ bool Highlight::FileNameCompatible(etk::File &fileName)
void Highlight::Display(void)
{
int32_t i;
EDN_INFO("List of ALL Highlight : ");
APPL_INFO("List of ALL Highlight : ");
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
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();
}
// Display all elements
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();
}
}
@ -243,26 +243,26 @@ void Highlight::Parse(int32_t start,
if (0 > addingPos) {
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 elementStop = stop;
colorInformation_ts resultat;
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
for (int32_t jjj=0; jjj<m_listHighlightPass1.Size(); jjj++){
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)
ret = m_listHighlightPass1[jjj]->Find(elementStart, buffer.Size(), resultat, buffer);
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...
int32_t kkk=addingPos;
while(kkk < metaData.Size() ) {
if (metaData[kkk].beginStart <= resultat.endStop) {
// Remove element
//EDN_INFO("Erase element=" << kkk);
//APPL_INFO("Erase element=" << kkk);
metaData.EraseLen(kkk, kkk+1);
// Increase the end of search
if (kkk < metaData.Size()) {
@ -279,7 +279,7 @@ void Highlight::Parse(int32_t start,
}
// Add curent element in the list ...
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
elementStart = resultat.endStop-1;
// increment the position of insertion:
@ -303,21 +303,21 @@ void Highlight::Parse2(int32_t start,
etk::VectorType<colorInformation_ts> &metaData,
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 elementStop = stop;
colorInformation_ts resultat;
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
int32_t jjj;
for (jjj=0; jjj<m_listHighlightPass2.Size(); jjj++){
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)
ret = m_listHighlightPass2[jjj]->Find(elementStart, elementStop, resultat, buffer);
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 ...
metaData.PushBack(resultat);
elementStart = resultat.endStop-1;

View File

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

View File

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

View File

@ -22,7 +22,7 @@
*
*******************************************************************************
*/
#include <tools_debug.h>
#include <appl/Debug.h>
#include <tools_globals.h>
#include <HighlightPattern.h>
#include <ColorizeManager.h>
@ -102,24 +102,24 @@ void HighlightPattern::ReloadColor(void)
void HighlightPattern::Display(void)
{
/*
EDN_INFO("patern : \"" << m_paternName << "\" level=" << m_level );
EDN_INFO(" ==> colorName \"" << m_colorName << "\"");
EDN_INFO(" ==> regExpStart \"" << m_regExpStart->GetRegExp() << "\"");
EDN_INFO(" ==> regExpStop \"" << m_regExpStop->GetRegExp() << "\"");
APPL_INFO("patern : \"" << m_paternName << "\" level=" << m_level );
APPL_INFO(" ==> colorName \"" << m_colorName << "\"");
APPL_INFO(" ==> regExpStart \"" << m_regExpStart->GetRegExp() << "\"");
APPL_INFO(" ==> regExpStop \"" << m_regExpStop->GetRegExp() << "\"");
if (true == m_haveStopPatern) {
EDN_INFO(" ==> stop pattern: YES");
APPL_INFO(" ==> stop pattern: YES");
} else {
EDN_INFO(" ==> stop pattern: NO");
APPL_INFO(" ==> stop pattern: NO");
}
if (true == m_multiline) {
EDN_INFO(" ==> multiline pattern: YES");
APPL_INFO(" ==> multiline pattern: YES");
} else {
EDN_INFO(" ==> multiline pattern: NO");
APPL_INFO(" ==> multiline pattern: NO");
}
*/
// Display all elements
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();
}
}
@ -148,7 +148,7 @@ void HighlightPattern::ParseRules(TiXmlNode *child, int32_t level)
if (NULL != xChild) {
const char *myData = xChild->GetText();
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;
SetColor(myEdnData);
}
@ -157,7 +157,7 @@ void HighlightPattern::ParseRules(TiXmlNode *child, int32_t level)
if (NULL != xChild) {
const char *myData = xChild->GetText();
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;
SetPaternStart(myEdnData);
}
@ -166,7 +166,7 @@ void HighlightPattern::ParseRules(TiXmlNode *child, int32_t level)
if (NULL != xChild) {
const char *myData = xChild->GetText();
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;
SetPaternStop(myEdnData);
}
@ -175,7 +175,7 @@ void HighlightPattern::ParseRules(TiXmlNode *child, int32_t level)
if (NULL != xChild) {
const char *myData = xChild->GetText();
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;
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)
{
//EDN_DEBUG(" try to find the element");
//APPL_DEBUG(" try to find the element");
resultat.beginStart = -1;
resultat.beginStop = -1;
resultat.endStart = -1;
@ -226,7 +226,7 @@ resultFind_te HighlightPattern::Find(int32_t start, int32_t stop, colorInformati
resultat.endStop = m_regExpStart->Stop();
return HLP_FIND_OK;
}
//EDN_DEBUG("NOT find hightlightpatern ...");
//APPL_DEBUG("NOT find hightlightpatern ...");
} else {
// try while we find the first element
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;
}
}
//EDN_DEBUG("NOT find start hightlightpatern ...");
//APPL_DEBUG("NOT find start hightlightpatern ...");
}
return HLP_FIND_ERROR;
}

View File

@ -23,7 +23,7 @@
*******************************************************************************
*/
#include <tools_debug.h>
#include <appl/Debug.h>
#include <tools_globals.h>
#include <CTagsManager.h>
#include <BufferManager.h>
@ -98,11 +98,11 @@ bool CTagsManager::OnEventAreaExternal(int32_t widgetID, const char * generateEv
/*
switch (id)
{
case EDN_MSG__BUFFER_CHANGE_CURRENT:
case APPL_MSG__BUFFER_CHANGE_CURRENT:
m_currentSelectedID = dataID;
break;
case EDN_MSG__OPEN_CTAGS:
EDN_INFO("Request opening ctag file");
case APPL_MSG__OPEN_CTAGS:
APPL_INFO("Request opening ctag file");
{
GtkWidget *dialog = gtk_file_chooser_dialog_new( "Open Exuberant Ctags File", NULL,
GTK_FILE_CHOOSER_ACTION_OPEN,
@ -119,24 +119,24 @@ bool CTagsManager::OnEventAreaExternal(int32_t widgetID, const char * generateEv
gtk_widget_destroy(dialog);
}
break;
case EDN_MSG__RELOAD_CTAGS:
case APPL_MSG__RELOAD_CTAGS:
LoadTagFile();
break;
case EDN_MSG__JUMP_TO_CURRENT_SELECTION:
case APPL_MSG__JUMP_TO_CURRENT_SELECTION:
JumpTo();
break;
case EDN_MSG__JUMP_BACK:
case APPL_MSG__JUMP_BACK:
if (m_historyList.Size() > 0) {
BufferManager *myBufferManager = BufferManager::getInstance();
int32_t id = m_historyList.Size()-1;
if (false == myBufferManager->Exist(*m_historyList[id]) ) {
// need to open the file :
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 {
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 ....
delete(m_historyList[id]);
m_historyList[id]=NULL;
@ -163,12 +163,12 @@ void CTagsManager::LoadTagFile(void)
return;
}
// 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);
if (NULL != m_ctagFile) {
EDN_INFO("open exuberant Ctags file is OK ...");
APPL_INFO("open exuberant Ctags file is OK ...");
} 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,
gpointer data)
{
EDN_DEBUG("event");
APPL_DEBUG("event");
CTagsManager * self = static_cast<CTagsManager*>(data);
gchar * p_file=NULL;
@ -216,7 +216,7 @@ void CTagsManager::cb_row(GtkTreeView *p_treeview,
CTAGS_COL_FILE, &p_file,
CTAGS_COL_LINE_NUMBER, &lineNumber,
-1 );
EDN_DEBUG("find : " << p_file << ":" << lineNumber);
APPL_DEBUG("find : " << p_file << ":" << lineNumber);
for (int32_t iii = 0; iii < self->m_currentList.Size() ; iii++) {
if( self->m_currentList[iii].lineID == lineNumber
&& strcmp(self->m_currentList[iii].filename, p_file)==0)
@ -317,7 +317,7 @@ void CTagsManager::JumpAtID(int32_t selectID)
/*
BufferManager *myBufferManager = BufferManager::getInstance();
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();
Buffer* tmpBuf = myBufferManager->Get(currentSelected);
if (NULL != tmpBuf) {
@ -326,15 +326,15 @@ void CTagsManager::JumpAtID(int32_t selectID)
bufferFilename->SetLineNumber(tmpBuf->GetCurrentLine());
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) ) {
// need to open the file :
int32_t openID = myBufferManager->Open(myFile);
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, openID);
SendMessage(APPL_MSG__CURRENT_CHANGE_BUFFER_ID, openID);
} 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 ...
ClipBoard::Get(COPY_MIDDLE_BUTTON, data);
if (data.Size() == 0) {
EDN_INFO("No current Sélection");
APPL_INFO("No current Sélection");
}
tagEntry entry;
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) {
tagEntry entrySave = entry;
int32_t numberOfTags = 0;
@ -382,7 +382,7 @@ void CTagsManager::JumpTo(void)
int32_t SelectID = MultipleJump();
}
} 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)
{
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);
} else {
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
<< "\" at line="<<entry->address.lineNumber);
EDN_INFO("Extention field : ");
APPL_INFO("Extention field : ");
if (entry->kind != NULL && entry->kind [0] != '\0') {
EDN_INFO(" kind : " << entry->kind);
APPL_INFO(" kind : " << entry->kind);
}
if (entry->fileScope) {
EDN_INFO(" file : ");
APPL_INFO(" file : ");
}
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 <etk/File.h>
#include <ewol/ewol.h>
@ -49,7 +49,7 @@ MainWindows * basicWindows = NULL;
*/
void APP_Init(void)
{
EDN_INFO("==> Init Edn (START)");
APPL_INFO("==> Init Edn (START)");
ewol::ChangeSize(800, 600);
// set the default Path of the application :
@ -104,12 +104,12 @@ void APP_Init(void)
return ;
}
cCurrentPath[FILENAME_MAX - 1] = '\0';
//EDN_INFO("The current working directory is " << cCurrentPath);
//APPL_INFO("The current working directory is " << cCurrentPath);
basicWindows = new MainWindows();
if (NULL == basicWindows) {
EDN_ERROR("Can not allocate the basic windows");
APPL_ERROR("Can not allocate the basic windows");
ewol::Stop();
return;
}
@ -142,15 +142,15 @@ void APP_Init(void)
// add files
EDN_INFO("show list of files : ");
APPL_INFO("show list of files : ");
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);
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)
{
EDN_INFO("==> Un-Init Edn (START)");
APPL_INFO("==> Un-Init Edn (START)");
// Remove windows :
ewol::DisplayWindows(NULL);
EDN_INFO("Stop Hightlight");
APPL_INFO("Stop Hightlight");
HighlightManager::UnInit();
//Kill all singleton
EDN_INFO("Stop BufferManager");
APPL_INFO("Stop BufferManager");
BufferManager::UnInit();
EDN_INFO("Stop ColorizeManager");
APPL_INFO("Stop ColorizeManager");
ColorizeManager::UnInit();
EDN_INFO("Stop Search");
APPL_INFO("Stop Search");
//Search::Kill();
//EDN_INFO("Stop Accel key");
//APPL_INFO("Stop Accel key");
//AccelKey::Kill();
if (NULL != basicWindows) {
basicWindows->MarkToRemove();
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 <Display.h>
#include <ewol/ewol.h>
#undef __class__
#define __class__ "Display"

View File

@ -26,7 +26,7 @@
#ifndef __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 <tools_globals.h>
#include <etk/Types.h>
#include <etk/unicode.h>
#include <appl/Debug.h>
#include <tools_globals.h>
#include <EdnBuf.h>
@ -161,7 +162,7 @@ void EdnBuf::GetRange(int32_t start, int32_t end, etk::VectorType<int8_t> &outpu
output.Clear();
// import data :
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)
@ -181,7 +182,7 @@ void EdnBuf::GetRange(int32_t start, int32_t end, etk::UString &output)
convertIsoToUnicode(m_charsetType, localOutput, 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)
{
// 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
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)
{
// 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
int32_t sizeInsert=LocalInsert(pos, insertText);
@ -303,8 +304,8 @@ void EdnBuf::Remove(int32_t start, int32_t end)
start = end;
end = temp;
}
start = edn_average(0 , start, m_data.Size());
end = edn_average(0 , end, m_data.Size());
start = etk_avg(0 , start, m_data.Size());
end = etk_avg(0 , end, m_data.Size());
// Remove and redisplay
GetRange(start, end, deletedText);
@ -542,7 +543,7 @@ int32_t EdnBuf::GetExpandedChar(int32_t &pos, int32_t indent, char outUTF8[MAX_E
sprintf(outUTF8, "<? ? ? ?>");
}
if (0 == size) {
EDN_ERROR("plop");
APPL_ERROR("plop");
}
pos+=size;
return strlen(outUTF8);
@ -651,7 +652,7 @@ int32_t EdnBuf::GetExpandedChar(int32_t &pos, int32_t indent, uniChar_t outUnico
outUnicode[5] = 0;
}
if (0 == size) {
EDN_ERROR("plop");
APPL_ERROR("plop");
}
pos+=size;
int32_t outSize = 0;
@ -767,14 +768,14 @@ int32_t EdnBuf::CountDispChars(int32_t lineStartPos, int32_t targetPos)
int32_t charCount = 0;
char expandedChar[MAX_EXP_CHAR_LEN];
//EDN_DEBUG("lineStartPos="<< lineStartPos << " targetPos=" << targetPos);
//APPL_DEBUG("lineStartPos="<< lineStartPos << " targetPos=" << targetPos);
while( myPosIt
&& myPosIt.Position() < targetPos )
{
charCount += ExpandCharacter(*myPosIt, charCount, expandedChar);
myPosIt++;
}
//EDN_DEBUG(" result=" << charCount);
//APPL_DEBUG(" result=" << charCount);
return charCount;
}
@ -902,19 +903,19 @@ int32_t EdnBuf::CountForwardNLines(int32_t startPos, int32_t nLines)
}
EdnVectorBuf::Iterator myPosIt = m_data.Position(startPos);
int32_t lineCount = 0;
//EDN_INFO("startPos=" << startPos << " nLines=" << nLines);
//APPL_INFO("startPos=" << startPos << " nLines=" << nLines);
while(myPosIt)
{
if ('\n' == *myPosIt) {
lineCount++;
if (lineCount == nLines) {
//EDN_INFO(" ==> (1) at position=" << myPosIt.Position()+1 );
//APPL_INFO(" ==> (1) at position=" << myPosIt.Position()+1 );
return myPosIt.Position()+1;
}
}
myPosIt++;
}
//EDN_INFO(" ==> (2) at position=" << myPosIt.Position() );
//APPL_INFO(" ==> (2) at position=" << 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() ) {
startPos = m_data.Size();
}
//EDN_INFO("startPos=" << startPos << " nLines=" << nLines);
//APPL_INFO("startPos=" << startPos << " nLines=" << nLines);
EdnVectorBuf::Iterator myPosIt = m_data.Position(startPos-1);
int32_t lineCount = -1;
@ -944,13 +945,13 @@ int32_t EdnBuf::CountBackwardNLines(int32_t startPos, int32_t nLines)
if ('\n' == *myPosIt) {
lineCount++;
if (lineCount >= nLines) {
//EDN_INFO(" ==> (1) at position=" << myPosIt.Position()+1 );
//APPL_INFO(" ==> (1) at position=" << myPosIt.Position()+1 );
return myPosIt.Position()+1;
}
}
myPosIt--;
}
//EDN_INFO(" ==> (2) at position=0");
//APPL_INFO(" ==> (2) at position=0");
return 0;
}
@ -966,10 +967,10 @@ bool EdnBuf::charMatch(char first, char second, bool caseSensitive)
}
}
if(first == second) {
//EDN_DEBUG("charMatch(" << first << ", " << second << ", " << caseSensitive << ") ==> true");
//APPL_DEBUG("charMatch(" << first << ", " << second << ", " << caseSensitive << ") ==> true");
return true;
} else {
//EDN_DEBUG("charMatch(" << first << ", " << second << ", " << caseSensitive << ") ==> false");
//APPL_DEBUG("charMatch(" << first << ", " << second << ", " << caseSensitive << ") ==> 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 dataLen = m_data.Size();
char currentChar = '\0';
//EDN_INFO(" startPos=" << startPos << " searchLen=" << searchLen);
//APPL_INFO(" startPos=" << startPos << " searchLen=" << searchLen);
for (position=startPos; position<dataLen - (searchLen-1); position++) {
currentChar = m_data[position];
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 searchLen = searchVect.Size();
char currentChar = '\0';
//EDN_INFO(" startPos=" << startPos << " searchLen=" << searchLen);
//APPL_INFO(" startPos=" << startPos << " searchLen=" << searchLen);
for (position=startPos; position>=searchLen-1; position--) {
currentChar = m_data[position];
if (true == charMatch(currentChar, searchVect[searchLen-1], caseSensitive)) {
@ -1062,10 +1063,10 @@ static bool isChar(char value)
|| '_' == value
|| '~' == value)
{
//EDN_DEBUG(" is a char \"" << value << "\"");
//APPL_DEBUG(" is a char \"" << value << "\"");
return true;
}
//EDN_DEBUG(" is NOT a char \"" << value << "\"");
//APPL_DEBUG(" is NOT a char \"" << value << "\"");
return false;
}
@ -1076,7 +1077,7 @@ bool EdnBuf::SelectAround(int32_t startPos, int32_t &beginPos, int32_t &endPos)
if( '\t' == currentChar
|| ' ' == currentChar)
{
EDN_DEBUG("select spacer");
APPL_DEBUG("select spacer");
// special case we are looking for separation
for (beginPos=startPos; beginPos>=0; beginPos--) {
currentChar = m_data[beginPos];
@ -1098,7 +1099,7 @@ bool EdnBuf::SelectAround(int32_t startPos, int32_t &beginPos, int32_t &endPos)
}
return true;
} else if( true == isChar(currentChar)){
EDN_DEBUG("select normal Char");
APPL_DEBUG("select normal Char");
// Search back
for (beginPos=startPos; beginPos>=0; beginPos--) {
currentChar = m_data[beginPos];
@ -1117,7 +1118,7 @@ bool EdnBuf::SelectAround(int32_t startPos, int32_t &beginPos, int32_t &endPos)
return true;
} else {
char comparechar = currentChar;
EDN_DEBUG("select same char");
APPL_DEBUG("select same char");
// Search back
for (beginPos=startPos; beginPos>=0; beginPos--) {
currentChar = m_data[beginPos];
@ -1198,13 +1199,13 @@ void EdnBuf::eventModification(int32_t pos, int32_t nInserted, etk::VectorType<i
&& 0 == nInserted)
{
// we do nothing ...
//EDN_INFO("EdnBuf::eventModification(pos="<<pos<<", ... , nRestyled=" << nRestyled << ", deletedText=\"" << textDisplay << "\");");
//APPL_INFO("EdnBuf::eventModification(pos="<<pos<<", ... , nRestyled=" << nRestyled << ", deletedText=\"" << textDisplay << "\");");
} 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 :
//CountNumberOfLines(); //==> not efficent methode ...
// ==> 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);
// Update histories
if (false == m_isUndoProcessing) {

View File

@ -24,7 +24,7 @@
*/
#include <tools_debug.h>
#include <appl/Debug.h>
#include <tools_globals.h>
#include <EdnBufHistory.h>
@ -34,14 +34,14 @@
EdnBufHistory::EdnBufHistory(void)
{
//EDN_INFO("EdnBufHistory new");
//APPL_INFO("EdnBufHistory new");
m_pos = 0;
m_nInserted = 0;
}
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_nInserted = nInserted;
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)
{
//EDN_INFO("EdnBufHistory new + data");
//APPL_INFO("EdnBufHistory new + data");
m_pos = pos;
m_nInserted = nInserted;
m_deletedText = deletedText;

View File

@ -23,7 +23,7 @@
*******************************************************************************
*/
#include <tools_debug.h>
#include <appl/Debug.h>
#include <tools_globals.h>
#include <EdnBuf.h>
@ -57,7 +57,7 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
return;
}
// normal case
//EDN_INFO("(pos="<<pos<<", nbDeleted="<<nbDeleted<<", nbAdded=" << nbAdded << "\");");
//APPL_INFO("(pos="<<pos<<", nbDeleted="<<nbDeleted<<", nbAdded=" << nbAdded << "\");");
int32_t 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 ) {
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;
@ -85,31 +85,31 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
} else if(-1 == startId) {
if (0 == stopId){
m_HLDataPass1.Erase(0);
//EDN_DEBUG("1 * Erase 0");
//APPL_DEBUG("1 * Erase 0");
} else {
m_HLDataPass1.EraseLen(0,stopId);
//EDN_DEBUG("2 * Erase 0->" << stopId);
//APPL_DEBUG("2 * Erase 0->" << 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);
stopId = -1;
} else {
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);
if (stopId == currentSize-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++) {
etk::UString ploppp;
if (NULL != m_HLDataPass1[i].patern ) {
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 :
@ -120,7 +120,7 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
elemStart = startId+1;
}
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].beginStop += 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
&& -1 == stopId)
{
//EDN_DEBUG("******* Regenerate ALL");
//APPL_DEBUG("******* Regenerate ALL");
GenerateHighLightAt(0, m_data.Size());
} else if(-1 == startId) {
//EDN_DEBUG("******* Regenerate START");
//APPL_DEBUG("******* Regenerate START");
GenerateHighLightAt(0, m_HLDataPass1[0].beginStart, 0);
} 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());
} else {
//EDN_DEBUG("******* Regenerate RANGE");
//APPL_DEBUG("******* Regenerate RANGE");
GenerateHighLightAt(m_HLDataPass1[startId].endStop, m_HLDataPass1[startId+1].beginStart, startId+1);
}
} else {
@ -152,12 +152,12 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
if (NULL != m_HLDataPass1[i].patern ) {
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;
//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)
@ -232,14 +232,14 @@ void EdnBuf::FindMainHighLightPosition(int32_t startPos, int32_t endPos, int32_t
}
/*
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 {
EDN_DEBUG("==> BEGIN : start=???, stop=??? id=" << startId);
APPL_DEBUG("==> BEGIN : start=???, stop=??? id=" << startId);
}
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 {
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) {
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);
}
@ -268,7 +268,7 @@ void EdnBuf::CleanHighLight(void)
colorInformation_ts *EdnBuf::GetElementColorAtPosition(int32_t pos, int32_t &starPos)
{
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++) {
starPos = i;
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);
int32_t k;
//EDN_DEBUG("List of section between : "<< startId << " & " << stopId);
//APPL_DEBUG("List of section between : "<< startId << " & " << stopId);
int32_t endSearch = stopId+1;
if (-1 == stopId) {
endSearch = m_HLDataPass1.Size();
}
for (k=edn_max(startId, 0); k<endSearch; k++) {
for (k=etk_max(startId, 0); k<endSearch; k++) {
// empty section :
if (0==k) {
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_HLDataPass1[k].beginStart,
MData.HLData,
m_data);
} // else : nothing to do ...
} 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_HLDataPass1[k].beginStart,
MData.HLData,
m_data);
}
// 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 : ...
}
if (endSearch == (int32_t)m_HLDataPass1.Size() ){
//if( k < (int32_t)m_HLDataPass1.Size()) {
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,
HLStop,
MData.HLData,
m_data);
} 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,
HLStop,
MData.HLData,
@ -346,7 +346,7 @@ void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart,
//GTimeVal 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)
{
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++) {
MData.posHLPass2 = i;
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 <EdnBuf.h>
@ -37,16 +37,16 @@
int32_t EdnBuf::Undo(void)
{
int32_t nbElement = m_historyUndo.Size();
//EDN_DEBUG("EdnBuf::Undo Request id="<<nbElement);
//APPL_DEBUG("EdnBuf::Undo Request id="<<nbElement);
int32_t posDest = -1;
if (0 == nbElement) {
// nothing to do ...
EDN_ERROR("EdnBuf::Undo No more History");
APPL_ERROR("EdnBuf::Undo No more History");
return -1;
}
nbElement--;
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();
return -1;
}
@ -59,7 +59,7 @@ int32_t EdnBuf::Undo(void)
if (0 == nbInserted) {
// just add data at position ...
if (0 == nbDeleted) {
EDN_ERROR("EdnBuf::Undo nothing to do in UNDO");
APPL_ERROR("EdnBuf::Undo nothing to do in UNDO");
} else {
Insert(pos, deletedText);
posDest = pos + nbDeleted;
@ -85,16 +85,16 @@ int32_t EdnBuf::Undo(void)
int32_t EdnBuf::Redo(void)
{
int32_t nbElement = m_historyRedo.Size();
//EDN_DEBUG("EdnBuf::Redo Request id="<<nbElement);
//APPL_DEBUG("EdnBuf::Redo Request id="<<nbElement);
int32_t posDest = -1;
if (0 == nbElement) {
// nothing to do ...
EDN_ERROR("EdnBuf::Redo No more History");
APPL_ERROR("EdnBuf::Redo No more History");
return -1;
}
nbElement--;
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();
return -1;
}
@ -107,7 +107,7 @@ int32_t EdnBuf::Redo(void)
if (0 == nbInserted) {
// just add data at position ...
if (0 == nbDeleted) {
EDN_ERROR("EdnBuf::Redo nothing to do in REDO");
APPL_ERROR("EdnBuf::Redo nothing to do in REDO");
} else {
Insert(pos, deletedText);
posDest = pos + nbDeleted;

View File

@ -23,7 +23,7 @@
*******************************************************************************
*/
#include <tools_debug.h>
#include <appl/Debug.h>
#include <tools_globals.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].zeroWidth = (start == end) ? true : false;
m_selectionList[select].rectangular = false;
m_selectionList[select].start = edn_min(start, end);
m_selectionList[select].end = edn_max(start, end);
m_selectionList[select].start = etk_min(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 <toolsMemory.h>
#include <EdnVectorBuf.h>
@ -66,8 +66,8 @@ EdnVectorBuf::EdnVectorBuf(const EdnVectorBuf & Evb)
m_gapEnd = Evb.m_gapEnd;
// allocate all same data
EDN_MALLOC(m_data, m_allocated, int8_t);
EDN_ASSERT(NULL!=m_data, "Error in data allocation");
APPL_MALLOC(m_data, m_allocated, int8_t);
APPL_ASSERT(NULL!=m_data, "Error in data allocation");
// Copy all data ...
memcpy(m_data, Evb.m_data, m_allocated * sizeof(int8_t) );
}
@ -84,7 +84,7 @@ EdnVectorBuf::EdnVectorBuf(const EdnVectorBuf & Evb)
EdnVectorBuf::~EdnVectorBuf()
{
if (NULL!=m_data) {
EDN_FREE(m_data);
APPL_FREE(m_data);
m_data = NULL;
m_allocated = 0;
m_gapStart = 0;
@ -146,10 +146,10 @@ bool EdnVectorBuf::DumpFrom(FILE *myFile)
// insert Data
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
if (nbReadData != length) {
EDN_ERROR("load data pb : filesize=" << length << ", readData=" << nbReadData);
APPL_ERROR("load data pb : filesize=" << length << ", readData=" << nbReadData);
ret = false;
}
// set the gapsize at the end ...
@ -173,7 +173,7 @@ EdnVectorBuf& EdnVectorBuf::operator=(const EdnVectorBuf & Evb)
if( this != &Evb ) // avoid copy to itself
{
if (NULL!=m_data) {
EDN_FREE(m_data);
APPL_FREE(m_data);
m_data = NULL;
}
// Set the new value
@ -181,8 +181,8 @@ EdnVectorBuf& EdnVectorBuf::operator=(const EdnVectorBuf & Evb)
m_gapStart = Evb.m_gapStart;
m_gapEnd = Evb.m_gapEnd;
// allocate all same data
EDN_MALLOC(m_data, m_allocated, int8_t);
EDN_ASSERT(NULL!=m_data, "Error in data allocation");
APPL_MALLOC(m_data, m_allocated, int8_t);
APPL_ASSERT(NULL!=m_data, "Error in data allocation");
// Copy all data ...
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)
{
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) {
return m_data[pos];
}
@ -210,7 +210,7 @@ int8_t EdnVectorBuf::operator[] (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) {
return m_data[pos];
}
@ -283,11 +283,11 @@ void EdnVectorBuf::Remove(int32_t pos, int32_t nbRemoveElement)
{
if( pos > Size()
|| 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;
}
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;
}
if (false == GapMove(pos) ) {
@ -336,17 +336,17 @@ void EdnVectorBuf::ChangeAllocation(int32_t newSize)
if (newSize == m_allocated) {
return;
}
EDN_DEBUG("Change Allocation : " << m_allocated << " ==> " << newSize);
APPL_DEBUG("Change Allocation : " << m_allocated << " ==> " << newSize);
// check if something is allocated :
if (NULL == m_data) {
// 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 {
// move datas
EDN_REALLOC(m_data, newSize, int8_t);
APPL_REALLOC(m_data, newSize, int8_t);
}
// 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
m_allocated = newSize;
}
@ -364,7 +364,7 @@ void EdnVectorBuf::Insert(int32_t pos, const int8_t& item)
{
if( pos > Size()
|| 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;
}
if( 0 == GapSize() ) {
@ -402,7 +402,7 @@ void EdnVectorBuf::Insert(int32_t pos, etk::VectorType<int8_t>& items)
{
if( pos > Size()
|| 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;
}
if( items.Size() > GapSize() ) {
@ -434,7 +434,7 @@ void EdnVectorBuf::Replace(int32_t pos, const int8_t& item)
{
if( pos > Size()
|| 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;
}
// 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()
|| 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;
}
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;
}
if (false == GapMove(pos)) {
@ -490,7 +490,7 @@ bool EdnVectorBuf::GapMove(int32_t pos)
{
if( pos > Size()
|| 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;
}
int32_t gapLen = m_gapEnd - m_gapStart;
@ -517,7 +517,7 @@ bool EdnVectorBuf::GapResize(int32_t pos, int32_t newGapLen)
{
if( pos > Size()
|| 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;
}
int32_t previousSize = Size();
@ -590,12 +590,12 @@ void EdnVectorBuf::GapCheckMaxSize(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++) {
if (i>= m_gapStart && i< m_gapEnd) {
EDN_INFO( "Element " << i << " : GAP");
APPL_INFO( "Element " << i << " : GAP");
} 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
{
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);
}
/**
@ -235,7 +235,7 @@ class EdnVectorBuf
*/
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);
}
private:

View File

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

View File

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

View File

@ -28,61 +28,61 @@
// General
#ifdef EDN_MEMORY_CHECKER
void EDN_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 EDN_MemShowLogs( void );
# define EDN_MALLOC(pointerData, nbElements, dataType) do { \
pointerData = (dataType *)EDN_MemMalloc( (nbElements), sizeof(dataType), 0, #pointerData, __func__, __LINE__, __FILE__); \
#ifdef APPL_MEMORY_CHECKER
void APPL_MemFree( void * pointerData, 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 APPL_MemShowLogs( void );
# define APPL_MALLOC(pointerData, nbElements, dataType) do { \
pointerData = (dataType *)APPL_MemMalloc( (nbElements), sizeof(dataType), 0, #pointerData, __func__, __LINE__, __FILE__); \
}while(0)
# define EDN_MALLOC_CAST(pointerData, nbElements, dataType, cast) do { \
pointerData = (cast)EDN_MemMalloc( (nbElements), sizeof(dataType), 0, #pointerData, __func__, __LINE__, __FILE__); \
# define APPL_MALLOC_CAST(pointerData, nbElements, dataType, cast) do { \
pointerData = (cast)APPL_MemMalloc( (nbElements), sizeof(dataType), 0, #pointerData, __func__, __LINE__, __FILE__); \
}while(0)
# define EDN_CALLOC(pointerData, nbElements, dataType) do { \
pointerData = (dataType *)EDN_MemMalloc( (nbElements), sizeof(dataType), 1, #pointerData, __func__, __LINE__, __FILE__); \
# define APPL_CALLOC(pointerData, nbElements, dataType) do { \
pointerData = (dataType *)APPL_MemMalloc( (nbElements), sizeof(dataType), 1, #pointerData, __func__, __LINE__, __FILE__); \
}while(0)
# define EDN_CALLOC_CAST(pointerData, nbElements, dataType, cast) do { \
pointerData = (cast)EDN_MemMalloc( (nbElements), sizeof(dataType), 1, #pointerData, __func__, __LINE__, __FILE__); \
# define APPL_CALLOC_CAST(pointerData, nbElements, dataType, cast) do { \
pointerData = (cast)APPL_MemMalloc( (nbElements), sizeof(dataType), 1, #pointerData, __func__, __LINE__, __FILE__); \
}while(0)
# define EDN_FREE(pointerData) do { \
EDN_MemFree( (pointerData) , #pointerData, __func__, __LINE__, __FILE__); \
# define APPL_FREE(pointerData) do { \
APPL_MemFree( (pointerData) , #pointerData, __func__, __LINE__, __FILE__); \
(pointerData) = NULL; \
}while(0)
# define EDN_MEM_SHOW_LOG() do { \
EDN_MemShowLogs(); \
# define APPL_MEM_SHOW_LOG() do { \
APPL_MemShowLogs(); \
}while(0)
#else
# define EDN_MALLOC(pointerData, nbElements, dataType) do { \
# define APPL_MALLOC(pointerData, nbElements, dataType) do { \
(pointerData) = (dataType *)malloc( (nbElements) * sizeof(dataType) ); \
}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) ); \
}while(0)
# define EDN_CALLOC(pointerData, nbElements, dataType) do { \
# define APPL_CALLOC(pointerData, nbElements, dataType) do { \
(pointerData) = (dataType *)calloc( (nbElements), sizeof(dataType) ); \
}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) ); \
}while(0)
# define EDN_REALLOC(pointerData, nbElements, dataType) do { \
# define APPL_REALLOC(pointerData, nbElements, dataType) do { \
(pointerData) = (dataType *)realloc( (pointerData), (nbElements)* sizeof(dataType) ); \
}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) ); \
}while(0)
# define EDN_FREE(pointerData) do { \
# define APPL_FREE(pointerData) do { \
free( pointerData ); \
(pointerData) = NULL; \
}while(0)
# define EDN_MEM_SHOW_LOG() do { \
# define APPL_MEM_SHOW_LOG() do { \
sup_system_diag("No Memory check availlable"); \
}while(0)
#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) :
FILE_LIST+= edn/ctags/readtags.cpp \
edn/ctags/CTagsManager.cpp
FILE_LIST+= appl/ctags/readtags.cpp \
appl/ctags/CTagsManager.cpp
# Globals debug tool:
FILE_LIST+= edn/tools/debug/tools_debug.cpp \
edn/tools/globals/tools_globals.cpp \
edn/tools/memory/toolsMemory.cpp
FILE_LIST+= appl/Debug.cpp \
appl/tools/globals/tools_globals.cpp \
appl/tools/memory/toolsMemory.cpp
# Buffers internal:
FILE_LIST+= edn/tools/EdnTemplate/EdnVectorBuf.cpp \
edn/tools/EdnBuf/EdnBuf.cpp \
edn/tools/EdnBuf/EdnBuf_HighLight.cpp \
edn/tools/EdnBuf/EdnBuf_History.cpp \
edn/tools/EdnBuf/EdnBuf_Selection.cpp \
edn/tools/EdnBuf/EdnBufHistory.cpp
FILE_LIST+= appl/tools/EdnTemplate/EdnVectorBuf.cpp \
appl/tools/EdnBuf/EdnBuf.cpp \
appl/tools/EdnBuf/EdnBuf_HighLight.cpp \
appl/tools/EdnBuf/EdnBuf_History.cpp \
appl/tools/EdnBuf/EdnBuf_Selection.cpp \
appl/tools/EdnBuf/EdnBufHistory.cpp
# Tools internal:
FILE_LIST+= edn/tools/Display/Display.cpp \
edn/tools/MsgBroadcast/MsgBroadcast.cpp
FILE_LIST+= appl/tools/Display/Display.cpp \
appl/tools/MsgBroadcast/MsgBroadcast.cpp
# Gui:
FILE_LIST+= edn/Gui/BufferView.cpp \
edn/Gui/CodeView.cpp \
edn/Gui/MainWindows.cpp \
edn/Gui/Search.cpp \
edn/Gui/SearchData.cpp
FILE_LIST+= appl/Gui/BufferView.cpp \
appl/Gui/CodeView.cpp \
appl/Gui/MainWindows.cpp \
appl/Gui/Search.cpp \
appl/Gui/SearchData.cpp
# Basic Interface :
FILE_LIST+= edn/Buffer/Buffer.cpp \
edn/Buffer/BufferText.cpp \
edn/Buffer/BufferEmpty.cpp \
edn/Buffer/BufferManager.cpp \
edn/Colorize/Colorize.cpp \
edn/Colorize/ColorizeManager.cpp \
edn/Highlight/HighlightPattern.cpp \
edn/Highlight/Highlight.cpp \
edn/Highlight/HighlightManager.cpp
FILE_LIST+= appl/Buffer/Buffer.cpp \
appl/Buffer/BufferText.cpp \
appl/Buffer/BufferEmpty.cpp \
appl/Buffer/BufferManager.cpp \
appl/Colorize/Colorize.cpp \
appl/Colorize/ColorizeManager.cpp \
appl/Highlight/HighlightPattern.cpp \
appl/Highlight/Highlight.cpp \
appl/Highlight/HighlightManager.cpp
# Main entry file :
FILE_LIST+= edn/init.cpp
FILE_LIST+= appl/init.cpp