[DEV] update to the new API, system start but not compleately work
This commit is contained in:
parent
08261def10
commit
cab0e6009d
@ -139,9 +139,7 @@ appl::Buffer::Buffer() :
|
|||||||
}
|
}
|
||||||
|
|
||||||
appl::Buffer::~Buffer() {
|
appl::Buffer::~Buffer() {
|
||||||
if (m_highlight == NULL) {
|
|
||||||
appl::Highlight::release(m_highlight);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool appl::Buffer::loadFile(const std::string& _name) {
|
bool appl::Buffer::loadFile(const std::string& _name) {
|
||||||
@ -694,9 +692,7 @@ void appl::Buffer::tryFindHighlightType() {
|
|||||||
void appl::Buffer::setHighlightType(const std::string& _type) {
|
void appl::Buffer::setHighlightType(const std::string& _type) {
|
||||||
m_highlightType = "";
|
m_highlightType = "";
|
||||||
cleanHighLight();
|
cleanHighLight();
|
||||||
if (m_highlight == NULL) {
|
m_highlight.reset();
|
||||||
appl::Highlight::release(m_highlight);
|
|
||||||
}
|
|
||||||
std::string resourceName = appl::highlightManager::getFileWithTypeType(_type);
|
std::string resourceName = appl::highlightManager::getFileWithTypeType(_type);
|
||||||
if (resourceName == "") {
|
if (resourceName == "") {
|
||||||
return;
|
return;
|
||||||
|
@ -588,7 +588,7 @@ namespace appl {
|
|||||||
protected:
|
protected:
|
||||||
std::string m_highlightType; //!< Name of the highlight type
|
std::string m_highlightType; //!< Name of the highlight type
|
||||||
|
|
||||||
appl::Highlight* m_highlight; //!< internal link with the Highlight system
|
ewol::object::Shared<appl::Highlight> m_highlight; //!< internal link with the Highlight system
|
||||||
std::vector<appl::HighlightInfo> m_HLDataPass1; //!< colorisation position in the current buffer pass 1
|
std::vector<appl::HighlightInfo> m_HLDataPass1; //!< colorisation position in the current buffer pass 1
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
@ -21,7 +21,7 @@ namespace appl {
|
|||||||
public:
|
public:
|
||||||
~BufferManager();
|
~BufferManager();
|
||||||
private:
|
private:
|
||||||
std::vector<ewol::object::Owner<appl::Buffer>> m_list; // list of all buffer curently open
|
std::vector<ewol::object::Shared<appl::Buffer>> m_list; // list of all buffer curently open
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Get a specific buffer with his name (can create a new buffer).
|
* @brief Get a specific buffer with his name (can create a new buffer).
|
||||||
|
@ -29,7 +29,7 @@ appl::WorkerCloseAllFile::WorkerCloseAllFile() :
|
|||||||
}
|
}
|
||||||
// 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) {
|
||||||
appl::Buffer* tmpBuffer = m_bufferManager->get(iii);
|
ewol::object::Shared<appl::Buffer> tmpBuffer = m_bufferManager->get(iii);
|
||||||
if (tmpBuffer == NULL) {
|
if (tmpBuffer == NULL) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ appl::WorkerCloseAllFile::WorkerCloseAllFile() :
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// create the worker :
|
// create the worker :
|
||||||
m_worker = new appl::WorkerCloseFile(m_bufferNameList.front());
|
m_worker = ewol::object::makeShared(new appl::WorkerCloseFile(m_bufferNameList.front()));
|
||||||
// remove first element :
|
// remove first element :
|
||||||
m_bufferNameList.erase(m_bufferNameList.begin());
|
m_bufferNameList.erase(m_bufferNameList.begin());
|
||||||
if (m_bufferNameList.size() == 0) {
|
if (m_bufferNameList.size() == 0) {
|
||||||
@ -56,7 +56,7 @@ appl::WorkerCloseAllFile::WorkerCloseAllFile() :
|
|||||||
}
|
}
|
||||||
|
|
||||||
appl::WorkerCloseAllFile::~WorkerCloseAllFile() {
|
appl::WorkerCloseAllFile::~WorkerCloseAllFile() {
|
||||||
appl::BufferManager::release(m_bufferManager);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void appl::WorkerCloseAllFile::onReceiveMessage(const ewol::object::Message& _msg) {
|
void appl::WorkerCloseAllFile::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||||
@ -70,7 +70,7 @@ void appl::WorkerCloseAllFile::onReceiveMessage(const ewol::object::Message& _ms
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// create the worker :
|
// create the worker :
|
||||||
m_worker = new appl::WorkerCloseFile(m_bufferNameList.front());
|
m_worker = ewol::object::makeShared(new appl::WorkerCloseFile(m_bufferNameList.front()));
|
||||||
// remove first element :
|
// remove first element :
|
||||||
m_bufferNameList.erase(m_bufferNameList.begin());
|
m_bufferNameList.erase(m_bufferNameList.begin());
|
||||||
if (m_bufferNameList.size() == 0) {
|
if (m_bufferNameList.size() == 0) {
|
||||||
|
@ -19,8 +19,8 @@ namespace appl {
|
|||||||
virtual ~WorkerCloseAllFile();
|
virtual ~WorkerCloseAllFile();
|
||||||
private:
|
private:
|
||||||
std::vector<std::string> m_bufferNameList;
|
std::vector<std::string> m_bufferNameList;
|
||||||
appl::WorkerCloseFile* m_worker; //! pop-up element that is open...
|
ewol::object::Shared<appl::WorkerCloseFile> m_worker; //! pop-up element that is open...
|
||||||
appl::BufferManager* m_bufferManager; //!< handle on the buffer manager
|
ewol::object::Shared<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager
|
||||||
public: // derived function
|
public: // derived function
|
||||||
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
||||||
virtual void onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject);
|
virtual void onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject);
|
||||||
|
@ -38,7 +38,7 @@ appl::WorkerCloseFile::WorkerCloseFile(const std::string& _bufferName) :
|
|||||||
}
|
}
|
||||||
if (m_bufferName == "") {
|
if (m_bufferName == "") {
|
||||||
// need to find the curent file ...
|
// need to find the curent file ...
|
||||||
appl::Buffer* tmpp = m_bufferManager->getBufferSelected();
|
ewol::object::Shared<appl::Buffer> tmpp = m_bufferManager->getBufferSelected();
|
||||||
if (tmpp == NULL) {
|
if (tmpp == NULL) {
|
||||||
APPL_ERROR("No selected buffer now ...");
|
APPL_ERROR("No selected buffer now ...");
|
||||||
autoDestroy();
|
autoDestroy();
|
||||||
@ -63,14 +63,14 @@ appl::WorkerCloseFile::WorkerCloseFile(const std::string& _bufferName) :
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ewol::widget::StdPopUp* tmpPopUp = new ewol::widget::StdPopUp();
|
ewol::object::Shared<ewol::widget::StdPopUp> tmpPopUp = ewol::object::makeShared(new ewol::widget::StdPopUp());
|
||||||
if (tmpPopUp == NULL) {
|
if (tmpPopUp == NULL) {
|
||||||
APPL_ERROR("Can not create a simple pop-up");
|
APPL_ERROR("Can not create a simple pop-up");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tmpPopUp->setTitle("<bold>Close un-saved file:</bold>");
|
tmpPopUp->setTitle("<bold>Close un-saved file:</bold>");
|
||||||
tmpPopUp->setComment("The file named : <i>\"" + m_buffer->getFileName() + "\"</i> is curently modify. <br/>If you don't saves these modifications,<br/>they will be definitly lost...");
|
tmpPopUp->setComment("The file named : <i>\"" + m_buffer->getFileName() + "\"</i> is curently modify. <br/>If you don't saves these modifications,<br/>they will be definitly lost...");
|
||||||
ewol::Widget* bt = NULL;
|
ewol::object::Shared<ewol::Widget> bt = NULL;
|
||||||
if (m_buffer->hasFileName() == true) {
|
if (m_buffer->hasFileName() == true) {
|
||||||
bt = tmpPopUp->addButton("Save", true);
|
bt = tmpPopUp->addButton("Save", true);
|
||||||
if (bt != NULL) {
|
if (bt != NULL) {
|
||||||
@ -87,7 +87,7 @@ appl::WorkerCloseFile::WorkerCloseFile(const std::string& _bufferName) :
|
|||||||
}
|
}
|
||||||
tmpPopUp->addButton("Cancel", true);
|
tmpPopUp->addButton("Cancel", true);
|
||||||
tmpPopUp->setRemoveOnExternClick(true);
|
tmpPopUp->setRemoveOnExternClick(true);
|
||||||
ewol::widget::Windows* tmpWindows = ewol::getContext().getWindows();
|
ewol::object::Shared<ewol::widget::Windows> tmpWindows = ewol::getContext().getWindows();
|
||||||
if (tmpWindows == NULL) {
|
if (tmpWindows == NULL) {
|
||||||
APPL_ERROR("Error to get the windows.");
|
APPL_ERROR("Error to get the windows.");
|
||||||
autoDestroy();
|
autoDestroy();
|
||||||
@ -97,7 +97,7 @@ appl::WorkerCloseFile::WorkerCloseFile(const std::string& _bufferName) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
appl::WorkerCloseFile::~WorkerCloseFile() {
|
appl::WorkerCloseFile::~WorkerCloseFile() {
|
||||||
appl::BufferManager::release(m_bufferManager);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void appl::WorkerCloseFile::onReceiveMessage(const ewol::object::Message& _msg) {
|
void appl::WorkerCloseFile::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||||
@ -107,7 +107,7 @@ void appl::WorkerCloseFile::onReceiveMessage(const ewol::object::Message& _msg)
|
|||||||
}
|
}
|
||||||
APPL_DEBUG("have message : " << _msg);
|
APPL_DEBUG("have message : " << _msg);
|
||||||
if (_msg.getMessage() == s_saveAsValidate) {
|
if (_msg.getMessage() == s_saveAsValidate) {
|
||||||
m_worker = new appl::WorkerSaveFile(m_bufferName);
|
m_worker = ewol::object::makeShared(new appl::WorkerSaveFile(m_bufferName));
|
||||||
if (m_worker != NULL) {
|
if (m_worker != NULL) {
|
||||||
m_worker->registerOnEvent(this, appl::WorkerSaveFile::eventSaveDone, s_saveAsDone);
|
m_worker->registerOnEvent(this, appl::WorkerSaveFile::eventSaveDone, s_saveAsDone);
|
||||||
}
|
}
|
||||||
@ -118,7 +118,7 @@ void appl::WorkerCloseFile::onReceiveMessage(const ewol::object::Message& _msg)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_buffer->storeFile() == false) {
|
if (m_buffer->storeFile() == false) {
|
||||||
ewol::widget::Windows* tmpWindows = ewol::getContext().getWindows();
|
ewol::object::Shared<ewol::widget::Windows> tmpWindows = ewol::getContext().getWindows();
|
||||||
if (tmpWindows == NULL) {
|
if (tmpWindows == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,9 @@ namespace appl {
|
|||||||
virtual ~WorkerCloseFile();
|
virtual ~WorkerCloseFile();
|
||||||
private:
|
private:
|
||||||
std::string m_bufferName;
|
std::string m_bufferName;
|
||||||
appl::Buffer* m_buffer; //!< reference on the buffer (when rename, we have no more reference on the buffer
|
ewol::object::Shared<appl::Buffer> m_buffer; //!< reference on the buffer (when rename, we have no more reference on the buffer
|
||||||
appl::WorkerSaveFile* m_worker; //! sub-worker element...
|
ewol::object::Shared<appl::WorkerSaveFile> m_worker; //! sub-worker element...
|
||||||
appl::BufferManager* m_bufferManager; //!< handle on the buffer manager
|
ewol::object::Shared<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager
|
||||||
public: // derived function
|
public: // derived function
|
||||||
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
||||||
virtual void onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject);
|
virtual void onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject);
|
||||||
|
@ -29,7 +29,7 @@ appl::WorkerSaveAllFile::WorkerSaveAllFile() :
|
|||||||
}
|
}
|
||||||
// List all current open file :
|
// List all current open file :
|
||||||
for (size_t iii=0; iii<m_bufferManager->size(); ++iii) {
|
for (size_t iii=0; iii<m_bufferManager->size(); ++iii) {
|
||||||
appl::Buffer* tmpBuffer = m_bufferManager->get(iii);
|
ewol::object::Shared<appl::Buffer> tmpBuffer = m_bufferManager->get(iii);
|
||||||
if (tmpBuffer == NULL) {
|
if (tmpBuffer == NULL) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -48,7 +48,7 @@ appl::WorkerSaveAllFile::WorkerSaveAllFile() :
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// create the worker :
|
// create the worker :
|
||||||
m_worker = new appl::WorkerSaveFile(m_bufferNameList.front());
|
m_worker = ewol::object::makeShared(new appl::WorkerSaveFile(m_bufferNameList.front()));
|
||||||
// remove first element :
|
// remove first element :
|
||||||
m_bufferNameList.erase(m_bufferNameList.begin());
|
m_bufferNameList.erase(m_bufferNameList.begin());
|
||||||
if (m_bufferNameList.size() == 0) {
|
if (m_bufferNameList.size() == 0) {
|
||||||
@ -59,7 +59,7 @@ appl::WorkerSaveAllFile::WorkerSaveAllFile() :
|
|||||||
}
|
}
|
||||||
|
|
||||||
appl::WorkerSaveAllFile::~WorkerSaveAllFile() {
|
appl::WorkerSaveAllFile::~WorkerSaveAllFile() {
|
||||||
appl::BufferManager::release(m_bufferManager);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void appl::WorkerSaveAllFile::onReceiveMessage(const ewol::object::Message& _msg) {
|
void appl::WorkerSaveAllFile::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||||
|
@ -19,8 +19,8 @@ namespace appl {
|
|||||||
virtual ~WorkerSaveAllFile();
|
virtual ~WorkerSaveAllFile();
|
||||||
private:
|
private:
|
||||||
std::vector<std::string> m_bufferNameList;
|
std::vector<std::string> m_bufferNameList;
|
||||||
appl::WorkerSaveFile* m_worker; //! pop-up element that is open...
|
ewol::object::Shared<appl::WorkerSaveFile> m_worker; //! pop-up element that is open...
|
||||||
appl::BufferManager* m_bufferManager; //!< handle on the buffer manager
|
ewol::object::Shared<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager
|
||||||
public: // derived function
|
public: // derived function
|
||||||
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
||||||
virtual void onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject);
|
virtual void onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject);
|
||||||
|
@ -33,7 +33,7 @@ appl::WorkerSaveFile::WorkerSaveFile(const std::string& _bufferName, bool _force
|
|||||||
}
|
}
|
||||||
if (m_bufferName == "") {
|
if (m_bufferName == "") {
|
||||||
// need to find the curent file ...
|
// need to find the curent file ...
|
||||||
appl::Buffer* tmpp = m_bufferManager->getBufferSelected();
|
ewol::object::Shared<appl::Buffer> tmpp = m_bufferManager->getBufferSelected();
|
||||||
if (tmpp == NULL) {
|
if (tmpp == NULL) {
|
||||||
APPL_ERROR("No selected buffer now ...");
|
APPL_ERROR("No selected buffer now ...");
|
||||||
autoDestroy();
|
autoDestroy();
|
||||||
@ -46,7 +46,7 @@ appl::WorkerSaveFile::WorkerSaveFile(const std::string& _bufferName, bool _force
|
|||||||
autoDestroy();
|
autoDestroy();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
appl::Buffer* tmpBuffer = m_bufferManager->get(m_bufferName);
|
ewol::object::Shared<appl::Buffer> tmpBuffer = m_bufferManager->get(m_bufferName);
|
||||||
if (tmpBuffer == NULL) {
|
if (tmpBuffer == NULL) {
|
||||||
APPL_ERROR("Error to get the buffer : " << m_bufferName);
|
APPL_ERROR("Error to get the buffer : " << m_bufferName);
|
||||||
autoDestroy();
|
autoDestroy();
|
||||||
@ -60,7 +60,7 @@ appl::WorkerSaveFile::WorkerSaveFile(const std::string& _bufferName, bool _force
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_chooser = new ewol::widget::FileChooser();
|
m_chooser = ewol::object::makeShared(new ewol::widget::FileChooser());
|
||||||
if (NULL == m_chooser) {
|
if (NULL == m_chooser) {
|
||||||
APPL_ERROR("Can not allocate widget == > display might be in error");
|
APPL_ERROR("Can not allocate widget == > display might be in error");
|
||||||
autoDestroy();
|
autoDestroy();
|
||||||
@ -71,7 +71,7 @@ appl::WorkerSaveFile::WorkerSaveFile(const std::string& _bufferName, bool _force
|
|||||||
etk::FSNode tmpName(m_bufferName);
|
etk::FSNode tmpName(m_bufferName);
|
||||||
m_chooser->setFolder(tmpName.getNameFolder());
|
m_chooser->setFolder(tmpName.getNameFolder());
|
||||||
m_chooser->setFileName(tmpName.getNameFile());
|
m_chooser->setFileName(tmpName.getNameFile());
|
||||||
ewol::widget::Windows* tmpWindows = ewol::getContext().getWindows();
|
ewol::object::Shared<ewol::widget::Windows> tmpWindows = ewol::getContext().getWindows();
|
||||||
if (tmpWindows == NULL) {
|
if (tmpWindows == NULL) {
|
||||||
APPL_ERROR("Error to get the windows.");
|
APPL_ERROR("Error to get the windows.");
|
||||||
autoDestroy();
|
autoDestroy();
|
||||||
@ -82,7 +82,7 @@ appl::WorkerSaveFile::WorkerSaveFile(const std::string& _bufferName, bool _force
|
|||||||
}
|
}
|
||||||
|
|
||||||
appl::WorkerSaveFile::~WorkerSaveFile() {
|
appl::WorkerSaveFile::~WorkerSaveFile() {
|
||||||
appl::BufferManager::release(m_bufferManager);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void appl::WorkerSaveFile::onReceiveMessage(const ewol::object::Message& _msg) {
|
void appl::WorkerSaveFile::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||||
@ -99,14 +99,14 @@ void appl::WorkerSaveFile::onReceiveMessage(const ewol::object::Message& _msg) {
|
|||||||
APPL_ERROR("Try to save an non-existant file :" << m_bufferName);
|
APPL_ERROR("Try to save an non-existant file :" << m_bufferName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
appl::Buffer* tmpBuffer = m_bufferManager->get(m_bufferName);
|
ewol::object::Shared<appl::Buffer> tmpBuffer = m_bufferManager->get(m_bufferName);
|
||||||
if (tmpBuffer == NULL) {
|
if (tmpBuffer == NULL) {
|
||||||
APPL_ERROR("Error to get the buffer : " << m_bufferName);
|
APPL_ERROR("Error to get the buffer : " << m_bufferName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tmpBuffer->setFileName(_msg.getData());
|
tmpBuffer->setFileName(_msg.getData());
|
||||||
if (tmpBuffer->storeFile() == false) {
|
if (tmpBuffer->storeFile() == false) {
|
||||||
ewol::widget::Windows* tmpWindows = ewol::getContext().getWindows();
|
ewol::object::Shared<ewol::widget::Windows> tmpWindows = ewol::getContext().getWindows();
|
||||||
if (tmpWindows == NULL) {
|
if (tmpWindows == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ namespace appl {
|
|||||||
private:
|
private:
|
||||||
std::string m_bufferName;
|
std::string m_bufferName;
|
||||||
ewol::object::Shared<ewol::widget::FileChooser> m_chooser; //! pop-up element that is open...
|
ewol::object::Shared<ewol::widget::FileChooser> m_chooser; //! pop-up element that is open...
|
||||||
appl::BufferManager* m_bufferManager; //!< handle on the buffer manager
|
ewol::object::Shared<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager
|
||||||
public: // derived function
|
public: // derived function
|
||||||
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
||||||
virtual void onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject);
|
virtual void onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject);
|
||||||
|
@ -260,29 +260,20 @@ void appl::Highlight::parse2(int64_t _start,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
appl::Highlight* appl::Highlight::keep(const std::string& _filename) {
|
ewol::object::Shared<appl::Highlight> appl::Highlight::keep(const std::string& _filename) {
|
||||||
//EWOL_INFO("KEEP : appl::Highlight : file : \"" << _filename << "\"");
|
//EWOL_INFO("KEEP : appl::Highlight : file : \"" << _filename << "\"");
|
||||||
appl::Highlight* object = static_cast<appl::Highlight*>(getManager().localKeep(_filename));
|
ewol::object::Shared<appl::Highlight> object = ewol::dynamic_pointer_cast<appl::Highlight>(getManager().localKeep(_filename));
|
||||||
if (NULL != object) {
|
if (NULL != object) {
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
EWOL_INFO("CREATE : appl::Highlight : file : \"" << _filename << "\"");
|
EWOL_INFO("CREATE : appl::Highlight : file : \"" << _filename << "\"");
|
||||||
// this element create a new one every time ....
|
// this element create a new one every time ....
|
||||||
object = new appl::Highlight(_filename, "THEME:COLOR:textViewer.json");
|
object = ewol::object::makeShared(new appl::Highlight(_filename, "THEME:COLOR:textViewer.json"));
|
||||||
if (NULL == object) {
|
if (NULL == object) {
|
||||||
EWOL_ERROR("allocation error of a resource : ??Highlight??");
|
EWOL_ERROR("allocation error of a resource : ??Highlight??");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
getManager().localAdd(object);
|
getManager().localAdd(object);
|
||||||
return object;
|
return object;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void appl::Highlight::release(appl::Highlight*& _object) {
|
|
||||||
if (NULL == _object) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ewol::Resource* object2 = static_cast<ewol::Resource*>(_object);
|
|
||||||
getManager().release(object2);
|
|
||||||
_object = NULL;
|
|
||||||
}
|
|
||||||
|
@ -34,10 +34,11 @@ namespace appl {
|
|||||||
namespace appl {
|
namespace appl {
|
||||||
class Highlight : public ewol::Resource {
|
class Highlight : public ewol::Resource {
|
||||||
private:
|
private:
|
||||||
appl::GlyphPainting* m_paintingProperties;
|
ewol::object::Shared<appl::GlyphPainting> m_paintingProperties;
|
||||||
protected:
|
protected:
|
||||||
// Constructeur
|
// Constructeur
|
||||||
Highlight(const std::string& _xmlFilename, const std::string& _colorFile);
|
Highlight(const std::string& _xmlFilename, const std::string& _colorFile);
|
||||||
|
public:
|
||||||
~Highlight();
|
~Highlight();
|
||||||
private:
|
private:
|
||||||
std::string m_typeName; //!< descriptive string type like "C/C++"
|
std::string m_typeName; //!< descriptive string type like "C/C++"
|
||||||
@ -73,12 +74,7 @@ namespace appl {
|
|||||||
* @param[in] _filename Name of the configuration file.
|
* @param[in] _filename Name of the configuration file.
|
||||||
* @return pointer on the resource or NULL if an error occured.
|
* @return pointer on the resource or NULL if an error occured.
|
||||||
*/
|
*/
|
||||||
static appl::Highlight* keep(const std::string& _filename);
|
static ewol::object::Shared<appl::Highlight> keep(const std::string& _filename);
|
||||||
/**
|
|
||||||
* @brief release the keeped resources
|
|
||||||
* @param[in,out] reference on the object pointer
|
|
||||||
*/
|
|
||||||
static void release(appl::Highlight*& _object);
|
|
||||||
public: // herited function :
|
public: // herited function :
|
||||||
virtual void updateContext() {
|
virtual void updateContext() {
|
||||||
// no upfate to do ...
|
// no upfate to do ...
|
||||||
|
@ -15,14 +15,14 @@
|
|||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "highlightManager"
|
#define __class__ "highlightManager"
|
||||||
|
|
||||||
static std::vector<appl::Highlight*>& s_list() {
|
static std::vector<ewol::object::Shared<appl::Highlight>>& s_list() {
|
||||||
static std::vector<appl::Highlight*> list;
|
static std::vector<ewol::object::Shared<appl::Highlight>> list;
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void appl::highlightManager::init() {
|
void appl::highlightManager::init() {
|
||||||
std::vector<appl::Highlight*>& hlList = s_list();
|
std::vector<ewol::object::Shared<appl::Highlight>>& hlList = s_list();
|
||||||
if (hlList.size() != 0) {
|
if (hlList.size() != 0) {
|
||||||
APPL_ERROR("HighlightManager == > already exist, just unlink the previous ...");
|
APPL_ERROR("HighlightManager == > already exist, just unlink the previous ...");
|
||||||
hlList.clear();
|
hlList.clear();
|
||||||
@ -40,7 +40,7 @@ void appl::highlightManager::init() {
|
|||||||
}
|
}
|
||||||
std::string filename = list[iii]->getName() + "/highlight.xml";
|
std::string filename = list[iii]->getName() + "/highlight.xml";
|
||||||
APPL_DEBUG("Load xml name : " << filename);
|
APPL_DEBUG("Load xml name : " << filename);
|
||||||
appl::Highlight *myHightLine = appl::Highlight::keep(filename);
|
ewol::object::Shared<appl::Highlight> myHightLine = appl::Highlight::keep(filename);
|
||||||
if (myHightLine != NULL) {
|
if (myHightLine != NULL) {
|
||||||
hlList.push_back(myHightLine);
|
hlList.push_back(myHightLine);
|
||||||
} else {
|
} else {
|
||||||
@ -59,19 +59,12 @@ void appl::highlightManager::init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void appl::highlightManager::unInit() {
|
void appl::highlightManager::unInit() {
|
||||||
std::vector<Highlight*>& hlList = s_list();
|
std::vector<ewol::object::Shared<Highlight>>& hlList = s_list();
|
||||||
if (hlList.size() == 0) {
|
if (hlList.size() == 0) {
|
||||||
APPL_DEBUG("HighlightManager ==> no highlight");
|
APPL_DEBUG("HighlightManager ==> no highlight");
|
||||||
hlList.clear();
|
hlList.clear();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (int32_t iii = 0; iii < hlList.size(); ++iii) {
|
|
||||||
if (hlList[iii] == NULL) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
appl::Highlight::release(hlList[iii]);
|
|
||||||
hlList[iii] = NULL;
|
|
||||||
}
|
|
||||||
hlList.clear();
|
hlList.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +73,7 @@ std::string appl::highlightManager::getTypeExtention(const std::string& _extenti
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
APPL_DEBUG("Try to find type for extention : '" << _extention << "' in " << s_list().size() << " types");
|
APPL_DEBUG("Try to find type for extention : '" << _extention << "' in " << s_list().size() << " types");
|
||||||
std::vector<Highlight*>& hlList = s_list();
|
std::vector<ewol::object::Shared<Highlight>>& hlList = s_list();
|
||||||
for (int32_t iii = 0; iii < hlList.size(); ++iii) {
|
for (int32_t iii = 0; iii < hlList.size(); ++iii) {
|
||||||
if (hlList[iii] == NULL) {
|
if (hlList[iii] == NULL) {
|
||||||
continue;
|
continue;
|
||||||
@ -99,7 +92,7 @@ std::string appl::highlightManager::getFileWithTypeType(const std::string& _type
|
|||||||
if (_type.size() == 0) {
|
if (_type.size() == 0) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
std::vector<Highlight*>& hlList = s_list();
|
std::vector<ewol::object::Shared<Highlight>>& hlList = s_list();
|
||||||
for (int32_t iii = 0; iii < hlList.size(); ++iii) {
|
for (int32_t iii = 0; iii < hlList.size(); ++iii) {
|
||||||
if (hlList[iii] == NULL) {
|
if (hlList[iii] == NULL) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#undef __class__
|
#undef __class__
|
||||||
#define __class__ "HighlightPattern"
|
#define __class__ "HighlightPattern"
|
||||||
|
|
||||||
appl::HighlightPattern::HighlightPattern(appl::GlyphPainting*& _glyphPainting) :
|
appl::HighlightPattern::HighlightPattern(const ewol::object::Shared<appl::GlyphPainting>& _glyphPainting) :
|
||||||
m_glyphPainting(_glyphPainting),
|
m_glyphPainting(_glyphPainting),
|
||||||
m_paternName(""),
|
m_paternName(""),
|
||||||
m_regExpStart(NULL),
|
m_regExpStart(NULL),
|
||||||
|
@ -29,10 +29,10 @@ enum resultFind {
|
|||||||
namespace appl {
|
namespace appl {
|
||||||
class HighlightPattern {
|
class HighlightPattern {
|
||||||
private:
|
private:
|
||||||
appl::GlyphPainting*& m_glyphPainting;
|
ewol::object::Shared<appl::GlyphPainting> m_glyphPainting;
|
||||||
public:
|
public:
|
||||||
// Constructeur
|
// Constructeur
|
||||||
HighlightPattern(appl::GlyphPainting*& _glyphPainting);
|
HighlightPattern(const ewol::object::Shared<appl::GlyphPainting>& _glyphPainting);
|
||||||
~HighlightPattern();
|
~HighlightPattern();
|
||||||
private:
|
private:
|
||||||
std::string m_paternName; //!< Current style name (like "c++" or "c" or "script Bash")
|
std::string m_paternName; //!< Current style name (like "c++" or "c" or "script Bash")
|
||||||
|
@ -27,7 +27,7 @@ appl::TextPluginCtags::TextPluginCtags() :
|
|||||||
m_bufferManager = appl::BufferManager::keep();
|
m_bufferManager = appl::BufferManager::keep();
|
||||||
}
|
}
|
||||||
appl::TextPluginCtags::~TextPluginCtags() {
|
appl::TextPluginCtags::~TextPluginCtags() {
|
||||||
appl::BufferManager::release(m_bufferManager);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* eventJumpDestination = "event-plugin-ctags-jump-destination";
|
const char* eventJumpDestination = "event-plugin-ctags-jump-destination";
|
||||||
@ -78,7 +78,7 @@ void appl::TextPluginCtags::jumpTo(const std::string& _name) {
|
|||||||
|
|
||||||
if (tagsFindNext (m_ctagFile, &entry) == TagSuccess) {
|
if (tagsFindNext (m_ctagFile, &entry) == TagSuccess) {
|
||||||
APPL_INFO("Multiple file destination ...");
|
APPL_INFO("Multiple file destination ...");
|
||||||
appl::TagFileSelection* tmpWidget = new appl::TagFileSelection();
|
ewol::object::Shared<appl::TagFileSelection> tmpWidget = ewol::object::makeShared(new appl::TagFileSelection());
|
||||||
if (NULL == tmpWidget) {
|
if (NULL == tmpWidget) {
|
||||||
APPL_ERROR("Can not allocate widget == > display might be in error");
|
APPL_ERROR("Can not allocate widget == > display might be in error");
|
||||||
} else {
|
} else {
|
||||||
@ -174,7 +174,7 @@ bool appl::TextPluginCtags::onReceiveMessage(appl::TextViewer& _textDrawer,
|
|||||||
}
|
}
|
||||||
if (_msg.getMessage() == eventOpenCtagsFile) {
|
if (_msg.getMessage() == eventOpenCtagsFile) {
|
||||||
APPL_INFO("Request opening ctag file");
|
APPL_INFO("Request opening ctag file");
|
||||||
ewol::widget::FileChooser* tmpWidget = new ewol::widget::FileChooser();
|
ewol::object::Shared<ewol::widget::FileChooser> tmpWidget = ewol::object::makeShared(new ewol::widget::FileChooser());
|
||||||
if (NULL == tmpWidget) {
|
if (NULL == tmpWidget) {
|
||||||
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;
|
||||||
|
@ -33,7 +33,7 @@ namespace appl {
|
|||||||
void printTag(const tagEntry *_entry);
|
void printTag(const tagEntry *_entry);
|
||||||
void jumpTo(const std::string& _name);
|
void jumpTo(const std::string& _name);
|
||||||
void jumpFile(const std::string& _filename, int64_t _lineId);
|
void jumpFile(const std::string& _filename, int64_t _lineId);
|
||||||
appl::BufferManager* m_bufferManager; //!< handle on the buffer manager
|
ewol::object::Shared<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager
|
||||||
public:
|
public:
|
||||||
TextPluginCtags();
|
TextPluginCtags();
|
||||||
~TextPluginCtags();
|
~TextPluginCtags();
|
||||||
|
@ -32,7 +32,7 @@ namespace appl {
|
|||||||
m_specificData.clear();
|
m_specificData.clear();
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
std::vector<std::pair<appl::Buffer* ,TYPE* >> m_specificData;
|
std::vector<std::pair<ewol::object::Shared<appl::Buffer> ,TYPE* >> m_specificData;
|
||||||
protected:
|
protected:
|
||||||
TYPE* getDataRef(appl::TextViewer& _textDrawer) {
|
TYPE* getDataRef(appl::TextViewer& _textDrawer) {
|
||||||
for (size_t iii = 0; iii < m_specificData.size() ; ++iii) {
|
for (size_t iii = 0; iii < m_specificData.size() ; ++iii) {
|
||||||
@ -115,7 +115,7 @@ namespace appl {
|
|||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
virtual void onObjectRemove(ewol::Object* _removeObject) {
|
virtual void onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject) {
|
||||||
// TODO : plop
|
// TODO : plop
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -176,7 +176,7 @@ bool appl::TextPluginHistory::onRemove(appl::TextViewer& _textDrawer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void appl::TextPluginHistory::onObjectRemove(ewol::Object* _removeObject) {
|
void appl::TextPluginHistory::onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject) {
|
||||||
// TODO : Dependence with buffer removing ...
|
// TODO : Dependence with buffer removing ...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ namespace appl {
|
|||||||
void clearRedo(appl::PluginHistoryData& _data);
|
void clearRedo(appl::PluginHistoryData& _data);
|
||||||
void clearUndo(appl::PluginHistoryData& _data);
|
void clearUndo(appl::PluginHistoryData& _data);
|
||||||
public:
|
public:
|
||||||
virtual void onObjectRemove(ewol::Object* _removeObject);
|
virtual void onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -126,16 +126,8 @@ bool APP_Init(ewol::Context& _context, size_t _initId, size_t& _nbInitStep) {
|
|||||||
*/
|
*/
|
||||||
void APP_UnInit(ewol::Context& _context) {
|
void APP_UnInit(ewol::Context& _context) {
|
||||||
APPL_INFO(" == > Un-Init " PROJECT_NAME " (START)");
|
APPL_INFO(" == > Un-Init " PROJECT_NAME " (START)");
|
||||||
ewol::object::Shared<ewol::widget::Windows> tmpWindows = _context.getWindows();
|
|
||||||
|
|
||||||
_context.setWindows(NULL);
|
_context.setWindows(NULL);
|
||||||
|
|
||||||
if (NULL != tmpWindows) {
|
|
||||||
delete(tmpWindows);
|
|
||||||
tmpWindows = NULL;
|
|
||||||
}
|
|
||||||
appl::textPluginManager::unInit();
|
appl::textPluginManager::unInit();
|
||||||
|
|
||||||
APPL_INFO("Stop Hightlight");
|
APPL_INFO("Stop Hightlight");
|
||||||
appl::highlightManager::unInit();
|
appl::highlightManager::unInit();
|
||||||
//Kill all singleton
|
//Kill all singleton
|
||||||
|
Loading…
x
Reference in New Issue
Block a user