[DEV] update at the new color class
This commit is contained in:
parent
3747bffa2f
commit
0240bced14
@ -338,8 +338,8 @@ int32_t BufferText::Display(ewol::Text& OOText,
|
||||
// Get color :
|
||||
Colorize * myColor = ColorizeManager::Get("normal");
|
||||
Colorize * myColorSel = ColorizeManager::Get("SelectedText");
|
||||
draw::Color & myColorSpace = ColorizeManager::Get(COLOR_CODE_SPACE);
|
||||
draw::Color & myColorTab = ColorizeManager::Get(COLOR_CODE_TAB);
|
||||
etk::Color<> & myColorSpace = ColorizeManager::Get(COLOR_CODE_SPACE);
|
||||
etk::Color<> & myColorTab = ColorizeManager::Get(COLOR_CODE_TAB);
|
||||
Colorize * selectColor = NULL;
|
||||
int mylen = m_EdnBuf.Size();
|
||||
int32_t x_base=nbColoneForLineNumber*letterWidth;
|
||||
@ -413,7 +413,7 @@ int32_t BufferText::Display(ewol::Text& OOText,
|
||||
selectColor = HLColor->patern->GetColor();
|
||||
}
|
||||
}
|
||||
OOText.SetColorBg(draw::color::none);
|
||||
OOText.SetColorBg(etk::color::none);
|
||||
if( true == selHave
|
||||
&& selStart <= iii
|
||||
&& selEnd > iii)
|
||||
|
@ -17,8 +17,8 @@
|
||||
|
||||
Colorize::Colorize(const etk::UString &_newColorName) :
|
||||
m_colorName(_newColorName),
|
||||
m_colorFG(draw::color::black),
|
||||
m_colorBG(draw::color::none),
|
||||
m_colorFG(etk::color::black),
|
||||
m_colorBG(etk::color::none),
|
||||
m_italic(false),
|
||||
m_bold(false)
|
||||
{
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#ifndef __COLORIZE_H__
|
||||
#define __COLORIZE_H__
|
||||
#include <draw/Color.h>
|
||||
#include <etk/Color.h>
|
||||
#include <etk/UString.h>
|
||||
|
||||
class Colorize {
|
||||
@ -24,17 +24,17 @@ class Colorize {
|
||||
const etk::UString& GetName(void) { return m_colorName; };
|
||||
|
||||
private:
|
||||
draw::Color m_colorFG;
|
||||
etk::Color<> m_colorFG;
|
||||
public:
|
||||
void SetFgColor(const etk::UString& _myColor) { m_colorFG=_myColor.c_str(); };
|
||||
const draw::Color& GetFG(void) { return m_colorFG; };
|
||||
bool HaveFg(void) { return m_colorFG.a!=0; };
|
||||
void SetFgColor(const etk::UString& _myColor) { m_colorFG=_myColor; };
|
||||
const etk::Color<>& GetFG(void) { return m_colorFG; };
|
||||
bool HaveFg(void) { return m_colorFG.a()!=0; };
|
||||
private:
|
||||
draw::Color m_colorBG;
|
||||
etk::Color<> m_colorBG;
|
||||
public:
|
||||
void SetBgColor(const etk::UString& _myColor) { m_colorBG=_myColor.c_str(); };
|
||||
const draw::Color& GetBG(void) { return m_colorBG; };
|
||||
bool HaveBg(void) { return m_colorBG.a!=0; };
|
||||
void SetBgColor(const etk::UString& _myColor) { m_colorBG=_myColor; };
|
||||
const etk::Color<>& GetBG(void) { return m_colorBG; };
|
||||
bool HaveBg(void) { return m_colorBG.a()!=0; };
|
||||
private:
|
||||
bool m_italic;
|
||||
public:
|
||||
|
@ -22,7 +22,7 @@ class classColorManager: public ewol::EObject
|
||||
etk::UString m_fileColor;
|
||||
etk::Vector<Colorize*> listMyColor; //!< List of ALL Color
|
||||
Colorize * errorColor;
|
||||
draw::Color basicColors[COLOR_NUMBER_MAX];
|
||||
etk::Color<> basicColors[COLOR_NUMBER_MAX];
|
||||
|
||||
public:
|
||||
// Constructeur
|
||||
@ -80,7 +80,7 @@ class classColorManager: public ewol::EObject
|
||||
// an error
|
||||
return errorColor;
|
||||
}
|
||||
draw::Color& Get(basicColor_te _myColor)
|
||||
etk::Color<>& Get(basicColor_te _myColor)
|
||||
{
|
||||
if (_myColor < COLOR_NUMBER_MAX) {
|
||||
return basicColors[_myColor];
|
||||
@ -195,7 +195,7 @@ void classColorManager::LoadFile(const etk::UString& _xmlFilename)
|
||||
}
|
||||
etk::UString color = pGuiNode->GetAttribute("val");
|
||||
if (color.Size()!=0) {
|
||||
basicColors[id] = color.c_str();
|
||||
basicColors[id] = color;
|
||||
}
|
||||
}
|
||||
} else if (pNode->GetValue()=="syntax") {
|
||||
@ -292,10 +292,10 @@ Colorize* ColorizeManager::Get(const etk::UString& _colorName)
|
||||
return localManager->Get(_colorName);
|
||||
}
|
||||
|
||||
draw::Color errorColor;
|
||||
|
||||
draw::Color& ColorizeManager::Get(basicColor_te _myColor)
|
||||
etk::Color<>& ColorizeManager::Get(basicColor_te _myColor)
|
||||
{
|
||||
static etk::Color<> errorColor;
|
||||
if (NULL == localManager) {
|
||||
return errorColor;
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include <Colorize.h>
|
||||
#include <appl/globalMsg.h>
|
||||
#include <draw/Color.h>
|
||||
#include <etk/Color.h>
|
||||
#include <ewol/widget/Widget.h>
|
||||
|
||||
typedef enum {
|
||||
@ -39,7 +39,7 @@ namespace ColorizeManager
|
||||
void UnInit(void);
|
||||
void LoadFile(const etk::UString& _xmlFilename);
|
||||
Colorize * Get(const etk::UString& _colorName);
|
||||
draw::Color& Get(basicColor_te _myColor);
|
||||
etk::Color<>& Get(basicColor_te _myColor);
|
||||
bool Exist(const etk::UString& _colorName);
|
||||
void DisplayListOfColor(void);
|
||||
};
|
||||
|
@ -110,7 +110,7 @@ void BufferView::OnReceiveMessage(const ewol::EMessage& _msg)
|
||||
}
|
||||
|
||||
|
||||
draw::Color BufferView::GetBasicBG(void)
|
||||
etk::Color<> BufferView::GetBasicBG(void)
|
||||
{
|
||||
return ColorizeManager::Get(COLOR_LIST_BG_1);
|
||||
}
|
||||
@ -120,7 +120,7 @@ uint32_t BufferView::GetNuberOfColomn(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool BufferView::GetTitle(int32_t colomn, etk::UString &myTitle, draw::Color &fg, draw::Color &bg)
|
||||
bool BufferView::GetTitle(int32_t colomn, etk::UString &myTitle, etk::Color<> &fg, etk::Color<> &bg)
|
||||
{
|
||||
myTitle = "Buffers : ";
|
||||
return true;
|
||||
@ -131,7 +131,7 @@ uint32_t BufferView::GetNuberOfRaw(void)
|
||||
return m_list.Size();
|
||||
}
|
||||
|
||||
bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg)
|
||||
bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color<> &fg, etk::Color<> &bg)
|
||||
{
|
||||
bool isModify;
|
||||
basicColor_te selectFG = COLOR_LIST_TEXT_NORMAL;
|
||||
|
@ -50,13 +50,13 @@ class BufferView : public widget::List
|
||||
virtual void OnReceiveMessage(const ewol::EMessage& _msg);
|
||||
protected:
|
||||
// function call to display the list :
|
||||
virtual draw::Color GetBasicBG(void);
|
||||
virtual etk::Color<> GetBasicBG(void);
|
||||
void RemoveAllElement(void);
|
||||
// Derived function
|
||||
virtual uint32_t GetNuberOfColomn(void);
|
||||
virtual bool GetTitle(int32_t colomn, etk::UString &myTitle, draw::Color &fg, draw::Color &bg);
|
||||
virtual bool GetTitle(int32_t colomn, etk::UString &myTitle, etk::Color<> &fg, etk::Color<> &bg);
|
||||
virtual uint32_t GetNuberOfRaw(void);
|
||||
virtual bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg);
|
||||
virtual bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color<> &fg, etk::Color<> &bg);
|
||||
virtual bool OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEvent, int32_t colomn, int32_t raw, float x, float y);
|
||||
};
|
||||
|
||||
|
@ -32,10 +32,10 @@ void CodeView::Init(void)
|
||||
|
||||
m_lineNumberList.Clear();
|
||||
|
||||
m_textColorFg = draw::color::black;
|
||||
m_textColorFg = etk::color::black;
|
||||
|
||||
m_textColorBg = draw::color::black;
|
||||
m_textColorBg.a = 0x40;
|
||||
m_textColorBg = etk::color::black;
|
||||
m_textColorBg.SetA(0x40);
|
||||
SetCanHaveFocus(true);
|
||||
RegisterMultiCast(ednMsgBufferId);
|
||||
RegisterMultiCast(ednMsgGuiCopy);
|
||||
|
@ -27,8 +27,8 @@ class CodeView :public widget::WidgetScrooled
|
||||
virtual ~CodeView(void);
|
||||
private:
|
||||
etk::UString m_label;
|
||||
draw::Color m_textColorFg; //!< Text color
|
||||
draw::Color m_textColorBg; //!< Background color
|
||||
etk::Color<> m_textColorFg; //!< Text color
|
||||
etk::Color<> m_textColorBg; //!< Background color
|
||||
int32_t m_bufferID;
|
||||
bool m_buttunOneSelected;
|
||||
etk::Vector<vec2 > m_lineNumberList;
|
||||
|
@ -36,16 +36,15 @@ appl::TagFileList::~TagFileList(void)
|
||||
}
|
||||
}
|
||||
|
||||
draw::Color appl::TagFileList::GetBasicBG(void) {
|
||||
draw::Color bg(0x00000010);
|
||||
return bg;
|
||||
etk::Color<> appl::TagFileList::GetBasicBG(void) {
|
||||
return 0x00000010;
|
||||
}
|
||||
|
||||
uint32_t appl::TagFileList::GetNuberOfColomn(void) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
bool appl::TagFileList::GetTitle(int32_t colomn, etk::UString &myTitle, draw::Color &fg, draw::Color &bg) {
|
||||
bool appl::TagFileList::GetTitle(int32_t colomn, etk::UString &myTitle, etk::Color<> &fg, etk::Color<> &bg) {
|
||||
myTitle = "title";
|
||||
return true;
|
||||
}
|
||||
@ -54,7 +53,7 @@ uint32_t appl::TagFileList::GetNuberOfRaw(void) {
|
||||
return m_list.Size();
|
||||
}
|
||||
|
||||
bool appl::TagFileList::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg) {
|
||||
bool appl::TagFileList::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color<> &fg, etk::Color<> &bg) {
|
||||
if (raw >= 0 && raw < m_list.Size() && NULL != m_list[raw]) {
|
||||
if (0==colomn) {
|
||||
myTextToWrite = etk::UString(m_list[raw]->fileLine);
|
||||
@ -64,7 +63,7 @@ bool appl::TagFileList::GetElement(int32_t colomn, int32_t raw, etk::UString &my
|
||||
} else {
|
||||
myTextToWrite = "ERROR";
|
||||
}
|
||||
fg = draw::color::black;
|
||||
fg = etk::color::black;
|
||||
if (raw % 2) {
|
||||
if (colomn%2==0) {
|
||||
bg = 0xFFFFFF00;
|
||||
|
@ -34,11 +34,11 @@ namespace appl {
|
||||
TagFileList(void);
|
||||
~TagFileList(void);
|
||||
// display API :
|
||||
virtual draw::Color GetBasicBG(void);
|
||||
virtual etk::Color<> GetBasicBG(void);
|
||||
uint32_t GetNuberOfColomn(void);
|
||||
bool GetTitle(int32_t colomn, etk::UString &myTitle, draw::Color &fg, draw::Color &bg);
|
||||
bool GetTitle(int32_t colomn, etk::UString &myTitle, etk::Color<> &fg, etk::Color<> &bg);
|
||||
uint32_t GetNuberOfRaw(void);
|
||||
bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg);
|
||||
bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color<> &fg, etk::Color<> &bg);
|
||||
bool OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEvent, int32_t colomn, int32_t raw, float x, float y);
|
||||
// derived function
|
||||
const char * const GetObjectType(void) { return "TagFileList"; };
|
||||
|
Loading…
x
Reference in New Issue
Block a user