From 6cb8885b4394cecc85f4fd0609485501cc92f799 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 22 Feb 2021 22:08:08 +0100 Subject: [PATCH] [PORT] step 1 --- src/org/atriasoft/ewol/DrawProperty.cpp | 2 +- src/org/atriasoft/ewol/DrawProperty.java | 8 +- src/org/atriasoft/ewol/compositing/Area.cpp | 14 +- src/org/atriasoft/ewol/compositing/Area.java | 20 +- .../ewol/compositing/Compositing.cpp | 6 +- .../ewol/compositing/Compositing.java | 6 +- .../atriasoft/ewol/compositing/Drawing.cpp | 116 +++++----- .../atriasoft/ewol/compositing/Drawing.java | 62 ++--- src/org/atriasoft/ewol/compositing/Image.cpp | 72 +++--- src/org/atriasoft/ewol/compositing/Image.java | 52 ++--- src/org/atriasoft/ewol/compositing/Shaper.cpp | 130 +++++------ .../atriasoft/ewol/compositing/Shaper.java | 18 +- src/org/atriasoft/ewol/compositing/Sprite.cpp | 12 +- .../atriasoft/ewol/compositing/Sprite.java | 12 +- src/org/atriasoft/ewol/compositing/Text.cpp | 26 +-- src/org/atriasoft/ewol/compositing/Text.java | 2 +- .../atriasoft/ewol/compositing/TextBase.cpp | 218 +++++++++--------- .../atriasoft/ewol/compositing/TextBase.java | 62 ++--- src/org/atriasoft/ewol/compositing/TextDF.cpp | 36 +-- .../atriasoft/ewol/compositing/TextDF.java | 4 +- src/org/atriasoft/ewol/context/ConfigFont.cpp | 6 +- src/org/atriasoft/ewol/context/Context.cpp | 82 +++---- src/org/atriasoft/ewol/context/Context.java | 4 +- .../atriasoft/ewol/context/InputManager.cpp | 26 +-- .../atriasoft/ewol/context/InputManager.java | 14 +- src/org/atriasoft/ewol/event/Input.java | 10 +- src/org/atriasoft/ewol/gravity.cpp | 12 +- src/org/atriasoft/ewol/gravity.java | 2 +- src/org/atriasoft/ewol/object/Manager.cpp | 22 +- src/org/atriasoft/ewol/object/Manager.java | 4 +- src/org/atriasoft/ewol/object/Object.cpp | 16 +- src/org/atriasoft/ewol/object/Object.java | 28 +-- src/org/atriasoft/ewol/resource/ColorFile.cpp | 16 +- .../atriasoft/ewol/resource/ColorFile.java | 2 +- .../ewol/resource/Colored3DObject.cpp | 178 +++++++------- .../ewol/resource/Colored3DObject.java | 18 +- .../atriasoft/ewol/resource/ConfigFile.cpp | 2 +- .../ewol/resource/DistanceFieldFont.cpp | 124 +++++----- .../ewol/resource/DistanceFieldFont.java | 8 +- .../atriasoft/ewol/resource/FontFreeType.cpp | 126 +++++----- .../atriasoft/ewol/resource/FontFreeType.java | 8 +- src/org/atriasoft/ewol/resource/ImageDF.cpp | 60 ++--- src/org/atriasoft/ewol/resource/ImageDF.java | 8 +- src/org/atriasoft/ewol/resource/Texture.cpp | 56 ++--- src/org/atriasoft/ewol/resource/Texture.java | 10 +- .../atriasoft/ewol/resource/TextureFile.cpp | 30 +-- .../atriasoft/ewol/resource/TextureFile.java | 12 +- .../atriasoft/ewol/resource/TexturedFont.cpp | 96 ++++---- .../atriasoft/ewol/resource/TexturedFont.java | 4 +- .../ewol/resource/font/FontBase.java | 6 +- .../ewol/resource/font/GlyphProperty.java | 12 +- .../atriasoft/ewol/resource/font/Kerning.java | 2 +- src/org/atriasoft/ewol/tools/message.cpp | 4 +- src/org/atriasoft/ewol/widget/Button.cpp | 34 +-- src/org/atriasoft/ewol/widget/Button.java | 4 +- src/org/atriasoft/ewol/widget/ButtonColor.cpp | 36 +-- .../atriasoft/ewol/widget/ButtonColor.java | 4 +- src/org/atriasoft/ewol/widget/CheckBox.cpp | 40 ++-- src/org/atriasoft/ewol/widget/CheckBox.java | 4 +- src/org/atriasoft/ewol/widget/ColorBar.cpp | 36 +-- src/org/atriasoft/ewol/widget/ColorBar.java | 2 +- src/org/atriasoft/ewol/widget/Composer.cpp | 34 +-- src/org/atriasoft/ewol/widget/Container.cpp | 26 +-- src/org/atriasoft/ewol/widget/Container.java | 4 +- src/org/atriasoft/ewol/widget/Container2.cpp | 48 ++-- src/org/atriasoft/ewol/widget/Container2.java | 2 +- src/org/atriasoft/ewol/widget/ContainerN.cpp | 38 +-- src/org/atriasoft/ewol/widget/ContainerN.java | 12 +- src/org/atriasoft/ewol/widget/ContextMenu.cpp | 60 ++--- .../atriasoft/ewol/widget/ContextMenu.java | 8 +- src/org/atriasoft/ewol/widget/Entry.cpp | 50 ++-- src/org/atriasoft/ewol/widget/Entry.java | 2 +- src/org/atriasoft/ewol/widget/Gird.cpp | 54 ++--- src/org/atriasoft/ewol/widget/Gird.java | 12 +- src/org/atriasoft/ewol/widget/Image.cpp | 74 +++--- src/org/atriasoft/ewol/widget/Image.java | 6 +- src/org/atriasoft/ewol/widget/Joystick.cpp | 10 +- src/org/atriasoft/ewol/widget/Joystick.java | 4 +- src/org/atriasoft/ewol/widget/Label.cpp | 40 ++-- src/org/atriasoft/ewol/widget/Layer.cpp | 8 +- src/org/atriasoft/ewol/widget/Layer.java | 2 +- src/org/atriasoft/ewol/widget/List.cpp | 60 ++--- src/org/atriasoft/ewol/widget/List.java | 16 +- .../atriasoft/ewol/widget/ListFileSystem.cpp | 16 +- .../atriasoft/ewol/widget/ListFileSystem.java | 8 +- src/org/atriasoft/ewol/widget/Manager.cpp | 26 +-- src/org/atriasoft/ewol/widget/Menu.cpp | 68 +++--- src/org/atriasoft/ewol/widget/Menu.hpp | 2 +- src/org/atriasoft/ewol/widget/PopUp.cpp | 48 ++-- src/org/atriasoft/ewol/widget/PopUp.java | 4 +- src/org/atriasoft/ewol/widget/ProgressBar.cpp | 10 +- src/org/atriasoft/ewol/widget/Scroll.cpp | 74 +++--- src/org/atriasoft/ewol/widget/Scroll.java | 6 +- src/org/atriasoft/ewol/widget/Select.cpp | 28 +-- src/org/atriasoft/ewol/widget/Select.java | 4 +- src/org/atriasoft/ewol/widget/Sizer.cpp | 70 +++--- src/org/atriasoft/ewol/widget/Slider.cpp | 16 +- src/org/atriasoft/ewol/widget/Spacer.cpp | 6 +- src/org/atriasoft/ewol/widget/Spacer.java | 2 +- src/org/atriasoft/ewol/widget/Spin.cpp | 2 +- src/org/atriasoft/ewol/widget/TreeView.cpp | 32 +-- src/org/atriasoft/ewol/widget/TreeView.java | 8 +- src/org/atriasoft/ewol/widget/WSlider.cpp | 44 ++-- src/org/atriasoft/ewol/widget/WSlider.java | 2 +- src/org/atriasoft/ewol/widget/Widget.cpp | 112 ++++----- src/org/atriasoft/ewol/widget/Widget.java | 42 ++-- .../atriasoft/ewol/widget/WidgetScrolled.cpp | 50 ++-- .../atriasoft/ewol/widget/WidgetScrolled.java | 22 +- src/org/atriasoft/ewol/widget/Windows.cpp | 36 +-- src/org/atriasoft/ewol/widget/Windows.java | 4 +- .../ewol/widget/meta/ColorChooser.cpp | 20 +- .../ewol/widget/meta/FileChooser.cpp | 10 +- .../atriasoft/ewol/widget/meta/Parameter.cpp | 74 +++--- .../ewol/widget/meta/ParameterList.cpp | 22 +- .../ewol/widget/meta/ParameterList.java | 4 +- .../atriasoft/ewol/widget/meta/SpinBase.cpp | 20 +- .../atriasoft/ewol/widget/meta/StdPopUp.cpp | 36 +-- 117 files changed, 1772 insertions(+), 1772 deletions(-) diff --git a/src/org/atriasoft/ewol/DrawProperty.cpp b/src/org/atriasoft/ewol/DrawProperty.cpp index 4d04f8e..6859e2a 100644 --- a/src/org/atriasoft/ewol/DrawProperty.cpp +++ b/src/org/atriasoft/ewol/DrawProperty.cpp @@ -15,7 +15,7 @@ etk::Stream& ewol::operator <<(etk::Stream& _os, const ewol::DrawProperty& _obj) return _os; } -void ewol::DrawProperty::limit(const vec2& _origin, const vec2& _size) { +void ewol::DrawProperty::limit(const Vector2f& _origin, const Vector2f& _size) { m_size += m_origin; m_origin.setMax(_origin); m_size.setMin(_origin+_size); diff --git a/src/org/atriasoft/ewol/DrawProperty.java b/src/org/atriasoft/ewol/DrawProperty.java index 659bad6..963c8b6 100644 --- a/src/org/atriasoft/ewol/DrawProperty.java +++ b/src/org/atriasoft/ewol/DrawProperty.java @@ -38,10 +38,10 @@ namespace ewol { (0,0) */ public : - ivec2 m_windowsSize; //!< Windows compleate size - ivec2 m_origin; //!< Windows clipping upper widget (can not be <0) - ivec2 m_size; //!< Windows clipping upper widget (can not be <0 and >m_windowsSize) - void limit(const vec2& _origin, const vec2& _size); + Vector2i m_windowsSize; //!< Windows compleate size + Vector2i m_origin; //!< Windows clipping upper widget (can not be <0) + Vector2i m_size; //!< Windows clipping upper widget (can not be <0 and >m_windowsSize) + void limit(const Vector2f& _origin, const Vector2f& _size); }; etk::Stream& operator <<(etk::Stream& _os, const ewol::DrawProperty& _obj); diff --git a/src/org/atriasoft/ewol/compositing/Area.cpp b/src/org/atriasoft/ewol/compositing/Area.cpp index 70bab49..c82c7f9 100644 --- a/src/org/atriasoft/ewol/compositing/Area.cpp +++ b/src/org/atriasoft/ewol/compositing/Area.cpp @@ -15,7 +15,7 @@ const int32_t ewol::compositing::Area::m_vboIdCoordText(1); const int32_t ewol::compositing::Area::m_vboIdColor(2); #define NB_VBO (3) -ewol::compositing::Area::Area(const ivec2& _size) : +ewol::compositing::Area::Area(const Vector2i& _size) : m_position(0.0, 0.0, 0.0), m_color(etk::color::white), m_GLprogram(null), @@ -31,7 +31,7 @@ ewol::compositing::Area::Area(const ivec2& _size) : // Create the VBO: m_VBO = gale::resource::VirtualBufferObject::create(NB_VBO); if (m_VBO == null) { - EWOL_ERROR("can not instanciate VBO ..."); + Log.error("can not instanciate VBO ..."); return; } // TO facilitate some debugs we add a name of the VBO: @@ -66,7 +66,7 @@ void ewol::compositing::Area::draw(bool _disableDepthTest) { return; } if (m_GLprogram == null) { - EWOL_ERROR("No shader ..."); + Log.error("No shader ..."); return; } // set Matrix : translation/positionMatrix @@ -92,12 +92,12 @@ void ewol::compositing::Area::clear() { // reset all VBOs: m_VBO->clear(); // reset temporal variables : - m_position = vec3(0.0, 0.0, 0.0); + m_position = Vector3f(0.0, 0.0, 0.0); } -void ewol::compositing::Area::print(const ivec2& _size) { - vec3 point(0,0,0); - vec2 tex(0,1); +void ewol::compositing::Area::print(const Vector2i& _size) { + Vector3f point(0,0,0); + Vector2f tex(0,1); point.setX(m_position.x()); point.setY(m_position.y()); m_VBO->pushOnBuffer(m_vboIdCoord, point); diff --git a/src/org/atriasoft/ewol/compositing/Area.java b/src/org/atriasoft/ewol/compositing/Area.java index d953b32..80650dd 100644 --- a/src/org/atriasoft/ewol/compositing/Area.java +++ b/src/org/atriasoft/ewol/compositing/Area.java @@ -17,7 +17,7 @@ namespace ewol { namespace compositing { class Area : public ewol::Compositing { private: - vec3 m_position; //!< The current position to draw + Vector3f m_position; //!< The current position to draw etk::Color m_color; //!< The text foreground color private: ememory::SharedPtr m_GLprogram; //!< pointer on the opengl display program @@ -43,7 +43,7 @@ namespace ewol { * @brief generic constructor * @param[in] _size Basic size of the area. */ - Area(const ivec2& _size); + Area(const Vector2i& _size); /** * @brief generic destructor */ @@ -61,34 +61,34 @@ namespace ewol { * @brief get the current display position (sometime needed in the gui control) * @return the current position. */ - const vec3& getPos() { + const Vector3f& getPos() { return m_position; }; /** * @brief set position for the next text writen * @param[in] _pos Position of the text (in 3D) */ - void setPos(const vec3& _pos) { + void setPos(const Vector3f& _pos) { m_position = _pos; }; - inline void setPos(const vec2& _pos) { - setPos(vec3(_pos.x(),_pos.y(),0)); + inline void setPos(const Vector2f& _pos) { + setPos(Vector3f(_pos.x(),_pos.y(),0)); }; /** * @brief set relative position for the next text writen * @param[in] _pos ofset apply of the text (in 3D) */ - void setRelPos(const vec3& _pos) { + void setRelPos(const Vector3f& _pos) { m_position += _pos; }; - inline void setRelPos(const vec2& _pos) { - setRelPos(vec3(_pos.x(),_pos.y(),0)); + inline void setRelPos(const Vector2f& _pos) { + setRelPos(Vector3f(_pos.x(),_pos.y(),0)); }; /** * @brief add a compleate of the image to display with the requested size * @param[in] _size size of the output image */ - void print(const ivec2& _size); + void print(const Vector2i& _size); egami::Image& get() { return m_resource->get(); diff --git a/src/org/atriasoft/ewol/compositing/Compositing.cpp b/src/org/atriasoft/ewol/compositing/Compositing.cpp index ff4462b..5715a8e 100644 --- a/src/org/atriasoft/ewol/compositing/Compositing.cpp +++ b/src/org/atriasoft/ewol/compositing/Compositing.cpp @@ -22,17 +22,17 @@ void ewol::Compositing::resetMatrix() { } -void ewol::Compositing::translate(const vec3& _vect) { +void ewol::Compositing::translate(const Vector3f& _vect) { m_matrixApply *= etk::matTranslate(_vect); } -void ewol::Compositing::rotate(const vec3& _vect, float _angle) { +void ewol::Compositing::rotate(const Vector3f& _vect, float _angle) { m_matrixApply *= etk::matRotate(_vect, _angle); } -void ewol::Compositing::scale(const vec3& _vect) { +void ewol::Compositing::scale(const Vector3f& _vect) { m_matrixApply *= etk::matScale(_vect); } diff --git a/src/org/atriasoft/ewol/compositing/Compositing.java b/src/org/atriasoft/ewol/compositing/Compositing.java index 7cea545..6f8bb06 100644 --- a/src/org/atriasoft/ewol/compositing/Compositing.java +++ b/src/org/atriasoft/ewol/compositing/Compositing.java @@ -38,17 +38,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(const vec3& _vect); + virtual void translate(const Vector3f& _vect); /** * @brief rotate the curent display of this element * @param[in] _vect The rotation vector to apply at the transformation matrix */ - virtual void rotate(const vec3& _vect, float _angle); + virtual void rotate(const Vector3f& _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(const vec3& _vect); + virtual void scale(const Vector3f& _vect); /** * @brief set the transformation matrix * @param[in] _mat The new matrix. diff --git a/src/org/atriasoft/ewol/compositing/Drawing.cpp b/src/org/atriasoft/ewol/compositing/Drawing.cpp index 6f9d386..7cc9204 100644 --- a/src/org/atriasoft/ewol/compositing/Drawing.cpp +++ b/src/org/atriasoft/ewol/compositing/Drawing.cpp @@ -17,7 +17,7 @@ const int32_t ewol::compositing::Drawing::m_vboIdColor(1); #if 0 -static void generatePolyGone(etk::Vector & input, etk::Vector & output ) +static void generatePolyGone(List & input, List & output ) { if (input.size()<3) { return; @@ -28,10 +28,10 @@ static void generatePolyGone(etk::Vector & input, etk::Vector & ou output.pushBack(input[iii]); output.pushBack(input[iii+1]); } - //EWOL_DEBUG("generate Plygone : " << input.size() << " == > " << output.size() ); + //Log.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(List & input, List & output, float sx, float sy, float ex, float ey) { // with Sutherland-Hodgman-Algorithm if (input.size() <0) { @@ -39,17 +39,17 @@ static void SutherlandHodgman(etk::Vector & input, etk::Vector & o } //int32_t sizeInit=input.size(); // last element : - vec2 destPoint; - vec2 lastElement = input[input.size()-1]; + Vector2f destPoint; + Vector2f lastElement = input[input.size()-1]; bool inside = true; if (lastElement.x < sx) { inside = false; } - //EWOL_DEBUG("generate an crop : "); + //Log.debug("generate an crop : "); for(int32_t iii=0; iii OUT "); + //Log.debug("element IN == > OUT "); //new point intersection ... //y=aaax+bbb float aaa = (lastElement.y-input[iii].y) / (lastElement.x-input[iii].x); @@ -58,15 +58,15 @@ static void SutherlandHodgman(etk::Vector & input, etk::Vector & o destPoint.x = sx; output.pushBack(destPoint); } else { - //EWOL_DEBUG("element OUT == > OUT "); + //Log.debug("element OUT == > OUT "); } inside = false; } else { if(true == inside) { - //EWOL_DEBUG("element IN == > IN "); + //Log.debug("element IN == > IN "); output.pushBack(input[iii]); } else { - //EWOL_DEBUG("element OUT == > IN "); + //Log.debug("element OUT == > IN "); //new point intersection ... //y=aaax+bbb float aaa = (lastElement.y-input[iii].y) / (lastElement.x-input[iii].x); @@ -83,7 +83,7 @@ static void SutherlandHodgman(etk::Vector & input, etk::Vector & o lastElement.y = input[iii].y; } - //EWOL_DEBUG("generate an crop on element : " << sizeInit << " == > " << output.size() << "intermediate (1)"); + //Log.debug("generate an crop on element : " << sizeInit << " == > " << output.size() << "intermediate (1)"); input = output; output.clear(); lastElement = input[input.size()-1]; @@ -94,7 +94,7 @@ static void SutherlandHodgman(etk::Vector & input, etk::Vector & o for(int32_t iii=0; iii OUT "); + //Log.debug("element IN == > OUT "); //new point intersection ... //x=aaay+bbb float aaa = (lastElement.x-input[iii].x) / (lastElement.y-input[iii].y); @@ -103,15 +103,15 @@ static void SutherlandHodgman(etk::Vector & input, etk::Vector & o destPoint.x = sy*aaa + bbb; output.pushBack(destPoint); } else { - //EWOL_DEBUG("element OUT == > OUT "); + //Log.debug("element OUT == > OUT "); } inside = false; } else { if(true == inside) { - //EWOL_DEBUG("element IN == > IN "); + //Log.debug("element IN == > IN "); output.pushBack(input[iii]); } else { - //EWOL_DEBUG("element OUT == > IN "); + //Log.debug("element OUT == > IN "); //new point intersection ... //y=aaax+bbb float aaa = (lastElement.x-input[iii].x) / (lastElement.y-input[iii].y); @@ -135,11 +135,11 @@ static void SutherlandHodgman(etk::Vector & input, etk::Vector & o if (lastElement.x > ex) { inside = false; } - //EWOL_DEBUG("generate an crop : "); + //Log.debug("generate an crop : "); for(int32_t iii=0; iii ex) { if(true == inside) { - //EWOL_DEBUG("element IN == > OUT "); + //Log.debug("element IN == > OUT "); //new point intersection ... //y=aaax+bbb float aaa = (lastElement.y-input[iii].y) / (lastElement.x-input[iii].x); @@ -148,15 +148,15 @@ static void SutherlandHodgman(etk::Vector & input, etk::Vector & o destPoint.x = ex; output.pushBack(destPoint); } else { - //EWOL_DEBUG("element OUT == > OUT "); + //Log.debug("element OUT == > OUT "); } inside = false; } else { if(true == inside) { - //EWOL_DEBUG("element IN == > IN "); + //Log.debug("element IN == > IN "); output.pushBack(input[iii]); } else { - //EWOL_DEBUG("element OUT == > IN "); + //Log.debug("element OUT == > IN "); //new point intersection ... //y=aaax+bbb float aaa = (lastElement.y-input[iii].y) / (lastElement.x-input[iii].x); @@ -183,7 +183,7 @@ static void SutherlandHodgman(etk::Vector & input, etk::Vector & o for(int32_t iii=0; iii ey) { if(true == inside) { - //EWOL_DEBUG("element IN == > OUT "); + //Log.debug("element IN == > OUT "); //new point intersection ... //x=aaay+bbb float aaa = (lastElement.x-input[iii].x) / (lastElement.y-input[iii].y); @@ -192,15 +192,15 @@ static void SutherlandHodgman(etk::Vector & input, etk::Vector & o destPoint.x = ey*aaa + bbb; output.pushBack(destPoint); } else { - //EWOL_DEBUG("element OUT == > OUT "); + //Log.debug("element OUT == > OUT "); } inside = false; } else { if(true == inside) { - //EWOL_DEBUG("element IN == > IN "); + //Log.debug("element IN == > IN "); output.pushBack(input[iii]); } else { - //EWOL_DEBUG("element OUT == > IN "); + //Log.debug("element OUT == > IN "); //new point intersection ... //y=aaax+bbb float aaa = (lastElement.x-input[iii].x) / (lastElement.y-input[iii].y); @@ -218,7 +218,7 @@ static void SutherlandHodgman(etk::Vector & input, etk::Vector & o } - //EWOL_DEBUG("generate an crop on element : " << sizeInit << " == > " << output.size() ); + //Log.debug("generate an crop on element : " << sizeInit << " == > " << output.size() ); } #endif @@ -244,7 +244,7 @@ ewol::compositing::Drawing::Drawing() : // Create the VBO: m_VBO = gale::resource::VirtualBufferObject::create(NB_VBO); if (m_VBO == null) { - EWOL_ERROR("can not instanciate VBO ..."); + Log.error("can not instanciate VBO ..."); return; } // TO facilitate some debugs we add a name of the VBO: @@ -278,7 +278,7 @@ void ewol::compositing::Drawing::internalSetColor(const etk::Color<>& _color) { } } -void ewol::compositing::Drawing::setPoint(const vec3& _point) { +void ewol::compositing::Drawing::setPoint(const Vector3f& _point) { m_triangle[m_triElement] = _point; m_triElement++; if (m_triElement >= 3) { @@ -316,7 +316,7 @@ void ewol::compositing::Drawing::draw(bool _disableDepthTest) { return; } if (m_GLprogram == null) { - EWOL_ERROR("No shader ..."); + Log.error("No shader ..."); return; } // set Matrix : translation/positionMatrix @@ -340,10 +340,10 @@ void ewol::compositing::Drawing::clear() { // reset Buffer : m_VBO->clear(); // reset temporal variables : - m_position = vec3(0.0, 0.0, 0.0); + m_position = Vector3f(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_clippingPosStart = Vector3f(0.0, 0.0, 0.0); + m_clippingPosStop = Vector3f(0.0, 0.0, 0.0); m_clippingEnable = false; m_color = etk::color::black; @@ -355,7 +355,7 @@ void ewol::compositing::Drawing::clear() { } } -void ewol::compositing::Drawing::setClipping(const vec3& _pos, const vec3& _posEnd) { +void ewol::compositing::Drawing::setClipping(const Vector3f& _pos, const Vector3f& _posEnd) { // note the internal system all time request to have a bounding all time in the same order if (_pos.x() <= _posEnd.x()) { m_clippingPosStart.setX(_pos.x()); @@ -394,10 +394,10 @@ void ewol::compositing::Drawing::addVertex() { setPoint(m_position); } -void ewol::compositing::Drawing::lineTo(const vec3& _dest) { +void ewol::compositing::Drawing::lineTo(const Vector3f& _dest) { resetCount(); internalSetColor(m_color); - //EWOL_VERBOSE("DrawLine : " << m_position << " to " << _dest); + //Log.verbose("DrawLine : " << m_position << " to " << _dest); if (m_position.x() == _dest.x() && m_position.y() == _dest.y() && m_position.z() == _dest.z()) { //EWOL_WARNING("Try to draw a line width 0"); return; @@ -414,21 +414,21 @@ void ewol::compositing::Drawing::lineTo(const vec3& _dest) { } else if (teta > 2*M_PI) { teta -= 2*M_PI; } - //EWOL_DEBUG("teta = " << (teta*180/(M_PI)) << " deg." ); + //Log.debug("teta = " << (teta*180/(M_PI)) << " deg." ); float offsety = sin(teta-M_PI/2) * (m_thickness/2); float offsetx = cos(teta-M_PI/2) * (m_thickness/2); - setPoint(vec3(m_position.x() - offsetx, m_position.y() - offsety, m_position.z()) ); - setPoint(vec3(m_position.x() + offsetx, m_position.y() + offsety, m_position.z()) ); - setPoint(vec3(_dest.x() + offsetx, _dest.y() + offsety, m_position.z()) ); + setPoint(Vector3f(m_position.x() - offsetx, m_position.y() - offsety, m_position.z()) ); + setPoint(Vector3f(m_position.x() + offsetx, m_position.y() + offsety, m_position.z()) ); + setPoint(Vector3f(_dest.x() + offsetx, _dest.y() + offsety, m_position.z()) ); - setPoint(vec3(_dest.x() + offsetx, _dest.y() + offsety, _dest.z()) ); - setPoint(vec3(_dest.x() - offsetx, _dest.y() - offsety, _dest.z()) ); - setPoint(vec3(m_position.x() - offsetx, m_position.y() - offsety, _dest.z()) ); + setPoint(Vector3f(_dest.x() + offsetx, _dest.y() + offsety, _dest.z()) ); + setPoint(Vector3f(_dest.x() - offsetx, _dest.y() - offsety, _dest.z()) ); + setPoint(Vector3f(m_position.x() - offsetx, m_position.y() - offsety, _dest.z()) ); // update the system position : m_position = _dest; } -void ewol::compositing::Drawing::rectangle(const vec3& _dest) { +void ewol::compositing::Drawing::rectangle(const Vector3f& _dest) { resetCount(); internalSetColor(m_color); /* Bitmap position @@ -472,16 +472,16 @@ void ewol::compositing::Drawing::rectangle(const vec3& _dest) { || dxA >= dxB) { return; } - setPoint(vec3(dxA, dyD, 0) ); - setPoint(vec3(dxA, dyC, 0) ); - setPoint(vec3(dxB, dyC, 0) ); + setPoint(Vector3f(dxA, dyD, 0) ); + setPoint(Vector3f(dxA, dyC, 0) ); + setPoint(Vector3f(dxB, dyC, 0) ); - setPoint(vec3(dxB, dyC, 0) ); - setPoint(vec3(dxB, dyD, 0) ); - setPoint(vec3(dxA, dyD, 0) ); + setPoint(Vector3f(dxB, dyC, 0) ); + setPoint(Vector3f(dxB, dyD, 0) ); + setPoint(Vector3f(dxA, dyD, 0) ); } -void ewol::compositing::Drawing::cube(const vec3& _dest) { +void ewol::compositing::Drawing::cube(const Vector3f& _dest) { } @@ -504,7 +504,7 @@ void ewol::compositing::Drawing::circle(float _radius, float _angleStart, float if (m_colorBg.a()!=0) { internalSetColor(m_colorBg); for (int32_t iii=0; iii m_color; //!< The text foreground color @@ -53,7 +53,7 @@ namespace ewol { void unLoadProgram(); float m_thickness; //!< when drawing line and other things int32_t m_triElement; //!< special counter of the single dot generated - vec3 m_triangle[3]; //!< Register every system with a combinaison of tiangle + Vector3f m_triangle[3]; //!< Register every system with a combinaison of tiangle etk::Color m_tricolor[3]; //!< Register every the associated color foreground // internal API for the generation abstraction of triangles /** @@ -73,7 +73,7 @@ namespace ewol { * @brief internal add of the specific point * @param[in] _point The requeste dpoint to add */ - void setPoint(const vec3& point); + void setPoint(const Vector3f& point); public: /** @@ -88,28 +88,28 @@ namespace ewol { * @brief get the current display position (sometime needed in the gui control) * @return the current position. */ - const vec3& getPos() { + const Vector3f& getPos() { return m_position; }; /** * @brief set position for the next text writen * @param[in] _pos Position of the text (in 3D) */ - void setPos(const vec3& _pos) { + void setPos(const Vector3f& _pos) { m_position = _pos; }; - inline void setPos(const vec2& _pos) { - setPos(vec3(_pos.x(), _pos.y(), 0)); + inline void setPos(const Vector2f& _pos) { + setPos(Vector3f(_pos.x(), _pos.y(), 0)); }; /** * @brief set relative position for the next text writen * @param[in] _pos ofset apply of the text (in 3D) */ - void setRelPos(const vec3& _pos) { + void setRelPos(const Vector3f& _pos) { m_position += _pos; }; - inline void setRelPos(const vec2& _pos) { - setRelPos(vec3(_pos.x(), _pos.y(), 0)); + inline void setRelPos(const Vector2f& _pos) { + setRelPos(Vector3f(_pos.x(), _pos.y(), 0)); }; /** * @brief set the Color of the current foreground font @@ -144,20 +144,20 @@ namespace ewol { * @param[in]_ pos Start position of the clipping * @param[in] _width Width size of the clipping */ - void setClippingWidth(const vec3& _pos, const vec3& _width) { + void setClippingWidth(const Vector3f& _pos, const Vector3f& _width) { setClipping(_pos, _pos+_width); }; - inline void setClippingWidth(const vec2& _pos, const vec2& _width) { - setClippingWidth(vec3(_pos.x(),_pos.y(),-1), vec3(_width.x(),_width.y(), 2)); + inline void setClippingWidth(const Vector2f& _pos, const Vector2f& _width) { + setClippingWidth(Vector3f(_pos.x(),_pos.y(),-1), Vector3f(_width.x(),_width.y(), 2)); }; /** * @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(const vec3& _pos, const vec3& _posEnd); - inline void setClipping(const vec2& _pos, const vec2& _posEnd) { - setClipping(vec3(_pos.x(),_pos.y(),-1), vec3(_posEnd.x(),_posEnd.y(), 1)); + void setClipping(const Vector3f& _pos, const Vector3f& _posEnd); + inline void setClipping(const Vector2f& _pos, const Vector2f& _posEnd) { + setClipping(Vector3f(_pos.x(),_pos.y(),-1), Vector3f(_posEnd.x(),_posEnd.y(), 1)); }; /** * @brief enable/Disable the clipping (without lose the current clipping position) @@ -179,43 +179,43 @@ namespace ewol { * @brief draw a line to a specific position * @param[in] _dest Position of the end of the line. */ - void lineTo(const vec3& _dest); - inline void lineTo(const vec2& _dest) { - lineTo(vec3(_dest.x(), _dest.y(), 0)); + void lineTo(const Vector3f& _dest); + inline void lineTo(const Vector2f& _dest) { + lineTo(Vector3f(_dest.x(), _dest.y(), 0)); }; /** * @brief Relative drawing a line (spacial vector) * @param[in] _vect Vector of the curent line. */ - void lineRel(const vec3& _vect) { + void lineRel(const Vector3f& _vect) { lineTo(m_position+_vect); }; - inline void lineRel(const vec2& _vect) { - lineRel(vec3(_vect.x(), _vect.y(), 0)); + inline void lineRel(const Vector2f& _vect) { + lineRel(Vector3f(_vect.x(), _vect.y(), 0)); }; /** * @brief draw a 2D rectangle to the position requested. * @param[in] _dest Position the the end of the rectangle */ - void rectangle(const vec3& _dest); - inline void rectangle(const vec2& _dest) { - rectangle(vec3(_dest.x(), _dest.y(), 0)); + void rectangle(const Vector3f& _dest); + inline void rectangle(const Vector2f& _dest) { + rectangle(Vector3f(_dest.x(), _dest.y(), 0)); }; /** * @brief draw a 2D rectangle to the requested size. * @param[in] _size size of the rectangle */ - void rectangleWidth(const vec3& _size) { + void rectangleWidth(const Vector3f& _size) { rectangle(m_position+_size); }; - inline void rectangleWidth(const vec2& _size) { - rectangleWidth(vec3(_size.x(), _size.y(), 0)); + inline void rectangleWidth(const Vector2f& _size) { + rectangleWidth(Vector3f(_size.x(), _size.y(), 0)); }; /** * @brief draw a 3D rectangle to the position requested. * @param[in] _dest Position the the end of the rectangle */ - void cube(const vec3& _dest); + void cube(const Vector3f& _dest); /** * @brief draw a 2D circle with the specify rafdius parameter. * @param[in] _radius Distence to the dorder diff --git a/src/org/atriasoft/ewol/compositing/Image.cpp b/src/org/atriasoft/ewol/compositing/Image.cpp index 76e8f67..2e85a72 100644 --- a/src/org/atriasoft/ewol/compositing/Image.cpp +++ b/src/org/atriasoft/ewol/compositing/Image.cpp @@ -40,7 +40,7 @@ ewol::compositing::Image::Image(const etk::Uri& _imageName, // Create the VBO: m_VBO = gale::resource::VirtualBufferObject::create(NB_VBO); if (m_VBO == null) { - EWOL_ERROR("can not instanciate VBO ..."); + Log.error("can not instanciate VBO ..."); return; } // TO facilitate some debugs we add a name of the VBO: @@ -83,7 +83,7 @@ void ewol::compositing::Image::draw(bool _disableDepthTest) { return; } if (m_GLprogram == null) { - EWOL_ERROR("No shader ..."); + Log.error("No shader ..."); return; } //EWOL_WARNING("Display image : " << m_VBO->bufferSize(m_vboIdCoord)); @@ -101,12 +101,12 @@ void ewol::compositing::Image::draw(bool _disableDepthTest) { m_GLprogram->setTexture0(m_GLtexID, m_resourceImage->getRendererId()); } else if (m_resource != null) { if (m_distanceFieldMode == true) { - EWOL_ERROR("FONT type error Request distance field and display normal ..."); + Log.error("FONT type error Request distance field and display normal ..."); } m_GLprogram->setTexture0(m_GLtexID, m_resource->getRendererId()); } else { if (m_distanceFieldMode == false) { - EWOL_ERROR("FONT type error Request normal and display distance field ..."); + Log.error("FONT type error Request normal and display distance field ..."); } m_GLprogram->setTexture0(m_GLtexID, m_resourceDF->getRendererId()); } @@ -127,15 +127,15 @@ void ewol::compositing::Image::clear() { // reset Buffer : m_VBO->clear(); // reset temporal variables : - 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_position = Vector3f(0.0, 0.0, 0.0); + m_clippingPosStart = Vector3f(0.0, 0.0, 0.0); + m_clippingPosStop = Vector3f(0.0, 0.0, 0.0); m_clippingEnable = false; m_color = etk::color::white; m_angle = 0.0; } -void ewol::compositing::Image::setClipping(const vec3& _pos, vec3 _posEnd) { +void ewol::compositing::Image::setClipping(const Vector3f& _pos, Vector3f _posEnd) { // note the internal system all time request to have a bounding all time in the same order if (_pos.x() <= _posEnd.x()) { m_clippingPosStart.setX(_pos.x()); @@ -165,27 +165,27 @@ void ewol::compositing::Image::setAngle(float _angle) { m_angle = _angle; } -void ewol::compositing::Image::print(const vec2& _size) { - printPart(_size, vec2(0,0), vec2(1.0,1.0)); +void ewol::compositing::Image::print(const Vector2f& _size) { + printPart(_size, Vector2f(0,0), Vector2f(1.0,1.0)); } -void ewol::compositing::Image::printPart(const vec2& _size, - vec2 _sourcePosStart, - vec2 _sourcePosStop) { +void ewol::compositing::Image::printPart(const Vector2f& _size, + Vector2f _sourcePosStart, + Vector2f _sourcePosStop) { if (m_resource == null) { return; } - vec2 openGLSize = vec2(m_resource->getOpenGlSize().x(), m_resource->getOpenGlSize().y()); - vec2 usefullSize = m_resource->getUsableSize(); - vec2 ratio = usefullSize/openGLSize; + Vector2f openGLSize = Vector2f(m_resource->getOpenGlSize().x(), m_resource->getOpenGlSize().y()); + Vector2f usefullSize = m_resource->getUsableSize(); + Vector2f ratio = usefullSize/openGLSize; _sourcePosStart *= ratio; _sourcePosStop *= ratio; - EWOL_VERBOSE(" openGLSize=" << openGLSize << " usableSize=" << usefullSize << " start=" << _sourcePosStart << " stop=" << _sourcePosStop); + Log.verbose(" openGLSize=" << openGLSize << " usableSize=" << usefullSize << " start=" << _sourcePosStart << " stop=" << _sourcePosStop); - //EWOL_ERROR("Debug image " << m_filename << " ==> " << m_position << " " << _size << " " << _sourcePosStart << " " << _sourcePosStop); + //Log.error("Debug image " << m_filename << " ==> " << m_position << " " << _size << " " << _sourcePosStart << " " << _sourcePosStop); if (m_angle == 0.0f) { - vec3 point = m_position; - vec2 tex(_sourcePosStart.x(),_sourcePosStop.y()); + Vector3f point = m_position; + Vector2f tex(_sourcePosStart.x(),_sourcePosStop.y()); m_VBO->pushOnBuffer(m_vboIdCoord, point); m_VBO->pushOnBuffer(m_vboIdCoordTex, tex); m_VBO->pushOnBuffer(m_vboIdColor, m_color); @@ -224,28 +224,28 @@ void ewol::compositing::Image::printPart(const vec2& _size, m_VBO->flush(); return; } - vec3 center = m_position + vec3(_size.x(),_size.y(),0)/2.0f; - vec3 limitedSize(_size.x()*0.5f, _size.y()*0.5f, 0.0f); + Vector3f center = m_position + Vector3f(_size.x(),_size.y(),0)/2.0f; + Vector3f limitedSize(_size.x()*0.5f, _size.y()*0.5f, 0.0f); - vec3 point(0,0,0); - vec2 tex(_sourcePosStart.x(),_sourcePosStop.y()); + Vector3f point(0,0,0); + Vector2f tex(_sourcePosStart.x(),_sourcePosStop.y()); point.setValue(-limitedSize.x(), -limitedSize.y(), 0); - point = point.rotate(vec3(0,0,1), m_angle) + center; + point = point.rotate(Vector3f(0,0,1), m_angle) + center; m_VBO->pushOnBuffer(m_vboIdCoord, point); m_VBO->pushOnBuffer(m_vboIdCoordTex, tex); m_VBO->pushOnBuffer(m_vboIdColor, m_color); tex.setValue(_sourcePosStop.x(),_sourcePosStop.y()); point.setValue(limitedSize.x(), -limitedSize.y(), 0); - point = point.rotate(vec3(0,0,1), m_angle) + center; + point = point.rotate(Vector3f(0,0,1), m_angle) + center; m_VBO->pushOnBuffer(m_vboIdCoord, point); m_VBO->pushOnBuffer(m_vboIdCoordTex, tex); m_VBO->pushOnBuffer(m_vboIdColor, m_color); tex.setValue(_sourcePosStop.x(),_sourcePosStart.y()); point.setValue(limitedSize.x(), limitedSize.y(), 0); - point = point.rotate(vec3(0,0,1), m_angle) + center; + point = point.rotate(Vector3f(0,0,1), m_angle) + center; m_VBO->pushOnBuffer(m_vboIdCoord, point); m_VBO->pushOnBuffer(m_vboIdCoordTex, tex); m_VBO->pushOnBuffer(m_vboIdColor, m_color); @@ -256,14 +256,14 @@ void ewol::compositing::Image::printPart(const vec2& _size, tex.setValue(_sourcePosStart.x(),_sourcePosStart.y()); point.setValue(-limitedSize.x(), limitedSize.y(), 0); - point = point.rotate(vec3(0,0,1), m_angle) + center; + point = point.rotate(Vector3f(0,0,1), m_angle) + center; m_VBO->pushOnBuffer(m_vboIdCoord, point); m_VBO->pushOnBuffer(m_vboIdCoordTex, tex); m_VBO->pushOnBuffer(m_vboIdColor, m_color); tex.setValue(_sourcePosStart.x(),_sourcePosStop.y()); point.setValue(-limitedSize.x(), -limitedSize.y(), 0); - point = point.rotate(vec3(0,0,1), m_angle) + center; + point = point.rotate(Vector3f(0,0,1), m_angle) + center; m_VBO->pushOnBuffer(m_vboIdCoord, point); m_VBO->pushOnBuffer(m_vboIdCoordTex, tex); m_VBO->pushOnBuffer(m_vboIdColor, m_color); @@ -271,7 +271,7 @@ void ewol::compositing::Image::printPart(const vec2& _size, m_VBO->flush(); } -void ewol::compositing::Image::setSource(const etk::Uri& _uri, const vec2& _size) { +void ewol::compositing::Image::setSource(const etk::Uri& _uri, const Vector2f& _size) { clear(); if ( m_filename == _uri && m_requestSize == _size) { @@ -286,19 +286,19 @@ void ewol::compositing::Image::setSource(const etk::Uri& _uri, const vec2& _size m_resource.reset(); m_resourceDF.reset(); m_resourceImage.reset(); - ivec2 tmpSize(_size.x(),_size.y()); + Vector2i tmpSize(_size.x(),_size.y()); // note that no image can be loaded... if (_uri.isEmpty() == false) { // link to new one if (m_distanceFieldMode == false) { m_resource = ewol::resource::TextureFile::create(m_filename, tmpSize); if (m_resource == null) { - EWOL_ERROR("Can not get Image resource"); + Log.error("Can not get Image resource"); } } else { m_resourceDF = ewol::resource::ImageDF::create(m_filename, tmpSize); if (m_resourceDF == null) { - EWOL_ERROR("Can not get Image resource DF"); + Log.error("Can not get Image resource DF"); } } } @@ -333,11 +333,11 @@ bool ewol::compositing::Image::hasSources() { } -vec2 ewol::compositing::Image::getRealSize() { +Vector2f ewol::compositing::Image::getRealSize() { if ( m_resource == null && m_resourceDF == null && m_resourceImage == null) { - return vec2(0,0); + return Vector2f(0,0); } if (m_resource != null) { return m_resource->getRealSize(); @@ -348,7 +348,7 @@ vec2 ewol::compositing::Image::getRealSize() { if (m_resourceImage != null) { return m_resourceImage->getUsableSize(); } - return vec2(0,0); + return Vector2f(0,0); } diff --git a/src/org/atriasoft/ewol/compositing/Image.java b/src/org/atriasoft/ewol/compositing/Image.java index 9725a15..a35794b 100644 --- a/src/org/atriasoft/ewol/compositing/Image.java +++ b/src/org/atriasoft/ewol/compositing/Image.java @@ -18,10 +18,10 @@ namespace ewol { static const int32_t sizeAuto; private: etk::Uri m_filename; - ivec2 m_requestSize; - vec3 m_position; //!< The current position to draw - vec3 m_clippingPosStart; //!< Clipping start position - vec3 m_clippingPosStop; //!< Clipping stop position + Vector2i m_requestSize; + Vector3f m_position; //!< The current position to draw + Vector3f m_clippingPosStart; //!< Clipping start position + Vector3f m_clippingPosStop; //!< Clipping stop position bool m_clippingEnable; //!< true if the clipping must be activated private: etk::Color m_color; //!< The text foreground color @@ -75,28 +75,28 @@ namespace ewol { * @brief get the current display position (sometime needed in the gui control) * @return the current position. */ - const vec3& getPos() { + const Vector3f& getPos() { return m_position; }; /** * @brief set position for the next text writen * @param[in] _pos Position of the text (in 3D) */ - void setPos(const vec3& _pos) { + void setPos(const Vector3f& _pos) { m_position = _pos; }; - inline void setPos(const vec2& _pos) { - setPos(vec3(_pos.x(),_pos.y(),0)); + inline void setPos(const Vector2f& _pos) { + setPos(Vector3f(_pos.x(),_pos.y(),0)); }; /** * @brief set relative position for the next text writen * @param[in] _pos ofset apply of the text (in 3D) */ - void setRelPos(const vec3& _pos) { + void setRelPos(const Vector3f& _pos) { m_position += _pos; }; - inline void setRelPos(const vec2& _pos) { - setRelPos(vec3(_pos.x(),_pos.y(),0)); + inline void setRelPos(const Vector2f& _pos) { + setRelPos(Vector3f(_pos.x(),_pos.y(),0)); }; /** * @brief set the Color of the current foreground font @@ -110,20 +110,20 @@ namespace ewol { * @param[in] _pos Start position of the clipping * @param[in] _width Width size of the clipping */ - void setClippingWidth(const vec3& _pos, vec3 _width) { + void setClippingWidth(const Vector3f& _pos, Vector3f _width) { setClipping(_pos, _pos+_width); }; - inline void setClippingWidth(const vec2& _pos, const vec2& _width) { - setClippingWidth(vec3(_pos.x(),_pos.y(),0), vec3(_width.x(),_width.y(),0)); + inline void setClippingWidth(const Vector2f& _pos, const Vector2f& _width) { + setClippingWidth(Vector3f(_pos.x(),_pos.y(),0), Vector3f(_width.x(),_width.y(),0)); }; /** * @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(const vec3& _pos, vec3 _posEnd); - inline void setClipping(const vec2& _pos, const vec2& _posEnd) { - setClipping(vec3(_pos.x(),_pos.y(),0), vec3(_posEnd.x(),_posEnd.y(),0)); + void setClipping(const Vector3f& _pos, Vector3f _posEnd); + inline void setClipping(const Vector2f& _pos, const Vector2f& _posEnd) { + setClipping(Vector3f(_pos.x(),_pos.y(),0), Vector3f(_posEnd.x(),_posEnd.y(),0)); }; /** * @brief enable/Disable the clipping (without lose the current clipping position) @@ -141,28 +141,28 @@ namespace ewol { * @brief add a compleate of the image to display with the requested size * @param[in] _size size of the output image */ - void print(const ivec2& _size) { - print(vec2(_size.x(),_size.y())); + void print(const Vector2i& _size) { + print(Vector2f(_size.x(),_size.y())); }; - void print(const vec2& _size); + void print(const Vector2f& _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(const vec2& _size, - vec2 _sourcePosStart, - vec2 _sourcePosStop); + void printPart(const Vector2f& _size, + Vector2f _sourcePosStart, + Vector2f _sourcePosStop); /** * @brief change the image Source == > can not be done to display 2 images at the same time ... * @param[in] _uri New file of the Image * @param[in] _size for the image when Verctorial image loading is requested */ void setSource(const etk::Uri& _uri, int32_t _size=32) { - setSource(_uri, vec2(_size,_size)); + setSource(_uri, Vector2f(_size,_size)); }; - void setSource(const etk::Uri& _uri, const vec2& _size); + void setSource(const etk::Uri& _uri, const Vector2f& _size); void setSource(egami::Image _image); /** * @brief Sometimes the user declare an image but not allocate the ressources all the time, this is to know it .. @@ -173,7 +173,7 @@ namespace ewol { * @brief get the source image registered size in the file (<0 when multiple size image) * @return tre image registered size */ - vec2 getRealSize(); + Vector2f getRealSize(); public: /** * @brief Set render mode of the image diff --git a/src/org/atriasoft/ewol/compositing/Shaper.cpp b/src/org/atriasoft/ewol/compositing/Shaper.cpp index cf96f8b..ff6f80e 100644 --- a/src/org/atriasoft/ewol/compositing/Shaper.cpp +++ b/src/org/atriasoft/ewol/compositing/Shaper.cpp @@ -50,7 +50,7 @@ ewol::compositing::Shaper::Shaper(const etk::Uri& _uri) : // Create the VBO: m_VBO = gale::resource::VirtualBufferObject::create(NB_VBO); if (m_VBO == null) { - EWOL_ERROR("can not instanciate VBO ..."); + Log.error("can not instanciate VBO ..."); return; } // TO facilitate some debugs we add a name of the VBO: @@ -84,7 +84,7 @@ void ewol::compositing::Shaper::unLoadProgram() { void ewol::compositing::Shaper::loadProgram() { if (m_uri.isEmpty() == true) { - EWOL_DEBUG("no Shaper set for loading resources ..."); + Log.debug("no Shaper set for loading resources ..."); return; } m_config = ewol::resource::ConfigFile::create(m_uri.get()); @@ -116,9 +116,9 @@ void ewol::compositing::Shaper::loadProgram() { etk::Uri tmpUri = m_uri; tmpUri.setPath(m_uri.getPath().getParent() / basicShaderFile); tmpFilename = tmpUri.get(); - EWOL_DEBUG("Shaper try load shader : '" << tmpFilename << "' with base : '" << basicShaderFile << "'"); + Log.debug("Shaper try load shader : '" << tmpFilename << "' with base : '" << basicShaderFile << "'"); } else { - EWOL_DEBUG("Shaper try load shader : '" << tmpFilename << "'"); + Log.debug("Shaper try load shader : '" << tmpFilename << "'"); } // get the shader resource : m_GLPosition = 0; @@ -144,11 +144,11 @@ void ewol::compositing::Shaper::loadProgram() { etk::Uri tmpUri = m_uri; tmpUri.setPath(m_uri.getPath().getParent() / basicImageFile); tmpFilename = tmpUri.get(); - EWOL_DEBUG("Shaper try load shaper image : '" << tmpFilename << "' with base : '" << basicImageFile << "'"); + Log.debug("Shaper try load shaper image : '" << tmpFilename << "' with base : '" << basicImageFile << "'"); } else { - EWOL_DEBUG("Shaper try load shaper image : '" << tmpFilename << "'"); + Log.debug("Shaper try load shaper image : '" << tmpFilename << "'"); } - ivec2 size(64,64); + Vector2i size(64,64); m_resourceTexture = ewol::resource::TextureFile::create(tmpFilename, size); } } @@ -160,18 +160,18 @@ void ewol::compositing::Shaper::loadProgram() { etk::Uri tmpUri = m_uri; tmpUri.setPath(m_uri.getPath().getParent() / basicColorFile); tmpFilename = tmpUri.get(); - EWOL_DEBUG("Shaper try load colorFile : '" << tmpFilename << "' with base : '" << basicColorFile << "'"); + Log.debug("Shaper try load colorFile : '" << tmpFilename << "' with base : '" << basicColorFile << "'"); } else { - EWOL_DEBUG("Shaper try load colorFile : '" << tmpFilename << "'"); + Log.debug("Shaper try load colorFile : '" << tmpFilename << "'"); } m_colorProperty = ewol::resource::ColorFile::create(tmpFilename); if ( m_GLprogram != null && m_colorProperty != null) { - etk::Vector listColor = m_colorProperty->getColors(); + List listColor = m_colorProperty->getColors(); for (auto tmpColor : listColor) { int32_t glId = m_GLprogram->getUniform(tmpColor); int32_t colorID = m_colorProperty->request(tmpColor); - m_listAssiciatedId.pushBack(ivec2(glId, colorID)); + m_listAssiciatedId.pushBack(Vector2i(glId, colorID)); } } } @@ -183,7 +183,7 @@ void ewol::compositing::Shaper::draw(bool _disableDepthTest) { return; } if (m_GLprogram == null) { - EWOL_ERROR("No shader ..."); + Log.error("No shader ..."); return; } if (m_VBO->bufferSize(m_vboIdCoord) <= 0) { @@ -218,10 +218,10 @@ void ewol::compositing::Shaper::draw(bool _disableDepthTest) { void ewol::compositing::Shaper::clear() { // nothing to do ... - m_propertySize = vec2(0,0); - m_propertyOrigin = vec2(0,0); - m_propertyInsidePosition = vec2(0,0); - m_propertyInsideSize = vec2(0,0); + m_propertySize = Vector2f(0,0); + m_propertyOrigin = Vector2f(0,0); + m_propertyInsidePosition = Vector2f(0,0); + m_propertyInsideSize = Vector2f(0,0); m_VBO->clear(); } @@ -246,7 +246,7 @@ bool ewol::compositing::Shaper::changeStatusIn(int32_t _newStatusId) { } bool ewol::compositing::Shaper::periodicCall(const ewol::event::Time& _event) { - EWOL_VERBOSE("call=" << _event << "state transition=" << m_stateTransition << " speedTime=" << m_config->getNumber(m_confIdChangeTime)); + Log.verbose("call=" << _event << "state transition=" << m_stateTransition << " speedTime=" << m_config->getNumber(m_confIdChangeTime)); // start : if (m_stateTransition >= 1.0) { m_stateOld = m_stateNew; @@ -255,7 +255,7 @@ bool ewol::compositing::Shaper::periodicCall(const ewol::event::Time& _event) { m_stateNew = m_nextStatusRequested; m_nextStatusRequested = -1; m_stateTransition = 0.0; - EWOL_VERBOSE(" ##### START ##### "); + Log.verbose(" ##### START ##### "); } else { m_nextStatusRequested = -1; // disable periodic call ... @@ -281,7 +281,7 @@ bool ewol::compositing::Shaper::periodicCall(const ewol::event::Time& _event) { m_stateTransition += _event.getDeltaCall() / timeRelativity; //m_stateTransition += _event.getDeltaCall(); m_stateTransition = etk::avg(0.0f, m_stateTransition, 1.0f); - EWOL_VERBOSE("relative=" << timeRelativity << " Transition : " << m_stateTransition); + Log.verbose("relative=" << timeRelativity << " Transition : " << m_stateTransition); } return true; } @@ -310,97 +310,97 @@ void ewol::compositing::Shaper::addVertexLine(float _yTop, m_nbVertexToDisplay++; if (_displayOutside == true) { - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x1, _yButtom)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[0],_yValButtom)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x1, _yButtom)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[0],_yValButtom)); m_nbVertexToDisplay++; } else { - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x2, _yButtom)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[1],_yValButtom)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x2, _yButtom)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[1],_yValButtom)); m_nbVertexToDisplay++; } } if (_displayOutside == true) { // A - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x1, _yButtom)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[0],_yValButtom)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x1, _yButtom)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[0],_yValButtom)); m_nbVertexToDisplay++; - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x1, _yTop)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[0],_yValTop)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x1, _yTop)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[0],_yValTop)); m_nbVertexToDisplay++; - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x2, _yButtom)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[1],_yValButtom)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x2, _yButtom)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[1],_yValButtom)); m_nbVertexToDisplay++; // B - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x2, _yTop)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[1],_yValTop)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x2, _yTop)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[1],_yValTop)); m_nbVertexToDisplay++; // C - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x3, _yButtom)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[2],_yValButtom)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x3, _yButtom)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[2],_yValButtom)); m_nbVertexToDisplay++; } else { // C - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x2, _yButtom)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[1],_yValButtom)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x2, _yButtom)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[1],_yValButtom)); m_nbVertexToDisplay++; - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x2, _yTop)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[1],_yValTop)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x2, _yTop)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[1],_yValTop)); m_nbVertexToDisplay++; - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x3, _yButtom)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[2],_yValButtom)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x3, _yButtom)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[2],_yValButtom)); m_nbVertexToDisplay++; } // D - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x3, _yTop)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[2],_yValTop)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x3, _yTop)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[2],_yValTop)); m_nbVertexToDisplay++; // E - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x4, _yButtom)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[3],_yValButtom)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x4, _yButtom)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[3],_yValButtom)); m_nbVertexToDisplay++; // F - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x4, _yTop)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[3],_yValTop)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x4, _yTop)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[3],_yValTop)); m_nbVertexToDisplay++; // G - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x5, _yButtom)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[4],_yValButtom)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x5, _yButtom)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[4],_yValButtom)); m_nbVertexToDisplay++; // H - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x5, _yTop)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[4],_yValTop)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x5, _yTop)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[4],_yValTop)); m_nbVertexToDisplay++; // I - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x6, _yButtom)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[5],_yValButtom)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x6, _yButtom)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[5],_yValButtom)); m_nbVertexToDisplay++; // J - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x6, _yTop)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[5],_yValTop)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x6, _yTop)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[5],_yValTop)); m_nbVertexToDisplay++; // K - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x7, _yButtom)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[6],_yValButtom)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x7, _yButtom)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[6],_yValButtom)); m_nbVertexToDisplay++; // L - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x7, _yTop)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[6],_yValTop)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x7, _yTop)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[6],_yValTop)); m_nbVertexToDisplay++; if (_displayOutside == true) { // M - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x8, _yButtom)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[7],_yValButtom)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x8, _yButtom)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[7],_yValButtom)); m_nbVertexToDisplay++; // N - m_VBO->pushOnBuffer(m_vboIdCoord, vec2(_x8, _yTop)); - m_VBO->pushOnBuffer(m_vboIdPos, vec2(_table[7],_yValTop)); + m_VBO->pushOnBuffer(m_vboIdCoord, Vector2f(_x8, _yTop)); + m_VBO->pushOnBuffer(m_vboIdPos, Vector2f(_table[7],_yValTop)); m_nbVertexToDisplay++; } } @@ -451,7 +451,7 @@ const float modeDisplay[][8] = { { 1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f, 1.0f, 1.0f } }; -void ewol::compositing::Shaper::setShape(const vec2& _origin, const vec2& _size, const vec2& _insidePos, const vec2& _insideSize) { +void ewol::compositing::Shaper::setShape(const Vector2f& _origin, const Vector2f& _size, const Vector2f& _insidePos, const Vector2f& _insideSize) { m_VBO->clear(); ewol::Padding borderTmp = getBorder(); ewol::Padding paddingIn = getPaddingIn(); @@ -490,9 +490,9 @@ void ewol::compositing::Shaper::setShape(const vec2& _origin, const vec2& _size, #endif /* - EWOL_ERROR(" enveloppe = " << enveloppe); - EWOL_ERROR(" border = " << border); - EWOL_ERROR(" inside = " << inside); + Log.error(" enveloppe = " << enveloppe); + Log.error(" border = " << border); + Log.error(" inside = " << inside); */ int32_t mode = 0; bool displayOutside = false; diff --git a/src/org/atriasoft/ewol/compositing/Shaper.java b/src/org/atriasoft/ewol/compositing/Shaper.java index db86d64..68d49e4 100644 --- a/src/org/atriasoft/ewol/compositing/Shaper.java +++ b/src/org/atriasoft/ewol/compositing/Shaper.java @@ -54,7 +54,7 @@ namespace ewol { ememory::SharedPtr m_GLprogram; //!< pointer on the opengl display program int32_t m_GLPosition; //!< openGL id on the element (vertex buffer) int32_t m_GLMatrix; //!< openGL id on the element (transformation matrix) - int32_t m_GLPropertyPos; //!< openGL id on the element (simple ratio position in the widget : ____/-----\_____ on vec2(X,Y)) + int32_t m_GLPropertyPos; //!< openGL id on the element (simple ratio position in the widget : ____/-----\_____ on Vector2f(X,Y)) int32_t m_GLStateActivate; //!< openGL id on the element (activate state displayed) int32_t m_GLStateOld; //!< openGL id on the element (old state displayed) int32_t m_GLStateNew; //!< openGL id on the element (new state displayed) @@ -64,10 +64,10 @@ namespace ewol { ememory::SharedPtr m_resourceTexture; //!< texture resources (for the image) // internal needed data : int32_t m_nextStatusRequested; //!< when status is changing, this represent the next step of it - vec2 m_propertyOrigin; //!< widget origin - vec2 m_propertySize; //!< widget size - vec2 m_propertyInsidePosition; //!< internal subwidget position - vec2 m_propertyInsideSize; //!< internal subwidget size + Vector2f m_propertyOrigin; //!< widget origin + Vector2f m_propertySize; //!< widget size + Vector2f m_propertyInsidePosition; //!< internal subwidget position + Vector2f m_propertyInsideSize; //!< internal subwidget size int32_t m_stateActivate; //!< Activate state of the element int32_t m_stateOld; //!< previous state int32_t m_stateNew; //!< destination state @@ -75,7 +75,7 @@ namespace ewol { int32_t m_nbVertexToDisplay; // color management theme: ememory::SharedPtr m_colorProperty; //!< input resource for color management - etk::Vector m_listAssiciatedId; //!< Corellation ID between ColorProperty (Y) and OpenGL Program (X) + List m_listAssiciatedId; //!< Corellation ID between ColorProperty (Y) and OpenGL Program (X) protected: static const int32_t m_vboIdCoord; static const int32_t m_vboIdPos; @@ -224,11 +224,11 @@ namespace ewol { * @param[in] _insidePos Positin of the internal data * @param[in] _insideSize Size of the internal data */ - void setShape(const vec2& _origin, const vec2& _size, const vec2& _insidePos, const vec2& _insideSize); + void setShape(const Vector2f& _origin, const Vector2f& _size, const Vector2f& _insidePos, const Vector2f& _insideSize); // @previous - void setShape(const vec2& _origin, const vec2& _size) { + void setShape(const Vector2f& _origin, const Vector2f& _size) { ewol::Padding tmp = getPadding(); - setShape(_origin, _size, _origin+vec2(tmp.xLeft(), tmp.yButtom()), _size - vec2(tmp.x(), tmp.y())); + setShape(_origin, _size, _origin+Vector2f(tmp.xLeft(), tmp.yButtom()), _size - Vector2f(tmp.x(), tmp.y())); } public: /** diff --git a/src/org/atriasoft/ewol/compositing/Sprite.cpp b/src/org/atriasoft/ewol/compositing/Sprite.cpp index 16a5b97..7a119f6 100644 --- a/src/org/atriasoft/ewol/compositing/Sprite.cpp +++ b/src/org/atriasoft/ewol/compositing/Sprite.cpp @@ -10,12 +10,12 @@ #include ETK_DECLARE_TYPE(ewol::compositing::Sprite); -ewol::compositing::Sprite::Sprite(const etk::String& _imageName, const ivec2& _nbSprite, int32_t _size) : +ewol::compositing::Sprite::Sprite(const etk::String& _imageName, const Vector2i& _nbSprite, int32_t _size) : ewol::compositing::Image(_imageName, false, _size), m_nbSprite(_nbSprite), m_unitarySpriteSize(0,0) { /* - vec2 imageSize = getRealSize(); + Vector2f imageSize = getRealSize(); m_unitarySpriteSize.setValue(imageSize.x()/(float)m_nbSprite.x(), imageSize.y()/(float)m_nbSprite.y()); */ @@ -24,16 +24,16 @@ ewol::compositing::Sprite::Sprite(const etk::String& _imageName, const ivec2& _n } -void ewol::compositing::Sprite::printSprite(const ivec2& _spriteID, const vec3& _size) { +void ewol::compositing::Sprite::printSprite(const Vector2i& _spriteID, const Vector3f& _size) { if( _spriteID.x()<0 || _spriteID.y()<0 || _spriteID.x() >= m_nbSprite.x() || _spriteID.y() >= m_nbSprite.y()) { return; } - printPart(vec2(_size.x(),_size.y()), - vec2((float)(_spriteID.x() )*m_unitarySpriteSize.x(), (float)(_spriteID.y() )*m_unitarySpriteSize.y()), - vec2((float)(_spriteID.x()+1)*m_unitarySpriteSize.x(), (float)(_spriteID.y()+1)*m_unitarySpriteSize.y())); + printPart(Vector2f(_size.x(),_size.y()), + Vector2f((float)(_spriteID.x() )*m_unitarySpriteSize.x(), (float)(_spriteID.y() )*m_unitarySpriteSize.y()), + Vector2f((float)(_spriteID.x()+1)*m_unitarySpriteSize.x(), (float)(_spriteID.y()+1)*m_unitarySpriteSize.y())); } diff --git a/src/org/atriasoft/ewol/compositing/Sprite.java b/src/org/atriasoft/ewol/compositing/Sprite.java index d2b5231..9888435 100644 --- a/src/org/atriasoft/ewol/compositing/Sprite.java +++ b/src/org/atriasoft/ewol/compositing/Sprite.java @@ -12,17 +12,17 @@ namespace ewol { namespace compositing { class Sprite : public ewol::compositing::Image { protected: - ivec2 m_nbSprite; //!< number of sprite in vertical and horizontal - vec2 m_unitarySpriteSize; //!< size of a unique sprite + Vector2i m_nbSprite; //!< number of sprite in vertical and horizontal + Vector2f m_unitarySpriteSize; //!< size of a unique sprite public: Sprite(const etk::String& _imageName, - const ivec2& _nbSprite, + const Vector2i& _nbSprite, int32_t _size=ewol::compositing::Image::sizeAuto); virtual ~Sprite() {}; - void printSprite(const ivec2& _spriteID, const vec2& _size) { - printSprite(_spriteID, vec3(_size.x(), _size.y(),0)); + void printSprite(const Vector2i& _spriteID, const Vector2f& _size) { + printSprite(_spriteID, Vector3f(_size.x(), _size.y(),0)); }; - void printSprite(const ivec2& _spriteID, const vec3& _size); + void printSprite(const Vector2i& _spriteID, const Vector3f& _size); }; } } diff --git a/src/org/atriasoft/ewol/compositing/Text.cpp b/src/org/atriasoft/ewol/compositing/Text.cpp index 0b912e5..82a21ad 100644 --- a/src/org/atriasoft/ewol/compositing/Text.cpp +++ b/src/org/atriasoft/ewol/compositing/Text.cpp @@ -37,7 +37,7 @@ void ewol::compositing::Text::drawMT(const mat4& _transformationMatrix, bool _en return; } if (m_GLprogram == null) { - EWOL_ERROR("No shader ..."); + Log.error("No shader ..."); return; } if (_enableDepthTest == true) { @@ -81,7 +81,7 @@ void ewol::compositing::Text::drawD(bool _disableDepthTest) { return; } if (m_GLprogram == null) { - EWOL_ERROR("No shader ..."); + Log.error("No shader ..."); return; } // set Matrix : translation/positionMatrix @@ -158,11 +158,11 @@ void ewol::compositing::Text::setFont(etk::String _fontName, int32_t _fontSize) } _fontName += ":"; _fontName += etk::toString(_fontSize); - EWOL_VERBOSE("plop : " << _fontName << " size=" << _fontSize << " result :" << _fontName); + Log.verbose("plop : " << _fontName << " size=" << _fontSize << " result :" << _fontName); // link to new one m_font = ewol::resource::TexturedFont::create(_fontName); if (m_font == null) { - EWOL_ERROR("Can not get font resource"); + Log.error("Can not get font resource"); m_font = previousFont; } } @@ -177,7 +177,7 @@ void ewol::compositing::Text::printChar(const char32_t& _charcode) { // get a pointer on the glyph property : ewol::GlyphProperty* myGlyph = getGlyphPointer(_charcode); if (null == myGlyph) { - EWOL_ERROR(" font does not really existed ..."); + Log.error(" font does not really existed ..."); return; } int32_t fontSize = getSize(); @@ -188,7 +188,7 @@ void ewol::compositing::Text::printChar(const char32_t& _charcode) { if (m_kerning == true) { kerningOffset = myGlyph->kerningGet(m_previousCharcode); if (kerningOffset != 0) { - //EWOL_DEBUG("Kerning between : '" << m_previousCharcode << "'&'" << myGlyph->m_UVal << "' value : " << kerningOffset); + //Log.debug("Kerning between : '" << m_previousCharcode << "'&'" << myGlyph->m_UVal << "' value : " << kerningOffset); } } // 0x01 == 0x20 == ' '; @@ -271,7 +271,7 @@ void ewol::compositing::Text::printChar(const char32_t& _charcode) { * 3------2 */ if (m_needDisplay == true) { - vec3 bitmapDrawPos[4]; + Vector3f bitmapDrawPos[4]; bitmapDrawPos[0].setValue((int32_t)dxA, (int32_t)dyC, 0); bitmapDrawPos[1].setValue((int32_t)dxB, (int32_t)dyC, 0); bitmapDrawPos[2].setValue((int32_t)dxB, (int32_t)dyD, 0); @@ -282,7 +282,7 @@ void ewol::compositing::Text::printChar(const char32_t& _charcode) { * | | * 3------2 */ - vec2 texturePos[4]; + Vector2f texturePos[4]; texturePos[0].setValue(tuA+m_mode, tvC); texturePos[1].setValue(tuB+m_mode, tvC); texturePos[2].setValue(tuB+m_mode, tvD); @@ -332,9 +332,9 @@ void ewol::compositing::Text::printChar(const char32_t& _charcode) { } } // move the position : - //EWOL_DEBUG(" 5 pos=" << m_position << " advance=" << myGlyph->m_advance.x() << " kerningOffset=" << kerningOffset); + //Log.debug(" 5 pos=" << m_position << " advance=" << myGlyph->m_advance.x() << " kerningOffset=" << kerningOffset); m_position.setX(m_position.x() + myGlyph->m_advance.x() + kerningOffset); - //EWOL_DEBUG(" 6 print '" << charcode << "' : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); + //Log.debug(" 6 print '" << charcode << "' : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); // Register the previous character m_previousCharcode = _charcode; m_VBO->flush(); @@ -342,7 +342,7 @@ void ewol::compositing::Text::printChar(const char32_t& _charcode) { } -vec3 ewol::compositing::Text::calculateSizeChar(const char32_t& _charcode) { +Vector3f ewol::compositing::Text::calculateSizeChar(const char32_t& _charcode) { // get a pointer on the glyph property : ewol::GlyphProperty * myGlyph = getGlyphPointer(_charcode); int32_t fontHeigh = getHeight(); @@ -352,7 +352,7 @@ vec3 ewol::compositing::Text::calculateSizeChar(const char32_t& _charcode) { } else { EWOL_WARNING("no Glyph... in font : " << m_font->getName()); } - return vec3((float)(0.2), + return Vector3f((float)(0.2), (float)(fontHeigh), (float)(0.0)); } @@ -362,7 +362,7 @@ vec3 ewol::compositing::Text::calculateSizeChar(const char32_t& _charcode) { kerningOffset = myGlyph->kerningGet(m_previousCharcode); } - vec3 outputSize((float)(myGlyph->m_advance.x() + kerningOffset), + Vector3f outputSize((float)(myGlyph->m_advance.x() + kerningOffset), (float)(fontHeigh), (float)(0.0)); // Register the previous character diff --git a/src/org/atriasoft/ewol/compositing/Text.java b/src/org/atriasoft/ewol/compositing/Text.java index 8e9d3ac..5916387 100644 --- a/src/org/atriasoft/ewol/compositing/Text.java +++ b/src/org/atriasoft/ewol/compositing/Text.java @@ -49,7 +49,7 @@ namespace ewol { virtual void setFont(etk::String _fontName, int32_t _fontSize); virtual void setFontMode(enum ewol::font::mode _mode); virtual void printChar(const char32_t& _charcode); - virtual vec3 calculateSizeChar(const char32_t& _charcode); + virtual Vector3f calculateSizeChar(const char32_t& _charcode); }; } } diff --git a/src/org/atriasoft/ewol/compositing/TextBase.cpp b/src/org/atriasoft/ewol/compositing/TextBase.cpp index 1869c9e..56c8dba 100644 --- a/src/org/atriasoft/ewol/compositing/TextBase.cpp +++ b/src/org/atriasoft/ewol/compositing/TextBase.cpp @@ -49,7 +49,7 @@ ewol::compositing::TextBase::TextBase(const etk::String& _shaderName, bool _load // Create the VBO: m_VBO = gale::resource::VirtualBufferObject::create(NB_VBO); if (m_VBO == null) { - EWOL_ERROR("can not instanciate VBO ..."); + Log.error("can not instanciate VBO ..."); return; } // TO facilitate some debugs we add a name of the VBO: @@ -75,23 +75,23 @@ void ewol::compositing::TextBase::loadProgram(const etk::String& _shaderName) { m_GLtextWidth = m_GLprogram->getUniform("EW_texWidth"); m_GLtextHeight = m_GLprogram->getUniform("EW_texHeight"); } else { - EWOL_ERROR("Can not load the program => create previous one..."); + Log.error("Can not load the program => create previous one..."); m_GLprogram = old; old = null; } } -void ewol::compositing::TextBase::translate(const vec3& _vect) { +void ewol::compositing::TextBase::translate(const Vector3f& _vect) { ewol::Compositing::translate(_vect); m_vectorialDraw.translate(_vect); } -void ewol::compositing::TextBase::rotate(const vec3& _vect, float _angle) { +void ewol::compositing::TextBase::rotate(const Vector3f& _vect, float _angle) { ewol::Compositing::rotate(_vect, _angle); m_vectorialDraw.rotate(_vect, _angle); } -void ewol::compositing::TextBase::scale(const vec3& _vect) { +void ewol::compositing::TextBase::scale(const Vector3f& _vect) { ewol::Compositing::scale(_vect); m_vectorialDraw.scale(_vect); } @@ -108,9 +108,9 @@ void ewol::compositing::TextBase::clear() { } void ewol::compositing::TextBase::reset() { - m_position = vec3(0,0,0); - m_clippingPosStart = vec3(0,0,0); - m_clippingPosStop = vec3(0,0,0); + m_position = Vector3f(0,0,0); + m_clippingPosStart = Vector3f(0,0,0); + m_clippingPosStop = Vector3f(0,0,0); m_sizeDisplayStart = m_position; m_sizeDisplayStop = m_position; m_nbCharDisplayed = 0; @@ -130,15 +130,15 @@ void ewol::compositing::TextBase::reset() { m_nbCharDisplayed = 0; } -void ewol::compositing::TextBase::setPos(const vec3& _pos) { +void ewol::compositing::TextBase::setPos(const Vector3f& _pos) { // check min max for display area if (m_nbCharDisplayed != 0) { - EWOL_VERBOSE("update size 1 " << m_sizeDisplayStart << " " << m_sizeDisplayStop); + Log.verbose("update size 1 " << m_sizeDisplayStart << " " << m_sizeDisplayStop); m_sizeDisplayStop.setX(etk::max(m_position.x(), m_sizeDisplayStop.x())); m_sizeDisplayStop.setY(etk::max(m_position.y(), m_sizeDisplayStop.y())); m_sizeDisplayStart.setX(etk::min(m_position.x(), m_sizeDisplayStart.x())); m_sizeDisplayStart.setY(etk::min(m_position.y(), m_sizeDisplayStart.y())); - EWOL_VERBOSE("update size 2 " << m_sizeDisplayStart << " " << m_sizeDisplayStop); + Log.verbose("update size 2 " << m_sizeDisplayStart << " " << m_sizeDisplayStop); } // update position m_position = _pos; @@ -149,18 +149,18 @@ void ewol::compositing::TextBase::setPos(const vec3& _pos) { m_sizeDisplayStart = m_position; m_sizeDisplayStop = m_position; m_sizeDisplayStop.setY( m_sizeDisplayStop.y()+ getHeight()); - EWOL_VERBOSE("update size 0 " << m_sizeDisplayStart << " " << m_sizeDisplayStop); + Log.verbose("update size 0 " << m_sizeDisplayStart << " " << m_sizeDisplayStop); } else { - EWOL_VERBOSE("update size 3 " << m_sizeDisplayStart << " " << m_sizeDisplayStop); + Log.verbose("update size 3 " << m_sizeDisplayStart << " " << m_sizeDisplayStop); m_sizeDisplayStop.setX(etk::max(m_position.x(), m_sizeDisplayStop.x())); m_sizeDisplayStop.setY(etk::max(m_position.y(), m_sizeDisplayStop.y())); m_sizeDisplayStart.setX(etk::min(m_position.x(), m_sizeDisplayStart.x())); m_sizeDisplayStart.setY(etk::min(m_position.y(), m_sizeDisplayStart.y())); - EWOL_VERBOSE("update size 4 " << m_sizeDisplayStart << " " << m_sizeDisplayStop); + Log.verbose("update size 4 " << m_sizeDisplayStart << " " << m_sizeDisplayStop); } } -void ewol::compositing::TextBase::setRelPos(const vec3& _pos) { +void ewol::compositing::TextBase::setRelPos(const Vector3f& _pos) { m_position += _pos; m_previousCharcode = 0; m_vectorialDraw.setPos(m_position); @@ -171,7 +171,7 @@ void ewol::compositing::TextBase::setColorBg(const etk::Color<>& _color) { m_vectorialDraw.setColor(_color); } -void ewol::compositing::TextBase::setClipping(const vec3& _pos, const vec3& _posEnd) { +void ewol::compositing::TextBase::setClipping(const Vector3f& _pos, const Vector3f& _posEnd) { // note the internal system all time request to have a bounding all time in the same order if (_pos.x() <= _posEnd.x()) { m_clippingPosStart.setX(_pos.x()); @@ -244,12 +244,12 @@ void ewol::compositing::TextBase::setKerningMode(bool _newMode) { } void ewol::compositing::TextBase::print(const etk::UString& _text) { - etk::Vector decorationEmpty; + List decorationEmpty; print(_text, decorationEmpty); } void ewol::compositing::TextBase::print(const etk::String& _text) { - etk::Vector decorationEmpty; + List decorationEmpty; print(_text, decorationEmpty); } @@ -257,7 +257,7 @@ void ewol::compositing::TextBase::print(const etk::String& _text) { void ewol::compositing::TextBase::parseHtmlNode(const exml::Element& _element) { // get the static real pointer if (_element.exist() == false) { - EWOL_ERROR( "Error Input node does not existed ..."); + Log.error( "Error Input node does not existed ..."); return; } for(auto it : _element.nodes) { @@ -266,23 +266,23 @@ void ewol::compositing::TextBase::parseHtmlNode(const exml::Element& _element) { continue; } else if (it.isText() == true) { htmlAddData(etk::toUString(it.getValue())); - EWOL_VERBOSE("XML add : " << it.getValue()); + Log.verbose("XML add : " << it.getValue()); continue; } else if (it.isElement() == false) { - EWOL_ERROR("(l "<< it.getPos() << ") node not suported type : " << it.getType() << " val='"<< it.getValue() << "'" ); + Log.error("(l "<< it.getPos() << ") node not suported type : " << it.getType() << " val='"<< it.getValue() << "'" ); continue; } exml::Element elem = it.toElement(); if (elem.exist() == false) { - EWOL_ERROR("Cast error ..."); + Log.error("Cast error ..."); continue; } if(etk::compare_no_case(elem.getValue(), "br") == true) { htmlFlush(); - EWOL_VERBOSE("XML flush & newLine"); + Log.verbose("XML flush & newLine"); forceLineReturn(); } else if (etk::compare_no_case(elem.getValue(), "font") == true) { - EWOL_VERBOSE("XML Font ..."); + Log.verbose("XML Font ..."); TextDecoration tmpDeco = m_htmlDecoTmp; etk::String colorValue = elem.attributes["color"]; if (colorValue.size() != 0) { @@ -296,7 +296,7 @@ void ewol::compositing::TextBase::parseHtmlNode(const exml::Element& _element) { m_htmlDecoTmp = tmpDeco; } else if( etk::compare_no_case(elem.getValue(), "b") == true || etk::compare_no_case(elem.getValue(), "bold") == true) { - EWOL_VERBOSE("XML bold ..."); + Log.verbose("XML bold ..."); TextDecoration tmpDeco = m_htmlDecoTmp; if (m_htmlDecoTmp.m_mode == ewol::font::Regular) { m_htmlDecoTmp.m_mode = ewol::font::Bold; @@ -307,7 +307,7 @@ void ewol::compositing::TextBase::parseHtmlNode(const exml::Element& _element) { m_htmlDecoTmp = tmpDeco; } else if( etk::compare_no_case(elem.getValue(), "i") == true || etk::compare_no_case(elem.getValue(), "italic") == true) { - EWOL_VERBOSE("XML italic ..."); + Log.verbose("XML italic ..."); TextDecoration tmpDeco = m_htmlDecoTmp; if (m_htmlDecoTmp.m_mode == ewol::font::Regular) { m_htmlDecoTmp.m_mode = ewol::font::Italic; @@ -318,38 +318,38 @@ void ewol::compositing::TextBase::parseHtmlNode(const exml::Element& _element) { m_htmlDecoTmp = tmpDeco; } else if( etk::compare_no_case(elem.getValue(), "u") == true || etk::compare_no_case(elem.getValue(), "underline") == true) { - EWOL_VERBOSE("XML underline ..."); + Log.verbose("XML underline ..."); parseHtmlNode(elem); } else if( etk::compare_no_case(elem.getValue(), "p") == true || etk::compare_no_case(elem.getValue(), "paragraph") == true) { - EWOL_VERBOSE("XML paragraph ..."); + Log.verbose("XML paragraph ..."); htmlFlush(); m_alignement = alignLeft; forceLineReturn(); parseHtmlNode(elem); forceLineReturn(); } else if (etk::compare_no_case(elem.getValue(), "center") == true) { - EWOL_VERBOSE("XML center ..."); + Log.verbose("XML center ..."); htmlFlush(); m_alignement = alignCenter; parseHtmlNode(elem); } else if (etk::compare_no_case(elem.getValue(), "left") == true) { - EWOL_VERBOSE("XML left ..."); + Log.verbose("XML left ..."); htmlFlush(); m_alignement = alignLeft; parseHtmlNode(elem); } else if (etk::compare_no_case(elem.getValue(), "right") == true) { - EWOL_VERBOSE("XML right ..."); + Log.verbose("XML right ..."); htmlFlush(); m_alignement = alignRight; parseHtmlNode(elem); } else if (etk::compare_no_case(elem.getValue(), "justify") == true) { - EWOL_VERBOSE("XML justify ..."); + Log.verbose("XML justify ..."); htmlFlush(); m_alignement = alignJustify; parseHtmlNode(elem); } else { - EWOL_ERROR("(l "<< elem.getPos() << ") node not suported type: " << elem.getType() << " val='"<< elem.getValue() << "'" ); + Log.error("(l "<< elem.getPos() << ") node not suported type: " << elem.getType() << " val='"<< elem.getValue() << "'" ); } } } @@ -358,7 +358,7 @@ void ewol::compositing::TextBase::printDecorated(const etk::String& _text) { etk::String tmpData("\n\n"); tmpData += _text; tmpData += "\n\n\n"; - //EWOL_DEBUG("plop : " << tmpData); + //Log.debug("plop : " << tmpData); printHTML(tmpData); } @@ -366,7 +366,7 @@ void ewol::compositing::TextBase::printDecorated(const etk::UString& _text) { etk::UString tmpData(U"\n\n"); tmpData += _text; tmpData += U"\n\n\n"; - //EWOL_DEBUG("plop : " << tmpData); + //Log.debug("plop : " << tmpData); printHTML(tmpData); } @@ -379,19 +379,19 @@ void ewol::compositing::TextBase::printHTML(const etk::String& _text) { m_htmlDecoTmp.m_mode = ewol::font::Regular; if (doc.parse(_text) == false) { - EWOL_ERROR( "can not load XML: PARSING error: Decorated text "); + Log.error( "can not load XML: PARSING error: Decorated text "); return; } exml::Element root = doc.nodes["html"]; if (root.exist() == false) { - EWOL_ERROR( "can not load XML: main node not find: 'html'"); + Log.error( "can not load XML: main node not find: 'html'"); doc.display(); return; } exml::Element bodyNode = root.nodes["body"]; if (root.exist() == false) { - EWOL_ERROR( "can not load XML: main node not find: 'body'"); + Log.error( "can not load XML: main node not find: 'body'"); return; } parseHtmlNode(bodyNode); @@ -407,30 +407,30 @@ void ewol::compositing::TextBase::printHTML(const etk::UString& _text) { m_htmlDecoTmp.m_mode = ewol::font::Regular; // TODO : Create an instance of xml parser to manage etk::UString... if (doc.parse(etk::toString(_text)) == false) { - EWOL_ERROR( "can not load XML: PARSING error: Decorated text "); + Log.error( "can not load XML: PARSING error: Decorated text "); return; } exml::Element root = doc.nodes["html"]; if (root.exist() == false) { - EWOL_ERROR( "can not load XML: main node not find: 'html'"); + Log.error( "can not load XML: main node not find: 'html'"); doc.display(); return; } exml::Element bodyNode = root.nodes["body"]; if (root.exist() == false) { - EWOL_ERROR( "can not load XML: main node not find: 'body'"); + Log.error( "can not load XML: main node not find: 'body'"); return; } parseHtmlNode(bodyNode); htmlFlush(); } -void ewol::compositing::TextBase::print(const etk::String& _text, const etk::Vector& _decoration) { +void ewol::compositing::TextBase::print(const etk::String& _text, const List& _decoration) { etk::Color<> tmpFg(m_color); etk::Color<> tmpBg(m_colorBg); if (m_alignement == alignDisable) { - //EWOL_DEBUG(" 1 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); + //Log.debug(" 1 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); // display the cursor if needed (if it is at the start position...) if (m_needDisplay == true) { if (0 == m_cursorPos) { @@ -462,11 +462,11 @@ void ewol::compositing::TextBase::print(const etk::String& _text, const etk::Vec } if( m_needDisplay == true && m_colorBg.a() != 0) { - vec3 pos = m_position; + Vector3f pos = m_position; m_vectorialDraw.setPos(pos); printChar(_text[iii]); float fontHeigh = getHeight(); - m_vectorialDraw.rectangleWidth(vec3(m_position.x()-pos.x(),fontHeigh,0.0f) ); + m_vectorialDraw.rectangleWidth(Vector3f(m_position.x()-pos.x(),fontHeigh,0.0f) ); m_nbCharDisplayed++; } else { printChar(_text[iii]); @@ -481,9 +481,9 @@ void ewol::compositing::TextBase::print(const etk::String& _text, const etk::Vec } } } - //EWOL_DEBUG(" 2 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); + //Log.debug(" 2 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); } else { - //EWOL_DEBUG(" 3 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); + //Log.debug(" 3 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); // special start case at the right of the endpoint : if (m_stopTextPos < m_position.x()) { forceLineReturn(); @@ -509,7 +509,7 @@ void ewol::compositing::TextBase::print(const etk::String& _text, const etk::Vec case alignRight: if (m_needDisplay == true) { // Move the first char at the right : - setPos(vec3(m_position.x() + freeSpace, + setPos(Vector3f(m_position.x() + freeSpace, m_position.y(), m_position.z()) ); } @@ -517,7 +517,7 @@ void ewol::compositing::TextBase::print(const etk::String& _text, const etk::Vec case alignCenter: if (m_needDisplay == true) { // Move the first char at the right : - setPos(vec3(m_position.x() + freeSpace/2, + setPos(Vector3f(m_position.x() + freeSpace/2, m_position.y(), m_position.z()) ); } @@ -552,27 +552,27 @@ void ewol::compositing::TextBase::print(const etk::String& _text, const etk::Vec } // special for the justify mode if ((char32_t)_text[iii] == u32char::Space) { - //EWOL_DEBUG(" generateString : \" \""); + //Log.debug(" generateString : \" \""); if( m_needDisplay == true && m_colorBg.a() != 0) { m_vectorialDraw.setPos(m_position); } // Must generate a dynamic space : - setPos(vec3(m_position.x() + interpolation, + setPos(Vector3f(m_position.x() + interpolation, m_position.y(), m_position.z()) ); if( m_needDisplay == true && m_colorBg.a() != 0) { - m_vectorialDraw.rectangleWidth(vec3(interpolation,fontHeigh,0.0f) ); + m_vectorialDraw.rectangleWidth(Vector3f(interpolation,fontHeigh,0.0f) ); } } else { - //EWOL_DEBUG(" generateString : \"" << (char)text[iii] << "\""); + //Log.debug(" generateString : \"" << (char)text[iii] << "\""); if( m_needDisplay == true && m_colorBg.a() != 0) { - vec3 pos = m_position; + Vector3f pos = m_position; m_vectorialDraw.setPos(pos); printChar(_text[iii]); - m_vectorialDraw.rectangleWidth(vec3(m_position.x()-pos.x(),fontHeigh,0.0f) ); + m_vectorialDraw.rectangleWidth(Vector3f(m_position.x()-pos.x(),fontHeigh,0.0f) ); m_nbCharDisplayed++; } else { printChar(_text[iii]); @@ -592,14 +592,14 @@ void ewol::compositing::TextBase::print(const etk::String& _text, const etk::Vec } else if((char32_t)_text[stop] == u32char::Space) { currentId = stop+1; // reset position : - setPos(vec3(m_startTextpos, + setPos(Vector3f(m_startTextpos, (float)(m_position.y() - getHeight()), m_position.z()) ); m_nbCharDisplayed++; } else if((char32_t)_text[stop] == u32char::Return) { currentId = stop+1; // reset position : - setPos(vec3(m_startTextpos, + setPos(Vector3f(m_startTextpos, (float)(m_position.y() - getHeight()), m_position.z()) ); m_nbCharDisplayed++; @@ -607,15 +607,15 @@ void ewol::compositing::TextBase::print(const etk::String& _text, const etk::Vec currentId = stop; } } - //EWOL_DEBUG(" 4 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); + //Log.debug(" 4 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); } } -void ewol::compositing::TextBase::print(const etk::UString& _text, const etk::Vector& _decoration) { +void ewol::compositing::TextBase::print(const etk::UString& _text, const List& _decoration) { etk::Color<> tmpFg(m_color); etk::Color<> tmpBg(m_colorBg); if (m_alignement == alignDisable) { - //EWOL_DEBUG(" 1 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); + //Log.debug(" 1 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); // display the cursor if needed (if it is at the start position...) if (m_needDisplay == true) { if (0 == m_cursorPos) { @@ -647,11 +647,11 @@ void ewol::compositing::TextBase::print(const etk::UString& _text, const etk::Ve } if( m_needDisplay == true && m_colorBg.a() != 0) { - vec3 pos = m_position; + Vector3f pos = m_position; m_vectorialDraw.setPos(pos); printChar(_text[iii]); float fontHeigh = getHeight(); - m_vectorialDraw.rectangleWidth(vec3(m_position.x()-pos.x(),fontHeigh,0.0f) ); + m_vectorialDraw.rectangleWidth(Vector3f(m_position.x()-pos.x(),fontHeigh,0.0f) ); m_nbCharDisplayed++; } else { printChar(_text[iii]); @@ -666,9 +666,9 @@ void ewol::compositing::TextBase::print(const etk::UString& _text, const etk::Ve } } } - //EWOL_DEBUG(" 2 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); + //Log.debug(" 2 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); } else { - //EWOL_DEBUG(" 3 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); + //Log.debug(" 3 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); // special start case at the right of the endpoint : if (m_stopTextPos < m_position.x()) { forceLineReturn(); @@ -694,7 +694,7 @@ void ewol::compositing::TextBase::print(const etk::UString& _text, const etk::Ve case alignRight: if (m_needDisplay == true) { // Move the first char at the right : - setPos(vec3(m_position.x() + freeSpace, + setPos(Vector3f(m_position.x() + freeSpace, m_position.y(), m_position.z()) ); } @@ -702,7 +702,7 @@ void ewol::compositing::TextBase::print(const etk::UString& _text, const etk::Ve case alignCenter: if (m_needDisplay == true) { // Move the first char at the right : - setPos(vec3(m_position.x() + freeSpace/2, + setPos(Vector3f(m_position.x() + freeSpace/2, m_position.y(), m_position.z()) ); } @@ -737,27 +737,27 @@ void ewol::compositing::TextBase::print(const etk::UString& _text, const etk::Ve } // special for the justify mode if ((char32_t)_text[iii] == u32char::Space) { - //EWOL_DEBUG(" generateString : \" \""); + //Log.debug(" generateString : \" \""); if( m_needDisplay == true && m_colorBg.a() != 0) { m_vectorialDraw.setPos(m_position); } // Must generate a dynamic space : - setPos(vec3(m_position.x() + interpolation, + setPos(Vector3f(m_position.x() + interpolation, m_position.y(), m_position.z()) ); if( m_needDisplay == true && m_colorBg.a() != 0) { - m_vectorialDraw.rectangleWidth(vec3(interpolation,fontHeigh,0.0f) ); + m_vectorialDraw.rectangleWidth(Vector3f(interpolation,fontHeigh,0.0f) ); } } else { - //EWOL_DEBUG(" generateString : \"" << (char)text[iii] << "\""); + //Log.debug(" generateString : \"" << (char)text[iii] << "\""); if( m_needDisplay == true && m_colorBg.a() != 0) { - vec3 pos = m_position; + Vector3f pos = m_position; m_vectorialDraw.setPos(pos); printChar(_text[iii]); - m_vectorialDraw.rectangleWidth(vec3(m_position.x()-pos.x(),fontHeigh,0.0f) ); + m_vectorialDraw.rectangleWidth(Vector3f(m_position.x()-pos.x(),fontHeigh,0.0f) ); m_nbCharDisplayed++; } else { printChar(_text[iii]); @@ -777,14 +777,14 @@ void ewol::compositing::TextBase::print(const etk::UString& _text, const etk::Ve } else if(_text[stop] == u32char::Space) { currentId = stop+1; // reset position : - setPos(vec3(m_startTextpos, + setPos(Vector3f(m_startTextpos, (float)(m_position.y() - getHeight()), m_position.z()) ); m_nbCharDisplayed++; } else if(_text[stop] == u32char::Return) { currentId = stop+1; // reset position : - setPos(vec3(m_startTextpos, + setPos(Vector3f(m_startTextpos, (float)(m_position.y() - getHeight()), m_position.z()) ); m_nbCharDisplayed++; @@ -792,7 +792,7 @@ void ewol::compositing::TextBase::print(const etk::UString& _text, const etk::Ve currentId = stop; } } - //EWOL_DEBUG(" 4 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); + //Log.debug(" 4 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); } } @@ -801,7 +801,7 @@ void ewol::compositing::TextBase::print(const etk::UString& _text, const etk::Ve void ewol::compositing::TextBase::forceLineReturn() { // reset position : - setPos(vec3(m_startTextpos, m_position.y() - getHeight(), 0) ); + setPos(Vector3f(m_startTextpos, m_position.y() - getHeight(), 0) ); } void ewol::compositing::TextBase::setTextAlignement(float _startTextpos, float _stopTextPos, enum ewol::compositing::aligneMode _alignement) { @@ -810,7 +810,7 @@ void ewol::compositing::TextBase::setTextAlignement(float _startTextpos, float _ m_alignement = _alignement; if (m_startTextpos >= m_stopTextPos) { // TODO: understand why this flush ... - EWOL_VERBOSE("Request allignement with Borne position error : " << _startTextpos << " => " << _stopTextPos); + Log.verbose("Request allignement with Borne position error : " << _startTextpos << " => " << _stopTextPos); } } @@ -822,18 +822,18 @@ void ewol::compositing::TextBase::disableAlignement() { m_alignement = alignDisable; } -vec3 ewol::compositing::TextBase::calculateSizeHTML(const etk::String& _text) { +Vector3f ewol::compositing::TextBase::calculateSizeHTML(const etk::String& _text) { // remove intermediate result reset(); - //EWOL_DEBUG(" 0 size for=\n" << text); + //Log.debug(" 0 size for=\n" << text); // disable display system m_needDisplay = false; - setPos(vec3(0,0,0) ); + setPos(Vector3f(0,0,0) ); // same as print without the end display ... printHTML(_text); - //EWOL_DEBUG(" 1 Start pos=" << m_sizeDisplayStart); - //EWOL_DEBUG(" 1 Stop pos=" << m_sizeDisplayStop); + //Log.debug(" 1 Start pos=" << m_sizeDisplayStart); + //Log.debug(" 1 Stop pos=" << m_sizeDisplayStop); // get the last elements m_sizeDisplayStop.setValue(etk::max(m_position.x(), m_sizeDisplayStop.x()) , @@ -843,28 +843,28 @@ vec3 ewol::compositing::TextBase::calculateSizeHTML(const etk::String& _text) { etk::min(m_position.y(), m_sizeDisplayStart.y()) , 0); - //EWOL_DEBUG(" 2 Start pos=" << m_sizeDisplayStart); - //EWOL_DEBUG(" 2 Stop pos=" << m_sizeDisplayStop); + //Log.debug(" 2 Start pos=" << m_sizeDisplayStart); + //Log.debug(" 2 Stop pos=" << m_sizeDisplayStop); // set back the display system m_needDisplay = true; - return vec3( m_sizeDisplayStop.x()-m_sizeDisplayStart.x(), + return Vector3f( m_sizeDisplayStop.x()-m_sizeDisplayStart.x(), m_sizeDisplayStop.y()-m_sizeDisplayStart.y(), m_sizeDisplayStop.z()-m_sizeDisplayStart.z()); } -vec3 ewol::compositing::TextBase::calculateSizeHTML(const etk::UString& _text) { +Vector3f ewol::compositing::TextBase::calculateSizeHTML(const etk::UString& _text) { // remove intermediate result reset(); - //EWOL_DEBUG(" 0 size for=\n" << text); + //Log.debug(" 0 size for=\n" << text); // disable display system m_needDisplay = false; - setPos(vec3(0,0,0) ); + setPos(Vector3f(0,0,0) ); // same as print without the end display ... printHTML(_text); - //EWOL_DEBUG(" 1 Start pos=" << m_sizeDisplayStart); - //EWOL_DEBUG(" 1 Stop pos=" << m_sizeDisplayStop); + //Log.debug(" 1 Start pos=" << m_sizeDisplayStart); + //Log.debug(" 1 Stop pos=" << m_sizeDisplayStop); // get the last elements m_sizeDisplayStop.setValue(etk::max(m_position.x(), m_sizeDisplayStop.x()) , @@ -874,42 +874,42 @@ vec3 ewol::compositing::TextBase::calculateSizeHTML(const etk::UString& _text) { etk::min(m_position.y(), m_sizeDisplayStart.y()) , 0); - //EWOL_DEBUG(" 2 Start pos=" << m_sizeDisplayStart); - //EWOL_DEBUG(" 2 Stop pos=" << m_sizeDisplayStop); + //Log.debug(" 2 Start pos=" << m_sizeDisplayStart); + //Log.debug(" 2 Stop pos=" << m_sizeDisplayStop); // set back the display system m_needDisplay = true; - return vec3( m_sizeDisplayStop.x()-m_sizeDisplayStart.x(), + return Vector3f( m_sizeDisplayStop.x()-m_sizeDisplayStart.x(), m_sizeDisplayStop.y()-m_sizeDisplayStart.y(), m_sizeDisplayStop.z()-m_sizeDisplayStart.z()); } -vec3 ewol::compositing::TextBase::calculateSizeDecorated(const etk::String& _text) { +Vector3f ewol::compositing::TextBase::calculateSizeDecorated(const etk::String& _text) { if (_text.size() == 0) { - return vec3(0,0,0); + return Vector3f(0,0,0); } etk::String tmpData("\n"); tmpData+=_text; tmpData+="\n\n"; - vec3 tmpVal = calculateSizeHTML(tmpData); + Vector3f tmpVal = calculateSizeHTML(tmpData); return tmpVal; } -vec3 ewol::compositing::TextBase::calculateSizeDecorated(const etk::UString& _text) { +Vector3f ewol::compositing::TextBase::calculateSizeDecorated(const etk::UString& _text) { if (_text.size() == 0) { - return vec3(0,0,0); + return Vector3f(0,0,0); } etk::UString tmpData(U"\n"); tmpData += _text; tmpData += U"\n\n"; - vec3 tmpVal = calculateSizeHTML(tmpData); + Vector3f tmpVal = calculateSizeHTML(tmpData); return tmpVal; } -vec3 ewol::compositing::TextBase::calculateSize(const etk::String& _text) { - vec3 outputSize(0, 0, 0); +Vector3f ewol::compositing::TextBase::calculateSize(const etk::String& _text) { + Vector3f outputSize(0, 0, 0); for(auto element : _text) { - vec3 tmpp = calculateSize(element); + Vector3f tmpp = calculateSize(element); if (outputSize.y() == 0) { outputSize.setY(tmpp.y()); } @@ -918,10 +918,10 @@ vec3 ewol::compositing::TextBase::calculateSize(const etk::String& _text) { return outputSize; } -vec3 ewol::compositing::TextBase::calculateSize(const etk::UString& _text) { - vec3 outputSize(0, 0, 0); +Vector3f ewol::compositing::TextBase::calculateSize(const etk::UString& _text) { + Vector3f outputSize(0, 0, 0); for(auto element : _text) { - vec3 tmpp = calculateSize(element); + Vector3f tmpp = calculateSize(element); if (outputSize.y() == 0) { outputSize.setY(tmpp.y()); } @@ -933,10 +933,10 @@ vec3 ewol::compositing::TextBase::calculateSize(const etk::UString& _text) { void ewol::compositing::TextBase::printCursor(bool _isInsertMode, float _cursorSize) { int32_t fontHeigh = getHeight(); if (true == _isInsertMode) { - m_vectorialDraw.rectangleWidth(vec3(_cursorSize, fontHeigh, 0) ); + m_vectorialDraw.rectangleWidth(Vector3f(_cursorSize, fontHeigh, 0) ); } else { m_vectorialDraw.setThickness(2); - m_vectorialDraw.lineRel( vec3(0, fontHeigh, 0) ); + m_vectorialDraw.lineRel( Vector3f(0, fontHeigh, 0) ); m_vectorialDraw.setThickness(0); } } @@ -965,7 +965,7 @@ bool ewol::compositing::TextBase::extrapolateLastId(const etk::String& _text, } for (size_t iii=_start; iii<_text.size(); iii++) { - vec3 tmpSize = calculateSize(_text[iii]); + Vector3f tmpSize = calculateSize(_text[iii]); // check oveflow : if (endPos + tmpSize.x() > stopPosition) { _stop = iii; @@ -1028,7 +1028,7 @@ bool ewol::compositing::TextBase::extrapolateLastId(const etk::UString& _text, } for (size_t iii=_start; iii<_text.size(); iii++) { - vec3 tmpSize = calculateSize(_text[iii]); + Vector3f tmpSize = calculateSize(_text[iii]); // check oveflow : if (endPos + tmpSize.x() > stopPosition) { _stop = iii; diff --git a/src/org/atriasoft/ewol/compositing/TextBase.java b/src/org/atriasoft/ewol/compositing/TextBase.java index fa37b31..f500650 100644 --- a/src/org/atriasoft/ewol/compositing/TextBase.java +++ b/src/org/atriasoft/ewol/compositing/TextBase.java @@ -49,12 +49,12 @@ namespace ewol { }; protected: int32_t m_nbCharDisplayed; //!< prevent some error in calculation size. - vec3 m_sizeDisplayStart; //!< The start windows of the display. - vec3 m_sizeDisplayStop; //!< The end windows of the display. + Vector3f m_sizeDisplayStart; //!< The start windows of the display. + Vector3f m_sizeDisplayStop; //!< The end windows of the display. bool m_needDisplay; //!< This just need the display and not the size rendering. - vec3 m_position; //!< The current position to draw - vec3 m_clippingPosStart; //!< Clipping start position - vec3 m_clippingPosStop; //!< Clipping stop position + Vector3f m_position; //!< The current position to draw + Vector3f m_clippingPosStart; //!< Clipping start position + Vector3f m_clippingPosStop; //!< Clipping stop position bool m_clippingEnable; //!< true if the clipping must be activated protected: etk::Color m_defaultColorFg; //!< The text foreground color @@ -105,9 +105,9 @@ namespace ewol { */ virtual ~TextBase(); public: // Derived function - void translate(const vec3& _vect); - void rotate(const vec3& _vect, float _angle); - void scale(const vec3& _vect); + void translate(const Vector3f& _vect); + void rotate(const Vector3f& _vect, float _angle); + void scale(const Vector3f& _vect); public: /** * @brief draw All the refistered text in the current element on openGL @@ -137,26 +137,26 @@ namespace ewol { * @brief get the current display position (sometime needed in the gui control) * @return the current position. */ - const vec3& getPos() { + const Vector3f& getPos() { return m_position; }; /** * @brief set position for the next text writen * @param[in] _pos Position of the text (in 3D) */ - void setPos(const vec3& _pos); + void setPos(const Vector3f& _pos); //! @previous - inline void setPos(const vec2& _pos) { - setPos(vec3(_pos.x(),_pos.y(),0)); + inline void setPos(const Vector2f& _pos) { + setPos(Vector3f(_pos.x(),_pos.y(),0)); }; /** * @brief set relative position for the next text writen * @param[in] _pos ofset apply of the text (in 3D) */ - void setRelPos(const vec3& _pos); + void setRelPos(const Vector3f& _pos); //! @previous - inline void setRelPos(const vec2& _pos) { - setRelPos(vec3(_pos.x(),_pos.y(),0)); + inline void setRelPos(const Vector2f& _pos) { + setRelPos(Vector3f(_pos.x(),_pos.y(),0)); }; /** * @brief set the default background color of the font (when reset, set this value ...) @@ -189,11 +189,11 @@ namespace ewol { * @param[in] _pos Start position of the clipping * @param[in] _width Width size of the clipping */ - void setClippingWidth(const vec3& _pos, const vec3& _width) { + void setClippingWidth(const Vector3f& _pos, const Vector3f& _width) { setClipping(_pos, _pos+_width); } //! @previous - void setClippingWidth(const vec2& _pos, const vec2& _width) { + void setClippingWidth(const Vector2f& _pos, const Vector2f& _width) { setClipping(_pos, _pos+_width); }; /** @@ -201,10 +201,10 @@ namespace ewol { * @param[in] _pos Start position of the clipping * @param[in] _posEnd End position of the clipping */ - void setClipping(const vec3& _pos, const vec3& _posEnd); + void setClipping(const Vector3f& _pos, const Vector3f& _posEnd); //! @previous - void setClipping(const vec2& _pos, const vec2& _posEnd) { - setClipping(vec3(_pos.x(),_pos.y(),-1), vec3(_posEnd.x(),_posEnd.y(),1) ); + void setClipping(const Vector2f& _pos, const Vector2f& _posEnd) { + setClipping(Vector3f(_pos.x(),_pos.y(),-1), Vector3f(_posEnd.x(),_posEnd.y(),1) ); }; /** * @brief enable/Disable the clipping (without lose the current clipping position) @@ -338,9 +338,9 @@ namespace ewol { * @param[in] _text The string to display. * @param[in] _decoration The text decoration for the text that might be display (if the vector is smaller, the last parameter is get) */ - void print(const etk::String& _text, const etk::Vector& _decoration); + void print(const etk::String& _text, const List& _decoration); //! @previous - void print(const etk::UString& _text, const etk::Vector& _decoration); + void print(const etk::UString& _text, const List& _decoration); /** * @brief display the current char in the current element (note that the kerning is availlable if the position is not changed) * @param[in] _charcode Char that might be dispalyed @@ -379,36 +379,36 @@ namespace ewol { * @param[in] _text The string to calculate dimention. * @return The theoric size used. */ - vec3 calculateSizeHTML(const etk::String& _text); + Vector3f calculateSizeHTML(const etk::String& _text); //! @previous - vec3 calculateSizeHTML(const etk::UString& _text); + Vector3f calculateSizeHTML(const etk::UString& _text); /** * @brief calculate a theoric text size * @param[in] _text The string to calculate dimention. * @return The theoric size used. */ - vec3 calculateSizeDecorated(const etk::String& _text); + Vector3f calculateSizeDecorated(const etk::String& _text); //! @previous - vec3 calculateSizeDecorated(const etk::UString& _text); + Vector3f calculateSizeDecorated(const etk::UString& _text); /** * @brief calculate a theoric text size * @param[in] _text The string to calculate dimention. * @return The theoric size used. */ - vec3 calculateSize(const etk::String& _text); + Vector3f calculateSize(const etk::String& _text); //! @previous - vec3 calculateSize(const etk::UString& _text); + Vector3f 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. */ - inline vec3 calculateSize(const char32_t& _charcode) { + inline Vector3f calculateSize(const char32_t& _charcode) { return calculateSizeChar(_charcode); }; protected: //! @previous - virtual vec3 calculateSizeChar(const char32_t& _charcode) = 0; + virtual Vector3f calculateSizeChar(const char32_t& _charcode) = 0; public: /** * @brief draw a cursor at the specify position @@ -434,7 +434,7 @@ namespace ewol { protected: // this section is reserved for HTML parsing and display: etk::UString m_htmlCurrrentLine; //!< current line for HTML display - etk::Vector m_htmlDecoration; //!< current decoration for the HTML display + List m_htmlDecoration; //!< current decoration for the HTML display TextDecoration m_htmlDecoTmp; //!< current decoration /** * @brief add a line with the current m_htmlDecoTmp decoration diff --git a/src/org/atriasoft/ewol/compositing/TextDF.cpp b/src/org/atriasoft/ewol/compositing/TextDF.cpp index 41430ac..1c275d3 100644 --- a/src/org/atriasoft/ewol/compositing/TextDF.cpp +++ b/src/org/atriasoft/ewol/compositing/TextDF.cpp @@ -24,7 +24,7 @@ ewol::compositing::TextDF::~TextDF() { } -void ewol::compositing::TextDF::updateSizeToRender(const vec2& _size) { +void ewol::compositing::TextDF::updateSizeToRender(const Vector2f& _size) { float minSize = etk::min(_size.x(), _size.y()); if (m_fontDF != null) { setFontSize(m_fontDF->getSize(minSize)); @@ -44,7 +44,7 @@ void ewol::compositing::TextDF::drawMT(const mat4& _transformationMatrix, bool _ return; } if (m_GLprogram == null) { - EWOL_ERROR("No shader ..."); + Log.error("No shader ..."); return; } if (_enableDepthTest == true) { @@ -88,7 +88,7 @@ void ewol::compositing::TextDF::drawD(bool _disableDepthTest) { return; } if (m_GLprogram == null) { - EWOL_ERROR("No shader ..."); + Log.error("No shader ..."); return; } // set Matrix: translation/positionMatrix @@ -134,7 +134,7 @@ ewol::GlyphProperty * ewol::compositing::TextDF::getGlyphPointer(char32_t _charc void ewol::compositing::TextDF::setFontSize(int32_t _fontSize) { clear(); - EWOL_VERBOSE("Set font Size: " << _fontSize); + Log.verbose("Set font Size: " << _fontSize); if (_fontSize <= 1) { m_size = ewol::getContext().getFontDefault().getSize(); } else { @@ -152,11 +152,11 @@ void ewol::compositing::TextDF::setFontName(const etk::String& _fontName) { } else { fontName = _fontName; } - EWOL_VERBOSE("Set font name: '" << fontName << "'"); + Log.verbose("Set font name: '" << fontName << "'"); // link to new one m_fontDF = ewol::resource::DistanceFieldFont::create(fontName); if (m_fontDF == null) { - EWOL_ERROR("Can not get find resource"); + Log.error("Can not get find resource"); m_fontDF = previousFont; } } @@ -178,7 +178,7 @@ void ewol::compositing::TextDF::printChar(const char32_t& _charcode) { // get a pointer on the glyph property : ewol::GlyphProperty* myGlyph = getGlyphPointer(_charcode); if (null == myGlyph) { - EWOL_ERROR(" font does not really existed ..."); + Log.error(" font does not really existed ..."); return; } float fontSize = getSize(); @@ -191,7 +191,7 @@ void ewol::compositing::TextDF::printChar(const char32_t& _charcode) { if (true == m_kerning) { kerningOffset = myGlyph->kerningGet(m_previousCharcode); if (kerningOffset != 0) { - //EWOL_DEBUG("Kerning between : '" << m_previousCharcode << "'&'" << myGlyph->m_UVal << "' value : " << kerningOffset); + //Log.debug("Kerning between : '" << m_previousCharcode << "'&'" << myGlyph->m_UVal << "' value : " << kerningOffset); } } // 0x01 == 0x20 == ' '; @@ -223,7 +223,7 @@ void ewol::compositing::TextDF::printChar(const char32_t& _charcode) { float dyC = m_position.y() + (myGlyph->m_bearing.y() + fontHeigh - fontSize) * factorDisplay; float dyD = dyC - myGlyph->m_sizeTexture.y() * factorDisplay; #else - //EWOL_DEBUG(" plop : fontHeigh" << fontHeigh << " fontSize=" << fontSize); + //Log.debug(" plop : fontHeigh" << fontHeigh << " fontSize=" << fontSize); float dxA = m_position.x() + ((float)myGlyph->m_bearing.x() + kerningOffset - (float)m_fontDF->getPixelBorderSize()*0.5f) * factorDisplay; float dxB = dxA + ((float)myGlyph->m_sizeTexture.x() + (float)m_fontDF->getPixelBorderSize()) * factorDisplay; float dyC = m_position.y() + (fontHeigh - fontSize + ((float)myGlyph->m_bearing.y() + (float)m_fontDF->getPixelBorderSize()*0.5f) * factorDisplay); @@ -235,13 +235,13 @@ void ewol::compositing::TextDF::printChar(const char32_t& _charcode) { float tvC = myGlyph->m_texturePosStart.y(); float tvD = tvC + myGlyph->m_texturePosSize.y(); /* - vec3 drawingPos = m_vectorialDraw.getPos(); + Vector3f drawingPos = m_vectorialDraw.getPos(); etk::Color<> backColor = m_vectorialDraw.getColor(); - m_vectorialDraw.setPos(vec2(dxA, dyC)); + m_vectorialDraw.setPos(Vector2f(dxA, dyC)); m_vectorialDraw.setColor(etk::Color<>(0.0,1.0,0.0,1.0)); - m_vectorialDraw.rectangle(vec2(dxB, dyD)); + m_vectorialDraw.rectangle(Vector2f(dxB, dyD)); m_vectorialDraw.setPos(drawingPos); m_vectorialDraw.setColor(backColor); @@ -306,7 +306,7 @@ void ewol::compositing::TextDF::printChar(const char32_t& _charcode) { * 3------2 */ if (m_needDisplay == true) { - vec3 bitmapDrawPos[4]; + Vector3f bitmapDrawPos[4]; bitmapDrawPos[0].setValue(dxA+italicMove, dyC, 0); bitmapDrawPos[1].setValue(dxB+italicMove, dyC, 0); bitmapDrawPos[2].setValue(dxB, dyD, 0); @@ -317,7 +317,7 @@ void ewol::compositing::TextDF::printChar(const char32_t& _charcode) { * | | * 3------2 */ - vec2 texturePos[4]; + Vector2f texturePos[4]; texturePos[0].setValue(tuA+m_mode, tvC); texturePos[1].setValue(tuB+m_mode, tvC); texturePos[2].setValue(tuB+m_mode, tvD); @@ -375,9 +375,9 @@ void ewol::compositing::TextDF::printChar(const char32_t& _charcode) { } } // move the position : - //EWOL_DEBUG(" 5 pos=" << m_position << " advance=" << myGlyph->m_advance.x() << " kerningOffset=" << kerningOffset); + //Log.debug(" 5 pos=" << m_position << " advance=" << myGlyph->m_advance.x() << " kerningOffset=" << kerningOffset); m_position.setX(m_position.x() + (myGlyph->m_advance.x() + kerningOffset) * factorDisplay); - //EWOL_DEBUG(" 6 print '" << charcode << "' : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); + //Log.debug(" 6 print '" << charcode << "' : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); // Register the previous character m_previousCharcode = _charcode; m_VBO->flush(); @@ -385,7 +385,7 @@ void ewol::compositing::TextDF::printChar(const char32_t& _charcode) { } -vec3 ewol::compositing::TextDF::calculateSizeChar(const char32_t& _charcode) { +Vector3f ewol::compositing::TextDF::calculateSizeChar(const char32_t& _charcode) { // get a pointer on the glyph property : ewol::GlyphProperty * myGlyph = getGlyphPointer(_charcode); int32_t fontHeigh = getHeight(); @@ -396,7 +396,7 @@ vec3 ewol::compositing::TextDF::calculateSizeChar(const char32_t& _charcode) { kerningOffset = myGlyph->kerningGet(m_previousCharcode); } - vec3 outputSize((float)(myGlyph->m_advance.x() + kerningOffset)*m_fontDF->getDisplayRatio(getSize()), + Vector3f outputSize((float)(myGlyph->m_advance.x() + kerningOffset)*m_fontDF->getDisplayRatio(getSize()), (float)(fontHeigh), (float)(0.0)); // Register the previous character diff --git a/src/org/atriasoft/ewol/compositing/TextDF.java b/src/org/atriasoft/ewol/compositing/TextDF.java index 6bc6ba7..16daf9e 100644 --- a/src/org/atriasoft/ewol/compositing/TextDF.java +++ b/src/org/atriasoft/ewol/compositing/TextDF.java @@ -39,7 +39,7 @@ namespace ewol { * @note special for Distance field mode. * @param[in] _size request dimention. */ - void updateSizeToRender(const vec2& _size); + void updateSizeToRender(const Vector2f& _size); public: virtual void drawD(bool _disableDepthTest); virtual void drawMT(const mat4& _transformationMatrix, bool _enableDepthTest); @@ -62,7 +62,7 @@ namespace ewol { virtual void setFont(etk::String _fontName, int32_t _fontSize); virtual void setFontMode(enum ewol::font::mode _mode); virtual void printChar(const char32_t& _charcode); - virtual vec3 calculateSizeChar(const char32_t& _charcode); + virtual Vector3f calculateSizeChar(const char32_t& _charcode); }; } } diff --git a/src/org/atriasoft/ewol/context/ConfigFont.cpp b/src/org/atriasoft/ewol/context/ConfigFont.cpp index 886a4ab..34ce697 100644 --- a/src/org/atriasoft/ewol/context/ConfigFont.cpp +++ b/src/org/atriasoft/ewol/context/ConfigFont.cpp @@ -28,16 +28,16 @@ ewol::context::ConfigFont::~ConfigFont() { void ewol::context::ConfigFont::set(const etk::String& _fontName, int32_t _size) { m_name = _fontName; m_size = _size; - EWOL_DEBUG("Set default Font : '" << m_name << "' size=" << m_size); + Log.debug("Set default Font : '" << m_name << "' size=" << m_size); } void ewol::context::ConfigFont::setSize(int32_t _size) { m_size = _size; - EWOL_DEBUG("Set default Font : '" << m_name << "' size=" << m_size << " (change size only)"); + Log.debug("Set default Font : '" << m_name << "' size=" << m_size << " (change size only)"); } void ewol::context::ConfigFont::setName(const etk::String& _fontName) { m_name = _fontName; - EWOL_DEBUG("Set default Font : '" << m_name << "' size=" << m_size << " (change name only)"); + Log.debug("Set default Font : '" << m_name << "' size=" << m_size << " (change name only)"); } diff --git a/src/org/atriasoft/ewol/context/Context.cpp b/src/org/atriasoft/ewol/context/Context.cpp index c25c10a..f761fbd 100644 --- a/src/org/atriasoft/ewol/context/Context.cpp +++ b/src/org/atriasoft/ewol/context/Context.cpp @@ -37,7 +37,7 @@ ewol::Context& ewol::getContext() { gale::Context& context = gale::getContext(); ememory::SharedPtr appl = context.getApplication(); if (appl == null) { - EWOL_CRITICAL("[CRITICAL] try acces at an empty GALE application (can not get Context)"); + Log.critical("[CRITICAL] try acces at an empty GALE application (can not get Context)"); // ??? } return *(ememory::staticPointerCast(appl)); @@ -66,7 +66,7 @@ void ewol::Context::inputEventUnGrabPointer() { void ewol::Context::onCreate(gale::Context& _context) { - EWOL_INFO(" == > Ewol system create (BEGIN)"); + Log.info(" == > Ewol system create (BEGIN)"); // Add basic ewol translation: etranslate::addPath("ewol", "DATA:///translate/ewol/?lib=ewol"); etranslate::autoDetectLanguage(); @@ -77,11 +77,11 @@ void ewol::Context::onCreate(gale::Context& _context) { for(int32_t iii = 0; iii < _context.getCmd().size() ; ++iii) { if ( _context.getCmd().get(iii) == "-h" || _context.getCmd().get(iii) == "--help") { - EWOL_PRINT("ewol - help : "); - EWOL_PRINT(" " << etk::getApplicationName() << " [options]"); - EWOL_PRINT(" -h/--help: Display this help"); - EWOL_PRINT(" example:"); - EWOL_PRINT(" " << etk::getApplicationName() << " --help"); + Log.print("ewol - help : "); + Log.print(" " << etk::getApplicationName() << " [options]"); + Log.print(" -h/--help: Display this help"); + Log.print(" example:"); + Log.print(" " << etk::getApplicationName() << " --help"); // this is a global help system does not remove it continue; } else { @@ -91,7 +91,7 @@ void ewol::Context::onCreate(gale::Context& _context) { --iii; } - EWOL_INFO("EWOL v:" << ewol::getVersion()); + Log.info("EWOL v:" << ewol::getVersion()); // force a recalculation /* requestUpdateSize(); @@ -105,40 +105,40 @@ void ewol::Context::onCreate(gale::Context& _context) { */ ememory::SharedPtr appl = m_application; if (appl == null) { - EWOL_ERROR(" == > Create without application"); + Log.error(" == > Create without application"); return; } appl->onCreate(*this); - EWOL_INFO(" == > Ewol system create (END)"); + Log.info(" == > Ewol system create (END)"); } void ewol::Context::onStart(gale::Context& _context) { - EWOL_INFO(" == > Ewol system start (BEGIN)"); + Log.info(" == > Ewol system start (BEGIN)"); ememory::SharedPtr appl = m_application; if (appl == null) { // TODO : Request exit of the application .... with error ... return; } appl->onStart(*this); - EWOL_INFO(" == > Ewol system start (END)"); + Log.info(" == > Ewol system start (END)"); } void ewol::Context::onResume(gale::Context& _context) { - EWOL_INFO(" == > Ewol system resume (BEGIN)"); + Log.info(" == > Ewol system resume (BEGIN)"); ememory::SharedPtr appl = m_application; if (appl == null) { return; } appl->onResume(*this); - EWOL_INFO(" == > Ewol system resume (END)"); + Log.info(" == > Ewol system resume (END)"); } void ewol::Context::onRegenerateDisplay(gale::Context& _context) { - //EWOL_INFO("REGENERATE_DISPLAY"); + //Log.info("REGENERATE_DISPLAY"); // check if the user selected a windows ewol::widget::WindowsShared window = m_windowsCurrent; if (window == null) { - EWOL_DEBUG("No windows ..."); + Log.debug("No windows ..."); return; } // Redraw all needed elements @@ -150,7 +150,7 @@ void ewol::Context::onRegenerateDisplay(gale::Context& _context) { } void ewol::Context::onDraw(gale::Context& _context) { - //EWOL_INFO("DRAW"); + //Log.info("DRAW"); // clean internal data... m_objectManager.cleanInternalRemoved(); // real draw... @@ -162,27 +162,27 @@ void ewol::Context::onDraw(gale::Context& _context) { } void ewol::Context::onPause(gale::Context& _context) { - EWOL_INFO(" == > Ewol system pause (BEGIN)"); + Log.info(" == > Ewol system pause (BEGIN)"); ememory::SharedPtr appl = m_application; if (appl == null) { return; } appl->onPause(*this); - EWOL_INFO(" == > Ewol system pause (END)"); + Log.info(" == > Ewol system pause (END)"); } void ewol::Context::onStop(gale::Context& _context) { - EWOL_INFO(" == > Ewol system stop (BEGIN)"); + Log.info(" == > Ewol system stop (BEGIN)"); ememory::SharedPtr appl = m_application; if (appl == null) { return; } appl->onStop(*this); - EWOL_INFO(" == > Ewol system stop (END)"); + Log.info(" == > Ewol system stop (END)"); } void ewol::Context::onDestroy(gale::Context& _context) { - EWOL_INFO(" == > Ewol system destroy (BEGIN)"); + Log.info(" == > Ewol system destroy (BEGIN)"); // Remove current windows m_windowsCurrent.reset(); // clean all widget and sub widget with their resources: @@ -195,44 +195,44 @@ void ewol::Context::onDestroy(gale::Context& _context) { } // internal clean elements m_objectManager.cleanInternalRemoved(); - EWOL_INFO("List of all widget of this context must be equal at 0 ==> otherwise some remove is missing"); + Log.info("List of all widget of this context must be equal at 0 ==> otherwise some remove is missing"); m_objectManager.displayListObject(); // now All must be removed !!! m_objectManager.unInit(); - EWOL_INFO(" == > Ewol system destroy (END)"); + Log.info(" == > Ewol system destroy (END)"); } void ewol::Context::onKillDemand(gale::Context& _context) { - EWOL_INFO(" == > User demand a destroy (BEGIN)"); + Log.info(" == > User demand a destroy (BEGIN)"); ememory::SharedPtr appl = m_application; if (appl == null) { exit(0); return; } appl->onKillDemand(*this); - EWOL_INFO(" == > User demand a destroy (END)"); + Log.info(" == > User demand a destroy (END)"); } void ewol::Context::onPointer(enum gale::key::type _type, int32_t _pointerID, - const vec2& _pos, + const Vector2f& _pos, gale::key::status _state) { switch (_state) { case gale::key::status::move: - //EWOL_DEBUG("Receive MSG : THREAD_INPUT_MOTION"); + //Log.debug("Receive MSG : THREAD_INPUT_MOTION"); m_input.motion(_type, _pointerID, _pos); break; case gale::key::status::down: case gale::key::status::downRepeate: - //EWOL_DEBUG("Receive MSG : THREAD_INPUT_STATE"); + //Log.debug("Receive MSG : THREAD_INPUT_STATE"); m_input.state(_type, _pointerID, true, _pos); break; case gale::key::status::up: - //EWOL_DEBUG("Receive MSG : THREAD_INPUT_STATE"); + //Log.debug("Receive MSG : THREAD_INPUT_STATE"); m_input.state(_type, _pointerID, false, _pos); break; default: - EWOL_DEBUG("Unknow state : " << _state); + Log.debug("Unknow state : " << _state); break; } } @@ -240,7 +240,7 @@ void ewol::Context::onKeyboard(const gale::key::Special& _special, enum gale::key::keyboard _type, char32_t _value, gale::key::status _state) { - EWOL_VERBOSE("event {" << _special << "} " << _type << " " << _value << " " << _state); + Log.verbose("event {" << _special << "} " << _type << " " << _value << " " << _state); // store the keyboard special key status for mouse event... m_input.setLastKeyboardSpecial(_special); if (m_windowsCurrent == null) { @@ -264,7 +264,7 @@ void ewol::Context::onKeyboard(const gale::key::Special& _special, return; } // check if the widget allow repeating key events. - //EWOL_INFO("repeating test :" << repeate << " widget=" << tmpWidget->getKeyboardRepeate() << " state=" << isDown); + //Log.info("repeating test :" << repeate << " widget=" << tmpWidget->getKeyboardRepeate() << " state=" << isDown); if( repeate == false || ( repeate == true && tmpWidget->getKeyboardRepeat() == true) ) { @@ -294,7 +294,7 @@ void ewol::Context::onKeyboard(const gale::key::Special& _special, tmpWidget->systemEventEntry(tmpEntryEvent); } } else { - EWOL_DEBUG("remove Repeate key ..."); + Log.debug("remove Repeate key ..."); } } } @@ -302,7 +302,7 @@ void ewol::Context::onKeyboard(const gale::key::Special& _special, /* void ewol::Context::processEvents() { case eSystemMessage::msgResize: - //EWOL_DEBUG("Receive MSG : THREAD_RESIZE"); + //Log.debug("Receive MSG : THREAD_RESIZE"); m_windowsSize = data->dimention; ewol::Dimension::setPixelWindowsSize(m_windowsSize); forceRedrawAll(); @@ -325,7 +325,7 @@ ewol::Context::Context(ewol::context::Application* _application) : m_windowsCurrent(null), m_initStepId(0) { if (m_application == null) { - EWOL_CRITICAL("Can not start context with no Application ==> rtfm ..."); + Log.critical("Can not start context with no Application ==> rtfm ..."); } } @@ -347,7 +347,7 @@ void ewol::Context::resetIOEvent() { } void ewol::Context::setWindows(const ewol::widget::WindowsShared& _windows) { - EWOL_INFO("set New windows"); + Log.info("set New windows"); // remove current focus : m_widgetManager.focusSetDefault(null); m_widgetManager.focusRelease(); @@ -366,8 +366,8 @@ void ewol::Context::setWindows(const ewol::widget::WindowsShared& _windows) { ewol::widget::WindowsShared ewol::Context::getWindows() { return m_windowsCurrent; }; -void ewol::Context::onResize(const ivec2& _size) { - EWOL_VERBOSE("Resize: " << _size); +void ewol::Context::onResize(const Vector2i& _size) { + Log.verbose("Resize: " << _size); forceRedrawAll(); } @@ -375,8 +375,8 @@ void ewol::Context::forceRedrawAll() { if (m_windowsCurrent == null) { return; } - ivec2 size = getSize(); - m_windowsCurrent->setSize(vec2(size.x(), size.y())); + Vector2i size = getSize(); + m_windowsCurrent->setSize(Vector2f(size.x(), size.y())); m_windowsCurrent->onChangeSize(); } diff --git a/src/org/atriasoft/ewol/context/Context.java b/src/org/atriasoft/ewol/context/Context.java index 8adf8ea..b0f1f9e 100644 --- a/src/org/atriasoft/ewol/context/Context.java +++ b/src/org/atriasoft/ewol/context/Context.java @@ -73,7 +73,7 @@ namespace ewol { void onKillDemand(gale::Context& _context) override; void onPointer(enum gale::key::type _type, int32_t _pointerID, - const vec2& _pos, + const Vector2f& _pos, gale::key::status _state) override; void onKeyboard(const gale::key::Special& _special, enum gale::key::keyboard _type, @@ -119,7 +119,7 @@ namespace ewol { * @brief This fonction un-lock the pointer properties to move in relative instead of absolute */ void inputEventUnGrabPointer(); - void onResize(const ivec2& _size) override; + void onResize(const Vector2i& _size) override; public: /** * @brief This is the only one things the User might done in his main(); diff --git a/src/org/atriasoft/ewol/context/InputManager.cpp b/src/org/atriasoft/ewol/context/InputManager.cpp index 0e57cd8..0ac496c 100644 --- a/src/org/atriasoft/ewol/context/InputManager.cpp +++ b/src/org/atriasoft/ewol/context/InputManager.cpp @@ -39,7 +39,7 @@ bool ewol::context::InputManager::localEventInput(enum gale::key::type _type, ewol::WidgetShared _destWidget, int32_t _IdInput, enum gale::key::status _status, - vec2 _pos) { + Vector2f _pos) { if (_destWidget != null) { if ( _type == gale::key::type::mouse || _type == gale::key::type::finger) { @@ -74,7 +74,7 @@ void ewol::context::InputManager::cleanElement(InputPoperty *_eventTable, if (_eventTable == null) { return; } - //EWOL_INFO("CleanElement[" << idInput << "] = @" << (int64_t)eventTable); + //Log.info("CleanElement[" << idInput << "] = @" << (int64_t)eventTable); _eventTable[_idInput].isUsed = false; _eventTable[_idInput].destinationInputId = 0; _eventTable[_idInput].lastTimeEvent.reset(); @@ -127,14 +127,14 @@ void ewol::context::InputManager::grabPointer(ewol::WidgetShared _widget) { m_grabWidget = _widget; /* TODO : m_context.grabPointerEvents(true, _widget->getOrigin() - + ivec2(_widget->getSize().x()/2.0f, + + Vector2i(_widget->getSize().x()/2.0f, _widget->getSize().y()/2.0f) ); */ } void ewol::context::InputManager::unGrabPointer() { m_grabWidget.reset(); - // TODO: m_context.grabPointerEvents(false, vec2(0,0)); + // TODO: m_context.grabPointerEvents(false, Vector2f(0,0)); } void ewol::context::InputManager::newLayerSet() { @@ -151,18 +151,18 @@ ewol::context::InputManager::InputManager(ewol::Context& _context) : m_grabWidget(), m_context(_context) { setDpi(200); - EWOL_INFO("Init (start)"); + Log.info("Init (start)"); for(int32_t iii=0; iii the it was finger event ... void ewol::context::InputManager::motion(enum gale::key::type _type, int _pointerID, - vec2 _pos) { + Vector2f _pos) { EVENT_DEBUG("motion event : " << _type << " " << _pointerID << " " << _pos); if (MAX_MANAGE_INPUT <= _pointerID) { // reject pointer == > out of IDs... @@ -200,7 +200,7 @@ void ewol::context::InputManager::motion(enum gale::key::type _type, } else if (_type == gale::key::type::finger) { eventTable = m_eventInputSaved; } else { - EWOL_ERROR("Unknown type of event"); + Log.error("Unknown type of event"); return; } if( _pointerID > MAX_MANAGE_INPUT @@ -318,7 +318,7 @@ void ewol::context::InputManager::motion(enum gale::key::type _type, void ewol::context::InputManager::state(enum gale::key::type _type, int _pointerID, bool _isDown, - vec2 _pos) { + Vector2f _pos) { if (_pointerID >= MAX_MANAGE_INPUT) { // reject pointer == > out of IDs... return; @@ -334,7 +334,7 @@ void ewol::context::InputManager::state(enum gale::key::type _type, eventTable = m_eventInputSaved; localLimit = m_eventInputLimit; } else { - EWOL_ERROR("Unknown type of event"); + Log.error("Unknown type of event"); return; } if( _pointerID > MAX_MANAGE_INPUT @@ -425,7 +425,7 @@ void ewol::context::InputManager::state(enum gale::key::type _type, ewol::WidgetShared tmpWidget = eventTable[_pointerID].curentWidgetEvent.lock(); if(eventTable[_pointerID].isUsed == false) { // bad case ... ??? - EWOL_DEBUG("Up event without previous down ... "); + Log.debug("Up event without previous down ... "); // Mark it un-used : eventTable[_pointerID].isUsed = false; // revove the widget ... diff --git a/src/org/atriasoft/ewol/context/InputManager.java b/src/org/atriasoft/ewol/context/InputManager.java index 1445d0f..d4ef1e6 100644 --- a/src/org/atriasoft/ewol/context/InputManager.java +++ b/src/org/atriasoft/ewol/context/InputManager.java @@ -20,10 +20,10 @@ namespace ewol { int32_t destinationInputId; echrono::Clock lastTimeEvent; ewol::WidgetWeak curentWidgetEvent; - vec2 origin; - vec2 size; - vec2 downStart; - vec2 posEvent; + Vector2f origin; + Vector2f size; + Vector2f downStart; + Vector2f posEvent; bool isDown; bool isInside; int32_t nbClickEvent; // 0 .. 1 .. 2 .. 3 @@ -65,7 +65,7 @@ namespace ewol { ewol::WidgetShared _destWidget, int32_t _IdInput, enum gale::key::status _typeEvent, - vec2 _pos); + Vector2f _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 @@ -86,8 +86,8 @@ namespace ewol { void setDpi(int32_t _newDPI); // note if id<0 == > the it was finger event ... - void motion(enum gale::key::type _type, int _pointerID, vec2 _pos ); - void state(enum gale::key::type _type, int _pointerID, bool _isDown, vec2 _pos); + void motion(enum gale::key::type _type, int _pointerID, Vector2f _pos ); + void state(enum gale::key::type _type, int _pointerID, bool _isDown, Vector2f _pos); public: /** * @brief a new layer on the windows is set == > might remove all the property of the current element ... diff --git a/src/org/atriasoft/ewol/event/Input.java b/src/org/atriasoft/ewol/event/Input.java index 05e6557..3c9562e 100644 --- a/src/org/atriasoft/ewol/event/Input.java +++ b/src/org/atriasoft/ewol/event/Input.java @@ -14,13 +14,13 @@ namespace ewol { enum gale::key::type m_type; enum gale::key::status m_status; uint8_t m_inputId; - vec2 m_pos; + Vector2f m_pos; gale::key::Special m_specialKey; //!< input key status (prevent change in time..) public: Input(enum gale::key::type _type, enum gale::key::status _status, uint8_t _id, - const vec2& _pos, + const Vector2f& _pos, gale::key::Special _specialKey): m_type(_type), m_status(_status), @@ -47,10 +47,10 @@ namespace ewol { inline const uint8_t& getId() const { return m_inputId; }; - void setPos(const vec2& _pos) { + void setPos(const Vector2f& _pos) { m_pos = _pos; }; - inline const vec2& getPos() const { + inline const Vector2f& getPos() const { return m_pos; }; void setSpecialKey(const gale::key::Special& _specialKey) { @@ -73,7 +73,7 @@ namespace ewol { InputSystem(enum gale::key::type _type, enum gale::key::status _status, uint8_t _id, - const vec2& _pos, + const Vector2f& _pos, ewol::WidgetShared _dest, int32_t _realIdEvent, gale::key::Special _specialKey) : diff --git a/src/org/atriasoft/ewol/gravity.cpp b/src/org/atriasoft/ewol/gravity.cpp index 537aea1..3dd641c 100644 --- a/src/org/atriasoft/ewol/gravity.cpp +++ b/src/org/atriasoft/ewol/gravity.cpp @@ -56,24 +56,24 @@ enum ewol::gravity ewol::stringToGravity(const etk::String& _obj) { } return ewol::gravity_center; } -vec2 ewol::gravityGenerateDelta(const enum ewol::gravity _gravity, const vec2& _deltas) { - vec2 out(0.0f,0.0f); +Vector2f ewol::gravityGenerateDelta(const enum ewol::gravity _gravity, const Vector2f& _deltas) { + Vector2f out(0.0f,0.0f); if (_deltas.x() > 0.0001f) { if ((uint32_t(_gravity) & uint32_t(ewol::gravity_left)) != 0) { // nothing to do } else if ((uint32_t(_gravity) & uint32_t(ewol::gravity_right)) != 0) { - out = vec2(int32_t(_deltas.x()), 0.0f); + out = Vector2f(int32_t(_deltas.x()), 0.0f); } else { - out = vec2(int32_t(_deltas.x()*0.5f), 0.0f); + out = Vector2f(int32_t(_deltas.x()*0.5f), 0.0f); } } if (_deltas.y() > 0.0001f) { if ((uint32_t(_gravity) & uint32_t(ewol::gravity_buttom)) != 0) { // nothing to do } else if ((uint32_t(_gravity) & uint32_t(ewol::gravity_top)) != 0) { - out += vec2(0.0f, int32_t(_deltas.y())); + out += Vector2f(0.0f, int32_t(_deltas.y())); } else { - out += vec2(0.0f, int32_t(_deltas.y()*0.5f)); + out += Vector2f(0.0f, int32_t(_deltas.y()*0.5f)); } } return out; diff --git a/src/org/atriasoft/ewol/gravity.java b/src/org/atriasoft/ewol/gravity.java index e1cec79..ad2cb88 100644 --- a/src/org/atriasoft/ewol/gravity.java +++ b/src/org/atriasoft/ewol/gravity.java @@ -27,5 +27,5 @@ namespace ewol { etk::Stream& operator <<(etk::Stream& _os, const enum ewol::gravity _obj); etk::String gravityToString(const enum ewol::gravity _obj); enum ewol::gravity stringToGravity(const etk::String& _obj); - vec2 gravityGenerateDelta(const enum ewol::gravity _gravity, const vec2& _deltas); + Vector2f gravityGenerateDelta(const enum ewol::gravity _gravity, const Vector2f& _deltas); } diff --git a/src/org/atriasoft/ewol/object/Manager.cpp b/src/org/atriasoft/ewol/object/Manager.cpp index bc6dadd..2867e9d 100644 --- a/src/org/atriasoft/ewol/object/Manager.cpp +++ b/src/org/atriasoft/ewol/object/Manager.cpp @@ -17,7 +17,7 @@ ewol::object::Manager::Manager(ewol::Context& _context) : periodicCall(this, "periodic", "Call every time system render"), m_applWakeUpTime(0), m_lastPeriodicCallTime(0) { - EWOL_DEBUG(" == > init Object-Manager"); + Log.debug(" == > init Object-Manager"); periodicCall.setPeriodic(true); // set the basic time properties : m_applWakeUpTime = echrono::Clock::now(); @@ -29,31 +29,31 @@ ewol::object::Manager::~Manager() { m_workerList.clear(); bool hasError = false; if (m_eObjectList.size()!=0) { - EWOL_ERROR("Must not have anymore eObject !!!"); + Log.error("Must not have anymore eObject !!!"); hasError = true; } if (hasError == true) { - EWOL_ERROR("Check if the function UnInit has been called !!!"); + Log.error("Check if the function UnInit has been called !!!"); } displayListObject(); } void ewol::object::Manager::displayListObject() { ethread::RecursiveLock lock(m_mutex); - EWOL_INFO("List loaded object : "); + Log.info("List loaded object : "); for (auto &it : m_eObjectList) { ewol::ObjectShared element = it.lock(); if (element != null) { - EWOL_INFO(" [" << element->getId() << "] ref=" << element.useCount()-1 << " name='" << element->propertyName.get() << "' type=" << element->getObjectType()); + Log.info(" [" << element->getId() << "] ref=" << element.useCount()-1 << " name='" << element->propertyName.get() << "' type=" << element->getObjectType()); } } } void ewol::object::Manager::unInit() { ethread::RecursiveLock lock(m_mutex); - EWOL_DEBUG(" == > Un-Init Object-Manager"); + Log.debug(" == > Un-Init Object-Manager"); if (m_workerList.size() > 0) { - EWOL_DEBUG(" == > Remove all workers"); + Log.debug(" == > Remove all workers"); m_workerList.clear(); } for (auto &it : m_eObjectList) { @@ -63,7 +63,7 @@ void ewol::object::Manager::unInit() { } } if (m_eObjectList.size() != 0) { - EWOL_ERROR("Have " << m_eObjectList.size() << " active Object"); + Log.error("Have " << m_eObjectList.size() << " active Object"); } m_eObjectList.clear(); } @@ -71,7 +71,7 @@ void ewol::object::Manager::unInit() { void ewol::object::Manager::add(const ewol::ObjectShared& _object) { ethread::RecursiveLock lock(m_mutex); if (_object == null) { - EWOL_ERROR("try to add an inexistant Object in manager"); + Log.error("try to add an inexistant Object in manager"); } m_eObjectList.pushBack(_object); } @@ -85,7 +85,7 @@ int32_t ewol::object::Manager::getNumberObject() { void ewol::object::Manager::cleanInternalRemoved() { ethread::RecursiveLock lock(m_mutex); size_t nbObject = m_eObjectList.size(); - EWOL_VERBOSE("Clean Object List (if needed) : " << m_eObjectList.size() << " elements"); + Log.verbose("Clean Object List (if needed) : " << m_eObjectList.size() << " elements"); auto it(m_eObjectList.begin()); while (it != m_eObjectList.end()) { if (it->expired() == true) { @@ -95,7 +95,7 @@ void ewol::object::Manager::cleanInternalRemoved() { } } if (m_eObjectList.size() != nbObject) { - EWOL_VERBOSE(" remove " << nbObject - m_eObjectList.size() << " deprecated objects"); + Log.verbose(" remove " << nbObject - m_eObjectList.size() << " deprecated objects"); } } diff --git a/src/org/atriasoft/ewol/object/Manager.java b/src/org/atriasoft/ewol/object/Manager.java index 14c755f..8c2dbe1 100644 --- a/src/org/atriasoft/ewol/object/Manager.java +++ b/src/org/atriasoft/ewol/object/Manager.java @@ -20,7 +20,7 @@ namespace ewol { protected: ethread::MutexRecursive m_mutex; private: - etk::Vector m_eObjectList; // all widget allocated == > all time increment ... never removed ... + List m_eObjectList; // all widget allocated == > all time increment ... never removed ... Context& m_context; public: Manager(Context& _context); @@ -66,7 +66,7 @@ namespace ewol { */ ewol::ObjectShared getObjectNamed(const etk::String& _name); private: - etk::Vector m_workerList; + List m_workerList; public: /** * @brief Add a worker on the system list. diff --git a/src/org/atriasoft/ewol/object/Object.cpp b/src/org/atriasoft/ewol/object/Object.cpp index 442a1c8..8cf17f9 100644 --- a/src/org/atriasoft/ewol/object/Object.cpp +++ b/src/org/atriasoft/ewol/object/Object.cpp @@ -18,11 +18,11 @@ void ewol::Object::autoDestroy() { EWOL_WARNING("try to auto destroy inside a constructor"); return; } - EWOL_VERBOSE("Destroy object: [" << getId() << "] type:" << getObjectType()); + Log.verbose("Destroy object: [" << getId() << "] type:" << getObjectType()); ewol::ObjectShared parent = m_parent.lock(); // TODO : set a signal to do this ... if (parent != null) { - EWOL_VERBOSE("Destroy object: Call parrent"); + Log.verbose("Destroy object: Call parrent"); parent->requestDestroyFromChild(sharedFromThis()); } //if no parent ==> noting to do ... @@ -34,8 +34,8 @@ bool ewol::Object::objectHasBeenCorectlyInit() { } void ewol::Object::requestDestroyFromChild(const ewol::ObjectShared& _child) { - EWOL_INFO("requestDestroyFromChild(...) is called when an object reference as a parent have a child that request quto-destroy ..."); - EWOL_CRITICAL("Call From Child with no effects ==> must implement : requestDestroyFromChild(...)"); + Log.info("requestDestroyFromChild(...) is called when an object reference as a parent have a child that request quto-destroy ..."); + Log.critical("Call From Child with no effects ==> must implement : requestDestroyFromChild(...)"); } void ewol::Object::destroy() { @@ -63,11 +63,11 @@ ewol::Object::Object() : m_isResource(false) { // note this is nearly atomic ... (but it is enough) m_uniqueId = m_valUID++; - EWOL_DEBUG("new Object : [" << m_uniqueId << "]"); + Log.debug("new Object : [" << m_uniqueId << "]"); } ewol::Object::~Object() { - EWOL_DEBUG("delete Object : [" << m_uniqueId << "] : " << getTypeDescription()); + Log.debug("delete Object : [" << m_uniqueId << "] : " << getTypeDescription()); m_uniqueId = -1; } @@ -87,7 +87,7 @@ const char * const ewol::Object::getObjectType() const { void ewol::Object::addObjectType(const char* _type) { if (_type == null) { - EWOL_ERROR(" try to add a type with no value..."); + Log.error(" try to add a type with no value..."); return; } m_listType.pushBack(_type); @@ -168,7 +168,7 @@ ewol::ObjectShared ewol::Object::getObjectNamed(const etk::String& _objectName) } ewol::ObjectShared ewol::Object::getSubObjectNamed(const etk::String& _objectName) { - EWOL_VERBOSE("check if name : " << _objectName << " ?= " << propertyName.get()); + Log.verbose("check if name : " << _objectName << " ?= " << propertyName.get()); if (_objectName == propertyName.get()) { return sharedFromThis(); } diff --git a/src/org/atriasoft/ewol/object/Object.java b/src/org/atriasoft/ewol/object/Object.java index 7c41a1e..de4c392 100644 --- a/src/org/atriasoft/ewol/object/Object.java +++ b/src/org/atriasoft/ewol/object/Object.java @@ -38,17 +38,17 @@ template static void baseInit eproperty::Property* prop(null); eproperty::PropertyType* propType(null); if (_object == null) { - EWOL_ERROR("EMPTY pointer"); + Log.error("EMPTY pointer"); return; } prop = _object->properties.getRaw(_name); if (prop == null) { - EWOL_ERROR("property does not exit ... '" << _name << "'"); + Log.error("property does not exit ... '" << _name << "'"); goto exit_on_error; } propType = dynamic_cast*>(prop); if (propType == null) { - EWOL_ERROR("property does not cast in requested type ... '" << _name << "' require type : " << /*typeid(_val).name()*/ "?TODO?" << "' instead of '" << prop->getType() << "'"); + Log.error("property does not cast in requested type ... '" << _name << "' require type : " << /*typeid(_val).name()*/ "?TODO?" << "' instead of '" << prop->getType() << "'"); goto exit_on_error; } propType->setDirectCheck(_val); @@ -64,26 +64,26 @@ exit_on_error: template static ememory::SharedPtr create(const EWOL_FACTORY_CREATE_TYPE& ... _all) { \ ememory::SharedPtr object(ETK_NEW(className)); \ if (object == null) { \ - EWOL_ERROR("Factory error"); \ + Log.error("Factory error"); \ return null; \ } \ baseInit(object, _all... ); \ object->init(); \ if (object->objectHasBeenCorectlyInit() == false) { \ - EWOL_CRITICAL("Object Is not correctly init : " << #className ); \ + Log.critical("Object Is not correctly init : " << #className ); \ } \ return object; \ } \ static ememory::SharedPtr createXml(const exml::Element& _node) { \ ememory::SharedPtr object(ETK_NEW(className)); \ if (object == null) { \ - EWOL_ERROR("Factory error"); \ + Log.error("Factory error"); \ return null; \ } \ object->loadXMLAttributes(_node); \ object->init(); \ if (object->objectHasBeenCorectlyInit() == false) { \ - EWOL_CRITICAL("Object Is not correctly init : " << #className ); \ + Log.critical("Object Is not correctly init : " << #className ); \ } \ return object; \ } @@ -95,7 +95,7 @@ exit_on_error: if (object2 != null) { \ object = ememory::dynamicPointerCast(object2); \ if (object == null) { \ - EWOL_CRITICAL("Request object element: '" << uniqueName << "' With the wrong type (dynamic cast error)"); \ + Log.critical("Request object element: '" << uniqueName << "' With the wrong type (dynamic cast error)"); \ return null; \ } \ } \ @@ -104,13 +104,13 @@ exit_on_error: } \ object = ememory::SharedPtr(ETK_NEW(className)); \ if (object == null) { \ - EWOL_ERROR("Factory error"); \ + Log.error("Factory error"); \ return null; \ } \ baseInit(object, "name", etk::String(uniqueName), _all... ); \ object->init(); \ if (object->objectHasBeenCorectlyInit() == false) { \ - EWOL_CRITICAL("Object Is not correctly init : " << #className ); \ + Log.critical("Object Is not correctly init : " << #className ); \ } \ return object; \ } @@ -186,7 +186,7 @@ namespace ewol { */ virtual void removeParent(); private: - etk::Vector m_listType; + List m_listType; public: /** * @brief get the current Object type of the Object @@ -306,7 +306,7 @@ namespace ewol { if (myObject != null) { \ myObject->_event.connect(_shared_ptr, _func, ##__VA_ARGS__); \ } else { \ - EWOL_ERROR("object named='" << _name << "' not exit or can not be cast in : " << #_type); \ + Log.error("object named='" << _name << "' not exit or can not be cast in : " << #_type); \ } \ } while (false) }; @@ -321,7 +321,7 @@ namespace ewol { if (myObject != null) { \ myObject->_event.connect(_obj, _func, ##__VA_ARGS__); \ } else { \ - EWOL_ERROR("object named='" << _name << "' not exit or can not be cast in : " << #_type); \ + Log.error("object named='" << _name << "' not exit or can not be cast in : " << #_type); \ } \ } while (false) @@ -333,7 +333,7 @@ namespace ewol { if (myObject != null) { \ myObject->_event.connect(_obj, _func, ##__VA_ARGS__); \ } else { \ - EWOL_ERROR("object named='" << _name << "' not exit or can not be cast in : " << #_type); \ + Log.error("object named='" << _name << "' not exit or can not be cast in : " << #_type); \ } \ } while (false) diff --git a/src/org/atriasoft/ewol/resource/ColorFile.cpp b/src/org/atriasoft/ewol/resource/ColorFile.cpp index cbd5afd..ff1fd6a 100644 --- a/src/org/atriasoft/ewol/resource/ColorFile.cpp +++ b/src/org/atriasoft/ewol/resource/ColorFile.cpp @@ -22,9 +22,9 @@ ewol::resource::ColorFile::ColorFile() : void ewol::resource::ColorFile::init(const etk::Uri& _uri) { ethread::RecursiveLock lock(m_mutex); gale::Resource::init(_uri.get()); - EWOL_DEBUG("CF : load \"" << _uri << "\""); + Log.debug("CF : load \"" << _uri << "\""); reload(); - EWOL_DEBUG("List of all color : " << m_list.getKeys()); + Log.debug("List of all color : " << m_list.getKeys()); } ewol::resource::ColorFile::~ColorFile() { @@ -42,12 +42,12 @@ void ewol::resource::ColorFile::reload() { // open and read all json elements: ejson::Document doc; if (doc.load(etk::Uri(m_name)) == false) { - EWOL_ERROR("Can not load file : '" << m_name << "'"); + Log.error("Can not load file : '" << m_name << "'"); return; } ejson::Array baseArray = doc["color"].toArray(); if (baseArray.exist() == false) { - EWOL_ERROR("Can not get basic array : 'color' in file:" << m_name); + Log.error("Can not get basic array : 'color' in file:" << m_name); doc.display(); return; } @@ -55,22 +55,22 @@ void ewol::resource::ColorFile::reload() { for (const auto it : baseArray) { ejson::Object tmpObj = it.toObject(); if (tmpObj.exist() == false) { - EWOL_ERROR(" can not get object in 'color' : " << it); + Log.error(" can not get object in 'color' : " << it); findError = true; continue; } etk::String name = tmpObj["name"].toString().get(); etk::String color = tmpObj["color"].toString().get(m_errorColor.getHexString()); - EWOL_DEBUG("find new color : '" << name << "' color='" << color << "'"); + Log.debug("find new color : '" << name << "' color='" << color << "'"); if (name.size() == 0) { - EWOL_ERROR("Drop an empty name"); + Log.error("Drop an empty name"); findError = true; continue; } m_list.add(name, etk::Color(color)); } if (findError == true) { - EWOL_ERROR("pb in parsing file:" << m_name); + Log.error("pb in parsing file:" << m_name); doc.display(); } } diff --git a/src/org/atriasoft/ewol/resource/ColorFile.java b/src/org/atriasoft/ewol/resource/ColorFile.java index f8c2367..38b684a 100644 --- a/src/org/atriasoft/ewol/resource/ColorFile.java +++ b/src/org/atriasoft/ewol/resource/ColorFile.java @@ -62,7 +62,7 @@ namespace ewol { * @brief Get All color name * @return list of all color existing */ - etk::Vector getColors() const { + List getColors() const { return m_list.getKeys(); } public: // herited function: diff --git a/src/org/atriasoft/ewol/resource/Colored3DObject.cpp b/src/org/atriasoft/ewol/resource/Colored3DObject.cpp index 692147a..e49e6d4 100644 --- a/src/org/atriasoft/ewol/resource/Colored3DObject.cpp +++ b/src/org/atriasoft/ewol/resource/Colored3DObject.cpp @@ -37,7 +37,7 @@ ewol::resource::Colored3DObject::~Colored3DObject() { } -void ewol::resource::Colored3DObject::draw(const etk::Vector& _vertices, +void ewol::resource::Colored3DObject::draw(const List& _vertices, const etk::Color& _color, bool _updateDepthBuffer, bool _depthtest) { @@ -45,7 +45,7 @@ void ewol::resource::Colored3DObject::draw(const etk::Vector& _vertices, return; } if (m_GLprogram == null) { - EWOL_ERROR("No shader ..."); + Log.error("No shader ..."); return; } if (true == _depthtest) { @@ -54,7 +54,7 @@ void ewol::resource::Colored3DObject::draw(const etk::Vector& _vertices, glDepthMask(GL_FALSE); } } - //EWOL_DEBUG(" display " << m_coord.size() << " elements" ); + //Log.debug(" display " << m_coord.size() << " elements" ); m_GLprogram->use(); // set Matrix: translation/positionMatrix mat4 projMatrix = gale::openGL::getMatrix(); @@ -79,7 +79,7 @@ void ewol::resource::Colored3DObject::draw(const etk::Vector& _vertices, } } -void ewol::resource::Colored3DObject::draw(const etk::Vector& _vertices, +void ewol::resource::Colored3DObject::draw(const List& _vertices, const etk::Color& _color, mat4& _transformationMatrix, bool _updateDepthBuffer, @@ -88,7 +88,7 @@ void ewol::resource::Colored3DObject::draw(const etk::Vector& _vertices, return; } if (m_GLprogram == null) { - EWOL_ERROR("No shader ..."); + Log.error("No shader ..."); return; } if (true == _depthtest) { @@ -97,7 +97,7 @@ void ewol::resource::Colored3DObject::draw(const etk::Vector& _vertices, glDepthMask(GL_FALSE); } } - //EWOL_DEBUG(" display " << m_coord.size() << " elements" ); + //Log.debug(" display " << m_coord.size() << " elements" ); m_GLprogram->use(); // set Matrix: translation/positionMatrix mat4 projMatrix = gale::openGL::getMatrix(); @@ -119,7 +119,7 @@ void ewol::resource::Colored3DObject::draw(const etk::Vector& _vertices, } } -void ewol::resource::Colored3DObject::drawLine(etk::Vector& _vertices, +void ewol::resource::Colored3DObject::drawLine(List& _vertices, const etk::Color& _color, mat4& _transformationMatrix, bool _updateDepthBuffer, @@ -128,7 +128,7 @@ void ewol::resource::Colored3DObject::drawLine(etk::Vector& _vertices, return; } if (m_GLprogram == null) { - EWOL_ERROR("No shader ..."); + Log.error("No shader ..."); return; } if (true == _depthtest) { @@ -137,7 +137,7 @@ void ewol::resource::Colored3DObject::drawLine(etk::Vector& _vertices, glDepthMask(GL_FALSE); } } - //EWOL_DEBUG(" display " << m_coord.size() << " elements" ); + //Log.debug(" display " << m_coord.size() << " elements" ); m_GLprogram->use(); // set Matrix: translation/positionMatrix mat4 projMatrix = gale::openGL::getMatrix(); @@ -160,70 +160,70 @@ void ewol::resource::Colored3DObject::drawLine(etk::Vector& _vertices, } -void ewol::resource::Colored3DObject::drawCubeLine(const vec3& _min, - const vec3& _max, +void ewol::resource::Colored3DObject::drawCubeLine(const Vector3f& _min, + const Vector3f& _max, const etk::Color& _color, mat4& _transformationMatrix, bool _updateDepthBuffer, bool _depthtest) { - etk::Vector vertices; - vertices.pushBack(vec3(_min.x(), _min.y(),_min.z())); - vertices.pushBack(vec3(_max.x(), _min.y(),_min.z())); + List vertices; + vertices.pushBack(Vector3f(_min.x(), _min.y(),_min.z())); + vertices.pushBack(Vector3f(_max.x(), _min.y(),_min.z())); - vertices.pushBack(vec3(_max.x(), _min.y(),_min.z())); - vertices.pushBack(vec3(_max.x(), _min.y(),_max.z())); + vertices.pushBack(Vector3f(_max.x(), _min.y(),_min.z())); + vertices.pushBack(Vector3f(_max.x(), _min.y(),_max.z())); - vertices.pushBack(vec3(_max.x(), _min.y(),_max.z())); - vertices.pushBack(vec3(_min.x(), _min.y(),_max.z())); + vertices.pushBack(Vector3f(_max.x(), _min.y(),_max.z())); + vertices.pushBack(Vector3f(_min.x(), _min.y(),_max.z())); - vertices.pushBack(vec3(_min.x(), _min.y(),_max.z())); - vertices.pushBack(vec3(_min.x(), _min.y(),_min.z())); + vertices.pushBack(Vector3f(_min.x(), _min.y(),_max.z())); + vertices.pushBack(Vector3f(_min.x(), _min.y(),_min.z())); - vertices.pushBack(vec3(_min.x(), _max.y(),_min.z())); - vertices.pushBack(vec3(_max.x(), _max.y(),_min.z())); + vertices.pushBack(Vector3f(_min.x(), _max.y(),_min.z())); + vertices.pushBack(Vector3f(_max.x(), _max.y(),_min.z())); - vertices.pushBack(vec3(_max.x(), _max.y(),_min.z())); - vertices.pushBack(vec3(_max.x(), _max.y(),_max.z())); + vertices.pushBack(Vector3f(_max.x(), _max.y(),_min.z())); + vertices.pushBack(Vector3f(_max.x(), _max.y(),_max.z())); - vertices.pushBack(vec3(_max.x(), _max.y(),_max.z())); - vertices.pushBack(vec3(_min.x(), _max.y(),_max.z())); + vertices.pushBack(Vector3f(_max.x(), _max.y(),_max.z())); + vertices.pushBack(Vector3f(_min.x(), _max.y(),_max.z())); - vertices.pushBack(vec3(_min.x(), _max.y(),_max.z())); - vertices.pushBack(vec3(_min.x(), _max.y(),_min.z())); + vertices.pushBack(Vector3f(_min.x(), _max.y(),_max.z())); + vertices.pushBack(Vector3f(_min.x(), _max.y(),_min.z())); - vertices.pushBack(vec3(_min.x(), _min.y(),_min.z())); - vertices.pushBack(vec3(_min.x(), _max.y(),_min.z())); + vertices.pushBack(Vector3f(_min.x(), _min.y(),_min.z())); + vertices.pushBack(Vector3f(_min.x(), _max.y(),_min.z())); - vertices.pushBack(vec3(_max.x(), _min.y(),_min.z())); - vertices.pushBack(vec3(_max.x(), _max.y(),_min.z())); + vertices.pushBack(Vector3f(_max.x(), _min.y(),_min.z())); + vertices.pushBack(Vector3f(_max.x(), _max.y(),_min.z())); - vertices.pushBack(vec3(_max.x(), _min.y(),_max.z())); - vertices.pushBack(vec3(_max.x(), _max.y(),_max.z())); + vertices.pushBack(Vector3f(_max.x(), _min.y(),_max.z())); + vertices.pushBack(Vector3f(_max.x(), _max.y(),_max.z())); - vertices.pushBack(vec3(_min.x(), _min.y(),_max.z())); - vertices.pushBack(vec3(_min.x(), _max.y(),_max.z())); + vertices.pushBack(Vector3f(_min.x(), _min.y(),_max.z())); + vertices.pushBack(Vector3f(_min.x(), _max.y(),_max.z())); drawLine(vertices, _color, _transformationMatrix, _updateDepthBuffer, _depthtest); } -void ewol::resource::Colored3DObject::drawSquare(const vec3& _size, +void ewol::resource::Colored3DObject::drawSquare(const Vector3f& _size, mat4& _transformationMatrix, const etk::Color& _tmpColor) { - etk::Vector tmpVertices; + List tmpVertices; static int indices[36] = { 0,1,2, 3,2,1, 4,0,6, 6,0,2, 5,1,4, 4,1,0, 7,3,1, 7,1,5, 5,4,7, 7,4,6, 7,2,3, 7,6,2}; - vec3 vertices[8]={ vec3(_size[0],_size[1],_size[2]), - vec3(-_size[0],_size[1],_size[2]), - vec3(_size[0],-_size[1],_size[2]), - vec3(-_size[0],-_size[1],_size[2]), - vec3(_size[0],_size[1],-_size[2]), - vec3(-_size[0],_size[1],-_size[2]), - vec3(_size[0],-_size[1],-_size[2]), - vec3(-_size[0],-_size[1],-_size[2])}; + Vector3f vertices[8]={ Vector3f(_size[0],_size[1],_size[2]), + Vector3f(-_size[0],_size[1],_size[2]), + Vector3f(_size[0],-_size[1],_size[2]), + Vector3f(-_size[0],-_size[1],_size[2]), + Vector3f(_size[0],_size[1],-_size[2]), + Vector3f(-_size[0],_size[1],-_size[2]), + Vector3f(_size[0],-_size[1],-_size[2]), + Vector3f(-_size[0],-_size[1],-_size[2])}; tmpVertices.clear(); for (int32_t iii=0 ; iii<36 ; iii+=3) { // normal calculation : @@ -241,7 +241,7 @@ void ewol::resource::Colored3DObject::drawSphere(float _radius, int _longs, mat4& _transformationMatrix, const etk::Color& _tmpColor) { - etk::Vector tmpVertices; + List tmpVertices; for(int32_t iii=0; iii<=_lats; ++iii) { float lat0 = M_PI * (-0.5f + float(iii - 1) / _lats); float z0 = _radius*sin(lat0); @@ -255,14 +255,14 @@ void ewol::resource::Colored3DObject::drawSphere(float _radius, float lng = 2.0f * M_PI * float(jjj - 1) / _longs; float x = cos(lng); float y = sin(lng); - vec3 v1 = vec3(x * zr1, y * zr1, z1); - vec3 v4 = vec3(x * zr0, y * zr0, z0); + Vector3f v1 = Vector3f(x * zr1, y * zr1, z1); + Vector3f v4 = Vector3f(x * zr0, y * zr0, z0); lng = 2 * M_PI * float(jjj) / _longs; x = cos(lng); y = sin(lng); - vec3 v2 = vec3(x * zr1, y * zr1, z1); - vec3 v3 = vec3(x * zr0, y * zr0, z0); + Vector3f v2 = Vector3f(x * zr1, y * zr1, z1); + Vector3f v3 = Vector3f(x * zr0, y * zr0, z0); tmpVertices.pushBack(v1); tmpVertices.pushBack(v2); @@ -281,7 +281,7 @@ void ewol::resource::Colored3DObject::drawCylinder(float _radius, int _longs, mat4& _transformationMatrix, const etk::Color& _tmpColor) { - etk::Vector tmpVertices; + List tmpVertices; // center to border (TOP) // center to border (TOP) @@ -289,16 +289,16 @@ void ewol::resource::Colored3DObject::drawCylinder(float _radius, float lng = 2.0f * M_PI * float(jjj - 1) / _longs; float z = _size*0.5f; - vec3 v1 = vec3(0.0f, 0.0f, z); + Vector3f v1 = Vector3f(0.0f, 0.0f, z); float x = cos(lng)*_radius; float y = sin(lng)*_radius; - vec3 v2 = vec3(x, y, z); + Vector3f v2 = Vector3f(x, y, z); lng = 2.0f * M_PI * float(jjj) / _longs; x = cos(lng)*_radius; y = sin(lng)*_radius; - vec3 v3 = vec3(x, y, z); + Vector3f v3 = Vector3f(x, y, z); tmpVertices.pushBack(v1); tmpVertices.pushBack(v3); tmpVertices.pushBack(v2); @@ -311,14 +311,14 @@ void ewol::resource::Colored3DObject::drawCylinder(float _radius, float x = cos(lng)*_radius; float y = sin(lng)*_radius; - vec3 v2 = vec3(x, y, z); - vec3 v2b = vec3(x, y, -z); + Vector3f v2 = Vector3f(x, y, z); + Vector3f v2b = Vector3f(x, y, -z); lng = 2.0f * M_PI * float(jjj) / _longs; x = cos(lng)*_radius; y = sin(lng)*_radius; - vec3 v3 = vec3(x, y, z); - vec3 v3b = vec3(x, y, -z); + Vector3f v3 = Vector3f(x, y, z); + Vector3f v3b = Vector3f(x, y, -z); tmpVertices.pushBack(v2); tmpVertices.pushBack(v3); @@ -333,16 +333,16 @@ void ewol::resource::Colored3DObject::drawCylinder(float _radius, float lng = 2.0f * M_PI * float(jjj - 1) / _longs; float z = _size*-0.5f; - vec3 v1 = vec3(0.0f, 0.0f, z); + Vector3f v1 = Vector3f(0.0f, 0.0f, z); float x = cos(lng)*_radius; float y = sin(lng)*_radius; - vec3 v2 = vec3(x, y, z); + Vector3f v2 = Vector3f(x, y, z); lng = 2.0f * M_PI * float(jjj) / _longs; x = cos(lng)*_radius; y = sin(lng)*_radius; - vec3 v3 = vec3(x, y, z); + Vector3f v3 = Vector3f(x, y, z); tmpVertices.pushBack(v1); tmpVertices.pushBack(v2); tmpVertices.pushBack(v3); @@ -355,7 +355,7 @@ void ewol::resource::Colored3DObject::drawCapsule(float _radius, int _longs, mat4& _transformationMatrix, const etk::Color& _tmpColor) { - etk::Vector tmpVertices; + List tmpVertices; _lats = int32_t(_lats / 2)*2; // center to border (TOP) @@ -373,14 +373,14 @@ void ewol::resource::Colored3DObject::drawCapsule(float _radius, float lng = 2.0f * M_PI * float(jjj - 1) / _longs; float x = cos(lng); float y = sin(lng); - vec3 v1 = vec3(x * zr1, y * zr1, z1+offset); - vec3 v4 = vec3(x * zr0, y * zr0, z0+offset); + Vector3f v1 = Vector3f(x * zr1, y * zr1, z1+offset); + Vector3f v4 = Vector3f(x * zr0, y * zr0, z0+offset); lng = 2 * M_PI * float(jjj) / _longs; x = cos(lng); y = sin(lng); - vec3 v2 = vec3(x * zr1, y * zr1, z1+offset); - vec3 v3 = vec3(x * zr0, y * zr0, z0+offset); + Vector3f v2 = Vector3f(x * zr1, y * zr1, z1+offset); + Vector3f v3 = Vector3f(x * zr0, y * zr0, z0+offset); tmpVertices.pushBack(v1); tmpVertices.pushBack(v2); tmpVertices.pushBack(v3); @@ -398,14 +398,14 @@ void ewol::resource::Colored3DObject::drawCapsule(float _radius, float x = cos(lng)*_radius; float y = sin(lng)*_radius; - vec3 v2 = vec3(x, y, z); - vec3 v2b = vec3(x, y, -z); + Vector3f v2 = Vector3f(x, y, z); + Vector3f v2b = Vector3f(x, y, -z); lng = 2.0f * M_PI * float(jjj) / _longs; x = cos(lng)*_radius; y = sin(lng)*_radius; - vec3 v3 = vec3(x, y, z); - vec3 v3b = vec3(x, y, -z); + Vector3f v3 = Vector3f(x, y, z); + Vector3f v3b = Vector3f(x, y, -z); tmpVertices.pushBack(v2); tmpVertices.pushBack(v3); @@ -430,14 +430,14 @@ void ewol::resource::Colored3DObject::drawCapsule(float _radius, float lng = 2.0f * M_PI * float(jjj - 1) / _longs; float x = cos(lng); float y = sin(lng); - vec3 v1 = vec3(x * zr1, y * zr1, z1+offset); - vec3 v4 = vec3(x * zr0, y * zr0, z0+offset); + Vector3f v1 = Vector3f(x * zr1, y * zr1, z1+offset); + Vector3f v4 = Vector3f(x * zr0, y * zr0, z0+offset); lng = 2 * M_PI * float(jjj) / _longs; x = cos(lng); y = sin(lng); - vec3 v2 = vec3(x * zr1, y * zr1, z1+offset); - vec3 v3 = vec3(x * zr0, y * zr0, z0+offset); + Vector3f v2 = Vector3f(x * zr1, y * zr1, z1+offset); + Vector3f v3 = Vector3f(x * zr0, y * zr0, z0+offset); tmpVertices.pushBack(v1); tmpVertices.pushBack(v2); tmpVertices.pushBack(v3); @@ -456,20 +456,20 @@ void ewol::resource::Colored3DObject::drawCone(float _radius, int _longs, mat4& _transformationMatrix, const etk::Color& _tmpColor) { - etk::Vector tmpVertices; + List tmpVertices; // center to border (TOP) for(int32_t jjj=0; jjj<_longs; ++jjj) { float lng = 2.0f * M_PI * float(jjj - 1) / _longs; - vec3 v1 = vec3(0.0f, 0.0f, -_size/2); + Vector3f v1 = Vector3f(0.0f, 0.0f, -_size/2); float x = cos(lng)*_radius; float y = sin(lng)*_radius; - vec3 v2 = vec3(x, y, _size/2); + Vector3f v2 = Vector3f(x, y, _size/2); lng = 2.0f * M_PI * float(jjj) / _longs; x = cos(lng)*_radius; y = sin(lng)*_radius; - vec3 v3 = vec3(x, y, _size/2); + Vector3f v3 = Vector3f(x, y, _size/2); tmpVertices.pushBack(v1); tmpVertices.pushBack(v3); tmpVertices.pushBack(v2); @@ -478,16 +478,16 @@ void ewol::resource::Colored3DObject::drawCone(float _radius, for(int32_t jjj=0; jjj<_longs; ++jjj) { float lng = 2.0f * M_PI * float(jjj - 1) / _longs; - vec3 v1 = vec3(0.0f, 0.0f, _size/2); + Vector3f v1 = Vector3f(0.0f, 0.0f, _size/2); float x = cos(lng)*_radius; float y = sin(lng)*_radius; - vec3 v2 = vec3(x, y, _size/2); + Vector3f v2 = Vector3f(x, y, _size/2); lng = 2.0f * M_PI * float(jjj) / _longs; x = cos(lng)*_radius; y = sin(lng)*_radius; - vec3 v3 = vec3(x, y, _size/2); + Vector3f v3 = Vector3f(x, y, _size/2); tmpVertices.pushBack(v1); tmpVertices.pushBack(v2); tmpVertices.pushBack(v3); @@ -495,20 +495,20 @@ void ewol::resource::Colored3DObject::drawCone(float _radius, draw(tmpVertices, _tmpColor, _transformationMatrix); } -void ewol::resource::Colored3DObject::drawTriangles(const etk::Vector& _vertex, - const etk::Vector& _indice, +void ewol::resource::Colored3DObject::drawTriangles(const List& _vertex, + const List& _indice, mat4& _transformationMatrix, const etk::Color& _tmpColor, - const vec3& _offset) { - etk::Vector tmpVertices; + const Vector3f& _offset) { + List tmpVertices; for (size_t iii=0; iii<_indice.size()/3; ++iii) { tmpVertices.pushBack(_vertex[_indice[iii*3 + 0]]+_offset); tmpVertices.pushBack(_vertex[_indice[iii*3 + 1]]+_offset); tmpVertices.pushBack(_vertex[_indice[iii*3 + 2]]+_offset); - //EWOL_INFO(" indices " << _indice[iii*3 + 0] << " " << _indice[iii*3 + 1] << " " << _indice[iii*3 + 2]); - //EWOL_INFO(" triangle " << _vertex[_indice[iii*3 + 0]] << " " << _vertex[_indice[iii*3 + 1]] << " " << _vertex[_indice[iii*3 + 2]]); + //Log.info(" indices " << _indice[iii*3 + 0] << " " << _indice[iii*3 + 1] << " " << _indice[iii*3 + 2]); + //Log.info(" triangle " << _vertex[_indice[iii*3 + 0]] << " " << _vertex[_indice[iii*3 + 1]] << " " << _vertex[_indice[iii*3 + 2]]); } - //EWOL_INFO("display " << tmpVertices.size() << " vertices form " << _indice.size()); + //Log.info("display " << tmpVertices.size() << " vertices form " << _indice.size()); draw(tmpVertices, _tmpColor, _transformationMatrix); } diff --git a/src/org/atriasoft/ewol/resource/Colored3DObject.java b/src/org/atriasoft/ewol/resource/Colored3DObject.java index c9a6c42..fe4ba3f 100644 --- a/src/org/atriasoft/ewol/resource/Colored3DObject.java +++ b/src/org/atriasoft/ewol/resource/Colored3DObject.java @@ -30,28 +30,28 @@ namespace ewol { DECLARE_RESOURCE_FACTORY(Colored3DObject); virtual ~Colored3DObject(); public: - virtual void draw(const etk::Vector& _vertices, + virtual void draw(const List& _vertices, const etk::Color& _color, bool _updateDepthBuffer=true, bool _depthtest=true); - virtual void draw(const etk::Vector& _vertices, + virtual void draw(const List& _vertices, const etk::Color& _color, mat4& _transformationMatrix, bool _updateDepthBuffer=true, bool _depthtest=true); - virtual void drawLine(etk::Vector& _vertices, + virtual void drawLine(List& _vertices, const etk::Color& _color, mat4& _transformationMatrix, bool _updateDepthBuffer=true, bool _depthtest=true); - virtual void drawCubeLine(const vec3& _min, - const vec3& _max, + virtual void drawCubeLine(const Vector3f& _min, + const Vector3f& _max, const etk::Color& _color, mat4& _transformationMatrix, bool _updateDepthBuffer=true, bool _depthtest=true); public: - void drawSquare(const vec3& _size, + void drawSquare(const Vector3f& _size, mat4& _transformationMatrix, const etk::Color& _tmpColor); void drawSphere(float _radius, @@ -77,11 +77,11 @@ namespace ewol { int _longs, mat4& _transformationMatrix, const etk::Color& _tmpColor); - void drawTriangles(const etk::Vector& _vertex, - const etk::Vector& _indice, + void drawTriangles(const List& _vertex, + const List& _indice, mat4& _transformationMatrix, const etk::Color& _tmpColor, - const vec3& _offset=vec3(0,0,0.1)); + const Vector3f& _offset=Vector3f(0,0,0.1)); }; }; }; diff --git a/src/org/atriasoft/ewol/resource/ConfigFile.cpp b/src/org/atriasoft/ewol/resource/ConfigFile.cpp index ceb5b75..e1aa7f1 100644 --- a/src/org/atriasoft/ewol/resource/ConfigFile.cpp +++ b/src/org/atriasoft/ewol/resource/ConfigFile.cpp @@ -24,7 +24,7 @@ ewol::resource::ConfigFile::ConfigFile() : void ewol::resource::ConfigFile::init(const etk::Uri& _uri) { ethread::RecursiveLock lock(m_mutex); gale::Resource::init(_uri.get()); - EWOL_DEBUG("SFP : load \"" << _uri << "\""); + Log.debug("SFP : load \"" << _uri << "\""); reload(); } diff --git a/src/org/atriasoft/ewol/resource/DistanceFieldFont.cpp b/src/org/atriasoft/ewol/resource/DistanceFieldFont.cpp index fd126f1..edf8264 100644 --- a/src/org/atriasoft/ewol/resource/DistanceFieldFont.cpp +++ b/src/org/atriasoft/ewol/resource/DistanceFieldFont.cpp @@ -43,8 +43,8 @@ ewol::resource::DistanceFieldFont::DistanceFieldFont() : * // out contain: {"DATA:///font", "DATA:///font?lib=ewol"} * @example[stop] */ -static etk::Vector explodeMultiplePath(const etk::Uri& _uri) { - etk::Vector out; +static List explodeMultiplePath(const etk::Uri& _uri) { + List out; out.pushBack(_uri); if (_uri.getQuery().exist("lib") == true) { etk::Uri tmp = _uri; @@ -58,7 +58,7 @@ void ewol::resource::DistanceFieldFont::init(const etk::String& _fontName) { ethread::RecursiveLock lock(m_mutex); ewol::resource::Texture::init(_fontName); etk::String localName = _fontName; - etk::Vector folderList; + List folderList; if (ewol::getContext().getFontDefault().getUseExternal() == true) { #if defined(__TARGET_OS__Android) folderList.pushBack(etk::Path("/system/fonts")); @@ -71,52 +71,52 @@ void ewol::resource::DistanceFieldFont::init(const etk::String& _fontName) { folderList.pushBack(it); } for (size_t folderID = 0; folderID < folderList.size() ; folderID++) { - etk::Vector output = etk::uri::listRecursive(folderList[folderID]); + List output = etk::uri::listRecursive(folderList[folderID]); - etk::Vector split = etk::split(localName, ';'); - EWOL_INFO("try to find font named : " << split << " in: " << output); - //EWOL_CRITICAL("parse string : " << split); + List split = etk::split(localName, ';'); + Log.info("try to find font named : " << split << " in: " << output); + //Log.critical("parse string : " << split); bool hasFindAFont = false; for (size_t jjj=0; jjjgetHeight(SIZE_GENERATION)); // TODO : basic font use 512 is better ... == > maybe estimate it with the dpi ??? - setImageSize(ivec2(512,32)); + setImageSize(Vector2i(512,32)); // now we can acces directly on the image m_data.clear(etk::Color<>(0x00000000)); // add error glyph @@ -143,7 +143,7 @@ void ewol::resource::DistanceFieldFont::init(const etk::String& _fontName) { } flush(); if (true) { - EWOL_ERROR("Save in cache the loaded data ..... "); + Log.error("Save in cache the loaded data ..... "); egami::store(m_data, "CACHE:///fileFont.bmp"); // ==> for debug test only ... egami::store(m_data, "CACHE:///fileFont.png"); } @@ -162,17 +162,17 @@ float ewol::resource::DistanceFieldFont::getDisplayRatio(float _size) { void ewol::resource::DistanceFieldFont::generateDistanceField(const egami::ImageMono& _input, egami::Image& _output) { - EWOL_INFO("Generate Distance field font [START]"); - EWOL_INFO(" _input.getSize()=" << _input.getSize()); + Log.info("Generate Distance field font [START]"); + Log.info(" _input.getSize()=" << _input.getSize()); ethread::RecursiveLock lock(m_mutex); int32_t size = _input.getSize().x() * _input.getSize().y(); - etk::Vector xdist; - etk::Vector ydist; - etk::Vector gx; - etk::Vector gy; - etk::Vector data; - etk::Vector outside; - etk::Vector inside; + List xdist; + List ydist; + List gx; + List gy; + List data; + List outside; + List inside; xdist.resize(size, 0); ydist.resize(size, 0); gx.resize(size, 0.0); @@ -180,13 +180,13 @@ void ewol::resource::DistanceFieldFont::generateDistanceField(const egami::Image data.resize(size, 0.0); outside.resize(size, 0.0); inside.resize(size, 0.0); - EWOL_INFO(" size=" << size); + Log.info(" size=" << size); // Convert img into double (data) double img_min = 255, img_max = -255; for (int32_t yyy = 0; yyy < _input.getSize().y(); ++yyy) { for (int32_t xxx = 0; xxx < _input.getSize().x(); ++xxx) { int32_t iii = yyy * _input.getSize().x() + xxx; - double v = _input.get(ivec2(xxx, yyy)); + double v = _input.get(Vector2i(xxx, yyy)); data[iii] = v; if (v > img_max) { img_max = v; @@ -200,7 +200,7 @@ void ewol::resource::DistanceFieldFont::generateDistanceField(const egami::Image for (int32_t yyy = 0; yyy < _input.getSize().y(); ++yyy) { for (int32_t xxx = 0; xxx < _input.getSize().x(); ++xxx) { int32_t iii = yyy * _input.getSize().x() + xxx; - data[iii] = (_input.get(ivec2(xxx, yyy))-img_min)/img_max; + data[iii] = (_input.get(Vector2i(xxx, yyy))-img_min)/img_max; } } // Compute outside = edtaa3(bitmap); % Transform background (0's) @@ -228,7 +228,7 @@ void ewol::resource::DistanceFieldFont::generateDistanceField(const egami::Image inside[iii] = 0.0; } } - EWOL_INFO(" _output=" << _output); + Log.info(" _output=" << _output); _output.resize(_input.getSize(), etk::Color<>(0)); _output.clear(etk::Color<>(0)); for (int32_t xxx = 0; xxx < _output.getSize().x(); ++xxx) { @@ -244,10 +244,10 @@ void ewol::resource::DistanceFieldFont::generateDistanceField(const egami::Image } uint8_t val = 255 - (unsigned char) outside[iii]; // TODO : Remove multiple size of the map ... - _output.set(ivec2(xxx, yyy), etk::Color<>((int32_t)val,(int32_t)val,(int32_t)val,255)); + _output.set(Vector2i(xxx, yyy), etk::Color<>((int32_t)val,(int32_t)val,(int32_t)val,255)); } } - EWOL_INFO(" _output=" << _output); + Log.info(" _output=" << _output); } bool ewol::resource::DistanceFieldFont::addGlyph(const char32_t& _val) { @@ -260,30 +260,30 @@ bool ewol::resource::DistanceFieldFont::addGlyph(const char32_t& _val) { GlyphProperty tmpchar; tmpchar.m_UVal = _val; egami::ImageMono imageGlyphRaw; - egami::Image imageGlyphDistanceField(ivec2(32,32), egami::colorType::RGBA8); - EWOL_DEBUG("Generate Glyph : " << _val); + egami::Image imageGlyphDistanceField(Vector2i(32,32), egami::colorType::RGBA8); + Log.debug("Generate Glyph : " << _val); if (m_font->getGlyphProperty(SIZE_GENERATION, tmpchar) == true) { - //EWOL_DEBUG("load char: '" << _val << "'=" << _val); + //Log.debug("load char: '" << _val << "'=" << _val); hasChange = true; // change line if needed ... if (m_lastGlyphPos.x() + tmpchar.m_sizeTexture.x()+m_borderSize*2.0 > m_data.getSize().x()) { m_lastGlyphPos.setX(1); - m_lastGlyphPos += ivec2(0, m_lastRawHeigh); + m_lastGlyphPos += Vector2i(0, m_lastRawHeigh); m_lastRawHeigh = 0; } while(m_lastGlyphPos.y()+tmpchar.m_sizeTexture.y()+m_borderSize*2.0 > m_data.getSize().y()) { - ivec2 size = m_data.getSize(); + Vector2i size = m_data.getSize(); size.setY(size.y()*2); - EWOL_VERBOSE("resize " << m_data.getSize() << " => " << size); + Log.verbose("resize " << m_data.getSize() << " => " << size); m_data.resize(size, etk::Color<>(0)); // change the coordonate on the element in the texture for (size_t jjj = 0; jjj < m_listElement.size(); ++jjj) { - m_listElement[jjj].m_texturePosStart *= vec2(1.0f, 0.5f); - m_listElement[jjj].m_texturePosSize *= vec2(1.0f, 0.5f); + m_listElement[jjj].m_texturePosStart *= Vector2f(1.0f, 0.5f); + m_listElement[jjj].m_texturePosSize *= Vector2f(1.0f, 0.5f); } } - m_textureBorderSize = vec2(m_borderSize/(float)m_data.getSize().x(), + m_textureBorderSize = Vector2f(m_borderSize/(float)m_data.getSize().x(), m_borderSize/(float)m_data.getSize().y() ); // draw the glyph m_font->drawGlyph(imageGlyphRaw, SIZE_GENERATION, tmpchar, m_borderSize); @@ -291,10 +291,10 @@ bool ewol::resource::DistanceFieldFont::addGlyph(const char32_t& _val) { generateDistanceField(imageGlyphRaw, imageGlyphDistanceField); if (_val == 100) { - EWOL_DEBUG("print char: " << _val << " size=" << imageGlyphDistanceField.getSize()); + Log.debug("print char: " << _val << " size=" << imageGlyphDistanceField.getSize()); for (int32_t yyy = 0; yyy < imageGlyphDistanceField.getSize().y(); ++yyy) { for (int32_t xxx = 0; xxx < imageGlyphDistanceField.getSize().x(); ++xxx) { - EWOL_PRINT((int)(imageGlyphDistanceField.get(ivec2(xxx, yyy)).r()) << " "); + Log.print((int)(imageGlyphDistanceField.get(Vector2i(xxx, yyy)).r()) << " "); } } } @@ -314,7 +314,7 @@ bool ewol::resource::DistanceFieldFont::addGlyph(const char32_t& _val) { } // note : +1 is for the overlapping of the glyph (Part 3) // update the Bitmap position drawing : - m_lastGlyphPos += ivec2(imageGlyphRaw.getSize().x()+1, 0); + m_lastGlyphPos += Vector2i(imageGlyphRaw.getSize().x()+1, 0); } else { EWOL_WARNING("Did not find char : '" << _val << "'=" << _val); tmpchar.setNotExist(); @@ -328,7 +328,7 @@ bool ewol::resource::DistanceFieldFont::addGlyph(const char32_t& _val) { } if (hasChange == true) { flush(); - //EWOL_ERROR("Save in cache the loaded data ..... "); + //Log.error("Save in cache the loaded data ..... "); //egami::store(m_data, "CACHE:///fileFont.bmp"); // ==> for debug test only ... //egami::store(m_data, "CACHE:///fileFont.png"); } @@ -343,11 +343,11 @@ int32_t ewol::resource::DistanceFieldFont::getIndex(char32_t _charcode) { return _charcode - 0x1F; } else { for (size_t iii=0x80-0x20; iii < m_listElement.size(); iii++) { - //EWOL_DEBUG("search : '" << charcode << "' =?= '" << (m_listElement[displayMode])[iii].m_UVal << "'"); + //Log.debug("search : '" << charcode << "' =?= '" << (m_listElement[displayMode])[iii].m_UVal << "'"); if (_charcode == (m_listElement)[iii].m_UVal) { - //EWOL_DEBUG("search : '" << charcode << "'"); + //Log.debug("search : '" << charcode << "'"); if ((m_listElement)[iii].exist()) { - //EWOL_DEBUG("return " << iii); + //Log.debug("return " << iii); return iii; } else { return 0; @@ -364,27 +364,27 @@ int32_t ewol::resource::DistanceFieldFont::getIndex(char32_t _charcode) { ewol::GlyphProperty* ewol::resource::DistanceFieldFont::getGlyphPointer(const char32_t& _charcode) { ethread::RecursiveLock lock(m_mutex); - EWOL_VERBOSE("getGlyphPointer : " << uint32_t(_charcode)); + Log.verbose("getGlyphPointer : " << uint32_t(_charcode)); int32_t index = getIndex(_charcode); if( index < 0 || (size_t)index >= m_listElement.size() ) { - EWOL_ERROR(" Try to get glyph index inexistant ... == > return the index 0 ... id=" << index); + Log.error(" Try to get glyph index inexistant ... == > return the index 0 ... id=" << index); if (m_listElement.size() > 0) { return &((m_listElement)[0]); } return null; } - //EWOL_ERROR(" index=" << index); - //EWOL_ERROR(" m_UVal=" << m_listElement[_displayMode][index].m_UVal); - //EWOL_ERROR(" m_glyphIndex=" << m_listElement[_displayMode][index].m_glyphIndex); - //EWOL_ERROR(" m_advance=" << m_listElement[_displayMode][index].m_advance); - //EWOL_ERROR(" m_bearing=" << m_listElement[_displayMode][index].m_bearing); + //Log.error(" index=" << index); + //Log.error(" m_UVal=" << m_listElement[_displayMode][index].m_UVal); + //Log.error(" m_glyphIndex=" << m_listElement[_displayMode][index].m_glyphIndex); + //Log.error(" m_advance=" << m_listElement[_displayMode][index].m_advance); + //Log.error(" m_bearing=" << m_listElement[_displayMode][index].m_bearing); return &((m_listElement)[index]); } void ewol::resource::DistanceFieldFont::exportOnFile() { ethread::RecursiveLock lock(m_mutex); - EWOL_DEBUG("EXPORT: DistanceFieldFont : file : '" << m_fileName << ".json'"); + Log.debug("EXPORT: DistanceFieldFont : file : '" << m_fileName << ".json'"); ejson::Document doc; ejson::Array tmpList; for (size_t iii=0; iii Bold is a little more complicated (maybe with the bordersize) ememory::SharedPtr m_font; public: - etk::Vector m_listElement; + List m_listElement; private: // for the texture generation : - ivec2 m_lastGlyphPos; + Vector2i m_lastGlyphPos; int32_t m_lastRawHeigh; protected: DistanceFieldFont(); @@ -80,12 +80,12 @@ namespace ewol { void generateDistanceField(const egami::ImageMono& _input, egami::Image& _output); private: float m_borderSize; //!< number of pixel added on the border of a glyph - vec2 m_textureBorderSize; //!< Transformed the border size in the texture dimention + Vector2f m_textureBorderSize; //!< Transformed the border size in the texture dimention public: float getPixelBorderSize() { return m_borderSize; } - const vec2& getTextureBorderSize() { + const Vector2f& getTextureBorderSize() { return m_textureBorderSize; } public: diff --git a/src/org/atriasoft/ewol/resource/FontFreeType.cpp b/src/org/atriasoft/ewol/resource/FontFreeType.cpp index d74dd09..83ceade 100644 --- a/src/org/atriasoft/ewol/resource/FontFreeType.cpp +++ b/src/org/atriasoft/ewol/resource/FontFreeType.cpp @@ -23,7 +23,7 @@ static int32_t l_countLoaded=0; static FT_Library library; void ewol::resource::freeTypeInit() { - EWOL_DEBUG(" == > init Font-Manager"); + Log.debug(" == > init Font-Manager"); l_countLoaded++; if (l_countLoaded>1) { // already loaded ... @@ -31,12 +31,12 @@ void ewol::resource::freeTypeInit() { } int32_t error = FT_Init_FreeType( &library ); if(0 != error) { - EWOL_CRITICAL(" when loading FreeType Librairy ..."); + Log.critical(" when loading FreeType Librairy ..."); } } void ewol::resource::freeTypeUnInit() { - EWOL_DEBUG(" == > Un-Init Font-Manager"); + Log.debug(" == > Un-Init Font-Manager"); l_countLoaded--; if (l_countLoaded>0) { // already needed ... @@ -45,7 +45,7 @@ void ewol::resource::freeTypeUnInit() { int32_t error = FT_Done_FreeType( library ); library = null; if(0 != error) { - EWOL_CRITICAL(" when Un-loading FreeType Librairy ..."); + Log.critical(" when Un-loading FreeType Librairy ..."); } } @@ -60,11 +60,11 @@ void ewol::resource::FontFreeType::init(const etk::Uri& _uri) { ewol::resource::FontBase::init(_uri); auto fileIO = etk::uri::get(_uri); if (fileIO == null) { - EWOL_ERROR("File Does not exist : " << _uri); + Log.error("File Does not exist : " << _uri); return; } if (fileIO->open(etk::io::OpenMode::Read) == false) { - EWOL_ERROR("Can not open the file : " << _uri); + Log.error("Can not open the file : " << _uri); return; } m_FileBuffer = fileIO->readAll(); @@ -73,12 +73,12 @@ void ewol::resource::FontFreeType::init(const etk::Uri& _uri) { // load Face ... int32_t error = FT_New_Memory_Face(library, &m_FileBuffer[0], m_FileBuffer.size(), 0, &m_fftFace ); if( FT_Err_Unknown_File_Format == error) { - EWOL_ERROR("... the font file could be opened and read, but it appears ... that its font format is unsupported"); + Log.error("... the font file could be opened and read, but it appears ... that its font format is unsupported"); } else if (0 != error) { - EWOL_ERROR("... another error code means that the font file could not ... be opened or read, or simply that it is broken..."); + Log.error("... another error code means that the font file could not ... be opened or read, or simply that it is broken..."); } else { // all OK - EWOL_DEBUG("load font : \"" << _uri << "\" glyph count = " << (int)m_fftFace->num_glyphs); + Log.debug("load font : \"" << _uri << "\" glyph count = " << (int)m_fftFace->num_glyphs); m_init = true; //display(); } @@ -92,13 +92,13 @@ ewol::resource::FontFreeType::~FontFreeType() { FT_Done_Face(m_fftFace); } -vec2 ewol::resource::FontFreeType::getSize(int32_t _fontSize, const etk::String& _unicodeString) { +Vector2f ewol::resource::FontFreeType::getSize(int32_t _fontSize, const etk::String& _unicodeString) { ethread::RecursiveLock lock(m_mutex); if (m_init == false) { - return vec2(0,0); + return Vector2f(0,0); } // TODO : ... - vec2 outputSize(0,0); + Vector2f outputSize(0,0); return outputSize; } @@ -122,7 +122,7 @@ bool ewol::resource::FontFreeType::getGlyphProperty(int32_t _fontSize, ewol::Gly // note tha <<6 == *64 corespond with the 1/64th of points calculation of freetype int32_t error = FT_Set_Char_Size(m_fftFace, _fontSize<<6, _fontSize<<6, fontQuality, fontQuality); if (0!=error ) { - EWOL_ERROR("FT_Set_Char_Size == > error in settings ..."); + Log.error("FT_Set_Char_Size == > error in settings ..."); return false; } // a small shortcut @@ -134,13 +134,13 @@ bool ewol::resource::FontFreeType::getGlyphProperty(int32_t _fontSize, ewol::Gly glyph_index, // glyph index FT_LOAD_DEFAULT ); if (0!=error ) { - EWOL_ERROR("FT_Load_Glyph specify Glyph"); + Log.error("FT_Load_Glyph specify Glyph"); return false; } // convert to an anti-aliased bitmap error = FT_Render_Glyph(slot, FT_RENDER_MODE_NORMAL ); if (0!=error) { - EWOL_ERROR("FT_Render_Glyph"); + Log.error("FT_Render_Glyph"); return false; } // set properties : @@ -154,7 +154,7 @@ bool ewol::resource::FontFreeType::getGlyphProperty(int32_t _fontSize, ewol::Gly bool ewol::resource::FontFreeType::drawGlyph(egami::Image& _imageOut, int32_t _fontSize, - ivec2 _glyphPosition, + Vector2i _glyphPosition, ewol::GlyphProperty& _property, int8_t _posInImage) { ethread::RecursiveLock lock(m_mutex); @@ -167,7 +167,7 @@ bool ewol::resource::FontFreeType::drawGlyph(egami::Image& _imageOut, // note tha <<6 == *64 corespond with the 1/64th of points calculation of freetype int32_t error = FT_Set_Char_Size(m_fftFace, _fontSize<<6, _fontSize<<6, fontQuality, fontQuality); if (0!=error ) { - EWOL_ERROR("FT_Set_Char_Size == > error in settings ..."); + Log.error("FT_Set_Char_Size == > error in settings ..."); return false; } // a small shortcut @@ -177,20 +177,20 @@ bool ewol::resource::FontFreeType::drawGlyph(egami::Image& _imageOut, _property.m_glyphIndex, // glyph index FT_LOAD_DEFAULT ); if (0!=error ) { - EWOL_ERROR("FT_Load_Glyph specify Glyph"); + Log.error("FT_Load_Glyph specify Glyph"); return false; } // convert to an anti-aliased bitmap error = FT_Render_Glyph(slot, FT_RENDER_MODE_NORMAL ); if (0!=error) { - EWOL_ERROR("FT_Render_Glyph"); + Log.error("FT_Render_Glyph"); return false; } // draw it on the output Image : etk::Color<> tlpppp(0xFF, 0xFF, 0xFF, 0x00); for(size_t jjj=0; jjj < slot->bitmap.rows;jjj++) { for(size_t iii=0; iii < slot->bitmap.width; iii++){ - tlpppp = _imageOut.get(ivec2(_glyphPosition.x()+iii, _glyphPosition.y()+jjj)); + tlpppp = _imageOut.get(Vector2i(_glyphPosition.x()+iii, _glyphPosition.y()+jjj)); uint8_t valueColor = slot->bitmap.buffer[iii + slot->bitmap.width*jjj]; // set only alpha : switch(_posInImage) { @@ -209,7 +209,7 @@ bool ewol::resource::FontFreeType::drawGlyph(egami::Image& _imageOut, break; } // real set of color - _imageOut.set(ivec2(_glyphPosition.x()+iii, _glyphPosition.y()+jjj), tlpppp ); + _imageOut.set(Vector2i(_glyphPosition.x()+iii, _glyphPosition.y()+jjj), tlpppp ); } } return true; @@ -229,7 +229,7 @@ bool ewol::resource::FontFreeType::drawGlyph(egami::ImageMono& _imageOut, // note tha <<6 == *64 corespond with the 1/64th of points calculation of freetype int32_t error = FT_Set_Char_Size(m_fftFace, _fontSize<<6, _fontSize<<6, fontQuality, fontQuality); if (0!=error ) { - EWOL_ERROR("FT_Set_Char_Size == > error in settings ..."); + Log.error("FT_Set_Char_Size == > error in settings ..."); return false; } // a small shortcut @@ -239,36 +239,36 @@ bool ewol::resource::FontFreeType::drawGlyph(egami::ImageMono& _imageOut, _property.m_glyphIndex, // glyph index FT_LOAD_DEFAULT ); if (0!=error ) { - EWOL_ERROR("FT_Load_Glyph specify Glyph"); + Log.error("FT_Load_Glyph specify Glyph"); return false; } // convert to an anti-aliased bitmap error = FT_Render_Glyph(slot, FT_RENDER_MODE_NORMAL ); // TODO : set FT_RENDER_MODE_MONO ==> 1 bit value ==> faster generation ... if (0!=error) { - EWOL_ERROR("FT_Render_Glyph"); + Log.error("FT_Render_Glyph"); return false; } // resize output image : - _imageOut.resize(ivec2(slot->bitmap.width+2*_borderSize, slot->bitmap.rows+2*_borderSize), 0); + _imageOut.resize(Vector2i(slot->bitmap.width+2*_borderSize, slot->bitmap.rows+2*_borderSize), 0); for(size_t jjj=0; jjj < slot->bitmap.rows;jjj++) { for(size_t iii=0; iii < slot->bitmap.width; iii++){ uint8_t valueColor = slot->bitmap.buffer[iii + slot->bitmap.width*jjj]; // real set of color - _imageOut.set(ivec2(_borderSize+iii, _borderSize+jjj), valueColor ); + _imageOut.set(Vector2i(_borderSize+iii, _borderSize+jjj), valueColor ); } } return true; } -void ewol::resource::FontFreeType::generateKerning(int32_t fontSize, etk::Vector& listGlyph) { +void ewol::resource::FontFreeType::generateKerning(int32_t fontSize, List& listGlyph) { ethread::RecursiveLock lock(m_mutex); if(m_init == false) { return; } if ((FT_FACE_FLAG_KERNING & m_fftFace->face_flags) == 0) { - EWOL_INFO("No kerning generation (disable) in the font"); + Log.info("No kerning generation (disable) in the font"); } // 300dpi (hight quality) 96 dpi (normal quality) int32_t fontQuality = 96; @@ -276,7 +276,7 @@ void ewol::resource::FontFreeType::generateKerning(int32_t fontSize, etk::Vector // note tha <<6 == *64 corespond with the 1/64th of points calculation of freetype int32_t error = FT_Set_Char_Size(m_fftFace, fontSize<<6, fontSize<<6, fontQuality, fontQuality); if (0!=error ) { - EWOL_ERROR("FT_Set_Char_Size == > error in settings ..."); + Log.error("FT_Set_Char_Size == > error in settings ..."); return; } // For all the kerning element we get the kerning value : @@ -289,7 +289,7 @@ void ewol::resource::FontFreeType::generateKerning(int32_t fontSize, etk::Vector if (kerning.x != 0) { listGlyph[iii].kerningAdd(listGlyph[kkk].m_UVal, kerning.x/32.0f ); - //EWOL_DEBUG("Kerning between : '" << (char)listGlyph[iii].m_UVal << "'&'" << (char)listGlyph[kkk].m_UVal << "' value : " << kerning.x << " => " << (kerning.x/64.0f)); + //Log.debug("Kerning between : '" << (char)listGlyph[iii].m_UVal << "'&'" << (char)listGlyph[kkk].m_UVal << "' value : " << kerning.x << " => " << (kerning.x/64.0f)); } } } @@ -301,84 +301,84 @@ void ewol::resource::FontFreeType::display() { if(m_init == false) { return; } - EWOL_INFO(" number of glyph = " << (int)m_fftFace->num_glyphs); + Log.info(" number of glyph = " << (int)m_fftFace->num_glyphs); if ((FT_FACE_FLAG_SCALABLE & m_fftFace->face_flags) != 0) { - EWOL_INFO(" flags = FT_FACE_FLAG_SCALABLE (enable)"); + Log.info(" flags = FT_FACE_FLAG_SCALABLE (enable)"); } else { - EWOL_DEBUG(" flags = FT_FACE_FLAG_SCALABLE (disable)"); + Log.debug(" flags = FT_FACE_FLAG_SCALABLE (disable)"); } if ((FT_FACE_FLAG_FIXED_SIZES & m_fftFace->face_flags) != 0) { - EWOL_INFO(" flags = FT_FACE_FLAG_FIXED_SIZES (enable)"); + Log.info(" flags = FT_FACE_FLAG_FIXED_SIZES (enable)"); } else { - EWOL_DEBUG(" flags = FT_FACE_FLAG_FIXED_SIZES (disable)"); + Log.debug(" flags = FT_FACE_FLAG_FIXED_SIZES (disable)"); } if ((FT_FACE_FLAG_FIXED_WIDTH & m_fftFace->face_flags) != 0) { - EWOL_INFO(" flags = FT_FACE_FLAG_FIXED_WIDTH (enable)"); + Log.info(" flags = FT_FACE_FLAG_FIXED_WIDTH (enable)"); } else { - EWOL_DEBUG(" flags = FT_FACE_FLAG_FIXED_WIDTH (disable)"); + Log.debug(" flags = FT_FACE_FLAG_FIXED_WIDTH (disable)"); } if ((FT_FACE_FLAG_SFNT & m_fftFace->face_flags) != 0) { - EWOL_INFO(" flags = FT_FACE_FLAG_SFNT (enable)"); + Log.info(" flags = FT_FACE_FLAG_SFNT (enable)"); } else { - EWOL_DEBUG(" flags = FT_FACE_FLAG_SFNT (disable)"); + Log.debug(" flags = FT_FACE_FLAG_SFNT (disable)"); } if ((FT_FACE_FLAG_HORIZONTAL & m_fftFace->face_flags) != 0) { - EWOL_INFO(" flags = FT_FACE_FLAG_HORIZONTAL (enable)"); + Log.info(" flags = FT_FACE_FLAG_HORIZONTAL (enable)"); } else { - EWOL_DEBUG(" flags = FT_FACE_FLAG_HORIZONTAL (disable)"); + Log.debug(" flags = FT_FACE_FLAG_HORIZONTAL (disable)"); } if ((FT_FACE_FLAG_VERTICAL & m_fftFace->face_flags) != 0) { - EWOL_INFO(" flags = FT_FACE_FLAG_VERTICAL (enable)"); + Log.info(" flags = FT_FACE_FLAG_VERTICAL (enable)"); } else { - EWOL_DEBUG(" flags = FT_FACE_FLAG_VERTICAL (disable)"); + Log.debug(" flags = FT_FACE_FLAG_VERTICAL (disable)"); } if ((FT_FACE_FLAG_KERNING & m_fftFace->face_flags) != 0) { - EWOL_INFO(" flags = FT_FACE_FLAG_KERNING (enable)"); + Log.info(" flags = FT_FACE_FLAG_KERNING (enable)"); } else { - EWOL_DEBUG(" flags = FT_FACE_FLAG_KERNING (disable)"); + Log.debug(" flags = FT_FACE_FLAG_KERNING (disable)"); } /* Deprecated flag if ((FT_FACE_FLAG_FAST_GLYPHS & face->face_flags) != 0) { - EWOL_INFO(" flags = FT_FACE_FLAG_FAST_GLYPHS (enable)"); + Log.info(" flags = FT_FACE_FLAG_FAST_GLYPHS (enable)"); } else { - EWOL_DEBUG(" flags = FT_FACE_FLAG_FAST_GLYPHS (disable)"); + Log.debug(" flags = FT_FACE_FLAG_FAST_GLYPHS (disable)"); } */ if ((FT_FACE_FLAG_MULTIPLE_MASTERS & m_fftFace->face_flags) != 0) { - EWOL_INFO(" flags = FT_FACE_FLAG_MULTIPLE_MASTERS (enable)"); + Log.info(" flags = FT_FACE_FLAG_MULTIPLE_MASTERS (enable)"); } else { - EWOL_DEBUG(" flags = FT_FACE_FLAG_MULTIPLE_MASTERS (disable)"); + Log.debug(" flags = FT_FACE_FLAG_MULTIPLE_MASTERS (disable)"); } if ((FT_FACE_FLAG_GLYPH_NAMES & m_fftFace->face_flags) != 0) { - EWOL_INFO(" flags = FT_FACE_FLAG_GLYPH_NAMES (enable)"); + Log.info(" flags = FT_FACE_FLAG_GLYPH_NAMES (enable)"); } else { - EWOL_DEBUG(" flags = FT_FACE_FLAG_GLYPH_NAMES (disable)"); + Log.debug(" flags = FT_FACE_FLAG_GLYPH_NAMES (disable)"); } if ((FT_FACE_FLAG_EXTERNAL_STREAM & m_fftFace->face_flags) != 0) { - EWOL_INFO(" flags = FT_FACE_FLAG_EXTERNAL_STREAM (enable)"); + Log.info(" flags = FT_FACE_FLAG_EXTERNAL_STREAM (enable)"); } else { - EWOL_DEBUG(" flags = FT_FACE_FLAG_EXTERNAL_STREAM (disable)"); + Log.debug(" flags = FT_FACE_FLAG_EXTERNAL_STREAM (disable)"); } if ((FT_FACE_FLAG_HINTER & m_fftFace->face_flags) != 0) { - EWOL_INFO(" flags = FT_FACE_FLAG_HINTER (enable)"); + Log.info(" flags = FT_FACE_FLAG_HINTER (enable)"); } else { - EWOL_DEBUG(" flags = FT_FACE_FLAG_HINTER (disable)"); + Log.debug(" flags = FT_FACE_FLAG_HINTER (disable)"); } if ((FT_FACE_FLAG_CID_KEYED & m_fftFace->face_flags) != 0) { - EWOL_INFO(" flags = FT_FACE_FLAG_CID_KEYED (enable)"); + Log.info(" flags = FT_FACE_FLAG_CID_KEYED (enable)"); } else { - EWOL_DEBUG(" flags = FT_FACE_FLAG_CID_KEYED (disable)"); + Log.debug(" flags = FT_FACE_FLAG_CID_KEYED (disable)"); } /* if ((FT_FACE_FLAG_TRICKY & m_fftFace->face_flags) != 0) { - EWOL_INFO(" flags = FT_FACE_FLAG_TRICKY (enable)"); + Log.info(" flags = FT_FACE_FLAG_TRICKY (enable)"); } else { - EWOL_DEBUG(" flags = FT_FACE_FLAG_TRICKY (disable)"); + Log.debug(" flags = FT_FACE_FLAG_TRICKY (disable)"); } */ - EWOL_INFO(" unit per EM = " << m_fftFace->units_per_EM); - EWOL_INFO(" num of fixed sizes = " << m_fftFace->num_fixed_sizes); - //EWOL_INFO(" Availlable sizes = " << (int)m_fftFace->available_sizes); + Log.info(" unit per EM = " << m_fftFace->units_per_EM); + Log.info(" num of fixed sizes = " << m_fftFace->num_fixed_sizes); + //Log.info(" Availlable sizes = " << (int)m_fftFace->available_sizes); - //EWOL_INFO(" Current size = " << (int)m_fftFace->size); + //Log.info(" Current size = " << (int)m_fftFace->size); } diff --git a/src/org/atriasoft/ewol/resource/FontFreeType.java b/src/org/atriasoft/ewol/resource/FontFreeType.java index 3bede00..03b0576 100644 --- a/src/org/atriasoft/ewol/resource/FontFreeType.java +++ b/src/org/atriasoft/ewol/resource/FontFreeType.java @@ -20,7 +20,7 @@ namespace ewol { // show : http://www.freetype.org/freetype2/docs/tutorial/step2.html class FontFreeType : public ewol::resource::FontBase { private: - etk::Vector m_FileBuffer; + List m_FileBuffer; int32_t m_FileSize; FT_Face m_fftFace; bool m_init; @@ -38,7 +38,7 @@ namespace ewol { bool drawGlyph(egami::Image& _imageOut, int32_t _fontSize, - ivec2 _glyphPosition, + Vector2i _glyphPosition, ewol::GlyphProperty& _property, int8_t _posInImage); @@ -47,12 +47,12 @@ namespace ewol { ewol::GlyphProperty& _property, int32_t _borderSize = 0); - vec2 getSize(int32_t _fontSize, const etk::String& _unicodeString); + Vector2f getSize(int32_t _fontSize, const etk::String& _unicodeString); int32_t getHeight(int32_t _fontSize); float getSizeWithHeight(float _fontHeight); - void generateKerning(int32_t _fontSize, etk::Vector& _listGlyph); + void generateKerning(int32_t _fontSize, List& _listGlyph); }; void freeTypeInit(); void freeTypeUnInit(); diff --git a/src/org/atriasoft/ewol/resource/ImageDF.cpp b/src/org/atriasoft/ewol/resource/ImageDF.cpp index 86e75b6..3a33149 100644 --- a/src/org/atriasoft/ewol/resource/ImageDF.cpp +++ b/src/org/atriasoft/ewol/resource/ImageDF.cpp @@ -25,16 +25,16 @@ void ewol::resource::ImageDF::init() { ewol::resource::Texture::init(); } -void ewol::resource::ImageDF::init(etk::String _genName, const etk::Uri& _uri, const ivec2& _size) { +void ewol::resource::ImageDF::init(etk::String _genName, const etk::Uri& _uri, const Vector2i& _size) { ethread::RecursiveLock lock(m_mutex); ewol::resource::Texture::init(_genName); - EWOL_DEBUG("create a new resource::Image : _genName=" << _genName << " _uri=" << _uri << " size=" << _size); + Log.debug("create a new resource::Image : _genName=" << _genName << " _uri=" << _uri << " size=" << _size); m_data = egami::load(_uri, _size); if (m_data.exist() == false) { - EWOL_ERROR("ERROR when loading the image : " << _uri); + Log.error("ERROR when loading the image : " << _uri); } - ivec2 tmp = m_data.getSize(); - m_realImageSize = vec2(tmp.x(), tmp.y()); + Vector2i tmp = m_data.getSize(); + m_realImageSize = Vector2f(tmp.x(), tmp.y()); // distance field Generation // TODO : if it is not a .edf ==> generate dynamicly ... /* @@ -42,7 +42,7 @@ void ewol::resource::ImageDF::init(etk::String _genName, const etk::Uri& _uri, c input.resize(tmp); for (size_t yyy = 0; yyy < tmp.y(); ++yyy) { for (size_t xxx = 0; xxx < tmp.x(); ++xxx) { - input.set(ivec2(xxx, yyy), m_data.get(ivec2(xxx, yyy)).a() ); + input.set(Vector2i(xxx, yyy), m_data.get(Vector2i(xxx, yyy)).a() ); } } generateDistanceField(input, m_data); @@ -54,13 +54,13 @@ void ewol::resource::ImageDF::init(etk::String _genName, const etk::Uri& _uri, c void ewol::resource::ImageDF::generateDistanceField(const egami::ImageMono& _input, egami::Image& _output) { ethread::RecursiveLock lock(m_mutex); int32_t size = _input.getSize().x() * _input.getSize().y(); - etk::Vector xdist; - etk::Vector ydist; - etk::Vector gx; - etk::Vector gy; - etk::Vector data; - etk::Vector outside; - etk::Vector inside; + List xdist; + List ydist; + List gx; + List gy; + List data; + List outside; + List inside; xdist.resize(size, 0); ydist.resize(size, 0); gx.resize(size, 0.0); @@ -73,7 +73,7 @@ void ewol::resource::ImageDF::generateDistanceField(const egami::ImageMono& _inp for (int32_t yyy = 0; yyy < _input.getSize().y(); ++yyy) { for (int32_t xxx = 0; xxx < _input.getSize().x(); ++xxx) { int32_t iii = yyy * _input.getSize().x() + xxx; - double v = _input.get(ivec2(xxx, yyy)); + double v = _input.get(Vector2i(xxx, yyy)); data[iii] = v; if (v > img_max) { img_max = v; @@ -87,7 +87,7 @@ void ewol::resource::ImageDF::generateDistanceField(const egami::ImageMono& _inp for (int32_t yyy = 0; yyy < _input.getSize().y(); ++yyy) { for (int32_t xxx = 0; xxx < _input.getSize().x(); ++xxx) { int32_t iii = yyy * _input.getSize().x() + xxx; - data[iii] = (_input.get(ivec2(xxx, yyy))-img_min)/img_max; + data[iii] = (_input.get(Vector2i(xxx, yyy))-img_min)/img_max; } } @@ -133,7 +133,7 @@ void ewol::resource::ImageDF::generateDistanceField(const egami::ImageMono& _inp } uint8_t val = 255 - (unsigned char) outside[iii]; // TODO : Remove multiple size of the map ... - _output.set(ivec2(xxx, yyy), etk::Color<>((int32_t)val,(int32_t)val,(int32_t)val,255)); + _output.set(Vector2i(xxx, yyy), etk::Color<>((int32_t)val,(int32_t)val,(int32_t)val,255)); } } } @@ -153,19 +153,19 @@ static int32_t nextP2(int32_t _value) { } val *=2; } - EWOL_CRITICAL("impossible CASE.... request P2 of " << _value); + Log.critical("impossible CASE.... request P2 of " << _value); return val; } #endif -ememory::SharedPtr ewol::resource::ImageDF::create(const etk::Uri& _uri, ivec2 _size) { - EWOL_VERBOSE("KEEP: TextureFile: '" << _uri << "' size=" << _size); +ememory::SharedPtr ewol::resource::ImageDF::create(const etk::Uri& _uri, Vector2i _size) { + Log.verbose("KEEP: TextureFile: '" << _uri << "' size=" << _size); if (_uri.isEmpty() == true) { ememory::SharedPtr object(ETK_NEW(ewol::resource::ImageDF)); if (object == null) { - EWOL_ERROR("allocation error of a resource : ??TEX??"); + Log.error("allocation error of a resource : ??TEX??"); return null; } object->init(); @@ -174,23 +174,23 @@ ememory::SharedPtr ewol::resource::ImageDF::create(cons } if (_size.x() == 0) { _size.setX(-1); - //EWOL_ERROR("Error Request the image size.x() =0 ???"); + //Log.error("Error Request the image size.x() =0 ???"); } if (_size.y() == 0) { _size.setY(-1); - //EWOL_ERROR("Error Request the image size.y() =0 ???"); + //Log.error("Error Request the image size.y() =0 ???"); } etk::Uri tmpFilename = _uri; if (etk::toLower(_uri.getPath().getExtention()) != "svg") { - _size = ivec2(-1,-1); + _size = Vector2i(-1,-1); } #ifdef __TARGET_OS__MacOs - EWOL_ERROR("TODO : remove this strange hack"); - _size = ivec2(64,64); + Log.error("TODO : remove this strange hack"); + _size = Vector2i(64,64); #endif if ( _size.x() > 0 && _size.y() > 0) { - EWOL_VERBOSE(" == > specific size : " << _size); + Log.verbose(" == > specific size : " << _size); #ifdef __TARGET_OS__Android _size.setValue(nextP2(_size.x()), nextP2(_size.y())); #endif @@ -198,24 +198,24 @@ ememory::SharedPtr ewol::resource::ImageDF::create(cons tmpFilename.getQuery().set("y", etk::toString(_size.y())); } - EWOL_VERBOSE("KEEP: TextureFile: '" << tmpFilename << "' new size=" << _size); + Log.verbose("KEEP: TextureFile: '" << tmpFilename << "' new size=" << _size); ememory::SharedPtr object = null; ememory::SharedPtr object2 = getManager().localKeep("DF__" + tmpFilename.getString()); if (object2 != null) { object = ememory::dynamicPointerCast(object2); if (object == null) { - EWOL_CRITICAL("Request resource file : '" << tmpFilename << "' With the wrong type (dynamic cast error)"); + Log.critical("Request resource file : '" << tmpFilename << "' With the wrong type (dynamic cast error)"); return null; } } if (object != null) { return object; } - EWOL_INFO("CREATE: ImageDF: '" << tmpFilename << "' size=" << _size); + Log.info("CREATE: ImageDF: '" << tmpFilename << "' size=" << _size); // need to crate a new one ... object = ememory::SharedPtr(ETK_NEW(ewol::resource::ImageDF)); if (object == null) { - EWOL_ERROR("allocation error of a resource : " << _uri); + Log.error("allocation error of a resource : " << _uri); return null; } object->init("DF__" + tmpFilename.getString(), _uri, _size); diff --git a/src/org/atriasoft/ewol/resource/ImageDF.java b/src/org/atriasoft/ewol/resource/ImageDF.java index 4c4b9fc..a59ffa1 100644 --- a/src/org/atriasoft/ewol/resource/ImageDF.java +++ b/src/org/atriasoft/ewol/resource/ImageDF.java @@ -14,11 +14,11 @@ namespace ewol { namespace resource { class ImageDF : public ewol::resource::Texture { protected: - vec2 m_realImageSize; + Vector2f m_realImageSize; protected: ImageDF(); void init(); - void init(etk::String _genName, const etk::Uri& _uri, const ivec2& _size); + void init(etk::String _genName, const etk::Uri& _uri, const Vector2i& _size); public: virtual ~ImageDF() { }; protected: @@ -29,7 +29,7 @@ namespace ewol { */ void generateDistanceField(const egami::ImageMono& _input, egami::Image& _output); public: - const vec2& getRealSize() { + const Vector2f& getRealSize() { return m_realImageSize; }; public: @@ -40,7 +40,7 @@ namespace ewol { * @param[in] _requested size of the image (usefull when loading .svg to automatic rescale) * @return pointer on the resource or null if an error occured. */ - static ememory::SharedPtr create(const etk::Uri& _uri, ivec2 _size=ivec2(-1,-1)); + static ememory::SharedPtr create(const etk::Uri& _uri, Vector2i _size=Vector2i(-1,-1)); }; }; }; diff --git a/src/org/atriasoft/ewol/resource/Texture.cpp b/src/org/atriasoft/ewol/resource/Texture.cpp index 0320e19..c73b6c5 100644 --- a/src/org/atriasoft/ewol/resource/Texture.cpp +++ b/src/org/atriasoft/ewol/resource/Texture.cpp @@ -28,7 +28,7 @@ static int32_t nextP2(int32_t _value) { } val *=2; } - EWOL_CRITICAL("impossible CASE...."); + Log.critical("impossible CASE...."); return val; } @@ -44,7 +44,7 @@ ewol::resource::Texture::Texture() : #ifdef EWOL_USE_FBO m_texPboId(0), #endif - m_data(ivec2(32,32),egami::colorType::RGBA8), + m_data(Vector2i(32,32),egami::colorType::RGBA8), m_realImageSize(1,1), m_lastSize(1,1), m_loaded(false), @@ -71,12 +71,12 @@ void ewol::resource::Texture::setFilterMode(enum ewol::resource::TextureFilter _ #include bool ewol::resource::Texture::updateContext() { - EWOL_VERBOSE("updateContext [START]"); + Log.verbose("updateContext [START]"); if (false) { echrono::Steady tic = echrono::Steady::now(); gale::openGL::flush(); echrono::Steady toc = echrono::Steady::now(); - EWOL_VERBOSE(" updateContext [FLUSH] ==> " << (toc - tic)); + Log.verbose(" updateContext [FLUSH] ==> " << (toc - tic)); } ethread::RecursiveLock lock(m_mutex, true); echrono::Steady tic = echrono::Steady::now(); @@ -112,7 +112,7 @@ bool ewol::resource::Texture::updateContext() { case egami::colorType::unsignedInt32: case egami::colorType::float32: case egami::colorType::float64: - EWOL_ERROR("Not manage the type " << m_data.getType() << " for texture"); + Log.error("Not manage the type " << m_data.getType() << " for texture"); break; } if (m_loaded == true) { @@ -129,22 +129,22 @@ bool ewol::resource::Texture::updateContext() { glGenTextures(1, &m_texId); #ifdef EWOL_USE_FBO - EWOL_ERROR("CREATE PBO"); + Log.error("CREATE PBO"); glGenBuffers(1, &m_texPboId); - EWOL_ERROR("CREATE PBO 1"); + Log.error("CREATE PBO 1"); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, m_texPboId); - EWOL_ERROR("CREATE PBO 2"); + Log.error("CREATE PBO 2"); glBufferData(GL_PIXEL_UNPACK_BUFFER, m_data.getGPUSize().x()*m_data.getGPUSize().y()*sizeByte, 0, GL_STREAM_DRAW); - EWOL_ERROR("CREATE PBO 3"); + Log.error("CREATE PBO 3"); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - EWOL_ERROR("CREATE PBO 4 (done)"); + Log.error("CREATE PBO 4 (done)"); #endif m_lastSize = m_data.getSize(); m_lastTypeObject = typeObject; m_lastSizeObject = sizeObject; - EWOL_DEBUG("TEXTURE: add [" << getId() << "]=" << m_data.getSize() << "=>" << m_data.getGPUSize() << " OGl_Id=" << m_texId << " type=" << m_data.getType()); + Log.debug("TEXTURE: add [" << getId() << "]=" << m_data.getSize() << "=>" << m_data.getGPUSize() << " OGl_Id=" << m_texId << " type=" << m_data.getType()); } else { - EWOL_DEBUG("TEXTURE: update [" << getId() << "]=" << m_data.getSize() << "=>" << m_data.getGPUSize() << " OGl_Id=" << m_texId << " type=" << m_data.getType()); + Log.debug("TEXTURE: update [" << getId() << "]=" << m_data.getSize() << "=>" << m_data.getGPUSize() << " OGl_Id=" << m_texId << " type=" << m_data.getType()); } // in all case we set the texture properties : // TODO : check error ??? @@ -167,7 +167,7 @@ bool ewol::resource::Texture::updateContext() { } //glPixelStorei(GL_UNPACK_ALIGNMENT,1); echrono::Steady toc1 = echrono::Steady::now(); - EWOL_VERBOSE(" BIND ==> " << (toc1 - tic)); + Log.verbose(" BIND ==> " << (toc1 - tic)); //egami::store(m_data, etk::String("~/texture_") + etk::toString(getId()) + ".bmp"); #if defined(__TARGET_OS__Android) \ || defined(__TARGET_OS__IOs) @@ -175,11 +175,11 @@ bool ewol::resource::Texture::updateContext() { if (m_loaded == false) { // 1: Create the square 2 texture: int32_t bufferSize = m_data.getGPUSize().x() * m_data.getGPUSize().y() * 8; - static etk::Vector tmpData; + static List tmpData; if (tmpData.size() < bufferSize) { tmpData.resize(bufferSize, 0.0f); } - EWOL_DEBUG(" CREATE texture ==> " << m_data.getGPUSize()); + Log.debug(" CREATE texture ==> " << m_data.getGPUSize()); // 2 create a new empty texture: #ifdef EWOL_USE_FBO glBindBuffer(GL_PIXEL_UNPACK_BUFFER, m_texPboId); @@ -236,7 +236,7 @@ bool ewol::resource::Texture::updateContext() { sizeObject, // type (void*)((char*)m_data.getTextureDataPointer()) ); echrono::Steady toc2 = echrono::Steady::now(); - EWOL_INFO(" updateContext [STOP] ==> " << (toc2 - tic1)); + Log.info(" updateContext [STOP] ==> " << (toc2 - tic1)); #endif #else // This is the normal case ==> set the image and after set just the update of the data @@ -265,7 +265,7 @@ bool ewol::resource::Texture::updateContext() { // now the data is loaded m_loaded = true; echrono::Steady toc = echrono::Steady::now(); - //EWOL_ERROR(" updateContext [STOP] ==> " << (toc - toc1)); + //Log.error(" updateContext [STOP] ==> " << (toc - toc1)); return true; } @@ -273,7 +273,7 @@ void ewol::resource::Texture::removeContext() { ethread::RecursiveLock lock(m_mutex); if (m_loaded == true) { // Request remove texture ... - EWOL_DEBUG("TEXTURE: Rm [" << getId() << "] texId=" << m_texId); + Log.debug("TEXTURE: Rm [" << getId() << "] texId=" << m_texId); // TODO: Check if we are in the correct thread glDeleteTextures(1, &m_texId); m_loaded = false; @@ -289,31 +289,31 @@ void ewol::resource::Texture::removeContextToLate() { void ewol::resource::Texture::flush() { ethread::RecursiveLock lock(m_mutex); // request to the manager to be call at the next update ... - EWOL_VERBOSE("Request UPDATE of Element"); + Log.verbose("Request UPDATE of Element"); getManager().update(ememory::dynamicPointerCast(sharedFromThis())); } -void ewol::resource::Texture::setImageSize(ivec2 _newSize) { +void ewol::resource::Texture::setImageSize(Vector2i _newSize) { ethread::RecursiveLock lock(m_mutex); _newSize.setValue( nextP2(_newSize.x()), nextP2(_newSize.y()) ); m_data.resize(_newSize); } void ewol::resource::Texture::set(egami::Image _image) { - EWOL_DEBUG("Set a new image in a texture:"); + Log.debug("Set a new image in a texture:"); ethread::RecursiveLock lock(m_mutex); if (_image.exist() == false) { - EWOL_ERROR("ERROR when loading the image : [raw data]"); + Log.error("ERROR when loading the image : [raw data]"); return; } - EWOL_DEBUG(" size=" << _image.getSize()); + Log.debug(" size=" << _image.getSize()); etk::swap(m_data, _image); - ivec2 tmp = m_data.getSize(); - m_realImageSize = vec2(tmp.x(), tmp.y()); - vec2 compatibilityHWSize = vec2(nextP2(tmp.x()), nextP2(tmp.y())); + Vector2i tmp = m_data.getSize(); + m_realImageSize = Vector2f(tmp.x(), tmp.y()); + Vector2f compatibilityHWSize = Vector2f(nextP2(tmp.x()), nextP2(tmp.y())); if (m_realImageSize != compatibilityHWSize) { - EWOL_VERBOSE("RESIZE Image for HArwareCompatibility:" << m_realImageSize << " => " << compatibilityHWSize); - m_data.resize(ivec2(compatibilityHWSize.x(),compatibilityHWSize.y())); + Log.verbose("RESIZE Image for HArwareCompatibility:" << m_realImageSize << " => " << compatibilityHWSize); + m_data.resize(Vector2i(compatibilityHWSize.x(),compatibilityHWSize.y())); } flush(); } diff --git a/src/org/atriasoft/ewol/resource/Texture.java b/src/org/atriasoft/ewol/resource/Texture.java index e7ba8ff..237586d 100644 --- a/src/org/atriasoft/ewol/resource/Texture.java +++ b/src/org/atriasoft/ewol/resource/Texture.java @@ -27,9 +27,9 @@ namespace ewol { // openGl Context propoerties : egami::Image m_data; //! Last loaded size in the system openGL - vec2 m_lastSize; + Vector2f m_lastSize; //! 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 - vec2 m_realImageSize; + Vector2f m_realImageSize; // internal state of the openGl system : bool m_loaded; int32_t m_lastTypeObject; @@ -60,7 +60,7 @@ namespace ewol { virtual ~Texture(); public: // You must set the size here, because it will be set in multiple of pow(2) - void setImageSize(ivec2 _newSize); + void setImageSize(Vector2i _newSize); // Get the reference on this image to draw nomething on it ... inline egami::Image& get() { return m_data; @@ -76,10 +76,10 @@ namespace ewol { bool updateContext(); void removeContext(); void removeContextToLate(); - const ivec2& getOpenGlSize() const { + const Vector2i& getOpenGlSize() const { return m_data.getSize(); }; - const vec2& getUsableSize() const { + const Vector2f& getUsableSize() const { return m_realImageSize; }; uint32_t getRendererId() const { diff --git a/src/org/atriasoft/ewol/resource/TextureFile.cpp b/src/org/atriasoft/ewol/resource/TextureFile.cpp index f37acf8..a7c5193 100644 --- a/src/org/atriasoft/ewol/resource/TextureFile.cpp +++ b/src/org/atriasoft/ewol/resource/TextureFile.cpp @@ -14,8 +14,8 @@ #include ETK_DECLARE_TYPE(ewol::resource::TextureFile); -const ivec2 ewol::resource::TextureFile::sizeAuto(-1,-1); -const ivec2 ewol::resource::TextureFile::sizeDefault(0,0); +const Vector2i ewol::resource::TextureFile::sizeAuto(-1,-1); +const Vector2i ewol::resource::TextureFile::sizeDefault(0,0); /** * @brief get the next power 2 if the input @@ -30,7 +30,7 @@ static int32_t nextP2(int32_t _value) { } val *=2; } - EWOL_CRITICAL("impossible CASE.... request P2 of " << _value); + Log.critical("impossible CASE.... request P2 of " << _value); return val; } @@ -45,10 +45,10 @@ void ewol::resource::TextureFile::init() { ewol::resource::Texture::init(); } -void ewol::resource::TextureFile::init(etk::String _genName, const etk::Uri& _uri, const ivec2& _size) { +void ewol::resource::TextureFile::init(etk::String _genName, const etk::Uri& _uri, const Vector2i& _size) { ethread::RecursiveLock lock(m_mutex); ewol::resource::Texture::init(_genName); - EWOL_DEBUG("create a new resource::Image : _genName=" << _genName << " _uri=" << _uri << " size=" << _size); + Log.debug("create a new resource::Image : _genName=" << _genName << " _uri=" << _uri << " size=" << _size); egami::Image tmp = egami::load(_uri, _size); set(etk::move(tmp)); //m_lastSize = m_realImageSize; @@ -58,12 +58,12 @@ void ewol::resource::TextureFile::init(etk::String _genName, const etk::Uri& _ur #endif } -ememory::SharedPtr ewol::resource::TextureFile::create(const etk::Uri& _uri, ivec2 _size, ivec2 _sizeRegister) { - EWOL_VERBOSE("KEEP: TextureFile: '" << _uri << "' size=" << _size << " sizeRegister=" << _sizeRegister); +ememory::SharedPtr ewol::resource::TextureFile::create(const etk::Uri& _uri, Vector2i _size, Vector2i _sizeRegister) { + Log.verbose("KEEP: TextureFile: '" << _uri << "' size=" << _size << " sizeRegister=" << _sizeRegister); if (_uri.isEmpty() == true) { ememory::SharedPtr object(ETK_NEW(ewol::resource::TextureFile)); if (object == null) { - EWOL_ERROR("allocation error of a resource : ??TEX??"); + Log.error("allocation error of a resource : ??TEX??"); return null; } object->init(); @@ -72,18 +72,18 @@ ememory::SharedPtr ewol::resource::TextureFile::cre } if (_size.x() == 0) { _size.setX(-1); - //EWOL_ERROR("Error Request the image size.x() =0 ???"); + //Log.error("Error Request the image size.x() =0 ???"); } if (_size.y() == 0) { _size.setY(-1); - //EWOL_ERROR("Error Request the image size.y() =0 ???"); + //Log.error("Error Request the image size.y() =0 ???"); } etk::Uri tmpFilename = _uri; if (etk::toLower(_uri.getPath().getExtention()) != "svg") { _size = ewol::resource::TextureFile::sizeAuto; } if (_size.x()>0 && _size.y()>0) { - EWOL_VERBOSE(" == > specific size : " << _size); + Log.verbose(" == > specific size : " << _size); _size.setValue(nextP2(_size.x()), nextP2(_size.y())); if (_sizeRegister != ewol::resource::TextureFile::sizeAuto) { if (_sizeRegister != ewol::resource::TextureFile::sizeDefault) { @@ -93,24 +93,24 @@ ememory::SharedPtr ewol::resource::TextureFile::cre } } - EWOL_VERBOSE("KEEP: TextureFile: '" << tmpFilename << "' new size=" << _size); + Log.verbose("KEEP: TextureFile: '" << tmpFilename << "' new size=" << _size); ememory::SharedPtr object = null; ememory::SharedPtr object2 = getManager().localKeep(tmpFilename.getString()); if (object2 != null) { object = ememory::dynamicPointerCast(object2); if (object == null) { - EWOL_CRITICAL("Request resource file : '" << tmpFilename << "' With the wrong type (dynamic cast error)"); + Log.critical("Request resource file : '" << tmpFilename << "' With the wrong type (dynamic cast error)"); return null; } } if (object != null) { return object; } - EWOL_DEBUG("CREATE: TextureFile: '" << tmpFilename << "' size=" << _size); + Log.debug("CREATE: TextureFile: '" << tmpFilename << "' size=" << _size); // need to crate a new one ... object = ememory::SharedPtr(ETK_NEW(ewol::resource::TextureFile)); if (object == null) { - EWOL_ERROR("allocation error of a resource : " << _uri); + Log.error("allocation error of a resource : " << _uri); return null; } object->init(tmpFilename.getString(), _uri, _size); diff --git a/src/org/atriasoft/ewol/resource/TextureFile.java b/src/org/atriasoft/ewol/resource/TextureFile.java index 8dc61a0..28f81c5 100644 --- a/src/org/atriasoft/ewol/resource/TextureFile.java +++ b/src/org/atriasoft/ewol/resource/TextureFile.java @@ -17,16 +17,16 @@ namespace ewol { namespace resource { class TextureFile : public ewol::resource::Texture { public: - static const ivec2 sizeAuto; - static const ivec2 sizeDefault; + static const Vector2i sizeAuto; + static const Vector2i sizeDefault; protected: TextureFile(); void init(); - void init(etk::String _genName, const etk::Uri& _uri, const ivec2& _size); + void init(etk::String _genName, const etk::Uri& _uri, const Vector2i& _size); public: virtual ~TextureFile() { }; public: - const vec2& getRealSize() { + const Vector2f& getRealSize() { return m_realImageSize; }; public: @@ -39,8 +39,8 @@ namespace ewol { * @return pointer on the resource or null if an error occured. */ static ememory::SharedPtr create(const etk::Uri& _filename, - ivec2 _size=ewol::resource::TextureFile::sizeAuto, - ivec2 _sizeRegister=ewol::resource::TextureFile::sizeAuto); + Vector2i _size=ewol::resource::TextureFile::sizeAuto, + Vector2i _sizeRegister=ewol::resource::TextureFile::sizeAuto); }; }; }; diff --git a/src/org/atriasoft/ewol/resource/TexturedFont.cpp b/src/org/atriasoft/ewol/resource/TexturedFont.cpp index 75fae1e..ea79679 100644 --- a/src/org/atriasoft/ewol/resource/TexturedFont.cpp +++ b/src/org/atriasoft/ewol/resource/TexturedFont.cpp @@ -52,8 +52,8 @@ ewol::resource::TexturedFont::TexturedFont(): * // out contain: {"DATA:///font", "DATA:///font?lib=ewol"} * @example[stop] */ -static etk::Vector explodeMultiplePath(const etk::Uri& _uri) { - etk::Vector out; +static List explodeMultiplePath(const etk::Uri& _uri) { + List out; out.pushBack(_uri); if (_uri.getQuery().exist("lib") == true) { etk::Uri tmp = _uri; @@ -66,7 +66,7 @@ static etk::Vector explodeMultiplePath(const etk::Uri& _uri) { void ewol::resource::TexturedFont::init(const etk::String& _fontName) { ethread::RecursiveLock lock(m_mutex); ewol::resource::Texture::init(_fontName); - EWOL_DEBUG("Load font : '" << _fontName << "'" ); + Log.debug("Load font : '" << _fontName << "'" ); m_font[0] = null; m_font[1] = null; @@ -95,23 +95,23 @@ void ewol::resource::TexturedFont::init(const etk::String& _fontName) { if (tmpPos == null) { m_size = 1; - EWOL_CRITICAL("Can not parse the font name: '" << _fontName << "' ??? ':' " ); + Log.critical("Can not parse the font name: '" << _fontName << "' ??? ':' " ); return; } else { if (sscanf(tmpPos+1, "%d", &tmpSize)!=1) { m_size = 1; - EWOL_CRITICAL("Can not parse the font name: '" << _fontName << "' == > size ???"); + Log.critical("Can not parse the font name: '" << _fontName << "' == > size ???"); return; } } etk::String localName(_fontName, 0, (tmpPos - tmpData)); if (tmpSize>400) { - EWOL_ERROR("Font size too big ==> limit at 400 when exxeed ==> error: " << tmpSize << "==>30"); + Log.error("Font size too big ==> limit at 400 when exxeed ==> error: " << tmpSize << "==>30"); tmpSize = 30; } m_size = tmpSize; - etk::Vector folderList; + List folderList; if (ewol::getContext().getFontDefault().getUseExternal() == true) { #if defined(__TARGET_OS__Android) folderList.pushBack(etk::Path("/system/fonts")); @@ -124,24 +124,24 @@ void ewol::resource::TexturedFont::init(const etk::String& _fontName) { folderList.pushBack(it); } for (size_t folderID = 0; folderID < folderList.size() ; folderID++) { - etk::Vector output = etk::uri::listRecursive(folderList[folderID]); + List output = etk::uri::listRecursive(folderList[folderID]); - etk::Vector split = etk::split(localName, ';'); - EWOL_DEBUG("try to find font named : " << split << " in: " << output); - //EWOL_CRITICAL("parse string : " << split); + List split = etk::split(localName, ';'); + Log.debug("try to find font named : " << split << " in: " << output); + //Log.critical("parse string : " << split); bool hasFindAFont = false; for (size_t jjj=0; jjj= 0; iii--) { if (m_fileName[iii].isEmpty() == false) { @@ -209,14 +209,14 @@ void ewol::resource::TexturedFont::init(const etk::String& _fontName) { for (int32_t iiiFontId=0; iiiFontId<4 ; iiiFontId++) { if (m_fileName[iiiFontId].isEmpty() == true) { - EWOL_DEBUG("can not load FONT [" << iiiFontId << "] name : \"" << m_fileName[iiiFontId] << "\" == > size=" << m_size ); + Log.debug("can not load FONT [" << iiiFontId << "] name : \"" << m_fileName[iiiFontId] << "\" == > size=" << m_size ); m_font[iiiFontId] = null; continue; } - EWOL_DEBUG("Load FONT [" << iiiFontId << "] name : \"" << m_fileName[iiiFontId] << "\" == > size=" << m_size); + Log.debug("Load FONT [" << iiiFontId << "] name : \"" << m_fileName[iiiFontId] << "\" == > size=" << m_size); m_font[iiiFontId] = ewol::resource::FontFreeType::create(m_fileName[iiiFontId]); if (m_font[iiiFontId] == null) { - EWOL_DEBUG("error in loading FONT [" << iiiFontId << "] name : \"" << m_fileName[iiiFontId] << "\" == > size=" << m_size ); + Log.debug("error in loading FONT [" << iiiFontId << "] name : \"" << m_fileName[iiiFontId] << "\" == > size=" << m_size ); } } for (int32_t iiiFontId=0; iiiFontId<4 ; iiiFontId++) { @@ -227,7 +227,7 @@ void ewol::resource::TexturedFont::init(const etk::String& _fontName) { } m_height[iiiFontId] = m_font[iiiFontId]->getHeight(m_size); // TODO : basic font use 512 is better ... == > maybe estimate it with the dpi ??? - setImageSize(ivec2(256,32)); + setImageSize(Vector2i(256,32)); // now we can acces directly on the image m_data.clear(etk::Color<>(0x00000000)); } @@ -235,15 +235,15 @@ void ewol::resource::TexturedFont::init(const etk::String& _fontName) { addGlyph(0); // by default we set only the first AINSI char availlable for (int32_t iii=0x20; iii<0x7F; iii++) { - EWOL_VERBOSE("Add clyph :" << iii); + Log.verbose("Add clyph :" << iii); addGlyph(iii); } flush(); - EWOL_DEBUG("Wrapping properties : "); - EWOL_DEBUG(" " << ewol::font::Regular << " == >" << getWrappingMode(ewol::font::Regular)); - EWOL_DEBUG(" " << ewol::font::Italic << " == >" << getWrappingMode(ewol::font::Italic)); - EWOL_DEBUG(" " << ewol::font::Bold << " == >" << getWrappingMode(ewol::font::Bold)); - EWOL_DEBUG(" " << ewol::font::BoldItalic << " == >" << getWrappingMode(ewol::font::BoldItalic)); + Log.debug("Wrapping properties : "); + Log.debug(" " << ewol::font::Regular << " == >" << getWrappingMode(ewol::font::Regular)); + Log.debug(" " << ewol::font::Italic << " == >" << getWrappingMode(ewol::font::Italic)); + Log.debug(" " << ewol::font::Bold << " == >" << getWrappingMode(ewol::font::Bold)); + Log.debug(" " << ewol::font::BoldItalic << " == >" << getWrappingMode(ewol::font::BoldItalic)); } ewol::resource::TexturedFont::~TexturedFont() { @@ -263,24 +263,24 @@ bool ewol::resource::TexturedFont::addGlyph(const char32_t& _val) { tmpchar.m_UVal = _val; if (m_font[iii]->getGlyphProperty(m_size, tmpchar) == true) { - //EWOL_DEBUG("load char : '" << _val << "'=" << _val.get()); + //Log.debug("load char : '" << _val << "'=" << _val.get()); hasChange = true; // change line if needed ... if (m_lastGlyphPos[iii].x()+tmpchar.m_sizeTexture.x()+3 > m_data.getSize().x()) { m_lastGlyphPos[iii].setX(1); - m_lastGlyphPos[iii] += ivec2(0, m_lastRawHeigh[iii]); + m_lastGlyphPos[iii] += Vector2i(0, m_lastRawHeigh[iii]); m_lastRawHeigh[iii] = 0; } while(m_lastGlyphPos[iii].y()+tmpchar.m_sizeTexture.y()+3 > m_data.getSize().y()) { - ivec2 size = m_data.getSize(); + Vector2i size = m_data.getSize(); size.setY(size.y()*2); m_data.resize(size, etk::Color<>(0)); // note : need to rework all the lyer due to the fact that the texture is used by the faur type... for (size_t kkk=0; kkk<4 ; kkk++) { // change the coordonate on the element in the texture for (size_t jjj=0 ; jjj wrapping index : " << m_modeWraping[_displayMode]); + //Log.debug("Get glyph property for mode: " << _displayMode << " == > wrapping index : " << m_modeWraping[_displayMode]); int32_t index = getIndex(_charcode, _displayMode); if( index < 0 || (size_t)index >= m_listElement[_displayMode].size() ) { - EWOL_ERROR(" Try to get glyph index inexistant ... == > return the index 0 ... id=" << index); + Log.error(" Try to get glyph index inexistant ... == > return the index 0 ... id=" << index); if (m_listElement[_displayMode].size() > 0) { return &((m_listElement[_displayMode])[0]); } return &m_emptyGlyph; } - //EWOL_ERROR(" index=" << index); - //EWOL_ERROR(" m_UVal=" << m_listElement[_displayMode][index].m_UVal); - //EWOL_ERROR(" m_glyphIndex=" << m_listElement[_displayMode][index].m_glyphIndex); - //EWOL_ERROR(" m_advance=" << m_listElement[_displayMode][index].m_advance); - //EWOL_ERROR(" m_bearing=" << m_listElement[_displayMode][index].m_bearing); + //Log.error(" index=" << index); + //Log.error(" m_UVal=" << m_listElement[_displayMode][index].m_UVal); + //Log.error(" m_glyphIndex=" << m_listElement[_displayMode][index].m_glyphIndex); + //Log.error(" m_advance=" << m_listElement[_displayMode][index].m_advance); + //Log.error(" m_bearing=" << m_listElement[_displayMode][index].m_bearing); return &((m_listElement[_displayMode])[index]); } diff --git a/src/org/atriasoft/ewol/resource/TexturedFont.java b/src/org/atriasoft/ewol/resource/TexturedFont.java index 0874cb2..3ee914a 100644 --- a/src/org/atriasoft/ewol/resource/TexturedFont.java +++ b/src/org/atriasoft/ewol/resource/TexturedFont.java @@ -35,10 +35,10 @@ namespace ewol { enum ewol::font::mode m_modeWraping[4]; //!< This is a wrapping mode to prevent the fact that no font is define for a specific mode public: GlyphProperty m_emptyGlyph; - etk::Vector m_listElement[4]; + List m_listElement[4]; private: // for the texture generation : - ivec2 m_lastGlyphPos[4]; + Vector2i m_lastGlyphPos[4]; int32_t m_lastRawHeigh[4]; protected: TexturedFont(); diff --git a/src/org/atriasoft/ewol/resource/font/FontBase.java b/src/org/atriasoft/ewol/resource/font/FontBase.java index e4595d5..1aea490 100644 --- a/src/org/atriasoft/ewol/resource/font/FontBase.java +++ b/src/org/atriasoft/ewol/resource/font/FontBase.java @@ -32,7 +32,7 @@ namespace ewol { virtual bool drawGlyph(egami::Image& _imageOut, int32_t _fontSize, - ivec2 _glyphPosition, + Vector2i _glyphPosition, ewol::GlyphProperty& _property, int8_t _posInImage) = 0; @@ -41,12 +41,12 @@ namespace ewol { ewol::GlyphProperty& _property, int32_t _borderSize = 0) = 0; - virtual vec2 getSize(int32_t _fontSize, const etk::String& _unicodeString) = 0; + virtual Vector2f getSize(int32_t _fontSize, const etk::String& _unicodeString) = 0; virtual float getSizeWithHeight(float _fontHeight) = 0; virtual int32_t getHeight(int32_t _fontSize) = 0; - virtual void generateKerning(int32_t _fontSize, etk::Vector& _listGlyph) { }; + virtual void generateKerning(int32_t _fontSize, List& _listGlyph) { }; virtual void display() {}; }; diff --git a/src/org/atriasoft/ewol/resource/font/GlyphProperty.java b/src/org/atriasoft/ewol/resource/font/GlyphProperty.java index 39a7876..1259469 100644 --- a/src/org/atriasoft/ewol/resource/font/GlyphProperty.java +++ b/src/org/atriasoft/ewol/resource/font/GlyphProperty.java @@ -52,13 +52,13 @@ namespace ewol { bool m_exist; public: int32_t m_glyphIndex; //!< Glyph index in the system - 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 normalized position (START) - vec2 m_texturePosSize; //!< Texture normalized position (SIZE) + Vector2i m_sizeTexture; //!< size of the element to display + Vector2i m_bearing; //!< offset to display the data (can be negatif id the texture sise is bigger than the theoric places in the string) + Vector2i m_advance; //!< space use in the display for this specific char + Vector2f m_texturePosStart; //!< Texture normalized position (START) + Vector2f m_texturePosSize; //!< Texture normalized position (SIZE) private: - etk::Vector m_kerning; //!< kerning values of link of all elements + List m_kerning; //!< kerning values of link of all elements public: GlyphProperty() : m_UVal(0), diff --git a/src/org/atriasoft/ewol/resource/font/Kerning.java b/src/org/atriasoft/ewol/resource/font/Kerning.java index 061e683..55f486b 100644 --- a/src/org/atriasoft/ewol/resource/font/Kerning.java +++ b/src/org/atriasoft/ewol/resource/font/Kerning.java @@ -43,7 +43,7 @@ namespace ewol { float m_value; //!< kerning real offset public: /** - * @brief Simple constructor that allow to allocate the etk::Vector element + * @brief Simple constructor that allow to allocate the List element */ Kerning() : m_UVal(0), diff --git a/src/org/atriasoft/ewol/tools/message.cpp b/src/org/atriasoft/ewol/tools/message.cpp index 7ae1703..abf55f2 100644 --- a/src/org/atriasoft/ewol/tools/message.cpp +++ b/src/org/atriasoft/ewol/tools/message.cpp @@ -16,7 +16,7 @@ void ewol::tools::message::create(enum ewol::tools::message::type _type, const etk::String& _message) { ewol::widget::StdPopUpShared tmpPopUp = widget::StdPopUp::create(); if (tmpPopUp == null) { - EWOL_ERROR("Can not create a simple pop-up"); + Log.error("Can not create a simple pop-up"); return; } switch(_type) { @@ -40,7 +40,7 @@ void ewol::tools::message::create(enum ewol::tools::message::type _type, const e ewol::Context& context = ewol::getContext(); ewol::widget::WindowsShared windows = context.getWindows(); if (windows == null) { - EWOL_ERROR("can not get the current windows ... ==> can not display message : " << _message); + Log.error("can not get the current windows ... ==> can not display message : " << _message); return; } windows->popUpWidgetPush(tmpPopUp); diff --git a/src/org/atriasoft/ewol/widget/Button.cpp b/src/org/atriasoft/ewol/widget/Button.cpp index 0a8a51d..79d93e1 100644 --- a/src/org/atriasoft/ewol/widget/Button.cpp +++ b/src/org/atriasoft/ewol/widget/Button.cpp @@ -61,9 +61,9 @@ ewol::widget::Button::~Button() { void ewol::widget::Button::onChangeSize() { ewol::Padding padding = m_shaper.getPadding(); ewol::Padding ret = onChangeSizePadded(padding); - //EWOL_DEBUG(" configuring : origin=" << origin << " size=" << subElementSize << ""); - m_selectableAreaPos = vec2(ret.xLeft(), ret.yButtom()); - m_selectableAreaSize = m_size - (m_selectableAreaPos + vec2(ret.xRight(), ret.yTop())); + //Log.debug(" configuring : origin=" << origin << " size=" << subElementSize << ""); + m_selectableAreaPos = Vector2f(ret.xLeft(), ret.yButtom()); + m_selectableAreaSize = m_size - (m_selectableAreaPos + Vector2f(ret.xRight(), ret.yTop())); } @@ -83,15 +83,15 @@ void ewol::widget::Button::onRegenerateDisplay() { return; } ewol::Padding padding = m_shaper.getPadding(); - m_shaper.setShape(vec2(0,0), + m_shaper.setShape(Vector2f(0,0), m_size, - vec2ClipInt32(m_selectableAreaPos+vec2(padding.xLeft(),padding.yButtom()) ), - vec2ClipInt32(m_selectableAreaSize-vec2(padding.x(),padding.y()) ) ); - //EWOL_ERROR("pos=" << m_origin << " size=" << m_size); + Vector2fClipInt32(m_selectableAreaPos+Vector2f(padding.xLeft(),padding.yButtom()) ), + Vector2fClipInt32(m_selectableAreaSize-Vector2f(padding.x(),padding.y()) ) ); + //Log.error("pos=" << m_origin << " size=" << m_size); } bool ewol::widget::Button::onEventInput(const ewol::event::Input& _event) { - EWOL_VERBOSE("Event on BT : " << _event); + Log.verbose("Event on BT : " << _event); // disable event in the lock access mode : if(ewol::widget::Button::lockAccess == *propertyLock) { return false; @@ -101,7 +101,7 @@ bool ewol::widget::Button::onEventInput(const ewol::event::Input& _event) { m_mouseHover = false; m_buttonPressed = false; } else { - vec2 relativePos = relativePosition(_event.getPos()); + Vector2f relativePos = relativePosition(_event.getPos()); // prevent error from ouside the button if( relativePos.x() < m_selectableAreaPos.x() || relativePos.y() < m_selectableAreaPos.y() @@ -113,17 +113,17 @@ bool ewol::widget::Button::onEventInput(const ewol::event::Input& _event) { m_mouseHover = true; } } - EWOL_VERBOSE("Event on BT ... mouse hover : " << m_mouseHover); + Log.verbose("Event on BT ... mouse hover : " << m_mouseHover); if (m_mouseHover == true) { if (_event.getId() == 1) { if(_event.getStatus() == gale::key::status::down) { - EWOL_VERBOSE(*propertyName << " : Generate event : " << signalDown); + Log.verbose(*propertyName << " : Generate event : " << signalDown); signalDown.emit(); m_buttonPressed = true; markToRedraw(); } if(_event.getStatus() == gale::key::status::up) { - EWOL_VERBOSE(*propertyName << " : Generate event : " << signalUp); + Log.verbose(*propertyName << " : Generate event : " << signalUp); signalUp.emit(); m_buttonPressed = false; markToRedraw(); @@ -138,14 +138,14 @@ bool ewol::widget::Button::onEventInput(const ewol::event::Input& _event) { } else { // inverse value : propertyValue.set((*propertyValue)?false:true); - EWOL_VERBOSE(*propertyName << " : Generate event : " << signalPressed); + Log.verbose(*propertyName << " : Generate event : " << signalPressed); signalPressed.emit(); - EWOL_VERBOSE(*propertyName << " : Generate event : " << signalValue << " val=" << *propertyValue ); + Log.verbose(*propertyName << " : Generate event : " << signalValue << " val=" << *propertyValue ); signalValue.emit(*propertyValue); if( *propertyToggleMode == false && *propertyValue == true) { propertyValue.set(false); - EWOL_VERBOSE(*propertyName << " : Generate event : " << signalValue << " val=" << *propertyValue); + Log.verbose(*propertyName << " : Generate event : " << signalValue << " val=" << *propertyValue); signalValue.emit(*propertyValue); } } @@ -159,7 +159,7 @@ bool ewol::widget::Button::onEventInput(const ewol::event::Input& _event) { bool ewol::widget::Button::onEventEntry(const ewol::event::Entry& _event) { - //EWOL_DEBUG("BT PRESSED : \"" << UTF8_data << "\" size=" << strlen(UTF8_data)); + //Log.debug("BT PRESSED : \"" << UTF8_data << "\" size=" << strlen(UTF8_data)); if( _event.getType() == gale::key::keyboard::character && _event.getStatus() == gale::key::status::down && _event.getChar() == '\r') { @@ -171,7 +171,7 @@ bool ewol::widget::Button::onEventEntry(const ewol::event::Entry& _event) { void ewol::widget::Button::onLostFocus() { m_buttonPressed = false; - EWOL_VERBOSE(propertyName.get() << " : Remove Focus ..."); + Log.verbose(propertyName.get() << " : Remove Focus ..."); CheckStatus(); } diff --git a/src/org/atriasoft/ewol/widget/Button.java b/src/org/atriasoft/ewol/widget/Button.java index 55c168c..78c3775 100644 --- a/src/org/atriasoft/ewol/widget/Button.java +++ b/src/org/atriasoft/ewol/widget/Button.java @@ -65,8 +65,8 @@ namespace ewol { 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 : - vec2 m_selectableAreaPos; //!< Start position of the events - vec2 m_selectableAreaSize; //!< size of the event positions + Vector2f m_selectableAreaPos; //!< Start position of the events + Vector2f m_selectableAreaSize; //!< size of the event positions private: /** * @brief internal system to change the property of the current status diff --git a/src/org/atriasoft/ewol/widget/ButtonColor.cpp b/src/org/atriasoft/ewol/widget/ButtonColor.cpp index e60077d..5369175 100644 --- a/src/org/atriasoft/ewol/widget/ButtonColor.cpp +++ b/src/org/atriasoft/ewol/widget/ButtonColor.cpp @@ -47,7 +47,7 @@ ewol::widget::ButtonColor::~ButtonColor() { void ewol::widget::ButtonColor::calculateMinMaxSize() { ewol::Padding padding = m_shaper.getPadding(); etk::String label = propertyValue.getString(); - vec3 minSize = m_text.calculateSize(label); + Vector3f minSize = m_text.calculateSize(label); m_minSize.setX(padding.x()*2 + minSize.x() + 7); m_minSize.setY(padding.y()*2 + minSize.y() ); markToRedraw(); @@ -65,7 +65,7 @@ void ewol::widget::ButtonColor::onRegenerateDisplay() { if (needRedraw() == false) { return; } - EWOL_DEBUG("redraw"); + Log.debug("redraw"); m_text.clear(); m_shaper.clear(); @@ -73,13 +73,13 @@ void ewol::widget::ButtonColor::onRegenerateDisplay() { etk::String label = propertyValue.getString(); - ivec2 localSize = m_minSize; + Vector2i localSize = m_minSize; - vec3 tmpOrigin((m_size.x() - m_minSize.x()) / 2.0, + Vector3f tmpOrigin((m_size.x() - m_minSize.x()) / 2.0, (m_size.y() - m_minSize.y()) / 2.0, 0); // no change for the text orogin : - vec3 tmpTextOrigin((m_size.x() - m_minSize.x()) / 2.0, + Vector3f tmpTextOrigin((m_size.x() - m_minSize.x()) / 2.0, (m_size.y() - m_minSize.y()) / 2.0, 0); @@ -91,9 +91,9 @@ void ewol::widget::ButtonColor::onRegenerateDisplay() { if (propertyFill->y() == true) { localSize.setY(m_size.y()); } - tmpOrigin += vec3(padding.xLeft(), padding.yButtom(), 0); - tmpTextOrigin += vec3(padding.xLeft(), padding.yButtom(), 0); - localSize -= ivec2(padding.x(), padding.y()); + tmpOrigin += Vector3f(padding.xLeft(), padding.yButtom(), 0); + tmpTextOrigin += Vector3f(padding.xLeft(), padding.yButtom(), 0); + localSize -= Vector2i(padding.x(), padding.y()); // clean the element m_text.reset(); @@ -115,13 +115,13 @@ void ewol::widget::ButtonColor::onRegenerateDisplay() { } // selection area : - m_selectableAreaPos = vec2(tmpOrigin.x()-padding.xLeft(), tmpOrigin.y()-padding.yButtom()); - m_selectableAreaSize = localSize + vec2(padding.x(),padding.y()); - vec3 tmpp = m_text.calculateSize(label); + m_selectableAreaPos = Vector2f(tmpOrigin.x()-padding.xLeft(), tmpOrigin.y()-padding.yButtom()); + m_selectableAreaSize = localSize + Vector2f(padding.x(),padding.y()); + Vector3f tmpp = m_text.calculateSize(label); m_shaper.setShape(m_selectableAreaPos, m_selectableAreaSize, - vec2(tmpTextOrigin.x(), tmpTextOrigin.y()), - vec2(tmpp.x(), tmpp.y())); + Vector2f(tmpTextOrigin.x(), tmpTextOrigin.y()), + Vector2f(tmpp.x(), tmpp.y())); } @@ -131,7 +131,7 @@ bool ewol::widget::ButtonColor::onEventInput(const ewol::event::Input& _event) { m_mouseHover = false; m_buttonPressed = false; } else { - vec2 relativePos = relativePosition(_event.getPos()); + Vector2f relativePos = relativePosition(_event.getPos()); // prevent error from ouside the button if( relativePos.x() < m_selectableAreaPos.x() || relativePos.y() < m_selectableAreaPos.y() @@ -144,7 +144,7 @@ bool ewol::widget::ButtonColor::onEventInput(const ewol::event::Input& _event) { } } bool previousPressed = m_buttonPressed; - //EWOL_DEBUG("Event on BT ... mouse position : " << m_mouseHover); + //Log.debug("Event on BT ... mouse position : " << m_mouseHover); if (true == m_mouseHover) { if (1 == _event.getId()) { if(gale::key::status::down == _event.getStatus()) { @@ -161,10 +161,10 @@ bool ewol::widget::ButtonColor::onEventInput(const ewol::event::Input& _event) { // create a context menu : m_widgetContextMenu = ewol::widget::ContextMenu::create(); if (m_widgetContextMenu == null) { - EWOL_ERROR("Allocation Error"); + Log.error("Allocation Error"); return true; } - vec2 tmpPos = m_origin + m_selectableAreaPos + m_selectableAreaSize; + Vector2f tmpPos = m_origin + m_selectableAreaPos + m_selectableAreaSize; tmpPos.setX( tmpPos.x() - m_minSize.x()/2.0); m_widgetContextMenu->setPositionMark(ewol::widget::ContextMenu::markButtom, tmpPos ); @@ -175,7 +175,7 @@ bool ewol::widget::ButtonColor::onEventInput(const ewol::event::Input& _event) { myColorChooser->signalChange.connect(sharedFromThis(), &ewol::widget::ButtonColor::onCallbackColorChange); ewol::widget::WindowsShared currentWindows = getWindows(); if (currentWindows == null) { - EWOL_ERROR("Can not get the curent Windows..."); + Log.error("Can not get the curent Windows..."); m_widgetContextMenu.reset(); } else { currentWindows->popUpWidgetPush(m_widgetContextMenu); diff --git a/src/org/atriasoft/ewol/widget/ButtonColor.java b/src/org/atriasoft/ewol/widget/ButtonColor.java index 0719794..d139f3a 100644 --- a/src/org/atriasoft/ewol/widget/ButtonColor.java +++ b/src/org/atriasoft/ewol/widget/ButtonColor.java @@ -33,8 +33,8 @@ namespace ewol { 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 : - vec2 m_selectableAreaPos; //!< Start position of the events - vec2 m_selectableAreaSize; //!< size of the event positions + Vector2f m_selectableAreaPos; //!< Start position of the events + Vector2f m_selectableAreaSize; //!< size of the event positions protected: /** * @brief Main constructor. diff --git a/src/org/atriasoft/ewol/widget/CheckBox.cpp b/src/org/atriasoft/ewol/widget/CheckBox.cpp index 6596481..5ccce7d 100644 --- a/src/org/atriasoft/ewol/widget/CheckBox.cpp +++ b/src/org/atriasoft/ewol/widget/CheckBox.cpp @@ -59,9 +59,9 @@ void ewol::widget::CheckBox::onChangeSize() { float boxSize = m_shaper.getConfigNumber(m_shaperIdSize); padding.setXLeft(padding.xLeft()*2.0f + boxSize); ewol::Padding ret = onChangeSizePadded(padding); - EWOL_DEBUG(" configuring : padding=" << padding << " boxSize=" << boxSize << ""); - m_selectableAreaPos = vec2(ret.xLeft()/*-boxSize*/, ret.yButtom()); - m_selectableAreaSize = m_size - (m_selectableAreaPos + vec2(ret.xRight(), ret.yTop())); + Log.debug(" configuring : padding=" << padding << " boxSize=" << boxSize << ""); + m_selectableAreaPos = Vector2f(ret.xLeft()/*-boxSize*/, ret.yButtom()); + m_selectableAreaSize = m_size - (m_selectableAreaPos + Vector2f(ret.xRight(), ret.yTop())); } void ewol::widget::CheckBox::calculateMinMaxSize() { @@ -88,20 +88,20 @@ void ewol::widget::CheckBox::onRegenerateDisplay() { float boxSize = m_shaper.getConfigNumber(m_shaperIdSize); float boxInside = m_shaper.getConfigNumber(m_shaperIdSizeInsize); m_shaper.clear(); - EWOL_DEBUG(" configuring : boxSize=" << boxSize << " boxInside=" << boxInside << ""); - vec2 origin(m_selectableAreaPos + vec2(0, (m_selectableAreaSize.y() - (boxSize+padding.y()))*0.5f)); - vec2 size = vec2(boxSize+padding.x(), boxSize+padding.y()); + Log.debug(" configuring : boxSize=" << boxSize << " boxInside=" << boxInside << ""); + Vector2f origin(m_selectableAreaPos + Vector2f(0, (m_selectableAreaSize.y() - (boxSize+padding.y()))*0.5f)); + Vector2f size = Vector2f(boxSize+padding.x(), boxSize+padding.y()); - vec2 origin2 = m_selectableAreaPos + vec2((boxSize-boxInside)*0.5f, (m_selectableAreaSize.y() - (boxInside+padding.y()))*0.5f); - vec2 size2 = vec2(boxInside+padding.x(), boxInside+padding.y()); - m_shaper.setShape(vec2ClipInt32(origin), - vec2ClipInt32(size), - vec2ClipInt32(origin2+vec2(padding.xLeft(),padding.yButtom()) ), - vec2ClipInt32(size2-vec2(padding.x(),padding.y()) )); + Vector2f origin2 = m_selectableAreaPos + Vector2f((boxSize-boxInside)*0.5f, (m_selectableAreaSize.y() - (boxInside+padding.y()))*0.5f); + Vector2f size2 = Vector2f(boxInside+padding.x(), boxInside+padding.y()); + m_shaper.setShape(Vector2fClipInt32(origin), + Vector2fClipInt32(size), + Vector2fClipInt32(origin2+Vector2f(padding.xLeft(),padding.yButtom()) ), + Vector2fClipInt32(size2-Vector2f(padding.x(),padding.y()) )); } bool ewol::widget::CheckBox::onEventInput(const ewol::event::Input& _event) { - EWOL_VERBOSE("Event on BT : " << _event); + Log.verbose("Event on BT : " << _event); bool previousHoverState = m_mouseHover; if( gale::key::status::leave == _event.getStatus() @@ -109,7 +109,7 @@ bool ewol::widget::CheckBox::onEventInput(const ewol::event::Input& _event) { m_mouseHover = false; m_buttonPressed = false; } else { - vec2 relativePos = relativePosition(_event.getPos()); + Vector2f relativePos = relativePosition(_event.getPos()); // prevent error from ouside the button if( relativePos.x() < m_selectableAreaPos.x() || relativePos.y() < m_selectableAreaPos.y() @@ -122,17 +122,17 @@ bool ewol::widget::CheckBox::onEventInput(const ewol::event::Input& _event) { } } bool previousPressed = m_buttonPressed; - EWOL_VERBOSE("Event on BT ... mouse hover : " << m_mouseHover); + Log.verbose("Event on BT ... mouse hover : " << m_mouseHover); if (m_mouseHover == true) { if (_event.getId() == 1) { if(gale::key::status::down == _event.getStatus()) { - EWOL_VERBOSE(*propertyName << " : Generate event : " << signalDown); + Log.verbose(*propertyName << " : Generate event : " << signalDown); signalDown.emit(); m_buttonPressed = true; markToRedraw(); } if(gale::key::status::up == _event.getStatus()) { - EWOL_VERBOSE(*propertyName << " : Generate event : " << signalUp); + Log.verbose(*propertyName << " : Generate event : " << signalUp); signalUp.emit(); m_buttonPressed = false; markToRedraw(); @@ -140,9 +140,9 @@ bool ewol::widget::CheckBox::onEventInput(const ewol::event::Input& _event) { if(gale::key::status::pressSingle == _event.getStatus()) { // inverse value : propertyValue.set((*propertyValue)?false:true); - EWOL_VERBOSE(*propertyName << " : Generate event : " << signalPressed); + Log.verbose(*propertyName << " : Generate event : " << signalPressed); signalPressed.emit(); - EWOL_VERBOSE(*propertyName << " : Generate event : " << signalValue << " val=" << propertyValue ); + Log.verbose(*propertyName << " : Generate event : " << signalValue << " val=" << propertyValue ); signalValue.emit(*propertyValue); markToRedraw(); } @@ -157,7 +157,7 @@ bool ewol::widget::CheckBox::onEventInput(const ewol::event::Input& _event) { bool ewol::widget::CheckBox::onEventEntry(const ewol::event::Entry& _event) { - //EWOL_DEBUG("BT PRESSED : \"" << UTF8_data << "\" size=" << strlen(UTF8_data)); + //Log.debug("BT PRESSED : \"" << UTF8_data << "\" size=" << strlen(UTF8_data)); if( _event.getType() == gale::key::keyboard::character && _event.getStatus() == gale::key::status::down && _event.getChar() == '\r') { diff --git a/src/org/atriasoft/ewol/widget/CheckBox.java b/src/org/atriasoft/ewol/widget/CheckBox.java index b5059b3..49a2987 100644 --- a/src/org/atriasoft/ewol/widget/CheckBox.java +++ b/src/org/atriasoft/ewol/widget/CheckBox.java @@ -33,8 +33,8 @@ namespace ewol { 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 : - vec2 m_selectableAreaPos; //!< Start position of the events - vec2 m_selectableAreaSize; //!< size of the event positions + Vector2f m_selectableAreaPos; //!< Start position of the events + Vector2f m_selectableAreaSize; //!< size of the event positions // shaper ids: int32_t m_shaperIdSize; int32_t m_shaperIdSizeInsize; diff --git a/src/org/atriasoft/ewol/widget/ColorBar.cpp b/src/org/atriasoft/ewol/widget/ColorBar.cpp index f66dc33..b2d1973 100644 --- a/src/org/atriasoft/ewol/widget/ColorBar.cpp +++ b/src/org/atriasoft/ewol/widget/ColorBar.cpp @@ -51,7 +51,7 @@ static etk::Color<> s_listColor[NB_BAND_COLOR+1] = { void ewol::widget::ColorBar::onChangePropertyValue() { propertyValue.getDirect().setA(0xFF); // estimate the cursor position: - EWOL_TODO("Later when really needed ..."); + Log.todo("Later when really needed ..."); } void ewol::widget::ColorBar::onDraw() { @@ -89,13 +89,13 @@ void ewol::widget::ColorBar::onRegenerateDisplay() { * ******** */ m_draw.setColor(s_listColorWhite); - m_draw.setPos(vec3(tmpOriginX + (iii)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY, 0) ); + m_draw.setPos(Vector3f(tmpOriginX + (iii)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY, 0) ); m_draw.addVertex(); m_draw.setColor(s_listColor[iii+1]); - m_draw.setPos(vec3(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2, 0) ); + m_draw.setPos(Vector3f(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2, 0) ); m_draw.addVertex(); m_draw.setColor(s_listColor[iii]); - m_draw.setPos(vec3(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2, 0) ); + m_draw.setPos(Vector3f(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2, 0) ); m_draw.addVertex(); /* Step 2 : * ******** @@ -105,13 +105,13 @@ void ewol::widget::ColorBar::onRegenerateDisplay() { * */ m_draw.setColor(s_listColorWhite); - m_draw.setPos(vec3(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY, 0) ); + m_draw.setPos(Vector3f(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY, 0) ); m_draw.addVertex(); m_draw.setColor(s_listColorWhite); - m_draw.setPos(vec3(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY, 0) ); + m_draw.setPos(Vector3f(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY, 0) ); m_draw.addVertex(); m_draw.setColor(s_listColor[iii+1]); - m_draw.setPos(vec3(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2, 0) ); + m_draw.setPos(Vector3f(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2, 0) ); m_draw.addVertex(); /* Step 3 : * @@ -121,13 +121,13 @@ void ewol::widget::ColorBar::onRegenerateDisplay() { * ******** */ m_draw.setColor(s_listColor[iii]); - m_draw.setPos(vec3(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2, 0)); + m_draw.setPos(Vector3f(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2, 0)); m_draw.addVertex(); m_draw.setColor(s_listColorBlack); - m_draw.setPos(vec3(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY, 0)); + m_draw.setPos(Vector3f(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY, 0)); m_draw.addVertex(); m_draw.setColor(s_listColorBlack); - m_draw.setPos(vec3(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY, 0)); + m_draw.setPos(Vector3f(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY, 0)); m_draw.addVertex(); /* Step 4 : * ******** @@ -137,13 +137,13 @@ void ewol::widget::ColorBar::onRegenerateDisplay() { * */ m_draw.setColor(s_listColor[iii]); - m_draw.setPos(vec3(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2, 0)); + m_draw.setPos(Vector3f(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2, 0)); m_draw.addVertex(); m_draw.setColor(s_listColor[iii+1]); - m_draw.setPos(vec3(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2, 0)); + m_draw.setPos(Vector3f(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2, 0)); m_draw.addVertex(); m_draw.setColor(s_listColorBlack); - m_draw.setPos(vec3(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY, 0)); + m_draw.setPos(Vector3f(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY, 0)); m_draw.addVertex(); } if (m_currentUserPos.y() > 0.5) { @@ -151,15 +151,15 @@ void ewol::widget::ColorBar::onRegenerateDisplay() { } else { m_draw.setColor(etk::color::black); } - m_draw.setPos(vec3(m_currentUserPos.x()*m_size.x(), m_currentUserPos.y()*m_size.y(), 0) ); + m_draw.setPos(Vector3f(m_currentUserPos.x()*m_size.x(), m_currentUserPos.y()*m_size.y(), 0) ); m_draw.setThickness(1); m_draw.circle(3.0); } bool ewol::widget::ColorBar::onEventInput(const ewol::event::Input& _event) { - vec2 relativePos = relativePosition(_event.getPos()); - //EWOL_DEBUG("Event on BT ..."); + Vector2f relativePos = relativePosition(_event.getPos()); + //Log.debug("Event on BT ..."); if (1 == _event.getId()) { relativePos.setValue( etk::avg(0.0f, m_size.x(),relativePos.x()), etk::avg(0.0f, m_size.y(),relativePos.y()) ); @@ -170,11 +170,11 @@ bool ewol::widget::ColorBar::onEventInput(const ewol::event::Input& _event) { relativePos.y()/m_size.y() ); markToRedraw(); // == > try to estimate color - EWOL_VERBOSE("event on (" << relativePos.x() << "," << relativePos.y() << ")"); + Log.verbose("event on (" << relativePos.x() << "," << relativePos.y() << ")"); int32_t bandID = (int32_t)(relativePos.x()/(m_size.x()/6)); float localPos = relativePos.x() - (m_size.x()/6) * bandID; float poroportionnalPos = localPos/(m_size.x()/6); - EWOL_VERBOSE("bandId=" << bandID << " relative pos=" << localPos); + Log.verbose("bandId=" << bandID << " relative pos=" << localPos); etk::Color<> estimateColor = etk::color::white; if (s_listColor[bandID].r() == s_listColor[bandID+1].r()) { estimateColor.setR(s_listColor[bandID].r()); diff --git a/src/org/atriasoft/ewol/widget/ColorBar.java b/src/org/atriasoft/ewol/widget/ColorBar.java index b086e6c..cf6d164 100644 --- a/src/org/atriasoft/ewol/widget/ColorBar.java +++ b/src/org/atriasoft/ewol/widget/ColorBar.java @@ -30,7 +30,7 @@ namespace ewol { virtual ~ColorBar(); private: ewol::compositing::Drawing m_draw; //!< Compositing drawing element - vec2 m_currentUserPos; + Vector2f m_currentUserPos; protected: void onDraw() override; public: diff --git a/src/org/atriasoft/ewol/widget/Composer.cpp b/src/org/atriasoft/ewol/widget/Composer.cpp index c76ed0b..91063ab 100644 --- a/src/org/atriasoft/ewol/widget/Composer.cpp +++ b/src/org/atriasoft/ewol/widget/Composer.cpp @@ -23,7 +23,7 @@ ewol::widget::Composer::Composer() : ewol::WidgetShared ewol::widget::composerGenerateFile(const etk::Uri& _uri, uint64_t _id) { etk::String tmpData; if (etk::uri::readAll(_uri, tmpData) == false) { - EWOL_ERROR("Can not read the file: " << _uri); + Log.error("Can not read the file: " << _uri); return null; } return ewol::widget::composerGenerateString(tmpData, _id); @@ -41,12 +41,12 @@ ewol::WidgetShared ewol::widget::composerGenerateString(const etk::String& _data tmpData.replace("{ID}", etk::toString(_id)); } if (doc.parse(tmpData) == false) { - EWOL_ERROR(" can not load file XML string..."); + Log.error(" can not load file XML string..."); return null; } exml::Element root = doc.toElement(); if (root.nodes.size() == 0) { - EWOL_ERROR(" (l ?) No node in the XML file/string."); + Log.error(" (l ?) No node in the XML file/string."); return null; } if (root.nodes.size() > 1) { @@ -54,15 +54,15 @@ ewol::WidgetShared ewol::widget::composerGenerateString(const etk::String& _data } exml::Element pNode = root.nodes[0].toElement(); if (pNode.exist() == false) { - EWOL_ERROR(" (l ?) No node in the XML file/string. {2}"); + Log.error(" (l ?) No node in the XML file/string. {2}"); return null; } etk::String widgetName = pNode.getValue(); if (widgetManager.exist(widgetName) == false) { - EWOL_ERROR("(l " << pNode.getPos() << ") Unknown basic node='" << widgetName << "' not in : [" << widgetManager.list() << "]" ); + Log.error("(l " << pNode.getPos() << ") Unknown basic node='" << widgetName << "' not in : [" << widgetManager.list() << "]" ); return null; } - EWOL_DEBUG("try to create subwidget : '" << widgetName << "'"); + Log.debug("try to create subwidget : '" << widgetName << "'"); ewol::WidgetShared tmpWidget = widgetManager.create(widgetName); if (tmpWidget == null) { EWOL_ERROR ("(l " << pNode.getPos() << ") Can not create the widget : '" << widgetName << "'"); @@ -81,7 +81,7 @@ ewol::widget::Composer::~Composer() { bool ewol::widget::Composer::loadFromFile(const etk::Uri& _uri, uint64_t _id) { etk::String tmpData; if (etk::uri::readAll(_uri, tmpData) == false) { - EWOL_ERROR("Can not read the file: " << _uri); + Log.error("Can not read the file: " << _uri); return false; } return loadFromString(tmpData, _id); @@ -95,7 +95,7 @@ bool ewol::widget::Composer::loadFromString(const etk::String& _composerXmlStrin tmpData.replace("{ID}", etk::toString(_id)); } if (doc.parse(tmpData) == false) { - EWOL_ERROR(" can not load file XML string..."); + Log.error(" can not load file XML string..."); return false; } exml::Element root = doc.nodes["composer"]; @@ -103,11 +103,11 @@ bool ewol::widget::Composer::loadFromString(const etk::String& _composerXmlStrin // Maybe a multiple node XML for internal config: root = doc.toElement(); if (root.exist() == false) { - EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} (l ?) main node not find: 'composer' ..."); + Log.error("[" << getId() << "] {" << getObjectType() << "} (l ?) main node not find: 'composer' ..."); return false; } if (root.nodes.size() == 0) { - EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} (l ?) no node in the Container XML element."); + Log.error("[" << getId() << "] {" << getObjectType() << "} (l ?) no node in the Container XML element."); return false; } } @@ -116,7 +116,7 @@ bool ewol::widget::Composer::loadFromString(const etk::String& _composerXmlStrin if (m_subWidget == null) { EWOL_WARNING("Load data from composer and have no under Widget after loading"); if (_composerXmlString.size() != 0) { - EWOL_ERROR("Error Loading XML data : " << _composerXmlString); + Log.error("Error Loading XML data : " << _composerXmlString); return false; } } @@ -127,26 +127,26 @@ bool ewol::widget::Composer::loadFromString(const etk::String& _composerXmlStrin void ewol::widget::Composer::requestDestroyFromChild(const ewol::ObjectShared& _child) { ewol::widget::Container::requestDestroyFromChild(_child); if (*propertyRemoveIfUnderRemove == true) { - EWOL_DEBUG("Child widget remove ==> auto-remove"); + Log.debug("Child widget remove ==> auto-remove"); autoDestroy(); } } void ewol::widget::Composer::onChangePropertySubFile() { - EWOL_INFO("Load compositing form external file : " << propertySubFile); + Log.info("Load compositing form external file : " << propertySubFile); if (*propertySubFile == "") { // remove all elements: subWidgetRemove(); return; } if (loadFromFile(*propertySubFile, getId()) == false) { - EWOL_ERROR("Can not load Player GUI from file ... " << propertySubFile); + Log.error("Can not load Player GUI from file ... " << propertySubFile); return; } } bool ewol::widget::Composer::loadXML(const exml::Element& _node) { - //EWOL_VERBOSE("[" << getId() << "] t=" << getObjectType() << " Load XML (start)"); + //Log.verbose("[" << getId() << "] t=" << getObjectType() << " Load XML (start)"); if (_node.exist() == false) { return false; } @@ -154,9 +154,9 @@ bool ewol::widget::Composer::loadXML(const exml::Element& _node) { ewol::Widget::loadXML(_node); // parse all the elements: if (_node.nodes.size() != 0) { - EWOL_ERROR("a composer Node Can not have Sub-element in XML ==> must be done in an external file and load it with attribute: 'sub-file'"); + Log.error("a composer Node Can not have Sub-element in XML ==> must be done in an external file and load it with attribute: 'sub-file'"); } //drawWidgetTree(); - //EWOL_VERBOSE("[" << getId() << "] t=" << getObjectType() << " Load XML (stop)"); + //Log.verbose("[" << getId() << "] t=" << getObjectType() << " Load XML (stop)"); return true; } \ No newline at end of file diff --git a/src/org/atriasoft/ewol/widget/Container.cpp b/src/org/atriasoft/ewol/widget/Container.cpp index 35c2705..032b06c 100644 --- a/src/org/atriasoft/ewol/widget/Container.cpp +++ b/src/org/atriasoft/ewol/widget/Container.cpp @@ -90,10 +90,10 @@ void ewol::widget::Container::systemDraw(const ewol::DrawProperty& _displayProp) if (m_subWidget != null) { ewol::DrawProperty prop = _displayProp; prop.limit(m_origin, m_size); - //EWOL_INFO("Draw : [" << propertyName << "] t=" << getObjectType() << " o=" << m_origin << " s=" << m_size); + //Log.info("Draw : [" << propertyName << "] t=" << getObjectType() << " o=" << m_origin << " s=" << m_size); m_subWidget->systemDraw(prop); } else { - EWOL_INFO("[" << getId() << "] ++++++ : [null]"); + Log.info("[" << getId() << "] ++++++ : [null]"); } } @@ -105,9 +105,9 @@ void ewol::widget::Container::onChangeSize() { if (m_subWidget == null) { return; } - vec2 origin = m_origin+m_offset; - vec2 minSize = m_subWidget->getCalculateMinSize(); - bvec2 expand = m_subWidget->propertyExpand.get(); + Vector2f origin = m_origin+m_offset; + Vector2f minSize = m_subWidget->getCalculateMinSize(); + Vector2b expand = m_subWidget->propertyExpand.get(); origin += ewol::gravityGenerateDelta(propertyGravity.get(), minSize - m_size); m_subWidget->setOrigin(origin); m_subWidget->setSize(m_size); @@ -120,10 +120,10 @@ void ewol::widget::Container::calculateMinMaxSize() { // call sub classes if (m_subWidget != null) { m_subWidget->calculateMinMaxSize(); - vec2 min = m_subWidget->getCalculateMinSize(); + Vector2f min = m_subWidget->getCalculateMinSize(); m_minSize.setMax(min); } - //EWOL_ERROR("[" << getId() << "] Result min size : " << m_minSize); + //Log.error("[" << getId() << "] Result min size : " << m_minSize); } void ewol::widget::Container::onRegenerateDisplay() { @@ -132,7 +132,7 @@ void ewol::widget::Container::onRegenerateDisplay() { } } -ewol::WidgetShared ewol::widget::Container::getWidgetAtPos(const vec2& _pos) { +ewol::WidgetShared ewol::widget::Container::getWidgetAtPos(const Vector2f& _pos) { if (propertyHide.get() == false) { if (m_subWidget != null) { return m_subWidget->getWidgetAtPos(_pos); @@ -157,16 +157,16 @@ bool ewol::widget::Container::loadXML(const exml::Element& _node) { continue; } etk::String widgetName = pNode.getValue(); - EWOL_VERBOSE("[" << getId() << "] t=" << getObjectType() << " Load node name : '" << widgetName << "'"); + Log.verbose("[" << getId() << "] t=" << getObjectType() << " Load node name : '" << widgetName << "'"); if (getWidgetManager().exist(widgetName) == false) { - EWOL_ERROR("(l " << pNode.getPos() << ") Unknown basic node='" << widgetName << "' not in : [" << getWidgetManager().list() << "]" ); + Log.error("(l " << pNode.getPos() << ") Unknown basic node='" << widgetName << "' not in : [" << getWidgetManager().list() << "]" ); continue; } if (getSubWidget() != null) { - EWOL_ERROR("(l " << pNode.getPos() << ") Can only have one subWidget ??? node='" << widgetName << "'" ); + Log.error("(l " << pNode.getPos() << ") Can only have one subWidget ??? node='" << widgetName << "'" ); continue; } - EWOL_DEBUG("try to create subwidget : '" << widgetName << "'"); + Log.debug("try to create subwidget : '" << widgetName << "'"); ewol::WidgetShared tmpWidget = getWidgetManager().create(widgetName, pNode); if (tmpWidget == null) { EWOL_ERROR ("(l " << pNode.getPos() << ") Can not create the widget : '" << widgetName << "'"); @@ -186,7 +186,7 @@ bool ewol::widget::Container::loadXML(const exml::Element& _node) { return true; } -void ewol::widget::Container::setOffset(const vec2& _newVal) { +void ewol::widget::Container::setOffset(const Vector2f& _newVal) { if (m_offset != _newVal) { ewol::Widget::setOffset(_newVal); // recalculate the new sise and position of sub widget ... diff --git a/src/org/atriasoft/ewol/widget/Container.java b/src/org/atriasoft/ewol/widget/Container.java index 12aae48..4dc6cc0 100644 --- a/src/org/atriasoft/ewol/widget/Container.java +++ b/src/org/atriasoft/ewol/widget/Container.java @@ -62,10 +62,10 @@ namespace ewol { void onRegenerateDisplay() override; void onChangeSize() override; void calculateMinMaxSize() override; - ewol::WidgetShared getWidgetAtPos(const vec2& _pos) override; + ewol::WidgetShared getWidgetAtPos(const Vector2f& _pos) override; ewol::ObjectShared getSubObjectNamed(const etk::String& _objectName) override; bool loadXML(const exml::Element& _node) override; - void setOffset(const vec2& _newVal) override; + void setOffset(const Vector2f& _newVal) override; void requestDestroyFromChild(const ewol::ObjectShared& _child) override; void drawWidgetTree(int32_t _level=0) override; }; diff --git a/src/org/atriasoft/ewol/widget/Container2.cpp b/src/org/atriasoft/ewol/widget/Container2.cpp index 1c7e629..75488dc 100644 --- a/src/org/atriasoft/ewol/widget/Container2.cpp +++ b/src/org/atriasoft/ewol/widget/Container2.cpp @@ -26,7 +26,7 @@ void ewol::widget::Container2::setSubWidget(ewol::WidgetShared _newWidget, int32 subWidgetRemove(_idWidget); m_subWidget[_idWidget] = _newWidget; if (m_subWidget[_idWidget] != null) { - EWOL_VERBOSE("Add widget : " << _idWidget); + Log.verbose("Add widget : " << _idWidget); m_subWidget[_idWidget]->setParent(sharedFromThis()); } markToRedraw(); @@ -59,7 +59,7 @@ void ewol::widget::Container2::subWidgetReplace(const ewol::WidgetShared& _oldWi void ewol::widget::Container2::subWidgetRemove(int32_t _idWidget) { if (m_subWidget[_idWidget] != null) { - EWOL_VERBOSE("Remove widget : " << _idWidget); + Log.verbose("Remove widget : " << _idWidget); m_subWidget[_idWidget]->removeParent(); m_subWidget[_idWidget].reset(); markToRedraw(); @@ -70,7 +70,7 @@ void ewol::widget::Container2::subWidgetRemove(int32_t _idWidget) { void ewol::widget::Container2::subWidgetUnLink(int32_t _idWidget) { if (m_subWidget[_idWidget] != null) { m_subWidget[_idWidget]->removeParent(); - EWOL_VERBOSE("Unlink widget : " << _idWidget); + Log.verbose("Unlink widget : " << _idWidget); } m_subWidget[_idWidget].reset(); } @@ -99,38 +99,38 @@ void ewol::widget::Container2::systemDraw(const ewol::DrawProperty& _displayProp } ewol::Widget::systemDraw(_displayProp); if (m_subWidget[m_idWidgetDisplayed] != null) { - //EWOL_INFO("Draw : [" << propertyName << "] t=" << getObjectType() << " o=" << m_origin << " s=" << m_size); + //Log.info("Draw : [" << propertyName << "] t=" << getObjectType() << " o=" << m_origin << " s=" << m_size); m_subWidget[m_idWidgetDisplayed]->systemDraw(_displayProp); } } ewol::Padding ewol::widget::Container2::onChangeSizePadded(const ewol::Padding& _padding) { ewol::Widget::onChangeSize(); - vec2 localAvaillable = m_size - vec2(_padding.x(), _padding.y()); + Vector2f localAvaillable = m_size - Vector2f(_padding.x(), _padding.y()); // Checkin the filling properties == > for the subElements: - vec2 subElementSize = m_minSize; + Vector2f subElementSize = m_minSize; if (propertyFill->x() == true) { subElementSize.setX(m_size.x()); } if (propertyFill->y() == true) { subElementSize.setY(m_size.y()); } - vec2 delta = ewol::gravityGenerateDelta(propertyGravity, m_size - subElementSize); - vec2 origin = delta + vec2(_padding.xLeft(), _padding.yButtom()); - subElementSize -= vec2(_padding.x(), _padding.y()); + Vector2f delta = ewol::gravityGenerateDelta(propertyGravity, m_size - subElementSize); + Vector2f origin = delta + Vector2f(_padding.xLeft(), _padding.yButtom()); + subElementSize -= Vector2f(_padding.x(), _padding.y()); for (size_t iii = 0; iii < 2; ++iii) { if (m_subWidget[iii] != null) { - vec2 origin2 = origin+m_offset; - vec2 minSize = m_subWidget[iii]->getCalculateMinSize(); - //bvec2 expand = m_subWidget[iii]->propertyExpand.get(); + Vector2f origin2 = origin+m_offset; + Vector2f minSize = m_subWidget[iii]->getCalculateMinSize(); + //Vector2b expand = m_subWidget[iii]->propertyExpand.get(); origin2 += ewol::gravityGenerateDelta(propertyGravity, minSize - localAvaillable); m_subWidget[iii]->setOrigin(m_origin + origin); m_subWidget[iii]->setSize(subElementSize); m_subWidget[iii]->onChangeSize(); } } - vec2 selectableAreaPos = origin-vec2(_padding.xLeft(), _padding.yButtom()); - vec2 selectableAreaEndPos = m_size - (selectableAreaPos + subElementSize + vec2(_padding.x(), _padding.y())); + Vector2f selectableAreaPos = origin-Vector2f(_padding.xLeft(), _padding.yButtom()); + Vector2f selectableAreaEndPos = m_size - (selectableAreaPos + subElementSize + Vector2f(_padding.x(), _padding.y())); markToRedraw(); return ewol::Padding(selectableAreaPos.x(), selectableAreaEndPos.y(), @@ -140,17 +140,17 @@ ewol::Padding ewol::widget::Container2::onChangeSizePadded(const ewol::Padding& void ewol::widget::Container2::calculateMinMaxSizePadded(const ewol::Padding& _padding) { // call main class - m_minSize = vec2(0,0); + m_minSize = Vector2f(0,0); // call sub classes for (size_t iii = 0; iii < 2; ++iii) { if (m_subWidget[iii] != null) { m_subWidget[iii]->calculateMinMaxSize(); - vec2 min = m_subWidget[iii]->getCalculateMinSize(); + Vector2f min = m_subWidget[iii]->getCalculateMinSize(); m_minSize.setMax(min); } } // add padding : - m_minSize += vec2(_padding.x(), _padding.y()); + m_minSize += Vector2f(_padding.x(), _padding.y()); // verify the min max of the min size ... checkMinSize(); markToRedraw(); @@ -162,7 +162,7 @@ void ewol::widget::Container2::onRegenerateDisplay() { } } /* -ewol::WidgetShared ewol::widget::Container2::getWidgetAtPos(const vec2& _pos) { +ewol::WidgetShared ewol::widget::Container2::getWidgetAtPos(const Vector2f& _pos) { if (isHide() == false) { if (m_subWidget[m_idWidgetDisplayed] != null) { return m_subWidget[m_idWidgetDisplayed]->getWidgetAtPos(_pos); @@ -180,10 +180,10 @@ bool ewol::widget::Container2::loadXML(const exml::Element& _node) { ewol::Widget::loadXML(_node); // remove previous element : subWidgetRemove(); - EWOL_VERBOSE("Create en element 2 ... with nodes.size()=" << _node.nodes.size()); + Log.verbose("Create en element 2 ... with nodes.size()=" << _node.nodes.size()); // parse all the elements: for(const auto it : _node.nodes) { - EWOL_VERBOSE(" node: " << it); + Log.verbose(" node: " << it); exml::Element pNode = it.toElement(); if (pNode.exist() == false) { // trash here all that is not element @@ -191,18 +191,18 @@ bool ewol::widget::Container2::loadXML(const exml::Element& _node) { } etk::String widgetName = pNode.getValue(); if (getWidgetManager().exist(widgetName) == false) { - EWOL_ERROR("(l " << pNode.getPos() << ") Unknown basic node='" << widgetName << "' not in: [" << getWidgetManager().list() << "]" ); + Log.error("(l " << pNode.getPos() << ") Unknown basic node='" << widgetName << "' not in: [" << getWidgetManager().list() << "]" ); continue; } bool toogleMode=false; if (getSubWidget() != null) { toogleMode=true; if (getSubWidgetToggle() != null) { - EWOL_ERROR("(l " << pNode.getPos() << ") Can only have one subWidget ??? node='" << widgetName << "'" ); + Log.error("(l " << pNode.getPos() << ") Can only have one subWidget ??? node='" << widgetName << "'" ); continue; } } - EWOL_DEBUG("try to create subwidget : '" << widgetName << "'"); + Log.debug("try to create subwidget : '" << widgetName << "'"); ewol::WidgetShared tmpWidget = getWidgetManager().create(widgetName, pNode); if (tmpWidget == null) { EWOL_ERROR ("(l " << pNode.getPos() << ") Can not create the widget: '" << widgetName << "'"); @@ -222,7 +222,7 @@ bool ewol::widget::Container2::loadXML(const exml::Element& _node) { return true; } -void ewol::widget::Container2::setOffset(const vec2& _newVal) { +void ewol::widget::Container2::setOffset(const Vector2f& _newVal) { if (m_offset != _newVal) { ewol::Widget::setOffset(_newVal); // recalculate the new sise and position of sub widget ... diff --git a/src/org/atriasoft/ewol/widget/Container2.java b/src/org/atriasoft/ewol/widget/Container2.java index 93ad51a..6048a43 100644 --- a/src/org/atriasoft/ewol/widget/Container2.java +++ b/src/org/atriasoft/ewol/widget/Container2.java @@ -166,7 +166,7 @@ namespace ewol { } ewol::ObjectShared getSubObjectNamed(const etk::String& _objectName) override; bool loadXML(const exml::Element& _node) override; - void setOffset(const vec2& _newVal) override; + void setOffset(const Vector2f& _newVal) override; void requestDestroyFromChild(const ewol::ObjectShared& _child) override; void drawWidgetTree(int32_t _level=0) override; }; diff --git a/src/org/atriasoft/ewol/widget/ContainerN.cpp b/src/org/atriasoft/ewol/widget/ContainerN.cpp index deaa7e0..31ab58e 100644 --- a/src/org/atriasoft/ewol/widget/ContainerN.cpp +++ b/src/org/atriasoft/ewol/widget/ContainerN.cpp @@ -14,7 +14,7 @@ ETK_DECLARE_TYPE(ewol::widget::ContainerN); ewol::widget::ContainerN::ContainerN() : propertyLockExpand(this, "lock", - vec2(false,false), + Vector2f(false,false), "Lock the subwidget expand", &ewol::widget::ContainerN::onChangePropertyLockExpand), m_subExpend(false,false) { @@ -27,8 +27,8 @@ ewol::widget::ContainerN::~ContainerN() { } -bvec2 ewol::widget::ContainerN::canExpand() { - bvec2 res = propertyExpand.get(); +Vector2b ewol::widget::ContainerN::canExpand() { + Vector2b res = propertyExpand.get(); if (propertyLockExpand->x() == false) { if (m_subExpend.x() == true) { res.setX(true); @@ -39,7 +39,7 @@ bvec2 ewol::widget::ContainerN::canExpand() { res.setY(true); } } - //EWOL_DEBUG("Expend check : user=" << m_userExpand << " lock=" << propertyLockExpand << " sub=" << m_subExpend << " res=" << res); + //Log.debug("Expend check : user=" << m_userExpand << " lock=" << propertyLockExpand << " sub=" << m_subExpend << " res=" << res); return res; } @@ -73,7 +73,7 @@ void ewol::widget::ContainerN::subWidgetReplace(ewol::WidgetShared _oldWidget, int32_t ewol::widget::ContainerN::subWidgetAdd(ewol::WidgetShared _newWidget) { if (_newWidget == null) { - EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} Try to add An empty Widget ... "); + Log.error("[" << getId() << "] {" << getObjectType() << "} Try to add An empty Widget ... "); return -1; } _newWidget->setParent(sharedFromThis()); @@ -86,7 +86,7 @@ int32_t ewol::widget::ContainerN::subWidgetAdd(ewol::WidgetShared _newWidget) { int32_t ewol::widget::ContainerN::subWidgetAddStart(ewol::WidgetShared _newWidget) { if (_newWidget == null) { - EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} Try to add start An empty Widget ... "); + Log.error("[" << getId() << "] {" << getObjectType() << "} Try to add start An empty Widget ... "); return -1; } if (_newWidget != null) { @@ -179,7 +179,7 @@ void ewol::widget::ContainerN::systemDraw(const ewol::DrawProperty& _displayProp prop.limit(m_origin, m_size); for (int64_t iii = m_subWidget.size()-1; iii>=0; --iii) { if (m_subWidget[iii] != null) { - //EWOL_INFO(" ***** : [" << (*it)->propertyName << "] t=" << (*it)->getObjectType() << " o=" << (*it)->m_origin << " s=" << (*it)->m_size); + //Log.info(" ***** : [" << (*it)->propertyName << "] t=" << (*it)->getObjectType() << " o=" << (*it)->m_origin << " s=" << (*it)->m_size); m_subWidget[iii]->systemDraw(prop); } } @@ -200,23 +200,23 @@ void ewol::widget::ContainerN::calculateMinMaxSize() { m_subExpend.setValue(false, false); m_minSize.setValue(0,0); m_maxSize.setValue(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE); - //EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} set min size : " << m_minSize); + //Log.error("[" << getId() << "] {" << getObjectType() << "} set min size : " << m_minSize); for (auto &it : m_subWidget) { if (it != null) { it->calculateMinMaxSize(); - bvec2 subExpendProp = it->canExpand(); + Vector2b subExpendProp = it->canExpand(); if (true == subExpendProp.x()) { m_subExpend.setX(true); } if (true == subExpendProp.y()) { m_subExpend.setY(true); } - vec2 tmpSize = it->getCalculateMinSize(); + Vector2f tmpSize = it->getCalculateMinSize(); m_minSize.setValue( etk::max(tmpSize.x(), m_minSize.x()), etk::max(tmpSize.y(), m_minSize.y()) ); } } - //EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} Result min size : " << m_minSize); + //Log.error("[" << getId() << "] {" << getObjectType() << "} Result min size : " << m_minSize); } void ewol::widget::ContainerN::onRegenerateDisplay() { @@ -227,15 +227,15 @@ void ewol::widget::ContainerN::onRegenerateDisplay() { } } -ewol::WidgetShared ewol::widget::ContainerN::getWidgetAtPos(const vec2& _pos) { +ewol::WidgetShared ewol::widget::ContainerN::getWidgetAtPos(const Vector2f& _pos) { if (*propertyHide == true) { return null; } // for all element in the sizer ... for (auto &it : m_subWidget) { if (it != null) { - vec2 tmpSize = it->getSize(); - vec2 tmpOrigin = it->getOrigin(); + Vector2f tmpSize = it->getSize(); + Vector2f tmpOrigin = it->getOrigin(); if( (tmpOrigin.x() <= _pos.x() && tmpOrigin.x() + tmpSize.x() >= _pos.x()) && (tmpOrigin.y() <= _pos.y() && tmpOrigin.y() + tmpSize.y() >= _pos.y()) ) { @@ -277,12 +277,12 @@ bool ewol::widget::ContainerN::loadXML(const exml::Element& _node) { continue; } etk::String widgetName = pNode.getValue(); - EWOL_VERBOSE(" t=" << getObjectType() << " Load node name : '" << widgetName << "'"); + Log.verbose(" t=" << getObjectType() << " Load node name : '" << widgetName << "'"); if (getWidgetManager().exist(widgetName) == false) { - EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} (l " << pNode.getPos() << ") Unknown basic node='" << widgetName << "' not in : [" << getWidgetManager().list() << "]" ); + Log.error("[" << getId() << "] {" << getObjectType() << "} (l " << pNode.getPos() << ") Unknown basic node='" << widgetName << "' not in : [" << getWidgetManager().list() << "]" ); continue; } - EWOL_DEBUG("[" << getId() << "] {" << getObjectType() << "} load new element : '" << widgetName << "'"); + Log.debug("[" << getId() << "] {" << getObjectType() << "} load new element : '" << widgetName << "'"); ewol::WidgetShared subWidget = getWidgetManager().create(widgetName, pNode); if (subWidget == null) { EWOL_ERROR ("[" << getId() << "] {" << getObjectType() << "} (l " << pNode.getPos() << ") Can not create the widget : '" << widgetName << "'"); @@ -295,7 +295,7 @@ bool ewol::widget::ContainerN::loadXML(const exml::Element& _node) { subWidgetAddStart(subWidget); } if (subWidget->loadXML(pNode) == false) { - EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} (l " << pNode.getPos() << ") can not load widget properties : '" << widgetName << "'"); + Log.error("[" << getId() << "] {" << getObjectType() << "} (l " << pNode.getPos() << ") can not load widget properties : '" << widgetName << "'"); return false; } } @@ -303,7 +303,7 @@ bool ewol::widget::ContainerN::loadXML(const exml::Element& _node) { } -void ewol::widget::ContainerN::setOffset(const vec2& _newVal) { +void ewol::widget::ContainerN::setOffset(const Vector2f& _newVal) { if (m_offset != _newVal) { ewol::Widget::setOffset(_newVal); // recalculate the new sise and position of sub widget ... diff --git a/src/org/atriasoft/ewol/widget/ContainerN.java b/src/org/atriasoft/ewol/widget/ContainerN.java index b62e089..3010cc2 100644 --- a/src/org/atriasoft/ewol/widget/ContainerN.java +++ b/src/org/atriasoft/ewol/widget/ContainerN.java @@ -20,9 +20,9 @@ namespace ewol { */ class ContainerN : public ewol::Widget { public: // properties: - eproperty::Value propertyLockExpand; //!< Lock the expend of the sub widget to this one == > this permit to limit bigger subWidget + eproperty::Value propertyLockExpand; //!< Lock the expend of the sub widget to this one == > this permit to limit bigger subWidget protected: - etk::Vector m_subWidget; + List m_subWidget; protected: /** * @brief Constructor @@ -34,9 +34,9 @@ namespace ewol { */ virtual ~ContainerN(); protected: - bvec2 m_subExpend; //!< reference of the sub element expention requested. + Vector2b m_subExpend; //!< reference of the sub element expention requested. // herited function - virtual bvec2 canExpand() override; + virtual Vector2b canExpand() override; public: /** * @brief remove all sub element from the widget. @@ -92,10 +92,10 @@ namespace ewol { void onRegenerateDisplay() override; void onChangeSize() override; void calculateMinMaxSize() override; - ewol::WidgetShared getWidgetAtPos(const vec2& _pos) override; + ewol::WidgetShared getWidgetAtPos(const Vector2f& _pos) override; ewol::ObjectShared getSubObjectNamed(const etk::String& _objectName) override; bool loadXML(const exml::Element& _node) override; - void setOffset(const vec2& _newVal) override; + void setOffset(const Vector2f& _newVal) override; void requestDestroyFromChild(const ewol::ObjectShared& _child) override; void drawWidgetTree(int32_t _level=0) override; protected: diff --git a/src/org/atriasoft/ewol/widget/ContextMenu.cpp b/src/org/atriasoft/ewol/widget/ContextMenu.cpp index 57e4ea4..1da8dbe 100644 --- a/src/org/atriasoft/ewol/widget/ContextMenu.cpp +++ b/src/org/atriasoft/ewol/widget/ContextMenu.cpp @@ -22,7 +22,7 @@ ewol::widget::ContextMenu::ContextMenu(): "the display name for config file", &ewol::widget::ContextMenu::onChangePropertyShape), propertyArrowPos(this, "arrow-position", - vec2(0,0), + Vector2f(0,0), "Position of the arrow in the pop-up", &ewol::widget::ContextMenu::onChangePropertyArrowPos), propertyArrawBorder(this, "arrow-mode", @@ -59,12 +59,12 @@ void ewol::widget::ContextMenu::onChangeSize() { markToRedraw(); // pop-up fill all the display : ewol::Padding padding = m_shaper.getPadding(); - EWOL_VERBOSE("our origin=" << m_origin << " size=" << m_size); + Log.verbose("our origin=" << m_origin << " size=" << m_size); if (m_subWidget == null) { return; } - vec2 subWidgetSize(0,0); - vec2 subWidgetOrigin(0,0); + Vector2f subWidgetSize(0,0); + Vector2f subWidgetOrigin(0,0); subWidgetSize = m_subWidget->getCalculateMinSize(); if (m_subWidget->canExpand().x() == true) { subWidgetSize.setX(m_size.x()); @@ -115,7 +115,7 @@ void ewol::widget::ContextMenu::onChangeSize() { } break; } - EWOL_VERBOSE(" == > sub origin=" << subWidgetOrigin << " size=" << subWidgetSize); + Log.verbose(" == > sub origin=" << subWidgetOrigin << " size=" << subWidgetSize); m_subWidget->setOrigin(subWidgetOrigin); m_subWidget->setSize(subWidgetSize); m_subWidget->onChangeSize(); @@ -127,8 +127,8 @@ void ewol::widget::ContextMenu::calculateMinMaxSize() { ewol::widget::Container::calculateMinMaxSize(); // add padding of the display ewol::Padding padding = m_shaper.getPadding(); - m_minSize += vec2(padding.x(), padding.y()); - //EWOL_DEBUG("CalculateMinSize=>>" << m_minSize); + m_minSize += Vector2f(padding.x(), padding.y()); + //Log.debug("CalculateMinSize=>>" << m_minSize); markToRedraw(); } @@ -152,57 +152,57 @@ void ewol::widget::ContextMenu::onRegenerateDisplay() { if (m_subWidget == null) { return; } - vec2 tmpSize = m_subWidget->getSize(); - vec2 tmpOrigin = m_subWidget->getOrigin(); + Vector2f tmpSize = m_subWidget->getSize(); + Vector2f tmpOrigin = m_subWidget->getOrigin(); // display border ... m_compositing.setColor(m_colorBorder); switch (propertyArrawBorder) { case markTop: - m_compositing.setPos(vec3(propertyArrowPos->x(), propertyArrowPos->y(), 0.0f) ); + m_compositing.setPos(Vector3f(propertyArrowPos->x(), propertyArrowPos->y(), 0.0f) ); m_compositing.addVertex(); if (propertyArrowPos->x() <= tmpOrigin.x() ) { float laking = m_offset - padding.yTop(); - m_compositing.setPos(vec3(propertyArrowPos->x()+laking, propertyArrowPos->y()-laking, 0.0f) ); + m_compositing.setPos(Vector3f(propertyArrowPos->x()+laking, propertyArrowPos->y()-laking, 0.0f) ); m_compositing.addVertex(); - m_compositing.setPos(vec3(propertyArrowPos->x(), propertyArrowPos->y()-laking, 0.0f) ); + m_compositing.setPos(Vector3f(propertyArrowPos->x(), propertyArrowPos->y()-laking, 0.0f) ); m_compositing.addVertex(); } else { float laking = m_offset - padding.yTop(); - m_compositing.setPos(vec3(propertyArrowPos->x()+laking, propertyArrowPos->y()-laking, 0.0f) ); + m_compositing.setPos(Vector3f(propertyArrowPos->x()+laking, propertyArrowPos->y()-laking, 0.0f) ); m_compositing.addVertex(); - m_compositing.setPos(vec3(propertyArrowPos->x()-laking, propertyArrowPos->y()-laking, 0.0f) ); + m_compositing.setPos(Vector3f(propertyArrowPos->x()-laking, propertyArrowPos->y()-laking, 0.0f) ); m_compositing.addVertex(); } break; case markButtom: - m_compositing.setPos(vec3(propertyArrowPos->x(), propertyArrowPos->y(), 0) ); + m_compositing.setPos(Vector3f(propertyArrowPos->x(), propertyArrowPos->y(), 0) ); m_compositing.addVertex(); if (propertyArrowPos->x() <= tmpOrigin.x() ) { int32_t laking = m_offset - padding.yTop(); - m_compositing.setPos(vec3(propertyArrowPos->x()+laking, propertyArrowPos->y()+laking, 0.0f) ); + m_compositing.setPos(Vector3f(propertyArrowPos->x()+laking, propertyArrowPos->y()+laking, 0.0f) ); m_compositing.addVertex(); - m_compositing.setPos(vec3(propertyArrowPos->x(), propertyArrowPos->y()+laking, 0.0f) ); + m_compositing.setPos(Vector3f(propertyArrowPos->x(), propertyArrowPos->y()+laking, 0.0f) ); m_compositing.addVertex(); } else { int32_t laking = m_offset - padding.yTop(); - m_compositing.setPos(vec3(propertyArrowPos->x()+laking, propertyArrowPos->y()+laking, 0.0f) ); + m_compositing.setPos(Vector3f(propertyArrowPos->x()+laking, propertyArrowPos->y()+laking, 0.0f) ); m_compositing.addVertex(); - m_compositing.setPos(vec3(propertyArrowPos->x()-laking, propertyArrowPos->y()+laking, 0.0f) ); + m_compositing.setPos(Vector3f(propertyArrowPos->x()-laking, propertyArrowPos->y()+laking, 0.0f) ); m_compositing.addVertex(); } break; default: case markRight: case markLeft: - EWOL_TODO("later"); + Log.todo("later"); break; } - vec2 shaperOrigin = tmpOrigin-vec2(padding.xLeft(), padding.yButtom()); - vec2 shaperSize = tmpSize+vec2(padding.x(), padding.y()); - m_shaper.setShape(vec2ClipInt32(shaperOrigin), - vec2ClipInt32(shaperSize)); + Vector2f shaperOrigin = tmpOrigin-Vector2f(padding.xLeft(), padding.yButtom()); + Vector2f shaperSize = tmpSize+Vector2f(padding.x(), padding.y()); + m_shaper.setShape(Vector2fClipInt32(shaperOrigin), + Vector2fClipInt32(shaperSize)); } bool ewol::widget::ContextMenu::onEventInput(const ewol::event::Input& _event) { @@ -224,7 +224,7 @@ bool ewol::widget::ContextMenu::onEventInput(const ewol::event::Input& _event) { return false; } -ewol::WidgetShared ewol::widget::ContextMenu::getWidgetAtPos(const vec2& _pos) { +ewol::WidgetShared ewol::widget::ContextMenu::getWidgetAtPos(const Vector2f& _pos) { ewol::WidgetShared val = ewol::widget::Container::getWidgetAtPos(_pos); if (val != null) { return val; @@ -246,21 +246,21 @@ void ewol::widget::ContextMenu::onChangePropertyShape() { } -void ewol::widget::ContextMenu::setPositionMarkAuto(const vec2& _origin, const vec2& _size) { +void ewol::widget::ContextMenu::setPositionMarkAuto(const Vector2f& _origin, const Vector2f& _size) { ewol::widget::WindowsShared windows = getWindows(); - vec2 globalSize = windows->getSize(); + Vector2f globalSize = windows->getSize(); // TODO : Support left and right float upperSize = globalSize.y() - (_origin.y() + _size.y()); float underSize = _origin.y(); if (underSize >= upperSize) { - vec2 pos = _origin + _size - vec2(_size.x()*0.5f, 0.0f); + Vector2f pos = _origin + _size - Vector2f(_size.x()*0.5f, 0.0f); setPositionMark(ewol::widget::ContextMenu::markButtom, pos); } else { - vec2 pos = _origin + vec2(_size.x()*0.5f, 0.0f); + Vector2f pos = _origin + Vector2f(_size.x()*0.5f, 0.0f); setPositionMark(ewol::widget::ContextMenu::markTop, pos); } } -void ewol::widget::ContextMenu::setPositionMark(enum markPosition _position, const vec2& _arrowPos) { +void ewol::widget::ContextMenu::setPositionMark(enum markPosition _position, const Vector2f& _arrowPos) { propertyArrawBorder.set(_position); propertyArrowPos.set(_arrowPos); } diff --git a/src/org/atriasoft/ewol/widget/ContextMenu.java b/src/org/atriasoft/ewol/widget/ContextMenu.java index 9dc1537..d93f73e 100644 --- a/src/org/atriasoft/ewol/widget/ContextMenu.java +++ b/src/org/atriasoft/ewol/widget/ContextMenu.java @@ -32,7 +32,7 @@ namespace ewol { }; public: // properties eproperty::Value propertyShape; //!< shape of the widget. - eproperty::Value propertyArrowPos; + eproperty::Value propertyArrowPos; eproperty::List propertyArrawBorder; protected: ContextMenu(); @@ -50,8 +50,8 @@ namespace ewol { float m_offset; public: - void setPositionMarkAuto(const vec2& _origin, const vec2& _size); - void setPositionMark(enum markPosition _position, const vec2& _arrowPos); + void setPositionMarkAuto(const Vector2f& _origin, const Vector2f& _size); + void setPositionMark(enum markPosition _position, const Vector2f& _arrowPos); protected: void onDraw() override; public: @@ -59,7 +59,7 @@ namespace ewol { bool onEventInput(const ewol::event::Input& _event) override; void onChangeSize() override; void calculateMinMaxSize() override; - ewol::WidgetShared getWidgetAtPos(const vec2& _pos) override; + ewol::WidgetShared getWidgetAtPos(const Vector2f& _pos) override; protected: virtual void onChangePropertyArrowPos(); virtual void onChangePropertyArrawBorder(); diff --git a/src/org/atriasoft/ewol/widget/Entry.cpp b/src/org/atriasoft/ewol/widget/Entry.cpp index c47eb11..549de7e 100644 --- a/src/org/atriasoft/ewol/widget/Entry.cpp +++ b/src/org/atriasoft/ewol/widget/Entry.cpp @@ -61,7 +61,7 @@ void ewol::widget::Entry::init() { m_regex.compile(propertyRegex.get()); if (m_regex.getStatus() == false) { - EWOL_ERROR("can not parse regex for : " << propertyRegex); + Log.error("can not parse regex for : " << propertyRegex); } markToRedraw(); @@ -104,9 +104,9 @@ void ewol::widget::Entry::calculateMinMaxSize() { // get generic padding ewol::Padding padding = m_shaper.getPadding(); int32_t minHeight = m_text.calculateSize(char32_t('A')).y(); - vec2 minimumSizeBase(20, minHeight); + Vector2f minimumSizeBase(20, minHeight); // add padding : - minimumSizeBase += vec2(padding.x(), padding.y()); + minimumSizeBase += Vector2f(padding.x(), padding.y()); m_minSize.setMax(minimumSizeBase); // verify the min max of the min size ... checkMinSize(); @@ -132,7 +132,7 @@ void ewol::widget::Entry::onRegenerateDisplay() { updateTextPosition(); ewol::Padding padding = m_shaper.getPadding(); - vec2 tmpSizeShaper = m_minSize; + Vector2f tmpSizeShaper = m_minSize; if (propertyFill->x() == true) { tmpSizeShaper.setX(m_size.x()); } @@ -140,23 +140,23 @@ void ewol::widget::Entry::onRegenerateDisplay() { tmpSizeShaper.setY(m_size.y()); } - vec2 tmpOriginShaper = (m_size - tmpSizeShaper) / 2.0f; - vec2 tmpSizeText = tmpSizeShaper - vec2(padding.x(), padding.y()); - vec2 tmpOriginText = (m_size - tmpSizeText) / 2.0f; + Vector2f tmpOriginShaper = (m_size - tmpSizeShaper) / 2.0f; + Vector2f tmpSizeText = tmpSizeShaper - Vector2f(padding.x(), padding.y()); + Vector2f tmpOriginText = (m_size - tmpSizeText) / 2.0f; // sometimes, the user define an height bigger than the real size needed == > in this case we need to center the text in the shaper ... int32_t minHeight = m_text.calculateSize(char32_t('A')).y(); if (tmpSizeText.y() > minHeight) { - tmpOriginText += vec2(0,(tmpSizeText.y()-minHeight)/2.0f); + tmpOriginText += Vector2f(0,(tmpSizeText.y()-minHeight)/2.0f); } // fix all the position in the int32_t class: - tmpSizeShaper = vec2ClipInt32(tmpSizeShaper); - tmpOriginShaper = vec2ClipInt32(tmpOriginShaper); - tmpSizeText = vec2ClipInt32(tmpSizeText); - tmpOriginText = vec2ClipInt32(tmpOriginText); + tmpSizeShaper = Vector2fClipInt32(tmpSizeShaper); + tmpOriginShaper = Vector2fClipInt32(tmpOriginShaper); + tmpSizeText = Vector2fClipInt32(tmpSizeText); + tmpOriginText = Vector2fClipInt32(tmpOriginText); m_text.reset(); m_text.setClippingWidth(tmpOriginText, tmpSizeText); - m_text.setPos(tmpOriginText+vec2(m_displayStartPosition,0)); + m_text.setPos(tmpOriginText+Vector2f(m_displayStartPosition,0)); if (m_displayCursorPosSelection != m_displayCursorPos) { m_text.setCursorSelection(m_displayCursorPos, m_displayCursorPosSelection); } else { @@ -183,15 +183,15 @@ void ewol::widget::Entry::onRegenerateDisplay() { } -void ewol::widget::Entry::updateCursorPosition(const vec2& _pos, bool _selection) { +void ewol::widget::Entry::updateCursorPosition(const Vector2f& _pos, bool _selection) { ewol::Padding padding = m_shaper.getPadding(); - vec2 relPos = relativePosition(_pos); + Vector2f relPos = relativePosition(_pos); relPos.setX(relPos.x()-m_displayStartPosition - padding.xLeft()); // try to find the new cursor position : etk::String tmpDisplay = etk::String(propertyValue, 0, m_displayStartPosition); int32_t displayHidenSize = m_text.calculateSize(tmpDisplay).x(); - //EWOL_DEBUG("hidenSize : " << displayHidenSize); + //Log.debug("hidenSize : " << displayHidenSize); int32_t newCursorPosition = -1; int32_t tmpTextOriginX = padding.xLeft(); for (size_t iii=0; iiisize(); iii++) { @@ -375,9 +375,9 @@ bool ewol::widget::Entry::onEventEntry(const ewol::event::Entry& _event) { m_displayCursorPosSelection = m_displayCursorPos; } } else if(_event.getChar() >= 20) { - EWOL_ERROR("get data: '" << _event.getChar() << "' = '" << u32char::convertToUtf8(_event.getChar()) << "'"); + Log.error("get data: '" << _event.getChar() << "' = '" << u32char::convertToUtf8(_event.getChar()) << "'"); if ((int64_t)propertyValue->size() > propertyMaxCharacter) { - EWOL_INFO("Reject data for entry : '" << _event.getChar() << "'"); + Log.info("Reject data for entry : '" << _event.getChar() << "'"); } else { etk::String newData = propertyValue; etk::String inputData = u32char::convertToUtf8(_event.getChar()); @@ -427,15 +427,15 @@ void ewol::widget::Entry::setInternalValue(const etk::String& _newData) { if (_newData.size()>0) { /* if (m_regex.parse(_newData, 0, _newData.size()) == false) { - EWOL_INFO("The input data does not match with the regExp '" << _newData << "' Regex='" << propertyRegex << "'" ); + Log.info("The input data does not match with the regExp '" << _newData << "' Regex='" << propertyRegex << "'" ); return; } if (m_regex.start() != 0) { - EWOL_INFO("The input data does not match with the regExp '" << _newData << "' Regex='" << propertyRegex << "' (start position error)" ); + Log.info("The input data does not match with the regExp '" << _newData << "' Regex='" << propertyRegex << "' (start position error)" ); return; } if (m_regex.stop() != _newData.size()) { - EWOL_INFO("The input data does not match with the regExp '" << _newData << "' Regex='" << propertyRegex << "' (stop position error)" ); + Log.info("The input data does not match with the regExp '" << _newData << "' Regex='" << propertyRegex << "' (stop position error)" ); return; } */ @@ -525,7 +525,7 @@ void ewol::widget::Entry::updateTextPosition() { int32_t pixelCursorPos = m_text.calculateSize(tmpDisplay).x(); // check if the Cussor is visible at 10px nearest the border : int32_t tmp1 = pixelCursorPos+m_displayStartPosition; - EWOL_DEBUG("cursorPos=" << pixelCursorPos << "px maxSize=" << tmpUserSize << "px tmp1=" << tmp1); + Log.debug("cursorPos=" << pixelCursorPos << "px maxSize=" << tmpUserSize << "px tmp1=" << tmp1); if (tmp1<10) { // set the cursor on le left m_displayStartPosition = etk::min(-pixelCursorPos+10, 0); @@ -582,14 +582,14 @@ void ewol::widget::Entry::onChangePropertyValue() { etk::String newData = propertyValue.get(); if ((int64_t)newData.size() > propertyMaxCharacter) { newData = etk::String(newData, 0, propertyMaxCharacter); - EWOL_DEBUG("Limit entry set of data... " << etk::String(newData, propertyMaxCharacter)); + Log.debug("Limit entry set of data... " << etk::String(newData, propertyMaxCharacter)); } // set the value with the check of the RegExp ... setInternalValue(newData); if (newData == propertyValue.get()) { m_displayCursorPos = propertyValue->size(); m_displayCursorPosSelection = m_displayCursorPos; - EWOL_VERBOSE("Set : '" << newData << "'"); + Log.verbose("Set : '" << newData << "'"); } markToRedraw(); } @@ -601,7 +601,7 @@ void ewol::widget::Entry::onChangePropertyMaxCharacter() { void ewol::widget::Entry::onChangePropertyRegex() { m_regex.compile(propertyRegex.get()); if (m_regex.getStatus() == false) { - EWOL_ERROR("can not parse regex for : " << propertyRegex); + Log.error("can not parse regex for : " << propertyRegex); } markToRedraw(); } diff --git a/src/org/atriasoft/ewol/widget/Entry.java b/src/org/atriasoft/ewol/widget/Entry.java index 66eb62f..f231277 100644 --- a/src/org/atriasoft/ewol/widget/Entry.java +++ b/src/org/atriasoft/ewol/widget/Entry.java @@ -92,7 +92,7 @@ namespace ewol { * @param[in] _pos Absolute position of the event * @note The display is automaticly requested when change apear. */ - virtual void updateCursorPosition(const vec2& _pos, bool _Selection=false); + virtual void updateCursorPosition(const Vector2f& _pos, bool _Selection=false); public: /** * @brief Copy the selected data on the specify clipboard diff --git a/src/org/atriasoft/ewol/widget/Gird.cpp b/src/org/atriasoft/ewol/widget/Gird.cpp index 503662b..a3e8292 100644 --- a/src/org/atriasoft/ewol/widget/Gird.cpp +++ b/src/org/atriasoft/ewol/widget/Gird.cpp @@ -21,18 +21,18 @@ ewol::widget::Gird::Gird() : } ewol::widget::Gird::~Gird() { - EWOL_DEBUG("[" << getId() << "]={" << getObjectType() << "} Gird : destroy"); + Log.debug("[" << getId() << "]={" << getObjectType() << "} Gird : destroy"); subWidgetRemoveAll(); } -void ewol::widget::Gird::setBorderSize(const ivec2& _newBorderSize) { +void ewol::widget::Gird::setBorderSize(const Vector2i& _newBorderSize) { m_borderSize = _newBorderSize; if (m_borderSize.x() < 0) { - EWOL_ERROR("Try to set a border size <0 on x : " << m_borderSize.x() << " == > restore to 0"); + Log.error("Try to set a border size <0 on x : " << m_borderSize.x() << " == > restore to 0"); m_borderSize.setX(0); } if (m_borderSize.y() < 0) { - EWOL_ERROR("Try to set a border size <0 on y : " << m_borderSize.y() << " == > restore to 0"); + Log.error("Try to set a border size <0 on y : " << m_borderSize.y() << " == > restore to 0"); m_borderSize.setY(0); } markToRedraw(); @@ -40,15 +40,15 @@ void ewol::widget::Gird::setBorderSize(const ivec2& _newBorderSize) { } void ewol::widget::Gird::onChangeSize() { - //EWOL_DEBUG("Update size"); + //Log.debug("Update size"); m_size -= m_borderSize*2; for (size_t iii=0; iiigetPixel(); m_maxSize = propertyMaxSize->getPixel(); m_uniformSizeRow = 0; @@ -96,8 +96,8 @@ void ewol::widget::Gird::calculateMinMaxSize() { } if (m_subWidget[iii].widget != null) { m_subWidget[iii].widget->calculateMinMaxSize(); - vec2 tmpSize = m_subWidget[iii].widget->getCalculateMinSize(); - EWOL_DEBUG(" [" << iii << "] subWidgetMinSize=" << tmpSize); + Vector2f tmpSize = m_subWidget[iii].widget->getCalculateMinSize(); + Log.debug(" [" << iii << "] subWidgetMinSize=" << tmpSize); // for all we get the max size : m_uniformSizeRow = etk::max((int32_t)tmpSize.y(), m_uniformSizeRow); // for the colomn size : We set the autamatic value in negative : @@ -114,13 +114,13 @@ void ewol::widget::Gird::calculateMinMaxSize() { for (size_t iii=0; iii it is not the case ==> the herited class must call the \"OnObjectRemove\" function..."); + Log.critical("[" << getId() << "] The number of element might have been reduced ... == > it is not the case ==> the herited class must call the \"OnObjectRemove\" function..."); } } else { EWOL_WARNING("[" << getId() << "] Must not have null pointer on the subWidget list ..."); @@ -157,7 +157,7 @@ void ewol::widget::Gird::setColSize(int32_t _colId, int32_t _size) { if ((int64_t)m_sizeCol.size() > _colId) { m_sizeCol[_colId] = _size; } else { - EWOL_ERROR("Can not set the Colomn size : " << _colId+1 + Log.error("Can not set the Colomn size : " << _colId+1 << " at " << _size << "px we have " << m_sizeCol.size() << " colomn"); } @@ -174,7 +174,7 @@ int32_t ewol::widget::Gird::getColSize(int32_t _colId) { } return m_sizeCol[_colId]; } - EWOL_ERROR("Can not get the Colomn size : " << _colId+1 << " we have "<< m_sizeCol.size() << " colomn"); + Log.error("Can not get the Colomn size : " << _colId+1 << " we have "<< m_sizeCol.size() << " colomn"); return 0; } @@ -219,7 +219,7 @@ void ewol::widget::Gird::subWidgetAdd(int32_t _colId, int32_t _rowId, ewol::Widg if (m_tmpWidget != null) { m_tmpWidget.reset(); if (m_tmpWidget != null) { - EWOL_CRITICAL("[" << getId() << "] Error while replacing a widget ... == > never call when free"); + Log.critical("[" << getId() << "] Error while replacing a widget ... == > never call when free"); m_tmpWidget = null; } } @@ -304,7 +304,7 @@ void ewol::widget::Gird::onRegenerateDisplay() { } } -ewol::WidgetShared ewol::widget::Gird::getWidgetAtPos(const vec2& _pos) { +ewol::WidgetShared ewol::widget::Gird::getWidgetAtPos(const Vector2f& _pos) { if (*propertyHide == true) { return null; } @@ -313,8 +313,8 @@ ewol::WidgetShared ewol::widget::Gird::getWidgetAtPos(const vec2& _pos) { if (it.widget == null) { continue; } - vec2 tmpSize = it.widget->getSize(); - vec2 tmpOrigin = it.widget->getOrigin(); + Vector2f tmpSize = it.widget->getSize(); + Vector2f tmpOrigin = it.widget->getOrigin(); if( (tmpOrigin.x() <= _pos.x() && tmpOrigin.x() + tmpSize.x() >= _pos.x()) && (tmpOrigin.y() <= _pos.y() && tmpOrigin.y() + tmpSize.y() >= _pos.y()) ) { ewol::WidgetShared tmpWidget = it.widget->getWidgetAtPos(_pos); diff --git a/src/org/atriasoft/ewol/widget/Gird.java b/src/org/atriasoft/ewol/widget/Gird.java index aa07daf..3029bbe 100644 --- a/src/org/atriasoft/ewol/widget/Gird.java +++ b/src/org/atriasoft/ewol/widget/Gird.java @@ -29,8 +29,8 @@ namespace ewol { }; int32_t m_sizeRow; //!< size of all lines (row) (if set (otherwise 0)) == > we have a only one size ==> multiple size will have no use ... int32_t m_uniformSizeRow; - etk::Vector m_sizeCol; //!< size of all colomn (if set (otherwise 0)) - etk::Vector m_subWidget; //!< all sub widget are contained in this element + List m_sizeCol; //!< size of all colomn (if set (otherwise 0)) + List m_subWidget; //!< all sub widget are contained in this element ewol::WidgetShared m_tmpWidget; //!< use when replace a widget ... bool m_gavityButtom; protected: @@ -121,24 +121,24 @@ namespace ewol { virtual void subWidgetUnLink(int32_t _colId, int32_t _rowId); private: // TODO : property - ivec2 m_borderSize; //!< Border size needed for all the display + Vector2i m_borderSize; //!< Border size needed for all the display public: /** * @brief set the current border size of the current element: * @param[in] _newBorderSize The border size to set (0 if not used) */ - void setBorderSize(const ivec2& _newBorderSize); + void setBorderSize(const Vector2i& _newBorderSize); /** * @brief get the current border size of the current element: * @return the border size (0 if not used) */ - const ivec2& getBorderSize() { + const Vector2i& getBorderSize() { return m_borderSize; }; public: virtual void systemDraw(const ewol::DrawProperty& _displayProp) override; virtual void onRegenerateDisplay() override; - virtual ewol::WidgetShared getWidgetAtPos(const vec2& pos) override; + virtual ewol::WidgetShared getWidgetAtPos(const Vector2f& pos) override; virtual void onChangeSize() override; virtual void calculateMinMaxSize() override; }; diff --git a/src/org/atriasoft/ewol/widget/Image.cpp b/src/org/atriasoft/ewol/widget/Image.cpp index 00f4e3b..7509b31 100644 --- a/src/org/atriasoft/ewol/widget/Image.cpp +++ b/src/org/atriasoft/ewol/widget/Image.cpp @@ -16,18 +16,18 @@ ETK_DECLARE_TYPE(ewol::widget::Image); ewol::widget::Image::Image() : signalPressed(this, "pressed", "Image is pressed"), propertySource(this, "src", "", "Image source path", &ewol::widget::Image::onChangePropertySource), - propertyBorder(this, "border", vec2(0,0), "Border of the image", &ewol::widget::Image::onChangePropertyGlobalSize), - propertyImageSize(this, "size", vec2(0,0), "Basic display size of the image", &ewol::widget::Image::onChangePropertyGlobalSize), + propertyBorder(this, "border", Vector2f(0,0), "Border of the image", &ewol::widget::Image::onChangePropertyGlobalSize), + propertyImageSize(this, "size", Vector2f(0,0), "Basic display size of the image", &ewol::widget::Image::onChangePropertyGlobalSize), propertyKeepRatio(this, "ratio", true, "Keep ratio of the image", &ewol::widget::Image::onChangePropertyGlobalSize), - propertyPosStart(this, "part-start", vec2(0.0f, 0.0f), vec2(0.0f, 0.0f), vec2(1.0f, 1.0f), "Start display position in the image", &ewol::widget::Image::onChangePropertyGlobalSize), - propertyPosStop(this, "part-stop", vec2(1.0f, 1.0f), vec2(0.0f, 0.0f), vec2(1.0f, 1.0f), "Start display position in the image", &ewol::widget::Image::onChangePropertyGlobalSize), + propertyPosStart(this, "part-start", Vector2f(0.0f, 0.0f), Vector2f(0.0f, 0.0f), Vector2f(1.0f, 1.0f), "Start display position in the image", &ewol::widget::Image::onChangePropertyGlobalSize), + propertyPosStop(this, "part-stop", Vector2f(1.0f, 1.0f), Vector2f(0.0f, 0.0f), Vector2f(1.0f, 1.0f), "Start display position in the image", &ewol::widget::Image::onChangePropertyGlobalSize), propertyDistanceFieldMode(this, "distance-field", false, "Distance field mode", &ewol::widget::Image::onChangePropertyDistanceFieldMode), propertySmooth(this, "smooth", true, "Smooth display of the image", &ewol::widget::Image::onChangePropertySmooth), propertyUseThemeColor(this, "use-theme-color", false, "use the theme color to display images", &ewol::widget::Image::onChangePropertyUseThemeColor), m_colorProperty(null), m_colorId(-1) { addObjectType("ewol::widget::Image"); - m_imageRenderSize = vec2(0,0); + m_imageRenderSize = Vector2f(0,0); m_colorProperty = ewol::resource::ColorFile::create(etk::Uri("THEME_COLOR:///Image.json?lib=ewol")); if (m_colorProperty != null) { m_colorId = m_colorProperty->request("foreground"); @@ -45,7 +45,7 @@ void ewol::widget::Image::init() { } void ewol::widget::Image::set(const etk::Uri& _uri, const gale::Dimension& _border) { - EWOL_VERBOSE("Set Image : " << _uri << " border=" << _border); + Log.verbose("Set Image : " << _uri << " border=" << _border); propertyBorder.set(_border); propertySource.set(_uri); } @@ -72,16 +72,16 @@ void ewol::widget::Image::onRegenerateDisplay() { m_compositing.setColor(m_colorProperty->get(m_colorId)); } // Calculate the new position and size: - vec2 imageBoder = propertyBorder->getPixel(); - vec2 origin = imageBoder; + Vector2f imageBoder = propertyBorder->getPixel(); + Vector2f origin = imageBoder; imageBoder *= 2.0f; - vec2 imageRealSize = m_imageRenderSize - imageBoder; - vec2 imageRealSizeMax = m_size - imageBoder; + Vector2f imageRealSize = m_imageRenderSize - imageBoder; + Vector2f imageRealSizeMax = m_size - imageBoder; - vec2 ratioSizeDisplayRequested = *propertyPosStop - *propertyPosStart; + Vector2f ratioSizeDisplayRequested = *propertyPosStop - *propertyPosStart; //imageRealSizeMax *= ratioSizeDisplayRequested; - vec2 delta = ewol::gravityGenerateDelta(*propertyGravity, m_size-m_imageRenderSize); + Vector2f delta = ewol::gravityGenerateDelta(*propertyGravity, m_size-m_imageRenderSize); if (propertyFill->x() == true) { imageRealSize.setX(imageRealSizeMax.x()); delta.setX(0.0); @@ -93,7 +93,7 @@ void ewol::widget::Image::onRegenerateDisplay() { origin += delta; if (*propertyKeepRatio == true) { - vec2 tmpSize = m_compositing.getRealSize(); + Vector2f tmpSize = m_compositing.getRealSize(); //float ratio = tmpSize.x() / tmpSize.y(); float ratio = (tmpSize.x()*ratioSizeDisplayRequested.x()) / (tmpSize.y() * ratioSizeDisplayRequested.y()); //float ratioCurrent = (imageRealSize.x()*ratioSizeDisplayRequested.x()) / (imageRealSize.y() * ratioSizeDisplayRequested.y()); @@ -103,11 +103,11 @@ void ewol::widget::Image::onRegenerateDisplay() { } else if (ratio < ratioCurrent) { float oldX = imageRealSize.x(); imageRealSize.setX(imageRealSize.y()*ratio); - origin += vec2((oldX - imageRealSize.x()) * 0.5f, 0); + origin += Vector2f((oldX - imageRealSize.x()) * 0.5f, 0); } else { float oldY = imageRealSize.y(); imageRealSize.setY(imageRealSize.x()/ratio); - origin += vec2(0, (oldY - imageRealSize.y()) * 0.5f); + origin += Vector2f(0, (oldY - imageRealSize.y()) * 0.5f); } } @@ -115,44 +115,44 @@ void ewol::widget::Image::onRegenerateDisplay() { if (*propertySmooth == true) { m_compositing.setPos(origin); } else { - m_compositing.setPos(ivec2(origin)); + m_compositing.setPos(Vector2i(origin)); } m_compositing.printPart(imageRealSize, *propertyPosStart, *propertyPosStop); - EWOL_DEBUG("Paint Image at : " << origin << " size=" << imageRealSize); - EWOL_DEBUG("Paint Image :" << *propertySource << " realsize=" << m_compositing.getRealSize() << " origin=" << origin << " size=" << imageRealSize); - EWOL_DEBUG(" start=" << *propertyPosStart << " stop=" << *propertyPosStop); + Log.debug("Paint Image at : " << origin << " size=" << imageRealSize); + Log.debug("Paint Image :" << *propertySource << " realsize=" << m_compositing.getRealSize() << " origin=" << origin << " size=" << imageRealSize); + Log.debug(" start=" << *propertyPosStart << " stop=" << *propertyPosStop); } void ewol::widget::Image::calculateMinMaxSize() { - EWOL_DEBUG("calculate min size: border=" << propertyBorder << " size=" << propertyImageSize << " min-size=" << propertyMinSize); - vec2 imageBoder = propertyBorder->getPixel()*2.0f; - vec2 imageSize = propertyImageSize->getPixel(); - vec2 size = propertyMinSize->getPixel(); - EWOL_DEBUG(" ==> border=" << imageBoder << " size=" << imageSize << " min-size=" << size); - if (imageSize != vec2(0,0)) { + Log.debug("calculate min size: border=" << propertyBorder << " size=" << propertyImageSize << " min-size=" << propertyMinSize); + Vector2f imageBoder = propertyBorder->getPixel()*2.0f; + Vector2f imageSize = propertyImageSize->getPixel(); + Vector2f size = propertyMinSize->getPixel(); + Log.debug(" ==> border=" << imageBoder << " size=" << imageSize << " min-size=" << size); + if (imageSize != Vector2f(0,0)) { m_minSize = imageBoder+imageSize; m_maxSize = m_minSize; } else { - vec2 imageSizeReal = m_compositing.getRealSize(); - EWOL_VERBOSE(" Real Size = " << imageSizeReal); - vec2 min1 = imageBoder+propertyMinSize->getPixel(); + Vector2f imageSizeReal = m_compositing.getRealSize(); + Log.verbose(" Real Size = " << imageSizeReal); + Vector2f min1 = imageBoder+propertyMinSize->getPixel(); m_minSize = imageBoder+imageSizeReal; - EWOL_VERBOSE(" set max : " << m_minSize << " min1=" << min1); + Log.verbose(" set max : " << m_minSize << " min1=" << min1); m_minSize.setMax(min1); - EWOL_VERBOSE(" result : " << m_minSize); + Log.verbose(" result : " << m_minSize); m_maxSize = imageBoder+propertyMaxSize->getPixel(); m_minSize.setMin(m_maxSize); } m_imageRenderSize = m_minSize; m_minSize.setMax(size); m_maxSize.setMax(m_minSize); - EWOL_DEBUG("set widget min=" << m_minSize << " max=" << m_maxSize << " with real Image size=" << m_imageRenderSize << " img size=" << imageSize << " " << propertyImageSize); + Log.debug("set widget min=" << m_minSize << " max=" << m_maxSize << " with real Image size=" << m_imageRenderSize << " img size=" << imageSize << " " << propertyImageSize); markToRedraw(); } bool ewol::widget::Image::onEventInput(const ewol::event::Input& _event) { - //EWOL_DEBUG("Event on BT ..."); + //Log.debug("Event on BT ..."); if (_event.getId() == 1) { if(gale::key::status::pressSingle == _event.getStatus()) { signalPressed.emit(); @@ -181,9 +181,9 @@ bool ewol::widget::Image::loadXML(const exml::Element& _node) { } tmpAttributeValue = _node.attributes["size"]; if (tmpAttributeValue.size() != 0) { - //EWOL_CRITICAL(" Parse SIZE : " << tmpAttributeValue); + //Log.critical(" Parse SIZE : " << tmpAttributeValue); propertyImageSize.setDirect(tmpAttributeValue); - //EWOL_CRITICAL(" == > " << propertyImageSize); + //Log.critical(" == > " << propertyImageSize); } tmpAttributeValue = _node.attributes["border"]; if (tmpAttributeValue.size() != 0) { @@ -193,7 +193,7 @@ bool ewol::widget::Image::loadXML(const exml::Element& _node) { if (tmpAttributeValue.size() != 0) { propertySmooth.setDirect(etk::string_to_bool(tmpAttributeValue)); } - //EWOL_DEBUG("Load label:" << node->ToElement()->getText()); + //Log.debug("Load label:" << node->ToElement()->getText()); if (_node.nodes.size() != 0) { propertySource.set(_node.getText()); } else { @@ -208,14 +208,14 @@ bool ewol::widget::Image::loadXML(const exml::Element& _node) { void ewol::widget::Image::onChangePropertySource() { markToRedraw(); requestUpdateSize(); - EWOL_VERBOSE("Set sources : " << *propertySource << " size=" << *propertyImageSize); + Log.verbose("Set sources : " << *propertySource << " size=" << *propertyImageSize); m_compositing.setSource(*propertySource, propertyImageSize->getPixel()); } void ewol::widget::Image::onChangePropertyImageSize() { markToRedraw(); requestUpdateSize(); - EWOL_VERBOSE("Set sources : " << *propertySource << " size=" << *propertyImageSize); + Log.verbose("Set sources : " << *propertySource << " size=" << *propertyImageSize); m_compositing.setSource(*propertySource, propertyImageSize->getPixel()); } diff --git a/src/org/atriasoft/ewol/widget/Image.java b/src/org/atriasoft/ewol/widget/Image.java index e0920c9..0247fb5 100644 --- a/src/org/atriasoft/ewol/widget/Image.java +++ b/src/org/atriasoft/ewol/widget/Image.java @@ -29,8 +29,8 @@ namespace ewol { eproperty::Value propertyBorder; //!< border to add at the image. eproperty::Value propertyImageSize; //!< border to add at the image. eproperty::Value propertyKeepRatio; //!< keep the image ratio between width and hight - eproperty::Range propertyPosStart; //!< position in the image to start the sisplay (when we want not to display all the image) - eproperty::Range propertyPosStop; //!< position in the image to start the sisplay (when we want not to display all the image) + eproperty::Range propertyPosStart; //!< position in the image to start the sisplay (when we want not to display all the image) + eproperty::Range propertyPosStop; //!< position in the image to start the sisplay (when we want not to display all the image) eproperty::Value propertyDistanceFieldMode; //!< to have a parameter eproperty::Value propertySmooth; //!< display is done in the pixed approximation if false eproperty::Value propertyUseThemeColor; //!< Use the themo color management ("THEME_COLOR:///Image.json?lib=ewol") default false @@ -62,7 +62,7 @@ namespace ewol { */ void setCustumSource(const egami::Image& _image); protected: - vec2 m_imageRenderSize; //!< size of the image when we render it + Vector2f m_imageRenderSize; //!< size of the image when we render it protected: void onDraw() override; public: diff --git a/src/org/atriasoft/ewol/widget/Joystick.cpp b/src/org/atriasoft/ewol/widget/Joystick.cpp index d93b2f0..d00e731 100644 --- a/src/org/atriasoft/ewol/widget/Joystick.cpp +++ b/src/org/atriasoft/ewol/widget/Joystick.cpp @@ -105,7 +105,7 @@ bool ewol::widget::Joystick::onEventInput(const ewol::event::Input& _event) { if( gale::key::status::down == typeEvent || gale::key::status::move == typeEvent) { // get local relative position - vec2 relativePos = relativePosition(pos); + Vector2f 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; @@ -135,7 +135,7 @@ bool ewol::widget::Joystick::onEventInput(const ewol::event::Input& _event) { signalMove.emit(m_angle+M_PI/2); } //teta += M_PI/2; - //EWOL_DEBUG("TETA = " << (m_angle*180/M_PI) << " deg distance = " << m_distance); + //Log.debug("TETA = " << (m_angle*180/M_PI) << " deg distance = " << m_distance); return true; } else if( gale::key::status::up == typeEvent) { if( true == m_lock @@ -163,7 +163,7 @@ void ewol::widget::Joystick::ratio(float _newRatio) { _newRatio = 1; } m_ratio = _newRatio; - EWOL_INFO("Set default Joystick ratio at " << m_ratio); + Log.info("Set default Joystick ratio at " << m_ratio); } @@ -171,14 +171,14 @@ void ewol::widget::Joystick::background(etk::String _imageNameInData, bool _disp // TODO : check if it existed m_background = _imageNameInData; m_displayBackground = _display; - EWOL_INFO("Set default Joystick background at " << m_background << " display it=" << m_displayBackground); + Log.info("Set default Joystick background at " << m_background << " display it=" << m_displayBackground); } void ewol::widget::Joystick::foreground(etk::String imageNameInData) { // TODO : check if it existed m_foreground = imageNameInData; - EWOL_INFO("Set default Joystick Foreground at " << m_foreground); + Log.info("Set default Joystick Foreground at " << m_foreground); } diff --git a/src/org/atriasoft/ewol/widget/Joystick.java b/src/org/atriasoft/ewol/widget/Joystick.java index bba67c5..1917771 100644 --- a/src/org/atriasoft/ewol/widget/Joystick.java +++ b/src/org/atriasoft/ewol/widget/Joystick.java @@ -26,7 +26,7 @@ namespace ewol { // Event list of properties esignal::Signal<> signalEnable; esignal::Signal<> signalDisable; - esignal::Signal signalMove; + esignal::Signal signalMove; public: enum joystickMode { modeNormal, @@ -35,7 +35,7 @@ namespace ewol { private: etk::Color<> m_colorFg; //!< Forground color etk::Color<> m_colorBg; //!< Background color - vec2 m_displayPos; //!< direction of the cursor ... + Vector2f 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 diff --git a/src/org/atriasoft/ewol/widget/Label.cpp b/src/org/atriasoft/ewol/widget/Label.cpp index f068bb4..7c04897 100644 --- a/src/org/atriasoft/ewol/widget/Label.cpp +++ b/src/org/atriasoft/ewol/widget/Label.cpp @@ -53,19 +53,19 @@ void ewol::widget::Label::init() { void ewol::widget::Label::calculateMinMaxSize() { - vec2 tmpMax = propertyMaxSize->getPixel(); - vec2 tmpMin = propertyMinSize->getPixel(); - //EWOL_DEBUG("[" << getId() << "] {" << getObjectType() << "} tmpMax : " << tmpMax); + Vector2f tmpMax = propertyMaxSize->getPixel(); + Vector2f tmpMin = propertyMinSize->getPixel(); + //Log.debug("[" << getId() << "] {" << getObjectType() << "} tmpMax : " << tmpMax); if (tmpMax.x() <= 999999) { m_text.setTextAlignement(0, tmpMax.x()-4, ewol::compositing::alignLeft); - //EWOL_DEBUG("[" << getId() << "] {" << getObjectType() << "} forcez Alignement "); + //Log.debug("[" << getId() << "] {" << getObjectType() << "} forcez Alignement "); } - vec3 minSize = m_text.calculateSizeDecorated(m_value); - //EWOL_DEBUG("[" << getId() << "] {" << getObjectType() << "} minSize : " << minSize); + Vector3f minSize = m_text.calculateSizeDecorated(m_value); + //Log.debug("[" << getId() << "] {" << getObjectType() << "} minSize : " << minSize); m_minSize.setX(etk::avg(tmpMin.x(), 4 + minSize.x(), tmpMax.x())); m_minSize.setY(etk::avg(tmpMin.y(), 4 + minSize.y(), tmpMax.y())); - EWOL_VERBOSE("[" << getId() << "] {" << getObjectType() << "} Result min size : " << tmpMin << " < " << m_minSize << " < " << tmpMax); + Log.verbose("[" << getId() << "] {" << getObjectType() << "} Result min size : " << tmpMin << " < " << m_minSize << " < " << tmpMax); } void ewol::widget::Label::onDraw() { @@ -79,21 +79,21 @@ void ewol::widget::Label::onRegenerateDisplay() { m_text.clear(); int32_t paddingSize = 2; - vec2 tmpMax = propertyMaxSize->getPixel(); + Vector2f tmpMax = propertyMaxSize->getPixel(); // to know the size of one line : - vec3 minSize = m_text.calculateSize(char32_t('A')); + Vector3f minSize = m_text.calculateSize(char32_t('A')); //minSize.setX(etk::max(minSize.x(), m_minSize.x())); //minSize.setY(etk::max(minSize.y(), m_minSize.y())); if (tmpMax.x() <= 999999) { m_text.setTextAlignement(0, tmpMax.x()-2*paddingSize, ewol::compositing::alignLeft); } - vec3 curentTextSize = m_text.calculateSizeDecorated(m_value); + Vector3f curentTextSize = m_text.calculateSizeDecorated(m_value); - ivec2 localSize = m_minSize; + Vector2i localSize = m_minSize; // no change for the text orogin : - vec3 tmpTextOrigin((m_size.x() - m_minSize.x()) / 2.0, + Vector3f tmpTextOrigin((m_size.x() - m_minSize.x()) / 2.0, (m_size.y() - m_minSize.y()) / 2.0, 0); @@ -105,15 +105,15 @@ void ewol::widget::Label::onRegenerateDisplay() { localSize.setY(m_size.y()); tmpTextOrigin.setY(m_size.y() - 2*paddingSize - curentTextSize.y()); } - tmpTextOrigin += vec3(paddingSize, paddingSize, 0); - localSize -= vec2(2*paddingSize,2*paddingSize); + tmpTextOrigin += Vector3f(paddingSize, paddingSize, 0); + localSize -= Vector2f(2*paddingSize,2*paddingSize); tmpTextOrigin.setY( tmpTextOrigin.y() + (m_minSize.y()-2*paddingSize) - minSize.y()); - vec2 textPos(tmpTextOrigin.x(), tmpTextOrigin.y()); + Vector2f textPos(tmpTextOrigin.x(), tmpTextOrigin.y()); - vec3 drawClippingPos(paddingSize, paddingSize, -0.5); - vec3 drawClippingSize((m_size.x() - paddingSize), + Vector3f drawClippingPos(paddingSize, paddingSize, -0.5); + Vector3f drawClippingSize((m_size.x() - paddingSize), (m_size.y() - paddingSize), 1); @@ -127,14 +127,14 @@ void ewol::widget::Label::onRegenerateDisplay() { m_text.setDefaultColorBg(m_colorProperty->get(m_colorDefaultBgText)); } m_text.setPos(tmpTextOrigin); - EWOL_VERBOSE("[" << getId() << "] {" << m_value << "} display at pos : " << tmpTextOrigin); + Log.verbose("[" << getId() << "] {" << m_value << "} display at pos : " << tmpTextOrigin); m_text.setTextAlignement(tmpTextOrigin.x(), tmpTextOrigin.x()+localSize.x(), ewol::compositing::alignLeft); m_text.setClipping(drawClippingPos, drawClippingSize); m_text.printDecorated(m_value); } bool ewol::widget::Label::onEventInput(const ewol::event::Input& _event) { - //EWOL_DEBUG("Event on Label ..."); + //Log.debug("Event on Label ..."); if (_event.getId() == 1) { if (gale::key::status::pressSingle == _event.getStatus()) { // nothing to do ... @@ -151,7 +151,7 @@ bool ewol::widget::Label::loadXML(const exml::Element& _node) { } ewol::Widget::loadXML(_node); // get internal data : - EWOL_DEBUG("Load label:" << _node.getText()); + Log.debug("Load label:" << _node.getText()); propertyValue.set(_node.getText()); return true; } diff --git a/src/org/atriasoft/ewol/widget/Layer.cpp b/src/org/atriasoft/ewol/widget/Layer.cpp index d9a1cc9..03df151 100644 --- a/src/org/atriasoft/ewol/widget/Layer.cpp +++ b/src/org/atriasoft/ewol/widget/Layer.cpp @@ -15,10 +15,10 @@ ewol::widget::Layer::Layer() { } ewol::widget::Layer::~Layer() { - EWOL_DEBUG("[" << getId() << "] Layer : destroy"); + Log.debug("[" << getId() << "] Layer : destroy"); } -ewol::WidgetShared ewol::widget::Layer::getWidgetAtPos(const vec2& _pos) { +ewol::WidgetShared ewol::widget::Layer::getWidgetAtPos(const Vector2f& _pos) { if (*propertyHide == true) { return null; } @@ -27,8 +27,8 @@ ewol::WidgetShared ewol::widget::Layer::getWidgetAtPos(const vec2& _pos) { if (it == null) { continue; } - vec2 tmpSize = it->getSize(); - vec2 tmpOrigin = it->getOrigin(); + Vector2f tmpSize = it->getSize(); + Vector2f tmpOrigin = it->getOrigin(); if( (tmpOrigin.x() <= _pos.x() && tmpOrigin.x() + tmpSize.x() >= _pos.x()) && (tmpOrigin.y() <= _pos.y() && tmpOrigin.y() + tmpSize.y() >= _pos.y()) ) { ewol::WidgetShared tmpWidget = it->getWidgetAtPos(_pos); diff --git a/src/org/atriasoft/ewol/widget/Layer.java b/src/org/atriasoft/ewol/widget/Layer.java index c5faf91..c137306 100644 --- a/src/org/atriasoft/ewol/widget/Layer.java +++ b/src/org/atriasoft/ewol/widget/Layer.java @@ -31,7 +31,7 @@ namespace ewol { */ virtual ~Layer(); public: - ewol::WidgetShared getWidgetAtPos(const vec2& _pos) override; + ewol::WidgetShared getWidgetAtPos(const Vector2f& _pos) override; }; }; }; diff --git a/src/org/atriasoft/ewol/widget/List.cpp b/src/org/atriasoft/ewol/widget/List.cpp index c4dff93..1635fe2 100644 --- a/src/org/atriasoft/ewol/widget/List.cpp +++ b/src/org/atriasoft/ewol/widget/List.cpp @@ -23,7 +23,7 @@ ewol::widget::List::List() { #endif m_nbVisibleRaw = 0; propertyCanFocus.setDirectCheck(true); - m_limitScrolling = vec2(1, 0.5); + m_limitScrolling = Vector2f(1, 0.5); } @@ -57,7 +57,7 @@ ememory::SharedPtr ewol::widget::List::getComposeElemnent(con } /* void ewol::widget::List::setRawVisible(int32_t _id) { - EWOL_DEBUG("Set Raw visible : " << _id); + Log.debug("Set Raw visible : " << _id); if (_id<0) { return; } @@ -72,14 +72,14 @@ void ewol::widget::List::setRawVisible(int32_t _id) { m_displayStartRaw = _id - m_nbVisibleRaw + 2; } } - ivec2 matrixSize = getMatrixSize(); + Vector2i matrixSize = getMatrixSize(); if (m_displayStartRaw > matrixSize.y()) { m_displayStartRaw = matrixSize.y()-2; } if (m_displayStartRaw<0) { m_displayStartRaw = 0; } - EWOL_DEBUG("Set start raw : " << m_displayStartRaw); + Log.debug("Set start raw : " << m_displayStartRaw); markToRedraw(); } */ @@ -110,15 +110,15 @@ void ewol::widget::List::onRegenerateDisplay() { // ------------------------------------------------------- // -- Calculate the size of each element // ------------------------------------------------------- - ivec2 matrixSize = getMatrixSize(); + Vector2i matrixSize = getMatrixSize(); m_listSizeX.clear(); m_listSizeX.resize(matrixSize.x(), 0); m_listSizeY.clear(); m_listSizeY.resize(matrixSize.y(), 0); for (int_t yyy=0; yyy m_listSizeX[xxx]) { m_listSizeX[xxx] = elementSize.x(); } @@ -165,8 +165,8 @@ void ewol::widget::List::onRegenerateDisplay() { // ------------------------------------------------------- // -- Calculate the start position size of each element // ------------------------------------------------------- - etk::Vector listStartPosX; - etk::Vector listStartPosY; + List listStartPosX; + List listStartPosY; int32_t lastPositionX = 0; for (auto &size: m_listSizeX) { listStartPosX.pushBack(lastPositionX); @@ -180,7 +180,7 @@ void ewol::widget::List::onRegenerateDisplay() { // ------------------------------------------------------- // -- Update the scroolBar // ------------------------------------------------------- - m_maxSize = ivec2(lastPositionX, lastPositionY); + m_maxSize = Vector2i(lastPositionX, lastPositionY); // ------------------------------------------------------- // -- Clean the background // ------------------------------------------------------- @@ -200,7 +200,7 @@ void ewol::widget::List::onRegenerateDisplay() { } for (int_t xxx=0; xxx element out of range ==> nothing to display continue; @@ -209,9 +209,9 @@ void ewol::widget::List::onRegenerateDisplay() { // ==> element out of range ==> nothing to display break; } - drawElement(ivec2(xxx, yyy), - vec2(startXposition, startYposition), - vec2(m_listSizeX[xxx], m_listSizeY[yyy])); + drawElement(Vector2i(xxx, yyy), + Vector2f(startXposition, startYposition), + Vector2f(m_listSizeX[xxx], m_listSizeY[yyy])); } } // ------------------------------------------------------- @@ -221,16 +221,16 @@ void ewol::widget::List::onRegenerateDisplay() { } } -ivec2 ewol::widget::List::getMatrixSize() const { - return ivec2(1,0); +Vector2i ewol::widget::List::getMatrixSize() const { + return Vector2i(1,0); } -vec2 ewol::widget::List::calculateElementSize(const ivec2& _pos) { +Vector2f ewol::widget::List::calculateElementSize(const Vector2i& _pos) { auto tmpText = ememory::staticPointerCast(getComposeElemnent("text")); etk::String myTextToWrite = getData(ListRole::Text, _pos).getSafeString(); - vec3 textSize = tmpText->calculateSize(myTextToWrite); - ivec2 count = getMatrixSize(); - return vec2(textSize.x(), + Vector3f textSize = tmpText->calculateSize(myTextToWrite); + Vector2i count = getMatrixSize(); + return Vector2f(textSize.x(), textSize.y() + m_paddingSizeY*3 ); } @@ -240,12 +240,12 @@ void ewol::widget::List::drawBackground() { if (BGOObjects != null) { etk::Color<> basicBG = getBasicBG(); BGOObjects->setColor(basicBG); - BGOObjects->setPos(vec3(0, 0, 0) ); + BGOObjects->setPos(Vector3f(0, 0, 0) ); BGOObjects->rectangleWidth(m_size); } } -void ewol::widget::List::drawElement(const ivec2& _pos, const vec2& _start, const vec2& _size) { +void ewol::widget::List::drawElement(const Vector2i& _pos, const Vector2f& _start, const Vector2f& _size) { etk::String myTextToWrite = getData(ListRole::Text, _pos).getSafeString(); etk::Color<> fg = getData(ListRole::FgColor, _pos).getSafeColor(); auto backgroundVariant = getData(ListRole::BgColor, _pos); @@ -254,7 +254,7 @@ void ewol::widget::List::drawElement(const ivec2& _pos, const vec2& _start, cons auto BGOObjects = ememory::staticPointerCast(getComposeElemnent("drawing")); if (BGOObjects != null) { BGOObjects->setColor(bg); - BGOObjects->setPos(vec3(_start.x(), _start.y(), 0) ); + BGOObjects->setPos(Vector3f(_start.x(), _start.y(), 0) ); BGOObjects->rectangleWidth(_size); } } @@ -263,14 +263,14 @@ void ewol::widget::List::drawElement(const ivec2& _pos, const vec2& _start, cons if (tmpText != null) { int32_t displayPositionY = _start.y() + m_paddingSizeY; tmpText->setColor(fg); - tmpText->setPos(vec3(_start.x() + m_paddingSizeX, displayPositionY, 0) ); + tmpText->setPos(Vector3f(_start.x() + m_paddingSizeX, displayPositionY, 0) ); tmpText->print(myTextToWrite);; } } } bool ewol::widget::List::onEventInput(const ewol::event::Input& _event) { - vec2 relativePos = relativePosition(_event.getPos()); + Vector2f relativePos = relativePosition(_event.getPos()); if (WidgetScrolled::onEventInput(_event) == true) { keepFocus(); // nothing to do ... done on upper widet ... @@ -279,9 +279,9 @@ bool ewol::widget::List::onEventInput(const ewol::event::Input& _event) { if (m_listSizeY.size() == 0) { return false; } - relativePos = vec2(relativePos.x(),m_size.y() - relativePos.y()) + m_originScrooled; + relativePos = Vector2f(relativePos.x(),m_size.y() - relativePos.y()) + m_originScrooled; // Find the colomn and the row - ivec2 pos{0,0}; + Vector2i pos{0,0}; float_t offsetY = 0; for (size_t iii=0; iii> m_listOObject; //!< generic element to display... - etk::Vector m_listSizeX; //!< size of every colomns - etk::Vector m_listSizeY; //!< size of every rows + List> m_listOObject; //!< generic element to display... + List m_listSizeX; //!< size of every colomns + List m_listSizeY; //!< size of every rows protected: etk::Map> m_compositingElements; void addComposeElemnent(const etk::String& _name, const ememory::SharedPtr& _element); @@ -73,9 +73,9 @@ namespace ewol { * @brief Get the number of colomn and row availlable in the list * @return Number of colomn and row */ - virtual ivec2 getMatrixSize() const; + virtual Vector2i getMatrixSize() const; - virtual fluorine::Variant getData(int32_t _role, const ivec2& _pos) { + virtual fluorine::Variant getData(int32_t _role, const Vector2i& _pos) { switch (_role) { case ListRole::Text: return ""; @@ -95,7 +95,7 @@ namespace ewol { * @param[in] _pos Position of colomn and Raw of the element. * @return The estimate size of the element. */ - virtual vec2 calculateElementSize(const ivec2& _pos); + virtual Vector2f calculateElementSize(const Vector2i& _pos); /** * @brief Draw an element in the specific size and position. * @param[in] _pos Position of colomn and Raw of the element. @@ -103,13 +103,13 @@ namespace ewol { * @param[in] _size Render raw size * @return The estimate size of the element. */ - virtual void drawElement(const ivec2& _pos, const vec2& _start, const vec2& _size); + virtual void drawElement(const Vector2i& _pos, const Vector2f& _start, const Vector2f& _size); /** * @brief Draw the background */ virtual void drawBackground(); - virtual bool onItemEvent(const ewol::event::Input& _event, const ivec2& _pos, const vec2& _mousePosition) { + virtual bool onItemEvent(const ewol::event::Input& _event, const Vector2i& _pos, const Vector2f& _mousePosition) { return false; } /** diff --git a/src/org/atriasoft/ewol/widget/ListFileSystem.cpp b/src/org/atriasoft/ewol/widget/ListFileSystem.cpp index d8df3b2..959fcd0 100644 --- a/src/org/atriasoft/ewol/widget/ListFileSystem.cpp +++ b/src/org/atriasoft/ewol/widget/ListFileSystem.cpp @@ -87,7 +87,7 @@ void ewol::widget::ListFileSystem::regenerateView() { flags |= etk::path::LIST_FILE; } m_list = etk::path::list(*propertyPath, flags); - EWOL_ERROR("Lsit of element: " << m_list.size() ); + Log.error("Lsit of element: " << m_list.size() ); // Sort the list: etk::algorithm::quickSort(m_list, localSort); // request a redraw ... @@ -117,7 +117,7 @@ void ewol::widget::ListFileSystem::setSelect(const etk::Path& _data) { markToRedraw(); } -ivec2 ewol::widget::ListFileSystem::getMatrixSize() const { +Vector2i ewol::widget::ListFileSystem::getMatrixSize() const { int32_t offset = 0; if (*propertyShowFolder == true) { if (propertyPath.get() == "/") { @@ -126,10 +126,10 @@ ivec2 ewol::widget::ListFileSystem::getMatrixSize() const { offset = 2; } } - return ivec2(1, m_list.size() + offset); + return Vector2i(1, m_list.size() + offset); } -fluorine::Variant ewol::widget::ListFileSystem::getData(int32_t _role, const ivec2& _pos) { +fluorine::Variant ewol::widget::ListFileSystem::getData(int32_t _role, const Vector2i& _pos) { switch (_role) { case ListRole::Text: { @@ -149,7 +149,7 @@ fluorine::Variant ewol::widget::ListFileSystem::getData(int32_t _role, const ive } if( _pos.y()-offset >= 0 && _pos.y()-offset < (int32_t)m_list.size()) { - EWOL_VERBOSE("get filename for : '" << m_list[_pos.y()-offset] << ":'" << m_list[_pos.y()-offset].getFileName() << "'"); + Log.verbose("get filename for : '" << m_list[_pos.y()-offset] << ":'" << m_list[_pos.y()-offset].getFileName() << "'"); return m_list[_pos.y()-offset].getFileName(); } } @@ -169,8 +169,8 @@ fluorine::Variant ewol::widget::ListFileSystem::getData(int32_t _role, const ive } bool ewol::widget::ListFileSystem::onItemEvent(const ewol::event::Input& _event, - const ivec2& _pos, - const vec2& _mousePosition) { + const Vector2i& _pos, + const Vector2f& _mousePosition) { int32_t offset = 0; if (*propertyShowFolder == true) { if (*propertyPath == "/") { @@ -181,7 +181,7 @@ bool ewol::widget::ListFileSystem::onItemEvent(const ewol::event::Input& _event, } if ( _event.getStatus() == gale::key::status::pressSingle || _event.getStatus() == gale::key::status::pressDouble) { - EWOL_VERBOSE("Event on List : IdInput=" << _event.getId() << " _pos=" << _pos ); + Log.verbose("Event on List : IdInput=" << _event.getId() << " _pos=" << _pos ); if (1 == _event.getId()) { if (_pos.y() > (int32_t)m_list.size()+offset ) { m_selectedLine = -1; diff --git a/src/org/atriasoft/ewol/widget/ListFileSystem.java b/src/org/atriasoft/ewol/widget/ListFileSystem.java index 430e279..03d21bb 100644 --- a/src/org/atriasoft/ewol/widget/ListFileSystem.java +++ b/src/org/atriasoft/ewol/widget/ListFileSystem.java @@ -43,11 +43,11 @@ namespace ewol { int32_t m_colorIdBackgroundSelected; //!< Color of line selected. protected: etk::Color<> getBasicBG() override; - ivec2 getMatrixSize() const override; - fluorine::Variant getData(int32_t _role, const ivec2& _pos) override; - bool onItemEvent(const ewol::event::Input& _event, const ivec2& _pos, const vec2& _mousePosition) override; + Vector2i getMatrixSize() const override; + fluorine::Variant getData(int32_t _role, const Vector2i& _pos) override; + bool onItemEvent(const ewol::event::Input& _event, const Vector2i& _pos, const Vector2f& _mousePosition) override; protected: - etk::Vector m_list; //!< List of all element in the path. (they are filtered) + List m_list; //!< List of all element in the path. (they are filtered) /** * @brief Clean the list of element. */ diff --git a/src/org/atriasoft/ewol/widget/Manager.cpp b/src/org/atriasoft/ewol/widget/Manager.cpp index 9bb0271..f9da32b 100644 --- a/src/org/atriasoft/ewol/widget/Manager.cpp +++ b/src/org/atriasoft/ewol/widget/Manager.cpp @@ -37,7 +37,7 @@ ewol::widget::Manager::Manager() : m_creatorList(0, false), m_creatorListXml(0, false), m_haveRedraw(true) { - EWOL_DEBUG(" == > init Widget-Manager"); + Log.debug(" == > init Widget-Manager"); ewol::widget::Button::createManagerWidget(*this); ewol::widget::ButtonColor::createManagerWidget(*this); @@ -63,8 +63,8 @@ ewol::widget::Manager::Manager() : } ewol::widget::Manager::~Manager() { - EWOL_DEBUG(" == > Un-Init Widget-Manager"); - EWOL_INFO("Realease all FOCUS"); + Log.debug(" == > Un-Init Widget-Manager"); + Log.info("Realease all FOCUS"); focusSetDefault(null); focusRelease(); @@ -80,7 +80,7 @@ void ewol::widget::Manager::focusKeep(ewol::WidgetShared _newWidget) { // nothing to do ... return; } - EWOL_DEBUG("focusKeep=" << _newWidget->getId() ); + Log.debug("focusKeep=" << _newWidget->getId() ); //elog::displayBacktrace(); auto focusWidgetCurrent = m_focusWidgetCurrent.lock(); if (_newWidget == focusWidgetCurrent) { @@ -88,17 +88,17 @@ void ewol::widget::Manager::focusKeep(ewol::WidgetShared _newWidget) { return; } if (focusWidgetCurrent != null) { - EWOL_DEBUG("Rm focus on WidgetID=" << focusWidgetCurrent->getId() ); + Log.debug("Rm focus on WidgetID=" << focusWidgetCurrent->getId() ); focusWidgetCurrent->rmFocus(); focusWidgetCurrent.reset(); } if (_newWidget->propertyCanFocus.get() == false) { - EWOL_DEBUG("Widget can not have focus, id=" << _newWidget->getId() ); + Log.debug("Widget can not have focus, id=" << _newWidget->getId() ); return; } m_focusWidgetCurrent = _newWidget; if (_newWidget != null) { - EWOL_DEBUG("Set focus on WidgetID=" << _newWidget->getId() ); + Log.debug("Set focus on WidgetID=" << _newWidget->getId() ); _newWidget->setFocus(); } } @@ -106,19 +106,19 @@ void ewol::widget::Manager::focusKeep(ewol::WidgetShared _newWidget) { void ewol::widget::Manager::focusSetDefault(ewol::WidgetShared _newWidget) { if( _newWidget != null && _newWidget->propertyCanFocus.get() == false) { - EWOL_VERBOSE("Widget can not have focus, id=" << _newWidget->getId() ); + Log.verbose("Widget can not have focus, id=" << _newWidget->getId() ); return; } ewol::WidgetShared focusWidgetDefault = m_focusWidgetDefault.lock(); ewol::WidgetShared focusWidgetCurrent = m_focusWidgetCurrent.lock(); if (focusWidgetDefault == focusWidgetCurrent) { if (focusWidgetCurrent != null) { - EWOL_DEBUG("Rm focus on WidgetID=" << focusWidgetCurrent->getId() ); + Log.debug("Rm focus on WidgetID=" << focusWidgetCurrent->getId() ); focusWidgetCurrent->rmFocus(); } m_focusWidgetCurrent = _newWidget; if (_newWidget != null) { - EWOL_DEBUG("Set focus on WidgetID=" << _newWidget->getId() ); + Log.debug("Set focus on WidgetID=" << _newWidget->getId() ); _newWidget->setFocus(); } } @@ -133,13 +133,13 @@ void ewol::widget::Manager::focusRelease() { return; } if (focusWidgetCurrent != null) { - EWOL_DEBUG("Rm focus on WidgetID=" << focusWidgetCurrent->getId() ); + Log.debug("Rm focus on WidgetID=" << focusWidgetCurrent->getId() ); focusWidgetCurrent->rmFocus(); } m_focusWidgetCurrent = m_focusWidgetDefault; focusWidgetCurrent = m_focusWidgetCurrent.lock(); if (focusWidgetCurrent != null) { - EWOL_DEBUG("Set focus on WidgetID=" << focusWidgetCurrent->getId() ); + Log.debug("Set focus on WidgetID=" << focusWidgetCurrent->getId() ); focusWidgetCurrent->setFocus(); } } @@ -198,7 +198,7 @@ void ewol::widget::Manager::addWidgetCreator(const etk::String& _name, if (find == true) { return; } - EWOL_INFO("Add Creator of a specify widget : " << nameLower); + Log.info("Add Creator of a specify widget : " << nameLower); m_creatorList.set(nameLower, _pointer); m_creatorListXml.set(nameLower, _pointerXml); } diff --git a/src/org/atriasoft/ewol/widget/Menu.cpp b/src/org/atriasoft/ewol/widget/Menu.cpp index e878f7b..81f962d 100644 --- a/src/org/atriasoft/ewol/widget/Menu.cpp +++ b/src/org/atriasoft/ewol/widget/Menu.cpp @@ -20,7 +20,7 @@ ewol::widget::Menu::Menu() : signalSelect(this, "select", "") { addObjectType("ewol::widget::Menu"); m_staticId = 666; - propertyLockExpand.setDirect(bvec2(true,true)); + propertyLockExpand.setDirect(Vector2b(true,true)); } ewol::widget::Menu::~Menu() { @@ -33,16 +33,16 @@ void ewol::widget::Menu::subWidgetRemoveAll() { } int32_t ewol::widget::Menu::subWidgetAdd(ewol::WidgetShared _newWidget) { - EWOL_ERROR("Not availlable"); + Log.error("Not availlable"); return -1; } void ewol::widget::Menu::subWidgetRemove(ewol::WidgetShared _newWidget) { - EWOL_ERROR("Not availlable"); + Log.error("Not availlable"); } void ewol::widget::Menu::subWidgetUnLink(ewol::WidgetShared _newWidget) { - EWOL_ERROR("Not availlable"); + Log.error("Not availlable"); } void ewol::widget::Menu::clear() { @@ -84,7 +84,7 @@ int32_t ewol::widget::Menu::add(int32_t _parent, if (tmpObject.m_parentId == -1) { ewol::widget::ButtonShared myButton = ewol::widget::Button::create(); if (myButton == null) { - EWOL_ERROR("Allocation button error"); + Log.error("Allocation button error"); return tmpObject.m_localId; } if (tmpObject.m_image.size()!=0) { @@ -113,7 +113,7 @@ int32_t ewol::widget::Menu::add(int32_t _parent, } void ewol::widget::Menu::remove(int32_t _id) { - EWOL_TODO("NOT remove..."); + Log.todo("NOT remove..."); } @@ -127,13 +127,13 @@ int32_t ewol::widget::Menu::addSpacer(int32_t _parent) { if (tmpObject.m_parentId == -1) { ewol::widget::SpacerShared mySpacer = ewol::widget::Spacer::create(); if (mySpacer == null) { - EWOL_ERROR("Allocation spacer error"); + Log.error("Allocation spacer error"); return tmpObject.m_localId; } - mySpacer->propertyExpand.set(bvec2(true,true)); - mySpacer->propertyFill.set(bvec2(true,true)); - mySpacer->propertyMinSize.set(gale::Dimension(vec2(2,0), gale::distance::pixel)); - mySpacer->propertyMaxSize.set(gale::Dimension(vec2(2,10000), gale::distance::pixel)); + mySpacer->propertyExpand.set(Vector2b(true,true)); + mySpacer->propertyFill.set(Vector2b(true,true)); + mySpacer->propertyMinSize.set(gale::Dimension(Vector2f(2,0), gale::distance::pixel)); + mySpacer->propertyMaxSize.set(gale::Dimension(Vector2f(2,10000), gale::distance::pixel)); mySpacer->propertyColor.set(etk::Color<>(0,0,0,0xFF)); // add it in the widget list ewol::widget::Sizer::subWidgetAdd(mySpacer); @@ -153,17 +153,17 @@ void ewol::widget::Menu::onButtonPressed(ewol::widget::ButtonWeak _button) { } // 2 posible case (have a message or have a child ... if (it.m_message.size() > 0) { - EWOL_DEBUG("Menu == > generate Event"); + Log.debug("Menu == > generate Event"); // Send a multicast event ... signalSelect.emit(it.m_message); ewol::widget::ContextMenuShared tmpContext = m_widgetContextMenu.lock(); if (tmpContext != null) { - EWOL_DEBUG("Mark the menu to remove ..."); + Log.debug("Mark the menu to remove ..."); tmpContext->destroy(); } return; } - EWOL_DEBUG("Menu == > load Sub Menu"); + Log.debug("Menu == > load Sub Menu"); bool findChild = false; for (auto &it2 : m_listElement) { if (it.m_localId == it2.m_parentId) { @@ -179,15 +179,15 @@ void ewol::widget::Menu::onButtonPressed(ewol::widget::ButtonWeak _button) { ewol::widget::ContextMenuShared tmpContext = ewol::widget::ContextMenu::create(); m_widgetContextMenu = tmpContext; if (tmpContext == null) { - EWOL_ERROR("Allocation Error"); + Log.error("Allocation Error"); return; } // get the button widget: - vec2 newPosition; + Vector2f newPosition; ewol::WidgetShared eventFromWidget = ememory::dynamicPointerCast(caller); if (eventFromWidget != null) { - vec2 tmpOri = eventFromWidget->getOrigin(); - vec2 tmpSize = eventFromWidget->getSize(); + Vector2f tmpOri = eventFromWidget->getOrigin(); + Vector2f tmpSize = eventFromWidget->getSize(); // calculate the correct position newPosition.setValue(tmpOri.x() + tmpSize.x()/2, tmpOri.y() ); @@ -198,8 +198,8 @@ void ewol::widget::Menu::onButtonPressed(ewol::widget::ButtonWeak _button) { mySizer = ewol::widget::Sizer::create(); if (mySizer != null) { mySizer->propertyMode.set(widget::Sizer::modeVert); - mySizer->propertyLockExpand.set(vec2(true,true)); - mySizer->propertyFill.set(vec2(true,true)); + mySizer->propertyLockExpand.set(Vector2f(true,true)); + mySizer->propertyFill.set(Vector2f(true,true)); // set it in the pop-up-system: tmpContext->setSubWidget(mySizer); bool menuHaveImage = false; @@ -219,24 +219,24 @@ void ewol::widget::Menu::onButtonPressed(ewol::widget::ButtonWeak _button) { if (m_listElement[iii].m_message == "" && m_listElement[iii].m_label == "") { ewol::widget::SpacerShared mySpacer = ewol::widget::Spacer::create(); if (mySpacer == null) { - EWOL_ERROR("Allocation spacer error"); + Log.error("Allocation spacer error"); continue; } - mySpacer->propertyExpand.set(bvec2(true,true)); - mySpacer->propertyFill.set(bvec2(true,true)); - mySpacer->propertyMinSize.set(gale::Dimension(vec2(0,2), gale::distance::pixel)); - mySpacer->propertyMaxSize.set(gale::Dimension(vec2(10000,2), gale::distance::pixel)); + mySpacer->propertyExpand.set(Vector2b(true,true)); + mySpacer->propertyFill.set(Vector2b(true,true)); + mySpacer->propertyMinSize.set(gale::Dimension(Vector2f(0,2), gale::distance::pixel)); + mySpacer->propertyMaxSize.set(gale::Dimension(Vector2f(10000,2), gale::distance::pixel)); mySpacer->propertyColor.set(etk::Color<>(0,0,0,0xFF)); // add it in the widget list mySizer->subWidgetAdd(mySpacer); } else { myButton = ewol::widget::Button::create(); if (myButton == null) { - EWOL_ERROR("Allocation Error"); + Log.error("Allocation Error"); continue; } - myButton->propertyExpand.set(bvec2(true,true)); - myButton->propertyFill.set(bvec2(true,true)); + myButton->propertyExpand.set(Vector2b(true,true)); + myButton->propertyFill.set(Vector2b(true,true)); // set callback myButton->signalPressed.connect(sharedFromThis(), &ewol::widget::Menu::onButtonPressed, ewol::widget::ButtonWeak(myButton)); // add it in the widget list @@ -265,8 +265,8 @@ void ewol::widget::Menu::onButtonPressed(ewol::widget::ButtonWeak _button) { ewol::widget::LabelShared tmpLabel = widget::Label::create(); if (tmpLabel != null) { tmpLabel->propertyValue.set(etk::String("") + m_listElement[iii].m_label + "\n"); - tmpLabel->propertyExpand.set(bvec2(true,false)); - tmpLabel->propertyFill.set(bvec2(true,true)); + tmpLabel->propertyExpand.set(Vector2b(true,false)); + tmpLabel->propertyFill.set(Vector2b(true,true)); myButton->setSubWidget(tmpLabel); } } @@ -277,7 +277,7 @@ void ewol::widget::Menu::onButtonPressed(ewol::widget::ButtonWeak _button) { } ewol::widget::WindowsShared currentWindows = getWindows(); if (currentWindows == null) { - EWOL_ERROR("Can not get the curent Windows..."); + Log.error("Can not get the curent Windows..."); } else { currentWindows->popUpWidgetPush(tmpContext); } @@ -299,7 +299,7 @@ bool ewol::widget::Menu::loadXML(const exml::Element& _node) { continue; } etk::String widgetName = pNode.getValue(); - EWOL_INFO("Get node : " << pNode); + Log.info("Get node : " << pNode); if (widgetName == "elem") { // int32_t idMenu = addTitle(pNode.attributes["title"], pNode.attributes["image"], pNode.attributes["event"]); @@ -317,13 +317,13 @@ bool ewol::widget::Menu::loadXML(const exml::Element& _node) { } else if (widgetName2 == "separator") { addSpacer(idMenu); } else { - EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} (l " << pNode2.getPos() << ") Unknown basic node='" << widgetName2 << "' not in : [elem,separator]" ); + Log.error("[" << getId() << "] {" << getObjectType() << "} (l " << pNode2.getPos() << ") Unknown basic node='" << widgetName2 << "' not in : [elem,separator]" ); } } } else if (widgetName == "separator") { addSpacer(); } else { - EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} (l " << pNode.getPos() << ") Unknown basic node='" << widgetName << "' not in : [elem,separator]" ); + Log.error("[" << getId() << "] {" << getObjectType() << "} (l " << pNode.getPos() << ") Unknown basic node='" << widgetName << "' not in : [elem,separator]" ); } } return true; diff --git a/src/org/atriasoft/ewol/widget/Menu.hpp b/src/org/atriasoft/ewol/widget/Menu.hpp index c5e10a2..d894b0a 100644 --- a/src/org/atriasoft/ewol/widget/Menu.hpp +++ b/src/org/atriasoft/ewol/widget/Menu.hpp @@ -45,7 +45,7 @@ namespace ewol { void subWidgetUnLink(ewol::WidgetShared _newWidget) override; bool loadXML(const exml::Element& _node) override; private: - etk::Vector m_listElement; + List m_listElement; int32_t m_staticId; // unique ID for every element of the menu ... ewol::widget::ContextMenuWeak m_widgetContextMenu; int32_t get(const etk::String& _label); diff --git a/src/org/atriasoft/ewol/widget/PopUp.cpp b/src/org/atriasoft/ewol/widget/PopUp.cpp index 73d6a0f..837fe56 100644 --- a/src/org/atriasoft/ewol/widget/PopUp.cpp +++ b/src/org/atriasoft/ewol/widget/PopUp.cpp @@ -21,7 +21,7 @@ ewol::widget::PopUp::PopUp() : "The shaper properties", &ewol::widget::PopUp::onChangePropertyShape), propertyLockExpand(this, "lock", - bvec2(true,true), + Vector2b(true,true), "Lock expand contamination", &ewol::widget::PopUp::onChangePropertyLockExpand), propertyCloseOutEvent(this, "out-click-remove", @@ -33,10 +33,10 @@ ewol::widget::PopUp::PopUp() : void ewol::widget::PopUp::init() { ewol::widget::Container::init(); - propertyFill.set(bvec2(false,false)); + propertyFill.set(Vector2b(false,false)); propertyShape.notifyChange(); - propertyMinSize.set(gale::Dimension(vec2(80,80),gale::distance::pourcent)); - propertyExpand.set(bvec2(false, false)); + propertyMinSize.set(gale::Dimension(Vector2f(80,80),gale::distance::pourcent)); + propertyExpand.set(Vector2b(false, false)); } ewol::widget::PopUp::~PopUp() { @@ -48,7 +48,7 @@ void ewol::widget::PopUp::onChangeSize() { return; } ewol::Padding padding = m_shaper.getPadding(); - vec2 subWidgetSize = m_subWidget->getCalculateMinSize(); + Vector2f subWidgetSize = m_subWidget->getCalculateMinSize(); if (m_subWidget->canExpand().x() == true) { if (propertyLockExpand->x() == true) { subWidgetSize.setX(m_minSize.x()); @@ -66,11 +66,11 @@ void ewol::widget::PopUp::onChangeSize() { // limit the size of the element : //subWidgetSize.setMin(m_minSize); // posiition at a int32_t pos : - subWidgetSize = vec2ClipInt32(subWidgetSize); + subWidgetSize = Vector2fClipInt32(subWidgetSize); // set config to the Sub-widget - vec2 subWidgetOrigin = m_origin + (m_size-subWidgetSize)/2.0f; - subWidgetOrigin = vec2ClipInt32(subWidgetOrigin); + Vector2f subWidgetOrigin = m_origin + (m_size-subWidgetSize)/2.0f; + subWidgetOrigin = Vector2fClipInt32(subWidgetOrigin); m_subWidget->setOrigin(subWidgetOrigin); m_subWidget->setSize(subWidgetSize); @@ -102,9 +102,9 @@ void ewol::widget::PopUp::onRegenerateDisplay() { if (needRedraw() == true) { m_shaper.clear(); ewol::Padding padding = m_shaper.getPadding(); - vec2 tmpSize(0,0); - bvec2 expand = canExpand(); - bvec2 fill = canFill(); + Vector2f tmpSize(0,0); + Vector2b expand = canExpand(); + Vector2b fill = canFill(); if (fill.x() == true) { tmpSize.setX(m_size.x()-padding.x()); } @@ -112,14 +112,14 @@ void ewol::widget::PopUp::onRegenerateDisplay() { tmpSize.setY(m_size.y()-padding.y()); } if (m_subWidget != null) { - vec2 tmpSize = m_subWidget->getSize(); + Vector2f tmpSize = m_subWidget->getSize(); } tmpSize.setMax(m_minSize); - vec2 tmpOrigin = (m_size-tmpSize)/2.0f; - m_shaper.setShape(vec2(0,0), - vec2ClipInt32(m_size), - vec2ClipInt32(tmpOrigin-vec2(padding.xLeft(), padding.yButtom())), - vec2ClipInt32(tmpSize + vec2(padding.x(), padding.y()))); + Vector2f tmpOrigin = (m_size-tmpSize)/2.0f; + m_shaper.setShape(Vector2f(0,0), + Vector2fClipInt32(m_size), + Vector2fClipInt32(tmpOrigin-Vector2f(padding.xLeft(), padding.yButtom())), + Vector2fClipInt32(tmpSize + Vector2f(padding.x(), padding.y()))); } // SUBwIDGET GENERATION ... if (m_subWidget != null) { @@ -127,7 +127,7 @@ void ewol::widget::PopUp::onRegenerateDisplay() { } } -ewol::WidgetShared ewol::widget::PopUp::getWidgetAtPos(const vec2& _pos) { +ewol::WidgetShared ewol::widget::PopUp::getWidgetAtPos(const Vector2f& _pos) { ewol::WidgetShared val = ewol::widget::Container::getWidgetAtPos(_pos); if (val != null) { return val; @@ -157,16 +157,16 @@ bool ewol::widget::PopUp::onEventInput(const ewol::event::Input& _event) { return false; } ewol::Padding padding = m_shaper.getPadding(); - vec2 tmpSize(0,0); + Vector2f tmpSize(0,0); if (m_subWidget != null) { - vec2 tmpSize = m_subWidget->getSize(); + Vector2f tmpSize = m_subWidget->getSize(); } tmpSize.setMax(m_minSize); - vec2 tmpOrigin = (m_size-tmpSize)/2.0f; + Vector2f tmpOrigin = (m_size-tmpSize)/2.0f; - tmpOrigin -= vec2(padding.xLeft(), padding.yButtom()); - tmpSize += vec2(padding.x(), padding.y()); - vec2 pos = relativePosition(_event.getPos()); + tmpOrigin -= Vector2f(padding.xLeft(), padding.yButtom()); + tmpSize += Vector2f(padding.x(), padding.y()); + Vector2f pos = relativePosition(_event.getPos()); if( pos.x() < tmpOrigin.x() || pos.y() < tmpOrigin.y() || pos.x() > tmpOrigin.x()+tmpSize.x() diff --git a/src/org/atriasoft/ewol/widget/PopUp.java b/src/org/atriasoft/ewol/widget/PopUp.java index 3d784c9..aafb330 100644 --- a/src/org/atriasoft/ewol/widget/PopUp.java +++ b/src/org/atriasoft/ewol/widget/PopUp.java @@ -24,7 +24,7 @@ namespace ewol { class PopUp : public ewol::widget::Container { public: // properties eproperty::Value propertyShape; //!< Compositing theme. - eproperty::Value propertyLockExpand; //!< Lock the expend of the sub widget to this one == > this permit to limit bigger subWidget + eproperty::Value propertyLockExpand; //!< Lock the expend of the sub widget to this one == > this permit to limit bigger subWidget eproperty::Value propertyCloseOutEvent; //!< ratio progression of a sliding protected: /** @@ -48,7 +48,7 @@ namespace ewol { void onRegenerateDisplay() override; void onChangeSize() override; bool onEventInput(const ewol::event::Input& _event) override; - ewol::WidgetShared getWidgetAtPos(const vec2& _pos) override; + ewol::WidgetShared getWidgetAtPos(const Vector2f& _pos) override; protected: virtual void onChangePropertyShape(); virtual void onChangePropertyLockExpand(); diff --git a/src/org/atriasoft/ewol/widget/ProgressBar.cpp b/src/org/atriasoft/ewol/widget/ProgressBar.cpp index 29ca3fe..9d76572 100644 --- a/src/org/atriasoft/ewol/widget/ProgressBar.cpp +++ b/src/org/atriasoft/ewol/widget/ProgressBar.cpp @@ -43,7 +43,7 @@ ewol::widget::ProgressBar::~ProgressBar() { } void ewol::widget::ProgressBar::calculateMinMaxSize() { - vec2 tmpMin = propertyMinSize->getPixel(); + Vector2f tmpMin = propertyMinSize->getPixel(); m_minSize.setValue( etk::max(tmpMin.x(), 40.0f), etk::max(tmpMin.y(), dotRadius*2.0f) ); markToRedraw(); @@ -67,11 +67,11 @@ void ewol::widget::ProgressBar::onRegenerateDisplay() { int32_t tmpOriginX = 5; int32_t tmpOriginY = 5; m_draw.setColor(propertyTextColorBgOn); - m_draw.setPos(vec3(tmpOriginX, tmpOriginY, 0) ); - m_draw.rectangleWidth(vec3(tmpSizeX*propertyValue, tmpSizeY, 0) ); + m_draw.setPos(Vector3f(tmpOriginX, tmpOriginY, 0) ); + m_draw.rectangleWidth(Vector3f(tmpSizeX*propertyValue, tmpSizeY, 0) ); m_draw.setColor(propertyTextColorBgOff); - m_draw.setPos(vec3(tmpOriginX+tmpSizeX*propertyValue, tmpOriginY, 0) ); - m_draw.rectangleWidth(vec3(tmpSizeX*(1.0-propertyValue), tmpSizeY, 0) ); + m_draw.setPos(Vector3f(tmpOriginX+tmpSizeX*propertyValue, tmpOriginY, 0) ); + m_draw.rectangleWidth(Vector3f(tmpSizeX*(1.0-propertyValue), tmpSizeY, 0) ); // TODO : Create a better progress Bar ... //m_draw.setColor(propertyTextColorFg); diff --git a/src/org/atriasoft/ewol/widget/Scroll.cpp b/src/org/atriasoft/ewol/widget/Scroll.cpp index 7fb6758..476d5dd 100644 --- a/src/org/atriasoft/ewol/widget/Scroll.cpp +++ b/src/org/atriasoft/ewol/widget/Scroll.cpp @@ -14,7 +14,7 @@ ETK_DECLARE_TYPE(ewol::widget::Scroll); ewol::widget::Scroll::Scroll() : propertyLimit(this, "limit", - vec2(0.15,0.5), vec2(0.0,0.0), vec2(1.0,1.0), + Vector2f(0.15,0.5), Vector2f(0.0,0.0), Vector2f(1.0,1.0), "Limit the scroll maximum position [0..1]% represent the free space in the scoll when arrive at the end", &ewol::widget::Scroll::onChangePropertyLimit), propertyShapeVert(this, "shape-vert", @@ -70,15 +70,15 @@ void ewol::widget::Scroll::onChangeSize() { return; } // remove the bar if hover - vec2 basicSize = m_size; + Vector2f basicSize = m_size; if (*propertyHover == false) { - basicSize -= vec2(SCROLL_BAR_SPACE,SCROLL_BAR_SPACE); + basicSize -= Vector2f(SCROLL_BAR_SPACE,SCROLL_BAR_SPACE); } - vec2 origin = m_origin+m_offset; - vec2 minSize = m_subWidget->getCalculateMinSize(); - bvec2 expand = m_subWidget->propertyExpand.get(); + Vector2f origin = m_origin+m_offset; + Vector2f minSize = m_subWidget->getCalculateMinSize(); + Vector2b expand = m_subWidget->propertyExpand.get(); //The gravity is not set on the sub element ==> special use of the widget //origin += ewol::gravityGenerateDelta(propertyGravity.get(), minSize - m_size); if ( expand.x() == true @@ -91,14 +91,14 @@ void ewol::widget::Scroll::onChangeSize() { } m_subWidget->setSize(minSize); if (*propertyGravity == ewol::gravity_top) { - origin += vec2(0.0f, basicSize.y()-minSize.y()); + origin += Vector2f(0.0f, basicSize.y()-minSize.y()); if (*propertyHover == false) { - origin += vec2(0,SCROLL_BAR_SPACE); + origin += Vector2f(0,SCROLL_BAR_SPACE); } } else if (*propertyGravity == ewol::gravity_buttom) { // nothing to do ... origin += } else { - EWOL_ERROR(" Not manage other gravity ..."); + Log.error(" Not manage other gravity ..."); } m_subWidget->setOrigin(origin); m_subWidget->onChangeSize(); @@ -130,12 +130,12 @@ void ewol::widget::Scroll::onDraw() { m_shaperV.draw(); /* ewol::compositing::Drawing draw; - draw.setPos(vec2(10,10)); + draw.setPos(Vector2f(10,10)); draw.setColor(etk::color::orange); - draw.rectangleWidth(vec2(25,25)); - draw.setPos(m_size - vec2(35,35)); + draw.rectangleWidth(Vector2f(25,25)); + draw.setPos(m_size - Vector2f(35,35)); draw.setColor(etk::color::green); - draw.rectangleWidth(vec2(25,25)); + draw.rectangleWidth(Vector2f(25,25)); draw.draw(); */ } @@ -154,8 +154,8 @@ void ewol::widget::Scroll::onRegenerateDisplay() { m_shaperV.clear(); ewol::Padding paddingVert = m_shaperV.getPadding(); ewol::Padding paddingHori = m_shaperH.getPadding(); - vec2 scrollOffset(0,0); - vec2 scrollSize(0,0); + Vector2f scrollOffset(0,0); + Vector2f scrollSize(0,0); if (m_subWidget != null) { scrollOffset = m_subWidget->getOffset(); scrollSize = m_subWidget->getSize(); @@ -167,10 +167,10 @@ void ewol::widget::Scroll::onRegenerateDisplay() { float originScrollBar = scrollOffset.y() / (scrollSize.y()-m_size.y()*propertyLimit->y()); originScrollBar = etk::avg(0.0f, originScrollBar, 1.0f); originScrollBar *= (m_size.y()-lenScrollBar); - m_shaperV.setShape(vec2(m_size.x() - paddingVert.x(), 0), - vec2(paddingVert.x(), m_size.y()), - vec2(m_size.x() - paddingVert.xRight(), m_size.y() - originScrollBar - lenScrollBar), - vec2(0, lenScrollBar)); + m_shaperV.setShape(Vector2f(m_size.x() - paddingVert.x(), 0), + Vector2f(paddingVert.x(), m_size.y()), + Vector2f(m_size.x() - paddingVert.xRight(), m_size.y() - originScrollBar - lenScrollBar), + Vector2f(0, lenScrollBar)); } if( m_size.x() < scrollSize.x() || scrollOffset.x() != 0) { @@ -179,24 +179,24 @@ void ewol::widget::Scroll::onRegenerateDisplay() { float originScrollBar = scrollOffset.x() / (scrollSize.x()-m_size.x()*propertyLimit->x()); originScrollBar = etk::avg(0.0f, originScrollBar, 1.0f); originScrollBar *= (m_size.x()-paddingHori.xRight()-lenScrollBar); - m_shaperH.setShape(vec2(0, 0), - vec2(m_size.x()-paddingVert.x(), paddingHori.y()), - vec2(originScrollBar, paddingHori.yButtom()), - vec2(lenScrollBar, 0)); + m_shaperH.setShape(Vector2f(0, 0), + Vector2f(m_size.x()-paddingVert.x(), paddingHori.y()), + Vector2f(originScrollBar, paddingHori.yButtom()), + Vector2f(lenScrollBar, 0)); } } bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { //ewol::event::Input _event = event; //_event.setType(gale::key::type::finger); - vec2 relativePos = relativePosition(_event.getPos()); - vec2 scrollOffset(0,0); - vec2 scrollSize(0,0); + Vector2f relativePos = relativePosition(_event.getPos()); + Vector2f scrollOffset(0,0); + Vector2f scrollSize(0,0); if (m_subWidget != null) { scrollOffset = m_subWidget->getOffset(); scrollSize = m_subWidget->getSize(); } - EWOL_VERBOSE("Get Event on scroll : " << _event); + Log.verbose("Get Event on scroll : " << _event); relativePos.setY(m_size.y() - relativePos.y()); if( _event.getType() == gale::key::type::mouse && ( m_highSpeedType == gale::key::type::unknow @@ -242,7 +242,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { return false; } else if( _event.getId() == 4 && _event.getStatus() == gale::key::status::up) { - EWOL_VERBOSE(" mode UP " << m_size.y() << "<" << scrollSize.y()); + Log.verbose(" mode UP " << m_size.y() << "<" << scrollSize.y()); if(m_size.y() < scrollSize.y()) { scrollOffset.setY(scrollOffset.y()-m_pixelScrolling); scrollOffset.setY(etk::avg(0.0f, scrollOffset.y(), (scrollSize.y() - m_size.y()*propertyLimit->y()))); @@ -254,7 +254,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { } } else if( _event.getId() == 5 && _event.getStatus() == gale::key::status::up) { - EWOL_VERBOSE(" mode DOWN " << m_size.y() << "<" << scrollSize.y()); + Log.verbose(" mode DOWN " << m_size.y() << "<" << scrollSize.y()); if(m_size.y() < scrollSize.y()) { scrollOffset.setY(scrollOffset.y()+m_pixelScrolling); scrollOffset.setY(etk::avg(0.0f, scrollOffset.y(), (scrollSize.y() - m_size.y()*propertyLimit->y()))); @@ -358,17 +358,17 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { && ( gale::key::type::unknow == m_highSpeedType || gale::key::type::finger == m_highSpeedType ) ) { if (1 == _event.getId()) { - EWOL_VERBOSE("event: " << _event); + Log.verbose("event: " << _event); if (gale::key::status::down == _event.getStatus()) { m_highSpeedMode = speedModeInit; m_highSpeedType = gale::key::type::finger; m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y()); - EWOL_VERBOSE("SCROOL == > INIT pos=" << m_highSpeedStartPos << " && curent scrollOffset=" << scrollOffset); + Log.verbose("SCROOL == > INIT pos=" << m_highSpeedStartPos << " && curent scrollOffset=" << scrollOffset); return true; } else if (gale::key::status::upAfter == _event.getStatus()) { m_highSpeedMode = speedModeDisable; m_highSpeedType = gale::key::type::unknow; - EWOL_VERBOSE("SCROOL == > DISABLE"); + Log.verbose("SCROOL == > DISABLE"); markToRedraw(); return true; } else if ( m_highSpeedMode == speedModeInit @@ -379,14 +379,14 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { // the scrooling can start : // select the direction : m_highSpeedMode = speedModeEnableFinger; - EWOL_VERBOSE("SCROOL == > ENABLE"); + Log.verbose("SCROOL == > ENABLE"); markToRedraw(); } return true; } if ( m_highSpeedMode == speedModeEnableFinger && gale::key::status::move == _event.getStatus()) { - EWOL_VERBOSE("SCROOL == > INIT scrollOffset=" << scrollOffset.y() << " relativePos=" << relativePos.y() << " m_highSpeedStartPos=" << m_highSpeedStartPos.y()); + Log.verbose("SCROOL == > INIT scrollOffset=" << scrollOffset.y() << " relativePos=" << relativePos.y() << " m_highSpeedStartPos=" << m_highSpeedStartPos.y()); //scrollOffset.x = (int32_t)(scrollSize.x * x / m_size.x); if (propertyLimit->x() != 0.0f) { scrollOffset.setX(scrollOffset.x() + (relativePos.x() - m_highSpeedStartPos.x())); @@ -398,7 +398,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { } // update current position: m_highSpeedStartPos = relativePos; - EWOL_VERBOSE("SCROOL == > MOVE " << scrollOffset); + Log.verbose("SCROOL == > MOVE " << scrollOffset); markToRedraw(); if (m_subWidget != null) { m_subWidget->setOffset(scrollOffset); @@ -412,7 +412,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { && gale::key::status::leave == _event.getStatus()) { m_highSpeedMode = speedModeDisable; m_highSpeedType = gale::key::type::unknow; - EWOL_VERBOSE("SCROOL == > DISABLE"); + Log.verbose("SCROOL == > DISABLE"); markToRedraw(); return true; } @@ -420,7 +420,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) { return false; } -ewol::WidgetShared ewol::widget::Scroll::getWidgetAtPos(const vec2& _pos) { +ewol::WidgetShared ewol::widget::Scroll::getWidgetAtPos(const Vector2f& _pos) { ewol::WidgetShared tmpWidget = ewol::widget::Container::getWidgetAtPos(_pos); if (tmpWidget != null) { return tmpWidget; diff --git a/src/org/atriasoft/ewol/widget/Scroll.java b/src/org/atriasoft/ewol/widget/Scroll.java index e7959d0..bda8874 100644 --- a/src/org/atriasoft/ewol/widget/Scroll.java +++ b/src/org/atriasoft/ewol/widget/Scroll.java @@ -19,7 +19,7 @@ namespace ewol { using ScrollWeak = ememory::WeakPtr; class Scroll : public ewol::widget::Container { public: // properties - eproperty::Range propertyLimit; //!< Set the limitation of the ratio in the sreen + eproperty::Range propertyLimit; //!< Set the limitation of the ratio in the sreen eproperty::Value propertyShapeVert; //!< Vertical shaper name eproperty::Value propertyShapeHori; //!< Horizontal shaper name eproperty::Value propertyHover; //!< Horizontal shaper name @@ -37,7 +37,7 @@ namespace ewol { ewol::compositing::Shaper m_shaperV; //!< Compositing theme Vertical. private: float m_pixelScrolling; - vec2 m_highSpeedStartPos; + Vector2f m_highSpeedStartPos; enum highSpeedMode m_highSpeedMode; int32_t m_highSpeedButton; enum gale::key::type m_highSpeedType; @@ -53,7 +53,7 @@ namespace ewol { void onRegenerateDisplay() override; bool onEventInput(const ewol::event::Input& _event) override; void systemDraw(const ewol::DrawProperty& _displayProp) override; - ewol::WidgetShared getWidgetAtPos(const vec2& _pos) override; + ewol::WidgetShared getWidgetAtPos(const Vector2f& _pos) override; protected: void onDraw() override; protected: diff --git a/src/org/atriasoft/ewol/widget/Select.cpp b/src/org/atriasoft/ewol/widget/Select.cpp index 4a849ce..49f6862 100644 --- a/src/org/atriasoft/ewol/widget/Select.cpp +++ b/src/org/atriasoft/ewol/widget/Select.cpp @@ -46,7 +46,7 @@ ewol::widget::Select::~Select() { void ewol::widget::Select::onChangePropertyValue() { markToRedraw(); if (m_widgetEntry == null) { - EWOL_ERROR("Can not acces at entry ..."); + Log.error("Can not acces at entry ..."); return; } for (auto &it : m_listElement) { @@ -64,7 +64,7 @@ void ewol::widget::Select::onChangePropertyValue() { void ewol::widget::Select::optionSelectDefault() { if (m_widgetEntry == null) { - EWOL_ERROR("Can not acces at entry ..."); + Log.error("Can not acces at entry ..."); return; } for (auto &it : m_listElement) { @@ -81,7 +81,7 @@ void ewol::widget::Select::optionSelectDefault() { void ewol::widget::Select::optionRemove(int32_t _value) { for (auto it=m_listElement.begin(); it != m_listElement.end(); ++it) { if (_value == it->m_value) { - EWOL_DEBUG("remove element: " << _value); + Log.debug("remove element: " << _value); m_listElement.erase(it); break; } @@ -97,7 +97,7 @@ void ewol::widget::Select::optionClear() { void ewol::widget::Select::optionAdd(int32_t _value, etk::String _data) { for (auto &it : m_listElement) { if (_value == it.m_value) { - EWOL_DEBUG("replace element: " << _value << " with: '" << _data << "'"); + Log.debug("replace element: " << _value << " with: '" << _data << "'"); it.m_name = _data; } } @@ -120,7 +120,7 @@ bool ewol::widget::Select::loadXML(const exml::Element& _node) { continue; } if (pNode.getValue() != "option") { - EWOL_ERROR("(l " << pNode.getPos() << ") Unknown basic node='" << pNode.getValue() << "' not in : [option]" ); + Log.error("(l " << pNode.getPos() << ") Unknown basic node='" << pNode.getValue() << "' not in : [option]" ); continue; } etk::String valId = pNode.attributes["id"]; @@ -152,7 +152,7 @@ void ewol::widget::Select::updateGui() { } void ewol::widget::Select::onCallbackLabelPressed(int32_t _value) { - EWOL_VERBOSE("User select:" << _value); + Log.verbose("User select:" << _value); propertyValue.set(_value); } @@ -160,7 +160,7 @@ void ewol::widget::Select::onCallbackOpenMenu() { // create a context menu: ewol::widget::ContextMenuShared tmpContext = ewol::widget::ContextMenu::create(); if (tmpContext == null) { - EWOL_ERROR("Allocation Error"); + Log.error("Allocation Error"); return; } // auto-select mark position: @@ -168,18 +168,18 @@ void ewol::widget::Select::onCallbackOpenMenu() { ewol::widget::SizerShared mySizer; mySizer = ewol::widget::Sizer::create(); if (mySizer == null) { - EWOL_ERROR("Allocation Error or sizer"); + Log.error("Allocation Error or sizer"); return; } mySizer->propertyMode.set(widget::Sizer::modeVert); - mySizer->propertyLockExpand.set(vec2(true,true)); - mySizer->propertyFill.set(vec2(true,true)); + mySizer->propertyLockExpand.set(Vector2f(true,true)); + mySizer->propertyFill.set(Vector2f(true,true)); // set it in the pop-up-system: tmpContext->setSubWidget(mySizer); for (auto &it : m_listElement) { ewol::widget::LabelShared myLabel = ewol::widget::Label::create(); if (myLabel == null) { - EWOL_ERROR("Allocation Error"); + Log.error("Allocation Error"); continue; } if (it.m_selected == true) { @@ -187,8 +187,8 @@ void ewol::widget::Select::onCallbackOpenMenu() { } else { myLabel->propertyValue.set(it.m_name); } - myLabel->propertyExpand.set(bvec2(true,true)); - myLabel->propertyFill.set(bvec2(true,true)); + myLabel->propertyExpand.set(Vector2b(true,true)); + myLabel->propertyFill.set(Vector2b(true,true)); // set callback myLabel->signalPressed.connect(sharedFromThis(), &ewol::widget::Select::onCallbackLabelPressed, it.m_value); myLabel->signalPressed.connect(tmpContext, &ewol::widget::ContextMenu::destroy); @@ -197,7 +197,7 @@ void ewol::widget::Select::onCallbackOpenMenu() { } ewol::widget::WindowsShared currentWindows = getWindows(); if (currentWindows == null) { - EWOL_ERROR("Can not get the curent Windows..."); + Log.error("Can not get the curent Windows..."); } else { currentWindows->popUpWidgetPush(tmpContext); } diff --git a/src/org/atriasoft/ewol/widget/Select.java b/src/org/atriasoft/ewol/widget/Select.java index 9f56f50..2f54092 100644 --- a/src/org/atriasoft/ewol/widget/Select.java +++ b/src/org/atriasoft/ewol/widget/Select.java @@ -42,11 +42,11 @@ namespace ewol { etk::String m_name; bool m_selected; public: - // TODO: Remove this: due to the fact my etk::Vector is not full implemented + // TODO: Remove this: due to the fact my List is not full implemented Element() {} Element(int32_t _value, etk::String _name, bool _selected=false); }; - etk::Vector m_listElement; + List m_listElement; public: void optionSelectDefault(); void optionRemove(int32_t _value); diff --git a/src/org/atriasoft/ewol/widget/Sizer.cpp b/src/org/atriasoft/ewol/widget/Sizer.cpp index d41a460..4e3aedf 100644 --- a/src/org/atriasoft/ewol/widget/Sizer.cpp +++ b/src/org/atriasoft/ewol/widget/Sizer.cpp @@ -17,7 +17,7 @@ ewol::widget::Sizer::Sizer() : "The display mode", &ewol::widget::Sizer::onChangePropertyMode), propertyBorderSize(this, "border", - vec2(0,0), + Vector2f(0,0), "The sizer border size", &ewol::widget::Sizer::onChangePropertyBorderSize), propertyAnimation(this, "annimation", @@ -37,37 +37,37 @@ ewol::widget::Sizer::Sizer() : } ewol::widget::Sizer::~Sizer() { - //EWOL_DEBUG("[" << getId() << "]={" << getObjectType() << "} sizer : destroy (mode=" << (propertyMode == ewol::widget::Sizer::modeVert?"Vert":"Hori") << ")"); + //Log.debug("[" << getId() << "]={" << getObjectType() << "} sizer : destroy (mode=" << (propertyMode == ewol::widget::Sizer::modeVert?"Vert":"Hori") << ")"); } void ewol::widget::Sizer::onChangeSize() { ewol::Widget::onChangeSize(); - vec2 tmpBorderSize = propertyBorderSize->getPixel(); - EWOL_VERBOSE("[" << getId() << "] update size : " << m_size << " nbElement : " << m_subWidget.size() << " borderSize=" << tmpBorderSize << " from border=" << propertyBorderSize); - vec2 localWidgetSize = m_size - tmpBorderSize*2.0f; + Vector2f tmpBorderSize = propertyBorderSize->getPixel(); + Log.verbose("[" << getId() << "] update size : " << m_size << " nbElement : " << m_subWidget.size() << " borderSize=" << tmpBorderSize << " from border=" << propertyBorderSize); + Vector2f localWidgetSize = m_size - tmpBorderSize*2.0f; // -1- calculate min-size and expand requested: - vec2 minSize(0.0f, 0.0f); - ivec2 nbWidgetExpand(0,0); + Vector2f minSize(0.0f, 0.0f); + Vector2i nbWidgetExpand(0,0); for (auto &it : m_subWidget) { if (it == null) { continue; } - vec2 tmpSize = it->getCalculateMinSize(); + Vector2f tmpSize = it->getCalculateMinSize(); if (*propertyMode == ewol::widget::Sizer::modeVert) { - minSize = vec2(etk::max(minSize.x(), tmpSize.x()), + minSize = Vector2f(etk::max(minSize.x(), tmpSize.x()), minSize.y() + tmpSize.y()); } else { - minSize = vec2(minSize.x() + tmpSize.x(), + minSize = Vector2f(minSize.x() + tmpSize.x(), etk::max(minSize.y(), tmpSize.y())); } - bvec2 expand = it->canExpand(); - nbWidgetExpand += ivec2(expand.x()==true?1:0, + Vector2b expand = it->canExpand(); + nbWidgetExpand += Vector2i(expand.x()==true?1:0, expand.y()==true?1:0); } // -2- Calculate the size to add at every elements... float deltaExpandSize = 0.0f; - if (nbWidgetExpand != ivec2(0,0)) { + if (nbWidgetExpand != Vector2i(0,0)) { if (*propertyMode == ewol::widget::Sizer::modeVert) { deltaExpandSize = (localWidgetSize.y() - minSize.y()) / float(nbWidgetExpand.y()); } else { @@ -97,8 +97,8 @@ void ewol::widget::Sizer::onChangeSize() { if (it == null) { continue; } - vec2 tmpSizeMin = it->getSize(); - vec2 tmpSizeMax = it->getCalculateMaxSize(); + Vector2f tmpSizeMin = it->getSize(); + Vector2f tmpSizeMax = it->getCalculateMaxSize(); // Now update his size his size in X and the curent sizer size in Y: if (*propertyMode == ewol::widget::Sizer::modeVert) { if (it->canExpand().y() == true) { @@ -152,14 +152,14 @@ void ewol::widget::Sizer::onChangeSize() { if (it->canExpand().x() == false) { continue; } - vec2 tmpSizeMin = it->getSize(); + Vector2f tmpSizeMin = it->getSize(); tmpSizeMin.setX(etk::avg(tmpSizeMin.x(), localWidgetSize.x(), it->getCalculateMaxSize().x())); it->setSize(tmpSizeMin); } else { if (it->canExpand().y() == false) { continue; } - vec2 tmpSizeMin = it->getSize(); + Vector2f tmpSizeMin = it->getSize(); tmpSizeMin.setY(etk::avg(tmpSizeMin.y(), localWidgetSize.y(), it->getCalculateMaxSize().y())); it->setSize(tmpSizeMin); } @@ -169,38 +169,38 @@ void ewol::widget::Sizer::onChangeSize() { if (it == null) { continue; } - it->setSize(vec2ClipInt32(it->getSize())); + it->setSize(Vector2fClipInt32(it->getSize())); } // -7- get under Size - vec2 underSize(0,0); + Vector2f underSize(0,0); for (auto &it : m_subWidget) { if (it == null) { continue; } - vec2 size = it->getSize(); + Vector2f size = it->getSize(); if (*propertyMode == ewol::widget::Sizer::modeVert) { - underSize += vec2(0.0f, size.y()); + underSize += Vector2f(0.0f, size.y()); underSize.setX(etk::max(underSize.x(), size.x())); } else { - underSize += vec2(size.x(), 0.0f); + underSize += Vector2f(size.x(), 0.0f); underSize.setY(etk::max(underSize.y(), size.y())); } } - vec2 deltas = localWidgetSize - underSize; + Vector2f deltas = localWidgetSize - underSize; // -8- Calculate the local origin, depending of the gravity: - vec2 tmpOrigin = m_origin + tmpBorderSize + ewol::gravityGenerateDelta(propertyGravity, deltas); + Vector2f tmpOrigin = m_origin + tmpBorderSize + ewol::gravityGenerateDelta(propertyGravity, deltas); // -9- Set sub widget origin: for (auto &it : m_subWidget) { if (it == null) { continue; } - vec2 origin; - vec2 size = it->getSize(); + Vector2f origin; + Vector2f size = it->getSize(); if (*propertyMode == ewol::widget::Sizer::modeVert) { - origin = vec2ClipInt32(tmpOrigin+m_offset + ewol::gravityGenerateDelta(propertyGravity, vec2(underSize.x()-size.x(),0.0f))); + origin = Vector2fClipInt32(tmpOrigin+m_offset + ewol::gravityGenerateDelta(propertyGravity, Vector2f(underSize.x()-size.x(),0.0f))); } else { - origin = vec2ClipInt32(tmpOrigin+m_offset + ewol::gravityGenerateDelta(propertyGravity, vec2(0.0f, underSize.y()-size.y()))); + origin = Vector2fClipInt32(tmpOrigin+m_offset + ewol::gravityGenerateDelta(propertyGravity, Vector2f(0.0f, underSize.y()-size.y()))); } it->setOrigin(origin); if (*propertyMode == ewol::widget::Sizer::modeVert) { @@ -220,11 +220,11 @@ void ewol::widget::Sizer::onChangeSize() { } void ewol::widget::Sizer::calculateMinMaxSize() { - EWOL_VERBOSE("[" << getId() << "] update minimum size"); + Log.verbose("[" << getId() << "] update minimum size"); m_subExpend.setValue(false, false); m_minSize = propertyMinSize->getPixel(); - vec2 tmpBorderSize = propertyBorderSize->getPixel(); - EWOL_VERBOSE("[" << getId() << "] {" << getObjectType() << "} set min size : " << m_minSize); + Vector2f tmpBorderSize = propertyBorderSize->getPixel(); + Log.verbose("[" << getId() << "] {" << getObjectType() << "} set min size : " << m_minSize); for (auto &it : m_subWidget) { if (it == null) { continue; @@ -236,9 +236,9 @@ void ewol::widget::Sizer::calculateMinMaxSize() { if (it->canExpand().y() == true) { m_subExpend.setY(true); } - vec2 tmpSize = it->getCalculateMinSize(); - EWOL_VERBOSE("[" << getId() << "] NewMinSize=" << tmpSize); - EWOL_VERBOSE("[" << getId() << "] {" << getObjectType() << "} Get minSize="<< tmpSize); + Vector2f tmpSize = it->getCalculateMinSize(); + Log.verbose("[" << getId() << "] NewMinSize=" << tmpSize); + Log.verbose("[" << getId() << "] {" << getObjectType() << "} Get minSize="<< tmpSize); if (*propertyMode == ewol::widget::Sizer::modeVert) { m_minSize.setY(m_minSize.y() + tmpSize.y()); if (tmpSize.x()>m_minSize.x()) { @@ -252,7 +252,7 @@ void ewol::widget::Sizer::calculateMinMaxSize() { } } m_minSize += tmpBorderSize*2; - //EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} Result min size : " << m_minSize); + //Log.error("[" << getId() << "] {" << getObjectType() << "} Result min size : " << m_minSize); } int32_t ewol::widget::Sizer::subWidgetAdd(ewol::WidgetShared _newWidget) { diff --git a/src/org/atriasoft/ewol/widget/Slider.cpp b/src/org/atriasoft/ewol/widget/Slider.cpp index 07f5c2a..f106f2d 100644 --- a/src/org/atriasoft/ewol/widget/Slider.cpp +++ b/src/org/atriasoft/ewol/widget/Slider.cpp @@ -47,7 +47,7 @@ ewol::widget::Slider::~Slider() { } void ewol::widget::Slider::calculateMinMaxSize() { - vec2 minTmp = propertyMinSize->getPixel(); + Vector2f minTmp = propertyMinSize->getPixel(); m_minSize.setValue(etk::max(minTmp.x(), 40.0f), etk::max(minTmp.y(), dotRadius*2.0f) ); markToRedraw(); @@ -66,13 +66,13 @@ void ewol::widget::Slider::onRegenerateDisplay() { m_draw.setColor(m_textColorFg); // draw a line : m_draw.setThickness(1); - m_draw.setPos(vec3(dotRadius, m_size.y()/2, 0) ); - m_draw.lineTo(vec3(m_size.x()-dotRadius, m_size.y()/2, 0) ); + m_draw.setPos(Vector3f(dotRadius, m_size.y()/2, 0) ); + m_draw.lineTo(Vector3f(m_size.x()-dotRadius, m_size.y()/2, 0) ); m_draw.setThickness(0); etk::Color<> borderDot = m_textColorFg; borderDot.setA(borderDot.a()/2); - m_draw.setPos(vec3(4+((propertyValue-propertyMinimum)/(propertyMaximum-propertyMinimum))*(m_size.x()-2*dotRadius), m_size.y()/2, 0) ); + m_draw.setPos(Vector3f(4+((propertyValue-propertyMinimum)/(propertyMaximum-propertyMinimum))*(m_size.x()-2*dotRadius), m_size.y()/2, 0) ); m_draw.setColorBg(borderDot); m_draw.circle(dotRadius); m_draw.setColorBg(m_textColorFg); @@ -80,17 +80,17 @@ void ewol::widget::Slider::onRegenerateDisplay() { } bool ewol::widget::Slider::onEventInput(const ewol::event::Input& _event) { - vec2 relativePos = relativePosition(_event.getPos()); - //EWOL_DEBUG("Event on Slider ..." << _event); + Vector2f relativePos = relativePosition(_event.getPos()); + //Log.debug("Event on Slider ..." << _event); if (1 == _event.getId()) { if( gale::key::status::pressSingle == _event.getStatus() || gale::key::status::move == _event.getStatus()) { // get the new position : - EWOL_VERBOSE("Event on Slider (" << relativePos.x() << "," << relativePos.y() << ")"); + Log.verbose("Event on Slider (" << relativePos.x() << "," << relativePos.y() << ")"); float oldValue = *propertyValue; updateValue(*propertyMinimum + (float)(relativePos.x() - dotRadius) / (m_size.x()-2*dotRadius) * (*propertyMaximum-*propertyMinimum)); if (oldValue != *propertyValue) { - EWOL_VERBOSE(" new value : " << *propertyValue << " in [" << *propertyMinimum << ".." << *propertyMaximum << "]"); + Log.verbose(" new value : " << *propertyValue << " in [" << *propertyMinimum << ".." << *propertyMaximum << "]"); signalChange.emit(*propertyValue); } return true; diff --git a/src/org/atriasoft/ewol/widget/Spacer.cpp b/src/org/atriasoft/ewol/widget/Spacer.cpp index 1e6143b..18b0536 100644 --- a/src/org/atriasoft/ewol/widget/Spacer.cpp +++ b/src/org/atriasoft/ewol/widget/Spacer.cpp @@ -17,7 +17,7 @@ ewol::widget::Spacer::Spacer() : "background of the spacer", &ewol::widget::Spacer::onChangePropertyColor) { addObjectType("ewol::widget::Spacer"); - propertyMinSize.setDirectCheck(gale::Dimension(vec2(10,10))); + propertyMinSize.setDirectCheck(gale::Dimension(Vector2f(10,10))); propertyCanFocus.setDirectCheck(true); } @@ -40,8 +40,8 @@ void ewol::widget::Spacer::onRegenerateDisplay() { return; } m_draw.setColor(propertyColor); - m_draw.setPos(vec3(0, 0, 0) ); - m_draw.rectangleWidth(vec3(m_size.x(), m_size.y(),0) ); + m_draw.setPos(Vector3f(0, 0, 0) ); + m_draw.rectangleWidth(Vector3f(m_size.x(), m_size.y(),0) ); } void ewol::widget::Spacer::onChangePropertyColor() { diff --git a/src/org/atriasoft/ewol/widget/Spacer.java b/src/org/atriasoft/ewol/widget/Spacer.java index 9c6cbc7..479f1e8 100644 --- a/src/org/atriasoft/ewol/widget/Spacer.java +++ b/src/org/atriasoft/ewol/widget/Spacer.java @@ -37,7 +37,7 @@ namespace ewol { private: ewol::compositing::Drawing m_draw; //!< Compositing drawing element public: - ewol::WidgetShared getWidgetAtPos(const vec2& _pos) override { + ewol::WidgetShared getWidgetAtPos(const Vector2f& _pos) override { return null; }; void onRegenerateDisplay() override; diff --git a/src/org/atriasoft/ewol/widget/Spin.cpp b/src/org/atriasoft/ewol/widget/Spin.cpp index a0abde2..d4167f4 100644 --- a/src/org/atriasoft/ewol/widget/Spin.cpp +++ b/src/org/atriasoft/ewol/widget/Spin.cpp @@ -48,7 +48,7 @@ ewol::widget::Spin::~Spin() { void ewol::widget::Spin::onChangePropertyValue() { markToRedraw(); if (m_widgetEntry == null) { - EWOL_ERROR("Can not acces at entry ..."); + Log.error("Can not acces at entry ..."); return; } checkValue(*propertyValue); diff --git a/src/org/atriasoft/ewol/widget/TreeView.cpp b/src/org/atriasoft/ewol/widget/TreeView.cpp index 0e9aee8..402cf6e 100644 --- a/src/org/atriasoft/ewol/widget/TreeView.cpp +++ b/src/org/atriasoft/ewol/widget/TreeView.cpp @@ -33,7 +33,7 @@ ewol::widget::TreeView::TreeView(): void ewol::widget::TreeView::init() { ewol::widget::List::init(); - propertyFill.set(bvec2(true,false)); + propertyFill.set(Vector2b(true,false)); addComposeElemnent("image_ChevronRight", ememory::makeShared("THEME_GUI:///ChevronRight.svg?lib=ewol")); addComposeElemnent("image_ChevronMore", ememory::makeShared("THEME_GUI:///ChevronMore.svg?lib=ewol")); } @@ -42,7 +42,7 @@ ewol::widget::TreeView::~TreeView() { } -vec2 ewol::widget::TreeView::calculateElementSize(const ivec2& _pos) { +Vector2f ewol::widget::TreeView::calculateElementSize(const Vector2i& _pos) { auto tmpText = ememory::staticPointerCast(getComposeElemnent("text")); etk::String myTextToWrite = getData(ListRole::Text, _pos).getSafeString(); float_t treeOffset = 0; @@ -65,20 +65,20 @@ vec2 ewol::widget::TreeView::calculateElementSize(const ivec2& _pos) { iconSize += propertyIconTreeViewSize.get(); } } - vec3 textSize; + Vector3f textSize; if (propertyTextIsDecorated.get() == true) { textSize = tmpText->calculateSizeDecorated(myTextToWrite); } else { textSize = tmpText->calculateSize(myTextToWrite); } - ivec2 count = getMatrixSize(); - return vec2(textSize.x() + treeOffset + iconSize, + Vector2i count = getMatrixSize(); + return Vector2f(textSize.x() + treeOffset + iconSize, etk::max(textSize.y(), iconSize) + m_paddingSizeY*2 ); } -void ewol::widget::TreeView::drawElement(const ivec2& _pos, const vec2& _start, const vec2& _size) { - vec2 posStart = _start; +void ewol::widget::TreeView::drawElement(const Vector2i& _pos, const Vector2f& _start, const Vector2f& _size) { + Vector2f posStart = _start; etk::String iconName; etk::Color<> fg = getData(ListRole::FgColor, _pos).getSafeColor(); if (_pos.x() == 0) { @@ -98,7 +98,7 @@ void ewol::widget::TreeView::drawElement(const ivec2& _pos, const vec2& _start, if (tmpImage != null) { tmpImage->setColor(fg); tmpImage->setPos(posStart); - tmpImage->print(vec2(propertyIconTreeViewSize.get(), propertyIconTreeViewSize.get())); + tmpImage->print(Vector2f(propertyIconTreeViewSize.get(), propertyIconTreeViewSize.get())); } } // move right @@ -116,15 +116,15 @@ void ewol::widget::TreeView::drawElement(const ivec2& _pos, const vec2& _start, BGOObjects->rectangleWidth(_size); } } - posStart += vec2(m_paddingSizeX, m_paddingSizeY); + posStart += Vector2f(m_paddingSizeX, m_paddingSizeY); if (iconName != "") { auto tmpImage = ememory::staticPointerCast(getComposeElemnent(iconName)); if (tmpImage != null) { tmpImage->setColor(fg); tmpImage->setPos(posStart); - tmpImage->print(vec2(propertyIconTreeViewSize.get(), propertyIconTreeViewSize.get())); + tmpImage->print(Vector2f(propertyIconTreeViewSize.get(), propertyIconTreeViewSize.get())); } else { - EWOL_ERROR("can not get : " << iconName ); + Log.error("can not get : " << iconName ); } // move right posStart.setX(posStart.x() + propertyIconTreeViewSize.get()); @@ -151,7 +151,7 @@ void ewol::widget::TreeView::onChangePropertyOffsetTreeView() { markToRedraw(); } -bool ewol::widget::TreeView::onItemEvent(const ewol::event::Input& _event, const ivec2& _pos, const vec2& _mousePosition) { +bool ewol::widget::TreeView::onItemEvent(const ewol::event::Input& _event, const Vector2i& _pos, const Vector2f& _mousePosition) { if (_event.getStatus() != gale::key::status::pressSingle) { return false; } @@ -161,8 +161,8 @@ bool ewol::widget::TreeView::onItemEvent(const ewol::event::Input& _event, const if (_pos.x() != 0) { return false; } - //EWOL_INFO("event: " << _event); - vec2 posStart = vec2(0,0); + //Log.info("event: " << _event); + Vector2f posStart = Vector2f(0,0); bool haveChild = getData(ListRole::HaveChild, _pos).getSafeBoolean(); if (haveChild == false) { return false; @@ -172,9 +172,9 @@ bool ewol::widget::TreeView::onItemEvent(const ewol::event::Input& _event, const posStart.setX(posStart.x() + value.getSafeNumber() * propertyOffsetTreeView.get()); } // Inverse the display of Y - EWOL_VERBOSE("check: " << vec2(_mousePosition.x(), m_listSizeY[_pos.y()] - _mousePosition.y()) + Log.verbose("check: " << Vector2f(_mousePosition.x(), m_listSizeY[_pos.y()] - _mousePosition.y()) << " in " << posStart - << " -> " << (posStart+vec2(propertyIconTreeViewSize.get(),propertyIconTreeViewSize.get()))); + << " -> " << (posStart+Vector2f(propertyIconTreeViewSize.get(),propertyIconTreeViewSize.get()))); if ( _mousePosition.x() >= posStart.x() && _mousePosition.x() <= posStart.x()+propertyIconTreeViewSize.get() && m_listSizeY[_pos.y()] - _mousePosition.y() >= posStart.y() diff --git a/src/org/atriasoft/ewol/widget/TreeView.java b/src/org/atriasoft/ewol/widget/TreeView.java index d6872f6..42642a6 100644 --- a/src/org/atriasoft/ewol/widget/TreeView.java +++ b/src/org/atriasoft/ewol/widget/TreeView.java @@ -39,7 +39,7 @@ namespace ewol { * @param[in] _pos Position of colomn and Raw of the element. * @return The estimate size of the element. */ - vec2 calculateElementSize(const ivec2& _pos) override; + Vector2f calculateElementSize(const Vector2i& _pos) override; /** * @brief Draw an element in the specific size and position. * @param[in] _pos Position of colomn and Raw of the element. @@ -47,13 +47,13 @@ namespace ewol { * @param[in] _size Render raw size * @return The estimate size of the element. */ - void drawElement(const ivec2& _pos, const vec2& _start, const vec2& _size) override; + void drawElement(const Vector2i& _pos, const Vector2f& _start, const Vector2f& _size) override; protected: virtual void onChangePropertyOffsetTreeView(); virtual void onChangePropertyTextDecorated(); - bool onItemEvent(const ewol::event::Input& _event, const ivec2& _pos, const vec2& _mousePosition) override; - virtual void onItemExpandEvent(const ivec2& _pos) { }; + bool onItemEvent(const ewol::event::Input& _event, const Vector2i& _pos, const Vector2f& _mousePosition) override; + virtual void onItemExpandEvent(const Vector2i& _pos) { }; }; }; }; diff --git a/src/org/atriasoft/ewol/widget/WSlider.cpp b/src/org/atriasoft/ewol/widget/WSlider.cpp index be94b99..7e38294 100644 --- a/src/org/atriasoft/ewol/widget/WSlider.cpp +++ b/src/org/atriasoft/ewol/widget/WSlider.cpp @@ -71,11 +71,11 @@ void ewol::widget::WSlider::onChangeSize() { if ( it != m_subWidget.end() && *it != null) { if (*propertyTransitionMode == sladingTransitionHori) { - (*it)->setOrigin( vec2(m_origin.x() + factor*(m_size.x()*m_slidingProgress), + (*it)->setOrigin( Vector2f(m_origin.x() + factor*(m_size.x()*m_slidingProgress), m_origin.y()) + m_offset); } else { - (*it)->setOrigin( vec2(m_origin.x(), + (*it)->setOrigin( Vector2f(m_origin.x(), m_origin.y() + factor*(m_size.y()*m_slidingProgress)) + m_offset); } @@ -87,11 +87,11 @@ void ewol::widget::WSlider::onChangeSize() { if ( it != m_subWidget.end() && *it != null) { if (*propertyTransitionMode == sladingTransitionHori) { - (*it)->setOrigin( vec2(m_origin.x() + factor*(m_size.x()*m_slidingProgress - m_size.x()), + (*it)->setOrigin( Vector2f(m_origin.x() + factor*(m_size.x()*m_slidingProgress - m_size.x()), m_origin.y()) + m_offset); } else { - (*it)->setOrigin( vec2(m_origin.x(), + (*it)->setOrigin( Vector2f(m_origin.x(), m_origin.y() + factor*(m_size.y()*m_slidingProgress - m_size.y())) + m_offset); } @@ -104,7 +104,7 @@ void ewol::widget::WSlider::onChangeSize() { void ewol::widget::WSlider::subWidgetSelectSetVectorId(int32_t _id) { if (_id<0) { - EWOL_ERROR("Can not change to a widget not present : vectID=" << _id); + Log.error("Can not change to a widget not present : vectID=" << _id); return; } if (_id != m_windowsDestination) { @@ -143,7 +143,7 @@ void ewol::widget::WSlider::subWidgetSelectSet(int32_t _id) { void ewol::widget::WSlider::subWidgetSelectSet(const ewol::WidgetShared& _widgetPointer) { if (_widgetPointer == null) { - EWOL_ERROR("Can not change to a widget null"); + Log.error("Can not change to a widget null"); return; } int32_t iii = 0; @@ -161,15 +161,15 @@ void ewol::widget::WSlider::subWidgetSelectSet(const ewol::WidgetShared& _widget } iii++; } - EWOL_ERROR("Can not change to a widget not present"); + Log.error("Can not change to a widget not present"); } void ewol::widget::WSlider::subWidgetSelectSet(const etk::String& _widgetName) { if (_widgetName == "") { - EWOL_ERROR("Can not change to a widget with no name (input)"); + Log.error("Can not change to a widget with no name (input)"); return; } - EWOL_VERBOSE("Select a new sub-widget to dosplay : '" << _widgetName << "'"); + Log.verbose("Select a new sub-widget to dosplay : '" << _widgetName << "'"); int32_t iii = 0; for (auto &it : m_subWidget) { if ( it != null @@ -181,10 +181,10 @@ void ewol::widget::WSlider::subWidgetSelectSet(const etk::String& _widgetName) { } iii++; } - EWOL_ERROR("Can not change to a widget not present"); + Log.error("Can not change to a widget not present"); } void ewol::widget::WSlider::periodicCall(const ewol::event::Time& _event) { - EWOL_ERROR("Periodic: " << m_slidingProgress << "/1.0 " << m_windowsSources << " ==> " << m_windowsDestination << " " << _event); + Log.error("Periodic: " << m_slidingProgress << "/1.0 " << m_windowsSources << " ==> " << m_windowsDestination << " " << _event); if (m_slidingProgress >= 1.0) { m_windowsSources = m_windowsDestination; if( m_windowsRequested != -1 @@ -230,16 +230,16 @@ void ewol::widget::WSlider::systemDraw(const ewol::DrawProperty& _displayProp) { prop.limit(m_origin, m_size); if (m_windowsDestination == m_windowsSources) { - //EWOL_DEBUG("Draw : " << m_windowsDestination); + //Log.debug("Draw : " << m_windowsDestination); auto it = m_subWidget.begin(); it += m_windowsDestination; if ( it != m_subWidget.end() && *it != null) { - //EWOL_INFO("Draw : [" << propertyName << "] t=" << getObjectType() << "o=" << m_origin << " s=" << m_size); + //Log.info("Draw : [" << propertyName << "] t=" << getObjectType() << "o=" << m_origin << " s=" << m_size); (*it)->systemDraw(prop); } } else { - //EWOL_DEBUG("Draw : " << m_windowsSources << "=>" << m_windowsDestination << "progress=" << ((float)m_slidingProgress/1000.) ); + //Log.debug("Draw : " << m_windowsSources << "=>" << m_windowsDestination << "progress=" << ((float)m_slidingProgress/1000.) ); // draw Sources : auto it = m_subWidget.begin(); it += m_windowsSources; @@ -283,7 +283,7 @@ void ewol::widget::WSlider::onRegenerateDisplay() { void ewol::widget::WSlider::onChangePropertySelectWidget() { if (propertySelectWidget.get() != "") { - EWOL_ERROR("SELECT new widget: " << propertySelectWidget.get()); + Log.error("SELECT new widget: " << propertySelectWidget.get()); subWidgetSelectSet(*propertySelectWidget); } } @@ -293,7 +293,7 @@ void ewol::widget::WSlider::onChangePropertyTransitionMode() { } -ewol::WidgetShared ewol::widget::WSlider::getWidgetAtPos(const vec2& _pos) { +ewol::WidgetShared ewol::widget::WSlider::getWidgetAtPos(const Vector2f& _pos) { if (*propertyHide == true) { return null; } @@ -302,8 +302,8 @@ ewol::WidgetShared ewol::widget::WSlider::getWidgetAtPos(const vec2& _pos) { it += m_windowsDestination; if ( it != m_subWidget.end() && *it != null) { - vec2 tmpSize = (*it)->getSize(); - vec2 tmpOrigin = (*it)->getOrigin(); + Vector2f tmpSize = (*it)->getSize(); + Vector2f tmpOrigin = (*it)->getOrigin(); if( (tmpOrigin.x() <= _pos.x() && tmpOrigin.x() + tmpSize.x() >= _pos.x()) && (tmpOrigin.y() <= _pos.y() && tmpOrigin.y() + tmpSize.y() >= _pos.y()) ) { @@ -319,8 +319,8 @@ ewol::WidgetShared ewol::widget::WSlider::getWidgetAtPos(const vec2& _pos) { it += m_windowsDestination; if ( it != m_subWidget.end() && *it != null) { - vec2 tmpSize = (*it)->getSize(); - vec2 tmpOrigin = (*it)->getOrigin(); + Vector2f tmpSize = (*it)->getSize(); + Vector2f tmpOrigin = (*it)->getOrigin(); if( (tmpOrigin.x() <= _pos.x() && tmpOrigin.x() + tmpSize.x() >= _pos.x()) && (tmpOrigin.y() <= _pos.y() && tmpOrigin.y() + tmpSize.y() >= _pos.y()) ) { @@ -335,8 +335,8 @@ ewol::WidgetShared ewol::widget::WSlider::getWidgetAtPos(const vec2& _pos) { it += m_windowsSources; if ( it != m_subWidget.end() && *it != null) { - vec2 tmpSize = (*it)->getSize(); - vec2 tmpOrigin = (*it)->getOrigin(); + Vector2f tmpSize = (*it)->getSize(); + Vector2f tmpOrigin = (*it)->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/src/org/atriasoft/ewol/widget/WSlider.java b/src/org/atriasoft/ewol/widget/WSlider.java index e64b10b..917743a 100644 --- a/src/org/atriasoft/ewol/widget/WSlider.java +++ b/src/org/atriasoft/ewol/widget/WSlider.java @@ -69,7 +69,7 @@ namespace ewol { void onChangeSize() override; void systemDraw(const ewol::DrawProperty& _displayProp) override; void onRegenerateDisplay() override; - ewol::WidgetShared getWidgetAtPos(const vec2& _pos) override; + ewol::WidgetShared getWidgetAtPos(const Vector2f& _pos) override; protected: esignal::Connection m_PCH; //!< Periodic call handle to remove it when needed /** diff --git a/src/org/atriasoft/ewol/widget/Widget.cpp b/src/org/atriasoft/ewol/widget/Widget.cpp index c690b54..e9926ad 100644 --- a/src/org/atriasoft/ewol/widget/Widget.cpp +++ b/src/org/atriasoft/ewol/widget/Widget.cpp @@ -16,19 +16,19 @@ ETK_DECLARE_TYPE(ewol::Widget); ewol::Widget::Widget() : propertyMinSize(this, "min-size", - gale::Dimension(vec2(0,0),gale::distance::pixel), + gale::Dimension(Vector2f(0,0),gale::distance::pixel), "User minimum size", &ewol::Widget::onChangePropertyMinSize), propertyMaxSize(this, "max-size", - gale::Dimension(vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE),gale::distance::pixel), + gale::Dimension(Vector2f(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE),gale::distance::pixel), "User maximum size", &ewol::Widget::onChangePropertyMaxSize), propertyExpand(this, "expand", - bvec2(false,false), + Vector2b(false,false), "Request the widget Expand size wile space is available", &ewol::Widget::onChangePropertyExpand), propertyFill(this, "fill", - bvec2(true,true), + Vector2b(true,true), "Fill the widget available size", &ewol::Widget::onChangePropertyFill), propertyHide(this, "hide", @@ -46,7 +46,7 @@ ewol::Widget::Widget() : &ewol::Widget::onChangePropertyCanFocus), m_size(10,10), m_minSize(0,0), - m_maxSize(vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE)), + m_maxSize(Vector2f(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE)), m_offset(0,0), m_zoom(1.0f), m_origin(0,0), @@ -73,21 +73,21 @@ ewol::Widget::Widget() : void ewol::Widget::onChangeSize() { - EWOL_VERBOSE("[" << getId() << "] {" << getObjectType() << "} update size : " << m_size); + Log.verbose("[" << getId() << "] {" << getObjectType() << "} update size : " << m_size); markToRedraw(); } bool ewol::Widget::setFocus() { - EWOL_VERBOSE("set focus (start) *propertyCanFocus=" << *propertyCanFocus << " m_hasFocus=" << m_hasFocus); + Log.verbose("set focus (start) *propertyCanFocus=" << *propertyCanFocus << " m_hasFocus=" << m_hasFocus); if (*propertyCanFocus == true) { if (m_hasFocus == false) { m_hasFocus = true; onGetFocus(); } - EWOL_VERBOSE("set focus (stop) ret true"); + Log.verbose("set focus (stop) ret true"); return true; } - EWOL_VERBOSE("set focus (stop) ret false"); + Log.verbose("set focus (stop) ret false"); return false; } @@ -106,8 +106,8 @@ void ewol::Widget::keepFocus() { getWidgetManager().focusKeep(ememory::dynamicPointerCast(sharedFromThis())); } -void ewol::Widget::setOffset(const vec2& _newVal) { - EWOL_INFO("Set offset: " << _newVal); +void ewol::Widget::setOffset(const Vector2f& _newVal) { + Log.info("Set offset: " << _newVal); if (m_offset != _newVal) { m_offset = _newVal; markToRedraw(); @@ -142,12 +142,12 @@ void ewol::Widget::setOffset(const vec2& _newVal) { (0,0) */ void ewol::Widget::systemDraw(const ewol::DrawProperty& _displayProp) { - //EWOL_INFO("[" << getId() << "] Draw : [" << propertyName << "] t=" << getObjectType() << " o=" << m_origin << " s=" << m_size << " hide=" << propertyHide); + //Log.info("[" << getId() << "] Draw : [" << propertyName << "] t=" << getObjectType() << " o=" << m_origin << " s=" << m_size << " hide=" << propertyHide); if (*propertyHide == true){ // widget is hidden ... return; } - vec2 displayOrigin = m_origin + m_offset; + Vector2f displayOrigin = m_origin + m_offset; // check if the element is displayable in the windows : if( _displayProp.m_windowsSize.x() < m_origin.x() @@ -166,13 +166,13 @@ void ewol::Widget::systemDraw(const ewol::DrawProperty& _displayProp) { (int32_t)tmpSize.m_size.x(), (int32_t)tmpSize.m_size.y()); // special case, when origin < display origin, we need to cut the display : - ivec2 downOffset = m_origin - tmpSize.m_origin; - downOffset.setMin(ivec2(0,0)); + Vector2i downOffset = m_origin - tmpSize.m_origin; + downOffset.setMin(Vector2i(0,0)); - mat4 tmpTranslate = etk::matTranslate(vec3ClipInt32(vec3(-tmpSize.m_size.x()/2+m_offset.x() + downOffset.x(), + mat4 tmpTranslate = etk::matTranslate(Vector3fClipInt32(Vector3f(-tmpSize.m_size.x()/2+m_offset.x() + downOffset.x(), -tmpSize.m_size.y()/2+m_offset.y() + downOffset.y(), -1.0f))); - mat4 tmpScale = etk::matScale(vec3(m_zoom, m_zoom, 1.0f)); + mat4 tmpScale = etk::matScale(Vector3f(m_zoom, m_zoom, 1.0f)); mat4 tmpProjection = etk::matOrtho((int32_t)(-tmpSize.m_size.x())>>1, (int32_t)( tmpSize.m_size.x())>>1, (int32_t)(-tmpSize.m_size.y())>>1, @@ -205,8 +205,8 @@ void ewol::Widget::systemDraw(const ewol::DrawProperty& _displayProp) { tmpOriginY, tmpclipX, m_size.y()); - mat4 tmpTranslate = etk::matTranslate(vec3((float)(-tmpclipX/2 - (tmpOriginX-m_origin.x())), (float)(-m_size.y()/2.0), -1.0f)); - mat4 tmpScale = etk::matScale(vec3(m_zoom, m_zoom, 1)); + mat4 tmpTranslate = etk::matTranslate(Vector3f((float)(-tmpclipX/2 - (tmpOriginX-m_origin.x())), (float)(-m_size.y()/2.0), -1.0f)); + mat4 tmpScale = etk::matScale(Vector3f(m_zoom, m_zoom, 1)); mat4 tmpProjection = etk::matOrtho(-tmpclipX/2, tmpclipX/2, -m_size.y()/2, m_size.y()/2, -1, 1); mat4 tmpMat = tmpProjection * tmpScale * tmpTranslate; // set internal matrix system : @@ -214,15 +214,15 @@ void ewol::Widget::systemDraw(const ewol::DrawProperty& _displayProp) { //int64_t ___startTime = ewol::getTime(); onDraw(); //float ___localTime = (float)(ewol::getTime() - ___startTime) / 1000.0f; - //EWOL_DEBUG(" Widget1 : " << ___localTime << "ms "); + //Log.debug(" Widget1 : " << ___localTime << "ms "); } else { - EWOL_DEBUG("rasta.."); + Log.debug("rasta.."); glViewport( m_origin.x(), m_origin.y(), m_size.x(), m_size.y()); - mat4 tmpTranslate = etk::matTranslate(vec3(-m_size.x()/2, -m_size.y()/2, -1.0f)); - mat4 tmpScale = etk::matScale(vec3(m_zoom, m_zoom, 1.0f)); + mat4 tmpTranslate = etk::matTranslate(Vector3f(-m_size.x()/2, -m_size.y()/2, -1.0f)); + mat4 tmpScale = etk::matScale(Vector3f(m_zoom, m_zoom, 1.0f)); mat4 tmpProjection = etk::matOrtho(-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 : @@ -230,7 +230,7 @@ void ewol::Widget::systemDraw(const ewol::DrawProperty& _displayProp) { //int64_t ___startTime = ewol::getTime(); onDraw(); //float ___localTime = (float)(ewol::getTime() - ___startTime) / 1000.0f; - //EWOL_DEBUG(" Widget2 : " << ___localTime << "ms "); + //Log.debug(" Widget2 : " << ___localTime << "ms "); } #endif gale::openGL::pop(); @@ -257,7 +257,7 @@ float ewol::Widget::getZoom() { return m_zoom; } -void ewol::Widget::setOrigin(const vec2& _pos) { +void ewol::Widget::setOrigin(const Vector2f& _pos) { #if DEBUG_LEVEL > 2 if( m_origin.x() < -5000 || m_origin.y() < -5000) { @@ -267,70 +267,70 @@ void ewol::Widget::setOrigin(const vec2& _pos) { m_origin = _pos; } -vec2 ewol::Widget::getOrigin() { +Vector2f ewol::Widget::getOrigin() { return m_origin; } -vec2 ewol::Widget::relativePosition(const vec2& _pos) { +Vector2f ewol::Widget::relativePosition(const Vector2f& _pos) { return _pos - m_origin; } void ewol::Widget::calculateMinMaxSize() { m_minSize = propertyMinSize->getPixel(); - //EWOL_ERROR("[" << getId() << "] convert in min size : " << propertyMinSize << " out=" << m_minSize); + //Log.error("[" << getId() << "] convert in min size : " << propertyMinSize << " out=" << m_minSize); m_maxSize = propertyMaxSize->getPixel(); markToRedraw(); } -vec2 ewol::Widget::getCalculateMinSize() { +Vector2f ewol::Widget::getCalculateMinSize() { if (*propertyHide == false) { return m_minSize; } - return vec2(0,0); + return Vector2f(0,0); } -vec2 ewol::Widget::getCalculateMaxSize() { +Vector2f ewol::Widget::getCalculateMaxSize() { if (*propertyHide == false) { return m_maxSize; } - return vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE); + return Vector2f(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE); } void ewol::Widget::setNoMinSize() { - propertyMinSize.set(gale::Dimension(vec2(0,0),gale::distance::pixel)); + propertyMinSize.set(gale::Dimension(Vector2f(0,0),gale::distance::pixel)); } void ewol::Widget::checkMinSize() { - vec2 pixelSize = propertyMinSize->getPixel(); + Vector2f pixelSize = propertyMinSize->getPixel(); m_minSize.setX(etk::max(m_minSize.x(), pixelSize.x())); m_minSize.setY(etk::max(m_minSize.y(), pixelSize.y())); } void ewol::Widget::setNoMaxSize() { - propertyMaxSize.set(gale::Dimension(vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE),gale::distance::pixel)); + propertyMaxSize.set(gale::Dimension(Vector2f(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE),gale::distance::pixel)); } void ewol::Widget::checkMaxSize() { - vec2 pixelSize = propertyMaxSize->getPixel(); + Vector2f pixelSize = propertyMaxSize->getPixel(); m_maxSize.setX(etk::min(m_maxSize.x(), pixelSize.x())); m_maxSize.setY(etk::min(m_maxSize.y(), pixelSize.y())); } -vec2 ewol::Widget::getSize() { +Vector2f ewol::Widget::getSize() { if (*propertyHide == false) { return m_size; } - return vec2(0,0); + return Vector2f(0,0); } -bvec2 ewol::Widget::canExpand() { +Vector2b ewol::Widget::canExpand() { if (*propertyHide == false) { return *propertyExpand; } - return bvec2(false,false); + return Vector2b(false,false); } -const bvec2& ewol::Widget::canFill() { +const Vector2b& ewol::Widget::canFill() { return *propertyFill; } @@ -340,7 +340,7 @@ const bvec2& ewol::Widget::canFill() { void ewol::Widget::shortCutAdd(const etk::String& _descriptiveString, const etk::String& _message) { if (_descriptiveString.size() == 0) { - EWOL_ERROR("try to add shortcut with no descriptive string ..."); + Log.error("try to add shortcut with no descriptive string ..."); return; } EventShortCut tmpElement; @@ -448,7 +448,7 @@ bool ewol::Widget::onEventShortCut(const gale::key::Special& _special, && _unicodeValue <= 'Z') { _unicodeValue += 'a' - 'A'; } - EWOL_VERBOSE("check shortcut...." << _special << " " << _unicodeValue << " " << _kbMove << " " << (_isDown?"DOWN":"UP") << " nb shortcut:" << m_localShortcut.size()); + Log.verbose("check shortcut...." << _special << " " << _unicodeValue << " " << _kbMove << " " << (_isDown?"DOWN":"UP") << " nb shortcut:" << m_localShortcut.size()); // Remove the up event of the shortcut... if (_isDown == false) { for (int32_t iii=m_localShortcut.size()-1; iii >= 0; iii--) { @@ -462,12 +462,12 @@ bool ewol::Widget::onEventShortCut(const gale::key::Special& _special, ) { // In this case we grap the event in case of an error can occured ... m_localShortcut[iii].isActive = false; - EWOL_VERBOSE("detect up of a shortcut"); + Log.verbose("detect up of a shortcut"); return true; } } } - //EWOL_INFO("Try to find generic shortcut ..."); + //Log.info("Try to find generic shortcut ..."); for (int32_t iii=m_localShortcut.size()-1; iii >= 0; iii--) { if ( m_localShortcut[iii].specialKey.getShift() == _special.getShift() && m_localShortcut[iii].specialKey.getCtrl() == _special.getCtrl() @@ -481,7 +481,7 @@ bool ewol::Widget::onEventShortCut(const gale::key::Special& _special, ) { if (_isDown == true) { m_localShortcut[iii].isActive = true; - EWOL_VERBOSE("Generate shortCut: " << m_localShortcut[iii].message); + Log.verbose("Generate shortCut: " << m_localShortcut[iii].message); signalShortcut.emit(m_localShortcut[iii].message); } return true; @@ -510,7 +510,7 @@ bool ewol::Widget::getGrabStatus() { } void ewol::Widget::setCursor(enum gale::context::cursor _newCursor) { - EWOL_DEBUG("Change Cursor in " << _newCursor); + Log.debug("Change Cursor in " << _newCursor); m_cursorDisplay = _newCursor; getContext().setCursor(m_cursorDisplay); } @@ -572,8 +572,8 @@ void ewol::Widget::onChangePropertyExpand() { } void ewol::Widget::onChangePropertyMaxSize() { - vec2 pixelMin = propertyMinSize->getPixel(); - vec2 pixelMax = propertyMaxSize->getPixel(); + Vector2f pixelMin = propertyMinSize->getPixel(); + Vector2f pixelMax = propertyMaxSize->getPixel(); // check minimum & maximum compatibility : bool error=false; if (pixelMin.x()>pixelMax.x()) { @@ -583,15 +583,15 @@ void ewol::Widget::onChangePropertyMaxSize() { error=true; } if (error == true) { - EWOL_ERROR("Can not set a 'min size' > 'max size' reset to maximum ..."); - propertyMaxSize.setDirect(gale::Dimension(vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE),gale::distance::pixel)); + Log.error("Can not set a 'min size' > 'max size' reset to maximum ..."); + propertyMaxSize.setDirect(gale::Dimension(Vector2f(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE),gale::distance::pixel)); } requestUpdateSize(); } void ewol::Widget::onChangePropertyMinSize() { - vec2 pixelMin = propertyMinSize->getPixel(); - vec2 pixelMax = propertyMaxSize->getPixel(); + Vector2f pixelMin = propertyMinSize->getPixel(); + Vector2f pixelMax = propertyMaxSize->getPixel(); // check minimum & maximum compatibility : bool error=false; if (pixelMin.x()>pixelMax.x()) { @@ -601,8 +601,8 @@ void ewol::Widget::onChangePropertyMinSize() { error=true; } if (error == true) { - EWOL_ERROR("Can not set a 'min size' > 'max size' set nothing ..."); - propertyMinSize.setDirect(gale::Dimension(vec2(0,0),gale::distance::pixel)); + Log.error("Can not set a 'min size' > 'max size' set nothing ..."); + propertyMinSize.setDirect(gale::Dimension(Vector2f(0,0),gale::distance::pixel)); } requestUpdateSize(); } @@ -632,5 +632,5 @@ void ewol::Widget::drawWidgetTree(int32_t _level) { for (int32_t iii=0; iii<_level; ++iii) { space += " "; } - EWOL_PRINT(space << "[" << getId() << "] name='" << propertyName << "' type=" << getObjectType() << " o=" << m_origin << " s=" << m_size << " hide=" << propertyHide); + Log.print(space << "[" << getId() << "] name='" << propertyName << "' type=" << getObjectType() << " o=" << m_origin << " s=" << m_size << " hide=" << propertyHide); } \ No newline at end of file diff --git a/src/org/atriasoft/ewol/widget/Widget.java b/src/org/atriasoft/ewol/widget/Widget.java index d96f860..0cc0427 100644 --- a/src/org/atriasoft/ewol/widget/Widget.java +++ b/src/org/atriasoft/ewol/widget/Widget.java @@ -84,8 +84,8 @@ namespace ewol { public: // properties: eproperty::Value propertyMinSize; //!< user define the minimum size of the widget eproperty::Value propertyMaxSize; //!< user define the maximum size of the widget - eproperty::Value propertyExpand; //!< the widget will expand if possible - eproperty::Value propertyFill; //!< the widget will fill all the space provided by the parent. + eproperty::Value propertyExpand; //!< the widget will expand if possible + eproperty::Value propertyFill; //!< the widget will fill all the space provided by the parent. eproperty::Value propertyHide; //!< hide a widget on the display eproperty::List propertyGravity; //!< Gravity of the widget eproperty::Value propertyCanFocus; //!< the focus can be done on this widget @@ -104,16 +104,16 @@ namespace ewol { // -- Widget size: // ---------------------------------------------------------------------------------------------------------------- protected: - vec2 m_size; //!< internal: current size of the widget - vec2 m_minSize; //!< internal: minimum size of the widget - vec2 m_maxSize; //!< internal: maximum size of the widget + Vector2f m_size; //!< internal: current size of the widget + Vector2f m_minSize; //!< internal: minimum size of the widget + Vector2f m_maxSize; //!< internal: maximum size of the widget public: /** * @brief Convert the absolute position in the local Position (Relative) * @param[in] _pos Absolute position that you request conversion. * @return The relative position. */ - virtual vec2 relativePosition(const vec2& _pos); + virtual Vector2f relativePosition(const Vector2f& _pos); /** * @brief Parent have set the size and the origin. The container need to update the child widget property * @note INTERNAL EWOL SYSTEM @@ -125,13 +125,13 @@ namespace ewol { * @return Requested size * @note : INTERNAL EWOL SYSTEM */ - virtual vec2 getSize(); + virtual Vector2f getSize(); /** * @brief set the widget size * @return Requested size * @note : INTERNAL EWOL SYSTEM Do not modify the size yourself: calculation is complex and need knowledge of around widget */ - virtual void setSize(const vec2& _value) { + virtual void setSize(const Vector2f& _value) { m_size = _value; } /** @@ -144,26 +144,26 @@ namespace ewol { * @return Requested size * @note : INTERNAL EWOL SYSTEM */ - virtual vec2 getCalculateMinSize(); + virtual Vector2f getCalculateMinSize(); /** * @brief get the widget maximum size calculated * @return Requested size * @note : INTERNAL EWOL SYSTEM */ - virtual vec2 getCalculateMaxSize(); + virtual Vector2f getCalculateMaxSize(); protected: - vec2 m_offset; //!< Offset of the display in the view-port + Vector2f m_offset; //!< Offset of the display in the view-port public: /** * @brief set the zoom property of the widget. * @param[in] _newVal offset value. */ - virtual void setOffset(const vec2& _newVal); + virtual void setOffset(const Vector2f& _newVal); /** * @brief get the offset property of the widget. * @return The current offset value. */ - virtual const vec2& getOffset() { + virtual const Vector2f& getOffset() { return m_offset; }; protected: @@ -186,7 +186,7 @@ namespace ewol { */ virtual void changeZoom(float _range) {}; protected: - vec2 m_origin; //!< internal ... I do not really known how if can use it ... + Vector2f m_origin; //!< internal ... I do not really known how if can use it ... public: /** * @brief Set origin at the widget (must be an parent widget that set this parameter). @@ -194,12 +194,12 @@ namespace ewol { * @param[in] _pos Position of the origin. * @note : INTERNAL EWOL SYSTEM */ - virtual void setOrigin(const vec2& _pos); + virtual void setOrigin(const Vector2f& _pos); /** * @brief Get the origin (absolute position in the windows). * @return Coordinate of the origin requested. */ - virtual vec2 getOrigin(); + virtual Vector2f getOrigin(); public: /** * @brief User set No minimum size. @@ -230,14 +230,14 @@ namespace ewol { * @return 2D boolean represents the capacity to expend * @note : INTERNAL EWOL SYSTEM */ - virtual bvec2 canExpand(); + virtual Vector2b canExpand(); public: /** * @brief get the filling capabilities x&y - * @return bvec2 repensent the capacity to x&y filling + * @return Vector2b repensent the capacity to x&y filling * @note : INTERNAL EWOL SYSTEM */ - const bvec2& canFill(); + const Vector2b& canFill(); // ---------------------------------------------------------------------------------------------------------------- // -- focus Area // ---------------------------------------------------------------------------------------------------------------- @@ -334,7 +334,7 @@ namespace ewol { * @return pointer on the widget found * @note : INTERNAL EWOL SYSTEM */ - virtual ewol::WidgetShared getWidgetAtPos(const vec2& _pos) { + virtual ewol::WidgetShared getWidgetAtPos(const Vector2f& _pos) { if (propertyHide.get() == false) { return ememory::dynamicPointerCast(sharedFromThis()); } @@ -396,7 +396,7 @@ namespace ewol { public: esignal::Signal signalShortcut; //!< signal handle of the message private: - etk::Vector m_localShortcut; //!< list of all shortcut in the widget + List m_localShortcut; //!< list of all shortcut in the widget protected: /** * @brief add a specific shortcut with his description diff --git a/src/org/atriasoft/ewol/widget/WidgetScrolled.cpp b/src/org/atriasoft/ewol/widget/WidgetScrolled.cpp index a7cda4a..4ab970b 100644 --- a/src/org/atriasoft/ewol/widget/WidgetScrolled.cpp +++ b/src/org/atriasoft/ewol/widget/WidgetScrolled.cpp @@ -32,7 +32,7 @@ ewol::widget::WidgetScrolled::WidgetScrolled() : m_scroollingMode = scroolModeNormal; m_highSpeedType = gale::key::type::unknow; m_highSpeedButton = -1; - m_limitScrolling = vec2(0.5f, 0.5f); + m_limitScrolling = Vector2f(0.5f, 0.5f); m_fingerScoolActivated = false; for (size_t iii = 0; iii < CALCULATE_SIMULTANEOUS_FINGER; ++iii) { @@ -66,10 +66,10 @@ void ewol::widget::WidgetScrolled::onRegenerateDisplay() { float originScrollBar = m_originScrooled.y() / (m_maxSize.y()-m_size.y()*m_limitScrolling.y()); originScrollBar = etk::avg(0.0f, originScrollBar, 1.0f); originScrollBar *= (m_size.y()-lenScrollBar); - m_shaperV.setShape(vec2(m_size.x() - paddingVert.x(), 0), - vec2(paddingVert.x(), m_size.y()), - vec2(m_size.x() - paddingVert.xRight(), m_size.y() - originScrollBar - lenScrollBar), - vec2(0, lenScrollBar)); + m_shaperV.setShape(Vector2f(m_size.x() - paddingVert.x(), 0), + Vector2f(paddingVert.x(), m_size.y()), + Vector2f(m_size.x() - paddingVert.xRight(), m_size.y() - originScrollBar - lenScrollBar), + Vector2f(0, lenScrollBar)); } if( m_size.x() < m_maxSize.x() || m_originScrooled.x()!=0) { @@ -78,16 +78,16 @@ void ewol::widget::WidgetScrolled::onRegenerateDisplay() { float originScrollBar = m_originScrooled.x() / (m_maxSize.x()-m_size.x()*m_limitScrolling.x()); originScrollBar = etk::avg(0.0f, originScrollBar, 1.0f); originScrollBar *= (m_size.x()-paddingHori.xRight()-lenScrollBar); - m_shaperH.setShape(vec2(0, 0), - vec2(m_size.x()-paddingVert.x(), paddingHori.y()), - vec2(originScrollBar, paddingHori.yButtom()), - vec2(lenScrollBar, 0)); + m_shaperH.setShape(Vector2f(0, 0), + Vector2f(m_size.x()-paddingVert.x(), paddingHori.y()), + Vector2f(originScrollBar, paddingHori.yButtom()), + Vector2f(lenScrollBar, 0)); } } bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event) { - EWOL_VERBOSE("event XXX " << _event); - vec2 relativePos = relativePosition(_event.getPos()); + Log.verbose("event XXX " << _event); + Vector2f relativePos = relativePosition(_event.getPos()); // corection due to the open Gl invertion ... relativePos.setY(m_size.y() - relativePos.y()); ewol::Padding paddingV = m_shaperV.getPadding(); @@ -295,7 +295,7 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event && m_fingerPresent[1] == true && m_fingerScoolActivated == false) { m_fingerScoolActivated = true; - EWOL_VERBOSE("SCROOL == > START pos=" << m_fingerMoveStartPos); + Log.verbose("SCROOL == > START pos=" << m_fingerMoveStartPos); } if (m_fingerScoolActivated == true) { // 1: scroll... @@ -306,7 +306,7 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event m_originScrooled.setX(etk::avg(0.0f, m_originScrooled.x(), (m_maxSize.x() - m_size.x()*m_limitScrolling.x()))); m_originScrooled.setY(etk::avg(0.0f, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling.y()))); m_fingerMoveStartPos[idTable] = relativePos; - EWOL_VERBOSE("SCROOL == > MOVE m_originScrooled=" << m_originScrooled << " " << relativePos << " " << m_highSpeedStartPos); + Log.verbose("SCROOL == > MOVE m_originScrooled=" << m_originScrooled << " " << relativePos << " " << m_highSpeedStartPos); markToRedraw(); } if ( m_fingerPresent[0] == false @@ -324,17 +324,17 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event // ** Single finger mode : ** // ************************** if (_event.getId() == 1) { - EWOL_VERBOSE("event 1 " << _event); + Log.verbose("event 1 " << _event); if (_event.getStatus() == gale::key::status::down) { m_highSpeedMode = ewol::widget::Scroll::speedModeInit; m_highSpeedType = gale::key::type::finger; m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y()); - EWOL_VERBOSE("SCROOL == > INIT"); + Log.verbose("SCROOL == > INIT"); return true; } else if (_event.getStatus() == gale::key::status::upAfter) { m_highSpeedMode = ewol::widget::Scroll::speedModeDisable; m_highSpeedType = gale::key::type::unknow; - EWOL_VERBOSE("SCROOL == > DISABLE"); + Log.verbose("SCROOL == > DISABLE"); markToRedraw(); return true; } else if ( m_highSpeedMode == ewol::widget::Scroll::speedModeInit @@ -345,7 +345,7 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event // the scrooling can start : // select the direction : m_highSpeedMode = ewol::widget::Scroll::speedModeEnableFinger; - EWOL_DEBUG("SCROOL == > ENABLE"); + Log.debug("SCROOL == > ENABLE"); markToRedraw(); } return true; @@ -365,7 +365,7 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event m_originScrooled.setX(etk::avg(0.0f, m_originScrooled.x(), (m_maxSize.x() - m_size.x()*m_limitScrolling.x()))); m_originScrooled.setY(etk::avg(0.0f, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling.y()))); m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y()); - EWOL_VERBOSE("SCROOL == > MOVE m_originScrooled=" << m_originScrooled << " " << relativePos << " " << m_highSpeedStartPos); + Log.verbose("SCROOL == > MOVE m_originScrooled=" << m_originScrooled << " " << relativePos << " " << m_highSpeedStartPos); markToRedraw(); return true; } @@ -373,7 +373,7 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event && _event.getStatus() == gale::key::status::leave) { m_highSpeedMode = ewol::widget::Scroll::speedModeDisable; m_highSpeedType = gale::key::type::unknow; - EWOL_VERBOSE("SCROOL == > DISABLE"); + Log.verbose("SCROOL == > DISABLE"); markToRedraw(); return true; } @@ -383,7 +383,7 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event if (_event.getType() == gale::key::type::mouse) { float tmp1=m_size.x() / m_maxSize.y(); float tmp2=m_size.y() / m_maxSize.x(); - //EWOL_INFO(" elements Zoom : " << tmp1 << " " << tmp2); + //Log.info(" elements Zoom : " << tmp1 << " " << tmp2); tmp1 = etk::min(tmp1, tmp2); if ( _event.getId() == 4 && _event.getStatus() == gale::key::status::up) { @@ -410,7 +410,7 @@ bool ewol::widget::WidgetScrolled::onEventInput(const ewol::event::Input& _event } else if (m_scroollingMode == scroolModeGame) { } else { - EWOL_ERROR("Scrolling mode unknow ... " << m_scroollingMode ); + Log.error("Scrolling mode unknow ... " << m_scroollingMode ); } return false; } @@ -427,8 +427,8 @@ void ewol::widget::WidgetScrolled::systemDraw(const ewol::DrawProperty& _display // here we invert the reference of the standard openGl view because the reference in the common display is Top left and not buttom left gale::openGL::setViewPort(m_origin, m_size); mat4 tmpProjection = etk::matOrtho(-m_size.x()/2, m_size.x()/2, -m_size.y()/2, m_size.y()/2, -1, 1); - mat4 tmpScale = etk::matScale(vec3(m_zoom, m_zoom, 1.0) ); - mat4 tmpTranslate = etk::matTranslate(vec3(-m_maxSize.x()/2, -m_maxSize.y()/2, -1.0) ); + mat4 tmpScale = etk::matScale(Vector3f(m_zoom, m_zoom, 1.0) ); + mat4 tmpTranslate = etk::matTranslate(Vector3f(-m_maxSize.x()/2, -m_maxSize.y()/2, -1.0) ); mat4 tmpMat = tmpProjection * tmpScale * tmpTranslate; // set internal matrix system : gale::openGL::setMatrix(tmpMat); @@ -438,7 +438,7 @@ void ewol::widget::WidgetScrolled::systemDraw(const ewol::DrawProperty& _display // here we invert the reference of the standard openGl view because the reference in the common display is Top left and not buttom left gale::openGL::setViewPort(m_origin, m_size); mat4 tmpProjection = etk::matOrtho(-m_size.x()/2, m_size.x()/2, -m_size.y()/2, m_size.y()/2, -1, 1); - mat4 tmpTranslate = etk::matTranslate(vec3( -m_maxSize.x()/2, -m_maxSize.y()/2, -1.0) ); + mat4 tmpTranslate = etk::matTranslate(Vector3f( -m_maxSize.x()/2, -m_maxSize.y()/2, -1.0) ); mat4 tmpMat = tmpProjection * tmpTranslate; // set internal matrix system : gale::openGL::setMatrix(tmpMat); @@ -450,7 +450,7 @@ void ewol::widget::WidgetScrolled::systemDraw(const ewol::DrawProperty& _display gale::openGL::pop(); } -void ewol::widget::WidgetScrolled::setScrollingPositionDynamic(vec2 _borderWidth, const vec2& _currentPosition, bool _center) { +void ewol::widget::WidgetScrolled::setScrollingPositionDynamic(Vector2f _borderWidth, const Vector2f& _currentPosition, bool _center) { if (true == _center) { _borderWidth.setValue(m_size.x() / 2 - _borderWidth.x(), m_size.y() / 2 - _borderWidth.y() ); diff --git a/src/org/atriasoft/ewol/widget/WidgetScrolled.java b/src/org/atriasoft/ewol/widget/WidgetScrolled.java index 0e95ea2..b38d09a 100644 --- a/src/org/atriasoft/ewol/widget/WidgetScrolled.java +++ b/src/org/atriasoft/ewol/widget/WidgetScrolled.java @@ -36,13 +36,13 @@ namespace ewol { ewol::compositing::Shaper m_shaperH; //!< Compositing theme Horizontal. ewol::compositing::Shaper m_shaperV; //!< Compositing theme Vertical. protected: - vec2 m_originScrooled; //!< pixel distance from the origin of the display (Bottum left) - vec2 m_maxSize; //!< Maximum size of the Widget ==> to display scrollbar - vec2 m_limitScrolling; //!< Mimit scrolling represent the propertion of the minimel scrolling activate (0.2 ==> 20% migt all time be visible) + Vector2f m_originScrooled; //!< pixel distance from the origin of the display (Bottum left) + Vector2f m_maxSize; //!< Maximum size of the Widget ==> to display scrollbar + Vector2f m_limitScrolling; //!< Mimit scrolling represent the propertion of the minimel scrolling activate (0.2 ==> 20% migt all time be visible) private: // Mouse section : enum scrollingMode m_scroollingMode; //!< mode of management of the scrooling float m_pixelScrolling; - vec2 m_highSpeedStartPos; + Vector2f m_highSpeedStartPos; enum Scroll::highSpeedMode m_highSpeedMode; int32_t m_highSpeedButton; enum gale::key::type m_highSpeedType; @@ -66,12 +66,12 @@ namespace ewol { * @brief Reset the scoll of the subWidget */ void resetScrollOrigin() { - m_originScrooled = vec2(0,0); + m_originScrooled = Vector2f(0,0); } private: bool m_fingerPresent[CALCULATE_SIMULTANEOUS_FINGER]; bool m_fingerScoolActivated; - vec2 m_fingerMoveStartPos[CALCULATE_SIMULTANEOUS_FINGER]; + Vector2f m_fingerMoveStartPos[CALCULATE_SIMULTANEOUS_FINGER]; protected: /** * @brief Scroll Widget main constructor to be herited from an other widget (this is not a stand-alone widget) @@ -108,7 +108,7 @@ namespace ewol { * @brief set the specific mawimum size of the widget * @param[in] _localSize new Maximum size */ - void setMaxSize(const vec2& _localSize) { + void setMaxSize(const Vector2f& _localSize) { m_maxSize = _localSize; }; /** @@ -117,21 +117,21 @@ namespace ewol { * @param[in] _currentPosition Position that is requested to view * @param[in] _center True if the position might be at the center of the widget */ - void setScrollingPositionDynamic(vec2 _borderWidth, const vec2& _currentPosition, bool _center = false); + void setScrollingPositionDynamic(Vector2f _borderWidth, const Vector2f& _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 ... */ void setLimitScrolling(float _poucentageLimit) { _poucentageLimit = etk::avg(0.1f, _poucentageLimit,1.0f); - m_limitScrolling = vec2(_poucentageLimit, _poucentageLimit); + m_limitScrolling = Vector2f(_poucentageLimit, _poucentageLimit); }; /** * @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 for axis specific... */ - void setLimitScrolling(const vec2& _poucentageLimit) { - m_limitScrolling = vec2(etk::avg(0.1f, _poucentageLimit.x(),1.0f), etk::avg(0.1f, _poucentageLimit.y(),1.0f)); + void setLimitScrolling(const Vector2f& _poucentageLimit) { + m_limitScrolling = Vector2f(etk::avg(0.1f, _poucentageLimit.x(),1.0f), etk::avg(0.1f, _poucentageLimit.y(),1.0f)); }; protected: virtual void onChangePropertyShapeVert(); diff --git a/src/org/atriasoft/ewol/widget/Windows.cpp b/src/org/atriasoft/ewol/widget/Windows.cpp index cd1a25b..c5b2264 100644 --- a/src/org/atriasoft/ewol/widget/Windows.cpp +++ b/src/org/atriasoft/ewol/widget/Windows.cpp @@ -52,23 +52,23 @@ void ewol::widget::Windows::onChangeSize() { m_subWidget->calculateMinMaxSize(); // TODO : do it better ... and manage gravity ... m_subWidget->setSize(m_size); - m_subWidget->setOrigin(vec2(0.0f, 0.0f)); + m_subWidget->setOrigin(Vector2f(0.0f, 0.0f)); m_subWidget->onChangeSize(); } for (auto &it : m_popUpWidgetList) { if(it != null) { it->calculateMinMaxSize(); it->setSize(m_size); - it->setOrigin(vec2(0.0f, 0.0f)); + it->setOrigin(Vector2f(0.0f, 0.0f)); it->onChangeSize(); } } } -ewol::WidgetShared ewol::widget::Windows::getWidgetAtPos(const vec2& _pos) { - EWOL_VERBOSE("Get widget at pos : " << _pos); +ewol::WidgetShared ewol::widget::Windows::getWidgetAtPos(const Vector2f& _pos) { + Log.verbose("Get widget at pos : " << _pos); // calculate relative position - vec2 relativePos = relativePosition(_pos); + Vector2f relativePos = relativePosition(_pos); // event go directly on the pop-up if (m_popUpWidgetList.size() != 0) { return m_popUpWidgetList.back()->getWidgetAtPos(_pos); @@ -81,9 +81,9 @@ ewol::WidgetShared ewol::widget::Windows::getWidgetAtPos(const vec2& _pos) { } void ewol::widget::Windows::sysDraw() { - EWOL_VERBOSE("Draw on " << m_size); + Log.verbose("Draw on " << m_size); // set the size of the open GL system - gale::openGL::setViewPort(vec2(0,0), m_size); + gale::openGL::setViewPort(Vector2f(0,0), m_size); gale::openGL::disable(gale::openGL::flag_dither); //gale::openGL::disable(gale::openGL::flag_blend); gale::openGL::disable(gale::openGL::flag_stencilTest); @@ -136,36 +136,36 @@ void ewol::widget::Windows::systemDraw(const ewol::DrawProperty& _displayProp) { | uint32_t(gale::openGL::clearFlag_depthBuffer)); #ifdef TEST_PERFO_WINDOWS float ___localTime0 = (float)(ewol::getTime() - ___startTime0) / 1000.0f; - EWOL_ERROR(" Windows000 : " << ___localTime0 << "ms "); + Log.error(" Windows000 : " << ___localTime0 << "ms "); int64_t ___startTime1 = ewol::getTime(); #endif //EWOL_WARNING(" WINDOWS draw on " << m_currentDrawId); // first display the windows on the display if (m_subWidget != null) { m_subWidget->systemDraw(_displayProp); - //EWOL_DEBUG("Draw Windows"); + //Log.debug("Draw Windows"); } #ifdef TEST_PERFO_WINDOWS float ___localTime1 = (float)(ewol::getTime() - ___startTime1) / 1000.0f; - EWOL_ERROR(" Windows111 : " << ___localTime1 << "ms "); + Log.error(" Windows111 : " << ___localTime1 << "ms "); int64_t ___startTime2 = ewol::getTime(); #endif // second display the pop-up for (auto &it : m_popUpWidgetList) { if (it != null) { it->systemDraw(_displayProp); - //EWOL_DEBUG("Draw Pop-up"); + //Log.debug("Draw Pop-up"); } } #ifdef TEST_PERFO_WINDOWS float ___localTime2 = (float)(ewol::getTime() - ___startTime2) / 1000.0f; - EWOL_ERROR(" Windows222 : " << ___localTime2 << "ms "); + Log.error(" Windows222 : " << ___localTime2 << "ms "); #endif } void ewol::widget::Windows::setSubWidget(ewol::WidgetShared _widget) { if (m_subWidget != null) { - EWOL_INFO("Remove current main windows Widget..."); + Log.info("Remove current main windows Widget..."); m_subWidget->removeParent(); m_subWidget.reset(); } @@ -181,7 +181,7 @@ void ewol::widget::Windows::setSubWidget(ewol::WidgetShared _widget) { void ewol::widget::Windows::popUpWidgetPush(ewol::WidgetShared _widget) { if (_widget == null) { // nothing to do an error appear : - EWOL_ERROR("can not set widget pop-up (null pointer)"); + Log.error("can not set widget pop-up (null pointer)"); return; } m_popUpWidgetList.pushBack(_widget); @@ -215,16 +215,16 @@ void ewol::widget::Windows::onChangePropertyTitle() { if (context.getWindows() == sharedFromThis()) { context.setTitle(*propertyTitle); } else { - EWOL_INFO("Set title is delayed ..."); + Log.info("Set title is delayed ..."); } } void ewol::widget::Windows::requestDestroyFromChild(const ewol::ObjectShared& _child) { - EWOL_VERBOSE("A child has been removed"); + Log.verbose("A child has been removed"); auto it = m_popUpWidgetList.begin(); while (it != m_popUpWidgetList.end()) { if (*it == _child) { - EWOL_VERBOSE(" Find it ..."); + Log.verbose(" Find it ..."); if (*it == null) { m_popUpWidgetList.erase(it); it = m_popUpWidgetList.begin(); @@ -240,7 +240,7 @@ void ewol::widget::Windows::requestDestroyFromChild(const ewol::ObjectShared& _c ++it; } if (m_subWidget == _child) { - EWOL_VERBOSE(" Find it ... 2"); + Log.verbose(" Find it ... 2"); if (m_subWidget == null) { return; } diff --git a/src/org/atriasoft/ewol/widget/Windows.java b/src/org/atriasoft/ewol/widget/Windows.java index 0f8b294..d7dc3d6 100644 --- a/src/org/atriasoft/ewol/widget/Windows.java +++ b/src/org/atriasoft/ewol/widget/Windows.java @@ -43,7 +43,7 @@ namespace ewol { */ void setSubWidget(ewol::WidgetShared _widget); protected: - etk::Vector m_popUpWidgetList; //!< List of pop-up displayed + List m_popUpWidgetList; //!< List of pop-up displayed public: /** * @brief Add a pop-up on the Windows. @@ -66,7 +66,7 @@ namespace ewol { public: void onRegenerateDisplay() override; void onChangeSize() override; - ewol::WidgetShared getWidgetAtPos(const vec2& _pos) override; + ewol::WidgetShared getWidgetAtPos(const Vector2f& _pos) override; void requestDestroyFromChild(const ewol::ObjectShared& _child) override; ewol::ObjectShared getSubObjectNamed(const etk::String& _objectName) override; void drawWidgetTree(int32_t _level=0) override; diff --git a/src/org/atriasoft/ewol/widget/meta/ColorChooser.cpp b/src/org/atriasoft/ewol/widget/meta/ColorChooser.cpp index ef13956..ad12f84 100644 --- a/src/org/atriasoft/ewol/widget/meta/ColorChooser.cpp +++ b/src/org/atriasoft/ewol/widget/meta/ColorChooser.cpp @@ -31,10 +31,10 @@ ewol::widget::ColorChooser::ColorChooser() : void ewol::widget::ColorChooser::init() { ewol::widget::Sizer::init(); propertyMode.set(ewol::widget::Sizer::modeVert); - propertyLockExpand.set(bvec2(true,true)); + propertyLockExpand.set(Vector2b(true,true)); m_widgetColorBar = ewol::widget::ColorBar::create(); m_widgetColorBar->signalChange.connect(sharedFromThis(), &ewol::widget::ColorChooser::onCallbackColorChange); - m_widgetColorBar->propertyFill.set(bvec2(true,true)); + m_widgetColorBar->propertyFill.set(Vector2b(true,true)); subWidgetAdd(m_widgetColorBar); etk::Color<> sliderColor; @@ -42,8 +42,8 @@ void ewol::widget::ColorChooser::init() { m_widgetRed = ewol::widget::Slider::create(); m_widgetRed->signalChange.connect(sharedFromThis(), &ewol::widget::ColorChooser::onCallbackColorChangeRed); - m_widgetRed->propertyExpand.set(bvec2(true,false)); - m_widgetRed->propertyFill.set(bvec2(true,false)); + m_widgetRed->propertyExpand.set(Vector2b(true,false)); + m_widgetRed->propertyFill.set(Vector2b(true,false)); m_widgetRed->propertyMinimum.set(0); m_widgetRed->propertyMaximum.set(255); sliderColor = etk::Color<>(0xFF, 0x00, 0x00, 0xFF); @@ -51,8 +51,8 @@ void ewol::widget::ColorChooser::init() { subWidgetAdd(m_widgetRed); m_widgetGreen = ewol::widget::Slider::create(); m_widgetGreen->signalChange.connect(sharedFromThis(), &ewol::widget::ColorChooser::onCallbackColorChangeGreen); - m_widgetGreen->propertyExpand.set(bvec2(true,false)); - m_widgetGreen->propertyFill.set(bvec2(true,false)); + m_widgetGreen->propertyExpand.set(Vector2b(true,false)); + m_widgetGreen->propertyFill.set(Vector2b(true,false)); m_widgetGreen->propertyMinimum.set(0); m_widgetGreen->propertyMaximum.set(255); sliderColor = etk::Color<>(0x00, 0xFF, 0x00, 0xFF); @@ -60,8 +60,8 @@ void ewol::widget::ColorChooser::init() { subWidgetAdd(m_widgetGreen); m_widgetBlue = ewol::widget::Slider::create(); m_widgetBlue->signalChange.connect(sharedFromThis(), &ewol::widget::ColorChooser::onCallbackColorChangeBlue); - m_widgetBlue->propertyExpand.set(bvec2(true,false)); - m_widgetBlue->propertyFill.set(bvec2(true,false)); + m_widgetBlue->propertyExpand.set(Vector2b(true,false)); + m_widgetBlue->propertyFill.set(Vector2b(true,false)); m_widgetBlue->propertyMinimum.set(0); m_widgetBlue->propertyMaximum.set(255); sliderColor = etk::Color<>(0x00, 0x00, 0xFF, 0xFF); @@ -69,8 +69,8 @@ void ewol::widget::ColorChooser::init() { subWidgetAdd(m_widgetBlue); m_widgetAlpha = ewol::widget::Slider::create(); m_widgetAlpha->signalChange.connect(sharedFromThis(), &ewol::widget::ColorChooser::onCallbackColorChangeAlpha); - m_widgetAlpha->propertyExpand.set(bvec2(true,false)); - m_widgetAlpha->propertyFill.set(bvec2(true,false)); + m_widgetAlpha->propertyExpand.set(Vector2b(true,false)); + m_widgetAlpha->propertyFill.set(Vector2b(true,false)); m_widgetAlpha->propertyMinimum.set(0); m_widgetAlpha->propertyMaximum.set(255); subWidgetAdd(m_widgetAlpha); diff --git a/src/org/atriasoft/ewol/widget/meta/FileChooser.cpp b/src/org/atriasoft/ewol/widget/meta/FileChooser.cpp index 3e20f9c..2cee75e 100644 --- a/src/org/atriasoft/ewol/widget/meta/FileChooser.cpp +++ b/src/org/atriasoft/ewol/widget/meta/FileChooser.cpp @@ -142,9 +142,9 @@ void ewol::widget::FileChooser::onCallbackHidenFileChangeChangeValue(const bool& void ewol::widget::FileChooser::onCallbackListFolderSelectChange(const etk::Path& _value) { // == > this is an internal event ... - EWOL_DEBUG(" old PATH: '" << *propertyPath << "' ==> '" << _value << "'"); + Log.debug(" old PATH: '" << *propertyPath << "' ==> '" << _value << "'"); propertyPath.setDirect(_value); - EWOL_DEBUG("new PATH: '" << *propertyPath << "'"); + Log.debug("new PATH: '" << *propertyPath << "'"); propertyFile.setDirect(""); updateCurrentFolder(); } @@ -161,7 +161,7 @@ void ewol::widget::FileChooser::onCallbackListFileSelectChange(const etk::Path& void ewol::widget::FileChooser::onCallbackListFileValidate(const etk::Path& _value) { // select the file == > generate a validate propertyFile.set(_value); - EWOL_VERBOSE(" generate a fiel opening : '" << propertyFile << "'"); + Log.verbose(" generate a fiel opening : '" << propertyFile << "'"); signalValidate.emit(_value); autoDestroy(); } @@ -175,14 +175,14 @@ void ewol::widget::FileChooser::onCallbackListValidate() { EWOL_WARNING(" Validate : '" << *propertyFile << "' ==> error No name ..."); return; } - EWOL_DEBUG(" generate a file opening : '" << *propertyFile << "'"); + Log.debug(" generate a file opening : '" << *propertyFile << "'"); signalValidate.emit(*propertyFile); autoDestroy(); } void ewol::widget::FileChooser::onCallbackHomePressed() { etk::Path tmpUserFolder = etk::path::getHomePath(); - EWOL_DEBUG("new PATH: '" << tmpUserFolder << "'"); + Log.debug("new PATH: '" << tmpUserFolder << "'"); propertyPath.setDirect(tmpUserFolder); propertyFile.setDirect(""); diff --git a/src/org/atriasoft/ewol/widget/meta/Parameter.cpp b/src/org/atriasoft/ewol/widget/meta/Parameter.cpp index 822ec25..567ec47 100644 --- a/src/org/atriasoft/ewol/widget/meta/Parameter.cpp +++ b/src/org/atriasoft/ewol/widget/meta/Parameter.cpp @@ -37,40 +37,40 @@ void ewol::widget::Parameter::init() { ewol::widget::SizerShared mySizerHori = null; ewol::widget::SpacerShared mySpacer = null; #ifdef __TARGET_OS__Android - propertyMinSize.set(gale::Dimension(vec2(90, 90), gale::distance::pourcent)); + propertyMinSize.set(gale::Dimension(Vector2f(90, 90), gale::distance::pourcent)); #else - propertyMinSize.set(gale::Dimension(vec2(80, 80), gale::distance::pourcent)); + propertyMinSize.set(gale::Dimension(Vector2f(80, 80), gale::distance::pourcent)); #endif mySizerVert = ewol::widget::Sizer::create(); if (mySizerVert == null) { - EWOL_ERROR("Can not allocate widget == > display might be in error"); + Log.error("Can not allocate widget == > display might be in error"); } else { - EWOL_INFO("add widget"); + Log.info("add widget"); mySizerVert->propertyMode.set(widget::Sizer::modeVert); - mySizerVert->propertyLockExpand.set(bvec2(true,true)); - mySizerVert->propertyExpand.set(bvec2(true,true)); + mySizerVert->propertyLockExpand.set(Vector2b(true,true)); + mySizerVert->propertyExpand.set(Vector2b(true,true)); // set it in the pop-up-system : setSubWidget(mySizerVert); mySizerHori = ewol::widget::Sizer::create(); if (mySizerHori == null) { - EWOL_ERROR("Can not allocate widget == > display might be in error"); + Log.error("Can not allocate widget == > display might be in error"); } else { mySizerHori->propertyMode.set(widget::Sizer::modeHori); mySizerVert->subWidgetAdd(mySizerHori); mySpacer = ewol::widget::Spacer::create(); if (mySpacer == null) { - EWOL_ERROR("Can not allocate widget == > display might be in error"); + Log.error("Can not allocate widget == > display might be in error"); } else { - mySpacer->propertyExpand.set(bvec2(true,false)); + mySpacer->propertyExpand.set(Vector2b(true,false)); mySizerHori->subWidgetAdd(mySpacer); } ewol::widget::ButtonShared tmpButton = widget::Button::create(); if (tmpButton == null) { - EWOL_ERROR("Can not allocate widget == > display might be in error"); + Log.error("Can not allocate widget == > display might be in error"); } else { tmpButton->setSubWidget(ewol::widget::composerGenerateString( "\n" @@ -83,16 +83,16 @@ void ewol::widget::Parameter::init() { mySpacer = ewol::widget::Spacer::create(); if (mySpacer == null) { - EWOL_ERROR("Can not allocate widget == > display might be in error"); + Log.error("Can not allocate widget == > display might be in error"); } else { - mySpacer->propertyExpand.set(bvec2(false,false)); - mySpacer->propertyMinSize.set(gale::Dimension(vec2(10,0))); + mySpacer->propertyExpand.set(Vector2b(false,false)); + mySpacer->propertyMinSize.set(gale::Dimension(Vector2f(10,0))); mySizerHori->subWidgetAdd(mySpacer); } tmpButton = ewol::widget::Button::create(); if (tmpButton == null) { - EWOL_ERROR("Can not allocate widget == > display might be in error"); + Log.error("Can not allocate widget == > display might be in error"); } else { tmpButton->setSubWidget(ewol::widget::composerGenerateString( "\n" @@ -106,55 +106,55 @@ void ewol::widget::Parameter::init() { mySizerHori = ewol::widget::Sizer::create(); if (mySizerHori == null) { - EWOL_ERROR("Can not allocate widget == > display might be in error"); + Log.error("Can not allocate widget == > display might be in error"); } else { mySizerHori->propertyMode.set(widget::Sizer::modeHori); mySizerVert->subWidgetAdd(mySizerHori); m_paramList = ewol::widget::ParameterList::create(); if (m_paramList == null) { - EWOL_ERROR("Can not allocate widget == > display might be in error"); + Log.error("Can not allocate widget == > display might be in error"); } else { m_paramList->signalSelect.connect(sharedFromThis(), &ewol::widget::Parameter::onCallbackMenuSelected); - m_paramList->propertyFill.set(bvec2(false,true)); - m_paramList->propertyExpand.set(bvec2(false,true)); + m_paramList->propertyFill.set(Vector2b(false,true)); + m_paramList->propertyExpand.set(Vector2b(false,true)); mySizerHori->subWidgetAdd(m_paramList); } mySpacer = ewol::widget::Spacer::create(); if (mySpacer == null) { - EWOL_ERROR("Can not allocate widget == > display might be in error"); + Log.error("Can not allocate widget == > display might be in error"); } else { - mySpacer->propertyFill.set(bvec2(false,true)); - mySpacer->propertyMinSize.set(vec2(5,5)); + mySpacer->propertyFill.set(Vector2b(false,true)); + mySpacer->propertyMinSize.set(Vector2f(5,5)); mySpacer->propertyColor.set(0x000000BF); mySizerHori->subWidgetAdd(mySpacer); } ewol::widget::SizerShared mySizerVert2 = widget::Sizer::create(); if (mySizerVert2 == null) { - EWOL_ERROR("Can not allocate widget == > display might be in error"); + Log.error("Can not allocate widget == > display might be in error"); } else { mySizerVert2->propertyMode.set(widget::Sizer::modeVert); mySizerHori->subWidgetAdd(mySizerVert2); mySpacer = ewol::widget::Spacer::create(); if (mySpacer == null) { - EWOL_ERROR("Can not allocate widget == > display might be in error"); + Log.error("Can not allocate widget == > display might be in error"); } else { - mySpacer->propertyExpand.set(bvec2(true,false)); - mySpacer->propertyMinSize.set(vec2(5,5)); + mySpacer->propertyExpand.set(Vector2b(true,false)); + mySpacer->propertyMinSize.set(Vector2f(5,5)); mySpacer->propertyColor.set(0x000000BF); mySizerVert2->subWidgetAdd(mySpacer); } m_wSlider = ewol::widget::WSlider::create(); if (m_wSlider == null) { - EWOL_ERROR("Can not allocate widget == > display might be in error"); + Log.error("Can not allocate widget == > display might be in error"); } else { m_wSlider->propertyTransitionSpeed.set(0.5); m_wSlider->propertyTransitionMode.set(ewol::widget::WSlider::sladingTransitionVert); - m_wSlider->propertyExpand.set(bvec2(true,true)); + m_wSlider->propertyExpand.set(Vector2b(true,true)); mySizerVert2->subWidgetAdd(m_wSlider); } } @@ -162,20 +162,20 @@ void ewol::widget::Parameter::init() { mySpacer = ewol::widget::Spacer::create(); if (mySpacer == null) { - EWOL_ERROR("Can not allocate widget == > display might be in error"); + Log.error("Can not allocate widget == > display might be in error"); } else { - mySpacer->propertyExpand.set(bvec2(true,false)); - mySpacer->propertyMinSize.set(vec2(5,5)); + mySpacer->propertyExpand.set(Vector2b(true,false)); + mySpacer->propertyMinSize.set(Vector2f(5,5)); mySpacer->propertyColor.set(0x000000BF); mySizerVert->subWidgetAdd(mySpacer); } m_widgetTitle = ewol::widget::Label::create(); if (m_widgetTitle == null) { - EWOL_ERROR("Can not allocate widget == > display might be in error"); + Log.error("Can not allocate widget == > display might be in error"); } else { m_widgetTitle->propertyValue.set(propertyLabelTitle); - m_widgetTitle->propertyExpand.set(bvec2(true,false)); + m_widgetTitle->propertyExpand.set(Vector2b(true,false)); mySizerVert->subWidgetAdd(m_widgetTitle); } } @@ -200,11 +200,11 @@ void ewol::widget::Parameter::onCallbackMenuclosed() { } void ewol::widget::Parameter::onCallbackParameterSave() { //ewol::userConfig::Save(); - EWOL_TODO("Save Parameter !!! "); + Log.todo("Save Parameter !!! "); } void ewol::widget::Parameter::onCallbackMenuSelected(const int32_t& _value) { if (m_wSlider != null) { - EWOL_DEBUG("event on the parameter : Menu-select select ID=" << _value << ""); + Log.debug("event on the parameter : Menu-select select ID=" << _value << ""); m_wSlider->subWidgetSelectSet(_value); } } @@ -216,13 +216,13 @@ void ewol::widget::Parameter::menuAdd(etk::String _label, etk::String _image, ew if (_associateWidget != null) { m_wSlider->subWidgetAdd(_associateWidget); } else { - EWOL_DEBUG("Associate an empty widget on it ..."); + Log.debug("Associate an empty widget on it ..."); ewol::widget::LabelShared myLabel = widget::Label::create(); if (myLabel == null) { - EWOL_ERROR("Can not allocate widget == > display might be in error"); + Log.error("Can not allocate widget == > display might be in error"); } else { myLabel->propertyValue.set(etk::String("No widget for : ") + _label); - myLabel->propertyExpand.set(bvec2(true,true)); + myLabel->propertyExpand.set(Vector2b(true,true)); m_wSlider->subWidgetAdd(myLabel); } } diff --git a/src/org/atriasoft/ewol/widget/meta/ParameterList.cpp b/src/org/atriasoft/ewol/widget/meta/ParameterList.cpp index 58667bb..96a2d3f 100644 --- a/src/org/atriasoft/ewol/widget/meta/ParameterList.cpp +++ b/src/org/atriasoft/ewol/widget/meta/ParameterList.cpp @@ -52,7 +52,7 @@ void ewol::widget::ParameterList::calculateMinMaxSize() { void ewol::widget::ParameterList::addOObject(const ememory::SharedPtr& _newObject, int32_t _pos) { if (_newObject == null) { - EWOL_ERROR("Try to add an empty object in the Widget generic display system"); + Log.error("Try to add an empty object in the Widget generic display system"); return; } if (_pos < 0 || (size_t)_pos >= m_listOObject.size() ) { @@ -79,7 +79,7 @@ void ewol::widget::ParameterList::onRegenerateDisplay() { if (needRedraw() == true) { // clean the object list ... clearOObjectList(); - //EWOL_DEBUG("OnRegenerateDisplay(" << m_size.x << "," << m_size.y << ")"); + //Log.debug("OnRegenerateDisplay(" << m_size.x << "," << m_size.y << ")"); int32_t tmpOriginX = 0; int32_t tmpOriginY = 0; @@ -108,7 +108,7 @@ void ewol::widget::ParameterList::onRegenerateDisplay() { (minHeight + 2*m_paddingSizeY) * nbRaw ); - etk::Vector listSizeColomn; + List listSizeColomn; // set background color : ememory::SharedPtr tmpDraw = ememory::makeShared(); @@ -116,8 +116,8 @@ void ewol::widget::ParameterList::onRegenerateDisplay() { return; } tmpDraw->setColor(etk::Color<>(0xFF, 0xFF, 0xFF, 0xFF)); - tmpDraw->setPos(vec3(0,0,0) ); - tmpDraw->rectangleWidth(vec3(m_size.x(), m_size.y(), 0) ); + tmpDraw->setPos(Vector3f(0,0,0) ); + tmpDraw->rectangleWidth(Vector3f(m_size.x(), m_size.y(), 0) ); uint32_t displayableRaw = m_size.y() / (minHeight + 2*m_paddingSizeY) +2; @@ -141,7 +141,7 @@ void ewol::widget::ParameterList::onRegenerateDisplay() { ememory::SharedPtr tmpText = ememory::makeShared(); - vec3 textPos; + Vector3f textPos; textPos.setX((int32_t)tmpOriginX); if (m_list[iii]->m_group == false) { textPos.setX(textPos.x() + minHeight); @@ -168,7 +168,7 @@ bool ewol::widget::ParameterList::onEventInput(const ewol::event::Input& _event) return true; } if (_event.getId() == 1 && _event.getStatus() == gale::key::status::pressSingle) { - vec2 relativePos = relativePosition(_event.getPos()); + Vector2f relativePos = relativePosition(_event.getPos()); // corection for the openGl abstraction relativePos.setY(m_size.y() - relativePos.y()); // TODO : Rework this ... @@ -195,17 +195,17 @@ bool ewol::widget::ParameterList::onEventInput(const ewol::event::Input& _event) } void ewol::widget::ParameterList::onGetFocus() { - EWOL_DEBUG("Ewol::List get focus"); + Log.debug("Ewol::List get focus"); } void ewol::widget::ParameterList::onLostFocus() { - EWOL_DEBUG("Ewol::List Lost focus"); + Log.debug("Ewol::List Lost focus"); } void ewol::widget::ParameterList::menuAdd(etk::String& _label, int32_t _refId, etk::String& _image) { ememory::SharedPtr tmpEmement = ememory::makeShared(_label, _refId, _image, false); if (tmpEmement == null) { - EWOL_ERROR("Can not allocacte menu parameter"); + Log.error("Can not allocacte menu parameter"); return; } m_list.pushBack(tmpEmement); @@ -219,7 +219,7 @@ void ewol::widget::ParameterList::menuAddGroup(etk::String& _label) { etk::String image = ""; ememory::SharedPtr tmpEmement = ememory::makeShared(_label, -1, image, true); if (tmpEmement == null) { - EWOL_ERROR("Can not allocacte menu parameter"); + Log.error("Can not allocacte menu parameter"); return; } m_list.pushBack(tmpEmement); diff --git a/src/org/atriasoft/ewol/widget/meta/ParameterList.java b/src/org/atriasoft/ewol/widget/meta/ParameterList.java index fec2cf3..41859ff 100644 --- a/src/org/atriasoft/ewol/widget/meta/ParameterList.java +++ b/src/org/atriasoft/ewol/widget/meta/ParameterList.java @@ -40,7 +40,7 @@ namespace ewol { private: int32_t m_idSelected; - etk::Vector> m_list; + List> m_list; protected: ParameterList(); void init() override; @@ -50,7 +50,7 @@ namespace ewol { void setLabel(etk::String _newLabel); // drawing capabilities .... private: - etk::Vector> m_listOObject; //!< generic element to display... + List> m_listOObject; //!< generic element to display... public: void addOObject(const ememory::SharedPtr& _newObject, int32_t _pos=-1); void clearOObjectList(); diff --git a/src/org/atriasoft/ewol/widget/meta/SpinBase.cpp b/src/org/atriasoft/ewol/widget/meta/SpinBase.cpp index c768110..5062950 100644 --- a/src/org/atriasoft/ewol/widget/meta/SpinBase.cpp +++ b/src/org/atriasoft/ewol/widget/meta/SpinBase.cpp @@ -35,7 +35,7 @@ ewol::widget::SpinBase::SpinBase() : propertySpinMode.add(ewol::widget::spinPosition_leftRight, "left-right"); propertySpinMode.add(ewol::widget::spinPosition_leftLeft, "left-left"); propertySpinMode.add(ewol::widget::spinPosition_RightRight, "right-right"); - propertyLockExpand.setDirectCheck(bvec2(true,true)); + propertyLockExpand.setDirectCheck(Vector2b(true,true)); propertyGravity.setDirectCheck(gravity_center); } @@ -75,24 +75,24 @@ void ewol::widget::SpinBase::updateGui() { etk::String shaper; if (m_config != null) { shaper = m_config->getString(m_confIdEntryShaper); - EWOL_VERBOSE("shaper entry : " << shaper); + Log.verbose("shaper entry : " << shaper); } m_widgetEntry = ewol::widget::Entry::create("shape", shaper); if (m_widgetEntry != null) { - m_widgetEntry->propertyExpand.set(bvec2(true,false)); - m_widgetEntry->propertyFill.set(bvec2(true,true)); + m_widgetEntry->propertyExpand.set(Vector2b(true,false)); + m_widgetEntry->propertyFill.set(Vector2b(true,true)); } } if (m_widgetButtonDown == null) { etk::String shaper; if (m_config != null) { shaper = m_config->getString(m_confIdDownShaper); - EWOL_VERBOSE("shaper button DOWN : " << shaper); + Log.verbose("shaper button DOWN : " << shaper); } m_widgetButtonDown = ewol::widget::Button::create("shape", shaper); if (m_widgetButtonDown != null) { - m_widgetButtonDown->propertyExpand.set(bvec2(false,false)); - m_widgetButtonDown->propertyFill.set(bvec2(true,true)); + m_widgetButtonDown->propertyExpand.set(Vector2b(false,false)); + m_widgetButtonDown->propertyFill.set(Vector2b(true,true)); etk::String data = m_config->getString(m_confIdDownData); ewol::WidgetShared widget = ewol::widget::composerGenerateString(data); m_widgetButtonDown->setSubWidget(widget); @@ -102,12 +102,12 @@ void ewol::widget::SpinBase::updateGui() { etk::String shaper; if (m_config != null) { shaper = m_config->getString(m_confIdUpShaper); - EWOL_VERBOSE("shaper button UP : " << shaper); + Log.verbose("shaper button UP : " << shaper); } m_widgetButtonUp = ewol::widget::Button::create("shape", shaper); if (m_widgetButtonUp != null) { - m_widgetButtonUp->propertyExpand.set(bvec2(false,false)); - m_widgetButtonUp->propertyFill.set(bvec2(true,true)); + m_widgetButtonUp->propertyExpand.set(Vector2b(false,false)); + m_widgetButtonUp->propertyFill.set(Vector2b(true,true)); etk::String data = m_config->getString(m_confIdUpData); ewol::WidgetShared widget = ewol::widget::composerGenerateString(data); m_widgetButtonUp->setSubWidget(widget); diff --git a/src/org/atriasoft/ewol/widget/meta/StdPopUp.cpp b/src/org/atriasoft/ewol/widget/meta/StdPopUp.cpp index c41fa39..2a19c0a 100644 --- a/src/org/atriasoft/ewol/widget/meta/StdPopUp.cpp +++ b/src/org/atriasoft/ewol/widget/meta/StdPopUp.cpp @@ -31,7 +31,7 @@ ewol::widget::StdPopUp::StdPopUp() : void ewol::widget::StdPopUp::init() { ewol::widget::PopUp::init(); - propertyMinSize.set(gale::Dimension(vec2(20,10),gale::distance::pourcent)); + propertyMinSize.set(gale::Dimension(Vector2f(20,10),gale::distance::pourcent)); ewol::widget::SizerShared mySizerVert; ewol::widget::SpacerShared mySpacer; @@ -41,44 +41,44 @@ void ewol::widget::StdPopUp::init() { mySizerVert->propertyMode.set(widget::Sizer::modeVert); m_subBar = ewol::widget::Sizer::create(); m_subBar->propertyMode.set(widget::Sizer::modeHori); - m_subBar->propertyLockExpand.set(bvec2(true,true)); - m_subBar->propertyExpand.set(bvec2(true,false)); + m_subBar->propertyLockExpand.set(Vector2b(true,true)); + m_subBar->propertyExpand.set(Vector2b(true,false)); mySizerVert->subWidgetAdd(m_subBar); mySpacer = ewol::widget::Spacer::create(); - mySpacer->propertyExpand.set(bvec2(true,false)); + mySpacer->propertyExpand.set(Vector2b(true,false)); m_subBar->subWidgetAdd(mySpacer); mySpacer = ewol::widget::Spacer::create(); - mySpacer->propertyExpand.set(bvec2(true,false)); + mySpacer->propertyExpand.set(Vector2b(true,false)); mySpacer->propertyColor.set(etk::Color<>(0x88, 0x88, 0x88, 0xFF)); - mySpacer->propertyMinSize.set(gale::Dimension(vec2(0,3),gale::distance::pixel)); + mySpacer->propertyMinSize.set(gale::Dimension(Vector2f(0,3),gale::distance::pixel)); mySizerVert->subWidgetAdd(mySpacer); mySpacer = ewol::widget::Spacer::create(); - mySpacer->propertyExpand.set(bvec2(true,false)); - mySpacer->propertyMinSize.set(gale::Dimension(vec2(0,5),gale::distance::pixel)); + mySpacer->propertyExpand.set(Vector2b(true,false)); + mySpacer->propertyMinSize.set(gale::Dimension(Vector2f(0,5),gale::distance::pixel)); mySizerVert->subWidgetAdd(mySpacer); m_comment = ewol::widget::Label::create(); m_comment->propertyValue.set(*propertyComment); - m_comment->propertyExpand.set(bvec2(true,true)); + m_comment->propertyExpand.set(Vector2b(true,true)); mySizerVert->subWidgetAdd(m_comment); mySpacer = ewol::widget::Spacer::create(); - mySpacer->propertyExpand.set(bvec2(true,false)); - mySpacer->propertyMinSize.set(gale::Dimension(vec2(0,5),gale::distance::pixel)); + mySpacer->propertyExpand.set(Vector2b(true,false)); + mySpacer->propertyMinSize.set(gale::Dimension(Vector2f(0,5),gale::distance::pixel)); mySizerVert->subWidgetAdd(mySpacer); mySpacer = ewol::widget::Spacer::create(); - mySpacer->propertyExpand.set(bvec2(true,false)); + mySpacer->propertyExpand.set(Vector2b(true,false)); mySpacer->propertyColor.set(etk::Color<>(0x88, 0x88, 0x88, 0xFF)); - mySpacer->propertyMinSize.set(gale::Dimension(vec2(0,3),gale::distance::pixel)); + mySpacer->propertyMinSize.set(gale::Dimension(Vector2f(0,3),gale::distance::pixel)); mySizerVert->subWidgetAdd(mySpacer); m_title = ewol::widget::Label::create(); m_title->propertyValue.set(*propertyTitle); - m_title->propertyExpand.set(bvec2(true,false)); - m_title->propertyFill.set(bvec2(true,true)); + m_title->propertyExpand.set(Vector2b(true,false)); + m_title->propertyFill.set(Vector2b(true,true)); mySizerVert->subWidgetAdd(m_title); } @@ -104,17 +104,17 @@ void ewol::widget::StdPopUp::onChangePropertyComment() { ewol::widget::ButtonShared ewol::widget::StdPopUp::addButton(const etk::String& _text, bool _autoExit) { if (m_subBar == null) { - EWOL_ERROR("button-bar does not existed ..."); + Log.error("button-bar does not existed ..."); return null; } ewol::widget::ButtonShared myButton = widget::Button::create(); if (myButton == null) { - EWOL_ERROR("Can not allocate new button ..."); + Log.error("Can not allocate new button ..."); return null; } ewol::widget::LabelShared myLabel = ewol::widget::Label::create(); if (myLabel == null) { - EWOL_ERROR("Can not allocate new label ..."); + Log.error("Can not allocate new label ..."); return null; } myLabel->propertyValue.set(_text);