[DEV] buffer manager better work
This commit is contained in:
parent
7ddaa68bb0
commit
50c1830696
@ -118,6 +118,7 @@ bool appl::Buffer::loadFile(const etk::UString& _name) {
|
|||||||
setHighlightType("");
|
setHighlightType("");
|
||||||
etk::FSNode file(m_fileName);
|
etk::FSNode file(m_fileName);
|
||||||
if (file.exist() == false) {
|
if (file.exist() == false) {
|
||||||
|
APPL_INFO("File doesn not exist !!! " << file);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
m_nbLines = 0;
|
m_nbLines = 0;
|
||||||
@ -753,3 +754,4 @@ appl::HighlightInfo* appl::Buffer::getElementColorAtPosition(appl::DisplayHLData
|
|||||||
}
|
}
|
||||||
return getElementColorAtPosition(_pos, _MData.posHLPass1);
|
return getElementColorAtPosition(_pos, _MData.posHLPass1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -514,16 +514,15 @@ namespace appl {
|
|||||||
|
|
||||||
void regenerateHighLightAt(int32_t _pos, int32_t _nbDeleted, int32_t _nbAdded);
|
void regenerateHighLightAt(int32_t _pos, int32_t _nbDeleted, int32_t _nbAdded);
|
||||||
void findMainHighLightPosition(int32_t _startPos,
|
void findMainHighLightPosition(int32_t _startPos,
|
||||||
int32_t _endPos,
|
int32_t _endPos,
|
||||||
int32_t& _startId,
|
int32_t& _startId,
|
||||||
int32_t& _stopId,
|
int32_t& _stopId,
|
||||||
bool _backPreviousNotEnded);
|
bool _backPreviousNotEnded);
|
||||||
void generateHighLightAt(int32_t _pos, int32_t _endPos, int32_t _addingPos=0);
|
void generateHighLightAt(int32_t _pos, int32_t _endPos, int32_t _addingPos=0);
|
||||||
void cleanHighLight(void);
|
void cleanHighLight(void);
|
||||||
appl::HighlightInfo* getElementColorAtPosition(int32_t _pos, int32_t &_starPos);
|
appl::HighlightInfo* getElementColorAtPosition(int32_t _pos, int32_t &_starPos);
|
||||||
void hightlightGenerateLines(appl::DisplayHLData& _MData, int32_t _HLStart, int32_t _nbLines);
|
void hightlightGenerateLines(appl::DisplayHLData& _MData, int32_t _HLStart, int32_t _nbLines);
|
||||||
appl::HighlightInfo* getElementColorAtPosition(appl::DisplayHLData& _MData, int32_t _pos);
|
appl::HighlightInfo* getElementColorAtPosition(appl::DisplayHLData& _MData, int32_t _pos);
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -8,13 +8,107 @@
|
|||||||
|
|
||||||
#include <appl/debug.h>
|
#include <appl/debug.h>
|
||||||
#include <appl/global.h>
|
#include <appl/global.h>
|
||||||
#include <BufferManager.h>
|
#include <appl/BufferManager.h>
|
||||||
#include <ewol/renderer/EObject.h>
|
#include <ewol/renderer/EObject.h>
|
||||||
#include <ewol/renderer/EObjectManager.h>
|
#include <ewol/renderer/EObjectManager.h>
|
||||||
|
|
||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "BufferManager"
|
#define __class__ "BufferManager"
|
||||||
|
|
||||||
|
appl::BufferManager::BufferManager(void) :
|
||||||
|
ewol::Resource("???BufferManager???") {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
appl::BufferManager::~BufferManager(void) {
|
||||||
|
esize_t previousCount = m_list.size();
|
||||||
|
for (esize_t iii = m_list.size()-1; iii >= 0 ; --iii) {
|
||||||
|
if (m_list[iii] == NULL) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
delete(m_list[iii]);
|
||||||
|
if (previousCount == m_list.size()) {
|
||||||
|
APPL_ERROR("Error in removing buffer !! ");
|
||||||
|
}
|
||||||
|
previousCount = m_list.size();
|
||||||
|
}
|
||||||
|
m_list.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
appl::Buffer* appl::BufferManager::get(const etk::UString& _fileName, bool _createIfNeeded) {
|
||||||
|
for (esize_t iii = 0; iii < m_list.size(); ++iii) {
|
||||||
|
if (m_list[iii] == NULL) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_list[iii]->getFileName() == _fileName) {
|
||||||
|
return m_list[iii];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (_createIfNeeded == true) {
|
||||||
|
appl::Buffer* tmp = new appl::Buffer();
|
||||||
|
if (tmp == NULL) {
|
||||||
|
APPL_ERROR("Can not allocate the Buffer class : " << _fileName);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
tmp->loadFile(_fileName);
|
||||||
|
m_list.pushBack(tmp);
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void appl::BufferManager::onObjectRemove(ewol::EObject * _removeObject) {
|
||||||
|
for (esize_t iii = 0; iii < m_list.size(); ++iii) {
|
||||||
|
if (m_list[iii] != _removeObject) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
m_list[iii] = NULL;
|
||||||
|
m_list.remove(iii);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void appl::BufferManager::open(const etk::UString& _fileName) {
|
||||||
|
(void)get(_fileName, true);
|
||||||
|
sendMultiCast(appl::MsgSelectNewFile, _fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
void appl::BufferManager::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||||
|
APPL_DEBUG("receive message !!! " << _msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
appl::BufferManager* appl::BufferManager::keep(void) {
|
||||||
|
//EWOL_INFO("KEEP : appl::GlyphPainting : file : \"" << _filename << "\"");
|
||||||
|
appl::BufferManager* object = static_cast<appl::BufferManager*>(getManager().localKeep("???BufferManager???"));
|
||||||
|
if (NULL != object) {
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
// this element create a new one every time ....
|
||||||
|
EWOL_INFO("CREATE : appl::BufferManager: ???BufferManager???");
|
||||||
|
object = new appl::BufferManager();
|
||||||
|
if (NULL == object) {
|
||||||
|
EWOL_ERROR("allocation error of a resource : ???BufferManager???");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
getManager().localAdd(object);
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
|
||||||
|
void appl::BufferManager::release(appl::BufferManager*& _object) {
|
||||||
|
if (NULL == _object) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ewol::Resource* object2 = static_cast<ewol::Resource*>(_object);
|
||||||
|
getManager().release(object2);
|
||||||
|
_object = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef QSGDQSDFGSDFGSDFGZS8DFGHD_sDFGSDFGDGT
|
||||||
|
|
||||||
|
|
||||||
class classBufferManager: public ewol::EObject {
|
class classBufferManager: public ewol::EObject {
|
||||||
public:
|
public:
|
||||||
// Constructeur
|
// Constructeur
|
||||||
@ -399,30 +493,4 @@ appl::Buffer* get(esize_t _bufferID);
|
|||||||
esize_t size(void):
|
esize_t size(void):
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
appl::BufferManager* appl::BufferManager::keep(void) {
|
|
||||||
//EWOL_INFO("KEEP : appl::GlyphPainting : file : \"" << _filename << "\"");
|
|
||||||
appl::GlyphPainting* object = static_cast<appl::GlyphPainting*>(getManager().localKeep("???BufferManager???"));
|
|
||||||
if (NULL != object) {
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
// this element create a new one every time ....
|
|
||||||
EWOL_INFO("CREATE : appl::BufferManager: ???BufferManager???");
|
|
||||||
object = new appl::BufferManager();
|
|
||||||
if (NULL == object) {
|
|
||||||
EWOL_ERROR("allocation error of a resource : ???BufferManager???");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
getManager().localAdd(object);
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
|
|
||||||
void appl::GlyphPainting::release(appl::BufferManager*& _object) {
|
|
||||||
if (NULL == _object) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ewol::Resource* object2 = static_cast<ewol::Resource*>(_object);
|
|
||||||
getManager().release(object2);
|
|
||||||
_object = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -17,13 +17,31 @@
|
|||||||
namespace appl {
|
namespace appl {
|
||||||
class BufferManager : public ewol::Resource {
|
class BufferManager : public ewol::Resource {
|
||||||
protected:
|
protected:
|
||||||
void BufferManager(void);
|
BufferManager(void);
|
||||||
void ~BufferManager(void);
|
~BufferManager(void);
|
||||||
|
private:
|
||||||
|
etk::Vector<appl::Buffer*> m_list; // list of all buffer curently open
|
||||||
public:
|
public:
|
||||||
appl::Buffer* get(const etk::UString& _filename);
|
/**
|
||||||
|
* @brief Get a specific buffer with his name (can create a new buffer).
|
||||||
|
* @param[in] _fileName Name of the file to open.
|
||||||
|
* @param[in] _createIfNeeded Create the buffer if not existed.
|
||||||
|
* @return a pointer on the buffer
|
||||||
|
*/
|
||||||
|
appl::Buffer* get(const etk::UString& _fileName, bool _createIfNeeded=false);
|
||||||
|
/**
|
||||||
|
* @brief Load a specific file, event if it not existed:
|
||||||
|
* @param[in] _fileName Name of the file to open or create.
|
||||||
|
*/
|
||||||
|
void open(const etk::UString& _fileName);
|
||||||
|
/*
|
||||||
appl::Buffer* get(esize_t _bufferID);
|
appl::Buffer* get(esize_t _bufferID);
|
||||||
esize_t size(void):
|
esize_t size(void);
|
||||||
|
*/
|
||||||
|
public: // herited function
|
||||||
|
void onReceiveMessage(const ewol::EMessage& _msg);
|
||||||
|
void onObjectRemove(ewol::EObject * _removeObject);
|
||||||
|
public: // resource manager
|
||||||
/**
|
/**
|
||||||
* @brief keep the resource pointer.
|
* @brief keep the resource pointer.
|
||||||
* @note Never free this pointer by your own...
|
* @note Never free this pointer by your own...
|
||||||
|
@ -68,10 +68,10 @@ void BufferView::onReceiveMessage(const ewol::EMessage& _msg) {
|
|||||||
// clean The list
|
// clean The list
|
||||||
removeAllElement();
|
removeAllElement();
|
||||||
// get all the buffer name and properties:
|
// get all the buffer name and properties:
|
||||||
int32_t nbBufferOpen = BufferManager::size();
|
int32_t nbBufferOpen = 0; // BufferManager::size();
|
||||||
for (int32_t iii=0; iii<nbBufferOpen; iii++) {
|
for (int32_t iii=0; iii<nbBufferOpen; iii++) {
|
||||||
|
/*
|
||||||
if (BufferManager::exist(iii)) {
|
if (BufferManager::exist(iii)) {
|
||||||
/*
|
|
||||||
BufferText* tmpBuffer = BufferManager::get(iii);
|
BufferText* tmpBuffer = BufferManager::get(iii);
|
||||||
if (NULL != tmpBuffer) {
|
if (NULL != tmpBuffer) {
|
||||||
bool isModify = tmpBuffer->isModify();
|
bool isModify = tmpBuffer->isModify();
|
||||||
@ -83,15 +83,15 @@ void BufferView::onReceiveMessage(const ewol::EMessage& _msg) {
|
|||||||
APPL_ERROR("Allocation error of the tmp buffer list element");
|
APPL_ERROR("Allocation error of the tmp buffer list element");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
if (true == globals::OrderTheBufferList() ) {
|
if (true == globals::OrderTheBufferList() ) {
|
||||||
SortElementList(m_list);
|
SortElementList(m_list);
|
||||||
}
|
}
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
}else if (_msg.getMessage() == ednMsgBufferId) {
|
}else if (_msg.getMessage() == ednMsgBufferId) {
|
||||||
m_selectedIdRequested = BufferManager::getSelected();
|
m_selectedIdRequested = 0; //BufferManager::getSelected();
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
}else if (_msg.getMessage() == ednMsgBufferState) {
|
}else if (_msg.getMessage() == ednMsgBufferState) {
|
||||||
// update list of modify section ...
|
// update list of modify section ...
|
||||||
|
@ -282,15 +282,15 @@ void MainWindows::onReceiveMessage(const ewol::EMessage& _msg) {
|
|||||||
widget::FileChooser* tmpWidget = new widget::FileChooser();
|
widget::FileChooser* tmpWidget = new widget::FileChooser();
|
||||||
tmpWidget->setTitle("Open files ...");
|
tmpWidget->setTitle("Open files ...");
|
||||||
tmpWidget->setValidateLabel("Open");
|
tmpWidget->setValidateLabel("Open");
|
||||||
|
/*
|
||||||
if (BufferManager::getSelected()!=-1) {
|
if (BufferManager::getSelected()!=-1) {
|
||||||
/*
|
|
||||||
BufferText * myBuffer = BufferManager::get(BufferManager::getSelected());
|
BufferText * myBuffer = BufferManager::get(BufferManager::getSelected());
|
||||||
if (NULL!=myBuffer) {
|
if (NULL!=myBuffer) {
|
||||||
etk::FSNode tmpFile = myBuffer->getFileName();
|
etk::FSNode tmpFile = myBuffer->getFileName();
|
||||||
tmpWidget->setFolder(tmpFile.getNameFolder());
|
tmpWidget->setFolder(tmpFile.getNameFolder());
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
popUpWidgetPush(tmpWidget);
|
popUpWidgetPush(tmpWidget);
|
||||||
tmpWidget->registerOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected);
|
tmpWidget->registerOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSelected);
|
||||||
} else if (_msg.getMessage() == ednEventPopUpFileSelected) {
|
} else if (_msg.getMessage() == ednEventPopUpFileSelected) {
|
||||||
@ -302,15 +302,14 @@ void MainWindows::onReceiveMessage(const ewol::EMessage& _msg) {
|
|||||||
} else {
|
} else {
|
||||||
m_currentSavingAsIdBuffer = -1;
|
m_currentSavingAsIdBuffer = -1;
|
||||||
if (_msg.getData() == "current") {
|
if (_msg.getData() == "current") {
|
||||||
m_currentSavingAsIdBuffer = BufferManager::getSelected();
|
m_currentSavingAsIdBuffer = -1;//BufferManager::getSelected();
|
||||||
} else {
|
} else {
|
||||||
sscanf(_msg.getData().c_str(), "%d", &m_currentSavingAsIdBuffer);
|
sscanf(_msg.getData().c_str(), "%d", &m_currentSavingAsIdBuffer);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
if (false == BufferManager::exist(m_currentSavingAsIdBuffer)) {
|
if (false == BufferManager::exist(m_currentSavingAsIdBuffer)) {
|
||||||
APPL_ERROR("Request saveAs on non existant Buffer ID=" << m_currentSavingAsIdBuffer);
|
APPL_ERROR("Request saveAs on non existant Buffer ID=" << m_currentSavingAsIdBuffer);
|
||||||
} else {
|
} else {
|
||||||
/*
|
|
||||||
BufferText* myBuffer = BufferManager::get(m_currentSavingAsIdBuffer);
|
BufferText* myBuffer = BufferManager::get(m_currentSavingAsIdBuffer);
|
||||||
widget::FileChooser* tmpWidget = new widget::FileChooser();
|
widget::FileChooser* tmpWidget = new widget::FileChooser();
|
||||||
if (NULL == tmpWidget) {
|
if (NULL == tmpWidget) {
|
||||||
@ -330,16 +329,17 @@ void MainWindows::onReceiveMessage(const ewol::EMessage& _msg) {
|
|||||||
popUpWidgetPush(tmpWidget);
|
popUpWidgetPush(tmpWidget);
|
||||||
tmpWidget->registerOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSaveAs);
|
tmpWidget->registerOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpFileSaveAs);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
} else if (_msg.getMessage() == ednEventPopUpFileSaveAs) {
|
} else if (_msg.getMessage() == ednEventPopUpFileSaveAs) {
|
||||||
// get the filename :
|
// get the filename :
|
||||||
etk::UString tmpData = _msg.getData();
|
etk::UString tmpData = _msg.getData();
|
||||||
APPL_DEBUG("Request Saving As file : " << tmpData);
|
APPL_DEBUG("Request Saving As file : " << tmpData);
|
||||||
|
/*
|
||||||
BufferManager::get(m_currentSavingAsIdBuffer)->setFileName(tmpData);
|
BufferManager::get(m_currentSavingAsIdBuffer)->setFileName(tmpData);
|
||||||
sendMultiCast(ednMsgGuiSave, m_currentSavingAsIdBuffer);
|
sendMultiCast(ednMsgGuiSave, m_currentSavingAsIdBuffer);
|
||||||
|
*/
|
||||||
} else if( _msg.getMessage() == ednMsgBufferState
|
} else if( _msg.getMessage() == ednMsgBufferState
|
||||||
|| _msg.getMessage() == ednMsgBufferId) {
|
|| _msg.getMessage() == ednMsgBufferId) {
|
||||||
// the buffer change we need to update the widget string
|
// the buffer change we need to update the widget string
|
||||||
|
@ -33,6 +33,7 @@ appl::TextViewer::TextViewer(const etk::UString& _fontName, int32_t _fontSize) :
|
|||||||
registerMultiCast(ednMsgGuiFind);
|
registerMultiCast(ednMsgGuiFind);
|
||||||
registerMultiCast(ednMsgGuiReplace);
|
registerMultiCast(ednMsgGuiReplace);
|
||||||
registerMultiCast(ednMsgGuiGotoLine);
|
registerMultiCast(ednMsgGuiGotoLine);
|
||||||
|
registerMultiCast(appl::MsgSelectNewFile);
|
||||||
setLimitScrolling(0.2);
|
setLimitScrolling(0.2);
|
||||||
|
|
||||||
shortCutAdd("ctrl+w", ednMsgGuiRm, "Line");
|
shortCutAdd("ctrl+w", ednMsgGuiRm, "Line");
|
||||||
@ -40,6 +41,9 @@ appl::TextViewer::TextViewer(const etk::UString& _fontName, int32_t _fontSize) :
|
|||||||
shortCutAdd("ctrl+a", ednMsgGuiSelect, "ALL");
|
shortCutAdd("ctrl+a", ednMsgGuiSelect, "ALL");
|
||||||
shortCutAdd("ctrl+shift+a", ednMsgGuiSelect, "NONE");
|
shortCutAdd("ctrl+shift+a", ednMsgGuiSelect, "NONE");
|
||||||
|
|
||||||
|
// load buffer manager:
|
||||||
|
m_bufferManager = appl::BufferManager::keep();
|
||||||
|
|
||||||
// load color properties
|
// load color properties
|
||||||
m_paintingProperties = appl::GlyphPainting::keep("THEME:COLOR:textViewer.json");
|
m_paintingProperties = appl::GlyphPainting::keep("THEME:COLOR:textViewer.json");
|
||||||
// get all id properties ...
|
// get all id properties ...
|
||||||
@ -65,6 +69,12 @@ appl::TextViewer::TextViewer(const etk::UString& _fontName, int32_t _fontSize) :
|
|||||||
|
|
||||||
appl::TextViewer::~TextViewer(void) {
|
appl::TextViewer::~TextViewer(void) {
|
||||||
appl::textPluginManager::disconnect(*this);
|
appl::textPluginManager::disconnect(*this);
|
||||||
|
if (m_paintingProperties != NULL) {
|
||||||
|
appl::GlyphPainting::release(m_paintingProperties);
|
||||||
|
}
|
||||||
|
if (m_bufferManager != NULL) {
|
||||||
|
appl::BufferManager::release(m_bufferManager);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool appl::TextViewer::calculateMinSize(void) {
|
bool appl::TextViewer::calculateMinSize(void) {
|
||||||
@ -519,13 +529,24 @@ void appl::TextViewer::onEventClipboard(ewol::clipBoard::clipboardListe_te _clip
|
|||||||
|
|
||||||
void appl::TextViewer::onReceiveMessage(const ewol::EMessage& _msg) {
|
void appl::TextViewer::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||||
// First call plugin
|
// First call plugin
|
||||||
|
//APPL_DEBUG("receive msg: " << _msg);
|
||||||
if (appl::textPluginManager::onReceiveMessage(*this, _msg) == true) {
|
if (appl::textPluginManager::onReceiveMessage(*this, _msg) == true) {
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (_msg.getMessage() == appl::MsgSelectNewFile) {
|
||||||
|
m_buffer = m_bufferManager->get(_msg.getData());
|
||||||
|
}
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void appl::TextViewer::onObjectRemove(ewol::EObject* _removeObject) {
|
||||||
|
if (m_buffer == _removeObject) {
|
||||||
|
m_buffer = NULL;
|
||||||
|
markToRedraw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void appl::TextViewer::onGetFocus(void) {
|
void appl::TextViewer::onGetFocus(void) {
|
||||||
showKeyboard();
|
showKeyboard();
|
||||||
APPL_INFO("Focus - In");
|
APPL_INFO("Focus - In");
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include <ewol/widget/WidgetScrolled.h>
|
#include <ewol/widget/WidgetScrolled.h>
|
||||||
#include <ewol/compositing/Text.h>
|
#include <ewol/compositing/Text.h>
|
||||||
#include <ewol/compositing/Drawing.h>
|
#include <ewol/compositing/Drawing.h>
|
||||||
|
#include <appl/BufferManager.h>
|
||||||
|
|
||||||
namespace appl {
|
namespace appl {
|
||||||
class TextViewerPlugin;
|
class TextViewerPlugin;
|
||||||
@ -38,6 +39,8 @@ namespace appl {
|
|||||||
esize_t m_colorLineNumber;
|
esize_t m_colorLineNumber;
|
||||||
esize_t m_colorSelection;
|
esize_t m_colorSelection;
|
||||||
esize_t m_colorNormal;
|
esize_t m_colorNormal;
|
||||||
|
private:
|
||||||
|
appl::BufferManager* m_bufferManager; //!< handle on the buffer manager
|
||||||
public:
|
public:
|
||||||
TextViewer(const etk::UString& _fontName="", int32_t _fontSize=-1);
|
TextViewer(const etk::UString& _fontName="", int32_t _fontSize=-1);
|
||||||
virtual ~TextViewer(void);
|
virtual ~TextViewer(void);
|
||||||
@ -55,6 +58,7 @@ namespace appl {
|
|||||||
virtual bool calculateMinSize(void);
|
virtual bool calculateMinSize(void);
|
||||||
virtual void onRegenerateDisplay(void);
|
virtual void onRegenerateDisplay(void);
|
||||||
virtual void onReceiveMessage(const ewol::EMessage& _msg);
|
virtual void onReceiveMessage(const ewol::EMessage& _msg);
|
||||||
|
virtual void onObjectRemove(ewol::EObject* _removeObject);
|
||||||
virtual bool onEventInput(const ewol::EventInput& _event);
|
virtual bool onEventInput(const ewol::EventInput& _event);
|
||||||
virtual bool onEventEntry(const ewol::EventEntry& _event);
|
virtual bool onEventEntry(const ewol::EventEntry& _event);
|
||||||
virtual void onEventClipboard(ewol::clipBoard::clipboardListe_te clipboardID);
|
virtual void onEventClipboard(ewol::clipBoard::clipboardListe_te clipboardID);
|
||||||
|
@ -167,8 +167,8 @@ void CTagsManager::loadTagFile(void) {
|
|||||||
|
|
||||||
void CTagsManager::registerHistory(void) {
|
void CTagsManager::registerHistory(void) {
|
||||||
APPL_INFO("save curent filename and position : ");
|
APPL_INFO("save curent filename and position : ");
|
||||||
int32_t currentSelected = BufferManager::getSelected();
|
|
||||||
/*
|
/*
|
||||||
|
int32_t currentSelected = BufferManager::getSelected();
|
||||||
BufferText* tmpBuf = BufferManager::get(currentSelected);
|
BufferText* tmpBuf = BufferManager::get(currentSelected);
|
||||||
if (NULL != tmpBuf) {
|
if (NULL != tmpBuf) {
|
||||||
etk::FSNode * bufferFilename = new etk::FSNode();
|
etk::FSNode * bufferFilename = new etk::FSNode();
|
||||||
|
@ -58,3 +58,6 @@ extern const char* const ednMsgBufferListChange = "edn-Msg-BufferListChange";
|
|||||||
extern const char* const ednMsgBufferColor = "edn-Msg-Buffer-Color";
|
extern const char* const ednMsgBufferColor = "edn-Msg-Buffer-Color";
|
||||||
|
|
||||||
|
|
||||||
|
extern const char* const appl::MsgSelectNewFile = "edn-msg-select-new-file";
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,6 +57,9 @@
|
|||||||
|
|
||||||
extern const char* const ednMsgBufferColor; // data : "new"
|
extern const char* const ednMsgBufferColor; // data : "new"
|
||||||
|
|
||||||
|
namespace appl {
|
||||||
|
extern const char* const MsgSelectNewFile; // data : "buffer/name"
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ int main(int _argc, const char *_argv[])
|
|||||||
// only one things to do:
|
// only one things to do:
|
||||||
return ewol::run(_argc, _argv);
|
return ewol::run(_argc, _argv);
|
||||||
}
|
}
|
||||||
|
appl::BufferManager* bufferManager = NULL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief main application function initialisation
|
* @brief main application function initialisation
|
||||||
@ -71,7 +71,7 @@ bool APP_Init(ewol::eContext& _context)
|
|||||||
|
|
||||||
// init ALL Singleton :
|
// init ALL Singleton :
|
||||||
//(void)CTagsManager::getInstance();
|
//(void)CTagsManager::getInstance();
|
||||||
BufferManager::init();
|
bufferManager = appl::BufferManager::keep();
|
||||||
|
|
||||||
appl::highlightManager::init();
|
appl::highlightManager::init();
|
||||||
cTagsManager::init();
|
cTagsManager::init();
|
||||||
@ -113,7 +113,7 @@ bool APP_Init(ewol::eContext& _context)
|
|||||||
_context.getEObjectManager().multiCast().anonymousSend(ednMsgCtagsLoadFile, tmpppp);
|
_context.getEObjectManager().multiCast().anonymousSend(ednMsgCtagsLoadFile, tmpppp);
|
||||||
} else {
|
} else {
|
||||||
APPL_INFO("need load file : \"" << tmpppp << "\"" );
|
APPL_INFO("need load file : \"" << tmpppp << "\"" );
|
||||||
_context.getEObjectManager().multiCast().anonymousSend(ednMsgOpenFile, tmpppp);
|
bufferManager->open(tmpppp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,8 +142,11 @@ void APP_UnInit(ewol::eContext& _context)
|
|||||||
APPL_INFO("Stop Hightlight");
|
APPL_INFO("Stop Hightlight");
|
||||||
appl::highlightManager::unInit();
|
appl::highlightManager::unInit();
|
||||||
//Kill all singleton
|
//Kill all singleton
|
||||||
APPL_INFO("Stop BufferManager");
|
if (bufferManager != NULL) {
|
||||||
BufferManager::unInit();
|
APPL_INFO("Stop BufferManager");
|
||||||
|
appl::BufferManager::release(bufferManager);
|
||||||
|
bufferManager = NULL;
|
||||||
|
}
|
||||||
APPL_INFO(" == > Un-Init "PROJECT_NAME" (END)");
|
APPL_INFO(" == > Un-Init "PROJECT_NAME" (END)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user