GUI : Reload on the fly the Color file
This commit is contained in:
@@ -135,6 +135,20 @@ Highlight::~Highlight(void)
|
||||
m_listExtentions.Clear();
|
||||
}
|
||||
|
||||
void Highlight::ReloadColor(void)
|
||||
{
|
||||
int32_t i;
|
||||
for (i=0; i< m_listHighlightPass1.Size(); i++) {
|
||||
if (NULL != m_listHighlightPass1[i]) {
|
||||
m_listHighlightPass1[i]->ReloadColor();
|
||||
}
|
||||
}
|
||||
for (i=0; i< m_listHighlightPass2.Size(); i++) {
|
||||
if (NULL != m_listHighlightPass2[i]) {
|
||||
m_listHighlightPass2[i]->ReloadColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool Highlight::HasExtention(Edn::String &ext)
|
||||
{
|
||||
|
@@ -56,6 +56,7 @@ class Highlight {
|
||||
bool HasExtention(Edn::String &ext);
|
||||
bool FileNameCompatible(Edn::File &fileName);
|
||||
void Display(void);
|
||||
void ReloadColor(void);
|
||||
void Parse(int32_t start,
|
||||
int32_t stop,
|
||||
Edn::VectorType<colorInformation_ts> &metaData,
|
||||
|
@@ -30,7 +30,7 @@
|
||||
#undef __class__
|
||||
#define __class__ "HighlightManager"
|
||||
|
||||
HighlightManager::HighlightManager(void)
|
||||
HighlightManager::HighlightManager(void) : MsgBroadcast("Hight-light Manager", EDN_CAT_HL)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -50,6 +50,21 @@ HighlightManager::~HighlightManager(void)
|
||||
}
|
||||
|
||||
|
||||
void HighlightManager::OnMessage(int32_t id, int32_t dataID)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case EDN_MSG__COLOR_HAS_CHANGE:
|
||||
EDN_INFO("UPDATE the color pointer on the HL");
|
||||
for (int32_t i=0; i<listHighlight.Size(); i++) {
|
||||
if (NULL != listHighlight[i]) {
|
||||
listHighlight[i]->ReloadColor();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Highlight *HighlightManager::Get(Edn::File &fileName)
|
||||
{
|
||||
int32_t i;
|
||||
|
@@ -29,10 +29,11 @@
|
||||
class HighlightManager;
|
||||
|
||||
#include "Singleton.h"
|
||||
#include "MsgBroadcast.h"
|
||||
#include "Highlight.h"
|
||||
|
||||
|
||||
class HighlightManager: public Singleton<HighlightManager>
|
||||
class HighlightManager: public Singleton<HighlightManager>, public MsgBroadcast
|
||||
{
|
||||
friend class Singleton<HighlightManager>;
|
||||
// specific for sigleton system...
|
||||
@@ -41,6 +42,8 @@ class HighlightManager: public Singleton<HighlightManager>
|
||||
HighlightManager(void);
|
||||
~HighlightManager(void);
|
||||
|
||||
public:
|
||||
void OnMessage(int32_t id, int32_t dataID);
|
||||
public:
|
||||
void loadLanguages(void);
|
||||
Highlight * Get(Edn::File &fileName);
|
||||
|
@@ -87,6 +87,13 @@ bool HighlightPattern::IsEnable(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void HighlightPattern::ReloadColor(void)
|
||||
{
|
||||
ColorizeManager *myColorManager = ColorizeManager::getInstance();
|
||||
m_color = myColorManager->Get(m_colorName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
|
@@ -51,23 +51,25 @@ class HighlightPattern {
|
||||
HighlightPattern(void);
|
||||
~HighlightPattern(void);
|
||||
|
||||
void SetName(Edn::String &name) { m_paternName = name;};
|
||||
Edn::String GetName(void) { return m_paternName;};
|
||||
void SetName(Edn::String &name) { m_paternName = name;};
|
||||
Edn::String GetName(void) { return m_paternName;};
|
||||
|
||||
void SetPaternStart(Edn::String ®Exp);
|
||||
void SetPaternStop(Edn::String ®Exp);
|
||||
void SetColor(Edn::String &colorName);
|
||||
void SetEscapeChar(Edn::String &EscapeChar);
|
||||
void SetMultiline(bool enable) { m_multiline = enable; };
|
||||
void SetPaternStart(Edn::String ®Exp);
|
||||
void SetPaternStop(Edn::String ®Exp);
|
||||
void SetColor(Edn::String &colorName);
|
||||
void SetEscapeChar(Edn::String &EscapeChar);
|
||||
void SetMultiline(bool enable) { m_multiline = enable; };
|
||||
|
||||
void SetLevel(int32_t newLevel) { m_level = newLevel; };
|
||||
int32_t GetLevel(void) { return m_level; };
|
||||
void SetLevel(int32_t newLevel) { m_level = newLevel; };
|
||||
int32_t GetLevel(void) { return m_level; };
|
||||
|
||||
bool IsEnable(void);
|
||||
void Display(void);
|
||||
bool IsEnable(void);
|
||||
void Display(void);
|
||||
resultFind_te Find(int32_t start, int32_t stop, colorInformation_ts &resultat, EdnVectorBuf &buffer);
|
||||
Colorize * GetColor(void) { return m_color; };
|
||||
void ParseRules(TiXmlNode *child, int32_t level);
|
||||
Colorize * GetColor(void) { return m_color; };
|
||||
void ParseRules(TiXmlNode *child, int32_t level);
|
||||
|
||||
void ReloadColor(void);
|
||||
|
||||
private:
|
||||
int32_t m_level; //!< Level of the pattern ==> this is to overwrite next pattern when we create an higher ....
|
||||
|
Reference in New Issue
Block a user