[DEV] change default Instance
This commit is contained in:
parent
5a924f7c9d
commit
3f0febce28
@ -131,7 +131,7 @@ appl::Buffer::Buffer() :
|
|||||||
m_highlight(nullptr) {
|
m_highlight(nullptr) {
|
||||||
addObjectType("appl::Buffer");
|
addObjectType("appl::Buffer");
|
||||||
static int32_t bufferBaseId = 0;
|
static int32_t bufferBaseId = 0;
|
||||||
m_fileName = "No Name " + std::to_string(bufferBaseId);
|
m_fileName = "No Name " + etk::to_string(bufferBaseId);
|
||||||
bufferBaseId++;
|
bufferBaseId++;
|
||||||
addEventId(eventIsModify);
|
addEventId(eventIsModify);
|
||||||
addEventId(eventIsSave);
|
addEventId(eventIsSave);
|
||||||
|
@ -88,7 +88,7 @@ void BufferView::insertAlphabetic(appl::dataBufferStruct* _dataStruct, bool _sel
|
|||||||
if (m_list[iii] == nullptr) {
|
if (m_list[iii] == nullptr) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (std::tolower(m_list[iii]->m_bufferName.getNameFile()) > std::tolower(_dataStruct->m_bufferName.getNameFile())) {
|
if (etk::tolower(m_list[iii]->m_bufferName.getNameFile()) > etk::tolower(_dataStruct->m_bufferName.getNameFile())) {
|
||||||
m_list.insert(m_list.begin() + iii, _dataStruct);
|
m_list.insert(m_list.begin() + iii, _dataStruct);
|
||||||
_dataStruct = nullptr;
|
_dataStruct = nullptr;
|
||||||
if (_selectNewPosition == true) {
|
if (_selectNewPosition == true) {
|
||||||
|
@ -40,11 +40,11 @@
|
|||||||
namespace appl {
|
namespace appl {
|
||||||
std::string getVersion() {
|
std::string getVersion() {
|
||||||
#define FIRST_YEAR (2010)
|
#define FIRST_YEAR (2010)
|
||||||
std::string tmpOutput = std::to_string(date::getYear()-FIRST_YEAR);
|
std::string tmpOutput = etk::to_string(date::getYear()-FIRST_YEAR);
|
||||||
tmpOutput += ".";
|
tmpOutput += ".";
|
||||||
tmpOutput += std::to_string(date::getMonth());
|
tmpOutput += etk::to_string(date::getMonth());
|
||||||
tmpOutput += ".";
|
tmpOutput += ".";
|
||||||
tmpOutput += std::to_string(date::getDay());
|
tmpOutput += etk::to_string(date::getDay());
|
||||||
return tmpOutput;
|
return tmpOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -409,10 +409,10 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
|
|||||||
m_bufferManager->open(_msg.getData());
|
m_bufferManager->open(_msg.getData());
|
||||||
} else if (_msg.getMessage() == ednMsgGuiSave) {
|
} else if (_msg.getMessage() == ednMsgGuiSave) {
|
||||||
APPL_DEBUG("Request saving the file : " << _msg.getData());
|
APPL_DEBUG("Request saving the file : " << _msg.getData());
|
||||||
if (std::tolower(_msg.getData()) == "current") {
|
if (etk::tolower(_msg.getData()) == "current") {
|
||||||
appl::WorkerSaveFile::create("", false);
|
appl::WorkerSaveFile::create("", false);
|
||||||
return;
|
return;
|
||||||
} else if (std::tolower(_msg.getData()) == "all") {
|
} else if (etk::tolower(_msg.getData()) == "all") {
|
||||||
appl::WorkerSaveAllFile::create();
|
appl::WorkerSaveAllFile::create();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
@ -50,9 +50,9 @@ void appl::widget::Search::init() {
|
|||||||
registerOnEventNameWidget(shared_from_this(), "SEARCH:wrap", "value", l_eventWrapCb);
|
registerOnEventNameWidget(shared_from_this(), "SEARCH:wrap", "value", l_eventWrapCb);
|
||||||
registerOnEventNameWidget(shared_from_this(), "SEARCH:up-down", "value", l_eventForwardCb);
|
registerOnEventNameWidget(shared_from_this(), "SEARCH:up-down", "value", l_eventForwardCb);
|
||||||
// set default properties
|
// set default properties
|
||||||
setConfigNamed("SEARCH:case", "value", std::to_string(m_caseSensitive));
|
setConfigNamed("SEARCH:case", "value", etk::to_string(m_caseSensitive));
|
||||||
setConfigNamed("SEARCH:wrap", "value", std::to_string(m_wrap));
|
setConfigNamed("SEARCH:wrap", "value", etk::to_string(m_wrap));
|
||||||
setConfigNamed("SEARCH:up-down", "value", std::to_string(m_forward));
|
setConfigNamed("SEARCH:up-down", "value", etk::to_string(m_forward));
|
||||||
// get widget
|
// get widget
|
||||||
m_searchEntry = std::dynamic_pointer_cast<ewol::widget::Entry>(getWidgetNamed("SEARCH:search-entry"));
|
m_searchEntry = std::dynamic_pointer_cast<ewol::widget::Entry>(getWidgetNamed("SEARCH:search-entry"));
|
||||||
m_replaceEntry = std::dynamic_pointer_cast<ewol::widget::Entry>(getWidgetNamed("SEARCH:replace-entry"));
|
m_replaceEntry = std::dynamic_pointer_cast<ewol::widget::Entry>(getWidgetNamed("SEARCH:replace-entry"));
|
||||||
@ -124,22 +124,22 @@ void appl::widget::Search::onReceiveMessage(const ewol::object::Message& _msg) {
|
|||||||
ewol::widget::Composer::onReceiveMessage(_msg);
|
ewol::widget::Composer::onReceiveMessage(_msg);
|
||||||
APPL_INFO("Search receive message : " << _msg);
|
APPL_INFO("Search receive message : " << _msg);
|
||||||
if ( _msg.getMessage() == l_eventSearchEntry) {
|
if ( _msg.getMessage() == l_eventSearchEntry) {
|
||||||
m_searchData = to_u32string(_msg.getData());
|
m_searchData = etk::to_u32string(_msg.getData());
|
||||||
} else if ( _msg.getMessage() == l_eventSearchEntryEnter
|
} else if ( _msg.getMessage() == l_eventSearchEntryEnter
|
||||||
|| _msg.getMessage() == l_eventSearchBt) {
|
|| _msg.getMessage() == l_eventSearchBt) {
|
||||||
find();
|
find();
|
||||||
} else if ( _msg.getMessage() == l_eventReplaceEntry) {
|
} else if ( _msg.getMessage() == l_eventReplaceEntry) {
|
||||||
m_replaceData = to_u32string(_msg.getData());
|
m_replaceData = etk::to_u32string(_msg.getData());
|
||||||
} else if ( _msg.getMessage() == l_eventReplaceEntryEnter
|
} else if ( _msg.getMessage() == l_eventReplaceEntryEnter
|
||||||
|| _msg.getMessage() == l_eventReplaceBt) {
|
|| _msg.getMessage() == l_eventReplaceBt) {
|
||||||
replace();
|
replace();
|
||||||
find();
|
find();
|
||||||
} else if ( _msg.getMessage() == l_eventCaseCb) {
|
} else if ( _msg.getMessage() == l_eventCaseCb) {
|
||||||
m_caseSensitive = std::stob(_msg.getData());
|
m_caseSensitive = etk::string_to_bool(_msg.getData());
|
||||||
} else if ( _msg.getMessage() == l_eventWrapCb) {
|
} else if ( _msg.getMessage() == l_eventWrapCb) {
|
||||||
m_wrap = std::stob(_msg.getData());
|
m_wrap = etk::string_to_bool(_msg.getData());
|
||||||
} else if ( _msg.getMessage() == l_eventForwardCb) {
|
} else if ( _msg.getMessage() == l_eventForwardCb) {
|
||||||
m_forward = std::stob(_msg.getData());
|
m_forward = etk::string_to_bool(_msg.getData());
|
||||||
} else if ( _msg.getMessage() == l_eventHideBt) {
|
} else if ( _msg.getMessage() == l_eventHideBt) {
|
||||||
hide();
|
hide();
|
||||||
} else if ( _msg.getMessage() == ednMsgGuiSearch) {
|
} else if ( _msg.getMessage() == ednMsgGuiSearch) {
|
||||||
|
@ -62,7 +62,7 @@ uint32_t appl::TagFileList::getNuberOfRaw() {
|
|||||||
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, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) {
|
||||||
if (_raw >= 0 && (size_t)_raw < m_list.size() && nullptr != m_list[_raw]) {
|
if (_raw >= 0 && (size_t)_raw < m_list.size() && nullptr != m_list[_raw]) {
|
||||||
if (0 == _colomn) {
|
if (0 == _colomn) {
|
||||||
_myTextToWrite = std::to_string(m_list[_raw]->fileLine);
|
_myTextToWrite = etk::to_string(m_list[_raw]->fileLine);
|
||||||
} else {
|
} else {
|
||||||
_myTextToWrite = m_list[_raw]->filename;
|
_myTextToWrite = m_list[_raw]->filename;
|
||||||
}
|
}
|
||||||
@ -99,7 +99,7 @@ bool appl::TagFileList::onItemEvent(int32_t _IdInput, enum ewol::key::status _ty
|
|||||||
if( m_selectedLine >= 0
|
if( m_selectedLine >= 0
|
||||||
&& m_selectedLine < (int64_t)m_list.size()
|
&& m_selectedLine < (int64_t)m_list.size()
|
||||||
&& nullptr != m_list[m_selectedLine] ) {
|
&& nullptr != m_list[m_selectedLine] ) {
|
||||||
generateEventId(event, std::to_string(m_list[_raw]->fileLine)+":"+m_list[m_selectedLine]->filename);
|
generateEventId(event, etk::to_string(m_list[_raw]->fileLine)+":"+m_list[m_selectedLine]->filename);
|
||||||
} else {
|
} else {
|
||||||
generateEventId(applEventCtagsListUnSelect);
|
generateEventId(applEventCtagsListUnSelect);
|
||||||
}
|
}
|
||||||
|
@ -649,7 +649,7 @@ void appl::TextViewer::onReceiveMessage(const ewol::object::Message& _msg) {
|
|||||||
if (m_buffer == nullptr) {
|
if (m_buffer == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
appl::Buffer::Iterator it = m_buffer->countForwardNLines(m_buffer->begin(), std::stoi(_msg.getData()));
|
appl::Buffer::Iterator it = m_buffer->countForwardNLines(m_buffer->begin(), etk::string_to_int32_t(_msg.getData()));
|
||||||
select(it, m_buffer->getEndLine(it));
|
select(it, m_buffer->getEndLine(it));
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
return;
|
return;
|
||||||
@ -658,7 +658,7 @@ void appl::TextViewer::onReceiveMessage(const ewol::object::Message& _msg) {
|
|||||||
if (m_buffer == nullptr) {
|
if (m_buffer == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
appl::Buffer::Iterator it = m_buffer->countForwardNLines(m_buffer->begin(), std::stoi(_msg.getData()));
|
appl::Buffer::Iterator it = m_buffer->countForwardNLines(m_buffer->begin(), etk::string_to_int32_t(_msg.getData()));
|
||||||
moveCursor(it);
|
moveCursor(it);
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
return;
|
return;
|
||||||
|
@ -88,7 +88,7 @@ namespace appl {
|
|||||||
bool replace(const std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd);
|
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::string& _data);
|
||||||
bool replace(const std::u32string& _data) {
|
bool replace(const std::u32string& _data) {
|
||||||
return replace(std::to_string(_data));
|
return replace(etk::to_string(_data));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief Remove selected data ...
|
* @brief Remove selected data ...
|
||||||
|
@ -112,7 +112,7 @@ void appl::TextPluginCtags::jumpFile(const std::string& _filename, int64_t _line
|
|||||||
m_bufferManager->open(_filename);
|
m_bufferManager->open(_filename);
|
||||||
}
|
}
|
||||||
sendMultiCast(appl::MsgSelectChange, _filename);
|
sendMultiCast(appl::MsgSelectChange, _filename);
|
||||||
sendMultiCast(appl::MsgSelectGotoLineSelect, std::to_string(_lineId));
|
sendMultiCast(appl::MsgSelectGotoLineSelect, etk::to_string(_lineId));
|
||||||
}
|
}
|
||||||
|
|
||||||
void appl::TextPluginCtags::loadTagFile() {
|
void appl::TextPluginCtags::loadTagFile() {
|
||||||
|
@ -18,45 +18,36 @@
|
|||||||
|
|
||||||
class myParamGlobal : public ewol::Object {
|
class myParamGlobal : public ewol::Object {
|
||||||
public:
|
public:
|
||||||
static const char * const configEOL;
|
ewol::object::Param<bool> m_displayEOL;
|
||||||
static const char * const configAutoIndent;
|
ewol::object::Param<bool> m_AutoIndent;
|
||||||
static const char * const configShowTabChar;
|
ewol::object::Param<bool> m_displayTabChar;
|
||||||
static const char * const configShowSpaceChar;
|
ewol::object::Param<bool> m_displaySpaceChar;
|
||||||
public :
|
public :
|
||||||
bool m_displayEOL;
|
myParamGlobal() :
|
||||||
bool m_AutoIndent;
|
m_displayEOL(*this, "eol", false, "Display end of line character"),
|
||||||
bool m_displayTabChar;
|
m_AutoIndent(*this, "auto-indent", true, "Auto indent when create new line"),
|
||||||
bool m_displaySpaceChar;
|
m_displayTabChar(*this, "display-tab", true, "Display the Tab char"),
|
||||||
public :
|
m_displaySpaceChar(*this, "display-space", true, "Display the space char") {
|
||||||
myParamGlobal() {
|
|
||||||
m_static = true; // Note : set the object static notification( Must be set or assert at the end of process)
|
m_static = true; // Note : set the object static notification( Must be set or assert at the end of process)
|
||||||
setName("edn_global_param");
|
setName("edn_global_param");
|
||||||
m_displayEOL=false;
|
|
||||||
m_AutoIndent = true;
|
|
||||||
m_displayTabChar = true;
|
|
||||||
m_displaySpaceChar = true;
|
|
||||||
registerConfig(configEOL, "bool", nullptr, "Display end of line character");
|
|
||||||
registerConfig(configAutoIndent, "bool", nullptr, "Auto indent when create new line");
|
|
||||||
registerConfig(configShowTabChar, "bool", nullptr, "Display the Tab char");
|
|
||||||
registerConfig(configShowSpaceChar, "bool", nullptr, "Display the space char");
|
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
bool onSetConfig(const ewol::object::Config& _conf) {
|
bool onSetConfig(const ewol::object::Config& _conf) {
|
||||||
// Not set the EObject node parameter (name == > not change ...)
|
// Not set the EObject node parameter (name == > not change ...)
|
||||||
if (_conf.getConfig() == configEOL) {
|
if (_conf.getConfig() == configEOL) {
|
||||||
m_displayEOL = std::stob(_conf.getData());
|
m_displayEOL = etk::string_to_bool(_conf.getData());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (_conf.getConfig() == configAutoIndent) {
|
if (_conf.getConfig() == configAutoIndent) {
|
||||||
m_AutoIndent = std::stob(_conf.getData());
|
m_AutoIndent = etk::string_to_bool(_conf.getData());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (_conf.getConfig() == configShowTabChar) {
|
if (_conf.getConfig() == configShowTabChar) {
|
||||||
m_displayTabChar = std::stob(_conf.getData());
|
m_displayTabChar = etk::string_to_bool(_conf.getData());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (_conf.getConfig() == configShowSpaceChar) {
|
if (_conf.getConfig() == configShowSpaceChar) {
|
||||||
m_displaySpaceChar = std::stob(_conf.getData());
|
m_displaySpaceChar = etk::string_to_bool(_conf.getData());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -97,12 +88,9 @@ class myParamGlobal : public ewol::Object {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
const char * const myParamGlobal::configEOL = "eol";
|
|
||||||
const char * const myParamGlobal::configAutoIndent = "auto-indent";
|
|
||||||
const char * const myParamGlobal::configShowTabChar = "display-tab";
|
|
||||||
const char * const myParamGlobal::configShowSpaceChar = "display-space";
|
|
||||||
|
|
||||||
static myParamGlobal& l_obj() {
|
static myParamGlobal& l_obj() {
|
||||||
static myParamGlobal s_obj;
|
static myParamGlobal s_obj;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user