[DEV] change NULL ==> nullptr
This commit is contained in:
parent
55e05d24a3
commit
7d7d66d121
@ -27,7 +27,7 @@ appl::Buffer::Iterator& appl::Buffer::Iterator::operator++ () {
|
||||
m_current = 0;
|
||||
return *this;
|
||||
}
|
||||
if (m_data != NULL) {
|
||||
if (m_data != nullptr) {
|
||||
if (m_current < m_data->m_data.size() ) {
|
||||
int8_t nbChar = utf8::theoricLen(m_data->m_data[m_current]);
|
||||
if (nbChar != 0) {
|
||||
@ -45,7 +45,7 @@ appl::Buffer::Iterator& appl::Buffer::Iterator::operator++ () {
|
||||
|
||||
appl::Buffer::Iterator& appl::Buffer::Iterator::operator-- () {
|
||||
m_value = u32char::Null;
|
||||
if (m_data != NULL) {
|
||||
if (m_data != nullptr) {
|
||||
if (m_current > 0) {
|
||||
int32_t iii = -1;
|
||||
while( utf8::theoricFirst(m_data->m_data[m_current+iii]) == false
|
||||
@ -68,7 +68,7 @@ char32_t appl::Buffer::Iterator::operator* () {
|
||||
if (m_value != u32char::Null) {
|
||||
return m_value;
|
||||
}
|
||||
if (m_data == NULL) {
|
||||
if (m_data == nullptr) {
|
||||
APPL_ERROR("request an element that iterator not link");
|
||||
return m_value;
|
||||
}
|
||||
@ -127,7 +127,7 @@ appl::Buffer::Buffer() :
|
||||
m_cursorSelectPos(-1),
|
||||
m_cursorPreferredCol(-1),
|
||||
m_nbLines(1),
|
||||
m_highlight(NULL) {
|
||||
m_highlight(nullptr) {
|
||||
addObjectType("appl::Buffer");
|
||||
static int32_t bufferBaseId = 0;
|
||||
m_fileName = "No Name " + std::to_string(bufferBaseId);
|
||||
@ -704,7 +704,7 @@ void appl::Buffer::setHighlightType(const std::string& _type) {
|
||||
|
||||
void appl::Buffer::regenerateHighLightAt(int64_t _pos, int64_t _nbDeleted, int64_t _nbAdded) {
|
||||
// prevent ERROR...
|
||||
if (NULL == m_highlight) {
|
||||
if (nullptr == m_highlight) {
|
||||
return;
|
||||
}
|
||||
// prevent No data Call
|
||||
@ -857,7 +857,7 @@ void appl::Buffer::findMainHighLightPosition(int64_t _startPos,
|
||||
}
|
||||
|
||||
void appl::Buffer::generateHighLightAt(int64_t _pos, int64_t _endPos, int64_t _addingPos) {
|
||||
if (NULL == m_highlight) {
|
||||
if (nullptr == m_highlight) {
|
||||
return;
|
||||
}
|
||||
//APPL_DEBUG("area : ("<<pos<<","<<endPos<<") insert at : " << addingPos);
|
||||
@ -879,17 +879,17 @@ appl::HighlightInfo* appl::Buffer::getElementColorAtPosition(int64_t _pos, int64
|
||||
return &m_HLDataPass1[iii];
|
||||
}
|
||||
if(m_HLDataPass1[iii].beginStart > _pos) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
void appl::Buffer::hightlightGenerateLines(appl::DisplayHLData& _MData, const appl::Buffer::Iterator& _HLStart, int64_t _nbLines) {
|
||||
_MData.posHLPass1 = 0;
|
||||
_MData.posHLPass2 = 0;
|
||||
if (NULL == m_highlight) {
|
||||
if (nullptr == m_highlight) {
|
||||
return;
|
||||
}
|
||||
//int64_t timeStart = ewol::getTime();
|
||||
|
@ -40,7 +40,7 @@ namespace appl {
|
||||
*/
|
||||
Iterator():
|
||||
m_current(0),
|
||||
m_data(NULL),
|
||||
m_data(nullptr),
|
||||
m_value(u32char::Null) {
|
||||
// nothing to do ...
|
||||
};
|
||||
@ -70,7 +70,7 @@ namespace appl {
|
||||
*/
|
||||
virtual ~Iterator() {
|
||||
m_current = 0;
|
||||
m_data = NULL;
|
||||
m_data = nullptr;
|
||||
m_value = u32char::Null;
|
||||
};
|
||||
/**
|
||||
@ -78,7 +78,7 @@ namespace appl {
|
||||
* @return true if the element is present in buffer
|
||||
*/
|
||||
operator bool () const {
|
||||
if (m_data == NULL) {
|
||||
if (m_data == nullptr) {
|
||||
return false;
|
||||
}
|
||||
if (m_current >= m_data->m_data.size()) {
|
||||
@ -94,7 +94,7 @@ namespace appl {
|
||||
* @return true if the element is present in buffer
|
||||
*/
|
||||
operator int64_t () const {
|
||||
if (m_data == NULL) {
|
||||
if (m_data == nullptr) {
|
||||
return 0;
|
||||
}
|
||||
if (m_current < 0) {
|
||||
@ -217,7 +217,7 @@ namespace appl {
|
||||
* @return The requested position.
|
||||
*/
|
||||
int64_t getPos() const {
|
||||
if (m_data == NULL) {
|
||||
if (m_data == nullptr) {
|
||||
return 0;
|
||||
}
|
||||
if (m_current < 0) {
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
appl::BufferManager::BufferManager() :
|
||||
ewol::Resource("???BufferManager???"),
|
||||
m_bufferSelected(NULL) {
|
||||
m_bufferSelected(nullptr) {
|
||||
addObjectType("appl::BufferManager");
|
||||
}
|
||||
|
||||
@ -31,9 +31,9 @@ appl::BufferManager::~BufferManager() {
|
||||
|
||||
ewol::object::Shared<appl::Buffer> appl::BufferManager::createNewBuffer() {
|
||||
ewol::object::Shared<appl::Buffer> tmp = ewol::object::makeShared(new appl::Buffer());
|
||||
if (tmp == NULL) {
|
||||
if (tmp == nullptr) {
|
||||
APPL_ERROR("Can not allocate the Buffer (empty).");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
m_list.push_back(tmp);
|
||||
sendMultiCast(appl::MsgSelectNewFile, tmp->getFileName());
|
||||
@ -43,7 +43,7 @@ ewol::object::Shared<appl::Buffer> appl::BufferManager::createNewBuffer() {
|
||||
ewol::object::Shared<appl::Buffer> appl::BufferManager::get(const std::string& _fileName, bool _createIfNeeded) {
|
||||
APPL_INFO("get(" << _fileName << "," << _createIfNeeded << ")");
|
||||
for (auto &it : m_list) {
|
||||
if (it == NULL) {
|
||||
if (it == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (it->getFileName() == _fileName) {
|
||||
@ -54,18 +54,18 @@ ewol::object::Shared<appl::Buffer> appl::BufferManager::get(const std::string& _
|
||||
if (etk::FSNodeGetType(_fileName) == etk::FSN_FOLDER) {
|
||||
APPL_WARNING("try open a folder : " << _fileName);
|
||||
APPL_CRITICAL("plop");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
ewol::object::Shared<appl::Buffer> tmp = ewol::object::makeShared(new appl::Buffer());
|
||||
if (tmp == NULL) {
|
||||
if (tmp == nullptr) {
|
||||
APPL_ERROR("Can not allocate the Buffer class : " << _fileName);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
tmp->loadFile(_fileName);
|
||||
m_list.push_back(tmp);
|
||||
return tmp;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
void appl::BufferManager::setBufferSelected(ewol::object::Shared<appl::Buffer> _bufferSelected) {
|
||||
m_bufferSelected = _bufferSelected;
|
||||
@ -75,7 +75,7 @@ void appl::BufferManager::setBufferSelected(ewol::object::Shared<appl::Buffer> _
|
||||
void appl::BufferManager::onObjectRemove(const ewol::object::Shared<ewol::Object>& _object) {
|
||||
ewol::Resource::onObjectRemove(_object);
|
||||
if (m_bufferSelected == _object) {
|
||||
setBufferSelected(NULL);
|
||||
setBufferSelected(nullptr);
|
||||
}
|
||||
for (auto it(m_list.begin()); it!=m_list.end(); ++it) {
|
||||
if (*it != _object) {
|
||||
@ -113,7 +113,7 @@ void appl::BufferManager::open(const std::string& _fileName) {
|
||||
if (exist(_fileName) == true) {
|
||||
return;
|
||||
}
|
||||
if (get(_fileName, true) == NULL) {
|
||||
if (get(_fileName, true) == nullptr) {
|
||||
return;
|
||||
}
|
||||
sendMultiCast(appl::MsgSelectNewFile, _fileName);
|
||||
@ -125,15 +125,15 @@ void appl::BufferManager::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
|
||||
ewol::object::Shared<appl::BufferManager> appl::BufferManager::keep() {
|
||||
ewol::object::Shared<appl::BufferManager> object = ewol::dynamic_pointer_cast<appl::BufferManager>(getManager().localKeep("???BufferManager???"));
|
||||
if (NULL != object) {
|
||||
if (nullptr != object) {
|
||||
return object;
|
||||
}
|
||||
// this element create a new one every time ....
|
||||
EWOL_INFO("CREATE : appl::BufferManager: ???BufferManager???");
|
||||
object = ewol::object::makeShared(new appl::BufferManager());
|
||||
if (NULL == object) {
|
||||
if (nullptr == object) {
|
||||
EWOL_ERROR("allocation error of a resource : ???BufferManager???");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
getManager().localAdd(object);
|
||||
return object;
|
||||
|
@ -57,7 +57,7 @@ namespace appl {
|
||||
ewol::object::Shared<appl::Buffer> get(int32_t _id);
|
||||
/**
|
||||
* @brief Create a new buffer empty.
|
||||
* @return Created buffer or NULL.
|
||||
* @return Created buffer or nullptr.
|
||||
*/
|
||||
ewol::object::Shared<appl::Buffer> createNewBuffer();
|
||||
private:
|
||||
@ -83,7 +83,7 @@ namespace appl {
|
||||
* @brief keep the resource pointer.
|
||||
* @note Never free this pointer by your own...
|
||||
* @param[in] _filename Name of the configuration file.
|
||||
* @return pointer on the resource or NULL if an error occured.
|
||||
* @return pointer on the resource or nullptr if an error occured.
|
||||
*/
|
||||
static ewol::object::Shared<appl::BufferManager> keep();
|
||||
};
|
||||
|
@ -43,13 +43,13 @@ void appl::GlyphPainting::reload() {
|
||||
APPL_DEBUG(tmppppp);
|
||||
*/
|
||||
ejson::Array* baseArray = doc.getArray("ednColor");
|
||||
if (baseArray == NULL) {
|
||||
if (baseArray == nullptr) {
|
||||
APPL_ERROR("Can not get basic array : 'ednColor'");
|
||||
return;
|
||||
}
|
||||
for (size_t iii = 0; iii < baseArray->size(); ++iii) {
|
||||
ejson::Object* tmpObj = baseArray->getObject(iii);
|
||||
if (tmpObj == NULL) {
|
||||
if (tmpObj == nullptr) {
|
||||
APPL_DEBUG(" can not get object in 'ednColor' id=" << iii);
|
||||
continue;
|
||||
}
|
||||
@ -98,15 +98,15 @@ int32_t appl::GlyphPainting::request(const std::string& _name) {
|
||||
ewol::object::Shared<appl::GlyphPainting> appl::GlyphPainting::keep(const std::string& _filename) {
|
||||
//EWOL_INFO("KEEP : appl::GlyphPainting : file : \"" << _filename << "\"");
|
||||
ewol::object::Shared<appl::GlyphPainting> object = ewol::dynamic_pointer_cast<appl::GlyphPainting>(getManager().localKeep(_filename));
|
||||
if (NULL != object) {
|
||||
if (nullptr != object) {
|
||||
return object;
|
||||
}
|
||||
// this element create a new one every time ....
|
||||
EWOL_INFO("CREATE : appl::GlyphPainting : file : \"" << _filename << "\"");
|
||||
object = ewol::object::makeShared(new appl::GlyphPainting(_filename));
|
||||
if (NULL == object) {
|
||||
if (nullptr == object) {
|
||||
EWOL_ERROR("allocation error of a resource : ??GlyphPainting??");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
getManager().localAdd(object);
|
||||
return object;
|
||||
|
@ -54,7 +54,7 @@ namespace appl {
|
||||
* @brief keep the resource pointer.
|
||||
* @note Never free this pointer by your own...
|
||||
* @param[in] _filename Name of the configuration file.
|
||||
* @return pointer on the resource or NULL if an error occured.
|
||||
* @return pointer on the resource or nullptr if an error occured.
|
||||
*/
|
||||
static ewol::object::Shared<appl::GlyphPainting> keep(const std::string& _filename);
|
||||
};
|
||||
|
@ -21,13 +21,13 @@ static void SortElementList(std::vector<appl::dataBufferStruct*>& _list) {
|
||||
std::vector<appl::dataBufferStruct *> tmpList = _list;
|
||||
_list.clear();
|
||||
for(size_t iii=0; iii<tmpList.size(); iii++) {
|
||||
if (NULL == tmpList[iii]) {
|
||||
if (nullptr == tmpList[iii]) {
|
||||
continue;
|
||||
}
|
||||
size_t findPos = 0;
|
||||
for(size_t jjj=0; jjj<_list.size(); jjj++) {
|
||||
//EWOL_DEBUG("compare : \""<<*tmpList[iii] << "\" and \"" << *m_listDirectory[jjj] << "\"");
|
||||
if (_list[jjj] == NULL) {
|
||||
if (_list[jjj] == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (tmpList[iii]->m_bufferName.getNameFile() > _list[jjj]->m_bufferName.getNameFile()) {
|
||||
@ -70,30 +70,30 @@ BufferView::~BufferView() {
|
||||
void BufferView::removeAllElement() {
|
||||
for(auto &it : m_list) {
|
||||
delete(it);
|
||||
it = NULL;
|
||||
it = nullptr;
|
||||
}
|
||||
m_list.clear();
|
||||
}
|
||||
|
||||
void BufferView::insertAlphabetic(appl::dataBufferStruct* _dataStruct, bool _selectNewPosition) {
|
||||
if (_dataStruct == NULL) {
|
||||
if (_dataStruct == nullptr) {
|
||||
return;
|
||||
}
|
||||
// alphabetical order:
|
||||
for (size_t iii = 0; iii < m_list.size(); ++iii) {
|
||||
if (m_list[iii] == NULL) {
|
||||
if (m_list[iii] == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (std::tolower(m_list[iii]->m_bufferName.getNameFile()) > std::tolower(_dataStruct->m_bufferName.getNameFile())) {
|
||||
m_list.insert(m_list.begin() + iii, _dataStruct);
|
||||
_dataStruct = NULL;
|
||||
_dataStruct = nullptr;
|
||||
if (_selectNewPosition == true) {
|
||||
m_selectedID = iii;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (_dataStruct != NULL) {
|
||||
if (_dataStruct != nullptr) {
|
||||
m_list.push_back(_dataStruct);
|
||||
if (_selectNewPosition == true) {
|
||||
m_selectedID = m_list.size()-1;
|
||||
@ -106,7 +106,7 @@ void BufferView::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
ewol::widget::List::onReceiveMessage(_msg);
|
||||
if (_msg.getMessage() == appl::MsgSelectNewFile) {
|
||||
ewol::object::Shared<appl::Buffer> buffer = m_bufferManager->get(_msg.getData());
|
||||
if (buffer == NULL) {
|
||||
if (buffer == nullptr) {
|
||||
APPL_ERROR("event on element nor exist : " << _msg.getData());
|
||||
return;
|
||||
}
|
||||
@ -114,7 +114,7 @@ void BufferView::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
buffer->registerOnEvent(this, appl::Buffer::eventIsModify);
|
||||
buffer->registerOnEvent(this, appl::Buffer::eventChangeName);
|
||||
appl::dataBufferStruct* tmp = new appl::dataBufferStruct(_msg.getData(), buffer);
|
||||
if (tmp == NULL) {
|
||||
if (tmp == nullptr) {
|
||||
APPL_ERROR("Allocation error of the tmp buffer list element");
|
||||
return;
|
||||
}
|
||||
@ -128,7 +128,7 @@ void BufferView::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
}
|
||||
if (_msg.getMessage() == appl::Buffer::eventChangeName) {
|
||||
for (size_t iii = 0; iii < m_list.size(); ++iii) {
|
||||
if (m_list[iii] == NULL) {
|
||||
if (m_list[iii] == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (m_list[iii]->m_bufferName != m_list[iii]->m_buffer->getFileName()) {
|
||||
@ -136,7 +136,7 @@ void BufferView::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
if (m_openOrderMode == false) {
|
||||
// re-order the fine in the correct position
|
||||
appl::dataBufferStruct* tmp = m_list[iii];
|
||||
m_list[iii] = NULL;
|
||||
m_list[iii] = nullptr;
|
||||
m_list.erase(m_list.begin() + iii);
|
||||
insertAlphabetic(tmp, ((int64_t)iii == m_selectedID));
|
||||
break;
|
||||
@ -158,12 +158,12 @@ void BufferView::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
if (_msg.getMessage() == appl::MsgSelectChange) {
|
||||
m_selectedID = -1;
|
||||
ewol::object::Shared<appl::Buffer> tmpBuffer;
|
||||
if (m_bufferManager != NULL) {
|
||||
if (m_bufferManager != nullptr) {
|
||||
tmpBuffer = m_bufferManager->getBufferSelected();
|
||||
}
|
||||
if (tmpBuffer != NULL) {
|
||||
if (tmpBuffer != nullptr) {
|
||||
for (size_t iii=0; iii<m_list.size(); iii++) {
|
||||
if (m_list[iii] == NULL) {
|
||||
if (m_list[iii] == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (m_list[iii]->m_buffer != tmpBuffer) {
|
||||
@ -185,11 +185,11 @@ void BufferView::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
/*
|
||||
if (BufferManager::exist(iii)) {
|
||||
BufferText* tmpBuffer = BufferManager::get(iii);
|
||||
if (NULL != tmpBuffer) {
|
||||
if (nullptr != tmpBuffer) {
|
||||
bool isModify = tmpBuffer->isModify();
|
||||
etk::FSNode name = tmpBuffer->getFileName();
|
||||
appl::dataBufferStruct* tmpElement = new appl::dataBufferStruct(name, iii, isModify);
|
||||
if (NULL != tmpElement) {
|
||||
if (nullptr != tmpElement) {
|
||||
m_list.push_back(tmpElement);
|
||||
} else {
|
||||
APPL_ERROR("Allocation error of the tmp buffer list element");
|
||||
@ -258,7 +258,7 @@ bool BufferView::getElement(int32_t _colomn, int32_t _raw, std::string& _myTextT
|
||||
&& m_list[_raw] != nullptr) {
|
||||
_myTextToWrite = m_list[_raw]->m_bufferName.getNameFile();
|
||||
|
||||
if ( m_list[_raw]->m_buffer != NULL
|
||||
if ( m_list[_raw]->m_buffer != nullptr
|
||||
&& m_list[_raw]->m_buffer->isModify() == false) {
|
||||
_fg = (*m_paintingProperties)[m_colorTextNormal].getForeground();
|
||||
} else {
|
||||
@ -285,8 +285,8 @@ bool BufferView::onItemEvent(int32_t _IdInput, enum ewol::key::status _typeEvent
|
||||
APPL_INFO("Event on List : IdInput=" << _IdInput << " colomn=" << _colomn << " raw=" << _raw );
|
||||
if( _raw >= 0
|
||||
&& _raw<(int64_t)m_list.size()
|
||||
&& NULL != m_list[_raw]) {
|
||||
if (m_list[_raw]->m_buffer != NULL) {
|
||||
&& nullptr != m_list[_raw]) {
|
||||
if (m_list[_raw]->m_buffer != nullptr) {
|
||||
sendMultiCast(appl::MsgSelectNewFile, m_list[_raw]->m_buffer->getFileName());
|
||||
m_selectedID = _raw;
|
||||
markToRedraw();
|
||||
|
@ -61,10 +61,10 @@ class ParameterAboutGui : public ewol::widget::Sizer {
|
||||
public :
|
||||
ParameterAboutGui() :
|
||||
ewol::widget::Sizer(ewol::widget::Sizer::modeVert) {
|
||||
ewol::object::Shared<ewol::widget::Spacer> mySpacer = NULL;
|
||||
ewol::object::Shared<ewol::widget::Spacer> mySpacer = nullptr;
|
||||
|
||||
mySpacer = ewol::object::makeShared(new ewol::widget::Spacer());
|
||||
if (NULL == mySpacer) {
|
||||
if (nullptr == mySpacer) {
|
||||
APPL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
mySpacer->setExpand(bvec2(true,true));
|
||||
@ -94,7 +94,7 @@ class ParameterAboutGui : public ewol::widget::Sizer {
|
||||
tmpLabel += " tinyXml, freetype, agg2.4, etk<br/>";
|
||||
tmpLabel += "</left>";
|
||||
ewol::object::Shared<ewol::widget::Label> myLabel = ewol::object::makeShared(new ewol::widget::Label(tmpLabel));
|
||||
if (NULL == myLabel) {
|
||||
if (nullptr == myLabel) {
|
||||
APPL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
myLabel->setExpand(bvec2(true,false));
|
||||
@ -122,12 +122,12 @@ const char* l_smoothMax = "tmpEvent_maxChange";
|
||||
MainWindows::MainWindows() {
|
||||
addObjectType("appl::MainWindows");
|
||||
APPL_DEBUG("CREATE WINDOWS ... ");
|
||||
ewol::object::Shared<ewol::widget::Sizer> mySizerVert = NULL;
|
||||
ewol::object::Shared<ewol::widget::Sizer> mySizerVert2 = NULL;
|
||||
ewol::object::Shared<ewol::widget::Sizer> mySizerHori = NULL;
|
||||
ewol::object::Shared<appl::TextViewer> myTextView = NULL;
|
||||
ewol::object::Shared<BufferView> myBufferView = NULL;
|
||||
ewol::object::Shared<ewol::widget::Menu> myMenu = NULL;
|
||||
ewol::object::Shared<ewol::widget::Sizer> mySizerVert = nullptr;
|
||||
ewol::object::Shared<ewol::widget::Sizer> mySizerVert2 = nullptr;
|
||||
ewol::object::Shared<ewol::widget::Sizer> mySizerHori = nullptr;
|
||||
ewol::object::Shared<appl::TextViewer> myTextView = nullptr;
|
||||
ewol::object::Shared<BufferView> myBufferView = nullptr;
|
||||
ewol::object::Shared<ewol::widget::Menu> myMenu = nullptr;
|
||||
|
||||
// load buffer manager:
|
||||
m_bufferManager = appl::BufferManager::keep();
|
||||
@ -283,19 +283,19 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
// open file Section ...
|
||||
if (_msg.getMessage() == ednMsgGuiOpen) {
|
||||
ewol::widget::FileChooser* tmpWidget = new ewol::widget::FileChooser();
|
||||
if (tmpWidget == NULL) {
|
||||
if (tmpWidget == nullptr) {
|
||||
APPL_ERROR("Can not open File chooser !!! ");
|
||||
return;
|
||||
}
|
||||
tmpWidget->setTitle("Open files ...");
|
||||
tmpWidget->setValidateLabel("Open");
|
||||
if (m_bufferManager == NULL) {
|
||||
if (m_bufferManager == nullptr) {
|
||||
APPL_ERROR("can not call unexistant buffer manager ... ");
|
||||
return;
|
||||
}
|
||||
// Get a ref on the buffer selected (if null, no buffer was selected ...)
|
||||
ewol::object::Shared<appl::Buffer> tmpBuffer = m_bufferManager->getBufferSelected();
|
||||
if (tmpBuffer != NULL) {
|
||||
if (tmpBuffer != nullptr) {
|
||||
etk::FSNode tmpFile = tmpBuffer->getFileName();
|
||||
tmpWidget->setFolder(tmpFile.getNameFolder());
|
||||
}
|
||||
@ -305,7 +305,7 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
} else if (_msg.getMessage() == ednMsgProperties) {
|
||||
// Request the parameter GUI
|
||||
ewol::object::Shared<ewol::widget::Parameter> tmpWidget = ewol::object::makeShared(new ewol::widget::Parameter());
|
||||
if (NULL == tmpWidget) {
|
||||
if (nullptr == tmpWidget) {
|
||||
APPL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
#ifdef SDGSDFGSDFGSDFGSDFGSTERGDHFGHFDS
|
||||
@ -344,10 +344,10 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
tmpWidget->menuAddGroup("Editor");
|
||||
ewol::object::Shared<ewol::Widget> tmpSubWidget = ewol::object::makeShared(new globals::ParameterGlobalsGui());
|
||||
tmpWidget->menuAdd("Editor", "", tmpSubWidget);
|
||||
tmpWidget->menuAdd("Font & Color", "", NULL);
|
||||
tmpWidget->menuAdd("Highlight", "", NULL);
|
||||
tmpWidget->menuAdd("Font & Color", "", nullptr);
|
||||
tmpWidget->menuAdd("Highlight", "", nullptr);
|
||||
tmpWidget->menuAddGroup("General");
|
||||
tmpWidget->menuAdd("Display", "", NULL);
|
||||
tmpWidget->menuAdd("Display", "", nullptr);
|
||||
tmpSubWidget = ewol::object::makeShared(new ParameterAboutGui());
|
||||
tmpWidget->menuAdd("About", "", tmpSubWidget);
|
||||
}
|
||||
@ -366,7 +366,7 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
// TODO : ...
|
||||
}
|
||||
// Note : Fore all next message we need to acces to the buffer manager ==> just check one time ...
|
||||
if (m_bufferManager == NULL) {
|
||||
if (m_bufferManager == nullptr) {
|
||||
APPL_ERROR("can not call unexistant buffer manager ... ");
|
||||
return;
|
||||
}
|
||||
@ -376,9 +376,9 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
|| _msg.getMessage() == appl::Buffer::eventChangeName) {
|
||||
// select a new Buffer ==> change title:
|
||||
ewol::object::Shared<appl::Buffer> tmpp = m_bufferManager->getBufferSelected();
|
||||
if (tmpp == NULL) {
|
||||
if (tmpp == nullptr) {
|
||||
setTitle("Edn");
|
||||
if (m_widgetLabelFileName != NULL) {
|
||||
if (m_widgetLabelFileName != nullptr) {
|
||||
m_widgetLabelFileName->setLabel("");
|
||||
}
|
||||
} else {
|
||||
@ -389,7 +389,7 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
}
|
||||
std::string nameFileSystem = etk::FSNode(tmpp->getFileName()).getFileSystemName();
|
||||
setTitle(std::string("Edn : ") + (tmpp->isModify()==true?" *":"") + nameFileSystem);
|
||||
if (m_widgetLabelFileName != NULL) {
|
||||
if (m_widgetLabelFileName != nullptr) {
|
||||
m_widgetLabelFileName->setLabel(nameFileSystem + (tmpp->isModify()==true?" *":""));
|
||||
}
|
||||
}
|
||||
@ -426,7 +426,7 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
return;
|
||||
}
|
||||
ewol::object::Shared<appl::Buffer> tmpBuffer = m_bufferManager->get(_msg.getData());
|
||||
if (tmpBuffer == NULL) {
|
||||
if (tmpBuffer == nullptr) {
|
||||
APPL_ERROR("Error to get the buffer : " << _msg.getData());
|
||||
return;
|
||||
}
|
||||
@ -445,7 +445,7 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
return;
|
||||
}
|
||||
ewol::object::Shared<appl::Buffer> tmpBuffer = m_bufferManager->get(_msg.getData());
|
||||
if (tmpBuffer == NULL) {
|
||||
if (tmpBuffer == nullptr) {
|
||||
APPL_ERROR("Error to get the buffer : " << _msg.getData());
|
||||
return;
|
||||
}
|
||||
@ -456,7 +456,7 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
return;
|
||||
}
|
||||
ewol::object::Shared<appl::Buffer> tmpBuffer = m_bufferManager->get(_msg.getData());
|
||||
if (tmpBuffer == NULL) {
|
||||
if (tmpBuffer == nullptr) {
|
||||
APPL_ERROR("Error to get the buffer : " << _msg.getData());
|
||||
return;
|
||||
}
|
||||
@ -467,42 +467,42 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
}
|
||||
|
||||
void MainWindows::saveAsPopUp(const ewol::object::Shared<appl::Buffer>& _buffer) {
|
||||
if (_buffer == NULL) {
|
||||
APPL_ERROR("Call With NULL input...");
|
||||
if (_buffer == nullptr) {
|
||||
APPL_ERROR("Call With nullptr input...");
|
||||
return;
|
||||
}
|
||||
appl::WorkerSaveFile* tmpObject = new appl::WorkerSaveFile(_buffer->getFileName());
|
||||
}
|
||||
|
||||
void MainWindows::closeNotSavedFile(const ewol::object::Shared<appl::Buffer>& _buffer) {
|
||||
if (_buffer == NULL) {
|
||||
APPL_ERROR("Call With NULL input...");
|
||||
if (_buffer == nullptr) {
|
||||
APPL_ERROR("Call With nullptr input...");
|
||||
return;
|
||||
}
|
||||
ewol::object::Shared<ewol::widget::StdPopUp> tmpPopUp = ewol::object::makeShared(new ewol::widget::StdPopUp());
|
||||
if (tmpPopUp == NULL) {
|
||||
if (tmpPopUp == nullptr) {
|
||||
APPL_ERROR("Can not create a simple pop-up");
|
||||
return;
|
||||
}
|
||||
tmpPopUp->setTitle("<bold>Close un-saved file:</bold>");
|
||||
tmpPopUp->setComment("The file named : <i>\"" + _buffer->getFileName() + "\"</i> is curently modify. <br/>If you don't saves these modifications,<br/>they will be definitly lost...");
|
||||
ewol::object::Shared<ewol::Widget> bt = NULL;
|
||||
ewol::object::Shared<ewol::Widget> bt = nullptr;
|
||||
if (_buffer->hasFileName() == true) {
|
||||
bt = tmpPopUp->addButton("Save", true);
|
||||
if (bt != NULL) {
|
||||
if (bt != nullptr) {
|
||||
// TODO : The element is removed before beeing pressed
|
||||
bt->registerOnEvent(this, "pressed", mainWindowsRequestSaveFile, _buffer->getFileName());
|
||||
bt->registerOnEvent(this, "pressed", mainWindowsRequestcloseFileNoCheck, _buffer->getFileName());
|
||||
}
|
||||
}
|
||||
bt = tmpPopUp->addButton("Save As", true);
|
||||
if (bt != NULL) {
|
||||
if (bt != nullptr) {
|
||||
bt->registerOnEvent(this, "pressed", mainWindowsRequestSaveFileAs, _buffer->getFileName());
|
||||
//bt->registerOnEvent(this, "pressed", mainWindowsRequestcloseFileNoCheck, _buffer->getFileName());
|
||||
// TODO : Request the close when saved ...
|
||||
}
|
||||
bt = tmpPopUp->addButton("Close", true);
|
||||
if (bt != NULL) {
|
||||
if (bt != nullptr) {
|
||||
bt->registerOnEvent(this, "pressed", mainWindowsRequestcloseFileNoCheck, _buffer->getFileName());
|
||||
}
|
||||
tmpPopUp->addButton("Cancel", true);
|
||||
@ -513,6 +513,6 @@ void MainWindows::closeNotSavedFile(const ewol::object::Shared<appl::Buffer>& _b
|
||||
void MainWindows::onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject) {
|
||||
ewol::widget::Windows::onObjectRemove(_removeObject);
|
||||
if (m_widgetLabelFileName == _removeObject) {
|
||||
m_widgetLabelFileName = NULL;
|
||||
m_widgetLabelFileName = nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -30,12 +30,12 @@ const char* const l_eventHideBt = "appl-hide-button";
|
||||
|
||||
appl::widget::Search::Search() :
|
||||
ewol::widget::Composer(ewol::widget::Composer::file, "DATA:GUI-Search.xml"),
|
||||
m_viewerManager(NULL),
|
||||
m_viewerManager(nullptr),
|
||||
m_forward(true),
|
||||
m_caseSensitive(false),
|
||||
m_wrap(true),
|
||||
m_searchEntry(NULL),
|
||||
m_replaceEntry(NULL) {
|
||||
m_searchEntry(nullptr),
|
||||
m_replaceEntry(nullptr) {
|
||||
addObjectType("appl::widget::Search");
|
||||
// load buffer manager:onObjectRemove
|
||||
m_viewerManager = appl::ViewerManager::keep();
|
||||
@ -68,12 +68,12 @@ appl::widget::Search::~Search() {
|
||||
}
|
||||
|
||||
void appl::widget::Search::find() {
|
||||
if (m_viewerManager == NULL) {
|
||||
if (m_viewerManager == nullptr) {
|
||||
APPL_WARNING("No viewer manager selected!!!");
|
||||
return;
|
||||
}
|
||||
ewol::object::Shared<appl::TextViewer> viewer = m_viewerManager->getViewerSelected();
|
||||
if (viewer == NULL) {
|
||||
if (viewer == nullptr) {
|
||||
APPL_INFO("No viewer selected!!!");
|
||||
return;
|
||||
}
|
||||
@ -104,12 +104,12 @@ void appl::widget::Search::find() {
|
||||
}
|
||||
|
||||
void appl::widget::Search::replace() {
|
||||
if (m_viewerManager == NULL) {
|
||||
if (m_viewerManager == nullptr) {
|
||||
APPL_WARNING("No viewer manager selected!!!");
|
||||
return;
|
||||
}
|
||||
ewol::object::Shared<appl::TextViewer> viewer = m_viewerManager->getViewerSelected();
|
||||
if (viewer == NULL) {
|
||||
if (viewer == nullptr) {
|
||||
APPL_INFO("No viewer selected!!!");
|
||||
return;
|
||||
}
|
||||
@ -146,14 +146,14 @@ void appl::widget::Search::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
} else if ( _msg.getMessage() == ednMsgGuiSearch) {
|
||||
if (true == isHide()) {
|
||||
show();
|
||||
if (m_searchEntry!= NULL) {
|
||||
if (m_searchEntry!= nullptr) {
|
||||
m_searchEntry->keepFocus();
|
||||
}
|
||||
} else {
|
||||
if( (m_searchEntry!=NULL && true == m_searchEntry->getFocus())
|
||||
|| (m_replaceEntry!=NULL && true == m_replaceEntry->getFocus()) ) {
|
||||
if( (m_searchEntry!=nullptr && true == m_searchEntry->getFocus())
|
||||
|| (m_replaceEntry!=nullptr && true == m_replaceEntry->getFocus()) ) {
|
||||
hide();
|
||||
} else if (m_searchEntry!= NULL) {
|
||||
} else if (m_searchEntry!= nullptr) {
|
||||
m_searchEntry->keepFocus();
|
||||
} else {
|
||||
hide();
|
||||
|
@ -24,7 +24,7 @@ appl::TagFileList::TagFileList() {
|
||||
setMouseLimit(1);
|
||||
// Load color properties: (use file list to be generic ...)
|
||||
m_colorProperty = ewol::resource::ColorFile::keep("THEME:COLOR:ListFileSystem.json");
|
||||
if (m_colorProperty != NULL) {
|
||||
if (m_colorProperty != nullptr) {
|
||||
m_colorIdText = m_colorProperty->request("text");
|
||||
m_colorIdBackground1 = m_colorProperty->request("background1");
|
||||
m_colorIdBackground2 = m_colorProperty->request("background2");
|
||||
@ -36,7 +36,7 @@ appl::TagFileList::TagFileList() {
|
||||
appl::TagFileList::~TagFileList() {
|
||||
for (auto &it : m_list) {
|
||||
delete(it);
|
||||
it = NULL;
|
||||
it = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ uint32_t appl::TagFileList::getNuberOfRaw() {
|
||||
}
|
||||
|
||||
bool appl::TagFileList::getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) {
|
||||
if (_raw >= 0 && (size_t)_raw < m_list.size() && NULL != m_list[_raw]) {
|
||||
if (_raw >= 0 && (size_t)_raw < m_list.size() && nullptr != m_list[_raw]) {
|
||||
if (0 == _colomn) {
|
||||
_myTextToWrite = std::to_string(m_list[_raw]->fileLine);
|
||||
} else {
|
||||
@ -96,7 +96,7 @@ bool appl::TagFileList::onItemEvent(int32_t _IdInput, enum ewol::key::status _ty
|
||||
}
|
||||
if( m_selectedLine >= 0
|
||||
&& m_selectedLine < (int64_t)m_list.size()
|
||||
&& NULL != m_list[m_selectedLine] ) {
|
||||
&& nullptr != m_list[m_selectedLine] ) {
|
||||
generateEventId(event, std::to_string(m_list[_raw]->fileLine)+":"+m_list[m_selectedLine]->filename);
|
||||
} else {
|
||||
generateEventId(applEventCtagsListUnSelect);
|
||||
@ -117,7 +117,7 @@ bool appl::TagFileList::onItemEvent(int32_t _IdInput, enum ewol::key::status _ty
|
||||
*/
|
||||
void appl::TagFileList::add(std::string& _file, int32_t _line) {
|
||||
appl::TagListElement *tmpFile = new appl::TagListElement(_file, _line);
|
||||
if (NULL != tmpFile) {
|
||||
if (nullptr != tmpFile) {
|
||||
m_list.push_back(tmpFile);
|
||||
}
|
||||
markToRedraw();
|
||||
|
@ -47,7 +47,7 @@ appl::TagFileSelection::TagFileSelection() {
|
||||
#endif
|
||||
|
||||
mySizerVert = ewol::object::makeShared(new ewol::widget::Sizer(ewol::widget::Sizer::modeVert));
|
||||
if (NULL == mySizerVert) {
|
||||
if (nullptr == mySizerVert) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
mySizerVert->lockExpand(bvec2(true,true));
|
||||
@ -77,7 +77,7 @@ appl::TagFileSelection::TagFileSelection() {
|
||||
compose->registerOnEventNameWidget(this, "PLUGIN-CTAGS-cancel", "pressed", applEventctagsCancel);
|
||||
|
||||
m_listTag = ewol::object::makeShared(new appl::TagFileList());
|
||||
if (NULL == m_listTag) {
|
||||
if (nullptr == m_listTag) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
m_listTag->registerOnEvent(this, applEventCtagsListValidate);
|
||||
@ -89,7 +89,7 @@ appl::TagFileSelection::TagFileSelection() {
|
||||
}
|
||||
|
||||
myWidgetTitle = new ewol::widget::Label("Ctags Jump Selection ...");
|
||||
if (NULL == myWidgetTitle) {
|
||||
if (nullptr == myWidgetTitle) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
mySizerVert->subWidgetAdd(myWidgetTitle);
|
||||
@ -134,7 +134,7 @@ void appl::TagFileSelection::onReceiveMessage(const ewol::object::Message& _msg)
|
||||
* @param[in] jump line id
|
||||
*/
|
||||
void appl::TagFileSelection::addCtagsNewItem(std::string _file, int32_t _line) {
|
||||
if (NULL != m_listTag) {
|
||||
if (nullptr != m_listTag) {
|
||||
m_listTag->add(_file, _line);
|
||||
}
|
||||
}
|
||||
@ -144,7 +144,7 @@ void appl::TagFileSelection::onObjectRemove(const ewol::object::Shared<ewol::Obj
|
||||
ewol::widget::PopUp::onObjectRemove(_removeObject);
|
||||
// second step find if in all the elements ...
|
||||
if(_removeObject == m_listTag) {
|
||||
m_listTag = NULL;
|
||||
m_listTag = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ appl::TextViewer::~TextViewer() {
|
||||
}
|
||||
|
||||
std::string appl::TextViewer::getBufferPath() {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return "";
|
||||
}
|
||||
std::string filename = m_buffer->getFileName();
|
||||
@ -109,7 +109,7 @@ void appl::TextViewer::onRegenerateDisplay() {
|
||||
m_displayDrawing.setColor((*m_paintingProperties)[m_colorBackground].getForeground());
|
||||
m_displayDrawing.rectangleWidth(m_size);
|
||||
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
m_maxSize.setX(256);
|
||||
m_maxSize.setY(256);
|
||||
m_displayText.setTextAlignement(10, m_size.x()-20, ewol::compositing::alignLeft);
|
||||
@ -204,7 +204,7 @@ void appl::TextViewer::onRegenerateDisplay() {
|
||||
appl::DisplayHLData displayLocalSyntax;
|
||||
m_buffer->hightlightGenerateLines(displayLocalSyntax, startingIt, (m_size.y()/tmpLetterSize.y()) + 5);
|
||||
float maxSizeX = 0;
|
||||
appl::HighlightInfo * HLColor = NULL;
|
||||
appl::HighlightInfo * HLColor = nullptr;
|
||||
bool DisplayCursorAndSelection = isSelectedLast();
|
||||
appl::Buffer::Iterator it;
|
||||
for (it = startingIt;
|
||||
@ -242,8 +242,8 @@ void appl::TextViewer::onRegenerateDisplay() {
|
||||
}
|
||||
HLColor = m_buffer->getElementColorAtPosition(displayLocalSyntax, (int64_t)it);
|
||||
bool haveBackground = false;
|
||||
if ( HLColor != NULL
|
||||
&& HLColor->patern != NULL) {
|
||||
if ( HLColor != nullptr
|
||||
&& HLColor->patern != nullptr) {
|
||||
m_displayText.setColor(HLColor->patern->getColorGlyph().getForeground());
|
||||
m_displayText.setColorBg(HLColor->patern->getColorGlyph().getBackground());
|
||||
haveBackground = HLColor->patern->getColorGlyph().haveBackground();
|
||||
@ -313,7 +313,7 @@ void appl::TextViewer::onRegenerateDisplay() {
|
||||
}
|
||||
|
||||
bool appl::TextViewer::onEventEntry(const ewol::event::Entry& _event) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return false;
|
||||
}
|
||||
// First call plugin
|
||||
@ -429,7 +429,7 @@ bool appl::TextViewer::onEventInput(const ewol::event::Input& _event) {
|
||||
keepFocus();
|
||||
}
|
||||
//tic();
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return false;
|
||||
}
|
||||
// First call the scrolling widget :
|
||||
@ -613,7 +613,7 @@ appl::Buffer::Iterator appl::TextViewer::getMousePosition(const vec2& _relativeP
|
||||
}
|
||||
|
||||
void appl::TextViewer::onEventClipboard(enum ewol::context::clipBoard::clipboardListe _clipboardID) {
|
||||
if (m_buffer != NULL) {
|
||||
if (m_buffer != nullptr) {
|
||||
std::string data = ewol::context::clipBoard::get(_clipboardID);
|
||||
write(data);
|
||||
}
|
||||
@ -642,7 +642,7 @@ void appl::TextViewer::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
return;
|
||||
}
|
||||
if (_msg.getMessage() == appl::MsgSelectGotoLineSelect) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return;
|
||||
}
|
||||
appl::Buffer::Iterator it = m_buffer->countForwardNLines(m_buffer->begin(), std::stoi(_msg.getData()));
|
||||
@ -651,7 +651,7 @@ void appl::TextViewer::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
return;
|
||||
}
|
||||
if (_msg.getMessage() == appl::MsgSelectGotoLine) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return;
|
||||
}
|
||||
appl::Buffer::Iterator it = m_buffer->countForwardNLines(m_buffer->begin(), std::stoi(_msg.getData()));
|
||||
@ -661,7 +661,7 @@ void appl::TextViewer::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
}
|
||||
if (_msg.getMessage() == appl::MsgSelectNewFile) {
|
||||
// reset scroll:
|
||||
if (m_buffer != NULL) {
|
||||
if (m_buffer != nullptr) {
|
||||
m_buffer->unRegisterOnEvent(this);
|
||||
bool needAdd = true;
|
||||
for (size_t iii=0; iii<m_drawingRemenber.size(); ++iii) {
|
||||
@ -678,10 +678,10 @@ void appl::TextViewer::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
}
|
||||
}
|
||||
m_originScrooled = vec2(0,0);
|
||||
if (m_bufferManager != NULL) {
|
||||
if (m_bufferManager != nullptr) {
|
||||
m_buffer = m_bufferManager->get(_msg.getData());
|
||||
m_bufferManager->setBufferSelected(m_buffer);
|
||||
if (m_buffer != NULL) {
|
||||
if (m_buffer != nullptr) {
|
||||
m_buffer->registerOnEvent(this, appl::Buffer::eventIsModify);
|
||||
m_buffer->registerOnEvent(this, appl::Buffer::eventSelectChange);
|
||||
for (auto element : m_drawingRemenber) {
|
||||
@ -702,7 +702,7 @@ void appl::TextViewer::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
void appl::TextViewer::onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject) {
|
||||
ewol::widget::WidgetScrolled::onObjectRemove(_removeObject);
|
||||
if (m_buffer == _removeObject) {
|
||||
m_buffer = NULL;
|
||||
m_buffer = nullptr;
|
||||
markToRedraw();
|
||||
}
|
||||
}
|
||||
@ -731,7 +731,7 @@ void appl::TextViewer::setFontName(const std::string& _fontName) {
|
||||
|
||||
// TODO : Update process time ==> a little expensive (2->4ms) in end of file
|
||||
void appl::TextViewer::updateScrolling() {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return;
|
||||
}
|
||||
vec2 realCursorPosition(0,0);
|
||||
@ -760,7 +760,7 @@ void appl::TextViewer::updateScrolling() {
|
||||
}
|
||||
|
||||
bool appl::TextViewer::moveCursor(const appl::Buffer::Iterator& _pos) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return false;
|
||||
}
|
||||
markToRedraw();
|
||||
@ -774,7 +774,7 @@ bool appl::TextViewer::moveCursor(const appl::Buffer::Iterator& _pos) {
|
||||
}
|
||||
|
||||
bool appl::TextViewer::write(const std::string& _data) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return false;
|
||||
}
|
||||
if (m_buffer->hasTextSelected() == true) {
|
||||
@ -784,7 +784,7 @@ bool appl::TextViewer::write(const std::string& _data) {
|
||||
}
|
||||
|
||||
bool appl::TextViewer::write(const std::string& _data, const appl::Buffer::Iterator& _pos) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return false;
|
||||
}
|
||||
markToRedraw();
|
||||
@ -800,7 +800,7 @@ bool appl::TextViewer::write(const std::string& _data, const appl::Buffer::Itera
|
||||
}
|
||||
|
||||
bool appl::TextViewer::replace(const std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return false;
|
||||
}
|
||||
markToRedraw();
|
||||
@ -816,7 +816,7 @@ bool appl::TextViewer::replace(const std::string& _data, const appl::Buffer::Ite
|
||||
}
|
||||
|
||||
bool appl::TextViewer::replace(const std::string& _data) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return false;
|
||||
}
|
||||
if (m_buffer->hasTextSelected() == false) {
|
||||
@ -826,7 +826,7 @@ bool appl::TextViewer::replace(const std::string& _data) {
|
||||
}
|
||||
|
||||
void appl::TextViewer::remove() {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return;
|
||||
}
|
||||
if (m_buffer->hasTextSelected() == false) {
|
||||
@ -844,7 +844,7 @@ void appl::TextViewer::remove() {
|
||||
|
||||
|
||||
void appl::TextViewer::moveCursorRight(appl::TextViewer::moveMode _mode) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return;
|
||||
}
|
||||
markToRedraw();
|
||||
@ -867,7 +867,7 @@ void appl::TextViewer::moveCursorRight(appl::TextViewer::moveMode _mode) {
|
||||
}
|
||||
|
||||
void appl::TextViewer::moveCursorLeft(appl::TextViewer::moveMode _mode) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return;
|
||||
}
|
||||
markToRedraw();
|
||||
@ -890,7 +890,7 @@ void appl::TextViewer::moveCursorLeft(appl::TextViewer::moveMode _mode) {
|
||||
}
|
||||
|
||||
void appl::TextViewer::moveCursorUp(uint32_t _nbLine) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return;
|
||||
}
|
||||
markToRedraw();
|
||||
@ -916,7 +916,7 @@ void appl::TextViewer::moveCursorUp(uint32_t _nbLine) {
|
||||
}
|
||||
|
||||
void appl::TextViewer::moveCursorDown(uint32_t _nbLine) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return;
|
||||
}
|
||||
markToRedraw();
|
||||
@ -996,13 +996,13 @@ float appl::TextViewer::getScreenSize(const appl::Buffer::Iterator& _startLinePo
|
||||
}
|
||||
|
||||
void appl::TextViewer::setCurrentSelect() {
|
||||
if (m_viewerManager != NULL) {
|
||||
if (m_viewerManager != nullptr) {
|
||||
m_viewerManager->setViewerSelected(this, m_buffer);
|
||||
}
|
||||
}
|
||||
|
||||
bool appl::TextViewer::isSelectedLast() {
|
||||
if (m_viewerManager != NULL) {
|
||||
if (m_viewerManager != nullptr) {
|
||||
return m_viewerManager->isLastSelected(this);
|
||||
}
|
||||
return false;
|
||||
|
@ -95,7 +95,7 @@ namespace appl {
|
||||
* @brief Remove selected data ... (No plugin call)
|
||||
*/
|
||||
void removeDirect() {
|
||||
if (m_buffer==NULL) {
|
||||
if (m_buffer==nullptr) {
|
||||
return;
|
||||
}
|
||||
m_buffer->removeSelection();
|
||||
@ -108,7 +108,7 @@ namespace appl {
|
||||
* @return true of no error occured.
|
||||
*/
|
||||
bool copy(std::string& _data) {
|
||||
if (m_buffer==NULL) {
|
||||
if (m_buffer==nullptr) {
|
||||
return false;
|
||||
}
|
||||
return m_buffer->copy(_data);
|
||||
@ -120,7 +120,7 @@ namespace appl {
|
||||
* @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) {
|
||||
if (m_buffer==NULL) {
|
||||
if (m_buffer==nullptr) {
|
||||
return;
|
||||
}
|
||||
m_buffer->copy(_data, _pos, _posEnd);
|
||||
@ -132,7 +132,7 @@ namespace appl {
|
||||
* @return true if the write is done corectly
|
||||
*/
|
||||
bool writeDirect(const std::string& _data, const appl::Buffer::Iterator& _pos) {
|
||||
if (m_buffer==NULL) {
|
||||
if (m_buffer==nullptr) {
|
||||
return false;
|
||||
}
|
||||
bool ret = m_buffer->write(_data, _pos);
|
||||
@ -147,7 +147,7 @@ namespace appl {
|
||||
* @return true if the write is done corectly
|
||||
*/
|
||||
bool replaceDirect(const std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
|
||||
if (m_buffer==NULL) {
|
||||
if (m_buffer==nullptr) {
|
||||
return false;
|
||||
}
|
||||
bool ret = m_buffer->replace(_data, _pos, _posEnd);
|
||||
@ -208,14 +208,14 @@ namespace appl {
|
||||
* @return true if a display buffer is present, false otherwise.
|
||||
*/
|
||||
virtual bool hasBuffer() {
|
||||
return m_buffer != NULL;
|
||||
return m_buffer != nullptr;
|
||||
}
|
||||
/**
|
||||
* @brief Get the status of selection.
|
||||
* @return true if we have a current selection, false otherwise.
|
||||
*/
|
||||
virtual bool hasTextSelected() {
|
||||
if (m_buffer==NULL) {
|
||||
if (m_buffer==nullptr) {
|
||||
return false;
|
||||
}
|
||||
return m_buffer->hasTextSelected();
|
||||
@ -224,7 +224,7 @@ namespace appl {
|
||||
* @brief Remove Selection of the buffer.
|
||||
*/
|
||||
virtual void unSelect() {
|
||||
if (m_buffer==NULL) {
|
||||
if (m_buffer==nullptr) {
|
||||
return;
|
||||
}
|
||||
m_buffer->unSelect();
|
||||
@ -235,7 +235,7 @@ namespace appl {
|
||||
* @param[in] _stop Stop position of the selection (the curor is set at this position)
|
||||
*/
|
||||
virtual void select(const appl::Buffer::Iterator& _start, const appl::Buffer::Iterator& _stop) {
|
||||
if (m_buffer==NULL) {
|
||||
if (m_buffer==nullptr) {
|
||||
return;
|
||||
}
|
||||
moveCursor(_stop);
|
||||
@ -255,7 +255,7 @@ namespace appl {
|
||||
appl::Buffer::Iterator& _resultStart,
|
||||
appl::Buffer::Iterator& _resultStop,
|
||||
bool _caseSensitive = true) {
|
||||
if (m_buffer==NULL) {
|
||||
if (m_buffer==nullptr) {
|
||||
return false;
|
||||
}
|
||||
bool ret = m_buffer->search(_pos, _search, _resultStart, _caseSensitive);
|
||||
@ -278,7 +278,7 @@ namespace appl {
|
||||
appl::Buffer::Iterator& _resultStart,
|
||||
appl::Buffer::Iterator& _resultStop,
|
||||
bool _caseSensitive = true) {
|
||||
if (m_buffer==NULL) {
|
||||
if (m_buffer==nullptr) {
|
||||
return false;
|
||||
}
|
||||
bool ret = m_buffer->searchBack(_pos, _search, _resultStart, _caseSensitive);
|
||||
@ -297,7 +297,7 @@ namespace appl {
|
||||
bool getPosAround(const appl::Buffer::Iterator& _pos,
|
||||
appl::Buffer::Iterator &_beginPos,
|
||||
appl::Buffer::Iterator &_endPos) {
|
||||
if (m_buffer==NULL) {
|
||||
if (m_buffer==nullptr) {
|
||||
return false;
|
||||
}
|
||||
return m_buffer->getPosAround(_pos, _beginPos, _endPos);
|
||||
@ -308,7 +308,7 @@ namespace appl {
|
||||
* @return The Iterator
|
||||
*/
|
||||
appl::Buffer::Iterator position(int64_t _pos) {
|
||||
if (m_buffer==NULL) {
|
||||
if (m_buffer==nullptr) {
|
||||
return appl::Buffer::Iterator();
|
||||
}
|
||||
return m_buffer->position(_pos);
|
||||
@ -318,7 +318,7 @@ namespace appl {
|
||||
* @return The iterator on the cursor position
|
||||
*/
|
||||
appl::Buffer::Iterator cursor() {
|
||||
if (m_buffer==NULL) {
|
||||
if (m_buffer==nullptr) {
|
||||
return appl::Buffer::Iterator();
|
||||
}
|
||||
return m_buffer->cursor();
|
||||
@ -328,7 +328,7 @@ namespace appl {
|
||||
* @return The iterator on the begin position
|
||||
*/
|
||||
appl::Buffer::Iterator begin() {
|
||||
if (m_buffer==NULL) {
|
||||
if (m_buffer==nullptr) {
|
||||
return appl::Buffer::Iterator();
|
||||
}
|
||||
return m_buffer->begin();
|
||||
@ -338,7 +338,7 @@ namespace appl {
|
||||
* @return The iterator on the end position
|
||||
*/
|
||||
appl::Buffer::Iterator end() {
|
||||
if (m_buffer==NULL) {
|
||||
if (m_buffer==nullptr) {
|
||||
return appl::Buffer::Iterator();
|
||||
}
|
||||
return m_buffer->end();
|
||||
@ -348,7 +348,7 @@ namespace appl {
|
||||
* @return The Iterator
|
||||
*/
|
||||
appl::Buffer::Iterator selectStart() {
|
||||
if (m_buffer==NULL) {
|
||||
if (m_buffer==nullptr) {
|
||||
return appl::Buffer::Iterator();
|
||||
}
|
||||
return m_buffer->selectStart();
|
||||
@ -358,7 +358,7 @@ namespace appl {
|
||||
* @return The Iterator
|
||||
*/
|
||||
appl::Buffer::Iterator selectStop() {
|
||||
if (m_buffer==NULL) {
|
||||
if (m_buffer==nullptr) {
|
||||
return appl::Buffer::Iterator();
|
||||
}
|
||||
return m_buffer->selectStop();
|
||||
@ -369,7 +369,7 @@ namespace appl {
|
||||
* @return The position in the buffer of the start of the line.
|
||||
*/
|
||||
appl::Buffer::Iterator getStartLine(const appl::Buffer::Iterator& _pos) {
|
||||
if (m_buffer==NULL) {
|
||||
if (m_buffer==nullptr) {
|
||||
return appl::Buffer::Iterator();
|
||||
}
|
||||
return m_buffer->getStartLine(_pos);
|
||||
@ -380,7 +380,7 @@ namespace appl {
|
||||
* @return The position in the buffer of the end of the line.
|
||||
*/
|
||||
appl::Buffer::Iterator getEndLine(const appl::Buffer::Iterator& _pos) {
|
||||
if (m_buffer==NULL) {
|
||||
if (m_buffer==nullptr) {
|
||||
return appl::Buffer::Iterator();
|
||||
}
|
||||
return m_buffer->getEndLine(_pos);
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
appl::ViewerManager::ViewerManager() :
|
||||
ewol::Resource("???ViewerManager???"),
|
||||
m_viewer(NULL) {
|
||||
m_viewer(nullptr) {
|
||||
addObjectType("appl::ViewerManager");
|
||||
// load buffer manager:
|
||||
m_bufferManager = appl::BufferManager::keep();
|
||||
@ -38,7 +38,7 @@ void appl::ViewerManager::setViewerSelected(const ewol::object::Shared<appl::Tex
|
||||
return;
|
||||
}
|
||||
m_viewer = _viewer;
|
||||
if (m_bufferManager != NULL) {
|
||||
if (m_bufferManager != nullptr) {
|
||||
m_bufferManager->setBufferSelected(_buffer);
|
||||
}
|
||||
}
|
||||
@ -58,15 +58,15 @@ void appl::ViewerManager::onObjectRemove(const ewol::object::Shared<ewol::Object
|
||||
ewol::object::Shared<appl::ViewerManager> appl::ViewerManager::keep() {
|
||||
//EWOL_INFO("KEEP : appl::GlyphPainting : file : \"" << _filename << "\"");
|
||||
ewol::object::Shared<appl::ViewerManager> object = ewol::dynamic_pointer_cast<appl::ViewerManager>(getManager().localKeep("???ViewerManager???"));
|
||||
if (NULL != object) {
|
||||
if (nullptr != object) {
|
||||
return object;
|
||||
}
|
||||
// this element create a new one every time ....
|
||||
EWOL_INFO("CREATE : appl::ViewerManager: ???ViewerManager???");
|
||||
object = ewol::object::makeShared(new appl::ViewerManager());
|
||||
if (NULL == object) {
|
||||
if (nullptr == object) {
|
||||
EWOL_ERROR("allocation error of a resource : ???ViewerManager???");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
getManager().localAdd(object);
|
||||
return object;
|
||||
|
@ -52,7 +52,7 @@ namespace appl {
|
||||
* @brief keep the resource pointer.
|
||||
* @note Never free this pointer by your own...
|
||||
* @param[in] _filename Name of the configuration file.
|
||||
* @return pointer on the resource or NULL if an error occured.
|
||||
* @return pointer on the resource or nullptr if an error occured.
|
||||
*/
|
||||
static ewol::object::Shared<appl::ViewerManager> keep();
|
||||
};
|
||||
|
@ -16,13 +16,13 @@
|
||||
static const char* s_closeDone = "close-done";
|
||||
|
||||
appl::WorkerCloseAllFile::WorkerCloseAllFile() :
|
||||
m_worker(NULL),
|
||||
m_bufferManager(NULL) {
|
||||
m_worker(nullptr),
|
||||
m_bufferManager(nullptr) {
|
||||
addObjectType("appl::WorkerCloseAllFile");
|
||||
// load buffer manager:
|
||||
m_bufferManager = appl::BufferManager::keep();
|
||||
|
||||
if (m_bufferManager == NULL) {
|
||||
if (m_bufferManager == nullptr) {
|
||||
APPL_ERROR("can not call unexistant buffer manager ... ");
|
||||
autoDestroy();
|
||||
return;
|
||||
@ -30,7 +30,7 @@ appl::WorkerCloseAllFile::WorkerCloseAllFile() :
|
||||
// List all current open file :
|
||||
for (int64_t iii=m_bufferManager->size()-1; iii>=0; --iii) {
|
||||
ewol::object::Shared<appl::Buffer> tmpBuffer = m_bufferManager->get(iii);
|
||||
if (tmpBuffer == NULL) {
|
||||
if (tmpBuffer == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (tmpBuffer->isModify() == false) {
|
||||
@ -60,7 +60,7 @@ appl::WorkerCloseAllFile::~WorkerCloseAllFile() {
|
||||
}
|
||||
|
||||
void appl::WorkerCloseAllFile::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
if (m_bufferManager == NULL) {
|
||||
if (m_bufferManager == nullptr) {
|
||||
// nothing to do in this case ==> can do nothing ...
|
||||
return;
|
||||
}
|
||||
@ -83,11 +83,11 @@ void appl::WorkerCloseAllFile::onReceiveMessage(const ewol::object::Message& _ms
|
||||
|
||||
void appl::WorkerCloseAllFile::onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject) {
|
||||
if (_removeObject == m_worker) {
|
||||
m_worker = NULL;
|
||||
m_worker = nullptr;
|
||||
APPL_VERBOSE("AutoRemove After saving sub widget ...");
|
||||
autoDestroy();
|
||||
} else if (_removeObject == m_bufferManager) {
|
||||
m_bufferManager = NULL;
|
||||
m_bufferManager = nullptr;
|
||||
autoDestroy();
|
||||
}
|
||||
}
|
||||
|
@ -23,15 +23,15 @@ static const char* s_saveAsDone = "save-as-done";
|
||||
|
||||
appl::WorkerCloseFile::WorkerCloseFile(const std::string& _bufferName) :
|
||||
m_bufferName(_bufferName),
|
||||
m_buffer(NULL),
|
||||
m_worker(NULL),
|
||||
m_bufferManager(NULL) {
|
||||
m_buffer(nullptr),
|
||||
m_worker(nullptr),
|
||||
m_bufferManager(nullptr) {
|
||||
addObjectType("appl::WorkerCloseFile");
|
||||
addEventId(eventCloseDone);
|
||||
// load buffer manager:
|
||||
m_bufferManager = appl::BufferManager::keep();
|
||||
|
||||
if (m_bufferManager == NULL) {
|
||||
if (m_bufferManager == nullptr) {
|
||||
APPL_ERROR("can not call unexistant buffer manager ... ");
|
||||
autoDestroy();
|
||||
return;
|
||||
@ -39,7 +39,7 @@ appl::WorkerCloseFile::WorkerCloseFile(const std::string& _bufferName) :
|
||||
if (m_bufferName == "") {
|
||||
// need to find the curent file ...
|
||||
ewol::object::Shared<appl::Buffer> tmpp = m_bufferManager->getBufferSelected();
|
||||
if (tmpp == NULL) {
|
||||
if (tmpp == nullptr) {
|
||||
APPL_ERROR("No selected buffer now ...");
|
||||
autoDestroy();
|
||||
return;
|
||||
@ -52,7 +52,7 @@ appl::WorkerCloseFile::WorkerCloseFile(const std::string& _bufferName) :
|
||||
return;
|
||||
}
|
||||
m_buffer = m_bufferManager->get(m_bufferName);
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
APPL_ERROR("Error to get the buffer : " << m_bufferName);
|
||||
autoDestroy();
|
||||
return;
|
||||
@ -64,31 +64,31 @@ appl::WorkerCloseFile::WorkerCloseFile(const std::string& _bufferName) :
|
||||
}
|
||||
|
||||
ewol::object::Shared<ewol::widget::StdPopUp> tmpPopUp = ewol::object::makeShared(new ewol::widget::StdPopUp());
|
||||
if (tmpPopUp == NULL) {
|
||||
if (tmpPopUp == nullptr) {
|
||||
APPL_ERROR("Can not create a simple pop-up");
|
||||
return;
|
||||
}
|
||||
tmpPopUp->setTitle("<bold>Close un-saved file:</bold>");
|
||||
tmpPopUp->setComment("The file named : <i>\"" + m_buffer->getFileName() + "\"</i> is curently modify. <br/>If you don't saves these modifications,<br/>they will be definitly lost...");
|
||||
ewol::object::Shared<ewol::Widget> bt = NULL;
|
||||
ewol::object::Shared<ewol::Widget> bt = nullptr;
|
||||
if (m_buffer->hasFileName() == true) {
|
||||
bt = tmpPopUp->addButton("Save", true);
|
||||
if (bt != NULL) {
|
||||
if (bt != nullptr) {
|
||||
bt->registerOnEvent(this, "pressed", s_saveValidate);
|
||||
}
|
||||
}
|
||||
bt = tmpPopUp->addButton("Save As", true);
|
||||
if (bt != NULL) {
|
||||
if (bt != nullptr) {
|
||||
bt->registerOnEvent(this, "pressed", s_saveAsValidate);
|
||||
}
|
||||
bt = tmpPopUp->addButton("Close", true);
|
||||
if (bt != NULL) {
|
||||
if (bt != nullptr) {
|
||||
bt->registerOnEvent(this, "pressed", s_closeValidate);
|
||||
}
|
||||
tmpPopUp->addButton("Cancel", true);
|
||||
tmpPopUp->setRemoveOnExternClick(true);
|
||||
ewol::object::Shared<ewol::widget::Windows> tmpWindows = ewol::getContext().getWindows();
|
||||
if (tmpWindows == NULL) {
|
||||
if (tmpWindows == nullptr) {
|
||||
APPL_ERROR("Error to get the windows.");
|
||||
autoDestroy();
|
||||
return;
|
||||
@ -101,25 +101,25 @@ appl::WorkerCloseFile::~WorkerCloseFile() {
|
||||
}
|
||||
|
||||
void appl::WorkerCloseFile::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
if (m_bufferManager == NULL) {
|
||||
if (m_bufferManager == nullptr) {
|
||||
// nothing to do in this case ==> can do nothing ...
|
||||
return;
|
||||
}
|
||||
APPL_DEBUG("have message : " << _msg);
|
||||
if (_msg.getMessage() == s_saveAsValidate) {
|
||||
m_worker = ewol::object::makeShared(new appl::WorkerSaveFile(m_bufferName));
|
||||
if (m_worker != NULL) {
|
||||
if (m_worker != nullptr) {
|
||||
m_worker->registerOnEvent(this, appl::WorkerSaveFile::eventSaveDone, s_saveAsDone);
|
||||
}
|
||||
} else if (_msg.getMessage() == s_saveValidate) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
APPL_ERROR("Error to get the buffer : oldName=" << m_bufferName);
|
||||
autoDestroy();
|
||||
return;
|
||||
}
|
||||
if (m_buffer->storeFile() == false) {
|
||||
ewol::object::Shared<ewol::widget::Windows> tmpWindows = ewol::getContext().getWindows();
|
||||
if (tmpWindows == NULL) {
|
||||
if (tmpWindows == nullptr) {
|
||||
return;
|
||||
}
|
||||
tmpWindows->displayWarningMessage("We can not save the file : <br/><i>" + m_buffer->getFileName() + "</i>");
|
||||
@ -128,7 +128,7 @@ void appl::WorkerCloseFile::onReceiveMessage(const ewol::object::Message& _msg)
|
||||
}
|
||||
} else if ( _msg.getMessage() == s_closeValidate
|
||||
|| _msg.getMessage() == s_saveAsDone) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
APPL_ERROR("Error to get the buffer : " << m_bufferName);
|
||||
autoDestroy();
|
||||
return;
|
||||
@ -140,14 +140,14 @@ void appl::WorkerCloseFile::onReceiveMessage(const ewol::object::Message& _msg)
|
||||
|
||||
void appl::WorkerCloseFile::onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject) {
|
||||
if (_removeObject == m_worker) {
|
||||
m_worker = NULL;
|
||||
m_worker = nullptr;
|
||||
APPL_VERBOSE("AutoRemove After closing sub widget ...");
|
||||
autoDestroy();
|
||||
} else if (_removeObject == m_bufferManager) {
|
||||
m_bufferManager = NULL;
|
||||
m_bufferManager = nullptr;
|
||||
autoDestroy();
|
||||
} else if (_removeObject == m_buffer) {
|
||||
m_buffer = NULL;
|
||||
m_buffer = nullptr;
|
||||
autoDestroy();
|
||||
}
|
||||
}
|
||||
|
@ -16,13 +16,13 @@
|
||||
static const char* s_saveAsDone = "save-as-done";
|
||||
|
||||
appl::WorkerSaveAllFile::WorkerSaveAllFile() :
|
||||
m_worker(NULL),
|
||||
m_bufferManager(NULL) {
|
||||
m_worker(nullptr),
|
||||
m_bufferManager(nullptr) {
|
||||
addObjectType("appl::WorkerSaveAllFile");
|
||||
// load buffer manager:
|
||||
m_bufferManager = appl::BufferManager::keep();
|
||||
|
||||
if (m_bufferManager == NULL) {
|
||||
if (m_bufferManager == nullptr) {
|
||||
APPL_ERROR("can not call unexistant buffer manager ... ");
|
||||
autoDestroy();
|
||||
return;
|
||||
@ -30,7 +30,7 @@ appl::WorkerSaveAllFile::WorkerSaveAllFile() :
|
||||
// List all current open file :
|
||||
for (int32_t iii=0; iii<m_bufferManager->size(); ++iii) {
|
||||
ewol::object::Shared<appl::Buffer> tmpBuffer = m_bufferManager->get(iii);
|
||||
if (tmpBuffer == NULL) {
|
||||
if (tmpBuffer == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (tmpBuffer->isModify() == false) {
|
||||
@ -63,7 +63,7 @@ appl::WorkerSaveAllFile::~WorkerSaveAllFile() {
|
||||
}
|
||||
|
||||
void appl::WorkerSaveAllFile::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
if (m_bufferManager == NULL) {
|
||||
if (m_bufferManager == nullptr) {
|
||||
// nothing to do in this case ==> can do nothing ...
|
||||
return;
|
||||
}
|
||||
@ -86,11 +86,11 @@ void appl::WorkerSaveAllFile::onReceiveMessage(const ewol::object::Message& _msg
|
||||
|
||||
void appl::WorkerSaveAllFile::onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject) {
|
||||
if (_removeObject == m_worker) {
|
||||
m_worker = NULL;
|
||||
m_worker = nullptr;
|
||||
APPL_VERBOSE("AutoRemove After saving sub widget ...");
|
||||
autoDestroy();
|
||||
} else if (_removeObject == m_bufferManager) {
|
||||
m_bufferManager = NULL;
|
||||
m_bufferManager = nullptr;
|
||||
autoDestroy();
|
||||
}
|
||||
}
|
||||
|
@ -19,14 +19,14 @@ static const char* s_saveAsValidate = "save-as-validate";
|
||||
|
||||
appl::WorkerSaveFile::WorkerSaveFile(const std::string& _bufferName, bool _forceSaveAs) :
|
||||
m_bufferName(_bufferName),
|
||||
m_chooser(NULL),
|
||||
m_bufferManager(NULL) {
|
||||
m_chooser(nullptr),
|
||||
m_bufferManager(nullptr) {
|
||||
addObjectType("appl::WorkerSaveFile");
|
||||
addEventId(eventSaveDone);
|
||||
// load buffer manager:
|
||||
m_bufferManager = appl::BufferManager::keep();
|
||||
|
||||
if (m_bufferManager == NULL) {
|
||||
if (m_bufferManager == nullptr) {
|
||||
APPL_ERROR("can not call unexistant buffer manager ... ");
|
||||
autoDestroy();
|
||||
return;
|
||||
@ -34,7 +34,7 @@ appl::WorkerSaveFile::WorkerSaveFile(const std::string& _bufferName, bool _force
|
||||
if (m_bufferName == "") {
|
||||
// need to find the curent file ...
|
||||
ewol::object::Shared<appl::Buffer> tmpp = m_bufferManager->getBufferSelected();
|
||||
if (tmpp == NULL) {
|
||||
if (tmpp == nullptr) {
|
||||
APPL_ERROR("No selected buffer now ...");
|
||||
autoDestroy();
|
||||
return;
|
||||
@ -47,7 +47,7 @@ appl::WorkerSaveFile::WorkerSaveFile(const std::string& _bufferName, bool _force
|
||||
return;
|
||||
}
|
||||
ewol::object::Shared<appl::Buffer> tmpBuffer = m_bufferManager->get(m_bufferName);
|
||||
if (tmpBuffer == NULL) {
|
||||
if (tmpBuffer == nullptr) {
|
||||
APPL_ERROR("Error to get the buffer : " << m_bufferName);
|
||||
autoDestroy();
|
||||
return;
|
||||
@ -61,7 +61,7 @@ appl::WorkerSaveFile::WorkerSaveFile(const std::string& _bufferName, bool _force
|
||||
}
|
||||
}
|
||||
m_chooser = ewol::object::makeShared(new ewol::widget::FileChooser());
|
||||
if (NULL == m_chooser) {
|
||||
if (nullptr == m_chooser) {
|
||||
APPL_ERROR("Can not allocate widget == > display might be in error");
|
||||
autoDestroy();
|
||||
return;
|
||||
@ -72,7 +72,7 @@ appl::WorkerSaveFile::WorkerSaveFile(const std::string& _bufferName, bool _force
|
||||
m_chooser->setFolder(tmpName.getNameFolder());
|
||||
m_chooser->setFileName(tmpName.getNameFile());
|
||||
ewol::object::Shared<ewol::widget::Windows> tmpWindows = ewol::getContext().getWindows();
|
||||
if (tmpWindows == NULL) {
|
||||
if (tmpWindows == nullptr) {
|
||||
APPL_ERROR("Error to get the windows.");
|
||||
autoDestroy();
|
||||
return;
|
||||
@ -86,7 +86,7 @@ appl::WorkerSaveFile::~WorkerSaveFile() {
|
||||
}
|
||||
|
||||
void appl::WorkerSaveFile::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
if (m_bufferManager == NULL) {
|
||||
if (m_bufferManager == nullptr) {
|
||||
// nothing to do in this case ==> can do nothing ...
|
||||
return;
|
||||
}
|
||||
@ -100,14 +100,14 @@ void appl::WorkerSaveFile::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
return;
|
||||
}
|
||||
ewol::object::Shared<appl::Buffer> tmpBuffer = m_bufferManager->get(m_bufferName);
|
||||
if (tmpBuffer == NULL) {
|
||||
if (tmpBuffer == nullptr) {
|
||||
APPL_ERROR("Error to get the buffer : " << m_bufferName);
|
||||
return;
|
||||
}
|
||||
tmpBuffer->setFileName(_msg.getData());
|
||||
if (tmpBuffer->storeFile() == false) {
|
||||
ewol::object::Shared<ewol::widget::Windows> tmpWindows = ewol::getContext().getWindows();
|
||||
if (tmpWindows == NULL) {
|
||||
if (tmpWindows == nullptr) {
|
||||
return;
|
||||
}
|
||||
tmpWindows->displayWarningMessage("We can not save the file : <br/><i>" + tmpBuffer->getFileName() + "</i>");
|
||||
@ -119,11 +119,11 @@ void appl::WorkerSaveFile::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
|
||||
void appl::WorkerSaveFile::onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject) {
|
||||
if (_removeObject == m_chooser) {
|
||||
m_chooser = NULL;
|
||||
m_chooser = nullptr;
|
||||
APPL_VERBOSE("AutoRemove After closing sub widget ...");
|
||||
autoDestroy();
|
||||
} else if (_removeObject == m_bufferManager) {
|
||||
m_bufferManager = NULL;
|
||||
m_bufferManager = nullptr;
|
||||
autoDestroy();
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ appl::Highlight::Highlight(const std::string& _xmlFilename, const std::string& _
|
||||
return;
|
||||
}
|
||||
exml::Element* root = doc.getNamed("EdnLang");
|
||||
if (NULL == root ) {
|
||||
if (nullptr == root ) {
|
||||
APPL_ERROR("(l ?) main node not find: \"EdnLang\" ...");
|
||||
return;
|
||||
}
|
||||
@ -58,7 +58,7 @@ appl::Highlight::Highlight(const std::string& _xmlFilename, const std::string& _
|
||||
// parse all the elements :
|
||||
for(size_t iii = 0; iii < root->size(); ++iii) {
|
||||
exml::Element* child = root->getElement(iii);
|
||||
if (child == NULL) {
|
||||
if (child == nullptr) {
|
||||
// trash here all that is not element ...
|
||||
continue;
|
||||
}
|
||||
@ -72,7 +72,7 @@ appl::Highlight::Highlight(const std::string& _xmlFilename, const std::string& _
|
||||
// get sub Nodes ...
|
||||
for(size_t jjj=0; jjj< child->size(); jjj++) {
|
||||
exml::Element* passChild = child->getElement(jjj);
|
||||
if (passChild == NULL) {
|
||||
if (passChild == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (passChild->getValue() != "rule") {
|
||||
@ -85,7 +85,7 @@ appl::Highlight::Highlight(const std::string& _xmlFilename, const std::string& _
|
||||
// get sub Nodes ...
|
||||
for(size_t jjj=0; jjj< child->size(); jjj++) {
|
||||
exml::Element* passChild = child->getElement(jjj);
|
||||
if (passChild == NULL) {
|
||||
if (passChild == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (passChild->getValue() != "rule") {
|
||||
@ -259,15 +259,15 @@ void appl::Highlight::parse2(int64_t _start,
|
||||
ewol::object::Shared<appl::Highlight> appl::Highlight::keep(const std::string& _filename) {
|
||||
//EWOL_INFO("KEEP : appl::Highlight : file : \"" << _filename << "\"");
|
||||
ewol::object::Shared<appl::Highlight> object = ewol::dynamic_pointer_cast<appl::Highlight>(getManager().localKeep(_filename));
|
||||
if (NULL != object) {
|
||||
if (nullptr != object) {
|
||||
return object;
|
||||
}
|
||||
EWOL_INFO("CREATE : appl::Highlight : file : \"" << _filename << "\"");
|
||||
// this element create a new one every time ....
|
||||
object = ewol::object::makeShared(new appl::Highlight(_filename, "THEME:COLOR:textViewer.json"));
|
||||
if (NULL == object) {
|
||||
if (nullptr == object) {
|
||||
EWOL_ERROR("allocation error of a resource : ??Highlight??");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
getManager().localAdd(object);
|
||||
return object;
|
||||
|
@ -73,7 +73,7 @@ namespace appl {
|
||||
* @brief keep the resource pointer.
|
||||
* @note Never free this pointer by your own...
|
||||
* @param[in] _filename Name of the configuration file.
|
||||
* @return pointer on the resource or NULL if an error occured.
|
||||
* @return pointer on the resource or nullptr if an error occured.
|
||||
*/
|
||||
static ewol::object::Shared<appl::Highlight> keep(const std::string& _filename);
|
||||
public: // herited function :
|
||||
|
@ -34,7 +34,7 @@ void appl::highlightManager::init() {
|
||||
// get the subfolder list :
|
||||
std::vector<etk::FSNode *> list = myFile.folderGetSubList(false, true, false,false);
|
||||
for (auto &it : list) {
|
||||
if (it == NULL) {
|
||||
if (it == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (it->getNodeType() != etk::FSN_FOLDER) {
|
||||
@ -43,7 +43,7 @@ void appl::highlightManager::init() {
|
||||
std::string filename = it->getName() + "/highlight.xml";
|
||||
APPL_DEBUG("Load xml name : " << filename);
|
||||
ewol::object::Shared<appl::Highlight> myHightLine = appl::Highlight::keep(filename);
|
||||
if (myHightLine != NULL) {
|
||||
if (myHightLine != nullptr) {
|
||||
hlList.push_back(myHightLine);
|
||||
} else {
|
||||
APPL_ERROR("Can not allocate HighLight");
|
||||
@ -52,7 +52,7 @@ void appl::highlightManager::init() {
|
||||
// display :
|
||||
/*
|
||||
for (auto &it : hlList) {
|
||||
if (it == NULL) {
|
||||
if (it == nullptr) {
|
||||
continue;
|
||||
}
|
||||
it->display();
|
||||
@ -77,7 +77,7 @@ std::string appl::highlightManager::getTypeExtention(const std::string& _extenti
|
||||
APPL_DEBUG("Try to find type for extention : '" << _extention << "' in " << s_list().size() << " types");
|
||||
std::vector<ewol::object::Shared<Highlight>>& hlList = s_list();
|
||||
for (auto &it : hlList) {
|
||||
if (it == NULL) {
|
||||
if (it == nullptr) {
|
||||
continue;
|
||||
}
|
||||
APPL_DEBUG(" check : " << it->getTypeName());
|
||||
@ -95,7 +95,7 @@ std::string appl::highlightManager::getFileWithTypeType(const std::string& _type
|
||||
return "";
|
||||
}
|
||||
for (auto &it : s_list()) {
|
||||
if (it == NULL) {
|
||||
if (it == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (it->getTypeName() == _type) {
|
||||
|
@ -30,7 +30,7 @@ appl::HighlightPattern::~HighlightPattern() {
|
||||
}
|
||||
|
||||
void appl::HighlightPattern::setPaternStart(std::string& _regExp) {
|
||||
if (m_regExpStart == NULL) {
|
||||
if (m_regExpStart == nullptr) {
|
||||
return;
|
||||
}
|
||||
m_regExpStart->compile(_regExp);
|
||||
@ -40,7 +40,7 @@ void appl::HighlightPattern::setPaternStop(std::string& _regExp) {
|
||||
m_regExpStop.reset();
|
||||
if (_regExp.size() != 0) {
|
||||
m_regExpStop = std::unique_ptr<etk::RegExp<etk::Buffer>>(new etk::RegExp<etk::Buffer>());
|
||||
if (m_regExpStop != NULL) {
|
||||
if (m_regExpStop != nullptr) {
|
||||
m_regExpStop->compile(_regExp);
|
||||
} else {
|
||||
APPL_ERROR("Allocation error");
|
||||
@ -62,7 +62,7 @@ void appl::HighlightPattern::display() {
|
||||
APPL_INFO("patern : \"" << m_paternName << "\" level=" << m_level );
|
||||
APPL_INFO(" == > colorName \"" << m_colorName << "\"");
|
||||
APPL_INFO(" == > regExpStart \"" << m_regExpStart->getRegExp() << "\"");
|
||||
if (m_regExpStop != NULL) {
|
||||
if (m_regExpStop != nullptr) {
|
||||
APPL_INFO(" == > regExpStop \"" << m_regExpStop->getRegExp() << "\"");
|
||||
}
|
||||
if (m_multiline == true) {
|
||||
@ -93,7 +93,7 @@ void appl::HighlightPattern::parseRules(exml::Element* _child, int32_t _level) {
|
||||
setLevel(_level);
|
||||
|
||||
exml::Element* xChild = _child->getNamed("color");
|
||||
if (NULL != xChild) {
|
||||
if (nullptr != xChild) {
|
||||
std::string myData = xChild->getText();
|
||||
if (myData.size() != 0) {
|
||||
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
||||
@ -102,7 +102,7 @@ void appl::HighlightPattern::parseRules(exml::Element* _child, int32_t _level) {
|
||||
}
|
||||
}
|
||||
xChild = _child->getNamed("start");
|
||||
if (NULL != xChild) {
|
||||
if (nullptr != xChild) {
|
||||
std::string myData = xChild->getText();
|
||||
if (myData.size() != 0) {
|
||||
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
||||
@ -111,7 +111,7 @@ void appl::HighlightPattern::parseRules(exml::Element* _child, int32_t _level) {
|
||||
}
|
||||
}
|
||||
xChild = _child->getNamed("end");
|
||||
if (NULL != xChild) {
|
||||
if (nullptr != xChild) {
|
||||
std::string myData = xChild->getText();
|
||||
if (myData.size() != 0) {
|
||||
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
||||
@ -120,7 +120,7 @@ void appl::HighlightPattern::parseRules(exml::Element* _child, int32_t _level) {
|
||||
}
|
||||
}
|
||||
xChild = _child->getNamed("EscapeChar");
|
||||
if (NULL != xChild) {
|
||||
if (nullptr != xChild) {
|
||||
std::string myData = xChild->getText();
|
||||
if (myData.size() != 0) {
|
||||
//APPL_INFO(PFX"(l %d) node fined : %s=\"%s\"", xChild->Row(), xChild->Value() , myData);
|
||||
@ -143,7 +143,7 @@ enum resultFind appl::HighlightPattern::find(int32_t _start,
|
||||
_resultat.patern = this;
|
||||
|
||||
// when we have only one element:
|
||||
if (m_regExpStop == NULL) {
|
||||
if (m_regExpStop == nullptr) {
|
||||
if (true == m_regExpStart->processOneElement(_buffer, _start, _stop)) {
|
||||
_resultat.beginStart = m_regExpStart->start();
|
||||
_resultat.beginStop = m_regExpStart->stop();
|
||||
|
@ -21,7 +21,7 @@
|
||||
appl::TextPluginCtags::TextPluginCtags() :
|
||||
m_tagFolderBase(""),
|
||||
m_tagFilename(""),
|
||||
m_ctagFile(NULL) {
|
||||
m_ctagFile(nullptr) {
|
||||
m_activateOnReceiveMessage = true;
|
||||
// load buffer manager:
|
||||
m_bufferManager = appl::BufferManager::keep();
|
||||
@ -58,7 +58,7 @@ void appl::TextPluginCtags::onPluginDisable(appl::TextViewer& _textDrawer) {
|
||||
}
|
||||
|
||||
void appl::TextPluginCtags::jumpTo(const std::string& _name) {
|
||||
if (m_ctagFile == NULL) {
|
||||
if (m_ctagFile == nullptr) {
|
||||
APPL_WARNING("No ctags file open");
|
||||
return;
|
||||
}
|
||||
@ -80,7 +80,7 @@ void appl::TextPluginCtags::jumpTo(const std::string& _name) {
|
||||
if (tagsFindNext (m_ctagFile, &entry) == TagSuccess) {
|
||||
APPL_INFO("Multiple file destination ...");
|
||||
ewol::object::Shared<appl::TagFileSelection> tmpWidget = ewol::object::makeShared(new appl::TagFileSelection());
|
||||
if (NULL == tmpWidget) {
|
||||
if (nullptr == tmpWidget) {
|
||||
APPL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
tmpWidget->addCtagsNewItem(myfile.getFileSystemName(), lineID);
|
||||
@ -102,7 +102,7 @@ void appl::TextPluginCtags::jumpTo(const std::string& _name) {
|
||||
void appl::TextPluginCtags::jumpFile(const std::string& _filename, int64_t _lineId) {
|
||||
// save the current file in the history
|
||||
// TODO : registerHistory();
|
||||
if (m_bufferManager != NULL) {
|
||||
if (m_bufferManager != nullptr) {
|
||||
m_bufferManager->open(_filename);
|
||||
}
|
||||
sendMultiCast(appl::MsgSelectChange, _filename);
|
||||
@ -112,9 +112,9 @@ void appl::TextPluginCtags::jumpFile(const std::string& _filename, int64_t _line
|
||||
void appl::TextPluginCtags::loadTagFile() {
|
||||
tagFileInfo info;
|
||||
// close previous tag file
|
||||
if (NULL != m_ctagFile) {
|
||||
if (nullptr != m_ctagFile) {
|
||||
tagsClose(m_ctagFile);
|
||||
m_ctagFile = NULL;
|
||||
m_ctagFile = nullptr;
|
||||
}
|
||||
if (m_tagFilename == "") {
|
||||
return;
|
||||
@ -122,7 +122,7 @@ void appl::TextPluginCtags::loadTagFile() {
|
||||
// load (open) the tag file :
|
||||
APPL_INFO("try to open tag file : " << m_tagFilename);
|
||||
m_ctagFile = tagsOpen(m_tagFilename.c_str(), &info);
|
||||
if (NULL != m_ctagFile) {
|
||||
if (nullptr != m_ctagFile) {
|
||||
APPL_INFO("open exuberant Ctags file is OK ...");
|
||||
} else {
|
||||
APPL_INFO("Error to open ctags file ...");
|
||||
@ -139,7 +139,7 @@ void appl::TextPluginCtags::printTag(const tagEntry *_entry) {
|
||||
<< "\" at line="<< (int32_t)_entry->address.lineNumber);
|
||||
|
||||
APPL_INFO("Extention field : ");
|
||||
if (_entry->kind != NULL && _entry->kind [0] != '\0') {
|
||||
if (_entry->kind != nullptr && _entry->kind [0] != '\0') {
|
||||
APPL_INFO(" kind : " << _entry->kind);
|
||||
}
|
||||
if (_entry->fileScope) {
|
||||
@ -176,7 +176,7 @@ bool appl::TextPluginCtags::onReceiveMessageViewer(appl::TextViewer& _textDrawer
|
||||
if (_msg.getMessage() == eventOpenCtagsFile) {
|
||||
APPL_INFO("Request opening ctag file");
|
||||
ewol::object::Shared<ewol::widget::FileChooser> tmpWidget = ewol::object::makeShared(new ewol::widget::FileChooser());
|
||||
if (NULL == tmpWidget) {
|
||||
if (nullptr == tmpWidget) {
|
||||
APPL_ERROR("Can not allocate widget == > display might be in error");
|
||||
return true;
|
||||
}
|
||||
|
@ -24,10 +24,10 @@ namespace appl {
|
||||
}
|
||||
virtual ~TextViewerPluginData() {
|
||||
for (size_t iii = 0; iii < m_specificData.size() ; ++iii) {
|
||||
if (m_specificData[iii].second != NULL) {
|
||||
if (m_specificData[iii].second != nullptr) {
|
||||
remove(*m_specificData[iii].second);
|
||||
delete(m_specificData[iii].second);
|
||||
m_specificData[iii].second = NULL;
|
||||
m_specificData[iii].second = nullptr;
|
||||
}
|
||||
}
|
||||
m_specificData.clear();
|
||||
@ -42,8 +42,8 @@ namespace appl {
|
||||
}
|
||||
}
|
||||
TYPE* data = new TYPE();
|
||||
if (data == NULL) {
|
||||
return NULL;
|
||||
if (data == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
m_specificData.push_back(std::make_pair(_textDrawer.internalGetBuffer(), data));
|
||||
// create a new one ...
|
||||
@ -53,7 +53,7 @@ namespace appl {
|
||||
bool onReceiveMessageViewer(appl::TextViewer& _textDrawer,
|
||||
const ewol::object::Message& _msg) {
|
||||
TYPE* data = getDataRef(_textDrawer);
|
||||
if (data == NULL) {
|
||||
if (data == nullptr) {
|
||||
return false;
|
||||
}
|
||||
return onReceiveMessageViewer(_textDrawer, _msg, *data);
|
||||
@ -62,7 +62,7 @@ namespace appl {
|
||||
const appl::Buffer::Iterator& _pos,
|
||||
const std::string& _data) {
|
||||
TYPE* data = getDataRef(_textDrawer);
|
||||
if (data == NULL) {
|
||||
if (data == nullptr) {
|
||||
return false;
|
||||
}
|
||||
return onWrite(_textDrawer, _pos, _data, *data);
|
||||
@ -72,7 +72,7 @@ namespace appl {
|
||||
const std::string& _data,
|
||||
const appl::Buffer::Iterator& _posEnd) {
|
||||
TYPE* data = getDataRef(_textDrawer);
|
||||
if (data == NULL) {
|
||||
if (data == nullptr) {
|
||||
return false;
|
||||
}
|
||||
return onReplace(_textDrawer, _pos, _data, _posEnd, *data);
|
||||
@ -81,7 +81,7 @@ namespace appl {
|
||||
const appl::Buffer::Iterator& _pos,
|
||||
const appl::Buffer::Iterator& _posEnd) {
|
||||
TYPE* data = getDataRef(_textDrawer);
|
||||
if (data == NULL) {
|
||||
if (data == nullptr) {
|
||||
return false;
|
||||
}
|
||||
return onRemove(_textDrawer, _pos, _posEnd, *data);
|
||||
|
@ -45,7 +45,7 @@ bool appl::TextPluginHistory::onReceiveMessageViewer(appl::TextViewer& _textDraw
|
||||
if (_data.m_redo.size() == 0) {
|
||||
return true;
|
||||
}
|
||||
if (_data.m_redo[_data.m_redo.size()-1] == NULL) {
|
||||
if (_data.m_redo[_data.m_redo.size()-1] == nullptr) {
|
||||
_data.m_redo.pop_back();
|
||||
return true;
|
||||
}
|
||||
@ -61,7 +61,7 @@ bool appl::TextPluginHistory::onReceiveMessageViewer(appl::TextViewer& _textDraw
|
||||
if (_data.m_undo.size() == 0) {
|
||||
return true;
|
||||
}
|
||||
if (_data.m_undo[_data.m_undo.size()-1] == NULL) {
|
||||
if (_data.m_undo[_data.m_undo.size()-1] == nullptr) {
|
||||
_data.m_undo.pop_back();
|
||||
return true;
|
||||
}
|
||||
@ -82,11 +82,11 @@ void appl::TextPluginHistory::clearRedo(appl::PluginHistoryData& _data) {
|
||||
return;
|
||||
}
|
||||
for (size_t iii=0; iii<_data.m_redo.size(); ++iii) {
|
||||
if (_data.m_redo[iii] == NULL) {
|
||||
if (_data.m_redo[iii] == nullptr) {
|
||||
continue;
|
||||
}
|
||||
delete(_data.m_redo[iii]);
|
||||
_data.m_redo[iii] = NULL;
|
||||
_data.m_redo[iii] = nullptr;
|
||||
}
|
||||
_data.m_redo.clear();
|
||||
}
|
||||
@ -96,11 +96,11 @@ void appl::TextPluginHistory::clearUndo(appl::PluginHistoryData& _data) {
|
||||
return;
|
||||
}
|
||||
for (size_t iii=0; iii<_data.m_undo.size(); ++iii) {
|
||||
if (_data.m_undo[iii] == NULL) {
|
||||
if (_data.m_undo[iii] == nullptr) {
|
||||
continue;
|
||||
}
|
||||
delete(_data.m_undo[iii]);
|
||||
_data.m_undo[iii] = NULL;
|
||||
_data.m_undo[iii] = nullptr;
|
||||
}
|
||||
_data.m_undo.clear();
|
||||
}
|
||||
@ -114,13 +114,13 @@ bool appl::TextPluginHistory::onWrite(appl::TextViewer& _textDrawer,
|
||||
return false;
|
||||
}
|
||||
appl::History *tmpElement = new appl::History();
|
||||
if (tmpElement != NULL) {
|
||||
if (tmpElement != nullptr) {
|
||||
tmpElement->m_addedText = _strData;
|
||||
tmpElement->m_posAdded = (int64_t)_pos;
|
||||
tmpElement->m_endPosRemoved = (int64_t)_pos;
|
||||
}
|
||||
_textDrawer.writeDirect(_strData, _pos);
|
||||
if (tmpElement != NULL) {
|
||||
if (tmpElement != nullptr) {
|
||||
tmpElement->m_endPosAdded = (int64_t)_textDrawer.cursor();
|
||||
clearRedo(_data);
|
||||
_data.m_undo.push_back(tmpElement);
|
||||
@ -138,14 +138,14 @@ bool appl::TextPluginHistory::onReplace(appl::TextViewer& _textDrawer,
|
||||
return false;
|
||||
}
|
||||
appl::History *tmpElement = new appl::History();
|
||||
if (tmpElement != NULL) {
|
||||
if (tmpElement != nullptr) {
|
||||
tmpElement->m_posAdded = (int64_t)_pos;
|
||||
tmpElement->m_addedText = _strData;
|
||||
tmpElement->m_endPosRemoved = (int64_t)_posEnd;
|
||||
_textDrawer.copy(tmpElement->m_removedText, _pos, _posEnd);
|
||||
}
|
||||
_textDrawer.replaceDirect(_strData, _pos, _posEnd);
|
||||
if (tmpElement != NULL) {
|
||||
if (tmpElement != nullptr) {
|
||||
tmpElement->m_endPosAdded = (int64_t)_textDrawer.cursor();
|
||||
clearRedo(_data);
|
||||
_data.m_undo.push_back(tmpElement);
|
||||
@ -162,7 +162,7 @@ bool appl::TextPluginHistory::onRemove(appl::TextViewer& _textDrawer,
|
||||
return false;
|
||||
}
|
||||
appl::History *tmpElement = new appl::History();
|
||||
if (tmpElement != NULL) {
|
||||
if (tmpElement != nullptr) {
|
||||
tmpElement->m_addedText = "";
|
||||
tmpElement->m_posAdded = (int64_t)_pos;
|
||||
tmpElement->m_endPosAdded = tmpElement->m_posAdded;
|
||||
|
@ -79,7 +79,7 @@ void appl::textPluginManager::addDefaultPlugin() {
|
||||
}
|
||||
|
||||
void appl::textPluginManager::addPlugin(const ewol::object::Shared<appl::TextViewerPlugin>& _plugin) {
|
||||
if (_plugin == NULL) {
|
||||
if (_plugin == nullptr) {
|
||||
return;
|
||||
}
|
||||
getList().push_back(_plugin);
|
||||
@ -108,7 +108,7 @@ void appl::textPluginManager::addPlugin(const ewol::object::Shared<appl::TextVie
|
||||
|
||||
void appl::textPluginManager::connect(appl::TextViewer& _widget) {
|
||||
for (auto &it : getList()) {
|
||||
if (it == NULL) {
|
||||
if (it == nullptr) {
|
||||
continue;
|
||||
}
|
||||
it->onPluginEnable(_widget);
|
||||
@ -117,7 +117,7 @@ void appl::textPluginManager::connect(appl::TextViewer& _widget) {
|
||||
|
||||
void appl::textPluginManager::disconnect(appl::TextViewer& _widget) {
|
||||
for (auto &it : getList()) {
|
||||
if (it == NULL) {
|
||||
if (it == nullptr) {
|
||||
continue;
|
||||
}
|
||||
it->onPluginDisable(_widget);
|
||||
@ -127,7 +127,7 @@ void appl::textPluginManager::disconnect(appl::TextViewer& _widget) {
|
||||
bool appl::textPluginManager::onEventEntry(appl::TextViewer& _textDrawer,
|
||||
const ewol::event::Entry& _event) {
|
||||
for (auto &it : getListOnEventEntry()) {
|
||||
if (it == NULL) {
|
||||
if (it == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (it->onEventEntry(_textDrawer, _event) == true ) {
|
||||
@ -140,7 +140,7 @@ bool appl::textPluginManager::onEventEntry(appl::TextViewer& _textDrawer,
|
||||
bool appl::textPluginManager::onEventInput(appl::TextViewer& _textDrawer,
|
||||
const ewol::event::Input& _event) {
|
||||
for (auto &it : getListOnEventInput()) {
|
||||
if (it == NULL) {
|
||||
if (it == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (it->onEventInput(_textDrawer, _event) == true ) {
|
||||
@ -154,7 +154,7 @@ bool appl::textPluginManager::onWrite(appl::TextViewer& _textDrawer,
|
||||
const appl::Buffer::Iterator& _pos,
|
||||
const std::string& _data) {
|
||||
for (auto &it : getListOnWrite()) {
|
||||
if (it == NULL) {
|
||||
if (it == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (it->onWrite(_textDrawer, _pos, _data) == true ) {
|
||||
@ -169,7 +169,7 @@ bool appl::textPluginManager::onReplace(appl::TextViewer& _textDrawer,
|
||||
const std::string& _data,
|
||||
const appl::Buffer::Iterator& _posEnd) {
|
||||
for (auto &it : getListOnReplace()) {
|
||||
if (it == NULL) {
|
||||
if (it == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (it->onReplace(_textDrawer, _pos, _data, _posEnd) == true ) {
|
||||
@ -183,7 +183,7 @@ bool appl::textPluginManager::onRemove(appl::TextViewer& _textDrawer,
|
||||
const appl::Buffer::Iterator& _pos,
|
||||
const appl::Buffer::Iterator& _posEnd) {
|
||||
for (auto &it : getListOnRemove()) {
|
||||
if (it == NULL) {
|
||||
if (it == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (it->onRemove(_textDrawer, _pos, _posEnd) == true ) {
|
||||
@ -196,7 +196,7 @@ bool appl::textPluginManager::onRemove(appl::TextViewer& _textDrawer,
|
||||
bool appl::textPluginManager::onReceiveMessageViewer(appl::TextViewer& _textDrawer,
|
||||
const ewol::object::Message& _msg) {
|
||||
for (auto &it : getListonReceiveMessageViewer()) {
|
||||
if (it == NULL) {
|
||||
if (it == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (it->onReceiveMessageViewer(_textDrawer, _msg) == true ) {
|
||||
@ -209,7 +209,7 @@ bool appl::textPluginManager::onReceiveMessageViewer(appl::TextViewer& _textDraw
|
||||
bool appl::textPluginManager::onCursorMove(appl::TextViewer& _textDrawer,
|
||||
const appl::Buffer::Iterator& _pos) {
|
||||
for (auto &it : getListOnCursorMove()) {
|
||||
if (it == NULL) {
|
||||
if (it == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (it->onCursorMove(_textDrawer, _pos) == true ) {
|
||||
|
@ -138,7 +138,7 @@ static int growString (vstring *s)
|
||||
newLength = 2 * s->size;
|
||||
newLine = (char*) realloc (s->buffer, newLength);
|
||||
}
|
||||
if (newLine == NULL)
|
||||
if (newLine == nullptr)
|
||||
perror ("string too large");
|
||||
else
|
||||
{
|
||||
@ -154,13 +154,13 @@ static void copyName (tagFile *const file)
|
||||
{
|
||||
size_t length;
|
||||
const char *end = strchr (file->line.buffer, '\t');
|
||||
if (end == NULL)
|
||||
if (end == nullptr)
|
||||
{
|
||||
end = strchr (file->line.buffer, '\n');
|
||||
if (end == NULL)
|
||||
if (end == nullptr)
|
||||
end = strchr (file->line.buffer, '\r');
|
||||
}
|
||||
if (end != NULL)
|
||||
if (end != nullptr)
|
||||
length = end - file->line.buffer;
|
||||
else
|
||||
length = strlen (file->line.buffer);
|
||||
@ -189,7 +189,7 @@ static int readTagLineRaw (tagFile *const file)
|
||||
reReadLine = 0;
|
||||
*pLastChar = '\0';
|
||||
line = fgets (file->line.buffer, (int) file->line.size, file->fp);
|
||||
if (line == NULL)
|
||||
if (line == nullptr)
|
||||
{
|
||||
/* read error */
|
||||
if (! feof (file->fp))
|
||||
@ -236,7 +236,7 @@ static tagResult growFields (tagFile *const file)
|
||||
unsigned short newCount = (unsigned short) 2 * file->fields.max;
|
||||
tagExtensionField *newFields = (tagExtensionField*)
|
||||
realloc (file->fields.list, newCount * sizeof (tagExtensionField));
|
||||
if (newFields == NULL)
|
||||
if (newFields == nullptr)
|
||||
perror ("too many extension fields");
|
||||
else
|
||||
{
|
||||
@ -251,7 +251,7 @@ static void parseExtensionFields (tagFile *const file, tagEntry *const entry,
|
||||
char *const string)
|
||||
{
|
||||
char *p = string;
|
||||
while (p != NULL && *p != '\0')
|
||||
while (p != nullptr && *p != '\0')
|
||||
{
|
||||
while (*p == TAB)
|
||||
*p++ = '\0';
|
||||
@ -260,10 +260,10 @@ static void parseExtensionFields (tagFile *const file, tagEntry *const entry,
|
||||
char *colon;
|
||||
char *field = p;
|
||||
p = strchr (p, TAB);
|
||||
if (p != NULL)
|
||||
if (p != nullptr)
|
||||
*p++ = '\0';
|
||||
colon = strchr (field, ':');
|
||||
if (colon == NULL)
|
||||
if (colon == nullptr)
|
||||
entry->kind = field;
|
||||
else
|
||||
{
|
||||
@ -295,19 +295,19 @@ static void parseTagLine (tagFile *file, tagEntry *const entry)
|
||||
char *p = file->line.buffer;
|
||||
char *tab = strchr (p, TAB);
|
||||
|
||||
entry->fields.list = NULL;
|
||||
entry->fields.list = nullptr;
|
||||
entry->fields.count = 0;
|
||||
entry->kind = NULL;
|
||||
entry->kind = nullptr;
|
||||
entry->fileScope = 0;
|
||||
|
||||
entry->name = p;
|
||||
if (tab != NULL)
|
||||
if (tab != nullptr)
|
||||
{
|
||||
*tab = '\0';
|
||||
p = tab + 1;
|
||||
entry->file = p;
|
||||
tab = strchr (p, TAB);
|
||||
if (tab != NULL)
|
||||
if (tab != nullptr)
|
||||
{
|
||||
int fieldsPresent;
|
||||
*tab = '\0';
|
||||
@ -321,8 +321,8 @@ static void parseTagLine (tagFile *file, tagEntry *const entry)
|
||||
do
|
||||
{
|
||||
p = strchr (p + 1, delimiter);
|
||||
} while (p != NULL && *(p - 1) == '\\');
|
||||
if (p == NULL)
|
||||
} while (p != nullptr && *(p - 1) == '\\');
|
||||
if (p == nullptr)
|
||||
{
|
||||
/* invalid pattern */
|
||||
}
|
||||
@ -351,19 +351,19 @@ static void parseTagLine (tagFile *file, tagEntry *const entry)
|
||||
entry->fields.list = file->fields.list;
|
||||
for (i = entry->fields.count ; i < file->fields.max ; ++i)
|
||||
{
|
||||
file->fields.list [i].key = NULL;
|
||||
file->fields.list [i].value = NULL;
|
||||
file->fields.list [i].key = nullptr;
|
||||
file->fields.list [i].value = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
static char *duplicate (const char *str)
|
||||
{
|
||||
char *result = NULL;
|
||||
if (str != NULL)
|
||||
char *result = nullptr;
|
||||
if (str != nullptr)
|
||||
{
|
||||
result = strdup (str);
|
||||
if (result == NULL)
|
||||
perror (NULL);
|
||||
if (result == nullptr)
|
||||
perror (nullptr);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -372,14 +372,14 @@ static void readPseudoTags (tagFile *const file, tagFileInfo *const info)
|
||||
{
|
||||
fpos_t startOfLine;
|
||||
const size_t prefixLength = strlen (PseudoTagPrefix);
|
||||
if (info != NULL)
|
||||
if (info != nullptr)
|
||||
{
|
||||
info->file.format = 1;
|
||||
info->file.sort = TAG_UNSORTED;
|
||||
info->program.author = NULL;
|
||||
info->program.name = NULL;
|
||||
info->program.url = NULL;
|
||||
info->program.version = NULL;
|
||||
info->program.author = nullptr;
|
||||
info->program.name = nullptr;
|
||||
info->program.url = nullptr;
|
||||
info->program.version = nullptr;
|
||||
}
|
||||
while (1)
|
||||
{
|
||||
@ -407,7 +407,7 @@ static void readPseudoTags (tagFile *const file, tagFileInfo *const info)
|
||||
file->program.url = duplicate (value);
|
||||
else if (strcmp (key, "TAG_PROGRAM_VERSION") == 0)
|
||||
file->program.version = duplicate (value);
|
||||
if (info != NULL)
|
||||
if (info != nullptr)
|
||||
{
|
||||
info->file.format = file->format;
|
||||
info->file.sort = file->sortMethod;
|
||||
@ -440,7 +440,7 @@ static void gotoFirstLogicalTag (tagFile *const file)
|
||||
static tagFile *initialize (const char *const filePath, tagFileInfo *const info)
|
||||
{
|
||||
tagFile *result = (tagFile*) calloc ((size_t) 1, sizeof (tagFile));
|
||||
if (result != NULL)
|
||||
if (result != nullptr)
|
||||
{
|
||||
growString (&result->line);
|
||||
growString (&result->name);
|
||||
@ -448,10 +448,10 @@ static tagFile *initialize (const char *const filePath, tagFileInfo *const info)
|
||||
result->fields.list = (tagExtensionField*) calloc (
|
||||
result->fields.max, sizeof (tagExtensionField));
|
||||
result->fp = fopen (filePath, "r");
|
||||
if (result->fp == NULL)
|
||||
if (result->fp == nullptr)
|
||||
{
|
||||
free (result);
|
||||
result = NULL;
|
||||
result = nullptr;
|
||||
info->status.error_number = errno;
|
||||
}
|
||||
else
|
||||
@ -475,15 +475,15 @@ static void terminate (tagFile *const file)
|
||||
free (file->name.buffer);
|
||||
free (file->fields.list);
|
||||
|
||||
if (file->program.author != NULL)
|
||||
if (file->program.author != nullptr)
|
||||
free (file->program.author);
|
||||
if (file->program.name != NULL)
|
||||
if (file->program.name != nullptr)
|
||||
free (file->program.name);
|
||||
if (file->program.url != NULL)
|
||||
if (file->program.url != nullptr)
|
||||
free (file->program.url);
|
||||
if (file->program.version != NULL)
|
||||
if (file->program.version != nullptr)
|
||||
free (file->program.version);
|
||||
if (file->search.name != NULL)
|
||||
if (file->search.name != nullptr)
|
||||
free (file->search.name);
|
||||
|
||||
memset (file, 0, sizeof (tagFile));
|
||||
@ -494,13 +494,13 @@ static void terminate (tagFile *const file)
|
||||
static tagResult readNext (tagFile *const file, tagEntry *const entry)
|
||||
{
|
||||
tagResult result;
|
||||
if (file == NULL || ! file->initialized)
|
||||
if (file == nullptr || ! file->initialized)
|
||||
result = TagFailure;
|
||||
else if (! readTagLine (file))
|
||||
result = TagFailure;
|
||||
else
|
||||
{
|
||||
if (entry != NULL)
|
||||
if (entry != nullptr)
|
||||
parseTagLine (file, entry);
|
||||
result = TagSuccess;
|
||||
}
|
||||
@ -510,13 +510,13 @@ static tagResult readNext (tagFile *const file, tagEntry *const entry)
|
||||
static const char *readFieldValue (
|
||||
const tagEntry *const entry, const char *const key)
|
||||
{
|
||||
const char *result = NULL;
|
||||
const char *result = nullptr;
|
||||
int i;
|
||||
if (strcmp (key, "kind") == 0)
|
||||
result = entry->kind;
|
||||
else if (strcmp (key, "file") == 0)
|
||||
result = EmptyString;
|
||||
else for (i = 0 ; i < entry->fields.count && result == NULL ; ++i)
|
||||
else for (i = 0 ; i < entry->fields.count && result == nullptr ; ++i)
|
||||
if (strcmp (entry->fields.list [i].key, key) == 0)
|
||||
result = entry->fields.list [i].value;
|
||||
return result;
|
||||
@ -650,7 +650,7 @@ static tagResult find (tagFile *const file, tagEntry *const entry,
|
||||
const char *const name, const int options)
|
||||
{
|
||||
tagResult result;
|
||||
if (file->search.name != NULL)
|
||||
if (file->search.name != nullptr)
|
||||
free (file->search.name);
|
||||
file->search.name = duplicate (name);
|
||||
file->search.nameLength = strlen (name);
|
||||
@ -680,7 +680,7 @@ static tagResult find (tagFile *const file, tagEntry *const entry,
|
||||
else
|
||||
{
|
||||
file->search.pos = file->pos;
|
||||
if (entry != NULL)
|
||||
if (entry != nullptr)
|
||||
parseTagLine (file, entry);
|
||||
}
|
||||
return result;
|
||||
@ -699,7 +699,7 @@ static tagResult findNext (tagFile *const file, tagEntry *const entry)
|
||||
else
|
||||
{
|
||||
result = findSequential (file);
|
||||
if (result == TagSuccess && entry != NULL)
|
||||
if (result == TagSuccess && entry != nullptr)
|
||||
parseTagLine (file, entry);
|
||||
}
|
||||
return result;
|
||||
@ -717,7 +717,7 @@ extern tagFile *tagsOpen (const char *const filePath, tagFileInfo *const info)
|
||||
extern tagResult tagsSetSortType (tagFile *const file, const sortType type)
|
||||
{
|
||||
tagResult result = TagFailure;
|
||||
if (file != NULL && file->initialized)
|
||||
if (file != nullptr && file->initialized)
|
||||
{
|
||||
file->sortMethod = type;
|
||||
result = TagSuccess;
|
||||
@ -728,7 +728,7 @@ extern tagResult tagsSetSortType (tagFile *const file, const sortType type)
|
||||
extern tagResult tagsFirst (tagFile *const file, tagEntry *const entry)
|
||||
{
|
||||
tagResult result = TagFailure;
|
||||
if (file != NULL && file->initialized)
|
||||
if (file != nullptr && file->initialized)
|
||||
{
|
||||
gotoFirstLogicalTag (file);
|
||||
result = readNext (file, entry);
|
||||
@ -739,15 +739,15 @@ extern tagResult tagsFirst (tagFile *const file, tagEntry *const entry)
|
||||
extern tagResult tagsNext (tagFile *const file, tagEntry *const entry)
|
||||
{
|
||||
tagResult result = TagFailure;
|
||||
if (file != NULL && file->initialized)
|
||||
if (file != nullptr && file->initialized)
|
||||
result = readNext (file, entry);
|
||||
return result;
|
||||
}
|
||||
|
||||
extern const char *tagsField (const tagEntry *const entry, const char *const key)
|
||||
{
|
||||
const char *result = NULL;
|
||||
if (entry != NULL)
|
||||
const char *result = nullptr;
|
||||
if (entry != nullptr)
|
||||
result = readFieldValue (entry, key);
|
||||
return result;
|
||||
}
|
||||
@ -756,7 +756,7 @@ extern tagResult tagsFind (tagFile *const file, tagEntry *const entry,
|
||||
const char *const name, const int options)
|
||||
{
|
||||
tagResult result = TagFailure;
|
||||
if (file != NULL && file->initialized)
|
||||
if (file != nullptr && file->initialized)
|
||||
result = find (file, entry, name, options);
|
||||
return result;
|
||||
}
|
||||
@ -764,7 +764,7 @@ extern tagResult tagsFind (tagFile *const file, tagEntry *const entry,
|
||||
extern tagResult tagsFindNext (tagFile *const file, tagEntry *const entry)
|
||||
{
|
||||
tagResult result = TagFailure;
|
||||
if (file != NULL && file->initialized)
|
||||
if (file != nullptr && file->initialized)
|
||||
result = findNext (file, entry);
|
||||
return result;
|
||||
}
|
||||
@ -772,7 +772,7 @@ extern tagResult tagsFindNext (tagFile *const file, tagEntry *const entry)
|
||||
extern tagResult tagsClose (tagFile *const file)
|
||||
{
|
||||
tagResult result = TagFailure;
|
||||
if (file != NULL && file->initialized)
|
||||
if (file != nullptr && file->initialized)
|
||||
{
|
||||
terminate (file);
|
||||
result = TagSuccess;
|
||||
@ -804,7 +804,7 @@ static void printTag (const tagEntry *entry)
|
||||
entry->name, entry->file, entry->address.pattern);
|
||||
if (extensionFields)
|
||||
{
|
||||
if (entry->kind != NULL && entry->kind [0] != '\0')
|
||||
if (entry->kind != nullptr && entry->kind [0] != '\0')
|
||||
printf ("%s\tkind:%s", sep, entry->kind);
|
||||
if (entry->fileScope)
|
||||
printf ("%s\tfile:", sep);
|
||||
@ -825,7 +825,7 @@ static void findTag (const char *const name, const int options)
|
||||
tagFileInfo info;
|
||||
tagEntry entry;
|
||||
tagFile *const file = tagsOpen (TagFileName, &info);
|
||||
if (file == NULL)
|
||||
if (file == nullptr)
|
||||
{
|
||||
fprintf (stderr, "%s: cannot open tag file: %s: %s\n",
|
||||
ProgramName, strerror (info.status.error_number), name);
|
||||
@ -851,7 +851,7 @@ static void listTags ()
|
||||
tagFileInfo info;
|
||||
tagEntry entry;
|
||||
tagFile *const file = tagsOpen (TagFileName, &info);
|
||||
if (file == NULL)
|
||||
if (file == nullptr)
|
||||
{
|
||||
fprintf (stderr, "%s: cannot open tag file: %s: %s\n",
|
||||
ProgramName, strerror (info.status.error_number), TagFileName);
|
||||
@ -927,7 +927,7 @@ extern int main (int argc, char **argv)
|
||||
++j;
|
||||
if (arg [j] == '\0')
|
||||
SortMethod = TAG_SORTED;
|
||||
else if (strchr ("012", arg[j]) != NULL)
|
||||
else if (strchr ("012", arg[j]) != nullptr)
|
||||
SortMethod = (sortType) (arg[j] - '0');
|
||||
else
|
||||
{
|
||||
|
@ -114,7 +114,7 @@ typedef struct {
|
||||
/* address for locating tag in source file */
|
||||
struct {
|
||||
/* pattern for locating source line
|
||||
* (may be NULL if not present) */
|
||||
* (may be nullptr if not present) */
|
||||
const char *pattern;
|
||||
|
||||
/* line number in source file of tag definition
|
||||
@ -122,7 +122,7 @@ typedef struct {
|
||||
unsigned long lineNumber;
|
||||
} address;
|
||||
|
||||
/* kind of tag (may by name, character, or NULL if not known) */
|
||||
/* kind of tag (may by name, character, or nullptr if not known) */
|
||||
const char *kind;
|
||||
|
||||
/* is tag of file-limited scope? */
|
||||
|
@ -35,10 +35,10 @@ class myParamGlobal : public ewol::Object {
|
||||
m_AutoIndent = true;
|
||||
m_displayTabChar = true;
|
||||
m_displaySpaceChar = true;
|
||||
registerConfig(configEOL, "bool", NULL, "Display end of line character");
|
||||
registerConfig(configAutoIndent, "bool", NULL, "Auto indent when create new line");
|
||||
registerConfig(configShowTabChar, "bool", NULL, "Display the Tab char");
|
||||
registerConfig(configShowSpaceChar, "bool", NULL, "Display the space char");
|
||||
registerConfig(configEOL, "bool", nullptr, "Display end of line character");
|
||||
registerConfig(configAutoIndent, "bool", nullptr, "Auto indent when create new line");
|
||||
registerConfig(configShowTabChar, "bool", nullptr, "Display the Tab char");
|
||||
registerConfig(configShowSpaceChar, "bool", nullptr, "Display the space char");
|
||||
}
|
||||
|
||||
bool onSetConfig(const ewol::object::Config& _conf) {
|
||||
@ -181,18 +181,18 @@ static const char * const l_changeRounded = "edn-event-change-rounded";
|
||||
|
||||
globals::ParameterGlobalsGui::ParameterGlobalsGui() :
|
||||
ewol::widget::Sizer(ewol::widget::Sizer::modeVert) {
|
||||
ewol::widget::CheckBox* myCheckbox = NULL;
|
||||
ewol::widget::Spacer* mySpacer = NULL;
|
||||
ewol::widget::CheckBox* myCheckbox = nullptr;
|
||||
ewol::widget::Spacer* mySpacer = nullptr;
|
||||
|
||||
mySpacer = new ewol::widget::Spacer();
|
||||
if (NULL == mySpacer) {
|
||||
if (nullptr == mySpacer) {
|
||||
APPL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
mySpacer->setExpand(bvec2(true,true));
|
||||
subWidgetAdd(mySpacer);
|
||||
}
|
||||
myCheckbox = new ewol::widget::CheckBox("Automatic Indentation");
|
||||
if (NULL == myCheckbox) {
|
||||
if (nullptr == myCheckbox) {
|
||||
APPL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
myCheckbox->setExpand(bvec2(true,false));
|
||||
@ -201,7 +201,7 @@ globals::ParameterGlobalsGui::ParameterGlobalsGui() :
|
||||
subWidgetAdd(myCheckbox);
|
||||
}
|
||||
myCheckbox = new ewol::widget::CheckBox("Display space char (' ')");
|
||||
if (NULL == myCheckbox) {
|
||||
if (nullptr == myCheckbox) {
|
||||
APPL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
myCheckbox->setExpand(bvec2(true,false));
|
||||
@ -210,7 +210,7 @@ globals::ParameterGlobalsGui::ParameterGlobalsGui() :
|
||||
subWidgetAdd(myCheckbox);
|
||||
}
|
||||
myCheckbox = new ewol::widget::CheckBox("Display tabulation char ('\\t')");
|
||||
if (NULL == myCheckbox) {
|
||||
if (nullptr == myCheckbox) {
|
||||
APPL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
myCheckbox->setExpand(bvec2(true,false));
|
||||
@ -219,7 +219,7 @@ globals::ParameterGlobalsGui::ParameterGlobalsGui() :
|
||||
subWidgetAdd(myCheckbox);
|
||||
}
|
||||
myCheckbox = new ewol::widget::CheckBox("Display end of line ('\\n')");
|
||||
if (NULL == myCheckbox) {
|
||||
if (nullptr == myCheckbox) {
|
||||
APPL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
myCheckbox->setExpand(bvec2(true,false));
|
||||
@ -228,7 +228,7 @@ globals::ParameterGlobalsGui::ParameterGlobalsGui() :
|
||||
subWidgetAdd(myCheckbox);
|
||||
}
|
||||
myCheckbox = new ewol::widget::CheckBox("switch Rounded/default");
|
||||
if (NULL == myCheckbox) {
|
||||
if (nullptr == myCheckbox) {
|
||||
APPL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
myCheckbox->setExpand(bvec2(true,false));
|
||||
|
Loading…
x
Reference in New Issue
Block a user