[DEV] update new esignal (not build)

This commit is contained in:
Edouard DUPIN 2016-02-19 23:33:00 +01:00
parent 3e3c47cfa9
commit 3f5d2abc41
18 changed files with 66 additions and 66 deletions

View File

@ -1053,6 +1053,6 @@ namespace etk {
#include <esignal/details/Signal.hxx>
// declare for signal event
template class esignal::Signal<std::shared_ptr<appl::Buffer>>;
template class esignal::ISignal<std::shared_ptr<appl::Buffer>>;

View File

@ -16,7 +16,7 @@
#include <ewol/widget/Widget.h>
#include <ewol/compositing/Text.h>
#include <appl/Highlight.h>
#include <esignal/Signal.h>
#include <esignal/ISignal.h>
namespace appl {
@ -288,10 +288,10 @@ namespace appl {
friend class Buffer;
};
public:
esignal::Signal<void> signalIsModify;
esignal::Signal<void> signalIsSave;
esignal::Signal<void> signalSelectChange;
esignal::Signal<void> signalChangeName;
esignal::ISignal<> signalIsModify;
esignal::ISignal<> signalIsSave;
esignal::ISignal<> signalSelectChange;
esignal::ISignal<> signalChangeName;
protected:
Buffer();
void init();

View File

@ -13,7 +13,7 @@
#include <appl/BufferManager.h>
#include <ewol/object/Object.h>
#include <ewol/object/Manager.h>
#include <esignal/Signal.h>
#include <esignal/ISignal.h>
#include <gale/resource/Manager.h>
#undef __class__

View File

@ -18,10 +18,10 @@
namespace appl {
class BufferManager : public ewol::Object {
public:
esignal::Signal<std::string> signalNewBuffer;
esignal::Signal<std::string> signalSelectFile;
esignal::Signal<void> signalTextSelectionChange;
esignal::Signal<std::shared_ptr<appl::Buffer>> signalRemoveBuffer;
esignal::ISignal<std::string> signalNewBuffer;
esignal::ISignal<std::string> signalSelectFile;
esignal::ISignal<> signalTextSelectionChange;
esignal::ISignal<std::shared_ptr<appl::Buffer>> signalRemoveBuffer;
protected:
BufferManager();
void init(const std::string& _uniqueName);

View File

@ -56,9 +56,9 @@ void BufferView::init() {
propertyHide.set(true);
propertyCanFocus.set(true);
if (m_bufferManager != nullptr) {
m_bufferManager->signalNewBuffer.bind(shared_from_this(), &BufferView::onCallbackNewBuffer);
m_bufferManager->signalSelectFile.bind(shared_from_this(), &BufferView::onCallbackselectNewFile);
m_bufferManager->signalRemoveBuffer.bind(shared_from_this(), &BufferView::onCallbackBufferRemoved);
m_bufferManager->signalNewBuffer.connect(shared_from_this(), &BufferView::onCallbackNewBuffer);
m_bufferManager->signalSelectFile.connect(shared_from_this(), &BufferView::onCallbackselectNewFile);
m_bufferManager->signalRemoveBuffer.connect(shared_from_this(), &BufferView::onCallbackBufferRemoved);
}
}
@ -93,9 +93,9 @@ void BufferView::onCallbackNewBuffer(const std::string& _value) {
APPL_ERROR("event on element nor exist : " << _value);
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);
buffer->signalIsSave.connect(shared_from_this(), &BufferView::onCallbackIsSave);
buffer->signalIsModify.connect(shared_from_this(), &BufferView::onCallbackIsModify);
buffer->signalChangeName.connect(shared_from_this(), &BufferView::onCallbackChangeName);
appl::dataBufferStruct tmp(_value, buffer);
if (m_openOrderMode == true) {
m_list.push_back(tmp);

View File

@ -219,7 +219,7 @@ void MainWindows::init() {
myMenu->add(idMenugDisplay, "Unsplit", "", "menu:split:disable");
myMenu->add(idMenugDisplay, "Vertical", "", "menu:split:vert");
myMenu->add(idMenugDisplay, "Horizontal", "", "menu:split:hori");
myMenu->signalSelect.bind(shared_from_this(), &MainWindows::onCallbackMenuEvent);
myMenu->signalSelect.connect(shared_from_this(), &MainWindows::onCallbackMenuEvent);
m_widgetLabelFileName = ewol::widget::Label::create("FileName");
m_widgetLabelFileName->propertyName.set("appl-widget-display-name");
m_widgetLabelFileName->propertyExpand.set(bvec2(true,false));
@ -240,9 +240,9 @@ void MainWindows::init() {
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);
// TODO : auto-connect on shortcut event ==> maybe do beter later ...
signalShortcut.connect(shared_from_this(), &MainWindows::onCallbackShortCut);
m_bufferManager->signalSelectFile.connect(shared_from_this(), &MainWindows::onCallbackShortCut);
}
@ -418,7 +418,7 @@ void MainWindows::displayOpen() {
}
// apply widget pop-up ...
popUpWidgetPush(tmpWidget);
tmpWidget->signalValidate.bind(shared_from_this(), &MainWindows::onCallbackPopUpFileSelected);
tmpWidget->signalValidate.connect(shared_from_this(), &MainWindows::onCallbackPopUpFileSelected);
}
void MainWindows::displayProperty() {
@ -460,13 +460,13 @@ void MainWindows::onCallbackselectNewFile(const std::string& _value) {
APPL_ERROR("can not call unexistant buffer manager ... ");
return;
}
// TODO : Remove all previous binding from the old buffer ...
// TODO : Remove all previous connecting 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);
tmpp->signalIsSave.connect(shared_from_this(), &MainWindows::onCallbackTitleUpdate);
tmpp->signalIsModify.connect(shared_from_this(), &MainWindows::onCallbackTitleUpdate);
tmpp->signalChangeName.connect(shared_from_this(), &MainWindows::onCallbackTitleUpdate);
}
}
@ -523,19 +523,19 @@ void MainWindows::closeNotSavedFile(const std::shared_ptr<appl::Buffer>& _buffer
bt = tmpPopUp->addButton("Save", true);
if (bt != nullptr) {
// TODO : The element is removed before beeing pressed
// TODO : bt->signalPressed.bind(shared_from_this(), mainWindowsRequestSaveFile, _buffer->getFileName());
// TODO : bt->signalPressed.bind(shared_from_this(), mainWindowsRequestcloseFileNoCheck, _buffer->getFileName());
// TODO : bt->signalPressed.connect(shared_from_this(), mainWindowsRequestSaveFile, _buffer->getFileName());
// TODO : bt->signalPressed.connect(shared_from_this(), mainWindowsRequestcloseFileNoCheck, _buffer->getFileName());
}
}
bt = tmpPopUp->addButton("Save As", true);
if (bt != nullptr) {
// TODO : bt->signalPressed.bind(shared_from_this(), mainWindowsRequestSaveFileAs, _buffer->getFileName());
//bt->signalPressed.bind(shared_from_this(), mainWindowsRequestcloseFileNoCheck, _buffer->getFileName());
// TODO : bt->signalPressed.connect(shared_from_this(), mainWindowsRequestSaveFileAs, _buffer->getFileName());
//bt->signalPressed.connect(shared_from_this(), mainWindowsRequestcloseFileNoCheck, _buffer->getFileName());
// TODO : Request the close when saved ...
}
bt = tmpPopUp->addButton("Close", true);
if (bt != nullptr) {
// TODO : bt->signalPressed.bind(shared_from_this(), mainWindowsRequestcloseFileNoCheck, _buffer->getFileName());
// TODO : bt->signalPressed.connect(shared_from_this(), mainWindowsRequestcloseFileNoCheck, _buffer->getFileName());
}
tmpPopUp->addButton("Cancel", true);
tmpPopUp->propertyCloseOutEvent.set(true);

View File

@ -29,9 +29,9 @@ namespace appl {
};
class TagFileList : public ewol::widget::List {
public:
esignal::Signal<std::string> signalSelect;
esignal::Signal<std::string> signalValidate;
esignal::Signal<void> signalUnSelect;
esignal::ISignal<std::string> signalSelect;
esignal::ISignal<std::string> signalValidate;
esignal::ISignal<> signalUnSelect;
private:
int32_t m_selectedLine;
std::vector<appl::TagListElement*> m_list;

View File

@ -85,9 +85,9 @@ void appl::TagFileSelection::init() {
if (m_listTag == nullptr) {
EWOL_ERROR("Can not allocate widget == > display might be in error");
} else {
m_listTag->signalValidate.bind(shared_from_this(), &appl::TagFileSelection::onCallbackCtagsListValidate);
m_listTag->signalSelect.bind(shared_from_this(), &appl::TagFileSelection::onCallbackCtagsListSelect);
m_listTag->signalUnSelect.bind(shared_from_this(), &appl::TagFileSelection::onCallbackCtagsListUnSelect);
m_listTag->signalValidate.connect(shared_from_this(), &appl::TagFileSelection::onCallbackCtagsListValidate);
m_listTag->signalSelect.connect(shared_from_this(), &appl::TagFileSelection::onCallbackCtagsListSelect);
m_listTag->signalUnSelect.connect(shared_from_this(), &appl::TagFileSelection::onCallbackCtagsListUnSelect);
m_listTag->propertyExpand.set(bvec2(true,true));
m_listTag->propertyFill.set(bvec2(true,true));
mySizerVert->subWidgetAdd(m_listTag);

View File

@ -16,8 +16,8 @@
namespace appl {
class TagFileSelection : public ewol::widget::PopUp {
public:
esignal::Signal<std::string> signalSelect;
esignal::Signal<void> signalCancel;
esignal::ISignal<std::string> signalSelect;
esignal::ISignal<> signalCancel;
private:
std::shared_ptr<appl::TagFileList> m_listTag;
std::string m_eventNamed;

View File

@ -62,7 +62,7 @@ void appl::TextViewer::init(const std::string& _fontName, int32_t _fontSize) {
m_pluginManager->connect(*this);
// last created has focus ...
setCurrentSelect();
signalShortcut.bind(shared_from_this(), &appl::TextViewer::onCallbackShortCut);
signalShortcut.connect(shared_from_this(), &appl::TextViewer::onCallbackShortCut);
/*
registerMultiCast(ednMsgBufferId);
@ -72,7 +72,7 @@ void appl::TextViewer::init(const std::string& _fontName, int32_t _fontSize) {
registerMultiCast(appl::MsgSelectGotoLineSelect);
*/
if (m_bufferManager != nullptr) {
m_bufferManager->signalSelectFile.bind(shared_from_this(), &appl::TextViewer::onCallbackselectNewFile);
m_bufferManager->signalSelectFile.connect(shared_from_this(), &appl::TextViewer::onCallbackselectNewFile);
}
}
@ -121,8 +121,8 @@ void appl::TextViewer::onCallbackselectNewFile(const std::string& _value) {
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);
m_buffer->signalIsModify.connect(shared_from_this(), &appl::TextViewer::onCallbackIsModify);
m_buffer->signalSelectChange.connect(shared_from_this(), &appl::TextViewer::onCallbackSelectChange);
for (auto element : m_drawingRemenber) {
if (element.first.lock() == m_buffer) {
m_originScrooled = element.second;

View File

@ -46,7 +46,7 @@ void appl::WorkerCloseAllFile::init() {
}
// create the worker :
m_worker = appl::WorkerCloseFile::create();
m_worker->signalCloseDone.bind(shared_from_this(), &appl::WorkerCloseAllFile::onCallbackCloseDone);
m_worker->signalCloseDone.connect(shared_from_this(), &appl::WorkerCloseAllFile::onCallbackCloseDone);
m_worker->startAction(m_bufferNameList.front());
// remove first element :
m_bufferNameList.erase(m_bufferNameList.begin());
@ -71,7 +71,7 @@ void appl::WorkerCloseAllFile::onCallbackCloseDone() {
}
// create the worker :
m_worker = appl::WorkerCloseFile::create();
m_worker->signalCloseDone.bind(shared_from_this(), &appl::WorkerCloseAllFile::onCallbackCloseDone);
m_worker->signalCloseDone.connect(shared_from_this(), &appl::WorkerCloseAllFile::onCallbackCloseDone);
m_worker->startAction(m_bufferNameList.front());
// remove first element :
m_bufferNameList.erase(m_bufferNameList.begin());

View File

@ -76,20 +76,20 @@ void appl::WorkerCloseFile::startAction(const std::string& _bufferName) {
if (m_buffer->hasFileName() == true) {
bt = tmpPopUp->addButton("Save", true);
if (bt != nullptr) {
bt->signalPressed.bind(shared_from_this(), &appl::WorkerCloseFile::onCallbackSaveValidate);
bt->signalPressed.connect(shared_from_this(), &appl::WorkerCloseFile::onCallbackSaveValidate);
}
}
bt = tmpPopUp->addButton("Save As", true);
if (bt != nullptr) {
bt->signalPressed.bind(shared_from_this(), &appl::WorkerCloseFile::onCallbackSaveAsValidate);
bt->signalPressed.connect(shared_from_this(), &appl::WorkerCloseFile::onCallbackSaveAsValidate);
}
bt = tmpPopUp->addButton("Close", true);
if (bt != nullptr) {
bt->signalPressed.bind(shared_from_this(), &appl::WorkerCloseFile::onCallbackClose);
bt->signalPressed.connect(shared_from_this(), &appl::WorkerCloseFile::onCallbackClose);
}
bt = tmpPopUp->addButton("Cancel", true);
if (bt != nullptr) {
bt->signalPressed.bind(shared_from_this(), &appl::WorkerCloseFile::onCallbackCancel);
bt->signalPressed.connect(shared_from_this(), &appl::WorkerCloseFile::onCallbackCancel);
}
tmpPopUp->propertyCloseOutEvent.set(true);
std::shared_ptr<ewol::widget::Windows> tmpWindows = ewol::getContext().getWindows();
@ -118,8 +118,8 @@ void appl::WorkerCloseFile::onCallbackSaveAsValidate() {
}
m_worker = appl::WorkerSaveFile::create(m_bufferName);
if (m_worker != nullptr) {
m_worker->signalSaveDone.bind(shared_from_this(), &appl::WorkerCloseFile::onCallbackClose);
m_worker->signalAbort.bind(shared_from_this(), &appl::WorkerCloseFile::onCallbackCancel);
m_worker->signalSaveDone.connect(shared_from_this(), &appl::WorkerCloseFile::onCallbackClose);
m_worker->signalAbort.connect(shared_from_this(), &appl::WorkerCloseFile::onCallbackCancel);
}
}

View File

@ -17,8 +17,8 @@
namespace appl {
class WorkerCloseFile : public ewol::object::Worker {
public:
esignal::Signal<void> signalCloseDone;
esignal::Signal<void> signalAbort;
esignal::ISignal<> signalCloseDone;
esignal::ISignal<> signalAbort;
protected:
// note : if == "" ==> current ...
WorkerCloseFile();

View File

@ -53,7 +53,7 @@ void appl::WorkerSaveAllFile::init() {
destroy();
return;
}
m_worker->signalSaveDone.bind(shared_from_this(), &appl::WorkerSaveAllFile::onCallbackSaveAsDone);
m_worker->signalSaveDone.connect(shared_from_this(), &appl::WorkerSaveAllFile::onCallbackSaveAsDone);
}
appl::WorkerSaveAllFile::~WorkerSaveAllFile() {
@ -77,6 +77,6 @@ void appl::WorkerSaveAllFile::onCallbackSaveAsDone() {
destroy();
return;
}
m_worker->signalSaveDone.bind(shared_from_this(), &appl::WorkerSaveAllFile::onCallbackSaveAsDone);
m_worker->signalSaveDone.connect(shared_from_this(), &appl::WorkerSaveAllFile::onCallbackSaveAsDone);
}

View File

@ -77,8 +77,8 @@ void appl::WorkerSaveFile::init(const std::string& _bufferName, bool _forceSaveA
return;
}
tmpWindows->popUpWidgetPush(m_chooser);
m_chooser->signalValidate.bind(shared_from_this(), &appl::WorkerSaveFile::onCallbackSaveAsValidate);
m_chooser->signalCancel.bind(shared_from_this(), &appl::WorkerSaveFile::onCallbackCancel);
m_chooser->signalValidate.connect(shared_from_this(), &appl::WorkerSaveFile::onCallbackSaveAsValidate);
m_chooser->signalCancel.connect(shared_from_this(), &appl::WorkerSaveFile::onCallbackCancel);
}
appl::WorkerSaveFile::~WorkerSaveFile() {

View File

@ -16,8 +16,8 @@
namespace appl {
class WorkerSaveFile : public ewol::object::Worker {
public:
esignal::Signal<void> signalSaveDone;
esignal::Signal<void> signalAbort;
esignal::ISignal<> signalSaveDone;
esignal::ISignal<> signalAbort;
protected:
WorkerSaveFile();
void init(const std::string& _bufferName, bool _forceSaveAs=true);

View File

@ -85,7 +85,7 @@ void appl::TextPluginCtags::jumpTo(const std::string& _name) {
tmpWidget->addCtagsNewItem(myfile.getFileSystemName(), lineID);
} while (tagsFindNext (m_ctagFile, &entry) == TagSuccess);
ewol::getContext().getWindows()->popUpWidgetPush(tmpWidget);
tmpWidget->signalSelect.bind(shared_from_this(), &appl::TextPluginCtags::onCallbackOpenCtagsSelectReturn);
tmpWidget->signalSelect.connect(shared_from_this(), &appl::TextPluginCtags::onCallbackOpenCtagsSelectReturn);
}
} else {
jumpFile(myfile.getName(), lineID - 1);
@ -183,7 +183,7 @@ bool appl::TextPluginCtags::onReceiveShortCut(appl::TextViewer& _textDrawer,
tmpWidget->propertyPath.set(path);
}
ewol::getContext().getWindows()->popUpWidgetPush(tmpWidget);
tmpWidget->signalValidate.bind(shared_from_this(), &appl::TextPluginCtags::onCallbackOpenCtagsOpenFileReturn);
tmpWidget->signalValidate.connect(shared_from_this(), &appl::TextPluginCtags::onCallbackOpenCtagsOpenFileReturn);
return true;
} else if (_shortCutName == "appl::TextPluginCtags::JumpDestination") {
if (_textDrawer.hasBuffer() == false) {

View File

@ -126,7 +126,7 @@ void globals::ParameterGlobalsGui::init() {
} else {
myCheckbox->propertyExpand.set(bvec2(true,false));
myCheckbox->propertyValue.set(isSetAutoIndent());
myCheckbox->signalValue.bind(shared_from_this(), &globals::ParameterGlobalsGui::onCallbackIndentation);
myCheckbox->signalValue.connect(shared_from_this(), &globals::ParameterGlobalsGui::onCallbackIndentation);
subWidgetAdd(myCheckbox);
}
myCheckbox = ewol::widget::CheckBox::create("Display space char (' ')");
@ -135,7 +135,7 @@ void globals::ParameterGlobalsGui::init() {
} else {
myCheckbox->propertyExpand.set(bvec2(true,false));
myCheckbox->propertyValue.set(isSetDisplaySpaceChar());
myCheckbox->signalValue.bind(shared_from_this(), &globals::ParameterGlobalsGui::onCallbackSpace);
myCheckbox->signalValue.connect(shared_from_this(), &globals::ParameterGlobalsGui::onCallbackSpace);
subWidgetAdd(myCheckbox);
}
myCheckbox = ewol::widget::CheckBox::create("Display tabulation char ('\\t')");
@ -144,7 +144,7 @@ void globals::ParameterGlobalsGui::init() {
} else {
myCheckbox->propertyExpand.set(bvec2(true,false));
myCheckbox->propertyValue.set(isSetDisplayTabChar());
myCheckbox->signalValue.bind(shared_from_this(), &globals::ParameterGlobalsGui::onCallbackTabulation);
myCheckbox->signalValue.connect(shared_from_this(), &globals::ParameterGlobalsGui::onCallbackTabulation);
subWidgetAdd(myCheckbox);
}
myCheckbox = ewol::widget::CheckBox::create("Display end of line ('\\n')");
@ -153,7 +153,7 @@ void globals::ParameterGlobalsGui::init() {
} else {
myCheckbox->propertyExpand.set(bvec2(true,false));
myCheckbox->propertyValue.set(isSetDisplayEndOfLine());
myCheckbox->signalValue.bind(shared_from_this(), &globals::ParameterGlobalsGui::onCallbackEndOfLine);
myCheckbox->signalValue.connect(shared_from_this(), &globals::ParameterGlobalsGui::onCallbackEndOfLine);
subWidgetAdd(myCheckbox);
}
myCheckbox = ewol::widget::CheckBox::create("switch Rounded/default");
@ -162,7 +162,7 @@ void globals::ParameterGlobalsGui::init() {
} else {
myCheckbox->propertyExpand.set(bvec2(true,false));
myCheckbox->propertyValue.set(isSetDisplayEndOfLine());
myCheckbox->signalValue.bind(shared_from_this(), &globals::ParameterGlobalsGui::onCallbackRounded);
myCheckbox->signalValue.connect(shared_from_this(), &globals::ParameterGlobalsGui::onCallbackRounded);
subWidgetAdd(myCheckbox);
}
}