Set the distance field test in compilation flags

This commit is contained in:
2012-10-09 09:40:11 +02:00
parent fc129e2745
commit 6e2df2dc77
13 changed files with 68 additions and 28 deletions

View File

@@ -41,7 +41,7 @@ typedef struct{
uint32_t diplayableLine; //!< NB Line that can be displayed
}infoStatBuffer_ts;
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
#define TEXT_DISPLAY_TYPE OObject2DTextShader
#else
#define TEXT_DISPLAY_TYPE OObject2DTextColored
@@ -85,7 +85,7 @@ class Buffer {
public:
virtual void GetInfo(infoStatBuffer_ts &infoToUpdate) {};
virtual void SetLineDisplay(uint32_t lineNumber) {};
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
virtual int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOText,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY)

View File

@@ -67,7 +67,7 @@ BufferEmpty::~BufferEmpty(void)
* @return ---
*
*/
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
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
@@ -81,7 +81,7 @@ int32_t BufferEmpty::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
// Get color :
Colorize *myColor = NULL;
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
int32_t letterHeight = OOText.GetHeight();
#else
int32_t letterHeight = OOTextNormal.GetHeight();
@@ -94,7 +94,7 @@ int32_t BufferEmpty::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
myColor = ColorizeManager::Get("normal");
tmpDisplay = "edn - Editeur De N'ours";
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
OOText.SetColor(myColor->GetFG());
OOText.SetBold(true);
OOText.SetItalic(false);
@@ -107,7 +107,7 @@ int32_t BufferEmpty::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
myColor = ColorizeManager::Get("commentDoxygen");
textPos.y = (int32_t)(textPos.y - letterHeight*1.30);
tmpDisplay = "No Buffer Availlable to display";
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
OOText.SetBold(false);
OOText.SetItalic(false);
OOText.SetColor(myColor->GetFG());

View File

@@ -32,7 +32,7 @@ class BufferEmpty : public Buffer {
public:
BufferEmpty(void);
virtual ~BufferEmpty(void);
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOText,
ewol::OObject2DColored& OOColored, int32_t offsetX, int32_t offsetY, int32_t sizeX, int32_t sizeY);
#else

View File

@@ -277,7 +277,7 @@ int32_t BufferText::GetNumberOfLine(void)
* @return
*
*/
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOText,
ewol::OObject2DColored& OOColored,
int32_t offsetX, int32_t offsetY,
@@ -296,7 +296,7 @@ int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
bool selIsRect;
int32_t selHave;
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
int32_t letterWidth = OOText.GetSize("A").x;
int32_t letterHeight = OOText.GetHeight();
#else
@@ -330,7 +330,7 @@ int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
draw::Color & myColorSpace = ColorizeManager::Get(COLOR_CODE_SPACE);
draw::Color & myColorTab = ColorizeManager::Get(COLOR_CODE_TAB);
Colorize * selectColor = NULL;
#ifndef __VIDEO__OPENGL_ES_2
#ifndef APPL_BUFFER_FONT_DISTANCE_FIELD
ewol::TEXT_DISPLAY_TYPE* OOTextSelected = NULL;
#endif
int mylen = m_EdnBuf.Size();
@@ -362,7 +362,7 @@ int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
y -= letterHeight;
OOColored.clippingDisable();
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
OOText.clippingDisable();
DrawLineNumber(&OOText, &OOColored, x_base, sizeY, nbColoneForLineNumber, currentLineID, y);
#else
@@ -383,7 +383,7 @@ int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
drawClippingTextArea.w = sizeX - drawClipping.x;
drawClippingTextArea.h = sizeY;
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
OOText.clippingSet(drawClippingTextArea);
#else
OOTextNormal.clippingSet(drawClippingTextArea);
@@ -455,7 +455,7 @@ int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
haveBg = selectColor->HaveBg();
}
}
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
tmpElementProperty.m_ySize = OOText.GetHeight();
OOText.SetColor(selectColor->GetFG());
OOText.SetBold(selectColor->GetBold());
@@ -508,7 +508,7 @@ int32_t BufferText::Display(ewol::TEXT_DISPLAY_TYPE& OOTextNormal,
displayLines++;
currentLineID++;
OOColored.clippingDisable();
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
OOText.clippingDisable();
OOText.SetBold(false);
OOText.SetItalic(false);

View File

@@ -54,7 +54,7 @@ class BufferText : public Buffer {
void GetInfo(infoStatBuffer_ts &infoToUpdate);
void SetLineDisplay(uint32_t lineNumber);
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
int32_t Display(ewol::TEXT_DISPLAY_TYPE& OOText,
ewol::OObject2DColored& OOColored,
int32_t offsetX, int32_t offsetY,

View File

@@ -69,7 +69,7 @@ void CodeView::Init(void)
SetLimitScrolling(0.2);
}
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
CodeView::CodeView(etk::UString fontName, int32_t fontSize) :
m_OObjectText(fontName, fontSize)
{
@@ -118,7 +118,7 @@ bool CodeView::CalculateMinSize(void)
void CodeView::CalculateMaxSize(void)
{
m_maxSize.x = 2048;
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
int32_t letterHeight = m_OObjectText.GetHeight();
#else
int32_t letterHeight = m_OObjectTextNormal.GetHeight();
@@ -130,7 +130,7 @@ void CodeView::CalculateMaxSize(void)
void CodeView::OnDraw(ewol::DrawProperty& displayProp)
{
m_OObjectsColored.Draw();
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
m_OObjectText.Draw();
#else
m_OObjectTextNormal.Draw();
@@ -149,7 +149,7 @@ void CodeView::OnRegenerateDisplay(void)
// For the scrooling windows
CalculateMaxSize();
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
m_OObjectText.Clear();
#else
m_OObjectTextNormal.Clear();
@@ -169,7 +169,7 @@ void CodeView::OnRegenerateDisplay(void)
} // else : nothing to do ...
// generate the objects :
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
BufferManager::Get(m_bufferID)->Display(m_OObjectText,
m_OObjectsColored,
m_originScrooled.x, m_originScrooled.y, m_size.x, m_size.y);
@@ -435,7 +435,7 @@ void CodeView::OnLostFocus(void)
void CodeView::SetFontSize(int32_t size)
{
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
m_OObjectText.SetSize(size);
#else
m_OObjectTextNormal.SetSize(size);
@@ -446,12 +446,11 @@ void CodeView::SetFontSize(int32_t size)
SetScrollingSize(size*3.0*1.46); // 1.46 is a magic nmber ...
}
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
void CodeView::SetFontName(etk::UString fontName)
{
m_OObjectText.SetFont(fontName);
}
#else
void CodeView::SetFontNameNormal(etk::UString fontName)
{

View File

@@ -39,7 +39,7 @@ class CodeView :public ewol::WidgetScrooled
{
public:
void Init(void);
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
CodeView(etk::UString fontName, int32_t fontSize);
#endif
CodeView(void);
@@ -61,7 +61,7 @@ class CodeView :public ewol::WidgetScrooled
etk::Vector<Vector2D<float> > m_lineNumberList;
void UpdateNumberOfLineReference(int32_t bufferID);
// drawing elements :
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
ewol::TEXT_DISPLAY_TYPE m_OObjectText;
#else
ewol::TEXT_DISPLAY_TYPE m_OObjectTextNormal;
@@ -106,7 +106,7 @@ class CodeView :public ewol::WidgetScrooled
virtual void OnLostFocus(void);
public:
void SetFontSize(int32_t size);
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
void SetFontName(etk::UString fontName);
#else
void SetFontNameNormal(etk::UString fontName);

View File

@@ -154,7 +154,7 @@ MainWindows::MainWindows(void)
mySizerHori->SubWidgetAdd(mySizerVert2);
// main buffer Area :
#ifdef __VIDEO__OPENGL_ES_2
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
myCodeView = new CodeView("Font/freefont/FreeMono.ttf", 24);
#else
myCodeView = new CodeView();
@@ -163,7 +163,7 @@ MainWindows::MainWindows(void)
myCodeView->SetExpendY(true);
myCodeView->SetFillX(true);
myCodeView->SetFillY(true);
#ifndef __VIDEO__OPENGL_ES_2
#ifndef APPL_BUFFER_FONT_DISTANCE_FIELD
myCodeView->SetFontSize(11);
myCodeView->SetFontNameNormal( "Font/freefont/FreeMono.ttf");
myCodeView->SetFontNameBold( "Font/freefont/FreeMonoBold.ttf");
@@ -175,6 +175,7 @@ MainWindows::MainWindows(void)
// search area :
Search * mySearch = new Search();
mySizerVert2->SubWidgetAdd(mySearch);
#ifdef APPL_BUFFER_FONT_DISTANCE_FIELD
{
ewol::SizerHori * mySizerHori2 = new ewol::SizerHori();
mySizerVert2->SubWidgetAdd(mySizerHori2);
@@ -201,6 +202,7 @@ MainWindows::MainWindows(void)
tmpSlider->SetValue(0550);
tmpSliderMax = tmpSlider;
}
#endif
mySizerHori = new ewol::SizerHori();
mySizerVert->SubWidgetAdd(mySizerHori);