Rework of EWOL (Step 3)
This commit is contained in:
parent
ae113a8a2f
commit
f6f8679b76
@ -28,12 +28,12 @@
|
|||||||
#include <tools_globals.h>
|
#include <tools_globals.h>
|
||||||
#include <BufferManager.h>
|
#include <BufferManager.h>
|
||||||
#include <ewol/EObject.h>
|
#include <ewol/EObject.h>
|
||||||
#include <ewol/WidgetManager.h>
|
#include <ewol/EObjectManager.h>
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "classBufferManager"
|
#define __class__ "classBufferManager"
|
||||||
|
|
||||||
class classBufferManager: public ewol::Widget
|
class classBufferManager: public ewol::EObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructeur
|
// Constructeur
|
||||||
@ -41,7 +41,14 @@ class classBufferManager: public ewol::Widget
|
|||||||
~classBufferManager(void);
|
~classBufferManager(void);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
/**
|
||||||
|
* @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, 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
|
||||||
@ -87,14 +94,12 @@ classBufferManager::classBufferManager(void)
|
|||||||
// nothing to do ...
|
// nothing to do ...
|
||||||
BufferNotExiste = new BufferEmpty();
|
BufferNotExiste = new BufferEmpty();
|
||||||
m_idSelected = -1;
|
m_idSelected = -1;
|
||||||
/*
|
RegisterMultiCast(ednMsgGuiNew);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiNew);
|
RegisterMultiCast(ednMsgOpenFile);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgOpenFile);
|
RegisterMultiCast(ednMsgGuiClose);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiClose);
|
RegisterMultiCast(ednMsgGuiSave);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiSave);
|
RegisterMultiCast(ednMsgCodeViewSelectedId);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgCodeViewSelectedId);
|
RegisterMultiCast(ednMsgBufferId);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferId);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -118,15 +123,24 @@ classBufferManager::~classBufferManager(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool classBufferManager::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y)
|
/**
|
||||||
|
* @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, etk::UString data)
|
||||||
{
|
{
|
||||||
if (generateEventId == ednMsgBufferId) {
|
ewol::EObject::OnReceiveMessage(CallerObject, eventId, data);
|
||||||
|
|
||||||
|
if (eventId == ednMsgBufferId) {
|
||||||
// select a new buffer ID :
|
// select a new buffer ID :
|
||||||
if (NULL == data) {
|
if (data == "") {
|
||||||
EDN_ERROR("Request select buffer ID = NULL ????");
|
EDN_ERROR("Request select buffer ID = \"\" ");
|
||||||
} else {
|
} else {
|
||||||
int32_t newID = -1;
|
int32_t newID = -1;
|
||||||
sscanf(data, "%d", &newID);
|
sscanf(data.Utf8Data(), "%d", &newID);
|
||||||
if(true == Exist(newID)) {
|
if(true == Exist(newID)) {
|
||||||
m_idSelected = newID;
|
m_idSelected = newID;
|
||||||
} else {
|
} else {
|
||||||
@ -134,74 +148,67 @@ bool classBufferManager::OnEventAreaExternal(int32_t widgetID, const char * gene
|
|||||||
EDN_ERROR("Request a non existant ID : " << newID << " reset to -1...");
|
EDN_ERROR("Request a non existant ID : " << newID << " reset to -1...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (generateEventId == ednMsgGuiNew) {
|
} else if (eventId == ednMsgGuiNew) {
|
||||||
/*
|
|
||||||
int32_t newOne = Create();
|
int32_t newOne = Create();
|
||||||
if (-1 != newOne) {
|
if (-1 != newOne) {
|
||||||
m_idSelected = newOne;
|
m_idSelected = newOne;
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_idSelected);
|
SendMultiCast(ednMsgBufferId, m_idSelected);
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferListChange);
|
SendMultiCast(ednMsgBufferListChange);
|
||||||
}
|
}
|
||||||
*/
|
} else if (eventId == ednMsgOpenFile) {
|
||||||
} else if (generateEventId == ednMsgOpenFile) {
|
if (data != "" ) {
|
||||||
/*
|
|
||||||
if (NULL != data) {
|
|
||||||
etk::File myFile(data, etk::FILE_TYPE_DIRECT);
|
etk::File myFile(data, etk::FILE_TYPE_DIRECT);
|
||||||
int32_t newOne = Open(myFile);
|
int32_t newOne = Open(myFile);
|
||||||
if (-1 != newOne) {
|
if (-1 != newOne) {
|
||||||
m_idSelected = newOne;
|
m_idSelected = newOne;
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_idSelected);
|
SendMultiCast(ednMsgBufferId, m_idSelected);
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferListChange);
|
SendMultiCast(ednMsgBufferListChange);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
} else if (eventId == ednMsgGuiSave) {
|
||||||
} else if (generateEventId == ednMsgGuiSave) {
|
if (data == "") {
|
||||||
/*
|
|
||||||
if (NULL == data) {
|
|
||||||
EDN_ERROR("Null data for close file ... ");
|
EDN_ERROR("Null data for close file ... ");
|
||||||
} else {
|
} else {
|
||||||
if (0 == strcmp(data , "current")) {
|
if (data == "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 ...
|
||||||
if (Get(m_idSelected)->HaveName() == false) {
|
if (Get(m_idSelected)->HaveName() == false) {
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgGuiSaveAs, "current");
|
SendMultiCast(ednMsgGuiSaveAs, "current");
|
||||||
} else {
|
} else {
|
||||||
Get(m_idSelected)->Save();
|
Get(m_idSelected)->Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int32_t newId;
|
int32_t newId;
|
||||||
sscanf(data, "%d", &newId);
|
sscanf(data.Utf8Data(), "%d", &newId);
|
||||||
if (false == Exist(newId)) {
|
if (false == Exist(newId)) {
|
||||||
EDN_ERROR("Request a save As with a non existant ID=" << newId);
|
EDN_ERROR("Request a save As with a non existant ID=" << newId);
|
||||||
} else {
|
} else {
|
||||||
// If no name ==> request a Gui display ...
|
// If no name ==> request a Gui display ...
|
||||||
if (Get(newId)->HaveName() == false) {
|
if (Get(newId)->HaveName() == false) {
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgGuiSaveAs, newId);
|
SendMultiCast(ednMsgGuiSaveAs, newId);
|
||||||
} else {
|
} else {
|
||||||
Get(m_idSelected)->Save();
|
Get(m_idSelected)->Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferState, "saved");
|
SendMultiCast(ednMsgBufferState, "saved");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
} else if (eventId == ednMsgGuiClose) {
|
||||||
} else if (generateEventId == ednMsgGuiClose) {
|
if (data == "") {
|
||||||
/*
|
|
||||||
if (NULL == data) {
|
|
||||||
EDN_ERROR("Null data for close file ... ");
|
EDN_ERROR("Null data for close file ... ");
|
||||||
} else {
|
} else {
|
||||||
if (0 == strcmp(data , "All")) {
|
if (data == "All") {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
int32_t closeID = -1;
|
int32_t closeID = -1;
|
||||||
if (0 == strcmp(data , "current")) {
|
if (data == "current") {
|
||||||
closeID = m_idSelected;
|
closeID = m_idSelected;
|
||||||
EDN_DEBUG("Close specific buffer ID" << closeID);
|
EDN_DEBUG("Close specific buffer ID" << closeID);
|
||||||
} else {
|
} else {
|
||||||
// close specific buffer ...
|
// close specific buffer ...
|
||||||
sscanf(data, "%d", &closeID);
|
sscanf(data.Utf8Data(), "%d", &closeID);
|
||||||
EDN_DEBUG("Close specific buffer ID="<< closeID);
|
EDN_DEBUG("Close specific buffer ID="<< closeID);
|
||||||
}
|
}
|
||||||
if(true == Exist(closeID)) {
|
if(true == Exist(closeID)) {
|
||||||
@ -225,36 +232,33 @@ bool classBufferManager::OnEventAreaExternal(int32_t widgetID, const char * gene
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// set it to the currect display
|
// set it to the currect display
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, destBuffer);
|
SendMultiCast(ednMsgBufferId, destBuffer);
|
||||||
m_idSelected = destBuffer;
|
m_idSelected = destBuffer;
|
||||||
}
|
}
|
||||||
// Remove requested buffer
|
// Remove requested buffer
|
||||||
Remove(closeID);
|
Remove(closeID);
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferListChange);
|
SendMultiCast(ednMsgBufferListChange);
|
||||||
} else {
|
} else {
|
||||||
EDN_ERROR("Request Close of a non existant ID : " << closeID);
|
EDN_ERROR("Request Close of a non existant ID : " << closeID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
} else if (eventId == ednMsgCodeViewSelectedId) {
|
||||||
} else if (generateEventId == ednMsgCodeViewSelectedId) {
|
|
||||||
/*
|
|
||||||
//Change the selected buffer
|
//Change the selected buffer
|
||||||
if (NULL == data) {
|
if (data == "") {
|
||||||
EDN_ERROR("Null data for changing buffer ID file ... ");
|
EDN_ERROR("Null data for changing buffer ID file ... ");
|
||||||
} else {
|
} else {
|
||||||
int32_t newId;
|
int32_t newId;
|
||||||
sscanf(data, "%d", &newId);
|
sscanf(data.Utf8Data(), "%d", &newId);
|
||||||
if (true == Exist(newId)) {
|
if (true == Exist(newId)) {
|
||||||
m_idSelected = newId;
|
m_idSelected = newId;
|
||||||
} else {
|
} else {
|
||||||
EDN_ERROR("code biew request the selection of an non -existant buffer ==> reset to -1");
|
EDN_ERROR("code biew request the selection of an non -existant buffer ==> reset to -1");
|
||||||
m_idSelected = -1;
|
m_idSelected = -1;
|
||||||
}
|
}
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_idSelected);
|
SendMultiCast(ednMsgBufferId, m_idSelected);
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferListChange);
|
SendMultiCast(ednMsgBufferListChange);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
switch (id)
|
switch (id)
|
||||||
@ -271,7 +275,6 @@ bool classBufferManager::OnEventAreaExternal(int32_t widgetID, const char * gene
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -290,13 +293,11 @@ bool classBufferManager::OnEventAreaExternal(int32_t widgetID, const char * gene
|
|||||||
*/
|
*/
|
||||||
void classBufferManager::RemoveAll(void)
|
void classBufferManager::RemoveAll(void)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
int32_t i;
|
int32_t i;
|
||||||
for (i=0; i<listBuffer.Size(); i++) {
|
for (i=0; i<listBuffer.Size(); i++) {
|
||||||
Remove(i);
|
Remove(i);
|
||||||
}
|
}
|
||||||
ewol::widgetMessageMultiCast::Send(-1, ednMsgGuiClose, "All");
|
SendMultiCast(ednMsgGuiClose, "All");
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -513,7 +514,7 @@ void BufferManager::UnInit(void)
|
|||||||
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
|
EWOL_ERROR("classBufferManager ==> request UnInit, but does not exist ...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
localManager->MarkToRemove();
|
ewol::EObjectManager::MarkToRemoved(localManager);
|
||||||
localManager = NULL;
|
localManager = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,20 +27,27 @@
|
|||||||
#include <ColorizeManager.h>
|
#include <ColorizeManager.h>
|
||||||
#include <tinyXML/tinyxml.h>
|
#include <tinyXML/tinyxml.h>
|
||||||
#include <ewol/EObject.h>
|
#include <ewol/EObject.h>
|
||||||
#include <ewol/WidgetManager.h>
|
#include <ewol/EObjectManager.h>
|
||||||
|
|
||||||
#define PFX "ColorizeManager "
|
#define PFX "ColorizeManager "
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class classColorManager: public ewol::Widget
|
class classColorManager: public ewol::EObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Constructeur
|
// Constructeur
|
||||||
classColorManager(void);
|
classColorManager(void);
|
||||||
~classColorManager(void);
|
~classColorManager(void);
|
||||||
public:
|
public:
|
||||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
/**
|
||||||
|
* @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, 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,8 +87,7 @@ classColorManager::~classColorManager(void)
|
|||||||
listMyColor.Clear();
|
listMyColor.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void classColorManager::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
||||||
bool classColorManager::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
switch (id)
|
switch (id)
|
||||||
@ -96,7 +102,6 @@ bool classColorManager::OnEventAreaExternal(int32_t widgetID, const char * gener
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -388,7 +393,7 @@ void ColorizeManager::UnInit(void)
|
|||||||
EWOL_ERROR("ColorizeManager ==> request UnInit, but does not exist ...");
|
EWOL_ERROR("ColorizeManager ==> request UnInit, but does not exist ...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
localManager->MarkToRemove();
|
ewol::EObjectManager::MarkToRemoved(localManager);
|
||||||
localManager = NULL;
|
localManager = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,37 +37,36 @@
|
|||||||
|
|
||||||
BufferView::BufferView(void)
|
BufferView::BufferView(void)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
SetCanHaveFocus(true);
|
SetCanHaveFocus(true);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferListChange);
|
RegisterMultiCast(ednMsgBufferListChange);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferState);
|
RegisterMultiCast(ednMsgBufferState);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferId);
|
RegisterMultiCast(ednMsgBufferId);
|
||||||
m_selectedID = -1;
|
m_selectedID = -1;
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BufferView::~BufferView(void)
|
BufferView::~BufferView(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
GtkWidget * BufferView::GetMainWidget(void)
|
|
||||||
|
/**
|
||||||
|
* @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, etk::UString data)
|
||||||
{
|
{
|
||||||
return m_widget;
|
ewol::List::OnReceiveMessage(CallerObject, eventId, data);
|
||||||
}
|
if (eventId == ednMsgBufferListChange) {
|
||||||
*/
|
|
||||||
bool BufferView::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
if (generateEventId == ednMsgBufferListChange) {
|
|
||||||
MarkToReedraw();
|
MarkToReedraw();
|
||||||
}else if (generateEventId == ednMsgBufferId) {
|
}else if (eventId == ednMsgBufferId) {
|
||||||
MarkToReedraw();
|
MarkToReedraw();
|
||||||
}else if (generateEventId == ednMsgBufferState) {
|
}else if (eventId == ednMsgBufferState) {
|
||||||
MarkToReedraw();
|
MarkToReedraw();
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -138,17 +137,15 @@ bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToW
|
|||||||
|
|
||||||
bool BufferView::OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y)
|
bool BufferView::OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
if (1 == IdInput && typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) {
|
if (1 == IdInput && typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) {
|
||||||
EDN_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw );
|
EDN_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw );
|
||||||
int32_t selectBuf = BufferManager::WitchBuffer(raw+1);
|
int32_t selectBuf = BufferManager::WitchBuffer(raw+1);
|
||||||
if ( 0 <= selectBuf) {
|
if ( 0 <= selectBuf) {
|
||||||
m_selectedID = raw;
|
m_selectedID = raw;
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, selectBuf);
|
SendMultiCast(ednMsgBufferId, selectBuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MarkToReedraw();
|
MarkToReedraw();
|
||||||
*/
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,14 @@ class BufferView : public ewol::List
|
|||||||
// Constructeur
|
// Constructeur
|
||||||
BufferView(void);
|
BufferView(void);
|
||||||
~BufferView(void);
|
~BufferView(void);
|
||||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
/**
|
||||||
|
* @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, etk::UString data);
|
||||||
protected:
|
protected:
|
||||||
// function call to display the list :
|
// function call to display the list :
|
||||||
virtual color_ts GetBasicBG(void);
|
virtual color_ts GetBasicBG(void);
|
||||||
|
@ -65,9 +65,7 @@ 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);
|
||||||
/*
|
RegisterMultiCast(ednMsgBufferId);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferId);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeView::~CodeView(void)
|
CodeView::~CodeView(void)
|
||||||
@ -123,11 +121,11 @@ void CodeView::OnRegenerateDisplay(void)
|
|||||||
|
|
||||||
// generate the objects :
|
// generate the objects :
|
||||||
BufferManager::Get(m_bufferID)->Display(m_OObjectTextNormal[m_currentCreateId],
|
BufferManager::Get(m_bufferID)->Display(m_OObjectTextNormal[m_currentCreateId],
|
||||||
m_OObjectTextBold[m_currentCreateId],
|
m_OObjectTextBold[m_currentCreateId],
|
||||||
m_OObjectTextItalic[m_currentCreateId],
|
m_OObjectTextItalic[m_currentCreateId],
|
||||||
m_OObjectTextBoldItalic[m_currentCreateId],
|
m_OObjectTextBoldItalic[m_currentCreateId],
|
||||||
m_OObjectsColored[m_currentCreateId],
|
m_OObjectsColored[m_currentCreateId],
|
||||||
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
|
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
|
||||||
|
|
||||||
int64_t stopTime = GetCurrentTime();
|
int64_t stopTime = GetCurrentTime();
|
||||||
EDN_DEBUG("Display Code Generation = " << stopTime - startTime << " milli-s");
|
EDN_DEBUG("Display Code Generation = " << stopTime - startTime << " milli-s");
|
||||||
@ -227,15 +225,23 @@ bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool CodeView::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y)
|
/**
|
||||||
|
* @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 CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
||||||
{
|
{
|
||||||
EDN_DEBUG("Extern Event : " << widgetID << " type : " << generateEventId << " position(" << x << "," << y << ")");
|
ewol::WidgetScrooled::OnReceiveMessage(CallerObject, eventId, data);
|
||||||
|
EDN_DEBUG("Extern Event : " << CallerObject << " type : " << eventId << " data=\"" << data << "\"");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if( ednMsgBufferId == generateEventId) {
|
if(eventId == ednMsgBufferId) {
|
||||||
int32_t bufferID = 0;
|
int32_t bufferID = 0;
|
||||||
sscanf(data, "%d", &bufferID);
|
sscanf(data.Utf8Data(), "%d", &bufferID);
|
||||||
EDN_INFO("Select a new Buffer ... " << bufferID);
|
EDN_INFO("Select a new Buffer ... " << bufferID);
|
||||||
m_bufferID = bufferID;
|
m_bufferID = bufferID;
|
||||||
BufferManager::Get(m_bufferID)->ForceReDraw(true);
|
BufferManager::Get(m_bufferID)->ForceReDraw(true);
|
||||||
@ -390,7 +396,6 @@ bool CodeView::OnEventAreaExternal(int32_t widgetID, const char * generateEventI
|
|||||||
*/
|
*/
|
||||||
// Force redraw of the widget
|
// Force redraw of the widget
|
||||||
MarkToReedraw();
|
MarkToReedraw();
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,7 +56,14 @@ class CodeView :public ewol::WidgetScrooled
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void OnRegenerateDisplay(void);
|
virtual void OnRegenerateDisplay(void);
|
||||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
|
/**
|
||||||
|
* @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, etk::UString data);
|
||||||
public:
|
public:
|
||||||
virtual bool OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, ewol::eventPosition_ts pos);
|
virtual bool OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, ewol::eventPosition_ts pos);
|
||||||
virtual bool OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData);
|
virtual bool OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData);
|
||||||
|
@ -137,15 +137,13 @@ MainWindows::MainWindows(void)
|
|||||||
*/
|
*/
|
||||||
mySizerHori->SubWidgetAdd(myCodeView);
|
mySizerHori->SubWidgetAdd(myCodeView);
|
||||||
|
|
||||||
/*
|
|
||||||
// Generic event ...
|
// Generic event ...
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiSaveAs);
|
RegisterMultiCast(ednMsgGuiSaveAs);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiOpen);
|
RegisterMultiCast(ednMsgGuiOpen);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgGuiAbout);
|
RegisterMultiCast(ednMsgGuiAbout);
|
||||||
// to update the title ...
|
// to update the title ...
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferState);
|
RegisterMultiCast(ednMsgBufferState);
|
||||||
ewol::widgetMessageMultiCast::Add(GetWidgetId(), ednMsgBufferId);
|
RegisterMultiCast(ednMsgBufferId);
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -157,14 +155,20 @@ MainWindows::~MainWindows(void)
|
|||||||
const char *const ednEventPopUpFileSelected = "edn-mainWindows-openSelected";
|
const char *const ednEventPopUpFileSelected = "edn-mainWindows-openSelected";
|
||||||
const char *const ednEventPopUpFileSaveAs = "edn-mainWindows-saveAsSelected";
|
const char *const ednEventPopUpFileSaveAs = "edn-mainWindows-saveAsSelected";
|
||||||
|
|
||||||
bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y)
|
/**
|
||||||
|
* @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 MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
|
||||||
{
|
{
|
||||||
if (true == ewol::Windows::OnEventAreaExternal(widgetID, generateEventId, data, x, y) ) {
|
ewol::Windows::OnReceiveMessage(CallerObject, eventId, data);
|
||||||
return true;
|
|
||||||
}
|
EDN_INFO("Receive Event from the main windows ... : widgetid=" << CallerObject << "\"" << eventId << "\" ==> data=\"" << data << "\"" );
|
||||||
EDN_INFO("Receive Event from the main windows ... : widgetid=" << widgetID << "\"" << generateEventId << "\" ==> data=\"" << data << "\"" );
|
|
||||||
// Open file Section ...
|
// Open file Section ...
|
||||||
if (generateEventId == ednMsgGuiOpen) {
|
if (eventId == ednMsgGuiOpen) {
|
||||||
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");
|
||||||
@ -172,7 +176,7 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve
|
|||||||
//tmpWidget->SetFolder("/");
|
//tmpWidget->SetFolder("/");
|
||||||
PopUpWidgetPush(tmpWidget);
|
PopUpWidgetPush(tmpWidget);
|
||||||
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected);
|
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected);
|
||||||
} else if (generateEventId == ednEventPopUpFileSelected) {
|
} else if (eventId == ednEventPopUpFileSelected) {
|
||||||
/*
|
/*
|
||||||
// get widget:
|
// get widget:
|
||||||
ewol::FileChooser * tmpWidget = static_cast<ewol::FileChooser*>(ewol::widgetManager::Get(widgetID));
|
ewol::FileChooser * tmpWidget = static_cast<ewol::FileChooser*>(ewol::widgetManager::Get(widgetID));
|
||||||
@ -185,15 +189,15 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve
|
|||||||
EDN_DEBUG("Request opening the file : " << tmpData);
|
EDN_DEBUG("Request opening the file : " << tmpData);
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgOpenFile, tmpData);
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgOpenFile, tmpData);
|
||||||
*/
|
*/
|
||||||
} else if (generateEventId == ednMsgGuiSaveAs) {
|
} else if (eventId == ednMsgGuiSaveAs) {
|
||||||
if (NULL == data) {
|
if (data == "") {
|
||||||
EDN_ERROR("Null data for Save As file ... ");
|
EDN_ERROR("Null data for Save As file ... ");
|
||||||
} else {
|
} else {
|
||||||
m_currentSavingAsIdBuffer = -1;
|
m_currentSavingAsIdBuffer = -1;
|
||||||
if (0 == strcmp(data , "current")) {
|
if (data == "current") {
|
||||||
m_currentSavingAsIdBuffer = BufferManager::GetSelected();
|
m_currentSavingAsIdBuffer = BufferManager::GetSelected();
|
||||||
} else {
|
} else {
|
||||||
sscanf(data, "%d", &m_currentSavingAsIdBuffer);
|
sscanf(data.Utf8Data(), "%d", &m_currentSavingAsIdBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (false == BufferManager::Exist(m_currentSavingAsIdBuffer)) {
|
if (false == BufferManager::Exist(m_currentSavingAsIdBuffer)) {
|
||||||
@ -216,7 +220,7 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve
|
|||||||
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSaveAs);
|
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSaveAs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (generateEventId == ednEventPopUpFileSaveAs) {
|
} else if (eventId == ednEventPopUpFileSaveAs) {
|
||||||
/*
|
/*
|
||||||
// get widget:
|
// get widget:
|
||||||
ewol::FileChooser * tmpWidget = static_cast<ewol::FileChooser*>(ewol::widgetManager::Get(widgetID));
|
ewol::FileChooser * tmpWidget = static_cast<ewol::FileChooser*>(ewol::widgetManager::Get(widgetID));
|
||||||
@ -231,8 +235,8 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve
|
|||||||
BufferManager::Get(m_currentSavingAsIdBuffer)->SetFileName(tmpData);
|
BufferManager::Get(m_currentSavingAsIdBuffer)->SetFileName(tmpData);
|
||||||
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgGuiSave, m_currentSavingAsIdBuffer);
|
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgGuiSave, m_currentSavingAsIdBuffer);
|
||||||
*/
|
*/
|
||||||
} else if( generateEventId == ednMsgBufferState
|
} else if( eventId == ednMsgBufferState
|
||||||
|| generateEventId == ednMsgBufferId) {
|
|| eventId == ednMsgBufferId) {
|
||||||
// the buffer change we need to update the widget string
|
// the buffer change we need to update the widget string
|
||||||
Buffer* tmpBuffer = BufferManager::Get(BufferManager::GetSelected());
|
Buffer* tmpBuffer = BufferManager::Get(BufferManager::GetSelected());
|
||||||
if (NULL != tmpBuffer) {
|
if (NULL != tmpBuffer) {
|
||||||
@ -243,14 +247,14 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve
|
|||||||
directName += " *";
|
directName += " *";
|
||||||
}
|
}
|
||||||
if (NULL == m_widgetLabelFileName) {
|
if (NULL == m_widgetLabelFileName) {
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
m_widgetLabelFileName->SetLabel(directName);
|
m_widgetLabelFileName->SetLabel(directName);
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
return false;
|
return;
|
||||||
// TODO : Set the Title ....
|
// TODO : Set the Title ....
|
||||||
} else if (generateEventId == ednMsgGuiAbout) {
|
} else if (eventId == ednMsgGuiAbout) {
|
||||||
/*
|
/*
|
||||||
//Title
|
//Title
|
||||||
"Edn"
|
"Edn"
|
||||||
@ -282,6 +286,6 @@ bool MainWindows::OnEventAreaExternal(int32_t widgetID, const char * generateEve
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,14 @@ class MainWindows : public ewol::Windows
|
|||||||
// Constructeur
|
// Constructeur
|
||||||
MainWindows(void);
|
MainWindows(void);
|
||||||
~MainWindows(void);
|
~MainWindows(void);
|
||||||
virtual bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * data, etkFloat_t x, etkFloat_t y);
|
/**
|
||||||
|
* @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, etk::UString data);
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -27,13 +27,13 @@
|
|||||||
#include <tools_globals.h>
|
#include <tools_globals.h>
|
||||||
#include <HighlightManager.h>
|
#include <HighlightManager.h>
|
||||||
#include <ewol/EObject.h>
|
#include <ewol/EObject.h>
|
||||||
#include <ewol/WidgetManager.h>
|
#include <ewol/EObjectManager.h>
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "HighlightManager"
|
#define __class__ "HighlightManager"
|
||||||
|
|
||||||
|
|
||||||
class localClassHighlightManager: public ewol::Widget
|
class localClassHighlightManager: public ewol::EObject
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
etk::VectorType<Highlight*> listHighlight; //!< List of ALL hightlight modules
|
etk::VectorType<Highlight*> listHighlight; //!< List of ALL hightlight modules
|
||||||
@ -54,7 +54,14 @@ class localClassHighlightManager: public ewol::Widget
|
|||||||
// clear the compleate list
|
// clear the compleate list
|
||||||
listHighlight.Clear();
|
listHighlight.Clear();
|
||||||
};
|
};
|
||||||
bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
|
/**
|
||||||
|
* @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, etk::UString data)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
switch (id)
|
switch (id)
|
||||||
@ -69,7 +76,6 @@ class localClassHighlightManager: public ewol::Widget
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Highlight* Get(etk::File &fileName)
|
Highlight* Get(etk::File &fileName)
|
||||||
@ -159,7 +165,7 @@ void HighlightManager::UnInit(void)
|
|||||||
EWOL_ERROR("HighlightManager ==> request UnInit, but does not exist ...");
|
EWOL_ERROR("HighlightManager ==> request UnInit, but does not exist ...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
localManager->MarkToRemove();
|
ewol::EObjectManager::MarkToRemoved(localManager);
|
||||||
localManager = NULL;
|
localManager = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user