From ae29b34eabc44bfb1af44ecdbe70fbcfc0ce11ab Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 3 Dec 2012 10:00:01 +0100 Subject: [PATCH] [DEV] adapt vector 2D, 3D and 4D wrapper with statdard glsl vec[2-4] ivec[2-4] and std mat4 --- external/etk | 2 +- sources/ewol/compositing/Compositing.cpp | 12 +-- sources/ewol/compositing/Compositing.h | 8 +- sources/ewol/compositing/Drawing.cpp | 80 +++++++++---------- sources/ewol/compositing/Drawing.h | 32 ++++---- sources/ewol/compositing/Image.cpp | 36 ++++----- sources/ewol/compositing/Image.h | 32 ++++---- sources/ewol/compositing/Shaper.cpp | 16 ++-- sources/ewol/compositing/Shaper.h | 20 ++--- sources/ewol/compositing/Text.cpp | 80 +++++++++---------- sources/ewol/compositing/Text.h | 38 ++++----- sources/ewol/ewol.cpp | 4 +- sources/ewol/ewol.h | 4 +- sources/ewol/game/GameElement.cpp | 4 +- sources/ewol/game/GameElement.h | 12 +-- sources/ewol/game/SceneElement.cpp | 26 +++--- sources/ewol/game/SceneElement.h | 16 ++-- sources/ewol/renderer/ResourceManager.cpp | 4 +- sources/ewol/renderer/ResourceManager.h | 2 +- sources/ewol/renderer/openGL.cpp | 18 ++--- sources/ewol/renderer/openGL.h | 6 +- sources/ewol/renderer/os/eSystem.cpp | 8 +- sources/ewol/renderer/os/eSystem.h | 2 +- sources/ewol/renderer/os/eSystemInput.cpp | 6 +- sources/ewol/renderer/os/eSystemInput.h | 14 ++-- sources/ewol/renderer/os/gui.Android.base.cpp | 6 +- sources/ewol/renderer/os/gui.Windows.cpp | 8 +- sources/ewol/renderer/os/gui.X11.cpp | 8 +- sources/ewol/renderer/os/gui.h | 6 +- .../ewol/renderer/resources/FontFreeType.cpp | 12 +-- .../ewol/renderer/resources/FontFreeType.h | 4 +- sources/ewol/renderer/resources/Image.cpp | 2 +- sources/ewol/renderer/resources/Image.h | 2 +- sources/ewol/renderer/resources/Mesh.cpp | 12 +-- sources/ewol/renderer/resources/Mesh.h | 6 +- sources/ewol/renderer/resources/MeshObj.cpp | 14 ++-- sources/ewol/renderer/resources/Program.cpp | 2 +- sources/ewol/renderer/resources/Program.h | 2 +- sources/ewol/renderer/resources/Texture.cpp | 2 +- sources/ewol/renderer/resources/Texture.h | 6 +- .../ewol/renderer/resources/TexturedFont.cpp | 8 +- .../ewol/renderer/resources/TexturedFont.h | 2 +- .../ewol/renderer/resources/font/FontBase.h | 4 +- .../renderer/resources/font/GlyphProperty.h | 10 +-- .../renderer/resources/image/ImageBMP.cpp | 12 +-- .../renderer/resources/image/ImagePNG.cpp | 4 +- sources/ewol/widget/Button.cpp | 42 +++++----- sources/ewol/widget/Button.h | 6 +- sources/ewol/widget/ButtonColor.cpp | 28 +++---- sources/ewol/widget/ButtonColor.h | 6 +- sources/ewol/widget/CheckBox.cpp | 16 ++-- sources/ewol/widget/CheckBox.h | 2 +- sources/ewol/widget/ColorBar.cpp | 30 +++---- sources/ewol/widget/ColorBar.h | 4 +- sources/ewol/widget/ContextMenu.cpp | 50 ++++++------ sources/ewol/widget/ContextMenu.h | 10 +-- sources/ewol/widget/Entry.cpp | 20 ++--- sources/ewol/widget/Entry.h | 4 +- sources/ewol/widget/Image.cpp | 12 +-- sources/ewol/widget/Image.h | 6 +- sources/ewol/widget/Joystick.cpp | 4 +- sources/ewol/widget/Joystick.h | 4 +- sources/ewol/widget/Label.cpp | 6 +- sources/ewol/widget/Label.h | 2 +- sources/ewol/widget/Layer.cpp | 8 +- sources/ewol/widget/Layer.h | 2 +- sources/ewol/widget/List.cpp | 18 ++--- sources/ewol/widget/List.h | 4 +- sources/ewol/widget/Menu.cpp | 6 +- sources/ewol/widget/PopUp.cpp | 30 +++---- sources/ewol/widget/PopUp.h | 2 +- sources/ewol/widget/ProgressBar.cpp | 8 +- sources/ewol/widget/Scene.cpp | 8 +- sources/ewol/widget/Scene.h | 6 +- sources/ewol/widget/SizerHori.cpp | 14 ++-- sources/ewol/widget/SizerHori.h | 2 +- sources/ewol/widget/SizerVert.cpp | 14 ++-- sources/ewol/widget/SizerVert.h | 2 +- sources/ewol/widget/Slider.cpp | 10 +-- sources/ewol/widget/Slider.h | 2 +- sources/ewol/widget/Spacer.cpp | 4 +- sources/ewol/widget/Spacer.h | 2 +- sources/ewol/widget/WSlider.cpp | 8 +- sources/ewol/widget/WSlider.h | 4 +- sources/ewol/widget/Widget.cpp | 28 +++---- sources/ewol/widget/Widget.h | 30 +++---- sources/ewol/widget/WidgetScrolled.cpp | 36 ++++----- sources/ewol/widget/WidgetScrolled.h | 12 +-- sources/ewol/widget/Windows.cpp | 6 +- sources/ewol/widget/Windows.h | 2 +- sources/ewol/widget/meta/ParameterList.cpp | 10 +-- sources/ewol/widget/meta/ParameterList.h | 2 +- test/human/appl/init.cpp | 2 +- 93 files changed, 574 insertions(+), 574 deletions(-) diff --git a/external/etk b/external/etk index 03c1459c..a44667d4 160000 --- a/external/etk +++ b/external/etk @@ -1 +1 @@ -Subproject commit 03c1459c66ee3f4da2c6140612949e99f8d7248c +Subproject commit a44667d4566066767a7961dde989a661c932943e diff --git a/sources/ewol/compositing/Compositing.cpp b/sources/ewol/compositing/Compositing.cpp index b52390ac..04d74f0c 100644 --- a/sources/ewol/compositing/Compositing.cpp +++ b/sources/ewol/compositing/Compositing.cpp @@ -31,21 +31,21 @@ void ewol::Compositing::ResetMatrix(void) } -void ewol::Compositing::Translate(etk::Vector3D vect) +void ewol::Compositing::Translate(vec3 vect) { - m_matrixApply *= etk::Matrix4::Translate(vect); + m_matrixApply *= mat4::Translate(vect); } -void ewol::Compositing::Rotate(etk::Vector3D vect, float angle) +void ewol::Compositing::Rotate(vec3 vect, float angle) { - m_matrixApply *= etk::Matrix4::Rotate(vect, angle); + m_matrixApply *= mat4::Rotate(vect, angle); } -void ewol::Compositing::Scale(etk::Vector3D vect) +void ewol::Compositing::Scale(vec3 vect) { - m_matrixApply *= etk::Matrix4::Scale(vect); + m_matrixApply *= mat4::Scale(vect); } diff --git a/sources/ewol/compositing/Compositing.h b/sources/ewol/compositing/Compositing.h index 8e26d46d..32fdd98a 100644 --- a/sources/ewol/compositing/Compositing.h +++ b/sources/ewol/compositing/Compositing.h @@ -18,7 +18,7 @@ namespace ewol class Compositing { protected: - etk::Matrix4 m_matrixApply; + mat4 m_matrixApply; public: /** * @brief generic constructor @@ -44,17 +44,17 @@ namespace ewol * @brief Translate the current display of this element * @param[in] vect The translation vector to apply at the transformation matrix */ - virtual void Translate(etk::Vector3D vect); + virtual void Translate(vec3 vect); /** * @brief Rotate the curent display of this element * @param[in] vect The rotation vector to apply at the transformation matrix */ - virtual void Rotate(etk::Vector3D vect, float angle); + virtual void Rotate(vec3 vect, float angle); /** * @brief Scale the current diaplsy of this element * @param[in] vect The scaling vector to apply at the transformation matrix */ - virtual void Scale(etk::Vector3D vect); + virtual void Scale(vec3 vect); }; }; diff --git a/sources/ewol/compositing/Drawing.cpp b/sources/ewol/compositing/Drawing.cpp index bf4adecb..0e97fcbe 100644 --- a/sources/ewol/compositing/Drawing.cpp +++ b/sources/ewol/compositing/Drawing.cpp @@ -12,7 +12,7 @@ #if 0 -static void generatePolyGone(etk::Vector > & input, etk::Vector > & output ) +static void generatePolyGone(etk::Vector & input, etk::Vector & output ) { if (input.Size()<3) { return; @@ -26,7 +26,7 @@ static void generatePolyGone(etk::Vector > & input, etk::Ve //EWOL_DEBUG("generate Plygone : " << input.Size() << " ==> " << output.Size() ); } -static void SutherlandHodgman(etk::Vector > & input, etk::Vector > & output, float sx, float sy, float ex, float ey) +static void SutherlandHodgman(etk::Vector & input, etk::Vector & output, float sx, float sy, float ex, float ey) { // with Sutherland-Hodgman-Algorithm if (input.Size() <0) { @@ -34,8 +34,8 @@ static void SutherlandHodgman(etk::Vector > & input, etk::V } //int32_t sizeInit=input.Size(); // last element : - etk::Vector2D destPoint; - etk::Vector2D lastElement = input[input.Size()-1]; + vec2 destPoint; + vec2 lastElement = input[input.Size()-1]; bool inside = true; if (lastElement.x < sx) { inside = false; @@ -271,7 +271,7 @@ void ewol::Drawing::InternalSetColor(draw::Color& color) } -void ewol::Drawing::SetPoint(etk::Vector3D point) +void ewol::Drawing::SetPoint(vec3 point) { m_triangle[m_triElement] = point; m_triElement++; @@ -320,7 +320,7 @@ void ewol::Drawing::Draw(void) return; } // set Matrix : translation/positionMatrix - etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix()*m_matrixApply; + mat4 tmpMatrix = ewol::openGL::GetMatrix()*m_matrixApply; m_GLprogram->Use(); m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat); // position : @@ -341,10 +341,10 @@ void ewol::Drawing::Clear(void) m_coord.Clear(); m_coordColor.Clear(); // Reset temporal variables : - m_position = etk::Vector3D(0.0, 0.0, 0.0); + m_position = vec3(0.0, 0.0, 0.0); - m_clippingPosStart = etk::Vector3D(0.0, 0.0, 0.0); - m_clippingPosStop = etk::Vector3D(0.0, 0.0, 0.0); + m_clippingPosStart = vec3(0.0, 0.0, 0.0); + m_clippingPosStop = vec3(0.0, 0.0, 0.0); m_clippingEnable = false; m_color = draw::color::black; @@ -357,19 +357,19 @@ void ewol::Drawing::Clear(void) } -etk::Vector3D ewol::Drawing::GetPos(void) +vec3 ewol::Drawing::GetPos(void) { return m_position; } -void ewol::Drawing::SetPos(etk::Vector3D pos) +void ewol::Drawing::SetPos(vec3 pos) { m_position = pos; } -void ewol::Drawing::SetRelPos(etk::Vector3D pos) +void ewol::Drawing::SetRelPos(vec3 pos) { m_position += pos; } @@ -387,12 +387,12 @@ void ewol::Drawing::SetColorBg(draw::Color color) } -void ewol::Drawing::SetClippingWidth(etk::Vector3D pos, etk::Vector3D width) +void ewol::Drawing::SetClippingWidth(vec3 pos, vec3 width) { SetClipping(pos, pos+width); } -void ewol::Drawing::SetClipping(etk::Vector3D pos, etk::Vector3D posEnd) +void ewol::Drawing::SetClipping(vec3 pos, vec3 posEnd) { // note the internal system all time request to have a bounding all time in the same order if (pos.x <= posEnd.x) { @@ -443,7 +443,7 @@ void ewol::Drawing::AddVertex(void) } -void ewol::Drawing::LineTo(etk::Vector3D dest) +void ewol::Drawing::LineTo(vec3 dest) { ResetCount(); InternalSetColor(m_color); @@ -467,24 +467,24 @@ void ewol::Drawing::LineTo(etk::Vector3D dest) float offsety = sin(teta-M_PI/2) * (m_thickness/2); float offsetx = cos(teta-M_PI/2) * (m_thickness/2); - SetPoint(etk::Vector3D(m_position.x - offsetx, m_position.y - offsety, (float)0.0) ); - SetPoint(etk::Vector3D(m_position.x + offsetx, m_position.y + offsety, (float)0.0) ); - SetPoint(etk::Vector3D(dest.x + offsetx, dest.y + offsety, (float)0.0) ); + SetPoint(vec3(m_position.x - offsetx, m_position.y - offsety, (float)0.0) ); + SetPoint(vec3(m_position.x + offsetx, m_position.y + offsety, (float)0.0) ); + SetPoint(vec3(dest.x + offsetx, dest.y + offsety, (float)0.0) ); - SetPoint(etk::Vector3D(dest.x + offsetx, dest.y + offsety, (float)0.0) ); - SetPoint(etk::Vector3D(dest.x - offsetx, dest.y - offsety, (float)0.0) ); - SetPoint(etk::Vector3D(m_position.x - offsetx, m_position.y - offsety, (float)0.0) ); + SetPoint(vec3(dest.x + offsetx, dest.y + offsety, (float)0.0) ); + SetPoint(vec3(dest.x - offsetx, dest.y - offsety, (float)0.0) ); + SetPoint(vec3(m_position.x - offsetx, m_position.y - offsety, (float)0.0) ); // update the system position : m_position = dest; } -void ewol::Drawing::LineRel(etk::Vector3D vect) +void ewol::Drawing::LineRel(vec3 vect) { LineTo(m_position+vect); } -void ewol::Drawing::Rectangle(etk::Vector3D dest) +void ewol::Drawing::Rectangle(vec3 dest) { ResetCount(); InternalSetColor(m_color); @@ -517,24 +517,24 @@ void ewol::Drawing::Rectangle(etk::Vector3D dest) || dxA >= dxB) { return; } - SetPoint(etk::Vector3D(dxA, dyD, (float)0.0) ); - SetPoint(etk::Vector3D(dxA, dyC, (float)0.0) ); - SetPoint(etk::Vector3D(dxB, dyC, (float)0.0) ); + SetPoint(vec3(dxA, dyD, (float)0.0) ); + SetPoint(vec3(dxA, dyC, (float)0.0) ); + SetPoint(vec3(dxB, dyC, (float)0.0) ); - SetPoint(etk::Vector3D(dxB, dyC, (float)0.0) ); - SetPoint(etk::Vector3D(dxB, dyD, (float)0.0) ); - SetPoint(etk::Vector3D(dxA, dyD, (float)0.0) ); + SetPoint(vec3(dxB, dyC, (float)0.0) ); + SetPoint(vec3(dxB, dyD, (float)0.0) ); + SetPoint(vec3(dxA, dyD, (float)0.0) ); } -void ewol::Drawing::RectangleWidth(etk::Vector3D size) +void ewol::Drawing::RectangleWidth(vec3 size) { Rectangle(m_position+size); } -void ewol::Drawing::Cube(etk::Vector3D dest) +void ewol::Drawing::Cube(vec3 dest) { } @@ -560,19 +560,19 @@ void ewol::Drawing::Circle(float radius, float angleStart, float angleStop) if (m_colorBg.a!=0) { InternalSetColor(m_colorBg); for (int32_t iii=0; iii(m_position.x, m_position.y) ); + SetPoint(vec3(m_position.x, m_position.y) ); float angleOne = angleStart + (angleStop* iii / nbOcurence) ; float offsety = sin(angleOne) * radius; float offsetx = cos(angleOne) * radius; - SetPoint(etk::Vector3D(m_position.x + offsetx, m_position.y + offsety) ); + SetPoint(vec3(m_position.x + offsetx, m_position.y + offsety) ); float angleTwo = angleStart + (angleStop* (iii+1) / nbOcurence) ; offsety = sin(angleTwo) * radius; offsetx = cos(angleTwo) * radius; - SetPoint(etk::Vector3D(m_position.x + offsetx, m_position.y + offsety) ); + SetPoint(vec3(m_position.x + offsetx, m_position.y + offsety) ); } } @@ -596,13 +596,13 @@ void ewol::Drawing::Circle(float radius, float angleStart, float angleStop) float offsetInt2y = sin(angleTwo) * (radius-m_thickness/2); float offsetInt2x = cos(angleTwo) * (radius-m_thickness/2); - SetPoint(etk::Vector3D(m_position.x + offsetIntx, m_position.y + offsetInty)); - SetPoint(etk::Vector3D(m_position.x + offsetExtx, m_position.y + offsetExty)); - SetPoint(etk::Vector3D(m_position.x + offsetExt2x, m_position.y + offsetExt2y)); + SetPoint(vec3(m_position.x + offsetIntx, m_position.y + offsetInty)); + SetPoint(vec3(m_position.x + offsetExtx, m_position.y + offsetExty)); + SetPoint(vec3(m_position.x + offsetExt2x, m_position.y + offsetExt2y)); - SetPoint(etk::Vector3D(m_position.x + offsetExt2x, m_position.y + offsetExt2y)); - SetPoint(etk::Vector3D(m_position.x + offsetInt2x, m_position.y + offsetInt2y)); - SetPoint(etk::Vector3D(m_position.x + offsetIntx, m_position.y + offsetInty)); + SetPoint(vec3(m_position.x + offsetExt2x, m_position.y + offsetExt2y)); + SetPoint(vec3(m_position.x + offsetInt2x, m_position.y + offsetInt2y)); + SetPoint(vec3(m_position.x + offsetIntx, m_position.y + offsetInty)); } } diff --git a/sources/ewol/compositing/Drawing.h b/sources/ewol/compositing/Drawing.h index 69730ca4..c9235c20 100644 --- a/sources/ewol/compositing/Drawing.h +++ b/sources/ewol/compositing/Drawing.h @@ -21,9 +21,9 @@ namespace ewol class Drawing : public ewol::Compositing { private: - etk::Vector3D m_position; //!< The current position to draw - etk::Vector3D m_clippingPosStart; //!< Clipping start position - etk::Vector3D m_clippingPosStop; //!< Clipping stop position + vec3 m_position; //!< The current position to draw + vec3 m_clippingPosStart; //!< Clipping start position + vec3 m_clippingPosStop; //!< Clipping stop position bool m_clippingEnable; //!< true if the clipping must be activated private: draw::Color m_color; //!< The text foreground color @@ -34,7 +34,7 @@ namespace ewol int32_t m_GLMatrix; //!< openGL id on the element (transformation matrix) int32_t m_GLColor; //!< openGL id on the element (color buffer) private: // Background Color (display only when needed) - etk::Vector > m_coord; //!< internal position for the text display + etk::Vector m_coord; //!< internal position for the text display etk::Vector m_coordColor; //!< internal color of the background public: /** @@ -56,7 +56,7 @@ namespace ewol void UnLoadProgram(void); float m_thickness; //!< when drawing line and other things int32_t m_triElement; //!< special counter of the single dot generated - etk::Vector3D m_triangle[3]; //!< Register every system with a combinaison of tiangle + vec3 m_triangle[3]; //!< Register every system with a combinaison of tiangle draw::Colorf m_tricolor[3]; //!< Register every the associated color foreground // internal API for the generation abstraction of triangles /** @@ -76,7 +76,7 @@ namespace ewol * @brief internal add of the specific point * @param[in] point The requeste dpoint to add */ - void SetPoint(etk::Vector3D point); + void SetPoint(vec3 point); public: /** @@ -91,17 +91,17 @@ namespace ewol * @brief Get the current display position (sometime needed in the gui control) * @return the current position. */ - etk::Vector3D GetPos(void); + vec3 GetPos(void); /** * @brief Set position for the next text writen * @param[in] pos Position of the text (in 3D) */ - void SetPos(etk::Vector3D pos); + void SetPos(vec3 pos); /** * @brief Set relative position for the next text writen * @param[in] pos ofset apply of the text (in 3D) */ - void SetRelPos(etk::Vector3D pos); + void SetRelPos(vec3 pos); /** * @brief Set the Color of the current foreground font * @param[in] color Color to set on foreground (for next print) @@ -117,13 +117,13 @@ namespace ewol * @param[in] pos Start position of the clipping * @param[in] width Width size of the clipping */ - void SetClippingWidth(etk::Vector3D pos, etk::Vector3D width); + void SetClippingWidth(vec3 pos, vec3 width); /** * @brief Request a clipping area for the text (next draw only) * @param[in] pos Start position of the clipping * @param[in] posEnd End position of the clipping */ - void SetClipping(etk::Vector3D pos, etk::Vector3D posEnd); + void SetClipping(vec3 pos, vec3 posEnd); /** * @brief Enable/Disable the clipping (without lose the current clipping position) * @brief newMode The new status of the clipping @@ -142,27 +142,27 @@ namespace ewol * @brief Draw a line to a specific position * @param[in] dest Position of the end of the line. */ - void LineTo(etk::Vector3D dest); + void LineTo(vec3 dest); /** * @brief Relative drawing a line (spacial vector) * @param[in] vect Vector of the curent line. */ - void LineRel(etk::Vector3D vect); + void LineRel(vec3 vect); /** * @brief Draw a 2D rectangle to the position requested. * @param[in] dest Position the the end of the rectangle */ - void Rectangle(etk::Vector3D dest); + void Rectangle(vec3 dest); /** * @brief Draw a 2D rectangle to the requested size. * @param[in] width size of the rectangle */ - void RectangleWidth(etk::Vector3D size); + void RectangleWidth(vec3 size); /** * @brief Draw a 3D rectangle to the position requested. * @param[in] dest Position the the end of the rectangle */ - void Cube(etk::Vector3D dest); + void Cube(vec3 dest); /** * @brief Draw a 2D circle with the specify rafdius parameter. * @param[in] radius Distence to the dorder diff --git a/sources/ewol/compositing/Image.cpp b/sources/ewol/compositing/Image.cpp index f237132e..ab60f69b 100644 --- a/sources/ewol/compositing/Image.cpp +++ b/sources/ewol/compositing/Image.cpp @@ -73,7 +73,7 @@ void ewol::Image::Draw(void) return; } // set Matrix : translation/positionMatrix - etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix()*m_matrixApply; + mat4 tmpMatrix = ewol::openGL::GetMatrix()*m_matrixApply; m_GLprogram->Use(); m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat); // TextureID @@ -98,29 +98,29 @@ void ewol::Image::Clear(void) m_coordTex.Clear(); m_coordColor.Clear(); // Reset temporal variables : - m_position = etk::Vector3D(0.0, 0.0, 0.0); - m_clippingPosStart = etk::Vector3D(0.0, 0.0, 0.0); - m_clippingPosStop = etk::Vector3D(0.0, 0.0, 0.0); + m_position = vec3(0.0, 0.0, 0.0); + m_clippingPosStart = vec3(0.0, 0.0, 0.0); + m_clippingPosStop = vec3(0.0, 0.0, 0.0); m_clippingEnable = false; m_color = draw::color::white; - m_axes = etk::Vector3D(0.0, 0.0, 0.0); + m_axes = vec3(0.0, 0.0, 0.0); m_angle = 0.0; } -etk::Vector3D ewol::Image::GetPos(void) +vec3 ewol::Image::GetPos(void) { return m_position; } -void ewol::Image::SetPos(etk::Vector3D pos) +void ewol::Image::SetPos(vec3 pos) { m_position = pos; } -void ewol::Image::SetRelPos(etk::Vector3D pos) +void ewol::Image::SetRelPos(vec3 pos) { m_position += pos; } @@ -132,12 +132,12 @@ void ewol::Image::SetColor(draw::Color color) } -void ewol::Image::SetClippingWidth(etk::Vector3D pos, etk::Vector3D width) +void ewol::Image::SetClippingWidth(vec3 pos, vec3 width) { SetClipping(pos, pos+width); } -void ewol::Image::SetClipping(etk::Vector3D pos, etk::Vector3D posEnd) +void ewol::Image::SetClipping(vec3 pos, vec3 posEnd) { // note the internal system all time request to have a bounding all time in the same order if (pos.x <= posEnd.x) { @@ -171,7 +171,7 @@ void ewol::Image::SetClippingMode(bool newMode) } -void ewol::Image::SetAngle(etk::Vector3D axes, float angle) +void ewol::Image::SetAngle(vec3 axes, float angle) { m_axes = axes; m_angle = angle; @@ -182,10 +182,10 @@ void ewol::Image::SetAngle(etk::Vector3D axes, float angle) } } -void ewol::Image::Print(etk::Vector2D size) +void ewol::Image::Print(ivec2 size) { - etk::Vector3D point; - etk::Vector2D tex; + vec3 point; + vec2 tex; point.z = 0; tex.x = 0; @@ -235,9 +235,9 @@ void ewol::Image::Print(etk::Vector2D size) m_coordColor.PushBack(m_color); } -void ewol::Image::PrintPart(etk::Vector2D size, - etk::Vector2D sourcePosStart, - etk::Vector2D sourcePosStop) +void ewol::Image::PrintPart(ivec2 size, + vec2 sourcePosStart, + vec2 sourcePosStop) { } @@ -250,7 +250,7 @@ void ewol::Image::SetSource(etk::UString newFile) ewol::resource::Release(m_resource); m_resource = NULL; } - etk::Vector2D size(32,32); + ivec2 size(32,32); // note that no image can be loaded... if (newFile != "") { // link to new One diff --git a/sources/ewol/compositing/Image.h b/sources/ewol/compositing/Image.h index 66fc8c40..cf1aabbc 100644 --- a/sources/ewol/compositing/Image.h +++ b/sources/ewol/compositing/Image.h @@ -19,13 +19,13 @@ namespace ewol { private: private: - etk::Vector3D m_position; //!< The current position to draw - etk::Vector3D m_clippingPosStart; //!< Clipping start position - etk::Vector3D m_clippingPosStop; //!< Clipping stop position + vec3 m_position; //!< The current position to draw + vec3 m_clippingPosStart; //!< Clipping start position + vec3 m_clippingPosStop; //!< Clipping stop position bool m_clippingEnable; //!< true if the clipping must be activated private: draw::Color m_color; //!< The text foreground color - etk::Vector3D m_axes; //!< Rotation axes (instant) + vec3 m_axes; //!< Rotation axes (instant) float m_angle; //!< Angle to set at the axes private: ewol::Program* m_GLprogram; //!< pointer on the opengl display program @@ -36,8 +36,8 @@ namespace ewol int32_t m_GLtexID; //!< openGL id on the element (texture ID) private: ewol::TextureFile* m_resource; //!< texture resources - etk::Vector > m_coord; //!< internal coord of the object - etk::Vector > m_coordTex; //!< internal texture coordinate for every point + etk::Vector m_coord; //!< internal coord of the object + etk::Vector m_coordTex; //!< internal texture coordinate for every point etk::Vector m_coordColor; //!< internal color of the different point private: /** @@ -67,17 +67,17 @@ namespace ewol * @brief Get the current display position (sometime needed in the gui control) * @return the current position. */ - etk::Vector3D GetPos(void); + vec3 GetPos(void); /** * @brief Set position for the next text writen * @param[in] pos Position of the text (in 3D) */ - void SetPos(etk::Vector3D pos); + void SetPos(vec3 pos); /** * @brief Set relative position for the next text writen * @param[in] pos ofset apply of the text (in 3D) */ - void SetRelPos(etk::Vector3D pos); + void SetRelPos(vec3 pos); /** * @brief Set the Color of the current foreground font * @param[in] color Color to set on foreground (for next print) @@ -88,13 +88,13 @@ namespace ewol * @param[in] pos Start position of the clipping * @param[in] width Width size of the clipping */ - void SetClippingWidth(etk::Vector3D pos, etk::Vector3D width); + void SetClippingWidth(vec3 pos, vec3 width); /** * @brief Request a clipping area for the text (next draw only) * @param[in] pos Start position of the clipping * @param[in] posEnd End position of the clipping */ - void SetClipping(etk::Vector3D pos, etk::Vector3D posEnd); + void SetClipping(vec3 pos, vec3 posEnd); /** * @brief Enable/Disable the clipping (without lose the current clipping position) * @brief newMode The new status of the clipping @@ -105,21 +105,21 @@ namespace ewol * @param[in] axes Rotation axes selection * @param[in] angle Angle to set on this axes */ - void SetAngle(etk::Vector3D axes, float angle); + void SetAngle(vec3 axes, float angle); /** * @brief Add a compleate of the image to display with the requested size * @param[in] size Size of the output image */ - void Print(etk::Vector2D size); + void Print(ivec2 size); /** * @brief Add a part of the image to display with the requested size * @param[in] size Size of the output image * @param[in] sourcePosStart Start position in the image [0..1] (can be bigger but this repeate the image). * @param[in] sourcePosStop Stop position in the image [0..1] (can be bigger but this repeate the image). */ - void PrintPart(etk::Vector2D size, - etk::Vector2D sourcePosStart, - etk::Vector2D sourcePosStop); + void PrintPart(ivec2 size, + vec2 sourcePosStart, + vec2 sourcePosStop); /** * @brief Change the image Source ==> can not be done to display 2 images at the same time ... * @param[in] newFile New file of the Image diff --git a/sources/ewol/compositing/Shaper.cpp b/sources/ewol/compositing/Shaper.cpp index fb47429c..87ef8cc9 100644 --- a/sources/ewol/compositing/Shaper.cpp +++ b/sources/ewol/compositing/Shaper.cpp @@ -103,7 +103,7 @@ void ewol::Shaper::LoadProgram(void) etk::UString basicImageFile = m_config->GetString(m_confImageFile); if (basicImageFile != "") { tmpFilename = file.GetRelativeFolder() + basicImageFile; - etk::Vector2D size(64,64); + ivec2 size(64,64); if (true == ewol::resource::Keep(tmpFilename, m_resourceTexture, size) ) { // nothing else to do ... } @@ -125,7 +125,7 @@ void ewol::Shaper::Draw(void) //glScalef(m_scaling.x, m_scaling.y, 1.0); m_GLprogram->Use(); // set Matrix : translation/positionMatrix - etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix(); + mat4 tmpMatrix = ewol::openGL::GetMatrix(); m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat); // position : m_GLprogram->SendAttribute(m_GLPosition, 2/*x,y*/, m_coord); @@ -220,7 +220,7 @@ void ewol::Shaper::UpdateVectex(void) m_coord[5].y= m_propertyOrigin.y+m_propertySize.y; } -void ewol::Shaper::SetOrigin(etk::Vector2D newOri) +void ewol::Shaper::SetOrigin(vec2 newOri) { if (m_propertyOrigin != newOri) { m_propertyOrigin = newOri; @@ -229,7 +229,7 @@ void ewol::Shaper::SetOrigin(etk::Vector2D newOri) } -void ewol::Shaper::SetSize(etk::Vector2D newSize) +void ewol::Shaper::SetSize(vec2 newSize) { if (m_propertySize != newSize) { m_propertySize = newSize; @@ -237,20 +237,20 @@ void ewol::Shaper::SetSize(etk::Vector2D newSize) } } -void ewol::Shaper::SetInsideSize(etk::Vector2D newInsideSize) +void ewol::Shaper::SetInsideSize(vec2 newInsideSize) { m_propertyInsideSize = newInsideSize; } -void ewol::Shaper::SetInsidePos(etk::Vector2D newInsidePos) +void ewol::Shaper::SetInsidePos(vec2 newInsidePos) { m_propertyInsidePosition = newInsidePos; } -etk::Vector2D ewol::Shaper::GetPadding(void) +vec2 ewol::Shaper::GetPadding(void) { - etk::Vector2D padding; + vec2 padding; if (m_config!=NULL) { padding.x = m_config->GetFloat(m_confIdPaddingX); padding.y = m_config->GetFloat(m_confIdPaddingY); diff --git a/sources/ewol/compositing/Shaper.h b/sources/ewol/compositing/Shaper.h index 23c89ab0..fda3ce9a 100644 --- a/sources/ewol/compositing/Shaper.h +++ b/sources/ewol/compositing/Shaper.h @@ -48,14 +48,14 @@ namespace ewol // internal needed data : int32_t m_nextStatusRequested; //!< when status is changing, this represent the next step of it int64_t m_time; //!< The last time of the dispaly (-1 if nothing progressing) - etk::Vector2D m_propertyOrigin; //!< widget origin - etk::Vector2D m_propertySize; //!< widget size - etk::Vector2D m_propertyInsidePosition; //!< internal subwidget position - etk::Vector2D m_propertyInsideSize; //!< internal subwidget size + vec2 m_propertyOrigin; //!< widget origin + vec2 m_propertySize; //!< widget size + vec2 m_propertyInsidePosition; //!< internal subwidget position + vec2 m_propertyInsideSize; //!< internal subwidget size int32_t m_stateOld; //!< previous state int32_t m_stateNew; //!< destination state float m_stateTransition; //!< working state between 2 states - etk::Vector2D m_coord[6]; //!< the double triangle coordonates + vec2 m_coord[6]; //!< the double triangle coordonates private: /** * @brief Load the openGL program and get all the ID needed @@ -112,27 +112,27 @@ namespace ewol * @brief Set the widget origin (needed fot the display) * @param[in] newOri : the new widget origin */ - void SetOrigin(etk::Vector2D newOri); + void SetOrigin(vec2 newOri); /** * @brief Set the widget size (needed fot the display) * @param[in] newSize : the new widget size */ - void SetSize(etk::Vector2D newSize); + void SetSize(vec2 newSize); /** * @brief Set the internal widget size * @param[in] newInsidePos : the subelement size. */ - void SetInsideSize(etk::Vector2D newInsideSize); + void SetInsideSize(vec2 newInsideSize); /** * @brief Set the internal widget position * @param[in] newInsidePos : the subelement position */ - void SetInsidePos(etk::Vector2D newInsidePos); + void SetInsidePos(vec2 newInsidePos); /** * @brief Get the padding declared by the user in the config file * @return the padding property */ - etk::Vector2D GetPadding(void); + vec2 GetPadding(void); /** * @brief Change the image Source ==> can not be done to display 2 images at the same time ... * @param[in] newFile New file of the Image diff --git a/sources/ewol/compositing/Text.cpp b/sources/ewol/compositing/Text.cpp index b187a6ff..34cba683 100644 --- a/sources/ewol/compositing/Text.cpp +++ b/sources/ewol/compositing/Text.cpp @@ -117,7 +117,7 @@ void ewol::Text::Draw(void) return; } // set Matrix : translation/positionMatrix - etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix()*m_matrixApply; + mat4 tmpMatrix = ewol::openGL::GetMatrix()*m_matrixApply; m_GLprogram->Use(); m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat); // TextureID @@ -133,21 +133,21 @@ void ewol::Text::Draw(void) m_GLprogram->UnUse(); } -void ewol::Text::Translate(etk::Vector3D vect) +void ewol::Text::Translate(vec3 vect) { ewol::Compositing::Translate(vect); m_vectorialDraw.Translate(vect); } -void ewol::Text::Rotate(etk::Vector3D vect, float angle) +void ewol::Text::Rotate(vec3 vect, float angle) { ewol::Compositing::Rotate(vect, angle); m_vectorialDraw.Rotate(vect, angle); } -void ewol::Text::Scale(etk::Vector3D vect) +void ewol::Text::Scale(vec3 vect) { ewol::Compositing::Scale(vect); m_vectorialDraw.Scale(vect); @@ -170,9 +170,9 @@ void ewol::Text::Clear(void) void ewol::Text::Reset(void) { - m_position = etk::Vector3D(0.0, 0.0, 0.0); - m_clippingPosStart = etk::Vector3D(0.0, 0.0, 0.0); - m_clippingPosStop = etk::Vector3D(0.0, 0.0, 0.0); + m_position = vec3(0.0, 0.0, 0.0); + m_clippingPosStart = vec3(0.0, 0.0, 0.0); + m_clippingPosStop = vec3(0.0, 0.0, 0.0); m_sizeDisplayStart = m_position; m_sizeDisplayStop = m_position; m_nbCharDisplayed = 0; @@ -193,13 +193,13 @@ void ewol::Text::Reset(void) } -etk::Vector3D ewol::Text::GetPos(void) +vec3 ewol::Text::GetPos(void) { return m_position; } -void ewol::Text::SetPos(etk::Vector3D pos) +void ewol::Text::SetPos(vec3 pos) { // check min max for display area if (m_nbCharDisplayed != 0) { @@ -231,7 +231,7 @@ void ewol::Text::SetPos(etk::Vector3D pos) } -void ewol::Text::SetRelPos(etk::Vector3D pos) +void ewol::Text::SetRelPos(vec3 pos) { m_position += pos; m_previousCharcode = 0; @@ -252,12 +252,12 @@ void ewol::Text::SetColorBg(draw::Color color) } -void ewol::Text::SetClippingWidth(etk::Vector3D pos, etk::Vector3D width) +void ewol::Text::SetClippingWidth(vec3 pos, vec3 width) { SetClipping(pos, pos+width); } -void ewol::Text::SetClipping(etk::Vector3D pos, etk::Vector3D posEnd) +void ewol::Text::SetClipping(vec3 pos, vec3 posEnd) { // note the internal system all time request to have a bounding all time in the same order if (pos.x <= posEnd.x) { @@ -574,11 +574,11 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector pos = m_position; + vec3 pos = m_position; m_vectorialDraw.SetPos(pos); Print(text[iii]); float fontHeigh = m_font->GetHeight(m_mode); - m_vectorialDraw.RectangleWidth(etk::Vector3D(m_position.x-pos.x,fontHeigh,0.0f) ); + m_vectorialDraw.RectangleWidth(vec3(m_position.x-pos.x,fontHeigh,0.0f) ); m_nbCharDisplayed++; } else { Print(text[iii]); @@ -620,7 +620,7 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector(m_position.x + freeSpace, + SetPos(vec3(m_position.x + freeSpace, m_position.y, m_position.z) ); } @@ -628,7 +628,7 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector(m_position.x + freeSpace/2, + SetPos(vec3(m_position.x + freeSpace/2, m_position.y, m_position.z) ); } @@ -669,21 +669,21 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector(m_position.x + interpolation, + SetPos(vec3(m_position.x + interpolation, m_position.y, m_position.z) ); if( true == m_needDisplay && m_colorBg.a != 0) { - m_vectorialDraw.RectangleWidth(etk::Vector3D(interpolation,fontHeigh,0.0f) ); + m_vectorialDraw.RectangleWidth(vec3(interpolation,fontHeigh,0.0f) ); } } else { //EWOL_DEBUG(" generateString : \"" << (char)text[iii] << "\""); if( true == m_needDisplay && m_colorBg.a != 0) { - etk::Vector3D pos = m_position; + vec3 pos = m_position; m_vectorialDraw.SetPos(pos); Print(text[iii]); - m_vectorialDraw.RectangleWidth(etk::Vector3D(m_position.x-pos.x,fontHeigh,0.0f) ); + m_vectorialDraw.RectangleWidth(vec3(m_position.x-pos.x,fontHeigh,0.0f) ); m_nbCharDisplayed++; } else { Print(text[iii]); @@ -703,14 +703,14 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector(m_startTextpos, + SetPos(vec3(m_startTextpos, (float)(m_position.y - m_font->GetHeight(m_mode)), m_position.z) ); m_nbCharDisplayed++; } else if(text[stop] == (uniChar_t)'\n') { currentId = stop+1; // Reset position : - SetPos(etk::Vector3D(m_startTextpos, + SetPos(vec3(m_startTextpos, (float)(m_position.y - m_font->GetHeight(m_mode)), m_position.z) ); m_nbCharDisplayed++; @@ -821,7 +821,7 @@ void ewol::Text::Print(const uniChar_t charcode) * 3------2 */ if (m_needDisplay == true) { - etk::Vector2D bitmapDrawPos[4]; + ivec2 bitmapDrawPos[4]; bitmapDrawPos[0].x = (int32_t)dxA; bitmapDrawPos[1].x = (int32_t)dxB; bitmapDrawPos[2].x = (int32_t)dxB; @@ -837,7 +837,7 @@ void ewol::Text::Print(const uniChar_t charcode) * | | * 3------2 */ - etk::Vector2D texturePos[4]; + vec2 texturePos[4]; texturePos[0].x = tuA+m_mode; texturePos[1].x = tuB+m_mode; texturePos[2].x = tuB+m_mode; @@ -901,7 +901,7 @@ void ewol::Text::Print(const uniChar_t charcode) void ewol::Text::ForceLineReturn(void) { // Reset position : - SetPos(etk::Vector3D(m_startTextpos, m_position.y - m_font->GetHeight(m_mode), 0) ); + SetPos(vec3(m_startTextpos, m_position.y - m_font->GetHeight(m_mode), 0) ); } @@ -928,7 +928,7 @@ void ewol::Text::DisableAlignement(void) } -etk::Vector3D ewol::Text::CalculateSizeHTML(const etk::UString& text) +vec3 ewol::Text::CalculateSizeHTML(const etk::UString& text) { // remove intermediate result Reset(); @@ -936,7 +936,7 @@ etk::Vector3D ewol::Text::CalculateSizeHTML(const etk::UString& text) // disable display system m_needDisplay = false; - SetPos(etk::Vector3D(0,0,0) ); + SetPos(vec3(0,0,0) ); // same as print without the end display ... PrintHTML(text); // get the last elements @@ -948,29 +948,29 @@ etk::Vector3D ewol::Text::CalculateSizeHTML(const etk::UString& text) // set back the display system m_needDisplay = true; - return etk::Vector3D( m_sizeDisplayStop.x-m_sizeDisplayStart.x, + return vec3( m_sizeDisplayStop.x-m_sizeDisplayStart.x, m_sizeDisplayStop.y-m_sizeDisplayStart.y, m_sizeDisplayStop.z-m_sizeDisplayStart.z); } -etk::Vector3D ewol::Text::CalculateSizeDecorated(const etk::UString& text) +vec3 ewol::Text::CalculateSizeDecorated(const etk::UString& text) { etk::UString tmpData("\n"); tmpData+=text; tmpData+="\n\n"; - etk::Vector3D tmpVal = CalculateSizeHTML(tmpData); + vec3 tmpVal = CalculateSizeHTML(tmpData); return tmpVal; } -etk::Vector3D ewol::Text::CalculateSize(const etk::UString& text) +vec3 ewol::Text::CalculateSize(const etk::UString& text) { if (m_font == NULL) { EWOL_ERROR("Font Id is not corectly defined"); - return etk::Vector3D(0,0,0); + return vec3(0,0,0); } - etk::Vector3D outputSize(0, 0, 0); + vec3 outputSize(0, 0, 0); for(int32_t iii=0; iii tmpp = CalculateSize(text[iii]); + vec3 tmpp = CalculateSize(text[iii]); if (outputSize.y == 0) { outputSize.y += tmpp.y; } @@ -979,11 +979,11 @@ etk::Vector3D ewol::Text::CalculateSize(const etk::UString& text) return outputSize; } -etk::Vector3D ewol::Text::CalculateSize(const uniChar_t charcode) +vec3 ewol::Text::CalculateSize(const uniChar_t charcode) { if (m_font == NULL) { EWOL_ERROR("Font Id is not corectly defined"); - return etk::Vector3D(0,0,0); + return vec3(0,0,0); } // get a pointer on the glyph property : ewol::GlyphProperty * myGlyph = m_font->GetGlyphPointer(charcode, m_mode); @@ -995,7 +995,7 @@ etk::Vector3D ewol::Text::CalculateSize(const uniChar_t charcode) kerningOffset = myGlyph->KerningGet(m_previousCharcode); } - etk::Vector3D outputSize((float)(myGlyph->m_advance.x + kerningOffset), + vec3 outputSize((float)(myGlyph->m_advance.x + kerningOffset), (float)(fontHeigh), (float)(0.0)); // Register the previous character @@ -1008,10 +1008,10 @@ void ewol::Text::PrintCursor(bool isInsertMode) { int32_t fontHeigh = m_font->GetHeight(m_mode); if (true == isInsertMode) { - m_vectorialDraw.RectangleWidth(etk::Vector3D(20, fontHeigh, 0) ); + m_vectorialDraw.RectangleWidth(vec3(20, fontHeigh, 0) ); } else { m_vectorialDraw.SetThickness(2); - m_vectorialDraw.LineRel( etk::Vector3D(0, fontHeigh, 0) ); + m_vectorialDraw.LineRel( vec3(0, fontHeigh, 0) ); m_vectorialDraw.SetThickness(0); } } @@ -1038,7 +1038,7 @@ bool ewol::Text::ExtrapolateLastId(const etk::UString& text, const int32_t start } for (int32_t iii=start; iii tmpSize = CalculateSize(text[iii]); + vec3 tmpSize = CalculateSize(text[iii]); // check oveflow : if (endPos + tmpSize.x > stopPosition) { stop = iii; diff --git a/sources/ewol/compositing/Text.h b/sources/ewol/compositing/Text.h index 29e27ac5..3b48b2e1 100644 --- a/sources/ewol/compositing/Text.h +++ b/sources/ewol/compositing/Text.h @@ -50,13 +50,13 @@ namespace ewol ewol::Drawing m_vectorialDraw; //!< This is used to draw background selection and other things ... private: int32_t m_nbCharDisplayed; //!< prevent some error in calculation size. - etk::Vector3D m_sizeDisplayStart; //!< The start windows of the display. - etk::Vector3D m_sizeDisplayStop; //!< The end windows of the display. + vec3 m_sizeDisplayStart; //!< The start windows of the display. + vec3 m_sizeDisplayStop; //!< The end windows of the display. bool m_needDisplay; //!< This just need the display and not the size rendering. - etk::Vector3D m_position; //!< The current position to draw - etk::Vector3D m_clippingPosStart; //!< Clipping start position - etk::Vector3D m_clippingPosStop; //!< Clipping stop position + vec3 m_position; //!< The current position to draw + vec3 m_clippingPosStart; //!< Clipping start position + vec3 m_clippingPosStop; //!< Clipping stop position bool m_clippingEnable; //!< true if the clipping must be activated private: draw::Color m_color; //!< The text foreground color @@ -85,8 +85,8 @@ namespace ewol private: ewol::TexturedFont* m_font; //!< Font resources private: // Text - etk::Vector > m_coord; //!< internal coord of the object - etk::Vector > m_coordTex; //!< internal texture coordinate for every point + etk::Vector m_coord; //!< internal coord of the object + etk::Vector m_coordTex; //!< internal texture coordinate for every point etk::Vector m_coordColor; //!< internal color of the different point private: /** @@ -110,11 +110,11 @@ namespace ewol ~Text(void); public: // Derived function - virtual void Translate(etk::Vector3D vect); + virtual void Translate(vec3 vect); // Derived function - virtual void Rotate(etk::Vector3D vect, float angle); + virtual void Rotate(vec3 vect, float angle); // Derived function - virtual void Scale(etk::Vector3D vect); + virtual void Scale(vec3 vect); public: /** * @brief Draw All the refistered text in the current element on openGL @@ -132,17 +132,17 @@ namespace ewol * @brief Get the current display position (sometime needed in the gui control) * @return the current position. */ - etk::Vector3D GetPos(void); + vec3 GetPos(void); /** * @brief Set position for the next text writen * @param[in] pos Position of the text (in 3D) */ - void SetPos(etk::Vector3D pos); + void SetPos(vec3 pos); /** * @brief Set relative position for the next text writen * @param[in] pos ofset apply of the text (in 3D) */ - void SetRelPos(etk::Vector3D pos); + void SetRelPos(vec3 pos); /** * @brief Set the Color of the current foreground font * @param[in] color Color to set on foreground (for next print) @@ -158,13 +158,13 @@ namespace ewol * @param[in] pos Start position of the clipping * @param[in] width Width size of the clipping */ - void SetClippingWidth(etk::Vector3D pos, etk::Vector3D width); + void SetClippingWidth(vec3 pos, vec3 width); /** * @brief Request a clipping area for the text (next draw only) * @param[in] pos Start position of the clipping * @param[in] posEnd End position of the clipping */ - void SetClipping(etk::Vector3D pos, etk::Vector3D posEnd); + void SetClipping(vec3 pos, vec3 posEnd); /** * @brief Enable/Disable the clipping (without lose the current clipping position) * @brief newMode The new status of the clipping @@ -327,25 +327,25 @@ namespace ewol * @param[in] text The string to calculate dimention. * @return The theoric size used. */ - etk::Vector3D CalculateSizeHTML(const etk::UString& text); + vec3 CalculateSizeHTML(const etk::UString& text); /** * @brief Calculate a theoric text size * @param[in] text The string to calculate dimention. * @return The theoric size used. */ - etk::Vector3D CalculateSizeDecorated(const etk::UString& text); + vec3 CalculateSizeDecorated(const etk::UString& text); /** * @brief Calculate a theoric text size * @param[in] text The string to calculate dimention. * @return The theoric size used. */ - etk::Vector3D CalculateSize(const etk::UString& text); + vec3 CalculateSize(const etk::UString& text); /** * @brief Calculate a theoric charcode size * @param[in] charcode The ľUnicode value to calculate dimention. * @return The theoric size used. */ - etk::Vector3D CalculateSize(const uniChar_t charcode); + vec3 CalculateSize(const uniChar_t charcode); /** * @brief Draw a cursor at the specify position * @param[in] isInsertMode True if the insert mode is activated diff --git a/sources/ewol/ewol.cpp b/sources/ewol/ewol.cpp index 2a8bb21e..40594a1c 100644 --- a/sources/ewol/ewol.cpp +++ b/sources/ewol/ewol.cpp @@ -81,12 +81,12 @@ void ewol::WindowsPopUpAdd(ewol::Widget * tmpWidget) } } -void ewol::ChangeSize(etk::Vector2D size) +void ewol::ChangeSize(ivec2 size) { guiInterface::ChangeSize(size); } -void ewol::ChangePos(etk::Vector2D pos) +void ewol::ChangePos(ivec2 pos) { guiInterface::ChangePos(pos); } diff --git a/sources/ewol/ewol.h b/sources/ewol/ewol.h index 66030e1a..c35d304c 100644 --- a/sources/ewol/ewol.h +++ b/sources/ewol/ewol.h @@ -47,13 +47,13 @@ namespace ewol * @note work only on computer * @param[in] size The new windows size */ - void ChangeSize(etk::Vector2D size); + void ChangeSize(ivec2 size); /** * @brief Change the windows curent position * @note work only on computer * @param[in] pos The new windows position */ - void ChangePos(etk::Vector2D pos); + void ChangePos(ivec2 pos); /** * @brief Generate the action of redrawing all the display. */ diff --git a/sources/ewol/game/GameElement.cpp b/sources/ewol/game/GameElement.cpp index 3e7852d4..ceb14b70 100644 --- a/sources/ewol/game/GameElement.cpp +++ b/sources/ewol/game/GameElement.cpp @@ -35,7 +35,7 @@ ewol::GameElement::GameElement(SceneElement & sceneElement, etk::UString& tmpNam -float quadDist(etk::Vector2D pos1, etk::Vector2D pos2) +float quadDist(vec2 pos1, vec2 pos2) { float tmpVal1 = pos1.x - pos2.x; float tmpVal2 = pos1.y - pos2.y; @@ -44,7 +44,7 @@ float quadDist(etk::Vector2D pos1, etk::Vector2D pos2) } -bool ewol::GameElement::HaveImpact(int32_t group, int32_t type, etk::Vector2D position, float size) +bool ewol::GameElement::HaveImpact(int32_t group, int32_t type, vec2 position, float size) { if (true != m_canHaveImpact) { return false; diff --git a/sources/ewol/game/GameElement.h b/sources/ewol/game/GameElement.h index e1e41c18..b681a766 100644 --- a/sources/ewol/game/GameElement.h +++ b/sources/ewol/game/GameElement.h @@ -33,7 +33,7 @@ namespace ewol { int32_t m_type; //!< float m_power; //!< Current power of the element bool m_visible; //!< This is to know if the element is displayed or not ==> TODO : check if usefull ... - etk::Vector2D m_position; //!< Current position of the element + vec2 m_position; //!< Current position of the element float m_speed; //!< Speed of the element (only one value, the angle is generated by the m_angle float m_angle; //!< Angle of the speed float m_mass; //!< Current element Mass ==> for the physical calculation @@ -67,8 +67,8 @@ namespace ewol { void SetVisible(bool state) { m_visible = state; StatusUpdate();}; bool IsEnable(void) { return m_enable; }; void SetEnable(bool state) { m_enable = state; StatusUpdate();}; - etk::Vector2D PositionGet(void) { return m_position; }; - void PositionSet(etk::Vector2D state) { m_position = state; StatusUpdate();}; + vec2 PositionGet(void) { return m_position; }; + void PositionSet(vec2 state) { m_position = state; StatusUpdate();}; void PositionSet(float xxx, float yyy) { m_position.x = xxx; m_position.y = yyy; StatusUpdate();}; float SpeedGet(void) { return m_speed; }; void SpeedSet(float state) { m_speed = state; StatusUpdate();}; @@ -129,8 +129,8 @@ namespace ewol { * @return --- */ virtual void RemoveElement(int32_t idOfElement) { }; - virtual bool HaveImpact(int32_t group, int32_t type, etk::Vector2D position, float size); - virtual bool Explosion(int32_t group, int32_t type, etk::Vector2D position, float pxAtenuation, float power) { return false; } ; + virtual bool HaveImpact(int32_t group, int32_t type, vec2 position, float size); + virtual bool Explosion(int32_t group, int32_t type, vec2 position, float pxAtenuation, float power) { return false; } ; virtual etk::UString Message(etk::UString control, etk::UString message) { return ""; } ; virtual void StatusUpdate(void) { }; @@ -140,6 +140,6 @@ namespace ewol { #include -float quadDist(etk::Vector2D pos1, etk::Vector2D pos2); +float quadDist(vec2 pos1, vec2 pos2); #endif diff --git a/sources/ewol/game/SceneElement.cpp b/sources/ewol/game/SceneElement.cpp index df348baa..8749bce7 100644 --- a/sources/ewol/game/SceneElement.cpp +++ b/sources/ewol/game/SceneElement.cpp @@ -226,7 +226,7 @@ ewol::GameElement* ewol::SceneElement::GetElement(uint32_t idElement) } -uint32_t ewol::SceneElement::GetNearestEnemy(etk::Vector2D position, int32_t groupId, float maxRange) +uint32_t ewol::SceneElement::GetNearestEnemy(vec2 position, int32_t groupId, float maxRange) { uint32_t result = 0; float lastQuadDistance = 9999999999999999.0; @@ -245,7 +245,7 @@ uint32_t ewol::SceneElement::GetNearestEnemy(etk::Vector2D position, int3 if (NULL != listAnimatedElements[gId][iii]) { if( true == listAnimatedElements[gId][iii]->IsEnable() && true == listAnimatedElements[gId][iii]->CanBeCibledGet()) { - etk::Vector2D tmpPos = listAnimatedElements[gId][iii]->PositionGet(); + vec2 tmpPos = listAnimatedElements[gId][iii]->PositionGet(); float distance = quadDist(position, tmpPos); if( distance <= lastQuadDistance && maxRange >= distance ) { @@ -260,7 +260,7 @@ uint32_t ewol::SceneElement::GetNearestEnemy(etk::Vector2D position, int3 return result; } -void ewol::SceneElement::GetNearestEnemy(etk::Vector2D position, int32_t groupId, float maxRange, etk::Vector& list) +void ewol::SceneElement::GetNearestEnemy(vec2 position, int32_t groupId, float maxRange, etk::Vector& list) { // remove all elements.. list.Clear(); @@ -279,7 +279,7 @@ void ewol::SceneElement::GetNearestEnemy(etk::Vector2D position, int32_t if (NULL != listAnimatedElements[gId][iii]) { if( true == listAnimatedElements[gId][iii]->IsEnable() && true == listAnimatedElements[gId][iii]->CanBeCibledGet()) { - etk::Vector2D tmpPos = listAnimatedElements[gId][iii]->PositionGet(); + vec2 tmpPos = listAnimatedElements[gId][iii]->PositionGet(); float distance = quadDist(position, tmpPos); if(maxRange >= distance) { uint32_t tmpp = createUniqueId(listAnimatedElements[gId][iii]->GetUniqueId(), iii); @@ -292,7 +292,7 @@ void ewol::SceneElement::GetNearestEnemy(etk::Vector2D position, int32_t } } -uint32_t ewol::SceneElement::GetNearestFriend(etk::Vector2D position, int32_t groupId, uint32_t us) +uint32_t ewol::SceneElement::GetNearestFriend(vec2 position, int32_t groupId, uint32_t us) { uint32_t result = 0; float lastQuadDistance = 9999999999999999.0; @@ -305,7 +305,7 @@ uint32_t ewol::SceneElement::GetNearestFriend(etk::Vector2D position, int if (NULL != listAnimatedElements[gId][iii]) { if( true == listAnimatedElements[gId][iii]->IsEnable() && true == listAnimatedElements[gId][iii]->CanBeCibledGet()) { - etk::Vector2D tmpPos = listAnimatedElements[gId][iii]->PositionGet(); + vec2 tmpPos = listAnimatedElements[gId][iii]->PositionGet(); float distance = quadDist(position, tmpPos); if( distance <= lastQuadDistance && us != listAnimatedElements[gId][iii]->GetUniqueId() ) { @@ -319,7 +319,7 @@ uint32_t ewol::SceneElement::GetNearestFriend(etk::Vector2D position, int } -void ewol::SceneElement::GetNearestFriend(etk::Vector2D position, int32_t groupId, float maxRange, etk::Vector& list, uint32_t us) +void ewol::SceneElement::GetNearestFriend(vec2 position, int32_t groupId, float maxRange, etk::Vector& list, uint32_t us) { // remove all elements.. list.Clear(); @@ -332,7 +332,7 @@ void ewol::SceneElement::GetNearestFriend(etk::Vector2D position, int32_t if (NULL != listAnimatedElements[groupId][iii]) { if( true == listAnimatedElements[groupId][iii]->IsEnable() && true == listAnimatedElements[groupId][iii]->CanBeCibledGet()) { - etk::Vector2D tmpPos = listAnimatedElements[groupId][iii]->PositionGet(); + vec2 tmpPos = listAnimatedElements[groupId][iii]->PositionGet(); float distance = quadDist(position, tmpPos); if( maxRange >= distance && us != listAnimatedElements[groupId][iii]->GetUniqueId() ) { @@ -344,7 +344,7 @@ void ewol::SceneElement::GetNearestFriend(etk::Vector2D position, int32_t } } -bool ewol::SceneElement::HaveImpact(int32_t group, int32_t type, etk::Vector2D position, float size) +bool ewol::SceneElement::HaveImpact(int32_t group, int32_t type, vec2 position, float size) { for (int32_t jjj=0; jjj position, float pxAtenuation, float power) +void ewol::SceneElement::Explosion(int32_t group, int32_t type, vec2 position, float pxAtenuation, float power) { for (int32_t jjj=0; jjj position, int32_t maxDistanceDetection) +uint32_t ewol::SceneElement::GetElementAtPos(vec2 position, int32_t maxDistanceDetection) { uint32_t result = 0; float lastQuadDistance = 9999999999999999.0; @@ -384,7 +384,7 @@ uint32_t ewol::SceneElement::GetElementAtPos(etk::Vector2D position, int3 for (int32_t iii=0; iiiIsEnable()) { - etk::Vector2D tmpPos = listAnimatedElements[jjj][iii]->PositionGet(); + vec2 tmpPos = listAnimatedElements[jjj][iii]->PositionGet(); float distance = quadDist(position, tmpPos); if (distance <= lastQuadDistance) { lastQuadDistance = distance; @@ -400,7 +400,7 @@ uint32_t ewol::SceneElement::GetElementAtPos(etk::Vector2D position, int3 return result; } -void ewol::SceneElement::SetEventInput(uint32_t id, etk::Vector2D position) +void ewol::SceneElement::SetEventInput(uint32_t id, vec2 position) { EWOL_TODO("but when ..."); } diff --git a/sources/ewol/game/SceneElement.h b/sources/ewol/game/SceneElement.h index 493cb6a1..ef1a7f53 100644 --- a/sources/ewol/game/SceneElement.h +++ b/sources/ewol/game/SceneElement.h @@ -51,14 +51,14 @@ namespace ewol { uint32_t AddElement(int32_t group, ewol::GameElement* newElement); uint32_t AddElementNamed(int32_t group, etk::UString &elementName); ewol::GameElement* GetElement(uint32_t idElement); - uint32_t GetNearestEnemy(etk::Vector2D position, int32_t groupId, float maxRange=9999999999999999.0); - void GetNearestEnemy(etk::Vector2D position, int32_t groupId, float maxRange, etk::Vector& list); - uint32_t GetNearestFriend(etk::Vector2D position, int32_t groupId, uint32_t us); - void GetNearestFriend(etk::Vector2D position, int32_t groupId, float maxRange, etk::Vector& list, uint32_t us); - bool HaveImpact(int32_t group, int32_t type, etk::Vector2D position, float size); - void Explosion(int32_t group, int32_t type, etk::Vector2D position, float pxAtenuation, float power); - uint32_t GetElementAtPos(etk::Vector2D position, int32_t maxDistanceDetection); - void SetEventInput(uint32_t id, etk::Vector2D position); + uint32_t GetNearestEnemy(vec2 position, int32_t groupId, float maxRange=9999999999999999.0); + void GetNearestEnemy(vec2 position, int32_t groupId, float maxRange, etk::Vector& list); + uint32_t GetNearestFriend(vec2 position, int32_t groupId, uint32_t us); + void GetNearestFriend(vec2 position, int32_t groupId, float maxRange, etk::Vector& list, uint32_t us); + bool HaveImpact(int32_t group, int32_t type, vec2 position, float size); + void Explosion(int32_t group, int32_t type, vec2 position, float pxAtenuation, float power); + uint32_t GetElementAtPos(vec2 position, int32_t maxDistanceDetection); + void SetEventInput(uint32_t id, vec2 position); void SetEventExternButton(uint32_t id, int32_t btId, int32_t state); void SetEventExternJoystick(uint32_t id, int32_t joyId, float angle, float distance, int32_t state); /** diff --git a/sources/ewol/renderer/ResourceManager.cpp b/sources/ewol/renderer/ResourceManager.cpp index 60eed71b..49098bff 100644 --- a/sources/ewol/renderer/ResourceManager.cpp +++ b/sources/ewol/renderer/ResourceManager.cpp @@ -279,9 +279,9 @@ static int32_t nextP2(int32_t value) return val; } -bool ewol::resource::Keep(etk::UString& filename, ewol::TextureFile*& object, etk::Vector2D size) +bool ewol::resource::Keep(etk::UString& filename, ewol::TextureFile*& object, ivec2 size) { - etk::Vector2D size2(nextP2(size.x), nextP2(size.y)); + ivec2 size2(nextP2(size.x), nextP2(size.y)); etk::UString TmpFilename = filename; TmpFilename += ":"; TmpFilename += size2.x; diff --git a/sources/ewol/renderer/ResourceManager.h b/sources/ewol/renderer/ResourceManager.h index 2f7c2d9e..71750a6e 100644 --- a/sources/ewol/renderer/ResourceManager.h +++ b/sources/ewol/renderer/ResourceManager.h @@ -42,7 +42,7 @@ namespace ewol bool Keep(etk::UString& filename, ewol::Program*& object); bool Keep(etk::UString& filename, ewol::Shader*& object); bool Keep(ewol::Texture*& object); // no name needed here ... - bool Keep(etk::UString& filename, ewol::TextureFile*& object, etk::Vector2D size); + bool Keep(etk::UString& filename, ewol::TextureFile*& object, ivec2 size); bool Keep(etk::UString& accesMode, ewol::VirtualBufferObject*& object); bool Keep(etk::UString& filename, ewol::MeshObj*& object); bool Keep(etk::UString& filename, ewol::ConfigFile*& object); diff --git a/sources/ewol/renderer/openGL.cpp b/sources/ewol/renderer/openGL.cpp index c04f5eb6..8826915a 100644 --- a/sources/ewol/renderer/openGL.cpp +++ b/sources/ewol/renderer/openGL.cpp @@ -10,13 +10,13 @@ #include #include -etk::Vector l_matrixList; +etk::Vector l_matrixList; void ewol::openGL::Init(void) { // remove deprecated pb ... l_matrixList.Clear(); - etk::Matrix4 tmpMat; + mat4 tmpMat; l_matrixList.PushBack(tmpMat); } @@ -26,7 +26,7 @@ void ewol::openGL::UnInit(void) l_matrixList.Clear(); } -void ewol::openGL::SetBasicMatrix(etk::Matrix4& newOne) +void ewol::openGL::SetBasicMatrix(mat4& newOne) { if (l_matrixList.Size()!=1) { EWOL_ERROR("matrix is not corect size in the stack : " << l_matrixList.Size()); @@ -35,7 +35,7 @@ void ewol::openGL::SetBasicMatrix(etk::Matrix4& newOne) l_matrixList.PushBack(newOne); } -void ewol::openGL::SetMatrix(etk::Matrix4& newOne) +void ewol::openGL::SetMatrix(mat4& newOne) { if (l_matrixList.Size()==0) { EWOL_ERROR("set matrix list is not corect size in the stack : " << l_matrixList.Size()); @@ -49,11 +49,11 @@ void ewol::openGL::Push(void) { if (l_matrixList.Size()==0) { EWOL_ERROR("set matrix list is not corect size in the stack : " << l_matrixList.Size()); - etk::Matrix4 tmp; + mat4 tmp; l_matrixList.PushBack(tmp); return; } - etk::Matrix4 tmp = l_matrixList[l_matrixList.Size()-1]; + mat4 tmp = l_matrixList[l_matrixList.Size()-1]; l_matrixList.PushBack(tmp); } @@ -62,18 +62,18 @@ void ewol::openGL::Pop(void) if (l_matrixList.Size()<=1) { EWOL_ERROR("set matrix list is not corect size in the stack : " << l_matrixList.Size()); l_matrixList.Clear(); - etk::Matrix4 tmp; + mat4 tmp; l_matrixList.PushBack(tmp); return; } l_matrixList.PopBack(); } -etk::Matrix4& ewol::openGL::GetMatrix(void) +mat4& ewol::openGL::GetMatrix(void) { if (l_matrixList.Size()==0) { EWOL_ERROR("set matrix list is not corect size in the stack : " << l_matrixList.Size()); - etk::Matrix4 tmp; + mat4 tmp; l_matrixList.PushBack(tmp); } return l_matrixList[l_matrixList.Size()-1]; diff --git a/sources/ewol/renderer/openGL.h b/sources/ewol/renderer/openGL.h index 9ffe51a0..960da845 100644 --- a/sources/ewol/renderer/openGL.h +++ b/sources/ewol/renderer/openGL.h @@ -62,13 +62,13 @@ namespace ewol { * @brief When you will done an opengl rendering, you might call this reset matrix first. It remove all the stach of the matrix pushed. * @param[in] newOne the default matrix that might be set for the graphic card for renderer. if too more pop will be done, this is the last that mmight survived */ - void SetBasicMatrix(etk::Matrix4& newOne); + void SetBasicMatrix(mat4& newOne); /** * @brief this funtion configure the current use matrix for the renderer (call @ref Push before, and @ref Pop when no more needed). * @param[in] newOne The new current matrix use for the render. * @note We did not use opengl standard system, due to the fact that is not supported in opengl ES-2 */ - void SetMatrix(etk::Matrix4& newOne); + void SetMatrix(mat4& newOne); /** * @brief Store current matrix in the matrix stack. */ @@ -81,7 +81,7 @@ namespace ewol { * @brief Get a reference on the current matrix destinate to opengl renderer. * @return The requested matrix. */ - etk::Matrix4& GetMatrix(void); + mat4& GetMatrix(void); }; }; diff --git a/sources/ewol/renderer/os/eSystem.cpp b/sources/ewol/renderer/os/eSystem.cpp index 8d325549..9f5df0f4 100644 --- a/sources/ewol/renderer/os/eSystem.cpp +++ b/sources/ewol/renderer/os/eSystem.cpp @@ -29,7 +29,7 @@ static ewol::Windows* windowsCurrent = NULL; -static etk::Vector2D windowsSize(320, 480); +static ivec2 windowsSize(320, 480); static ewol::eSystemInput l_managementInput; @@ -70,7 +70,7 @@ class eSystemMessage { ewol::keyEvent::type_te inputType; int32_t inputId; // generic dimentions - etk::Vector2D dimention; + vec2 dimention; // keyboard events : bool stateIsDown; uniChar_t keyboardChar; @@ -523,7 +523,7 @@ ewol::Windows* eSystem::GetCurrentWindows(void) } -etk::Vector2D eSystem::GetSize(void) +ivec2 eSystem::GetSize(void) { return windowsSize; } @@ -533,7 +533,7 @@ void eSystem::ForceRedrawAll(void) { ewol::Windows* tmpWindows = eSystem::GetCurrentWindows(); if (NULL != tmpWindows) { - etk::Vector2D tmpSize = eSystem::GetSize(); + ivec2 tmpSize = eSystem::GetSize(); tmpWindows->CalculateSize(tmpSize.x, tmpSize.y); } } diff --git a/sources/ewol/renderer/os/eSystem.h b/sources/ewol/renderer/os/eSystem.h index 2567f7e7..be5e1f30 100644 --- a/sources/ewol/renderer/os/eSystem.h +++ b/sources/ewol/renderer/os/eSystem.h @@ -94,7 +94,7 @@ namespace eSystem * @param --- * @return the current size ... */ - etk::Vector2D GetSize(void); + ivec2 GetSize(void); /** * @brief Redraw all the windows diff --git a/sources/ewol/renderer/os/eSystemInput.cpp b/sources/ewol/renderer/os/eSystemInput.cpp index 74789e14..5ad19257 100644 --- a/sources/ewol/renderer/os/eSystemInput.cpp +++ b/sources/ewol/renderer/os/eSystemInput.cpp @@ -69,7 +69,7 @@ bool ewol::eSystemInput::localEventInput(ewol::keyEvent::type_te type, ewol::Widget* destWidget, int32_t IdInput, ewol::keyEvent::status_te typeEvent, - etk::Vector2D pos) + vec2 pos) { if (NULL != destWidget) { if (type == ewol::keyEvent::typeMouse || type == ewol::keyEvent::typeFinger) { @@ -178,7 +178,7 @@ int32_t ewol::eSystemInput::localGetDestinationId(ewol::keyEvent::type_te type, } // note if id<0 ==> the it was finger event ... -void ewol::eSystemInput::Motion(ewol::keyEvent::type_te type, int pointerID, etk::Vector2D pos) +void ewol::eSystemInput::Motion(ewol::keyEvent::type_te type, int pointerID, vec2 pos) { // convert position in Open-GL coordonates ... pos.y = pos.y; @@ -269,7 +269,7 @@ void ewol::eSystemInput::Motion(ewol::keyEvent::type_te type, int pointerID, etk } } -void ewol::eSystemInput::State(ewol::keyEvent::type_te type, int pointerID, bool isDown, etk::Vector2D pos) +void ewol::eSystemInput::State(ewol::keyEvent::type_te type, int pointerID, bool isDown, vec2 pos) { // convert position in Open-GL coordonates ... InputPoperty_ts *eventTable = NULL; diff --git a/sources/ewol/renderer/os/eSystemInput.h b/sources/ewol/renderer/os/eSystemInput.h index 1757e438..ddd95b04 100644 --- a/sources/ewol/renderer/os/eSystemInput.h +++ b/sources/ewol/renderer/os/eSystemInput.h @@ -20,10 +20,10 @@ namespace ewol int32_t destinationInputId; int64_t lastTimeEvent; ewol::Widget* curentWidgetEvent; - etk::Vector2D origin; - etk::Vector2D size; - etk::Vector2D downStart; - etk::Vector2D posEvent; + vec2 origin; + vec2 size; + vec2 downStart; + vec2 posEvent; bool isDown; bool isInside; int32_t nbClickEvent; // 0 .. 1 .. 2 .. 3 @@ -58,7 +58,7 @@ namespace ewol ewol::Widget* destWidget, int32_t IdInput, ewol::keyEvent::status_te typeEvent, - etk::Vector2D pos); + vec2 pos); /** * @brief Convert the system event id in the correct EWOL id depending of the system management mode * This function find the next input id unused on the specifiic widget @@ -77,8 +77,8 @@ namespace ewol void SetDpi(int32_t newDPI); // note if id<0 ==> the it was finger event ... - void Motion(ewol::keyEvent::type_te type, int pointerID, etk::Vector2D pos ); - void State(ewol::keyEvent::type_te type, int pointerID, bool isDown, etk::Vector2D pos); + void Motion(ewol::keyEvent::type_te type, int pointerID, vec2 pos ); + void State(ewol::keyEvent::type_te type, int pointerID, bool isDown, vec2 pos); /** * @brief Inform object that an other object is removed ... diff --git a/sources/ewol/renderer/os/gui.Android.base.cpp b/sources/ewol/renderer/os/gui.Android.base.cpp index 5eb819d7..70181d74 100644 --- a/sources/ewol/renderer/os/gui.Android.base.cpp +++ b/sources/ewol/renderer/os/gui.Android.base.cpp @@ -583,17 +583,17 @@ void guiInterface::KeyboardHide(void) SendJava_KeyboardShow(false); } -void guiInterface::ChangeSize(etk::Vector2D size) +void guiInterface::ChangeSize(ivec2 size) { // The size can not be change on android platform } -void guiInterface::ChangePos(etk::Vector2D size) +void guiInterface::ChangePos(ivec2 size) { // The position can not be change on Android platform } -void guiInterface::GetAbsPos(etk::Vector2D& size) +void guiInterface::GetAbsPos(ivec2& size) { size.x = 0; size.y = 0; diff --git a/sources/ewol/renderer/os/gui.Windows.cpp b/sources/ewol/renderer/os/gui.Windows.cpp index 920b6507..5833123c 100644 --- a/sources/ewol/renderer/os/gui.Windows.cpp +++ b/sources/ewol/renderer/os/gui.Windows.cpp @@ -70,7 +70,7 @@ void guiInterface::KeyboardHide(void) -void guiInterface::ChangeSize(etk::Vector2D size) +void guiInterface::ChangeSize(ivec2 size) { int border_thickness = GetSystemMetrics(SM_CXSIZEFRAME); int title_size = GetSystemMetrics(SM_CYCAPTION); @@ -80,12 +80,12 @@ void guiInterface::ChangeSize(etk::Vector2D size) // TODO : Later } -void guiInterface::ChangePos(etk::Vector2D pos) +void guiInterface::ChangePos(ivec2 pos) { // TODO : Later } -void guiInterface::GetAbsPos(etk::Vector2D& size) +void guiInterface::GetAbsPos(ivec2& size) { // TODO : Later size.x = 0; @@ -273,7 +273,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { bool buttonIsDown = true; int32_t mouseButtonId = 0; - etk::Vector2D pos; + ivec2 pos; // to know all message : http://wiki.winehq.org/List_Of_Windows_Messages switch (message) { diff --git a/sources/ewol/renderer/os/gui.X11.cpp b/sources/ewol/renderer/os/gui.X11.cpp index 58e426e2..960e904e 100644 --- a/sources/ewol/renderer/os/gui.X11.cpp +++ b/sources/ewol/renderer/os/gui.X11.cpp @@ -242,7 +242,7 @@ bool CreateX11Context(void) XSetWMProtocols(m_display, WindowHandle, &m_delAtom, 1); } - etk::Vector2D tmpSize(400, 300); + ivec2 tmpSize(400, 300); guiInterface::ChangeSize(tmpSize); return true; @@ -1042,7 +1042,7 @@ void guiInterface::KeyboardHide(void) } -void guiInterface::ChangeSize(etk::Vector2D size) +void guiInterface::ChangeSize(ivec2 size) { #ifdef DEBUG_X11_EVENT EWOL_INFO("X11: ChangeSize"); @@ -1052,7 +1052,7 @@ void guiInterface::ChangeSize(etk::Vector2D size) } -void guiInterface::ChangePos(etk::Vector2D pos) +void guiInterface::ChangePos(ivec2 pos) { #ifdef DEBUG_X11_EVENT EWOL_INFO("X11: ChangePos"); @@ -1061,7 +1061,7 @@ void guiInterface::ChangePos(etk::Vector2D pos) } -void guiInterface::GetAbsPos(etk::Vector2D& pos) +void guiInterface::GetAbsPos(ivec2& pos) { #ifdef DEBUG_X11_EVENT EWOL_INFO("X11: GetAbsPos"); diff --git a/sources/ewol/renderer/os/gui.h b/sources/ewol/renderer/os/gui.h index c0420e04..c8c31bb8 100644 --- a/sources/ewol/renderer/os/gui.h +++ b/sources/ewol/renderer/os/gui.h @@ -37,19 +37,19 @@ namespace guiInterface * @param size The requested size * @return --- */ - void ChangeSize(etk::Vector2D size); + void ChangeSize(ivec2 size); /** * @brief Change the current Windows position * @param pos The position where the winsdows might be placed. * @return --- */ - void ChangePos(etk::Vector2D pos); + void ChangePos(ivec2 pos); /** * @brief Get the current Windows position * @param pos The position where the winsdows is. * @return --- */ - void GetAbsPos(etk::Vector2D& pos); + void GetAbsPos(ivec2& pos); /** * @brief Display the virtal keyboard (for touch system only) * @param --- diff --git a/sources/ewol/renderer/resources/FontFreeType.cpp b/sources/ewol/renderer/resources/FontFreeType.cpp index f1d503a4..e13ceecc 100644 --- a/sources/ewol/renderer/resources/FontFreeType.cpp +++ b/sources/ewol/renderer/resources/FontFreeType.cpp @@ -103,13 +103,13 @@ ewol::FontFreeType::~FontFreeType(void) } -etk::Vector2D ewol::FontFreeType::GetSize(int32_t fontSize, const etk::UString & unicodeString) +vec2 ewol::FontFreeType::GetSize(int32_t fontSize, const etk::UString & unicodeString) { if(false==m_init) { - return etk::Vector2D(0,0); + return vec2(0,0); } // TODO : ... - etk::Vector2D outputSize(0,0); + vec2 outputSize(0,0); return outputSize; } @@ -165,7 +165,7 @@ bool ewol::FontFreeType::GetGlyphProperty(int32_t fontSize, bool ewol::FontFreeType::DrawGlyph(draw::Image& imageOut, int32_t fontSize, - etk::Vector2D glyphPosition, + ivec2 glyphPosition, ewol::GlyphProperty& property, int8_t posInImage) { @@ -202,7 +202,7 @@ bool ewol::FontFreeType::DrawGlyph(draw::Image& imageOut, draw::Color tlpppp(0xFF,0xFF,0xFF,0x00); for(int32_t jjj=0; jjj < slot->bitmap.rows;jjj++) { for(int32_t iii=0; iii < slot->bitmap.width; iii++){ - tlpppp = imageOut.Get(etk::Vector2D(glyphPosition.x+iii, glyphPosition.y+jjj)); + tlpppp = imageOut.Get(ivec2(glyphPosition.x+iii, glyphPosition.y+jjj)); uint8_t valueColor = slot->bitmap.buffer[iii + slot->bitmap.width*jjj]; // set only alpha : switch(posInImage) @@ -222,7 +222,7 @@ bool ewol::FontFreeType::DrawGlyph(draw::Image& imageOut, break; } // real set of color - imageOut.Set(etk::Vector2D(glyphPosition.x+iii, glyphPosition.y+jjj), tlpppp ); + imageOut.Set(ivec2(glyphPosition.x+iii, glyphPosition.y+jjj), tlpppp ); } } return true; diff --git a/sources/ewol/renderer/resources/FontFreeType.h b/sources/ewol/renderer/resources/FontFreeType.h index bea3fb94..5a5d71d2 100644 --- a/sources/ewol/renderer/resources/FontFreeType.h +++ b/sources/ewol/renderer/resources/FontFreeType.h @@ -37,11 +37,11 @@ namespace ewol bool DrawGlyph(draw::Image& imageOut, int32_t fontSize, - etk::Vector2D glyphPosition, + ivec2 glyphPosition, ewol::GlyphProperty& property, int8_t posInImage); - etk::Vector2D GetSize(int32_t fontSize, const etk::UString & unicodeString); + vec2 GetSize(int32_t fontSize, const etk::UString & unicodeString); int32_t GetHeight(int32_t fontSize); diff --git a/sources/ewol/renderer/resources/Image.cpp b/sources/ewol/renderer/resources/Image.cpp index d6ac4668..0f04290f 100644 --- a/sources/ewol/renderer/resources/Image.cpp +++ b/sources/ewol/renderer/resources/Image.cpp @@ -21,7 +21,7 @@ #include -ewol::TextureFile::TextureFile(etk::UString genName, etk::UString tmpfileName, etk::Vector2D size) : +ewol::TextureFile::TextureFile(etk::UString genName, etk::UString tmpfileName, ivec2 size) : Texture(genName) { etk::UString tmpName = tmpfileName; diff --git a/sources/ewol/renderer/resources/Image.h b/sources/ewol/renderer/resources/Image.h index d609d7dc..79dc19ec 100644 --- a/sources/ewol/renderer/resources/Image.h +++ b/sources/ewol/renderer/resources/Image.h @@ -20,7 +20,7 @@ namespace ewol class TextureFile : public ewol::Texture { public: - TextureFile(etk::UString genName, etk::UString fileName, etk::Vector2D size); + TextureFile(etk::UString genName, etk::UString fileName, ivec2 size); ~TextureFile(void) { }; virtual const char* GetType(void) { return "ewol::TextureFile"; }; }; diff --git a/sources/ewol/renderer/resources/Mesh.cpp b/sources/ewol/renderer/resources/Mesh.cpp index 557020c6..22420018 100644 --- a/sources/ewol/renderer/resources/Mesh.cpp +++ b/sources/ewol/renderer/resources/Mesh.cpp @@ -60,12 +60,12 @@ void ewol::Mesh::Draw(void) //EWOL_DEBUG(" Display " << m_coord.Size() << " elements" ); m_GLprogram->Use(); // set Matrix : translation/positionMatrix - etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix(); - tmpMatrix = etk::Matrix4::Scale(etk::Vector3D(100,100,100) ) - * etk::Matrix4::Rotate(etk::Vector3D(1,0,0), rotx) - * etk::Matrix4::Rotate(etk::Vector3D(0,1,0), roty)/* - * etk::Matrix4::Translate(etk::Vector3D(0.01,0.0,0.0)) - * etk::Matrix4::Rotate(etk::Vector3D(0,0,1), rotz)*/ + mat4 tmpMatrix = ewol::openGL::GetMatrix(); + tmpMatrix = mat4::Scale(vec3(100,100,100) ) + * mat4::Rotate(vec3(1,0,0), rotx) + * mat4::Rotate(vec3(0,1,0), roty)/* + * mat4::Translate(vec3(0.01,0.0,0.0)) + * mat4::Rotate(vec3(0,0,1), rotz)*/ * tmpMatrix; m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat); // TextureID diff --git a/sources/ewol/renderer/resources/Mesh.h b/sources/ewol/renderer/resources/Mesh.h index 64a915ab..721723df 100644 --- a/sources/ewol/renderer/resources/Mesh.h +++ b/sources/ewol/renderer/resources/Mesh.h @@ -27,9 +27,9 @@ namespace ewol int32_t m_GLtexture; int32_t m_GLtexID; etk::Vector m_indices; - etk::Vector< etk::Vector3D > m_vertices; - etk::Vector< etk::Vector2D > m_uvTextures; - etk::Vector< etk::Vector3D > m_normals; + etk::Vector< vec3 > m_vertices; + etk::Vector< vec2 > m_uvTextures; + etk::Vector< vec3 > m_normals; ewol::TextureFile* m_texture1; etk::Vector m_coordColor; //!< internal color of the different point public: diff --git a/sources/ewol/renderer/resources/MeshObj.cpp b/sources/ewol/renderer/resources/MeshObj.cpp index 40cf37a7..7a404deb 100644 --- a/sources/ewol/renderer/resources/MeshObj.cpp +++ b/sources/ewol/renderer/resources/MeshObj.cpp @@ -35,9 +35,9 @@ ewol::MeshObj::MeshObj(etk::UString _fileName) : etk::Vector indicesVertices; etk::Vector indicesUv; etk::Vector indicesNormal; - etk::Vector< etk::Vector3D > vertices; - etk::Vector< etk::Vector2D > uvTextures; - etk::Vector< etk::Vector3D > normals; + etk::Vector< vec3 > vertices; + etk::Vector< vec2 > uvTextures; + etk::Vector< vec3 > normals; while (NULL != fileName.FileGets(inputDataLine, 2048) ) @@ -45,17 +45,17 @@ ewol::MeshObj::MeshObj(etk::UString _fileName) : if (inputDataLine[0]=='v') { if (inputDataLine[1]=='n') { // Vertice normal : vn 0.000000 0.000000 -1.000000 - etk::Vector3D vertex; + vec3 vertex; sscanf(&inputDataLine[3], "%f %f %f", &vertex.x, &vertex.y, &vertex.z ); normals.PushBack(vertex); } else if (inputDataLine[1]=='t') { // Texture position : vt 0.748573 0.750412 - etk::Vector2D vertex; + vec2 vertex; sscanf(&inputDataLine[3], "%f %f", &vertex.x, &vertex.y); uvTextures.PushBack(vertex); } else { // Vertice position : v 1.000000 -1.000000 -1.000000 - etk::Vector3D vertex; + vec3 vertex; sscanf(&inputDataLine[2], "%f %f %f", &vertex.x, &vertex.y, &vertex.z ); vertices.PushBack(vertex); } @@ -101,7 +101,7 @@ ewol::MeshObj::MeshObj(etk::UString _fileName) : inputDataLine[strlen(inputDataLine)-1] = '\0'; } etk::UString tmpVal(&inputDataLine[7]); - etk::Vector2D tmpSize(256, 256); + ivec2 tmpSize(256, 256); if (NULL != m_texture1) { EWOL_INFO("Release previous loaded texture ... "); ewol::resource::Release(m_texture1); diff --git a/sources/ewol/renderer/resources/Program.cpp b/sources/ewol/renderer/resources/Program.cpp index c7f5bbf4..8930208e 100644 --- a/sources/ewol/renderer/resources/Program.cpp +++ b/sources/ewol/renderer/resources/Program.cpp @@ -285,7 +285,7 @@ void ewol::Program::SendAttribute(int32_t idElem, int32_t nbElement, void* point ////////////////////////////////////////////////////////////////////////////////////////////// -void ewol::Program::UniformMatrix4fv(int32_t idElem, int32_t nbElement, etk::Matrix4 _matrix, bool transpose) +void ewol::Program::UniformMatrix4fv(int32_t idElem, int32_t nbElement, mat4 _matrix, bool transpose) { if (idElem<0 || idElem>m_elementList.Size()) { EWOL_ERROR("idElem = " << idElem << " not in [0.." << (m_elementList.Size()-1) << "]"); diff --git a/sources/ewol/renderer/resources/Program.h b/sources/ewol/renderer/resources/Program.h index a9f5ffc3..0757b5a4 100644 --- a/sources/ewol/renderer/resources/Program.h +++ b/sources/ewol/renderer/resources/Program.h @@ -95,7 +95,7 @@ namespace ewol * @param[in] pointer Pointer on the data that might be sended * @param[in] transpose Transpose the matrix (needed all the taime in the normal openGl access (only not done in the openGL-ES2 due to the fact we must done it ourself) */ - void UniformMatrix4fv(int32_t idElem, int32_t nbElement, etk::Matrix4 pointer, bool transpose=true); + void UniformMatrix4fv(int32_t idElem, int32_t nbElement, mat4 pointer, bool transpose=true); /** * @brief Send 1 float uniform element to the spefified ID (not send if does not really exist in the OpenGL program) * @param[in] idElem Id of the uniform that might be sended. diff --git a/sources/ewol/renderer/resources/Texture.cpp b/sources/ewol/renderer/resources/Texture.cpp index a9fed36b..897a8930 100644 --- a/sources/ewol/renderer/resources/Texture.cpp +++ b/sources/ewol/renderer/resources/Texture.cpp @@ -111,7 +111,7 @@ void ewol::Texture::Flush(void) } -void ewol::Texture::SetImageSize(etk::Vector2D newSize) +void ewol::Texture::SetImageSize(ivec2 newSize) { newSize.x = nextP2(newSize.x); newSize.y = nextP2(newSize.y); diff --git a/sources/ewol/renderer/resources/Texture.h b/sources/ewol/renderer/resources/Texture.h index 11e34296..c2b511f0 100644 --- a/sources/ewol/renderer/resources/Texture.h +++ b/sources/ewol/renderer/resources/Texture.h @@ -23,7 +23,7 @@ namespace ewol { // OpenGl textureID : GLuint m_texId; // some image are not square ==> we need to sqared it to prevent some openGl api error the the displayable size is not all the time 0.0 -> 1.0 - etk::Vector2D m_endPointSize; + vec2 m_endPointSize; // internal state of the openGl system : bool m_loaded; // Ewol internal API: @@ -34,14 +34,14 @@ namespace ewol { // middleware interface: public: GLuint GetId(void) { return m_texId; }; - etk::Vector2D GetUsableSize(void) { return m_endPointSize; }; + vec2 GetUsableSize(void) { return m_endPointSize; }; // Public API: public: Texture(etk::UString tmpName); ~Texture(void); virtual const char* GetType(void) { return "ewol::Texture"; }; // you must set the size here, because it will be set in multiple of pow(2) - void SetImageSize(etk::Vector2D newSize); + void SetImageSize(ivec2 newSize); // get the reference on this image to draw nomething on it ... inline draw::Image& Get(void) { return m_data; }; // Flush the data to send it at the OpenGl system diff --git a/sources/ewol/renderer/resources/TexturedFont.cpp b/sources/ewol/renderer/resources/TexturedFont.cpp index df5ec7d5..df4220c7 100644 --- a/sources/ewol/renderer/resources/TexturedFont.cpp +++ b/sources/ewol/renderer/resources/TexturedFont.cpp @@ -209,7 +209,7 @@ ewol::TexturedFont::TexturedFont(etk::UString fontName) : if (iiiFontId == 0) { EWOL_DEBUG("Generate a text texture for char(" << nbRaws << "," << nbLine << ") with size=(" << textureWidth << "," << textureHeight << ")"); // resize must be done on the texture ... - SetImageSize(etk::Vector2D(textureWidth,textureHeight)); + SetImageSize(ivec2(textureWidth,textureHeight)); // now we can acces directly on the image m_data.SetFillColor(draw::Color(0x00000000)); m_data.Clear(); @@ -217,7 +217,7 @@ ewol::TexturedFont::TexturedFont(etk::UString fontName) : m_height[iiiFontId] = m_font[iiiFontId]->GetHeight(m_size); int32_t CurrentLineHigh = 0; - etk::Vector2D glyphPosition(1,1); + ivec2 glyphPosition(1,1); for (int32_t iii=0; iiiGetGlyphProperty(m_size, (m_listElement[iiiFontId])[iii])) { // change line if needed ... @@ -254,11 +254,11 @@ ewol::TexturedFont::TexturedFont(etk::UString fontName) : draw::Color tlpppp(0xFF,0xFF,0xFF,0x00); for(int32_t jjj=0; jjj < textureHeight;jjj++) { for(int32_t iii=0; iii < textureWidth; iii++){ - tlpppp = m_data.Get(etk::Vector2D(iii, jjj) ); + tlpppp = m_data.Get(ivec2(iii, jjj) ); // set only alpha : tlpppp.a = etk_min( tlpppp.a+0x60, 0xFF); // real set of color - m_data.Set(etk::Vector2D(iii, jjj), tlpppp ); + m_data.Set(ivec2(iii, jjj), tlpppp ); } } #endif diff --git a/sources/ewol/renderer/resources/TexturedFont.h b/sources/ewol/renderer/resources/TexturedFont.h index a9ce42b5..9a006786 100644 --- a/sources/ewol/renderer/resources/TexturedFont.h +++ b/sources/ewol/renderer/resources/TexturedFont.h @@ -39,7 +39,7 @@ namespace ewol etk::Vector m_listElement[4]; private: // for the texture generation : - etk::Vector2D m_lastGlyphPos[4]; + ivec2 m_lastGlyphPos[4]; int32_t m_lastRawHeigh[4]; public: TexturedFont(etk::UString fontName); diff --git a/sources/ewol/renderer/resources/font/FontBase.h b/sources/ewol/renderer/resources/font/FontBase.h index 65d21fb5..3d850378 100644 --- a/sources/ewol/renderer/resources/font/FontBase.h +++ b/sources/ewol/renderer/resources/font/FontBase.h @@ -34,11 +34,11 @@ namespace ewol virtual bool DrawGlyph(draw::Image& imageOut, int32_t fontSize, - etk::Vector2D glyphPosition, + ivec2 glyphPosition, ewol::GlyphProperty& property, int8_t posInImage) = 0; - virtual etk::Vector2D GetSize(int32_t fontSize, const etk::UString & unicodeString) = 0; + virtual vec2 GetSize(int32_t fontSize, const etk::UString & unicodeString) = 0; virtual int32_t GetHeight(int32_t fontSize) = 0; diff --git a/sources/ewol/renderer/resources/font/GlyphProperty.h b/sources/ewol/renderer/resources/font/GlyphProperty.h index 912bb0c9..2723adbe 100644 --- a/sources/ewol/renderer/resources/font/GlyphProperty.h +++ b/sources/ewol/renderer/resources/font/GlyphProperty.h @@ -54,11 +54,11 @@ namespace ewol public: uniChar_t m_UVal; //!< Unicode value int32_t m_glyphIndex; //!< Glyph index in the system - etk::Vector2D m_sizeTexture; //!< size of the element to display - etk::Vector2D m_bearing; //!< offset to display the data (can be negatif id the texture sise is bigger than the theoric places in the string) - etk::Vector2D m_advance; //!< space use in the display for this specific char - etk::Vector2D m_texturePosStart; //!< Texture normalised position (START) - etk::Vector2D m_texturePosStop; //!< Texture normalised position (STOP) + ivec2 m_sizeTexture; //!< size of the element to display + ivec2 m_bearing; //!< offset to display the data (can be negatif id the texture sise is bigger than the theoric places in the string) + ivec2 m_advance; //!< space use in the display for this specific char + vec2 m_texturePosStart; //!< Texture normalised position (START) + vec2 m_texturePosStop; //!< Texture normalised position (STOP) private: etk::Vector m_kerning; //!< kerning values of link of all elements public: diff --git a/sources/ewol/renderer/resources/image/ImageBMP.cpp b/sources/ewol/renderer/resources/image/ImageBMP.cpp index 5bef20cb..03c36858 100644 --- a/sources/ewol/renderer/resources/image/ImageBMP.cpp +++ b/sources/ewol/renderer/resources/image/ImageBMP.cpp @@ -125,7 +125,7 @@ bool ewol::imageBMP::GenerateImage(etk::UString & inputFile, draw::Image & ouput m_width = m_InfoHeader.biWidth; m_height = m_InfoHeader.biHeight; // reallocate the image - ouputImage.Resize(etk::Vector2D(m_width,m_height)); + ouputImage.Resize(ivec2(m_width,m_height)); uint8_t* m_data = NULL; if(0 != m_InfoHeader.biSizeImage) @@ -151,7 +151,7 @@ bool ewol::imageBMP::GenerateImage(etk::UString & inputFile, draw::Image & ouput tmpColor.g = (int8_t)((*pointer & 0x07E0) >> 3); tmpColor.b = (int8_t)(*pointer << 3); tmpColor.a = 0xFF; - ouputImage.Set(etk::Vector2D(xxx,yyy), tmpColor); + ouputImage.Set(ivec2(xxx,yyy), tmpColor); pointer++; } } @@ -166,7 +166,7 @@ bool ewol::imageBMP::GenerateImage(etk::UString & inputFile, draw::Image & ouput tmpColor.g = (int8_t)((*pointer & 0x03E0) >> 2); tmpColor.b = (int8_t)(*pointer << 3); tmpColor.a = 0xFF; - ouputImage.Set(etk::Vector2D(xxx,yyy), tmpColor); + ouputImage.Set(ivec2(xxx,yyy), tmpColor); pointer++; } } @@ -181,7 +181,7 @@ bool ewol::imageBMP::GenerateImage(etk::UString & inputFile, draw::Image & ouput tmpColor.g = *pointer++; tmpColor.b = *pointer++; tmpColor.a = 0xFF; - ouputImage.Set(etk::Vector2D(xxx,yyy), tmpColor); + ouputImage.Set(ivec2(xxx,yyy), tmpColor); } } } @@ -196,7 +196,7 @@ bool ewol::imageBMP::GenerateImage(etk::UString & inputFile, draw::Image & ouput tmpColor.g = *pointer++; tmpColor.b = *pointer++; tmpColor.a = 0xFF; - ouputImage.Set(etk::Vector2D(xxx,yyy), tmpColor); + ouputImage.Set(ivec2(xxx,yyy), tmpColor); } } } @@ -210,7 +210,7 @@ bool ewol::imageBMP::GenerateImage(etk::UString & inputFile, draw::Image & ouput tmpColor.g = *pointer++; tmpColor.b = *pointer++; tmpColor.a = *pointer++; - ouputImage.Set(etk::Vector2D(xxx,yyy), tmpColor); + ouputImage.Set(ivec2(xxx,yyy), tmpColor); } } } diff --git a/sources/ewol/renderer/resources/image/ImagePNG.cpp b/sources/ewol/renderer/resources/image/ImagePNG.cpp index 9142f3b6..bdcd7a4e 100644 --- a/sources/ewol/renderer/resources/image/ImagePNG.cpp +++ b/sources/ewol/renderer/resources/image/ImagePNG.cpp @@ -97,7 +97,7 @@ bool ewol::imagePNG::GenerateImage(etk::UString & inputFile, draw::Image & ouput int32_t width = png_get_image_width(png_ptr, info_ptr); int32_t height = png_get_image_height(png_ptr, info_ptr); // reallocate the image - ouputImage.Resize(etk::Vector2D(width,height)); + ouputImage.Resize(ivec2(width,height)); int32_t bit_depth = png_get_bit_depth(png_ptr, info_ptr); png_read_update_info(png_ptr, info_ptr); @@ -131,7 +131,7 @@ bool ewol::imagePNG::GenerateImage(etk::UString & inputFile, draw::Image & ouput tmpColor.g = ptr[1]; tmpColor.b = ptr[2]; tmpColor.a = ptr[3]; - ouputImage.Set(etk::Vector2D(x,y), tmpColor); + ouputImage.Set(ivec2(x,y), tmpColor); } delete row_pointers[y]; } diff --git a/sources/ewol/widget/Button.cpp b/sources/ewol/widget/Button.cpp index f5823bc1..95fa9d7a 100644 --- a/sources/ewol/widget/Button.cpp +++ b/sources/ewol/widget/Button.cpp @@ -82,13 +82,13 @@ void widget::Button::SetImageToggle(etk::UString imageName, draw::Color color) bool widget::Button::CalculateMinSize(void) { - etk::Vector2D padding = m_shaper.GetPadding(); + vec2 padding = m_shaper.GetPadding(); m_displayText.Clear(); - etk::Vector3D minSize = m_displayText.CalculateSizeDecorated(m_label); + ivec3 minSize = m_displayText.CalculateSizeDecorated(m_label); if( true == m_toggleMode && m_labelToggle.Size()!=0) { m_displayText.Clear(); - etk::Vector3D minSizeToggle = m_displayText.CalculateSizeDecorated(m_labelToggle); + ivec3 minSizeToggle = m_displayText.CalculateSizeDecorated(m_labelToggle); minSize.x = etk_max(minSize.x, minSizeToggle.x); minSize.y = etk_max(minSize.y, minSizeToggle.y); minSize.z = etk_max(minSize.z, minSizeToggle.z); @@ -170,10 +170,10 @@ void widget::Button::OnRegenerateDisplay(void) { if (true == NeedRedraw()) { - etk::Vector2D padding = m_shaper.GetPadding(); + vec2 padding = m_shaper.GetPadding(); // to know the size of one Line : - etk::Vector3D minSize = m_displayText.CalculateSize('A'); - etk::Vector3D curentTextSize; + ivec3 minSize = m_displayText.CalculateSize('A'); + ivec3 curentTextSize; if( false == m_toggleMode || false == m_value || m_labelToggle.Size()==0) { @@ -187,14 +187,14 @@ void widget::Button::OnRegenerateDisplay(void) m_shaper.Clear(); m_displayText.Clear(); - etk::Vector2D localSize = m_minSize; + ivec2 localSize = m_minSize; - etk::Vector3D tmpOrigin((m_size.x - m_minSize.x) / 2.0, + vec3 tmpOrigin((m_size.x - m_minSize.x) / 2.0, (m_size.y - m_minSize.y) / 2.0, 0.0); // no change for the text orogin : - etk::Vector3D tmpTextOrigin((m_size.x - m_minSize.x) / 2.0, + vec3 tmpTextOrigin((m_size.x - m_minSize.x) / 2.0, (m_size.y - m_minSize.y) / 2.0, 0.0); @@ -215,14 +215,14 @@ void widget::Button::OnRegenerateDisplay(void) tmpTextOrigin.y += (m_minSize.y-2*padding.y) - minSize.y; - etk::Vector2D textPos(tmpTextOrigin.x, tmpTextOrigin.y); + vec2 textPos(tmpTextOrigin.x, tmpTextOrigin.y); if( true == m_displayImage.HasSources() || true == m_displayImageToggle.HasSources()) { - etk::Vector3D imagePos(tmpOrigin.x-padding.x/4, + ivec3 imagePos(tmpOrigin.x-padding.x/4, tmpOrigin.y-padding.x/4+(m_minSize.y-m_imageDisplaySize-2*padding.y)/2.0, 0); - etk::Vector2D imageSize(m_imageDisplaySize, + ivec2 imageSize(m_imageDisplaySize, m_imageDisplaySize); if( false==m_toggleMode || false==m_value) { @@ -238,8 +238,8 @@ void widget::Button::OnRegenerateDisplay(void) tmpTextOrigin.x += padding.x/2 + m_imageDisplaySize; } - etk::Vector3D drawClippingPos(padding.x, padding.y, -0.5); - etk::Vector3D drawClippingSize((float)(m_size.x - padding.x), + vec3 drawClippingPos(padding.x, padding.y, -0.5); + vec3 drawClippingSize((float)(m_size.x - padding.x), (float)(m_size.y - padding.y), (float)1.0); @@ -268,27 +268,27 @@ void widget::Button::OnRegenerateDisplay(void) } // selection area : - m_selectableAreaPos = etk::Vector2D(tmpOrigin.x-padding.x, tmpOrigin.y-padding.y); - m_selectableAreaSize = localSize + etk::Vector2D(2,2)*padding; + m_selectableAreaPos = vec2(tmpOrigin.x-padding.x, tmpOrigin.y-padding.y); + m_selectableAreaSize = localSize + vec2(2,2)*padding; m_shaper.SetOrigin(m_selectableAreaPos ); m_shaper.SetSize(m_selectableAreaSize); - m_shaper.SetInsidePos(etk::Vector2D(tmpTextOrigin.x, tmpTextOrigin.y) ); - etk::Vector3D tmpp = m_displayText.CalculateSize(m_label); - etk::Vector2D tmpp2(tmpp.x, tmpp.y); + m_shaper.SetInsidePos(vec2(tmpTextOrigin.x, tmpTextOrigin.y) ); + vec3 tmpp = m_displayText.CalculateSize(m_label); + vec2 tmpp2(tmpp.x, tmpp.y); m_shaper.SetInsideSize(tmpp2); } } -bool widget::Button::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos) +bool widget::Button::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos) { bool previousHoverState = m_mouseHover; if(ewol::keyEvent::statusLeave == typeEvent) { m_mouseHover = false; m_buttonPressed = false; } else { - etk::Vector2D relativePos = RelativePosition(pos); + vec2 relativePos = RelativePosition(pos); // prevent error from ouside the button if( relativePos.x < m_selectableAreaPos.x || relativePos.y < m_selectableAreaPos.y diff --git a/sources/ewol/widget/Button.h b/sources/ewol/widget/Button.h index 615cab0f..0e6abbc6 100644 --- a/sources/ewol/widget/Button.h +++ b/sources/ewol/widget/Button.h @@ -42,8 +42,8 @@ namespace widget { bool m_buttonPressed; //!< Flag to know if the button is curently pressed. int32_t m_imageDisplaySize; //!< Display size of the Image. // hover area : - etk::Vector2D m_selectableAreaPos; //!< Start position of the events - etk::Vector2D m_selectableAreaSize; //!< Size of the event positions + vec2 m_selectableAreaPos; //!< Start position of the events + vec2 m_selectableAreaSize; //!< Size of the event positions public: /** * @brief Constructor @@ -123,7 +123,7 @@ namespace widget { // Derived function virtual void OnDraw(ewol::DrawProperty& displayProp); // Derived function - virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos); + virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos); // Derived function virtual bool OnEventKb(ewol::keyEvent::status_te typeEvent, uniChar_t unicodeData); private: diff --git a/sources/ewol/widget/ButtonColor.cpp b/sources/ewol/widget/ButtonColor.cpp index 4261a167..89f775c2 100644 --- a/sources/ewol/widget/ButtonColor.cpp +++ b/sources/ewol/widget/ButtonColor.cpp @@ -55,9 +55,9 @@ void widget::ButtonColor::SetShaperName(etk::UString shaperName) bool widget::ButtonColor::CalculateMinSize(void) { - etk::Vector2D padding = m_shaper.GetPadding(); + vec2 padding = m_shaper.GetPadding(); etk::UString label = draw::GetString(m_textColorFg); - etk::Vector3D minSize = m_text.CalculateSize(label); + ivec3 minSize = m_text.CalculateSize(label); m_minSize.x = padding.x*2 + minSize.x + 7; m_minSize.y = padding.y*2 + minSize.y; MarkToRedraw(); @@ -79,18 +79,18 @@ void widget::ButtonColor::OnRegenerateDisplay(void) m_text.Clear(); m_shaper.Clear(); - etk::Vector2D padding = m_shaper.GetPadding(); + vec2 padding = m_shaper.GetPadding(); etk::UString label = draw::GetString(m_textColorFg); - etk::Vector2D localSize = m_minSize; + ivec2 localSize = m_minSize; - etk::Vector3D tmpOrigin((m_size.x - m_minSize.x) / 2.0, + vec3 tmpOrigin((m_size.x - m_minSize.x) / 2.0, (m_size.y - m_minSize.y) / 2.0, 0.0); // no change for the text orogin : - etk::Vector3D tmpTextOrigin((m_size.x - m_minSize.x) / 2.0, + vec3 tmpTextOrigin((m_size.x - m_minSize.x) / 2.0, (m_size.y - m_minSize.y) / 2.0, 0.0); @@ -129,26 +129,26 @@ void widget::ButtonColor::OnRegenerateDisplay(void) } // selection area : - m_selectableAreaPos = etk::Vector2D(tmpOrigin.x-padding.x, tmpOrigin.y-padding.y); - m_selectableAreaSize = localSize + etk::Vector2D(2,2)*padding; + m_selectableAreaPos = vec2(tmpOrigin.x-padding.x, tmpOrigin.y-padding.y); + m_selectableAreaSize = localSize + vec2(2,2)*padding; m_shaper.SetOrigin(m_selectableAreaPos ); m_shaper.SetSize(m_selectableAreaSize); - m_shaper.SetInsidePos(etk::Vector2D(tmpTextOrigin.x, tmpTextOrigin.y) ); - etk::Vector3D tmpp = m_text.CalculateSize(label); - etk::Vector2D tmpp2(tmpp.x, tmpp.y); + m_shaper.SetInsidePos(vec2(tmpTextOrigin.x, tmpTextOrigin.y) ); + vec3 tmpp = m_text.CalculateSize(label); + vec2 tmpp2(tmpp.x, tmpp.y); m_shaper.SetInsideSize(tmpp2); } } -bool widget::ButtonColor::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos) +bool widget::ButtonColor::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos) { bool previousHoverState = m_mouseHover; if(ewol::keyEvent::statusLeave == typeEvent) { m_mouseHover = false; m_buttonPressed = false; } else { - etk::Vector2D relativePos = RelativePosition(pos); + vec2 relativePos = RelativePosition(pos); // prevent error from ouside the button if( relativePos.x < m_selectableAreaPos.x || relativePos.y < m_selectableAreaPos.y @@ -181,7 +181,7 @@ bool widget::ButtonColor::OnEventInput(ewol::keyEvent::type_te type, int32_t IdI EWOL_ERROR("Allocation Error"); return true; } - etk::Vector2D tmpPos = m_origin + m_selectableAreaPos + m_selectableAreaSize; + vec2 tmpPos = m_origin + m_selectableAreaPos + m_selectableAreaSize; tmpPos.x -= m_minSize.x/2.0; m_widgetContextMenu->SetPositionMark(widget::CONTEXT_MENU_MARK_BOTTOM, tmpPos ); diff --git a/sources/ewol/widget/ButtonColor.h b/sources/ewol/widget/ButtonColor.h index b743b3c7..488eb50c 100644 --- a/sources/ewol/widget/ButtonColor.h +++ b/sources/ewol/widget/ButtonColor.h @@ -30,8 +30,8 @@ namespace widget { bool m_mouseHover; //!< Flag to know where the mouse is (inside the displayed widget (if not fill)). bool m_buttonPressed; //!< Flag to know if the button is curently pressed. // hover area : - etk::Vector2D m_selectableAreaPos; //!< Start position of the events - etk::Vector2D m_selectableAreaSize; //!< Size of the event positions + vec2 m_selectableAreaPos; //!< Start position of the events + vec2 m_selectableAreaSize; //!< Size of the event positions public: /** * @brief Main constructor. @@ -68,7 +68,7 @@ namespace widget { // Derived function virtual void OnDraw(ewol::DrawProperty& displayProp); // Derived function - virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos); + virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos); // Derived function virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data); private: diff --git a/sources/ewol/widget/CheckBox.cpp b/sources/ewol/widget/CheckBox.cpp index e13fc2df..60685e3d 100644 --- a/sources/ewol/widget/CheckBox.cpp +++ b/sources/ewol/widget/CheckBox.cpp @@ -47,7 +47,7 @@ widget::CheckBox::~CheckBox(void) bool widget::CheckBox::CalculateMinSize(void) { - etk::Vector3D minSize = m_oObjectText.CalculateSize(m_label); + ivec3 minSize = m_oObjectText.CalculateSize(m_label); float boxSize = etk_max(20, minSize.y) + 5; m_minSize.x = boxSize+minSize.x; m_minSize.y = etk_max(boxSize, minSize.y)+3; @@ -89,14 +89,14 @@ void widget::CheckBox::OnRegenerateDisplay(void) m_oObjectDecoration.Clear(); m_oObjectText.Clear(); - etk::Vector3D minSize = m_oObjectText.CalculateSize(m_label); + ivec3 minSize = m_oObjectText.CalculateSize(m_label); float boxSize = etk_max(20, minSize.y) + 5; //int32_t fontWidth = ewol::GetWidth(fontId, m_label.c_str()); int32_t posy = (m_size.y - minSize.y - 6)/2 + 3; //int32_t posx = (m_size.x - fontWidth - 6)/2 + 25; - etk::Vector3D textPos; + vec3 textPos; textPos.x = boxSize+5; textPos.y = posy; textPos.z = 0; @@ -104,18 +104,18 @@ void widget::CheckBox::OnRegenerateDisplay(void) m_oObjectText.Print(m_label); m_oObjectDecoration.SetColor(m_textColorBg); - m_oObjectDecoration.SetPos(etk::Vector3D(2.5f, 2.5f, 0.0f) ); - m_oObjectDecoration.RectangleWidth(etk::Vector3D(boxSize, boxSize, 0.0f) ); + m_oObjectDecoration.SetPos(vec3(2.5f, 2.5f, 0.0f) ); + m_oObjectDecoration.RectangleWidth(vec3(boxSize, boxSize, 0.0f) ); if (m_value) { m_oObjectDecoration.SetColor(m_textColorFg); - m_oObjectDecoration.SetPos(etk::Vector3D(2.5f, 2.5f, 0.0f) ); + m_oObjectDecoration.SetPos(vec3(2.5f, 2.5f, 0.0f) ); m_oObjectDecoration.SetThickness(3); - m_oObjectDecoration.LineRel(etk::Vector3D(boxSize, boxSize, 0.0f) ); + m_oObjectDecoration.LineRel(vec3(boxSize, boxSize, 0.0f) ); } } } -bool widget::CheckBox::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos) +bool widget::CheckBox::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos) { //EWOL_DEBUG("Event on checkbox ..."); if (1 == IdInput) { diff --git a/sources/ewol/widget/CheckBox.h b/sources/ewol/widget/CheckBox.h index 12747da3..53188302 100644 --- a/sources/ewol/widget/CheckBox.h +++ b/sources/ewol/widget/CheckBox.h @@ -45,7 +45,7 @@ namespace widget { // Derived function virtual void OnDraw(ewol::DrawProperty& displayProp); // Derived function - virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos); + virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos); // Derived function virtual bool OnEventKb(ewol::keyEvent::status_te typeEvent, uniChar_t unicodeData); }; diff --git a/sources/ewol/widget/ColorBar.cpp b/sources/ewol/widget/ColorBar.cpp index 0346933b..6a7ebc1c 100644 --- a/sources/ewol/widget/ColorBar.cpp +++ b/sources/ewol/widget/ColorBar.cpp @@ -103,13 +103,13 @@ void widget::ColorBar::OnRegenerateDisplay(void) * ******** */ m_draw.SetColor(s_listColorWhite); - m_draw.SetPos(etk::Vector3D(tmpOriginX + (iii)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY) ); + m_draw.SetPos(vec3(tmpOriginX + (iii)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY) ); m_draw.AddVertex(); m_draw.SetColor(s_listColor[iii+1]); - m_draw.SetPos(etk::Vector3D(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2) ); + m_draw.SetPos(vec3(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2) ); m_draw.AddVertex(); m_draw.SetColor(s_listColor[iii]); - m_draw.SetPos(etk::Vector3D(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2) ); + m_draw.SetPos(vec3(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2) ); m_draw.AddVertex(); /* Step 2 : * ******** @@ -119,13 +119,13 @@ void widget::ColorBar::OnRegenerateDisplay(void) * */ m_draw.SetColor(s_listColorWhite); - m_draw.SetPos(etk::Vector3D(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY) ); + m_draw.SetPos(vec3(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY) ); m_draw.AddVertex(); m_draw.SetColor(s_listColorWhite); - m_draw.SetPos(etk::Vector3D(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY) ); + m_draw.SetPos(vec3(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY) ); m_draw.AddVertex(); m_draw.SetColor(s_listColor[iii+1]); - m_draw.SetPos(etk::Vector3D(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2) ); + m_draw.SetPos(vec3(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2) ); m_draw.AddVertex(); /* Step 3 : * @@ -135,13 +135,13 @@ void widget::ColorBar::OnRegenerateDisplay(void) * ******** */ m_draw.SetColor(s_listColor[iii]); - m_draw.SetPos(etk::Vector3D(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2)); + m_draw.SetPos(vec3(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2)); m_draw.AddVertex(); m_draw.SetColor(s_listColorBlack); - m_draw.SetPos(etk::Vector3D(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY)); + m_draw.SetPos(vec3(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY)); m_draw.AddVertex(); m_draw.SetColor(s_listColorBlack); - m_draw.SetPos(etk::Vector3D(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY)); + m_draw.SetPos(vec3(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY)); m_draw.AddVertex(); /* Step 4 : * ******** @@ -151,13 +151,13 @@ void widget::ColorBar::OnRegenerateDisplay(void) * */ m_draw.SetColor(s_listColor[iii]); - m_draw.SetPos(etk::Vector3D(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2)); + m_draw.SetPos(vec3(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2)); m_draw.AddVertex(); m_draw.SetColor(s_listColor[iii+1]); - m_draw.SetPos(etk::Vector3D(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2)); + m_draw.SetPos(vec3(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2)); m_draw.AddVertex(); m_draw.SetColor(s_listColorBlack); - m_draw.SetPos(etk::Vector3D(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY)); + m_draw.SetPos(vec3(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY)); m_draw.AddVertex(); } if (m_currentUserPos.y > 0.5) { @@ -165,7 +165,7 @@ void widget::ColorBar::OnRegenerateDisplay(void) } else { m_draw.SetColor(draw::color::black); } - m_draw.SetPos(etk::Vector3D(m_currentUserPos.x*m_size.x, m_currentUserPos.y*m_size.y) ); + m_draw.SetPos(vec3(m_currentUserPos.x*m_size.x, m_currentUserPos.y*m_size.y) ); m_draw.SetThickness(1); m_draw.Circle(3.0); @@ -173,9 +173,9 @@ void widget::ColorBar::OnRegenerateDisplay(void) } -bool widget::ColorBar::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos) +bool widget::ColorBar::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos) { - etk::Vector2D relativePos = RelativePosition(pos); + vec2 relativePos = RelativePosition(pos); //EWOL_DEBUG("Event on BT ..."); if (1 == IdInput) { relativePos.x = etk_max(etk_min(relativePos.x, m_size.x),0); diff --git a/sources/ewol/widget/ColorBar.h b/sources/ewol/widget/ColorBar.h index 5236880c..31b232e2 100644 --- a/sources/ewol/widget/ColorBar.h +++ b/sources/ewol/widget/ColorBar.h @@ -28,7 +28,7 @@ namespace widget { private: ewol::Drawing m_draw; //!< Compositing drawing element draw::Color m_currentColor; - etk::Vector2D m_currentUserPos; + vec2 m_currentUserPos; public: // Derived function virtual const char * const GetObjectType(void) { return "widget::ColorBar"; }; @@ -39,7 +39,7 @@ namespace widget { // Derived function virtual void OnDraw(ewol::DrawProperty& displayProp); // Derived function - virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos); + virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos); }; }; diff --git a/sources/ewol/widget/ContextMenu.cpp b/sources/ewol/widget/ContextMenu.cpp index 5d2680b6..8a46f794 100644 --- a/sources/ewol/widget/ContextMenu.cpp +++ b/sources/ewol/widget/ContextMenu.cpp @@ -48,8 +48,8 @@ bool widget::ContextMenu::CalculateSize(float availlableX, float availlableY) m_size.y = availlableY; if (NULL != m_subWidget) { - etk::Vector2D subWidgetSize; - etk::Vector2D subWidgetOrigin; + vec2 subWidgetSize; + vec2 subWidgetOrigin; subWidgetSize = m_subWidget->GetMinSize(); if (true == m_subWidget->CanExpentX()) { subWidgetSize.x = m_size.x; @@ -124,7 +124,7 @@ bool widget::ContextMenu::CalculateMinSize(void) m_minSize.y = 50.0; if (NULL != m_subWidget) { m_subWidget->CalculateMinSize(); - etk::Vector2D tmpSize = m_subWidget->GetMinSize(); + vec2 tmpSize = m_subWidget->GetMinSize(); m_minSize.x = tmpSize.x; m_minSize.y = tmpSize.y; } @@ -186,44 +186,44 @@ void widget::ContextMenu::OnRegenerateDisplay(void) AddOObject(BGOObjects); if (NULL != m_subWidget) { - etk::Vector2D tmpSize = m_subWidget->GetSize(); - etk::Vector2D tmpOrigin = m_subWidget->GetOrigin(); + vec2 tmpSize = m_subWidget->GetSize(); + vec2 tmpOrigin = m_subWidget->GetOrigin(); // display border ... BGOObjects->SetColor(m_colorBorder); switch (m_arrawBorder) { case widget::CONTEXT_MENU_MARK_TOP: - BGOObjects->SetPos(etk::Vector3D(m_arrowPos.x, m_arrowPos.y, 0.0f) ); + BGOObjects->SetPos(vec3(m_arrowPos.x, m_arrowPos.y, 0.0f) ); BGOObjects->AddVertex(); if (m_arrowPos.x <= tmpOrigin.x ) { float laking = m_offset - m_padding.y; - BGOObjects->SetPos(etk::Vector3D(m_arrowPos.x+laking, m_arrowPos.y-laking, 0.0f) ); + BGOObjects->SetPos(vec3(m_arrowPos.x+laking, m_arrowPos.y-laking, 0.0f) ); BGOObjects->AddVertex(); - BGOObjects->SetPos(etk::Vector3D(m_arrowPos.x, m_arrowPos.y-laking, 0.0f) ); + BGOObjects->SetPos(vec3(m_arrowPos.x, m_arrowPos.y-laking, 0.0f) ); BGOObjects->AddVertex(); } else { float laking = m_offset - m_padding.y; - BGOObjects->SetPos(etk::Vector3D(m_arrowPos.x+laking, m_arrowPos.y-laking, 0.0f) ); + BGOObjects->SetPos(vec3(m_arrowPos.x+laking, m_arrowPos.y-laking, 0.0f) ); BGOObjects->AddVertex(); - BGOObjects->SetPos(etk::Vector3D(m_arrowPos.x-laking, m_arrowPos.y-laking, 0.0f) ); + BGOObjects->SetPos(vec3(m_arrowPos.x-laking, m_arrowPos.y-laking, 0.0f) ); BGOObjects->AddVertex(); } break; case widget::CONTEXT_MENU_MARK_BOTTOM: - BGOObjects->SetPos(etk::Vector3D(m_arrowPos.x, m_arrowPos.y, 0.0f) ); + BGOObjects->SetPos(vec3(m_arrowPos.x, m_arrowPos.y, 0.0f) ); BGOObjects->AddVertex(); if (m_arrowPos.x <= tmpOrigin.x ) { int32_t laking = m_offset - m_padding.y; - BGOObjects->SetPos(etk::Vector3D(m_arrowPos.x+laking, m_arrowPos.y+laking, 0.0f) ); + BGOObjects->SetPos(vec3(m_arrowPos.x+laking, m_arrowPos.y+laking, 0.0f) ); BGOObjects->AddVertex(); - BGOObjects->SetPos(etk::Vector3D(m_arrowPos.x, m_arrowPos.y+laking, 0.0f) ); + BGOObjects->SetPos(vec3(m_arrowPos.x, m_arrowPos.y+laking, 0.0f) ); BGOObjects->AddVertex(); } else { int32_t laking = m_offset - m_padding.y; - BGOObjects->SetPos(etk::Vector3D(m_arrowPos.x+laking, m_arrowPos.y+laking, 0.0f) ); + BGOObjects->SetPos(vec3(m_arrowPos.x+laking, m_arrowPos.y+laking, 0.0f) ); BGOObjects->AddVertex(); - BGOObjects->SetPos(etk::Vector3D(m_arrowPos.x-laking, m_arrowPos.y+laking, 0.0f) ); + BGOObjects->SetPos(vec3(m_arrowPos.x-laking, m_arrowPos.y+laking, 0.0f) ); BGOObjects->AddVertex(); } break; @@ -233,12 +233,12 @@ void widget::ContextMenu::OnRegenerateDisplay(void) EWOL_TODO("later"); break; } - BGOObjects->SetPos(etk::Vector3D(tmpOrigin.x-m_padding.x, tmpOrigin.y - m_padding.y, 0.0f) ); - BGOObjects->RectangleWidth(etk::Vector3D(tmpSize.x + m_padding.x*2, tmpSize.y + m_padding.y*2, 0.0f) ); + BGOObjects->SetPos(vec3(tmpOrigin.x-m_padding.x, tmpOrigin.y - m_padding.y, 0.0f) ); + BGOObjects->RectangleWidth(vec3(tmpSize.x + m_padding.x*2, tmpSize.y + m_padding.y*2, 0.0f) ); // set the area in white ... BGOObjects->SetColor(m_colorBackGroung); - BGOObjects->SetPos(etk::Vector3D(tmpOrigin.x, tmpOrigin.y, 0.0f) ); - BGOObjects->RectangleWidth(etk::Vector3D(tmpSize.x, tmpSize.y, 0.0f) ); + BGOObjects->SetPos(vec3(tmpOrigin.x, tmpOrigin.y, 0.0f) ); + BGOObjects->RectangleWidth(vec3(tmpSize.x, tmpSize.y, 0.0f) ); } if (NULL != m_subWidget) { m_subWidget->OnRegenerateDisplay(); @@ -246,14 +246,14 @@ void widget::ContextMenu::OnRegenerateDisplay(void) } -ewol::Widget * widget::ContextMenu::GetWidgetAtPos(etk::Vector2D pos) +ewol::Widget * widget::ContextMenu::GetWidgetAtPos(vec2 pos) { // calculate relative position - etk::Vector2D relativePos = RelativePosition(pos); + vec2 relativePos = RelativePosition(pos); // Check for sub Element if (NULL != m_subWidget) { - etk::Vector2D tmpSize = m_subWidget->GetSize(); - etk::Vector2D tmpOrigin = m_subWidget->GetOrigin(); + vec2 tmpSize = m_subWidget->GetSize(); + vec2 tmpOrigin = m_subWidget->GetOrigin(); if( (tmpOrigin.x <= relativePos.x && tmpOrigin.x + tmpSize.x >= relativePos.x) && (tmpOrigin.y <= relativePos.y && tmpOrigin.y + tmpSize.y >= relativePos.y) ) { @@ -264,7 +264,7 @@ ewol::Widget * widget::ContextMenu::GetWidgetAtPos(etk::Vector2D pos) } -bool widget::ContextMenu::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos) +bool widget::ContextMenu::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos) { //EWOL_INFO("Event ouside the context menu"); if (IdInput > 0) { @@ -283,7 +283,7 @@ bool widget::ContextMenu::OnEventInput(ewol::keyEvent::type_te type, int32_t IdI } -void widget::ContextMenu::SetPositionMark(markPosition_te position, etk::Vector2D arrowPos) +void widget::ContextMenu::SetPositionMark(markPosition_te position, vec2 arrowPos) { EWOL_DEBUG("set context menu at the position : (" << arrowPos.x << "," << arrowPos.y << ")"); m_arrawBorder = position; diff --git a/sources/ewol/widget/ContextMenu.h b/sources/ewol/widget/ContextMenu.h index 7b5a0f32..e692bb50 100644 --- a/sources/ewol/widget/ContextMenu.h +++ b/sources/ewol/widget/ContextMenu.h @@ -39,15 +39,15 @@ namespace widget { private: draw::Color m_colorBackGroung; draw::Color m_colorBorder; - etk::Vector2D m_padding; - etk::Vector2D m_arrowPos; + vec2 m_padding; + vec2 m_arrowPos; float m_offset; markPosition_te m_arrawBorder; ewol::Widget* m_subWidget; public: void SubWidgetSet(ewol::Widget* newWidget); void SubWidgetRemove(void); - void SetPositionMark(markPosition_te position, etk::Vector2D arrowPos); + void SetPositionMark(markPosition_te position, vec2 arrowPos); protected: // Derived function virtual void OnDraw(ewol::DrawProperty& displayProp); @@ -55,9 +55,9 @@ namespace widget { // Derived function virtual void OnRegenerateDisplay(void); // Derived function - virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D pos); + virtual ewol::Widget * GetWidgetAtPos(vec2 pos); // Derived function - virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos); + virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos); }; }; diff --git a/sources/ewol/widget/Entry.cpp b/sources/ewol/widget/Entry.cpp index 309b3274..abc25190 100644 --- a/sources/ewol/widget/Entry.cpp +++ b/sources/ewol/widget/Entry.cpp @@ -68,7 +68,7 @@ widget::Entry::~Entry(void) bool widget::Entry::CalculateMinSize(void) { - etk::Vector2D padding = m_shaper.GetPadding(); + vec2 padding = m_shaper.GetPadding(); int32_t minHeight = m_oObjectText.CalculateSize('A').y; m_minSize.x = m_userSize + 2*padding.x; @@ -107,7 +107,7 @@ void widget::Entry::OnRegenerateDisplay(void) m_shaper.Clear(); m_oObjectText.Clear(); UpdateTextPosition(); - etk::Vector2D padding = m_shaper.GetPadding(); + vec2 padding = m_shaper.GetPadding(); int32_t tmpSizeX = m_minSize.x; int32_t tmpSizeY = m_minSize.y; @@ -131,13 +131,13 @@ void widget::Entry::OnRegenerateDisplay(void) tmpSizeY -= 2*padding.y; - etk::Vector3D textPos( tmpTextOriginX + m_displayStartPosition, + vec3 textPos( tmpTextOriginX + m_displayStartPosition, tmpTextOriginY, 0 ); - etk::Vector3D drawClippingPos( padding.x, + vec3 drawClippingPos( padding.x, padding.y, -1 ); - etk::Vector3D drawClippingSize( m_size.x - 2*drawClippingPos.x, + vec3 drawClippingSize( m_size.x - 2*drawClippingPos.x, m_size.y - 2*drawClippingPos.y, 1 ); m_oObjectText.SetClippingWidth(drawClippingPos, drawClippingSize); @@ -154,11 +154,11 @@ void widget::Entry::OnRegenerateDisplay(void) } -void widget::Entry::UpdateCursorPosition(etk::Vector2D& pos, bool selection) +void widget::Entry::UpdateCursorPosition(vec2& pos, bool selection) { - etk::Vector2D padding = m_shaper.GetPadding(); + vec2 padding = m_shaper.GetPadding(); - etk::Vector2D relPos = RelativePosition(pos); + vec2 relPos = RelativePosition(pos); relPos.x += -m_displayStartPosition - padding.x; // try to find the new cursor position : etk::UString tmpDisplay = m_data.Extract(0, m_displayStartPosition); @@ -230,7 +230,7 @@ void widget::Entry::CopySelectionToClipBoard(ewol::clipBoard::clipboardListe_te } -bool widget::Entry::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos) +bool widget::Entry::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos) { //EWOL_DEBUG("Event on Entry ... type=" << (int32_t)type << " id=" << IdInput); if (1 == IdInput) { @@ -444,7 +444,7 @@ void widget::Entry::OnReceiveMessage(ewol::EObject * CallerObject, const char * void widget::Entry::UpdateTextPosition(void) { - etk::Vector2D padding = m_shaper.GetPadding(); + vec2 padding = m_shaper.GetPadding(); int32_t tmpSizeX = m_minSize.x; if (true==m_userFill.x) { diff --git a/sources/ewol/widget/Entry.h b/sources/ewol/widget/Entry.h index f4fb7623..e4977667 100644 --- a/sources/ewol/widget/Entry.h +++ b/sources/ewol/widget/Entry.h @@ -72,7 +72,7 @@ namespace widget { // Derived function virtual void OnRegenerateDisplay(void); // Derived function - virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos); + virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos); // Derived function virtual bool OnEventKb(ewol::keyEvent::status_te typeEvent, uniChar_t unicodeData); // Derived function @@ -90,7 +90,7 @@ namespace widget { * @note The display is automaticly requested when change apear. * @return --- */ - virtual void UpdateCursorPosition(etk::Vector2D& pos, bool Selection=false); + virtual void UpdateCursorPosition(vec2& pos, bool Selection=false); /** * @brief Update the display position start ==> depending of the position of the Cursor and the size of the Data inside * @param --- diff --git a/sources/ewol/widget/Image.cpp b/sources/ewol/widget/Image.cpp index 85c54b5e..09d3b447 100644 --- a/sources/ewol/widget/Image.cpp +++ b/sources/ewol/widget/Image.cpp @@ -54,7 +54,7 @@ widget::Image::~Image(void) } -void widget::Image::SetPadding(etk::Vector2D newPadding) +void widget::Image::SetPadding(vec2 newPadding) { m_padding = newPadding; } @@ -102,14 +102,14 @@ void widget::Image::OnRegenerateDisplay(void) ewol::Image * tmpImage = NULL; tmpImage = new ewol::Image(m_imageSelected); // TODO : Check if it was possible later : , m_imageSize, m_imageSize); - tmpImage->SetPos(etk::Vector3D(tmpOriginX, tmpOriginY, 0) ); - tmpImage->Print(etk::Vector2D(m_imageSize, m_imageSize)); + tmpImage->SetPos(vec3(tmpOriginX, tmpOriginY, 0) ); + tmpImage->Print(vec2(m_imageSize, m_imageSize)); ewol::Drawing * tmpDraw = new ewol::Drawing(); tmpDraw->SetColor(m_textColorBg); - tmpDraw->SetPos(etk::Vector3D(tmpOriginX, tmpOriginY, 0) ); - tmpDraw->RectangleWidth(etk::Vector3D(tmpSizeX, tmpSizeY, 0) ); + tmpDraw->SetPos(vec3(tmpOriginX, tmpOriginY, 0) ); + tmpDraw->RectangleWidth(vec3(tmpSizeX, tmpSizeY, 0) ); // add all needed objects ... if (NULL != tmpDraw) { AddOObject(tmpDraw); @@ -120,7 +120,7 @@ void widget::Image::OnRegenerateDisplay(void) } } -bool widget::Image::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos) +bool widget::Image::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos) { //EWOL_DEBUG("Event on BT ..."); if (1 == IdInput) { diff --git a/sources/ewol/widget/Image.h b/sources/ewol/widget/Image.h index 07d0bbc9..5369b2ef 100644 --- a/sources/ewol/widget/Image.h +++ b/sources/ewol/widget/Image.h @@ -28,17 +28,17 @@ namespace widget { // Derived function virtual bool CalculateMinSize(void); void SetFile(etk::UString newFile); - void SetPadding(etk::Vector2D newPadding); + void SetPadding(vec2 newPadding); private: etk::UString m_imageSelected; - etk::Vector2D m_padding; + vec2 m_padding; draw::Color m_textColorBg; //!< Background color int32_t m_imageSize; public: // Derived function virtual void OnRegenerateDisplay(void); // Derived function - virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos); + virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos); }; }; diff --git a/sources/ewol/widget/Joystick.cpp b/sources/ewol/widget/Joystick.cpp index 435b235a..4e9b8a4c 100644 --- a/sources/ewol/widget/Joystick.cpp +++ b/sources/ewol/widget/Joystick.cpp @@ -121,13 +121,13 @@ Sine Function: sin(teta) = Opposite / Hypotenuse Cosine Function: cos(teta) = Adjacent / Hypotenuse Tangent Function: tan(teta) = Opposite / Adjacent */ -bool widget::Joystick::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos) +bool widget::Joystick::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos) { if (1 == IdInput) { if( ewol::keyEvent::statusDown == typeEvent || ewol::keyEvent::statusMove == typeEvent) { // get local relative position - etk::Vector2D relativePos = RelativePosition(pos); + vec2 relativePos = RelativePosition(pos); float sizeElement = m_size.x*m_ratio; // Calculate the position of the cursor... m_displayPos.x = (relativePos.x-sizeElement)/(m_size.x-sizeElement*2)*2.0 - 1.0; diff --git a/sources/ewol/widget/Joystick.h b/sources/ewol/widget/Joystick.h index 96cedf4f..ca4dd28c 100644 --- a/sources/ewol/widget/Joystick.h +++ b/sources/ewol/widget/Joystick.h @@ -28,7 +28,7 @@ namespace widget { private: draw::Color m_colorFg; //!< Forground color draw::Color m_colorBg; //!< Background color - etk::Vector2D m_displayPos; //!< direction of the cursor ... + vec2 m_displayPos; //!< direction of the cursor ... float m_distance; //!< dintance from the center float m_angle; //!< angle of the arraw (if < 0 : No arraw...) 0 is the TOP ... bool m_lock; //!< flag to mark the lock when the cursor is free when we are outside the circle @@ -49,7 +49,7 @@ namespace widget { // Derived function virtual void OnRegenerateDisplay(void); // Derived function - virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos); + virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos); void SetLockMode(bool lockWhenOut) { m_lock = lockWhenOut; }; void SetDisplayMode(joystickMode_te newMode) { m_displayMode = newMode; }; /** diff --git a/sources/ewol/widget/Label.cpp b/sources/ewol/widget/Label.cpp index 79f7810d..4448833f 100644 --- a/sources/ewol/widget/Label.cpp +++ b/sources/ewol/widget/Label.cpp @@ -48,7 +48,7 @@ widget::Label::~Label(void) bool widget::Label::CalculateMinSize(void) { - etk::Vector3D minSize = m_oObjectText.CalculateSize(m_label); + ivec3 minSize = m_oObjectText.CalculateSize(m_label); m_minSize.x = 3 + minSize.x; m_minSize.y = 3 + minSize.y; return true; @@ -86,14 +86,14 @@ void widget::Label::OnRegenerateDisplay(void) tmpOriginY += paddingSize; - etk::Vector3D textPos(tmpOriginX, tmpOriginY, 0); + vec3 textPos(tmpOriginX, tmpOriginY, 0); m_oObjectText.SetPos(textPos); m_oObjectText.Print(m_label); } } -bool widget::Label::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos) +bool widget::Label::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos) { //EWOL_DEBUG("Event on Label ..."); if (1 == IdInput) { diff --git a/sources/ewol/widget/Label.h b/sources/ewol/widget/Label.h index 11c0059e..aef7bd03 100644 --- a/sources/ewol/widget/Label.h +++ b/sources/ewol/widget/Label.h @@ -39,7 +39,7 @@ namespace widget { // Derived function virtual void OnDraw(ewol::DrawProperty& displayProp); // Derived function - virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos); + virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos); }; }; diff --git a/sources/ewol/widget/Layer.cpp b/sources/ewol/widget/Layer.cpp index 31d126c7..ad895693 100644 --- a/sources/ewol/widget/Layer.cpp +++ b/sources/ewol/widget/Layer.cpp @@ -57,7 +57,7 @@ bool widget::Layer::CalculateMinSize(void) if (true == m_subWidget[iii]->CanExpentY()) { m_userExpend.y = true; } - etk::Vector2D tmpSize = m_subWidget[iii]->GetMinSize(); + vec2 tmpSize = m_subWidget[iii]->GetMinSize(); m_minSize.x = etk_max(tmpSize.x, m_minSize.x); m_minSize.y = etk_max(tmpSize.y, m_minSize.y); } @@ -174,13 +174,13 @@ void widget::Layer::OnRegenerateDisplay(void) } -ewol::Widget * widget::Layer::GetWidgetAtPos(etk::Vector2D pos) +ewol::Widget * widget::Layer::GetWidgetAtPos(vec2 pos) { // for all element in the sizer ... for (int32_t iii=0; iii tmpSize = m_subWidget[iii]->GetSize(); - etk::Vector2D tmpOrigin = m_subWidget[iii]->GetOrigin(); + vec2 tmpSize = m_subWidget[iii]->GetSize(); + vec2 tmpOrigin = m_subWidget[iii]->GetOrigin(); if( (tmpOrigin.x <= pos.x && tmpOrigin.x + tmpSize.x >= pos.x) && (tmpOrigin.y <= pos.y && tmpOrigin.y + tmpSize.y >= pos.y) ) { diff --git a/sources/ewol/widget/Layer.h b/sources/ewol/widget/Layer.h index 56b9137e..5a3f86bd 100644 --- a/sources/ewol/widget/Layer.h +++ b/sources/ewol/widget/Layer.h @@ -47,7 +47,7 @@ namespace widget { // Derived function virtual void OnRegenerateDisplay(void); // Derived function - virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D pos); + virtual ewol::Widget * GetWidgetAtPos(vec2 pos); // Derived function virtual void OnObjectRemove(ewol::EObject * removeObject); }; diff --git a/sources/ewol/widget/List.cpp b/sources/ewol/widget/List.cpp index 33da5329..4847c486 100644 --- a/sources/ewol/widget/List.cpp +++ b/sources/ewol/widget/List.cpp @@ -126,8 +126,8 @@ void widget::List::OnRegenerateDisplay(void) ewol::Drawing * BGOObjects = new ewol::Drawing(); draw::Color basicBG = GetBasicBG(); BGOObjects->SetColor(basicBG); - BGOObjects->SetPos(etk::Vector3D(0, 0, 0) ); - BGOObjects->RectangleWidth(etk::Vector3D(m_size.x, m_size.y, 0) ); + BGOObjects->SetPos(vec3(0, 0, 0) ); + BGOObjects->RectangleWidth(vec3(m_size.x, m_size.y, 0) ); int32_t startRaw = m_originScrooled.y / (minHeight + 2*m_paddingSizeY); @@ -150,7 +150,7 @@ void widget::List::OnRegenerateDisplay(void) m_lineSize.Clear(); int32_t displayPositionY = m_size.y; int32_t displayPositionX = 0; - etk::Vector2D tmpRegister(startRaw, displayPositionY); + ivec2 tmpRegister(startRaw, displayPositionY); // add the default position raw : m_lineSize.PushBack(tmpRegister); @@ -170,15 +170,15 @@ void widget::List::OnRegenerateDisplay(void) displayPositionY-=(tmpFontHeight+m_paddingSizeY); BGOObjects->SetColor(bg); - BGOObjects->SetPos(etk::Vector3D(displayPositionX, displayPositionY, 0) ); - BGOObjects->RectangleWidth(etk::Vector3D(m_size.x-displayPositionX, tmpFontHeight+2*m_paddingSizeY, 0)); + BGOObjects->SetPos(vec3(displayPositionX, displayPositionY, 0) ); + BGOObjects->RectangleWidth(vec3(m_size.x-displayPositionX, tmpFontHeight+2*m_paddingSizeY, 0)); // get the maximum size of the colomn : - etk::Vector3D textSize = tmpText->CalculateSize(myTextToWrite); + vec3 textSize = tmpText->CalculateSize(myTextToWrite); sizeColom = etk_max(sizeColom, textSize.x); tmpText->SetColor(fg); - tmpText->SetPos(etk::Vector3D(tmpOriginX + displayPositionX, displayPositionY, 0) ); + tmpText->SetPos(vec3(tmpOriginX + displayPositionX, displayPositionY, 0) ); tmpText->Print(myTextToWrite); AddOObject(tmpText); // madding move ... @@ -202,9 +202,9 @@ void widget::List::OnRegenerateDisplay(void) } } -bool widget::List::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos) +bool widget::List::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos) { - etk::Vector2D relativePos = RelativePosition(pos); + vec2 relativePos = RelativePosition(pos); if (true == WidgetScrooled::OnEventInput(type, IdInput, typeEvent, pos)) { ewol::widgetManager::FocusKeep(this); diff --git a/sources/ewol/widget/List.h b/sources/ewol/widget/List.h index d24813dd..178dff01 100644 --- a/sources/ewol/widget/List.h +++ b/sources/ewol/widget/List.h @@ -29,7 +29,7 @@ namespace widget { // Drawing capabilities .... private: etk::Vector m_listOObject; //!< generic element to display... - etk::Vector > m_lineSize; + etk::Vector m_lineSize; public: void AddOObject(ewol::Compositing* newObject, int32_t pos=-1); void ClearOObjectList(void); @@ -46,7 +46,7 @@ namespace widget { // Derived function virtual void OnRegenerateDisplay(void); // Derived function - virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos); + virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos); protected: // function call to display the list : virtual draw::Color GetBasicBG(void) { diff --git a/sources/ewol/widget/Menu.cpp b/sources/ewol/widget/Menu.cpp index 40e6eeb1..4e6d4933 100644 --- a/sources/ewol/widget/Menu.cpp +++ b/sources/ewol/widget/Menu.cpp @@ -146,11 +146,11 @@ void widget::Menu::OnReceiveMessage(ewol::EObject * CallerObject, const char * e return; } // Get the button widget : - etk::Vector2D newPosition; + vec2 newPosition; ewol::Widget * eventFromWidget = static_cast(CallerObject); if (NULL != eventFromWidget) { - etk::Vector2D tmpOri = eventFromWidget->GetOrigin(); - etk::Vector2D tmpSize = eventFromWidget->GetSize(); + vec2 tmpOri = eventFromWidget->GetOrigin(); + vec2 tmpSize = eventFromWidget->GetSize(); // calculate the correct position newPosition.x = tmpOri.x + tmpSize.x/2; newPosition.y = tmpOri.y; diff --git a/sources/ewol/widget/PopUp.cpp b/sources/ewol/widget/PopUp.cpp index a8addc71..c19ace3b 100644 --- a/sources/ewol/widget/PopUp.cpp +++ b/sources/ewol/widget/PopUp.cpp @@ -44,8 +44,8 @@ bool widget::PopUp::CalculateSize(float availlableX, float availlableY) m_size.y = availlableY; if (NULL != m_subWidget) { - etk::Vector2D subWidgetSize; - etk::Vector2D subWidgetOrigin; + vec2 subWidgetSize; + vec2 subWidgetOrigin; subWidgetSize = m_subWidget->GetMinSize(); if (true == m_subWidget->CanExpentX()) { subWidgetSize.x = m_size.x; @@ -81,7 +81,7 @@ bool widget::PopUp::CalculateMinSize(void) m_minSize.y = 50.0; if (NULL != m_subWidget) { m_subWidget->CalculateMinSize(); - etk::Vector2D tmpSize = m_subWidget->GetMinSize(); + vec2 tmpSize = m_subWidget->GetMinSize(); m_minSize.x = tmpSize.x; m_minSize.y = tmpSize.y; } @@ -149,18 +149,18 @@ void widget::PopUp::OnRegenerateDisplay(void) AddOObject(BGOObjects); BGOObjects->SetColor(m_colorEmptyArea); - BGOObjects->SetPos(etk::Vector3D(0,0,0)); - BGOObjects->RectangleWidth(etk::Vector3D(m_size.x, m_size.y, 0)); + BGOObjects->SetPos(vec3(0,0,0)); + BGOObjects->RectangleWidth(vec3(m_size.x, m_size.y, 0)); // set the area in white ... if (NULL != m_subWidget) { - etk::Vector2D tmpSize = m_subWidget->GetSize(); - etk::Vector2D tmpOrigin = m_subWidget->GetOrigin(); + vec2 tmpSize = m_subWidget->GetSize(); + vec2 tmpOrigin = m_subWidget->GetOrigin(); BGOObjects->SetColor(m_colorBorder); - BGOObjects->SetPos(etk::Vector3D(tmpOrigin.x-BORDER_SIZE_TMP, tmpOrigin.y-BORDER_SIZE_TMP,0) ); - BGOObjects->RectangleWidth(etk::Vector3D(tmpSize.x+2*BORDER_SIZE_TMP, tmpSize.y+2*BORDER_SIZE_TMP, 0) ); + BGOObjects->SetPos(vec3(tmpOrigin.x-BORDER_SIZE_TMP, tmpOrigin.y-BORDER_SIZE_TMP,0) ); + BGOObjects->RectangleWidth(vec3(tmpSize.x+2*BORDER_SIZE_TMP, tmpSize.y+2*BORDER_SIZE_TMP, 0) ); BGOObjects->SetColor(m_colorBackGroung); - BGOObjects->SetPos(etk::Vector3D(tmpOrigin.x, tmpOrigin.y,0) ); - BGOObjects->RectangleWidth(etk::Vector3D(tmpSize.x, tmpSize.y, 0) ); + BGOObjects->SetPos(vec3(tmpOrigin.x, tmpOrigin.y,0) ); + BGOObjects->RectangleWidth(vec3(tmpSize.x, tmpSize.y, 0) ); } if (NULL != m_subWidget) { m_subWidget->OnRegenerateDisplay(); @@ -168,14 +168,14 @@ void widget::PopUp::OnRegenerateDisplay(void) } -ewol::Widget * widget::PopUp::GetWidgetAtPos(etk::Vector2D pos) +ewol::Widget * widget::PopUp::GetWidgetAtPos(vec2 pos) { // calculate relative position - etk::Vector2D relativePos = RelativePosition(pos); + vec2 relativePos = RelativePosition(pos); // for the element in the pop-up ... if (NULL != m_subWidget) { - etk::Vector2D tmpSize = m_subWidget->GetSize(); - etk::Vector2D tmpOrigin = m_subWidget->GetOrigin(); + vec2 tmpSize = m_subWidget->GetSize(); + vec2 tmpOrigin = m_subWidget->GetOrigin(); if( (tmpOrigin.x <= relativePos.x && tmpOrigin.x + tmpSize.x >= relativePos.x) && (tmpOrigin.y <= relativePos.y && tmpOrigin.y + tmpSize.y >= relativePos.y) ) { diff --git a/sources/ewol/widget/PopUp.h b/sources/ewol/widget/PopUp.h index c872e785..1d996c98 100644 --- a/sources/ewol/widget/PopUp.h +++ b/sources/ewol/widget/PopUp.h @@ -52,7 +52,7 @@ namespace widget { // Derived function virtual void OnRegenerateDisplay(void); // Derived function - virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D pos); + virtual ewol::Widget * GetWidgetAtPos(vec2 pos); // Derived function virtual void OnObjectRemove(ewol::EObject * removeObject); }; diff --git a/sources/ewol/widget/ProgressBar.cpp b/sources/ewol/widget/ProgressBar.cpp index 5c6c77f6..19563467 100644 --- a/sources/ewol/widget/ProgressBar.cpp +++ b/sources/ewol/widget/ProgressBar.cpp @@ -72,11 +72,11 @@ void widget::ProgressBar::OnRegenerateDisplay(void) int32_t tmpOriginX = 5; int32_t tmpOriginY = 5; tmpDraw->SetColor(m_textColorBgOn); - tmpDraw->SetPos(etk::Vector3D(tmpOriginX, tmpOriginY, 0) ); - tmpDraw->RectangleWidth(etk::Vector3D(tmpSizeX*m_value, tmpSizeY, 0) ); + tmpDraw->SetPos(vec3(tmpOriginX, tmpOriginY, 0) ); + tmpDraw->RectangleWidth(vec3(tmpSizeX*m_value, tmpSizeY, 0) ); tmpDraw->SetColor(m_textColorBgOff); - tmpDraw->SetPos(etk::Vector3D(tmpOriginX+tmpSizeX*m_value, tmpOriginY, 0) ); - tmpDraw->RectangleWidth(etk::Vector3D(tmpSizeX*(1.0-m_value), tmpSizeY, 0) ); + tmpDraw->SetPos(vec3(tmpOriginX+tmpSizeX*m_value, tmpOriginY, 0) ); + tmpDraw->RectangleWidth(vec3(tmpSizeX*(1.0-m_value), tmpSizeY, 0) ); // TODO : Create a better progress Bar ... //tmpDraw->SetColor(m_textColorFg); diff --git a/sources/ewol/widget/Scene.cpp b/sources/ewol/widget/Scene.cpp index 3862c498..aeebbb5d 100644 --- a/sources/ewol/widget/Scene.cpp +++ b/sources/ewol/widget/Scene.cpp @@ -126,7 +126,7 @@ void widget::Scene::GenDraw(DrawProperty displayProp) float ratio = m_size.x / m_size.y; m_zoom = 1.0/1000.0; //EWOL_INFO("ratio : " << ratio); - etk::Matrix4 tmpProjection; + mat4 tmpProjection; if (ratio >= 1.0) { tmpProjection = etk::matrix::Perspective(-ratio, ratio, -1, 1, -1, 1); @@ -134,8 +134,8 @@ void widget::Scene::GenDraw(DrawProperty displayProp) ratio = 1.0/ratio; tmpProjection = etk::matrix::Perspective(-1, 1, -ratio, ratio, -1, 1); } - etk::Matrix4 tmpScale = etk::matrix::Scale(m_zoom, m_zoom, m_zoom); - etk::Matrix4 tmpMat = tmpProjection * tmpScale; + mat4 tmpScale = etk::matrix::Scale(m_zoom, m_zoom, m_zoom); + mat4 tmpMat = tmpProjection * tmpScale; // set internal matrix system : ewol::openGL::SetMatrix(tmpMat); // Clear the screen with transparency ... @@ -148,7 +148,7 @@ void widget::Scene::GenDraw(DrawProperty displayProp) } -etk::Vector2D widget::Scene::RelativePosition(etk::Vector2D pos) +vec2 widget::Scene::RelativePosition(vec2 pos) { // Remove origin of the widget pos.x -= m_origin.x; diff --git a/sources/ewol/widget/Scene.h b/sources/ewol/widget/Scene.h index aee87382..46780463 100644 --- a/sources/ewol/widget/Scene.h +++ b/sources/ewol/widget/Scene.h @@ -71,8 +71,8 @@ namespace widget { virtual void ScenePeriodicCall(int64_t localTime, int32_t deltaTime) { }; // camera properties : private: - etk::Vector3D m_camRotation; - etk::Vector3D m_camTranslation; + vec3 m_camRotation; + vec3 m_camTranslation; float m_camAngleView; float m_camdistanceViewStart; float m_camdistanceViewStop; @@ -88,7 +88,7 @@ namespace widget { * @param[in] pos Absolute position that you request convertion * @return the relative position */ - virtual etk::Vector2D RelativePosition(etk::Vector2D pos); + virtual vec2 RelativePosition(vec2 pos); }; }; diff --git a/sources/ewol/widget/SizerHori.cpp b/sources/ewol/widget/SizerHori.cpp index ed7c1650..39bc9f91 100644 --- a/sources/ewol/widget/SizerHori.cpp +++ b/sources/ewol/widget/SizerHori.cpp @@ -35,7 +35,7 @@ bool widget::SizerHori::CalculateSize(float availlableX, float availlableY) int32_t nbWidgetNotFixedSize=0; for (int32_t iii=0; iii tmpSize = m_subWidget[iii]->GetMinSize(); + vec2 tmpSize = m_subWidget[iii]->GetMinSize(); unexpendableSize += tmpSize.x; if (false == m_subWidget[iii]->CanExpentX()) { nbWidgetFixedSize++; @@ -52,12 +52,12 @@ bool widget::SizerHori::CalculateSize(float availlableX, float availlableY) sizeToAddAtEveryOne=0; } } - etk::Vector2D tmpOrigin; + vec2 tmpOrigin; tmpOrigin.x = m_origin.x; tmpOrigin.y = m_origin.y; for (int32_t iii=0; iii tmpSize = m_subWidget[iii]->GetMinSize(); + vec2 tmpSize = m_subWidget[iii]->GetMinSize(); // Set the origin : //EWOL_DEBUG("Set ORIGIN : " << tmpOrigin.x << "," << tmpOrigin.y << ")"); m_subWidget[iii]->SetOrigin(tmpOrigin.x, tmpOrigin.y); @@ -92,7 +92,7 @@ bool widget::SizerHori::CalculateMinSize(void) if (true == m_subWidget[iii]->CanExpentY()) { m_userExpend.y = true; } - etk::Vector2D tmpSize = m_subWidget[iii]->GetMinSize(); + vec2 tmpSize = m_subWidget[iii]->GetMinSize(); m_minSize.x += tmpSize.x; if (tmpSize.y>m_minSize.y) { m_minSize.y = tmpSize.y; @@ -216,7 +216,7 @@ void widget::SizerHori::OnRegenerateDisplay(void) } -ewol::Widget * widget::SizerHori::GetWidgetAtPos(etk::Vector2D pos) +ewol::Widget * widget::SizerHori::GetWidgetAtPos(vec2 pos) { if (true == IsHide()) { return NULL; @@ -224,8 +224,8 @@ ewol::Widget * widget::SizerHori::GetWidgetAtPos(etk::Vector2D pos) // for all element in the sizer ... for (int32_t iii=0; iii tmpSize = m_subWidget[iii]->GetSize(); - etk::Vector2D tmpOrigin = m_subWidget[iii]->GetOrigin(); + vec2 tmpSize = m_subWidget[iii]->GetSize(); + vec2 tmpOrigin = m_subWidget[iii]->GetOrigin(); if( (tmpOrigin.x <= pos.x && tmpOrigin.x + tmpSize.x >= pos.x) && (tmpOrigin.y <= pos.y && tmpOrigin.y + tmpSize.y >= pos.y) ) { diff --git a/sources/ewol/widget/SizerHori.h b/sources/ewol/widget/SizerHori.h index 2b3cb1d9..93974a47 100644 --- a/sources/ewol/widget/SizerHori.h +++ b/sources/ewol/widget/SizerHori.h @@ -35,7 +35,7 @@ namespace widget { // Derived function virtual void OnRegenerateDisplay(void); // Derived function - virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D pos); + virtual ewol::Widget * GetWidgetAtPos(vec2 pos); // Derived function virtual void OnObjectRemove(ewol::EObject * removeObject); // Derived function diff --git a/sources/ewol/widget/SizerVert.cpp b/sources/ewol/widget/SizerVert.cpp index 03aa0ae9..9cd35ba6 100644 --- a/sources/ewol/widget/SizerVert.cpp +++ b/sources/ewol/widget/SizerVert.cpp @@ -37,7 +37,7 @@ bool widget::SizerVert::CalculateSize(float availlableX, float availlableY) int32_t nbWidgetNotFixedSize=0; for (int32_t iii=0; iii tmpSize = m_subWidget[iii]->GetMinSize(); + vec2 tmpSize = m_subWidget[iii]->GetMinSize(); unexpendableSize += tmpSize.y; if (false == m_subWidget[iii]->CanExpentY()) { nbWidgetFixedSize++; @@ -55,12 +55,12 @@ bool widget::SizerVert::CalculateSize(float availlableX, float availlableY) sizeToAddAtEveryOne=0; } } - etk::Vector2D tmpOrigin; + vec2 tmpOrigin; tmpOrigin.x = m_origin.x; tmpOrigin.y = m_origin.y; for (int32_t iii=0; iii tmpSize = m_subWidget[iii]->GetMinSize(); + vec2 tmpSize = m_subWidget[iii]->GetMinSize(); // Set the origin : //EWOL_DEBUG("Set ORIGIN : " << tmpOrigin.x << "," << tmpOrigin.y << ")"); m_subWidget[iii]->SetOrigin(tmpOrigin.x, tmpOrigin.y); @@ -95,7 +95,7 @@ bool widget::SizerVert::CalculateMinSize(void) if (true == m_subWidget[iii]->CanExpentY()) { m_userExpend.y = true; } - etk::Vector2D tmpSize = m_subWidget[iii]->GetMinSize(); + vec2 tmpSize = m_subWidget[iii]->GetMinSize(); //EWOL_DEBUG(" Get minSize[" << iii << "] ("<< tmpSize.x << "," << tmpSize.y << ")"); m_minSize.y += tmpSize.y; if (tmpSize.x>m_minSize.x) { @@ -219,7 +219,7 @@ void widget::SizerVert::OnRegenerateDisplay(void) } -ewol::Widget * widget::SizerVert::GetWidgetAtPos(etk::Vector2D pos) +ewol::Widget * widget::SizerVert::GetWidgetAtPos(vec2 pos) { if (true == IsHide()) { return NULL; @@ -227,8 +227,8 @@ ewol::Widget * widget::SizerVert::GetWidgetAtPos(etk::Vector2D pos) // for all element in the sizer ... for (int32_t iii=0; iii tmpSize = m_subWidget[iii]->GetSize(); - etk::Vector2D tmpOrigin = m_subWidget[iii]->GetOrigin(); + vec2 tmpSize = m_subWidget[iii]->GetSize(); + vec2 tmpOrigin = m_subWidget[iii]->GetOrigin(); if( (tmpOrigin.x <= pos.x && tmpOrigin.x + tmpSize.x >= pos.x) && (tmpOrigin.y <= pos.y && tmpOrigin.y + tmpSize.y >= pos.y) ) { diff --git a/sources/ewol/widget/SizerVert.h b/sources/ewol/widget/SizerVert.h index b8b7025a..afa97497 100644 --- a/sources/ewol/widget/SizerVert.h +++ b/sources/ewol/widget/SizerVert.h @@ -35,7 +35,7 @@ namespace widget { // Derived function virtual void OnRegenerateDisplay(void); // Derived function - virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D pos); + virtual ewol::Widget * GetWidgetAtPos(vec2 pos); // Derived function virtual void OnObjectRemove(ewol::EObject * removeObject); // Derived function diff --git a/sources/ewol/widget/Slider.cpp b/sources/ewol/widget/Slider.cpp index c5696484..5002bf32 100644 --- a/sources/ewol/widget/Slider.cpp +++ b/sources/ewol/widget/Slider.cpp @@ -93,13 +93,13 @@ void widget::Slider::OnRegenerateDisplay(void) tmpDraw->SetColor(m_textColorFg); // draw a line : tmpDraw->SetThickness(1); - tmpDraw->SetPos(etk::Vector3D(dotRadius, m_size.y/2) ); - tmpDraw->LineTo(etk::Vector3D(m_size.x-dotRadius, m_size.y/2) ); + tmpDraw->SetPos(vec3(dotRadius, m_size.y/2) ); + tmpDraw->LineTo(vec3(m_size.x-dotRadius, m_size.y/2) ); tmpDraw->SetThickness(0); draw::Color borderDot = m_textColorFg; borderDot.a /= 2; - tmpDraw->SetPos(etk::Vector3D(4+((float)(m_value-m_min)/(float)(m_max-m_min))*(float)(m_size.x-2*dotRadius), m_size.y/2) ); + tmpDraw->SetPos(vec3(4+((float)(m_value-m_min)/(float)(m_max-m_min))*(float)(m_size.x-2*dotRadius), m_size.y/2) ); tmpDraw->SetColorBg(borderDot); tmpDraw->Circle(dotRadius); tmpDraw->SetColorBg(m_textColorFg); @@ -109,9 +109,9 @@ void widget::Slider::OnRegenerateDisplay(void) } -bool widget::Slider::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos) +bool widget::Slider::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos) { - etk::Vector2D relativePos = RelativePosition(pos); + vec2 relativePos = RelativePosition(pos); //EWOL_DEBUG("Event on Slider ..."); if (1 == IdInput) { if( ewol::keyEvent::statusSingle == typeEvent diff --git a/sources/ewol/widget/Slider.h b/sources/ewol/widget/Slider.h index 43b0fa6c..00e95201 100644 --- a/sources/ewol/widget/Slider.h +++ b/sources/ewol/widget/Slider.h @@ -41,7 +41,7 @@ namespace widget { // Derived function virtual void OnRegenerateDisplay(void); // Derived function - virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos); + virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos); }; }; diff --git a/sources/ewol/widget/Spacer.cpp b/sources/ewol/widget/Spacer.cpp index 4dc18262..10e7ac42 100644 --- a/sources/ewol/widget/Spacer.cpp +++ b/sources/ewol/widget/Spacer.cpp @@ -63,7 +63,7 @@ void widget::Spacer::OnRegenerateDisplay(void) return; } m_draw.SetColor(m_color); - m_draw.SetPos(etk::Vector3D(0, 0, 0) ); - m_draw.RectangleWidth(etk::Vector3D(m_size.x, m_size.y) ); + m_draw.SetPos(vec3(0, 0, 0) ); + m_draw.RectangleWidth(vec3(m_size.x, m_size.y) ); } diff --git a/sources/ewol/widget/Spacer.h b/sources/ewol/widget/Spacer.h index d33fab14..9927b804 100644 --- a/sources/ewol/widget/Spacer.h +++ b/sources/ewol/widget/Spacer.h @@ -47,7 +47,7 @@ namespace widget { // Derived function virtual bool CalculateMinSize(void); // Derived function - virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D pos) { return NULL; }; + virtual ewol::Widget * GetWidgetAtPos(vec2 pos) { return NULL; }; // Derived function virtual void OnRegenerateDisplay(void); // Derived function diff --git a/sources/ewol/widget/WSlider.cpp b/sources/ewol/widget/WSlider.cpp index b2585085..07bf99d2 100644 --- a/sources/ewol/widget/WSlider.cpp +++ b/sources/ewol/widget/WSlider.cpp @@ -83,7 +83,7 @@ bool widget::WSlider::CalculateMinSize(void) if (true == m_subWidget[iii]->CanExpentY()) { m_underExpend.y = true; } - etk::Vector2D tmpSize = m_subWidget[iii]->GetMinSize(); + vec2 tmpSize = m_subWidget[iii]->GetMinSize(); m_minSize.x = etk_max(tmpSize.x, m_minSize.x); m_minSize.y = etk_max(tmpSize.y, m_minSize.y); } @@ -268,7 +268,7 @@ void widget::WSlider::OnRegenerateDisplay(void) } -ewol::Widget * widget::WSlider::GetWidgetAtPos(etk::Vector2D pos) +ewol::Widget * widget::WSlider::GetWidgetAtPos(vec2 pos) { // TODO : Review this ... if (m_windowsDestination<0 || m_windowsDestination > m_subWidget.Size()) { @@ -278,8 +278,8 @@ ewol::Widget * widget::WSlider::GetWidgetAtPos(etk::Vector2D pos) int32_t iii = m_windowsDestination; if (NULL != m_subWidget[iii]) { - etk::Vector2D tmpSize = m_subWidget[iii]->GetSize(); - etk::Vector2D tmpOrigin = m_subWidget[iii]->GetOrigin(); + vec2 tmpSize = m_subWidget[iii]->GetSize(); + vec2 tmpOrigin = m_subWidget[iii]->GetOrigin(); if( (tmpOrigin.x <= pos.x && tmpOrigin.x + tmpSize.x >= pos.x) && (tmpOrigin.y <= pos.y && tmpOrigin.y + tmpSize.y >= pos.y) ) { diff --git a/sources/ewol/widget/WSlider.h b/sources/ewol/widget/WSlider.h index c1b66b07..e4ac1c0a 100644 --- a/sources/ewol/widget/WSlider.h +++ b/sources/ewol/widget/WSlider.h @@ -22,7 +22,7 @@ namespace widget { // Derived function virtual const char * const GetObjectType(void) { return "EwolWSlider"; }; private: - etk::Vector2D m_underExpend; // expend of the uner elements ... + bvec2 m_underExpend; // expend of the uner elements ... public: // Derived function virtual bool CalculateSize(float availlableX, float availlableY); @@ -56,7 +56,7 @@ namespace widget { // Derived function virtual void OnRegenerateDisplay(void); // Derived function - virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D pos); + virtual ewol::Widget * GetWidgetAtPos(vec2 pos); // Derived function virtual void OnObjectRemove(ewol::EObject * removeObject); // Derived function diff --git a/sources/ewol/widget/Widget.cpp b/sources/ewol/widget/Widget.cpp index da16c51a..92217ed6 100644 --- a/sources/ewol/widget/Widget.cpp +++ b/sources/ewol/widget/Widget.cpp @@ -136,10 +136,10 @@ void ewol::Widget::GenDraw(DrawProperty displayProp) tmpOriginY, tmpclipX, m_size.y); - etk::Matrix4 tmpTranslate = etk::Matrix4::Translate(etk::Vector3D((float)(-tmpclipX/2 - (tmpOriginX-m_origin.x)), (float)(-m_size.y/2.0), -1.0f)); - etk::Matrix4 tmpScale = etk::Matrix4::Scale(etk::Vector3D(m_zoom, m_zoom, 1.0f)); - etk::Matrix4 tmpProjection = etk::Matrix4::Perspective(-tmpclipX/2, tmpclipX/2, -m_size.y/2, m_size.y/2, -1, 1); - etk::Matrix4 tmpMat = tmpProjection * tmpScale * tmpTranslate; + mat4 tmpTranslate = etk::Matrix4::Translate(vec3((float)(-tmpclipX/2 - (tmpOriginX-m_origin.x)), (float)(-m_size.y/2.0), -1.0f)); + mat4 tmpScale = etk::Matrix4::Scale(vec3(m_zoom, m_zoom, 1.0f)); + mat4 tmpProjection = etk::Matrix4::Perspective(-tmpclipX/2, tmpclipX/2, -m_size.y/2, m_size.y/2, -1, 1); + mat4 tmpMat = tmpProjection * tmpScale * tmpTranslate; // set internal matrix system : ewol::openGL::SetMatrix(tmpMat); // Call the widget drawing methode @@ -153,10 +153,10 @@ void ewol::Widget::GenDraw(DrawProperty displayProp) m_origin.y, m_size.x, m_size.y); - etk::Matrix4 tmpTranslate = etk::Matrix4::Translate(etk::Vector3D(-m_size.x/2, -m_size.y/2, -1.0f)); - etk::Matrix4 tmpScale = etk::Matrix4::Scale(etk::Vector3D(m_zoom, m_zoom, 1.0f)); - etk::Matrix4 tmpProjection = etk::Matrix4::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1); - etk::Matrix4 tmpMat = tmpProjection * tmpScale * tmpTranslate; + mat4 tmpTranslate = etk::Matrix4::Translate(vec3(-m_size.x/2, -m_size.y/2, -1.0f)); + mat4 tmpScale = etk::Matrix4::Scale(vec3(m_zoom, m_zoom, 1.0f)); + mat4 tmpProjection = etk::Matrix4::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1); + mat4 tmpMat = tmpProjection * tmpScale * tmpTranslate; // set internal matrix system : ewol::openGL::SetMatrix(tmpMat); // Call the widget drawing methode @@ -203,12 +203,12 @@ void ewol::Widget::SetOrigin(float x, float y) m_origin.y=y; } -etk::Vector2D ewol::Widget::GetOrigin(void) +vec2 ewol::Widget::GetOrigin(void) { return m_origin; } -etk::Vector2D ewol::Widget::RelativePosition(etk::Vector2D pos) +vec2 ewol::Widget::RelativePosition(vec2 pos) { pos.x -= m_origin.x; pos.y -= m_origin.y; @@ -229,20 +229,20 @@ void ewol::Widget::SetMinSize(float x, float y) m_userMinSize.y = y; } -etk::Vector2D ewol::Widget::GetMinSize(void) +vec2 ewol::Widget::GetMinSize(void) { if (false==IsHide()) { return m_minSize; } - return etk::Vector2D(0,0); + return vec2(0,0); } -etk::Vector2D ewol::Widget::GetSize(void) +vec2 ewol::Widget::GetSize(void) { if (false==IsHide()) { return m_size; } - return etk::Vector2D(0,0); + return vec2(0,0); } void ewol::Widget::SetExpendX(bool newExpend) diff --git a/sources/ewol/widget/Widget.h b/sources/ewol/widget/Widget.h index 1247acf3..eb572f68 100644 --- a/sources/ewol/widget/Widget.h +++ b/sources/ewol/widget/Widget.h @@ -24,9 +24,9 @@ namespace ewol { namespace ewol { class DrawProperty{ public : - etk::Vector2D m_windowsSize; - etk::Vector2D m_origin; - etk::Vector2D m_size; + ivec2 m_windowsSize; + ivec2 m_origin; + ivec2 m_size; }; @@ -84,13 +84,13 @@ namespace ewol { protected: // internal element calculated by the system float m_zoom; //!< generic widget zoom - etk::Vector2D m_origin; //!< internal ... I do not really known how i can use it ... - etk::Vector2D m_size; //!< internal : current size of the widget - etk::Vector2D m_minSize; //!< user define the minimum size of the widget + vec2 m_origin; //!< internal ... I do not really known how i can use it ... + vec2 m_size; //!< internal : current size of the widget + vec2 m_minSize; //!< user define the minimum size of the widget // user configuaration - etk::Vector2D m_userMinSize; //!< user define the minimum size of the widget - etk::Vector2D m_userExpend; - etk::Vector2D m_userFill; + vec2 m_userMinSize; //!< user define the minimum size of the widget + bvec2 m_userExpend; + bvec2 m_userFill; public: /** * @brief Set the zoom property of the widget @@ -117,13 +117,13 @@ namespace ewol { * @param --- * @return coordonate of the origin requested */ - etk::Vector2D GetOrigin(void); + vec2 GetOrigin(void); /** * @brief Convert the absolute position in the local Position (Relative) * @param[in] pos Absolute position that you request convertion * @return the relative position */ - virtual etk::Vector2D RelativePosition(etk::Vector2D pos); + virtual vec2 RelativePosition(vec2 pos); /** * @brief Parrent set the possible diplay size of the current widget whith his own possibilities * By default this save the widget availlable size in the widget size @@ -154,13 +154,13 @@ namespace ewol { * @param --- * @return re size requested */ - etk::Vector2D GetMinSize(void); + vec2 GetMinSize(void); /** * @brief Get the widget size * @param --- * @return Requested size */ - etk::Vector2D GetSize(void); + vec2 GetSize(void); /** * @brief Set the horizontal expend capacity * @param[in] newExpend new Expend state @@ -330,7 +330,7 @@ namespace ewol { * @return NULL No widget found * @return pointer on the widget found */ - virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D pos) { if (false==IsHide()) { return this; } return NULL; }; + virtual ewol::Widget * GetWidgetAtPos(vec2 pos) { if (false==IsHide()) { return this; } return NULL; }; /** * @brief Event on an input of this Widget * @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...) @@ -340,7 +340,7 @@ namespace ewol { * @return true the event is used * @return false the event is not used */ - virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos) { return false; }; + virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos) { return false; }; /** * @brief Event on the keybord (if no shortcut has been detected before). * @param[in] type of the event (ewol::EVENT_KB_TYPE_DOWN or ewol::EVENT_KB_TYPE_UP) diff --git a/sources/ewol/widget/WidgetScrolled.cpp b/sources/ewol/widget/WidgetScrolled.cpp index 7b43e73f..d1d7ffd4 100644 --- a/sources/ewol/widget/WidgetScrolled.cpp +++ b/sources/ewol/widget/WidgetScrolled.cpp @@ -52,36 +52,36 @@ void widget::WidgetScrooled::OnRegenerateDisplay(void) tmpDraw->SetThickness(1); if( m_size.y < m_maxSize.y || m_originScrooled.y!=0) { - tmpDraw->SetPos(etk::Vector3D(m_size.x-(SCROLL_BAR_SPACE/2), 0) ); - tmpDraw->LineTo(etk::Vector3D(m_size.x-(SCROLL_BAR_SPACE/2), m_size.y ) ); + tmpDraw->SetPos(vec3(m_size.x-(SCROLL_BAR_SPACE/2), 0) ); + tmpDraw->LineTo(vec3(m_size.x-(SCROLL_BAR_SPACE/2), m_size.y ) ); float lenScrollBar = m_size.y*m_size.y / m_maxSize.y; lenScrollBar = etk_avg(10, lenScrollBar, m_size.y); float originScrollBar = m_originScrooled.y / (m_maxSize.y-m_size.y*m_limitScrolling); originScrollBar = etk_avg(0.0, originScrollBar, 1.0); originScrollBar *= (m_size.y-lenScrollBar); - tmpDraw->SetPos(etk::Vector3D(m_size.x-SCROLL_BAR_SPACE, m_size.y - originScrollBar - lenScrollBar) ); - tmpDraw->RectangleWidth(etk::Vector3D(SCROLL_BAR_SPACE, lenScrollBar)); + tmpDraw->SetPos(vec3(m_size.x-SCROLL_BAR_SPACE, m_size.y - originScrollBar - lenScrollBar) ); + tmpDraw->RectangleWidth(vec3(SCROLL_BAR_SPACE, lenScrollBar)); } if( m_size.x < m_maxSize.x || m_originScrooled.x!=0) { - tmpDraw->SetPos(etk::Vector3D(0, (SCROLL_BAR_SPACE/2), 0) ); - tmpDraw->LineTo(etk::Vector3D(m_size.x-SCROLL_BAR_SPACE, (SCROLL_BAR_SPACE/2) ) ); + tmpDraw->SetPos(vec3(0, (SCROLL_BAR_SPACE/2), 0) ); + tmpDraw->LineTo(vec3(m_size.x-SCROLL_BAR_SPACE, (SCROLL_BAR_SPACE/2) ) ); float lenScrollBar = m_size.x*(m_size.x-SCROLL_BAR_SPACE) / m_maxSize.x; lenScrollBar = etk_avg(10, lenScrollBar, (m_size.x-SCROLL_BAR_SPACE)); float originScrollBar = m_originScrooled.x / (m_maxSize.x-m_size.x*m_limitScrolling); originScrollBar = etk_avg(0.0, originScrollBar, 1.0); originScrollBar *= (m_size.x-SCROLL_BAR_SPACE-lenScrollBar); - tmpDraw->SetPos(etk::Vector3D(originScrollBar, 0, 0) ); - tmpDraw->Rectangle(etk::Vector3D(lenScrollBar, SCROLL_BAR_SPACE) ); + tmpDraw->SetPos(vec3(originScrollBar, 0, 0) ); + tmpDraw->Rectangle(vec3(lenScrollBar, SCROLL_BAR_SPACE) ); } AddOObject(tmpDraw); } } -bool widget::WidgetScrooled::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos) +bool widget::WidgetScrooled::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos) { - etk::Vector2D relativePos = RelativePosition(pos); + vec2 relativePos = RelativePosition(pos); // corection due to the open Gl invertion ... relativePos.y = m_size.y - relativePos.y; if (SCROLL_MODE_NORMAL == m_scroollingMode) { @@ -351,10 +351,10 @@ void widget::WidgetScrooled::GenDraw(ewol::DrawProperty displayProp) m_origin.y, m_size.x, m_size.y); - etk::Matrix4 tmpProjection = etk::Matrix4::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1); - etk::Matrix4 tmpScale = etk::Matrix4::Scale(etk::Vector3D(m_zoom, m_zoom, 1.0) ); - etk::Matrix4 tmpTranslate = etk::Matrix4::Translate(etk::Vector3D(-m_maxSize.x/2, -m_maxSize.y/2, -1.0) ); - etk::Matrix4 tmpMat = tmpProjection * tmpScale * tmpTranslate; + mat4 tmpProjection = etk::Matrix4::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1); + mat4 tmpScale = etk::Matrix4::Scale(vec3(m_zoom, m_zoom, 1.0) ); + mat4 tmpTranslate = etk::Matrix4::Translate(vec3(-m_maxSize.x/2, -m_maxSize.y/2, -1.0) ); + mat4 tmpMat = tmpProjection * tmpScale * tmpTranslate; // set internal matrix system : ewol::openGL::SetMatrix(tmpMat); // Call the widget drawing methode @@ -366,9 +366,9 @@ void widget::WidgetScrooled::GenDraw(ewol::DrawProperty displayProp) m_size.x, m_size.y); - etk::Matrix4 tmpProjection = etk::Matrix4::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1); - etk::Matrix4 tmpTranslate = etk::Matrix4::Translate(etk::Vector3D( -m_maxSize.x/2, -m_maxSize.y/2, -1.0) ); - etk::Matrix4 tmpMat = tmpProjection * tmpTranslate; + mat4 tmpProjection = etk::Matrix4::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1); + mat4 tmpTranslate = etk::Matrix4::Translate(vec3( -m_maxSize.x/2, -m_maxSize.y/2, -1.0) ); + mat4 tmpMat = tmpProjection * tmpTranslate; // set internal matrix system : ewol::openGL::SetMatrix(tmpMat); // Call the widget drawing methode @@ -380,7 +380,7 @@ void widget::WidgetScrooled::GenDraw(ewol::DrawProperty displayProp) } -void widget::WidgetScrooled::SetScrollingPositionDynamic(etk::Vector2D borderWidth, etk::Vector2D currentPosition, bool center) +void widget::WidgetScrooled::SetScrollingPositionDynamic(vec2 borderWidth, vec2 currentPosition, bool center) { if (true == center) { borderWidth.x = m_size.x / 2 - borderWidth.x; diff --git a/sources/ewol/widget/WidgetScrolled.h b/sources/ewol/widget/WidgetScrolled.h index 94280256..0eb9de26 100644 --- a/sources/ewol/widget/WidgetScrolled.h +++ b/sources/ewol/widget/WidgetScrolled.h @@ -36,13 +36,13 @@ namespace widget { void AddOObject(ewol::Compositing* newObject, int32_t pos=-1); void ClearOObjectList(void); protected: - etk::Vector2D m_originScrooled; - etk::Vector2D m_maxSize; + vec2 m_originScrooled; + vec2 m_maxSize; float m_limitScrolling; private: scrollingMode_te m_scroollingMode; //!< mode of management of the scrooling float m_pixelScrolling; - etk::Vector2D m_highSpeedStartPos; + vec2 m_highSpeedStartPos; highSpeedMode_te m_highSpeedMode; int32_t m_highSpeedButton; ewol::keyEvent::type_te m_highSpeedType; @@ -56,7 +56,7 @@ namespace widget { // Derived function virtual void OnDraw(ewol::DrawProperty& displayProp); // Derived function - virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos); + virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos); // Derived function virtual void GenDraw(ewol::DrawProperty displayProp); protected: @@ -77,7 +77,7 @@ namespace widget { * @param[in] localSize new Maximum size * @return --- */ - void SetMaxSize(etk::Vector2D localSize) { m_maxSize = localSize; }; + void SetMaxSize(vec2 localSize) { m_maxSize = localSize; }; /** * @brief Request a specific position for the scrolling of the current windows. * @param[in] borderWidth Size of the border that requested the element might not to be @@ -85,7 +85,7 @@ namespace widget { * @param[in] center True if the position might be at the center of the widget * @return --- */ - void SetScrollingPositionDynamic(etk::Vector2D borderWidth, etk::Vector2D currentPosition, bool center = false); + void SetScrollingPositionDynamic(vec2 borderWidth, vec2 currentPosition, bool center = false); /** * @brief Set the scrolling limit when arriving at he end of the widget * @param[in] poucentageLimit pourcent of the limit of view nothing in the widget when arriving at the end ... diff --git a/sources/ewol/widget/Windows.cpp b/sources/ewol/widget/Windows.cpp index 167c7883..41f59309 100644 --- a/sources/ewol/widget/Windows.cpp +++ b/sources/ewol/widget/Windows.cpp @@ -71,10 +71,10 @@ bool ewol::Windows::CalculateSize(float availlableX, float availlableY) } -ewol::Widget * ewol::Windows::GetWidgetAtPos(etk::Vector2D pos) +ewol::Widget * ewol::Windows::GetWidgetAtPos(vec2 pos) { // calculate relative position - etk::Vector2D relativePos = RelativePosition(pos); + vec2 relativePos = RelativePosition(pos); // event go directly on the pop-up if (0 < m_popUpWidgetList.Size()) { if (NULL == m_popUpWidgetList[m_popUpWidgetList.Size()-1]) { @@ -101,7 +101,7 @@ void ewol::Windows::SysDraw(void) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // clear the matrix system : - etk::Matrix4 newOne; + mat4 newOne; ewol::openGL::SetBasicMatrix(newOne); ewol::DrawProperty displayProp; diff --git a/sources/ewol/widget/Windows.h b/sources/ewol/widget/Windows.h index d163af25..dd437155 100644 --- a/sources/ewol/widget/Windows.h +++ b/sources/ewol/widget/Windows.h @@ -38,7 +38,7 @@ namespace ewol { // Derived function virtual bool CalculateSize(float availlableX, float availlableY); // Derived function - virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D pos); + virtual ewol::Widget * GetWidgetAtPos(vec2 pos); private: bool m_hasDecoration; public: diff --git a/sources/ewol/widget/meta/ParameterList.cpp b/sources/ewol/widget/meta/ParameterList.cpp index 451989aa..23f1da40 100644 --- a/sources/ewol/widget/meta/ParameterList.cpp +++ b/sources/ewol/widget/meta/ParameterList.cpp @@ -141,8 +141,8 @@ void widget::ParameterList::OnRegenerateDisplay(void) // set background color : ewol::Drawing * tmpDraw = new ewol::Drawing(); tmpDraw->SetColor(0xFFFFFFFF); - tmpDraw->SetPos(etk::Vector3D(0,0,0) ); - tmpDraw->RectangleWidth(etk::Vector3D(m_size.x, m_size.y) ); + tmpDraw->SetPos(vec3(0,0,0) ); + tmpDraw->RectangleWidth(vec3(m_size.x, m_size.y) ); uint32_t displayableRaw = m_size.y / (minHeight + 2*m_paddingSizeY) +2; @@ -166,7 +166,7 @@ void widget::ParameterList::OnRegenerateDisplay(void) ewol::Text * tmpText = new ewol::Text(); - etk::Vector3D textPos; + vec3 textPos; textPos.x = (int32_t)tmpOriginX; if (m_list[iii]->m_group == false) { textPos.x += minHeight; @@ -186,7 +186,7 @@ void widget::ParameterList::OnRegenerateDisplay(void) } -bool widget::ParameterList::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos) +bool widget::ParameterList::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos) { if (true == WidgetScrooled::OnEventInput(type, IdInput, typeEvent, pos)) { ewol::widgetManager::FocusKeep(this); @@ -194,7 +194,7 @@ bool widget::ParameterList::OnEventInput(ewol::keyEvent::type_te type, int32_t I return true; } if (IdInput == 1 && typeEvent == ewol::keyEvent::statusSingle) { - etk::Vector2D relativePos = RelativePosition(pos); + vec2 relativePos = RelativePosition(pos); // corection for the openGl abstraction relativePos.y = m_size.y - relativePos.y; // TODO : Rework this ... diff --git a/sources/ewol/widget/meta/ParameterList.h b/sources/ewol/widget/meta/ParameterList.h index 4563cc1f..c4b2deea 100644 --- a/sources/ewol/widget/meta/ParameterList.h +++ b/sources/ewol/widget/meta/ParameterList.h @@ -67,7 +67,7 @@ namespace widget { // Derived function void OnRegenerateDisplay(void); // Derived function - bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D pos); + bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos); protected: // Derived function void OnGetFocus(void); diff --git a/test/human/appl/init.cpp b/test/human/appl/init.cpp index 0e80f01b..5771fd36 100644 --- a/test/human/appl/init.cpp +++ b/test/human/appl/init.cpp @@ -52,7 +52,7 @@ void APP_Init(void) #endif #endif etk::InitDefaultFolder(PROJECT_NAME); - ewol::ChangeSize(etk::Vector2D(800, 600)); + ewol::ChangeSize(ivec2(800, 600)); #ifdef __TARGET_OS__Android ewol::config::FontSetDefault("FreeSerif", 19); #else