[DEV] update the system interface

This commit is contained in:
Edouard DUPIN 2013-05-12 21:08:31 +02:00
parent b55be0aeca
commit 52ac167872
17 changed files with 186 additions and 264 deletions

View File

@ -21,25 +21,12 @@ class classBufferManager: public ewol::EObject
// Constructeur // Constructeur
classBufferManager(void); classBufferManager(void);
~classBufferManager(void); ~classBufferManager(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void) const char * const GetObjectType(void)
{ {
return "ApplBufferManager"; return "ApplBufferManager";
} }
public: public:
/** virtual void OnReceiveMessage(const ewol::EMessage& _msg);
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data);
private: 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
@ -70,14 +57,6 @@ class classBufferManager: public ewol::EObject
// Constructeur // Constructeur
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
classBufferManager::classBufferManager(void) classBufferManager::classBufferManager(void)
{ {
m_idSelected = -1; m_idSelected = -1;
@ -89,14 +68,6 @@ classBufferManager::classBufferManager(void)
RegisterMultiCast(ednMsgBufferId); RegisterMultiCast(ednMsgBufferId);
} }
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
classBufferManager::~classBufferManager(void) classBufferManager::~classBufferManager(void)
{ {
//clean All Buffer //clean All Buffer
@ -108,24 +79,17 @@ classBufferManager::~classBufferManager(void)
} }
/** void classBufferManager::OnReceiveMessage(const ewol::EMessage& _msg)
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data)
{ {
ewol::EObject::OnReceiveMessage(CallerObject, eventId, data); ewol::EObject::OnReceiveMessage(_msg);
if (eventId == ednMsgBufferId) { if (_msg.GetMessage() == ednMsgBufferId) {
// select a new buffer ID : // select a new buffer ID :
if (data == "") { if (_msg.GetData() == "") {
APPL_ERROR("Request select buffer ID = \"\" "); APPL_ERROR("Request select buffer ID = \"\" ");
} else { } else {
int32_t newID = -1; int32_t newID = -1;
sscanf(data.c_str(), "%d", &newID); sscanf(_msg.GetData().c_str(), "%d", &newID);
if(true == Exist(newID)) { if(true == Exist(newID)) {
m_idSelected = newID; m_idSelected = newID;
} else { } else {
@ -133,17 +97,17 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
APPL_ERROR("Request a non existant ID : " << newID << " reset to -1..."); APPL_ERROR("Request a non existant ID : " << newID << " reset to -1...");
} }
} }
} else if (eventId == ednMsgGuiNew) { } else if (_msg.GetMessage() == ednMsgGuiNew) {
int32_t newOne = Create(); int32_t newOne = Create();
if (-1 != newOne) { if (-1 != newOne) {
m_idSelected = newOne; m_idSelected = newOne;
SendMultiCast(ednMsgBufferId, m_idSelected); SendMultiCast(ednMsgBufferId, m_idSelected);
SendMultiCast(ednMsgBufferListChange); SendMultiCast(ednMsgBufferListChange);
} }
} else if (eventId == ednMsgOpenFile) { } else if (_msg.GetMessage() == ednMsgOpenFile) {
if (data != "" ) { if (_msg.GetData() != "" ) {
etk::FSNode myFile(data); etk::FSNode myFile(_msg.GetData());
APPL_DEBUG("request open file = \"" <<data << "\" ?= \"" << myFile << "\""); APPL_DEBUG("request open file = \"" << _msg.GetData() << "\" ?= \"" << myFile << "\"");
int32_t newOne = Open(myFile); int32_t newOne = Open(myFile);
if (-1 != newOne) { if (-1 != newOne) {
m_idSelected = newOne; m_idSelected = newOne;
@ -154,11 +118,11 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
APPL_ERROR("Can not open the file : \"" << myFile << "\""); APPL_ERROR("Can not open the file : \"" << myFile << "\"");
} }
} }
} else if (eventId == ednMsgGuiSave) { } else if (_msg.GetMessage() == ednMsgGuiSave) {
if (data == "") { if (_msg.GetData() == "") {
APPL_ERROR("Null data for close file ... "); APPL_ERROR("Null data for close file ... ");
} else { } else {
if (data == "current") { if (_msg.GetData() == "current") {
// Check buffer existence // Check buffer existence
if(true == Exist(m_idSelected)) { if(true == Exist(m_idSelected)) {
// If no name ==> request a Gui display ... // If no name ==> request a Gui display ...
@ -170,7 +134,7 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
} }
} else { } else {
int32_t newId; int32_t newId;
sscanf(data.c_str(), "%d", &newId); sscanf(_msg.GetData().c_str(), "%d", &newId);
if (false == Exist(newId)) { if (false == Exist(newId)) {
APPL_ERROR("Request a save As with a non existant ID=" << newId); APPL_ERROR("Request a save As with a non existant ID=" << newId);
} else { } else {
@ -184,20 +148,20 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
SendMultiCast(ednMsgBufferState, "saved"); SendMultiCast(ednMsgBufferState, "saved");
} }
} }
} else if (eventId == ednMsgGuiClose) { } else if (_msg.GetMessage() == ednMsgGuiClose) {
if (data == "") { if (_msg.GetData() == "") {
APPL_ERROR("Null data for close file ... "); APPL_ERROR("Null data for close file ... ");
} else { } else {
if (data == "All") { if (_msg.GetData() == "All") {
} else { } else {
int32_t closeID = -1; int32_t closeID = -1;
if (data == "current") { if (_msg.GetData() == "current") {
closeID = m_idSelected; closeID = m_idSelected;
APPL_DEBUG("Close specific buffer ID" << closeID); APPL_DEBUG("Close specific buffer ID" << closeID);
} else { } else {
// close specific buffer ... // close specific buffer ...
sscanf(data.c_str(), "%d", &closeID); sscanf(_msg.GetData().c_str(), "%d", &closeID);
APPL_DEBUG("Close specific buffer ID="<< closeID); APPL_DEBUG("Close specific buffer ID="<< closeID);
} }
if(true == Exist(closeID)) { if(true == Exist(closeID)) {
@ -232,13 +196,13 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
} }
} }
} }
} else if (eventId == ednMsgCodeViewSelectedId) { } else if (_msg.GetMessage() == ednMsgCodeViewSelectedId) {
//Change the selected buffer //Change the selected buffer
if (data == "") { if (_msg.GetData() == "") {
APPL_ERROR("Null data for changing buffer ID file ... "); APPL_ERROR("Null data for changing buffer ID file ... ");
} else { } else {
int32_t newId; int32_t newId;
sscanf(data.c_str(), "%d", &newId); sscanf(_msg.GetData().c_str(), "%d", &newId);
if (true == Exist(newId)) { if (true == Exist(newId)) {
m_idSelected = newId; m_idSelected = newId;
} else { } else {

View File

@ -23,24 +23,11 @@ class classColorManager: public ewol::EObject
classColorManager(void); classColorManager(void);
~classColorManager(void); ~classColorManager(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void) const char * const GetObjectType(void)
{ {
return "ApplColorManager"; return "ApplColorManager";
} }
/** virtual void OnReceiveMessage(const ewol::EMessage& _msg);
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data);
public: public:
void LoadFile(etk::UString &xmlFilename); void LoadFile(etk::UString &xmlFilename);
void LoadFile(const char * xmlFilename); void LoadFile(const char * xmlFilename);
@ -80,7 +67,7 @@ classColorManager::~classColorManager(void)
listMyColor.Clear(); listMyColor.Clear();
} }
void classColorManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data) void classColorManager::OnReceiveMessage(const ewol::EMessage& _msg)
{ {
/* /*
switch (id) switch (id)

View File

@ -68,17 +68,10 @@ void BufferView::RemoveAllElement(void)
m_list.Clear(); m_list.Clear();
} }
/** void BufferView::OnReceiveMessage(const ewol::EMessage& _msg)
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void BufferView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data)
{ {
widget::List::OnReceiveMessage(CallerObject, eventId, data); widget::List::OnReceiveMessage(_msg);
if (eventId == ednMsgBufferListChange) { if (_msg.GetMessage() == ednMsgBufferListChange) {
// clean The list // clean The list
RemoveAllElement(); RemoveAllElement();
// Get all the buffer name and properties: // Get all the buffer name and properties:
@ -102,10 +95,10 @@ void BufferView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eve
SortElementList(m_list); SortElementList(m_list);
} }
MarkToRedraw(); MarkToRedraw();
}else if (eventId == ednMsgBufferId) { }else if (_msg.GetMessage() == ednMsgBufferId) {
m_selectedIdRequested = BufferManager::GetSelected(); m_selectedIdRequested = BufferManager::GetSelected();
MarkToRedraw(); MarkToRedraw();
}else if (eventId == ednMsgBufferState) { }else if (_msg.GetMessage() == ednMsgBufferState) {
// Update list of modify section ... // Update list of modify section ...
for (int32_t iii=0; iii<m_list.Size(); iii++) { for (int32_t iii=0; iii<m_list.Size(); iii++) {
if (NULL!=m_list[iii]) { if (NULL!=m_list[iii]) {

View File

@ -47,7 +47,7 @@ class BufferView : public widget::List
// Derived function // Derived function
const char * const GetObjectType(void) { return "ApplBufferView"; }; const char * const GetObjectType(void) { return "ApplBufferView"; };
// Derived function // Derived function
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data); virtual void OnReceiveMessage(const ewol::EMessage& _msg);
protected: protected:
// function call to display the list : // function call to display the list :
virtual draw::Color GetBasicBG(void); virtual draw::Color GetBasicBG(void);

View File

@ -113,11 +113,11 @@ void CodeView::CalculateMaxSize(void)
} }
void CodeView::OnDraw(ewol::DrawProperty& displayProp) void CodeView::OnDraw(void)
{ {
m_displayDrawing.Draw(); m_displayDrawing.Draw();
m_displayText.Draw(); m_displayText.Draw();
WidgetScrooled::OnDraw(displayProp); WidgetScrooled::OnDraw();
} }
void CodeView::OnRegenerateDisplay(void) void CodeView::OnRegenerateDisplay(void)
@ -318,19 +318,19 @@ bool CodeView::OnEventInput(const ewol::EventInput& _event)
return true; return true;
} }
void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data) void CodeView::OnReceiveMessage(const ewol::EMessage& _msg)
{ {
widget::WidgetScrooled::OnReceiveMessage(CallerObject, eventId, data); widget::WidgetScrooled::OnReceiveMessage(_msg);
APPL_DEBUG("Extern Event : " << CallerObject << " type : " << eventId << " data=\"" << data << "\""); APPL_DEBUG("Extern Event : " << _msg.GetCaller() << " type : " << _msg.GetMessage() << " data=\"" << _msg.GetData() << "\"");
if(eventId == ednMsgBufferId) { if(_msg.GetMessage() == ednMsgBufferId) {
//keep the reference of the display offset : //keep the reference of the display offset :
if( m_bufferID >=0 if( m_bufferID >=0
&& m_bufferID < m_lineNumberList.Size()) { && m_bufferID < m_lineNumberList.Size()) {
m_lineNumberList[m_bufferID] = m_originScrooled; m_lineNumberList[m_bufferID] = m_originScrooled;
} }
int32_t bufferID = 0; int32_t bufferID = 0;
sscanf(data.c_str(), "%d", &bufferID); sscanf(_msg.GetData().c_str(), "%d", &bufferID);
APPL_INFO("Select a new Buffer ... " << bufferID); APPL_INFO("Select a new Buffer ... " << bufferID);
// set the new buffer ID // set the new buffer ID
m_bufferID = bufferID; m_bufferID = bufferID;
@ -341,105 +341,105 @@ void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * event
&& m_bufferID < m_lineNumberList.Size()) { && m_bufferID < m_lineNumberList.Size()) {
m_originScrooled = m_lineNumberList[m_bufferID]; m_originScrooled = m_lineNumberList[m_bufferID];
} }
} else if (eventId == ednMsgGuiCopy) { } else if (_msg.GetMessage() == ednMsgGuiCopy) {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID); BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) { if (NULL!=tmpBuffer) {
tmpBuffer->Copy(ewol::clipBoard::clipboardStd); tmpBuffer->Copy(ewol::clipBoard::clipboardStd);
} }
} else if (eventId == ednMsgGuiCut) { } else if (_msg.GetMessage() == ednMsgGuiCut) {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID); BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) { if (NULL!=tmpBuffer) {
tmpBuffer->Cut(ewol::clipBoard::clipboardStd); tmpBuffer->Cut(ewol::clipBoard::clipboardStd);
} }
} else if (eventId == ednMsgGuiPaste) { } else if (_msg.GetMessage() == ednMsgGuiPaste) {
ewol::clipBoard::Request(ewol::clipBoard::clipboardStd); ewol::clipBoard::Request(ewol::clipBoard::clipboardStd);
} else if (eventId == ednMsgGuiUndo) { } else if (_msg.GetMessage() == ednMsgGuiUndo) {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID); BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) { if (NULL!=tmpBuffer) {
tmpBuffer->Undo(); tmpBuffer->Undo();
} }
} else if (eventId == ednMsgGuiRedo) { } else if (_msg.GetMessage() == ednMsgGuiRedo) {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID); BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) { if (NULL!=tmpBuffer) {
tmpBuffer->Redo(); tmpBuffer->Redo();
} }
} else if (eventId == ednMsgGuiRm) { } else if (_msg.GetMessage() == ednMsgGuiRm) {
// data : "Word" "Line" "Paragraph" // data : "Word" "Line" "Paragraph"
if (data == "Word") { if (_msg.GetData() == "Word") {
APPL_WARNING(" on event " << eventId << " data=\"" << data << "\" ==> not coded" ); APPL_WARNING(" on event " << _msg.GetMessage() << " data=\"" << _msg.GetData() << "\" ==> not coded" );
} else if (data == "Line") { } else if (_msg.GetData() == "Line") {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID); BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) { if (NULL!=tmpBuffer) {
tmpBuffer->RemoveLine(); tmpBuffer->RemoveLine();
} }
} else if (data == "Paragraph") { } else if (_msg.GetData() == "Paragraph") {
APPL_WARNING(" on event " << eventId << " data=\"" << data << "\" ==> not coded" ); APPL_WARNING(" on event " << _msg.GetMessage() << " data=\"" << _msg.GetData() << "\" ==> not coded" );
} else { } else {
APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" ); APPL_ERROR(" on event " << _msg.GetMessage() << " unknow data=\"" << _msg.GetData() << "\"" );
} }
} else if (eventId == ednMsgGuiSelect) { } else if (_msg.GetMessage() == ednMsgGuiSelect) {
// data : "ALL" "NONE" // data : "ALL" "NONE"
if (data == "ALL") { if (_msg.GetData() == "ALL") {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID); BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) { if (NULL!=tmpBuffer) {
tmpBuffer->SelectAll(); tmpBuffer->SelectAll();
} }
} else if (data == "NONE") { } else if (_msg.GetData() == "NONE") {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID); BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) { if (NULL!=tmpBuffer) {
tmpBuffer->SelectNone(); tmpBuffer->SelectNone();
} }
} else { } else {
APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" ); APPL_ERROR(" on event " << _msg.GetMessage() << " unknow data=\"" << _msg.GetData() << "\"" );
} }
} else if (eventId == ednMsgGuiChangeCharset) { } else if (_msg.GetMessage() == ednMsgGuiChangeCharset) {
// data : "UTF-8" "ISO-8859-1" "ISO-8859-15" // data : "UTF-8" "ISO-8859-1" "ISO-8859-15"
if (data == "UTF-8") { if (_msg.GetData() == "UTF-8") {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID); BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) { if (NULL!=tmpBuffer) {
tmpBuffer->SetCharset(unicode::EDN_CHARSET_UTF8); tmpBuffer->SetCharset(unicode::EDN_CHARSET_UTF8);
} }
} else if (data == "ISO-8859-1") { } else if (_msg.GetData() == "ISO-8859-1") {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID); BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) { if (NULL!=tmpBuffer) {
tmpBuffer->SetCharset(unicode::EDN_CHARSET_ISO_8859_1); tmpBuffer->SetCharset(unicode::EDN_CHARSET_ISO_8859_1);
} }
} else if (data == "ISO-8859-15") { } else if (_msg.GetData() == "ISO-8859-15") {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID); BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) { if (NULL!=tmpBuffer) {
tmpBuffer->SetCharset(unicode::EDN_CHARSET_ISO_8859_15); tmpBuffer->SetCharset(unicode::EDN_CHARSET_ISO_8859_15);
} }
} else { } else {
APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" ); APPL_ERROR(" on event " << _msg.GetMessage() << " unknow data=\"" << _msg.GetData() << "\"" );
} }
} else if (eventId == ednMsgGuiFind) { } else if (_msg.GetMessage() == ednMsgGuiFind) {
etk::UString myDataString; etk::UString myDataString;
SearchData::GetSearch(myDataString); SearchData::GetSearch(myDataString);
if (data == "Next") { if (_msg.GetData() == "Next") {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID); BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) { if (NULL!=tmpBuffer) {
tmpBuffer->Search(myDataString, false, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() ); tmpBuffer->Search(myDataString, false, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
} }
} else if (data == "Previous") { } else if (_msg.GetData() == "Previous") {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID); BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) { if (NULL!=tmpBuffer) {
tmpBuffer->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() ); tmpBuffer->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
} }
} }
} else if (eventId == ednMsgGuiReplace) { } else if (_msg.GetMessage() == ednMsgGuiReplace) {
etk::UString myDataString; etk::UString myDataString;
SearchData::GetReplace(myDataString); SearchData::GetReplace(myDataString);
if (data == "Normal") { if (_msg.GetData() == "Normal") {
BufferText* tmpBuffer = BufferManager::Get(m_bufferID); BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) { if (NULL!=tmpBuffer) {
tmpBuffer->Replace(myDataString); tmpBuffer->Replace(myDataString);
} }
} else if (data == "All") { } else if (_msg.GetData() == "All") {
} }
} else if (eventId == ednMsgGuiGotoLine) { } else if (_msg.GetMessage() == ednMsgGuiGotoLine) {
int32_t lineID = 0; int32_t lineID = 0;
sscanf(data.c_str(), "%d", &lineID); sscanf(_msg.GetData().c_str(), "%d", &lineID);
APPL_INFO("Goto line : " << lineID); APPL_INFO("Goto line : " << lineID);
BufferText* tmpBuffer = BufferManager::Get(m_bufferID); BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) { if (NULL!=tmpBuffer) {

View File

@ -25,36 +25,34 @@ class CodeView :public widget::WidgetScrooled
CodeView(etk::UString fontName, int32_t fontSize); CodeView(etk::UString fontName, int32_t fontSize);
CodeView(void); CodeView(void);
virtual ~CodeView(void); virtual ~CodeView(void);
// Derived function
const char * const GetObjectType(void) { return "ApplCodeView"; };
// Derived function
virtual bool CalculateMinSize(void);
private: private:
etk::UString m_label; etk::UString m_label;
draw::Color m_textColorFg; //!< Text color draw::Color m_textColorFg; //!< Text color
draw::Color m_textColorBg; //!< Background color draw::Color m_textColorBg; //!< Background color
int32_t m_bufferID; int32_t m_bufferID;
bool m_buttunOneSelected; bool m_buttunOneSelected;
etk::Vector<vec2 > m_lineNumberList; etk::Vector<vec2 > m_lineNumberList;
void UpdateNumberOfLineReference(int32_t bufferID); void UpdateNumberOfLineReference(int32_t bufferID);
// drawing elements : // drawing elements :
ewol::Text m_displayText; ewol::Text m_displayText;
ewol::Drawing m_displayDrawing; ewol::Drawing m_displayDrawing;
public: // Derived function
virtual void OnRegenerateDisplay(void);
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data);
virtual bool OnEventInput(const ewol::EventInput& _event);
virtual bool OnEventEntry(const ewol::EventEntry& _event);
virtual void OnEventClipboard(ewol::clipBoard::clipboardListe_te clipboardID);
virtual void OnGetFocus(void);
virtual void OnLostFocus(void);
public: public:
void SetFontSize(int32_t size); void SetFontSize(int32_t size);
void SetFontName(etk::UString fontName); void SetFontName(etk::UString fontName);
private: private:
void CalculateMaxSize(void); void CalculateMaxSize(void);
protected: protected: // derived function
virtual void OnDraw(ewol::DrawProperty& displayProp); virtual void OnDraw(void);
public: // Derived function
const char * const GetObjectType(void) { return "ApplCodeView"; };
virtual bool CalculateMinSize(void);
virtual void OnRegenerateDisplay(void);
virtual void OnReceiveMessage(const ewol::EMessage& _msg);
virtual bool OnEventInput(const ewol::EventInput& _event);
virtual bool OnEventEntry(const ewol::EventEntry& _event);
virtual void OnEventClipboard(ewol::clipBoard::clipboardListe_te clipboardID);
virtual void OnGetFocus(void);
virtual void OnLostFocus(void);
}; };
#endif #endif

View File

@ -253,13 +253,13 @@ const char *const ednEventPopUpFileSelected = "edn-mainWindows-openSelected";
const char *const ednEventPopUpFileSaveAs = "edn-mainWindows-saveAsSelected"; const char *const ednEventPopUpFileSaveAs = "edn-mainWindows-saveAsSelected";
void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data) void MainWindows::OnReceiveMessage(const ewol::EMessage& _msg)
{ {
ewol::Windows::OnReceiveMessage(CallerObject, eventId, data); ewol::Windows::OnReceiveMessage(_msg);
//APPL_INFO("Receive Event from the main windows ... : \"" << eventId << "\" ==> data=\"" << data << "\"" ); //APPL_INFO("Receive Event from the main windows ... : \"" << eventId << "\" ==> data=\"" << data << "\"" );
// Open file Section ... // Open file Section ...
if (eventId == ednMsgGuiOpen) { if (_msg.GetMessage() == ednMsgGuiOpen) {
widget::FileChooser* tmpWidget = new widget::FileChooser(); widget::FileChooser* tmpWidget = new widget::FileChooser();
tmpWidget->SetTitle("Open Files ..."); tmpWidget->SetTitle("Open Files ...");
tmpWidget->SetValidateLabel("Open"); tmpWidget->SetValidateLabel("Open");
@ -272,18 +272,18 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
} }
PopUpWidgetPush(tmpWidget); PopUpWidgetPush(tmpWidget);
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected); tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected);
} else if (eventId == ednEventPopUpFileSelected) { } else if (_msg.GetMessage() == ednEventPopUpFileSelected) {
APPL_DEBUG("Request opening the file : " << data); APPL_DEBUG("Request opening the file : " << _msg.GetData());
SendMultiCast(ednMsgOpenFile, data); SendMultiCast(ednMsgOpenFile, _msg.GetData());
} else if (eventId == ednMsgGuiSaveAs) { } else if (_msg.GetMessage() == ednMsgGuiSaveAs) {
if (data == "") { if (_msg.GetData() == "") {
APPL_ERROR("Null data for Save As file ... "); APPL_ERROR("Null data for Save As file ... ");
} else { } else {
m_currentSavingAsIdBuffer = -1; m_currentSavingAsIdBuffer = -1;
if (data == "current") { if (_msg.GetData() == "current") {
m_currentSavingAsIdBuffer = BufferManager::GetSelected(); m_currentSavingAsIdBuffer = BufferManager::GetSelected();
} else { } else {
sscanf(data.c_str(), "%d", &m_currentSavingAsIdBuffer); sscanf(_msg.GetData().c_str(), "%d", &m_currentSavingAsIdBuffer);
} }
if (false == BufferManager::Exist(m_currentSavingAsIdBuffer)) { if (false == BufferManager::Exist(m_currentSavingAsIdBuffer)) {
@ -310,15 +310,15 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
} }
} }
} }
} else if (eventId == ednEventPopUpFileSaveAs) { } else if (_msg.GetMessage() == ednEventPopUpFileSaveAs) {
// get the filename : // get the filename :
etk::UString tmpData = data; etk::UString tmpData = _msg.GetData();
APPL_DEBUG("Request Saving As file : " << tmpData); APPL_DEBUG("Request Saving As file : " << tmpData);
BufferManager::Get(m_currentSavingAsIdBuffer)->SetFileName(tmpData); BufferManager::Get(m_currentSavingAsIdBuffer)->SetFileName(tmpData);
SendMultiCast(ednMsgGuiSave, m_currentSavingAsIdBuffer); SendMultiCast(ednMsgGuiSave, m_currentSavingAsIdBuffer);
} else if( eventId == ednMsgBufferState } else if( _msg.GetMessage() == ednMsgBufferState
|| eventId == ednMsgBufferId) { || _msg.GetMessage() == ednMsgBufferId) {
// the buffer change we need to update the widget string // the buffer change we need to update the widget string
BufferText* tmpBuffer = BufferManager::Get(BufferManager::GetSelected()); BufferText* tmpBuffer = BufferManager::Get(BufferManager::GetSelected());
if (NULL != tmpBuffer) { if (NULL != tmpBuffer) {
@ -341,7 +341,7 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
} }
return; return;
// TODO : Set the Title .... // TODO : Set the Title ....
} else if (eventId == ednMsgProperties) { } else if (_msg.GetMessage() == ednMsgProperties) {
// Request the parameter GUI // Request the parameter GUI
widget::Parameter* tmpWidget = new widget::Parameter(); widget::Parameter* tmpWidget = new widget::Parameter();
if (NULL == tmpWidget) { if (NULL == tmpWidget) {
@ -359,7 +359,7 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
tmpSubWidget = new ParameterAboutGui(); tmpSubWidget = new ParameterAboutGui();
tmpWidget->MenuAdd("About", "", tmpSubWidget); tmpWidget->MenuAdd("About", "", tmpSubWidget);
} }
} else if (eventId == ednMsgGuiReloadShader) { } else if (_msg.GetMessage() == ednMsgGuiReloadShader) {
ewol::resource::ReLoadResources(); ewol::resource::ReLoadResources();
ewol::ForceRedrawAll(); ewol::ForceRedrawAll();
} }
@ -367,10 +367,10 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
return; return;
} }
void MainWindows::OnObjectRemove(ewol::EObject * removeObject) void MainWindows::OnObjectRemove(ewol::EObject * _removeObject)
{ {
ewol::Windows::OnObjectRemove(removeObject); ewol::Windows::OnObjectRemove(_removeObject);
if (m_widgetLabelFileName == removeObject) { if (m_widgetLabelFileName == _removeObject) {
m_widgetLabelFileName = NULL; m_widgetLabelFileName = NULL;
} }
} }

View File

@ -26,12 +26,10 @@ class MainWindows : public ewol::Windows
// Constructeur // Constructeur
MainWindows(void); MainWindows(void);
~MainWindows(void); ~MainWindows(void);
// Derived function public: // Derived function
const char * const GetObjectType(void) { return "MainWindows"; }; virtual const char * const GetObjectType(void) { return "MainWindows"; };
// Derived function virtual void OnReceiveMessage(const ewol::EMessage& _msg);
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data); virtual void OnObjectRemove(ewol::EObject * _removeObject);
// Derived function
virtual void OnObjectRemove(ewol::EObject * removeObject);
}; };
#define EDN_CAST_MAIN_WINDOWS(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_MAIN_WINDOWS,MainWindows,curentPointer) #define EDN_CAST_MAIN_WINDOWS(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_MAIN_WINDOWS,MainWindows,curentPointer)

View File

@ -191,63 +191,63 @@ Search::~Search(void)
} }
void Search::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data) void Search::OnReceiveMessage(const ewol::EMessage& _msg)
{ {
widget::Sizer::OnReceiveMessage(CallerObject, eventId, data); widget::Sizer::OnReceiveMessage(_msg);
//APPL_INFO("Search receive message : \"" << eventId << "\" data=\"" << data << "\""); //APPL_INFO("Search receive message : \"" << eventId << "\" data=\"" << data << "\"");
if ( eventId == l_eventSearchEntry) { if ( _msg.GetMessage() == l_eventSearchEntry) {
SearchData::SetSearch(data); SearchData::SetSearch(_msg.GetData());
} else if ( eventId == l_eventSearchEntryEnter) { } else if ( _msg.GetMessage() == l_eventSearchEntryEnter) {
SearchData::SetSearch(data); SearchData::SetSearch(_msg.GetData());
if (true==m_forward) { if (true==m_forward) {
SendMultiCast(ednMsgGuiFind, "Previous"); SendMultiCast(ednMsgGuiFind, "Previous");
} else { } else {
SendMultiCast(ednMsgGuiFind, "Next"); SendMultiCast(ednMsgGuiFind, "Next");
} }
} else if ( eventId == l_eventReplaceEntry) { } else if ( _msg.GetMessage() == l_eventReplaceEntry) {
SearchData::SetReplace(data); SearchData::SetReplace(_msg.GetData());
} else if ( eventId == l_eventReplaceEntryEnter) { } else if ( _msg.GetMessage() == l_eventReplaceEntryEnter) {
SearchData::SetReplace(data); SearchData::SetReplace(_msg.GetData());
SendMultiCast(ednMsgGuiReplace, "Normal"); SendMultiCast(ednMsgGuiReplace, "Normal");
if (true==m_forward) { if (true==m_forward) {
SendMultiCast(ednMsgGuiFind, "Previous"); SendMultiCast(ednMsgGuiFind, "Previous");
} else { } else {
SendMultiCast(ednMsgGuiFind, "Next"); SendMultiCast(ednMsgGuiFind, "Next");
} }
} else if ( eventId == l_eventSearchBt) { } else if ( _msg.GetMessage() == l_eventSearchBt) {
if (true==m_forward) { if (true==m_forward) {
SendMultiCast(ednMsgGuiFind, "Previous"); SendMultiCast(ednMsgGuiFind, "Previous");
} else { } else {
SendMultiCast(ednMsgGuiFind, "Next"); SendMultiCast(ednMsgGuiFind, "Next");
} }
} else if ( eventId == l_eventReplaceBt) { } else if ( _msg.GetMessage() == l_eventReplaceBt) {
SendMultiCast(ednMsgGuiReplace, "Normal"); SendMultiCast(ednMsgGuiReplace, "Normal");
if (true==m_forward) { if (true==m_forward) {
SendMultiCast(ednMsgGuiFind, "Previous"); SendMultiCast(ednMsgGuiFind, "Previous");
} else { } else {
SendMultiCast(ednMsgGuiFind, "Next"); SendMultiCast(ednMsgGuiFind, "Next");
} }
} else if ( eventId == l_eventCaseCb) { } else if ( _msg.GetMessage() == l_eventCaseCb) {
if (data == "1") { if (_msg.GetData() == "1") {
SearchData::SetCase(false); SearchData::SetCase(false);
} else { } else {
SearchData::SetCase(true); SearchData::SetCase(true);
} }
} else if ( eventId == l_eventWrapCb) { } else if ( _msg.GetMessage() == l_eventWrapCb) {
if (data == "1") { if (_msg.GetData() == "1") {
SearchData::SetWrap(false); SearchData::SetWrap(false);
} else { } else {
SearchData::SetWrap(true); SearchData::SetWrap(true);
} }
} else if ( eventId == l_eventForwardCb) { } else if ( _msg.GetMessage() == l_eventForwardCb) {
if (data == "1") { if (_msg.GetData() == "1") {
m_forward = false; m_forward = false;
} else { } else {
m_forward = true; m_forward = true;
} }
} else if ( eventId == l_eventHideBt) { } else if ( _msg.GetMessage() == l_eventHideBt) {
Hide(); Hide();
} else if ( eventId == ednMsgGuiSearch) { } else if ( _msg.GetMessage() == ednMsgGuiSearch) {
if (true == IsHide()) { if (true == IsHide()) {
Show(); Show();
if (m_searchEntry!= NULL) { if (m_searchEntry!= NULL) {
@ -266,13 +266,13 @@ void Search::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId
} }
} }
void Search::OnObjectRemove(ewol::EObject * removeObject) void Search::OnObjectRemove(ewol::EObject * _removeObject)
{ {
widget::Sizer::OnObjectRemove(removeObject); widget::Sizer::OnObjectRemove(_removeObject);
if (removeObject == m_searchEntry) { if (_removeObject == m_searchEntry) {
m_searchEntry = NULL; m_searchEntry = NULL;
} }
if (removeObject == m_replaceEntry) { if (_removeObject == m_replaceEntry) {
m_replaceEntry = NULL; m_replaceEntry = NULL;
} }
} }

View File

@ -15,20 +15,18 @@
class Search : public widget::Sizer class Search : public widget::Sizer
{ {
public:
// Constructeur
Search(void);
~Search(void);
// herited function
const char * const GetObjectType(void) { return "ApplSearch"; };
// herited function
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data);
// herited function
virtual void OnObjectRemove(ewol::EObject * removeObject);
private: private:
bool m_forward; bool m_forward;
widget::Entry * m_searchEntry; widget::Entry * m_searchEntry;
widget::Entry * m_replaceEntry; widget::Entry * m_replaceEntry;
public:
// Constructeur
Search(void);
~Search(void);
public: // derived function
virtual const char * const GetObjectType(void) { return "ApplSearch"; };
virtual void OnReceiveMessage(const ewol::EMessage& _msg);
virtual void OnObjectRemove(ewol::EObject * _removeObject);
}; };
#endif #endif

View File

@ -40,7 +40,7 @@ namespace appl {
uint32_t GetNuberOfRaw(void); uint32_t GetNuberOfRaw(void);
bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg); bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg);
bool OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEvent, int32_t colomn, int32_t raw, float x, float y); bool OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEvent, int32_t colomn, int32_t raw, float x, float y);
// herited function // derived function
const char * const GetObjectType(void) { return "TagFileList"; }; const char * const GetObjectType(void) { return "TagFileList"; };
public: public:
/** /**

View File

@ -129,25 +129,25 @@ appl::TagFileSelection::~TagFileSelection(void)
} }
void appl::TagFileSelection::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data) void appl::TagFileSelection::OnReceiveMessage(const ewol::EMessage& _msg)
{ {
EWOL_INFO("ctags LIST ... : \"" << eventId << "\" ==> data=\"" << data << "\"" ); EWOL_INFO("ctags LIST ... : \"" << _msg.GetMessage() << "\" ==> data=\"" << _msg.GetData() << "\"" );
if (eventId == applEventctagsSelection) { if (_msg.GetMessage() == applEventctagsSelection) {
if (m_eventNamed!="") { if (m_eventNamed!="") {
GenerateEventId(applEventctagsSelection, m_eventNamed); GenerateEventId(applEventctagsSelection, m_eventNamed);
//==> Auto remove ... //==> Auto remove ...
AutoDestroy(); AutoDestroy();
} }
} else if (eventId == applEventCtagsListSelect) { } else if (_msg.GetMessage() == applEventCtagsListSelect) {
m_eventNamed = data; m_eventNamed = _msg.GetData();
} else if (eventId == applEventCtagsListUnSelect) { } else if (_msg.GetMessage() == applEventCtagsListUnSelect) {
m_eventNamed = ""; m_eventNamed = "";
} else if (eventId == applEventCtagsListValidate) { } else if (_msg.GetMessage() == applEventCtagsListValidate) {
GenerateEventId(applEventctagsSelection, data); GenerateEventId(applEventctagsSelection, _msg.GetData());
//==> Auto remove ... //==> Auto remove ...
AutoDestroy(); AutoDestroy();
} else if (eventId == applEventctagsCancel) { } else if (_msg.GetMessage() == applEventctagsCancel) {
GenerateEventId(applEventctagsCancel, ""); GenerateEventId(applEventctagsCancel, "");
//==> Auto remove ... //==> Auto remove ...
AutoDestroy(); AutoDestroy();
@ -168,12 +168,12 @@ void appl::TagFileSelection::AddCtagsNewItem(etk::UString file, int32_t line)
} }
} }
void appl::TagFileSelection::OnObjectRemove(ewol::EObject * removeObject) void appl::TagFileSelection::OnObjectRemove(ewol::EObject * _removeObject)
{ {
// First step call parrent : // First step call parrent :
widget::PopUp::OnObjectRemove(m_listTag); widget::PopUp::OnObjectRemove(_removeObject);
// second step find if in all the elements ... // second step find if in all the elements ...
if(removeObject == m_listTag) { if(_removeObject == m_listTag) {
m_listTag = NULL; m_listTag = NULL;
} }
} }

View File

@ -25,19 +25,16 @@ namespace appl {
public: public:
TagFileSelection(void); TagFileSelection(void);
virtual ~TagFileSelection(void); virtual ~TagFileSelection(void);
// herited function
const char * const GetObjectType(void) { return "EwolFileChooser"; };
// herited function
void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data);
// herited function
void OnObjectRemove(ewol::EObject * removeObject);
/** /**
* @brief Add a Ctags item on the curent list * @brief Add a Ctags item on the curent list
* @param[in] file Compleate file name * @param[in] file Compleate file name
* @param[in] jump line id * @param[in] jump line id
*/ */
void AddCtagsNewItem(etk::UString file, int32_t line); void AddCtagsNewItem(etk::UString file, int32_t line);
public: // herited function
const char * const GetObjectType(void) { return "EwolFileChooser"; };
void OnReceiveMessage(const ewol::EMessage& _msg);
void OnObjectRemove(ewol::EObject * _removeObject);
}; };
}; };

View File

@ -44,7 +44,7 @@ class localClassHighlightManager: public ewol::EObject
} }
// herited function // herited function
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data) virtual void OnReceiveMessage(const ewol::EMessage& _msg)
{ {
/* /*
switch (id) switch (id)

View File

@ -26,24 +26,11 @@ class CTagsManager: public ewol::EObject
CTagsManager(void); CTagsManager(void);
~CTagsManager(void); ~CTagsManager(void);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void) const char * const GetObjectType(void)
{ {
return "CTagsManager"; return "CTagsManager";
}; };
/** void OnReceiveMessage(const ewol::EMessage& _msg);
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data);
int32_t m_currentSelectedID; int32_t m_currentSelectedID;
void LoadTagFile(void); void LoadTagFile(void);
@ -125,21 +112,21 @@ CTagsManager::~CTagsManager(void)
const char * ednEventPopUpCtagsLoadFile = "edn-event-load-ctags"; const char * ednEventPopUpCtagsLoadFile = "edn-event-load-ctags";
void CTagsManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data) void CTagsManager::OnReceiveMessage(const ewol::EMessage& _msg)
{ {
//EWOL_INFO("ctags manager event ... : \"" << eventId << "\" ==> data=\"" << data << "\"" ); //EWOL_INFO("ctags manager event ... : \"" << eventId << "\" ==> data=\"" << data << "\"" );
if (eventId == ednMsgBufferId) { if (_msg.GetMessage() == ednMsgBufferId) {
//m_currentSelectedID = dataID; //m_currentSelectedID = dataID;
} else if( eventId == ednEventPopUpCtagsLoadFile } else if( _msg.GetMessage() == ednEventPopUpCtagsLoadFile
|| eventId == ednMsgCtagsLoadFile) { || _msg.GetMessage() == ednMsgCtagsLoadFile) {
// open the new one : // open the new one :
etk::FSNode tmpFilename = data; etk::FSNode tmpFilename = _msg.GetData();
m_tagFilename = tmpFilename.GetNameFile(); m_tagFilename = tmpFilename.GetNameFile();
m_tagFolderBase = tmpFilename.GetNameFolder(); m_tagFolderBase = tmpFilename.GetNameFolder();
APPL_DEBUG("Receive load Ctags file : " << m_tagFolderBase << "/" << m_tagFilename << " "); APPL_DEBUG("Receive load Ctags file : " << m_tagFolderBase << "/" << m_tagFilename << " ");
LoadTagFile(); LoadTagFile();
} else if (eventId == ednMsgGuiCtags) { } else if (_msg.GetMessage() == ednMsgGuiCtags) {
if (data == "Load") { if (_msg.GetData() == "Load") {
APPL_INFO("Request opening ctag file"); APPL_INFO("Request opening ctag file");
widget::FileChooser* tmpWidget = new widget::FileChooser(); widget::FileChooser* tmpWidget = new widget::FileChooser();
if (NULL == tmpWidget) { if (NULL == tmpWidget) {
@ -150,12 +137,12 @@ void CTagsManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * e
ewol::WindowsPopUpAdd(tmpWidget); ewol::WindowsPopUpAdd(tmpWidget);
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpCtagsLoadFile); tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpCtagsLoadFile);
} }
} else if (data == "ReLoad") { } else if (_msg.GetData() == "ReLoad") {
APPL_INFO("Request re-load ctag file"); APPL_INFO("Request re-load ctag file");
LoadTagFile(); LoadTagFile();
} else if (data == "Jump") { } else if (_msg.GetData() == "Jump") {
JumpTo(); JumpTo();
} else if (data == "Back") { } else if (_msg.GetData() == "Back") {
if (m_historyList.Size() > 0) { if (m_historyList.Size() > 0) {
int32_t id = m_historyList.Size()-1; int32_t id = m_historyList.Size()-1;
SendMultiCast(ednMsgOpenFile, m_historyList[id]->GetName() ); SendMultiCast(ednMsgOpenFile, m_historyList[id]->GetName() );
@ -168,13 +155,13 @@ void CTagsManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * e
} else { } else {
} }
} else if (eventId == applEventctagsSelection) { } else if (_msg.GetMessage() == applEventctagsSelection) {
// save the current file in the history // save the current file in the history
RegisterHistory(); RegisterHistory();
// parse the input data // parse the input data
char tmp[4096]; char tmp[4096];
int32_t lineID; int32_t lineID;
sscanf(data.c_str(), "%d:%s", &lineID, tmp); sscanf(_msg.GetData().c_str(), "%d:%s", &lineID, tmp);
// generate envents // generate envents
SendMultiCast(ednMsgOpenFile, tmp); SendMultiCast(ednMsgOpenFile, tmp);
SendMultiCast(ednMsgGuiGotoLine, lineID - 1); SendMultiCast(ednMsgGuiGotoLine, lineID - 1);

View File

@ -179,36 +179,36 @@ globals::ParameterGlobalsGui::~ParameterGlobalsGui(void)
} }
void globals::ParameterGlobalsGui::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data) void globals::ParameterGlobalsGui::OnReceiveMessage(const ewol::EMessage& _msg)
{ {
widget::Sizer::OnReceiveMessage(CallerObject, eventId, data); widget::Sizer::OnReceiveMessage(_msg);
if (eventId == l_changeEndOfLine) { if (_msg.GetMessage() == l_changeEndOfLine) {
if (data == "true") { if (_msg.GetData() == "true") {
SetDisplayEndOfLine(true); SetDisplayEndOfLine(true);
} else { } else {
SetDisplayEndOfLine(false); SetDisplayEndOfLine(false);
} }
} else if (eventId == l_changeIndentation) { } else if (_msg.GetMessage() == l_changeIndentation) {
if (data == "true") { if (_msg.GetData() == "true") {
SetAutoIndent(true); SetAutoIndent(true);
} else { } else {
SetAutoIndent(false); SetAutoIndent(false);
} }
} else if (eventId == l_changeSpace) { } else if (_msg.GetMessage() == l_changeSpace) {
if (data == "true") { if (_msg.GetData() == "true") {
SetDisplaySpaceChar(true); SetDisplaySpaceChar(true);
} else { } else {
SetDisplaySpaceChar(false); SetDisplaySpaceChar(false);
} }
} else if (eventId == l_changeTabulation) { } else if (_msg.GetMessage() == l_changeTabulation) {
if (data == "true") { if (_msg.GetData() == "true") {
SetDisplayTabChar(true); SetDisplayTabChar(true);
} else { } else {
SetDisplayTabChar(false); SetDisplayTabChar(false);
} }
} else if (eventId == l_changeRounded) { } else if (_msg.GetMessage() == l_changeRounded) {
if (data == "true") { if (_msg.GetData() == "true") {
etk::theme::SetName("GUI", "rounded");; etk::theme::SetName("GUI", "rounded");;
} else { } else {
etk::theme::SetName("GUI", "default");; etk::theme::SetName("GUI", "default");;

View File

@ -41,7 +41,7 @@ namespace globals
ParameterGlobalsGui(void); ParameterGlobalsGui(void);
~ParameterGlobalsGui(void); ~ParameterGlobalsGui(void);
// herited function // herited function
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, const etk::UString& data); virtual void OnReceiveMessage(const ewol::EMessage& _msg);
}; };
} }