diff --git a/data/GUI-Search.xml b/data/GUI-Search.xml index bb33713..49f7599 100644 --- a/data/GUI-Search.xml +++ b/data/GUI-Search.xml @@ -1,5 +1,5 @@ - + - \ No newline at end of file diff --git a/sources/appl/Buffer.h b/sources/appl/Buffer.h index 44f7a02..3c95f95 100644 --- a/sources/appl/Buffer.h +++ b/sources/appl/Buffer.h @@ -26,6 +26,9 @@ namespace appl { int64_t posHLPass1; int64_t posHLPass2; }; + class Buffer; + using BufferShared = ememory::SharedPtr; + using BufferWeak = ememory::WeakPtr; class Buffer : public ewol::Object { public: class Iterator { diff --git a/sources/appl/BufferManager.cpp b/sources/appl/BufferManager.cpp index 4e95873..28d2230 100644 --- a/sources/appl/BufferManager.cpp +++ b/sources/appl/BufferManager.cpp @@ -27,10 +27,6 @@ appl::BufferManager::BufferManager() : addObjectType("appl::BufferManager"); } -void appl::BufferManager::init(const std::string& _uniqueName) { - ewol::Object::init(_uniqueName); -} - appl::BufferManager::~BufferManager() { m_list.clear(); } diff --git a/sources/appl/BufferManager.h b/sources/appl/BufferManager.h index 18c8518..77f737a 100644 --- a/sources/appl/BufferManager.h +++ b/sources/appl/BufferManager.h @@ -16,6 +16,10 @@ #include namespace appl { + class BufferManager; + using BufferManagerShared = ememory::SharedPtr; + using BufferManagerWeak = ememory::WeakPtr; + // TODO: This is a service ... class BufferManager : public ewol::Object { public: esignal::ISignal signalNewBuffer; @@ -24,7 +28,6 @@ namespace appl { esignal::ISignal> signalRemoveBuffer; protected: BufferManager(); - void init(const std::string& _uniqueName); public: DECLARE_SINGLE_FACTORY(BufferManager, "???Buffer_Manager???"); virtual ~BufferManager(); diff --git a/sources/appl/Gui/BufferView.h b/sources/appl/Gui/BufferView.h index c4f3d33..41de984 100644 --- a/sources/appl/Gui/BufferView.h +++ b/sources/appl/Gui/BufferView.h @@ -29,6 +29,9 @@ namespace appl { }; }; + class BufferView; + using BufferViewShared = ememory::SharedPtr; + using BufferViewWeak = ememory::WeakPtr; class BufferView : public ewol::widget::List { private: std::shared_ptr m_bufferManager; //!< handle on the buffer manager diff --git a/sources/appl/Gui/MainWindows.cpp b/sources/appl/Gui/MainWindows.cpp index 35e1af6..822788a 100644 --- a/sources/appl/Gui/MainWindows.cpp +++ b/sources/appl/Gui/MainWindows.cpp @@ -63,7 +63,8 @@ class ParameterAboutGui : public ewol::widget::Sizer { addObjectType("appl::ParameterAboutGui"); } void init() { - ewol::widget::Sizer::init(ewol::widget::Sizer::modeVert); + propertyMode.setDirectCheck(ewol::widget::Sizer::modeVert); + ewol::widget::Sizer::init(); std::shared_ptr mySpacer; mySpacer = ewol::widget::Spacer::create(); @@ -96,10 +97,11 @@ class ParameterAboutGui : public ewol::widget::Sizer { tmpLabel += " libPng, ogg-tremor, portaudio, libZip
"; tmpLabel += " tinyXml, freetype, agg2.4, etk
"; tmpLabel += ""; - std::shared_ptr myLabel = ewol::widget::Label::create(tmpLabel); + std::shared_ptr myLabel = ewol::widget::Label::create(); if (nullptr == myLabel) { APPL_ERROR("Can not allocate widget == > display might be in error"); } else { + myLabel->propertyValue.set(tmpLabel); myLabel->propertyExpand.set(bvec2(true,false)); subWidgetAdd(myLabel); } @@ -129,24 +131,25 @@ MainWindows::MainWindows() { void MainWindows::init() { ewol::widget::Windows::init(); APPL_DEBUG("CREATE WINDOWS ... "); - std::shared_ptr mySizerVert; - std::shared_ptr mySizerVert2; - std::shared_ptr mySizerHori; + ewol::widget::SizerShared mySizerVert; + ewol::widget::SizerShared mySizerVert2; + ewol::widget::SizerShared mySizerHori; std::shared_ptr myTextView; std::shared_ptr myTextView2; std::shared_ptr myBufferView; - std::shared_ptr myMenu; + ewol::widget::MenuShared myMenu; // load buffer manager: m_bufferManager = appl::BufferManager::create(); m_viewerManager = appl::ViewerManager::create(); - mySizerVert = ewol::widget::Sizer::create(ewol::widget::Sizer::modeVert); + mySizerVert = ewol::widget::Sizer::create(); mySizerVert->propertyName.set("plop 1111111"); + mySizerVert->propertyMode.set(ewol::widget::Sizer::modeVert); setSubWidget(mySizerVert); - - mySizerHori = ewol::widget::Sizer::create(ewol::widget::Sizer::modeHori); + mySizerHori = ewol::widget::Sizer::create(); mySizerHori->propertyName.set("plop 222222222"); + mySizerHori->propertyMode.set(ewol::widget::Sizer::modeHori); mySizerVert->subWidgetAdd(mySizerHori); myBufferView = BufferView::create(); myBufferView->propertyName.set("plop 3333333"); @@ -154,7 +157,8 @@ void MainWindows::init() { myBufferView->propertyFill.set(bvec2(true,true)); mySizerHori->subWidgetAdd(myBufferView); - mySizerVert2 = ewol::widget::Sizer::create(ewol::widget::Sizer::modeVert); + mySizerVert2 = ewol::widget::Sizer::create(); + mySizerVert2->propertyMode.set(ewol::widget::Sizer::modeVert); mySizerHori->subWidgetAdd(mySizerVert2); mySizerVert2->propertyName.set("appl-view-code-sizer"); // main buffer Area : @@ -163,64 +167,66 @@ void MainWindows::init() { #else int32_t sizeText = 11; #endif - myTextView2 = appl::TextViewer::create("FreeMono;DejaVuSansMono;FreeSerif", sizeText); + myTextView2 = appl::TextViewer::create("font-size", sizeText); myTextView2->propertyName.set("appl-text-viewer2"); myTextView2->propertyExpand.set(bvec2(true,true)); myTextView2->propertyFill.set(bvec2(true,true)); myTextView2->propertyHide.set(true); mySizerVert2->subWidgetAdd(myTextView2); - myTextView = appl::TextViewer::create("FreeMono;DejaVuSansMono;FreeSerif", sizeText); + myTextView = appl::TextViewer::create("font-size", sizeText); myTextView->propertyName.set("appl-text-viewer1"); myTextView->propertyExpand.set(bvec2(true,true)); myTextView->propertyFill.set(bvec2(true,true)); mySizerVert2->subWidgetAdd(myTextView); - // search area : + // search area: m_widgetSearch = appl::widget::Search::create(); mySizerVert2->subWidgetAdd(m_widgetSearch); - mySizerHori = ewol::widget::Sizer::create(ewol::widget::Sizer::modeHori); + mySizerHori = ewol::widget::Sizer::create(); mySizerHori->propertyName.set("plop 555555"); + mySizerHori->propertyMode.set(ewol::widget::Sizer::modeHori); mySizerVert->subWidgetAdd(mySizerHori); myMenu = ewol::widget::Menu::create(); myMenu->propertyName.set("appl-menu-interface"); mySizerHori->subWidgetAdd(myMenu); - int32_t idMenuFile = myMenu->addTitle("File"); - myMenu->add(idMenuFile, "New", "", "menu:new"); + int32_t idMenuFile = myMenu->addTitle("_T{File}"); + myMenu->add(idMenuFile, "_T{New}", "", "menu:new"); myMenu->addSpacer(); - 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->add(idMenuFile, "_T{Open}", "THEME:GUI:Load.edf", "menu:open"); + myMenu->add(idMenuFile, "_T{Close}", "THEME:GUI:Close.edf", "menu:close"); + myMenu->add(idMenuFile, "_T{Close (all)}", "", "menu:close-all"); + myMenu->add(idMenuFile, "_T{Save}", "THEME:GUI:Save.edf", "menu:save"); + myMenu->add(idMenuFile, "_T{Save As ...}", "", "menu:save-as"); myMenu->addSpacer(); - myMenu->add(idMenuFile, "Properties", "THEME:GUI:Parameter.edf", "menu:property"); - int32_t idMenuEdit = myMenu->addTitle("Edit"); - myMenu->add(idMenuEdit, "Goto line ...","", "menu:goto-line"); - int32_t idMenuSearch = myMenu->addTitle("Search"); - myMenu->add(idMenuSearch, "Search", "THEME:GUI:Search.edf", "menu:search"); - myMenu->add(idMenuSearch, "Replace", "THEME:GUI:Replace.edf", "menu:replace"); + myMenu->add(idMenuFile, "_T{Properties}", "THEME:GUI:Parameter.edf", "menu:property"); + int32_t idMenuEdit = myMenu->addTitle("_T{Edit}"); + myMenu->add(idMenuEdit, "_T{Goto line ...}","", "menu:goto-line"); + int32_t idMenuSearch = myMenu->addTitle("_T{Search}"); + myMenu->add(idMenuSearch, "_T{Search}", "THEME:GUI:Search.edf", "menu:search"); + myMenu->add(idMenuSearch, "_T{Replace}", "THEME:GUI:Replace.edf", "menu:replace"); myMenu->addSpacer(); - 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", "", "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->add(idMenuSearch, "_T{Find (previous)}","", "menu:find:previous"); + myMenu->add(idMenuSearch, "_T{Find (next)}", "", "menu:find:next"); + myMenu->add(idMenuSearch, "_T{Find (all)}", "", "menu:find:all"); + myMenu->add(idMenuSearch, "_T{Un-Select}", "", "menu:find:none"); + int32_t idMenugDisplay = myMenu->addTitle("_T{Display}"); + myMenu->add(idMenugDisplay, "_T{Color Black}", "", "menu:color:color/black/"); + myMenu->add(idMenugDisplay, "_T{Color White}", "", "menu:color:color/white/"); + myMenu->add(idMenugDisplay, "_T{Shape square}", "", "menu:shape:shape/square/"); + myMenu->add(idMenugDisplay, "_T{Shape round}", "", "menu:shape:shape/round/"); myMenu->addSpacer(); - myMenu->add(idMenugDisplay, "Reload openGl Shader", "", "menu:reloadShape"); + myMenu->add(idMenugDisplay, "_T{Reload openGl Shader}", "", "menu:reloadShape"); myMenu->addSpacer(); - myMenu->add(idMenugDisplay, "Split", "", "menu:split:enable"); - myMenu->add(idMenugDisplay, "Unsplit", "", "menu:split:disable"); - myMenu->add(idMenugDisplay, "Vertical", "", "menu:split:vert"); - myMenu->add(idMenugDisplay, "Horizontal", "", "menu:split:hori"); + myMenu->add(idMenugDisplay, "_T{Split}", "", "menu:split:enable"); + myMenu->add(idMenugDisplay, "_T{Unsplit}", "", "menu:split:disable"); + myMenu->add(idMenugDisplay, "_T{Vertical}", "", "menu:split:vert"); + myMenu->add(idMenugDisplay, "_T{Horizontal}", "", "menu:split:hori"); myMenu->signalSelect.connect(shared_from_this(), &MainWindows::onCallbackMenuEvent); - m_widgetLabelFileName = ewol::widget::Label::create("FileName"); + m_widgetLabelFileName = ewol::widget::Label::create(); + m_widgetLabelFileName->propertyValue.set("FileName"); m_widgetLabelFileName->propertyName.set("appl-widget-display-name"); m_widgetLabelFileName->propertyExpand.set(bvec2(true,false)); m_widgetLabelFileName->propertyFill.set(bvec2(true,false));; @@ -242,7 +248,7 @@ void MainWindows::init() { shortCutAdd("F12", "menu:reloade-shader"); // 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); + m_bufferManager->signalSelectFile.connect(shared_from_this(), &MainWindows::onCallbackselectNewFile); } @@ -250,8 +256,6 @@ MainWindows::~MainWindows() { } - - void MainWindows::onCallbackShortCut(const std::string& _value) { APPL_WARNING("Event from ShortCut : " << _value); onCallbackMenuEvent(_value); @@ -404,8 +408,8 @@ void MainWindows::displayOpen() { APPL_ERROR("Can not open File chooser !!! "); return; } - tmpWidget->propertyLabelTitle.set("TRANSLATE:Open files ..."); - tmpWidget->propertyLabelValidate.set("TRANSLATE:Open"); + tmpWidget->propertyLabelTitle.set("_T{Open files ...}"); + tmpWidget->propertyLabelValidate.set("_T{Open}"); if (m_bufferManager == nullptr) { APPL_ERROR("can not call unexistant buffer manager ... "); return; @@ -427,30 +431,31 @@ void MainWindows::displayProperty() { if (nullptr == tmpWidget) { APPL_ERROR("Can not allocate widget == > display might be in error"); } else { - #ifdef SDGSDFGSDFGSDFGSDFGSTERGDHFGHFDS - std::string menuDescription = "Properties\n"; - menuDescription += "\n"; - menuDescription += " \n"; - menuDescription += "\n"; - menuDescription += "\n"; - menuDescription += " \n"; - menuDescription += " \n"; - menuDescription += " \n"; - menuDescription += "\n"; - - tmpWidget->setMenu(menuDescription); + #if 0 + std::string menuDescription = "Properties\n"; + menuDescription += "\n"; + menuDescription += " \n"; + menuDescription += "\n"; + menuDescription += "\n"; + menuDescription += " \n"; + menuDescription += " \n"; + menuDescription += " \n"; + menuDescription += "\n"; + + tmpWidget->setMenu(menuDescription); + #else + tmpWidget->propertyLabelTitle.set("_T{Properties}"); + popUpWidgetPush(tmpWidget); + tmpWidget->menuAddGroup("_T{Editor}"); + std::shared_ptr tmpSubWidget = globals::ParameterGlobalsGui::create(); + tmpWidget->menuAdd("_T{Editor}", "", tmpSubWidget); + tmpWidget->menuAdd("_T{Font & Color}", "", nullptr); + tmpWidget->menuAdd("_T{Highlight}", "", nullptr); + tmpWidget->menuAddGroup("_T{General}"); + tmpWidget->menuAdd("_T{Display}", "", nullptr); + tmpSubWidget = ParameterAboutGui::create(); + tmpWidget->menuAdd("_T{About}", "", tmpSubWidget); #endif - tmpWidget->propertyLabelTitle.set("TRANSLATE:Properties"); - popUpWidgetPush(tmpWidget); - tmpWidget->menuAddGroup("Editor"); - std::shared_ptr 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); } } @@ -460,13 +465,15 @@ void MainWindows::onCallbackselectNewFile(const std::string& _value) { APPL_ERROR("can not call unexistant buffer manager ... "); return; } - // TODO : Remove all previous connecting from the old buffer ... + m_connectionSave.disconnect(); + m_connectionModify.disconnect(); + m_connectionSaveName.disconnect(); onCallbackTitleUpdate(); std::shared_ptr tmpp = m_bufferManager->getBufferSelected(); if (tmpp != nullptr) { - tmpp->signalIsSave.connect(shared_from_this(), &MainWindows::onCallbackTitleUpdate); - tmpp->signalIsModify.connect(shared_from_this(), &MainWindows::onCallbackTitleUpdate); - tmpp->signalChangeName.connect(shared_from_this(), &MainWindows::onCallbackTitleUpdate); + m_connectionSave = tmpp->signalIsSave.connect(this, &MainWindows::onCallbackTitleUpdate); + m_connectionModify = tmpp->signalIsModify.connect(this, &MainWindows::onCallbackTitleUpdate); + m_connectionSaveName = tmpp->signalChangeName.connect(this, &MainWindows::onCallbackTitleUpdate); } } @@ -503,7 +510,7 @@ void MainWindows::saveAsPopUp(const std::shared_ptr& _buffer) { APPL_ERROR("Call With nullptr input..."); return; } - std::shared_ptr tmpObject = appl::WorkerSaveFile::create(_buffer->getFileName()); + std::shared_ptr tmpObject = appl::WorkerSaveFile::create("buffer-name", _buffer->getFileName()); } void MainWindows::closeNotSavedFile(const std::shared_ptr& _buffer) { @@ -516,28 +523,28 @@ void MainWindows::closeNotSavedFile(const std::shared_ptr& _buffer APPL_ERROR("Can not create a simple pop-up"); return; } - tmpPopUp->setTitle("Close un-saved file:"); - tmpPopUp->setComment("The file named : \"" + _buffer->getFileName() + "\" is curently modify.
If you don't saves these modifications,
they will be definitly lost..."); + tmpPopUp->setTitle("_T{Close un-saved file:}"); + tmpPopUp->setComment("_T{The file named:} \"" + _buffer->getFileName() + "\" _T{is curently modify.}
_T{If you don't saves these modifications,
they will be definitly lost...}"); std::shared_ptr bt = nullptr; if (_buffer->hasFileName() == true) { - bt = tmpPopUp->addButton("Save", true); + bt = tmpPopUp->addButton("_T{Save}", true); if (bt != nullptr) { // TODO : The element is removed before beeing pressed // 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); + bt = tmpPopUp->addButton("_T{Save As}", true); if (bt != nullptr) { // 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); + bt = tmpPopUp->addButton("_T{Close}", true); if (bt != nullptr) { // TODO : bt->signalPressed.connect(shared_from_this(), mainWindowsRequestcloseFileNoCheck, _buffer->getFileName()); } - tmpPopUp->addButton("Cancel", true); + tmpPopUp->addButton("_T{Cancel}", true); tmpPopUp->propertyCloseOutEvent.set(true); popUpWidgetPush(tmpPopUp); } diff --git a/sources/appl/Gui/MainWindows.h b/sources/appl/Gui/MainWindows.h index d877cb8..8e96e5c 100644 --- a/sources/appl/Gui/MainWindows.h +++ b/sources/appl/Gui/MainWindows.h @@ -20,8 +20,11 @@ #include class MainWindows : public ewol::widget::Windows { private: - std::shared_ptr m_widgetLabelFileName; - std::shared_ptr m_widgetSearch; + ewol::widget::LabelShared m_widgetLabelFileName; + appl::widget::SearchShared m_widgetSearch; + esignal::Connection m_connectionSave; + esignal::Connection m_connectionModify; + esignal::Connection m_connectionSaveName; protected: // Constructeur MainWindows(); diff --git a/sources/appl/Gui/Search.cpp b/sources/appl/Gui/Search.cpp index 834cfe4..a8b2528 100644 --- a/sources/appl/Gui/Search.cpp +++ b/sources/appl/Gui/Search.cpp @@ -19,17 +19,6 @@ #undef __class__ #define __class__ "Search" -const char* const l_eventSearchEntry = "appl-search-entry"; -const char* const l_eventSearchEntryEnter = "appl-search-entry-enter"; -const char* const l_eventReplaceEntry = "appl-replace-entry"; -const char* const l_eventReplaceEntryEnter = "appl-replace-entry-enter"; -const char* const l_eventSearchBt = "appl-search-button"; -const char* const l_eventReplaceBt = "appl-replace-button"; -const char* const l_eventCaseCb = "appl-case-sensitive-CheckBox"; -const char* const l_eventWrapCb = "appl-wrap-CheckBox"; -const char* const l_eventForwardCb = "appl-forward-CheckBox"; -const char* const l_eventHideBt = "appl-hide-button"; - appl::widget::Search::Search() : m_forward(true), m_caseSensitive(false), @@ -37,7 +26,8 @@ appl::widget::Search::Search() : addObjectType("appl::widget::Search"); } void appl::widget::Search::init() { - ewol::widget::Composer::init(ewol::widget::Composer::file, "DATA:GUI-Search.xml"); + ewol::widget::Composer::init(); + loadFromFile("DATA:GUI-Search.xml"); m_viewerManager = appl::ViewerManager::create(); // link event subBind(ewol::widget::Button, "SEARCH:close", signalPressed, shared_from_this(), &appl::widget::Search::OnCallbackHide); diff --git a/sources/appl/Gui/Search.h b/sources/appl/Gui/Search.h index c1adf29..bb2a16f 100644 --- a/sources/appl/Gui/Search.h +++ b/sources/appl/Gui/Search.h @@ -16,6 +16,9 @@ #include namespace appl { namespace widget { + class Search; + using SearchShared = ememory::SharedPtr; + using SearchWeak = ememory::WeakPtr; class Search : public ewol::widget::Composer { private: std::shared_ptr m_viewerManager; //!< handle on the buffer manager diff --git a/sources/appl/Gui/TagFileSelection.cpp b/sources/appl/Gui/TagFileSelection.cpp index c198876..a225b45 100644 --- a/sources/appl/Gui/TagFileSelection.cpp +++ b/sources/appl/Gui/TagFileSelection.cpp @@ -33,7 +33,7 @@ appl::TagFileSelection::TagFileSelection() : void appl::TagFileSelection::init() { ewol::widget::PopUp::init(); - std::shared_ptr mySizerVert; + ewol::widget::SizerShared mySizerVert; #if defined(__TARGET_OS__Android) propertyMinSize.set(gale::Dimension(vec2(90,90), gale::Dimension::Pourcent)); #elif defined(__TARGET_OS__Windows) @@ -42,32 +42,31 @@ void appl::TagFileSelection::init() { propertyMinSize.set(gale::Dimension(vec2(80,80), gale::Dimension::Pourcent)); #endif - mySizerVert = ewol::widget::Sizer::create(ewol::widget::Sizer::modeVert); + mySizerVert = ewol::widget::Sizer::create(); if (nullptr == mySizerVert) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { + mySizerVert->propertyMode.set(ewol::widget::Sizer::modeVert); mySizerVert->propertyLockExpand.set(bvec2(true,true)); mySizerVert->propertyExpand.set(bvec2(true,true)); // set it in the pop-up-system : setSubWidget(mySizerVert); - std::shared_ptr compose = ewol::widget::Composer::create(ewol::widget::Composer::String, - "\n" - " \n" - " \n" - " \n" "\n"); - compose->propertyExpand.set(bvec2(true,false)); - compose->propertyFill.set(bvec2(true,true)); mySizerVert->subWidgetAdd(compose); externSubBind(compose, ewol::widget::Button, "PLUGIN-CTAGS-jump", signalPressed, shared_from_this(), &appl::TagFileSelection::onCallbackCtagsSelection); externSubBind(compose, ewol::widget::Button, "PLUGIN-CTAGS-cancel", signalPressed, shared_from_this(), &appl::TagFileSelection::onCallbackCtagsCancel); @@ -84,11 +83,11 @@ void appl::TagFileSelection::init() { mySizerVert->subWidgetAdd(m_listTag); } - std::shared_ptr myWidgetTitle; - myWidgetTitle = ewol::widget::Label::create("Ctags Jump Selection ..."); + ewol::widget::LabelShared myWidgetTitle = ewol::widget::Label::create(); if (myWidgetTitle == nullptr) { EWOL_ERROR("Can not allocate widget == > display might be in error"); } else { + myWidgetTitle->propertyValue.set("Ctags Jump Selection ..."); mySizerVert->subWidgetAdd(myWidgetTitle); } } diff --git a/sources/appl/Gui/TextViewer.cpp b/sources/appl/Gui/TextViewer.cpp index 0d348bc..667b2f3 100644 --- a/sources/appl/Gui/TextViewer.cpp +++ b/sources/appl/Gui/TextViewer.cpp @@ -28,11 +28,10 @@ int64_t processTimeLocal = (endTime - startTime); \ APPL_DEBUG(comment << (float)((float)processTimeLocal / 1000.0) << "ms"); -static const char* const appl_Buffer_eventIsModify = "buffer-is-modify"; -static const char* const appl_Buffer_eventSelectChange = "buffer-select-change"; - appl::TextViewer::TextViewer() : + propertyFontName(this, "font-name", "FreeMono;DejaVuSansMono;FreeSerif", "Name of the font for the displayed text", &appl::TextViewer::onChangePropertyFontName), + propertyFontSize(this, "font-size", 12, "Size of the font for the displayed text", &appl::TextViewer::onChangePropertyFontSize), m_insertMode(false) { addObjectType("appl::TextViewer"); setLimitScrolling(0.2); @@ -55,10 +54,10 @@ appl::TextViewer::TextViewer() : m_colorNormal = m_paintingProperties->request("normal"); } -void appl::TextViewer::init(const std::string& _fontName, int32_t _fontSize) { +void appl::TextViewer::init() { ewol::widget::WidgetScrolled::init(); propertyCanFocus.set(true); - m_displayText.setFont(_fontName, _fontSize); + m_displayText.setFont(*propertyFontName, *propertyFontSize); m_pluginManager->connect(*this); // last created has focus ... setCurrentSelect(); @@ -73,6 +72,8 @@ void appl::TextViewer::init(const std::string& _fontName, int32_t _fontSize) { */ if (m_bufferManager != nullptr) { m_bufferManager->signalSelectFile.connect(shared_from_this(), &appl::TextViewer::onCallbackselectNewFile); + } else { + APPL_CRITICAL("Buffer manager has not been created at the init"); } } @@ -88,6 +89,7 @@ void appl::TextViewer::onCallbackShortCut(const std::string& _value) { void appl::TextViewer::onCallbackselectNewFile(const std::string& _value) { + APPL_INFO("Select new file: " << _value); if (isSelectedLast() == false) { return; } @@ -149,10 +151,6 @@ std::string appl::TextViewer::getBufferPath() { return std::string(filename, 0, pos); } -void appl::TextViewer::changeZoom(float _range) { - m_displayText.setFontSize(m_displayText.getSize() + _range); - markToRedraw(); -} bool appl::TextViewer::calculateMinSize() { m_minSize.setValue(50,50); @@ -710,13 +708,13 @@ void appl::TextViewer::onLostFocus() { markToRedraw(); } -void appl::TextViewer::setFontSize(int32_t _size) { - m_displayText.setFontSize(_size); - setScrollingSize(_size*3.0*1.46); // 1.46 is a magic number ... +void appl::TextViewer::onChangePropertyFontSize() { + m_displayText.setFontSize(*propertyFontSize); + setScrollingSize(*propertyFontSize*3.0*1.46); // 1.46 is a magic number ... } -void appl::TextViewer::setFontName(const std::string& _fontName) { - m_displayText.setFontName(_fontName); +void appl::TextViewer::onChangePropertyFontName() { + m_displayText.setFontName(*propertyFontName); } // TODO : Update process time ==> a little expensive (2->4ms) in end of file diff --git a/sources/appl/Gui/TextViewer.h b/sources/appl/Gui/TextViewer.h index 13a6752..bacb684 100644 --- a/sources/appl/Gui/TextViewer.h +++ b/sources/appl/Gui/TextViewer.h @@ -23,8 +23,14 @@ namespace appl { class textPluginManager; + class TextViewer; + using TextViewerShared = ememory::SharedPtr; + using TextViewerWeak = ememory::WeakPtr; class TextViewer : public ewol::widget::WidgetScrolled { private: + eproperty::Value propertyFontName; //!< name of the font to display text. + eproperty::Value propertyFontSize; //!< Size of the font to display text. + std::shared_ptr m_paintingProperties; //!< element painting property int32_t m_colorBackground; int32_t m_colorSpace; @@ -39,7 +45,7 @@ namespace appl { std::shared_ptr m_viewerManager; //!< handle on the buffer manager protected: TextViewer(); - void init(const std::string& _fontName="", int32_t _fontSize=-1); + void init(); public: DECLARE_FACTORY(TextViewer); virtual ~TextViewer(); @@ -58,8 +64,8 @@ namespace appl { ewol::compositing::Drawing m_displayDrawing; //!< Other display requested. std::vector, vec2>> m_drawingRemenber; public: - void setFontSize(int32_t _size); - void setFontName(const std::string& _fontName); + virtual void onChangePropertyFontSize(); + virtual void onChangePropertyFontName(); protected: // derived function virtual void onDraw(); public: // Derived function @@ -70,7 +76,6 @@ namespace appl { virtual void onEventClipboard(enum gale::context::clipBoard::clipboardListe _clipboardID); virtual void onGetFocus(); virtual void onLostFocus(); - virtual void changeZoom(float _range); private: float m_lastOffsetDisplay; //!< Line number ofssed in the display private: diff --git a/sources/appl/Gui/ViewerManager.cpp b/sources/appl/Gui/ViewerManager.cpp index c611f9c..0dd3a2b 100644 --- a/sources/appl/Gui/ViewerManager.cpp +++ b/sources/appl/Gui/ViewerManager.cpp @@ -23,10 +23,6 @@ appl::ViewerManager::ViewerManager() { m_bufferManager = appl::BufferManager::create(); } -void appl::ViewerManager::init(const std::string& _uniqueName) { - ewol::Object::init(_uniqueName); -} - appl::ViewerManager::~ViewerManager() { } diff --git a/sources/appl/Gui/ViewerManager.h b/sources/appl/Gui/ViewerManager.h index 4eb82e2..d589d55 100644 --- a/sources/appl/Gui/ViewerManager.h +++ b/sources/appl/Gui/ViewerManager.h @@ -17,10 +17,12 @@ namespace appl { class TextViewer; + class ViewerManager; + using ViewerManagerShared = ememory::SharedPtr; + using ViewerManagerWeak = ememory::WeakPtr; class ViewerManager : public ewol::Object { protected: ViewerManager(); - void init(const std::string& _uniqueName); public: DECLARE_SINGLE_FACTORY(ViewerManager, "???ViewerManager???"); virtual ~ViewerManager(); diff --git a/sources/appl/Gui/WorkerCloseFile.cpp b/sources/appl/Gui/WorkerCloseFile.cpp index 51ee740..0e33e55 100644 --- a/sources/appl/Gui/WorkerCloseFile.cpp +++ b/sources/appl/Gui/WorkerCloseFile.cpp @@ -116,7 +116,7 @@ void appl::WorkerCloseFile::onCallbackSaveAsValidate() { // nothing to do in this case ==> can do nothing ... return; } - m_worker = appl::WorkerSaveFile::create(m_bufferName); + m_worker = appl::WorkerSaveFile::create("buffer-name", m_bufferName); if (m_worker != nullptr) { m_worker->signalSaveDone.connect(shared_from_this(), &appl::WorkerCloseFile::onCallbackClose); m_worker->signalAbort.connect(shared_from_this(), &appl::WorkerCloseFile::onCallbackCancel); diff --git a/sources/appl/Gui/WorkerSaveAllFile.cpp b/sources/appl/Gui/WorkerSaveAllFile.cpp index 3174409..fe54ed3 100644 --- a/sources/appl/Gui/WorkerSaveAllFile.cpp +++ b/sources/appl/Gui/WorkerSaveAllFile.cpp @@ -46,7 +46,7 @@ void appl::WorkerSaveAllFile::init() { return; } // create the worker : - m_worker = appl::WorkerSaveFile::create(m_bufferNameList.front()); + m_worker = appl::WorkerSaveFile::create("buffer-name", m_bufferNameList.front()); // remove first element : m_bufferNameList.erase(m_bufferNameList.begin()); if (m_bufferNameList.size() == 0) { @@ -70,7 +70,7 @@ void appl::WorkerSaveAllFile::onCallbackSaveAsDone() { return; } // create the worker : - m_worker = appl::WorkerSaveFile::create(m_bufferNameList.front()); + m_worker = appl::WorkerSaveFile::create("buffer-name", m_bufferNameList.front()); // remove first element : m_bufferNameList.erase(m_bufferNameList.begin()); if (m_bufferNameList.size() == 0) { diff --git a/sources/appl/Gui/WorkerSaveFile.cpp b/sources/appl/Gui/WorkerSaveFile.cpp index 1fe3b64..c52eb03 100644 --- a/sources/appl/Gui/WorkerSaveFile.cpp +++ b/sources/appl/Gui/WorkerSaveFile.cpp @@ -16,21 +16,22 @@ appl::WorkerSaveFile::WorkerSaveFile() : signalSaveDone(this, "save-file-done", ""), - signalAbort(this, "save-file-abort", "") { + signalAbort(this, "save-file-abort", ""), + propertyBufferName(this, "buffer-name", "", ""), + propertyForceSave(this, "force-save", false, "request save in all case") { addObjectType("appl::WorkerSaveFile"); // load buffer manager: m_bufferManager = appl::BufferManager::create(); } -void appl::WorkerSaveFile::init(const std::string& _bufferName, bool _forceSaveAs) { +void appl::WorkerSaveFile::init() { ewol::object::Worker::init(); - m_bufferName = _bufferName; if (m_bufferManager == nullptr) { APPL_ERROR("can not call unexistant buffer manager ... "); destroy(); return; } - if (m_bufferName == "") { + if (*propertyBufferName == "") { // need to find the curent file ... std::shared_ptr tmpp = m_bufferManager->getBufferSelected(); if (tmpp == nullptr) { @@ -38,20 +39,20 @@ void appl::WorkerSaveFile::init(const std::string& _bufferName, bool _forceSaveA destroy(); return; } - m_bufferName = tmpp->getFileName(); + propertyBufferName.setDirect(tmpp->getFileName()); } - if (m_bufferManager->exist(m_bufferName) == false) { - APPL_ERROR("Try to save an non-existant file :" << m_bufferName); + if (m_bufferManager->exist(*propertyBufferName) == false) { + APPL_ERROR("Try to save an non-existant file :" << *propertyBufferName); destroy(); return; } - std::shared_ptr tmpBuffer = m_bufferManager->get(m_bufferName); + std::shared_ptr tmpBuffer = m_bufferManager->get(*propertyBufferName); if (tmpBuffer == nullptr) { - APPL_ERROR("Error to get the buffer : " << m_bufferName); + APPL_ERROR("Error to get the buffer : " << *propertyBufferName); destroy(); return; } - if (_forceSaveAs == false) { + if (*propertyForceSave == false) { if (tmpBuffer->hasFileName() == true) { tmpBuffer->storeFile(); signalSaveDone.emit(); @@ -67,7 +68,7 @@ void appl::WorkerSaveFile::init(const std::string& _bufferName, bool _forceSaveA } m_chooser->propertyLabelTitle.set("Save files As..."); m_chooser->propertyLabelValidate.set("Save"); - etk::FSNode tmpName(m_bufferName); + etk::FSNode tmpName(*propertyBufferName); m_chooser->propertyPath.set(tmpName.getNameFolder()); m_chooser->propertyFile.set(tmpName.getNameFile()); std::shared_ptr tmpWindows = ewol::getContext().getWindows(); @@ -101,14 +102,14 @@ void appl::WorkerSaveFile::onCallbackSaveAsValidate(const std::string& _value) { destroy(); return; } - if (m_bufferManager->exist(m_bufferName) == false) { - APPL_ERROR("Try to save an non-existant file :" << m_bufferName); + if (m_bufferManager->exist(*propertyBufferName) == false) { + APPL_ERROR("Try to save an non-existant file :" << *propertyBufferName); destroy(); return; } - std::shared_ptr tmpBuffer = m_bufferManager->get(m_bufferName); + std::shared_ptr tmpBuffer = m_bufferManager->get(*propertyBufferName); if (tmpBuffer == nullptr) { - APPL_ERROR("Error to get the buffer : " << m_bufferName); + APPL_ERROR("Error to get the buffer : " << *propertyBufferName); destroy(); return; } diff --git a/sources/appl/Gui/WorkerSaveFile.h b/sources/appl/Gui/WorkerSaveFile.h index dd52a64..1b08853 100644 --- a/sources/appl/Gui/WorkerSaveFile.h +++ b/sources/appl/Gui/WorkerSaveFile.h @@ -18,14 +18,15 @@ namespace appl { public: esignal::ISignal<> signalSaveDone; esignal::ISignal<> signalAbort; + eproperty::Value propertyBufferName; + eproperty::Value propertyForceSave; protected: WorkerSaveFile(); - void init(const std::string& _bufferName, bool _forceSaveAs=true); + void init(); public: DECLARE_FACTORY(WorkerSaveFile); virtual ~WorkerSaveFile(); private: - std::string m_bufferName; std::shared_ptr m_chooser; //! pop-up element that is open... std::shared_ptr m_bufferManager; //!< handle on the buffer manager public: // callback function diff --git a/sources/appl/Highlight.cpp b/sources/appl/Highlight.cpp index e61c5d5..994f890 100644 --- a/sources/appl/Highlight.cpp +++ b/sources/appl/Highlight.cpp @@ -292,7 +292,7 @@ void appl::Highlight::parse2(int64_t _start, while (elementStart < elementStop) { if (elementStart == 306) { - //etk::log::setLevel(etk::log::logLevelVerbose); + //elog::setLevel(elog::logLevelVerbose); } //HL2_DEBUG("Parse element in the buffer pos=" << elementStart << "," << _buffer.size() << ")" ); //try to fond the HL in ALL of we have diff --git a/sources/appl/TextPlugin.cpp b/sources/appl/TextPlugin.cpp index 7dc280b..f3d3117 100644 --- a/sources/appl/TextPlugin.cpp +++ b/sources/appl/TextPlugin.cpp @@ -33,14 +33,6 @@ appl::TextViewerPlugin::TextViewerPlugin() : m_pluginManager = appl::textPluginManager::create(); } -void appl::TextViewerPlugin::init() { - ewol::Object::init(); -} - -void appl::TextViewerPlugin::init(const std::string& _name) { - ewol::Object::init(_name); -} - appl::TextViewerPlugin::~TextViewerPlugin() { if (m_isEnable == false) { return; diff --git a/sources/appl/TextPlugin.h b/sources/appl/TextPlugin.h index b68b76c..7366dd7 100644 --- a/sources/appl/TextPlugin.h +++ b/sources/appl/TextPlugin.h @@ -17,19 +17,20 @@ namespace appl { class textPluginManager; + class TextViewerPlugin; + using TextViewerPluginShared = ememory::SharedPtr; + using TextViewerPluginWeak = ememory::WeakPtr; class TextViewerPlugin : public ewol::Object { friend class appl::TextViewer; protected: std::weak_ptr m_pluginManager; protected: TextViewerPlugin(); - void init(); - void init(const std::string& _name); public: DECLARE_FACTORY(TextViewerPlugin); virtual ~TextViewerPlugin(); protected: - std::weak_ptr m_menuInterface; + ewol::widget::MenuWeak m_menuInterface; private: bool m_isEnable; //!< The plugin is enable or not (for all viewer). public: diff --git a/sources/appl/TextPluginAutoIndent.cpp b/sources/appl/TextPluginAutoIndent.cpp index 78c979d..4d5de1a 100644 --- a/sources/appl/TextPluginAutoIndent.cpp +++ b/sources/appl/TextPluginAutoIndent.cpp @@ -20,9 +20,6 @@ appl::TextPluginAutoIndent::TextPluginAutoIndent() { addObjectType("appl::TextPluginAutoIndent"); } -void appl::TextPluginAutoIndent::init() { - appl::TextViewerPlugin::init(); -} bool appl::TextPluginAutoIndent::onEventEntry(appl::TextViewer& _textDrawer, const ewol::event::Entry& _event) { diff --git a/sources/appl/TextPluginAutoIndent.h b/sources/appl/TextPluginAutoIndent.h index 585cfd2..abfde49 100644 --- a/sources/appl/TextPluginAutoIndent.h +++ b/sources/appl/TextPluginAutoIndent.h @@ -19,7 +19,6 @@ namespace appl { class TextPluginAutoIndent : public appl::TextViewerPlugin { protected: TextPluginAutoIndent(); - void init(); public: DECLARE_FACTORY(TextPluginAutoIndent); virtual ~TextPluginAutoIndent() { diff --git a/sources/appl/TextPluginCopy.cpp b/sources/appl/TextPluginCopy.cpp index 77c56c8..867f373 100644 --- a/sources/appl/TextPluginCopy.cpp +++ b/sources/appl/TextPluginCopy.cpp @@ -25,10 +25,6 @@ appl::TextPluginCopy::TextPluginCopy() : addObjectType("appl::TextPluginCopy"); } -void appl::TextPluginCopy::init() { - appl::TextViewerPlugin::init(); -} - void appl::TextPluginCopy::onPluginEnable(appl::TextViewer& _textDrawer) { // add event : std::shared_ptr menu = m_menuInterface.lock(); diff --git a/sources/appl/TextPluginCopy.h b/sources/appl/TextPluginCopy.h index 27b0d9b..32d41fe 100644 --- a/sources/appl/TextPluginCopy.h +++ b/sources/appl/TextPluginCopy.h @@ -25,7 +25,6 @@ namespace appl { int32_t m_menuIdRemove; protected: TextPluginCopy(); - void init(); public: DECLARE_FACTORY(TextPluginCopy); virtual ~TextPluginCopy() { diff --git a/sources/appl/TextPluginCtags.cpp b/sources/appl/TextPluginCtags.cpp index 5af934d..0009835 100644 --- a/sources/appl/TextPluginCtags.cpp +++ b/sources/appl/TextPluginCtags.cpp @@ -28,11 +28,6 @@ appl::TextPluginCtags::TextPluginCtags() : addObjectType("appl::TextPluginCtags"); } -void appl::TextPluginCtags::init() { - appl::TextViewerPlugin::init(); -} - - appl::TextPluginCtags::~TextPluginCtags() { } diff --git a/sources/appl/TextPluginCtags.h b/sources/appl/TextPluginCtags.h index 27447b6..cb67885 100644 --- a/sources/appl/TextPluginCtags.h +++ b/sources/appl/TextPluginCtags.h @@ -36,7 +36,6 @@ namespace appl { std::shared_ptr m_bufferManager; //!< handle on the buffer manager protected: TextPluginCtags(); - void init(); public: DECLARE_FACTORY(TextPluginCtags); virtual ~TextPluginCtags(); diff --git a/sources/appl/TextPluginData.h b/sources/appl/TextPluginData.h index 033b667..57c74ed 100644 --- a/sources/appl/TextPluginData.h +++ b/sources/appl/TextPluginData.h @@ -22,12 +22,6 @@ namespace appl { // nothing to do ... addObjectType("appl::TextViewerPluginData"); } - void init() { - appl::TextViewerPlugin::init(); - } - void init(const std::string& _name) { - appl::TextViewerPlugin::init(_name); - } public: DECLARE_FACTORY(TextViewerPluginData); virtual ~TextViewerPluginData() { diff --git a/sources/appl/TextPluginHistory.cpp b/sources/appl/TextPluginHistory.cpp index 9f2b2a8..eb4ac1e 100644 --- a/sources/appl/TextPluginHistory.cpp +++ b/sources/appl/TextPluginHistory.cpp @@ -25,10 +25,6 @@ appl::TextPluginHistory::TextPluginHistory() : addObjectType("appl::TextPluginHistory"); } -void appl::TextPluginHistory::init() { - appl::TextViewerPluginData::init(); -} - void appl::TextPluginHistory::onPluginEnable(appl::TextViewer& _textDrawer) { std::shared_ptr menu = m_menuInterface.lock(); diff --git a/sources/appl/TextPluginHistory.h b/sources/appl/TextPluginHistory.h index 0278356..7dc0985 100644 --- a/sources/appl/TextPluginHistory.h +++ b/sources/appl/TextPluginHistory.h @@ -42,7 +42,6 @@ namespace appl { int32_t m_menuIdRedo; protected: TextPluginHistory(); - void init(); public: DECLARE_FACTORY(TextPluginHistory); virtual ~TextPluginHistory() { }; diff --git a/sources/appl/TextPluginMultiLineTab.cpp b/sources/appl/TextPluginMultiLineTab.cpp index 07f02ed..ecc09eb 100644 --- a/sources/appl/TextPluginMultiLineTab.cpp +++ b/sources/appl/TextPluginMultiLineTab.cpp @@ -18,9 +18,6 @@ appl::TextPluginMultiLineTab::TextPluginMultiLineTab() { addObjectType("appl::TextPluginMultiLineTab"); } -void appl::TextPluginMultiLineTab::init() { - appl::TextViewerPlugin::init(); -} bool appl::TextPluginMultiLineTab::onEventEntry(appl::TextViewer& _textDrawer, const ewol::event::Entry& _event) { diff --git a/sources/appl/TextPluginMultiLineTab.h b/sources/appl/TextPluginMultiLineTab.h index 23435e9..3d45518 100644 --- a/sources/appl/TextPluginMultiLineTab.h +++ b/sources/appl/TextPluginMultiLineTab.h @@ -19,7 +19,6 @@ namespace appl { class TextPluginMultiLineTab : public appl::TextViewerPlugin { protected: TextPluginMultiLineTab(); - void init(); public: DECLARE_FACTORY(TextPluginMultiLineTab); virtual ~TextPluginMultiLineTab() { diff --git a/sources/appl/TextPluginRmLine.cpp b/sources/appl/TextPluginRmLine.cpp index f3b0e2c..7dbd56d 100644 --- a/sources/appl/TextPluginRmLine.cpp +++ b/sources/appl/TextPluginRmLine.cpp @@ -19,9 +19,6 @@ appl::TextPluginRmLine::TextPluginRmLine() { addObjectType("appl::TextPluginRmLine"); } -void appl::TextPluginRmLine::init() { - appl::TextViewerPlugin::init(); -} void appl::TextPluginRmLine::onPluginEnable(appl::TextViewer& _textDrawer) { // add event : diff --git a/sources/appl/TextPluginRmLine.h b/sources/appl/TextPluginRmLine.h index bfba1e2..b816b69 100644 --- a/sources/appl/TextPluginRmLine.h +++ b/sources/appl/TextPluginRmLine.h @@ -19,7 +19,6 @@ namespace appl { class TextPluginRmLine : public appl::TextViewerPlugin { protected: TextPluginRmLine(); - void init(); public: DECLARE_FACTORY(TextPluginRmLine); virtual ~TextPluginRmLine() { diff --git a/sources/appl/TextPluginSelectAll.cpp b/sources/appl/TextPluginSelectAll.cpp index ab6bde1..e9446c4 100644 --- a/sources/appl/TextPluginSelectAll.cpp +++ b/sources/appl/TextPluginSelectAll.cpp @@ -22,9 +22,6 @@ appl::TextPluginSelectAll::TextPluginSelectAll() : addObjectType("appl::TextPluginSelectAll"); } -void appl::TextPluginSelectAll::init() { - appl::TextViewerPlugin::init(); -} void appl::TextPluginSelectAll::onPluginEnable(appl::TextViewer& _textDrawer) { std::shared_ptr menu = m_menuInterface.lock(); diff --git a/sources/appl/TextPluginSelectAll.h b/sources/appl/TextPluginSelectAll.h index c4b3fb7..6c8c2d4 100644 --- a/sources/appl/TextPluginSelectAll.h +++ b/sources/appl/TextPluginSelectAll.h @@ -19,7 +19,6 @@ namespace appl { class TextPluginSelectAll : public appl::TextViewerPlugin { protected: TextPluginSelectAll(); - void init(); int32_t m_menuIdTitle; int32_t m_menuIdSelectAll; int32_t m_menuIdSelectNone; diff --git a/sources/appl/debug.cpp b/sources/appl/debug.cpp index ad2d4c3..2df3ae0 100644 --- a/sources/appl/debug.cpp +++ b/sources/appl/debug.cpp @@ -9,6 +9,6 @@ #include int32_t appl::getLogId() { - static int32_t g_val = etk::log::registerInstance("edn"); + static int32_t g_val = elog::registerInstance("edn"); return g_val; } diff --git a/sources/appl/debug.h b/sources/appl/debug.h index bf87220..ac2b40b 100644 --- a/sources/appl/debug.h +++ b/sources/appl/debug.h @@ -9,12 +9,12 @@ #ifndef __APPL_DEBUG_H__ #define __APPL_DEBUG_H__ -#include +#include namespace appl { int32_t getLogId(); }; -#define APPL_BASE(info,data) TK_LOG_BASE(appl::getLogId(),info,data) +#define APPL_BASE(info,data) ELOG_BASE(appl::getLogId(),info,data) #define APPL_CRITICAL(data) APPL_BASE(1, data) #define APPL_ERROR(data) APPL_BASE(2, data) diff --git a/sources/appl/global.cpp b/sources/appl/global.cpp index ffb6ffe..92350ce 100644 --- a/sources/appl/global.cpp +++ b/sources/appl/global.cpp @@ -109,7 +109,8 @@ globals::ParameterGlobalsGui::ParameterGlobalsGui() { } void globals::ParameterGlobalsGui::init() { - ewol::widget::Sizer::init(ewol::widget::Sizer::modeVert); + ewol::widget::Sizer::init(); + propertyMode.set(ewol::widget::Sizer::modeVert); std::shared_ptr myCheckbox; std::shared_ptr mySpacer; @@ -120,46 +121,52 @@ void globals::ParameterGlobalsGui::init() { mySpacer->propertyExpand.set(bvec2(true,true)); subWidgetAdd(mySpacer); } - myCheckbox = ewol::widget::CheckBox::create("Automatic Indentation"); + myCheckbox = ewol::widget::CheckBox::create(); if (nullptr == myCheckbox) { APPL_ERROR("Can not allocate widget == > display might be in error"); } else { + //TODO : myCheckbox->propertyLabel.set("Automatic Indentation"); myCheckbox->propertyExpand.set(bvec2(true,false)); myCheckbox->propertyValue.set(isSetAutoIndent()); myCheckbox->signalValue.connect(shared_from_this(), &globals::ParameterGlobalsGui::onCallbackIndentation); subWidgetAdd(myCheckbox); } - myCheckbox = ewol::widget::CheckBox::create("Display space char (' ')"); + myCheckbox = ewol::widget::CheckBox::create(); if (nullptr == myCheckbox) { APPL_ERROR("Can not allocate widget == > display might be in error"); } else { + //TODO : myCheckbox->propertyLabel.set("Display space char (' ')"); myCheckbox->propertyExpand.set(bvec2(true,false)); myCheckbox->propertyValue.set(isSetDisplaySpaceChar()); myCheckbox->signalValue.connect(shared_from_this(), &globals::ParameterGlobalsGui::onCallbackSpace); subWidgetAdd(myCheckbox); } - myCheckbox = ewol::widget::CheckBox::create("Display tabulation char ('\\t')"); + myCheckbox = ewol::widget::CheckBox::create(); if (nullptr == myCheckbox) { APPL_ERROR("Can not allocate widget == > display might be in error"); } else { + //TODO : myCheckbox->propertyLabel.set("Display tabulation char ('\\t')"); + myCheckbox->propertyExpand.set(bvec2(true,false)); myCheckbox->propertyValue.set(isSetDisplayTabChar()); myCheckbox->signalValue.connect(shared_from_this(), &globals::ParameterGlobalsGui::onCallbackTabulation); subWidgetAdd(myCheckbox); } - myCheckbox = ewol::widget::CheckBox::create("Display end of line ('\\n')"); + myCheckbox = ewol::widget::CheckBox::create(); if (nullptr == myCheckbox) { APPL_ERROR("Can not allocate widget == > display might be in error"); } else { + //TODO : myCheckbox->propertyLabel.set("Display end of line ('\\n')"); myCheckbox->propertyExpand.set(bvec2(true,false)); myCheckbox->propertyValue.set(isSetDisplayEndOfLine()); myCheckbox->signalValue.connect(shared_from_this(), &globals::ParameterGlobalsGui::onCallbackEndOfLine); subWidgetAdd(myCheckbox); } - myCheckbox = ewol::widget::CheckBox::create("switch Rounded/default"); + myCheckbox = ewol::widget::CheckBox::create(); if (nullptr == myCheckbox) { APPL_ERROR("Can not allocate widget == > display might be in error"); } else { + //TODO : myCheckbox->propertyLabel.set("switch Rounded/default"); myCheckbox->propertyExpand.set(bvec2(true,false)); myCheckbox->propertyValue.set(isSetDisplayEndOfLine()); myCheckbox->signalValue.connect(shared_from_this(), &globals::ParameterGlobalsGui::onCallbackRounded); diff --git a/sources/appl/init.cpp b/sources/appl/init.cpp index a130e4d..111d0e5 100644 --- a/sources/appl/init.cpp +++ b/sources/appl/init.cpp @@ -70,7 +70,6 @@ class MainApplication : public ewol::context::Application { APPL_INFO("==> START ... " PROJECT_NAME " (BEGIN)"); // init internal global value globals::init(); - // init ALL Singleton : //()CTagsManager::getInstance(); m_bufferManager = appl::BufferManager::create();