remove etkFloat_t element and coord2D_ts with float and Vector2D<float>

This commit is contained in:
Edouard Dupin 2012-07-01 10:13:24 +02:00
parent df8d2772da
commit 0d79b55112
13 changed files with 35 additions and 35 deletions

View File

@ -54,7 +54,7 @@
</rule> </rule>
<rule name="condition"> <rule name="condition">
<color>boolean</color> <color>boolean</color>
<start>==|&lt;=|&gt;=|!=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}|</start> <start>==|&lt;=|&gt;=|~=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}|</start>
</rule> </rule>
</pass2> </pass2>
</EdnLang> </EdnLang>

View File

@ -117,19 +117,19 @@ bool Buffer::NeedToUpdateDisplayPosition(void)
return tmpVal; return tmpVal;
} }
coord2D_ts Buffer::GetBorderSize(void) Vector2D<float> Buffer::GetBorderSize(void)
{ {
coord2D_ts tmpVal; Vector2D<float> tmpVal;
tmpVal.x = 30; tmpVal.x = 30;
tmpVal.y = 30; tmpVal.y = 30;
return tmpVal; return tmpVal;
} }
coord2D_ts Buffer::GetPosition(int32_t fontId,bool& centerRequested) Vector2D<float> Buffer::GetPosition(int32_t fontId,bool& centerRequested)
{ {
centerRequested = false; centerRequested = false;
coord2D_ts tmpVal; Vector2D<float> tmpVal;
tmpVal.x = 0; tmpVal.x = 0;
tmpVal.y = 0; tmpVal.y = 0;
return tmpVal; return tmpVal;

View File

@ -117,15 +117,15 @@ class Buffer {
// moving with cursor change position: // moving with cursor change position:
private: private:
bool m_updatePositionRequested; //!< if a position xhange in the windows ... bool m_updatePositionRequested; //!< if a position xhange in the windows ...
coord2D_ts m_maximumSize; //!< current maxSize of the buffer Vector2D<float> m_maximumSize; //!< current maxSize of the buffer
protected: protected:
void RequestUpdateOfThePosition(void) { m_updatePositionRequested = true; }; void RequestUpdateOfThePosition(void) { m_updatePositionRequested = true; };
void SetMaximumSize(coord2D_ts maxSize) { m_maximumSize = maxSize; }; void SetMaximumSize(Vector2D<float> maxSize) { m_maximumSize = maxSize; };
public: public:
bool NeedToUpdateDisplayPosition(void); bool NeedToUpdateDisplayPosition(void);
virtual coord2D_ts GetBorderSize(void); // this is to requested the minimum size for the buffer that is not consider as visible ... virtual Vector2D<float> GetBorderSize(void); // this is to requested the minimum size for the buffer that is not consider as visible ...
virtual coord2D_ts GetPosition(int32_t fontId, bool& centerRequested); virtual Vector2D<float> GetPosition(int32_t fontId, bool& centerRequested);
coord2D_ts GetMaxSize(void) { return m_maximumSize; }; Vector2D<float> GetMaxSize(void) { return m_maximumSize; };
protected: protected:
bool m_fileModify; //!< bool m_fileModify; //!<
// naming // naming

View File

@ -79,7 +79,7 @@ int32_t BufferEmpty::Display(ewol::OObject2DTextColored& OOTextNormal,
int32_t fontId = OOTextNormal.GetFontID(); int32_t fontId = OOTextNormal.GetFontID();
int32_t letterHeight = ewol::GetHeight(fontId); int32_t letterHeight = ewol::GetHeight(fontId);
coord2D_ts textPos; Vector2D<float> textPos;
textPos.x = 20; textPos.x = 20;
textPos.y = 20; textPos.y = 20;

View File

@ -214,7 +214,7 @@ void BufferText::DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObjec
OOColored->Rectangle( 0, positionY, sizeX+0.5*SEPARATION_SIZE_LINE_NUMBER, sizeY); OOColored->Rectangle( 0, positionY, sizeX+0.5*SEPARATION_SIZE_LINE_NUMBER, sizeY);
OOText->SetColor(ColorizeManager::Get(COLOR_CODE_LINE_NUMBER)); OOText->SetColor(ColorizeManager::Get(COLOR_CODE_LINE_NUMBER));
coord2D_ts textPos; Vector2D<float> textPos;
textPos.x = 1; textPos.x = 1;
textPos.y = positionY; textPos.y = positionY;
etk::UString tmppp = tmpLineNumber; etk::UString tmppp = tmpLineNumber;
@ -299,7 +299,7 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
// update the display position with the scroll ofset : // update the display position with the scroll ofset :
int32_t displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, displayStartLineId); int32_t displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, displayStartLineId);
coord2D_ts maxSize; Vector2D<float> maxSize;
maxSize.x = 0.0; maxSize.x = 0.0;
maxSize.y = m_EdnBuf.NumberOfLines() * letterHeight; maxSize.y = m_EdnBuf.NumberOfLines() * letterHeight;
int32_t nbColoneForLineNumber = GetLineNumberNumberOfElement(); int32_t nbColoneForLineNumber = GetLineNumberNumberOfElement();
@ -370,7 +370,7 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
OOTextBoldItalic.clippingSet(drawClippingTextArea); OOTextBoldItalic.clippingSet(drawClippingTextArea);
OOColored.clippingSet(drawClippingTextArea); OOColored.clippingSet(drawClippingTextArea);
etkFloat_t lineMaxSize = 0.0; float lineMaxSize = 0.0;
for (iii=displayStartBufferPos; iii<mylen && displayLines < m_displaySize.y ; iii = new_i) { for (iii=displayStartBufferPos; iii<mylen && displayLines < m_displaySize.y ; iii = new_i) {
//APPL_DEBUG("diplay element=" << iii); //APPL_DEBUG("diplay element=" << iii);
int displaywidth; int displaywidth;
@ -411,7 +411,7 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
haveBg = selectColor->HaveBg(); haveBg = selectColor->HaveBg();
} }
} }
coord2D_ts textPos; Vector2D<float> textPos;
textPos.x = pixelX-offsetX; textPos.x = pixelX-offsetX;
textPos.y = y; textPos.y = y;
if (true == selectColor->GetItalic() ) { if (true == selectColor->GetItalic() ) {
@ -849,11 +849,11 @@ void BufferText::cursorMove(ewol::eventKbMoveType_te moveTypeEvent)
* @return --- * @return ---
* *
*/ */
coord2D_ts BufferText::GetPosition(int32_t fontId, bool& centerRequested) Vector2D<float> BufferText::GetPosition(int32_t fontId, bool& centerRequested)
{ {
centerRequested = m_centerRequested; centerRequested = m_centerRequested;
m_centerRequested = false; m_centerRequested = false;
coord2D_ts outputPosition; Vector2D<float> outputPosition;
// Display position (Y mode): // Display position (Y mode):
APPL_INFO("change the position : " << m_cursorPos); APPL_INFO("change the position : " << m_cursorPos);
@ -867,8 +867,8 @@ coord2D_ts BufferText::GetPosition(int32_t fontId, bool& centerRequested)
// get font porperties : // get font porperties :
// TODO : change this : // TODO : change this :
etkFloat_t letterWidth = ewol::GetWidth(fontId, "A"); float letterWidth = ewol::GetWidth(fontId, "A");
etkFloat_t letterHeight = ewol::GetHeight(fontId); float letterHeight = ewol::GetHeight(fontId);
outputPosition.x *= letterWidth; outputPosition.x *= letterWidth;
outputPosition.y *= letterHeight; outputPosition.y *= letterHeight;
return outputPosition; return outputPosition;
@ -876,7 +876,7 @@ coord2D_ts BufferText::GetPosition(int32_t fontId, bool& centerRequested)
/* if we request a center : /* if we request a center :
} else { } else {
// center the line at the middle of the screen : // center the line at the middle of the screen :
coord2D_ts outputPosition; Vector2D<float> outputPosition;
//APPL_DEBUG(" -------------------------------------------------"); //APPL_DEBUG(" -------------------------------------------------");
outputPosition.y = m_EdnBuf.CountLines(0, m_cursorPos); outputPosition.y = m_EdnBuf.CountLines(0, m_cursorPos);
//APPL_DEBUG(" cursor position : " << m_cursorPos << " ==> ligne=" << outputPosition.y); //APPL_DEBUG(" cursor position : " << m_cursorPos << " ==> ligne=" << outputPosition.y);

View File

@ -85,7 +85,7 @@ class BufferText : public Buffer {
// Direct buffer IO // Direct buffer IO
EdnBuf m_EdnBuf; //!< buffer associated on this displayer EdnBuf m_EdnBuf; //!< buffer associated on this displayer
coord2D_ts m_displaySize; //!< number of char displayable in the screan Vector2D<float> m_displaySize; //!< number of char displayable in the screan
// Cursor : // Cursor :
int32_t m_cursorPos; //!< position in the buffer of the cursor int32_t m_cursorPos; //!< position in the buffer of the cursor
int32_t m_cursorPreferredCol; //!< colomn of the last up and down ... int32_t m_cursorPreferredCol; //!< colomn of the last up and down ...
@ -96,7 +96,7 @@ class BufferText : public Buffer {
private: private:
bool m_centerRequested; bool m_centerRequested;
public: public:
virtual coord2D_ts GetPosition(int32_t fontId, bool& centerRequested); virtual Vector2D<float> GetPosition(int32_t fontId, bool& centerRequested);
private: private:
bool TextDMoveUp(int32_t offset); bool TextDMoveUp(int32_t offset);
bool TextDMoveDown(int32_t offset); bool TextDMoveDown(int32_t offset);

View File

@ -186,7 +186,7 @@ bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToW
return true; return true;
} }
bool BufferView::OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y) bool BufferView::OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, float x, float y)
{ {
if (1 == IdInput && typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) { if (1 == IdInput && typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) {
APPL_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw ); APPL_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw );

View File

@ -69,7 +69,7 @@ class BufferView : public ewol::List
virtual bool GetTitle(int32_t colomn, etk::UString &myTitle, color_ts &fg, color_ts &bg); virtual bool GetTitle(int32_t colomn, etk::UString &myTitle, color_ts &fg, color_ts &bg);
virtual uint32_t GetNuberOfRaw(void); virtual uint32_t GetNuberOfRaw(void);
virtual bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, color_ts &fg, color_ts &bg); virtual bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, color_ts &fg, color_ts &bg);
virtual bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y); virtual bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, float x, float y);
private: private:
int32_t m_selectedIdRequested; int32_t m_selectedIdRequested;
int32_t m_selectedID; int32_t m_selectedID;

View File

@ -87,7 +87,7 @@ CodeView::~CodeView(void)
*/ */
void CodeView::UpdateNumberOfLineReference(int32_t bufferID) void CodeView::UpdateNumberOfLineReference(int32_t bufferID)
{ {
coord2D_ts tmpCoord; Vector2D<float> tmpCoord;
tmpCoord.x = 0; tmpCoord.x = 0;
tmpCoord.y = 0; tmpCoord.y = 0;
if (m_lineNumberList.Size()<=bufferID) { if (m_lineNumberList.Size()<=bufferID) {
@ -182,9 +182,9 @@ void CodeView::OnRegenerateDisplay(void)
if(true == BufferManager::Get(m_bufferID)->NeedToUpdateDisplayPosition() ) { if(true == BufferManager::Get(m_bufferID)->NeedToUpdateDisplayPosition() ) {
coord2D_ts borderWidth = BufferManager::Get(m_bufferID)->GetBorderSize(); Vector2D<float> borderWidth = BufferManager::Get(m_bufferID)->GetBorderSize();
bool centerRequested = false; bool centerRequested = false;
coord2D_ts currentPosition = BufferManager::Get(m_bufferID)->GetPosition(m_OObjectTextNormal[m_currentCreateId].GetFontID(), centerRequested); Vector2D<float> currentPosition = BufferManager::Get(m_bufferID)->GetPosition(m_OObjectTextNormal[m_currentCreateId].GetFontID(), centerRequested);
SetScrollingPositionDynamic(borderWidth, currentPosition, centerRequested); SetScrollingPositionDynamic(borderWidth, currentPosition, centerRequested);
} // else : nothing to do ... } // else : nothing to do ...
@ -238,9 +238,9 @@ bool CodeView::OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveTy
* @return true the event is used * @return true the event is used
* @return false the event is not used * @return false the event is not used
*/ */
bool CodeView::OnEventInput(ewol::inputType_te type, int32_t IdInput, ewol::eventInputType_te typeEvent, coord2D_ts pos) bool CodeView::OnEventInput(ewol::inputType_te type, int32_t IdInput, ewol::eventInputType_te typeEvent, Vector2D<float> pos)
{ {
coord2D_ts relativePos = RelativePosition(pos); Vector2D<float> relativePos = RelativePosition(pos);
if (m_bufferID < 0) { if (m_bufferID < 0) {
return false; return false;
} }

View File

@ -63,7 +63,7 @@ class CodeView :public ewol::WidgetScrooled
color_ts m_textColorBg; //!< Background color color_ts m_textColorBg; //!< Background color
int32_t m_bufferID; int32_t m_bufferID;
bool m_buttunOneSelected; bool m_buttunOneSelected;
etk::VectorType<coord2D_ts> m_lineNumberList; etk::VectorType<Vector2D<float> > m_lineNumberList;
void UpdateNumberOfLineReference(int32_t bufferID); void UpdateNumberOfLineReference(int32_t bufferID);
// drawing elements : // drawing elements :
ewol::OObject2DTextColored m_OObjectTextNormal[NB_BOUBLE_BUFFER]; ewol::OObject2DTextColored m_OObjectTextNormal[NB_BOUBLE_BUFFER];
@ -92,7 +92,7 @@ class CodeView :public ewol::WidgetScrooled
* @return true the event is used * @return true the event is used
* @return false the event is not used * @return false the event is not used
*/ */
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, ewol::eventInputType_te typeEvent, coord2D_ts pos); virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, ewol::eventInputType_te typeEvent, Vector2D<float> pos);
virtual bool OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData); virtual bool OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData);
virtual bool OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveType_te moveTypeEvent); virtual bool OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveType_te moveTypeEvent);

View File

@ -93,7 +93,7 @@ etk::UString CTagsManager::GetFolder(etk::UString &inputString)
return out; return out;
} }
bool CTagsManager::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y) bool CTagsManager::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, float x, float y)
{ {
/* /*
switch (id) switch (id)
@ -348,7 +348,7 @@ void CTagsManager::JumpTo(void)
// get the middle button of the clipboard ==> represent the current selection ... // get the middle button of the clipboard ==> represent the current selection ...
ClipBoard::Get(COPY_MIDDLE_BUTTON, data); ClipBoard::Get(COPY_MIDDLE_BUTTON, data);
if (data.Size() == 0) { if (data.Size() == 0) {
APPL_INFO("No current Sélection"); APPL_INFO("No current S\E9lection");
} }
tagEntry entry; tagEntry entry;
data.PushBack('\0'); data.PushBack('\0');

View File

@ -50,7 +50,7 @@ class CTagsManager: public etk::Singleton<CTagsManager>, public ewol::Widget
~CTagsManager(void); ~CTagsManager(void);
public: public:
virtual bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y); virtual bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, float x, float y);
private: private:
int32_t m_currentSelectedID; int32_t m_currentSelectedID;
void LoadTagFile(void); void LoadTagFile(void);