display of the special font work....
This commit is contained in:
parent
3bdc96097c
commit
dab060c4fe
@ -41,8 +41,11 @@ typedef struct{
|
||||
uint32_t diplayableLine; //!< NB Line that can be displayed
|
||||
}infoStatBuffer_ts;
|
||||
|
||||
//#define TEXT_DISPLAY_TYPE OObject2DTextColored
|
||||
#define TEXT_DISPLAY_TYPE OObject2DTextShader
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
#define TEXT_DISPLAY_TYPE OObject2DTextShader
|
||||
#else
|
||||
#define TEXT_DISPLAY_TYPE OObject2DTextColored
|
||||
#endif
|
||||
|
||||
class Buffer {
|
||||
public:
|
||||
@ -82,12 +85,17 @@ class Buffer {
|
||||
public:
|
||||
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate) {};
|
||||
virtual void SetLineDisplay(uint32_t lineNumber) {};
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
virtual int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOText,
|
||||
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
|
||||
|
||||
#else
|
||||
virtual int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
||||
ewol::TEXT_DISPLAY_TYPE& OOTextBold,
|
||||
ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
|
||||
ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
|
||||
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
|
||||
#endif
|
||||
{
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
@ -67,32 +67,55 @@ BufferEmpty::~BufferEmpty(void)
|
||||
* @return ---
|
||||
*
|
||||
*/
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
int32_t BufferEmpty::Display(ewol::TEXT_DISPLAY_TYPE& OOText,
|
||||
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
|
||||
#else
|
||||
int32_t BufferEmpty::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
||||
ewol::TEXT_DISPLAY_TYPE& OOTextBold,
|
||||
ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
|
||||
ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
|
||||
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)
|
||||
#endif
|
||||
{
|
||||
// Get color :
|
||||
Colorize *myColor = NULL;
|
||||
|
||||
int32_t letterHeight = OOTextNormal.GetHeight();
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
int32_t letterHeight = OOText.GetHeight();
|
||||
#else
|
||||
int32_t letterHeight = OOTextNormal.GetHeight();
|
||||
#endif
|
||||
|
||||
Vector2D<float> textPos;
|
||||
textPos.x = 20;
|
||||
textPos.y = sizeY - 20 - letterHeight;
|
||||
etk::UString tmpDisplay ;
|
||||
/*
|
||||
|
||||
myColor = ColorizeManager::Get("normal");
|
||||
OOTextBold.SetColor(myColor->GetFG());
|
||||
etk::UString tmpDisplay = "edn - Editeur De N'ours";
|
||||
OOTextBold.Text(textPos, tmpDisplay);
|
||||
*/
|
||||
tmpDisplay = "edn - Editeur De N'ours";
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
OOText.SetColor(myColor->GetFG());
|
||||
OOText.SetBold(true);
|
||||
OOText.SetItalic(false);
|
||||
OOText.Text(textPos, tmpDisplay);
|
||||
#else
|
||||
OOTextBold.SetColor(myColor->GetFG());
|
||||
OOTextBold.Text(textPos, tmpDisplay);
|
||||
#endif
|
||||
|
||||
myColor = ColorizeManager::Get("commentDoxygen");
|
||||
OOTextNormal.SetColor(myColor->GetFG());
|
||||
textPos.y = (int32_t)(textPos.y - letterHeight*1.30);
|
||||
tmpDisplay = "No Buffer Availlable to display";
|
||||
OOTextNormal.Text(textPos, tmpDisplay);
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
OOText.SetBold(false);
|
||||
OOText.SetItalic(false);
|
||||
OOText.SetColor(myColor->GetFG());
|
||||
OOText.Text(textPos, tmpDisplay);
|
||||
#else
|
||||
OOTextNormal.SetColor(myColor->GetFG());
|
||||
OOTextNormal.Text(textPos, tmpDisplay);
|
||||
#endif
|
||||
|
||||
OOColored.SetColor(draw::color::white);
|
||||
OOColored.Rectangle( 0, 0, sizeX, sizeY);
|
||||
|
@ -32,11 +32,17 @@ class BufferEmpty : public Buffer {
|
||||
public:
|
||||
BufferEmpty(void);
|
||||
virtual ~BufferEmpty(void);
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOText,
|
||||
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY);
|
||||
#else
|
||||
int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
||||
ewol::TEXT_DISPLAY_TYPE& OOTextBold,
|
||||
ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
|
||||
ewol::TEXT_DISPLAY_TYPE& OOTextBoldItalic,
|
||||
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY);
|
||||
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
@ -277,6 +277,12 @@ int32_t BufferText::GetNumberOfLine(void)
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOText,
|
||||
ewol::OObject2DColored& OOColored,
|
||||
int32_t offsetX, int32_t offsetY,
|
||||
int32_t sizeX, int32_t sizeY)
|
||||
#else
|
||||
int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
||||
ewol::TEXT_DISPLAY_TYPE& OOTextBold,
|
||||
ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
|
||||
@ -284,14 +290,19 @@ int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
||||
ewol::OObject2DColored& OOColored,
|
||||
int32_t offsetX, int32_t offsetY,
|
||||
int32_t sizeX, int32_t sizeY)
|
||||
#endif
|
||||
{
|
||||
int32_t selStart, selEnd, selRectStart, selRectEnd;
|
||||
bool selIsRect;
|
||||
int32_t selHave;
|
||||
|
||||
int32_t letterWidth = OOTextNormal.GetSize("A").x;
|
||||
int32_t letterHeight = OOTextNormal.GetHeight();
|
||||
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
int32_t letterWidth = OOText.GetSize("A").x;
|
||||
int32_t letterHeight = OOText.GetHeight();
|
||||
#else
|
||||
int32_t letterWidth = OOTextNormal.GetSize("A").x;
|
||||
int32_t letterHeight = OOTextNormal.GetHeight();
|
||||
#endif
|
||||
int32_t displayStartLineId = offsetY / letterHeight - 1;
|
||||
displayStartLineId = etk_max(0, displayStartLineId);
|
||||
uint32_t y = - offsetY + displayStartLineId*letterHeight;
|
||||
@ -316,11 +327,12 @@ int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
||||
// 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);
|
||||
draw::Color & myColorSpace = ColorizeManager::Get(COLOR_CODE_SPACE);
|
||||
draw::Color & myColorTab = ColorizeManager::Get(COLOR_CODE_TAB);
|
||||
Colorize * selectColor = NULL;
|
||||
#ifndef __VIDEO__OPENGL_ES_2
|
||||
ewol::TEXT_DISPLAY_TYPE* OOTextSelected = NULL;
|
||||
|
||||
#endif
|
||||
int mylen = m_EdnBuf.Size();
|
||||
int32_t x_base=nbColoneForLineNumber*letterWidth;
|
||||
int32_t idX = 0;
|
||||
@ -349,9 +361,14 @@ int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
||||
y = sizeY - y;
|
||||
y -= letterHeight;
|
||||
|
||||
OOTextNormal.clippingDisable();
|
||||
OOColored.clippingDisable();
|
||||
DrawLineNumber(&OOTextNormal, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y);
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
OOText.clippingDisable();
|
||||
DrawLineNumber(&OOText, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y);
|
||||
#else
|
||||
OOTextNormal.clippingDisable();
|
||||
DrawLineNumber(&OOTextNormal, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y);
|
||||
#endif
|
||||
int32_t pixelX = x_base + SEPARATION_SIZE_LINE_NUMBER;
|
||||
|
||||
clipping_ts drawClipping;
|
||||
@ -366,10 +383,14 @@ int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
||||
drawClippingTextArea.w = sizeX - drawClipping.x;
|
||||
drawClippingTextArea.h = sizeY;
|
||||
|
||||
OOTextNormal.clippingSet(drawClippingTextArea);
|
||||
OOTextBold.clippingSet(drawClippingTextArea);
|
||||
OOTextItalic.clippingSet(drawClippingTextArea);
|
||||
OOTextBoldItalic.clippingSet(drawClippingTextArea);
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
OOText.clippingSet(drawClippingTextArea);
|
||||
#else
|
||||
OOTextNormal.clippingSet(drawClippingTextArea);
|
||||
OOTextBold.clippingSet(drawClippingTextArea);
|
||||
OOTextItalic.clippingSet(drawClippingTextArea);
|
||||
OOTextBoldItalic.clippingSet(drawClippingTextArea);
|
||||
#endif
|
||||
OOColored.clippingSet(drawClippingTextArea);
|
||||
|
||||
// Clear the line intexation :
|
||||
@ -434,25 +455,34 @@ int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
||||
haveBg = selectColor->HaveBg();
|
||||
}
|
||||
}
|
||||
if (true == selectColor->GetItalic() ) {
|
||||
if (true == selectColor->GetBold() ) {
|
||||
OOTextSelected = &OOTextBoldItalic;
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
tmpElementProperty.m_ySize = OOText.GetHeight();
|
||||
OOText.SetColor(selectColor->GetFG());
|
||||
OOText.SetBold(selectColor->GetBold());
|
||||
OOText.SetItalic(selectColor->GetItalic());
|
||||
myStringToDisplay = displayChar;
|
||||
drawSize = OOText.Text(textPos, myStringToDisplay);
|
||||
#else
|
||||
if (true == selectColor->GetItalic() ) {
|
||||
if (true == selectColor->GetBold() ) {
|
||||
OOTextSelected = &OOTextBoldItalic;
|
||||
} else {
|
||||
OOTextSelected = &OOTextItalic;
|
||||
}
|
||||
} else {
|
||||
OOTextSelected = &OOTextItalic;
|
||||
if (true == selectColor->GetBold() ) {
|
||||
OOTextSelected = &OOTextBold;
|
||||
} else {
|
||||
OOTextSelected = &OOTextNormal;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (true == selectColor->GetBold() ) {
|
||||
OOTextSelected = &OOTextBold;
|
||||
} else {
|
||||
OOTextSelected = &OOTextNormal;
|
||||
}
|
||||
}
|
||||
tmpElementProperty.m_ySize = OOTextSelected->GetHeight();
|
||||
//tmpElementProperty.m_yOffset += tmpElementProperty.m_ySize;
|
||||
OOTextSelected->SetColor(selectColor->GetFG());
|
||||
// TODO : Remove this unreallistic leak of time
|
||||
myStringToDisplay = displayChar;
|
||||
drawSize = OOTextSelected->Text(textPos, myStringToDisplay);
|
||||
tmpElementProperty.m_ySize = OOTextSelected->GetHeight();
|
||||
//tmpElementProperty.m_yOffset += tmpElementProperty.m_ySize;
|
||||
OOTextSelected->SetColor(selectColor->GetFG());
|
||||
// TODO : Remove this unreallistic leak of time
|
||||
myStringToDisplay = displayChar;
|
||||
drawSize = OOTextSelected->Text(textPos, myStringToDisplay);
|
||||
#endif
|
||||
//APPL_DEBUG("add element : " << tmpElementProperty.m_yOffset << "," << tmpElementProperty.m_xOffset);
|
||||
m_elmentList.PushBack(tmpElementProperty);
|
||||
|
||||
@ -477,10 +507,18 @@ int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
||||
y -= letterHeight;
|
||||
displayLines++;
|
||||
currentLineID++;
|
||||
OOTextNormal.clippingDisable();
|
||||
OOColored.clippingDisable();
|
||||
DrawLineNumber(&OOTextNormal, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y);
|
||||
OOTextNormal.clippingEnable();
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
OOText.clippingDisable();
|
||||
OOText.SetBold(false);
|
||||
OOText.SetItalic(false);
|
||||
DrawLineNumber(&OOText, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y);
|
||||
OOText.clippingEnable();
|
||||
#else
|
||||
OOTextNormal.clippingDisable();
|
||||
DrawLineNumber(&OOTextNormal, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y);
|
||||
OOTextNormal.clippingEnable();
|
||||
#endif
|
||||
OOColored.clippingEnable();
|
||||
// add elements :
|
||||
m_elmentList.PushBack(tmpElementProperty);
|
||||
|
@ -54,7 +54,12 @@ class BufferText : public Buffer {
|
||||
|
||||
void GetInfo(infoStatBuffer_ts &infoToUpdate);
|
||||
void SetLineDisplay(uint32_t lineNumber);
|
||||
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOText,
|
||||
ewol::OObject2DColored& OOColored,
|
||||
int32_t offsetX, int32_t offsetY,
|
||||
int32_t sizeX, int32_t sizeY);
|
||||
#else
|
||||
int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
|
||||
ewol::TEXT_DISPLAY_TYPE& OOTextBold,
|
||||
ewol::TEXT_DISPLAY_TYPE& OOTextItalic,
|
||||
@ -62,6 +67,7 @@ class BufferText : public Buffer {
|
||||
ewol::OObject2DColored& OOColored,
|
||||
int32_t offsetX, int32_t offsetY,
|
||||
int32_t sizeX, int32_t sizeY);
|
||||
#endif
|
||||
void AddChar(uniChar_t unicodeData);
|
||||
void cursorMove(ewol::eventKbMoveType_te moveTypeEvent);
|
||||
void MouseSelectFromCursorTo(Vector2D<float> pos);
|
||||
|
@ -41,8 +41,7 @@
|
||||
#undef __class__
|
||||
#define __class__ "CodeView"
|
||||
|
||||
|
||||
CodeView::CodeView(void)
|
||||
void CodeView::Init(void)
|
||||
{
|
||||
m_label = "CodeView is disable ...";
|
||||
|
||||
@ -70,6 +69,19 @@ CodeView::CodeView(void)
|
||||
SetLimitScrolling(0.2);
|
||||
}
|
||||
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
CodeView::CodeView(etk::UString fontName, int32_t fontSize) :
|
||||
m_OObjectText(fontName, fontSize)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
#endif
|
||||
|
||||
CodeView::CodeView(void)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
CodeView::~CodeView(void)
|
||||
{
|
||||
|
||||
@ -106,7 +118,11 @@ bool CodeView::CalculateMinSize(void)
|
||||
void CodeView::CalculateMaxSize(void)
|
||||
{
|
||||
m_maxSize.x = 2048;
|
||||
int32_t letterHeight = m_OObjectTextNormal.GetHeight();
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
int32_t letterHeight = m_OObjectText.GetHeight();
|
||||
#else
|
||||
int32_t letterHeight = m_OObjectTextNormal.GetHeight();
|
||||
#endif
|
||||
m_maxSize.y = BufferManager::Get(m_bufferID)->GetNumberOfLine() * letterHeight;
|
||||
}
|
||||
|
||||
@ -114,10 +130,14 @@ void CodeView::CalculateMaxSize(void)
|
||||
void CodeView::OnDraw(ewol::DrawProperty& displayProp)
|
||||
{
|
||||
m_OObjectsColored.Draw();
|
||||
m_OObjectTextNormal.Draw();
|
||||
m_OObjectTextBold.Draw();
|
||||
m_OObjectTextItalic.Draw();
|
||||
m_OObjectTextBoldItalic.Draw();
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
m_OObjectText.Draw();
|
||||
#else
|
||||
m_OObjectTextNormal.Draw();
|
||||
m_OObjectTextBold.Draw();
|
||||
m_OObjectTextItalic.Draw();
|
||||
m_OObjectTextBoldItalic.Draw();
|
||||
#endif
|
||||
WidgetScrooled::OnDraw(displayProp);
|
||||
}
|
||||
|
||||
@ -129,10 +149,14 @@ void CodeView::OnRegenerateDisplay(void)
|
||||
// For the scrooling windows
|
||||
CalculateMaxSize();
|
||||
|
||||
m_OObjectTextNormal.Clear();
|
||||
m_OObjectTextBold.Clear();
|
||||
m_OObjectTextItalic.Clear();
|
||||
m_OObjectTextBoldItalic.Clear();
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
m_OObjectText.Clear();
|
||||
#else
|
||||
m_OObjectTextNormal.Clear();
|
||||
m_OObjectTextBold.Clear();
|
||||
m_OObjectTextItalic.Clear();
|
||||
m_OObjectTextBoldItalic.Clear();
|
||||
#endif
|
||||
m_OObjectsColored.Clear();
|
||||
|
||||
|
||||
@ -145,12 +169,18 @@ void CodeView::OnRegenerateDisplay(void)
|
||||
} // else : nothing to do ...
|
||||
|
||||
// generate the objects :
|
||||
BufferManager::Get(m_bufferID)->Display(m_OObjectTextNormal,
|
||||
m_OObjectTextBold,
|
||||
m_OObjectTextItalic,
|
||||
m_OObjectTextBoldItalic,
|
||||
m_OObjectsColored,
|
||||
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
BufferManager::Get(m_bufferID)->Display(m_OObjectText,
|
||||
m_OObjectsColored,
|
||||
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
|
||||
#else
|
||||
BufferManager::Get(m_bufferID)->Display(m_OObjectTextNormal,
|
||||
m_OObjectTextBold,
|
||||
m_OObjectTextItalic,
|
||||
m_OObjectTextBoldItalic,
|
||||
m_OObjectsColored,
|
||||
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
|
||||
#endif
|
||||
// set the current size of the windows
|
||||
SetMaxSize(BufferManager::Get(m_bufferID)->GetMaxSize());
|
||||
|
||||
@ -405,29 +435,41 @@ void CodeView::OnLostFocus(void)
|
||||
|
||||
void CodeView::SetFontSize(int32_t size)
|
||||
{
|
||||
m_OObjectTextNormal.SetSize(size);
|
||||
m_OObjectTextBold.SetSize(size);
|
||||
m_OObjectTextItalic.SetSize(size);
|
||||
m_OObjectTextBoldItalic.SetSize(size);
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
m_OObjectText.SetSize(size);
|
||||
#else
|
||||
m_OObjectTextNormal.SetSize(size);
|
||||
m_OObjectTextBold.SetSize(size);
|
||||
m_OObjectTextItalic.SetSize(size);
|
||||
m_OObjectTextBoldItalic.SetSize(size);
|
||||
#endif
|
||||
SetScrollingSize(size*3.0*1.46); // 1.46 is a magic nmber ...
|
||||
}
|
||||
|
||||
void CodeView::SetFontNameNormal(etk::UString fontName)
|
||||
{
|
||||
m_OObjectTextNormal.SetFont(fontName);
|
||||
}
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
void CodeView::SetFontName(etk::UString fontName)
|
||||
{
|
||||
m_OObjectText.SetFont(fontName);
|
||||
}
|
||||
|
||||
void CodeView::SetFontNameBold(etk::UString fontName)
|
||||
{
|
||||
m_OObjectTextBold.SetFont(fontName);
|
||||
}
|
||||
|
||||
void CodeView::SetFontNameItalic(etk::UString fontName)
|
||||
{
|
||||
m_OObjectTextItalic.SetFont(fontName);
|
||||
}
|
||||
|
||||
void CodeView::SetFontNameBoldItalic(etk::UString fontName)
|
||||
{
|
||||
m_OObjectTextBoldItalic.SetFont(fontName);
|
||||
}
|
||||
#else
|
||||
void CodeView::SetFontNameNormal(etk::UString fontName)
|
||||
{
|
||||
m_OObjectTextNormal.SetFont(fontName);
|
||||
}
|
||||
|
||||
void CodeView::SetFontNameBold(etk::UString fontName)
|
||||
{
|
||||
m_OObjectTextBold.SetFont(fontName);
|
||||
}
|
||||
|
||||
void CodeView::SetFontNameItalic(etk::UString fontName)
|
||||
{
|
||||
m_OObjectTextItalic.SetFont(fontName);
|
||||
}
|
||||
|
||||
void CodeView::SetFontNameBoldItalic(etk::UString fontName)
|
||||
{
|
||||
m_OObjectTextBoldItalic.SetFont(fontName);
|
||||
}
|
||||
#endif
|
@ -38,7 +38,11 @@
|
||||
class CodeView :public ewol::WidgetScrooled
|
||||
{
|
||||
public:
|
||||
CodeView(void);
|
||||
void Init(void);
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
CodeView(etk::UString fontName, int32_t fontSize);
|
||||
#endif
|
||||
CodeView(void);
|
||||
virtual ~CodeView(void);
|
||||
/**
|
||||
* @brief Get the current Object type of the EObject
|
||||
@ -57,10 +61,14 @@ class CodeView :public ewol::WidgetScrooled
|
||||
etk::Vector<Vector2D<float> > m_lineNumberList;
|
||||
void UpdateNumberOfLineReference(int32_t bufferID);
|
||||
// drawing elements :
|
||||
ewol::TEXT_DISPLAY_TYPE m_OObjectTextNormal;
|
||||
ewol::TEXT_DISPLAY_TYPE m_OObjectTextBold;
|
||||
ewol::TEXT_DISPLAY_TYPE m_OObjectTextItalic;
|
||||
ewol::TEXT_DISPLAY_TYPE m_OObjectTextBoldItalic;
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
ewol::TEXT_DISPLAY_TYPE m_OObjectText;
|
||||
#else
|
||||
ewol::TEXT_DISPLAY_TYPE m_OObjectTextNormal;
|
||||
ewol::TEXT_DISPLAY_TYPE m_OObjectTextBold;
|
||||
ewol::TEXT_DISPLAY_TYPE m_OObjectTextItalic;
|
||||
ewol::TEXT_DISPLAY_TYPE m_OObjectTextBoldItalic;
|
||||
#endif
|
||||
ewol::OObject2DColored m_OObjectsColored;
|
||||
|
||||
public:
|
||||
@ -98,10 +106,14 @@ class CodeView :public ewol::WidgetScrooled
|
||||
virtual void OnLostFocus(void);
|
||||
public:
|
||||
void SetFontSize(int32_t size);
|
||||
void SetFontNameNormal(etk::UString fontName);
|
||||
void SetFontNameBold(etk::UString fontName);
|
||||
void SetFontNameItalic(etk::UString fontName);
|
||||
void SetFontNameBoldItalic(etk::UString fontName);
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
void SetFontName(etk::UString fontName);
|
||||
#else
|
||||
void SetFontNameNormal(etk::UString fontName);
|
||||
void SetFontNameBold(etk::UString fontName);
|
||||
void SetFontNameItalic(etk::UString fontName);
|
||||
void SetFontNameBoldItalic(etk::UString fontName);
|
||||
#endif
|
||||
private:
|
||||
void CalculateMaxSize(void);
|
||||
protected:
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include <ewol/widget/ContextMenu.h>
|
||||
#include <ewol/widget/PopUp.h>
|
||||
#include <ewol/widget/Spacer.h>
|
||||
#include <ewol/widget/Slider.h>
|
||||
#include <ewol/widget/Menu.h>
|
||||
#include <ewol/widget/meta/FileChooser.h>
|
||||
#include <ewol/widget/meta/Parameter.h>
|
||||
@ -112,6 +113,16 @@ class ParameterAboutGui : public ewol::SizerVert
|
||||
};
|
||||
|
||||
|
||||
const char * l_smoothChick = "tmpEvent_smooth";
|
||||
const char * l_smoothMin = "tmpEvent_minChange";
|
||||
const char * l_smoothMax = "tmpEvent_maxChange";
|
||||
|
||||
|
||||
extern float DF_SoftEdge_min;
|
||||
extern float DF_SoftEdge_max;
|
||||
extern int32_t DF_SoftEdge;
|
||||
ewol::Slider* tmpSliderMin = NULL;
|
||||
ewol::Slider* tmpSliderMax = NULL;
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "MainWindows"
|
||||
@ -143,21 +154,53 @@ MainWindows::MainWindows(void)
|
||||
mySizerHori->SubWidgetAdd(mySizerVert2);
|
||||
|
||||
// main buffer Area :
|
||||
myCodeView = new CodeView();
|
||||
#ifdef __VIDEO__OPENGL_ES_2
|
||||
myCodeView = new CodeView("Font/freefont/FreeMono.ttf", 24);
|
||||
#else
|
||||
myCodeView = new CodeView();
|
||||
#endif
|
||||
myCodeView->SetExpendX(true);
|
||||
myCodeView->SetExpendY(true);
|
||||
myCodeView->SetFillX(true);
|
||||
myCodeView->SetFillY(true);
|
||||
myCodeView->SetFontSize(48);
|
||||
myCodeView->SetFontNameNormal( "Font/freefont/FreeMono.ttf");
|
||||
myCodeView->SetFontNameBold( "Font/freefont/FreeMonoBold.ttf");
|
||||
myCodeView->SetFontNameItalic( "Font/freefont/FreeMonoOblique.ttf");
|
||||
myCodeView->SetFontNameBoldItalic("Font/freefont/FreeMonoBoldOblique.ttf");
|
||||
#ifndef __VIDEO__OPENGL_ES_2
|
||||
myCodeView->SetFontSize(11);
|
||||
myCodeView->SetFontNameNormal( "Font/freefont/FreeMono.ttf");
|
||||
myCodeView->SetFontNameBold( "Font/freefont/FreeMonoBold.ttf");
|
||||
myCodeView->SetFontNameItalic( "Font/freefont/FreeMonoOblique.ttf");
|
||||
myCodeView->SetFontNameBoldItalic("Font/freefont/FreeMonoBoldOblique.ttf");
|
||||
#endif
|
||||
mySizerVert2->SubWidgetAdd(myCodeView);
|
||||
|
||||
// search area :
|
||||
Search * mySearch = new Search();
|
||||
mySizerVert2->SubWidgetAdd(mySearch);
|
||||
{
|
||||
ewol::SizerHori * mySizerHori2 = new ewol::SizerHori();
|
||||
mySizerVert2->SubWidgetAdd(mySizerHori2);
|
||||
|
||||
ewol::CheckBox* tmpCheck = new ewol::CheckBox("smooth");
|
||||
mySizerHori2->SubWidgetAdd(tmpCheck);
|
||||
tmpCheck->RegisterOnEvent(this, ewolEventCheckBoxClicked, l_smoothChick);
|
||||
|
||||
ewol::Slider* tmpSlider = new ewol::Slider();
|
||||
mySizerHori2->SubWidgetAdd(tmpSlider);
|
||||
tmpSlider->RegisterOnEvent(this, ewolEventSliderChange, l_smoothMin);
|
||||
tmpSlider->SetExpendX(true);
|
||||
tmpSlider->SetMin(0);
|
||||
tmpSlider->SetMax(1000);
|
||||
tmpSlider->SetValue(0450);
|
||||
tmpSliderMin = tmpSlider;
|
||||
|
||||
tmpSlider = new ewol::Slider();
|
||||
mySizerHori2->SubWidgetAdd(tmpSlider);
|
||||
tmpSlider->RegisterOnEvent(this, ewolEventSliderChange, l_smoothMax);
|
||||
tmpSlider->SetExpendX(true);
|
||||
tmpSlider->SetMin(0);
|
||||
tmpSlider->SetMax(1000);
|
||||
tmpSlider->SetValue(0550);
|
||||
tmpSliderMax = tmpSlider;
|
||||
}
|
||||
|
||||
mySizerHori = new ewol::SizerHori();
|
||||
mySizerVert->SubWidgetAdd(mySizerHori);
|
||||
@ -349,9 +392,30 @@ void MainWindows::OnReceiveMessage(ewol::EObject * CallerObject, const char * ev
|
||||
tmpSubWidget = new ParameterAboutGui();
|
||||
tmpWidget->MenuAdd("About", "", tmpSubWidget);
|
||||
}
|
||||
} else if (eventId == l_smoothChick) {
|
||||
if (data == "true") {
|
||||
DF_SoftEdge = 1;
|
||||
} else {
|
||||
DF_SoftEdge = 0;
|
||||
}
|
||||
} else if (eventId == l_smoothMin) {
|
||||
int32_t newVal = 0;
|
||||
sscanf(data.c_str(), "%d", &newVal);
|
||||
DF_SoftEdge_min = (float)newVal / 1000.0;
|
||||
if (DF_SoftEdge_min>DF_SoftEdge_max) {
|
||||
DF_SoftEdge_max = DF_SoftEdge_min;
|
||||
tmpSliderMax->SetValue(DF_SoftEdge_max*1000.0);
|
||||
}
|
||||
} else if (eventId == l_smoothMax) {
|
||||
int32_t newVal = 0;
|
||||
sscanf(data.c_str(), "%d", &newVal);
|
||||
DF_SoftEdge_max = (float)newVal / 1000.0;
|
||||
if (DF_SoftEdge_min>DF_SoftEdge_max) {
|
||||
DF_SoftEdge_min = DF_SoftEdge_max;
|
||||
tmpSliderMin->SetValue(DF_SoftEdge_min*1000.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user