[DEBUG] correct some super integration bug
This commit is contained in:
parent
badb11d80d
commit
1821f2927b
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<composer>
|
||||
<composer expand="true,false" fill="true,false">
|
||||
<sizer mode="hori" expand="true,false" fill="true" lock="true">
|
||||
<button name="SEARCH:close">
|
||||
<image src="THEME:GUI:Remove.edf" fill="true" size="7,7mm" distance-field="true"/>
|
||||
@ -13,60 +13,16 @@
|
||||
<image src="THEME:GUI:Replace.edf" fill="true" size="7,7mm" distance-field="true"/>
|
||||
</button>
|
||||
<button name="SEARCH:case" toggle="true">
|
||||
<image src="THEME:GUI:CaseSensitive.edf" fill="true" size="7,7mm" hover="Close search bar" distance-field="true"/>
|
||||
<image src="THEME:GUI:CaseSensitive.edf" fill="true" size="7,7mm" hover="Close search bar" distance-field="true"/>
|
||||
<image src="THEME:GUI:CaseSensitive.edf" fill="true" size="7,7mm" hover="_T(Close search bar)" distance-field="true"/>
|
||||
<image src="THEME:GUI:CaseSensitive.edf" fill="true" size="7,7mm" hover="_T(Close search bar)" distance-field="true"/>
|
||||
</button>
|
||||
<button name="SEARCH:wrap" toggle="true">
|
||||
<image src="THEME:GUI:WrapAround.edf" fill="true" size="7,7mm" hover="Close search bar" distance-field="true"/>
|
||||
<image src="THEME:GUI:WrapAround.edf" fill="true" size="7,7mm" hover="Close search bar" distance-field="true"/>
|
||||
<image src="THEME:GUI:WrapAround.edf" fill="true" size="7,7mm" hover="_T(Close search bar)" distance-field="true"/>
|
||||
<image src="THEME:GUI:WrapAround.edf" fill="true" size="7,7mm" hover="_T(Close search bar)" distance-field="true"/>
|
||||
</button>
|
||||
<button name="SEARCH:up-down" toggle="true">
|
||||
<image src="THEME:GUI:Up.edf" fill="true" size="7,7mm" hover="Close search bar" distance-field="true"/>
|
||||
<image src="THEME:GUI:Down.edf" fill="true" size="7,7mm" hover="Close search bar" distance-field="true"/>
|
||||
<image src="THEME:GUI:Up.edf" fill="true" size="7,7mm" hover="_T(Close search bar)" distance-field="true"/>
|
||||
<image src="THEME:GUI:Down.edf" fill="true" size="7,7mm" hover="_T(Close search bar)" distance-field="true"/>
|
||||
</button>
|
||||
<!--
|
||||
<image src="THEME:GUI:Add.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:AtoZ.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Attache.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:CaseSensitive.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Close.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Contact.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Down.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:FavoriteDisable.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:FavoriteEnable.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:FavoriteMiddle.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:File.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Folder.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Forbidden.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Help.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Home.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Info.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:List.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Load.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Lock.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Next.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:OpenMenu.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Parameter.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Undo.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Trash.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Search.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:SDCard.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Save.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Replace.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Remove.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Remove2.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Redo.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Quit.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Previous.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Update.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Up.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Validate.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:VolumeMax.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:VolumeMute.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:Warning.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:WhereAmI.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:WrapAround.svg" fill="true" size="7,7mm"/>
|
||||
<image src="THEME:GUI:ZoomIn.svg" fill="true" size="7,7mm"/>
|
||||
-->
|
||||
</sizer>
|
||||
</composer>
|
@ -26,6 +26,9 @@ namespace appl {
|
||||
int64_t posHLPass1;
|
||||
int64_t posHLPass2;
|
||||
};
|
||||
class Buffer;
|
||||
using BufferShared = ememory::SharedPtr<appl::Buffer>;
|
||||
using BufferWeak = ememory::WeakPtr<appl::Buffer>;
|
||||
class Buffer : public ewol::Object {
|
||||
public:
|
||||
class Iterator {
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -16,6 +16,10 @@
|
||||
#include <gale/resource/Resource.h>
|
||||
|
||||
namespace appl {
|
||||
class BufferManager;
|
||||
using BufferManagerShared = ememory::SharedPtr<appl::BufferManager>;
|
||||
using BufferManagerWeak = ememory::WeakPtr<appl::BufferManager>;
|
||||
// TODO: This is a service ...
|
||||
class BufferManager : public ewol::Object {
|
||||
public:
|
||||
esignal::ISignal<std::string> signalNewBuffer;
|
||||
@ -24,7 +28,6 @@ namespace appl {
|
||||
esignal::ISignal<std::shared_ptr<appl::Buffer>> signalRemoveBuffer;
|
||||
protected:
|
||||
BufferManager();
|
||||
void init(const std::string& _uniqueName);
|
||||
public:
|
||||
DECLARE_SINGLE_FACTORY(BufferManager, "???Buffer_Manager???");
|
||||
virtual ~BufferManager();
|
||||
|
@ -29,6 +29,9 @@ namespace appl {
|
||||
};
|
||||
};
|
||||
|
||||
class BufferView;
|
||||
using BufferViewShared = ememory::SharedPtr<BufferView>;
|
||||
using BufferViewWeak = ememory::WeakPtr<BufferView>;
|
||||
class BufferView : public ewol::widget::List {
|
||||
private:
|
||||
std::shared_ptr<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager
|
||||
|
@ -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<ewol::widget::Spacer> mySpacer;
|
||||
|
||||
mySpacer = ewol::widget::Spacer::create();
|
||||
@ -96,10 +97,11 @@ class ParameterAboutGui : public ewol::widget::Sizer {
|
||||
tmpLabel += " libPng, ogg-tremor, portaudio, libZip<br/>";
|
||||
tmpLabel += " tinyXml, freetype, agg2.4, etk<br/>";
|
||||
tmpLabel += "</left>";
|
||||
std::shared_ptr<ewol::widget::Label> myLabel = ewol::widget::Label::create(tmpLabel);
|
||||
std::shared_ptr<ewol::widget::Label> 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<ewol::widget::Sizer> mySizerVert;
|
||||
std::shared_ptr<ewol::widget::Sizer> mySizerVert2;
|
||||
std::shared_ptr<ewol::widget::Sizer> mySizerHori;
|
||||
ewol::widget::SizerShared mySizerVert;
|
||||
ewol::widget::SizerShared mySizerVert2;
|
||||
ewol::widget::SizerShared mySizerHori;
|
||||
std::shared_ptr<appl::TextViewer> myTextView;
|
||||
std::shared_ptr<appl::TextViewer> myTextView2;
|
||||
std::shared_ptr<BufferView> myBufferView;
|
||||
std::shared_ptr<ewol::widget::Menu> 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 = "<title>Properties</title>\n";
|
||||
menuDescription += "<group title='Editor'>\n";
|
||||
menuDescription += " <menu title='Editor Interface' short-title='Editor' widget='appl-text-viewer'>\n";
|
||||
menuDescription += "</group>\n";
|
||||
menuDescription += "<group title='Gui'>\n";
|
||||
menuDescription += " <menu title='Font selection' short-title='Font' widget=''>\n";
|
||||
menuDescription += " <menu title='Color selection' short-title='Color' widget=''>\n";
|
||||
menuDescription += " <menu title='Theme selection' short-title='Theme' widget=''>\n";
|
||||
menuDescription += "</group>\n";
|
||||
|
||||
tmpWidget->setMenu(menuDescription);
|
||||
#if 0
|
||||
std::string menuDescription = "<title>Properties</title>\n";
|
||||
menuDescription += "<group title='_T{Editor}'>\n";
|
||||
menuDescription += " <menu title='_T{Editor Interface}' short-title='Editor' widget='appl-text-viewer'>\n";
|
||||
menuDescription += "</group>\n";
|
||||
menuDescription += "<group title='_T{Gui}'>\n";
|
||||
menuDescription += " <menu title='Font selection' short-title='Font' widget=''>\n";
|
||||
menuDescription += " <menu title='Color selection' short-title='Color' widget=''>\n";
|
||||
menuDescription += " <menu title='Theme selection' short-title='Theme' widget=''>\n";
|
||||
menuDescription += "</group>\n";
|
||||
|
||||
tmpWidget->setMenu(menuDescription);
|
||||
#else
|
||||
tmpWidget->propertyLabelTitle.set("_T{Properties}");
|
||||
popUpWidgetPush(tmpWidget);
|
||||
tmpWidget->menuAddGroup("_T{Editor}");
|
||||
std::shared_ptr<ewol::Widget> 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<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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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<appl::Buffer> 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<appl::Buffer>& _buffer) {
|
||||
APPL_ERROR("Call With nullptr input...");
|
||||
return;
|
||||
}
|
||||
std::shared_ptr<appl::WorkerSaveFile> tmpObject = appl::WorkerSaveFile::create(_buffer->getFileName());
|
||||
std::shared_ptr<appl::WorkerSaveFile> tmpObject = appl::WorkerSaveFile::create("buffer-name", _buffer->getFileName());
|
||||
}
|
||||
|
||||
void MainWindows::closeNotSavedFile(const std::shared_ptr<appl::Buffer>& _buffer) {
|
||||
@ -516,28 +523,28 @@ void MainWindows::closeNotSavedFile(const std::shared_ptr<appl::Buffer>& _buffer
|
||||
APPL_ERROR("Can not create a simple pop-up");
|
||||
return;
|
||||
}
|
||||
tmpPopUp->setTitle("<bold>Close un-saved file:</bold>");
|
||||
tmpPopUp->setComment("The file named : <i>\"" + _buffer->getFileName() + "\"</i> is curently modify. <br/>If you don't saves these modifications,<br/>they will be definitly lost...");
|
||||
tmpPopUp->setTitle("<bold>_T{Close un-saved file:}</bold>");
|
||||
tmpPopUp->setComment("_T{The file named:} <i>\"" + _buffer->getFileName() + "\"</i> _T{is curently modify.} <br/>_T{If you don't saves these modifications,<br/>they will be definitly lost...}");
|
||||
std::shared_ptr<ewol::widget::Button> 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);
|
||||
}
|
||||
|
@ -20,8 +20,11 @@
|
||||
#include <appl/Gui/ViewerManager.h>
|
||||
class MainWindows : public ewol::widget::Windows {
|
||||
private:
|
||||
std::shared_ptr<ewol::widget::Label> m_widgetLabelFileName;
|
||||
std::shared_ptr<appl::widget::Search> 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();
|
||||
|
@ -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);
|
||||
|
@ -16,6 +16,9 @@
|
||||
#include <appl/Gui/ViewerManager.h>
|
||||
namespace appl {
|
||||
namespace widget {
|
||||
class Search;
|
||||
using SearchShared = ememory::SharedPtr<appl::widget::Search>;
|
||||
using SearchWeak = ememory::WeakPtr<appl::widget::Search>;
|
||||
class Search : public ewol::widget::Composer {
|
||||
private:
|
||||
std::shared_ptr<appl::ViewerManager> m_viewerManager; //!< handle on the buffer manager
|
||||
|
@ -33,7 +33,7 @@ appl::TagFileSelection::TagFileSelection() :
|
||||
|
||||
void appl::TagFileSelection::init() {
|
||||
ewol::widget::PopUp::init();
|
||||
std::shared_ptr<ewol::widget::Sizer> 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<ewol::widget::Composer> compose = ewol::widget::Composer::create(ewol::widget::Composer::String,
|
||||
"<sizer mode=\"hori\" expand=\"true,false\" lock=\"false,true\">\n"
|
||||
" <spacer expand=\"true,false\"/>\n"
|
||||
" <button name=\"PLUGIN-CTAGS-jump\" expand=\"false\" fill=\"true\">"
|
||||
" <sizer mode=\"hori\">\n"
|
||||
" <image src=\"THEME:GUI:Load.svg\" fill=\"true\" size=\"10,10mm\"/>\n"
|
||||
ewol::WidgetShared compose = ewol::widget::composerGenerateString(
|
||||
"<sizer mode='hori' expand='true,false' lock='false,true'>\n"
|
||||
" <spacer expand='true,false'/>\n"
|
||||
" <button name='PLUGIN-CTAGS-jump' expand='false' fill='true'>"
|
||||
" <sizer mode='hori'>\n"
|
||||
" <image src='THEME:GUI:Load.svg' fill='true' size='10,10mm'/>\n"
|
||||
" <label>Jump</label>\n"
|
||||
" </sizer>\n"
|
||||
" </button>\n"
|
||||
" <button name=\"PLUGIN-CTAGS-cancel\" expand=\"false\" fill=\"true\">"
|
||||
" <sizer mode=\"hori\">\n"
|
||||
" <image src=\"THEME:GUI:Remove.svg\" fill=\"true\" size=\"10,10mm\"/>\n"
|
||||
" <button name='PLUGIN-CTAGS-cancel' expand='false' fill='true'>"
|
||||
" <sizer mode='hori'>\n"
|
||||
" <image src='THEME:GUI:Remove.svg' fill='true' size='10,10mm'/>\n"
|
||||
" <label>Cancel</label>\n"
|
||||
" </sizer>\n"
|
||||
" </button>\n"
|
||||
"</sizer>\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<ewol::widget::Label> 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);
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -23,8 +23,14 @@
|
||||
|
||||
namespace appl {
|
||||
class textPluginManager;
|
||||
class TextViewer;
|
||||
using TextViewerShared = ememory::SharedPtr<appl::TextViewer>;
|
||||
using TextViewerWeak = ememory::WeakPtr<appl::TextViewer>;
|
||||
class TextViewer : public ewol::widget::WidgetScrolled {
|
||||
private:
|
||||
eproperty::Value<std::string> propertyFontName; //!< name of the font to display text.
|
||||
eproperty::Value<int32_t> propertyFontSize; //!< Size of the font to display text.
|
||||
|
||||
std::shared_ptr<appl::GlyphPainting> m_paintingProperties; //!< element painting property
|
||||
int32_t m_colorBackground;
|
||||
int32_t m_colorSpace;
|
||||
@ -39,7 +45,7 @@ namespace appl {
|
||||
std::shared_ptr<appl::ViewerManager> 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<std::pair<std::weak_ptr<appl::Buffer>, 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:
|
||||
|
@ -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() {
|
||||
|
||||
}
|
||||
|
@ -17,10 +17,12 @@
|
||||
|
||||
namespace appl {
|
||||
class TextViewer;
|
||||
class ViewerManager;
|
||||
using ViewerManagerShared = ememory::SharedPtr<appl::ViewerManager>;
|
||||
using ViewerManagerWeak = ememory::WeakPtr<appl::ViewerManager>;
|
||||
class ViewerManager : public ewol::Object {
|
||||
protected:
|
||||
ViewerManager();
|
||||
void init(const std::string& _uniqueName);
|
||||
public:
|
||||
DECLARE_SINGLE_FACTORY(ViewerManager, "???ViewerManager???");
|
||||
virtual ~ViewerManager();
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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<appl::Buffer> 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<appl::Buffer> tmpBuffer = m_bufferManager->get(m_bufferName);
|
||||
std::shared_ptr<appl::Buffer> 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<ewol::widget::Windows> 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<appl::Buffer> tmpBuffer = m_bufferManager->get(m_bufferName);
|
||||
std::shared_ptr<appl::Buffer> 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;
|
||||
}
|
||||
|
@ -18,14 +18,15 @@ namespace appl {
|
||||
public:
|
||||
esignal::ISignal<> signalSaveDone;
|
||||
esignal::ISignal<> signalAbort;
|
||||
eproperty::Value<std::string> propertyBufferName;
|
||||
eproperty::Value<bool> 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<ewol::widget::FileChooser> m_chooser; //! pop-up element that is open...
|
||||
std::shared_ptr<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager
|
||||
public: // callback function
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -17,19 +17,20 @@
|
||||
|
||||
namespace appl {
|
||||
class textPluginManager;
|
||||
class TextViewerPlugin;
|
||||
using TextViewerPluginShared = ememory::SharedPtr<TextViewerPlugin>;
|
||||
using TextViewerPluginWeak = ememory::WeakPtr<TextViewerPlugin>;
|
||||
class TextViewerPlugin : public ewol::Object {
|
||||
friend class appl::TextViewer;
|
||||
protected:
|
||||
std::weak_ptr<appl::textPluginManager> m_pluginManager;
|
||||
protected:
|
||||
TextViewerPlugin();
|
||||
void init();
|
||||
void init(const std::string& _name);
|
||||
public:
|
||||
DECLARE_FACTORY(TextViewerPlugin);
|
||||
virtual ~TextViewerPlugin();
|
||||
protected:
|
||||
std::weak_ptr<ewol::widget::Menu> m_menuInterface;
|
||||
ewol::widget::MenuWeak m_menuInterface;
|
||||
private:
|
||||
bool m_isEnable; //!< The plugin is enable or not (for all viewer).
|
||||
public:
|
||||
|
@ -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) {
|
||||
|
@ -19,7 +19,6 @@ namespace appl {
|
||||
class TextPluginAutoIndent : public appl::TextViewerPlugin {
|
||||
protected:
|
||||
TextPluginAutoIndent();
|
||||
void init();
|
||||
public:
|
||||
DECLARE_FACTORY(TextPluginAutoIndent);
|
||||
virtual ~TextPluginAutoIndent() {
|
||||
|
@ -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<ewol::widget::Menu> menu = m_menuInterface.lock();
|
||||
|
@ -25,7 +25,6 @@ namespace appl {
|
||||
int32_t m_menuIdRemove;
|
||||
protected:
|
||||
TextPluginCopy();
|
||||
void init();
|
||||
public:
|
||||
DECLARE_FACTORY(TextPluginCopy);
|
||||
virtual ~TextPluginCopy() {
|
||||
|
@ -28,11 +28,6 @@ appl::TextPluginCtags::TextPluginCtags() :
|
||||
addObjectType("appl::TextPluginCtags");
|
||||
}
|
||||
|
||||
void appl::TextPluginCtags::init() {
|
||||
appl::TextViewerPlugin::init();
|
||||
}
|
||||
|
||||
|
||||
appl::TextPluginCtags::~TextPluginCtags() {
|
||||
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ namespace appl {
|
||||
std::shared_ptr<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager
|
||||
protected:
|
||||
TextPluginCtags();
|
||||
void init();
|
||||
public:
|
||||
DECLARE_FACTORY(TextPluginCtags);
|
||||
virtual ~TextPluginCtags();
|
||||
|
@ -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() {
|
||||
|
@ -25,10 +25,6 @@ appl::TextPluginHistory::TextPluginHistory() :
|
||||
addObjectType("appl::TextPluginHistory");
|
||||
}
|
||||
|
||||
void appl::TextPluginHistory::init() {
|
||||
appl::TextViewerPluginData<appl::PluginHistoryData>::init();
|
||||
}
|
||||
|
||||
|
||||
void appl::TextPluginHistory::onPluginEnable(appl::TextViewer& _textDrawer) {
|
||||
std::shared_ptr<ewol::widget::Menu> menu = m_menuInterface.lock();
|
||||
|
@ -42,7 +42,6 @@ namespace appl {
|
||||
int32_t m_menuIdRedo;
|
||||
protected:
|
||||
TextPluginHistory();
|
||||
void init();
|
||||
public:
|
||||
DECLARE_FACTORY(TextPluginHistory);
|
||||
virtual ~TextPluginHistory() { };
|
||||
|
@ -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) {
|
||||
|
@ -19,7 +19,6 @@ namespace appl {
|
||||
class TextPluginMultiLineTab : public appl::TextViewerPlugin {
|
||||
protected:
|
||||
TextPluginMultiLineTab();
|
||||
void init();
|
||||
public:
|
||||
DECLARE_FACTORY(TextPluginMultiLineTab);
|
||||
virtual ~TextPluginMultiLineTab() {
|
||||
|
@ -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 :
|
||||
|
@ -19,7 +19,6 @@ namespace appl {
|
||||
class TextPluginRmLine : public appl::TextViewerPlugin {
|
||||
protected:
|
||||
TextPluginRmLine();
|
||||
void init();
|
||||
public:
|
||||
DECLARE_FACTORY(TextPluginRmLine);
|
||||
virtual ~TextPluginRmLine() {
|
||||
|
@ -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<ewol::widget::Menu> menu = m_menuInterface.lock();
|
||||
|
@ -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;
|
||||
|
@ -9,6 +9,6 @@
|
||||
#include <appl/debug.h>
|
||||
|
||||
int32_t appl::getLogId() {
|
||||
static int32_t g_val = etk::log::registerInstance("edn");
|
||||
static int32_t g_val = elog::registerInstance("edn");
|
||||
return g_val;
|
||||
}
|
||||
|
@ -9,12 +9,12 @@
|
||||
#ifndef __APPL_DEBUG_H__
|
||||
#define __APPL_DEBUG_H__
|
||||
|
||||
#include <etk/log.h>
|
||||
#include <elog/log.h>
|
||||
|
||||
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)
|
||||
|
@ -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<ewol::widget::CheckBox> myCheckbox;
|
||||
std::shared_ptr<ewol::widget::Spacer> 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);
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user