[DEV] update new signal system ==> run but not have many capabilities

This commit is contained in:
Edouard DUPIN 2014-08-25 22:44:42 +02:00
parent cd3c5ff2d4
commit a371c09e22
17 changed files with 387 additions and 510 deletions

View File

@ -18,7 +18,10 @@
#undef __class__
#define __class__ "BufferManager"
appl::BufferManager::BufferManager() {
appl::BufferManager::BufferManager() :
signalNewBuffer(*this, "new-buffer"),
signalSelectFile(*this, "select-buffer"),
signalTextSelectionChange(*this, "text-selection-change") {
addObjectType("appl::BufferManager");
}
@ -38,12 +41,17 @@ std::shared_ptr<appl::Buffer> appl::BufferManager::createNewBuffer() {
return nullptr;
}
m_list.push_back(tmp);
sendMultiCast(appl::MsgSelectNewFile, tmp->getFileName());
APPL_INFO("Create a new Buffer");
signalNewBuffer.emit(tmp->getFileName());
APPL_INFO("Create a new Buffer (done)");
APPL_INFO("select Buffer");
signalSelectFile.emit(tmp->getFileName());
APPL_INFO("select Buffer (done)");
return tmp;
}
std::shared_ptr<appl::Buffer> appl::BufferManager::get(const std::string& _fileName, bool _createIfNeeded) {
APPL_INFO("get(" << _fileName << "," << _createIfNeeded << ")");
APPL_INFO("get('" << _fileName << "'," << _createIfNeeded << ")");
for (auto &it : m_list) {
if (it == nullptr) {
continue;
@ -65,13 +73,23 @@ std::shared_ptr<appl::Buffer> appl::BufferManager::get(const std::string& _fileN
}
tmp->loadFile(_fileName);
m_list.push_back(tmp);
APPL_INFO("Creata a open Buffer");
signalNewBuffer.emit(tmp->getFileName());
APPL_INFO("Creata a open Buffer (done)");
return tmp;
}
return nullptr;
}
void appl::BufferManager::setBufferSelected(std::shared_ptr<appl::Buffer> _bufferSelected) {
m_bufferSelected = _bufferSelected;
sendMultiCast(appl::MsgSelectChange, "");
if (m_bufferSelected == nullptr) {
APPL_ERROR("select a NULL buffer ...");
return;
}
APPL_INFO("Set buffer selected");
//signalSelectFile.emit(m_bufferSelected->getName());
APPL_INFO("Set buffer selected (done)");
}
std::shared_ptr<appl::Buffer> appl::BufferManager::get(int32_t _id) {
@ -99,15 +117,14 @@ bool appl::BufferManager::exist(const std::string& _fileName) {
void appl::BufferManager::open(const std::string& _fileName) {
if (exist(_fileName) == true) {
// TODO : Create a pop-up ...
return;
}
if (get(_fileName, true) == nullptr) {
return;
}
sendMultiCast(appl::MsgSelectNewFile, _fileName);
}
void appl::BufferManager::onReceiveMessage(const ewol::object::Message& _msg) {
APPL_DEBUG("receive message !!! " << _msg);
APPL_INFO("Open buffer:" << _fileName);
signalSelectFile.emit(_fileName);
APPL_INFO("Open buffer (done)");
}

View File

@ -18,6 +18,10 @@
namespace appl {
class BufferManager : public ewol::Resource {
public:
ewol::object::Signal<std::string> signalNewBuffer;
ewol::object::Signal<std::string> signalSelectFile;
ewol::object::Signal<void> signalTextSelectionChange;
protected:
BufferManager();
void init(const std::string& _uniqueName);
public:
@ -77,8 +81,6 @@ namespace appl {
std::shared_ptr<appl::Buffer> getBufferSelected() {
return m_bufferSelected;
};
public: // herited function
void onReceiveMessage(const ewol::object::Message& _msg);
};
};

View File

@ -59,12 +59,10 @@ BufferView::BufferView() :
void BufferView::init() {
ewol::widget::List::init();
registerMultiCast(ednMsgBufferListChange);
registerMultiCast(ednMsgBufferState);
registerMultiCast(ednMsgBufferId);
registerMultiCast(appl::MsgSelectNewFile);
registerMultiCast(appl::MsgSelectChange);
registerMultiCast(appl::MsgNameChange);
if (m_bufferManager != nullptr) {
m_bufferManager->signalNewBuffer.bind(shared_from_this(), &BufferView::onCallbackNewBuffer);
m_bufferManager->signalSelectFile.bind(shared_from_this(), &BufferView::onCallbackselectNewFile);
}
}
BufferView::~BufferView() {
@ -104,90 +102,47 @@ void BufferView::insertAlphabetic(appl::dataBufferStruct* _dataStruct, bool _sel
}
}
}
void BufferView::onReceiveMessage(const ewol::object::Message& _msg) {
APPL_VERBOSE("message : " << _msg);
ewol::widget::List::onReceiveMessage(_msg);
if (_msg.getMessage() == appl::MsgSelectNewFile) {
std::shared_ptr<appl::Buffer> buffer = m_bufferManager->get(_msg.getData());
if (buffer == nullptr) {
APPL_ERROR("event on element nor exist : " << _msg.getData());
return;
}
buffer->signalIsSave.bind(shared_from_this(), &BufferView::onCallbackIsSave);
buffer->signalIsModify.bind(shared_from_this(), &BufferView::onCallbackIsModify);
buffer->signalChangeName.bind(shared_from_this(), &BufferView::onCallbackChangeName);
appl::dataBufferStruct* tmp = new appl::dataBufferStruct(_msg.getData(), buffer);
if (tmp == nullptr) {
APPL_ERROR("Allocation error of the tmp buffer list element");
return;
}
if (m_openOrderMode == true) {
m_list.push_back(tmp);
} else {
insertAlphabetic(tmp);
}
markToRedraw();
void BufferView::onCallbackNewBuffer(const std::string& _value) {
std::shared_ptr<appl::Buffer> buffer = m_bufferManager->get(_value);
if (buffer == nullptr) {
APPL_ERROR("event on element nor exist : " << _value);
return;
}
if (_msg.getMessage() == appl::MsgSelectChange) {
m_selectedID = -1;
std::shared_ptr<appl::Buffer> tmpBuffer;
if (m_bufferManager != nullptr) {
tmpBuffer = m_bufferManager->getBufferSelected();
}
if (tmpBuffer != nullptr) {
for (size_t iii=0; iii<m_list.size(); iii++) {
if (m_list[iii] == nullptr) {
continue;
}
if (m_list[iii]->m_buffer != tmpBuffer) {
continue;
}
m_selectedID = iii;
break;
}
}
markToRedraw();
buffer->signalIsSave.bind(shared_from_this(), &BufferView::onCallbackIsSave);
buffer->signalIsModify.bind(shared_from_this(), &BufferView::onCallbackIsModify);
buffer->signalChangeName.bind(shared_from_this(), &BufferView::onCallbackChangeName);
appl::dataBufferStruct* tmp = new appl::dataBufferStruct(_value, buffer);
if (tmp == nullptr) {
APPL_ERROR("Allocation error of the tmp buffer list element");
return;
}
if (_msg.getMessage() == ednMsgBufferListChange) {
// clean The list
removeAllElement();
// get all the buffer name and properties:
size_t nbBufferOpen = 0; // BufferManager::size();
for (size_t iii=0; iii<nbBufferOpen; iii++) {
/*
if (BufferManager::exist(iii)) {
BufferText* tmpBuffer = BufferManager::get(iii);
if (nullptr != tmpBuffer) {
bool isModify = tmpBuffer->isModify();
etk::FSNode name = tmpBuffer->getFileName();
appl::dataBufferStruct* tmpElement = new appl::dataBufferStruct(name, iii, isModify);
if (nullptr != tmpElement) {
m_list.push_back(tmpElement);
} else {
APPL_ERROR("Allocation error of the tmp buffer list element");
}
}
}
*/
}
if (true == globals::OrderTheBufferList() ) {
SortElementList(m_list);
}
markToRedraw();
}else if (_msg.getMessage() == ednMsgBufferId) {
m_selectedIdRequested = 0; //BufferManager::getSelected();
markToRedraw();
}else if (_msg.getMessage() == ednMsgBufferState) {
// update list of modify section ...
for (auto &it : m_list) {
if (it != nullptr) {
//it->m_isModify = BufferManager::get(it->m_bufferID)->isModify();
}
}
markToRedraw();
if (m_openOrderMode == true) {
m_list.push_back(tmp);
} else {
insertAlphabetic(tmp);
}
markToRedraw();
}
void BufferView::onCallbackselectNewFile(const std::string& _value) {
m_selectedID = -1;
std::shared_ptr<appl::Buffer> tmpBuffer;
if (m_bufferManager != nullptr) {
tmpBuffer = m_bufferManager->getBufferSelected();
}
if (tmpBuffer != nullptr) {
for (size_t iii=0; iii<m_list.size(); iii++) {
if (m_list[iii] == nullptr) {
continue;
}
if (m_list[iii]->m_buffer != tmpBuffer) {
continue;
}
m_selectedID = iii;
break;
}
}
markToRedraw();
}
void BufferView::onCallbackChangeName() {
@ -268,7 +223,9 @@ bool BufferView::onItemEvent(int32_t _IdInput, enum ewol::key::status _typeEvent
&& _raw<(int64_t)m_list.size()
&& nullptr != m_list[_raw]) {
if (m_list[_raw]->m_buffer != nullptr) {
sendMultiCast(appl::MsgSelectNewFile, m_list[_raw]->m_buffer->getFileName());
if (m_bufferManager != nullptr) {
m_bufferManager->open(m_list[_raw]->m_buffer->getFileName());
}
m_selectedID = _raw;
markToRedraw();
return true;

View File

@ -55,8 +55,6 @@ class BufferView : public ewol::widget::List {
public:
DECLARE_FACTORY(BufferView);
virtual ~BufferView();
// Derived function
virtual void onReceiveMessage(const ewol::object::Message& _msg);
private:
bool m_openOrderMode; //!< true if the order is the opening order mode, otherwise, Alphabetic order
protected:
@ -73,6 +71,8 @@ class BufferView : public ewol::widget::List {
void onCallbackChangeName();
void onCallbackIsSave();
void onCallbackIsModify();
void onCallbackNewBuffer(const std::string& _value);
void onCallbackselectNewFile(const std::string& _value);
};

View File

@ -172,8 +172,8 @@ void MainWindows::init() {
mySizerVert2->subWidgetAdd(myTextView);
*/
// search area :
std::shared_ptr<appl::widget::Search> mySearch = appl::widget::Search::create();
mySizerVert2->subWidgetAdd(mySearch);
m_widgetSearch = appl::widget::Search::create();
mySizerVert2->subWidgetAdd(m_widgetSearch);
mySizerHori = ewol::widget::Sizer::create(ewol::widget::Sizer::modeHori);
mySizerHori->setName("plop 555555");
@ -182,95 +182,70 @@ void MainWindows::init() {
myMenu = ewol::widget::Menu::create();
mySizerHori->subWidgetAdd(myMenu);
int32_t idMenuFile = myMenu->addTitle("File");
myMenu->add(idMenuFile, "New", "", ednMsgGuiNew);
myMenu->add(idMenuFile, "New", "", "menu:new");
myMenu->addSpacer();
myMenu->add(idMenuFile, "Open", "THEME:GUI:Load.edf", ednMsgGuiOpen);
myMenu->add(idMenuFile, "Close", "THEME:GUI:Close.edf", ednMsgGuiClose, "current");
myMenu->add(idMenuFile, "Close (all)", "", ednMsgGuiClose, "All");
myMenu->add(idMenuFile, "Save", "THEME:GUI:Save.edf", ednMsgGuiSave, "current");
myMenu->add(idMenuFile, "Save As ...", "", ednMsgGuiSaveAs);
myMenu->add(idMenuFile, "Open", "THEME:GUI:Load.edf", "menu:open");
myMenu->add(idMenuFile, "Close", "THEME:GUI:Close.edf", "menu:close");
myMenu->add(idMenuFile, "Close (all)", "", "menu:close-all");
myMenu->add(idMenuFile, "Save", "THEME:GUI:Save.edf", "menu:save");
myMenu->add(idMenuFile, "Save As ...", "", "menu:save-as");
myMenu->addSpacer();
//myMenu->add(idMenuFile, "Exit", "", ednMsgGuiExit);
myMenu->addSpacer();
myMenu->add(idMenuFile, "Properties", "THEME:GUI:Parameter.edf", ednMsgProperties);
myMenu->add(idMenuFile, "Properties", "THEME:GUI:Parameter.edf", "menu:property");
int32_t idMenuEdit = myMenu->addTitle("Edit");
myMenu->add(idMenuEdit, "Undo", "THEME:GUI:Undo.edf", ednMsgGuiUndo);
myMenu->add(idMenuEdit, "Redo", "THEME:GUI:Redo.edf", ednMsgGuiRedo);
myMenu->add(idMenuEdit, "Undo", "THEME:GUI:Undo.edf", "menu:undo");
myMenu->add(idMenuEdit, "Redo", "THEME:GUI:Redo.edf", "menu:redo");
myMenu->addSpacer();
myMenu->add(idMenuEdit, "Copy", "", ednMsgGuiCopy, "STD");
myMenu->add(idMenuEdit, "Cut", "", ednMsgGuiCut, "STD");
myMenu->add(idMenuEdit, "Paste", "", ednMsgGuiPaste, "STD");
myMenu->add(idMenuEdit, "Remove", "", ednMsgGuiRm);
myMenu->add(idMenuEdit, "Copy", "", "menu:copy");
myMenu->add(idMenuEdit, "Cut", "", "menu:cut");
myMenu->add(idMenuEdit, "Paste", "", "menu:past");
myMenu->add(idMenuEdit, "Remove", "", "menu:remove");
myMenu->addSpacer();
myMenu->add(idMenuEdit, "Select All","", ednMsgGuiSelect, "ALL");
myMenu->add(idMenuEdit, "Un-Select","", ednMsgGuiSelect, "NONE");
myMenu->add(idMenuEdit, "Goto line ...","", ednMsgGuiGotoLine, "???");
myMenu->add(idMenuEdit, "Select All","", "menu:select-all");
myMenu->add(idMenuEdit, "Un-Select","", "menu:select-none");
myMenu->add(idMenuEdit, "Goto line ...","", "menu:goto-line");
int32_t idMenuSearch = myMenu->addTitle("Search");
myMenu->add(idMenuSearch, "Search", "THEME:GUI:Search.edf", ednMsgGuiSearch);
myMenu->add(idMenuSearch, "Replace", "THEME:GUI:Replace.edf", ednMsgGuiReplace);
myMenu->add(idMenuSearch, "Search", "THEME:GUI:Search.edf", "menu:search");
myMenu->add(idMenuSearch, "Replace", "THEME:GUI:Replace.edf", "menu:replace");
myMenu->addSpacer();
myMenu->add(idMenuSearch, "Find (previous)","", ednMsgGuiFind, "Previous");
myMenu->add(idMenuSearch, "Find (next)", "", ednMsgGuiFind, "Next");
myMenu->add(idMenuSearch, "Find (all)", "", ednMsgGuiFind, "All");
myMenu->add(idMenuSearch, "Un-Select", "", ednMsgGuiFind, "None");
/* ==> must be in the pluggin list control ...
int32_t idMenuCTags = myMenu->addTitle("C-tags");
myMenu->add(idMenuCTags, "Load", "", ednMsgGuiCtags, "Load");
myMenu->add(idMenuCTags, "ReLoad", "", ednMsgGuiCtags, "ReLoad");
myMenu->add(idMenuCTags, "Jump", "", ednMsgGuiCtags, "Jump");
myMenu->add(idMenuCTags, "Back", "", ednMsgGuiCtags, "Back");
*/
myMenu->add(idMenuSearch, "Find (previous)","", "menu:find:previous");
myMenu->add(idMenuSearch, "Find (next)", "", "menu:find:next");
myMenu->add(idMenuSearch, "Find (all)", "", "menu:find:all");
myMenu->add(idMenuSearch, "Un-Select", "", "menu:find:none");
int32_t idMenugDisplay = myMenu->addTitle("Display");
myMenu->add(idMenugDisplay, "Color Black", "", appl::MsgNameGuiChangeColor, "color/black/");
myMenu->add(idMenugDisplay, "Color White", "", appl::MsgNameGuiChangeColor, "color/white/");
myMenu->add(idMenugDisplay, "Shape square", "", l_MsgNameGuiChangeShape, "shape/square/");
myMenu->add(idMenugDisplay, "Shape round", "", l_MsgNameGuiChangeShape, "shape/round/");
myMenu->add(idMenugDisplay, "Color Black", "", "menu:color:color/black/");
myMenu->add(idMenugDisplay, "Color White", "", "menu:color:color/white/");
myMenu->add(idMenugDisplay, "Shape square", "", "menu:shape:shape/square/");
myMenu->add(idMenugDisplay, "Shape round", "", "menu:shape:shape/round/");
myMenu->addSpacer();
myMenu->add(idMenugDisplay, "Reload openGl Shader", "", ednMsgGuiReloadShader);
myMenu->add(idMenugDisplay, "Reload openGl Shader", "", "menu:reloadShape");
myMenu->signalSelect.bind(shared_from_this(), &MainWindows::onCallbackMenuEvent);
m_widgetLabelFileName = ewol::widget::Label::create("FileName");
m_widgetLabelFileName->setExpand(bvec2(true,false));
m_widgetLabelFileName->setFill(bvec2(true,false));;
mySizerHori->subWidgetAdd(m_widgetLabelFileName);
// add generic shortcut ...
// (shift, control, alt, meta, char32_t unicodeValue, const char * generateEventId, std::string& data)
shortCutAdd("ctrl+o", ednMsgGuiOpen, "", true);
shortCutAdd("ctrl+n", ednMsgGuiNew, "", true);
shortCutAdd("ctrl+o", "menu:open");
shortCutAdd("ctrl+n", "menu:new");
shortCutAdd("ctrl+s", ednMsgGuiSave, "current", true);
shortCutAdd("ctrl+shift+s", ednMsgGuiSave, "All", true);
shortCutAdd("ctrl+s", "menu:save");
shortCutAdd("ctrl+shift+s", "menu:save-all");
shortCutAdd("ctrl+q", ednMsgGuiClose, "current", true);
shortCutAdd("ctrl+shift+q", ednMsgGuiClose, "All", true);
shortCutAdd("ctrl+q", "menu:close");
shortCutAdd("ctrl+shift+q", "menu:close-all");
shortCutAdd("ctrl+z", ednMsgGuiUndo, "", true);
shortCutAdd("ctrl+shift+z", ednMsgGuiRedo, "", true);
shortCutAdd("ctrl+z", "menu:undo");
shortCutAdd("ctrl+shift+z", "menu:redo");
shortCutAdd("ctrl+l", ednMsgGuiGotoLine, "???", true);
shortCutAdd("ctrl+l", "menu:goto-line");
shortCutAdd("ctrl+f", ednMsgGuiSearch, "", true);
shortCutAdd("F12", ednMsgGuiReloadShader, "", true);
//shortCutAdd("ctrl+d", ednMsgGuiCtags, "Jump", true);
// Generic event ...
registerMultiCast(ednMsgGuiSave);
registerMultiCast(ednMsgGuiSaveAs);
registerMultiCast(ednMsgProperties);
registerMultiCast(ednMsgGuiNew);
registerMultiCast(ednMsgGuiOpen);
registerMultiCast(ednMsgGuiClose);
// to update the title ...
registerMultiCast(ednMsgBufferState);
registerMultiCast(ednMsgBufferId);
registerMultiCast(ednMsgGuiReloadShader);
registerMultiCast(appl::MsgNameGuiChangeColor);
registerMultiCast(l_MsgNameGuiChangeShape);
registerMultiCast(appl::MsgSelectNewFile);
shortCutAdd("ctrl+f", "menu:search");
shortCutAdd("F12", "menu:reloade-shader");
// TODO : auto-bind on shortcut event ==> maybe do beter later ...
signalShortcut.bind(shared_from_this(), &MainWindows::onCallbackShortCut);
m_bufferManager->signalSelectFile.bind(shared_from_this(), &MainWindows::onCallbackShortCut);
}
@ -279,135 +254,96 @@ MainWindows::~MainWindows() {
}
static const char* const ednEventPopUpFileSaveAs = "edn-mainWindows-saveAsSelected";
static const char* const ednEventIsSave = "edn-buffer-is-saved";
static const char* const ednEventIsModify = "edn-buffer-is-modify";
static const char* const ednEventChangeName = "edn-buffer-change-name";
void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
ewol::widget::Windows::onReceiveMessage(_msg);
APPL_VERBOSE("Receive Event from the main windows: " << _msg );
// open file Section ...
if (_msg.getMessage() == ednMsgGuiOpen) {
std::shared_ptr<ewol::widget::FileChooser> tmpWidget = ewol::widget::FileChooser::create();
if (tmpWidget == nullptr) {
APPL_ERROR("Can not open File chooser !!! ");
return;
void MainWindows::onCallbackShortCut(const std::string& _value) {
APPL_WARNING("Event from ShortCut : " << _value);
onCallbackMenuEvent(_value);
}
void MainWindows::onCallbackMenuEvent(const std::string& _value) {
APPL_WARNING("Event from Menu : " << _value);
if (_value == "menu:new") {
if (m_bufferManager != nullptr) {
m_bufferManager->createNewBuffer();
}
tmpWidget->setTitle("Open files ...");
tmpWidget->setValidateLabel("Open");
if (m_bufferManager == nullptr) {
APPL_ERROR("can not call unexistant buffer manager ... ");
return;
}
// Get a ref on the buffer selected (if null, no buffer was selected ...)
std::shared_ptr<appl::Buffer> tmpBuffer = m_bufferManager->getBufferSelected();
if (tmpBuffer != nullptr) {
etk::FSNode tmpFile = tmpBuffer->getFileName();
tmpWidget->setFolder(tmpFile.getNameFolder());
}
// apply widget pop-up ...
popUpWidgetPush(tmpWidget);
tmpWidget->signalValidate.bind(shared_from_this(), &MainWindows::onCallbackPopUpFileSelected);
} else if (_msg.getMessage() == ednMsgProperties) {
// Request the parameter GUI
std::shared_ptr<ewol::widget::Parameter> tmpWidget = ewol::widget::Parameter::create();
if (nullptr == tmpWidget) {
APPL_ERROR("Can not allocate widget == > display might be in error");
} else {
#ifdef SDGSDFGSDFGSDFGSDFGSTERGDHFGHFDS
std::string menuDescription = "<title>Properties</title>\n";
menuDescription += "<group>\n";
menuDescription += " <title>Editor</title>\n";
menuDescription += " <menu>\n";
menuDescription += " <title>Editor Interface</title>\n";
menuDescription += " <short-title>Editor</short-title>\n";
menuDescription += " <widget>appl-text-viewer</widget>\n";
menuDescription += " </menu>\n";
menuDescription += "</group>\n";
menuDescription += "<group>\n";
menuDescription += " <title>Gui</title>\n";
menuDescription += " <menu>\n";
menuDescription += " <title>Font selection</title>\n";
menuDescription += " <short-title>Font</short-title>\n";
menuDescription += " <widget></widget>\n";
menuDescription += " </menu>\n";
menuDescription += " <menu>\n";
menuDescription += " <title>Color selection</title>\n";
menuDescription += " <short-title>Color</short-title>\n";
menuDescription += " <widget></widget>\n";
menuDescription += " </menu>\n";
menuDescription += " <menu>\n";
menuDescription += " <title>Theme selection</title>\n";
menuDescription += " <short-title>Theme</short-title>\n";
menuDescription += " <widget></widget>\n";
menuDescription += " </menu>\n";
menuDescription += "</group>\n";
tmpWidget->setMenu(menuDescription);
#endif
tmpWidget->setTitle("Properties");
popUpWidgetPush(tmpWidget);
tmpWidget->menuAddGroup("Editor");
std::shared_ptr<ewol::Widget> tmpSubWidget = globals::ParameterGlobalsGui::create();
tmpWidget->menuAdd("Editor", "", tmpSubWidget);
tmpWidget->menuAdd("Font & Color", "", nullptr);
tmpWidget->menuAdd("Highlight", "", nullptr);
tmpWidget->menuAddGroup("General");
tmpWidget->menuAdd("Display", "", nullptr);
tmpSubWidget = ParameterAboutGui::create();
tmpWidget->menuAdd("About", "", tmpSubWidget);
}
} else if (_msg.getMessage() == appl::MsgNameGuiChangeColor) {
etk::theme::setName("COLOR", _msg.getData());
ewol::getContext().getResourcesManager().reLoadResources();
ewol::getContext().forceRedrawAll();
} else if (_msg.getMessage() == l_MsgNameGuiChangeShape) {
etk::theme::setName("GUI", _msg.getData());
ewol::getContext().getResourcesManager().reLoadResources();
ewol::getContext().forceRedrawAll();
} else if (_msg.getMessage() == ednMsgGuiReloadShader) {
ewol::getContext().getResourcesManager().reLoadResources();
ewol::getContext().forceRedrawAll();
} else if (_msg.getMessage() == ednMsgGuiExit) {
// TODO : ...
}
// Note : Fore all next message we need to acces to the buffer manager ==> just check one time ...
if (m_bufferManager == nullptr) {
APPL_ERROR("can not call unexistant buffer manager ... ");
return;
}
if (_msg.getMessage() == appl::MsgSelectNewFile) {
onCallbackTitleUpdate();
std::shared_ptr<appl::Buffer> tmpp = m_bufferManager->getBufferSelected();
if (tmpp != nullptr) {
tmpp->signalIsSave.bind(shared_from_this(), &MainWindows::onCallbackTitleUpdate);
tmpp->signalIsModify.bind(shared_from_this(), &MainWindows::onCallbackTitleUpdate);
tmpp->signalChangeName.bind(shared_from_this(), &MainWindows::onCallbackTitleUpdate);
}
} else if (_msg.getMessage() == ednMsgGuiNew) {
m_bufferManager->createNewBuffer();
} else if (_msg.getMessage() == ednMsgGuiSave) {
APPL_DEBUG("Request saving the file : " << _msg.getData());
if (etk::tolower(_msg.getData()) == "current") {
appl::WorkerSaveFile::create("", false);
return;
} else if (etk::tolower(_msg.getData()) == "all") {
appl::WorkerSaveAllFile::create();
return;
} else {
APPL_ERROR("UNKNOW request : " << _msg);
}
} else if (_msg.getMessage() == ednMsgGuiSaveAs) {
} else if (_value == "menu:open") {
displayOpen();
} else if (_value == "menu:close") {
appl::WorkerCloseFile::create("");
} else if (_value == "menu:close-all") {
appl::WorkerCloseAllFile::create();
} else if (_value == "menu:save") {
appl::WorkerSaveFile::create("", false);
} else if (_value == "menu:save-all") {
appl::WorkerSaveAllFile::create();
} else if (_value == "menu:save-as") {
appl::WorkerSaveFile::create("", true);
} else if (_msg.getMessage() == ednMsgGuiClose) {
// Get a ref on the buffer selected (if null, no buffer was selected ...)
if (_msg.getData() == "current") {
appl::WorkerCloseFile::create("");
} else {
appl::WorkerCloseAllFile::create();
} else if (_value == "menu:property") {
displayProperty();
} else if (_value == "menu:undo") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:redo") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:copy") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:cut") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:past") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:remove") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:select-all") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:select-none") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:goto-line") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:search") {
if (m_widgetSearch == nullptr) {
return;
}
if (m_widgetSearch->isHide()) {
m_widgetSearch->show();
m_widgetSearch->selectSearch();
} else {
m_widgetSearch->hide();
}
} else if (_value == "menu:replace") {
if (m_widgetSearch == nullptr) {
return;
}
if (m_widgetSearch->isHide()) {
m_widgetSearch->show();
m_widgetSearch->selectReplace();
} else {
m_widgetSearch->hide();
}
} else if (_value == "menu:find:previous") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:find:next") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:find:all") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:find:none") {
APPL_TODO("Event from Menu : " << _value);
} else if ( _value == "menu:color:color/black/"
|| _value == "menu:color:color/white/") {
etk::theme::setName("COLOR", std::string(_value, 12));
ewol::getContext().getResourcesManager().reLoadResources();
ewol::getContext().forceRedrawAll();
} else if ( _value == "menu:shape:shape/square/"
|| _value == "menu:shape:shape/round/") {
etk::theme::setName("GUI", std::string(_value, 12));
ewol::getContext().getResourcesManager().reLoadResources();
ewol::getContext().forceRedrawAll();
} else if (_value == "menu:reloadShape") {
ewol::getContext().getResourcesManager().reLoadResources();
ewol::getContext().forceRedrawAll();
} else {
APPL_ERROR("Event from Menu UNKNOW : '" << _value << "'");
}
}
/* TODO :
} else if (_msg.getMessage() == mainWindowsRequestSaveFile) { // return after a choice of close...
if (m_bufferManager->exist(_msg.getData()) == false) {
APPL_ERROR("Try to save an non-existant file :" << _msg.getData());
@ -452,8 +388,104 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
//tmpBuffer->removeObject();
EWOL_TODO("call remove buffer ...");
}
return;
*/
void MainWindows::displayOpen() {
std::shared_ptr<ewol::widget::FileChooser> tmpWidget = ewol::widget::FileChooser::create();
if (tmpWidget == nullptr) {
APPL_ERROR("Can not open File chooser !!! ");
return;
}
tmpWidget->setTitle("Open files ...");
tmpWidget->setValidateLabel("Open");
if (m_bufferManager == nullptr) {
APPL_ERROR("can not call unexistant buffer manager ... ");
return;
}
// Get a ref on the buffer selected (if null, no buffer was selected ...)
std::shared_ptr<appl::Buffer> tmpBuffer = m_bufferManager->getBufferSelected();
if (tmpBuffer != nullptr) {
etk::FSNode tmpFile = tmpBuffer->getFileName();
tmpWidget->setFolder(tmpFile.getNameFolder());
}
// apply widget pop-up ...
popUpWidgetPush(tmpWidget);
tmpWidget->signalValidate.bind(shared_from_this(), &MainWindows::onCallbackPopUpFileSelected);
}
void MainWindows::displayProperty() {
// Request the parameter GUI
std::shared_ptr<ewol::widget::Parameter> tmpWidget = ewol::widget::Parameter::create();
if (nullptr == tmpWidget) {
APPL_ERROR("Can not allocate widget == > display might be in error");
} else {
#ifdef SDGSDFGSDFGSDFGSDFGSTERGDHFGHFDS
std::string menuDescription = "<title>Properties</title>\n";
menuDescription += "<group>\n";
menuDescription += " <title>Editor</title>\n";
menuDescription += " <menu>\n";
menuDescription += " <title>Editor Interface</title>\n";
menuDescription += " <short-title>Editor</short-title>\n";
menuDescription += " <widget>appl-text-viewer</widget>\n";
menuDescription += " </menu>\n";
menuDescription += "</group>\n";
menuDescription += "<group>\n";
menuDescription += " <title>Gui</title>\n";
menuDescription += " <menu>\n";
menuDescription += " <title>Font selection</title>\n";
menuDescription += " <short-title>Font</short-title>\n";
menuDescription += " <widget></widget>\n";
menuDescription += " </menu>\n";
menuDescription += " <menu>\n";
menuDescription += " <title>Color selection</title>\n";
menuDescription += " <short-title>Color</short-title>\n";
menuDescription += " <widget></widget>\n";
menuDescription += " </menu>\n";
menuDescription += " <menu>\n";
menuDescription += " <title>Theme selection</title>\n";
menuDescription += " <short-title>Theme</short-title>\n";
menuDescription += " <widget></widget>\n";
menuDescription += " </menu>\n";
menuDescription += "</group>\n";
tmpWidget->setMenu(menuDescription);
#endif
tmpWidget->setTitle("Properties");
popUpWidgetPush(tmpWidget);
tmpWidget->menuAddGroup("Editor");
std::shared_ptr<ewol::Widget> tmpSubWidget = globals::ParameterGlobalsGui::create();
tmpWidget->menuAdd("Editor", "", tmpSubWidget);
tmpWidget->menuAdd("Font & Color", "", nullptr);
tmpWidget->menuAdd("Highlight", "", nullptr);
tmpWidget->menuAddGroup("General");
tmpWidget->menuAdd("Display", "", nullptr);
tmpSubWidget = ParameterAboutGui::create();
tmpWidget->menuAdd("About", "", tmpSubWidget);
}
}
void MainWindows::onCallbackselectNewFile(const std::string& _value) {
if (m_bufferManager == nullptr) {
APPL_ERROR("can not call unexistant buffer manager ... ");
return;
}
// TODO : Remove all previous binding from the old buffer ...
onCallbackTitleUpdate();
std::shared_ptr<appl::Buffer> tmpp = m_bufferManager->getBufferSelected();
if (tmpp != nullptr) {
tmpp->signalIsSave.bind(shared_from_this(), &MainWindows::onCallbackTitleUpdate);
tmpp->signalIsModify.bind(shared_from_this(), &MainWindows::onCallbackTitleUpdate);
tmpp->signalChangeName.bind(shared_from_this(), &MainWindows::onCallbackTitleUpdate);
}
}
static const char* const ednEventPopUpFileSaveAs = "edn-mainWindows-saveAsSelected";
static const char* const ednEventIsSave = "edn-buffer-is-saved";
static const char* const ednEventIsModify = "edn-buffer-is-modify";
static const char* const ednEventChangeName = "edn-buffer-change-name";
void MainWindows::onCallbackPopUpFileSelected(const std::string& _value) {
APPL_DEBUG("Request opening the file : " << _value);
m_bufferManager->open(_value);

View File

@ -16,10 +16,12 @@
#include <appl/BufferManager.h>
#include <ewol/widget/Label.h>
#include <appl/BufferManager.h>
#include <appl/Gui/Search.h>
class MainWindows : public ewol::widget::Windows {
private:
std::shared_ptr<ewol::widget::Label> m_widgetLabelFileName;
std::shared_ptr<appl::widget::Search> m_widgetSearch;
protected:
// Constructeur
MainWindows();
@ -39,11 +41,14 @@ class MainWindows : public ewol::widget::Windows {
* @param[in] _buffer Buffer that might be close.
*/
void closeNotSavedFile(const std::shared_ptr<appl::Buffer>& _buffer);
public: // Derived function
virtual void onReceiveMessage(const ewol::object::Message& _msg);
void displayOpen();
void displayProperty();
private:
void onCallbackPopUpFileSelected(const std::string& _value);
void onCallbackTitleUpdate();
void onCallbackMenuEvent(const std::string& _value);
void onCallbackShortCut(const std::string& _value);
void onCallbackselectNewFile(const std::string& _value);
};

View File

@ -57,8 +57,6 @@ void appl::widget::Search::init() {
// get widget
m_searchEntry = std::dynamic_pointer_cast<ewol::widget::Entry>(getSubObjectNamed("SEARCH:search-entry"));
m_replaceEntry = std::dynamic_pointer_cast<ewol::widget::Entry>(getSubObjectNamed("SEARCH:replace-entry"));
// Display and hide event:
registerMultiCast(ednMsgGuiSearch);
// basicly hiden ...
hide();
}
@ -155,25 +153,15 @@ void appl::widget::Search::OnCallbackForward(const bool& _value) {
m_forward = _value;
}
void appl::widget::Search::onReceiveMessage(const ewol::object::Message& _msg) {
ewol::widget::Composer::onReceiveMessage(_msg);
APPL_INFO("Search receive message : " << _msg);
if ( _msg.getMessage() == ednMsgGuiSearch) {
if (true == isHide()) {
show();
if (m_searchEntry!= nullptr) {
m_searchEntry->keepFocus();
}
} else {
if( (m_searchEntry!=nullptr && true == m_searchEntry->getFocus())
|| (m_replaceEntry!=nullptr && true == m_replaceEntry->getFocus()) ) {
hide();
} else if (m_searchEntry!= nullptr) {
m_searchEntry->keepFocus();
} else {
hide();
}
}
void appl::widget::Search::selectSearch() {
if (m_searchEntry!= nullptr) {
m_searchEntry->keepFocus();
}
}
void appl::widget::Search::selectReplace() {
if (m_replaceEntry!= nullptr) {
m_replaceEntry->keepFocus();
}
}

View File

@ -42,8 +42,9 @@ namespace appl {
* @brief Replace the current selected text.
*/
void replace();
public: // derived function
virtual void onReceiveMessage(const ewol::object::Message& _msg);
public:
void selectSearch();
void selectReplace();
private: // callback functions
void OnCallbackHide();
void OnCallbackSearchValue(const std::string& _value);

View File

@ -62,12 +62,16 @@ void appl::TextViewer::init(const std::string& _fontName, int32_t _fontSize) {
// last created has focus ...
setCurrentSelect();
/*
registerMultiCast(ednMsgBufferId);
registerMultiCast(ednMsgGuiFind);
registerMultiCast(ednMsgGuiReplace);
registerMultiCast(appl::MsgSelectGotoLine);
registerMultiCast(appl::MsgSelectNewFile);
registerMultiCast(appl::MsgSelectGotoLineSelect);
*/
if (m_bufferManager != nullptr) {
m_bufferManager->signalSelectFile.bind(shared_from_this(), &appl::TextViewer::onCallbackselectNewFile);
}
}
@ -75,6 +79,45 @@ appl::TextViewer::~TextViewer() {
appl::textPluginManager::disconnect(*this);
}
void appl::TextViewer::onCallbackselectNewFile(const std::string& _value) {
// reset scroll:
if (m_buffer != nullptr) {
m_buffer->unBindAll(shared_from_this());
bool needAdd = true;
for (size_t iii=0; iii<m_drawingRemenber.size(); ++iii) {
if (m_drawingRemenber[iii].first == m_buffer) {
m_drawingRemenber[iii].second = m_originScrooled;
APPL_VERBOSE("store origin : " << m_originScrooled);
needAdd = false;
break;
}
}
if (needAdd == true) {
m_drawingRemenber.push_back(std::make_pair(m_buffer, m_originScrooled));
APPL_VERBOSE("Push origin : " << m_originScrooled);
}
}
m_originScrooled = vec2(0,0);
if (m_bufferManager != nullptr) {
m_buffer = m_bufferManager->get(_value);
m_bufferManager->setBufferSelected(m_buffer);
if (m_buffer != nullptr) {
m_buffer->signalIsModify.bind(shared_from_this(), &appl::TextViewer::onCallbackIsModify);
m_buffer->signalSelectChange.bind(shared_from_this(), &appl::TextViewer::onCallbackSelectChange);
for (auto element : m_drawingRemenber) {
if (element.first == m_buffer) {
m_originScrooled = element.second;
APPL_VERBOSE("retrive origin : " << m_originScrooled);
// TODO : Check if this element is not out of the display text ...
break;
}
}
}
}
markToRedraw();
return;
}
std::string appl::TextViewer::getBufferPath() {
if (m_buffer == nullptr) {
return "";
@ -465,9 +508,9 @@ bool appl::TextViewer::onEventInput(const ewol::event::Input& _event) {
}
if ( _event.getId() == 12
&& _event.getStatus() == ewol::key::statusSingle) {
APPL_DEBUG("kjhkjhkjh");
APPL_TODO("RAT5 SAVE button ==> TODO implement");
// Rat5 save event
sendMultiCast(ednMsgGuiSave, "current");
//sendMultiCast(ednMsgGuiSave, "current");
return true;
}
// just forward event == > manage directly in the buffer
@ -633,6 +676,7 @@ void appl::TextViewer::onReceiveMessage(const ewol::object::Message& _msg) {
ewol::widget::WidgetScrolled::onReceiveMessage(_msg);
APPL_VERBOSE("receive msg: " << _msg);
// First call plugin
/*
if (appl::textPluginManager::onReceiveMessageViewer(*this, _msg) == true) {
markToRedraw();
return;
@ -659,44 +703,7 @@ void appl::TextViewer::onReceiveMessage(const ewol::object::Message& _msg) {
markToRedraw();
return;
}
if (_msg.getMessage() == appl::MsgSelectNewFile) {
// reset scroll:
if (m_buffer != nullptr) {
m_buffer->unBindAll(shared_from_this());
bool needAdd = true;
for (size_t iii=0; iii<m_drawingRemenber.size(); ++iii) {
if (m_drawingRemenber[iii].first == m_buffer) {
m_drawingRemenber[iii].second = m_originScrooled;
APPL_VERBOSE("store origin : " << m_originScrooled);
needAdd = false;
break;
}
}
if (needAdd == true) {
m_drawingRemenber.push_back(std::make_pair(m_buffer, m_originScrooled));
APPL_VERBOSE("Push origin : " << m_originScrooled);
}
}
m_originScrooled = vec2(0,0);
if (m_bufferManager != nullptr) {
m_buffer = m_bufferManager->get(_msg.getData());
m_bufferManager->setBufferSelected(m_buffer);
if (m_buffer != nullptr) {
m_buffer->signalIsModify.bind(shared_from_this(), &appl::TextViewer::onCallbackIsModify);
m_buffer->signalSelectChange.bind(shared_from_this(), &appl::TextViewer::onCallbackSelectChange);
for (auto element : m_drawingRemenber) {
if (element.first == m_buffer) {
m_originScrooled = element.second;
APPL_VERBOSE("retrive origin : " << m_originScrooled);
// TODO : Check if this element is not out of the display text ...
break;
}
}
}
}
markToRedraw();
return;
}
*/
}
void appl::TextViewer::onCallbackIsModify() {

View File

@ -392,7 +392,7 @@ namespace appl {
* @param[in] _messageId Event Id waiting for...
*/
void ext_registerMultiCast(const char* const _messageId) {
registerMultiCast(_messageId);
//registerMultiCast(_messageId);
}
/**
* @brief add a specific shortcut with his description
@ -404,11 +404,12 @@ namespace appl {
const char * _generateEventId,
std::string _data="",
bool _broadcast=false) {
shortCutAdd(_descriptiveString, _generateEventId, _data, _broadcast);
//shortCutAdd(_descriptiveString, _generateEventId, _data, _broadcast);
}
private: // callback fundtions
void onCallbackIsModify();
void onCallbackSelectChange();
void onCallbackselectNewFile(const std::string& _value);
};
};

View File

@ -41,6 +41,6 @@ void appl::ViewerManager::setViewerSelected(const std::shared_ptr<appl::TextView
}
m_viewer = _viewer;
if (m_bufferManager != nullptr) {
m_bufferManager->setBufferSelected(_buffer);
//m_bufferManager->setBufferSelected(_buffer);
}
}

View File

@ -26,12 +26,14 @@ void appl::TextPluginCopy::init() {
void appl::TextPluginCopy::onPluginEnable(appl::TextViewer& _textDrawer) {
// add event :
/*
_textDrawer.ext_registerMultiCast(ednMsgGuiCopy);
_textDrawer.ext_registerMultiCast(ednMsgGuiPaste);
_textDrawer.ext_registerMultiCast(ednMsgGuiCut);
_textDrawer.ext_shortCutAdd("ctrl+x", ednMsgGuiCut, "STD");
_textDrawer.ext_shortCutAdd("ctrl+c", ednMsgGuiCopy, "STD");
_textDrawer.ext_shortCutAdd("ctrl+v", ednMsgGuiPaste, "STD");
*/
}
void appl::TextPluginCopy::onPluginDisable(appl::TextViewer& _textDrawer) {
@ -43,6 +45,7 @@ bool appl::TextPluginCopy::onReceiveMessageViewer(appl::TextViewer& _textDrawer,
if (isEnable() == false) {
return false;
}
/*
if ( _msg.getMessage() == ednMsgGuiCopy
|| _msg.getMessage() == ednMsgGuiCut) {
if (_textDrawer.hasBuffer() == true) {
@ -62,5 +65,6 @@ bool appl::TextPluginCopy::onReceiveMessageViewer(appl::TextViewer& _textDrawer,
}
return true;
}
*/
return false;
}

View File

@ -105,8 +105,8 @@ void appl::TextPluginCtags::jumpFile(const std::string& _filename, int64_t _line
if (m_bufferManager != nullptr) {
m_bufferManager->open(_filename);
}
sendMultiCast(appl::MsgSelectChange, _filename);
sendMultiCast(appl::MsgSelectGotoLineSelect, etk::to_string(_lineId));
//sendMultiCast(appl::MsgSelectGotoLineSelect, etk::to_string(_lineId));
APPL_TODO("request jup at line ...");
}
void appl::TextPluginCtags::loadTagFile() {

View File

@ -30,10 +30,12 @@ void appl::TextPluginHistory::init() {
void appl::TextPluginHistory::onPluginEnable(appl::TextViewer& _textDrawer) {
// add event :
/*
_textDrawer.ext_registerMultiCast(ednMsgGuiRedo);
_textDrawer.ext_registerMultiCast(ednMsgGuiUndo);
_textDrawer.ext_shortCutAdd("ctrl+z", ednMsgGuiUndo);
_textDrawer.ext_shortCutAdd("ctrl+shift+z", ednMsgGuiRedo);
*/
}
void appl::TextPluginHistory::onPluginDisable(appl::TextViewer& _textDrawer) {
@ -46,6 +48,7 @@ bool appl::TextPluginHistory::onDataReceiveMessageViewer(appl::TextViewer& _text
if (isEnable() == false) {
return false;
}
/*
if (_msg.getMessage() == ednMsgGuiRedo) {
if (_data.m_redo.size() == 0) {
return true;
@ -79,6 +82,7 @@ bool appl::TextPluginHistory::onDataReceiveMessageViewer(appl::TextViewer& _text
return true;
}
*/
return false;
}

View File

@ -26,8 +26,10 @@ void appl::TextPluginRmLine::init() {
void appl::TextPluginRmLine::onPluginEnable(appl::TextViewer& _textDrawer) {
// add event :
/*
_textDrawer.ext_registerMultiCast(ednMsgGuiRm);
_textDrawer.ext_shortCutAdd("ctrl+w", ednMsgGuiRm);
*/
}
void appl::TextPluginRmLine::onPluginDisable(appl::TextViewer& _textDrawer) {
@ -39,6 +41,7 @@ bool appl::TextPluginRmLine::onReceiveMessageViewer(appl::TextViewer& _textDrawe
if (isEnable() == false) {
return false;
}
/*
if (_msg.getMessage() == ednMsgGuiRm) {
if (_textDrawer.hasBuffer() == false) {
return false;
@ -54,5 +57,6 @@ bool appl::TextPluginRmLine::onReceiveMessageViewer(appl::TextViewer& _textDrawe
}
return true;
}
*/
return false;
}

View File

@ -1,71 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license GPL v3 (see license file)
*/
#include <appl/globalMsg.h>
appl::Broadcast::Broadcast() :
signalBufferState(*this, "buffer-state"),
signalBufferName(*this, "buffer-name"),
signalBufferId(*this, "buffer-id"),
signalCodeViewSelectedId(*this, "code-view-select-id"),
signalOpenFile(*this, "open-file"),
signalBufferListChange(*this, "buffer-list-change"),
signalBufferColor(*this, "buffer-color"),
signalSelectNewFile(*this, "select-new-file"),
signalSelectChange(*this, "select-change"),
signalNameChange(*this, "buffer-name-change"),
signalNameGuiChangeColor(*this, "gui-Change-color"),
signalSelectGotoLine(*this, "gui-goto-line"),
signalSelectGotoLineSelect(*this, "gui-goto-line-select")
{
}
void appl::Broadcast::init(const std::string& _uniqueName) {
ewol::Resource::init(_uniqueName);
}
////////////////////////////////////////////////////////////////////////
// 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 ednMsgProperties = "edn-Msg-Gui-Properties";
extern const char* const ednMsgGuiExit = "edn-Msg-Gui-quit";
extern const char* const ednMsgGuiUndo = "edn-Msg-Gui-Undo";
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 ednMsgGuiSearch = "edn-Msg-Gui-Search";
extern const char* const ednMsgGuiReplace = "edn-Msg-Gui-Replace";
extern const char* const ednMsgGuiFind = "edn-Msg-Gui-Find";
extern const char* const ednMsgGuiShowSpaces = "edn-Msg-Gui-ShowSpaces";
extern const char* const ednMsgGuiShowEndOfLine = "edn-Msg-Gui-ShowEndOfLine";
extern const char* const ednMsgGuiCtags = "edn-Msg-Gui-CTags";
extern const char* const ednMsgCtagsLoadFile = "edn-Msg-CTags-direct-load";
extern const char* const ednMsgGuiReloadShader = "edn-Msg-Gui-ReloadOpenGlShader";
*/
////////////////////////////////////////////////////////////////////////
// Event internal :
////////////////////////////////////////////////////////////////////////

View File

@ -1,74 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2010, Edouard DUPIN, all right reserved
*
* @license GPL v3 (see license file)
*/
#ifndef __MSG_BROADCAST_H__
#define __MSG_BROADCAST_H__
namespace appl {
class Broadcast : public ewol::Resource {
public:
Broadcast();
void init(const std::string& _uniqueName);
public:
DECLARE_RESOURCE_SINGLE_FACTORY(Broadcast, "???Broadcast???");
virtual ~Broadcast() {};
public:
/*
ewol::object::Signal<> signalGuiNew; // data : ""
ewol::object::Signal<> signalGuiOpen; // data : ""
ewol::object::Signal<> signalGuiClose; // data : "current" "All"
ewol::object::Signal<> signalGuiSave; // data : ""
ewol::object::Signal<> signalSaveAs; // data : ""
ewol::object::Signal<> signalProperties; // data : ""
ewol::object::Signal<> signalGuiExit; // data : ""
ewol::object::Signal<> signalGuiUndo; // data : ""
ewol::object::Signal<> signalGuiRedo; // data : ""
ewol::object::Signal<> signalGuiCopy; // data : "STD" "Middle" "1" ... "9"
ewol::object::Signal<> signalGuiCut; // data : "STD" "Middle" "1" ... "9"
ewol::object::Signal<> signalGuiPaste; // data : "STD" "Middle" "1" ... "9"
ewol::object::Signal<> signalGuiRm; // data : "Word" "Line" "Paragraph"
ewol::object::Signal<> signalGuiSelect; // data : "ALL" "NONE"
ewol::object::Signal<> signalGuiGotoLine; // data : "???" / "1" ... "999999999999"
ewol::object::Signal<> signalGuiSearch; // data : ""
ewol::object::Signal<> signalGuiReplace; // data : "Normal" "All"
ewol::object::Signal<> signalGuiFind; // data : "Next" "Previous" "All" "None"
ewol::object::Signal<> signalShowSpaces; // data : "enable" "disable"
ewol::object::Signal<> signalShowEndOfLine; // data : "enable" "disable"
ewol::object::Signal<> signalGuiCtags; // data : "Load" "ReLoad" "Jump" "Back"
ewol::object::Signal<> signalCtagsLoadFile; // data : "filename of the ctags file"
ewol::object::Signal<> signalGuiReloadShader; // data : ""
*/
////////////////////////////////////////////////////////////////////////
// Event internal :
////////////////////////////////////////////////////////////////////////
ewol::object::Signal<std::string> signalBufferState; // data : "Saved" "Modify" "HasHistory" "HasNotHistory" "HasFutureHistory" "HasNotFutureHistory"
ewol::object::Signal<std::string> signalBufferName; // data : "filename"
ewol::object::Signal<void> signalBufferId; // data : "0" ... "99999999999"
ewol::object::Signal<void> signalCodeViewSelectedId; // data : "0" ... "99999999999"
ewol::object::Signal<std::string> signalOpenFile; // data : "/Compleate/file/name.xx"
ewol::object::Signal<void> signalBufferListChange; // data : ""
ewol::object::Signal<std::string> signalBufferColor; // data : "new"
ewol::object::Signal<std::string> signalSelectNewFile; // data : "buffer/name"
ewol::object::Signal<void> signalSelectChange; // data : ""
ewol::object::Signal<void> signalNameChange; // data : ""
ewol::object::Signal<std::string> signalNameGuiChangeColor; // data : "Black" "White"
ewol::object::Signal<int32_t> signalSelectGotoLine; // data : "75822"
ewol::object::Signal<int32_t> signalSelectGotoLineSelect; // data : "75822"
};
};
#endif