[DEV] update etk null

This commit is contained in:
Edouard DUPIN 2018-06-19 22:31:29 +02:00
parent 9305207371
commit dc8f8429fc
26 changed files with 280 additions and 280 deletions

View File

@ -16,7 +16,7 @@ appl::Buffer::Iterator& appl::Buffer::Iterator::operator++ () {
m_current = 0; m_current = 0;
return *this; return *this;
} }
if (m_data != nullptr) { if (m_data != null) {
if (m_current < (int64_t)m_data->m_data.size() ) { if (m_current < (int64_t)m_data->m_data.size() ) {
int8_t nbChar = utf8::length(m_data->m_data[m_current]); int8_t nbChar = utf8::length(m_data->m_data[m_current]);
if (nbChar != 0) { if (nbChar != 0) {
@ -34,7 +34,7 @@ appl::Buffer::Iterator& appl::Buffer::Iterator::operator++ () {
appl::Buffer::Iterator& appl::Buffer::Iterator::operator-- () { appl::Buffer::Iterator& appl::Buffer::Iterator::operator-- () {
m_value = u32char::Null; m_value = u32char::Null;
if (m_data != nullptr) { if (m_data != null) {
if (m_current > 0) { if (m_current > 0) {
int32_t iii = -1; int32_t iii = -1;
while( utf8::first(m_data->m_data[m_current+iii]) == false while( utf8::first(m_data->m_data[m_current+iii]) == false
@ -57,7 +57,7 @@ char32_t appl::Buffer::Iterator::operator* () {
if (m_value != u32char::Null) { if (m_value != u32char::Null) {
return m_value; return m_value;
} }
if (m_data == nullptr) { if (m_data == null) {
APPL_ERROR("request an element that iterator not link"); APPL_ERROR("request an element that iterator not link");
return m_value; return m_value;
} }
@ -119,7 +119,7 @@ appl::Buffer::Buffer() :
m_cursorSelectPos(-1), m_cursorSelectPos(-1),
m_cursorPreferredCol(-1), m_cursorPreferredCol(-1),
m_nbLines(1), m_nbLines(1),
m_highlight(nullptr) { m_highlight(null) {
addObjectType("appl::Buffer"); addObjectType("appl::Buffer");
static int32_t bufferBaseId = 0; static int32_t bufferBaseId = 0;
m_fileName = "No Name " + etk::toString(bufferBaseId); m_fileName = "No Name " + etk::toString(bufferBaseId);
@ -700,7 +700,7 @@ void appl::Buffer::setHighlightType(const etk::String& _type) {
void appl::Buffer::regenerateHighLightAt(int64_t _pos, int64_t _nbDeleted, int64_t _nbAdded) { void appl::Buffer::regenerateHighLightAt(int64_t _pos, int64_t _nbDeleted, int64_t _nbAdded) {
// prevent ERROR... // prevent ERROR...
if (m_highlight == nullptr) { if (m_highlight == null) {
return; return;
} }
// prevent No data Call // prevent No data Call
@ -874,7 +874,7 @@ void appl::Buffer::findMainHighLightPosition(int64_t _startPos,
} }
void appl::Buffer::generateHighLightAt(int64_t _pos, int64_t _endPos, int64_t _addingPos) { void appl::Buffer::generateHighLightAt(int64_t _pos, int64_t _endPos, int64_t _addingPos) {
if (m_highlight == nullptr) { if (m_highlight == null) {
return; return;
} }
//APPL_DEBUG("area : (" << _pos << "," << _endPos << ") insert at : " << _addingPos); //APPL_DEBUG("area : (" << _pos << "," << _endPos << ") insert at : " << _addingPos);
@ -896,17 +896,17 @@ appl::HighlightInfo* appl::Buffer::getElementColorAtPosition(int64_t _pos, int64
return &m_HLDataPass1[iii]; return &m_HLDataPass1[iii];
} }
if(m_HLDataPass1[iii].start > _pos) { if(m_HLDataPass1[iii].start > _pos) {
return nullptr; return null;
} }
} }
return nullptr; return null;
} }
void appl::Buffer::hightlightGenerateLines(appl::DisplayHLData& _MData, const appl::Buffer::Iterator& _HLStart, int64_t _nbLines) { void appl::Buffer::hightlightGenerateLines(appl::DisplayHLData& _MData, const appl::Buffer::Iterator& _HLStart, int64_t _nbLines) {
_MData.posHLPass1 = 0; _MData.posHLPass1 = 0;
_MData.posHLPass2 = 0; _MData.posHLPass2 = 0;
if (m_highlight == nullptr) { if (m_highlight == null) {
return; return;
} }
//int64_t timeStart = ewol::getTime(); //int64_t timeStart = ewol::getTime();
@ -1012,7 +1012,7 @@ uint32_t appl::Buffer::getCursorLinesId() {
namespace etk { namespace etk {
template<> etk::String toString<ememory::SharedPtr<appl::Buffer>>(const ememory::SharedPtr<appl::Buffer>& _obj) { template<> etk::String toString<ememory::SharedPtr<appl::Buffer>>(const ememory::SharedPtr<appl::Buffer>& _obj) {
if (_obj != nullptr) { if (_obj != null) {
return _obj->getFileName(); return _obj->getFileName();
} }
return ""; return "";
@ -1022,7 +1022,7 @@ namespace etk {
} }
template<> bool from_string<ememory::SharedPtr<appl::Buffer>>(ememory::SharedPtr<appl::Buffer>& _variableRet, const etk::String& _value) { template<> bool from_string<ememory::SharedPtr<appl::Buffer>>(ememory::SharedPtr<appl::Buffer>& _variableRet, const etk::String& _value) {
if (_variableRet != nullptr) { if (_variableRet != null) {
_variableRet->loadFile(_value); _variableRet->loadFile(_value);
return true; return true;
} }

View File

@ -40,7 +40,7 @@ namespace appl {
*/ */
Iterator(): Iterator():
m_current(0), m_current(0),
m_data(nullptr), m_data(null),
m_value(u32char::Null) { m_value(u32char::Null) {
// nothing to do ... // nothing to do ...
}; };
@ -70,7 +70,7 @@ namespace appl {
*/ */
virtual ~Iterator() { virtual ~Iterator() {
m_current = 0; m_current = 0;
m_data = nullptr; m_data = null;
m_value = u32char::Null; m_value = u32char::Null;
}; };
/** /**
@ -78,7 +78,7 @@ namespace appl {
* @return true if the element is present in buffer * @return true if the element is present in buffer
*/ */
operator bool () const { operator bool () const {
if (m_data == nullptr) { if (m_data == null) {
return false; return false;
} }
if (m_current >= (int64_t)m_data->m_data.size()) { if (m_current >= (int64_t)m_data->m_data.size()) {
@ -94,7 +94,7 @@ namespace appl {
* @return true if the element is present in buffer * @return true if the element is present in buffer
*/ */
operator int64_t () const { operator int64_t () const {
if (m_data == nullptr) { if (m_data == null) {
return 0; return 0;
} }
if (m_current < 0) { if (m_current < 0) {
@ -217,7 +217,7 @@ namespace appl {
* @return The requested position. * @return The requested position.
*/ */
int64_t getPos() const { int64_t getPos() const {
if (m_data == nullptr) { if (m_data == null) {
return 0; return 0;
} }
if (m_current < 0) { if (m_current < 0) {

View File

@ -28,9 +28,9 @@ appl::BufferManager::~BufferManager() {
ememory::SharedPtr<appl::Buffer> appl::BufferManager::createNewBuffer() { ememory::SharedPtr<appl::Buffer> appl::BufferManager::createNewBuffer() {
ememory::SharedPtr<appl::Buffer> tmp = appl::Buffer::create(); ememory::SharedPtr<appl::Buffer> tmp = appl::Buffer::create();
if (tmp == nullptr) { if (tmp == null) {
APPL_ERROR("Can not allocate the Buffer (empty)."); APPL_ERROR("Can not allocate the Buffer (empty).");
return nullptr; return null;
} }
tmp->setParent(ewol::Object::sharedFromThis()); tmp->setParent(ewol::Object::sharedFromThis());
m_list.pushBack(tmp); m_list.pushBack(tmp);
@ -46,7 +46,7 @@ ememory::SharedPtr<appl::Buffer> appl::BufferManager::createNewBuffer() {
ememory::SharedPtr<appl::Buffer> appl::BufferManager::get(const etk::String& _fileName, bool _createIfNeeded) { ememory::SharedPtr<appl::Buffer> appl::BufferManager::get(const etk::String& _fileName, bool _createIfNeeded) {
APPL_INFO("get('" << _fileName << "'," << _createIfNeeded << ")"); APPL_INFO("get('" << _fileName << "'," << _createIfNeeded << ")");
for (auto &it : m_list) { for (auto &it : m_list) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
if (it->getFileName() == _fileName) { if (it->getFileName() == _fileName) {
@ -57,12 +57,12 @@ ememory::SharedPtr<appl::Buffer> appl::BufferManager::get(const etk::String& _fi
if (etk::FSNodeGetType(_fileName) == etk::typeNode_folder) { if (etk::FSNodeGetType(_fileName) == etk::typeNode_folder) {
APPL_WARNING("try open a folder : " << _fileName); APPL_WARNING("try open a folder : " << _fileName);
APPL_CRITICAL("plop"); APPL_CRITICAL("plop");
return nullptr; return null;
} }
ememory::SharedPtr<appl::Buffer> tmp = appl::Buffer::create(); ememory::SharedPtr<appl::Buffer> tmp = appl::Buffer::create();
if (tmp == nullptr) { if (tmp == null) {
APPL_ERROR("Can not allocate the Buffer class : " << _fileName); APPL_ERROR("Can not allocate the Buffer class : " << _fileName);
return nullptr; return null;
} }
tmp->setParent(ewol::Object::sharedFromThis()); tmp->setParent(ewol::Object::sharedFromThis());
tmp->loadFile(_fileName); tmp->loadFile(_fileName);
@ -72,12 +72,12 @@ ememory::SharedPtr<appl::Buffer> appl::BufferManager::get(const etk::String& _fi
APPL_INFO("Creata a open Buffer (done)"); APPL_INFO("Creata a open Buffer (done)");
return tmp; return tmp;
} }
return nullptr; return null;
} }
void appl::BufferManager::setBufferSelected(ememory::SharedPtr<appl::Buffer> _bufferSelected) { void appl::BufferManager::setBufferSelected(ememory::SharedPtr<appl::Buffer> _bufferSelected) {
m_bufferSelected = _bufferSelected; m_bufferSelected = _bufferSelected;
if (m_bufferSelected == nullptr) { if (m_bufferSelected == null) {
APPL_ERROR("select a NULL buffer ..."); APPL_ERROR("select a NULL buffer ...");
propertySetOnWidgetNamed("appl-widget-display-name", "value", "---"); propertySetOnWidgetNamed("appl-widget-display-name", "value", "---");
return; return;
@ -101,7 +101,7 @@ ememory::SharedPtr<appl::Buffer> appl::BufferManager::get(int32_t _id) {
bool appl::BufferManager::exist(const etk::String& _fileName) { bool appl::BufferManager::exist(const etk::String& _fileName) {
for (auto &it : m_list) { for (auto &it : m_list) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
if (it->getFileName() == _fileName) { if (it->getFileName() == _fileName) {
@ -120,7 +120,7 @@ void appl::BufferManager::open(const etk::String& _fileName) {
propertySetOnWidgetNamed("appl-widget-display-name", "value", etk::FSNodeGetRealName(fileName)); propertySetOnWidgetNamed("appl-widget-display-name", "value", etk::FSNodeGetRealName(fileName));
return; return;
} }
if (get(fileName, true) == nullptr) { if (get(fileName, true) == null) {
APPL_ERROR("Error get '" << fileName << "' ... "); APPL_ERROR("Error get '" << fileName << "' ... ");
return; return;
} }
@ -134,7 +134,7 @@ void appl::BufferManager::requestDestroyFromChild(const ememory::SharedPtr<Objec
int32_t newValue = -1; int32_t newValue = -1;
auto it = m_list.begin(); auto it = m_list.begin();
while(it != m_list.end()) { while(it != m_list.end()) {
if (*it == nullptr) { if (*it == null) {
it = m_list.erase(it); it = m_list.erase(it);
continue; continue;
} }
@ -151,7 +151,7 @@ void appl::BufferManager::requestDestroyFromChild(const ememory::SharedPtr<Objec
} }
if (m_bufferSelected == _child) { if (m_bufferSelected == _child) {
if ( it != m_list.end() if ( it != m_list.end()
&& *it != nullptr) { && *it != null) {
APPL_VERBOSE("Remove buffer select new one"); APPL_VERBOSE("Remove buffer select new one");
signalSelectFile.emit((*it)->getFileName()); signalSelectFile.emit((*it)->getFileName());
propertySetOnWidgetNamed("appl-widget-display-name", "value", etk::FSNodeGetRealName((*it)->getFileName())); propertySetOnWidgetNamed("appl-widget-display-name", "value", etk::FSNodeGetRealName((*it)->getFileName()));
@ -159,7 +159,7 @@ void appl::BufferManager::requestDestroyFromChild(const ememory::SharedPtr<Objec
return; return;
} }
if ( m_list.size() != 0 if ( m_list.size() != 0
&& m_list.back() != nullptr) { && m_list.back() != null) {
APPL_VERBOSE("Remove buffer select new one (last)"); APPL_VERBOSE("Remove buffer select new one (last)");
signalSelectFile.emit(m_list.back()->getFileName()); signalSelectFile.emit(m_list.back()->getFileName());
propertySetOnWidgetNamed("appl-widget-display-name", "value", etk::FSNodeGetRealName(m_list.back()->getFileName())); propertySetOnWidgetNamed("appl-widget-display-name", "value", etk::FSNodeGetRealName(m_list.back()->getFileName()));
@ -168,7 +168,7 @@ void appl::BufferManager::requestDestroyFromChild(const ememory::SharedPtr<Objec
} }
signalSelectFile.emit(""); signalSelectFile.emit("");
propertySetOnWidgetNamed("appl-widget-display-name", "value", "---"); propertySetOnWidgetNamed("appl-widget-display-name", "value", "---");
m_bufferSelected = nullptr; m_bufferSelected = null;
} }
} }

View File

@ -62,7 +62,7 @@ namespace appl {
ememory::SharedPtr<appl::Buffer> get(int32_t _id); ememory::SharedPtr<appl::Buffer> get(int32_t _id);
/** /**
* @brief Create a new buffer empty. * @brief Create a new buffer empty.
* @return Created buffer or nullptr. * @return Created buffer or null.
*/ */
ememory::SharedPtr<appl::Buffer> createNewBuffer(); ememory::SharedPtr<appl::Buffer> createNewBuffer();
private: private:

View File

@ -49,7 +49,7 @@ void BufferView::init() {
ewol::widget::List::init(); ewol::widget::List::init();
propertyHide.set(true); propertyHide.set(true);
propertyCanFocus.set(true); propertyCanFocus.set(true);
if (m_bufferManager != nullptr) { if (m_bufferManager != null) {
m_bufferManager->signalNewBuffer.connect(sharedFromThis(), &BufferView::onCallbackNewBuffer); m_bufferManager->signalNewBuffer.connect(sharedFromThis(), &BufferView::onCallbackNewBuffer);
m_bufferManager->signalSelectFile.connect(sharedFromThis(), &BufferView::onCallbackselectNewFile); m_bufferManager->signalSelectFile.connect(sharedFromThis(), &BufferView::onCallbackselectNewFile);
m_bufferManager->signalRemoveBuffer.connect(sharedFromThis(), &BufferView::onCallbackBufferRemoved); m_bufferManager->signalRemoveBuffer.connect(sharedFromThis(), &BufferView::onCallbackBufferRemoved);
@ -94,7 +94,7 @@ void BufferView::insertAlphabetic(const appl::dataBufferStruct& _dataStruct, boo
void BufferView::onCallbackNewBuffer(const etk::String& _value) { void BufferView::onCallbackNewBuffer(const etk::String& _value) {
ememory::SharedPtr<appl::Buffer> buffer = m_bufferManager->get(_value); ememory::SharedPtr<appl::Buffer> buffer = m_bufferManager->get(_value);
if (buffer == nullptr) { if (buffer == null) {
APPL_ERROR("event on element nor exist : " << _value); APPL_ERROR("event on element nor exist : " << _value);
return; return;
} }
@ -121,7 +121,7 @@ void BufferView::onCallbackNewBuffer(const etk::String& _value) {
void BufferView::onCallbackselectNewFile(const etk::String& _value) { void BufferView::onCallbackselectNewFile(const etk::String& _value) {
m_selectedID = -1; m_selectedID = -1;
for (size_t iii=0; iii<m_list.size(); iii++) { for (size_t iii=0; iii<m_list.size(); iii++) {
if (m_list[iii].m_buffer == nullptr) { if (m_list[iii].m_buffer == null) {
continue; continue;
} }
if (m_list[iii].m_buffer->getFileName() != _value) { if (m_list[iii].m_buffer->getFileName() != _value) {
@ -196,7 +196,7 @@ bool BufferView::getElement(int32_t _colomn, int32_t _raw, etk::String& _myTextT
&& _raw<(int64_t)m_list.size() ) { && _raw<(int64_t)m_list.size() ) {
_myTextToWrite = m_list[_raw].m_bufferName.getNameFile(); _myTextToWrite = m_list[_raw].m_bufferName.getNameFile();
if ( m_list[_raw].m_buffer != nullptr if ( m_list[_raw].m_buffer != null
&& m_list[_raw].m_buffer->isModify() == false) { && m_list[_raw].m_buffer->isModify() == false) {
_fg = (*m_paintingProperties)[m_colorTextNormal].getForeground(); _fg = (*m_paintingProperties)[m_colorTextNormal].getForeground();
} else { } else {
@ -222,8 +222,8 @@ bool BufferView::onItemEvent(int32_t _IdInput, enum gale::key::status _typeEvent
APPL_INFO("Event on List : IdInput=" << _IdInput << " colomn=" << _colomn << " raw=" << _raw ); APPL_INFO("Event on List : IdInput=" << _IdInput << " colomn=" << _colomn << " raw=" << _raw );
if( _raw >= 0 if( _raw >= 0
&& _raw<(int64_t)m_list.size()) { && _raw<(int64_t)m_list.size()) {
if (m_list[_raw].m_buffer != nullptr) { if (m_list[_raw].m_buffer != null) {
if (m_bufferManager != nullptr) { if (m_bufferManager != null) {
APPL_INFO("Select file :" << m_list[_raw].m_buffer->getFileName() << " in list"); APPL_INFO("Select file :" << m_list[_raw].m_buffer->getFileName() << " in list");
m_bufferManager->open(m_list[_raw].m_buffer->getFileName()); m_bufferManager->open(m_list[_raw].m_buffer->getFileName());
} }

View File

@ -53,7 +53,7 @@ class ParameterAboutGui : public ewol::widget::Sizer {
ememory::SharedPtr<ewol::widget::Spacer> mySpacer; ememory::SharedPtr<ewol::widget::Spacer> mySpacer;
mySpacer = ewol::widget::Spacer::create(); mySpacer = ewol::widget::Spacer::create();
if (mySpacer == nullptr) { if (mySpacer == null) {
APPL_ERROR("Can not allocate widget == > display might be in error"); APPL_ERROR("Can not allocate widget == > display might be in error");
} else { } else {
mySpacer->propertyExpand.set(bvec2(true,true)); mySpacer->propertyExpand.set(bvec2(true,true));
@ -72,7 +72,7 @@ class ParameterAboutGui : public ewol::widget::Sizer {
tmpLabel += " tinyXml, freetype, agg2.4, etk<br/>"; tmpLabel += " tinyXml, freetype, agg2.4, etk<br/>";
tmpLabel += "</left>"; tmpLabel += "</left>";
ememory::SharedPtr<ewol::widget::Label> myLabel = ewol::widget::Label::create(); ememory::SharedPtr<ewol::widget::Label> myLabel = ewol::widget::Label::create();
if (myLabel == nullptr) { if (myLabel == null) {
APPL_ERROR("Can not allocate widget == > display might be in error"); APPL_ERROR("Can not allocate widget == > display might be in error");
} else { } else {
myLabel->propertyValue.set(tmpLabel); myLabel->propertyValue.set(tmpLabel);
@ -251,7 +251,7 @@ void MainWindows::onCallbackShortCut(const etk::String& _value) {
void MainWindows::onCallbackMenuEvent(const etk::String& _value) { void MainWindows::onCallbackMenuEvent(const etk::String& _value) {
APPL_WARNING("Event from Menu : " << _value); APPL_WARNING("Event from Menu : " << _value);
if (_value == "menu:new") { if (_value == "menu:new") {
if (m_bufferManager != nullptr) { if (m_bufferManager != null) {
m_bufferManager->createNewBuffer(); m_bufferManager->createNewBuffer();
} }
} else if (_value == "menu:exit") { } else if (_value == "menu:exit") {
@ -272,7 +272,7 @@ void MainWindows::onCallbackMenuEvent(const etk::String& _value) {
} else if (_value == "menu:property") { } else if (_value == "menu:property") {
displayProperty(); displayProperty();
} else if (_value == "menu:search") { } else if (_value == "menu:search") {
if (m_widgetSearch == nullptr) { if (m_widgetSearch == null) {
return; return;
} }
if (m_widgetSearch->propertyHide.get() == true) { if (m_widgetSearch->propertyHide.get() == true) {
@ -281,9 +281,9 @@ void MainWindows::onCallbackMenuEvent(const etk::String& _value) {
} else { } else {
if (m_widgetSearch->isSelectSearch()) { if (m_widgetSearch->isSelectSearch()) {
m_widgetSearch->propertyHide.set(true); m_widgetSearch->propertyHide.set(true);
if (m_viewerManager != nullptr) { if (m_viewerManager != null) {
ememory::SharedPtr<appl::TextViewer> tmp = m_viewerManager->getViewerSelected(); ememory::SharedPtr<appl::TextViewer> tmp = m_viewerManager->getViewerSelected();
if (tmp != nullptr) { if (tmp != null) {
tmp->keepFocus(); tmp->keepFocus();
} }
} }
@ -292,7 +292,7 @@ void MainWindows::onCallbackMenuEvent(const etk::String& _value) {
} }
} }
} else if (_value == "menu:replace") { } else if (_value == "menu:replace") {
if (m_widgetSearch == nullptr) { if (m_widgetSearch == null) {
return; return;
} }
if (m_widgetSearch->propertyHide.get() == true) { if (m_widgetSearch->propertyHide.get() == true) {
@ -301,9 +301,9 @@ void MainWindows::onCallbackMenuEvent(const etk::String& _value) {
} else { } else {
if (m_widgetSearch->isSelectReplace()) { if (m_widgetSearch->isSelectReplace()) {
m_widgetSearch->propertyHide.set(true); m_widgetSearch->propertyHide.set(true);
if (m_viewerManager != nullptr) { if (m_viewerManager != null) {
ememory::SharedPtr<appl::TextViewer> tmp = m_viewerManager->getViewerSelected(); ememory::SharedPtr<appl::TextViewer> tmp = m_viewerManager->getViewerSelected();
if (tmp != nullptr) { if (tmp != null) {
tmp->keepFocus(); tmp->keepFocus();
} }
} }
@ -360,7 +360,7 @@ void MainWindows::onCallbackMenuEvent(const etk::String& _value) {
return; return;
} }
ememory::SharedPtr<appl::Buffer> tmpBuffer = m_bufferManager->get(_msg.getData()); ememory::SharedPtr<appl::Buffer> tmpBuffer = m_bufferManager->get(_msg.getData());
if (tmpBuffer == nullptr) { if (tmpBuffer == null) {
APPL_ERROR("Error to get the buffer : " << _msg.getData()); APPL_ERROR("Error to get the buffer : " << _msg.getData());
return; return;
} }
@ -379,7 +379,7 @@ void MainWindows::onCallbackMenuEvent(const etk::String& _value) {
return; return;
} }
ememory::SharedPtr<appl::Buffer> tmpBuffer = m_bufferManager->get(_msg.getData()); ememory::SharedPtr<appl::Buffer> tmpBuffer = m_bufferManager->get(_msg.getData());
if (tmpBuffer == nullptr) { if (tmpBuffer == null) {
APPL_ERROR("Error to get the buffer : " << _msg.getData()); APPL_ERROR("Error to get the buffer : " << _msg.getData());
return; return;
} }
@ -390,7 +390,7 @@ void MainWindows::onCallbackMenuEvent(const etk::String& _value) {
return; return;
} }
ememory::SharedPtr<appl::Buffer> tmpBuffer = m_bufferManager->get(_msg.getData()); ememory::SharedPtr<appl::Buffer> tmpBuffer = m_bufferManager->get(_msg.getData());
if (tmpBuffer == nullptr) { if (tmpBuffer == null) {
APPL_ERROR("Error to get the buffer : " << _msg.getData()); APPL_ERROR("Error to get the buffer : " << _msg.getData());
return; return;
} }
@ -402,19 +402,19 @@ void MainWindows::onCallbackMenuEvent(const etk::String& _value) {
void MainWindows::displayOpen() { void MainWindows::displayOpen() {
ememory::SharedPtr<ewol::widget::FileChooser> tmpWidget = ewol::widget::FileChooser::create(); ememory::SharedPtr<ewol::widget::FileChooser> tmpWidget = ewol::widget::FileChooser::create();
if (tmpWidget == nullptr) { if (tmpWidget == null) {
APPL_ERROR("Can not open File chooser !!! "); APPL_ERROR("Can not open File chooser !!! ");
return; return;
} }
tmpWidget->propertyLabelTitle.set("_T{Open files ...}"); tmpWidget->propertyLabelTitle.set("_T{Open files ...}");
tmpWidget->propertyLabelValidate.set("_T{Open}"); tmpWidget->propertyLabelValidate.set("_T{Open}");
if (m_bufferManager == nullptr) { if (m_bufferManager == null) {
APPL_ERROR("can not call unexistant buffer manager ... "); APPL_ERROR("can not call unexistant buffer manager ... ");
return; return;
} }
// Get a ref on the buffer selected (if null, no buffer was selected ...) // Get a ref on the buffer selected (if null, no buffer was selected ...)
ememory::SharedPtr<appl::Buffer> tmpBuffer = m_bufferManager->getBufferSelected(); ememory::SharedPtr<appl::Buffer> tmpBuffer = m_bufferManager->getBufferSelected();
if (tmpBuffer != nullptr) { if (tmpBuffer != null) {
etk::FSNode tmpFile = tmpBuffer->getFileName(); etk::FSNode tmpFile = tmpBuffer->getFileName();
tmpWidget->propertyPath.set(tmpFile.getNameFolder()); tmpWidget->propertyPath.set(tmpFile.getNameFolder());
} }
@ -426,7 +426,7 @@ void MainWindows::displayOpen() {
void MainWindows::displayProperty() { void MainWindows::displayProperty() {
// Request the parameter GUI // Request the parameter GUI
ememory::SharedPtr<ewol::widget::Parameter> tmpWidget = ewol::widget::Parameter::create(); ememory::SharedPtr<ewol::widget::Parameter> tmpWidget = ewol::widget::Parameter::create();
if (tmpWidget == nullptr) { if (tmpWidget == null) {
APPL_ERROR("Can not allocate widget == > display might be in error"); APPL_ERROR("Can not allocate widget == > display might be in error");
return; return;
} }
@ -448,10 +448,10 @@ void MainWindows::displayProperty() {
tmpWidget->menuAddGroup("_T{Editor}"); tmpWidget->menuAddGroup("_T{Editor}");
ememory::SharedPtr<ewol::Widget> tmpSubWidget = globals::ParameterGlobalsGui::create(); ememory::SharedPtr<ewol::Widget> tmpSubWidget = globals::ParameterGlobalsGui::create();
tmpWidget->menuAdd("_T{Editor}", "", tmpSubWidget); tmpWidget->menuAdd("_T{Editor}", "", tmpSubWidget);
tmpWidget->menuAdd("_T{Font & Color}", "", nullptr); tmpWidget->menuAdd("_T{Font & Color}", "", null);
tmpWidget->menuAdd("_T{Highlight}", "", nullptr); tmpWidget->menuAdd("_T{Highlight}", "", null);
tmpWidget->menuAddGroup("_T{General}"); tmpWidget->menuAddGroup("_T{General}");
tmpWidget->menuAdd("_T{Display}", "", nullptr); tmpWidget->menuAdd("_T{Display}", "", null);
tmpSubWidget = ParameterAboutGui::create(); tmpSubWidget = ParameterAboutGui::create();
tmpWidget->menuAdd("_T{About}", "", tmpSubWidget); tmpWidget->menuAdd("_T{About}", "", tmpSubWidget);
#endif #endif
@ -459,7 +459,7 @@ void MainWindows::displayProperty() {
void MainWindows::onCallbackselectNewFile(const etk::String& _value) { void MainWindows::onCallbackselectNewFile(const etk::String& _value) {
APPL_INFO("onCallbackselectNewFile(" << _value << ")"); APPL_INFO("onCallbackselectNewFile(" << _value << ")");
if (m_bufferManager == nullptr) { if (m_bufferManager == null) {
APPL_ERROR("can not call unexistant buffer manager ... "); APPL_ERROR("can not call unexistant buffer manager ... ");
return; return;
} }
@ -468,7 +468,7 @@ void MainWindows::onCallbackselectNewFile(const etk::String& _value) {
m_connectionSaveName.disconnect(); m_connectionSaveName.disconnect();
onCallbackTitleUpdate(); onCallbackTitleUpdate();
ememory::SharedPtr<appl::Buffer> tmpp = m_bufferManager->getBufferSelected(); ememory::SharedPtr<appl::Buffer> tmpp = m_bufferManager->getBufferSelected();
if (tmpp != nullptr) { if (tmpp != null) {
m_connectionSave = tmpp->signalIsSave.connect(this, &MainWindows::onCallbackTitleUpdate); m_connectionSave = tmpp->signalIsSave.connect(this, &MainWindows::onCallbackTitleUpdate);
m_connectionModify = tmpp->signalIsModify.connect(this, &MainWindows::onCallbackTitleUpdate); m_connectionModify = tmpp->signalIsModify.connect(this, &MainWindows::onCallbackTitleUpdate);
m_connectionSaveName = tmpp->signalChangeName.connect(this, &MainWindows::onCallbackTitleUpdate); m_connectionSaveName = tmpp->signalChangeName.connect(this, &MainWindows::onCallbackTitleUpdate);
@ -483,63 +483,63 @@ void MainWindows::onCallbackPopUpFileSelected(const etk::String& _value) {
void MainWindows::onCallbackTitleUpdate() { void MainWindows::onCallbackTitleUpdate() {
APPL_INFO("onCallbackTitleUpdate()"); APPL_INFO("onCallbackTitleUpdate()");
if (m_bufferManager == nullptr) { if (m_bufferManager == null) {
APPL_ERROR("can not call unexistant buffer manager ... "); APPL_ERROR("can not call unexistant buffer manager ... ");
return; return;
} }
// select a new Buffer ==> change title: // select a new Buffer ==> change title:
ememory::SharedPtr<appl::Buffer> tmpp = m_bufferManager->getBufferSelected(); ememory::SharedPtr<appl::Buffer> tmpp = m_bufferManager->getBufferSelected();
if (tmpp == nullptr) { if (tmpp == null) {
propertyTitle.set("Edn"); propertyTitle.set("Edn");
if (m_widgetLabelFileName != nullptr) { if (m_widgetLabelFileName != null) {
m_widgetLabelFileName->propertyValue.set(""); m_widgetLabelFileName->propertyValue.set("");
} }
} else { } else {
etk::String nameFileSystem = etk::FSNode(tmpp->getFileName()).getFileSystemName(); etk::String nameFileSystem = etk::FSNode(tmpp->getFileName()).getFileSystemName();
propertyTitle.set(etk::String("Edn : ") + (tmpp->isModify()==true?" *":"") + nameFileSystem); propertyTitle.set(etk::String("Edn : ") + (tmpp->isModify()==true?" *":"") + nameFileSystem);
if (m_widgetLabelFileName != nullptr) { if (m_widgetLabelFileName != null) {
m_widgetLabelFileName->propertyValue.set(nameFileSystem + (tmpp->isModify()==true?" *":"")); m_widgetLabelFileName->propertyValue.set(nameFileSystem + (tmpp->isModify()==true?" *":""));
} }
} }
} }
void MainWindows::saveAsPopUp(const ememory::SharedPtr<appl::Buffer>& _buffer) { void MainWindows::saveAsPopUp(const ememory::SharedPtr<appl::Buffer>& _buffer) {
if (_buffer == nullptr) { if (_buffer == null) {
APPL_ERROR("Call With nullptr input..."); APPL_ERROR("Call With null input...");
return; return;
} }
ememory::SharedPtr<appl::WorkerSaveFile> tmpObject = appl::WorkerSaveFile::create("buffer-name", _buffer->getFileName()); ememory::SharedPtr<appl::WorkerSaveFile> tmpObject = appl::WorkerSaveFile::create("buffer-name", _buffer->getFileName());
} }
void MainWindows::closeNotSavedFile(const ememory::SharedPtr<appl::Buffer>& _buffer) { void MainWindows::closeNotSavedFile(const ememory::SharedPtr<appl::Buffer>& _buffer) {
if (_buffer == nullptr) { if (_buffer == null) {
APPL_ERROR("Call With nullptr input..."); APPL_ERROR("Call With null input...");
return; return;
} }
ememory::SharedPtr<ewol::widget::StdPopUp> tmpPopUp = ewol::widget::StdPopUp::create(); ememory::SharedPtr<ewol::widget::StdPopUp> tmpPopUp = ewol::widget::StdPopUp::create();
if (tmpPopUp == nullptr) { if (tmpPopUp == null) {
APPL_ERROR("Can not create a simple pop-up"); APPL_ERROR("Can not create a simple pop-up");
return; return;
} }
tmpPopUp->propertyTitle.set("<bold>_T{Close un-saved file:}</bold>"); tmpPopUp->propertyTitle.set("<bold>_T{Close un-saved file:}</bold>");
tmpPopUp->propertyComment.set("_T{The file named:} <i>\"" + _buffer->getFileName() + "\"</i> _T{is curently modify.} <br/>_T{If you don't saves these modifications,<br/>they will be definitly lost...}"); tmpPopUp->propertyComment.set("_T{The file named:} <i>\"" + _buffer->getFileName() + "\"</i> _T{is curently modify.} <br/>_T{If you don't saves these modifications,<br/>they will be definitly lost...}");
ememory::SharedPtr<ewol::widget::Button> bt = nullptr; ememory::SharedPtr<ewol::widget::Button> bt = null;
if (_buffer->hasFileName() == true) { if (_buffer->hasFileName() == true) {
bt = tmpPopUp->addButton("_T{Save}", true); bt = tmpPopUp->addButton("_T{Save}", true);
if (bt != nullptr) { if (bt != null) {
// TODO : The element is removed before beeing pressed // TODO : The element is removed before beeing pressed
// TODO : bt->signalPressed.connect(sharedFromThis(), mainWindowsRequestSaveFile, _buffer->getFileName()); // TODO : bt->signalPressed.connect(sharedFromThis(), mainWindowsRequestSaveFile, _buffer->getFileName());
// TODO : bt->signalPressed.connect(sharedFromThis(), mainWindowsRequestcloseFileNoCheck, _buffer->getFileName()); // TODO : bt->signalPressed.connect(sharedFromThis(), mainWindowsRequestcloseFileNoCheck, _buffer->getFileName());
} }
} }
bt = tmpPopUp->addButton("_T{Save As}", true); bt = tmpPopUp->addButton("_T{Save As}", true);
if (bt != nullptr) { if (bt != null) {
// TODO : bt->signalPressed.connect(sharedFromThis(), mainWindowsRequestSaveFileAs, _buffer->getFileName()); // TODO : bt->signalPressed.connect(sharedFromThis(), mainWindowsRequestSaveFileAs, _buffer->getFileName());
//bt->signalPressed.connect(sharedFromThis(), mainWindowsRequestcloseFileNoCheck, _buffer->getFileName()); //bt->signalPressed.connect(sharedFromThis(), mainWindowsRequestcloseFileNoCheck, _buffer->getFileName());
// TODO : Request the close when saved ... // TODO : Request the close when saved ...
} }
bt = tmpPopUp->addButton("_T{Close}", true); bt = tmpPopUp->addButton("_T{Close}", true);
if (bt != nullptr) { if (bt != null) {
// TODO : bt->signalPressed.connect(sharedFromThis(), mainWindowsRequestcloseFileNoCheck, _buffer->getFileName()); // TODO : bt->signalPressed.connect(sharedFromThis(), mainWindowsRequestcloseFileNoCheck, _buffer->getFileName());
} }
tmpPopUp->addButton("_T{Cancel}", true); tmpPopUp->addButton("_T{Cancel}", true);

View File

@ -49,12 +49,12 @@ appl::widget::Search::~Search() {
} }
void appl::widget::Search::find() { void appl::widget::Search::find() {
if (m_viewerManager == nullptr) { if (m_viewerManager == null) {
APPL_WARNING("No viewer manager selected!!!"); APPL_WARNING("No viewer manager selected!!!");
return; return;
} }
ememory::SharedPtr<appl::TextViewer> viewer = m_viewerManager->getViewerSelected(); ememory::SharedPtr<appl::TextViewer> viewer = m_viewerManager->getViewerSelected();
if (viewer == nullptr) { if (viewer == null) {
APPL_INFO("No viewer selected!!!"); APPL_INFO("No viewer selected!!!");
return; return;
} }
@ -85,12 +85,12 @@ void appl::widget::Search::find() {
} }
void appl::widget::Search::replace() { void appl::widget::Search::replace() {
if (m_viewerManager == nullptr) { if (m_viewerManager == null) {
APPL_WARNING("No viewer manager selected!!!"); APPL_WARNING("No viewer manager selected!!!");
return; return;
} }
ememory::SharedPtr<appl::TextViewer> viewer = m_viewerManager->getViewerSelected(); ememory::SharedPtr<appl::TextViewer> viewer = m_viewerManager->getViewerSelected();
if (viewer == nullptr) { if (viewer == null) {
APPL_INFO("No viewer selected!!!"); APPL_INFO("No viewer selected!!!");
return; return;
} }
@ -137,26 +137,26 @@ void appl::widget::Search::OnCallbackForward(const bool& _value) {
} }
void appl::widget::Search::selectSearch() { void appl::widget::Search::selectSearch() {
if (m_searchEntry != nullptr) { if (m_searchEntry != null) {
m_searchEntry->keepFocus(); m_searchEntry->keepFocus();
} }
} }
bool appl::widget::Search::isSelectSearch() { bool appl::widget::Search::isSelectSearch() {
if (m_searchEntry != nullptr) { if (m_searchEntry != null) {
return m_searchEntry->getFocus(); return m_searchEntry->getFocus();
} }
return false; return false;
} }
void appl::widget::Search::selectReplace() { void appl::widget::Search::selectReplace() {
if (m_replaceEntry != nullptr) { if (m_replaceEntry != null) {
m_replaceEntry->keepFocus(); m_replaceEntry->keepFocus();
} }
} }
bool appl::widget::Search::isSelectReplace() { bool appl::widget::Search::isSelectReplace() {
if (m_replaceEntry != nullptr) { if (m_replaceEntry != null) {
return m_replaceEntry->getFocus(); return m_replaceEntry->getFocus();
} }
return false; return false;

View File

@ -15,7 +15,7 @@ appl::TagFileList::TagFileList() :
setMouseLimit(1); setMouseLimit(1);
// Load color properties: (use file list to be generic ...) // Load color properties: (use file list to be generic ...)
m_colorProperty = ewol::resource::ColorFile::create("THEME:COLOR:ListFileSystem.json"); m_colorProperty = ewol::resource::ColorFile::create("THEME:COLOR:ListFileSystem.json");
if (m_colorProperty != nullptr) { if (m_colorProperty != null) {
m_colorIdText = m_colorProperty->request("text"); m_colorIdText = m_colorProperty->request("text");
m_colorIdBackground1 = m_colorProperty->request("background1"); m_colorIdBackground1 = m_colorProperty->request("background1");
m_colorIdBackground2 = m_colorProperty->request("background2"); m_colorIdBackground2 = m_colorProperty->request("background2");
@ -29,7 +29,7 @@ void appl::TagFileList::init() {
appl::TagFileList::~TagFileList() { appl::TagFileList::~TagFileList() {
for (auto &it : m_list) { for (auto &it : m_list) {
ETK_DELETE(appl::TagListElement, it); ETK_DELETE(appl::TagListElement, it);
it = nullptr; it = null;
} }
} }
@ -51,7 +51,7 @@ uint32_t appl::TagFileList::getNuberOfRaw() {
} }
bool appl::TagFileList::getElement(int32_t _colomn, int32_t _raw, etk::String& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) { bool appl::TagFileList::getElement(int32_t _colomn, int32_t _raw, etk::String& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) {
if (_raw >= 0 && (size_t)_raw < m_list.size() && nullptr != m_list[_raw]) { if (_raw >= 0 && (size_t)_raw < m_list.size() && null != m_list[_raw]) {
if (0 == _colomn) { if (0 == _colomn) {
_myTextToWrite = etk::toString(m_list[_raw]->fileLine); _myTextToWrite = etk::toString(m_list[_raw]->fileLine);
} else { } else {
@ -85,7 +85,7 @@ bool appl::TagFileList::onItemEvent(int32_t _IdInput, enum gale::key::status _ty
} }
if( m_selectedLine >= 0 if( m_selectedLine >= 0
&& m_selectedLine < (int64_t)m_list.size() && m_selectedLine < (int64_t)m_list.size()
&& nullptr != m_list[m_selectedLine] ) { && null != m_list[m_selectedLine] ) {
if (previousRaw != m_selectedLine) { if (previousRaw != m_selectedLine) {
signalSelect.emit(etk::toString(m_list[_raw]->fileLine)+":"+m_list[m_selectedLine]->filename); signalSelect.emit(etk::toString(m_list[_raw]->fileLine)+":"+m_list[m_selectedLine]->filename);
} else { } else {
@ -110,7 +110,7 @@ bool appl::TagFileList::onItemEvent(int32_t _IdInput, enum gale::key::status _ty
*/ */
void appl::TagFileList::add(etk::String& _file, int32_t _line) { void appl::TagFileList::add(etk::String& _file, int32_t _line) {
appl::TagListElement *tmpFile = ETK_NEW(appl::TagListElement, _file, _line); appl::TagListElement *tmpFile = ETK_NEW(appl::TagListElement, _file, _line);
if (nullptr != tmpFile) { if (null != tmpFile) {
m_list.pushBack(tmpFile); m_list.pushBack(tmpFile);
} }
markToRedraw(); markToRedraw();

View File

@ -35,7 +35,7 @@ void appl::TagFileSelection::init() {
#endif #endif
mySizerVert = ewol::widget::Sizer::create(); mySizerVert = ewol::widget::Sizer::create();
if (mySizerVert == nullptr) { if (mySizerVert == null) {
EWOL_ERROR("Can not allocate widget == > display might be in error"); EWOL_ERROR("Can not allocate widget == > display might be in error");
return; return;
} }
@ -65,7 +65,7 @@ void appl::TagFileSelection::init() {
externSubBind(compose, ewol::widget::Button, "PLUGIN-CTAGS-cancel", signalPressed, sharedFromThis(), &appl::TagFileSelection::onCallbackCtagsCancel); externSubBind(compose, ewol::widget::Button, "PLUGIN-CTAGS-cancel", signalPressed, sharedFromThis(), &appl::TagFileSelection::onCallbackCtagsCancel);
m_listTag = appl::TagFileList::create(); m_listTag = appl::TagFileList::create();
if (m_listTag == nullptr) { if (m_listTag == null) {
EWOL_ERROR("Can not allocate widget == > display might be in error"); EWOL_ERROR("Can not allocate widget == > display might be in error");
} else { } else {
m_listTag->signalValidate.connect(sharedFromThis(), &appl::TagFileSelection::onCallbackCtagsListValidate); m_listTag->signalValidate.connect(sharedFromThis(), &appl::TagFileSelection::onCallbackCtagsListValidate);
@ -77,7 +77,7 @@ void appl::TagFileSelection::init() {
} }
ewol::widget::LabelShared myWidgetTitle = ewol::widget::Label::create(); ewol::widget::LabelShared myWidgetTitle = ewol::widget::Label::create();
if (myWidgetTitle == nullptr) { if (myWidgetTitle == null) {
EWOL_ERROR("Can not allocate widget == > display might be in error"); EWOL_ERROR("Can not allocate widget == > display might be in error");
return; return;
} }
@ -126,7 +126,7 @@ void appl::TagFileSelection::onCallbackCtagsListUnSelect() {
* @param[in] jump line id * @param[in] jump line id
*/ */
void appl::TagFileSelection::addCtagsNewItem(etk::String _file, int32_t _line) { void appl::TagFileSelection::addCtagsNewItem(etk::String _file, int32_t _line) {
if (m_listTag != nullptr) { if (m_listTag != null) {
m_listTag->add(_file, _line); m_listTag->add(_file, _line);
} }
} }

View File

@ -65,7 +65,7 @@ void appl::TextViewer::init() {
registerMultiCast(appl::MsgSelectGotoLine); registerMultiCast(appl::MsgSelectGotoLine);
registerMultiCast(appl::MsgSelectGotoLineSelect); registerMultiCast(appl::MsgSelectGotoLineSelect);
*/ */
if (m_bufferManager != nullptr) { if (m_bufferManager != null) {
m_bufferManager->signalSelectFile.connect(sharedFromThis(), &appl::TextViewer::onCallbackselectNewFile); m_bufferManager->signalSelectFile.connect(sharedFromThis(), &appl::TextViewer::onCallbackselectNewFile);
} else { } else {
APPL_CRITICAL("Buffer manager has not been created at the init"); APPL_CRITICAL("Buffer manager has not been created at the init");
@ -90,13 +90,13 @@ void appl::TextViewer::onCallbackselectNewFile(const etk::String& _value) {
} }
// reset scroll: // reset scroll:
if (m_buffer != nullptr) { if (m_buffer != null) {
m_buffer->signals.disconnect(sharedFromThis()); m_buffer->signals.disconnect(sharedFromThis());
bool needAdd = true; bool needAdd = true;
auto it = m_drawingRemenber.begin(); auto it = m_drawingRemenber.begin();
while (it != m_drawingRemenber.end()) { while (it != m_drawingRemenber.end()) {
ememory::SharedPtr<appl::Buffer> tmpBuff = it->first.lock(); ememory::SharedPtr<appl::Buffer> tmpBuff = it->first.lock();
if (tmpBuff == nullptr) { if (tmpBuff == null) {
it = m_drawingRemenber.erase(it); it = m_drawingRemenber.erase(it);
continue; continue;
} }
@ -114,10 +114,10 @@ void appl::TextViewer::onCallbackselectNewFile(const etk::String& _value) {
} }
} }
m_originScrooled = vec2(0,0); m_originScrooled = vec2(0,0);
if (m_bufferManager != nullptr) { if (m_bufferManager != null) {
m_buffer = m_bufferManager->get(_value); m_buffer = m_bufferManager->get(_value);
m_bufferManager->setBufferSelected(m_buffer); m_bufferManager->setBufferSelected(m_buffer);
if (m_buffer != nullptr) { if (m_buffer != null) {
m_buffer->signalIsModify.connect(sharedFromThis(), &appl::TextViewer::onCallbackIsModify); m_buffer->signalIsModify.connect(sharedFromThis(), &appl::TextViewer::onCallbackIsModify);
m_buffer->signalSelectChange.connect(sharedFromThis(), &appl::TextViewer::onCallbackSelectChange); m_buffer->signalSelectChange.connect(sharedFromThis(), &appl::TextViewer::onCallbackSelectChange);
for (auto element : m_drawingRemenber) { for (auto element : m_drawingRemenber) {
@ -135,7 +135,7 @@ void appl::TextViewer::onCallbackselectNewFile(const etk::String& _value) {
} }
etk::String appl::TextViewer::getBufferPath() { etk::String appl::TextViewer::getBufferPath() {
if (m_buffer == nullptr) { if (m_buffer == null) {
return ""; return "";
} }
etk::String filename = m_buffer->getFileName(); etk::String filename = m_buffer->getFileName();
@ -173,7 +173,7 @@ void appl::TextViewer::onRegenerateDisplay() {
m_displayDrawing.setColor((*m_paintingProperties)[m_colorBackground].getForeground()); m_displayDrawing.setColor((*m_paintingProperties)[m_colorBackground].getForeground());
m_displayDrawing.rectangleWidth(m_size); m_displayDrawing.rectangleWidth(m_size);
if (m_buffer == nullptr) { if (m_buffer == null) {
m_maxSize.setX(256); m_maxSize.setX(256);
m_maxSize.setY(256); m_maxSize.setY(256);
float textEndAlignament = etk::max(11.0f, m_size.x()-20.0f); float textEndAlignament = etk::max(11.0f, m_size.x()-20.0f);
@ -269,7 +269,7 @@ void appl::TextViewer::onRegenerateDisplay() {
appl::DisplayHLData displayLocalSyntax; appl::DisplayHLData displayLocalSyntax;
m_buffer->hightlightGenerateLines(displayLocalSyntax, startingIt, (m_size.y()/tmpLetterSize.y()) + 5); m_buffer->hightlightGenerateLines(displayLocalSyntax, startingIt, (m_size.y()/tmpLetterSize.y()) + 5);
float maxSizeX = 0; float maxSizeX = 0;
appl::HighlightInfo * HLColor = nullptr; appl::HighlightInfo * HLColor = null;
bool displayCursorAndSelection = isSelectedLast(); bool displayCursorAndSelection = isSelectedLast();
appl::Buffer::Iterator it; appl::Buffer::Iterator it;
for (it = startingIt; for (it = startingIt;
@ -308,8 +308,8 @@ void appl::TextViewer::onRegenerateDisplay() {
} }
HLColor = m_buffer->getElementColorAtPosition(displayLocalSyntax, (int64_t)it); HLColor = m_buffer->getElementColorAtPosition(displayLocalSyntax, (int64_t)it);
bool haveBackground = false; bool haveBackground = false;
if ( HLColor != nullptr if ( HLColor != null
&& HLColor->patern != nullptr) { && HLColor->patern != null) {
m_displayText.setColor(HLColor->patern->getColorGlyph().getForeground()); m_displayText.setColor(HLColor->patern->getColorGlyph().getForeground());
m_displayText.setColorBg(HLColor->patern->getColorGlyph().getBackground()); m_displayText.setColorBg(HLColor->patern->getColorGlyph().getBackground());
haveBackground = HLColor->patern->getColorGlyph().haveBackground(); haveBackground = HLColor->patern->getColorGlyph().haveBackground();
@ -381,7 +381,7 @@ void appl::TextViewer::onRegenerateDisplay() {
} }
bool appl::TextViewer::onEventEntry(const ewol::event::Entry& _event) { bool appl::TextViewer::onEventEntry(const ewol::event::Entry& _event) {
if (m_buffer == nullptr) { if (m_buffer == null) {
return false; return false;
} }
// First call plugin // First call plugin
@ -497,7 +497,7 @@ bool appl::TextViewer::onEventInput(const ewol::event::Input& _event) {
keepFocus(); keepFocus();
} }
//tic(); //tic();
if (m_buffer == nullptr) { if (m_buffer == null) {
return false; return false;
} }
// First call the scrolling widget : // First call the scrolling widget :
@ -679,7 +679,7 @@ appl::Buffer::Iterator appl::TextViewer::getMousePosition(const vec2& _relativeP
} }
void appl::TextViewer::onEventClipboard(enum gale::context::clipBoard::clipboardListe _clipboardID) { void appl::TextViewer::onEventClipboard(enum gale::context::clipBoard::clipboardListe _clipboardID) {
if (m_buffer != nullptr) { if (m_buffer != null) {
etk::String data = gale::context::clipBoard::get(_clipboardID); etk::String data = gale::context::clipBoard::get(_clipboardID);
write(data); write(data);
} }
@ -718,7 +718,7 @@ void appl::TextViewer::onChangePropertyFontName() {
// TODO : Update process time ==> a little expensive (2->4ms) in end of file // TODO : Update process time ==> a little expensive (2->4ms) in end of file
void appl::TextViewer::updateScrolling() { void appl::TextViewer::updateScrolling() {
if (m_buffer == nullptr) { if (m_buffer == null) {
return; return;
} }
vec2 realCursorPosition(0,0); vec2 realCursorPosition(0,0);
@ -747,7 +747,7 @@ void appl::TextViewer::updateScrolling() {
} }
bool appl::TextViewer::moveCursor(const appl::Buffer::Iterator& _pos) { bool appl::TextViewer::moveCursor(const appl::Buffer::Iterator& _pos) {
if (m_buffer == nullptr) { if (m_buffer == null) {
return false; return false;
} }
markToRedraw(); markToRedraw();
@ -761,7 +761,7 @@ bool appl::TextViewer::moveCursor(const appl::Buffer::Iterator& _pos) {
} }
bool appl::TextViewer::write(const etk::String& _data) { bool appl::TextViewer::write(const etk::String& _data) {
if (m_buffer == nullptr) { if (m_buffer == null) {
return false; return false;
} }
if (m_buffer->hasTextSelected() == true) { if (m_buffer->hasTextSelected() == true) {
@ -771,7 +771,7 @@ bool appl::TextViewer::write(const etk::String& _data) {
} }
bool appl::TextViewer::write(const etk::String& _data, const appl::Buffer::Iterator& _pos) { bool appl::TextViewer::write(const etk::String& _data, const appl::Buffer::Iterator& _pos) {
if (m_buffer == nullptr) { if (m_buffer == null) {
return false; return false;
} }
markToRedraw(); markToRedraw();
@ -787,7 +787,7 @@ bool appl::TextViewer::write(const etk::String& _data, const appl::Buffer::Itera
} }
bool appl::TextViewer::replace(const etk::String& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) { bool appl::TextViewer::replace(const etk::String& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
if (m_buffer == nullptr) { if (m_buffer == null) {
return false; return false;
} }
markToRedraw(); markToRedraw();
@ -803,7 +803,7 @@ bool appl::TextViewer::replace(const etk::String& _data, const appl::Buffer::Ite
} }
bool appl::TextViewer::replace(const etk::String& _data) { bool appl::TextViewer::replace(const etk::String& _data) {
if (m_buffer == nullptr) { if (m_buffer == null) {
return false; return false;
} }
if (m_buffer->hasTextSelected() == false) { if (m_buffer->hasTextSelected() == false) {
@ -813,7 +813,7 @@ bool appl::TextViewer::replace(const etk::String& _data) {
} }
void appl::TextViewer::remove() { void appl::TextViewer::remove() {
if (m_buffer == nullptr) { if (m_buffer == null) {
return; return;
} }
if (m_buffer->hasTextSelected() == false) { if (m_buffer->hasTextSelected() == false) {
@ -831,7 +831,7 @@ void appl::TextViewer::remove() {
void appl::TextViewer::moveCursorRight(appl::TextViewer::moveMode _mode) { void appl::TextViewer::moveCursorRight(appl::TextViewer::moveMode _mode) {
if (m_buffer == nullptr) { if (m_buffer == null) {
return; return;
} }
markToRedraw(); markToRedraw();
@ -854,7 +854,7 @@ void appl::TextViewer::moveCursorRight(appl::TextViewer::moveMode _mode) {
} }
void appl::TextViewer::moveCursorLeft(appl::TextViewer::moveMode _mode) { void appl::TextViewer::moveCursorLeft(appl::TextViewer::moveMode _mode) {
if (m_buffer == nullptr) { if (m_buffer == null) {
return; return;
} }
markToRedraw(); markToRedraw();
@ -877,7 +877,7 @@ void appl::TextViewer::moveCursorLeft(appl::TextViewer::moveMode _mode) {
} }
void appl::TextViewer::moveCursorUp(uint32_t _nbLine) { void appl::TextViewer::moveCursorUp(uint32_t _nbLine) {
if (m_buffer == nullptr) { if (m_buffer == null) {
return; return;
} }
markToRedraw(); markToRedraw();
@ -903,7 +903,7 @@ void appl::TextViewer::moveCursorUp(uint32_t _nbLine) {
} }
void appl::TextViewer::moveCursorDown(uint32_t _nbLine) { void appl::TextViewer::moveCursorDown(uint32_t _nbLine) {
if (m_buffer == nullptr) { if (m_buffer == null) {
return; return;
} }
markToRedraw(); markToRedraw();
@ -983,13 +983,13 @@ float appl::TextViewer::getScreenSize(const appl::Buffer::Iterator& _startLinePo
} }
void appl::TextViewer::setCurrentSelect() { void appl::TextViewer::setCurrentSelect() {
if (m_viewerManager != nullptr) { if (m_viewerManager != null) {
m_viewerManager->setViewerSelected(ememory::dynamicPointerCast<appl::TextViewer>(sharedFromThis()), m_buffer); m_viewerManager->setViewerSelected(ememory::dynamicPointerCast<appl::TextViewer>(sharedFromThis()), m_buffer);
} }
} }
bool appl::TextViewer::isSelectedLast() { bool appl::TextViewer::isSelectedLast() {
if (m_viewerManager != nullptr) { if (m_viewerManager != null) {
return m_viewerManager->isLastSelected(ememory::dynamicPointerCast<appl::TextViewer>(sharedFromThis())); return m_viewerManager->isLastSelected(ememory::dynamicPointerCast<appl::TextViewer>(sharedFromThis()));
} }
return false; return false;

View File

@ -97,7 +97,7 @@ namespace appl {
* @brief Remove selected data ... (No plugin call) * @brief Remove selected data ... (No plugin call)
*/ */
void removeDirect() { void removeDirect() {
if (m_buffer==nullptr) { if (m_buffer==null) {
return; return;
} }
m_buffer->removeSelection(); m_buffer->removeSelection();
@ -110,7 +110,7 @@ namespace appl {
* @return true of no error occured. * @return true of no error occured.
*/ */
bool copy(etk::String& _data) { bool copy(etk::String& _data) {
if (m_buffer==nullptr) { if (m_buffer==null) {
return false; return false;
} }
return m_buffer->copy(_data); return m_buffer->copy(_data);
@ -122,7 +122,7 @@ namespace appl {
* @param[in] _posEnd End position to end replace the data. * @param[in] _posEnd End position to end replace the data.
*/ */
void copy(etk::String& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) { void copy(etk::String& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
if (m_buffer==nullptr) { if (m_buffer==null) {
return; return;
} }
m_buffer->copy(_data, _pos, _posEnd); m_buffer->copy(_data, _pos, _posEnd);
@ -134,7 +134,7 @@ namespace appl {
* @return true if the write is done corectly * @return true if the write is done corectly
*/ */
bool writeDirect(const etk::String& _data, const appl::Buffer::Iterator& _pos) { bool writeDirect(const etk::String& _data, const appl::Buffer::Iterator& _pos) {
if (m_buffer==nullptr) { if (m_buffer==null) {
return false; return false;
} }
bool ret = m_buffer->write(_data, _pos); bool ret = m_buffer->write(_data, _pos);
@ -149,7 +149,7 @@ namespace appl {
* @return true if the write is done corectly * @return true if the write is done corectly
*/ */
bool replaceDirect(const etk::String& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) { bool replaceDirect(const etk::String& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
if (m_buffer==nullptr) { if (m_buffer==null) {
return false; return false;
} }
bool ret = m_buffer->replace(_data, _pos, _posEnd); bool ret = m_buffer->replace(_data, _pos, _posEnd);
@ -210,14 +210,14 @@ namespace appl {
* @return true if a display buffer is present, false otherwise. * @return true if a display buffer is present, false otherwise.
*/ */
virtual bool hasBuffer() { virtual bool hasBuffer() {
return m_buffer != nullptr; return m_buffer != null;
} }
/** /**
* @brief Get the status of selection. * @brief Get the status of selection.
* @return true if we have a current selection, false otherwise. * @return true if we have a current selection, false otherwise.
*/ */
virtual bool hasTextSelected() { virtual bool hasTextSelected() {
if (m_buffer==nullptr) { if (m_buffer==null) {
return false; return false;
} }
return m_buffer->hasTextSelected(); return m_buffer->hasTextSelected();
@ -226,7 +226,7 @@ namespace appl {
* @brief Remove Selection of the buffer. * @brief Remove Selection of the buffer.
*/ */
virtual void unSelect() { virtual void unSelect() {
if (m_buffer==nullptr) { if (m_buffer==null) {
return; return;
} }
m_buffer->unSelect(); m_buffer->unSelect();
@ -237,7 +237,7 @@ namespace appl {
* @param[in] _stop Stop position of the selection (the curor is set at this position) * @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) { virtual void select(const appl::Buffer::Iterator& _start, const appl::Buffer::Iterator& _stop) {
if (m_buffer==nullptr) { if (m_buffer==null) {
return; return;
} }
moveCursor(_stop); moveCursor(_stop);
@ -257,7 +257,7 @@ namespace appl {
appl::Buffer::Iterator& _resultStart, appl::Buffer::Iterator& _resultStart,
appl::Buffer::Iterator& _resultStop, appl::Buffer::Iterator& _resultStop,
bool _caseSensitive = true) { bool _caseSensitive = true) {
if (m_buffer==nullptr) { if (m_buffer==null) {
return false; return false;
} }
bool ret = m_buffer->search(_pos, _search, _resultStart, _caseSensitive); bool ret = m_buffer->search(_pos, _search, _resultStart, _caseSensitive);
@ -280,7 +280,7 @@ namespace appl {
appl::Buffer::Iterator& _resultStart, appl::Buffer::Iterator& _resultStart,
appl::Buffer::Iterator& _resultStop, appl::Buffer::Iterator& _resultStop,
bool _caseSensitive = true) { bool _caseSensitive = true) {
if (m_buffer==nullptr) { if (m_buffer==null) {
return false; return false;
} }
bool ret = m_buffer->searchBack(_pos, _search, _resultStart, _caseSensitive); bool ret = m_buffer->searchBack(_pos, _search, _resultStart, _caseSensitive);
@ -299,7 +299,7 @@ namespace appl {
bool getPosAround(const appl::Buffer::Iterator& _pos, bool getPosAround(const appl::Buffer::Iterator& _pos,
appl::Buffer::Iterator &_beginPos, appl::Buffer::Iterator &_beginPos,
appl::Buffer::Iterator &_endPos) { appl::Buffer::Iterator &_endPos) {
if (m_buffer==nullptr) { if (m_buffer==null) {
return false; return false;
} }
return m_buffer->getPosAround(_pos, _beginPos, _endPos); return m_buffer->getPosAround(_pos, _beginPos, _endPos);
@ -310,7 +310,7 @@ namespace appl {
* @return The Iterator * @return The Iterator
*/ */
appl::Buffer::Iterator position(int64_t _pos) { appl::Buffer::Iterator position(int64_t _pos) {
if (m_buffer==nullptr) { if (m_buffer==null) {
return appl::Buffer::Iterator(); return appl::Buffer::Iterator();
} }
return m_buffer->position(_pos); return m_buffer->position(_pos);
@ -320,7 +320,7 @@ namespace appl {
* @return The iterator on the cursor position * @return The iterator on the cursor position
*/ */
appl::Buffer::Iterator cursor() { appl::Buffer::Iterator cursor() {
if (m_buffer==nullptr) { if (m_buffer==null) {
return appl::Buffer::Iterator(); return appl::Buffer::Iterator();
} }
return m_buffer->cursor(); return m_buffer->cursor();
@ -330,7 +330,7 @@ namespace appl {
* @return The iterator on the begin position * @return The iterator on the begin position
*/ */
appl::Buffer::Iterator begin() { appl::Buffer::Iterator begin() {
if (m_buffer==nullptr) { if (m_buffer==null) {
return appl::Buffer::Iterator(); return appl::Buffer::Iterator();
} }
return m_buffer->begin(); return m_buffer->begin();
@ -340,7 +340,7 @@ namespace appl {
* @return The iterator on the end position * @return The iterator on the end position
*/ */
appl::Buffer::Iterator end() { appl::Buffer::Iterator end() {
if (m_buffer==nullptr) { if (m_buffer==null) {
return appl::Buffer::Iterator(); return appl::Buffer::Iterator();
} }
return m_buffer->end(); return m_buffer->end();
@ -350,7 +350,7 @@ namespace appl {
* @return The Iterator * @return The Iterator
*/ */
appl::Buffer::Iterator selectStart() { appl::Buffer::Iterator selectStart() {
if (m_buffer==nullptr) { if (m_buffer==null) {
return appl::Buffer::Iterator(); return appl::Buffer::Iterator();
} }
return m_buffer->selectStart(); return m_buffer->selectStart();
@ -360,7 +360,7 @@ namespace appl {
* @return The Iterator * @return The Iterator
*/ */
appl::Buffer::Iterator selectStop() { appl::Buffer::Iterator selectStop() {
if (m_buffer==nullptr) { if (m_buffer==null) {
return appl::Buffer::Iterator(); return appl::Buffer::Iterator();
} }
return m_buffer->selectStop(); return m_buffer->selectStop();
@ -371,7 +371,7 @@ namespace appl {
* @return The position in the buffer of the start of the line. * @return The position in the buffer of the start of the line.
*/ */
appl::Buffer::Iterator getStartLine(const appl::Buffer::Iterator& _pos) { appl::Buffer::Iterator getStartLine(const appl::Buffer::Iterator& _pos) {
if (m_buffer==nullptr) { if (m_buffer==null) {
return appl::Buffer::Iterator(); return appl::Buffer::Iterator();
} }
return m_buffer->getStartLine(_pos); return m_buffer->getStartLine(_pos);
@ -382,7 +382,7 @@ namespace appl {
* @return The position in the buffer of the end of the line. * @return The position in the buffer of the end of the line.
*/ */
appl::Buffer::Iterator getEndLine(const appl::Buffer::Iterator& _pos) { appl::Buffer::Iterator getEndLine(const appl::Buffer::Iterator& _pos) {
if (m_buffer==nullptr) { if (m_buffer==null) {
return appl::Buffer::Iterator(); return appl::Buffer::Iterator();
} }
return m_buffer->getEndLine(_pos); return m_buffer->getEndLine(_pos);

View File

@ -34,7 +34,7 @@ void appl::ViewerManager::setViewerSelected(const ememory::SharedPtr<appl::TextV
return; return;
} }
m_viewer = _viewer; m_viewer = _viewer;
if (m_bufferManager != nullptr) { if (m_bufferManager != null) {
//m_bufferManager->setBufferSelected(_buffer); //m_bufferManager->setBufferSelected(_buffer);
} }
} }

View File

@ -15,7 +15,7 @@ appl::WorkerCloseAllFile::WorkerCloseAllFile() {
void appl::WorkerCloseAllFile::init() { void appl::WorkerCloseAllFile::init() {
ewol::object::Worker::init(); ewol::object::Worker::init();
if (m_bufferManager == nullptr) { if (m_bufferManager == null) {
APPL_ERROR("can not call unexistant buffer manager ... "); APPL_ERROR("can not call unexistant buffer manager ... ");
destroy(); destroy();
return; return;
@ -23,7 +23,7 @@ void appl::WorkerCloseAllFile::init() {
// List all current open file : // List all current open file :
for (int64_t iii=m_bufferManager->size()-1; iii>=0; --iii) { for (int64_t iii=m_bufferManager->size()-1; iii>=0; --iii) {
ememory::SharedPtr<appl::Buffer> tmpBuffer = m_bufferManager->get(iii); ememory::SharedPtr<appl::Buffer> tmpBuffer = m_bufferManager->get(iii);
if (tmpBuffer == nullptr) { if (tmpBuffer == null) {
continue; continue;
} }
if (tmpBuffer->isModify() == false) { if (tmpBuffer->isModify() == false) {
@ -55,7 +55,7 @@ appl::WorkerCloseAllFile::~WorkerCloseAllFile() {
} }
void appl::WorkerCloseAllFile::onCallbackCloseDone() { void appl::WorkerCloseAllFile::onCallbackCloseDone() {
if (m_bufferManager == nullptr) { if (m_bufferManager == null) {
// nothing to do in this case ==> can do nothing ... // nothing to do in this case ==> can do nothing ...
return; return;
} }

View File

@ -12,9 +12,9 @@
appl::WorkerCloseFile::WorkerCloseFile() : appl::WorkerCloseFile::WorkerCloseFile() :
signalCloseDone(this, "close-file-done", ""), signalCloseDone(this, "close-file-done", ""),
signalAbort(this, "close-file-abort", ""), signalAbort(this, "close-file-abort", ""),
m_buffer(nullptr), m_buffer(null),
m_worker(nullptr), m_worker(null),
m_bufferManager(nullptr) { m_bufferManager(null) {
addObjectType("appl::WorkerCloseFile"); addObjectType("appl::WorkerCloseFile");
// load buffer manager: // load buffer manager:
m_bufferManager = appl::BufferManager::create(); m_bufferManager = appl::BufferManager::create();
@ -26,7 +26,7 @@ void appl::WorkerCloseFile::init() {
void appl::WorkerCloseFile::startAction(const etk::String& _bufferName) { void appl::WorkerCloseFile::startAction(const etk::String& _bufferName) {
m_bufferName = _bufferName; m_bufferName = _bufferName;
if (m_bufferManager == nullptr) { if (m_bufferManager == null) {
APPL_ERROR("can not call unexistant buffer manager ... "); APPL_ERROR("can not call unexistant buffer manager ... ");
destroy(); destroy();
return; return;
@ -34,7 +34,7 @@ void appl::WorkerCloseFile::startAction(const etk::String& _bufferName) {
if (m_bufferName == "") { if (m_bufferName == "") {
// need to find the curent file ... // need to find the curent file ...
ememory::SharedPtr<appl::Buffer> tmpp = m_bufferManager->getBufferSelected(); ememory::SharedPtr<appl::Buffer> tmpp = m_bufferManager->getBufferSelected();
if (tmpp == nullptr) { if (tmpp == null) {
APPL_ERROR("No selected buffer now ..."); APPL_ERROR("No selected buffer now ...");
destroy(); destroy();
return; return;
@ -47,7 +47,7 @@ void appl::WorkerCloseFile::startAction(const etk::String& _bufferName) {
return; return;
} }
m_buffer = m_bufferManager->get(m_bufferName); m_buffer = m_bufferManager->get(m_bufferName);
if (m_buffer == nullptr) { if (m_buffer == null) {
APPL_ERROR("Error to get the buffer : " << m_bufferName); APPL_ERROR("Error to get the buffer : " << m_bufferName);
destroy(); destroy();
return; return;
@ -60,35 +60,35 @@ void appl::WorkerCloseFile::startAction(const etk::String& _bufferName) {
} }
ememory::SharedPtr<ewol::widget::StdPopUp> tmpPopUp = ewol::widget::StdPopUp::create(); ememory::SharedPtr<ewol::widget::StdPopUp> tmpPopUp = ewol::widget::StdPopUp::create();
if (tmpPopUp == nullptr) { if (tmpPopUp == null) {
APPL_ERROR("Can not create a simple pop-up"); APPL_ERROR("Can not create a simple pop-up");
destroy(); destroy();
return; return;
} }
tmpPopUp->propertyTitle.set("<bold>_T{Close un-saved file:}</bold>"); tmpPopUp->propertyTitle.set("<bold>_T{Close un-saved file:}</bold>");
tmpPopUp->propertyComment.set("_T{The file named:} <i>'" + m_buffer->getFileName() + "'</i> _T{is curently modify.}<br/>_T{If you don't saves these modifications,}<br/>_T{they will be definitly lost...}"); tmpPopUp->propertyComment.set("_T{The file named:} <i>'" + m_buffer->getFileName() + "'</i> _T{is curently modify.}<br/>_T{If you don't saves these modifications,}<br/>_T{they will be definitly lost...}");
ememory::SharedPtr<ewol::widget::Button> bt = nullptr; ememory::SharedPtr<ewol::widget::Button> bt = null;
if (m_buffer->hasFileName() == true) { if (m_buffer->hasFileName() == true) {
bt = tmpPopUp->addButton("_T{Save}", true); bt = tmpPopUp->addButton("_T{Save}", true);
if (bt != nullptr) { if (bt != null) {
bt->signalPressed.connect(sharedFromThis(), &appl::WorkerCloseFile::onCallbackSaveValidate); bt->signalPressed.connect(sharedFromThis(), &appl::WorkerCloseFile::onCallbackSaveValidate);
} }
} }
bt = tmpPopUp->addButton("_T{Save As}", true); bt = tmpPopUp->addButton("_T{Save As}", true);
if (bt != nullptr) { if (bt != null) {
bt->signalPressed.connect(sharedFromThis(), &appl::WorkerCloseFile::onCallbackSaveAsValidate); bt->signalPressed.connect(sharedFromThis(), &appl::WorkerCloseFile::onCallbackSaveAsValidate);
} }
bt = tmpPopUp->addButton("_T{Close}", true); bt = tmpPopUp->addButton("_T{Close}", true);
if (bt != nullptr) { if (bt != null) {
bt->signalPressed.connect(sharedFromThis(), &appl::WorkerCloseFile::onCallbackClose); bt->signalPressed.connect(sharedFromThis(), &appl::WorkerCloseFile::onCallbackClose);
} }
bt = tmpPopUp->addButton("_T{Cancel}", true); bt = tmpPopUp->addButton("_T{Cancel}", true);
if (bt != nullptr) { if (bt != null) {
bt->signalPressed.connect(sharedFromThis(), &appl::WorkerCloseFile::onCallbackCancel); bt->signalPressed.connect(sharedFromThis(), &appl::WorkerCloseFile::onCallbackCancel);
} }
tmpPopUp->propertyCloseOutEvent.set(true); tmpPopUp->propertyCloseOutEvent.set(true);
ememory::SharedPtr<ewol::widget::Windows> tmpWindows = ewol::getContext().getWindows(); ememory::SharedPtr<ewol::widget::Windows> tmpWindows = ewol::getContext().getWindows();
if (tmpWindows == nullptr) { if (tmpWindows == null) {
APPL_ERROR("Error to get the windows."); APPL_ERROR("Error to get the windows.");
destroy(); destroy();
return; return;
@ -107,25 +107,25 @@ void appl::WorkerCloseFile::onCallbackCancel() {
} }
void appl::WorkerCloseFile::onCallbackSaveAsValidate() { void appl::WorkerCloseFile::onCallbackSaveAsValidate() {
if (m_bufferManager == nullptr) { if (m_bufferManager == null) {
// nothing to do in this case ==> can do nothing ... // nothing to do in this case ==> can do nothing ...
return; return;
} }
m_worker = appl::WorkerSaveFile::create("buffer-name", m_bufferName); m_worker = appl::WorkerSaveFile::create("buffer-name", m_bufferName);
if (m_worker != nullptr) { if (m_worker != null) {
m_worker->signalSaveDone.connect(sharedFromThis(), &appl::WorkerCloseFile::onCallbackClose); m_worker->signalSaveDone.connect(sharedFromThis(), &appl::WorkerCloseFile::onCallbackClose);
m_worker->signalAbort.connect(sharedFromThis(), &appl::WorkerCloseFile::onCallbackCancel); m_worker->signalAbort.connect(sharedFromThis(), &appl::WorkerCloseFile::onCallbackCancel);
} }
} }
void appl::WorkerCloseFile::onCallbackSaveValidate() { void appl::WorkerCloseFile::onCallbackSaveValidate() {
if (m_bufferManager == nullptr) { if (m_bufferManager == null) {
// nothing to do in this case ==> can do nothing ... // nothing to do in this case ==> can do nothing ...
signalAbort.emit(); signalAbort.emit();
destroy(); destroy();
return; return;
} }
if (m_buffer == nullptr) { if (m_buffer == null) {
APPL_ERROR("Error to get the buffer : oldName=" << m_bufferName); APPL_ERROR("Error to get the buffer : oldName=" << m_bufferName);
signalAbort.emit(); signalAbort.emit();
destroy(); destroy();
@ -143,13 +143,13 @@ void appl::WorkerCloseFile::onCallbackSaveValidate() {
} }
void appl::WorkerCloseFile::onCallbackClose() { void appl::WorkerCloseFile::onCallbackClose() {
if (m_bufferManager == nullptr) { if (m_bufferManager == null) {
// nothing to do in this case ==> can do nothing ... // nothing to do in this case ==> can do nothing ...
signalAbort.emit(); signalAbort.emit();
destroy(); destroy();
return; return;
} }
if (m_buffer == nullptr) { if (m_buffer == null) {
APPL_ERROR("Error to get the buffer : " << m_bufferName); APPL_ERROR("Error to get the buffer : " << m_bufferName);
signalAbort.emit(); signalAbort.emit();
destroy(); destroy();

View File

@ -15,14 +15,14 @@ appl::WorkerSaveAllFile::WorkerSaveAllFile() {
void appl::WorkerSaveAllFile::init() { void appl::WorkerSaveAllFile::init() {
ewol::object::Worker::init(); ewol::object::Worker::init();
if (m_bufferManager == nullptr) { if (m_bufferManager == null) {
APPL_ERROR("can not call unexistant buffer manager ... "); APPL_ERROR("can not call unexistant buffer manager ... ");
destroy(); destroy();
return; return;
} }
// List all current open file : // List all current open file :
for (auto &it : *m_bufferManager) { for (auto &it : *m_bufferManager) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
if (it->isModify() == false) { if (it->isModify() == false) {
@ -55,7 +55,7 @@ appl::WorkerSaveAllFile::~WorkerSaveAllFile() {
} }
void appl::WorkerSaveAllFile::onCallbackSaveAsDone() { void appl::WorkerSaveAllFile::onCallbackSaveAsDone() {
if (m_bufferManager == nullptr) { if (m_bufferManager == null) {
// nothing to do in this case ==> can do nothing ... // nothing to do in this case ==> can do nothing ...
return; return;
} }

View File

@ -20,7 +20,7 @@ appl::WorkerSaveFile::WorkerSaveFile() :
void appl::WorkerSaveFile::init() { void appl::WorkerSaveFile::init() {
ewol::object::Worker::init(); ewol::object::Worker::init();
if (m_bufferManager == nullptr) { if (m_bufferManager == null) {
APPL_ERROR("can not call unexistant buffer manager ... "); APPL_ERROR("can not call unexistant buffer manager ... ");
destroy(); destroy();
return; return;
@ -28,7 +28,7 @@ void appl::WorkerSaveFile::init() {
if (*propertyBufferName == "") { if (*propertyBufferName == "") {
// need to find the curent file ... // need to find the curent file ...
ememory::SharedPtr<appl::Buffer> tmpp = m_bufferManager->getBufferSelected(); ememory::SharedPtr<appl::Buffer> tmpp = m_bufferManager->getBufferSelected();
if (tmpp == nullptr) { if (tmpp == null) {
APPL_ERROR("No selected buffer now ..."); APPL_ERROR("No selected buffer now ...");
destroy(); destroy();
return; return;
@ -41,7 +41,7 @@ void appl::WorkerSaveFile::init() {
return; return;
} }
ememory::SharedPtr<appl::Buffer> tmpBuffer = m_bufferManager->get(*propertyBufferName); ememory::SharedPtr<appl::Buffer> tmpBuffer = m_bufferManager->get(*propertyBufferName);
if (tmpBuffer == nullptr) { if (tmpBuffer == null) {
APPL_ERROR("Error to get the buffer : " << *propertyBufferName); APPL_ERROR("Error to get the buffer : " << *propertyBufferName);
destroy(); destroy();
return; return;
@ -55,7 +55,7 @@ void appl::WorkerSaveFile::init() {
} }
} }
m_chooser = ewol::widget::FileChooser::create(); m_chooser = ewol::widget::FileChooser::create();
if (m_chooser == nullptr) { if (m_chooser == null) {
APPL_ERROR("Can not allocate widget == > display might be in error"); APPL_ERROR("Can not allocate widget == > display might be in error");
destroy(); destroy();
return; return;
@ -66,7 +66,7 @@ void appl::WorkerSaveFile::init() {
m_chooser->propertyPath.set(tmpName.getNameFolder()); m_chooser->propertyPath.set(tmpName.getNameFolder());
m_chooser->propertyFile.set(tmpName.getNameFile()); m_chooser->propertyFile.set(tmpName.getNameFile());
ememory::SharedPtr<ewol::widget::Windows> tmpWindows = ewol::getContext().getWindows(); ememory::SharedPtr<ewol::widget::Windows> tmpWindows = ewol::getContext().getWindows();
if (tmpWindows == nullptr) { if (tmpWindows == null) {
APPL_ERROR("Error to get the windows."); APPL_ERROR("Error to get the windows.");
destroy(); destroy();
return; return;
@ -86,7 +86,7 @@ void appl::WorkerSaveFile::onCallbackCancel() {
} }
void appl::WorkerSaveFile::onCallbackSaveAsValidate(const etk::String& _value) { void appl::WorkerSaveFile::onCallbackSaveAsValidate(const etk::String& _value) {
if (m_bufferManager == nullptr) { if (m_bufferManager == null) {
// nothing to do in this case ==> can do nothing ... // nothing to do in this case ==> can do nothing ...
destroy(); destroy();
return; return;
@ -102,7 +102,7 @@ void appl::WorkerSaveFile::onCallbackSaveAsValidate(const etk::String& _value) {
return; return;
} }
ememory::SharedPtr<appl::Buffer> tmpBuffer = m_bufferManager->get(*propertyBufferName); ememory::SharedPtr<appl::Buffer> tmpBuffer = m_bufferManager->get(*propertyBufferName);
if (tmpBuffer == nullptr) { if (tmpBuffer == null) {
APPL_ERROR("Error to get the buffer : " << *propertyBufferName); APPL_ERROR("Error to get the buffer : " << *propertyBufferName);
destroy(); destroy();
return; return;

View File

@ -29,7 +29,7 @@ void appl::highlightManager::init() {
// get the subfolder list : // get the subfolder list :
etk::Vector<etk::FSNode *> list = myFile.folderGetSubList(false, true, false,false); etk::Vector<etk::FSNode *> list = myFile.folderGetSubList(false, true, false,false);
for (auto &it : list) { for (auto &it : list) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
if (it->getNodeType() != etk::typeNode_folder) { if (it->getNodeType() != etk::typeNode_folder) {
@ -38,10 +38,10 @@ void appl::highlightManager::init() {
etk::String filename = it->getName() + "/highlight.xml"; etk::String filename = it->getName() + "/highlight.xml";
APPL_DEBUG("Load xml name : " << filename); APPL_DEBUG("Load xml name : " << filename);
ememory::SharedPtr<appl::Highlight> myHightLine = appl::Highlight::create(filename); ememory::SharedPtr<appl::Highlight> myHightLine = appl::Highlight::create(filename);
if (myHightLine != nullptr) { if (myHightLine != null) {
// Check if the language name already exist // Check if the language name already exist
for (auto &it2 : hlList) { for (auto &it2 : hlList) {
if ( it2 != nullptr if ( it2 != null
&& it2->getTypeName() == myHightLine->getTypeName() ) { && it2->getTypeName() == myHightLine->getTypeName() ) {
APPL_WARNING("LANGUAGE : replace pattern name: '" << myHightLine->getTypeName() << "' with file '" << filename << "' replace: " << it2->getName()); APPL_WARNING("LANGUAGE : replace pattern name: '" << myHightLine->getTypeName() << "' with file '" << filename << "' replace: " << it2->getName());
} }
@ -53,7 +53,7 @@ void appl::highlightManager::init() {
} }
// display : // display :
for (auto &it : hlList) { for (auto &it : hlList) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
it->display(); it->display();
@ -77,7 +77,7 @@ etk::String appl::highlightManager::getTypeFile(const etk::String& _fileName) {
APPL_WARNING("Try to find type for extention : '" << _fileName << "' in " << s_list().size() << " types"); APPL_WARNING("Try to find type for extention : '" << _fileName << "' in " << s_list().size() << " types");
etk::Vector<ememory::SharedPtr<Highlight>>& hlList = s_list(); etk::Vector<ememory::SharedPtr<Highlight>>& hlList = s_list();
for (auto &it : hlList) { for (auto &it : hlList) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
APPL_WARNING(" check : " << it->getTypeName()); APPL_WARNING(" check : " << it->getTypeName());
@ -94,7 +94,7 @@ etk::String appl::highlightManager::getFileWithTypeType(const etk::String& _type
return ""; return "";
} }
for (auto &it : s_list()) { for (auto &it : s_list()) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
if (it->getTypeName() == _type) { if (it->getTypeName() == _type) {

View File

@ -21,7 +21,7 @@ appl::TextPluginCopy::TextPluginCopy() :
void appl::TextPluginCopy::onPluginEnable(appl::TextViewer& _textDrawer) { void appl::TextPluginCopy::onPluginEnable(appl::TextViewer& _textDrawer) {
// add event : // add event :
ememory::SharedPtr<ewol::widget::Menu> menu = m_menuInterface.lock(); ememory::SharedPtr<ewol::widget::Menu> menu = m_menuInterface.lock();
if (menu != nullptr) { if (menu != null) {
m_menuIdTitle = menu->addTitle("_T{Edit}"); m_menuIdTitle = menu->addTitle("_T{Edit}");
if (m_menuIdTitle != -1) { if (m_menuIdTitle != -1) {
m_menuIdCopy = menu->add(m_menuIdTitle, "_T{Copy}", "", "appl::TextPluginCopy::menu:copy"); m_menuIdCopy = menu->add(m_menuIdTitle, "_T{Copy}", "", "appl::TextPluginCopy::menu:copy");
@ -40,7 +40,7 @@ void appl::TextPluginCopy::onPluginDisable(appl::TextViewer& _textDrawer) {
_textDrawer.ext_shortCutRm("appl::TextPluginCopy::copy"); _textDrawer.ext_shortCutRm("appl::TextPluginCopy::copy");
_textDrawer.ext_shortCutRm("appl::TextPluginCopy::Paste"); _textDrawer.ext_shortCutRm("appl::TextPluginCopy::Paste");
ememory::SharedPtr<ewol::widget::Menu> menu = m_menuInterface.lock(); ememory::SharedPtr<ewol::widget::Menu> menu = m_menuInterface.lock();
if (menu != nullptr) { if (menu != null) {
menu->remove(m_menuIdRemove); menu->remove(m_menuIdRemove);
menu->remove(m_menuIdPast); menu->remove(m_menuIdPast);
menu->remove(m_menuIdCut); menu->remove(m_menuIdCut);

View File

@ -19,7 +19,7 @@ void appl::setCtagsFileName(const etk::String& _file) {
appl::TextPluginCtags::TextPluginCtags() : appl::TextPluginCtags::TextPluginCtags() :
m_tagFolderBase(""), m_tagFolderBase(""),
m_tagFilename(""), m_tagFilename(""),
m_ctagFile(nullptr) { m_ctagFile(null) {
m_activateOnReceiveShortCut = true; m_activateOnReceiveShortCut = true;
// load buffer manager: // load buffer manager:
m_bufferManager = appl::BufferManager::create(); m_bufferManager = appl::BufferManager::create();
@ -47,7 +47,7 @@ void appl::TextPluginCtags::onPluginDisable(appl::TextViewer& _textDrawer) {
} }
void appl::TextPluginCtags::jumpTo(const etk::String& _name) { void appl::TextPluginCtags::jumpTo(const etk::String& _name) {
if (m_ctagFile == nullptr) { if (m_ctagFile == null) {
APPL_WARNING("No ctags file open"); APPL_WARNING("No ctags file open");
return; return;
} }
@ -69,7 +69,7 @@ void appl::TextPluginCtags::jumpTo(const etk::String& _name) {
if (tagsFindNext (m_ctagFile, &entry) == TagSuccess) { if (tagsFindNext (m_ctagFile, &entry) == TagSuccess) {
APPL_INFO("Multiple file destination ..."); APPL_INFO("Multiple file destination ...");
ememory::SharedPtr<appl::TagFileSelection> tmpWidget = appl::TagFileSelection::create(); ememory::SharedPtr<appl::TagFileSelection> tmpWidget = appl::TagFileSelection::create();
if (tmpWidget == nullptr) { if (tmpWidget == null) {
APPL_ERROR("Can not allocate widget == > display might be in error"); APPL_ERROR("Can not allocate widget == > display might be in error");
} else { } else {
tmpWidget->addCtagsNewItem(myfile.getFileSystemName(), lineID); tmpWidget->addCtagsNewItem(myfile.getFileSystemName(), lineID);
@ -91,7 +91,7 @@ void appl::TextPluginCtags::jumpTo(const etk::String& _name) {
void appl::TextPluginCtags::jumpFile(const etk::String& _filename, int64_t _lineId) { void appl::TextPluginCtags::jumpFile(const etk::String& _filename, int64_t _lineId) {
// save the current file in the history // save the current file in the history
// TODO : registerHistory(); // TODO : registerHistory();
if (m_bufferManager != nullptr) { if (m_bufferManager != null) {
etk::String plop = _filename; etk::String plop = _filename;
while (plop[0] == '/') { while (plop[0] == '/') {
plop.erase(0); plop.erase(0);
@ -105,9 +105,9 @@ void appl::TextPluginCtags::jumpFile(const etk::String& _filename, int64_t _line
void appl::TextPluginCtags::loadTagFile() { void appl::TextPluginCtags::loadTagFile() {
tagFileInfo info; tagFileInfo info;
// close previous tag file // close previous tag file
if (nullptr != m_ctagFile) { if (null != m_ctagFile) {
tagsClose(m_ctagFile); tagsClose(m_ctagFile);
m_ctagFile = nullptr; m_ctagFile = null;
} }
if (m_tagFilename == "") { if (m_tagFilename == "") {
return; return;
@ -115,7 +115,7 @@ void appl::TextPluginCtags::loadTagFile() {
// load (open) the tag file : // load (open) the tag file :
APPL_INFO("try to open tag file : " << m_tagFilename); APPL_INFO("try to open tag file : " << m_tagFilename);
m_ctagFile = tagsOpen(m_tagFilename.c_str(), &info); m_ctagFile = tagsOpen(m_tagFilename.c_str(), &info);
if (nullptr != m_ctagFile) { if (null != m_ctagFile) {
APPL_INFO("open exuberant Ctags file is OK ..."); APPL_INFO("open exuberant Ctags file is OK ...");
} else { } else {
APPL_INFO("Error to open ctags file ..."); APPL_INFO("Error to open ctags file ...");
@ -132,7 +132,7 @@ void appl::TextPluginCtags::printTag(const tagEntry *_entry) {
<< "\" at line="<< (int32_t)_entry->address.lineNumber); << "\" at line="<< (int32_t)_entry->address.lineNumber);
APPL_INFO("Extention field : "); APPL_INFO("Extention field : ");
if (_entry->kind != nullptr && _entry->kind [0] != '\0') { if (_entry->kind != null && _entry->kind [0] != '\0') {
APPL_INFO(" kind : " << _entry->kind); APPL_INFO(" kind : " << _entry->kind);
} }
if (_entry->fileScope) { if (_entry->fileScope) {
@ -170,7 +170,7 @@ bool appl::TextPluginCtags::onReceiveShortCut(appl::TextViewer& _textDrawer,
if (_shortCutName == "appl::TextPluginCtags::OpenCtagsFile") { if (_shortCutName == "appl::TextPluginCtags::OpenCtagsFile") {
APPL_INFO("Request opening ctag file"); APPL_INFO("Request opening ctag file");
ememory::SharedPtr<ewol::widget::FileChooser> tmpWidget = ewol::widget::FileChooser::create(); ememory::SharedPtr<ewol::widget::FileChooser> tmpWidget = ewol::widget::FileChooser::create();
if (tmpWidget == nullptr) { if (tmpWidget == null) {
APPL_ERROR("Can not allocate widget == > display might be in error"); APPL_ERROR("Can not allocate widget == > display might be in error");
return true; return true;
} }

View File

@ -21,7 +21,7 @@ namespace appl {
DECLARE_FACTORY(TextViewerPluginData); DECLARE_FACTORY(TextViewerPluginData);
virtual ~TextViewerPluginData() { virtual ~TextViewerPluginData() {
for (size_t iii = 0; iii < m_specificData.size() ; ++iii) { for (size_t iii = 0; iii < m_specificData.size() ; ++iii) {
if (m_specificData[iii].second != nullptr) { if (m_specificData[iii].second != null) {
remove(*m_specificData[iii].second); remove(*m_specificData[iii].second);
} }
} }
@ -34,7 +34,7 @@ namespace appl {
auto it = m_specificData.begin(); auto it = m_specificData.begin();
while(it != m_specificData.end()) { while(it != m_specificData.end()) {
ememory::SharedPtr<appl::Buffer> buf = it->first.lock(); ememory::SharedPtr<appl::Buffer> buf = it->first.lock();
if (buf == nullptr) { if (buf == null) {
it = m_specificData.erase(it); it = m_specificData.erase(it);
continue; continue;
} }
@ -44,9 +44,9 @@ namespace appl {
++it; ++it;
} }
ememory::UniquePtr<TYPE> data(ETK_NEW(TYPE)); ememory::UniquePtr<TYPE> data(ETK_NEW(TYPE));
if (data == nullptr) { if (data == null) {
APPL_ERROR("ALLOCATION plugin data error"); APPL_ERROR("ALLOCATION plugin data error");
return nullptr; return null;
} }
TYPE* copyPocalPointer = data.get(); TYPE* copyPocalPointer = data.get();
ememory::WeakPtr<appl::Buffer> tmpBuffer = _textDrawer.internalGetBuffer(); ememory::WeakPtr<appl::Buffer> tmpBuffer = _textDrawer.internalGetBuffer();
@ -58,7 +58,7 @@ namespace appl {
bool onReceiveShortCut(appl::TextViewer& _textDrawer, bool onReceiveShortCut(appl::TextViewer& _textDrawer,
const etk::String& _shortCutName) { const etk::String& _shortCutName) {
TYPE* data = getDataRef(_textDrawer); TYPE* data = getDataRef(_textDrawer);
if (data == nullptr) { if (data == null) {
return false; return false;
} }
return onDataReceiveShortCut(_textDrawer, _shortCutName, *data); return onDataReceiveShortCut(_textDrawer, _shortCutName, *data);
@ -67,7 +67,7 @@ namespace appl {
const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _pos,
const etk::String& _data) { const etk::String& _data) {
TYPE* data = getDataRef(_textDrawer); TYPE* data = getDataRef(_textDrawer);
if (data == nullptr) { if (data == null) {
return false; return false;
} }
return onDataWrite(_textDrawer, _pos, _data, *data); return onDataWrite(_textDrawer, _pos, _data, *data);
@ -77,7 +77,7 @@ namespace appl {
const etk::String& _data, const etk::String& _data,
const appl::Buffer::Iterator& _posEnd) { const appl::Buffer::Iterator& _posEnd) {
TYPE* data = getDataRef(_textDrawer); TYPE* data = getDataRef(_textDrawer);
if (data == nullptr) { if (data == null) {
return false; return false;
} }
return onDataReplace(_textDrawer, _pos, _data, _posEnd, *data); return onDataReplace(_textDrawer, _pos, _data, _posEnd, *data);
@ -86,7 +86,7 @@ namespace appl {
const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _pos,
const appl::Buffer::Iterator& _posEnd) { const appl::Buffer::Iterator& _posEnd) {
TYPE* data = getDataRef(_textDrawer); TYPE* data = getDataRef(_textDrawer);
if (data == nullptr) { if (data == null) {
return false; return false;
} }
return onDataRemove(_textDrawer, _pos, _posEnd, *data); return onDataRemove(_textDrawer, _pos, _posEnd, *data);

View File

@ -21,7 +21,7 @@ appl::TextPluginHistory::TextPluginHistory() :
void appl::TextPluginHistory::onPluginEnable(appl::TextViewer& _textDrawer) { void appl::TextPluginHistory::onPluginEnable(appl::TextViewer& _textDrawer) {
ememory::SharedPtr<ewol::widget::Menu> menu = m_menuInterface.lock(); ememory::SharedPtr<ewol::widget::Menu> menu = m_menuInterface.lock();
if (menu != nullptr) { if (menu != null) {
m_menuIdTitle = menu->addTitle("_T{Edit}"); m_menuIdTitle = menu->addTitle("_T{Edit}");
if (m_menuIdTitle != -1) { if (m_menuIdTitle != -1) {
m_menuIdUndo = menu->add(m_menuIdTitle, "_T{Undo}", "THEME:GUI:Undo.svg", "appl::TextPluginHistory::menu:undo"); m_menuIdUndo = menu->add(m_menuIdTitle, "_T{Undo}", "THEME:GUI:Undo.svg", "appl::TextPluginHistory::menu:undo");
@ -37,7 +37,7 @@ void appl::TextPluginHistory::onPluginDisable(appl::TextViewer& _textDrawer) {
_textDrawer.ext_shortCutRm("appl::TextPluginHistory::Undo"); _textDrawer.ext_shortCutRm("appl::TextPluginHistory::Undo");
_textDrawer.ext_shortCutRm("appl::TextPluginHistory::Redo"); _textDrawer.ext_shortCutRm("appl::TextPluginHistory::Redo");
ememory::SharedPtr<ewol::widget::Menu> menu = m_menuInterface.lock(); ememory::SharedPtr<ewol::widget::Menu> menu = m_menuInterface.lock();
if (menu != nullptr) { if (menu != null) {
menu->remove(m_menuIdRedo); menu->remove(m_menuIdRedo);
menu->remove(m_menuIdUndo); menu->remove(m_menuIdUndo);
menu->remove(m_menuIdTitle); menu->remove(m_menuIdTitle);
@ -57,7 +57,7 @@ bool appl::TextPluginHistory::onDataReceiveShortCut(appl::TextViewer& _textDrawe
if (_data.m_redo.size() == 0) { if (_data.m_redo.size() == 0) {
return true; return true;
} }
if (_data.m_redo[_data.m_redo.size()-1] == nullptr) { if (_data.m_redo[_data.m_redo.size()-1] == null) {
_data.m_redo.popBack(); _data.m_redo.popBack();
return true; return true;
} }
@ -73,7 +73,7 @@ bool appl::TextPluginHistory::onDataReceiveShortCut(appl::TextViewer& _textDrawe
if (_data.m_undo.size() == 0) { if (_data.m_undo.size() == 0) {
return true; return true;
} }
if (_data.m_undo[_data.m_undo.size()-1] == nullptr) { if (_data.m_undo[_data.m_undo.size()-1] == null) {
_data.m_undo.popBack(); _data.m_undo.popBack();
return true; return true;
} }
@ -94,11 +94,11 @@ void appl::TextPluginHistory::clearRedo(appl::PluginHistoryData& _data) {
return; return;
} }
for (size_t iii=0; iii<_data.m_redo.size(); ++iii) { for (size_t iii=0; iii<_data.m_redo.size(); ++iii) {
if (_data.m_redo[iii] == nullptr) { if (_data.m_redo[iii] == null) {
continue; continue;
} }
ETK_DELETE(appl::History, _data.m_redo[iii]); ETK_DELETE(appl::History, _data.m_redo[iii]);
_data.m_redo[iii] = nullptr; _data.m_redo[iii] = null;
} }
_data.m_redo.clear(); _data.m_redo.clear();
} }
@ -108,11 +108,11 @@ void appl::TextPluginHistory::clearUndo(appl::PluginHistoryData& _data) {
return; return;
} }
for (size_t iii=0; iii<_data.m_undo.size(); ++iii) { for (size_t iii=0; iii<_data.m_undo.size(); ++iii) {
if (_data.m_undo[iii] == nullptr) { if (_data.m_undo[iii] == null) {
continue; continue;
} }
ETK_DELETE(appl::History, _data.m_undo[iii]); ETK_DELETE(appl::History, _data.m_undo[iii]);
_data.m_undo[iii] = nullptr; _data.m_undo[iii] = null;
} }
_data.m_undo.clear(); _data.m_undo.clear();
} }
@ -126,7 +126,7 @@ bool appl::TextPluginHistory::onDataWrite(appl::TextViewer& _textDrawer,
return false; return false;
} }
appl::History *tmpElement = ETK_NEW(appl::History); appl::History *tmpElement = ETK_NEW(appl::History);
if (tmpElement != nullptr) { if (tmpElement != null) {
tmpElement->m_addedText = _strData; tmpElement->m_addedText = _strData;
tmpElement->m_posAdded = (int64_t)_pos; tmpElement->m_posAdded = (int64_t)_pos;
tmpElement->m_endPosRemoved = (int64_t)_pos; tmpElement->m_endPosRemoved = (int64_t)_pos;
@ -134,13 +134,13 @@ bool appl::TextPluginHistory::onDataWrite(appl::TextViewer& _textDrawer,
APPL_ERROR("History allocation error"); APPL_ERROR("History allocation error");
} }
_textDrawer.writeDirect(_strData, _pos); _textDrawer.writeDirect(_strData, _pos);
if (tmpElement != nullptr) { if (tmpElement != null) {
tmpElement->m_endPosAdded = (int64_t)_textDrawer.cursor(); tmpElement->m_endPosAdded = (int64_t)_textDrawer.cursor();
clearRedo(_data); clearRedo(_data);
_data.m_undo.pushBack(tmpElement); _data.m_undo.pushBack(tmpElement);
} }
ememory::SharedPtr<appl::textPluginManager> mng = m_pluginManager.lock(); ememory::SharedPtr<appl::textPluginManager> mng = m_pluginManager.lock();
if (mng!=nullptr) { if (mng!=null) {
mng->onCursorMove(_textDrawer, _textDrawer.cursor()); mng->onCursorMove(_textDrawer, _textDrawer.cursor());
} }
return true; return true;
@ -155,20 +155,20 @@ bool appl::TextPluginHistory::onDataReplace(appl::TextViewer& _textDrawer,
return false; return false;
} }
appl::History *tmpElement = ETK_NEW(appl::History); appl::History *tmpElement = ETK_NEW(appl::History);
if (tmpElement != nullptr) { if (tmpElement != null) {
tmpElement->m_posAdded = (int64_t)_pos; tmpElement->m_posAdded = (int64_t)_pos;
tmpElement->m_addedText = _strData; tmpElement->m_addedText = _strData;
tmpElement->m_endPosRemoved = (int64_t)_posEnd; tmpElement->m_endPosRemoved = (int64_t)_posEnd;
_textDrawer.copy(tmpElement->m_removedText, _pos, _posEnd); _textDrawer.copy(tmpElement->m_removedText, _pos, _posEnd);
} }
_textDrawer.replaceDirect(_strData, _pos, _posEnd); _textDrawer.replaceDirect(_strData, _pos, _posEnd);
if (tmpElement != nullptr) { if (tmpElement != null) {
tmpElement->m_endPosAdded = (int64_t)_textDrawer.cursor(); tmpElement->m_endPosAdded = (int64_t)_textDrawer.cursor();
clearRedo(_data); clearRedo(_data);
_data.m_undo.pushBack(tmpElement); _data.m_undo.pushBack(tmpElement);
} }
ememory::SharedPtr<appl::textPluginManager> mng = m_pluginManager.lock(); ememory::SharedPtr<appl::textPluginManager> mng = m_pluginManager.lock();
if (mng!=nullptr) { if (mng!=null) {
mng->onCursorMove(_textDrawer, _textDrawer.cursor()); mng->onCursorMove(_textDrawer, _textDrawer.cursor());
} }
return true; return true;
@ -182,7 +182,7 @@ bool appl::TextPluginHistory::onDataRemove(appl::TextViewer& _textDrawer,
return false; return false;
} }
appl::History *tmpElement = ETK_NEW(appl::History); appl::History *tmpElement = ETK_NEW(appl::History);
if (tmpElement != nullptr) { if (tmpElement != null) {
tmpElement->m_addedText = ""; tmpElement->m_addedText = "";
tmpElement->m_posAdded = (int64_t)_pos; tmpElement->m_posAdded = (int64_t)_pos;
tmpElement->m_endPosAdded = tmpElement->m_posAdded; tmpElement->m_endPosAdded = tmpElement->m_posAdded;
@ -193,7 +193,7 @@ bool appl::TextPluginHistory::onDataRemove(appl::TextViewer& _textDrawer,
} }
_textDrawer.removeDirect(); _textDrawer.removeDirect();
ememory::SharedPtr<appl::textPluginManager> mng = m_pluginManager.lock(); ememory::SharedPtr<appl::textPluginManager> mng = m_pluginManager.lock();
if (mng!=nullptr) { if (mng!=null) {
mng->onCursorMove(_textDrawer, _textDrawer.cursor()); mng->onCursorMove(_textDrawer, _textDrawer.cursor());
} }
return true; return true;

View File

@ -31,7 +31,7 @@ void appl::textPluginManager::addDefaultPlugin() {
} }
void appl::textPluginManager::addPlugin(ememory::SharedPtr<appl::TextViewerPlugin> _plugin) { void appl::textPluginManager::addPlugin(ememory::SharedPtr<appl::TextViewerPlugin> _plugin) {
if (_plugin == nullptr) { if (_plugin == null) {
return; return;
} }
APPL_DEBUG("Add plugin : " << _plugin->getObjectType()); APPL_DEBUG("Add plugin : " << _plugin->getObjectType());
@ -58,7 +58,7 @@ void appl::textPluginManager::addPlugin(ememory::SharedPtr<appl::TextViewerPlugi
m_listOnCursorMove.pushBack(_plugin); m_listOnCursorMove.pushBack(_plugin);
} }
ememory::SharedPtr<appl::TextViewer> viewer = m_currentViewer.lock(); ememory::SharedPtr<appl::TextViewer> viewer = m_currentViewer.lock();
if (viewer != nullptr) { if (viewer != null) {
_plugin->onPluginEnable(*viewer); _plugin->onPluginEnable(*viewer);
} }
} }
@ -66,7 +66,7 @@ void appl::textPluginManager::addPlugin(ememory::SharedPtr<appl::TextViewerPlugi
void appl::textPluginManager::connect(appl::TextViewer& _widget) { void appl::textPluginManager::connect(appl::TextViewer& _widget) {
m_currentViewer = ememory::dynamicPointerCast<appl::TextViewer>(_widget.sharedFromThis()); m_currentViewer = ememory::dynamicPointerCast<appl::TextViewer>(_widget.sharedFromThis());
for (auto &it : m_list) { for (auto &it : m_list) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
it->onPluginEnable(_widget); it->onPluginEnable(_widget);
@ -76,7 +76,7 @@ void appl::textPluginManager::connect(appl::TextViewer& _widget) {
void appl::textPluginManager::disconnect(appl::TextViewer& _widget) { void appl::textPluginManager::disconnect(appl::TextViewer& _widget) {
m_currentViewer.reset(); m_currentViewer.reset();
for (auto &it : m_list) { for (auto &it : m_list) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
it->onPluginDisable(_widget); it->onPluginDisable(_widget);
@ -86,7 +86,7 @@ void appl::textPluginManager::disconnect(appl::TextViewer& _widget) {
bool appl::textPluginManager::onEventEntry(appl::TextViewer& _textDrawer, bool appl::textPluginManager::onEventEntry(appl::TextViewer& _textDrawer,
const ewol::event::Entry& _event) { const ewol::event::Entry& _event) {
for (auto &it : m_listOnEventEntry) { for (auto &it : m_listOnEventEntry) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
if (it->onEventEntry(_textDrawer, _event) == true ) { if (it->onEventEntry(_textDrawer, _event) == true ) {
@ -99,7 +99,7 @@ bool appl::textPluginManager::onEventEntry(appl::TextViewer& _textDrawer,
bool appl::textPluginManager::onEventInput(appl::TextViewer& _textDrawer, bool appl::textPluginManager::onEventInput(appl::TextViewer& _textDrawer,
const ewol::event::Input& _event) { const ewol::event::Input& _event) {
for (auto &it : m_listOnEventInput) { for (auto &it : m_listOnEventInput) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
if (it->onEventInput(_textDrawer, _event) == true ) { if (it->onEventInput(_textDrawer, _event) == true ) {
@ -113,7 +113,7 @@ bool appl::textPluginManager::onWrite(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _pos,
const etk::String& _data) { const etk::String& _data) {
for (auto &it : m_listOnWrite) { for (auto &it : m_listOnWrite) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
if (it->onWrite(_textDrawer, _pos, _data) == true ) { if (it->onWrite(_textDrawer, _pos, _data) == true ) {
@ -128,7 +128,7 @@ bool appl::textPluginManager::onReplace(appl::TextViewer& _textDrawer,
const etk::String& _data, const etk::String& _data,
const appl::Buffer::Iterator& _posEnd) { const appl::Buffer::Iterator& _posEnd) {
for (auto &it : m_listOnReplace) { for (auto &it : m_listOnReplace) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
if (it->onReplace(_textDrawer, _pos, _data, _posEnd) == true ) { if (it->onReplace(_textDrawer, _pos, _data, _posEnd) == true ) {
@ -142,7 +142,7 @@ bool appl::textPluginManager::onRemove(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _pos,
const appl::Buffer::Iterator& _posEnd) { const appl::Buffer::Iterator& _posEnd) {
for (auto &it : m_listOnRemove) { for (auto &it : m_listOnRemove) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
if (it->onRemove(_textDrawer, _pos, _posEnd) == true ) { if (it->onRemove(_textDrawer, _pos, _posEnd) == true ) {
@ -155,7 +155,7 @@ bool appl::textPluginManager::onRemove(appl::TextViewer& _textDrawer,
bool appl::textPluginManager::onReceiveShortCut(appl::TextViewer& _textDrawer, bool appl::textPluginManager::onReceiveShortCut(appl::TextViewer& _textDrawer,
const etk::String& _shortCutName) { const etk::String& _shortCutName) {
for (auto &it : m_listOnReceiveShortCutViewer) { for (auto &it : m_listOnReceiveShortCutViewer) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
if (it->onReceiveShortCut(_textDrawer, _shortCutName) == true ) { if (it->onReceiveShortCut(_textDrawer, _shortCutName) == true ) {
@ -168,7 +168,7 @@ bool appl::textPluginManager::onReceiveShortCut(appl::TextViewer& _textDrawer,
bool appl::textPluginManager::onCursorMove(appl::TextViewer& _textDrawer, bool appl::textPluginManager::onCursorMove(appl::TextViewer& _textDrawer,
const appl::Buffer::Iterator& _pos) { const appl::Buffer::Iterator& _pos) {
for (auto &it : m_listOnCursorMove) { for (auto &it : m_listOnCursorMove) {
if (it == nullptr) { if (it == null) {
continue; continue;
} }
if (it->onCursorMove(_textDrawer, _pos) == true ) { if (it->onCursorMove(_textDrawer, _pos) == true ) {

View File

@ -17,7 +17,7 @@ appl::TextPluginSelectAll::TextPluginSelectAll() :
void appl::TextPluginSelectAll::onPluginEnable(appl::TextViewer& _textDrawer) { void appl::TextPluginSelectAll::onPluginEnable(appl::TextViewer& _textDrawer) {
ememory::SharedPtr<ewol::widget::Menu> menu = m_menuInterface.lock(); ememory::SharedPtr<ewol::widget::Menu> menu = m_menuInterface.lock();
if (menu != nullptr) { if (menu != null) {
m_menuIdTitle = menu->addTitle("_T{Edit}"); m_menuIdTitle = menu->addTitle("_T{Edit}");
if (m_menuIdTitle != -1) { if (m_menuIdTitle != -1) {
m_menuIdSelectAll = menu->add(m_menuIdTitle, "_T{Select All}", "", "appl::TextPluginSelectAll::menu:select-all"); m_menuIdSelectAll = menu->add(m_menuIdTitle, "_T{Select All}", "", "appl::TextPluginSelectAll::menu:select-all");
@ -33,7 +33,7 @@ void appl::TextPluginSelectAll::onPluginDisable(appl::TextViewer& _textDrawer) {
_textDrawer.ext_shortCutRm("appl::TextPluginSelectAll::All"); _textDrawer.ext_shortCutRm("appl::TextPluginSelectAll::All");
_textDrawer.ext_shortCutRm("appl::TextPluginSelectAll::None"); _textDrawer.ext_shortCutRm("appl::TextPluginSelectAll::None");
ememory::SharedPtr<ewol::widget::Menu> menu = m_menuInterface.lock(); ememory::SharedPtr<ewol::widget::Menu> menu = m_menuInterface.lock();
if (menu != nullptr) { if (menu != null) {
menu->remove(m_menuIdSelectNone); menu->remove(m_menuIdSelectNone);
menu->remove(m_menuIdSelectAll); menu->remove(m_menuIdSelectAll);
menu->remove(m_menuIdTitle); menu->remove(m_menuIdTitle);

View File

@ -138,7 +138,7 @@ static int growString (vstring *s)
newLength = 2 * s->size; newLength = 2 * s->size;
newLine = (char*) realloc (s->buffer, newLength); newLine = (char*) realloc (s->buffer, newLength);
} }
if (newLine == nullptr) if (newLine == NULL)
perror ("string too large"); perror ("string too large");
else else
{ {
@ -154,13 +154,13 @@ static void copyName (tagFile *const file)
{ {
size_t length; size_t length;
const char *end = strchr (file->line.buffer, '\t'); const char *end = strchr (file->line.buffer, '\t');
if (end == nullptr) if (end == NULL)
{ {
end = strchr (file->line.buffer, '\n'); end = strchr (file->line.buffer, '\n');
if (end == nullptr) if (end == NULL)
end = strchr (file->line.buffer, '\r'); end = strchr (file->line.buffer, '\r');
} }
if (end != nullptr) if (end != NULL)
length = end - file->line.buffer; length = end - file->line.buffer;
else else
length = strlen (file->line.buffer); length = strlen (file->line.buffer);
@ -175,7 +175,7 @@ static int readTagLineRaw (tagFile *const file)
int result = 1; int result = 1;
int reReadLine; int reReadLine;
/* If reading the line places any character other than a null or a /* If reading the line places any character other than a NULL or a
* newline at the last character position in the buffer (one less than * newline at the last character position in the buffer (one less than
* the buffer size), then we must resize the buffer and reattempt to read * the buffer size), then we must resize the buffer and reattempt to read
* the line. * the line.
@ -189,7 +189,7 @@ static int readTagLineRaw (tagFile *const file)
reReadLine = 0; reReadLine = 0;
*pLastChar = '\0'; *pLastChar = '\0';
line = fgets (file->line.buffer, (int) file->line.size, file->fp); line = fgets (file->line.buffer, (int) file->line.size, file->fp);
if (line == nullptr) if (line == NULL)
{ {
/* read error */ /* read error */
if (! feof (file->fp)) if (! feof (file->fp))
@ -236,7 +236,7 @@ static tagResult growFields (tagFile *const file)
unsigned short newCount = (unsigned short) 2 * file->fields.max; unsigned short newCount = (unsigned short) 2 * file->fields.max;
tagExtensionField *newFields = (tagExtensionField*) tagExtensionField *newFields = (tagExtensionField*)
realloc (file->fields.list, newCount * sizeof (tagExtensionField)); realloc (file->fields.list, newCount * sizeof (tagExtensionField));
if (newFields == nullptr) if (newFields == NULL)
perror ("too many extension fields"); perror ("too many extension fields");
else else
{ {
@ -251,7 +251,7 @@ static void parseExtensionFields (tagFile *const file, tagEntry *const entry,
char *const string) char *const string)
{ {
char *p = string; char *p = string;
while (p != nullptr && *p != '\0') while (p != NULL && *p != '\0')
{ {
while (*p == TAB) while (*p == TAB)
*p++ = '\0'; *p++ = '\0';
@ -260,10 +260,10 @@ static void parseExtensionFields (tagFile *const file, tagEntry *const entry,
char *colon; char *colon;
char *field = p; char *field = p;
p = strchr (p, TAB); p = strchr (p, TAB);
if (p != nullptr) if (p != NULL)
*p++ = '\0'; *p++ = '\0';
colon = strchr (field, ':'); colon = strchr (field, ':');
if (colon == nullptr) if (colon == NULL)
entry->kind = field; entry->kind = field;
else else
{ {
@ -295,19 +295,19 @@ static void parseTagLine (tagFile *file, tagEntry *const entry)
char *p = file->line.buffer; char *p = file->line.buffer;
char *tab = strchr (p, TAB); char *tab = strchr (p, TAB);
entry->fields.list = nullptr; entry->fields.list = NULL;
entry->fields.count = 0; entry->fields.count = 0;
entry->kind = nullptr; entry->kind = NULL;
entry->fileScope = 0; entry->fileScope = 0;
entry->name = p; entry->name = p;
if (tab != nullptr) if (tab != NULL)
{ {
*tab = '\0'; *tab = '\0';
p = tab + 1; p = tab + 1;
entry->file = p; entry->file = p;
tab = strchr (p, TAB); tab = strchr (p, TAB);
if (tab != nullptr) if (tab != NULL)
{ {
int fieldsPresent; int fieldsPresent;
*tab = '\0'; *tab = '\0';
@ -321,8 +321,8 @@ static void parseTagLine (tagFile *file, tagEntry *const entry)
do do
{ {
p = strchr (p + 1, delimiter); p = strchr (p + 1, delimiter);
} while (p != nullptr && *(p - 1) == '\\'); } while (p != NULL && *(p - 1) == '\\');
if (p == nullptr) if (p == NULL)
{ {
/* invalid pattern */ /* invalid pattern */
} }
@ -351,19 +351,19 @@ static void parseTagLine (tagFile *file, tagEntry *const entry)
entry->fields.list = file->fields.list; entry->fields.list = file->fields.list;
for (i = entry->fields.count ; i < file->fields.max ; ++i) for (i = entry->fields.count ; i < file->fields.max ; ++i)
{ {
file->fields.list [i].key = nullptr; file->fields.list [i].key = NULL;
file->fields.list [i].value = nullptr; file->fields.list [i].value = NULL;
} }
} }
static char *duplicate (const char *str) static char *duplicate (const char *str)
{ {
char *result = nullptr; char *result = NULL;
if (str != nullptr) if (str != NULL)
{ {
result = strdup (str); result = strdup (str);
if (result == nullptr) if (result == NULL)
perror (nullptr); perror (NULL);
} }
return result; return result;
} }
@ -372,14 +372,14 @@ static void readPseudoTags (tagFile *const file, tagFileInfo *const info)
{ {
fpos_t startOfLine; fpos_t startOfLine;
const size_t prefixLength = strlen (PseudoTagPrefix); const size_t prefixLength = strlen (PseudoTagPrefix);
if (info != nullptr) if (info != NULL)
{ {
info->file.format = 1; info->file.format = 1;
info->file.sort = TAG_UNSORTED; info->file.sort = TAG_UNSORTED;
info->program.author = nullptr; info->program.author = NULL;
info->program.name = nullptr; info->program.name = NULL;
info->program.url = nullptr; info->program.url = NULL;
info->program.version = nullptr; info->program.version = NULL;
} }
while (1) while (1)
{ {
@ -407,7 +407,7 @@ static void readPseudoTags (tagFile *const file, tagFileInfo *const info)
file->program.url = duplicate (value); file->program.url = duplicate (value);
else if (strcmp (key, "TAG_PROGRAM_VERSION") == 0) else if (strcmp (key, "TAG_PROGRAM_VERSION") == 0)
file->program.version = duplicate (value); file->program.version = duplicate (value);
if (info != nullptr) if (info != NULL)
{ {
info->file.format = file->format; info->file.format = file->format;
info->file.sort = file->sortMethod; 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) static tagFile *initialize (const char *const filePath, tagFileInfo *const info)
{ {
tagFile *result = (tagFile*) calloc ((size_t) 1, sizeof (tagFile)); tagFile *result = (tagFile*) calloc ((size_t) 1, sizeof (tagFile));
if (result != nullptr) if (result != NULL)
{ {
growString (&result->line); growString (&result->line);
growString (&result->name); growString (&result->name);
@ -448,10 +448,10 @@ static tagFile *initialize (const char *const filePath, tagFileInfo *const info)
result->fields.list = (tagExtensionField*) calloc ( result->fields.list = (tagExtensionField*) calloc (
result->fields.max, sizeof (tagExtensionField)); result->fields.max, sizeof (tagExtensionField));
result->fp = fopen (filePath, "r"); result->fp = fopen (filePath, "r");
if (result->fp == nullptr) if (result->fp == NULL)
{ {
free (result); free (result);
result = nullptr; result = NULL;
info->status.error_number = errno; info->status.error_number = errno;
} }
else else
@ -475,15 +475,15 @@ static void terminate (tagFile *const file)
free (file->name.buffer); free (file->name.buffer);
free (file->fields.list); free (file->fields.list);
if (file->program.author != nullptr) if (file->program.author != NULL)
free (file->program.author); free (file->program.author);
if (file->program.name != nullptr) if (file->program.name != NULL)
free (file->program.name); free (file->program.name);
if (file->program.url != nullptr) if (file->program.url != NULL)
free (file->program.url); free (file->program.url);
if (file->program.version != nullptr) if (file->program.version != NULL)
free (file->program.version); free (file->program.version);
if (file->search.name != nullptr) if (file->search.name != NULL)
free (file->search.name); free (file->search.name);
memset (file, 0, sizeof (tagFile)); memset (file, 0, sizeof (tagFile));
@ -494,13 +494,13 @@ static void terminate (tagFile *const file)
static tagResult readNext (tagFile *const file, tagEntry *const entry) static tagResult readNext (tagFile *const file, tagEntry *const entry)
{ {
tagResult result; tagResult result;
if (file == nullptr || ! file->initialized) if (file == NULL || ! file->initialized)
result = TagFailure; result = TagFailure;
else if (! readTagLine (file)) else if (! readTagLine (file))
result = TagFailure; result = TagFailure;
else else
{ {
if (entry != nullptr) if (entry != NULL)
parseTagLine (file, entry); parseTagLine (file, entry);
result = TagSuccess; result = TagSuccess;
} }
@ -510,13 +510,13 @@ static tagResult readNext (tagFile *const file, tagEntry *const entry)
static const char *readFieldValue ( static const char *readFieldValue (
const tagEntry *const entry, const char *const key) const tagEntry *const entry, const char *const key)
{ {
const char *result = nullptr; const char *result = NULL;
int i; int i;
if (strcmp (key, "kind") == 0) if (strcmp (key, "kind") == 0)
result = entry->kind; result = entry->kind;
else if (strcmp (key, "file") == 0) else if (strcmp (key, "file") == 0)
result = EmptyString; result = EmptyString;
else for (i = 0 ; i < entry->fields.count && result == nullptr ; ++i) else for (i = 0 ; i < entry->fields.count && result == NULL ; ++i)
if (strcmp (entry->fields.list [i].key, key) == 0) if (strcmp (entry->fields.list [i].key, key) == 0)
result = entry->fields.list [i].value; result = entry->fields.list [i].value;
return result; return result;
@ -650,7 +650,7 @@ static tagResult find (tagFile *const file, tagEntry *const entry,
const char *const name, const int options) const char *const name, const int options)
{ {
tagResult result; tagResult result;
if (file->search.name != nullptr) if (file->search.name != NULL)
free (file->search.name); free (file->search.name);
file->search.name = duplicate (name); file->search.name = duplicate (name);
file->search.nameLength = strlen (name); file->search.nameLength = strlen (name);
@ -680,7 +680,7 @@ static tagResult find (tagFile *const file, tagEntry *const entry,
else else
{ {
file->search.pos = file->pos; file->search.pos = file->pos;
if (entry != nullptr) if (entry != NULL)
parseTagLine (file, entry); parseTagLine (file, entry);
} }
return result; return result;
@ -699,7 +699,7 @@ static tagResult findNext (tagFile *const file, tagEntry *const entry)
else else
{ {
result = findSequential (file); result = findSequential (file);
if (result == TagSuccess && entry != nullptr) if (result == TagSuccess && entry != NULL)
parseTagLine (file, entry); parseTagLine (file, entry);
} }
return result; 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) extern tagResult tagsSetSortType (tagFile *const file, const sortType type)
{ {
tagResult result = TagFailure; tagResult result = TagFailure;
if (file != nullptr && file->initialized) if (file != NULL && file->initialized)
{ {
file->sortMethod = type; file->sortMethod = type;
result = TagSuccess; result = TagSuccess;
@ -728,7 +728,7 @@ extern tagResult tagsSetSortType (tagFile *const file, const sortType type)
extern tagResult tagsFirst (tagFile *const file, tagEntry *const entry) extern tagResult tagsFirst (tagFile *const file, tagEntry *const entry)
{ {
tagResult result = TagFailure; tagResult result = TagFailure;
if (file != nullptr && file->initialized) if (file != NULL && file->initialized)
{ {
gotoFirstLogicalTag (file); gotoFirstLogicalTag (file);
result = readNext (file, entry); 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) extern tagResult tagsNext (tagFile *const file, tagEntry *const entry)
{ {
tagResult result = TagFailure; tagResult result = TagFailure;
if (file != nullptr && file->initialized) if (file != NULL && file->initialized)
result = readNext (file, entry); result = readNext (file, entry);
return result; return result;
} }
extern const char *tagsField (const tagEntry *const entry, const char *const key) extern const char *tagsField (const tagEntry *const entry, const char *const key)
{ {
const char *result = nullptr; const char *result = NULL;
if (entry != nullptr) if (entry != NULL)
result = readFieldValue (entry, key); result = readFieldValue (entry, key);
return result; return result;
} }
@ -756,7 +756,7 @@ extern tagResult tagsFind (tagFile *const file, tagEntry *const entry,
const char *const name, const int options) const char *const name, const int options)
{ {
tagResult result = TagFailure; tagResult result = TagFailure;
if (file != nullptr && file->initialized) if (file != NULL && file->initialized)
result = find (file, entry, name, options); result = find (file, entry, name, options);
return result; return result;
} }
@ -764,7 +764,7 @@ extern tagResult tagsFind (tagFile *const file, tagEntry *const entry,
extern tagResult tagsFindNext (tagFile *const file, tagEntry *const entry) extern tagResult tagsFindNext (tagFile *const file, tagEntry *const entry)
{ {
tagResult result = TagFailure; tagResult result = TagFailure;
if (file != nullptr && file->initialized) if (file != NULL && file->initialized)
result = findNext (file, entry); result = findNext (file, entry);
return result; return result;
} }
@ -772,7 +772,7 @@ extern tagResult tagsFindNext (tagFile *const file, tagEntry *const entry)
extern tagResult tagsClose (tagFile *const file) extern tagResult tagsClose (tagFile *const file)
{ {
tagResult result = TagFailure; tagResult result = TagFailure;
if (file != nullptr && file->initialized) if (file != NULL && file->initialized)
{ {
terminate (file); terminate (file);
result = TagSuccess; result = TagSuccess;
@ -804,7 +804,7 @@ static void printTag (const tagEntry *entry)
entry->name, entry->file, entry->address.pattern); entry->name, entry->file, entry->address.pattern);
if (extensionFields) if (extensionFields)
{ {
if (entry->kind != nullptr && entry->kind [0] != '\0') if (entry->kind != NULL && entry->kind [0] != '\0')
printf ("%s\tkind:%s", sep, entry->kind); printf ("%s\tkind:%s", sep, entry->kind);
if (entry->fileScope) if (entry->fileScope)
printf ("%s\tfile:", sep); printf ("%s\tfile:", sep);
@ -825,7 +825,7 @@ static void findTag (const char *const name, const int options)
tagFileInfo info; tagFileInfo info;
tagEntry entry; tagEntry entry;
tagFile *const file = tagsOpen (TagFileName, &info); tagFile *const file = tagsOpen (TagFileName, &info);
if (file == nullptr) if (file == NULL)
{ {
fprintf (stderr, "%s: cannot open tag file: %s: %s\n", fprintf (stderr, "%s: cannot open tag file: %s: %s\n",
ProgramName, strerror (info.status.error_number), name); ProgramName, strerror (info.status.error_number), name);
@ -851,7 +851,7 @@ static void listTags ()
tagFileInfo info; tagFileInfo info;
tagEntry entry; tagEntry entry;
tagFile *const file = tagsOpen (TagFileName, &info); tagFile *const file = tagsOpen (TagFileName, &info);
if (file == nullptr) if (file == NULL)
{ {
fprintf (stderr, "%s: cannot open tag file: %s: %s\n", fprintf (stderr, "%s: cannot open tag file: %s: %s\n",
ProgramName, strerror (info.status.error_number), TagFileName); ProgramName, strerror (info.status.error_number), TagFileName);
@ -927,7 +927,7 @@ extern int main (int argc, char **argv)
++j; ++j;
if (arg [j] == '\0') if (arg [j] == '\0')
SortMethod = TAG_SORTED; SortMethod = TAG_SORTED;
else if (strchr ("012", arg[j]) != nullptr) else if (strchr ("012", arg[j]) != NULL)
SortMethod = (sortType) (arg[j] - '0'); SortMethod = (sortType) (arg[j] - '0');
else else
{ {

View File

@ -114,7 +114,7 @@ typedef struct {
/* address for locating tag in source file */ /* address for locating tag in source file */
struct { struct {
/* pattern for locating source line /* pattern for locating source line
* (may be nullptr if not present) */ * (may be null if not present) */
const char *pattern; const char *pattern;
/* line number in source file of tag definition /* line number in source file of tag definition
@ -122,7 +122,7 @@ typedef struct {
unsigned long lineNumber; unsigned long lineNumber;
} address; } address;
/* kind of tag (may by name, character, or nullptr if not known) */ /* kind of tag (may by name, character, or null if not known) */
const char *kind; const char *kind;
/* is tag of file-limited scope? */ /* is tag of file-limited scope? */

View File

@ -85,7 +85,7 @@ class MainApplication : public ewol::context::Application {
ememory::SharedPtr<MainWindows> basicWindows = MainWindows::create(); ememory::SharedPtr<MainWindows> basicWindows = MainWindows::create();
if (basicWindows == nullptr) { if (basicWindows == null) {
APPL_ERROR("Can not allocate the basic windows"); APPL_ERROR("Can not allocate the basic windows");
_context.exit(-1); _context.exit(-1);
return; return;
@ -141,7 +141,7 @@ class MainApplication : public ewol::context::Application {
} }
void onKillDemand(ewol::Context& _context) override { void onKillDemand(ewol::Context& _context) override {
APPL_INFO("==> User demand kill ... " PROJECT_NAME " (START)"); APPL_INFO("==> User demand kill ... " PROJECT_NAME " (START)");
if (m_bufferManager == nullptr) { if (m_bufferManager == null) {
_context.exit(0); _context.exit(0);
} }
APPL_TODO("Implement the check of buffer not saved ..."); APPL_TODO("Implement the check of buffer not saved ...");