[DEV] continue removing stl

This commit is contained in:
2017-08-28 00:09:10 +02:00
parent 34af3f6bb2
commit f655155aa4
55 changed files with 394 additions and 535 deletions

View File

@@ -12,8 +12,8 @@
#include <ewol/object/Object.hpp>
// TODO : write it better
static void SortElementList(std::vector<appl::dataBufferStruct>& _list) {
std::vector<appl::dataBufferStruct> tmpList = _list;
static void SortElementList(etk::Vector<appl::dataBufferStruct>& _list) {
etk::Vector<appl::dataBufferStruct> tmpList = _list;
_list.clear();
for(size_t iii=0; iii<tmpList.size(); iii++) {
size_t findPos = 0;
@@ -75,13 +75,13 @@ void BufferView::insertAlphabetic(const appl::dataBufferStruct& _dataStruct, boo
return;
}
}
m_list.push_back(_dataStruct);
m_list.pushBack(_dataStruct);
if (_selectNewPosition == true) {
m_selectedID = m_list.size()-1;
}
}
void BufferView::onCallbackNewBuffer(const std::string& _value) {
void BufferView::onCallbackNewBuffer(const etk::String& _value) {
ememory::SharedPtr<appl::Buffer> buffer = m_bufferManager->get(_value);
if (buffer == nullptr) {
APPL_ERROR("event on element nor exist : " << _value);
@@ -92,7 +92,7 @@ void BufferView::onCallbackNewBuffer(const std::string& _value) {
buffer->signalChangeName.connect(sharedFromThis(), &BufferView::onCallbackChangeName);
appl::dataBufferStruct tmp(_value, buffer);
if (m_openOrderMode == true) {
m_list.push_back(tmp);
m_list.pushBack(tmp);
} else {
insertAlphabetic(tmp);
}
@@ -107,7 +107,7 @@ void BufferView::onCallbackNewBuffer(const std::string& _value) {
}
// TODO : Review this callback with the real shared_ptr on the buffer ...
void BufferView::onCallbackselectNewFile(const std::string& _value) {
void BufferView::onCallbackselectNewFile(const etk::String& _value) {
m_selectedID = -1;
for (size_t iii=0; iii<m_list.size(); iii++) {
if (m_list[iii].m_buffer == nullptr) {
@@ -171,7 +171,7 @@ uint32_t BufferView::getNuberOfColomn() {
return 1;
}
bool BufferView::getTitle(int32_t _colomn, std::string &_myTitle, etk::Color<> &_fg, etk::Color<> &_bg) {
bool BufferView::getTitle(int32_t _colomn, etk::String &_myTitle, etk::Color<> &_fg, etk::Color<> &_bg) {
_myTitle = "Buffers : ";
return true;
}
@@ -180,7 +180,7 @@ uint32_t BufferView::getNuberOfRaw() {
return m_list.size();
}
bool BufferView::getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) {
bool BufferView::getElement(int32_t _colomn, int32_t _raw, etk::String& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) {
if( _raw >= 0
&& _raw<(int64_t)m_list.size() ) {
_myTextToWrite = m_list[_raw].m_bufferName.getNameFile();

View File

@@ -16,7 +16,7 @@ namespace appl {
public:
etk::FSNode m_bufferName;
ememory::SharedPtr<appl::Buffer> m_buffer;
dataBufferStruct(const std::string& _bufferName, const ememory::SharedPtr<appl::Buffer>& _buffer) :
dataBufferStruct(const etk::String& _bufferName, const ememory::SharedPtr<appl::Buffer>& _buffer) :
m_bufferName(_bufferName),
m_buffer(_buffer) {
@@ -41,7 +41,7 @@ class BufferView : public ewol::widget::List {
private:
int32_t m_selectedIdRequested;
int32_t m_selectedID;
std::vector<appl::dataBufferStruct> m_list;
etk::Vector<appl::dataBufferStruct> m_list;
/**
* @brief Insert the element in the alphabetic order.
* @param[in] _dataStruct element to add.
@@ -62,16 +62,16 @@ class BufferView : public ewol::widget::List {
void removeAllElement();
// Derived function
virtual uint32_t getNuberOfColomn();
virtual bool getTitle(int32_t _colomn, std::string& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg);
virtual bool getTitle(int32_t _colomn, etk::String& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg);
virtual uint32_t getNuberOfRaw();
virtual bool getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg);
virtual bool getElement(int32_t _colomn, int32_t _raw, etk::String& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg);
virtual bool onItemEvent(int32_t _IdInput, enum gale::key::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y);
private: //callback function:
void onCallbackChangeName();
void onCallbackIsSave();
void onCallbackIsModify();
void onCallbackNewBuffer(const std::string& _value);
void onCallbackselectNewFile(const std::string& _value);
void onCallbackNewBuffer(const etk::String& _value);
void onCallbackselectNewFile(const etk::String& _value);
void onCallbackBufferRemoved(const ememory::SharedPtr<appl::Buffer>& _buffer);
};

View File

@@ -33,7 +33,7 @@
#include <appl/Gui/WorkerCloseAllFile.hpp>
namespace appl {
std::string getVersion() {
etk::String getVersion() {
return APPL_VERSION;
}
@@ -59,7 +59,7 @@ class ParameterAboutGui : public ewol::widget::Sizer {
mySpacer->propertyExpand.set(bvec2(true,true));
subWidgetAdd(mySpacer);
}
std::string tmpLabel = "<left>";
etk::String tmpLabel = "<left>";
tmpLabel += " <b>Editeur De N'ours</b> : v:";
tmpLabel += appl::getVersion();
tmpLabel += "<br/>";
@@ -242,12 +242,12 @@ MainWindows::~MainWindows() {
}
void MainWindows::onCallbackShortCut(const std::string& _value) {
void MainWindows::onCallbackShortCut(const etk::String& _value) {
APPL_WARNING("Event from ShortCut : " << _value);
onCallbackMenuEvent(_value);
}
void MainWindows::onCallbackMenuEvent(const std::string& _value) {
void MainWindows::onCallbackMenuEvent(const etk::String& _value) {
APPL_WARNING("Event from Menu : " << _value);
if (_value == "menu:new") {
if (m_bufferManager != nullptr) {
@@ -320,14 +320,14 @@ void MainWindows::onCallbackMenuEvent(const std::string& _value) {
APPL_TODO("Event from Menu : " << _value);
} else if ( _value == "menu:color:color/black/"
|| _value == "menu:color:color/white/") {
etk::theme::setName("COLOR", std::string(_value, 11));
EWOL_ERROR("Select Shape or Color : 'COLOR'='" << std::string(_value, 11) << "'");
etk::theme::setName("COLOR", etk::String(_value, 11));
EWOL_ERROR("Select Shape or Color : 'COLOR'='" << etk::String(_value, 11) << "'");
ewol::getContext().getResourcesManager().reLoadResources();
ewol::getContext().forceRedrawAll();
} else if ( _value == "menu:shape:shape/square/"
|| _value == "menu:shape:shape/round/") {
EWOL_ERROR("Select Shape or Color : 'GUI'='" << std::string(_value, 11) << "'");
etk::theme::setName("GUI", std::string(_value, 11));
EWOL_ERROR("Select Shape or Color : 'GUI'='" << etk::String(_value, 11) << "'");
etk::theme::setName("GUI", etk::String(_value, 11));
ewol::getContext().getResourcesManager().reLoadResources();
ewol::getContext().forceRedrawAll();
} else if (_value == "menu:reloadShape") {
@@ -430,7 +430,7 @@ void MainWindows::displayProperty() {
return;
}
#if 0
std::string menuDescription = "<title>Properties</title>\n";
etk::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";
@@ -456,7 +456,7 @@ void MainWindows::displayProperty() {
#endif
}
void MainWindows::onCallbackselectNewFile(const std::string& _value) {
void MainWindows::onCallbackselectNewFile(const etk::String& _value) {
APPL_INFO("onCallbackselectNewFile(" << _value << ")");
if (m_bufferManager == nullptr) {
APPL_ERROR("can not call unexistant buffer manager ... ");
@@ -474,7 +474,7 @@ void MainWindows::onCallbackselectNewFile(const std::string& _value) {
}
}
void MainWindows::onCallbackPopUpFileSelected(const std::string& _value) {
void MainWindows::onCallbackPopUpFileSelected(const etk::String& _value) {
APPL_INFO("onCallbackPopUpFileSelected(" << _value << ")");
APPL_DEBUG("Request opening the file : " << _value);
m_bufferManager->open(_value);
@@ -494,8 +494,8 @@ void MainWindows::onCallbackTitleUpdate() {
m_widgetLabelFileName->propertyValue.set("");
}
} else {
std::string nameFileSystem = etk::FSNode(tmpp->getFileName()).getFileSystemName();
propertyTitle.set(std::string("Edn : ") + (tmpp->isModify()==true?" *":"") + nameFileSystem);
etk::String nameFileSystem = etk::FSNode(tmpp->getFileName()).getFileSystemName();
propertyTitle.set(etk::String("Edn : ") + (tmpp->isModify()==true?" *":"") + nameFileSystem);
if (m_widgetLabelFileName != nullptr) {
m_widgetLabelFileName->propertyValue.set(nameFileSystem + (tmpp->isModify()==true?" *":""));
}

View File

@@ -44,11 +44,11 @@ class MainWindows : public ewol::widget::Windows {
void displayOpen();
void displayProperty();
private:
void onCallbackPopUpFileSelected(const std::string& _value);
void onCallbackPopUpFileSelected(const etk::String& _value);
void onCallbackTitleUpdate();
void onCallbackMenuEvent(const std::string& _value);
void onCallbackShortCut(const std::string& _value);
void onCallbackselectNewFile(const std::string& _value);
void onCallbackMenuEvent(const etk::String& _value);
void onCallbackShortCut(const etk::String& _value);
void onCallbackselectNewFile(const etk::String& _value);
};

View File

@@ -23,23 +23,23 @@ void appl::widget::Search::init() {
loadFromFile("DATA:GUI-Search.xml", getId());
m_viewerManager = appl::ViewerManager::create();
// link event
subBind(ewol::widget::Button, "[" + etk::to_string(getId()) + "]SEARCH:close", signalPressed, sharedFromThis(), &appl::widget::Search::OnCallbackHide);
subBind(ewol::widget::Entry, "[" + etk::to_string(getId()) + "]SEARCH:search-entry", signalModify, sharedFromThis(), &appl::widget::Search::OnCallbackSearchValue);
subBind(ewol::widget::Entry, "[" + etk::to_string(getId()) + "]SEARCH:search-entry", signalEnter, sharedFromThis(), &appl::widget::Search::OnCallbackSearchEntryValidate);
subBind(ewol::widget::Button, "[" + etk::to_string(getId()) + "]SEARCH:search", signalPressed, sharedFromThis(), &appl::widget::Search::OnCallbackSearch);
subBind(ewol::widget::Entry, "[" + etk::to_string(getId()) + "]SEARCH:replace-entry", signalModify, sharedFromThis(), &appl::widget::Search::OnCallbackReplaceValue);
subBind(ewol::widget::Entry, "[" + etk::to_string(getId()) + "]SEARCH:replace-entry", signalEnter, sharedFromThis(), &appl::widget::Search::OnCallbackReplaceEntryValidate);
subBind(ewol::widget::Button, "[" + etk::to_string(getId()) + "]SEARCH:replace", signalPressed, sharedFromThis(), &appl::widget::Search::OnCallbackReplace);
subBind(ewol::widget::Button, "[" + etk::to_string(getId()) + "]SEARCH:case", signalValue, sharedFromThis(), &appl::widget::Search::OnCallbackCase);
subBind(ewol::widget::Button, "[" + etk::to_string(getId()) + "]SEARCH:wrap", signalValue, sharedFromThis(), &appl::widget::Search::OnCallbackWrap);
subBind(ewol::widget::Button, "[" + etk::to_string(getId()) + "]SEARCH:up-down", signalValue, sharedFromThis(), &appl::widget::Search::OnCallbackForward);
subBind(ewol::widget::Button, "[" + etk::toString(getId()) + "]SEARCH:close", signalPressed, sharedFromThis(), &appl::widget::Search::OnCallbackHide);
subBind(ewol::widget::Entry, "[" + etk::toString(getId()) + "]SEARCH:search-entry", signalModify, sharedFromThis(), &appl::widget::Search::OnCallbackSearchValue);
subBind(ewol::widget::Entry, "[" + etk::toString(getId()) + "]SEARCH:search-entry", signalEnter, sharedFromThis(), &appl::widget::Search::OnCallbackSearchEntryValidate);
subBind(ewol::widget::Button, "[" + etk::toString(getId()) + "]SEARCH:search", signalPressed, sharedFromThis(), &appl::widget::Search::OnCallbackSearch);
subBind(ewol::widget::Entry, "[" + etk::toString(getId()) + "]SEARCH:replace-entry", signalModify, sharedFromThis(), &appl::widget::Search::OnCallbackReplaceValue);
subBind(ewol::widget::Entry, "[" + etk::toString(getId()) + "]SEARCH:replace-entry", signalEnter, sharedFromThis(), &appl::widget::Search::OnCallbackReplaceEntryValidate);
subBind(ewol::widget::Button, "[" + etk::toString(getId()) + "]SEARCH:replace", signalPressed, sharedFromThis(), &appl::widget::Search::OnCallbackReplace);
subBind(ewol::widget::Button, "[" + etk::toString(getId()) + "]SEARCH:case", signalValue, sharedFromThis(), &appl::widget::Search::OnCallbackCase);
subBind(ewol::widget::Button, "[" + etk::toString(getId()) + "]SEARCH:wrap", signalValue, sharedFromThis(), &appl::widget::Search::OnCallbackWrap);
subBind(ewol::widget::Button, "[" + etk::toString(getId()) + "]SEARCH:up-down", signalValue, sharedFromThis(), &appl::widget::Search::OnCallbackForward);
// set default properties
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]SEARCH:case", "value", etk::to_string(m_caseSensitive));
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]SEARCH:wrap", "value", etk::to_string(m_wrap));
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]SEARCH:up-down", "value", etk::to_string(m_forward));
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]SEARCH:case", "value", etk::to_string(m_caseSensitive));
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]SEARCH:wrap", "value", etk::to_string(m_wrap));
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]SEARCH:up-down", "value", etk::to_string(m_forward));
// get widget
m_searchEntry = ememory::dynamicPointerCast<ewol::widget::Entry>(getSubObjectNamed("[" + etk::to_string(getId()) + "]SEARCH:search-entry"));
m_replaceEntry = ememory::dynamicPointerCast<ewol::widget::Entry>(getSubObjectNamed("[" + etk::to_string(getId()) + "]SEARCH:replace-entry"));
m_searchEntry = ememory::dynamicPointerCast<ewol::widget::Entry>(getSubObjectNamed("[" + etk::toString(getId()) + "]SEARCH:search-entry"));
m_replaceEntry = ememory::dynamicPointerCast<ewol::widget::Entry>(getSubObjectNamed("[" + etk::toString(getId()) + "]SEARCH:replace-entry"));
// basicly hiden ...
propertyHide.set(true);
}
@@ -104,25 +104,25 @@ void appl::widget::Search::replace() {
void appl::widget::Search::OnCallbackHide() {
propertyHide.set(true);
}
void appl::widget::Search::OnCallbackSearchValue(const std::string& _value) {
m_searchData = etk::to_u32string(_value);
void appl::widget::Search::OnCallbackSearchValue(const etk::String& _value) {
m_searchData = etk::toUString(_value);
}
void appl::widget::Search::OnCallbackSearch() {
find();
}
void appl::widget::Search::OnCallbackSearchEntryValidate(const std::string& _value) {
m_searchData = etk::to_u32string(_value);
void appl::widget::Search::OnCallbackSearchEntryValidate(const etk::String& _value) {
m_searchData = etk::toUString(_value);
find();
}
void appl::widget::Search::OnCallbackReplaceValue(const std::string& _value) {
m_replaceData = etk::to_u32string(_value);
void appl::widget::Search::OnCallbackReplaceValue(const etk::String& _value) {
m_replaceData = etk::toUString(_value);
}
void appl::widget::Search::OnCallbackReplace() {
replace();
find();
}
void appl::widget::Search::OnCallbackReplaceEntryValidate(const std::string& _value) {
m_replaceData = etk::to_u32string(_value);
void appl::widget::Search::OnCallbackReplaceEntryValidate(const etk::String& _value) {
m_replaceData = etk::toUString(_value);
replace();
find();
}

View File

@@ -22,8 +22,8 @@ namespace appl {
bool m_wrap;
ememory::SharedPtr<ewol::widget::Entry> m_searchEntry;
ememory::SharedPtr<ewol::widget::Entry> m_replaceEntry;
std::u32string m_searchData;
std::u32string m_replaceData;
etk::UString m_searchData;
etk::UString m_replaceData;
protected:
// Constructeur
Search();
@@ -47,12 +47,12 @@ namespace appl {
bool isSelectReplace();
private: // callback functions
void OnCallbackHide();
void OnCallbackSearchValue(const std::string& _value);
void OnCallbackSearchValue(const etk::String& _value);
void OnCallbackSearch();
void OnCallbackSearchEntryValidate(const std::string& _value);
void OnCallbackReplaceValue(const std::string& _value);
void OnCallbackSearchEntryValidate(const etk::String& _value);
void OnCallbackReplaceValue(const etk::String& _value);
void OnCallbackReplace();
void OnCallbackReplaceEntryValidate(const std::string& _value);
void OnCallbackReplaceEntryValidate(const etk::String& _value);
void OnCallbackCase(const bool& _value);
void OnCallbackWrap(const bool& _value);
void OnCallbackForward(const bool& _value);

View File

@@ -41,7 +41,7 @@ uint32_t appl::TagFileList::getNuberOfColomn() {
return 2;
}
bool appl::TagFileList::getTitle(int32_t _colomn, std::string& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg) {
bool appl::TagFileList::getTitle(int32_t _colomn, etk::String& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg) {
_myTitle = "title";
return true;
}
@@ -50,10 +50,10 @@ uint32_t appl::TagFileList::getNuberOfRaw() {
return m_list.size();
}
bool appl::TagFileList::getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) {
bool appl::TagFileList::getElement(int32_t _colomn, int32_t _raw, etk::String& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) {
if (_raw >= 0 && (size_t)_raw < m_list.size() && nullptr != m_list[_raw]) {
if (0 == _colomn) {
_myTextToWrite = etk::to_string(m_list[_raw]->fileLine);
_myTextToWrite = etk::toString(m_list[_raw]->fileLine);
} else {
_myTextToWrite = m_list[_raw]->filename;
}
@@ -87,9 +87,9 @@ bool appl::TagFileList::onItemEvent(int32_t _IdInput, enum gale::key::status _ty
&& m_selectedLine < (int64_t)m_list.size()
&& nullptr != m_list[m_selectedLine] ) {
if (previousRaw != m_selectedLine) {
signalSelect.emit(etk::to_string(m_list[_raw]->fileLine)+":"+m_list[m_selectedLine]->filename);
signalSelect.emit(etk::toString(m_list[_raw]->fileLine)+":"+m_list[m_selectedLine]->filename);
} else {
signalValidate.emit(etk::to_string(m_list[_raw]->fileLine)+":"+m_list[m_selectedLine]->filename);
signalValidate.emit(etk::toString(m_list[_raw]->fileLine)+":"+m_list[m_selectedLine]->filename);
}
} else {
signalUnSelect.emit();
@@ -108,10 +108,10 @@ bool appl::TagFileList::onItemEvent(int32_t _IdInput, enum gale::key::status _ty
* @param[in] file Compleate file name
* @param[in] jump line id
*/
void appl::TagFileList::add(std::string& _file, int32_t _line) {
void appl::TagFileList::add(etk::String& _file, int32_t _line) {
appl::TagListElement *tmpFile = new appl::TagListElement(_file, _line);
if (nullptr != tmpFile) {
m_list.push_back(tmpFile);
m_list.pushBack(tmpFile);
}
markToRedraw();
}

View File

@@ -11,9 +11,9 @@
namespace appl {
class TagListElement {
public:
std::string filename;
etk::String filename;
int32_t fileLine;
TagListElement(std::string& _file, int32_t _line) :
TagListElement(etk::String& _file, int32_t _line) :
filename(_file),
fileLine(_line) {
@@ -24,12 +24,12 @@ namespace appl {
};
class TagFileList : public ewol::widget::List {
public:
esignal::Signal<std::string> signalSelect;
esignal::Signal<std::string> signalValidate;
esignal::Signal<etk::String> signalSelect;
esignal::Signal<etk::String> signalValidate;
esignal::Signal<> signalUnSelect;
private:
int32_t m_selectedLine;
std::vector<appl::TagListElement*> m_list;
etk::Vector<appl::TagListElement*> m_list;
protected:
ememory::SharedPtr<ewol::resource::ColorFile> m_colorProperty; //!< theme color property.
int32_t m_colorIdText; //!< Color of the text.
@@ -45,9 +45,9 @@ namespace appl {
// display API :
virtual etk::Color<> getBasicBG();
uint32_t getNuberOfColomn();
bool getTitle(int32_t _colomn, std::string& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg);
bool getTitle(int32_t _colomn, etk::String& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg);
uint32_t getNuberOfRaw();
bool getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg);
bool getElement(int32_t _colomn, int32_t _raw, etk::String& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg);
bool onItemEvent(int32_t _IdInput, enum gale::key::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y);
public:
/**
@@ -55,7 +55,7 @@ namespace appl {
* @param[in] file Compleate file name
* @param[in] jump line id
*/
void add(std::string& _file, int32_t _line);
void add(etk::String& _file, int32_t _line);
};
}

View File

@@ -9,7 +9,7 @@
#include <ewol/widget/Spacer.hpp>
#include <ewol/widget/Image.hpp>
#include <ewol/widget/Manager.hpp>
#include <vector>
#include <etk/Vector.hpp>
#include <etk/tool.hpp>
#include <ewol/widget/Button.hpp>
#include <ewol/widget/Label.hpp>
@@ -104,13 +104,13 @@ void appl::TagFileSelection::onCallbackCtagsCancel() {
autoDestroy();
}
void appl::TagFileSelection::onCallbackCtagsListValidate(const std::string& _value) {
void appl::TagFileSelection::onCallbackCtagsListValidate(const etk::String& _value) {
signalSelect.emit(_value);
// == > Auto remove ...
autoDestroy();
}
void appl::TagFileSelection::onCallbackCtagsListSelect(const std::string& _value) {
void appl::TagFileSelection::onCallbackCtagsListSelect(const etk::String& _value) {
m_eventNamed = _value;
}
@@ -125,7 +125,7 @@ void appl::TagFileSelection::onCallbackCtagsListUnSelect() {
* @param[in] file Compleate file name
* @param[in] jump line id
*/
void appl::TagFileSelection::addCtagsNewItem(std::string _file, int32_t _line) {
void appl::TagFileSelection::addCtagsNewItem(etk::String _file, int32_t _line) {
if (m_listTag != nullptr) {
m_listTag->add(_file, _line);
}

View File

@@ -11,11 +11,11 @@
namespace appl {
class TagFileSelection : public ewol::widget::PopUp {
public:
esignal::Signal<std::string> signalSelect;
esignal::Signal<etk::String> signalSelect;
esignal::Signal<> signalCancel;
private:
ememory::SharedPtr<appl::TagFileList> m_listTag;
std::string m_eventNamed;
etk::String m_eventNamed;
public:
TagFileSelection();
void init();
@@ -27,12 +27,12 @@ namespace appl {
* @param[in] file Compleate file name
* @param[in] jump line id
*/
void addCtagsNewItem(std::string file, int32_t line);
void addCtagsNewItem(etk::String file, int32_t line);
public: // callback function
void onCallbackCtagsSelection();
void onCallbackCtagsCancel();
void onCallbackCtagsListValidate(const std::string& _value);
void onCallbackCtagsListSelect(const std::string& _value);
void onCallbackCtagsListValidate(const etk::String& _value);
void onCallbackCtagsListSelect(const etk::String& _value);
void onCallbackCtagsListUnSelect();
};
}

View File

@@ -76,14 +76,14 @@ appl::TextViewer::~TextViewer() {
m_pluginManager->disconnect(*this);
}
void appl::TextViewer::onCallbackShortCut(const std::string& _value) {
void appl::TextViewer::onCallbackShortCut(const etk::String& _value) {
if (m_pluginManager->onReceiveShortCut(*this, _value) == true) {
return;
}
}
void appl::TextViewer::onCallbackselectNewFile(const std::string& _value) {
void appl::TextViewer::onCallbackselectNewFile(const etk::String& _value) {
APPL_INFO("Select new file: " << _value);
if (isSelectedLast() == false) {
return;
@@ -109,7 +109,7 @@ void appl::TextViewer::onCallbackselectNewFile(const std::string& _value) {
++it;
}
if (needAdd == true) {
m_drawingRemenber.push_back(std::make_pair(ememory::WeakPtr<appl::Buffer>(m_buffer), m_originScrooled));
m_drawingRemenber.pushBack(etk::makePair(ememory::WeakPtr<appl::Buffer>(m_buffer), m_originScrooled));
APPL_VERBOSE("Push origin : " << m_originScrooled);
}
}
@@ -134,16 +134,16 @@ void appl::TextViewer::onCallbackselectNewFile(const std::string& _value) {
return;
}
std::string appl::TextViewer::getBufferPath() {
etk::String appl::TextViewer::getBufferPath() {
if (m_buffer == nullptr) {
return "";
}
std::string filename = m_buffer->getFileName();
etk::String filename = m_buffer->getFileName();
size_t pos = filename.rfind('/');
if (pos == std::string::npos) {
if (pos == etk::String::npos) {
return "";
}
return std::string(filename, 0, pos);
return etk::String(filename, 0, pos);
}
@@ -176,10 +176,10 @@ void appl::TextViewer::onRegenerateDisplay() {
if (m_buffer == nullptr) {
m_maxSize.setX(256);
m_maxSize.setY(256);
float textEndAlignament = std::max(11.0f, m_size.x()-20.0f);
float textEndAlignament = etk::max(11.0f, m_size.x()-20.0f);
m_displayText.setTextAlignement(10, textEndAlignament, ewol::compositing::alignLeft);
m_displayText.setRelPos(vec3(10, 0, 0));
std::string tmpString("<br/>\n"
etk::String tmpString("<br/>\n"
"<font color=\"red\">\n"
" <b>\n"
" edn - Editeur De N'ours\n"
@@ -189,7 +189,7 @@ void appl::TextViewer::onRegenerateDisplay() {
"<br/>\n"
"<font color=\"indigo\">\n"
" <i>\n"
" No Buffer Availlable to display\n" + etk::to_string(m_size) +
" No Buffer Availlable to display\n" + etk::toString(m_size) +
" </i>\n"
"</font>\n");
m_displayText.setPos(vec3(0.0f, m_size.y(), 0.0f) );
@@ -207,7 +207,7 @@ void appl::TextViewer::onRegenerateDisplay() {
float countNbLine = 1;
int32_t countColomn = 0;
// the siplay string :
std::u32string stringToDisplay;
etk::UString stringToDisplay;
appl::Buffer::Iterator selectPosStart = m_buffer->begin();
appl::Buffer::Iterator selectPosStop = m_buffer->begin();
if (m_buffer->hasTextSelected() == true) {
@@ -285,7 +285,7 @@ void appl::TextViewer::onRegenerateDisplay() {
if (*it == u32char::Return) {
countNbLine += 1;
countColomn = 0;
maxSizeX = std::max(m_displayText.getPos().x(), maxSizeX);
maxSizeX = etk::max(m_displayText.getPos().x(), maxSizeX);
// Display the end line position only if we have the focus ...
if ( ( displayCursorAndSelection == true
&& it >= selectPosStart
@@ -349,7 +349,7 @@ void appl::TextViewer::onRegenerateDisplay() {
tmpCursorPosition = m_displayText.getPos();
tmpCursorLenght = 5;
}
maxSizeX = std::max(m_displayText.getPos().x(), maxSizeX);
maxSizeX = etk::max(m_displayText.getPos().x(), maxSizeX);
// Display cursor only if we have the focus ...
if ( tmpCursorPosition.z() != -1
&& getFocus() == true) {
@@ -436,7 +436,7 @@ bool appl::TextViewer::onEventEntry(const ewol::event::Entry& _event) {
replace(output, pos, posEnd);
//TODO : choice UTF ... replace(localValue, pos, posEnd);
} else {
std::string myString = output;
etk::String myString = output;
write(myString);
}
return true;
@@ -545,7 +545,7 @@ bool appl::TextViewer::onEventInput(const ewol::event::Input& _event) {
moveCursor(newPos);
m_buffer->setSelectMode(false);
// Copy selection :
std::string value;
etk::String value;
m_buffer->copy(value);
if (value.size() != 0) {
gale::context::clipBoard::set(gale::context::clipBoard::clipboardSelection, value);
@@ -565,7 +565,7 @@ bool appl::TextViewer::onEventInput(const ewol::event::Input& _event) {
} else if (_event.getStatus() == gale::key::status::pressDouble) {
mouseEventDouble();
// Copy selection :
std::string value;
etk::String value;
m_buffer->copy(value);
if (value.size() != 0) {
gale::context::clipBoard::set(gale::context::clipBoard::clipboardSelection, value);
@@ -575,7 +575,7 @@ bool appl::TextViewer::onEventInput(const ewol::event::Input& _event) {
} else if (_event.getStatus() == gale::key::status::pressTriple) {
mouseEventTriple();
// Copy selection :
std::string value;
etk::String value;
m_buffer->copy(value);
if (value.size() != 0) {
gale::context::clipBoard::set(gale::context::clipBoard::clipboardSelection, value);
@@ -633,7 +633,7 @@ appl::Buffer::Iterator appl::TextViewer::getMousePosition(const vec2& _relativeP
vec3 positionCurentDisplay(0,0,0);
vec3 tmpLetterSize = m_displayText.calculateSize((char32_t)'A');
int32_t countColomn = 0;
std::u32string stringToDisplay;
etk::UString stringToDisplay;
m_displayText.clear();
m_displayText.forceLineReturn();
positionCurentDisplay = m_displayText.getPos();
@@ -680,7 +680,7 @@ appl::Buffer::Iterator appl::TextViewer::getMousePosition(const vec2& _relativeP
void appl::TextViewer::onEventClipboard(enum gale::context::clipBoard::clipboardListe _clipboardID) {
if (m_buffer != nullptr) {
std::string data = gale::context::clipBoard::get(_clipboardID);
etk::String data = gale::context::clipBoard::get(_clipboardID);
write(data);
}
markToRedraw();
@@ -760,7 +760,7 @@ bool appl::TextViewer::moveCursor(const appl::Buffer::Iterator& _pos) {
return true;
}
bool appl::TextViewer::write(const std::string& _data) {
bool appl::TextViewer::write(const etk::String& _data) {
if (m_buffer == nullptr) {
return false;
}
@@ -770,7 +770,7 @@ bool appl::TextViewer::write(const std::string& _data) {
return write(_data, m_buffer->cursor());
}
bool appl::TextViewer::write(const std::string& _data, const appl::Buffer::Iterator& _pos) {
bool appl::TextViewer::write(const etk::String& _data, const appl::Buffer::Iterator& _pos) {
if (m_buffer == nullptr) {
return false;
}
@@ -786,7 +786,7 @@ bool appl::TextViewer::write(const std::string& _data, const appl::Buffer::Itera
return ret;
}
bool appl::TextViewer::replace(const std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
bool appl::TextViewer::replace(const etk::String& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
if (m_buffer == nullptr) {
return false;
}
@@ -802,7 +802,7 @@ bool appl::TextViewer::replace(const std::string& _data, const appl::Buffer::Ite
return ret;
}
bool appl::TextViewer::replace(const std::string& _data) {
bool appl::TextViewer::replace(const etk::String& _data) {
if (m_buffer == nullptr) {
return false;
}
@@ -932,7 +932,7 @@ void appl::TextViewer::moveCursorDown(uint32_t _nbLine) {
appl::Buffer::Iterator appl::TextViewer::getPosSize(const appl::Buffer::Iterator& _startLinePos, float _distance) {
char32_t currentValue;
int32_t countColomn = 0;
std::u32string stringToDisplay;
etk::UString stringToDisplay;
m_displayText.clear();
m_displayText.forceLineReturn();
for (appl::Buffer::Iterator it = _startLinePos;
@@ -960,7 +960,7 @@ float appl::TextViewer::getScreenSize(const appl::Buffer::Iterator& _startLinePo
float ret = 0;
char32_t currentValue;
int32_t countColomn = 0;
std::u32string stringToDisplay;
etk::UString stringToDisplay;
m_displayText.clear();
for (appl::Buffer::Iterator it = _startLinePos;

View File

@@ -23,7 +23,7 @@ namespace appl {
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<etk::String> propertyFontName; //!< name of the font to display text.
eproperty::Value<int32_t> propertyFontSize; //!< Size of the font to display text.
ememory::SharedPtr<appl::GlyphPainting> m_paintingProperties; //!< element painting property
@@ -57,7 +57,7 @@ namespace appl {
private:
ewol::compositing::Text m_displayText; //!< Text display properties.
ewol::compositing::Drawing m_displayDrawing; //!< Other display requested.
std::vector<std::pair<ememory::WeakPtr<appl::Buffer>, vec2>> m_drawingRemenber;
etk::Vector<etk::Pair<ememory::WeakPtr<appl::Buffer>, vec2>> m_drawingRemenber;
public:
virtual void onChangePropertyFontSize();
virtual void onChangePropertyFontName();
@@ -83,12 +83,12 @@ namespace appl {
void updateScrolling();
// TODO : Doc : write data on buffer
bool moveCursor(const appl::Buffer::Iterator& _pos);
bool write(const std::string& _data);
bool write(const std::string& _data, const appl::Buffer::Iterator& _pos);
bool replace(const std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd);
bool replace(const std::string& _data);
bool replace(const std::u32string& _data) {
return replace(etk::to_string(_data));
bool write(const etk::String& _data);
bool write(const etk::String& _data, const appl::Buffer::Iterator& _pos);
bool replace(const etk::String& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd);
bool replace(const etk::String& _data);
bool replace(const etk::UString& _data) {
return replace(etk::toString(_data));
}
/**
* @brief Remove selected data ...
@@ -110,7 +110,7 @@ namespace appl {
* @param[out] _data Output stream to copy.
* @return true of no error occured.
*/
bool copy(std::string& _data) {
bool copy(etk::String& _data) {
if (m_buffer==nullptr) {
return false;
}
@@ -122,7 +122,7 @@ namespace appl {
* @param[in] _pos Position to add the data.
* @param[in] _posEnd End position to end replace the data.
*/
void copy(std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
void copy(etk::String& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
if (m_buffer==nullptr) {
return;
}
@@ -134,7 +134,7 @@ namespace appl {
* @param[in] _pos Position to add the data.
* @return true if the write is done corectly
*/
bool writeDirect(const std::string& _data, const appl::Buffer::Iterator& _pos) {
bool writeDirect(const etk::String& _data, const appl::Buffer::Iterator& _pos) {
if (m_buffer==nullptr) {
return false;
}
@@ -149,7 +149,7 @@ namespace appl {
* @param[in] _posEnd End position to end replace the data.
* @return true if the write is done corectly
*/
bool replaceDirect(const std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
bool replaceDirect(const etk::String& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
if (m_buffer==nullptr) {
return false;
}
@@ -205,7 +205,7 @@ namespace appl {
* @brief get the path of the current buffer
* @return Path of the buffer (remove the ended name)
*/
virtual std::string getBufferPath();
virtual etk::String getBufferPath();
/**
* @brief Check if the buffer is availlable
* @return true if a display buffer is present, false otherwise.
@@ -254,7 +254,7 @@ namespace appl {
* @return true if pos if fined.
*/
virtual bool find(const appl::Buffer::Iterator& _pos,
const std::u32string& _search,
const etk::UString& _search,
appl::Buffer::Iterator& _resultStart,
appl::Buffer::Iterator& _resultStop,
bool _caseSensitive = true) {
@@ -277,7 +277,7 @@ namespace appl {
* @return true if pos if fined.
*/
virtual bool rfind(const appl::Buffer::Iterator& _pos,
const std::u32string& _search,
const etk::UString& _search,
appl::Buffer::Iterator& _resultStart,
appl::Buffer::Iterator& _resultStop,
bool _caseSensitive = true) {
@@ -401,22 +401,22 @@ namespace appl {
* @param[in] _descriptiveString Description string of the shortcut
* @param[in] _generateEventName Event generic of the element
*/
virtual void ext_shortCutAdd(const std::string& _descriptiveString,
const std::string& _generateEventName) {
virtual void ext_shortCutAdd(const etk::String& _descriptiveString,
const etk::String& _generateEventName) {
shortCutAdd(_descriptiveString, _generateEventName);
}
/**
* @brief Remove a specific shortcut with his event name
* @param[in] _generateEventName Event of the element shortcut
*/
virtual void ext_shortCutRm(const std::string& _generateEventName) {
virtual void ext_shortCutRm(const etk::String& _generateEventName) {
shortCutRemove(_generateEventName);
}
private: // callback fundtions
void onCallbackIsModify();
void onCallbackShortCut(const std::string& _value);
void onCallbackShortCut(const etk::String& _value);
void onCallbackSelectChange();
void onCallbackselectNewFile(const std::string& _value);
void onCallbackselectNewFile(const etk::String& _value);
};
}

View File

@@ -31,7 +31,7 @@ void appl::WorkerCloseAllFile::init() {
tmpBuffer->destroy();
continue;
}
m_bufferNameList.push_back(tmpBuffer->getFileName());
m_bufferNameList.pushBack(tmpBuffer->getFileName());
}
// checkif an element has something to do in the queue
if (m_bufferNameList.size() == 0) {

View File

@@ -17,7 +17,7 @@ namespace appl {
DECLARE_FACTORY(WorkerCloseAllFile);
virtual ~WorkerCloseAllFile();
private:
std::vector<std::string> m_bufferNameList;
etk::Vector<etk::String> m_bufferNameList;
ememory::SharedPtr<appl::WorkerCloseFile> m_worker; //! pop-up element that is open...
ememory::SharedPtr<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager
public: // callback function

View File

@@ -24,7 +24,7 @@ void appl::WorkerCloseFile::init() {
ewol::object::Worker::init();
}
void appl::WorkerCloseFile::startAction(const std::string& _bufferName) {
void appl::WorkerCloseFile::startAction(const etk::String& _bufferName) {
m_bufferName = _bufferName;
if (m_bufferManager == nullptr) {
APPL_ERROR("can not call unexistant buffer manager ... ");

View File

@@ -25,9 +25,9 @@ namespace appl {
/**
* @brief Action to do
*/
void startAction(const std::string& _bufferName);
void startAction(const etk::String& _bufferName);
private:
std::string m_bufferName;
etk::String m_bufferName;
ememory::SharedPtr<appl::Buffer> m_buffer; //!< reference on the buffer (when rename, we have no more reference on the buffer
ememory::SharedPtr<appl::WorkerSaveFile> m_worker; //! sub-worker element...
ememory::SharedPtr<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager

View File

@@ -29,7 +29,7 @@ void appl::WorkerSaveAllFile::init() {
continue;
}
if (it->hasFileName() == false) {
m_bufferNameList.push_back(it->getFileName());
m_bufferNameList.pushBack(it->getFileName());
} else {
it->storeFile();
}

View File

@@ -17,7 +17,7 @@ namespace appl {
DECLARE_FACTORY(WorkerSaveAllFile);
virtual ~WorkerSaveAllFile();
private:
std::vector<std::string> m_bufferNameList;
etk::Vector<etk::String> m_bufferNameList;
ememory::SharedPtr<appl::WorkerSaveFile> m_worker; //! pop-up element that is open...
ememory::SharedPtr<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager
public: // callback function

View File

@@ -85,7 +85,7 @@ void appl::WorkerSaveFile::onCallbackCancel() {
destroy();
}
void appl::WorkerSaveFile::onCallbackSaveAsValidate(const std::string& _value) {
void appl::WorkerSaveFile::onCallbackSaveAsValidate(const etk::String& _value) {
if (m_bufferManager == nullptr) {
// nothing to do in this case ==> can do nothing ...
destroy();

View File

@@ -13,7 +13,7 @@ namespace appl {
public:
esignal::Signal<> signalSaveDone;
esignal::Signal<> signalAbort;
eproperty::Value<std::string> propertyBufferName;
eproperty::Value<etk::String> propertyBufferName;
eproperty::Value<bool> propertyForceSave;
protected:
WorkerSaveFile();
@@ -25,7 +25,7 @@ namespace appl {
ememory::SharedPtr<ewol::widget::FileChooser> m_chooser; //! pop-up element that is open...
ememory::SharedPtr<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager
public: // callback function
void onCallbackSaveAsValidate(const std::string& _value);
void onCallbackSaveAsValidate(const etk::String& _value);
void onCallbackCancel();
};
}