Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
610afddc9d | |||
4038dd74af | |||
8ba3e2e3d4 | |||
7734a8ce36 | |||
d088866891 | |||
0341795cbb |
@@ -94,7 +94,8 @@ void Buffer::SetModify(bool status)
|
|||||||
{
|
{
|
||||||
if (status != m_fileModify) {
|
if (status != m_fileModify) {
|
||||||
m_fileModify = status;
|
m_fileModify = status;
|
||||||
ewol::widgetMessageMultiCast::Send(-1, ednMsgBufferModify);
|
// TODO : Remove from here
|
||||||
|
ewol::widgetMessageMultiCast::Send(-1, ednMsgBufferState, "Modify");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,7 +148,11 @@ void Buffer::SetLineDisplay(uint32_t lineNumber)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int32_t Buffer::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY)
|
int32_t Buffer::Display(ewol::OObject2DTextColored* OOTextNormal,
|
||||||
|
ewol::OObject2DTextColored* OOTextBold,
|
||||||
|
ewol::OObject2DTextColored* OOTextItalic,
|
||||||
|
ewol::OObject2DTextColored* OOTextBoldItalic, ewol::OObject2DColored* OOColored,
|
||||||
|
int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
|
||||||
{
|
{
|
||||||
return ERR_NONE;
|
return ERR_NONE;
|
||||||
}
|
}
|
||||||
|
@@ -82,7 +82,11 @@ class Buffer {
|
|||||||
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate);
|
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate);
|
||||||
virtual void SetLineDisplay(uint32_t lineNumber);
|
virtual void SetLineDisplay(uint32_t lineNumber);
|
||||||
|
|
||||||
virtual int32_t Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY);
|
virtual int32_t Display(ewol::OObject2DTextColored* OOTextNormal,
|
||||||
|
ewol::OObject2DTextColored* OOTextBold,
|
||||||
|
ewol::OObject2DTextColored* OOTextItalic,
|
||||||
|
ewol::OObject2DTextColored* OOTextBoldItalic,
|
||||||
|
ewol::OObject2DColored* OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY);
|
||||||
virtual void ForceReDraw(bool allElement);
|
virtual void ForceReDraw(bool allElement);
|
||||||
virtual void AddChar(char * UTF8data);
|
virtual void AddChar(char * UTF8data);
|
||||||
virtual void cursorMove(ewol::eventKbMoveType_te moveTypeEvent);
|
virtual void cursorMove(ewol::eventKbMoveType_te moveTypeEvent);
|
||||||
@@ -109,6 +113,8 @@ class Buffer {
|
|||||||
virtual void JumpAtLine(int32_t newLine);
|
virtual void JumpAtLine(int32_t newLine);
|
||||||
virtual int32_t GetCurrentLine(void);
|
virtual int32_t GetCurrentLine(void);
|
||||||
|
|
||||||
|
virtual int32_t GetNumberOfLine(void) { return 1; };
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool m_fileModify; //!<
|
bool m_fileModify; //!<
|
||||||
// naming
|
// naming
|
||||||
|
@@ -67,7 +67,11 @@ BufferEmpty::~BufferEmpty(void)
|
|||||||
* @return ---
|
* @return ---
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int32_t BufferEmpty::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY)
|
int32_t BufferEmpty::Display(ewol::OObject2DTextColored* OOTextNormal,
|
||||||
|
ewol::OObject2DTextColored* OOTextBold,
|
||||||
|
ewol::OObject2DTextColored* OOTextItalic,
|
||||||
|
ewol::OObject2DTextColored* OOTextBoldItalic,
|
||||||
|
ewol::OObject2DColored* OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
|
||||||
{
|
{
|
||||||
ColorizeManager * myColorManager = ColorizeManager::getInstance();
|
ColorizeManager * myColorManager = ColorizeManager::getInstance();
|
||||||
// Get color :
|
// Get color :
|
||||||
@@ -75,7 +79,7 @@ int32_t BufferEmpty::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2D
|
|||||||
//drawer.Flush();
|
//drawer.Flush();
|
||||||
|
|
||||||
|
|
||||||
if (NULL == OOText) {
|
if (NULL == OOTextNormal) {
|
||||||
EDN_ERROR("Input VALUE is NULL");
|
EDN_ERROR("Input VALUE is NULL");
|
||||||
return ERR_FAIL;
|
return ERR_FAIL;
|
||||||
}
|
}
|
||||||
@@ -83,14 +87,16 @@ int32_t BufferEmpty::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2D
|
|||||||
EDN_ERROR("Input VALUE is NULL");
|
EDN_ERROR("Input VALUE is NULL");
|
||||||
return ERR_FAIL;
|
return ERR_FAIL;
|
||||||
}
|
}
|
||||||
|
int32_t fontId = OOTextNormal->GetFontID();
|
||||||
|
int32_t letterHeight = ewol::GetHeight(fontId);
|
||||||
|
|
||||||
myColor = myColorManager->Get("normal");
|
myColor = myColorManager->Get("normal");
|
||||||
OOText->SetColor(myColor->GetFG());
|
OOTextNormal->SetColor(myColor->GetFG());
|
||||||
OOText->TextAdd(20, 20, "edn - Editeur De N'ours, l'Editeur Desoxyribo-Nucleique", sizeX);
|
OOTextNormal->TextAdd(20, 20, "edn - Editeur De N'ours, l'Editeur Desoxyribo-Nucleique", sizeX);
|
||||||
|
|
||||||
myColor = myColorManager->Get("commentDoxygen");
|
myColor = myColorManager->Get("commentDoxygen");
|
||||||
OOText->SetColor(myColor->GetFG());
|
OOTextNormal->SetColor(myColor->GetFG());
|
||||||
OOText->TextAdd(20, 50, "No Buffer Availlable to display", sizeX);
|
OOTextNormal->TextAdd(20, (int32_t)(20 + letterHeight*1.30), "No Buffer Availlable to display", sizeX);
|
||||||
|
|
||||||
|
|
||||||
color_ts bgColor; //!< Text color
|
color_ts bgColor; //!< Text color
|
||||||
|
@@ -32,7 +32,11 @@ class BufferEmpty : public Buffer {
|
|||||||
public:
|
public:
|
||||||
BufferEmpty(void);
|
BufferEmpty(void);
|
||||||
virtual ~BufferEmpty(void);
|
virtual ~BufferEmpty(void);
|
||||||
int32_t Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY);
|
int32_t Display(ewol::OObject2DTextColored* OOTextNormal,
|
||||||
|
ewol::OObject2DTextColored* OOTextBold,
|
||||||
|
ewol::OObject2DTextColored* OOTextItalic,
|
||||||
|
ewol::OObject2DTextColored* OOTextBoldItalic,
|
||||||
|
ewol::OObject2DColored* OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -46,11 +46,18 @@ BufferManager::BufferManager(void)
|
|||||||
// nothing to do ...
|
// nothing to do ...
|
||||||
BufferNotExiste = new BufferEmpty();
|
BufferNotExiste = new BufferEmpty();
|
||||||
m_idSelected = -1;
|
m_idSelected = -1;
|
||||||
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiNew);
|
||||||
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgOpenFile);
|
||||||
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiClose);
|
||||||
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiSave);
|
||||||
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewSelectedId);
|
||||||
|
/*
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerNewFile);
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerNewFile);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerSaveAll);
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerSaveAll);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerCloseAll);
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerCloseAll);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerClose);
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerClose);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerSave);
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerSave);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -74,22 +81,85 @@ BufferManager::~BufferManager(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool BufferManager::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
bool BufferManager::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y)
|
||||||
{
|
{
|
||||||
|
if (generateEventId == ednMsgGuiNew) {
|
||||||
|
int32_t newOne = Create();
|
||||||
|
if (-1 != newOne) {
|
||||||
|
m_idSelected = newOne;
|
||||||
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_idSelected);
|
||||||
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferListChange);
|
||||||
|
}
|
||||||
|
} else if (generateEventId == ednMsgOpenFile) {
|
||||||
|
if (NULL != data) {
|
||||||
|
etk::File myFile(data, etk::FILE_TYPE_DIRECT);
|
||||||
|
int32_t newOne = Open(myFile);
|
||||||
|
if (-1 != newOne) {
|
||||||
|
m_idSelected = newOne;
|
||||||
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_idSelected);
|
||||||
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferListChange);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (generateEventId == ednMsgGuiSave) {
|
||||||
|
if (NULL == data) {
|
||||||
|
EDN_ERROR("Null data for close file ... ");
|
||||||
|
} else {
|
||||||
|
if (0 == strcmp(data , "current")) {
|
||||||
|
// Check buffer existence
|
||||||
|
if(true == Exist(m_idSelected)) {
|
||||||
|
// If no name ==> request a Gui display ...
|
||||||
|
if (Get(m_idSelected)->HaveName() == false) {
|
||||||
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgGuiSaveAs, "current");
|
||||||
|
} else {
|
||||||
|
Get(m_idSelected)->Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
int32_t newId;
|
||||||
|
sscanf(data, "%d", &newId);
|
||||||
|
if (false == Exist(newId)) {
|
||||||
|
EDN_ERROR("Request a save As with a non existant ID=" << newId);
|
||||||
|
} else {
|
||||||
|
// If no name ==> request a Gui display ...
|
||||||
|
if (Get(newId)->HaveName() == false) {
|
||||||
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgGuiSaveAs, newId);
|
||||||
|
} else {
|
||||||
|
Get(m_idSelected)->Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferState, "saved");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (generateEventId == ednMsgGuiClose) {
|
||||||
|
if (NULL == data) {
|
||||||
|
EDN_ERROR("Null data for close file ... ");
|
||||||
|
} else {
|
||||||
|
if (0 == strcmp(data , "current")) {
|
||||||
|
|
||||||
|
} else if (0 == strcmp(data , "All")) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (generateEventId == ednMsgCodeViewSelectedId) {
|
||||||
|
//Change the selected buffer
|
||||||
|
if (NULL == data) {
|
||||||
|
EDN_ERROR("Null data for changing buffer ID file ... ");
|
||||||
|
} else {
|
||||||
|
int32_t newId;
|
||||||
|
sscanf(data, "%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");
|
||||||
|
m_idSelected = -1;
|
||||||
|
}
|
||||||
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_idSelected);
|
||||||
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferListChange);
|
||||||
|
}
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case EDN_MSG__BUFFER_CHANGE_CURRENT:
|
|
||||||
m_idSelected = dataID;
|
|
||||||
break;
|
|
||||||
case EDN_MSG__NEW:
|
|
||||||
{
|
|
||||||
int32_t newOne = Create();
|
|
||||||
if (-1 != newOne) {
|
|
||||||
SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, newOne);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case EDN_MSG__BUFF_ID_CLOSE:
|
case EDN_MSG__BUFF_ID_CLOSE:
|
||||||
// Check buffer existence
|
// Check buffer existence
|
||||||
if(true == Exist(dataID)) {
|
if(true == Exist(dataID)) {
|
||||||
@@ -158,8 +228,7 @@ void BufferManager::RemoveAll(void)
|
|||||||
for (i=0; i<listBuffer.Size(); i++) {
|
for (i=0; i<listBuffer.Size(); i++) {
|
||||||
Remove(i);
|
Remove(i);
|
||||||
}
|
}
|
||||||
//SendMessage(EDN_MSG__BUFFER_REMOVE_ALL);
|
ewol::widgetMessageMultiCast::Send(-1, ednMsgGuiClose, "All");
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferRemoveAll);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -179,8 +248,6 @@ int32_t BufferManager::Create(void)
|
|||||||
// Add at the list of element
|
// Add at the list of element
|
||||||
listBuffer.PushBack(myBuffer);
|
listBuffer.PushBack(myBuffer);
|
||||||
int32_t basicID = listBuffer.Size() - 1;
|
int32_t basicID = listBuffer.Size() - 1;
|
||||||
//SendMessage(EDN_MSG__BUFFER_ADD, basicID);
|
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferAdd);
|
|
||||||
return basicID;
|
return basicID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,10 +269,7 @@ int32_t BufferManager::Open(etk::File &myFile)
|
|||||||
Buffer *myBuffer = new BufferText(myFile);
|
Buffer *myBuffer = new BufferText(myFile);
|
||||||
// Add at the list of element
|
// Add at the list of element
|
||||||
listBuffer.PushBack(myBuffer);
|
listBuffer.PushBack(myBuffer);
|
||||||
int32_t basicID = listBuffer.Size() - 1;
|
return listBuffer.Size() - 1;
|
||||||
//SendMessage(EDN_MSG__BUFFER_ADD, basicID);
|
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferAdd);
|
|
||||||
return basicID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -305,8 +369,7 @@ bool BufferManager::Remove(int32_t BufferID)
|
|||||||
// Delete the Buffer
|
// Delete the Buffer
|
||||||
delete( listBuffer[BufferID] );
|
delete( listBuffer[BufferID] );
|
||||||
listBuffer[BufferID] = NULL;
|
listBuffer[BufferID] = NULL;
|
||||||
//SendMessage(EDN_MSG__BUFFER_REMOVE, BufferID);
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferListChange);
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferRemove);
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
EDN_INFO("non existing Buffer " << BufferID);
|
EDN_INFO("non existing Buffer " << BufferID);
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
*
|
*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __BUFFER_MANAGER_H__
|
#ifndef __BUFFER_MANAGER_H__
|
||||||
#define __BUFFER_MANAGER_H__
|
#define __BUFFER_MANAGER_H__
|
||||||
|
|
||||||
@@ -44,14 +44,16 @@ class BufferManager: public etk::Singleton<BufferManager>, public ewol::Widget
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
||||||
|
private:
|
||||||
// return the ID of the buffer allocated
|
// return the ID of the buffer allocated
|
||||||
// create a buffer with no element
|
// create a buffer with no element
|
||||||
int32_t Create(void);
|
int32_t Create(void);
|
||||||
// open curent filename
|
// open curent filename
|
||||||
int32_t Open(etk::File &myFile);
|
int32_t Open(etk::File &myFile);
|
||||||
|
bool Remove(int32_t BufferID);
|
||||||
|
public:
|
||||||
int32_t GetSelected(void) { return m_idSelected;};
|
int32_t GetSelected(void) { return m_idSelected;};
|
||||||
void SetSelected(int32_t id) {m_idSelected = id;};
|
//void SetSelected(int32_t id) {m_idSelected = id;};
|
||||||
Buffer * Get(int32_t BufferID);
|
Buffer * Get(int32_t BufferID);
|
||||||
bool Exist(int32_t BufferID);
|
bool Exist(int32_t BufferID);
|
||||||
bool Exist(etk::File &myFile);
|
bool Exist(etk::File &myFile);
|
||||||
@@ -60,7 +62,6 @@ class BufferManager: public etk::Singleton<BufferManager>, public ewol::Widget
|
|||||||
uint32_t Size(void);
|
uint32_t Size(void);
|
||||||
int32_t WitchBuffer(int32_t iEmeElement);
|
int32_t WitchBuffer(int32_t iEmeElement);
|
||||||
|
|
||||||
bool Remove(int32_t BufferID);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@@ -79,7 +79,6 @@ void BufferText::BasicInit(void)
|
|||||||
m_displayStartLineId = 0;
|
m_displayStartLineId = 0;
|
||||||
m_displaySize.x = 200;
|
m_displaySize.x = 200;
|
||||||
m_displaySize.y = 20;
|
m_displaySize.y = 20;
|
||||||
m_displayLocalSyntax.idSequence = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -238,12 +237,14 @@ void BufferText::SetLineDisplay(uint32_t lineNumber)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define SEPARATION_SIZE_LINE_NUMBER (3)
|
||||||
|
|
||||||
void BufferText::DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY,char *myPrint, int32_t lineNumber, int32_t positionY)
|
void BufferText::DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY,char *myPrint, int32_t lineNumber, int32_t positionY)
|
||||||
{
|
{
|
||||||
char tmpLineNumber[50];
|
char tmpLineNumber[50];
|
||||||
sprintf(tmpLineNumber, myPrint, lineNumber);
|
sprintf(tmpLineNumber, myPrint, lineNumber);
|
||||||
OOColored->SetColor(myColorManager->Get(COLOR_LIST_BG_2));
|
OOColored->SetColor(myColorManager->Get(COLOR_LIST_BG_2));
|
||||||
OOColored->Rectangle( 0, positionY, 68, sizeY);
|
OOColored->Rectangle( 0, positionY, sizeX+0.5*SEPARATION_SIZE_LINE_NUMBER, sizeY);
|
||||||
OOText->SetColor(myColorManager->Get(COLOR_CODE_LINE_NUMBER));
|
OOText->SetColor(myColorManager->Get(COLOR_CODE_LINE_NUMBER));
|
||||||
OOText->TextAdd(1, positionY, tmpLineNumber, -1);
|
OOText->TextAdd(1, positionY, tmpLineNumber, -1);
|
||||||
}
|
}
|
||||||
@@ -291,6 +292,17 @@ void BufferText::UpdatePointerNumber(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
int32_t BufferText::GetNumberOfLine(void)
|
||||||
|
{
|
||||||
|
return m_EdnBuf.CountLines();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TODO : Remove this ... it is really bad...
|
||||||
|
|
||||||
|
static int32_t g_basicfontId = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Display the curent buffer with all the probematic imposed by the xharset and the user contraint.
|
* @brief Display the curent buffer with all the probematic imposed by the xharset and the user contraint.
|
||||||
*
|
*
|
||||||
@@ -299,20 +311,38 @@ void BufferText::UpdatePointerNumber(void)
|
|||||||
* @return
|
* @return
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int32_t BufferText::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY)
|
int32_t BufferText::Display(ewol::OObject2DTextColored* OOTextNormal,
|
||||||
|
ewol::OObject2DTextColored* OOTextBold,
|
||||||
|
ewol::OObject2DTextColored* OOTextItalic,
|
||||||
|
ewol::OObject2DTextColored* OOTextBoldItalic,
|
||||||
|
ewol::OObject2DColored* OOColored,
|
||||||
|
int32_t offsetX, int32_t offsetY,
|
||||||
|
int32_t sizeX, int32_t sizeY)
|
||||||
{
|
{
|
||||||
|
offsetX -= 40;
|
||||||
|
if (offsetX<0) {
|
||||||
|
offsetX = 0;
|
||||||
|
}
|
||||||
int32_t selStart, selEnd, selRectStart, selRectEnd;
|
int32_t selStart, selEnd, selRectStart, selRectEnd;
|
||||||
bool selIsRect;
|
bool selIsRect;
|
||||||
int32_t selHave;
|
int32_t selHave;
|
||||||
|
|
||||||
int32_t fontId = ewol::GetDefaultFontId();
|
int32_t fontId = OOTextNormal->GetFontID();
|
||||||
|
// TODO : Remove this ...
|
||||||
|
g_basicfontId = fontId;
|
||||||
int32_t letterWidth = ewol::GetWidth(fontId, "A");
|
int32_t letterWidth = ewol::GetWidth(fontId, "A");
|
||||||
int32_t letterHeight = ewol::GetHeight(fontId);
|
int32_t letterHeight = ewol::GetHeight(fontId);
|
||||||
|
|
||||||
|
m_displayStartLineId = offsetY / letterHeight;
|
||||||
|
|
||||||
|
// update the display position with the scroll ofset :
|
||||||
|
m_displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, m_displayStartLineId);
|
||||||
|
|
||||||
|
|
||||||
// update the number of element that can be displayed
|
// update the number of element that can be displayed
|
||||||
m_displaySize.x = (sizeX/letterWidth) + 1 - nbColoneForLineNumber;
|
m_displaySize.x = (sizeX/letterWidth) + 1 - nbColoneForLineNumber;
|
||||||
m_displaySize.y = (sizeY/letterHeight) + 1;
|
m_displaySize.y = (sizeY/letterHeight) + 1;
|
||||||
EDN_INFO("main DIPLAY " << m_displaySize.x << " char * " << m_displaySize.y << " char");
|
EDN_VERBOSE("main DIPLAY " << m_displaySize.x << " char * " << m_displaySize.y << " char");
|
||||||
|
|
||||||
selHave = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, selStart, selEnd, selIsRect, selRectStart, selRectEnd);
|
selHave = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, selStart, selEnd, selIsRect, selRectStart, selRectEnd);
|
||||||
|
|
||||||
@@ -341,9 +371,10 @@ int32_t BufferText::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DC
|
|||||||
color_ts & myColorSpace = myColorManager->Get(COLOR_CODE_SPACE);
|
color_ts & myColorSpace = myColorManager->Get(COLOR_CODE_SPACE);
|
||||||
color_ts & myColorTab = myColorManager->Get(COLOR_CODE_TAB);
|
color_ts & myColorTab = myColorManager->Get(COLOR_CODE_TAB);
|
||||||
Colorize * selectColor = NULL;
|
Colorize * selectColor = NULL;
|
||||||
|
ewol::OObject2DTextColored* OOTextSelected = NULL;
|
||||||
|
|
||||||
int mylen = m_EdnBuf.Size();
|
int mylen = m_EdnBuf.Size();
|
||||||
int32_t x_base=nbColoneForLineNumber*letterWidth + 3;
|
int32_t x_base=nbColoneForLineNumber*letterWidth;
|
||||||
int32_t idX = 0;
|
int32_t idX = 0;
|
||||||
|
|
||||||
OOColored->SetColor(myColorManager->Get(COLOR_CODE_BASIC_BG));
|
OOColored->SetColor(myColorManager->Get(COLOR_CODE_BASIC_BG));
|
||||||
@@ -351,6 +382,7 @@ int32_t BufferText::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DC
|
|||||||
|
|
||||||
int displayLines = 0;
|
int displayLines = 0;
|
||||||
// Regenerate the colorizing if necessary ...
|
// Regenerate the colorizing if necessary ...
|
||||||
|
displayHLData_ts m_displayLocalSyntax;
|
||||||
m_EdnBuf.HightlightGenerateLines(m_displayLocalSyntax, m_displayStartBufferPos, m_displaySize.y);
|
m_EdnBuf.HightlightGenerateLines(m_displayLocalSyntax, m_displayStartBufferPos, m_displaySize.y);
|
||||||
//GTimeVal timeStart;
|
//GTimeVal timeStart;
|
||||||
//g_get_current_time(&timeStart);
|
//g_get_current_time(&timeStart);
|
||||||
@@ -360,8 +392,12 @@ int32_t BufferText::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DC
|
|||||||
memset(displayChar, 0, sizeof(uniChar_t)*MAX_EXP_CHAR_LEN);
|
memset(displayChar, 0, sizeof(uniChar_t)*MAX_EXP_CHAR_LEN);
|
||||||
// draw the lineNumber :
|
// draw the lineNumber :
|
||||||
int32_t currentLineID = m_displayStartLineId+1;
|
int32_t currentLineID = m_displayStartLineId+1;
|
||||||
EDN_DEBUG("Start display of text buffer [" << m_displayStartBufferPos<< ".." << mylen << "]");
|
EDN_VERBOSE("Start display of text buffer [" << m_displayStartBufferPos<< ".." << mylen << "]");
|
||||||
EDN_DEBUG("cursor Pos : " << m_cursorPos << "start at pos=" << m_displayStartBufferPos);
|
EDN_VERBOSE("cursor Pos : " << m_cursorPos << "start at pos=" << m_displayStartBufferPos);
|
||||||
|
|
||||||
|
|
||||||
|
DrawLineNumber(OOTextNormal, OOColored, x_base, sizeY, myPrint, currentLineID, y);
|
||||||
|
int32_t pixelX = x_base + SEPARATION_SIZE_LINE_NUMBER;
|
||||||
|
|
||||||
clipping_ts drawClipping;
|
clipping_ts drawClipping;
|
||||||
drawClipping.x = 0;
|
drawClipping.x = 0;
|
||||||
@@ -369,8 +405,12 @@ int32_t BufferText::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DC
|
|||||||
drawClipping.w = sizeX;
|
drawClipping.w = sizeX;
|
||||||
drawClipping.h = sizeY;
|
drawClipping.h = sizeY;
|
||||||
|
|
||||||
DrawLineNumber(OOText, OOColored, sizeX, sizeY, myPrint, currentLineID, y);
|
clipping_ts drawClippingTextArea;
|
||||||
int32_t pixelX = x_base;
|
drawClippingTextArea.x = pixelX;
|
||||||
|
drawClippingTextArea.y = 0;
|
||||||
|
drawClippingTextArea.w = sizeX - drawClipping.x;
|
||||||
|
drawClippingTextArea.h = sizeY;
|
||||||
|
|
||||||
for (iii=m_displayStartBufferPos; iii<mylen && displayLines < m_displaySize.y ; iii = new_i) {
|
for (iii=m_displayStartBufferPos; iii<mylen && displayLines < m_displaySize.y ; iii = new_i) {
|
||||||
//EDN_DEBUG("diplay element=" << iii);
|
//EDN_DEBUG("diplay element=" << iii);
|
||||||
int displaywidth;
|
int displaywidth;
|
||||||
@@ -411,13 +451,26 @@ int32_t BufferText::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DC
|
|||||||
haveBg = selectColor->HaveBg();
|
haveBg = selectColor->HaveBg();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OOText->SetColor(selectColor->GetFG());
|
|
||||||
coord2D_ts textPos;
|
coord2D_ts textPos;
|
||||||
textPos.x = pixelX-m_displayStartPixelX;
|
textPos.x = pixelX-offsetX;
|
||||||
textPos.y = y;
|
textPos.y = y;
|
||||||
drawSize = OOText->TextAdd(textPos, drawClipping, displayChar);
|
if (true == selectColor->GetItalic() ) {
|
||||||
|
if (true == selectColor->GetBold() ) {
|
||||||
|
OOTextSelected = OOTextBoldItalic;
|
||||||
|
} else {
|
||||||
|
OOTextSelected = OOTextItalic;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (true == selectColor->GetBold() ) {
|
||||||
|
OOTextSelected = OOTextBold;
|
||||||
|
} else {
|
||||||
|
OOTextSelected = OOTextNormal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OOTextSelected->SetColor(selectColor->GetFG());
|
||||||
|
drawSize = OOTextSelected->TextAdd(textPos, drawClippingTextArea, displayChar);
|
||||||
if (true == haveBg ) {
|
if (true == haveBg ) {
|
||||||
OOColored->Rectangle( pixelX, y, drawSize, letterHeight, drawClipping);
|
OOColored->Rectangle(textPos.x, y, drawSize, letterHeight, drawClippingTextArea);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
idX += displaywidth;
|
idX += displaywidth;
|
||||||
@@ -430,11 +483,11 @@ int32_t BufferText::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DC
|
|||||||
// move to next line ...
|
// move to next line ...
|
||||||
if (currentChar=='\n') {
|
if (currentChar=='\n') {
|
||||||
idX =0;
|
idX =0;
|
||||||
pixelX = x_base;
|
pixelX = x_base + SEPARATION_SIZE_LINE_NUMBER;
|
||||||
y += letterHeight;
|
y += letterHeight;
|
||||||
displayLines++;
|
displayLines++;
|
||||||
currentLineID++;
|
currentLineID++;
|
||||||
DrawLineNumber(OOText, OOColored, sizeX, sizeY, myPrint, currentLineID, y);
|
DrawLineNumber(OOTextNormal, OOColored, x_base, sizeY, myPrint, currentLineID, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// special case : the cursor is at the end of the buffer...
|
// special case : the cursor is at the end of the buffer...
|
||||||
@@ -453,9 +506,8 @@ int32_t BufferText::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DC
|
|||||||
|
|
||||||
int32_t BufferText::GetMousePosition(int32_t width, int32_t height)
|
int32_t BufferText::GetMousePosition(int32_t width, int32_t height)
|
||||||
{
|
{
|
||||||
int32_t fontId = ewol::GetDefaultFontId();
|
int32_t letterWidth = ewol::GetWidth(g_basicfontId, "9");
|
||||||
int32_t letterWidth = ewol::GetWidth(fontId, "9");
|
int32_t letterHeight = ewol::GetHeight(g_basicfontId);
|
||||||
int32_t letterHeight = ewol::GetHeight(fontId);
|
|
||||||
|
|
||||||
int32_t lineOffset = height / letterHeight;
|
int32_t lineOffset = height / letterHeight;
|
||||||
|
|
||||||
@@ -479,7 +531,7 @@ int32_t BufferText::GetMousePosition(int32_t width, int32_t height)
|
|||||||
int32_t iii, new_i;
|
int32_t iii, new_i;
|
||||||
|
|
||||||
int mylen = m_EdnBuf.Size();
|
int mylen = m_EdnBuf.Size();
|
||||||
int32_t x_base=nbColoneForLineNumber*letterWidth + 3;
|
int32_t x_base=nbColoneForLineNumber*letterWidth + SEPARATION_SIZE_LINE_NUMBER;
|
||||||
int32_t idX = 0;
|
int32_t idX = 0;
|
||||||
|
|
||||||
uniChar_t displayChar[MAX_EXP_CHAR_LEN];
|
uniChar_t displayChar[MAX_EXP_CHAR_LEN];
|
||||||
@@ -491,30 +543,30 @@ int32_t BufferText::GetMousePosition(int32_t width, int32_t height)
|
|||||||
EDN_DEBUG(" Element : Befor the start of the line ... ==> END");
|
EDN_DEBUG(" Element : Befor the start of the line ... ==> END");
|
||||||
return startLinePosition;
|
return startLinePosition;
|
||||||
}
|
}
|
||||||
EDN_DEBUG("Get id element : x=" << width << "px y=" << height << "px");
|
EDN_VERBOSE("Get id element : x=" << width << "px y=" << height << "px");
|
||||||
EDN_DEBUG(" line offset = " << lineOffset);
|
EDN_VERBOSE(" line offset = " << lineOffset);
|
||||||
for (iii=startLinePosition; iii<mylen; iii = new_i) {
|
for (iii=startLinePosition; iii<mylen; iii = new_i) {
|
||||||
int displaywidth;
|
int displaywidth;
|
||||||
uint32_t currentChar = '\0';
|
uint32_t currentChar = '\0';
|
||||||
new_i = iii;
|
new_i = iii;
|
||||||
displaywidth = m_EdnBuf.GetExpandedChar(new_i, idX, displayChar, currentChar);
|
displaywidth = m_EdnBuf.GetExpandedChar(new_i, idX, displayChar, currentChar);
|
||||||
if (currentChar!='\n') {
|
if (currentChar!='\n') {
|
||||||
int32_t drawSize = ewol::GetWidth(fontId, displayChar);
|
int32_t drawSize = ewol::GetWidth(g_basicfontId, displayChar);
|
||||||
EDN_DEBUG(" Element : " << currentChar << "=\"" << (char)currentChar << "\" display offset=" << pixelX << "px width=" << drawSize << "px");
|
EDN_VERBOSE(" Element : " << currentChar << "=\"" << (char)currentChar << "\" display offset=" << pixelX << "px width=" << drawSize << "px");
|
||||||
pixelX += drawSize;
|
pixelX += drawSize;
|
||||||
if (width <= pixelX) {
|
if (width <= pixelX) {
|
||||||
EDN_DEBUG(" Find IT ==> END");
|
EDN_VERBOSE(" Find IT ==> END");
|
||||||
// find position ...
|
// find position ...
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
EDN_DEBUG(" Element : \"\\n\" display width=---px ==> end of line ==> END");
|
EDN_VERBOSE(" Element : \"\\n\" display width=---px ==> end of line ==> END");
|
||||||
// end of line ... exit cycle
|
// end of line ... exit cycle
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
idX += displaywidth;
|
idX += displaywidth;
|
||||||
}
|
}
|
||||||
EDN_DEBUG("BufferText::GetMousePosition(" << width << "," << height << "); ==> " << iii );
|
EDN_VERBOSE("BufferText::GetMousePosition(" << width << "," << height << "); ==> " << iii );
|
||||||
return iii;
|
return iii;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -687,7 +739,6 @@ void BufferText::ScrollUp(void)
|
|||||||
*/
|
*/
|
||||||
void BufferText::MoveUpDown(int32_t ofset)
|
void BufferText::MoveUpDown(int32_t ofset)
|
||||||
{
|
{
|
||||||
m_displayLocalSyntax.idSequence = -1;
|
|
||||||
if (ofset >= 0) {
|
if (ofset >= 0) {
|
||||||
int32_t nbLine = m_EdnBuf.NumberOfLines();
|
int32_t nbLine = m_EdnBuf.NumberOfLines();
|
||||||
if (m_displayStartLineId+ofset+3 > nbLine) {
|
if (m_displayStartLineId+ofset+3 > nbLine) {
|
||||||
@@ -722,7 +773,6 @@ void BufferText::MoveUpDown(int32_t ofset)
|
|||||||
void BufferText::ForceReDraw(bool allElement)
|
void BufferText::ForceReDraw(bool allElement)
|
||||||
{
|
{
|
||||||
NeedToCleanEndPage = true;
|
NeedToCleanEndPage = true;
|
||||||
//m_displayLocalSyntax.idSequence = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BufferText::SetInsertPosition(int32_t newPos, bool insertChar)
|
void BufferText::SetInsertPosition(int32_t newPos, bool insertChar)
|
||||||
|
@@ -46,7 +46,13 @@ class BufferText : public Buffer {
|
|||||||
void GetInfo(infoStatBuffer_ts &infoToUpdate);
|
void GetInfo(infoStatBuffer_ts &infoToUpdate);
|
||||||
void SetLineDisplay(uint32_t lineNumber);
|
void SetLineDisplay(uint32_t lineNumber);
|
||||||
|
|
||||||
int32_t Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DColored* OOColored, int32_t sizeX, int32_t sizeY);
|
int32_t Display(ewol::OObject2DTextColored* OOTextNormal,
|
||||||
|
ewol::OObject2DTextColored* OOTextBold,
|
||||||
|
ewol::OObject2DTextColored* OOTextItalic,
|
||||||
|
ewol::OObject2DTextColored* OOTextBoldItalic,
|
||||||
|
ewol::OObject2DColored* OOColored,
|
||||||
|
int32_t offsetX, int32_t offsetY,
|
||||||
|
int32_t sizeX, int32_t sizeY);
|
||||||
void ForceReDraw(bool allElement);
|
void ForceReDraw(bool allElement);
|
||||||
void AddChar(char * UTF8data);
|
void AddChar(char * UTF8data);
|
||||||
void cursorMove(ewol::eventKbMoveType_te moveTypeEvent);
|
void cursorMove(ewol::eventKbMoveType_te moveTypeEvent);
|
||||||
@@ -73,6 +79,7 @@ class BufferText : public Buffer {
|
|||||||
void Undo(void);
|
void Undo(void);
|
||||||
void Redo(void);
|
void Redo(void);
|
||||||
void SetCharset(unicode::charset_te newCharset);
|
void SetCharset(unicode::charset_te newCharset);
|
||||||
|
int32_t GetNumberOfLine(void);
|
||||||
protected:
|
protected:
|
||||||
void NameChange(void);
|
void NameChange(void);
|
||||||
|
|
||||||
@@ -94,8 +101,6 @@ class BufferText : public Buffer {
|
|||||||
int32_t m_cursorPreferredCol; //!< colomn of the last up and down ...
|
int32_t m_cursorPreferredCol; //!< colomn of the last up and down ...
|
||||||
cursorDisplayMode_te m_cursorMode; //!< type of cursor Selected
|
cursorDisplayMode_te m_cursorMode; //!< type of cursor Selected
|
||||||
|
|
||||||
displayHLData_ts m_displayLocalSyntax; //!< for the display of the local elements (display HL mode)
|
|
||||||
|
|
||||||
// internal function
|
// internal function
|
||||||
void BasicInit(void);
|
void BasicInit(void);
|
||||||
void UpdateWindowsPosition(bool centerPage = false);
|
void UpdateWindowsPosition(bool centerPage = false);
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
ColorizeManager::ColorizeManager(void)
|
ColorizeManager::ColorizeManager(void)
|
||||||
{
|
{
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgReloadColorFile);
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiChangeColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
ColorizeManager::~ColorizeManager(void)
|
ColorizeManager::~ColorizeManager(void)
|
||||||
@@ -115,11 +115,12 @@ void ColorizeManager::LoadFile(const char * xmlFilename)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// allocate data
|
// allocate data
|
||||||
char * fileBuffer = new char[fileSize];
|
char * fileBuffer = new char[fileSize+5];
|
||||||
if (NULL == fileBuffer) {
|
if (NULL == fileBuffer) {
|
||||||
EWOL_ERROR("Error Memory allocation size=" << fileSize);
|
EWOL_ERROR("Error Memory allocation size=" << fileSize);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
|
||||||
// load data from the file :
|
// load data from the file :
|
||||||
fileName.fRead(fileBuffer, 1, fileSize);
|
fileName.fRead(fileBuffer, 1, fileSize);
|
||||||
// close the file:
|
// close the file:
|
||||||
|
@@ -37,46 +37,13 @@
|
|||||||
|
|
||||||
BufferView::BufferView(void)
|
BufferView::BufferView(void)
|
||||||
{
|
{
|
||||||
m_shawableAreaX = 0;
|
|
||||||
m_shawableAreaY = 0;
|
|
||||||
//ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferManagerNewFile);
|
|
||||||
// Init link with the buffer Manager
|
// Init link with the buffer Manager
|
||||||
//m_bufferManager = BufferManager::Get();
|
m_bufferManager = BufferManager::getInstance();
|
||||||
//m_colorManager = ColorizeManager::Get();
|
m_colorManager = ColorizeManager::getInstance();
|
||||||
#if 0
|
SetCanHaveFocus(true);
|
||||||
m_widget = gtk_drawing_area_new();
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferListChange);
|
||||||
gtk_widget_set_size_request( m_widget, 250, 100);
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferState);
|
||||||
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferId);
|
||||||
gtk_widget_add_events( m_widget,
|
|
||||||
GDK_KEY_PRESS_MASK
|
|
||||||
| GDK_BUTTON_PRESS_MASK
|
|
||||||
| GDK_BUTTON_RELEASE_MASK
|
|
||||||
| GDK_POINTER_MOTION_MASK
|
|
||||||
| GDK_POINTER_MOTION_HINT_MASK);
|
|
||||||
|
|
||||||
# ifdef USE_GTK_VERSION_3_0
|
|
||||||
g_object_set(m_widget,"can-focus", TRUE, NULL);
|
|
||||||
# elif defined( USE_GTK_VERSION_2_0 )
|
|
||||||
GTK_WIDGET_SET_FLAGS(m_widget, GTK_CAN_FOCUS);
|
|
||||||
# endif
|
|
||||||
// Focus Event
|
|
||||||
g_signal_connect( G_OBJECT(m_widget), "focus_in_event", G_CALLBACK(CB_focusGet), this);
|
|
||||||
g_signal_connect( G_OBJECT(m_widget), "focus_out_event", G_CALLBACK(CB_focusLost), this);
|
|
||||||
// Keyboard Event
|
|
||||||
g_signal_connect_after( G_OBJECT(m_widget), "key_press_event", G_CALLBACK(CB_keyboardEvent), this);
|
|
||||||
g_signal_connect_after( G_OBJECT(m_widget), "key_release_event", G_CALLBACK(CB_keyboardEvent), this);
|
|
||||||
// Mouse Event
|
|
||||||
g_signal_connect( G_OBJECT(m_widget), "button_press_event", G_CALLBACK(CB_mouseButtonEvent), this);
|
|
||||||
g_signal_connect( G_OBJECT(m_widget), "button_release_event", G_CALLBACK(CB_mouseButtonEvent), this);
|
|
||||||
g_signal_connect( G_OBJECT(m_widget), "motion_notify_event", G_CALLBACK(CB_mouseMotionEvent), this);
|
|
||||||
// Display Event
|
|
||||||
g_signal_connect( G_OBJECT(m_widget), "realize", G_CALLBACK(CB_displayInit), this);
|
|
||||||
# ifdef USE_GTK_VERSION_3_0
|
|
||||||
g_signal_connect( G_OBJECT(m_widget), "draw", G_CALLBACK(CB_displayDraw), this);
|
|
||||||
# elif defined( USE_GTK_VERSION_2_0 )
|
|
||||||
g_signal_connect( G_OBJECT(m_widget), "expose_event", G_CALLBACK(CB_displayDraw), this);
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
m_selectedID = -1;
|
m_selectedID = -1;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -93,25 +60,98 @@ GtkWidget * BufferView::GetMainWidget(void)
|
|||||||
*/
|
*/
|
||||||
bool BufferView::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
bool BufferView::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
||||||
{
|
{
|
||||||
/*
|
if (generateEventId == ednMsgBufferListChange) {
|
||||||
switch (id)
|
MarkToReedraw();
|
||||||
{
|
}else if (generateEventId == ednMsgBufferId) {
|
||||||
case EDN_MSG__BUFFER_CHANGE_CURRENT:
|
MarkToReedraw();
|
||||||
m_selectedID = dataID;
|
}else if (generateEventId == ednMsgBufferState) {
|
||||||
case EDN_MSG__BUFFER_CHANGE_STATE:
|
MarkToReedraw();
|
||||||
case EDN_MSG__BUFFER_CHANGE_NAME:
|
|
||||||
case EDN_MSG__BUFFER_CHANGE_MODIFY:
|
|
||||||
// change Title :
|
|
||||||
//gtk_widget_queue_draw(m_widget);
|
|
||||||
break;
|
|
||||||
case EDN_MSG__USER_DISPLAY_CHANGE:
|
|
||||||
// Redraw all the display ...
|
|
||||||
//gtk_widget_queue_draw(m_widget);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
color_ts BufferView::GetBasicBG(void)
|
||||||
|
{
|
||||||
|
return m_colorManager->Get(COLOR_LIST_BG_1);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t BufferView::GetNuberOfColomn(void)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BufferView::GetTitle(int32_t colomn, etk::String &myTitle, color_ts &fg, color_ts &bg)
|
||||||
|
{
|
||||||
|
myTitle = "Buffers : ";
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t BufferView::GetNuberOfRaw(void)
|
||||||
|
{
|
||||||
|
if (NULL != m_bufferManager) {
|
||||||
|
return m_bufferManager->Size();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::String &myTextToWrite, color_ts &fg, color_ts &bg)
|
||||||
|
{
|
||||||
|
etk::File name;
|
||||||
|
bool isModify;
|
||||||
|
basicColor_te selectFG = COLOR_LIST_TEXT_NORMAL;
|
||||||
|
basicColor_te selectBG = COLOR_LIST_BG_1;
|
||||||
|
if (m_bufferManager->Exist(raw)) {
|
||||||
|
isModify = m_bufferManager->Get(raw)->IsModify();
|
||||||
|
name = m_bufferManager->Get(raw)->GetFileName();
|
||||||
|
char *tmpModify = (char*)" ";
|
||||||
|
if (true == isModify) {
|
||||||
|
tmpModify = (char*)"M";
|
||||||
|
}
|
||||||
|
char name2[1024] = "";
|
||||||
|
sprintf(name2, "[%2d](%s) %s", raw, tmpModify, name.GetShortFilename().c_str() );
|
||||||
|
|
||||||
|
myTextToWrite = name2;
|
||||||
|
|
||||||
|
if (true == isModify) {
|
||||||
|
selectFG = COLOR_LIST_TEXT_MODIFY;
|
||||||
|
} else {
|
||||||
|
selectFG = COLOR_LIST_TEXT_NORMAL;
|
||||||
|
}
|
||||||
|
if (raw%2==0) {
|
||||||
|
selectBG = COLOR_LIST_BG_1;
|
||||||
|
} else {
|
||||||
|
selectBG = COLOR_LIST_BG_2;
|
||||||
|
}
|
||||||
|
if (m_selectedID == raw) {
|
||||||
|
selectBG = COLOR_LIST_BG_SELECTED;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
myTextToWrite = "ERROR";
|
||||||
|
}
|
||||||
|
fg = m_colorManager->Get(selectFG);
|
||||||
|
bg = m_colorManager->Get(selectBG);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BufferView::OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y)
|
||||||
|
{
|
||||||
|
if (typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) {
|
||||||
|
EDN_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw );
|
||||||
|
int32_t selectBuf = m_bufferManager->WitchBuffer(raw+1);
|
||||||
|
if ( 0 <= selectBuf) {
|
||||||
|
m_selectedID = raw;
|
||||||
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, selectBuf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MarkToReedraw();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
gboolean BufferView::CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data)
|
gboolean BufferView::CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data)
|
||||||
|
@@ -30,10 +30,11 @@
|
|||||||
#include <BufferManager.h>
|
#include <BufferManager.h>
|
||||||
#include <Display.h>
|
#include <Display.h>
|
||||||
#include <MsgBroadcast.h>
|
#include <MsgBroadcast.h>
|
||||||
|
#include <ewol/widget/List.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class BufferView : public ewol::Widget
|
class BufferView : public ewol::List
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructeur
|
// Constructeur
|
||||||
@@ -41,34 +42,19 @@ class BufferView : public ewol::Widget
|
|||||||
~BufferView(void);
|
~BufferView(void);
|
||||||
//GtkWidget *GetMainWidget(void);
|
//GtkWidget *GetMainWidget(void);
|
||||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
||||||
/*
|
protected:
|
||||||
// sur : GTK+ callback :
|
// function call to display the list :
|
||||||
static gboolean CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data);
|
virtual color_ts GetBasicBG(void);
|
||||||
static gboolean CB_displayInit( GtkWidget *widget, gpointer data);
|
virtual uint32_t GetNuberOfColomn(void);
|
||||||
static gint CB_focusGet( GtkWidget *widget, GdkEventFocus *event, gpointer data);
|
virtual bool GetTitle(int32_t colomn, etk::String &myTitle, color_ts &fg, color_ts &bg);
|
||||||
static gint CB_focusLost( GtkWidget *widget, GdkEventFocus *event, gpointer data);
|
virtual uint32_t GetNuberOfRaw(void);
|
||||||
static gint CB_keyboardEvent( GtkWidget *widget, GdkEventKey *event, gpointer data);
|
virtual bool GetElement(int32_t colomn, int32_t raw, etk::String &myTextToWrite, color_ts &fg, color_ts &bg);
|
||||||
static gint CB_mouseButtonEvent(GtkWidget *widget, GdkEventButton *event, gpointer data);
|
virtual bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y);
|
||||||
static gint CB_mouseMotionEvent( GtkWidget *widget, GdkEventMotion *event, gpointer data);
|
|
||||||
static void CB_EventOnBufferManager(gpointer data);
|
|
||||||
|
|
||||||
static void OnPopupEventShow(GtkWidget *menuitem, gpointer data);
|
|
||||||
static void OnPopupEventClose(GtkWidget *menuitem, gpointer data);
|
|
||||||
static void OnPopupEventSave(GtkWidget *menuitem, gpointer data);
|
|
||||||
static void OnPopupEventSaveAs(GtkWidget *menuitem, gpointer data);
|
|
||||||
*/
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//void ViewPopupMenu(GtkWidget *parrent, GdkEventButton *event, int32_t BufferID);
|
|
||||||
// main windows widget :
|
|
||||||
//GtkWidget * m_widget;
|
|
||||||
// r<>cup<75>ration des proprieter g<>n<EFBFBD>ral...
|
// r<>cup<75>ration des proprieter g<>n<EFBFBD>ral...
|
||||||
BufferManager * m_bufferManager;
|
BufferManager * m_bufferManager;
|
||||||
ColorizeManager * m_colorManager;
|
ColorizeManager * m_colorManager;
|
||||||
int32_t m_shawableAreaX;
|
|
||||||
int32_t m_shawableAreaY;
|
|
||||||
int32_t m_selectedID;
|
int32_t m_selectedID;
|
||||||
int32_t m_contectMenuSelectID;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -46,6 +46,12 @@
|
|||||||
CodeView::CodeView(void)
|
CodeView::CodeView(void)
|
||||||
{
|
{
|
||||||
m_label = "CodeView is disable ...";
|
m_label = "CodeView is disable ...";
|
||||||
|
m_fontNormal = -1;
|
||||||
|
m_fontBold = -1;
|
||||||
|
m_fontItalic = -1;
|
||||||
|
m_fontBoldItalic = -1;
|
||||||
|
m_fontSize = 15;
|
||||||
|
|
||||||
m_bufferID = -1;
|
m_bufferID = -1;
|
||||||
m_buttunOneSelected = false;
|
m_buttunOneSelected = false;
|
||||||
|
|
||||||
@@ -63,6 +69,11 @@ CodeView::CodeView(void)
|
|||||||
m_textColorBg.blue = 0.0;
|
m_textColorBg.blue = 0.0;
|
||||||
m_textColorBg.alpha = 0.25;
|
m_textColorBg.alpha = 0.25;
|
||||||
SetCanHaveFocus(true);
|
SetCanHaveFocus(true);
|
||||||
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferId);
|
||||||
|
|
||||||
|
|
||||||
|
//old
|
||||||
|
/*
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentChangeBufferId);
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentChangeBufferId);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentSave);
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentSave);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentSaveAs);
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentSaveAs);
|
||||||
@@ -82,6 +93,7 @@ CodeView::CodeView(void)
|
|||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentRedo);
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentRedo);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentGotoLine);
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentGotoLine);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentSetCharset);
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewCurrentSetCharset);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeView::~CodeView(void)
|
CodeView::~CodeView(void)
|
||||||
@@ -96,42 +108,45 @@ bool CodeView::CalculateMinSize(void)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CodeView::CalculateMaxSize(void)
|
||||||
|
{
|
||||||
|
m_maxSize.x = 4096;
|
||||||
|
int32_t letterHeight = ewol::GetHeight(m_fontNormal);
|
||||||
|
m_maxSize.y = m_bufferManager->Get(m_bufferID)->GetNumberOfLine() * letterHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CodeView::OnRegenerateDisplay(void)
|
void CodeView::OnRegenerateDisplay(void)
|
||||||
{
|
{
|
||||||
// create tmp object :
|
if (true == NeedRedraw()) {
|
||||||
ewol::OObject2DTextColored* myOObjectText = new ewol::OObject2DTextColored("", -1);
|
// For the scrooling windows
|
||||||
ewol::OObject2DColored* myOObjectsColored = new ewol::OObject2DColored();
|
CalculateMaxSize();
|
||||||
|
|
||||||
// generate the objects :
|
// create tmp object :
|
||||||
//m_bufferID = 0;
|
ewol::OObject2DTextColored* myOObjectTextNormal = new ewol::OObject2DTextColored(m_fontNormal);
|
||||||
m_bufferManager->Get(m_bufferID)->Display(myOObjectText, myOObjectsColored, m_size.x, m_size.y);
|
ewol::OObject2DTextColored* myOObjectTextBold = new ewol::OObject2DTextColored(m_fontBold);
|
||||||
|
ewol::OObject2DTextColored* myOObjectTextItalic = new ewol::OObject2DTextColored(m_fontItalic);
|
||||||
// clean the object list ...
|
ewol::OObject2DTextColored* myOObjectTextBoldItalic = new ewol::OObject2DTextColored(m_fontBoldItalic);
|
||||||
ClearOObjectList();
|
ewol::OObject2DColored* myOObjectsColored = new ewol::OObject2DColored();
|
||||||
// add generated element
|
|
||||||
AddOObject(myOObjectsColored, "CodeViewBackground");
|
// generate the objects :
|
||||||
AddOObject(myOObjectText, "CodeViewText");
|
//m_bufferID = 0;
|
||||||
}
|
m_bufferManager->Get(m_bufferID)->Display(myOObjectTextNormal, myOObjectTextBold, myOObjectTextItalic, myOObjectTextBoldItalic, myOObjectsColored,
|
||||||
|
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
|
||||||
bool CodeView::OnEventArea(const char * generateEventId, etkFloat_t x, etkFloat_t y)
|
|
||||||
{
|
// clean the object list ...
|
||||||
/*
|
ClearOObjectList();
|
||||||
//bool eventIsOK = false;
|
// add generated element
|
||||||
//EWOL_DEBUG("Receive event : \"" << generateEventId << "\"");
|
AddOObject(myOObjectsColored, "CodeViewBackground");
|
||||||
if(ewolEventButtonPressed == generateEventId) {
|
AddOObject(myOObjectTextNormal, "CodeViewTextNormal");
|
||||||
EWOL_INFO("BT pressed ... " << m_label);
|
AddOObject(myOObjectTextBold, "CodeViewTextBold");
|
||||||
//eventIsOK = true;
|
AddOObject(myOObjectTextItalic, "CodeViewTextItalic");
|
||||||
ewol::widgetManager::FocusKeep(this);
|
AddOObject(myOObjectTextBoldItalic, "CodeViewTextBoldItalic");
|
||||||
} else if(ewolEventButtonEnter == generateEventId) {
|
|
||||||
OnRegenerateDisplay();
|
// call the herited class...
|
||||||
|
WidgetScrooled::OnRegenerateDisplay();
|
||||||
}
|
}
|
||||||
//return eventIsOK;
|
|
||||||
*/
|
|
||||||
// in every case this not stop the propagation of the event
|
|
||||||
return false;
|
|
||||||
// if overwrited... you can ...
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -140,7 +155,7 @@ bool CodeView::OnEventKb(ewol::eventKbType_te typeEvent, char UTF8_data[UTF8_MAX
|
|||||||
//EDN_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent);
|
//EDN_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent);
|
||||||
if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) {
|
if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) {
|
||||||
m_bufferManager->Get(m_bufferID)->AddChar(UTF8_data);
|
m_bufferManager->Get(m_bufferID)->AddChar(UTF8_data);
|
||||||
OnRegenerateDisplay();
|
MarkToReedraw();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -150,7 +165,7 @@ bool CodeView::OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveTy
|
|||||||
{
|
{
|
||||||
if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) {
|
if (typeEvent == ewol::EVENT_KB_TYPE_DOWN) {
|
||||||
m_bufferManager->Get(m_bufferID)->cursorMove(moveTypeEvent);
|
m_bufferManager->Get(m_bufferID)->cursorMove(moveTypeEvent);
|
||||||
OnRegenerateDisplay();
|
MarkToReedraw();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -159,6 +174,11 @@ bool CodeView::OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveTy
|
|||||||
|
|
||||||
bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y)
|
bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y)
|
||||||
{
|
{
|
||||||
|
if (true == WidgetScrooled::OnEventInput(IdInput, typeEvent, x, y)) {
|
||||||
|
ewol::widgetManager::FocusKeep(this);
|
||||||
|
// nothing to do ... done on upper widet ...
|
||||||
|
return true;
|
||||||
|
}
|
||||||
x -= m_origin.x;
|
x -= m_origin.x;
|
||||||
y -= m_origin.y;
|
y -= m_origin.y;
|
||||||
/*
|
/*
|
||||||
@@ -199,22 +219,23 @@ bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent,
|
|||||||
if (ewol::EVENT_INPUT_TYPE_DOWN == typeEvent) {
|
if (ewol::EVENT_INPUT_TYPE_DOWN == typeEvent) {
|
||||||
m_buttunOneSelected = true;
|
m_buttunOneSelected = true;
|
||||||
ewol::widgetManager::FocusKeep(this);
|
ewol::widgetManager::FocusKeep(this);
|
||||||
|
//EDN_INFO("mouse-event BT1 ==> One Clicked %d, %d", (uint32_t)event->x, (uint32_t)event->y);
|
||||||
|
m_bufferManager->Get(m_bufferID)->MouseEvent(x, y);
|
||||||
|
MarkToReedraw();
|
||||||
} else if (ewol::EVENT_INPUT_TYPE_UP == typeEvent) {
|
} else if (ewol::EVENT_INPUT_TYPE_UP == typeEvent) {
|
||||||
m_buttunOneSelected = false;
|
m_buttunOneSelected = false;
|
||||||
m_bufferManager->Get(m_bufferID)->Copy(COPY_MIDDLE_BUTTON);
|
m_bufferManager->Get(m_bufferID)->Copy(COPY_MIDDLE_BUTTON);
|
||||||
OnRegenerateDisplay();
|
MarkToReedraw();
|
||||||
} else if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) {
|
} else if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) {
|
||||||
//EDN_INFO("mouse-event BT1 ==> One Clicked %d, %d", (uint32_t)event->x, (uint32_t)event->y);
|
// nothing to do ...
|
||||||
m_bufferManager->Get(m_bufferID)->MouseEvent(x, y);
|
|
||||||
OnRegenerateDisplay();
|
|
||||||
} else if (ewol::EVENT_INPUT_TYPE_DOUBLE == typeEvent) {
|
} else if (ewol::EVENT_INPUT_TYPE_DOUBLE == typeEvent) {
|
||||||
//EDN_INFO("mouse-event BT1 ==> Double Clicked %d, %d", (uint32_t)event->x, (uint32_t)event->y);
|
//EDN_INFO("mouse-event BT1 ==> Double Clicked %d, %d", (uint32_t)event->x, (uint32_t)event->y);
|
||||||
m_bufferManager->Get(m_bufferID)->MouseEventDouble();
|
m_bufferManager->Get(m_bufferID)->MouseEventDouble();
|
||||||
OnRegenerateDisplay();
|
MarkToReedraw();
|
||||||
} else if (ewol::EVENT_INPUT_TYPE_TRIPLE == typeEvent) {
|
} else if (ewol::EVENT_INPUT_TYPE_TRIPLE == typeEvent) {
|
||||||
//EDN_INFO("mouse-event BT1 ==> Triple Clicked");
|
//EDN_INFO("mouse-event BT1 ==> Triple Clicked");
|
||||||
m_bufferManager->Get(m_bufferID)->MouseEventTriple();
|
m_bufferManager->Get(m_bufferID)->MouseEventTriple();
|
||||||
OnRegenerateDisplay();
|
MarkToReedraw();
|
||||||
} else if (ewol::EVENT_INPUT_TYPE_MOVE == typeEvent) {
|
} else if (ewol::EVENT_INPUT_TYPE_MOVE == typeEvent) {
|
||||||
if (true == m_buttunOneSelected) {
|
if (true == m_buttunOneSelected) {
|
||||||
int xxx, yyy;
|
int xxx, yyy;
|
||||||
@@ -228,49 +249,67 @@ bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent,
|
|||||||
}
|
}
|
||||||
//EDN_INFO("mouse-motion BT1 %d, %d", xxx, yyy);
|
//EDN_INFO("mouse-motion BT1 %d, %d", xxx, yyy);
|
||||||
m_bufferManager->Get(m_bufferID)->MouseSelectFromCursorTo(xxx, yyy);
|
m_bufferManager->Get(m_bufferID)->MouseSelectFromCursorTo(xxx, yyy);
|
||||||
OnRegenerateDisplay();
|
MarkToReedraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (2 == IdInput) {
|
} else if (2 == IdInput) {
|
||||||
if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) {
|
if (ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent) {
|
||||||
m_bufferManager->Get(m_bufferID)->MouseEvent(x, y);
|
m_bufferManager->Get(m_bufferID)->MouseEvent(x, y);
|
||||||
m_bufferManager->Get(m_bufferID)->Paste(COPY_MIDDLE_BUTTON);
|
m_bufferManager->Get(m_bufferID)->Paste(COPY_MIDDLE_BUTTON);
|
||||||
OnRegenerateDisplay();
|
MarkToReedraw();
|
||||||
ewol::widgetManager::FocusKeep(this);
|
ewol::widgetManager::FocusKeep(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (4 == IdInput && ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent)
|
// TODO : No mere used here ... ==> set in the scrooled windows ...
|
||||||
|
/*
|
||||||
|
if (4 == IdInput && ewol::EVENT_INPUT_TYPE_UP == typeEvent)
|
||||||
{
|
{
|
||||||
//EDN_INFO("mouse-event GDK_SCROLL_UP");
|
//EDN_INFO("mouse-event GDK_SCROLL_UP");
|
||||||
m_bufferManager->Get(m_bufferID)->ScrollUp();
|
m_bufferManager->Get(m_bufferID)->ScrollUp();
|
||||||
OnRegenerateDisplay();
|
MarkToReedraw();
|
||||||
ewol::widgetManager::FocusKeep(this);
|
ewol::widgetManager::FocusKeep(this);
|
||||||
} else if (5 == IdInput && ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent)
|
} else if (5 == IdInput && ewol::EVENT_INPUT_TYPE_UP == typeEvent)
|
||||||
{
|
{
|
||||||
//EDN_INFO("mouse-event GDK_SCROLL_DOWN");
|
//EDN_INFO("mouse-event GDK_SCROLL_DOWN");
|
||||||
m_bufferManager->Get(m_bufferID)->ScrollDown();
|
m_bufferManager->Get(m_bufferID)->ScrollDown();
|
||||||
OnRegenerateDisplay();
|
MarkToReedraw();
|
||||||
ewol::widgetManager::FocusKeep(this);
|
ewol::widgetManager::FocusKeep(this);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool CodeView::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
bool CodeView::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y)
|
||||||
{
|
{
|
||||||
EDN_DEBUG("Extern Event : " << widgetID << " type : " << generateEventId << " position(" << x << "," << y << ")");
|
EDN_DEBUG("Extern Event : " << widgetID << " type : " << generateEventId << " position(" << x << "," << y << ")");
|
||||||
|
|
||||||
if( ednMsgCodeViewCurrentChangeBufferId == generateEventId) {
|
|
||||||
|
|
||||||
|
if( ednMsgBufferId == generateEventId) {
|
||||||
int32_t bufferID = 0;
|
int32_t bufferID = 0;
|
||||||
sscanf(eventExternId, "%d", &bufferID);
|
sscanf(data, "%d", &bufferID);
|
||||||
|
EDN_INFO("Select a new Buffer ... " << bufferID);
|
||||||
|
m_bufferID = bufferID;
|
||||||
|
m_bufferManager->Get(m_bufferID)->ForceReDraw(true);
|
||||||
|
// TODO : need to update the state of the file and the filenames ...
|
||||||
|
}
|
||||||
|
// old
|
||||||
|
/*
|
||||||
|
else if( ednMsgCodeViewCurrentChangeBufferId == generateEventId) {
|
||||||
|
int32_t bufferID = 0;
|
||||||
|
sscanf(data, "%d", &bufferID);
|
||||||
EDN_INFO("Select a new Buffer ... " << bufferID);
|
EDN_INFO("Select a new Buffer ... " << bufferID);
|
||||||
m_bufferID = bufferID;
|
m_bufferID = bufferID;
|
||||||
m_bufferManager->Get(m_bufferID)->ForceReDraw(true);
|
m_bufferManager->Get(m_bufferID)->ForceReDraw(true);
|
||||||
// request the display of the curent Editor
|
// request the display of the curent Editor
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferChangeCurrent, (char*)eventExternId);
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferChangeCurrent, (char*)data);
|
||||||
|
|
||||||
} else if (ednMsgCodeViewCurrentSave == generateEventId) {
|
}
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
else if (ednMsgCodeViewCurrentSave == generateEventId) {
|
||||||
|
|
||||||
} else if (ednMsgCodeViewCurrentSaveAs == generateEventId) {
|
} else if (ednMsgCodeViewCurrentSaveAs == generateEventId) {
|
||||||
|
|
||||||
@@ -306,7 +345,9 @@ bool CodeView::OnEventAreaExternal(int32_t widgetID, const char * generateEventI
|
|||||||
|
|
||||||
} else if (ednMsgCodeViewCurrentSetCharset == generateEventId) {
|
} else if (ednMsgCodeViewCurrentSetCharset == generateEventId) {
|
||||||
|
|
||||||
} else {
|
}
|
||||||
|
*/
|
||||||
|
else {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -402,22 +443,58 @@ bool CodeView::OnEventAreaExternal(int32_t widgetID, const char * generateEventI
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
// Force redraw of the widget
|
// Force redraw of the widget
|
||||||
OnRegenerateDisplay();
|
MarkToReedraw();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CodeView::OnGetFocus(void)
|
void CodeView::OnGetFocus(void)
|
||||||
{
|
{
|
||||||
//SendMessage(EDN_MSG__BUFFER_CHANGE_CURRENT, m_bufferID);
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_bufferID);
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferChangeCurrent);
|
ewol::KeyboardShow(ewol::KEYBOARD_MODE_CODE);
|
||||||
EDN_INFO("Focus - In");
|
EDN_INFO("Focus - In");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CodeView::OnLostFocus(void)
|
void CodeView::OnLostFocus(void)
|
||||||
{
|
{
|
||||||
|
ewol::KeyboardHide();
|
||||||
EDN_INFO("Focus - out");
|
EDN_INFO("Focus - out");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CodeView::SetFontSize(int32_t size)
|
||||||
|
{
|
||||||
|
m_fontSize = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CodeView::SetFontNameNormal(etk::String fontName)
|
||||||
|
{
|
||||||
|
int32_t fontID = ewol::LoadFont(fontName, m_fontSize);
|
||||||
|
if (fontID >= 0) {
|
||||||
|
m_fontNormal = fontID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CodeView::SetFontNameBold(etk::String fontName)
|
||||||
|
{
|
||||||
|
int32_t fontID = ewol::LoadFont(fontName, m_fontSize);
|
||||||
|
if (fontID >= 0) {
|
||||||
|
m_fontBold = fontID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CodeView::SetFontNameItalic(etk::String fontName)
|
||||||
|
{
|
||||||
|
int32_t fontID = ewol::LoadFont(fontName, m_fontSize);
|
||||||
|
if (fontID >= 0) {
|
||||||
|
m_fontItalic = fontID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CodeView::SetFontNameBoldItalic(etk::String fontName)
|
||||||
|
{
|
||||||
|
int32_t fontID = ewol::LoadFont(fontName, m_fontSize);
|
||||||
|
if (fontID >= 0) {
|
||||||
|
m_fontBoldItalic = fontID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -34,17 +34,18 @@
|
|||||||
|
|
||||||
#include <etk/Types.h>
|
#include <etk/Types.h>
|
||||||
#include <ewol/Widget.h>
|
#include <ewol/Widget.h>
|
||||||
|
#include <ewol/widget/WidgetScrolled.h>
|
||||||
|
|
||||||
class CodeView :public ewol::Widget
|
class CodeView :public ewol::WidgetScrooled
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CodeView(void);
|
CodeView(void);
|
||||||
virtual ~CodeView(void);
|
virtual ~CodeView(void);
|
||||||
virtual bool CalculateMinSize(void);
|
virtual bool CalculateMinSize(void);
|
||||||
private:
|
private:
|
||||||
etk::String m_label;
|
etk::String m_label;
|
||||||
color_ts m_textColorFg; //!< Text color
|
color_ts m_textColorFg; //!< Text color
|
||||||
color_ts m_textColorBg; //!< Background color
|
color_ts m_textColorBg; //!< Background color
|
||||||
BufferManager * m_bufferManager;
|
BufferManager * m_bufferManager;
|
||||||
ColorizeManager * m_colorManager;
|
ColorizeManager * m_colorManager;
|
||||||
int32_t m_bufferID;
|
int32_t m_bufferID;
|
||||||
@@ -54,50 +55,25 @@ class CodeView :public ewol::Widget
|
|||||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
||||||
public:
|
public:
|
||||||
virtual bool OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y);
|
virtual bool OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y);
|
||||||
virtual bool OnEventArea(const char * generateEventId, etkFloat_t x, etkFloat_t y);
|
|
||||||
virtual bool OnEventKb(ewol::eventKbType_te typeEvent, char UTF8_data[UTF8_MAX_SIZE]);
|
virtual bool OnEventKb(ewol::eventKbType_te typeEvent, char UTF8_data[UTF8_MAX_SIZE]);
|
||||||
virtual bool OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveType_te moveTypeEvent);
|
virtual bool OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveType_te moveTypeEvent);
|
||||||
virtual void OnGetFocus(void);
|
virtual void OnGetFocus(void);
|
||||||
virtual void OnLostFocus(void);
|
virtual void OnLostFocus(void);
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
class CodeView : public MsgBroadcast
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
// Constructeur
|
|
||||||
CodeView(void);
|
|
||||||
~CodeView(void);
|
|
||||||
void OnMessage(int32_t id, int32_t dataID);
|
|
||||||
/*
|
|
||||||
GtkWidget *GetMainWidget(void);
|
|
||||||
// sur : GTK+ callback :
|
|
||||||
static gboolean CB_displayDraw( GtkWidget *widget, GdkEventExpose *event, gpointer data);
|
|
||||||
static gboolean CB_displayInit( GtkWidget *widget, gpointer data);
|
|
||||||
static gint CB_focusGet( GtkWidget *widget, GdkEventFocus *event, gpointer data);
|
|
||||||
static gint CB_focusLost( GtkWidget *widget, GdkEventFocus *event, gpointer data);
|
|
||||||
static gint CB_keyboardEvent( GtkWidget *widget, GdkEventKey *event, gpointer data);
|
|
||||||
static gint CB_mouseButtonEvent(GtkWidget *widget, GdkEventButton *event, gpointer data);
|
|
||||||
static gint CB_mouseMotionEvent( GtkWidget *widget, GdkEventMotion *event, gpointer data);
|
|
||||||
static gint CB_mouseScrollEvent( GtkWidget *widget, GdkEventScroll *event, gpointer data);
|
|
||||||
*/
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// main windows widget :
|
int32_t m_fontSize;
|
||||||
//GtkWidget * m_widget;
|
int32_t m_fontNormal;
|
||||||
// récupération des proprieter général...
|
int32_t m_fontBold;
|
||||||
BufferManager * m_bufferManager;
|
int32_t m_fontItalic;
|
||||||
ColorizeManager * m_colorManager;
|
int32_t m_fontBoldItalic;
|
||||||
int32_t m_shawableAreaX;
|
public:
|
||||||
int32_t m_shawableAreaY;
|
void SetFontSize(int32_t size);
|
||||||
int32_t m_bufferID;
|
void SetFontNameNormal(etk::String fontName);
|
||||||
bool m_buttunOneSelected;
|
void SetFontNameBold(etk::String fontName);
|
||||||
|
void SetFontNameItalic(etk::String fontName);
|
||||||
|
void SetFontNameBoldItalic(etk::String fontName);
|
||||||
|
private:
|
||||||
|
void CalculateMaxSize(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -49,12 +49,14 @@
|
|||||||
#define __class__ "MainWindows"
|
#define __class__ "MainWindows"
|
||||||
|
|
||||||
|
|
||||||
|
const char * const ednEventNewFile = "edn-New-File";
|
||||||
const char * const ednEventOpenFile = "edn-Open-File";
|
const char * const ednEventOpenFile = "edn-Open-File";
|
||||||
const char * const ednEventCloseFile = "edn-Close-File";
|
const char * const ednEventCloseFile = "edn-Close-File";
|
||||||
const char * const ednEventSaveFile = "edn-Save-File";
|
const char * const ednEventSaveFile = "edn-Save-File";
|
||||||
const char * const ednEventSaveAsFile = "edn-SaveAs-File";
|
const char * const ednEventSaveAsFile = "edn-SaveAs-File";
|
||||||
const char * const ednEventPopUpClose = "edn-PopUp-Close";
|
const char * const ednEventPopUpClose = "edn-PopUp-Close";
|
||||||
const char * const ednEventPopUpFileSelected = "edn-PopUp-FileSelected";
|
const char * const ednEventPopUpFileSelected = "edn-PopUp-FileSelected";
|
||||||
|
const char * const ednEventPopUpFileSaveAs = "edn-PopUp-FileSaveAs";
|
||||||
|
|
||||||
MainWindows::MainWindows(void)
|
MainWindows::MainWindows(void)
|
||||||
{
|
{
|
||||||
@@ -64,6 +66,7 @@ MainWindows::MainWindows(void)
|
|||||||
ewol::Button * myButton = NULL;
|
ewol::Button * myButton = NULL;
|
||||||
ewol::Label * myLabel = NULL;
|
ewol::Label * myLabel = NULL;
|
||||||
CodeView * myCodeView = NULL;
|
CodeView * myCodeView = NULL;
|
||||||
|
BufferView * myBufferView = NULL;
|
||||||
|
|
||||||
mySizerVert = new ewol::SizerVert();
|
mySizerVert = new ewol::SizerVert();
|
||||||
SetSubWidget(mySizerVert);
|
SetSubWidget(mySizerVert);
|
||||||
@@ -71,6 +74,12 @@ MainWindows::MainWindows(void)
|
|||||||
mySizerHori = new ewol::SizerHori();
|
mySizerHori = new ewol::SizerHori();
|
||||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||||
|
|
||||||
|
myButton = new ewol::Button("New");
|
||||||
|
mySizerHori->SubWidgetAdd(myButton);
|
||||||
|
if (false == myButton->ExternLinkOnEvent(ewolEventButtonPressed, GetWidgetId(), ednEventNewFile) ) {
|
||||||
|
EDN_CRITICAL("link with an entry event");
|
||||||
|
}
|
||||||
|
|
||||||
myButton = new ewol::Button("Open");
|
myButton = new ewol::Button("Open");
|
||||||
mySizerHori->SubWidgetAdd(myButton);
|
mySizerHori->SubWidgetAdd(myButton);
|
||||||
if (false == myButton->ExternLinkOnEvent(ewolEventButtonPressed, GetWidgetId(), ednEventOpenFile) ) {
|
if (false == myButton->ExternLinkOnEvent(ewolEventButtonPressed, GetWidgetId(), ednEventOpenFile) ) {
|
||||||
@@ -103,13 +112,34 @@ MainWindows::MainWindows(void)
|
|||||||
|
|
||||||
mySizerHori = new ewol::SizerHori();
|
mySizerHori = new ewol::SizerHori();
|
||||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||||
|
myBufferView = new BufferView();
|
||||||
|
myBufferView->SetExpendX(false);
|
||||||
|
myBufferView->SetExpendY(true);
|
||||||
|
myBufferView->SetFillX(true);
|
||||||
|
myBufferView->SetFillY(true);
|
||||||
|
mySizerHori->SubWidgetAdd(myBufferView);
|
||||||
myCodeView = new CodeView();
|
myCodeView = new CodeView();
|
||||||
myCodeView->SetExpendX(true);
|
myCodeView->SetExpendX(true);
|
||||||
myCodeView->SetExpendY(true);
|
myCodeView->SetExpendY(true);
|
||||||
myCodeView->SetFillX(true);
|
myCodeView->SetFillX(true);
|
||||||
myCodeView->SetFillY(true);
|
myCodeView->SetFillY(true);
|
||||||
|
|
||||||
|
myCodeView->SetFontSize(11);
|
||||||
|
myCodeView->SetFontNameNormal( "freefont/FreeMono.ttf");
|
||||||
|
myCodeView->SetFontNameBold( "freefont/FreeMonoBold.ttf");
|
||||||
|
myCodeView->SetFontNameItalic( "freefont/FreeMonoOblique.ttf");
|
||||||
|
myCodeView->SetFontNameBoldItalic("freefont/FreeMonoBoldOblique.ttf");
|
||||||
|
/*
|
||||||
|
myCodeView->SetFontSize(11);
|
||||||
|
myCodeView->SetFontNameNormal( "ubuntu/UbuntuMono-R.ttf");
|
||||||
|
myCodeView->SetFontNameBold( "ubuntu/UbuntuMono-B.ttf");
|
||||||
|
myCodeView->SetFontNameItalic( "ubuntu/UbuntuMono-RI.ttf");
|
||||||
|
myCodeView->SetFontNameBoldItalic("ubuntu/UbuntuMono-BI.ttf");
|
||||||
|
*/
|
||||||
mySizerHori->SubWidgetAdd(myCodeView);
|
mySizerHori->SubWidgetAdd(myCodeView);
|
||||||
|
|
||||||
|
// Generic event ...
|
||||||
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiSaveAs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -122,12 +152,30 @@ MainWindows::~MainWindows(void)
|
|||||||
|
|
||||||
bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y)
|
bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y)
|
||||||
{
|
{
|
||||||
EDN_INFO("Receive Event from the main windows ... : widgetid=" << widgetID << "\"" << generateEventId << "\" ==> data=\"" << data << "\"" );
|
if (true == ewol::Windows::OnEventAreaExternal(widgetID, generateEventId, data, x, y) ) {
|
||||||
if (generateEventId == ednEventOpenFile) {
|
return true;
|
||||||
|
}
|
||||||
|
//EDN_INFO("Receive Event from the main windows ... : widgetid=" << widgetID << "\"" << generateEventId << "\" ==> data=\"" << data << "\"" );
|
||||||
|
// newFile section ...
|
||||||
|
if (generateEventId == ednEventNewFile) {
|
||||||
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgGuiNew);
|
||||||
|
}
|
||||||
|
else if (generateEventId == ednEventCloseFile) {
|
||||||
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgGuiClose, "current");
|
||||||
|
}
|
||||||
|
else if (generateEventId == ednEventSaveFile) {
|
||||||
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgGuiSave, "current");
|
||||||
|
}
|
||||||
|
else if (generateEventId == ednEventSaveAsFile) {
|
||||||
|
OnEventAreaExternal(GetWidgetId(), ednMsgGuiSaveAs, "current", x, y);
|
||||||
|
}
|
||||||
|
// Open file Section ...
|
||||||
|
else if (generateEventId == ednEventOpenFile) {
|
||||||
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
|
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
|
||||||
tmpWidget->SetTitle("Open Files ...");
|
tmpWidget->SetTitle("Open Files ...");
|
||||||
tmpWidget->SetValidateLabel("Open");
|
tmpWidget->SetValidateLabel("Open");
|
||||||
tmpWidget->SetFolder("/");
|
// TODO : Set the good folder ...
|
||||||
|
//tmpWidget->SetFolder("/");
|
||||||
PopUpWidgetPush(tmpWidget);
|
PopUpWidgetPush(tmpWidget);
|
||||||
if (false == tmpWidget->ExternLinkOnEvent(ewolEventFileChooserCancel, GetWidgetId(), ednEventPopUpClose) ) {
|
if (false == tmpWidget->ExternLinkOnEvent(ewolEventFileChooserCancel, GetWidgetId(), ednEventPopUpClose) ) {
|
||||||
EDN_CRITICAL("link with an entry event");
|
EDN_CRITICAL("link with an entry event");
|
||||||
@@ -136,6 +184,7 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve
|
|||||||
EDN_CRITICAL("link with an entry event");
|
EDN_CRITICAL("link with an entry event");
|
||||||
}
|
}
|
||||||
} else if (generateEventId == ednEventPopUpClose) {
|
} else if (generateEventId == ednEventPopUpClose) {
|
||||||
|
// TODO : Set this in the upper windows ...
|
||||||
PopUpWidgetPop();
|
PopUpWidgetPop();
|
||||||
} else if (generateEventId == ednEventPopUpFileSelected) {
|
} else if (generateEventId == ednEventPopUpFileSelected) {
|
||||||
// get widget:
|
// get widget:
|
||||||
@@ -147,15 +196,47 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve
|
|||||||
}
|
}
|
||||||
// get the filename :
|
// get the filename :
|
||||||
etk::String tmpData = tmpWidget->GetCompleateFileName();
|
etk::String tmpData = tmpWidget->GetCompleateFileName();
|
||||||
etk::File myfilename = tmpData;
|
|
||||||
BufferManager *myBufferManager = BufferManager::getInstance();
|
|
||||||
if (false == myBufferManager->Exist(myfilename) ) {
|
|
||||||
int32_t openID = myBufferManager->Open(myfilename);
|
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgCodeViewCurrentChangeBufferId, openID);
|
|
||||||
} else {
|
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgCodeViewCurrentChangeBufferId, myBufferManager->GetId(myfilename));
|
|
||||||
}
|
|
||||||
EDN_DEBUG("Request opening the file : " << tmpData);
|
EDN_DEBUG("Request opening the file : " << tmpData);
|
||||||
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgOpenFile, tmpData.c_str());
|
||||||
|
PopUpWidgetPop();
|
||||||
|
} else if (generateEventId == ednMsgGuiSaveAs) {
|
||||||
|
if (NULL == data) {
|
||||||
|
EDN_ERROR("Null data for Save As file ... ");
|
||||||
|
} else {
|
||||||
|
BufferManager * myMng = BufferManager::getInstance();
|
||||||
|
m_currentSavingAsIdBuffer = -1;
|
||||||
|
if (0 == strcmp(data , "current")) {
|
||||||
|
m_currentSavingAsIdBuffer = myMng->GetSelected();
|
||||||
|
} else {
|
||||||
|
sscanf(data, "%d", &m_currentSavingAsIdBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (false == myMng->Exist(m_currentSavingAsIdBuffer)) {
|
||||||
|
EDN_ERROR("Request saveAs on non existant Buffer ID=" << m_currentSavingAsIdBuffer);
|
||||||
|
} else {
|
||||||
|
Buffer * myBuffer = myMng->Get(m_currentSavingAsIdBuffer);
|
||||||
|
ewol::FileChooser* tmpWidget = new ewol::FileChooser();
|
||||||
|
tmpWidget->SetTitle("Save Files As...");
|
||||||
|
tmpWidget->SetValidateLabel("Save");
|
||||||
|
etk::String folder = "/home/";
|
||||||
|
etk::String fileName = "";
|
||||||
|
if (true == myBuffer->HaveName()) {
|
||||||
|
etk::File tmpName = myBuffer->GetFileName();
|
||||||
|
folder = tmpName.GetFolder();
|
||||||
|
fileName = tmpName.GetShortFilename();
|
||||||
|
}
|
||||||
|
tmpWidget->SetFolder(folder);
|
||||||
|
tmpWidget->SetFileName(fileName);
|
||||||
|
PopUpWidgetPush(tmpWidget);
|
||||||
|
if (false == tmpWidget->ExternLinkOnEvent(ewolEventFileChooserCancel, GetWidgetId(), ednEventPopUpClose) ) {
|
||||||
|
EDN_CRITICAL("link with an entry event");
|
||||||
|
}
|
||||||
|
if (false == tmpWidget->ExternLinkOnEvent(ewolEventFileChooserValidate, GetWidgetId(), ednEventPopUpFileSaveAs) ) {
|
||||||
|
EDN_CRITICAL("link with an entry event");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (generateEventId == ednEventPopUpFileSaveAs) {
|
||||||
PopUpWidgetPop();
|
PopUpWidgetPop();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@@ -70,6 +70,8 @@ class MainWindows: public etk::Singleton<MainWindows>, public MsgBroadcast
|
|||||||
#endif
|
#endif
|
||||||
class MainWindows : public ewol::Windows
|
class MainWindows : public ewol::Windows
|
||||||
{
|
{
|
||||||
|
private:
|
||||||
|
int32_t m_currentSavingAsIdBuffer;
|
||||||
public:
|
public:
|
||||||
// Constructeur
|
// Constructeur
|
||||||
MainWindows(void);
|
MainWindows(void);
|
||||||
|
@@ -64,11 +64,12 @@ Highlight::Highlight(etk::String &xmlFilename)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// allocate data
|
// allocate data
|
||||||
char * fileBuffer = new char[fileSize];
|
char * fileBuffer = new char[fileSize+5];
|
||||||
if (NULL == fileBuffer) {
|
if (NULL == fileBuffer) {
|
||||||
EWOL_ERROR("Error Memory allocation size=" << fileSize);
|
EWOL_ERROR("Error Memory allocation size=" << fileSize);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
memset(fileBuffer, 0, (fileSize+5)*sizeof(char));
|
||||||
// load data from the file :
|
// load data from the file :
|
||||||
fileName.fRead(fileBuffer, 1, fileSize);
|
fileName.fRead(fileBuffer, 1, fileSize);
|
||||||
// close the file:
|
// close the file:
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
HighlightManager::HighlightManager(void)
|
HighlightManager::HighlightManager(void)
|
||||||
{
|
{
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgColorHasChange);
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
HighlightManager::~HighlightManager(void)
|
HighlightManager::~HighlightManager(void)
|
||||||
|
@@ -49,10 +49,7 @@ CTagsManager::CTagsManager(void)
|
|||||||
m_tagFolderBase = "";
|
m_tagFolderBase = "";
|
||||||
m_ctagFile = NULL;
|
m_ctagFile = NULL;
|
||||||
m_historyPos = 0;
|
m_historyPos = 0;
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCtagsOpen);
|
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiCtags);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCtagsReload);
|
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCtagsJumpCurrentSelection);
|
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCtagsJumpBack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -47,7 +47,7 @@ MainWindows * basicWindows = NULL;
|
|||||||
*/
|
*/
|
||||||
void APP_Init(void)
|
void APP_Init(void)
|
||||||
{
|
{
|
||||||
EDN_INFO("Start Edn");
|
EDN_INFO("==> Init Edn (START)");
|
||||||
ewol::ChangeSize(800, 600);
|
ewol::ChangeSize(800, 600);
|
||||||
|
|
||||||
// set the default Path of the application :
|
// set the default Path of the application :
|
||||||
@@ -87,7 +87,7 @@ void APP_Init(void)
|
|||||||
// init ALL Singleton :
|
// init ALL Singleton :
|
||||||
(void)WindowsManager::getInstance();
|
(void)WindowsManager::getInstance();
|
||||||
(void)CTagsManager::getInstance();
|
(void)CTagsManager::getInstance();
|
||||||
BufferManager *myBufferManager = BufferManager::getInstance();
|
(void)BufferManager::getInstance();
|
||||||
|
|
||||||
// set color and other trucs...
|
// set color and other trucs...
|
||||||
ColorizeManager *myColorManager = NULL;
|
ColorizeManager *myColorManager = NULL;
|
||||||
@@ -124,15 +124,9 @@ void APP_Init(void)
|
|||||||
|
|
||||||
for( int32_t iii=0 ; iii<ewol::CmdLineNb(); iii++) {
|
for( int32_t iii=0 ; iii<ewol::CmdLineNb(); iii++) {
|
||||||
EDN_INFO("need load file : \"" << ewol::CmdLineGet(iii) << "\"" );
|
EDN_INFO("need load file : \"" << ewol::CmdLineGet(iii) << "\"" );
|
||||||
etk::String tmpString = ewol::CmdLineGet(iii);
|
ewol::widgetMessageMultiCast::Send(-1, ednMsgOpenFile, ewol::CmdLineGet(iii).c_str());
|
||||||
etk::File myfile(tmpString, etk::FILE_TYPE_DIRECT);
|
|
||||||
if (false == myBufferManager->Exist(myfile) ) {
|
|
||||||
int32_t idBuffOpened = myBufferManager->Open(myfile);
|
|
||||||
if (1==iii) {
|
|
||||||
ewol::widgetMessageMultiCast::Send(-1, ednMsgCodeViewCurrentChangeBufferId, idBuffOpened);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
EDN_INFO("==> Init Edn (END)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -141,6 +135,7 @@ void APP_Init(void)
|
|||||||
*/
|
*/
|
||||||
void APP_UnInit(void)
|
void APP_UnInit(void)
|
||||||
{
|
{
|
||||||
|
EDN_INFO("==> Un-Init Edn (START)");
|
||||||
// Remove windows :
|
// Remove windows :
|
||||||
ewol::DisplayWindows(NULL);
|
ewol::DisplayWindows(NULL);
|
||||||
|
|
||||||
@@ -157,6 +152,7 @@ void APP_UnInit(void)
|
|||||||
if (NULL != basicWindows) {
|
if (NULL != basicWindows) {
|
||||||
delete(basicWindows);
|
delete(basicWindows);
|
||||||
}
|
}
|
||||||
EDN_INFO("Stop Edn");
|
basicWindows = NULL;
|
||||||
|
EDN_INFO("==> Un-Init Edn (END)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -78,7 +78,6 @@ EdnBuf::EdnBuf(void)
|
|||||||
// basicly no HL system ...
|
// basicly no HL system ...
|
||||||
m_Highlight = NULL;
|
m_Highlight = NULL;
|
||||||
m_nbLine = 1;
|
m_nbLine = 1;
|
||||||
m_HLDataSequence = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -68,7 +68,6 @@ typedef enum{
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
etk::VectorType<colorInformation_ts> HLData;
|
etk::VectorType<colorInformation_ts> HLData;
|
||||||
int32_t idSequence;
|
|
||||||
int32_t posHLPass1;
|
int32_t posHLPass1;
|
||||||
int32_t posHLPass2;
|
int32_t posHLPass2;
|
||||||
}displayHLData_ts;
|
}displayHLData_ts;
|
||||||
@@ -159,7 +158,6 @@ class EdnBuf {
|
|||||||
private:
|
private:
|
||||||
Highlight * m_Highlight; //!< internal link with the Highlight system
|
Highlight * m_Highlight; //!< internal link with the Highlight system
|
||||||
etk::VectorType<colorInformation_ts> m_HLDataPass1; //!< colorisation position in the current buffer pass 1
|
etk::VectorType<colorInformation_ts> m_HLDataPass1; //!< colorisation position in the current buffer pass 1
|
||||||
int32_t m_HLDataSequence; //!< position of the start of line requested by the screen viewer
|
|
||||||
void RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdded);
|
void RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdded);
|
||||||
void GenerateHighLightAt(int32_t pos, int32_t endPos, int32_t addinPos=0);
|
void GenerateHighLightAt(int32_t pos, int32_t endPos, int32_t addinPos=0);
|
||||||
void CleanHighLight(void);
|
void CleanHighLight(void);
|
||||||
|
@@ -46,9 +46,6 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd
|
|||||||
//GTimeVal timeStart;
|
//GTimeVal timeStart;
|
||||||
//g_get_current_time(&timeStart);
|
//g_get_current_time(&timeStart);
|
||||||
|
|
||||||
// remove display HL...
|
|
||||||
m_HLDataSequence++;
|
|
||||||
|
|
||||||
// prevent ERROR...
|
// prevent ERROR...
|
||||||
if (NULL == m_Highlight) {
|
if (NULL == m_Highlight) {
|
||||||
return;
|
return;
|
||||||
@@ -287,7 +284,6 @@ colorInformation_ts *EdnBuf::GetElementColorAtPosition(int32_t pos, int32_t &sta
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart, int32_t nbLines)
|
void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart, int32_t nbLines)
|
||||||
{
|
{
|
||||||
MData.posHLPass1 = 0;
|
MData.posHLPass1 = 0;
|
||||||
@@ -295,65 +291,62 @@ void EdnBuf::HightlightGenerateLines(displayHLData_ts & MData, int32_t HLStart,
|
|||||||
if (NULL == m_Highlight) {
|
if (NULL == m_Highlight) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (MData.idSequence != m_HLDataSequence) {
|
//GTimeVal timeStart;
|
||||||
//GTimeVal timeStart;
|
//g_get_current_time(&timeStart);
|
||||||
//g_get_current_time(&timeStart);
|
HLStart = StartOfLine(HLStart);
|
||||||
MData.idSequence = m_HLDataSequence;
|
MData.HLData.Clear();
|
||||||
HLStart = StartOfLine(HLStart);
|
int32_t HLStop = CountForwardNLines(HLStart, nbLines);
|
||||||
MData.HLData.Clear();
|
int32_t startId, stopId;
|
||||||
int32_t HLStop = CountForwardNLines(HLStart, nbLines);
|
// find element previous
|
||||||
int32_t startId, stopId;
|
FindMainHighLightPosition(HLStart, HLStop, startId, stopId, true);
|
||||||
// find element previous
|
|
||||||
FindMainHighLightPosition(HLStart, HLStop, startId, stopId, true);
|
|
||||||
|
|
||||||
int32_t k;
|
int32_t k;
|
||||||
//EDN_DEBUG("List of section between : "<< startId << " & " << stopId);
|
//EDN_DEBUG("List of section between : "<< startId << " & " << stopId);
|
||||||
int32_t endSearch = stopId+1;
|
int32_t endSearch = stopId+1;
|
||||||
if (-1 == stopId) {
|
if (-1 == stopId) {
|
||||||
endSearch = m_HLDataPass1.Size();
|
endSearch = m_HLDataPass1.Size();
|
||||||
}
|
}
|
||||||
for (k=edn_max(startId, 0); k<endSearch; k++) {
|
for (k=edn_max(startId, 0); k<endSearch; k++) {
|
||||||
// empty section :
|
// empty section :
|
||||||
if (0==k) {
|
if (0==k) {
|
||||||
if (HLStart < m_HLDataPass1[k].beginStart) {
|
if (HLStart < m_HLDataPass1[k].beginStart) {
|
||||||
//EDN_DEBUG(" ==> (empty section 1 ) k="<<k<<" start="<<HLStart<<" stop="<<m_HLDataPass1[k].beginStart );
|
//EDN_DEBUG(" ==> (empty section 1 ) k="<<k<<" start="<<HLStart<<" stop="<<m_HLDataPass1[k].beginStart );
|
||||||
m_Highlight->Parse2(HLStart,
|
m_Highlight->Parse2(HLStart,
|
||||||
m_HLDataPass1[k].beginStart,
|
|
||||||
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 );
|
|
||||||
m_Highlight->Parse2(m_HLDataPass1[k-1].endStop,
|
|
||||||
m_HLDataPass1[k].beginStart,
|
m_HLDataPass1[k].beginStart,
|
||||||
MData.HLData,
|
MData.HLData,
|
||||||
m_data);
|
m_data);
|
||||||
}
|
} // else : nothing to do ...
|
||||||
// under section :
|
} else {
|
||||||
//EDN_DEBUG(" ==> (under section ) k="<<k<<" start="<<m_HLDataPass1[k].beginStart<<" stop="<<m_HLDataPass1[k].endStop << " subSectionOfID=" << 99999999);
|
//EDN_DEBUG(" ==> (empty section 2 ) k="<<k<<" start="<<m_HLDataPass1[k-1].endStop<<" stop="<<m_HLDataPass1[k].beginStart );
|
||||||
// TODO : ...
|
m_Highlight->Parse2(m_HLDataPass1[k-1].endStop,
|
||||||
|
m_HLDataPass1[k].beginStart,
|
||||||
|
MData.HLData,
|
||||||
|
m_data);
|
||||||
}
|
}
|
||||||
if (endSearch == (int32_t)m_HLDataPass1.Size() ){
|
// under section :
|
||||||
//if( k < (int32_t)m_HLDataPass1.Size()) {
|
//EDN_DEBUG(" ==> (under section ) k="<<k<<" start="<<m_HLDataPass1[k].beginStart<<" stop="<<m_HLDataPass1[k].endStop << " subSectionOfID=" << 99999999);
|
||||||
if (m_HLDataPass1.Size() != 0) {
|
// TODO : ...
|
||||||
//EDN_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 );
|
|
||||||
m_Highlight->Parse2(0,
|
|
||||||
HLStop,
|
|
||||||
MData.HLData,
|
|
||||||
m_data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//GTimeVal timeStop;
|
|
||||||
//g_get_current_time(&timeStop);
|
|
||||||
//EDN_DEBUG("Display reAnnalyse = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s");
|
|
||||||
}
|
}
|
||||||
|
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 );
|
||||||
|
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 );
|
||||||
|
m_Highlight->Parse2(0,
|
||||||
|
HLStop,
|
||||||
|
MData.HLData,
|
||||||
|
m_data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//GTimeVal timeStop;
|
||||||
|
//g_get_current_time(&timeStop);
|
||||||
|
//EDN_DEBUG("Display reAnnalyse = " << timeStop.tv_usec - timeStart.tv_usec << " micro-s");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -28,53 +28,50 @@
|
|||||||
#include <MsgBroadcast.h>
|
#include <MsgBroadcast.h>
|
||||||
|
|
||||||
|
|
||||||
|
// new list of edn event generic :
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
// Event of the gui request something :
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
extern const char* const ednMsgGuiNew = "edn-Msg-Gui-New";
|
||||||
|
extern const char* const ednMsgGuiOpen = "edn-Msg-Gui-Open";
|
||||||
|
extern const char* const ednMsgGuiClose = "edn-Msg-Gui-Close";
|
||||||
|
extern const char* const ednMsgGuiSave = "edn-Msg-Gui-Save";
|
||||||
|
extern const char* const ednMsgGuiSaveAs = "edn-Msg-Gui-SaveAs";
|
||||||
|
|
||||||
extern const char* const ednMsgBufferChangeCurrent = "edn-Msg-Buffer-Change-Current";
|
extern const char* const ednMsgGuiUndo = "edn-Msg-Gui-Undo";
|
||||||
extern const char* const ednMsgUserDisplayChange = "edn-Msg-User-Display-Change";
|
extern const char* const ednMsgGuiRedo = "edn-Msg-Gui-Redo";
|
||||||
|
extern const char* const ednMsgGuiCopy = "edn-Msg-Gui-Copy";
|
||||||
|
extern const char* const ednMsgGuiCut = "edn-Msg-Gui-Cut";
|
||||||
|
extern const char* const ednMsgGuiPaste = "edn-Msg-Gui-Paste";
|
||||||
|
extern const char* const ednMsgGuiRm = "edn-Msg-Gui-Rm";
|
||||||
|
extern const char* const ednMsgGuiSelect = "edn-Msg-Gui-Select";
|
||||||
|
extern const char* const ednMsgGuiGotoLine = "edn-Msg-Gui-GotoLine";
|
||||||
|
|
||||||
extern const char* const ednMsgBufferRemove = "edn-Msg-Buffer-Remove";
|
extern const char* const ednMsgGuiSearch = "edn-Msg-Gui-Search";
|
||||||
extern const char* const ednMsgBufferRemoveAll = "edn-Msg-Buffer-Remove-All";
|
extern const char* const ednMsgGuiReplace = "edn-Msg-Gui-Replace";
|
||||||
extern const char* const ednMsgBufferAdd = "edn-Msg-Buffer-Add";
|
extern const char* const ednMsgGuiFind = "edn-Msg-Gui-Find";
|
||||||
extern const char* const ednMsgBufferChangeState = "edn-Msg-Buffer-Change-State";
|
|
||||||
extern const char* const ednMsgBufferChangeName = "edn-Msg-Buffer-Change-Name";
|
|
||||||
extern const char* const ednMsgBufferModify = "edn-Msg-Buffer-Modify";
|
|
||||||
extern const char* const ednMsgBufferHasHistory = "edn-Msg-Buffer-Has-History";
|
|
||||||
extern const char* const ednMsgBufferHasNotHistory = "edn-Msg-Buffer-Has-Not-History";
|
|
||||||
extern const char* const ednMsgBufferHasFutureHistory = "edn-Msg-Buffer-Has-Future-History";
|
|
||||||
extern const char* const ednMsgBufferHasNotFutureHistory = "edn-Msg-Buffer-Has-Not-Future-History";
|
|
||||||
|
|
||||||
extern const char* const ednMsgBufferManagerNewFile = "edn-Msg-Buffer-Manager-New-File";
|
extern const char* const ednMsgGuiChangeColor = "edn-Msg-Gui-ChangeColor";
|
||||||
extern const char* const ednMsgBufferManagerSaveAll = "edn-Msg-Buffer-Manager-Save-All";
|
extern const char* const ednMsgGuiChangeCharset = "edn-Msg-Gui-ChangeCharset";
|
||||||
extern const char* const ednMsgBufferManagerCloseAll = "edn-Msg-Buffer-Manager-Close-All";
|
extern const char* const ednMsgGuiShowSpaces = "edn-Msg-Gui-ShowSpaces";
|
||||||
extern const char* const ednMsgBufferManagerClose = "edn-Msg-Buffer-Manager-Close";
|
extern const char* const ednMsgGuiShowEndOfLine = "edn-Msg-Gui-ShowEndOfLine";
|
||||||
extern const char* const ednMsgBufferManagerSave = "edn-Msg-Buffer-Manager-Save";
|
|
||||||
|
|
||||||
extern const char* const ednMsgCodeViewCurrentChangeBufferId = "edn-Msg-CodeView-Current-Change-Buffer-Id";
|
extern const char* const ednMsgGuiCtags = "edn-Msg-Gui-CTags";
|
||||||
extern const char* const ednMsgCodeViewCurrentSave = "edn-Msg-CodeView-Current-Save";
|
|
||||||
extern const char* const ednMsgCodeViewCurrentSaveAs = "edn-Msg-CodeView-Current-Save-As";
|
|
||||||
extern const char* const ednMsgCodeViewCurrentSelectAll = "edn-Msg-CodeView-Current-Select-All";
|
|
||||||
extern const char* const ednMsgCodeViewCurrentRemoveLine = "edn-Msg-CodeView-Current-Remove-Line";
|
|
||||||
extern const char* const ednMsgCodeViewCurrentUnSelect = "edn-Msg-CodeView-Current-Un-Select";
|
|
||||||
extern const char* const ednMsgCodeViewCurrentCopy = "edn-Msg-CodeView-Current-Copy";
|
|
||||||
extern const char* const ednMsgCodeViewCurrentCut = "edn-Msg-CodeView-Current-Cut";
|
|
||||||
extern const char* const ednMsgCodeViewCurrentPaste = "edn-Msg-CodeView-Current-Paste";
|
|
||||||
extern const char* const ednMsgCodeViewCurrentFindPrevious = "edn-Msg-CodeView-Current-Find-Previous";
|
|
||||||
extern const char* const ednMsgCodeViewCurrentFindNext = "edn-Msg-CodeView-Current-Find-Next";
|
|
||||||
extern const char* const ednMsgCodeViewCurrentFindOldNext = "edn-Msg-CodeView-Current-Find-Old-Next";
|
|
||||||
extern const char* const ednMsgCodeViewCurrentReplace = "edn-Msg-CodeView-Current-Replace";
|
|
||||||
extern const char* const ednMsgCodeViewCurrentReplaceAll = "edn-Msg-CodeView-Current-Replace-All";
|
|
||||||
extern const char* const ednMsgCodeViewCurrentClose = "edn-Msg-CodeView-Current-Close";
|
|
||||||
extern const char* const ednMsgCodeViewCurrentUndo = "edn-Msg-CodeView-Current-Undo";
|
|
||||||
extern const char* const ednMsgCodeViewCurrentRedo = "edn-Msg-CodeView-Current-Redo";
|
|
||||||
extern const char* const ednMsgCodeViewCurrentGotoLine = "edn-Msg-CodeView-Current-Goto-Line";
|
|
||||||
extern const char* const ednMsgCodeViewCurrentSetCharset = "edn-Msg-CodeView-Current-Set-Charset";
|
|
||||||
|
|
||||||
extern const char* const ednMsgCtagsOpen = "edn-Msg-Ctags-Open";
|
extern const char* const ednMsgGuiAbout = "edn-Msg-Gui-About";
|
||||||
extern const char* const ednMsgCtagsReload = "edn-Msg-Ctags-Reload";
|
|
||||||
extern const char* const ednMsgCtagsJumpCurrentSelection = "edn-Msg-Ctags-Jump-Current-Selection";
|
|
||||||
extern const char* const ednMsgCtagsJumpBack = "edn-Msg-Ctags-Jump-Back";
|
|
||||||
|
|
||||||
extern const char* const ednMsgColorHasChange = "edn-Msg-Color-Has-Change";
|
|
||||||
|
|
||||||
extern const char* const ednMsgReloadColorFile = "edn-Msg-Reload-Color-File";
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
// Event internal :
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
extern const char* const ednMsgBufferState = "edn-Msg-Buffer-State";
|
||||||
|
extern const char* const ednMsgBufferName = "edn-Msg-Buffer-Name";
|
||||||
|
extern const char* const ednMsgBufferId = "edn-Msg-Buffer-Id";
|
||||||
|
extern const char* const ednMsgCodeViewSelectedId = "edn-Msg-CodeView-Select-Id";
|
||||||
|
extern const char* const ednMsgOpenFile = "edn-Msg-OpenFile";
|
||||||
|
|
||||||
|
extern const char* const ednMsgBufferListChange = "edn-Msg-BufferListChange";
|
||||||
|
|
||||||
|
extern const char* const ednMsgBufferColor = "edn-Msg-Buffer-Color";
|
||||||
|
|
||||||
|
|
||||||
|
@@ -30,54 +30,51 @@
|
|||||||
#include <etk/String.h>
|
#include <etk/String.h>
|
||||||
|
|
||||||
|
|
||||||
extern const char* const ednMsgBufferChangeCurrent; // set the new current BUFFER ...
|
// new list of edn event generic :
|
||||||
extern const char* const ednMsgUserDisplayChange; // User change the display ==> need to reload all the display depending on color internal
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
// Event of the gui request something :
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
extern const char* const ednMsgGuiNew; // data : ""
|
||||||
|
extern const char* const ednMsgGuiOpen; // data : ""
|
||||||
|
extern const char* const ednMsgGuiClose; // data : "current" "All"
|
||||||
|
extern const char* const ednMsgGuiSave; // data : ""
|
||||||
|
extern const char* const ednMsgGuiSaveAs; // data : ""
|
||||||
|
|
||||||
|
extern const char* const ednMsgGuiUndo; // data : ""
|
||||||
|
extern const char* const ednMsgGuiRedo; // data : ""
|
||||||
|
extern const char* const ednMsgGuiCopy; // data : "STD" "Middle" "1" ... "9"
|
||||||
|
extern const char* const ednMsgGuiCut; // data : "STD" "Middle" "1" ... "9"
|
||||||
|
extern const char* const ednMsgGuiPaste; // data : "STD" "Middle" "1" ... "9"
|
||||||
|
extern const char* const ednMsgGuiRm; // data : "Word" "Line" "Paragraph"
|
||||||
|
extern const char* const ednMsgGuiSelect; // data : "ALL" "NONE"
|
||||||
|
extern const char* const ednMsgGuiGotoLine; // data : "???" / "1" ... "999999999999"
|
||||||
|
|
||||||
|
extern const char* const ednMsgGuiSearch; // data : ""
|
||||||
|
extern const char* const ednMsgGuiReplace; // data : ""
|
||||||
|
extern const char* const ednMsgGuiFind; // data : "Next" "Previous"
|
||||||
|
|
||||||
|
extern const char* const ednMsgGuiChangeColor; // data : "Black" "White"
|
||||||
|
extern const char* const ednMsgGuiChangeCharset; // data : "UTF-8" "ISO-8859-1" "ISO-8859-15"
|
||||||
|
extern const char* const ednMsgGuiShowSpaces; // data : "enable" "disable"
|
||||||
|
extern const char* const ednMsgGuiShowEndOfLine; // data : "enable" "disable"
|
||||||
|
|
||||||
|
extern const char* const ednMsgGuiCtags; // data : "Load" "ReLoad" "Jump" "Back"
|
||||||
|
|
||||||
|
extern const char* const ednMsgGuiAbout; // data : ""
|
||||||
|
|
||||||
extern const char* const ednMsgBufferRemove;
|
|
||||||
extern const char* const ednMsgBufferRemoveAll;
|
|
||||||
extern const char* const ednMsgBufferAdd;
|
|
||||||
extern const char* const ednMsgBufferChangeState;
|
|
||||||
extern const char* const ednMsgBufferChangeName;
|
|
||||||
extern const char* const ednMsgBufferModify;
|
|
||||||
extern const char* const ednMsgBufferHasHistory;
|
|
||||||
extern const char* const ednMsgBufferHasNotHistory;
|
|
||||||
extern const char* const ednMsgBufferHasFutureHistory;
|
|
||||||
extern const char* const ednMsgBufferHasNotFutureHistory;
|
|
||||||
|
|
||||||
extern const char* const ednMsgBufferManagerNewFile;
|
////////////////////////////////////////////////////////////////////////
|
||||||
extern const char* const ednMsgBufferManagerSaveAll;
|
// Event internal :
|
||||||
extern const char* const ednMsgBufferManagerCloseAll;
|
////////////////////////////////////////////////////////////////////////
|
||||||
extern const char* const ednMsgBufferManagerClose;
|
extern const char* const ednMsgBufferState; // data : "Saved" "Modify" "HasHistory" "HasNotHistory" "HasFutureHistory" "HasNotFutureHistory"
|
||||||
extern const char* const ednMsgBufferManagerSave;
|
extern const char* const ednMsgBufferName; // data : "filename"
|
||||||
|
extern const char* const ednMsgBufferId; // data : "0" ... "99999999999"
|
||||||
extern const char* const ednMsgCodeViewCurrentChangeBufferId;
|
extern const char* const ednMsgCodeViewSelectedId; // data : "0" ... "99999999999"
|
||||||
extern const char* const ednMsgCodeViewCurrentSave;
|
extern const char* const ednMsgOpenFile; // data : "/Compleate/file/name.xx"
|
||||||
extern const char* const ednMsgCodeViewCurrentSaveAs;
|
|
||||||
extern const char* const ednMsgCodeViewCurrentSelectAll;
|
extern const char* const ednMsgBufferListChange; // data : ""
|
||||||
extern const char* const ednMsgCodeViewCurrentRemoveLine;
|
|
||||||
extern const char* const ednMsgCodeViewCurrentUnSelect;
|
extern const char* const ednMsgBufferColor; // data : "new"
|
||||||
extern const char* const ednMsgCodeViewCurrentCopy;
|
|
||||||
extern const char* const ednMsgCodeViewCurrentCut;
|
|
||||||
extern const char* const ednMsgCodeViewCurrentPaste;
|
|
||||||
extern const char* const ednMsgCodeViewCurrentFindPrevious;
|
|
||||||
extern const char* const ednMsgCodeViewCurrentFindNext;
|
|
||||||
extern const char* const ednMsgCodeViewCurrentFindOldNext;
|
|
||||||
extern const char* const ednMsgCodeViewCurrentReplace;
|
|
||||||
extern const char* const ednMsgCodeViewCurrentReplaceAll;
|
|
||||||
extern const char* const ednMsgCodeViewCurrentClose;
|
|
||||||
extern const char* const ednMsgCodeViewCurrentUndo;
|
|
||||||
extern const char* const ednMsgCodeViewCurrentRedo;
|
|
||||||
extern const char* const ednMsgCodeViewCurrentGotoLine;
|
|
||||||
extern const char* const ednMsgCodeViewCurrentSetCharset;
|
|
||||||
|
|
||||||
extern const char* const ednMsgCtagsOpen;
|
|
||||||
extern const char* const ednMsgCtagsReload;
|
|
||||||
extern const char* const ednMsgCtagsJumpCurrentSelection;
|
|
||||||
extern const char* const ednMsgCtagsJumpBack;
|
|
||||||
|
|
||||||
extern const char* const ednMsgColorHasChange;
|
|
||||||
|
|
||||||
extern const char* const ednMsgReloadColorFile;
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -55,7 +55,7 @@ void globals::SetDisplayEndOfLine(bool newVal)
|
|||||||
{
|
{
|
||||||
EDN_INFO("Set EndOfLine " << newVal);
|
EDN_INFO("Set EndOfLine " << newVal);
|
||||||
displayEOL = newVal;
|
displayEOL = newVal;
|
||||||
ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
|
//ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
@@ -69,7 +69,7 @@ void globals::SetDisplaySpaceChar(bool newVal)
|
|||||||
{
|
{
|
||||||
EDN_INFO("Set SpaceChar " << newVal);
|
EDN_INFO("Set SpaceChar " << newVal);
|
||||||
displaySpaceChar = newVal;
|
displaySpaceChar = newVal;
|
||||||
ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
|
//ewol::widgetMessageMultiCast::Send(-1, ednMsgUserDisplayChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user