[DEV] continue removing stl

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

View File

@ -2,152 +2,11 @@
<EdnLang version="0.1" lang="C++">
<ext>.*\.(cpp|CPP|cxx|CXX|cc|CC|hpp|HPP|hxx|HXX|hh|h|H|mm|MM|c\+\+|C\+\+|m\+\+|M\+\+|mpp|MPP)</ext>
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="doxygen multiline">
<color>commentDoxygen</color>
<regex>
<start>/\*(\*|!)</start>
<stop>\*/</stop>
</regex>
<sub>doxyparse</sub>
</rule>
<rule name="comment multiline">
<color>comment</color>
<regex>
<start>/\*</start>
<stop>\*/</stop>
</regex>
<sub>TODO</sub>
</rule>
<rule name="comment multiline ERROR">
<color>SYNTAX_ERROR</color>
<regex>
<start>/\*</start>
</regex>
</rule>
<rule name="#if 0">
<color>preprocesseur</color>
<regex>
<start>#[ \t]*if 0</start>
<stop>#e(ndif|lse)</stop>
</regex>
</rule>
<rule name="#if 0 ERROR">
<color>SYNTAX_ERROR</color>
<regex>
<start>#[ \t]*if 0</start>
</regex>
</rule>
<rule name="#preproc">
<color>preprocesseur</color>
<regex>#(\\[\\\n]|.)*$</regex>
</rule>
<rule name="inline doxygen">
<color>commentDoxygen</color>
<regex>//!.*$</regex>
<sub>doxyparse</sub>
</rule>
<rule name="inline comment">
<color>comment</color>
<regex>//.*$</regex>
<sub>TODO</sub>
</rule>
<rule name="double quote text">
<color>doubleQuoteText</color>
<regex>(U|u|u8)?&quot;(\\(n|t|v|b|r|f|a|\\|\?|&quot;|0|o[0-7]{2}|x[0-9a-fA-F]{2}|u[0-9]{4}|U[0-9]{8})|.)*&quot;</regex>
</rule>
<rule name="simple quote text">
<color>doubleQuoteText</color>
<regex>&apos;(\\(&apos;|n|t|v|b|r|f|a|\\|\?|0|o[0-7]{2}|x[0-9a-fA-F]{2}|u[0-9]{4}|U[0-9]{8})|[^\n])&apos;</regex>
</rule>
</pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="old school elements">
<color>SYNTAX_ERROR</color>
<regex>&apos;|&quot;|NULL|MAX|MIN|TRUE|FALSE|calloc|malloc|realloc|free|BOOL</regex>
</rule>
<rule name="my keyword">
<color>keyword</color>
<regex>\@return|goto|if|else|case|default|switch|break|continue|while|do|for|sizeof\@</regex>
</rule>
<rule name="my function keyword">
<color>systemFunction</color>
<regex>\@new|delete|try|catch|memset|fopen|fread|fwrite|fgets|fclose|printf|(f|s|diag_)printf|(reinterpret|static|dynamic|const)_cast\@</regex>
</rule>
<rule name="my type">
<color>type</color>
<regex>\@bool|char(16_t|32_t)?|double|float|u?int(8|16|32|64|128)?(_t)?|long|short|signed|size_t|unsigned|void|(I|U)(8|16|32|64|128)\@</regex>
</rule>
<rule name="std type">
<color>type</color>
<regex>\@std::[a-zA-Z_:][\w:]*\@</regex>
</rule>
<rule name="my storage keyword">
<color>storageKeyword</color>
<regex>\@inline|const|class|namespace|virtual|private|public|protected|friend|const|extern|mutable|auto|register|static|unsigned|signed|volatile|char|double|float|int|long|short|void|typedef|struct|union|enum|override|final\@</regex>
</rule>
<rule name="my common Define">
<color>commonDefine</color>
<regex>\@nullptr|__(LINE|DATA|FILE|func|TIME|STDC|PRETTY_FUNCTION|FUNCTION)__\@</regex>
</rule>
<rule name="numeric constant">
<color>number</color>
<regex>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(LL|L|l|UL|ul|u|U|F|f)?\@</regex>
</rule>
<rule name="my boolean">
<color>boolean</color>
<regex>\@true|false\@</regex>
</rule>
<rule name="BIG LETTER">
<color>macro</color>
<regex>\@[A-Z_][A-Z_0-9]{3,500}\@</regex>
</rule>
<rule name="CPP member">
<color>memberClass</color>
<regex>\@((m|s|p|s|g)_|property|signal)\w+\@</regex>
</rule>
<rule name="CPP member (bad version)">
<color>memberClass</color>
<regex>\@\w+_\@</regex>
</rule>
<rule name="function input">
<color>inputFunction</color>
<regex>\@_\w+\@</regex>
</rule>
<rule name="Function name">
<color>functionName</color>
<regex>\@((\w|_)+[ \t]*\()</regex>
</rule>
<rule name="condition">
<color>boolean</color>
<regex>==|&lt;=|&gt;=|!=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}</regex>
</rule>
<rule name="simpleQuteTextError">
<color>SYNTAX_ERROR</color>
<regex>&apos;|&quot;</regex>
</rule>
</pass2>
<pass name="doxyparse">
<rule name="knownkey">
<color>doxygen-key-known</color>
<regex>(\@|\\)[\t ]*(addindex|addtogroup|anchor|arg|attention|author|authors|a|brief|bug|b|callgraph|category|cite|class|code|cond|copybrief|copydetails|copydoc|copyright|date|def|defgroup|deprecated|details|diafile|dir|docbookonly|dontinclude|dot|dotfile|else|elseif|em|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endif|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|endverbatim|enduml|endxmlonly|enum|example|exception|extends|e|file|fn|headerfile|hidecallergraph|hidecallgraph|hideinitializer|htmlinclude|htmlonly|idlexcept|ifnot|if|image|implements|includelineno|include|ingroup|internal|invariant|interface|latexinclude|latexonly|line|link|license|li|mainpage|manonly|memberof|msc|mscfile|name|namespace|nosubgrouping|note|n|overload|package|page|paragraph|param|parblock|par|post|pre|private|privatesection|property|protected|protectedsection|protocol|public|publicsection|pure|p|refitem|ref|related|relates|relatedalso|relatesalso|remark|remarks|result|return|returns|retval|rtfonly|sa|secreflist|section|see|short|showinitializer|since|skip|skipline|snippet|startuml|struct|subpage|subsection|subsubsection|tableofcontents|test|throw|throws|todo|tparam|typedef|union|until|var|verbatim|verbinclude|version|vhdlflow|warning|weakgroup|xmlonly|xrefitem)</regex>
</rule>
<rule name="key">
<color>doxygen-key</color>
<regex>(\@|\\)[\t ]*\w+</regex>
</rule>
<rule name="in-out">
<color>doxygen-in-out</color>
<regex>\[(in|in,out|out)\]</regex>
</rule>
<rule name="function input">
<color>inputFunction</color>
<regex>\@_\w+\@</regex>
</rule>
</pass>
<pass name="TODO">
<rule name="function input">
<color>SYNTAX_ERROR</color>
<regex>TODO[ \t]*:.*$</regex>
</rule>
</pass>
</EdnLang>

View File

@ -112,7 +112,7 @@ def configure(target, my_module):
my_module.add_flag('c', [
"-DPROJECT_NAME=\"\\\""+my_module.get_name()+"\\\"\"",
"-DAPPL_VERSION=\"\\\"" + tools.version_to_string(get_version()) + "\\\"\""
"-DAPPL_VERSION=\"\\\"" + tools.version_toString(get_version()) + "\\\"\""
])
versionIDCode = str(get_version_id())

View File

@ -122,7 +122,7 @@ appl::Buffer::Buffer() :
m_highlight(nullptr) {
addObjectType("appl::Buffer");
static int32_t bufferBaseId = 0;
m_fileName = "No Name " + etk::to_string(bufferBaseId);
m_fileName = "No Name " + etk::toString(bufferBaseId);
bufferBaseId++;
}
@ -134,10 +134,10 @@ appl::Buffer::~Buffer() {
APPL_ERROR("REAL remove buffer : '" << propertyName << "'");
}
bool appl::Buffer::loadFile(const std::string& _name) {
bool appl::Buffer::loadFile(const etk::String& _name) {
APPL_DEBUG("Convert filename :'" << _name << "'");
etk::FSNode file(_name);
std::string name = file.getName();
etk::String name = file.getName();
APPL_INFO("Load file : '" << name << "'");
m_fileName = name;
m_hasFileName = true;
@ -154,10 +154,10 @@ bool appl::Buffer::loadFile(const std::string& _name) {
return false;
}
void appl::Buffer::setFileName(const std::string& _name) {
void appl::Buffer::setFileName(const etk::String& _name) {
APPL_DEBUG("Convert filename :'" << _name << "'");
etk::FSNode file(_name);
std::string name = file.getName();
etk::String name = file.getName();
if (m_fileName == name) {
return;
}
@ -251,7 +251,7 @@ bool appl::Buffer::searchBack(const appl::Buffer::Iterator& _pos, const char32_t
}
bool appl::Buffer::search(const appl::Buffer::Iterator& _pos,
const std::u32string& _search,
const etk::UString& _search,
appl::Buffer::Iterator& _result,
bool _caseSensitive) {
if (_search.size() <= 0 ) {
@ -320,7 +320,7 @@ bool appl::Buffer::search(const appl::Buffer::Iterator& _pos,
}
bool appl::Buffer::searchBack(const appl::Buffer::Iterator& _pos,
const std::u32string& _search,
const etk::UString& _search,
appl::Buffer::Iterator& _result,
bool _caseSensitive) {
if (_search.size() <= 0 ) {
@ -518,7 +518,7 @@ static const char *ControlCodeTable[32] = {
"NUL", "soh", "stx", "etx", "eot", "enq", "ack", "bel", "bs", "ht", "nl", "vt", "np", "cr", "so", "si",
"dle", "dc1", "dc2", "dc3", "dc4", "nak", "syn", "etb", "can", "em", "sub", "esc", "fs", "gs", "rs", "us"};
void appl::Buffer::expand(int32_t& _indent, const char32_t& _value, std::u32string& _out) const {
void appl::Buffer::expand(int32_t& _indent, const char32_t& _value, etk::UString& _out) const {
_out.clear();
int32_t tabDist = 4;
if (_value == u32char::Tabulation) {
@ -599,7 +599,7 @@ appl::Buffer::Iterator appl::Buffer::countBackwardNLines(const appl::Buffer::Ite
bool appl::Buffer::copy(std::string& _data) {
bool appl::Buffer::copy(etk::String& _data) {
_data.clear();
if (hasTextSelected() == true) {
int32_t startPos = getStartSelectionPos();
@ -615,7 +615,7 @@ bool appl::Buffer::copy(std::string& _data) {
return false;
}
void appl::Buffer::copy(std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
void appl::Buffer::copy(etk::String& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
_data.clear();
for (Iterator it = _pos;
it != _posEnd &&
@ -625,7 +625,7 @@ void appl::Buffer::copy(std::string& _data, const appl::Buffer::Iterator& _pos,
}
}
bool appl::Buffer::write(const std::string& _data, const appl::Buffer::Iterator& _pos) {
bool appl::Buffer::write(const etk::String& _data, const appl::Buffer::Iterator& _pos) {
int64_t position = (int64_t)_pos;
if (position < 0){
position = 0;
@ -643,7 +643,7 @@ bool appl::Buffer::write(const std::string& _data, const appl::Buffer::Iterator&
return true;
}
bool appl::Buffer::replace(const std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
bool appl::Buffer::replace(const etk::String& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
int64_t position = (int64_t)_pos;
if (position < 0){
position = 0;
@ -673,7 +673,7 @@ void appl::Buffer::removeSelection() {
void appl::Buffer::tryFindHighlightType() {
etk::FSNode file(m_fileName);
std::string type = appl::highlightManager::getTypeFile(file.getNameFile());
etk::String type = appl::highlightManager::getTypeFile(file.getNameFile());
if (type.size() == 0) {
return;
}
@ -681,11 +681,11 @@ void appl::Buffer::tryFindHighlightType() {
setHighlightType(type);
}
void appl::Buffer::setHighlightType(const std::string& _type) {
void appl::Buffer::setHighlightType(const etk::String& _type) {
m_highlightType = "";
cleanHighLight();
m_highlight.reset();
std::string resourceName = appl::highlightManager::getFileWithTypeType(_type);
etk::String resourceName = appl::highlightManager::getFileWithTypeType(_type);
if (resourceName == "") {
return;
}
@ -874,7 +874,7 @@ void appl::Buffer::cleanHighLight() {
appl::HighlightInfo* appl::Buffer::getElementColorAtPosition(int64_t _pos, int64_t &_starPos) {
int32_t start = std::max((int64_t)0, _starPos-1);
int32_t start = etk::max((int64_t)0, _starPos-1);
for (size_t iii = start; iii < m_HLDataPass1.size(); ++iii) {
_starPos = iii;
if ( m_HLDataPass1[iii].start <= _pos
@ -912,7 +912,7 @@ void appl::Buffer::hightlightGenerateLines(appl::DisplayHLData& _MData, const ap
endSearch = m_HLDataPass1.size();
}
int64_t kkk;
for (kkk = std::max(startId, (int64_t)0); kkk < endSearch; ++kkk) {
for (kkk = etk::max(startId, (int64_t)0); kkk < endSearch; ++kkk) {
// empty section :
if (kkk == 0) {
if (HLStartPos < m_HLDataPass1[kkk].start) {
@ -966,7 +966,7 @@ void appl::Buffer::hightlightGenerateLines(appl::DisplayHLData& _MData, const ap
appl::HighlightInfo* appl::Buffer::getElementColorAtPosition(appl::DisplayHLData& _MData, int64_t _pos) {
int64_t start = std::max((int64_t)0, _MData.posHLPass2-1);
int64_t start = etk::max((int64_t)0, _MData.posHLPass2-1);
for (int64_t iii=start; iii<(int32_t)_MData.HLData.size(); iii++) {
_MData.posHLPass2 = iii;
if( _MData.HLData[iii].start <= _pos
@ -997,39 +997,39 @@ uint32_t appl::Buffer::getCursorLinesId() {
}
namespace etk {
template<> std::string to_string<ememory::SharedPtr<appl::Buffer>>(const ememory::SharedPtr<appl::Buffer>& _obj) {
template<> etk::String toString<ememory::SharedPtr<appl::Buffer>>(const ememory::SharedPtr<appl::Buffer>& _obj) {
if (_obj != nullptr) {
return _obj->getFileName();
}
return "";
}
template<> std::u32string to_u32string<ememory::SharedPtr<appl::Buffer>>(const ememory::SharedPtr<appl::Buffer>& _obj) {
return etk::to_u32string(etk::to_string(_obj));
template<> etk::UString toUString<ememory::SharedPtr<appl::Buffer>>(const ememory::SharedPtr<appl::Buffer>& _obj) {
return etk::toUString(etk::toString(_obj));
}
template<> bool from_string<ememory::SharedPtr<appl::Buffer>>(ememory::SharedPtr<appl::Buffer>& _variableRet, const std::string& _value) {
template<> bool from_string<ememory::SharedPtr<appl::Buffer>>(ememory::SharedPtr<appl::Buffer>& _variableRet, const etk::String& _value) {
if (_variableRet != nullptr) {
_variableRet->loadFile(_value);
return true;
}
return false;
}
template<> bool from_string<ememory::SharedPtr<appl::Buffer>>(ememory::SharedPtr<appl::Buffer>& _variableRet, const std::u32string& _value) {
return from_string(_variableRet, etk::to_string(_value));
template<> bool from_string<ememory::SharedPtr<appl::Buffer>>(ememory::SharedPtr<appl::Buffer>& _variableRet, const etk::UString& _value) {
return from_string(_variableRet, etk::toString(_value));
}
template<> std::string to_string<appl::Buffer>(const appl::Buffer& _obj) {
template<> etk::String toString<appl::Buffer>(const appl::Buffer& _obj) {
return _obj.getFileName();
}
template<> std::u32string to_u32string<appl::Buffer>(const appl::Buffer& _obj) {
return etk::to_u32string(etk::to_string(_obj));
template<> etk::UString toUString<appl::Buffer>(const appl::Buffer& _obj) {
return etk::toUString(etk::toString(_obj));
}
template<> bool from_string<appl::Buffer>(appl::Buffer& _variableRet, const std::string& _value) {
template<> bool from_string<appl::Buffer>(appl::Buffer& _variableRet, const etk::String& _value) {
_variableRet.loadFile(_value);
return true;
}
template<> bool from_string<appl::Buffer>(appl::Buffer& _variableRet, const std::u32string& _value) {
return from_string(_variableRet, etk::to_string(_value));
template<> bool from_string<appl::Buffer>(appl::Buffer& _variableRet, const etk::UString& _value) {
return from_string(_variableRet, etk::toString(_value));
}
};

View File

@ -19,7 +19,7 @@ namespace appl {
class DisplayHLData {
public:
std::vector<appl::HighlightInfo> HLData;
etk::Vector<appl::HighlightInfo> HLData;
int64_t posHLPass1;
int64_t posHLPass2;
};
@ -300,12 +300,12 @@ namespace appl {
virtual ~Buffer();
private:
bool m_hasFileName; //!< when new file, the buffer has no name ==> but it might be reference with a single name ...
std::string m_fileName; //!< name of the file (with his path)
etk::String m_fileName; //!< name of the file (with his path)
public:
/**
* @brief get the curent filename of the Buffer
*/
const std::string& getFileName() const {
const etk::String& getFileName() const {
return m_fileName;
}
/**
@ -320,12 +320,12 @@ namespace appl {
* @param[in] _name name of the file.
* @return true if file corectly opened.
*/
bool loadFile(const std::string& _name);
bool loadFile(const etk::String& _name);
/**
* @brief Set a file name at this buffer (no saving ...)
* @param[in] _name name of the file.
*/
void setFileName(const std::string& _name);
void setFileName(const etk::String& _name);
/**
* @brief save the file in the specify path.
* @return true is saving well done
@ -384,14 +384,14 @@ namespace appl {
* @return position of the start selection.
*/
int64_t getStartSelectionPos() {
return std::min(m_cursorPos, m_cursorSelectPos);
return etk::min(m_cursorPos, m_cursorSelectPos);
}
/**
* @brief Get the Stop position of the selection.
* @return position of the stop selection.
*/
int64_t getStopSelectionPos() {
return std::max(m_cursorPos, m_cursorSelectPos);
return etk::max(m_cursorPos, m_cursorSelectPos);
}
protected:
float m_cursorPreferredCol; //!< position of the cursor when up and down is done.
@ -442,7 +442,7 @@ namespace appl {
* @param[in] _value Current value to transform
* @param[out] _out String that represent the curent value to display
*/
void expand(int32_t& _indent, const char32_t& _value, std::u32string& _out) const;
void expand(int32_t& _indent, const char32_t& _value, etk::UString& _out) const;
/**
* @brief get the start of a line with the position in the buffer.
* @param[in] _pos position in the buffer.
@ -482,7 +482,7 @@ namespace appl {
* @return true if pos if fined.
*/
// TODO : rename find
bool search(const Iterator& _pos, const std::u32string& _search, Iterator& _result, bool _caseSensitive = true);
bool search(const Iterator& _pos, const etk::UString& _search, Iterator& _result, bool _caseSensitive = true);
/**
* @brief Search a string in the buffer in back mode.
* @param[in] _pos Position to start the search of the element.
@ -492,7 +492,7 @@ namespace appl {
* @return true if pos if fined.
*/
// TODO : rename rfind
bool searchBack(const Iterator& _pos, const std::u32string& _search, Iterator& _result, bool _caseSensitive = true);
bool searchBack(const Iterator& _pos, const etk::UString& _search, Iterator& _result, bool _caseSensitive = true);
/**
* @brief find the first character of the line "nLines" forward
* @param[in] _startPos Start position.
@ -513,21 +513,21 @@ 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);
/**
* @brief copy data in the _data ref value.
* @param[out] _data Output stream to copy.
* @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);
/**
* @brief Write data at a specific position
* @param[in] _data Data to insert in the buffer
* @param[in] _pos Position to add the data.
* @return true if the write is done corectly
*/
bool write(const std::string& _data, const appl::Buffer::Iterator& _pos);
bool write(const etk::String& _data, const appl::Buffer::Iterator& _pos);
/**
* @brief Write data at a specific position
* @param[in] _data Data to insert in the buffer
@ -535,7 +535,7 @@ namespace appl {
* @param[in] _posEnd End position to end replace the data.
* @return true if the write is done corectly
*/
bool replace(const std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd);
bool replace(const etk::String& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd);
public: // iterator section :
/**
* @brief Get an iterator an an specific position
@ -589,10 +589,10 @@ namespace appl {
*/
void countNumberofLine();
protected:
std::string m_highlightType; //!< Name of the highlight type
etk::String m_highlightType; //!< Name of the highlight type
ememory::SharedPtr<appl::Highlight> m_highlight; //!< internal link with the Highlight system
std::vector<appl::HighlightInfo> m_HLDataPass1; //!< colorisation position in the current buffer pass 1
etk::Vector<appl::HighlightInfo> m_HLDataPass1; //!< colorisation position in the current buffer pass 1
public:
/**
* @brief Find the Highligh capability
@ -602,12 +602,12 @@ namespace appl {
* @brief Set type of highlight
* @param[in] _type type of the highlight
*/
void setHighlightType(const std::string& _type);
void setHighlightType(const etk::String& _type);
/**
* @brief Get type of highlight
* @return Type of the highlight
*/
const std::string& setHighlightType() {
const etk::String& setHighlightType() {
return m_highlightType;
};

View File

@ -33,7 +33,7 @@ ememory::SharedPtr<appl::Buffer> appl::BufferManager::createNewBuffer() {
return nullptr;
}
tmp->setParent(ewol::Object::sharedFromThis());
m_list.push_back(tmp);
m_list.pushBack(tmp);
APPL_INFO("Create a new Buffer");
signalNewBuffer.emit(tmp->getFileName());
APPL_INFO("Create a new Buffer (done)");
@ -43,7 +43,7 @@ ememory::SharedPtr<appl::Buffer> appl::BufferManager::createNewBuffer() {
return tmp;
}
ememory::SharedPtr<appl::Buffer> appl::BufferManager::get(const std::string& _fileName, bool _createIfNeeded) {
ememory::SharedPtr<appl::Buffer> appl::BufferManager::get(const etk::String& _fileName, bool _createIfNeeded) {
APPL_INFO("get('" << _fileName << "'," << _createIfNeeded << ")");
for (auto &it : m_list) {
if (it == nullptr) {
@ -66,7 +66,7 @@ ememory::SharedPtr<appl::Buffer> appl::BufferManager::get(const std::string& _fi
}
tmp->setParent(ewol::Object::sharedFromThis());
tmp->loadFile(_fileName);
m_list.push_back(tmp);
m_list.pushBack(tmp);
APPL_INFO("Creata a open Buffer");
signalNewBuffer.emit(tmp->getFileName());
APPL_INFO("Creata a open Buffer (done)");
@ -99,7 +99,7 @@ ememory::SharedPtr<appl::Buffer> appl::BufferManager::get(int32_t _id) {
return m_list.back();
}
bool appl::BufferManager::exist(const std::string& _fileName) {
bool appl::BufferManager::exist(const etk::String& _fileName) {
for (auto &it : m_list) {
if (it == nullptr) {
continue;
@ -111,7 +111,7 @@ bool appl::BufferManager::exist(const std::string& _fileName) {
return false;
}
void appl::BufferManager::open(const std::string& _fileName) {
void appl::BufferManager::open(const etk::String& _fileName) {
if (exist(_fileName) == true) {
APPL_WARNING(" the element '" << _fileName << "' already exist ... just reselect it ...");
signalSelectFile.emit(_fileName);

View File

@ -18,8 +18,8 @@ namespace appl {
// TODO: This is a service ...
class BufferManager : public ewol::Object {
public:
esignal::Signal<std::string> signalNewBuffer;
esignal::Signal<std::string> signalSelectFile;
esignal::Signal<etk::String> signalNewBuffer;
esignal::Signal<etk::String> signalSelectFile;
esignal::Signal<> signalTextSelectionChange;
esignal::Signal<ememory::SharedPtr<appl::Buffer>> signalRemoveBuffer;
protected:
@ -36,18 +36,18 @@ namespace appl {
* @param[in] _createIfNeeded Create the buffer if not existed.
* @return a pointer on the buffer
*/
ememory::SharedPtr<appl::Buffer> get(const std::string& _fileName, bool _createIfNeeded=false);
ememory::SharedPtr<appl::Buffer> get(const etk::String& _fileName, bool _createIfNeeded=false);
/**
* @brief Load a specific file, event if it not existed:
* @param[in] _fileName Name of the file to open or create.
*/
void open(const std::string& _fileName);
void open(const etk::String& _fileName);
/**
* @brief Check if a buffer is already open.
* @param[in] _fileName name of the file.
* @return true if the buffer is already open.
*/
bool exist(const std::string& _fileName);
bool exist(const etk::String& _fileName);
/**
* @brief Get count of all buffer availlable.
* @return Number of buffer

View File

@ -7,7 +7,7 @@
#include <appl/global.hpp>
#include <appl/GlyphDecoration.hpp>
appl::GlyphDecoration::GlyphDecoration(const std::string &_newColorName) :
appl::GlyphDecoration::GlyphDecoration(const etk::String &_newColorName) :
m_colorName(_newColorName),
m_colorFG(etk::color::black),
m_colorBG(etk::color::none),
@ -34,7 +34,7 @@ void appl::GlyphDecoration::setBold(bool _enable) {
}
}
std::ostream& appl::operator <<(std::ostream& _os, const appl::GlyphDecoration& _obj) {
etk::Stream& appl::operator <<(etk::Stream& _os, const appl::GlyphDecoration& _obj) {
_os << "{fg=" << _obj.getForeground();
_os << ",bg=" << _obj.getBackground();
_os << ",italic=" << _obj.getItalic();

View File

@ -12,25 +12,25 @@ namespace appl {
class GlyphDecoration {
public:
// Constructeur
GlyphDecoration(const std::string& _newColorName = "no_name");
GlyphDecoration(const etk::String& _newColorName = "no_name");
virtual ~GlyphDecoration() {
// nothing to do ...
};
private:
std::string m_colorName; //!< curent color Name
etk::String m_colorName; //!< curent color Name
public:
/**
* @brief Set color name of the element.
* @param[in] _newColorName new color name.
*/
void setName(const std::string& _newColorName) {
void setName(const etk::String& _newColorName) {
m_colorName = _newColorName;
};
/**
* @brief Get the color name.
* @return The name of the color.
*/
const std::string& getName() const {
const etk::String& getName() const {
return m_colorName;
};
private:
@ -40,7 +40,7 @@ namespace appl {
* @brief Set foreground color.
* @param[in] _myColor new color description.
*/
void setForeground(const std::string& _myColor) {
void setForeground(const etk::String& _myColor) {
m_colorFG = _myColor;
};
/**
@ -64,7 +64,7 @@ namespace appl {
* @brief Set background color.
* @param[in] _myColor new color description.
*/
void setBackground(const std::string& _myColor) {
void setBackground(const etk::String& _myColor) {
m_colorBG = _myColor;
};
/**
@ -112,7 +112,7 @@ namespace appl {
return m_bold;
};
};
std::ostream& operator <<(std::ostream& _os, const appl::GlyphDecoration& _obj);
etk::Stream& operator <<(etk::Stream& _os, const appl::GlyphDecoration& _obj);
}

View File

@ -15,7 +15,7 @@ appl::GlyphPainting::GlyphPainting() {
addResourceType("appl::GlyphPainting");
}
void appl::GlyphPainting::init(const std::string& _filename) {
void appl::GlyphPainting::init(const etk::String& _filename) {
gale::Resource::init(_filename);
APPL_DEBUG("SFP : load \"" << _filename << "\"");
reload();
@ -34,7 +34,7 @@ void appl::GlyphPainting::reload() {
// for debug only :
/*
APPL_WARNING("Load file : '" << m_name << "' = " << etk::FSNode(m_name).getFileSystemName());
std::string tmppppp;
etk::String tmppppp;
doc.generate(tmppppp);
APPL_DEBUG(tmppppp);
*/
@ -49,9 +49,9 @@ void appl::GlyphPainting::reload() {
APPL_DEBUG(" can not get object in 'ednColor' it=" << it);
continue;
}
std::string name = tmpObj["name"].toString().get();
std::string background = tmpObj["background"].toString().get("#FFF0");
std::string foreground = tmpObj["foreground"].toString().get("#000F");
etk::String name = tmpObj["name"].toString().get();
etk::String background = tmpObj["background"].toString().get("#FFF0");
etk::String foreground = tmpObj["foreground"].toString().get("#000F");
bool italic = tmpObj["italic"].toBoolean().get(false);
bool bold = tmpObj["bold"].toBoolean().get(false);
APPL_VERBOSE("find new color : '" << name << "' fg='" << foreground << "' bg='" << background << "' italic='" << italic << "' bold='" << bold << "'");
@ -74,12 +74,12 @@ void appl::GlyphPainting::reload() {
tmpDeco.setBackground(background);
tmpDeco.setItalic(italic);
tmpDeco.setBold(bold);
m_list.push_back(tmpDeco);
m_list.pushBack(tmpDeco);
}
}
int32_t appl::GlyphPainting::request(const std::string& _name) {
int32_t appl::GlyphPainting::request(const etk::String& _name) {
for (size_t iii=0; iii<m_list.size(); ++iii) {
if (m_list[iii].getName() == _name) {
return iii;
@ -87,6 +87,6 @@ int32_t appl::GlyphPainting::request(const std::string& _name) {
}
// create an empty deco ...
appl::GlyphDecoration tmpDeco(_name);
m_list.push_back(tmpDeco);
m_list.pushBack(tmpDeco);
return m_list.size()-1;
}

View File

@ -13,10 +13,10 @@
namespace appl {
class GlyphPainting : public gale::Resource {
private:
std::vector<appl::GlyphDecoration> m_list;
etk::Vector<appl::GlyphDecoration> m_list;
protected:
GlyphPainting();
void init(const std::string& _filename);
void init(const etk::String& _filename);
public:
DECLARE_RESOURCE_NAMED_FACTORY(GlyphPainting);
virtual ~GlyphPainting();
@ -30,7 +30,7 @@ namespace appl {
* @param[in] _name Name of the deco.
* @return id of the deco.
*/
int32_t request(const std::string& _name);
int32_t request(const etk::String& _name);
/**
* @brief Get Decoration handle.
* @param[in] _id Id of the decoration.

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();
};
}

View File

@ -23,7 +23,7 @@ appl::Highlight::Highlight() {
addResourceType("appl::Highlight");
}
void appl::Highlight::init(const std::string& _xmlFilename, const std::string& _colorFile) {
void appl::Highlight::init(const etk::String& _xmlFilename, const etk::String& _colorFile) {
gale::Resource::init(_xmlFilename);
// keep color propertiy file :
@ -50,10 +50,10 @@ void appl::Highlight::init(const std::string& _xmlFilename, const std::string& _
continue;
}
if (child.getValue() == "ext") {
std::string myData = child.getText();
etk::String myData = child.getText();
if (myData.size()!=0) {
//HL_DEBUG("(l %d) node fined : %s=\"%s\"", child->Row(), child->Value() , myData);
m_listExtentions.push_back(myData);
m_listExtentions.pushBack(myData);
}
} else if (child.getValue() == "pass1") {
// get sub Nodes ...
@ -67,7 +67,7 @@ void appl::Highlight::init(const std::string& _xmlFilename, const std::string& _
continue;
}
// Create the patern in list
m_listHighlightPass1.push_back(HighlightPattern(m_paintingProperties, passChild, level1++));
m_listHighlightPass1.pushBack(HighlightPattern(m_paintingProperties, passChild, level1++));
}
} else if (child.getValue() == "pass2") {
// get sub Nodes ...
@ -81,15 +81,15 @@ void appl::Highlight::init(const std::string& _xmlFilename, const std::string& _
continue;
}
// Create the patern in list
m_listHighlightPass2.push_back(HighlightPattern(m_paintingProperties, passChild, level2++));
m_listHighlightPass2.pushBack(HighlightPattern(m_paintingProperties, passChild, level2++));
}
} else if (child.getValue() == "pass") {
std::string attributeName = child.attributes["name"];
etk::String attributeName = child.attributes["name"];
if (attributeName == "") {
APPL_ERROR("Can not parse an element pass with no attribute name ... ligne=" << child.getPos());
continue;
}
m_listHighlightNamed.insert(std::pair<std::string, std::vector<HighlightPattern>>(attributeName, std::vector<HighlightPattern>()));
m_listHighlightNamed.insert(etk::Pair<etk::String, etk::Vector<HighlightPattern>>(attributeName, etk::Vector<HighlightPattern>()));
auto it3 = m_listHighlightNamed.find(attributeName);
int32_t level3=0;
// get sub Nodes ...
@ -103,7 +103,7 @@ void appl::Highlight::init(const std::string& _xmlFilename, const std::string& _
continue;
}
// add element in the list
it3->second.push_back(HighlightPattern(m_paintingProperties, passChild, level3++));
it3->second.pushBack(HighlightPattern(m_paintingProperties, passChild, level3++));
}
} else {
APPL_ERROR("(l "<< child.getPos() << ") node not suported : '"<< child.getValue() << "' must be [ext,pass1,pass2]" );
@ -120,7 +120,7 @@ appl::Highlight::~Highlight() {
m_listExtentions.clear();
}
bool appl::Highlight::isCompatible(const std::string& _name) {
bool appl::Highlight::isCompatible(const etk::String& _name) {
for (auto &it : m_listExtentions) {
APPL_WARNING(" check : " << it << "=?=" << _name);
// TODO: Remove dependency with the std::regex ...
@ -148,8 +148,8 @@ bool appl::Highlight::isCompatible(const std::string& _name) {
return false;
}
bool appl::Highlight::fileNameCompatible(const std::string& _fileName) {
std::string extention;
bool appl::Highlight::fileNameCompatible(const etk::String& _fileName) {
etk::String extention;
etk::FSNode file(_fileName);
if (true == file.fileHasExtention() ) {
extention = "*.";
@ -197,7 +197,7 @@ void appl::Highlight::display() {
*/
void appl::Highlight::parse(int64_t _start,
int64_t _stop,
std::vector<appl::HighlightInfo> & _metaData,
etk::Vector<appl::HighlightInfo> & _metaData,
int64_t _addingPos,
etk::Buffer& _buffer) {
if (0 > _addingPos) {
@ -278,7 +278,7 @@ void appl::Highlight::parse(int64_t _start,
*/
void appl::Highlight::parse2(int64_t _start,
int64_t _stop,
std::vector<appl::HighlightInfo>& _metaData,
etk::Vector<appl::HighlightInfo>& _metaData,
etk::Buffer& _buffer) {
HL2_DEBUG("Parse element 0 => " << m_listHighlightPass2.size() <<
" == > position search: (" << _start << "," << _stop << ")" );
@ -293,14 +293,14 @@ void appl::Highlight::parse2(int64_t _start,
/*
HL2_DEBUG("Parse HL id=" << jjj << " position search: (" <<
elementStart << "," << elementStop << ") in='"
<< std::string(_buffer.begin()+elementStart,_buffer.begin()+elementStop) << "' " << m_listHighlightPass2[jjj].getPaternString().first << " " << m_listHighlightPass1[jjj].getPaternString().second);
<< etk::String(_buffer.begin()+elementStart,_buffer.begin()+elementStop) << "' " << m_listHighlightPass2[jjj].getPaternString().first << " " << m_listHighlightPass1[jjj].getPaternString().second);
*/
// Stop the search to the end (to get the end of the pattern)
bool ret = m_listHighlightPass2[jjj].find(elementStart, elementStop, resultat, _buffer);
if (ret == true) {
// find an element:
_metaData.push_back(resultat);
//HL2_DEBUG("data='" << std::string(_buffer.begin()+elementStart,_buffer.begin()+resultat.stop) << "'");
_metaData.pushBack(resultat);
//HL2_DEBUG("data='" << etk::String(_buffer.begin()+elementStart,_buffer.begin()+resultat.stop) << "'");
elementStart = resultat.stop-1;
break;
}
@ -317,7 +317,7 @@ void appl::Highlight::parse2(int64_t _start,
* @param[in] _buffer buffer where we need to search data
*/
void appl::Highlight::parseSubElement(const appl::HighlightInfo& _upper,
std::vector<appl::HighlightInfo>& _metaData,
etk::Vector<appl::HighlightInfo>& _metaData,
etk::Buffer& _buffer) {
if (_upper.patern->getSubPatternName().size() == 0) {
return;
@ -342,7 +342,7 @@ void appl::Highlight::parseSubElement(const appl::HighlightInfo& _upper,
// Stop the search to the end (to get the end of the pattern)
bool ret = it.find(elementStart, elementStop, resultat, _buffer);
if (ret == true) {
_metaData.push_back(resultat);
_metaData.pushBack(resultat);
elementStart = resultat.stop-1;
break;
}

View File

@ -32,43 +32,43 @@ namespace appl {
public:
// Constructeur
Highlight();
void init(const std::string& _xmlFilename, const std::string& _colorFile = "THEME:COLOR:textViewer.json");
void init(const etk::String& _xmlFilename, const etk::String& _colorFile = "THEME:COLOR:textViewer.json");
public:
DECLARE_RESOURCE_NAMED_FACTORY(Highlight);
virtual ~Highlight();
private:
std::string m_typeName; //!< descriptive string type like "C/C++"
etk::String m_typeName; //!< descriptive string type like "C/C++"
public:
/**
* @brief Get the Type of the Hightlight like c++/Bash/...
* @return descriptive string
*/
const std::string& getTypeName() {
const etk::String& getTypeName() {
return m_typeName;
}
public:
bool isCompatible(const std::string& _name);
bool fileNameCompatible(const std::string& _fileName);
bool isCompatible(const etk::String& _name);
bool fileNameCompatible(const etk::String& _fileName);
void display();
void parse(int64_t _start,
int64_t _stop,
std::vector<appl::HighlightInfo>& _metaData,
etk::Vector<appl::HighlightInfo>& _metaData,
int64_t _addingPos,
etk::Buffer& _buffer);
void parse2(int64_t _start,
int64_t _stop,
std::vector<appl::HighlightInfo>& _metaData,
etk::Vector<appl::HighlightInfo>& _metaData,
etk::Buffer& _buffer);
void parseSubElement(const appl::HighlightInfo& _upper,
std::vector<appl::HighlightInfo>& _metaData,
etk::Vector<appl::HighlightInfo>& _metaData,
etk::Buffer& _buffer);
private:
std::string m_styleName; //!< curent style name (like "c++" or "c" or "script Bash")
std::vector<std::string> m_listExtentions; //!< List of possible extention for this high-light, like : ".c", ".cpp", ".h"
std::vector<HighlightPattern> m_listHighlightPass1; //!< List of ALL hightlight modules (pass 1 == > when we load and wride data on the buffer)
std::vector<HighlightPattern> m_listHighlightPass2; //!< List of ALL hightlight modules (pass 2 == > When we display the buffer( only the display area (100 lines)) )
etk::String m_styleName; //!< curent style name (like "c++" or "c" or "script Bash")
etk::Vector<etk::String> m_listExtentions; //!< List of possible extention for this high-light, like : ".c", ".cpp", ".h"
etk::Vector<HighlightPattern> m_listHighlightPass1; //!< List of ALL hightlight modules (pass 1 == > when we load and wride data on the buffer)
etk::Vector<HighlightPattern> m_listHighlightPass2; //!< List of ALL hightlight modules (pass 2 == > When we display the buffer( only the display area (100 lines)) )
// TODO : This is bad ==> the patern ar unordered ...
std::map<std::string, std::vector<HighlightPattern>> m_listHighlightNamed; //!< list of all sub partern to parse...
etk::Map<etk::String, etk::Vector<HighlightPattern>> m_listHighlightNamed; //!< list of all sub partern to parse...
public: // herited function :
virtual bool updateContext() {
// no upfate to do ...

View File

@ -12,14 +12,14 @@
// TODO : Review this in a generic unique resource ...
static std::vector<ememory::SharedPtr<appl::Highlight>>& s_list() {
static std::vector<ememory::SharedPtr<appl::Highlight>> list;
static etk::Vector<ememory::SharedPtr<appl::Highlight>>& s_list() {
static etk::Vector<ememory::SharedPtr<appl::Highlight>> list;
return list;
}
void appl::highlightManager::init() {
std::vector<ememory::SharedPtr<appl::Highlight>>& hlList = s_list();
etk::Vector<ememory::SharedPtr<appl::Highlight>>& hlList = s_list();
if (hlList.size() != 0) {
APPL_ERROR("HighlightManager == > already exist, just unlink the previous ...");
hlList.clear();
@ -27,7 +27,7 @@ void appl::highlightManager::init() {
APPL_DEBUG("HighlightManager == > INIT");
etk::FSNode myFile("DATA:languages/");
// get the subfolder list :
std::vector<etk::FSNode *> list = myFile.folderGetSubList(false, true, false,false);
etk::Vector<etk::FSNode *> list = myFile.folderGetSubList(false, true, false,false);
for (auto &it : list) {
if (it == nullptr) {
continue;
@ -35,7 +35,7 @@ void appl::highlightManager::init() {
if (it->getNodeType() != etk::typeNode_folder) {
continue;
}
std::string filename = it->getName() + "/highlight.xml";
etk::String filename = it->getName() + "/highlight.xml";
APPL_DEBUG("Load xml name : " << filename);
ememory::SharedPtr<appl::Highlight> myHightLine = appl::Highlight::create(filename);
if (myHightLine != nullptr) {
@ -46,7 +46,7 @@ void appl::highlightManager::init() {
APPL_WARNING("LANGUAGE : replace pattern name: '" << myHightLine->getTypeName() << "' with file '" << filename << "' replace: " << it2->getName());
}
}
hlList.push_back(myHightLine);
hlList.pushBack(myHightLine);
} else {
APPL_ERROR("Can not allocate HighLight");
}
@ -61,7 +61,7 @@ void appl::highlightManager::init() {
}
void appl::highlightManager::unInit() {
std::vector<ememory::SharedPtr<Highlight>>& hlList = s_list();
etk::Vector<ememory::SharedPtr<Highlight>>& hlList = s_list();
if (hlList.size() == 0) {
APPL_DEBUG("HighlightManager ==> no highlight");
hlList.clear();
@ -70,12 +70,12 @@ void appl::highlightManager::unInit() {
hlList.clear();
}
std::string appl::highlightManager::getTypeFile(const std::string& _fileName) {
etk::String appl::highlightManager::getTypeFile(const etk::String& _fileName) {
if (_fileName.size() == 0) {
return "";
}
APPL_WARNING("Try to find type for extention : '" << _fileName << "' in " << s_list().size() << " types");
std::vector<ememory::SharedPtr<Highlight>>& hlList = s_list();
etk::Vector<ememory::SharedPtr<Highlight>>& hlList = s_list();
for (auto &it : hlList) {
if (it == nullptr) {
continue;
@ -89,7 +89,7 @@ std::string appl::highlightManager::getTypeFile(const std::string& _fileName) {
return "";
}
std::string appl::highlightManager::getFileWithTypeType(const std::string& _type) {
etk::String appl::highlightManager::getFileWithTypeType(const etk::String& _type) {
if (_type.size() == 0) {
return "";
}
@ -104,8 +104,8 @@ std::string appl::highlightManager::getFileWithTypeType(const std::string& _type
return "";
}
std::vector<std::string> appl::highlightManager::getTypeList() {
std::vector<std::string> ret;
etk::Vector<etk::String> appl::highlightManager::getTypeList() {
etk::Vector<etk::String> ret;
return ret;
}

View File

@ -25,18 +25,18 @@ namespace appl {
* @param[in] _fileName name of the file
* @return type of highlight
*/
std::string getTypeFile(const std::string& _fileName);
etk::String getTypeFile(const etk::String& _fileName);
/**
* @brief Get filename with type.
* @param[in] _type Type name of the highlight.
* @return filename of the highlight.
*/
std::string getFileWithTypeType(const std::string& _type);
etk::String getFileWithTypeType(const etk::String& _type);
/**
* @brief Get the list of extention type
* @return the requested list.
*/
std::vector<std::string> getTypeList();
etk::Vector<etk::String> getTypeList();
};
}

View File

@ -35,7 +35,7 @@ appl::HighlightPattern::~HighlightPattern() {
}
void appl::HighlightPattern::setPatern(const std::string& _regExp, const std::string& _regExpStop, bool _hasEndRegEx) {
void appl::HighlightPattern::setPatern(const etk::String& _regExp, const etk::String& _regExpStop, bool _hasEndRegEx) {
m_regexValue[0] = _regExp;
m_regexValue[1] = _regExpStop;
m_hasEndRegEx = _hasEndRegEx;
@ -59,11 +59,11 @@ void appl::HighlightPattern::setPatern(const std::string& _regExp, const std::st
}
}
std::pair<std::string,std::string> appl::HighlightPattern::getPaternString() {
return std::make_pair(m_regexValue[0], m_regexValue[1]);
etk::Pair<etk::String,etk::String> appl::HighlightPattern::getPaternString() {
return etk::makePair(m_regexValue[0], m_regexValue[1]);
}
void appl::HighlightPattern::setColorGlyph(const std::string& _colorName) {
void appl::HighlightPattern::setColorGlyph(const etk::String& _colorName) {
m_colorName = _colorName;
m_colorId = m_glyphPainting->request(m_colorName);
APPL_VERBOSE("Resuest color name '" << m_colorName << "' => id=" << m_colorId);
@ -86,8 +86,8 @@ void appl::HighlightPattern::parseRules(const exml::Element& _child, int32_t _le
*/
//--------------------------------------------------------------------------------------------
// process attribute
std::string highLightName = _child.attributes["name"];
std::string myEdnDataTmp = "???";
etk::String highLightName = _child.attributes["name"];
etk::String myEdnDataTmp = "???";
if (highLightName.size()!=0) {
myEdnDataTmp = highLightName;
}
@ -96,17 +96,17 @@ void appl::HighlightPattern::parseRules(const exml::Element& _child, int32_t _le
exml::Element xChild = _child.nodes["color"];
if (xChild.exist() == true) {
std::string myData = xChild.getText();
etk::String myData = xChild.getText();
if (myData.size() != 0) {
setColorGlyph(myData);
}
}
std::string paterStart;
std::string paterStop;
etk::String paterStart;
etk::String paterStop;
xChild = _child.nodes["regex"];
if (xChild.exist() == true) {
if (xChild.nodes.size() == 1 && xChild.nodes[0].getType() == exml::nodeType::text) {
std::string myData = xChild.getText();
etk::String myData = xChild.getText();
if (myData.size() != 0) {
paterStart = myData;
}
@ -114,14 +114,14 @@ void appl::HighlightPattern::parseRules(const exml::Element& _child, int32_t _le
} else {
exml::Element xxChild = xChild.nodes["start"];
if (xxChild.exist() == true) {
std::string myData = xxChild.getText();
etk::String myData = xxChild.getText();
if (myData.size() != 0) {
paterStart = myData;
}
}
xxChild = xChild.nodes["stop"];
if (xxChild.exist() == true) {
std::string myData = xxChild.getText();
etk::String myData = xxChild.getText();
if (myData.size() != 0) {
paterStop = myData;
}
@ -131,7 +131,7 @@ void appl::HighlightPattern::parseRules(const exml::Element& _child, int32_t _le
}
xChild = _child.nodes["sub"];
if (xChild.exist() == true) {
std::string myData = xChild.getText();
etk::String myData = xChild.getText();
if (myData.size() != 0) {
setSubPatternName(myData);
}
@ -158,7 +158,7 @@ bool appl::HighlightPattern::find(int32_t _start,
if (m_regExp[0].processOneElement(_buffer, _start, _stop) == true) {
_resultat.start = m_regExp[0].start();
_resultat.stop = m_regExp[0].stop();
//APPL_DEBUG("find data at : start=" << _resultat.start << " stop=" << _resultat.stop << " data='" <<std::string(_buffer, _resultat.start, _resultat.stop-_resultat.start) << "'" );
//APPL_DEBUG("find data at : start=" << _resultat.start << " stop=" << _resultat.stop << " data='" <<etk::String(_buffer, _resultat.start, _resultat.stop-_resultat.start) << "'" );
//APPL_DEBUG("find data at : start=" << _resultat.start << " stop=" << _resultat.stop );
if (m_hasEndRegEx == true) {
// when no regex specify ==> get all the buffer ...

View File

@ -9,7 +9,7 @@
class HighlightPattern;
#include <appl/GlyphPainting.hpp>
#include <vector>
#include <etk/Vector.hpp>
#include <regex>
#include <etk/RegExp.hpp>
#include <etk/Buffer.hpp>
@ -25,36 +25,36 @@ namespace appl {
HighlightPattern(const ememory::SharedPtr<appl::GlyphPainting>& _glyphPainting, const exml::Element& _child, int32_t _level);
virtual ~HighlightPattern();
private:
std::string m_paternName; //!< Current style name (like "c++" or "c" or "script Bash")
etk::String m_paternName; //!< Current style name (like "c++" or "c" or "script Bash")
public:
void setName(const std::string& _name) {
void setName(const etk::String& _name) {
m_paternName = _name;
};
const std::string& getName() {
const etk::String& getName() {
return m_paternName;
};
private:
std::string m_paternSubName; //!< Sub patern name if needed
etk::String m_paternSubName; //!< Sub patern name if needed
public:
void setSubPatternName(const std::string& _name) {
void setSubPatternName(const etk::String& _name) {
m_paternSubName = _name;
};
const std::string& getSubPatternName() {
const etk::String& getSubPatternName() {
return m_paternSubName;
};
private:
bool m_hasParsingError;
std::string m_regexValue[2];
etk::String m_regexValue[2];
bool m_hasEndRegEx;
etk::RegExp<etk::Buffer> m_regExp[2]; //!< Start of Regular expression
public:
void setPatern(const std::string& _regExp, const std::string& _regExpStop="", bool _hasEndRegEx=false);
std::pair<std::string,std::string> getPaternString();
void setPatern(const etk::String& _regExp, const etk::String& _regExpStop="", bool _hasEndRegEx=false);
etk::Pair<etk::String,etk::String> getPaternString();
private:
std::string m_colorName; //!< Current color name
etk::String m_colorName; //!< Current color name
int32_t m_colorId; //!< Id of the the glyph painting
public:
void setColorGlyph(const std::string& _colorName);
void setColorGlyph(const etk::String& _colorName);
const appl::GlyphDecoration& getColorGlyph() {
return (*m_glyphPainting)[m_colorId];
};

View File

@ -127,7 +127,7 @@ namespace appl {
*/
virtual bool onWrite(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos,
const std::string& _data) {
const etk::String& _data) {
return false;
};
protected:
@ -150,7 +150,7 @@ namespace appl {
*/
virtual bool onReplace(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos,
const std::string& _data,
const etk::String& _data,
const appl::Buffer::Iterator& _posEnd) {
return false;
};
@ -192,7 +192,7 @@ namespace appl {
* @param[in] _shortCutName Generic message requested.
* @return true if the event might not propagate anymore
*/
virtual bool onReceiveShortCut(appl::TextViewer& _textDrawer, const std::string& _shortCutName) {
virtual bool onReceiveShortCut(appl::TextViewer& _textDrawer, const etk::String& _shortCutName) {
return false;
}
protected:

View File

@ -42,7 +42,7 @@ bool appl::TextPluginAutoIndent::onEventEntry(appl::TextViewer& _textDrawer,
startLine = _textDrawer.selectStart();
}
startLine = _textDrawer.getStartLine(startLine);
std::string data = "\n";
etk::String data = "\n";
for (appl::Buffer::Iterator it = startLine;

View File

@ -55,14 +55,14 @@ void appl::TextPluginCopy::onPluginDisable(appl::TextViewer& _textDrawer) {
}
bool appl::TextPluginCopy::onReceiveShortCut(appl::TextViewer& _textDrawer,
const std::string& _shortCutName) {
const etk::String& _shortCutName) {
if (isEnable() == false) {
return false;
}
if ( _shortCutName == "appl::TextPluginCopy::copy"
|| _shortCutName == "appl::TextPluginCopy::cut") {
if (_textDrawer.hasBuffer() == true) {
std::string value;
etk::String value;
_textDrawer.copy(value);
if (value.size() != 0) {
gale::context::clipBoard::set(gale::context::clipBoard::clipboardStd, value);

View File

@ -28,7 +28,7 @@ namespace appl {
public:
virtual void onPluginEnable(appl::TextViewer& _textDrawer);
virtual void onPluginDisable(appl::TextViewer& _textDrawer);
virtual bool onReceiveShortCut(appl::TextViewer& _textDrawer, const std::string& _shortCutName);
virtual bool onReceiveShortCut(appl::TextViewer& _textDrawer, const etk::String& _shortCutName);
};
}

View File

@ -37,7 +37,7 @@ void appl::TextPluginCtags::onPluginDisable(appl::TextViewer& _textDrawer) {
_textDrawer.ext_shortCutRm("appl::TextPluginCtags::OpenCtagsFile");
}
void appl::TextPluginCtags::jumpTo(const std::string& _name) {
void appl::TextPluginCtags::jumpTo(const etk::String& _name) {
if (m_ctagFile == nullptr) {
APPL_WARNING("No ctags file open");
return;
@ -52,7 +52,7 @@ void appl::TextPluginCtags::jumpTo(const std::string& _name) {
int32_t numberOfTags = 0;
// For all tags : Save in an internal Structure :
std::string tmpFile(m_tagFolderBase + "/" + entry.file);
etk::String tmpFile(m_tagFolderBase + "/" + entry.file);
etk::FSNode myfile(tmpFile);
int32_t lineID = entry.address.lineNumber;
printTag(&entry);
@ -79,13 +79,13 @@ void appl::TextPluginCtags::jumpTo(const std::string& _name) {
}
}
void appl::TextPluginCtags::jumpFile(const std::string& _filename, int64_t _lineId) {
void appl::TextPluginCtags::jumpFile(const etk::String& _filename, int64_t _lineId) {
// save the current file in the history
// TODO : registerHistory();
if (m_bufferManager != nullptr) {
m_bufferManager->open(_filename);
}
//sendMultiCast(appl::MsgSelectGotoLineSelect, etk::to_string(_lineId));
//sendMultiCast(appl::MsgSelectGotoLineSelect, etk::toString(_lineId));
APPL_TODO("request jup at line ...");
}
@ -131,7 +131,7 @@ void appl::TextPluginCtags::printTag(const tagEntry *_entry) {
#endif
}
void appl::TextPluginCtags::onCallbackOpenCtagsOpenFileReturn(const std::string& _value) {
void appl::TextPluginCtags::onCallbackOpenCtagsOpenFileReturn(const etk::String& _value) {
// open the new one :
etk::FSNode tmpFilename = _value;
m_tagFilename = tmpFilename.getNameFile();
@ -140,7 +140,7 @@ void appl::TextPluginCtags::onCallbackOpenCtagsOpenFileReturn(const std::string&
loadTagFile();
}
void appl::TextPluginCtags::onCallbackOpenCtagsSelectReturn(const std::string& _value) {
void appl::TextPluginCtags::onCallbackOpenCtagsSelectReturn(const etk::String& _value) {
// parse the input data
char tmp[4096];
int32_t lineID;
@ -150,7 +150,7 @@ void appl::TextPluginCtags::onCallbackOpenCtagsSelectReturn(const std::string& _
}
bool appl::TextPluginCtags::onReceiveShortCut(appl::TextViewer& _textDrawer,
const std::string& _shortCutName) {
const etk::String& _shortCutName) {
if (isEnable() == false) {
return false;
}
@ -164,7 +164,7 @@ bool appl::TextPluginCtags::onReceiveShortCut(appl::TextViewer& _textDrawer,
tmpWidget->propertyLabelTitle.set("Open Exuberant Ctags file");
tmpWidget->propertyLabelValidate.set("Open");
// try to get the current folder :
std::string path = _textDrawer.getBufferPath();
etk::String path = _textDrawer.getBufferPath();
APPL_ERROR("get path : '" << path << "'");
if (path != "") {
tmpWidget->propertyPath.set(path);
@ -176,7 +176,7 @@ bool appl::TextPluginCtags::onReceiveShortCut(appl::TextViewer& _textDrawer,
if (_textDrawer.hasBuffer() == false) {
return false;
}
std::string textToSearch;
etk::String textToSearch;
if (_textDrawer.hasTextSelected() == true) {
_textDrawer.copy(textToSearch, _textDrawer.selectStart(), _textDrawer.selectStop() );
} else {

View File

@ -19,15 +19,15 @@ namespace appl {
private:
// Global plugin data (not specific on buffer :
/*
std::vector<std::pair<std::string, int64_t>> m_historyList;
etk::Vector<etk::Pair<etk::String, int64_t>> m_historyList;
*/
std::string m_tagFolderBase;
std::string m_tagFilename;
etk::String m_tagFolderBase;
etk::String m_tagFilename;
tagFile* m_ctagFile;
void loadTagFile();
void printTag(const tagEntry *_entry);
void jumpTo(const std::string& _name);
void jumpFile(const std::string& _filename, int64_t _lineId);
void jumpTo(const etk::String& _name);
void jumpFile(const etk::String& _filename, int64_t _lineId);
ememory::SharedPtr<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager
protected:
TextPluginCtags();
@ -38,10 +38,10 @@ namespace appl {
virtual void onPluginEnable(appl::TextViewer& _textDrawer);
virtual void onPluginDisable(appl::TextViewer& _textDrawer);
virtual bool onReceiveShortCut(appl::TextViewer& _textDrawer,
const std::string& _shortCutName);
const etk::String& _shortCutName);
// callback function:
void onCallbackOpenCtagsOpenFileReturn(const std::string& _value);
void onCallbackOpenCtagsSelectReturn(const std::string& _value);
void onCallbackOpenCtagsOpenFileReturn(const etk::String& _value);
void onCallbackOpenCtagsSelectReturn(const etk::String& _value);
};
}

View File

@ -28,7 +28,7 @@ namespace appl {
m_specificData.clear();
}
private:
std::vector<std::pair<ememory::WeakPtr<appl::Buffer> ,std::unique_ptr<TYPE>>> m_specificData;
etk::Vector<etk::Pair<ememory::WeakPtr<appl::Buffer> ,std::unique_ptr<TYPE>>> m_specificData;
protected:
TYPE* getDataRef(appl::TextViewer& _textDrawer) {
auto it = m_specificData.begin();
@ -49,13 +49,13 @@ namespace appl {
return nullptr;
}
TYPE* copyPocalPointer = data.get();
m_specificData.push_back(std::make_pair(_textDrawer.internalGetBuffer(), std::move(data)));
m_specificData.pushBack(etk::makePair(_textDrawer.internalGetBuffer(), etk::move(data)));
// create a new one ...
return copyPocalPointer;
}
protected: // Wrap all element with their internal data: (do not use theses function)
bool onReceiveShortCut(appl::TextViewer& _textDrawer,
const std::string& _shortCutName) {
const etk::String& _shortCutName) {
TYPE* data = getDataRef(_textDrawer);
if (data == nullptr) {
return false;
@ -64,7 +64,7 @@ namespace appl {
}
bool onWrite(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos,
const std::string& _data) {
const etk::String& _data) {
TYPE* data = getDataRef(_textDrawer);
if (data == nullptr) {
return false;
@ -73,7 +73,7 @@ namespace appl {
}
bool onReplace(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos,
const std::string& _data,
const etk::String& _data,
const appl::Buffer::Iterator& _posEnd) {
TYPE* data = getDataRef(_textDrawer);
if (data == nullptr) {
@ -93,19 +93,19 @@ namespace appl {
public:
virtual bool onDataReceiveShortCut(appl::TextViewer& _textDrawer,
const std::string& _shortCutName,
const etk::String& _shortCutName,
TYPE& _data) {
return false;
}
virtual bool onDataWrite(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos,
const std::string& _strData,
const etk::String& _strData,
TYPE& _data) {
return false;
}
virtual bool onDataReplace(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos,
const std::string& _strData,
const etk::String& _strData,
const appl::Buffer::Iterator& _posEnd,
TYPE& _data) {
return false;

View File

@ -48,7 +48,7 @@ void appl::TextPluginHistory::onPluginDisable(appl::TextViewer& _textDrawer) {
}
bool appl::TextPluginHistory::onDataReceiveShortCut(appl::TextViewer& _textDrawer,
const std::string& _shortCutName,
const etk::String& _shortCutName,
appl::PluginHistoryData& _data) {
if (isEnable() == false) {
return false;
@ -58,12 +58,12 @@ bool appl::TextPluginHistory::onDataReceiveShortCut(appl::TextViewer& _textDrawe
return true;
}
if (_data.m_redo[_data.m_redo.size()-1] == nullptr) {
_data.m_redo.pop_back();
_data.m_redo.popBack();
return true;
}
appl::History *tmpElement = _data.m_redo[_data.m_redo.size()-1];
_data.m_redo.pop_back();
_data.m_undo.push_back(tmpElement);
_data.m_redo.popBack();
_data.m_undo.pushBack(tmpElement);
_textDrawer.replaceDirect(tmpElement->m_addedText,
_textDrawer.position(tmpElement->m_posAdded),
_textDrawer.position(tmpElement->m_endPosRemoved) );
@ -74,12 +74,12 @@ bool appl::TextPluginHistory::onDataReceiveShortCut(appl::TextViewer& _textDrawe
return true;
}
if (_data.m_undo[_data.m_undo.size()-1] == nullptr) {
_data.m_undo.pop_back();
_data.m_undo.popBack();
return true;
}
appl::History *tmpElement = _data.m_undo[_data.m_undo.size()-1];
_data.m_undo.pop_back();
_data.m_redo.push_back(tmpElement);
_data.m_undo.popBack();
_data.m_redo.pushBack(tmpElement);
_textDrawer.replaceDirect(tmpElement->m_removedText,
_textDrawer.position(tmpElement->m_posAdded),
_textDrawer.position(tmpElement->m_endPosAdded) );
@ -120,7 +120,7 @@ void appl::TextPluginHistory::clearUndo(appl::PluginHistoryData& _data) {
bool appl::TextPluginHistory::onDataWrite(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos,
const std::string& _strData,
const etk::String& _strData,
appl::PluginHistoryData& _data) {
if (isEnable() == false) {
return false;
@ -137,7 +137,7 @@ bool appl::TextPluginHistory::onDataWrite(appl::TextViewer& _textDrawer,
if (tmpElement != nullptr) {
tmpElement->m_endPosAdded = (int64_t)_textDrawer.cursor();
clearRedo(_data);
_data.m_undo.push_back(tmpElement);
_data.m_undo.pushBack(tmpElement);
}
ememory::SharedPtr<appl::textPluginManager> mng = m_pluginManager.lock();
if (mng!=nullptr) {
@ -148,7 +148,7 @@ bool appl::TextPluginHistory::onDataWrite(appl::TextViewer& _textDrawer,
bool appl::TextPluginHistory::onDataReplace(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos,
const std::string& _strData,
const etk::String& _strData,
const appl::Buffer::Iterator& _posEnd,
appl::PluginHistoryData& _data) {
if (isEnable() == false) {
@ -165,7 +165,7 @@ bool appl::TextPluginHistory::onDataReplace(appl::TextViewer& _textDrawer,
if (tmpElement != nullptr) {
tmpElement->m_endPosAdded = (int64_t)_textDrawer.cursor();
clearRedo(_data);
_data.m_undo.push_back(tmpElement);
_data.m_undo.pushBack(tmpElement);
}
ememory::SharedPtr<appl::textPluginManager> mng = m_pluginManager.lock();
if (mng!=nullptr) {
@ -189,7 +189,7 @@ bool appl::TextPluginHistory::onDataRemove(appl::TextViewer& _textDrawer,
tmpElement->m_endPosRemoved = (int64_t)_posEnd;
_textDrawer.copy(tmpElement->m_removedText, _pos, _posEnd);
clearRedo(_data);
_data.m_undo.push_back(tmpElement);
_data.m_undo.pushBack(tmpElement);
}
_textDrawer.removeDirect();
ememory::SharedPtr<appl::textPluginManager> mng = m_pluginManager.lock();

View File

@ -19,16 +19,16 @@ namespace appl {
m_endPosRemoved(0) {
};
std::string m_addedText;
std::string m_removedText;
etk::String m_addedText;
etk::String m_removedText;
int64_t m_posAdded;
int64_t m_endPosAdded;
int64_t m_endPosRemoved;
};
class PluginHistoryData {
public:
std::vector<History*> m_undo; //!< History storing data
std::vector<History*> m_redo; //!< History storing data
etk::Vector<History*> m_undo; //!< History storing data
etk::Vector<History*> m_redo; //!< History storing data
};
class TextPluginHistory : public appl::TextViewerPluginData<appl::PluginHistoryData> {
private:
@ -45,15 +45,15 @@ namespace appl {
virtual void onPluginEnable(appl::TextViewer& _textDrawer);
virtual void onPluginDisable(appl::TextViewer& _textDrawer);
virtual bool onDataReceiveShortCut(appl::TextViewer& _textDrawer,
const std::string& _shortCutName,
const etk::String& _shortCutName,
appl::PluginHistoryData& _data);
virtual bool onDataWrite(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos,
const std::string& _strData,
const etk::String& _strData,
appl::PluginHistoryData& _data);
virtual bool onDataReplace(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos,
const std::string& _strData,
const etk::String& _strData,
const appl::Buffer::Iterator& _posEnd,
appl::PluginHistoryData& _data);
virtual bool onDataRemove(appl::TextViewer& _textDrawer,

View File

@ -16,7 +16,7 @@
appl::textPluginManager::textPluginManager() {
}
void appl::textPluginManager::init(const std::string& _name) {
void appl::textPluginManager::init(const etk::String& _name) {
gale::Resource::init(_name);
}
@ -35,27 +35,27 @@ void appl::textPluginManager::addPlugin(ememory::SharedPtr<appl::TextViewerPlugi
return;
}
APPL_DEBUG("Add plugin : " << _plugin->getObjectType());
m_list.push_back(_plugin);
m_list.pushBack(_plugin);
if (_plugin->isAvaillableOnEventEntry() == true) {
m_listOnEventEntry.push_back(_plugin);
m_listOnEventEntry.pushBack(_plugin);
}
if (_plugin->isAvaillableOnEventInput() == true) {
m_listOnEventInput.push_back(_plugin);
m_listOnEventInput.pushBack(_plugin);
}
if (_plugin->isAvaillableOnWrite() == true) {
m_listOnWrite.push_back(_plugin);
m_listOnWrite.pushBack(_plugin);
}
if (_plugin->isAvaillableOnReplace() == true) {
m_listOnReplace.push_back(_plugin);
m_listOnReplace.pushBack(_plugin);
}
if (_plugin->isAvaillableOnRemove() == true) {
m_listOnRemove.push_back(_plugin);
m_listOnRemove.pushBack(_plugin);
}
if (_plugin->isAvaillableOnReceiveShortCut() == true) {
m_listOnReceiveShortCutViewer.push_back(_plugin);
m_listOnReceiveShortCutViewer.pushBack(_plugin);
}
if (_plugin->isAvaillableOnCursorMove() == true) {
m_listOnCursorMove.push_back(_plugin);
m_listOnCursorMove.pushBack(_plugin);
}
ememory::SharedPtr<appl::TextViewer> viewer = m_currentViewer.lock();
if (viewer != nullptr) {
@ -111,7 +111,7 @@ bool appl::textPluginManager::onEventInput(appl::TextViewer& _textDrawer,
bool appl::textPluginManager::onWrite(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos,
const std::string& _data) {
const etk::String& _data) {
for (auto &it : m_listOnWrite) {
if (it == nullptr) {
continue;
@ -125,7 +125,7 @@ bool appl::textPluginManager::onWrite(appl::TextViewer& _textDrawer,
bool appl::textPluginManager::onReplace(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos,
const std::string& _data,
const etk::String& _data,
const appl::Buffer::Iterator& _posEnd) {
for (auto &it : m_listOnReplace) {
if (it == nullptr) {
@ -153,7 +153,7 @@ bool appl::textPluginManager::onRemove(appl::TextViewer& _textDrawer,
}
bool appl::textPluginManager::onReceiveShortCut(appl::TextViewer& _textDrawer,
const std::string& _shortCutName) {
const etk::String& _shortCutName) {
for (auto &it : m_listOnReceiveShortCutViewer) {
if (it == nullptr) {
continue;

View File

@ -15,16 +15,16 @@ namespace appl {
private:
ememory::WeakPtr<appl::TextViewer> m_currentViewer;
std::list<ememory::SharedPtr<appl::TextViewerPlugin>> m_list;
std::vector<ememory::SharedPtr<appl::TextViewerPlugin>> m_listOnEventEntry;
std::vector<ememory::SharedPtr<appl::TextViewerPlugin>> m_listOnEventInput;
std::vector<ememory::SharedPtr<appl::TextViewerPlugin>> m_listOnWrite;
std::vector<ememory::SharedPtr<appl::TextViewerPlugin>> m_listOnReplace;
std::vector<ememory::SharedPtr<appl::TextViewerPlugin>> m_listOnRemove;
std::vector<ememory::SharedPtr<appl::TextViewerPlugin>> m_listOnReceiveShortCutViewer;
std::vector<ememory::SharedPtr<appl::TextViewerPlugin>> m_listOnCursorMove;
etk::Vector<ememory::SharedPtr<appl::TextViewerPlugin>> m_listOnEventEntry;
etk::Vector<ememory::SharedPtr<appl::TextViewerPlugin>> m_listOnEventInput;
etk::Vector<ememory::SharedPtr<appl::TextViewerPlugin>> m_listOnWrite;
etk::Vector<ememory::SharedPtr<appl::TextViewerPlugin>> m_listOnReplace;
etk::Vector<ememory::SharedPtr<appl::TextViewerPlugin>> m_listOnRemove;
etk::Vector<ememory::SharedPtr<appl::TextViewerPlugin>> m_listOnReceiveShortCutViewer;
etk::Vector<ememory::SharedPtr<appl::TextViewerPlugin>> m_listOnCursorMove;
protected:
textPluginManager();
void init(const std::string& _name);
void init(const etk::String& _name);
public:
DECLARE_RESOURCE_SINGLE_FACTORY(textPluginManager, "plugin-Manager");
virtual ~textPluginManager() {};
@ -72,7 +72,7 @@ namespace appl {
*/
bool onWrite(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos,
const std::string& _data);
const etk::String& _data);
/**
* @brief Called when data is written in the buffer, and some are removed.
* @param[in] _widget Reference on the widget caller.
@ -83,7 +83,7 @@ namespace appl {
*/
bool onReplace(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos,
const std::string& _data,
const etk::String& _data,
const appl::Buffer::Iterator& _posEnd);
/**
* @brief Called when data is removed.
@ -102,7 +102,7 @@ namespace appl {
* @return true if the event might not propagate anymore
*/
bool onReceiveShortCut(appl::TextViewer& _textDrawer,
const std::string& _shortCutName);
const etk::String& _shortCutName);
/**
* @brief Called when Cursor move of position.
* @param[in] _widget Reference on the widget caller.

View File

@ -37,7 +37,7 @@ bool appl::TextPluginMultiLineTab::onEventEntry(appl::TextViewer& _textDrawer,
itStart = _textDrawer.getStartLine(itStart);
itStop = _textDrawer.getEndLine(itStop);
// copy the curent data in a classicle string:
std::string data;
etk::String data;
_textDrawer.copy(data, itStart, itStop);
// TODO : Change this ...
bool m_useTabs = true;

View File

@ -22,7 +22,7 @@ void appl::TextPluginRmLine::onPluginDisable(appl::TextViewer& _textDrawer) {
}
bool appl::TextPluginRmLine::onReceiveShortCut(appl::TextViewer& _textDrawer,
const std::string& _shortCutName) {
const etk::String& _shortCutName) {
if (isEnable() == false) {
return false;
}

View File

@ -22,7 +22,7 @@ namespace appl {
public:
virtual void onPluginEnable(appl::TextViewer& _textDrawer);
virtual void onPluginDisable(appl::TextViewer& _textDrawer);
virtual bool onReceiveShortCut(appl::TextViewer& _textDrawer, const std::string& _shortCutName);
virtual bool onReceiveShortCut(appl::TextViewer& _textDrawer, const etk::String& _shortCutName);
};
}

View File

@ -45,7 +45,7 @@ void appl::TextPluginSelectAll::onPluginDisable(appl::TextViewer& _textDrawer) {
bool appl::TextPluginSelectAll::onReceiveShortCut(appl::TextViewer& _textDrawer,
const std::string& _shortCutName) {
const etk::String& _shortCutName) {
if (isEnable() == false) {
return false;
}

View File

@ -25,7 +25,7 @@ namespace appl {
public:
virtual void onPluginEnable(appl::TextViewer& _textDrawer);
virtual void onPluginDisable(appl::TextViewer& _textDrawer);
virtual bool onReceiveShortCut(appl::TextViewer& _textDrawer, const std::string& _shortCutName);
virtual bool onReceiveShortCut(appl::TextViewer& _textDrawer, const etk::String& _shortCutName);
};
}

View File

@ -11,7 +11,7 @@
#include <etk/os/FSNode.hpp>
#include <ejson/ejson.hpp>
static std::string g_baseDBName = "USERDATA:genericConfig.json";
static etk::String g_baseDBName = "USERDATA:genericConfig.json";
class myParamGlobal : public ewol::Object {
@ -139,17 +139,17 @@ void globals::ParameterGlobalsGui::init() {
ewol::widget::Composer::init();
loadFromFile("DATA:GUI-Parameter-global.xml", getId());
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]appl-param:auto-indent", "value", etk::to_string(isSetAutoIndent()));
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]appl-param:display-space-char", "value", etk::to_string(isSetDisplaySpaceChar()));
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]appl-param:display-tab", "value", etk::to_string(isSetDisplayTabChar()));
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]appl-param:display-eol", "value", etk::to_string(isSetDisplayEndOfLine()));
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]appl-param:display-shape", "value", etk::to_string(isSetDisplayEndOfLine()));
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]appl-param:auto-indent", "value", etk::to_string(isSetAutoIndent()));
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]appl-param:display-space-char", "value", etk::to_string(isSetDisplaySpaceChar()));
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]appl-param:display-tab", "value", etk::to_string(isSetDisplayTabChar()));
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]appl-param:display-eol", "value", etk::to_string(isSetDisplayEndOfLine()));
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]appl-param:display-shape", "value", etk::to_string(isSetDisplayEndOfLine()));
subBind(ewol::widget::CheckBox, "[" + etk::to_string(getId()) + "]appl-param:auto-indent", signalValue, sharedFromThis(), &globals::ParameterGlobalsGui::onCallbackIndentation);
subBind(ewol::widget::CheckBox, "[" + etk::to_string(getId()) + "]appl-param:display-space-char", signalValue, sharedFromThis(), &globals::ParameterGlobalsGui::onCallbackSpace);
subBind(ewol::widget::CheckBox, "[" + etk::to_string(getId()) + "]appl-param:display-tab", signalValue, sharedFromThis(), &globals::ParameterGlobalsGui::onCallbackTabulation);
subBind(ewol::widget::CheckBox, "[" + etk::to_string(getId()) + "]appl-param:display-eol", signalValue, sharedFromThis(), &globals::ParameterGlobalsGui::onCallbackEndOfLine);
subBind(ewol::widget::CheckBox, "[" + etk::to_string(getId()) + "]appl-param:display-shape", signalValue, sharedFromThis(), &globals::ParameterGlobalsGui::onCallbackRounded);
subBind(ewol::widget::CheckBox, "[" + etk::toString(getId()) + "]appl-param:auto-indent", signalValue, sharedFromThis(), &globals::ParameterGlobalsGui::onCallbackIndentation);
subBind(ewol::widget::CheckBox, "[" + etk::toString(getId()) + "]appl-param:display-space-char", signalValue, sharedFromThis(), &globals::ParameterGlobalsGui::onCallbackSpace);
subBind(ewol::widget::CheckBox, "[" + etk::toString(getId()) + "]appl-param:display-tab", signalValue, sharedFromThis(), &globals::ParameterGlobalsGui::onCallbackTabulation);
subBind(ewol::widget::CheckBox, "[" + etk::toString(getId()) + "]appl-param:display-eol", signalValue, sharedFromThis(), &globals::ParameterGlobalsGui::onCallbackEndOfLine);
subBind(ewol::widget::CheckBox, "[" + etk::toString(getId()) + "]appl-param:display-shape", signalValue, sharedFromThis(), &globals::ParameterGlobalsGui::onCallbackRounded);
}
globals::ParameterGlobalsGui::~ParameterGlobalsGui() {

View File

@ -33,7 +33,7 @@ class MainApplication : public ewol::context::Application {
virtual void onCreate(ewol::Context& _context) override {
APPL_INFO(" == > CREATE ... " << PROJECT_NAME << " v" << APPL_VERSION << " (START) [" << gale::getBoardType() << "] (" << gale::getCompilationMode() << ") (BEGIN)");
for( int32_t iii=0 ; iii<_context.getCmd().size(); iii++) {
std::string tmpppp = _context.getCmd().get(iii);
etk::String tmpppp = _context.getCmd().get(iii);
if ( tmpppp == "-h"
|| tmpppp == "--help") {
APPL_INFO(" -t c-flags-file-name" );
@ -99,12 +99,12 @@ class MainApplication : public ewol::context::Application {
APPL_INFO("show list of files : ");
bool ctagDetected = false;
for( int32_t iii=0 ; iii<_context.getCmd().size(); iii++) {
std::string tmpppp = _context.getCmd().get(iii);
etk::String tmpppp = _context.getCmd().get(iii);
if (tmpppp == "-t") {
ctagDetected = true;
} else if (ctagDetected == true) {
etk::FSNode file(tmpppp);
std::string name = file.getName();
etk::String name = file.getName();
APPL_INFO("Load ctag file : \"" << name << "\"" );
ctagDetected = false;
//_context.getEObjectManager().multiCast().anonymousSend(ednMsgCtagsLoadFile, name);
@ -114,15 +114,15 @@ class MainApplication : public ewol::context::Application {
} else {
etk::FSNode file(tmpppp);
if (file.getNodeType() == etk::typeNode_file) {
std::string name = file.getName();
etk::String name = file.getName();
APPL_INFO("need load file : \"" << name << "\"" );
m_bufferManager->open(name);
} else if (file.getNodeType() == etk::typeNode_folder) {
std::vector<std::string> listOfFiles = file.folderGetSub(false, true, ".*");
etk::Vector<etk::String> listOfFiles = file.folderGetSub(false, true, ".*");
for (auto &it: listOfFiles) {
etk::FSNode file2(it);
if (file2.getNodeType() == etk::typeNode_file) {
std::string name = file2.getName();
etk::String name = file2.getName();
APPL_INFO("need load file : \"" << name << "\"" );
m_bufferManager->open(name);
}
@ -163,7 +163,7 @@ class MainApplication : public ewol::context::Application {
int main(int _argc, const char *_argv[]) {
/*
APPL_ERROR(" base signature = " << typeid(&MainApplication::init).name());
APPL_ERROR(" base signature = " << typeid(std::string).name());
APPL_ERROR(" base signature = " << typeid(etk::String).name());
APPL_CRITICAL(" END ");
*/
// second possibility

View File

@ -24,7 +24,7 @@ aa "\u4855" aa "\U78965412" aa "\x0F" aa "\o45"
"dqf\"gsdfg" // \\ \n "
// TODO : sqdkfjsdldkqfj
std::string
etk::String
std::thread::sleep
@ -54,7 +54,7 @@ namespace ewol {
};
};
#include <etk/types.hpp>
#include <vector>
#include <etk/Vector.hpp>
#include <etk/math/Vector2D.hpp>
#include <ewol/debug.hpp>
#include <ewol/context/clipBoard.hpp>
@ -103,7 +103,7 @@ namespace ewol {
ivec2 m_size; //!< Windows clipping upper widget (can not be <0 and >m_windowsSize)
void limit(const vec2& _origin, const vec2& _size);
};
std::ostream& operator <<(std::ostream& _os, const ewol::DrawProperty& _obj);
etk::Stream& operator <<(etk::Stream& _os, const ewol::DrawProperty& _obj);
/**
* @brief Gravity of the widget property
* @not_in_doc
@ -119,9 +119,9 @@ namespace ewol {
gravityButtomLeft=0x0C,
gravityLeft=0x08,
};
std::ostream& operator <<(std::ostream& _os, const enum ewol::gravity _obj);
std::string gravityToString(const enum ewol::gravity _obj);
enum ewol::gravity stringToGravity(const std::string& _obj);
etk::Stream& operator <<(etk::Stream& _os, const enum ewol::gravity _obj);
etk::String gravityToString(const enum ewol::gravity _obj);
enum ewol::gravity stringToGravity(const etk::String& _obj);
/**
* @not_in_doc
*/
@ -129,7 +129,7 @@ namespace ewol {
public:
bool broadcastEvent; //!< if it is true, then the message is sent to all the system
const char* generateEventId; //!< Local generated event
std::string eventData; //!< data link with the event
etk::String eventData; //!< data link with the event
ewol::key::Special specialKey; //!< special board key
char32_t unicodeValue; //!< 0 if not used
enum ewol::key::keyboard keyboardMoveValue; //!< ewol::EVENT_KB_MOVE_TYPE_NONE if not used