78 lines
1.8 KiB
C++
78 lines
1.8 KiB
C++
/**
|
|
* @author Edouard DUPIN
|
|
*
|
|
* @copyright 2010, Edouard DUPIN, all right reserved
|
|
*
|
|
* @license GPL v3 (see license file)
|
|
*/
|
|
|
|
#include <appl/Debug.h>
|
|
#include <appl/global.h>
|
|
#include <HighlightManager.h>
|
|
#include <ewol/renderer/EObject.h>
|
|
#include <ewol/renderer/EObjectManager.h>
|
|
|
|
#undef __class__
|
|
#define __class__ "highlightManager"
|
|
|
|
static etk::Vector<Highlight*>& s_list(void) {
|
|
static etk::Vector<Highlight*> list;
|
|
return list;
|
|
}
|
|
|
|
|
|
void appl::highlightManager::init(void) {
|
|
etk::Vector<Highlight*>& hlList = s_list();
|
|
if (hlList.size() != 0) {
|
|
APPL_ERROR("HighlightManager == > already exist, just unlink the previous ...");
|
|
hlList.clear();
|
|
}
|
|
etk::FSNode myFile("DATA:languages/");
|
|
// get the subfolder list :
|
|
etk::Vector<etk::FSNode *> list = myFile.folderGetSubList(false, true, false,false);
|
|
for (esize_t iii=0;
|
|
iii<list.size();
|
|
++iii ) {
|
|
if (list[iii] == NULL) {
|
|
continue;
|
|
}
|
|
if (list[iii]->getNodeType() != etk::FSN_FOLDER) {
|
|
continue;
|
|
}
|
|
etk::UString filename = list[iii]->getName() + "/highlight.xml";
|
|
APPL_DEBUG("Load xml name : " << filename);
|
|
appl::Highlight *myHightline = appl::Highlight::keep(filename);
|
|
hlList.pushBack(myHightline);
|
|
}
|
|
}
|
|
|
|
void appl::highlightManager::unInit(void) {
|
|
etk::Vector<Highlight*>& hlList = s_list();
|
|
if (hlList.size() == 0) {
|
|
APPL_DEBUG("HighlightManager ==> no highlight");
|
|
hlList.clear();
|
|
return;
|
|
}
|
|
for (esize_t iii = 0;
|
|
iii < hlList.size();
|
|
++iii ) {
|
|
if (hlList[iii] == NULL) {
|
|
continue;
|
|
}
|
|
appl::Highlight::release(hlList[iii]);
|
|
hlList[iii] = NULL;
|
|
}
|
|
hlList.clear();
|
|
}
|
|
|
|
etk::UString appl::highlightManager::getTypeExtention(const etk::UString& _extention) {
|
|
return "";
|
|
}
|
|
|
|
etk::Vector<etk::UString> appl::highlightManager::getTypeList(void) {
|
|
etk::Vector<etk::UString> ret;
|
|
return ret;
|
|
}
|
|
|
|
|