[DEV] adapt vector 2D, 3D and 4D wrapper with statdard glsl vec[2-4] ivec[2-4] and std mat4

This commit is contained in:
Edouard DUPIN 2012-12-03 10:00:01 +01:00
parent d61e67773c
commit ae29b34eab
93 changed files with 574 additions and 574 deletions

2
external/etk vendored

@ -1 +1 @@
Subproject commit 03c1459c66ee3f4da2c6140612949e99f8d7248c
Subproject commit a44667d4566066767a7961dde989a661c932943e

View File

@ -31,21 +31,21 @@ void ewol::Compositing::ResetMatrix(void)
}
void ewol::Compositing::Translate(etk::Vector3D<float> vect)
void ewol::Compositing::Translate(vec3 vect)
{
m_matrixApply *= etk::Matrix4::Translate(vect);
m_matrixApply *= mat4::Translate(vect);
}
void ewol::Compositing::Rotate(etk::Vector3D<float> vect, float angle)
void ewol::Compositing::Rotate(vec3 vect, float angle)
{
m_matrixApply *= etk::Matrix4::Rotate(vect, angle);
m_matrixApply *= mat4::Rotate(vect, angle);
}
void ewol::Compositing::Scale(etk::Vector3D<float> vect)
void ewol::Compositing::Scale(vec3 vect)
{
m_matrixApply *= etk::Matrix4::Scale(vect);
m_matrixApply *= mat4::Scale(vect);
}

View File

@ -18,7 +18,7 @@ namespace ewol
class Compositing
{
protected:
etk::Matrix4 m_matrixApply;
mat4 m_matrixApply;
public:
/**
* @brief generic constructor
@ -44,17 +44,17 @@ namespace ewol
* @brief Translate the current display of this element
* @param[in] vect The translation vector to apply at the transformation matrix
*/
virtual void Translate(etk::Vector3D<float> vect);
virtual void Translate(vec3 vect);
/**
* @brief Rotate the curent display of this element
* @param[in] vect The rotation vector to apply at the transformation matrix
*/
virtual void Rotate(etk::Vector3D<float> vect, float angle);
virtual void Rotate(vec3 vect, float angle);
/**
* @brief Scale the current diaplsy of this element
* @param[in] vect The scaling vector to apply at the transformation matrix
*/
virtual void Scale(etk::Vector3D<float> vect);
virtual void Scale(vec3 vect);
};
};

View File

@ -12,7 +12,7 @@
#if 0
static void generatePolyGone(etk::Vector<etk::Vector2D<float> > & input, etk::Vector<etk::Vector2D<float> > & output )
static void generatePolyGone(etk::Vector<vec2 > & input, etk::Vector<vec2 > & output )
{
if (input.Size()<3) {
return;
@ -26,7 +26,7 @@ static void generatePolyGone(etk::Vector<etk::Vector2D<float> > & input, etk::Ve
//EWOL_DEBUG("generate Plygone : " << input.Size() << " ==> " << output.Size() );
}
static void SutherlandHodgman(etk::Vector<etk::Vector2D<float> > & input, etk::Vector<etk::Vector2D<float> > & output, float sx, float sy, float ex, float ey)
static void SutherlandHodgman(etk::Vector<vec2 > & input, etk::Vector<vec2 > & output, float sx, float sy, float ex, float ey)
{
// with Sutherland-Hodgman-Algorithm
if (input.Size() <0) {
@ -34,8 +34,8 @@ static void SutherlandHodgman(etk::Vector<etk::Vector2D<float> > & input, etk::V
}
//int32_t sizeInit=input.Size();
// last element :
etk::Vector2D<float> destPoint;
etk::Vector2D<float> lastElement = input[input.Size()-1];
vec2 destPoint;
vec2 lastElement = input[input.Size()-1];
bool inside = true;
if (lastElement.x < sx) {
inside = false;
@ -271,7 +271,7 @@ void ewol::Drawing::InternalSetColor(draw::Color& color)
}
void ewol::Drawing::SetPoint(etk::Vector3D<float> point)
void ewol::Drawing::SetPoint(vec3 point)
{
m_triangle[m_triElement] = point;
m_triElement++;
@ -320,7 +320,7 @@ void ewol::Drawing::Draw(void)
return;
}
// set Matrix : translation/positionMatrix
etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix()*m_matrixApply;
mat4 tmpMatrix = ewol::openGL::GetMatrix()*m_matrixApply;
m_GLprogram->Use();
m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat);
// position :
@ -341,10 +341,10 @@ void ewol::Drawing::Clear(void)
m_coord.Clear();
m_coordColor.Clear();
// Reset temporal variables :
m_position = etk::Vector3D<float>(0.0, 0.0, 0.0);
m_position = vec3(0.0, 0.0, 0.0);
m_clippingPosStart = etk::Vector3D<float>(0.0, 0.0, 0.0);
m_clippingPosStop = etk::Vector3D<float>(0.0, 0.0, 0.0);
m_clippingPosStart = vec3(0.0, 0.0, 0.0);
m_clippingPosStop = vec3(0.0, 0.0, 0.0);
m_clippingEnable = false;
m_color = draw::color::black;
@ -357,19 +357,19 @@ void ewol::Drawing::Clear(void)
}
etk::Vector3D<float> ewol::Drawing::GetPos(void)
vec3 ewol::Drawing::GetPos(void)
{
return m_position;
}
void ewol::Drawing::SetPos(etk::Vector3D<float> pos)
void ewol::Drawing::SetPos(vec3 pos)
{
m_position = pos;
}
void ewol::Drawing::SetRelPos(etk::Vector3D<float> pos)
void ewol::Drawing::SetRelPos(vec3 pos)
{
m_position += pos;
}
@ -387,12 +387,12 @@ void ewol::Drawing::SetColorBg(draw::Color color)
}
void ewol::Drawing::SetClippingWidth(etk::Vector3D<float> pos, etk::Vector3D<float> width)
void ewol::Drawing::SetClippingWidth(vec3 pos, vec3 width)
{
SetClipping(pos, pos+width);
}
void ewol::Drawing::SetClipping(etk::Vector3D<float> pos, etk::Vector3D<float> posEnd)
void ewol::Drawing::SetClipping(vec3 pos, vec3 posEnd)
{
// note the internal system all time request to have a bounding all time in the same order
if (pos.x <= posEnd.x) {
@ -443,7 +443,7 @@ void ewol::Drawing::AddVertex(void)
}
void ewol::Drawing::LineTo(etk::Vector3D<float> dest)
void ewol::Drawing::LineTo(vec3 dest)
{
ResetCount();
InternalSetColor(m_color);
@ -467,24 +467,24 @@ void ewol::Drawing::LineTo(etk::Vector3D<float> dest)
float offsety = sin(teta-M_PI/2) * (m_thickness/2);
float offsetx = cos(teta-M_PI/2) * (m_thickness/2);
SetPoint(etk::Vector3D<float>(m_position.x - offsetx, m_position.y - offsety, (float)0.0) );
SetPoint(etk::Vector3D<float>(m_position.x + offsetx, m_position.y + offsety, (float)0.0) );
SetPoint(etk::Vector3D<float>(dest.x + offsetx, dest.y + offsety, (float)0.0) );
SetPoint(vec3(m_position.x - offsetx, m_position.y - offsety, (float)0.0) );
SetPoint(vec3(m_position.x + offsetx, m_position.y + offsety, (float)0.0) );
SetPoint(vec3(dest.x + offsetx, dest.y + offsety, (float)0.0) );
SetPoint(etk::Vector3D<float>(dest.x + offsetx, dest.y + offsety, (float)0.0) );
SetPoint(etk::Vector3D<float>(dest.x - offsetx, dest.y - offsety, (float)0.0) );
SetPoint(etk::Vector3D<float>(m_position.x - offsetx, m_position.y - offsety, (float)0.0) );
SetPoint(vec3(dest.x + offsetx, dest.y + offsety, (float)0.0) );
SetPoint(vec3(dest.x - offsetx, dest.y - offsety, (float)0.0) );
SetPoint(vec3(m_position.x - offsetx, m_position.y - offsety, (float)0.0) );
// update the system position :
m_position = dest;
}
void ewol::Drawing::LineRel(etk::Vector3D<float> vect)
void ewol::Drawing::LineRel(vec3 vect)
{
LineTo(m_position+vect);
}
void ewol::Drawing::Rectangle(etk::Vector3D<float> dest)
void ewol::Drawing::Rectangle(vec3 dest)
{
ResetCount();
InternalSetColor(m_color);
@ -517,24 +517,24 @@ void ewol::Drawing::Rectangle(etk::Vector3D<float> dest)
|| dxA >= dxB) {
return;
}
SetPoint(etk::Vector3D<float>(dxA, dyD, (float)0.0) );
SetPoint(etk::Vector3D<float>(dxA, dyC, (float)0.0) );
SetPoint(etk::Vector3D<float>(dxB, dyC, (float)0.0) );
SetPoint(vec3(dxA, dyD, (float)0.0) );
SetPoint(vec3(dxA, dyC, (float)0.0) );
SetPoint(vec3(dxB, dyC, (float)0.0) );
SetPoint(etk::Vector3D<float>(dxB, dyC, (float)0.0) );
SetPoint(etk::Vector3D<float>(dxB, dyD, (float)0.0) );
SetPoint(etk::Vector3D<float>(dxA, dyD, (float)0.0) );
SetPoint(vec3(dxB, dyC, (float)0.0) );
SetPoint(vec3(dxB, dyD, (float)0.0) );
SetPoint(vec3(dxA, dyD, (float)0.0) );
}
void ewol::Drawing::RectangleWidth(etk::Vector3D<float> size)
void ewol::Drawing::RectangleWidth(vec3 size)
{
Rectangle(m_position+size);
}
void ewol::Drawing::Cube(etk::Vector3D<float> dest)
void ewol::Drawing::Cube(vec3 dest)
{
}
@ -560,19 +560,19 @@ void ewol::Drawing::Circle(float radius, float angleStart, float angleStop)
if (m_colorBg.a!=0) {
InternalSetColor(m_colorBg);
for (int32_t iii=0; iii<nbOcurence; iii++) {
SetPoint(etk::Vector3D<float>(m_position.x, m_position.y) );
SetPoint(vec3(m_position.x, m_position.y) );
float angleOne = angleStart + (angleStop* iii / nbOcurence) ;
float offsety = sin(angleOne) * radius;
float offsetx = cos(angleOne) * radius;
SetPoint(etk::Vector3D<float>(m_position.x + offsetx, m_position.y + offsety) );
SetPoint(vec3(m_position.x + offsetx, m_position.y + offsety) );
float angleTwo = angleStart + (angleStop* (iii+1) / nbOcurence) ;
offsety = sin(angleTwo) * radius;
offsetx = cos(angleTwo) * radius;
SetPoint(etk::Vector3D<float>(m_position.x + offsetx, m_position.y + offsety) );
SetPoint(vec3(m_position.x + offsetx, m_position.y + offsety) );
}
}
@ -596,13 +596,13 @@ void ewol::Drawing::Circle(float radius, float angleStart, float angleStop)
float offsetInt2y = sin(angleTwo) * (radius-m_thickness/2);
float offsetInt2x = cos(angleTwo) * (radius-m_thickness/2);
SetPoint(etk::Vector3D<float>(m_position.x + offsetIntx, m_position.y + offsetInty));
SetPoint(etk::Vector3D<float>(m_position.x + offsetExtx, m_position.y + offsetExty));
SetPoint(etk::Vector3D<float>(m_position.x + offsetExt2x, m_position.y + offsetExt2y));
SetPoint(vec3(m_position.x + offsetIntx, m_position.y + offsetInty));
SetPoint(vec3(m_position.x + offsetExtx, m_position.y + offsetExty));
SetPoint(vec3(m_position.x + offsetExt2x, m_position.y + offsetExt2y));
SetPoint(etk::Vector3D<float>(m_position.x + offsetExt2x, m_position.y + offsetExt2y));
SetPoint(etk::Vector3D<float>(m_position.x + offsetInt2x, m_position.y + offsetInt2y));
SetPoint(etk::Vector3D<float>(m_position.x + offsetIntx, m_position.y + offsetInty));
SetPoint(vec3(m_position.x + offsetExt2x, m_position.y + offsetExt2y));
SetPoint(vec3(m_position.x + offsetInt2x, m_position.y + offsetInt2y));
SetPoint(vec3(m_position.x + offsetIntx, m_position.y + offsetInty));
}
}

View File

@ -21,9 +21,9 @@ namespace ewol
class Drawing : public ewol::Compositing
{
private:
etk::Vector3D<float> m_position; //!< The current position to draw
etk::Vector3D<float> m_clippingPosStart; //!< Clipping start position
etk::Vector3D<float> m_clippingPosStop; //!< Clipping stop position
vec3 m_position; //!< The current position to draw
vec3 m_clippingPosStart; //!< Clipping start position
vec3 m_clippingPosStop; //!< Clipping stop position
bool m_clippingEnable; //!< true if the clipping must be activated
private:
draw::Color m_color; //!< The text foreground color
@ -34,7 +34,7 @@ namespace ewol
int32_t m_GLMatrix; //!< openGL id on the element (transformation matrix)
int32_t m_GLColor; //!< openGL id on the element (color buffer)
private: // Background Color (display only when needed)
etk::Vector<etk::Vector3D<float> > m_coord; //!< internal position for the text display
etk::Vector<vec3 > m_coord; //!< internal position for the text display
etk::Vector<draw::Colorf> m_coordColor; //!< internal color of the background
public:
/**
@ -56,7 +56,7 @@ namespace ewol
void UnLoadProgram(void);
float m_thickness; //!< when drawing line and other things
int32_t m_triElement; //!< special counter of the single dot generated
etk::Vector3D<float> m_triangle[3]; //!< Register every system with a combinaison of tiangle
vec3 m_triangle[3]; //!< Register every system with a combinaison of tiangle
draw::Colorf m_tricolor[3]; //!< Register every the associated color foreground
// internal API for the generation abstraction of triangles
/**
@ -76,7 +76,7 @@ namespace ewol
* @brief internal add of the specific point
* @param[in] point The requeste dpoint to add
*/
void SetPoint(etk::Vector3D<float> point);
void SetPoint(vec3 point);
public:
/**
@ -91,17 +91,17 @@ namespace ewol
* @brief Get the current display position (sometime needed in the gui control)
* @return the current position.
*/
etk::Vector3D<float> GetPos(void);
vec3 GetPos(void);
/**
* @brief Set position for the next text writen
* @param[in] pos Position of the text (in 3D)
*/
void SetPos(etk::Vector3D<float> pos);
void SetPos(vec3 pos);
/**
* @brief Set relative position for the next text writen
* @param[in] pos ofset apply of the text (in 3D)
*/
void SetRelPos(etk::Vector3D<float> pos);
void SetRelPos(vec3 pos);
/**
* @brief Set the Color of the current foreground font
* @param[in] color Color to set on foreground (for next print)
@ -117,13 +117,13 @@ namespace ewol
* @param[in] pos Start position of the clipping
* @param[in] width Width size of the clipping
*/
void SetClippingWidth(etk::Vector3D<float> pos, etk::Vector3D<float> width);
void SetClippingWidth(vec3 pos, vec3 width);
/**
* @brief Request a clipping area for the text (next draw only)
* @param[in] pos Start position of the clipping
* @param[in] posEnd End position of the clipping
*/
void SetClipping(etk::Vector3D<float> pos, etk::Vector3D<float> posEnd);
void SetClipping(vec3 pos, vec3 posEnd);
/**
* @brief Enable/Disable the clipping (without lose the current clipping position)
* @brief newMode The new status of the clipping
@ -142,27 +142,27 @@ namespace ewol
* @brief Draw a line to a specific position
* @param[in] dest Position of the end of the line.
*/
void LineTo(etk::Vector3D<float> dest);
void LineTo(vec3 dest);
/**
* @brief Relative drawing a line (spacial vector)
* @param[in] vect Vector of the curent line.
*/
void LineRel(etk::Vector3D<float> vect);
void LineRel(vec3 vect);
/**
* @brief Draw a 2D rectangle to the position requested.
* @param[in] dest Position the the end of the rectangle
*/
void Rectangle(etk::Vector3D<float> dest);
void Rectangle(vec3 dest);
/**
* @brief Draw a 2D rectangle to the requested size.
* @param[in] width size of the rectangle
*/
void RectangleWidth(etk::Vector3D<float> size);
void RectangleWidth(vec3 size);
/**
* @brief Draw a 3D rectangle to the position requested.
* @param[in] dest Position the the end of the rectangle
*/
void Cube(etk::Vector3D<float> dest);
void Cube(vec3 dest);
/**
* @brief Draw a 2D circle with the specify rafdius parameter.
* @param[in] radius Distence to the dorder

View File

@ -73,7 +73,7 @@ void ewol::Image::Draw(void)
return;
}
// set Matrix : translation/positionMatrix
etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix()*m_matrixApply;
mat4 tmpMatrix = ewol::openGL::GetMatrix()*m_matrixApply;
m_GLprogram->Use();
m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat);
// TextureID
@ -98,29 +98,29 @@ void ewol::Image::Clear(void)
m_coordTex.Clear();
m_coordColor.Clear();
// Reset temporal variables :
m_position = etk::Vector3D<float>(0.0, 0.0, 0.0);
m_clippingPosStart = etk::Vector3D<float>(0.0, 0.0, 0.0);
m_clippingPosStop = etk::Vector3D<float>(0.0, 0.0, 0.0);
m_position = vec3(0.0, 0.0, 0.0);
m_clippingPosStart = vec3(0.0, 0.0, 0.0);
m_clippingPosStop = vec3(0.0, 0.0, 0.0);
m_clippingEnable = false;
m_color = draw::color::white;
m_axes = etk::Vector3D<float>(0.0, 0.0, 0.0);
m_axes = vec3(0.0, 0.0, 0.0);
m_angle = 0.0;
}
etk::Vector3D<float> ewol::Image::GetPos(void)
vec3 ewol::Image::GetPos(void)
{
return m_position;
}
void ewol::Image::SetPos(etk::Vector3D<float> pos)
void ewol::Image::SetPos(vec3 pos)
{
m_position = pos;
}
void ewol::Image::SetRelPos(etk::Vector3D<float> pos)
void ewol::Image::SetRelPos(vec3 pos)
{
m_position += pos;
}
@ -132,12 +132,12 @@ void ewol::Image::SetColor(draw::Color color)
}
void ewol::Image::SetClippingWidth(etk::Vector3D<float> pos, etk::Vector3D<float> width)
void ewol::Image::SetClippingWidth(vec3 pos, vec3 width)
{
SetClipping(pos, pos+width);
}
void ewol::Image::SetClipping(etk::Vector3D<float> pos, etk::Vector3D<float> posEnd)
void ewol::Image::SetClipping(vec3 pos, vec3 posEnd)
{
// note the internal system all time request to have a bounding all time in the same order
if (pos.x <= posEnd.x) {
@ -171,7 +171,7 @@ void ewol::Image::SetClippingMode(bool newMode)
}
void ewol::Image::SetAngle(etk::Vector3D<float> axes, float angle)
void ewol::Image::SetAngle(vec3 axes, float angle)
{
m_axes = axes;
m_angle = angle;
@ -182,10 +182,10 @@ void ewol::Image::SetAngle(etk::Vector3D<float> axes, float angle)
}
}
void ewol::Image::Print(etk::Vector2D<int32_t> size)
void ewol::Image::Print(ivec2 size)
{
etk::Vector3D<float> point;
etk::Vector2D<float> tex;
vec3 point;
vec2 tex;
point.z = 0;
tex.x = 0;
@ -235,9 +235,9 @@ void ewol::Image::Print(etk::Vector2D<int32_t> size)
m_coordColor.PushBack(m_color);
}
void ewol::Image::PrintPart(etk::Vector2D<int32_t> size,
etk::Vector2D<float> sourcePosStart,
etk::Vector2D<float> sourcePosStop)
void ewol::Image::PrintPart(ivec2 size,
vec2 sourcePosStart,
vec2 sourcePosStop)
{
}
@ -250,7 +250,7 @@ void ewol::Image::SetSource(etk::UString newFile)
ewol::resource::Release(m_resource);
m_resource = NULL;
}
etk::Vector2D<int32_t> size(32,32);
ivec2 size(32,32);
// note that no image can be loaded...
if (newFile != "") {
// link to new One

View File

@ -19,13 +19,13 @@ namespace ewol
{
private:
private:
etk::Vector3D<float> m_position; //!< The current position to draw
etk::Vector3D<float> m_clippingPosStart; //!< Clipping start position
etk::Vector3D<float> m_clippingPosStop; //!< Clipping stop position
vec3 m_position; //!< The current position to draw
vec3 m_clippingPosStart; //!< Clipping start position
vec3 m_clippingPosStop; //!< Clipping stop position
bool m_clippingEnable; //!< true if the clipping must be activated
private:
draw::Color m_color; //!< The text foreground color
etk::Vector3D<float> m_axes; //!< Rotation axes (instant)
vec3 m_axes; //!< Rotation axes (instant)
float m_angle; //!< Angle to set at the axes
private:
ewol::Program* m_GLprogram; //!< pointer on the opengl display program
@ -36,8 +36,8 @@ namespace ewol
int32_t m_GLtexID; //!< openGL id on the element (texture ID)
private:
ewol::TextureFile* m_resource; //!< texture resources
etk::Vector<etk::Vector3D<float> > m_coord; //!< internal coord of the object
etk::Vector<etk::Vector2D<float> > m_coordTex; //!< internal texture coordinate for every point
etk::Vector<vec3 > m_coord; //!< internal coord of the object
etk::Vector<vec2 > m_coordTex; //!< internal texture coordinate for every point
etk::Vector<draw::Colorf> m_coordColor; //!< internal color of the different point
private:
/**
@ -67,17 +67,17 @@ namespace ewol
* @brief Get the current display position (sometime needed in the gui control)
* @return the current position.
*/
etk::Vector3D<float> GetPos(void);
vec3 GetPos(void);
/**
* @brief Set position for the next text writen
* @param[in] pos Position of the text (in 3D)
*/
void SetPos(etk::Vector3D<float> pos);
void SetPos(vec3 pos);
/**
* @brief Set relative position for the next text writen
* @param[in] pos ofset apply of the text (in 3D)
*/
void SetRelPos(etk::Vector3D<float> pos);
void SetRelPos(vec3 pos);
/**
* @brief Set the Color of the current foreground font
* @param[in] color Color to set on foreground (for next print)
@ -88,13 +88,13 @@ namespace ewol
* @param[in] pos Start position of the clipping
* @param[in] width Width size of the clipping
*/
void SetClippingWidth(etk::Vector3D<float> pos, etk::Vector3D<float> width);
void SetClippingWidth(vec3 pos, vec3 width);
/**
* @brief Request a clipping area for the text (next draw only)
* @param[in] pos Start position of the clipping
* @param[in] posEnd End position of the clipping
*/
void SetClipping(etk::Vector3D<float> pos, etk::Vector3D<float> posEnd);
void SetClipping(vec3 pos, vec3 posEnd);
/**
* @brief Enable/Disable the clipping (without lose the current clipping position)
* @brief newMode The new status of the clipping
@ -105,21 +105,21 @@ namespace ewol
* @param[in] axes Rotation axes selection
* @param[in] angle Angle to set on this axes
*/
void SetAngle(etk::Vector3D<float> axes, float angle);
void SetAngle(vec3 axes, float angle);
/**
* @brief Add a compleate of the image to display with the requested size
* @param[in] size Size of the output image
*/
void Print(etk::Vector2D<int32_t> size);
void Print(ivec2 size);
/**
* @brief Add a part of the image to display with the requested size
* @param[in] size Size of the output image
* @param[in] sourcePosStart Start position in the image [0..1] (can be bigger but this repeate the image).
* @param[in] sourcePosStop Stop position in the image [0..1] (can be bigger but this repeate the image).
*/
void PrintPart(etk::Vector2D<int32_t> size,
etk::Vector2D<float> sourcePosStart,
etk::Vector2D<float> sourcePosStop);
void PrintPart(ivec2 size,
vec2 sourcePosStart,
vec2 sourcePosStop);
/**
* @brief Change the image Source ==> can not be done to display 2 images at the same time ...
* @param[in] newFile New file of the Image

View File

@ -103,7 +103,7 @@ void ewol::Shaper::LoadProgram(void)
etk::UString basicImageFile = m_config->GetString(m_confImageFile);
if (basicImageFile != "") {
tmpFilename = file.GetRelativeFolder() + basicImageFile;
etk::Vector2D<int32_t> size(64,64);
ivec2 size(64,64);
if (true == ewol::resource::Keep(tmpFilename, m_resourceTexture, size) ) {
// nothing else to do ...
}
@ -125,7 +125,7 @@ void ewol::Shaper::Draw(void)
//glScalef(m_scaling.x, m_scaling.y, 1.0);
m_GLprogram->Use();
// set Matrix : translation/positionMatrix
etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix();
mat4 tmpMatrix = ewol::openGL::GetMatrix();
m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat);
// position :
m_GLprogram->SendAttribute(m_GLPosition, 2/*x,y*/, m_coord);
@ -220,7 +220,7 @@ void ewol::Shaper::UpdateVectex(void)
m_coord[5].y= m_propertyOrigin.y+m_propertySize.y;
}
void ewol::Shaper::SetOrigin(etk::Vector2D<float> newOri)
void ewol::Shaper::SetOrigin(vec2 newOri)
{
if (m_propertyOrigin != newOri) {
m_propertyOrigin = newOri;
@ -229,7 +229,7 @@ void ewol::Shaper::SetOrigin(etk::Vector2D<float> newOri)
}
void ewol::Shaper::SetSize(etk::Vector2D<float> newSize)
void ewol::Shaper::SetSize(vec2 newSize)
{
if (m_propertySize != newSize) {
m_propertySize = newSize;
@ -237,20 +237,20 @@ void ewol::Shaper::SetSize(etk::Vector2D<float> newSize)
}
}
void ewol::Shaper::SetInsideSize(etk::Vector2D<float> newInsideSize)
void ewol::Shaper::SetInsideSize(vec2 newInsideSize)
{
m_propertyInsideSize = newInsideSize;
}
void ewol::Shaper::SetInsidePos(etk::Vector2D<float> newInsidePos)
void ewol::Shaper::SetInsidePos(vec2 newInsidePos)
{
m_propertyInsidePosition = newInsidePos;
}
etk::Vector2D<float> ewol::Shaper::GetPadding(void)
vec2 ewol::Shaper::GetPadding(void)
{
etk::Vector2D<float> padding;
vec2 padding;
if (m_config!=NULL) {
padding.x = m_config->GetFloat(m_confIdPaddingX);
padding.y = m_config->GetFloat(m_confIdPaddingY);

View File

@ -48,14 +48,14 @@ namespace ewol
// internal needed data :
int32_t m_nextStatusRequested; //!< when status is changing, this represent the next step of it
int64_t m_time; //!< The last time of the dispaly (-1 if nothing progressing)
etk::Vector2D<float> m_propertyOrigin; //!< widget origin
etk::Vector2D<float> m_propertySize; //!< widget size
etk::Vector2D<float> m_propertyInsidePosition; //!< internal subwidget position
etk::Vector2D<float> m_propertyInsideSize; //!< internal subwidget size
vec2 m_propertyOrigin; //!< widget origin
vec2 m_propertySize; //!< widget size
vec2 m_propertyInsidePosition; //!< internal subwidget position
vec2 m_propertyInsideSize; //!< internal subwidget size
int32_t m_stateOld; //!< previous state
int32_t m_stateNew; //!< destination state
float m_stateTransition; //!< working state between 2 states
etk::Vector2D<float> m_coord[6]; //!< the double triangle coordonates
vec2 m_coord[6]; //!< the double triangle coordonates
private:
/**
* @brief Load the openGL program and get all the ID needed
@ -112,27 +112,27 @@ namespace ewol
* @brief Set the widget origin (needed fot the display)
* @param[in] newOri : the new widget origin
*/
void SetOrigin(etk::Vector2D<float> newOri);
void SetOrigin(vec2 newOri);
/**
* @brief Set the widget size (needed fot the display)
* @param[in] newSize : the new widget size
*/
void SetSize(etk::Vector2D<float> newSize);
void SetSize(vec2 newSize);
/**
* @brief Set the internal widget size
* @param[in] newInsidePos : the subelement size.
*/
void SetInsideSize(etk::Vector2D<float> newInsideSize);
void SetInsideSize(vec2 newInsideSize);
/**
* @brief Set the internal widget position
* @param[in] newInsidePos : the subelement position
*/
void SetInsidePos(etk::Vector2D<float> newInsidePos);
void SetInsidePos(vec2 newInsidePos);
/**
* @brief Get the padding declared by the user in the config file
* @return the padding property
*/
etk::Vector2D<float> GetPadding(void);
vec2 GetPadding(void);
/**
* @brief Change the image Source ==> can not be done to display 2 images at the same time ...
* @param[in] newFile New file of the Image

View File

@ -117,7 +117,7 @@ void ewol::Text::Draw(void)
return;
}
// set Matrix : translation/positionMatrix
etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix()*m_matrixApply;
mat4 tmpMatrix = ewol::openGL::GetMatrix()*m_matrixApply;
m_GLprogram->Use();
m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat);
// TextureID
@ -133,21 +133,21 @@ void ewol::Text::Draw(void)
m_GLprogram->UnUse();
}
void ewol::Text::Translate(etk::Vector3D<float> vect)
void ewol::Text::Translate(vec3 vect)
{
ewol::Compositing::Translate(vect);
m_vectorialDraw.Translate(vect);
}
void ewol::Text::Rotate(etk::Vector3D<float> vect, float angle)
void ewol::Text::Rotate(vec3 vect, float angle)
{
ewol::Compositing::Rotate(vect, angle);
m_vectorialDraw.Rotate(vect, angle);
}
void ewol::Text::Scale(etk::Vector3D<float> vect)
void ewol::Text::Scale(vec3 vect)
{
ewol::Compositing::Scale(vect);
m_vectorialDraw.Scale(vect);
@ -170,9 +170,9 @@ void ewol::Text::Clear(void)
void ewol::Text::Reset(void)
{
m_position = etk::Vector3D<float>(0.0, 0.0, 0.0);
m_clippingPosStart = etk::Vector3D<float>(0.0, 0.0, 0.0);
m_clippingPosStop = etk::Vector3D<float>(0.0, 0.0, 0.0);
m_position = vec3(0.0, 0.0, 0.0);
m_clippingPosStart = vec3(0.0, 0.0, 0.0);
m_clippingPosStop = vec3(0.0, 0.0, 0.0);
m_sizeDisplayStart = m_position;
m_sizeDisplayStop = m_position;
m_nbCharDisplayed = 0;
@ -193,13 +193,13 @@ void ewol::Text::Reset(void)
}
etk::Vector3D<float> ewol::Text::GetPos(void)
vec3 ewol::Text::GetPos(void)
{
return m_position;
}
void ewol::Text::SetPos(etk::Vector3D<float> pos)
void ewol::Text::SetPos(vec3 pos)
{
// check min max for display area
if (m_nbCharDisplayed != 0) {
@ -231,7 +231,7 @@ void ewol::Text::SetPos(etk::Vector3D<float> pos)
}
void ewol::Text::SetRelPos(etk::Vector3D<float> pos)
void ewol::Text::SetRelPos(vec3 pos)
{
m_position += pos;
m_previousCharcode = 0;
@ -252,12 +252,12 @@ void ewol::Text::SetColorBg(draw::Color color)
}
void ewol::Text::SetClippingWidth(etk::Vector3D<float> pos, etk::Vector3D<float> width)
void ewol::Text::SetClippingWidth(vec3 pos, vec3 width)
{
SetClipping(pos, pos+width);
}
void ewol::Text::SetClipping(etk::Vector3D<float> pos, etk::Vector3D<float> posEnd)
void ewol::Text::SetClipping(vec3 pos, vec3 posEnd)
{
// note the internal system all time request to have a bounding all time in the same order
if (pos.x <= posEnd.x) {
@ -574,11 +574,11 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector<TextDecoratio
}
if( true == m_needDisplay
&& m_colorBg.a != 0) {
etk::Vector3D<float> pos = m_position;
vec3 pos = m_position;
m_vectorialDraw.SetPos(pos);
Print(text[iii]);
float fontHeigh = m_font->GetHeight(m_mode);
m_vectorialDraw.RectangleWidth(etk::Vector3D<float>(m_position.x-pos.x,fontHeigh,0.0f) );
m_vectorialDraw.RectangleWidth(vec3(m_position.x-pos.x,fontHeigh,0.0f) );
m_nbCharDisplayed++;
} else {
Print(text[iii]);
@ -620,7 +620,7 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector<TextDecoratio
case ewol::Text::alignRight:
if (m_needDisplay == true) {
// Move the first char at the right :
SetPos(etk::Vector3D<float>(m_position.x + freeSpace,
SetPos(vec3(m_position.x + freeSpace,
m_position.y,
m_position.z) );
}
@ -628,7 +628,7 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector<TextDecoratio
case ewol::Text::alignCenter:
if (m_needDisplay == true) {
// Move the first char at the right :
SetPos(etk::Vector3D<float>(m_position.x + freeSpace/2,
SetPos(vec3(m_position.x + freeSpace/2,
m_position.y,
m_position.z) );
}
@ -669,21 +669,21 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector<TextDecoratio
m_vectorialDraw.SetPos(m_position);
}
// Must generate a dynamic space :
SetPos(etk::Vector3D<float>(m_position.x + interpolation,
SetPos(vec3(m_position.x + interpolation,
m_position.y,
m_position.z) );
if( true == m_needDisplay
&& m_colorBg.a != 0) {
m_vectorialDraw.RectangleWidth(etk::Vector3D<float>(interpolation,fontHeigh,0.0f) );
m_vectorialDraw.RectangleWidth(vec3(interpolation,fontHeigh,0.0f) );
}
} else {
//EWOL_DEBUG(" generateString : \"" << (char)text[iii] << "\"");
if( true == m_needDisplay
&& m_colorBg.a != 0) {
etk::Vector3D<float> pos = m_position;
vec3 pos = m_position;
m_vectorialDraw.SetPos(pos);
Print(text[iii]);
m_vectorialDraw.RectangleWidth(etk::Vector3D<float>(m_position.x-pos.x,fontHeigh,0.0f) );
m_vectorialDraw.RectangleWidth(vec3(m_position.x-pos.x,fontHeigh,0.0f) );
m_nbCharDisplayed++;
} else {
Print(text[iii]);
@ -703,14 +703,14 @@ void ewol::Text::Print(const etk::UString& text, const etk::Vector<TextDecoratio
} else if(text[stop] == (uniChar_t)' ') {
currentId = stop+1;
// Reset position :
SetPos(etk::Vector3D<float>(m_startTextpos,
SetPos(vec3(m_startTextpos,
(float)(m_position.y - m_font->GetHeight(m_mode)),
m_position.z) );
m_nbCharDisplayed++;
} else if(text[stop] == (uniChar_t)'\n') {
currentId = stop+1;
// Reset position :
SetPos(etk::Vector3D<float>(m_startTextpos,
SetPos(vec3(m_startTextpos,
(float)(m_position.y - m_font->GetHeight(m_mode)),
m_position.z) );
m_nbCharDisplayed++;
@ -821,7 +821,7 @@ void ewol::Text::Print(const uniChar_t charcode)
* 3------2
*/
if (m_needDisplay == true) {
etk::Vector2D<int32_t> bitmapDrawPos[4];
ivec2 bitmapDrawPos[4];
bitmapDrawPos[0].x = (int32_t)dxA;
bitmapDrawPos[1].x = (int32_t)dxB;
bitmapDrawPos[2].x = (int32_t)dxB;
@ -837,7 +837,7 @@ void ewol::Text::Print(const uniChar_t charcode)
* | |
* 3------2
*/
etk::Vector2D<float> texturePos[4];
vec2 texturePos[4];
texturePos[0].x = tuA+m_mode;
texturePos[1].x = tuB+m_mode;
texturePos[2].x = tuB+m_mode;
@ -901,7 +901,7 @@ void ewol::Text::Print(const uniChar_t charcode)
void ewol::Text::ForceLineReturn(void)
{
// Reset position :
SetPos(etk::Vector3D<float>(m_startTextpos, m_position.y - m_font->GetHeight(m_mode), 0) );
SetPos(vec3(m_startTextpos, m_position.y - m_font->GetHeight(m_mode), 0) );
}
@ -928,7 +928,7 @@ void ewol::Text::DisableAlignement(void)
}
etk::Vector3D<float> ewol::Text::CalculateSizeHTML(const etk::UString& text)
vec3 ewol::Text::CalculateSizeHTML(const etk::UString& text)
{
// remove intermediate result
Reset();
@ -936,7 +936,7 @@ etk::Vector3D<float> ewol::Text::CalculateSizeHTML(const etk::UString& text)
// disable display system
m_needDisplay = false;
SetPos(etk::Vector3D<float>(0,0,0) );
SetPos(vec3(0,0,0) );
// same as print without the end display ...
PrintHTML(text);
// get the last elements
@ -948,29 +948,29 @@ etk::Vector3D<float> ewol::Text::CalculateSizeHTML(const etk::UString& text)
// set back the display system
m_needDisplay = true;
return etk::Vector3D<float>( m_sizeDisplayStop.x-m_sizeDisplayStart.x,
return vec3( m_sizeDisplayStop.x-m_sizeDisplayStart.x,
m_sizeDisplayStop.y-m_sizeDisplayStart.y,
m_sizeDisplayStop.z-m_sizeDisplayStart.z);
}
etk::Vector3D<float> ewol::Text::CalculateSizeDecorated(const etk::UString& text)
vec3 ewol::Text::CalculateSizeDecorated(const etk::UString& text)
{
etk::UString tmpData("<html><body>\n");
tmpData+=text;
tmpData+="\n</body></html>\n";
etk::Vector3D<float> tmpVal = CalculateSizeHTML(tmpData);
vec3 tmpVal = CalculateSizeHTML(tmpData);
return tmpVal;
}
etk::Vector3D<float> ewol::Text::CalculateSize(const etk::UString& text)
vec3 ewol::Text::CalculateSize(const etk::UString& text)
{
if (m_font == NULL) {
EWOL_ERROR("Font Id is not corectly defined");
return etk::Vector3D<float>(0,0,0);
return vec3(0,0,0);
}
etk::Vector3D<float> outputSize(0, 0, 0);
vec3 outputSize(0, 0, 0);
for(int32_t iii=0; iii<text.Size(); iii++) {
etk::Vector3D<float> tmpp = CalculateSize(text[iii]);
vec3 tmpp = CalculateSize(text[iii]);
if (outputSize.y == 0) {
outputSize.y += tmpp.y;
}
@ -979,11 +979,11 @@ etk::Vector3D<float> ewol::Text::CalculateSize(const etk::UString& text)
return outputSize;
}
etk::Vector3D<float> ewol::Text::CalculateSize(const uniChar_t charcode)
vec3 ewol::Text::CalculateSize(const uniChar_t charcode)
{
if (m_font == NULL) {
EWOL_ERROR("Font Id is not corectly defined");
return etk::Vector3D<float>(0,0,0);
return vec3(0,0,0);
}
// get a pointer on the glyph property :
ewol::GlyphProperty * myGlyph = m_font->GetGlyphPointer(charcode, m_mode);
@ -995,7 +995,7 @@ etk::Vector3D<float> ewol::Text::CalculateSize(const uniChar_t charcode)
kerningOffset = myGlyph->KerningGet(m_previousCharcode);
}
etk::Vector3D<float> outputSize((float)(myGlyph->m_advance.x + kerningOffset),
vec3 outputSize((float)(myGlyph->m_advance.x + kerningOffset),
(float)(fontHeigh),
(float)(0.0));
// Register the previous character
@ -1008,10 +1008,10 @@ void ewol::Text::PrintCursor(bool isInsertMode)
{
int32_t fontHeigh = m_font->GetHeight(m_mode);
if (true == isInsertMode) {
m_vectorialDraw.RectangleWidth(etk::Vector3D<float>(20, fontHeigh, 0) );
m_vectorialDraw.RectangleWidth(vec3(20, fontHeigh, 0) );
} else {
m_vectorialDraw.SetThickness(2);
m_vectorialDraw.LineRel( etk::Vector3D<float>(0, fontHeigh, 0) );
m_vectorialDraw.LineRel( vec3(0, fontHeigh, 0) );
m_vectorialDraw.SetThickness(0);
}
}
@ -1038,7 +1038,7 @@ bool ewol::Text::ExtrapolateLastId(const etk::UString& text, const int32_t start
}
for (int32_t iii=start; iii<text.Size(); iii++) {
etk::Vector3D<float> tmpSize = CalculateSize(text[iii]);
vec3 tmpSize = CalculateSize(text[iii]);
// check oveflow :
if (endPos + tmpSize.x > stopPosition) {
stop = iii;

View File

@ -50,13 +50,13 @@ namespace ewol
ewol::Drawing m_vectorialDraw; //!< This is used to draw background selection and other things ...
private:
int32_t m_nbCharDisplayed; //!< prevent some error in calculation size.
etk::Vector3D<float> m_sizeDisplayStart; //!< The start windows of the display.
etk::Vector3D<float> m_sizeDisplayStop; //!< The end windows of the display.
vec3 m_sizeDisplayStart; //!< The start windows of the display.
vec3 m_sizeDisplayStop; //!< The end windows of the display.
bool m_needDisplay; //!< This just need the display and not the size rendering.
etk::Vector3D<float> m_position; //!< The current position to draw
etk::Vector3D<float> m_clippingPosStart; //!< Clipping start position
etk::Vector3D<float> m_clippingPosStop; //!< Clipping stop position
vec3 m_position; //!< The current position to draw
vec3 m_clippingPosStart; //!< Clipping start position
vec3 m_clippingPosStop; //!< Clipping stop position
bool m_clippingEnable; //!< true if the clipping must be activated
private:
draw::Color m_color; //!< The text foreground color
@ -85,8 +85,8 @@ namespace ewol
private:
ewol::TexturedFont* m_font; //!< Font resources
private: // Text
etk::Vector<etk::Vector2D<float> > m_coord; //!< internal coord of the object
etk::Vector<etk::Vector2D<float> > m_coordTex; //!< internal texture coordinate for every point
etk::Vector<vec2 > m_coord; //!< internal coord of the object
etk::Vector<vec2 > m_coordTex; //!< internal texture coordinate for every point
etk::Vector<draw::Colorf> m_coordColor; //!< internal color of the different point
private:
/**
@ -110,11 +110,11 @@ namespace ewol
~Text(void);
public:
// Derived function
virtual void Translate(etk::Vector3D<float> vect);
virtual void Translate(vec3 vect);
// Derived function
virtual void Rotate(etk::Vector3D<float> vect, float angle);
virtual void Rotate(vec3 vect, float angle);
// Derived function
virtual void Scale(etk::Vector3D<float> vect);
virtual void Scale(vec3 vect);
public:
/**
* @brief Draw All the refistered text in the current element on openGL
@ -132,17 +132,17 @@ namespace ewol
* @brief Get the current display position (sometime needed in the gui control)
* @return the current position.
*/
etk::Vector3D<float> GetPos(void);
vec3 GetPos(void);
/**
* @brief Set position for the next text writen
* @param[in] pos Position of the text (in 3D)
*/
void SetPos(etk::Vector3D<float> pos);
void SetPos(vec3 pos);
/**
* @brief Set relative position for the next text writen
* @param[in] pos ofset apply of the text (in 3D)
*/
void SetRelPos(etk::Vector3D<float> pos);
void SetRelPos(vec3 pos);
/**
* @brief Set the Color of the current foreground font
* @param[in] color Color to set on foreground (for next print)
@ -158,13 +158,13 @@ namespace ewol
* @param[in] pos Start position of the clipping
* @param[in] width Width size of the clipping
*/
void SetClippingWidth(etk::Vector3D<float> pos, etk::Vector3D<float> width);
void SetClippingWidth(vec3 pos, vec3 width);
/**
* @brief Request a clipping area for the text (next draw only)
* @param[in] pos Start position of the clipping
* @param[in] posEnd End position of the clipping
*/
void SetClipping(etk::Vector3D<float> pos, etk::Vector3D<float> posEnd);
void SetClipping(vec3 pos, vec3 posEnd);
/**
* @brief Enable/Disable the clipping (without lose the current clipping position)
* @brief newMode The new status of the clipping
@ -327,25 +327,25 @@ namespace ewol
* @param[in] text The string to calculate dimention.
* @return The theoric size used.
*/
etk::Vector3D<float> CalculateSizeHTML(const etk::UString& text);
vec3 CalculateSizeHTML(const etk::UString& text);
/**
* @brief Calculate a theoric text size
* @param[in] text The string to calculate dimention.
* @return The theoric size used.
*/
etk::Vector3D<float> CalculateSizeDecorated(const etk::UString& text);
vec3 CalculateSizeDecorated(const etk::UString& text);
/**
* @brief Calculate a theoric text size
* @param[in] text The string to calculate dimention.
* @return The theoric size used.
*/
etk::Vector3D<float> CalculateSize(const etk::UString& text);
vec3 CalculateSize(const etk::UString& text);
/**
* @brief Calculate a theoric charcode size
* @param[in] charcode The µUnicode value to calculate dimention.
* @return The theoric size used.
*/
etk::Vector3D<float> CalculateSize(const uniChar_t charcode);
vec3 CalculateSize(const uniChar_t charcode);
/**
* @brief Draw a cursor at the specify position
* @param[in] isInsertMode True if the insert mode is activated

View File

@ -81,12 +81,12 @@ void ewol::WindowsPopUpAdd(ewol::Widget * tmpWidget)
}
}
void ewol::ChangeSize(etk::Vector2D<int32_t> size)
void ewol::ChangeSize(ivec2 size)
{
guiInterface::ChangeSize(size);
}
void ewol::ChangePos(etk::Vector2D<int32_t> pos)
void ewol::ChangePos(ivec2 pos)
{
guiInterface::ChangePos(pos);
}

View File

@ -47,13 +47,13 @@ namespace ewol
* @note work only on computer
* @param[in] size The new windows size
*/
void ChangeSize(etk::Vector2D<int32_t> size);
void ChangeSize(ivec2 size);
/**
* @brief Change the windows curent position
* @note work only on computer
* @param[in] pos The new windows position
*/
void ChangePos(etk::Vector2D<int32_t> pos);
void ChangePos(ivec2 pos);
/**
* @brief Generate the action of redrawing all the display.
*/

View File

@ -35,7 +35,7 @@ ewol::GameElement::GameElement(SceneElement & sceneElement, etk::UString& tmpNam
float quadDist(etk::Vector2D<float> pos1, etk::Vector2D<float> pos2)
float quadDist(vec2 pos1, vec2 pos2)
{
float tmpVal1 = pos1.x - pos2.x;
float tmpVal2 = pos1.y - pos2.y;
@ -44,7 +44,7 @@ float quadDist(etk::Vector2D<float> pos1, etk::Vector2D<float> pos2)
}
bool ewol::GameElement::HaveImpact(int32_t group, int32_t type, etk::Vector2D<float> position, float size)
bool ewol::GameElement::HaveImpact(int32_t group, int32_t type, vec2 position, float size)
{
if (true != m_canHaveImpact) {
return false;

View File

@ -33,7 +33,7 @@ namespace ewol {
int32_t m_type; //!<
float m_power; //!< Current power of the element
bool m_visible; //!< This is to know if the element is displayed or not ==> TODO : check if usefull ...
etk::Vector2D<float> m_position; //!< Current position of the element
vec2 m_position; //!< Current position of the element
float m_speed; //!< Speed of the element (only one value, the angle is generated by the m_angle
float m_angle; //!< Angle of the speed
float m_mass; //!< Current element Mass ==> for the physical calculation
@ -67,8 +67,8 @@ namespace ewol {
void SetVisible(bool state) { m_visible = state; StatusUpdate();};
bool IsEnable(void) { return m_enable; };
void SetEnable(bool state) { m_enable = state; StatusUpdate();};
etk::Vector2D<float> PositionGet(void) { return m_position; };
void PositionSet(etk::Vector2D<float> state) { m_position = state; StatusUpdate();};
vec2 PositionGet(void) { return m_position; };
void PositionSet(vec2 state) { m_position = state; StatusUpdate();};
void PositionSet(float xxx, float yyy) { m_position.x = xxx; m_position.y = yyy; StatusUpdate();};
float SpeedGet(void) { return m_speed; };
void SpeedSet(float state) { m_speed = state; StatusUpdate();};
@ -129,8 +129,8 @@ namespace ewol {
* @return ---
*/
virtual void RemoveElement(int32_t idOfElement) { };
virtual bool HaveImpact(int32_t group, int32_t type, etk::Vector2D<float> position, float size);
virtual bool Explosion(int32_t group, int32_t type, etk::Vector2D<float> position, float pxAtenuation, float power) { return false; } ;
virtual bool HaveImpact(int32_t group, int32_t type, vec2 position, float size);
virtual bool Explosion(int32_t group, int32_t type, vec2 position, float pxAtenuation, float power) { return false; } ;
virtual etk::UString Message(etk::UString control, etk::UString message) { return ""; } ;
virtual void StatusUpdate(void) { };
@ -140,6 +140,6 @@ namespace ewol {
#include <ewol/widget/Scene.h>
float quadDist(etk::Vector2D<float> pos1, etk::Vector2D<float> pos2);
float quadDist(vec2 pos1, vec2 pos2);
#endif

View File

@ -226,7 +226,7 @@ ewol::GameElement* ewol::SceneElement::GetElement(uint32_t idElement)
}
uint32_t ewol::SceneElement::GetNearestEnemy(etk::Vector2D<float> position, int32_t groupId, float maxRange)
uint32_t ewol::SceneElement::GetNearestEnemy(vec2 position, int32_t groupId, float maxRange)
{
uint32_t result = 0;
float lastQuadDistance = 9999999999999999.0;
@ -245,7 +245,7 @@ uint32_t ewol::SceneElement::GetNearestEnemy(etk::Vector2D<float> position, int3
if (NULL != listAnimatedElements[gId][iii]) {
if( true == listAnimatedElements[gId][iii]->IsEnable()
&& true == listAnimatedElements[gId][iii]->CanBeCibledGet()) {
etk::Vector2D<float> tmpPos = listAnimatedElements[gId][iii]->PositionGet();
vec2 tmpPos = listAnimatedElements[gId][iii]->PositionGet();
float distance = quadDist(position, tmpPos);
if( distance <= lastQuadDistance
&& maxRange >= distance ) {
@ -260,7 +260,7 @@ uint32_t ewol::SceneElement::GetNearestEnemy(etk::Vector2D<float> position, int3
return result;
}
void ewol::SceneElement::GetNearestEnemy(etk::Vector2D<float> position, int32_t groupId, float maxRange, etk::Vector<uint32_t>& list)
void ewol::SceneElement::GetNearestEnemy(vec2 position, int32_t groupId, float maxRange, etk::Vector<uint32_t>& list)
{
// remove all elements..
list.Clear();
@ -279,7 +279,7 @@ void ewol::SceneElement::GetNearestEnemy(etk::Vector2D<float> position, int32_t
if (NULL != listAnimatedElements[gId][iii]) {
if( true == listAnimatedElements[gId][iii]->IsEnable()
&& true == listAnimatedElements[gId][iii]->CanBeCibledGet()) {
etk::Vector2D<float> tmpPos = listAnimatedElements[gId][iii]->PositionGet();
vec2 tmpPos = listAnimatedElements[gId][iii]->PositionGet();
float distance = quadDist(position, tmpPos);
if(maxRange >= distance) {
uint32_t tmpp = createUniqueId(listAnimatedElements[gId][iii]->GetUniqueId(), iii);
@ -292,7 +292,7 @@ void ewol::SceneElement::GetNearestEnemy(etk::Vector2D<float> position, int32_t
}
}
uint32_t ewol::SceneElement::GetNearestFriend(etk::Vector2D<float> position, int32_t groupId, uint32_t us)
uint32_t ewol::SceneElement::GetNearestFriend(vec2 position, int32_t groupId, uint32_t us)
{
uint32_t result = 0;
float lastQuadDistance = 9999999999999999.0;
@ -305,7 +305,7 @@ uint32_t ewol::SceneElement::GetNearestFriend(etk::Vector2D<float> position, int
if (NULL != listAnimatedElements[gId][iii]) {
if( true == listAnimatedElements[gId][iii]->IsEnable()
&& true == listAnimatedElements[gId][iii]->CanBeCibledGet()) {
etk::Vector2D<float> tmpPos = listAnimatedElements[gId][iii]->PositionGet();
vec2 tmpPos = listAnimatedElements[gId][iii]->PositionGet();
float distance = quadDist(position, tmpPos);
if( distance <= lastQuadDistance
&& us != listAnimatedElements[gId][iii]->GetUniqueId() ) {
@ -319,7 +319,7 @@ uint32_t ewol::SceneElement::GetNearestFriend(etk::Vector2D<float> position, int
}
void ewol::SceneElement::GetNearestFriend(etk::Vector2D<float> position, int32_t groupId, float maxRange, etk::Vector<uint32_t>& list, uint32_t us)
void ewol::SceneElement::GetNearestFriend(vec2 position, int32_t groupId, float maxRange, etk::Vector<uint32_t>& list, uint32_t us)
{
// remove all elements..
list.Clear();
@ -332,7 +332,7 @@ void ewol::SceneElement::GetNearestFriend(etk::Vector2D<float> position, int32_t
if (NULL != listAnimatedElements[groupId][iii]) {
if( true == listAnimatedElements[groupId][iii]->IsEnable()
&& true == listAnimatedElements[groupId][iii]->CanBeCibledGet()) {
etk::Vector2D<float> tmpPos = listAnimatedElements[groupId][iii]->PositionGet();
vec2 tmpPos = listAnimatedElements[groupId][iii]->PositionGet();
float distance = quadDist(position, tmpPos);
if( maxRange >= distance
&& us != listAnimatedElements[groupId][iii]->GetUniqueId() ) {
@ -344,7 +344,7 @@ void ewol::SceneElement::GetNearestFriend(etk::Vector2D<float> position, int32_t
}
}
bool ewol::SceneElement::HaveImpact(int32_t group, int32_t type, etk::Vector2D<float> position, float size)
bool ewol::SceneElement::HaveImpact(int32_t group, int32_t type, vec2 position, float size)
{
for (int32_t jjj=0; jjj<MAX_GROUP_NUMBER; jjj++) {
if (group != jjj) {
@ -361,7 +361,7 @@ bool ewol::SceneElement::HaveImpact(int32_t group, int32_t type, etk::Vector2D<f
return false;
}
void ewol::SceneElement::Explosion(int32_t group, int32_t type, etk::Vector2D<float> position, float pxAtenuation, float power)
void ewol::SceneElement::Explosion(int32_t group, int32_t type, vec2 position, float pxAtenuation, float power)
{
for (int32_t jjj=0; jjj<MAX_GROUP_NUMBER; jjj++) {
for (int32_t iii=0; iii<listAnimatedElements[jjj].Size(); iii++) {
@ -376,7 +376,7 @@ void ewol::SceneElement::Explosion(int32_t group, int32_t type, etk::Vector2D<fl
}
uint32_t ewol::SceneElement::GetElementAtPos(etk::Vector2D<float> position, int32_t maxDistanceDetection)
uint32_t ewol::SceneElement::GetElementAtPos(vec2 position, int32_t maxDistanceDetection)
{
uint32_t result = 0;
float lastQuadDistance = 9999999999999999.0;
@ -384,7 +384,7 @@ uint32_t ewol::SceneElement::GetElementAtPos(etk::Vector2D<float> position, int3
for (int32_t iii=0; iii<listAnimatedElements[jjj].Size(); iii++) {
if (NULL != listAnimatedElements[jjj][iii]) {
if( true == listAnimatedElements[jjj][iii]->IsEnable()) {
etk::Vector2D<float> tmpPos = listAnimatedElements[jjj][iii]->PositionGet();
vec2 tmpPos = listAnimatedElements[jjj][iii]->PositionGet();
float distance = quadDist(position, tmpPos);
if (distance <= lastQuadDistance) {
lastQuadDistance = distance;
@ -400,7 +400,7 @@ uint32_t ewol::SceneElement::GetElementAtPos(etk::Vector2D<float> position, int3
return result;
}
void ewol::SceneElement::SetEventInput(uint32_t id, etk::Vector2D<float> position)
void ewol::SceneElement::SetEventInput(uint32_t id, vec2 position)
{
EWOL_TODO("but when ...");
}

View File

@ -51,14 +51,14 @@ namespace ewol {
uint32_t AddElement(int32_t group, ewol::GameElement* newElement);
uint32_t AddElementNamed(int32_t group, etk::UString &elementName);
ewol::GameElement* GetElement(uint32_t idElement);
uint32_t GetNearestEnemy(etk::Vector2D<float> position, int32_t groupId, float maxRange=9999999999999999.0);
void GetNearestEnemy(etk::Vector2D<float> position, int32_t groupId, float maxRange, etk::Vector<uint32_t>& list);
uint32_t GetNearestFriend(etk::Vector2D<float> position, int32_t groupId, uint32_t us);
void GetNearestFriend(etk::Vector2D<float> position, int32_t groupId, float maxRange, etk::Vector<uint32_t>& list, uint32_t us);
bool HaveImpact(int32_t group, int32_t type, etk::Vector2D<float> position, float size);
void Explosion(int32_t group, int32_t type, etk::Vector2D<float> position, float pxAtenuation, float power);
uint32_t GetElementAtPos(etk::Vector2D<float> position, int32_t maxDistanceDetection);
void SetEventInput(uint32_t id, etk::Vector2D<float> position);
uint32_t GetNearestEnemy(vec2 position, int32_t groupId, float maxRange=9999999999999999.0);
void GetNearestEnemy(vec2 position, int32_t groupId, float maxRange, etk::Vector<uint32_t>& list);
uint32_t GetNearestFriend(vec2 position, int32_t groupId, uint32_t us);
void GetNearestFriend(vec2 position, int32_t groupId, float maxRange, etk::Vector<uint32_t>& list, uint32_t us);
bool HaveImpact(int32_t group, int32_t type, vec2 position, float size);
void Explosion(int32_t group, int32_t type, vec2 position, float pxAtenuation, float power);
uint32_t GetElementAtPos(vec2 position, int32_t maxDistanceDetection);
void SetEventInput(uint32_t id, vec2 position);
void SetEventExternButton(uint32_t id, int32_t btId, int32_t state);
void SetEventExternJoystick(uint32_t id, int32_t joyId, float angle, float distance, int32_t state);
/**

View File

@ -279,9 +279,9 @@ static int32_t nextP2(int32_t value)
return val;
}
bool ewol::resource::Keep(etk::UString& filename, ewol::TextureFile*& object, etk::Vector2D<int32_t> size)
bool ewol::resource::Keep(etk::UString& filename, ewol::TextureFile*& object, ivec2 size)
{
etk::Vector2D<int32_t> size2(nextP2(size.x), nextP2(size.y));
ivec2 size2(nextP2(size.x), nextP2(size.y));
etk::UString TmpFilename = filename;
TmpFilename += ":";
TmpFilename += size2.x;

View File

@ -42,7 +42,7 @@ namespace ewol
bool Keep(etk::UString& filename, ewol::Program*& object);
bool Keep(etk::UString& filename, ewol::Shader*& object);
bool Keep(ewol::Texture*& object); // no name needed here ...
bool Keep(etk::UString& filename, ewol::TextureFile*& object, etk::Vector2D<int32_t> size);
bool Keep(etk::UString& filename, ewol::TextureFile*& object, ivec2 size);
bool Keep(etk::UString& accesMode, ewol::VirtualBufferObject*& object);
bool Keep(etk::UString& filename, ewol::MeshObj*& object);
bool Keep(etk::UString& filename, ewol::ConfigFile*& object);

View File

@ -10,13 +10,13 @@
#include <ewol/debug.h>
#include <ewol/renderer/openGL.h>
etk::Vector<etk::Matrix4> l_matrixList;
etk::Vector<mat4> l_matrixList;
void ewol::openGL::Init(void)
{
// remove deprecated pb ...
l_matrixList.Clear();
etk::Matrix4 tmpMat;
mat4 tmpMat;
l_matrixList.PushBack(tmpMat);
}
@ -26,7 +26,7 @@ void ewol::openGL::UnInit(void)
l_matrixList.Clear();
}
void ewol::openGL::SetBasicMatrix(etk::Matrix4& newOne)
void ewol::openGL::SetBasicMatrix(mat4& newOne)
{
if (l_matrixList.Size()!=1) {
EWOL_ERROR("matrix is not corect size in the stack : " << l_matrixList.Size());
@ -35,7 +35,7 @@ void ewol::openGL::SetBasicMatrix(etk::Matrix4& newOne)
l_matrixList.PushBack(newOne);
}
void ewol::openGL::SetMatrix(etk::Matrix4& newOne)
void ewol::openGL::SetMatrix(mat4& newOne)
{
if (l_matrixList.Size()==0) {
EWOL_ERROR("set matrix list is not corect size in the stack : " << l_matrixList.Size());
@ -49,11 +49,11 @@ void ewol::openGL::Push(void)
{
if (l_matrixList.Size()==0) {
EWOL_ERROR("set matrix list is not corect size in the stack : " << l_matrixList.Size());
etk::Matrix4 tmp;
mat4 tmp;
l_matrixList.PushBack(tmp);
return;
}
etk::Matrix4 tmp = l_matrixList[l_matrixList.Size()-1];
mat4 tmp = l_matrixList[l_matrixList.Size()-1];
l_matrixList.PushBack(tmp);
}
@ -62,18 +62,18 @@ void ewol::openGL::Pop(void)
if (l_matrixList.Size()<=1) {
EWOL_ERROR("set matrix list is not corect size in the stack : " << l_matrixList.Size());
l_matrixList.Clear();
etk::Matrix4 tmp;
mat4 tmp;
l_matrixList.PushBack(tmp);
return;
}
l_matrixList.PopBack();
}
etk::Matrix4& ewol::openGL::GetMatrix(void)
mat4& ewol::openGL::GetMatrix(void)
{
if (l_matrixList.Size()==0) {
EWOL_ERROR("set matrix list is not corect size in the stack : " << l_matrixList.Size());
etk::Matrix4 tmp;
mat4 tmp;
l_matrixList.PushBack(tmp);
}
return l_matrixList[l_matrixList.Size()-1];

View File

@ -62,13 +62,13 @@ namespace ewol {
* @brief When you will done an opengl rendering, you might call this reset matrix first. It remove all the stach of the matrix pushed.
* @param[in] newOne the default matrix that might be set for the graphic card for renderer. if too more pop will be done, this is the last that mmight survived
*/
void SetBasicMatrix(etk::Matrix4& newOne);
void SetBasicMatrix(mat4& newOne);
/**
* @brief this funtion configure the current use matrix for the renderer (call @ref Push before, and @ref Pop when no more needed).
* @param[in] newOne The new current matrix use for the render.
* @note We did not use opengl standard system, due to the fact that is not supported in opengl ES-2
*/
void SetMatrix(etk::Matrix4& newOne);
void SetMatrix(mat4& newOne);
/**
* @brief Store current matrix in the matrix stack.
*/
@ -81,7 +81,7 @@ namespace ewol {
* @brief Get a reference on the current matrix destinate to opengl renderer.
* @return The requested matrix.
*/
etk::Matrix4& GetMatrix(void);
mat4& GetMatrix(void);
};
};

View File

@ -29,7 +29,7 @@
static ewol::Windows* windowsCurrent = NULL;
static etk::Vector2D<int32_t> windowsSize(320, 480);
static ivec2 windowsSize(320, 480);
static ewol::eSystemInput l_managementInput;
@ -70,7 +70,7 @@ class eSystemMessage {
ewol::keyEvent::type_te inputType;
int32_t inputId;
// generic dimentions
etk::Vector2D<float> dimention;
vec2 dimention;
// keyboard events :
bool stateIsDown;
uniChar_t keyboardChar;
@ -523,7 +523,7 @@ ewol::Windows* eSystem::GetCurrentWindows(void)
}
etk::Vector2D<int32_t> eSystem::GetSize(void)
ivec2 eSystem::GetSize(void)
{
return windowsSize;
}
@ -533,7 +533,7 @@ void eSystem::ForceRedrawAll(void)
{
ewol::Windows* tmpWindows = eSystem::GetCurrentWindows();
if (NULL != tmpWindows) {
etk::Vector2D<int32_t> tmpSize = eSystem::GetSize();
ivec2 tmpSize = eSystem::GetSize();
tmpWindows->CalculateSize(tmpSize.x, tmpSize.y);
}
}

View File

@ -94,7 +94,7 @@ namespace eSystem
* @param ---
* @return the current size ...
*/
etk::Vector2D<int32_t> GetSize(void);
ivec2 GetSize(void);
/**
* @brief Redraw all the windows

View File

@ -69,7 +69,7 @@ bool ewol::eSystemInput::localEventInput(ewol::keyEvent::type_te type,
ewol::Widget* destWidget,
int32_t IdInput,
ewol::keyEvent::status_te typeEvent,
etk::Vector2D<float> pos)
vec2 pos)
{
if (NULL != destWidget) {
if (type == ewol::keyEvent::typeMouse || type == ewol::keyEvent::typeFinger) {
@ -178,7 +178,7 @@ int32_t ewol::eSystemInput::localGetDestinationId(ewol::keyEvent::type_te type,
}
// note if id<0 ==> the it was finger event ...
void ewol::eSystemInput::Motion(ewol::keyEvent::type_te type, int pointerID, etk::Vector2D<float> pos)
void ewol::eSystemInput::Motion(ewol::keyEvent::type_te type, int pointerID, vec2 pos)
{
// convert position in Open-GL coordonates ...
pos.y = pos.y;
@ -269,7 +269,7 @@ void ewol::eSystemInput::Motion(ewol::keyEvent::type_te type, int pointerID, etk
}
}
void ewol::eSystemInput::State(ewol::keyEvent::type_te type, int pointerID, bool isDown, etk::Vector2D<float> pos)
void ewol::eSystemInput::State(ewol::keyEvent::type_te type, int pointerID, bool isDown, vec2 pos)
{
// convert position in Open-GL coordonates ...
InputPoperty_ts *eventTable = NULL;

View File

@ -20,10 +20,10 @@ namespace ewol
int32_t destinationInputId;
int64_t lastTimeEvent;
ewol::Widget* curentWidgetEvent;
etk::Vector2D<float> origin;
etk::Vector2D<float> size;
etk::Vector2D<float> downStart;
etk::Vector2D<float> posEvent;
vec2 origin;
vec2 size;
vec2 downStart;
vec2 posEvent;
bool isDown;
bool isInside;
int32_t nbClickEvent; // 0 .. 1 .. 2 .. 3
@ -58,7 +58,7 @@ namespace ewol
ewol::Widget* destWidget,
int32_t IdInput,
ewol::keyEvent::status_te typeEvent,
etk::Vector2D<float> pos);
vec2 pos);
/**
* @brief Convert the system event id in the correct EWOL id depending of the system management mode
* This function find the next input id unused on the specifiic widget
@ -77,8 +77,8 @@ namespace ewol
void SetDpi(int32_t newDPI);
// note if id<0 ==> the it was finger event ...
void Motion(ewol::keyEvent::type_te type, int pointerID, etk::Vector2D<float> pos );
void State(ewol::keyEvent::type_te type, int pointerID, bool isDown, etk::Vector2D<float> pos);
void Motion(ewol::keyEvent::type_te type, int pointerID, vec2 pos );
void State(ewol::keyEvent::type_te type, int pointerID, bool isDown, vec2 pos);
/**
* @brief Inform object that an other object is removed ...

View File

@ -583,17 +583,17 @@ void guiInterface::KeyboardHide(void)
SendJava_KeyboardShow(false);
}
void guiInterface::ChangeSize(etk::Vector2D<int32_t> size)
void guiInterface::ChangeSize(ivec2 size)
{
// The size can not be change on android platform
}
void guiInterface::ChangePos(etk::Vector2D<int32_t> size)
void guiInterface::ChangePos(ivec2 size)
{
// The position can not be change on Android platform
}
void guiInterface::GetAbsPos(etk::Vector2D<int32_t>& size)
void guiInterface::GetAbsPos(ivec2& size)
{
size.x = 0;
size.y = 0;

View File

@ -70,7 +70,7 @@ void guiInterface::KeyboardHide(void)
void guiInterface::ChangeSize(etk::Vector2D<int32_t> size)
void guiInterface::ChangeSize(ivec2 size)
{
int border_thickness = GetSystemMetrics(SM_CXSIZEFRAME);
int title_size = GetSystemMetrics(SM_CYCAPTION);
@ -80,12 +80,12 @@ void guiInterface::ChangeSize(etk::Vector2D<int32_t> size)
// TODO : Later
}
void guiInterface::ChangePos(etk::Vector2D<int32_t> pos)
void guiInterface::ChangePos(ivec2 pos)
{
// TODO : Later
}
void guiInterface::GetAbsPos(etk::Vector2D<int32_t>& size)
void guiInterface::GetAbsPos(ivec2& size)
{
// TODO : Later
size.x = 0;
@ -273,7 +273,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
bool buttonIsDown = true;
int32_t mouseButtonId = 0;
etk::Vector2D<int32_t> pos;
ivec2 pos;
// to know all message : http://wiki.winehq.org/List_Of_Windows_Messages
switch (message)
{

View File

@ -242,7 +242,7 @@ bool CreateX11Context(void)
XSetWMProtocols(m_display, WindowHandle, &m_delAtom, 1);
}
etk::Vector2D<int32_t> tmpSize(400, 300);
ivec2 tmpSize(400, 300);
guiInterface::ChangeSize(tmpSize);
return true;
@ -1042,7 +1042,7 @@ void guiInterface::KeyboardHide(void)
}
void guiInterface::ChangeSize(etk::Vector2D<int32_t> size)
void guiInterface::ChangeSize(ivec2 size)
{
#ifdef DEBUG_X11_EVENT
EWOL_INFO("X11: ChangeSize");
@ -1052,7 +1052,7 @@ void guiInterface::ChangeSize(etk::Vector2D<int32_t> size)
}
void guiInterface::ChangePos(etk::Vector2D<int32_t> pos)
void guiInterface::ChangePos(ivec2 pos)
{
#ifdef DEBUG_X11_EVENT
EWOL_INFO("X11: ChangePos");
@ -1061,7 +1061,7 @@ void guiInterface::ChangePos(etk::Vector2D<int32_t> pos)
}
void guiInterface::GetAbsPos(etk::Vector2D<int32_t>& pos)
void guiInterface::GetAbsPos(ivec2& pos)
{
#ifdef DEBUG_X11_EVENT
EWOL_INFO("X11: GetAbsPos");

View File

@ -37,19 +37,19 @@ namespace guiInterface
* @param size The requested size
* @return ---
*/
void ChangeSize(etk::Vector2D<int32_t> size);
void ChangeSize(ivec2 size);
/**
* @brief Change the current Windows position
* @param pos The position where the winsdows might be placed.
* @return ---
*/
void ChangePos(etk::Vector2D<int32_t> pos);
void ChangePos(ivec2 pos);
/**
* @brief Get the current Windows position
* @param pos The position where the winsdows is.
* @return ---
*/
void GetAbsPos(etk::Vector2D<int32_t>& pos);
void GetAbsPos(ivec2& pos);
/**
* @brief Display the virtal keyboard (for touch system only)
* @param ---

View File

@ -103,13 +103,13 @@ ewol::FontFreeType::~FontFreeType(void)
}
etk::Vector2D<float> ewol::FontFreeType::GetSize(int32_t fontSize, const etk::UString & unicodeString)
vec2 ewol::FontFreeType::GetSize(int32_t fontSize, const etk::UString & unicodeString)
{
if(false==m_init) {
return etk::Vector2D<float>(0,0);
return vec2(0,0);
}
// TODO : ...
etk::Vector2D<float> outputSize(0,0);
vec2 outputSize(0,0);
return outputSize;
}
@ -165,7 +165,7 @@ bool ewol::FontFreeType::GetGlyphProperty(int32_t fontSize,
bool ewol::FontFreeType::DrawGlyph(draw::Image& imageOut,
int32_t fontSize,
etk::Vector2D<int32_t> glyphPosition,
ivec2 glyphPosition,
ewol::GlyphProperty& property,
int8_t posInImage)
{
@ -202,7 +202,7 @@ bool ewol::FontFreeType::DrawGlyph(draw::Image& imageOut,
draw::Color tlpppp(0xFF,0xFF,0xFF,0x00);
for(int32_t jjj=0; jjj < slot->bitmap.rows;jjj++) {
for(int32_t iii=0; iii < slot->bitmap.width; iii++){
tlpppp = imageOut.Get(etk::Vector2D<int32_t>(glyphPosition.x+iii, glyphPosition.y+jjj));
tlpppp = imageOut.Get(ivec2(glyphPosition.x+iii, glyphPosition.y+jjj));
uint8_t valueColor = slot->bitmap.buffer[iii + slot->bitmap.width*jjj];
// set only alpha :
switch(posInImage)
@ -222,7 +222,7 @@ bool ewol::FontFreeType::DrawGlyph(draw::Image& imageOut,
break;
}
// real set of color
imageOut.Set(etk::Vector2D<int32_t>(glyphPosition.x+iii, glyphPosition.y+jjj), tlpppp );
imageOut.Set(ivec2(glyphPosition.x+iii, glyphPosition.y+jjj), tlpppp );
}
}
return true;

View File

@ -37,11 +37,11 @@ namespace ewol
bool DrawGlyph(draw::Image& imageOut,
int32_t fontSize,
etk::Vector2D<int32_t> glyphPosition,
ivec2 glyphPosition,
ewol::GlyphProperty& property,
int8_t posInImage);
etk::Vector2D<float> GetSize(int32_t fontSize, const etk::UString & unicodeString);
vec2 GetSize(int32_t fontSize, const etk::UString & unicodeString);
int32_t GetHeight(int32_t fontSize);

View File

@ -21,7 +21,7 @@
#include <ewol/renderer/resources/image/ImagePNG.h>
ewol::TextureFile::TextureFile(etk::UString genName, etk::UString tmpfileName, etk::Vector2D<int32_t> size) :
ewol::TextureFile::TextureFile(etk::UString genName, etk::UString tmpfileName, ivec2 size) :
Texture(genName)
{
etk::UString tmpName = tmpfileName;

View File

@ -20,7 +20,7 @@ namespace ewol
class TextureFile : public ewol::Texture
{
public:
TextureFile(etk::UString genName, etk::UString fileName, etk::Vector2D<int32_t> size);
TextureFile(etk::UString genName, etk::UString fileName, ivec2 size);
~TextureFile(void) { };
virtual const char* GetType(void) { return "ewol::TextureFile"; };
};

View File

@ -60,12 +60,12 @@ void ewol::Mesh::Draw(void)
//EWOL_DEBUG(" Display " << m_coord.Size() << " elements" );
m_GLprogram->Use();
// set Matrix : translation/positionMatrix
etk::Matrix4 tmpMatrix = ewol::openGL::GetMatrix();
tmpMatrix = etk::Matrix4::Scale(etk::Vector3D<float>(100,100,100) )
* etk::Matrix4::Rotate(etk::Vector3D<float>(1,0,0), rotx)
* etk::Matrix4::Rotate(etk::Vector3D<float>(0,1,0), roty)/*
* etk::Matrix4::Translate(etk::Vector3D<float>(0.01,0.0,0.0))
* etk::Matrix4::Rotate(etk::Vector3D<float>(0,0,1), rotz)*/
mat4 tmpMatrix = ewol::openGL::GetMatrix();
tmpMatrix = mat4::Scale(vec3(100,100,100) )
* mat4::Rotate(vec3(1,0,0), rotx)
* mat4::Rotate(vec3(0,1,0), roty)/*
* mat4::Translate(vec3(0.01,0.0,0.0))
* mat4::Rotate(vec3(0,0,1), rotz)*/
* tmpMatrix;
m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat);
// TextureID

View File

@ -27,9 +27,9 @@ namespace ewol
int32_t m_GLtexture;
int32_t m_GLtexID;
etk::Vector<uint32_t> m_indices;
etk::Vector< etk::Vector3D<float> > m_vertices;
etk::Vector< etk::Vector2D<float> > m_uvTextures;
etk::Vector< etk::Vector3D<float> > m_normals;
etk::Vector< vec3 > m_vertices;
etk::Vector< vec2 > m_uvTextures;
etk::Vector< vec3 > m_normals;
ewol::TextureFile* m_texture1;
etk::Vector<draw::Colorf> m_coordColor; //!< internal color of the different point
public:

View File

@ -35,9 +35,9 @@ ewol::MeshObj::MeshObj(etk::UString _fileName) :
etk::Vector<int32_t> indicesVertices;
etk::Vector<int32_t> indicesUv;
etk::Vector<int32_t> indicesNormal;
etk::Vector< etk::Vector3D<float> > vertices;
etk::Vector< etk::Vector2D<float> > uvTextures;
etk::Vector< etk::Vector3D<float> > normals;
etk::Vector< vec3 > vertices;
etk::Vector< vec2 > uvTextures;
etk::Vector< vec3 > normals;
while (NULL != fileName.FileGets(inputDataLine, 2048) )
@ -45,17 +45,17 @@ ewol::MeshObj::MeshObj(etk::UString _fileName) :
if (inputDataLine[0]=='v') {
if (inputDataLine[1]=='n') {
// Vertice normal : vn 0.000000 0.000000 -1.000000
etk::Vector3D<float> vertex;
vec3 vertex;
sscanf(&inputDataLine[3], "%f %f %f", &vertex.x, &vertex.y, &vertex.z );
normals.PushBack(vertex);
} else if (inputDataLine[1]=='t') {
// Texture position : vt 0.748573 0.750412
etk::Vector2D<float> vertex;
vec2 vertex;
sscanf(&inputDataLine[3], "%f %f", &vertex.x, &vertex.y);
uvTextures.PushBack(vertex);
} else {
// Vertice position : v 1.000000 -1.000000 -1.000000
etk::Vector3D<float> vertex;
vec3 vertex;
sscanf(&inputDataLine[2], "%f %f %f", &vertex.x, &vertex.y, &vertex.z );
vertices.PushBack(vertex);
}
@ -101,7 +101,7 @@ ewol::MeshObj::MeshObj(etk::UString _fileName) :
inputDataLine[strlen(inputDataLine)-1] = '\0';
}
etk::UString tmpVal(&inputDataLine[7]);
etk::Vector2D<int32_t> tmpSize(256, 256);
ivec2 tmpSize(256, 256);
if (NULL != m_texture1) {
EWOL_INFO("Release previous loaded texture ... ");
ewol::resource::Release(m_texture1);

View File

@ -285,7 +285,7 @@ void ewol::Program::SendAttribute(int32_t idElem, int32_t nbElement, void* point
//////////////////////////////////////////////////////////////////////////////////////////////
void ewol::Program::UniformMatrix4fv(int32_t idElem, int32_t nbElement, etk::Matrix4 _matrix, bool transpose)
void ewol::Program::UniformMatrix4fv(int32_t idElem, int32_t nbElement, mat4 _matrix, bool transpose)
{
if (idElem<0 || idElem>m_elementList.Size()) {
EWOL_ERROR("idElem = " << idElem << " not in [0.." << (m_elementList.Size()-1) << "]");

View File

@ -95,7 +95,7 @@ namespace ewol
* @param[in] pointer Pointer on the data that might be sended
* @param[in] transpose Transpose the matrix (needed all the taime in the normal openGl access (only not done in the openGL-ES2 due to the fact we must done it ourself)
*/
void UniformMatrix4fv(int32_t idElem, int32_t nbElement, etk::Matrix4 pointer, bool transpose=true);
void UniformMatrix4fv(int32_t idElem, int32_t nbElement, mat4 pointer, bool transpose=true);
/**
* @brief Send 1 float uniform element to the spefified ID (not send if does not really exist in the OpenGL program)
* @param[in] idElem Id of the uniform that might be sended.

View File

@ -111,7 +111,7 @@ void ewol::Texture::Flush(void)
}
void ewol::Texture::SetImageSize(etk::Vector2D<int32_t> newSize)
void ewol::Texture::SetImageSize(ivec2 newSize)
{
newSize.x = nextP2(newSize.x);
newSize.y = nextP2(newSize.y);

View File

@ -23,7 +23,7 @@ namespace ewol {
// OpenGl textureID :
GLuint m_texId;
// some image are not square ==> we need to sqared it to prevent some openGl api error the the displayable size is not all the time 0.0 -> 1.0
etk::Vector2D<float> m_endPointSize;
vec2 m_endPointSize;
// internal state of the openGl system :
bool m_loaded;
// Ewol internal API:
@ -34,14 +34,14 @@ namespace ewol {
// middleware interface:
public:
GLuint GetId(void) { return m_texId; };
etk::Vector2D<float> GetUsableSize(void) { return m_endPointSize; };
vec2 GetUsableSize(void) { return m_endPointSize; };
// Public API:
public:
Texture(etk::UString tmpName);
~Texture(void);
virtual const char* GetType(void) { return "ewol::Texture"; };
// you must set the size here, because it will be set in multiple of pow(2)
void SetImageSize(etk::Vector2D<int32_t> newSize);
void SetImageSize(ivec2 newSize);
// get the reference on this image to draw nomething on it ...
inline draw::Image& Get(void) { return m_data; };
// Flush the data to send it at the OpenGl system

View File

@ -209,7 +209,7 @@ ewol::TexturedFont::TexturedFont(etk::UString fontName) :
if (iiiFontId == 0) {
EWOL_DEBUG("Generate a text texture for char(" << nbRaws << "," << nbLine << ") with size=(" << textureWidth << "," << textureHeight << ")");
// resize must be done on the texture ...
SetImageSize(etk::Vector2D<int32_t>(textureWidth,textureHeight));
SetImageSize(ivec2(textureWidth,textureHeight));
// now we can acces directly on the image
m_data.SetFillColor(draw::Color(0x00000000));
m_data.Clear();
@ -217,7 +217,7 @@ ewol::TexturedFont::TexturedFont(etk::UString fontName) :
m_height[iiiFontId] = m_font[iiiFontId]->GetHeight(m_size);
int32_t CurrentLineHigh = 0;
etk::Vector2D<int32_t> glyphPosition(1,1);
ivec2 glyphPosition(1,1);
for (int32_t iii=0; iii<m_listElement[iiiFontId].Size(); iii++) {
if (true == m_font[iiiFontId]->GetGlyphProperty(m_size, (m_listElement[iiiFontId])[iii])) {
// change line if needed ...
@ -254,11 +254,11 @@ ewol::TexturedFont::TexturedFont(etk::UString fontName) :
draw::Color tlpppp(0xFF,0xFF,0xFF,0x00);
for(int32_t jjj=0; jjj < textureHeight;jjj++) {
for(int32_t iii=0; iii < textureWidth; iii++){
tlpppp = m_data.Get(etk::Vector2D<int32_t>(iii, jjj) );
tlpppp = m_data.Get(ivec2(iii, jjj) );
// set only alpha :
tlpppp.a = etk_min( tlpppp.a+0x60, 0xFF);
// real set of color
m_data.Set(etk::Vector2D<int32_t>(iii, jjj), tlpppp );
m_data.Set(ivec2(iii, jjj), tlpppp );
}
}
#endif

View File

@ -39,7 +39,7 @@ namespace ewol
etk::Vector<GlyphProperty> m_listElement[4];
private:
// for the texture generation :
etk::Vector2D<int32_t> m_lastGlyphPos[4];
ivec2 m_lastGlyphPos[4];
int32_t m_lastRawHeigh[4];
public:
TexturedFont(etk::UString fontName);

View File

@ -34,11 +34,11 @@ namespace ewol
virtual bool DrawGlyph(draw::Image& imageOut,
int32_t fontSize,
etk::Vector2D<int32_t> glyphPosition,
ivec2 glyphPosition,
ewol::GlyphProperty& property,
int8_t posInImage) = 0;
virtual etk::Vector2D<float> GetSize(int32_t fontSize, const etk::UString & unicodeString) = 0;
virtual vec2 GetSize(int32_t fontSize, const etk::UString & unicodeString) = 0;
virtual int32_t GetHeight(int32_t fontSize) = 0;

View File

@ -54,11 +54,11 @@ namespace ewol
public:
uniChar_t m_UVal; //!< Unicode value
int32_t m_glyphIndex; //!< Glyph index in the system
etk::Vector2D<int32_t> m_sizeTexture; //!< size of the element to display
etk::Vector2D<int32_t> m_bearing; //!< offset to display the data (can be negatif id the texture sise is bigger than the theoric places in the string)
etk::Vector2D<int32_t> m_advance; //!< space use in the display for this specific char
etk::Vector2D<float> m_texturePosStart; //!< Texture normalised position (START)
etk::Vector2D<float> m_texturePosStop; //!< Texture normalised position (STOP)
ivec2 m_sizeTexture; //!< size of the element to display
ivec2 m_bearing; //!< offset to display the data (can be negatif id the texture sise is bigger than the theoric places in the string)
ivec2 m_advance; //!< space use in the display for this specific char
vec2 m_texturePosStart; //!< Texture normalised position (START)
vec2 m_texturePosStop; //!< Texture normalised position (STOP)
private:
etk::Vector<ewol::Kerning> m_kerning; //!< kerning values of link of all elements
public:

View File

@ -125,7 +125,7 @@ bool ewol::imageBMP::GenerateImage(etk::UString & inputFile, draw::Image & ouput
m_width = m_InfoHeader.biWidth;
m_height = m_InfoHeader.biHeight;
// reallocate the image
ouputImage.Resize(etk::Vector2D<int32_t>(m_width,m_height));
ouputImage.Resize(ivec2(m_width,m_height));
uint8_t* m_data = NULL;
if(0 != m_InfoHeader.biSizeImage)
@ -151,7 +151,7 @@ bool ewol::imageBMP::GenerateImage(etk::UString & inputFile, draw::Image & ouput
tmpColor.g = (int8_t)((*pointer & 0x07E0) >> 3);
tmpColor.b = (int8_t)(*pointer << 3);
tmpColor.a = 0xFF;
ouputImage.Set(etk::Vector2D<int32_t>(xxx,yyy), tmpColor);
ouputImage.Set(ivec2(xxx,yyy), tmpColor);
pointer++;
}
}
@ -166,7 +166,7 @@ bool ewol::imageBMP::GenerateImage(etk::UString & inputFile, draw::Image & ouput
tmpColor.g = (int8_t)((*pointer & 0x03E0) >> 2);
tmpColor.b = (int8_t)(*pointer << 3);
tmpColor.a = 0xFF;
ouputImage.Set(etk::Vector2D<int32_t>(xxx,yyy), tmpColor);
ouputImage.Set(ivec2(xxx,yyy), tmpColor);
pointer++;
}
}
@ -181,7 +181,7 @@ bool ewol::imageBMP::GenerateImage(etk::UString & inputFile, draw::Image & ouput
tmpColor.g = *pointer++;
tmpColor.b = *pointer++;
tmpColor.a = 0xFF;
ouputImage.Set(etk::Vector2D<int32_t>(xxx,yyy), tmpColor);
ouputImage.Set(ivec2(xxx,yyy), tmpColor);
}
}
}
@ -196,7 +196,7 @@ bool ewol::imageBMP::GenerateImage(etk::UString & inputFile, draw::Image & ouput
tmpColor.g = *pointer++;
tmpColor.b = *pointer++;
tmpColor.a = 0xFF;
ouputImage.Set(etk::Vector2D<int32_t>(xxx,yyy), tmpColor);
ouputImage.Set(ivec2(xxx,yyy), tmpColor);
}
}
}
@ -210,7 +210,7 @@ bool ewol::imageBMP::GenerateImage(etk::UString & inputFile, draw::Image & ouput
tmpColor.g = *pointer++;
tmpColor.b = *pointer++;
tmpColor.a = *pointer++;
ouputImage.Set(etk::Vector2D<int32_t>(xxx,yyy), tmpColor);
ouputImage.Set(ivec2(xxx,yyy), tmpColor);
}
}
}

View File

@ -97,7 +97,7 @@ bool ewol::imagePNG::GenerateImage(etk::UString & inputFile, draw::Image & ouput
int32_t width = png_get_image_width(png_ptr, info_ptr);
int32_t height = png_get_image_height(png_ptr, info_ptr);
// reallocate the image
ouputImage.Resize(etk::Vector2D<int32_t>(width,height));
ouputImage.Resize(ivec2(width,height));
int32_t bit_depth = png_get_bit_depth(png_ptr, info_ptr);
png_read_update_info(png_ptr, info_ptr);
@ -131,7 +131,7 @@ bool ewol::imagePNG::GenerateImage(etk::UString & inputFile, draw::Image & ouput
tmpColor.g = ptr[1];
tmpColor.b = ptr[2];
tmpColor.a = ptr[3];
ouputImage.Set(etk::Vector2D<int32_t>(x,y), tmpColor);
ouputImage.Set(ivec2(x,y), tmpColor);
}
delete row_pointers[y];
}

View File

@ -82,13 +82,13 @@ void widget::Button::SetImageToggle(etk::UString imageName, draw::Color color)
bool widget::Button::CalculateMinSize(void)
{
etk::Vector2D<float> padding = m_shaper.GetPadding();
vec2 padding = m_shaper.GetPadding();
m_displayText.Clear();
etk::Vector3D<int32_t> minSize = m_displayText.CalculateSizeDecorated(m_label);
ivec3 minSize = m_displayText.CalculateSizeDecorated(m_label);
if( true == m_toggleMode
&& m_labelToggle.Size()!=0) {
m_displayText.Clear();
etk::Vector3D<int32_t> minSizeToggle = m_displayText.CalculateSizeDecorated(m_labelToggle);
ivec3 minSizeToggle = m_displayText.CalculateSizeDecorated(m_labelToggle);
minSize.x = etk_max(minSize.x, minSizeToggle.x);
minSize.y = etk_max(minSize.y, minSizeToggle.y);
minSize.z = etk_max(minSize.z, minSizeToggle.z);
@ -170,10 +170,10 @@ void widget::Button::OnRegenerateDisplay(void)
{
if (true == NeedRedraw()) {
etk::Vector2D<float> padding = m_shaper.GetPadding();
vec2 padding = m_shaper.GetPadding();
// to know the size of one Line :
etk::Vector3D<int32_t> minSize = m_displayText.CalculateSize('A');
etk::Vector3D<int32_t> curentTextSize;
ivec3 minSize = m_displayText.CalculateSize('A');
ivec3 curentTextSize;
if( false == m_toggleMode
|| false == m_value
|| m_labelToggle.Size()==0) {
@ -187,14 +187,14 @@ void widget::Button::OnRegenerateDisplay(void)
m_shaper.Clear();
m_displayText.Clear();
etk::Vector2D<int32_t> localSize = m_minSize;
ivec2 localSize = m_minSize;
etk::Vector3D<float> tmpOrigin((m_size.x - m_minSize.x) / 2.0,
vec3 tmpOrigin((m_size.x - m_minSize.x) / 2.0,
(m_size.y - m_minSize.y) / 2.0,
0.0);
// no change for the text orogin :
etk::Vector3D<float> tmpTextOrigin((m_size.x - m_minSize.x) / 2.0,
vec3 tmpTextOrigin((m_size.x - m_minSize.x) / 2.0,
(m_size.y - m_minSize.y) / 2.0,
0.0);
@ -215,14 +215,14 @@ void widget::Button::OnRegenerateDisplay(void)
tmpTextOrigin.y += (m_minSize.y-2*padding.y) - minSize.y;
etk::Vector2D<float> textPos(tmpTextOrigin.x, tmpTextOrigin.y);
vec2 textPos(tmpTextOrigin.x, tmpTextOrigin.y);
if( true == m_displayImage.HasSources()
|| true == m_displayImageToggle.HasSources()) {
etk::Vector3D<int32_t> imagePos(tmpOrigin.x-padding.x/4,
ivec3 imagePos(tmpOrigin.x-padding.x/4,
tmpOrigin.y-padding.x/4+(m_minSize.y-m_imageDisplaySize-2*padding.y)/2.0,
0);
etk::Vector2D<int32_t> imageSize(m_imageDisplaySize,
ivec2 imageSize(m_imageDisplaySize,
m_imageDisplaySize);
if( false==m_toggleMode
|| false==m_value) {
@ -238,8 +238,8 @@ void widget::Button::OnRegenerateDisplay(void)
tmpTextOrigin.x += padding.x/2 + m_imageDisplaySize;
}
etk::Vector3D<float> drawClippingPos(padding.x, padding.y, -0.5);
etk::Vector3D<float> drawClippingSize((float)(m_size.x - padding.x),
vec3 drawClippingPos(padding.x, padding.y, -0.5);
vec3 drawClippingSize((float)(m_size.x - padding.x),
(float)(m_size.y - padding.y),
(float)1.0);
@ -268,27 +268,27 @@ void widget::Button::OnRegenerateDisplay(void)
}
// selection area :
m_selectableAreaPos = etk::Vector2D<float>(tmpOrigin.x-padding.x, tmpOrigin.y-padding.y);
m_selectableAreaSize = localSize + etk::Vector2D<float>(2,2)*padding;
m_selectableAreaPos = vec2(tmpOrigin.x-padding.x, tmpOrigin.y-padding.y);
m_selectableAreaSize = localSize + vec2(2,2)*padding;
m_shaper.SetOrigin(m_selectableAreaPos );
m_shaper.SetSize(m_selectableAreaSize);
m_shaper.SetInsidePos(etk::Vector2D<float>(tmpTextOrigin.x, tmpTextOrigin.y) );
etk::Vector3D<float> tmpp = m_displayText.CalculateSize(m_label);
etk::Vector2D<float> tmpp2(tmpp.x, tmpp.y);
m_shaper.SetInsidePos(vec2(tmpTextOrigin.x, tmpTextOrigin.y) );
vec3 tmpp = m_displayText.CalculateSize(m_label);
vec2 tmpp2(tmpp.x, tmpp.y);
m_shaper.SetInsideSize(tmpp2);
}
}
bool widget::Button::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos)
bool widget::Button::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
{
bool previousHoverState = m_mouseHover;
if(ewol::keyEvent::statusLeave == typeEvent) {
m_mouseHover = false;
m_buttonPressed = false;
} else {
etk::Vector2D<float> relativePos = RelativePosition(pos);
vec2 relativePos = RelativePosition(pos);
// prevent error from ouside the button
if( relativePos.x < m_selectableAreaPos.x
|| relativePos.y < m_selectableAreaPos.y

View File

@ -42,8 +42,8 @@ namespace widget {
bool m_buttonPressed; //!< Flag to know if the button is curently pressed.
int32_t m_imageDisplaySize; //!< Display size of the Image.
// hover area :
etk::Vector2D<float> m_selectableAreaPos; //!< Start position of the events
etk::Vector2D<float> m_selectableAreaSize; //!< Size of the event positions
vec2 m_selectableAreaPos; //!< Start position of the events
vec2 m_selectableAreaSize; //!< Size of the event positions
public:
/**
* @brief Constructor
@ -123,7 +123,7 @@ namespace widget {
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
// Derived function
virtual bool OnEventKb(ewol::keyEvent::status_te typeEvent, uniChar_t unicodeData);
private:

View File

@ -55,9 +55,9 @@ void widget::ButtonColor::SetShaperName(etk::UString shaperName)
bool widget::ButtonColor::CalculateMinSize(void)
{
etk::Vector2D<float> padding = m_shaper.GetPadding();
vec2 padding = m_shaper.GetPadding();
etk::UString label = draw::GetString(m_textColorFg);
etk::Vector3D<int32_t> minSize = m_text.CalculateSize(label);
ivec3 minSize = m_text.CalculateSize(label);
m_minSize.x = padding.x*2 + minSize.x + 7;
m_minSize.y = padding.y*2 + minSize.y;
MarkToRedraw();
@ -79,18 +79,18 @@ void widget::ButtonColor::OnRegenerateDisplay(void)
m_text.Clear();
m_shaper.Clear();
etk::Vector2D<float> padding = m_shaper.GetPadding();
vec2 padding = m_shaper.GetPadding();
etk::UString label = draw::GetString(m_textColorFg);
etk::Vector2D<int32_t> localSize = m_minSize;
ivec2 localSize = m_minSize;
etk::Vector3D<float> tmpOrigin((m_size.x - m_minSize.x) / 2.0,
vec3 tmpOrigin((m_size.x - m_minSize.x) / 2.0,
(m_size.y - m_minSize.y) / 2.0,
0.0);
// no change for the text orogin :
etk::Vector3D<float> tmpTextOrigin((m_size.x - m_minSize.x) / 2.0,
vec3 tmpTextOrigin((m_size.x - m_minSize.x) / 2.0,
(m_size.y - m_minSize.y) / 2.0,
0.0);
@ -129,26 +129,26 @@ void widget::ButtonColor::OnRegenerateDisplay(void)
}
// selection area :
m_selectableAreaPos = etk::Vector2D<float>(tmpOrigin.x-padding.x, tmpOrigin.y-padding.y);
m_selectableAreaSize = localSize + etk::Vector2D<float>(2,2)*padding;
m_selectableAreaPos = vec2(tmpOrigin.x-padding.x, tmpOrigin.y-padding.y);
m_selectableAreaSize = localSize + vec2(2,2)*padding;
m_shaper.SetOrigin(m_selectableAreaPos );
m_shaper.SetSize(m_selectableAreaSize);
m_shaper.SetInsidePos(etk::Vector2D<float>(tmpTextOrigin.x, tmpTextOrigin.y) );
etk::Vector3D<float> tmpp = m_text.CalculateSize(label);
etk::Vector2D<float> tmpp2(tmpp.x, tmpp.y);
m_shaper.SetInsidePos(vec2(tmpTextOrigin.x, tmpTextOrigin.y) );
vec3 tmpp = m_text.CalculateSize(label);
vec2 tmpp2(tmpp.x, tmpp.y);
m_shaper.SetInsideSize(tmpp2);
}
}
bool widget::ButtonColor::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos)
bool widget::ButtonColor::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
{
bool previousHoverState = m_mouseHover;
if(ewol::keyEvent::statusLeave == typeEvent) {
m_mouseHover = false;
m_buttonPressed = false;
} else {
etk::Vector2D<float> relativePos = RelativePosition(pos);
vec2 relativePos = RelativePosition(pos);
// prevent error from ouside the button
if( relativePos.x < m_selectableAreaPos.x
|| relativePos.y < m_selectableAreaPos.y
@ -181,7 +181,7 @@ bool widget::ButtonColor::OnEventInput(ewol::keyEvent::type_te type, int32_t IdI
EWOL_ERROR("Allocation Error");
return true;
}
etk::Vector2D<float> tmpPos = m_origin + m_selectableAreaPos + m_selectableAreaSize;
vec2 tmpPos = m_origin + m_selectableAreaPos + m_selectableAreaSize;
tmpPos.x -= m_minSize.x/2.0;
m_widgetContextMenu->SetPositionMark(widget::CONTEXT_MENU_MARK_BOTTOM, tmpPos );

View File

@ -30,8 +30,8 @@ namespace widget {
bool m_mouseHover; //!< Flag to know where the mouse is (inside the displayed widget (if not fill)).
bool m_buttonPressed; //!< Flag to know if the button is curently pressed.
// hover area :
etk::Vector2D<float> m_selectableAreaPos; //!< Start position of the events
etk::Vector2D<float> m_selectableAreaSize; //!< Size of the event positions
vec2 m_selectableAreaPos; //!< Start position of the events
vec2 m_selectableAreaSize; //!< Size of the event positions
public:
/**
* @brief Main constructor.
@ -68,7 +68,7 @@ namespace widget {
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
// Derived function
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
private:

View File

@ -47,7 +47,7 @@ widget::CheckBox::~CheckBox(void)
bool widget::CheckBox::CalculateMinSize(void)
{
etk::Vector3D<int32_t> minSize = m_oObjectText.CalculateSize(m_label);
ivec3 minSize = m_oObjectText.CalculateSize(m_label);
float boxSize = etk_max(20, minSize.y) + 5;
m_minSize.x = boxSize+minSize.x;
m_minSize.y = etk_max(boxSize, minSize.y)+3;
@ -89,14 +89,14 @@ void widget::CheckBox::OnRegenerateDisplay(void)
m_oObjectDecoration.Clear();
m_oObjectText.Clear();
etk::Vector3D<int32_t> minSize = m_oObjectText.CalculateSize(m_label);
ivec3 minSize = m_oObjectText.CalculateSize(m_label);
float boxSize = etk_max(20, minSize.y) + 5;
//int32_t fontWidth = ewol::GetWidth(fontId, m_label.c_str());
int32_t posy = (m_size.y - minSize.y - 6)/2 + 3;
//int32_t posx = (m_size.x - fontWidth - 6)/2 + 25;
etk::Vector3D<float> textPos;
vec3 textPos;
textPos.x = boxSize+5;
textPos.y = posy;
textPos.z = 0;
@ -104,18 +104,18 @@ void widget::CheckBox::OnRegenerateDisplay(void)
m_oObjectText.Print(m_label);
m_oObjectDecoration.SetColor(m_textColorBg);
m_oObjectDecoration.SetPos(etk::Vector3D<float>(2.5f, 2.5f, 0.0f) );
m_oObjectDecoration.RectangleWidth(etk::Vector3D<float>(boxSize, boxSize, 0.0f) );
m_oObjectDecoration.SetPos(vec3(2.5f, 2.5f, 0.0f) );
m_oObjectDecoration.RectangleWidth(vec3(boxSize, boxSize, 0.0f) );
if (m_value) {
m_oObjectDecoration.SetColor(m_textColorFg);
m_oObjectDecoration.SetPos(etk::Vector3D<float>(2.5f, 2.5f, 0.0f) );
m_oObjectDecoration.SetPos(vec3(2.5f, 2.5f, 0.0f) );
m_oObjectDecoration.SetThickness(3);
m_oObjectDecoration.LineRel(etk::Vector3D<float>(boxSize, boxSize, 0.0f) );
m_oObjectDecoration.LineRel(vec3(boxSize, boxSize, 0.0f) );
}
}
}
bool widget::CheckBox::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos)
bool widget::CheckBox::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
{
//EWOL_DEBUG("Event on checkbox ...");
if (1 == IdInput) {

View File

@ -45,7 +45,7 @@ namespace widget {
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
// Derived function
virtual bool OnEventKb(ewol::keyEvent::status_te typeEvent, uniChar_t unicodeData);
};

View File

@ -103,13 +103,13 @@ void widget::ColorBar::OnRegenerateDisplay(void)
* ********
*/
m_draw.SetColor(s_listColorWhite);
m_draw.SetPos(etk::Vector3D<float>(tmpOriginX + (iii)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY) );
m_draw.SetPos(vec3(tmpOriginX + (iii)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY) );
m_draw.AddVertex();
m_draw.SetColor(s_listColor[iii+1]);
m_draw.SetPos(etk::Vector3D<float>(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2) );
m_draw.SetPos(vec3(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2) );
m_draw.AddVertex();
m_draw.SetColor(s_listColor[iii]);
m_draw.SetPos(etk::Vector3D<float>(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2) );
m_draw.SetPos(vec3(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2) );
m_draw.AddVertex();
/* Step 2 :
* ********
@ -119,13 +119,13 @@ void widget::ColorBar::OnRegenerateDisplay(void)
*
*/
m_draw.SetColor(s_listColorWhite);
m_draw.SetPos(etk::Vector3D<float>(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY) );
m_draw.SetPos(vec3(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY) );
m_draw.AddVertex();
m_draw.SetColor(s_listColorWhite);
m_draw.SetPos(etk::Vector3D<float>(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY) );
m_draw.SetPos(vec3(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY) );
m_draw.AddVertex();
m_draw.SetColor(s_listColor[iii+1]);
m_draw.SetPos(etk::Vector3D<float>(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2) );
m_draw.SetPos(vec3(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2) );
m_draw.AddVertex();
/* Step 3 :
*
@ -135,13 +135,13 @@ void widget::ColorBar::OnRegenerateDisplay(void)
* ********
*/
m_draw.SetColor(s_listColor[iii]);
m_draw.SetPos(etk::Vector3D<float>(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2));
m_draw.SetPos(vec3(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2));
m_draw.AddVertex();
m_draw.SetColor(s_listColorBlack);
m_draw.SetPos(etk::Vector3D<float>(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY));
m_draw.SetPos(vec3(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY));
m_draw.AddVertex();
m_draw.SetColor(s_listColorBlack);
m_draw.SetPos(etk::Vector3D<float>(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY));
m_draw.SetPos(vec3(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY));
m_draw.AddVertex();
/* Step 4 :
* ********
@ -151,13 +151,13 @@ void widget::ColorBar::OnRegenerateDisplay(void)
*
*/
m_draw.SetColor(s_listColor[iii]);
m_draw.SetPos(etk::Vector3D<float>(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2));
m_draw.SetPos(vec3(tmpOriginX + iii*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2));
m_draw.AddVertex();
m_draw.SetColor(s_listColor[iii+1]);
m_draw.SetPos(etk::Vector3D<float>(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2));
m_draw.SetPos(vec3(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY/2));
m_draw.AddVertex();
m_draw.SetColor(s_listColorBlack);
m_draw.SetPos(etk::Vector3D<float>(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY));
m_draw.SetPos(vec3(tmpOriginX + (iii+1)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY));
m_draw.AddVertex();
}
if (m_currentUserPos.y > 0.5) {
@ -165,7 +165,7 @@ void widget::ColorBar::OnRegenerateDisplay(void)
} else {
m_draw.SetColor(draw::color::black);
}
m_draw.SetPos(etk::Vector3D<float>(m_currentUserPos.x*m_size.x, m_currentUserPos.y*m_size.y) );
m_draw.SetPos(vec3(m_currentUserPos.x*m_size.x, m_currentUserPos.y*m_size.y) );
m_draw.SetThickness(1);
m_draw.Circle(3.0);
@ -173,9 +173,9 @@ void widget::ColorBar::OnRegenerateDisplay(void)
}
bool widget::ColorBar::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos)
bool widget::ColorBar::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
{
etk::Vector2D<float> relativePos = RelativePosition(pos);
vec2 relativePos = RelativePosition(pos);
//EWOL_DEBUG("Event on BT ...");
if (1 == IdInput) {
relativePos.x = etk_max(etk_min(relativePos.x, m_size.x),0);

View File

@ -28,7 +28,7 @@ namespace widget {
private:
ewol::Drawing m_draw; //!< Compositing drawing element
draw::Color m_currentColor;
etk::Vector2D<float> m_currentUserPos;
vec2 m_currentUserPos;
public:
// Derived function
virtual const char * const GetObjectType(void) { return "widget::ColorBar"; };
@ -39,7 +39,7 @@ namespace widget {
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
};
};

View File

@ -48,8 +48,8 @@ bool widget::ContextMenu::CalculateSize(float availlableX, float availlableY)
m_size.y = availlableY;
if (NULL != m_subWidget) {
etk::Vector2D<float> subWidgetSize;
etk::Vector2D<float> subWidgetOrigin;
vec2 subWidgetSize;
vec2 subWidgetOrigin;
subWidgetSize = m_subWidget->GetMinSize();
if (true == m_subWidget->CanExpentX()) {
subWidgetSize.x = m_size.x;
@ -124,7 +124,7 @@ bool widget::ContextMenu::CalculateMinSize(void)
m_minSize.y = 50.0;
if (NULL != m_subWidget) {
m_subWidget->CalculateMinSize();
etk::Vector2D<float> tmpSize = m_subWidget->GetMinSize();
vec2 tmpSize = m_subWidget->GetMinSize();
m_minSize.x = tmpSize.x;
m_minSize.y = tmpSize.y;
}
@ -186,44 +186,44 @@ void widget::ContextMenu::OnRegenerateDisplay(void)
AddOObject(BGOObjects);
if (NULL != m_subWidget) {
etk::Vector2D<float> tmpSize = m_subWidget->GetSize();
etk::Vector2D<float> tmpOrigin = m_subWidget->GetOrigin();
vec2 tmpSize = m_subWidget->GetSize();
vec2 tmpOrigin = m_subWidget->GetOrigin();
// display border ...
BGOObjects->SetColor(m_colorBorder);
switch (m_arrawBorder)
{
case widget::CONTEXT_MENU_MARK_TOP:
BGOObjects->SetPos(etk::Vector3D<float>(m_arrowPos.x, m_arrowPos.y, 0.0f) );
BGOObjects->SetPos(vec3(m_arrowPos.x, m_arrowPos.y, 0.0f) );
BGOObjects->AddVertex();
if (m_arrowPos.x <= tmpOrigin.x ) {
float laking = m_offset - m_padding.y;
BGOObjects->SetPos(etk::Vector3D<float>(m_arrowPos.x+laking, m_arrowPos.y-laking, 0.0f) );
BGOObjects->SetPos(vec3(m_arrowPos.x+laking, m_arrowPos.y-laking, 0.0f) );
BGOObjects->AddVertex();
BGOObjects->SetPos(etk::Vector3D<float>(m_arrowPos.x, m_arrowPos.y-laking, 0.0f) );
BGOObjects->SetPos(vec3(m_arrowPos.x, m_arrowPos.y-laking, 0.0f) );
BGOObjects->AddVertex();
} else {
float laking = m_offset - m_padding.y;
BGOObjects->SetPos(etk::Vector3D<float>(m_arrowPos.x+laking, m_arrowPos.y-laking, 0.0f) );
BGOObjects->SetPos(vec3(m_arrowPos.x+laking, m_arrowPos.y-laking, 0.0f) );
BGOObjects->AddVertex();
BGOObjects->SetPos(etk::Vector3D<float>(m_arrowPos.x-laking, m_arrowPos.y-laking, 0.0f) );
BGOObjects->SetPos(vec3(m_arrowPos.x-laking, m_arrowPos.y-laking, 0.0f) );
BGOObjects->AddVertex();
}
break;
case widget::CONTEXT_MENU_MARK_BOTTOM:
BGOObjects->SetPos(etk::Vector3D<float>(m_arrowPos.x, m_arrowPos.y, 0.0f) );
BGOObjects->SetPos(vec3(m_arrowPos.x, m_arrowPos.y, 0.0f) );
BGOObjects->AddVertex();
if (m_arrowPos.x <= tmpOrigin.x ) {
int32_t laking = m_offset - m_padding.y;
BGOObjects->SetPos(etk::Vector3D<float>(m_arrowPos.x+laking, m_arrowPos.y+laking, 0.0f) );
BGOObjects->SetPos(vec3(m_arrowPos.x+laking, m_arrowPos.y+laking, 0.0f) );
BGOObjects->AddVertex();
BGOObjects->SetPos(etk::Vector3D<float>(m_arrowPos.x, m_arrowPos.y+laking, 0.0f) );
BGOObjects->SetPos(vec3(m_arrowPos.x, m_arrowPos.y+laking, 0.0f) );
BGOObjects->AddVertex();
} else {
int32_t laking = m_offset - m_padding.y;
BGOObjects->SetPos(etk::Vector3D<float>(m_arrowPos.x+laking, m_arrowPos.y+laking, 0.0f) );
BGOObjects->SetPos(vec3(m_arrowPos.x+laking, m_arrowPos.y+laking, 0.0f) );
BGOObjects->AddVertex();
BGOObjects->SetPos(etk::Vector3D<float>(m_arrowPos.x-laking, m_arrowPos.y+laking, 0.0f) );
BGOObjects->SetPos(vec3(m_arrowPos.x-laking, m_arrowPos.y+laking, 0.0f) );
BGOObjects->AddVertex();
}
break;
@ -233,12 +233,12 @@ void widget::ContextMenu::OnRegenerateDisplay(void)
EWOL_TODO("later");
break;
}
BGOObjects->SetPos(etk::Vector3D<float>(tmpOrigin.x-m_padding.x, tmpOrigin.y - m_padding.y, 0.0f) );
BGOObjects->RectangleWidth(etk::Vector3D<float>(tmpSize.x + m_padding.x*2, tmpSize.y + m_padding.y*2, 0.0f) );
BGOObjects->SetPos(vec3(tmpOrigin.x-m_padding.x, tmpOrigin.y - m_padding.y, 0.0f) );
BGOObjects->RectangleWidth(vec3(tmpSize.x + m_padding.x*2, tmpSize.y + m_padding.y*2, 0.0f) );
// set the area in white ...
BGOObjects->SetColor(m_colorBackGroung);
BGOObjects->SetPos(etk::Vector3D<float>(tmpOrigin.x, tmpOrigin.y, 0.0f) );
BGOObjects->RectangleWidth(etk::Vector3D<float>(tmpSize.x, tmpSize.y, 0.0f) );
BGOObjects->SetPos(vec3(tmpOrigin.x, tmpOrigin.y, 0.0f) );
BGOObjects->RectangleWidth(vec3(tmpSize.x, tmpSize.y, 0.0f) );
}
if (NULL != m_subWidget) {
m_subWidget->OnRegenerateDisplay();
@ -246,14 +246,14 @@ void widget::ContextMenu::OnRegenerateDisplay(void)
}
ewol::Widget * widget::ContextMenu::GetWidgetAtPos(etk::Vector2D<float> pos)
ewol::Widget * widget::ContextMenu::GetWidgetAtPos(vec2 pos)
{
// calculate relative position
etk::Vector2D<float> relativePos = RelativePosition(pos);
vec2 relativePos = RelativePosition(pos);
// Check for sub Element
if (NULL != m_subWidget) {
etk::Vector2D<float> tmpSize = m_subWidget->GetSize();
etk::Vector2D<float> tmpOrigin = m_subWidget->GetOrigin();
vec2 tmpSize = m_subWidget->GetSize();
vec2 tmpOrigin = m_subWidget->GetOrigin();
if( (tmpOrigin.x <= relativePos.x && tmpOrigin.x + tmpSize.x >= relativePos.x)
&& (tmpOrigin.y <= relativePos.y && tmpOrigin.y + tmpSize.y >= relativePos.y) )
{
@ -264,7 +264,7 @@ ewol::Widget * widget::ContextMenu::GetWidgetAtPos(etk::Vector2D<float> pos)
}
bool widget::ContextMenu::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos)
bool widget::ContextMenu::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
{
//EWOL_INFO("Event ouside the context menu");
if (IdInput > 0) {
@ -283,7 +283,7 @@ bool widget::ContextMenu::OnEventInput(ewol::keyEvent::type_te type, int32_t IdI
}
void widget::ContextMenu::SetPositionMark(markPosition_te position, etk::Vector2D<float> arrowPos)
void widget::ContextMenu::SetPositionMark(markPosition_te position, vec2 arrowPos)
{
EWOL_DEBUG("set context menu at the position : (" << arrowPos.x << "," << arrowPos.y << ")");
m_arrawBorder = position;

View File

@ -39,15 +39,15 @@ namespace widget {
private:
draw::Color m_colorBackGroung;
draw::Color m_colorBorder;
etk::Vector2D<float> m_padding;
etk::Vector2D<float> m_arrowPos;
vec2 m_padding;
vec2 m_arrowPos;
float m_offset;
markPosition_te m_arrawBorder;
ewol::Widget* m_subWidget;
public:
void SubWidgetSet(ewol::Widget* newWidget);
void SubWidgetRemove(void);
void SetPositionMark(markPosition_te position, etk::Vector2D<float> arrowPos);
void SetPositionMark(markPosition_te position, vec2 arrowPos);
protected:
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
@ -55,9 +55,9 @@ namespace widget {
// Derived function
virtual void OnRegenerateDisplay(void);
// Derived function
virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D<float> pos);
virtual ewol::Widget * GetWidgetAtPos(vec2 pos);
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
};
};

View File

@ -68,7 +68,7 @@ widget::Entry::~Entry(void)
bool widget::Entry::CalculateMinSize(void)
{
etk::Vector2D<float> padding = m_shaper.GetPadding();
vec2 padding = m_shaper.GetPadding();
int32_t minHeight = m_oObjectText.CalculateSize('A').y;
m_minSize.x = m_userSize + 2*padding.x;
@ -107,7 +107,7 @@ void widget::Entry::OnRegenerateDisplay(void)
m_shaper.Clear();
m_oObjectText.Clear();
UpdateTextPosition();
etk::Vector2D<float> padding = m_shaper.GetPadding();
vec2 padding = m_shaper.GetPadding();
int32_t tmpSizeX = m_minSize.x;
int32_t tmpSizeY = m_minSize.y;
@ -131,13 +131,13 @@ void widget::Entry::OnRegenerateDisplay(void)
tmpSizeY -= 2*padding.y;
etk::Vector3D<float> textPos( tmpTextOriginX + m_displayStartPosition,
vec3 textPos( tmpTextOriginX + m_displayStartPosition,
tmpTextOriginY,
0 );
etk::Vector3D<float> drawClippingPos( padding.x,
vec3 drawClippingPos( padding.x,
padding.y,
-1 );
etk::Vector3D<float> drawClippingSize( m_size.x - 2*drawClippingPos.x,
vec3 drawClippingSize( m_size.x - 2*drawClippingPos.x,
m_size.y - 2*drawClippingPos.y,
1 );
m_oObjectText.SetClippingWidth(drawClippingPos, drawClippingSize);
@ -154,11 +154,11 @@ void widget::Entry::OnRegenerateDisplay(void)
}
void widget::Entry::UpdateCursorPosition(etk::Vector2D<float>& pos, bool selection)
void widget::Entry::UpdateCursorPosition(vec2& pos, bool selection)
{
etk::Vector2D<float> padding = m_shaper.GetPadding();
vec2 padding = m_shaper.GetPadding();
etk::Vector2D<float> relPos = RelativePosition(pos);
vec2 relPos = RelativePosition(pos);
relPos.x += -m_displayStartPosition - padding.x;
// try to find the new cursor position :
etk::UString tmpDisplay = m_data.Extract(0, m_displayStartPosition);
@ -230,7 +230,7 @@ void widget::Entry::CopySelectionToClipBoard(ewol::clipBoard::clipboardListe_te
}
bool widget::Entry::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos)
bool widget::Entry::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
{
//EWOL_DEBUG("Event on Entry ... type=" << (int32_t)type << " id=" << IdInput);
if (1 == IdInput) {
@ -444,7 +444,7 @@ void widget::Entry::OnReceiveMessage(ewol::EObject * CallerObject, const char *
void widget::Entry::UpdateTextPosition(void)
{
etk::Vector2D<float> padding = m_shaper.GetPadding();
vec2 padding = m_shaper.GetPadding();
int32_t tmpSizeX = m_minSize.x;
if (true==m_userFill.x) {

View File

@ -72,7 +72,7 @@ namespace widget {
// Derived function
virtual void OnRegenerateDisplay(void);
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
// Derived function
virtual bool OnEventKb(ewol::keyEvent::status_te typeEvent, uniChar_t unicodeData);
// Derived function
@ -90,7 +90,7 @@ namespace widget {
* @note The display is automaticly requested when change apear.
* @return ---
*/
virtual void UpdateCursorPosition(etk::Vector2D<float>& pos, bool Selection=false);
virtual void UpdateCursorPosition(vec2& pos, bool Selection=false);
/**
* @brief Update the display position start ==> depending of the position of the Cursor and the size of the Data inside
* @param ---

View File

@ -54,7 +54,7 @@ widget::Image::~Image(void)
}
void widget::Image::SetPadding(etk::Vector2D<float> newPadding)
void widget::Image::SetPadding(vec2 newPadding)
{
m_padding = newPadding;
}
@ -102,14 +102,14 @@ void widget::Image::OnRegenerateDisplay(void)
ewol::Image * tmpImage = NULL;
tmpImage = new ewol::Image(m_imageSelected); // TODO : Check if it was possible later : , m_imageSize, m_imageSize);
tmpImage->SetPos(etk::Vector3D<float>(tmpOriginX, tmpOriginY, 0) );
tmpImage->Print(etk::Vector2D<float>(m_imageSize, m_imageSize));
tmpImage->SetPos(vec3(tmpOriginX, tmpOriginY, 0) );
tmpImage->Print(vec2(m_imageSize, m_imageSize));
ewol::Drawing * tmpDraw = new ewol::Drawing();
tmpDraw->SetColor(m_textColorBg);
tmpDraw->SetPos(etk::Vector3D<float>(tmpOriginX, tmpOriginY, 0) );
tmpDraw->RectangleWidth(etk::Vector3D<float>(tmpSizeX, tmpSizeY, 0) );
tmpDraw->SetPos(vec3(tmpOriginX, tmpOriginY, 0) );
tmpDraw->RectangleWidth(vec3(tmpSizeX, tmpSizeY, 0) );
// add all needed objects ...
if (NULL != tmpDraw) {
AddOObject(tmpDraw);
@ -120,7 +120,7 @@ void widget::Image::OnRegenerateDisplay(void)
}
}
bool widget::Image::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos)
bool widget::Image::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
{
//EWOL_DEBUG("Event on BT ...");
if (1 == IdInput) {

View File

@ -28,17 +28,17 @@ namespace widget {
// Derived function
virtual bool CalculateMinSize(void);
void SetFile(etk::UString newFile);
void SetPadding(etk::Vector2D<float> newPadding);
void SetPadding(vec2 newPadding);
private:
etk::UString m_imageSelected;
etk::Vector2D<float> m_padding;
vec2 m_padding;
draw::Color m_textColorBg; //!< Background color
int32_t m_imageSize;
public:
// Derived function
virtual void OnRegenerateDisplay(void);
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
};
};

View File

@ -121,13 +121,13 @@ Sine Function: sin(teta) = Opposite / Hypotenuse
Cosine Function: cos(teta) = Adjacent / Hypotenuse
Tangent Function: tan(teta) = Opposite / Adjacent
*/
bool widget::Joystick::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos)
bool widget::Joystick::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
{
if (1 == IdInput) {
if( ewol::keyEvent::statusDown == typeEvent
|| ewol::keyEvent::statusMove == typeEvent) {
// get local relative position
etk::Vector2D<float> relativePos = RelativePosition(pos);
vec2 relativePos = RelativePosition(pos);
float sizeElement = m_size.x*m_ratio;
// Calculate the position of the cursor...
m_displayPos.x = (relativePos.x-sizeElement)/(m_size.x-sizeElement*2)*2.0 - 1.0;

View File

@ -28,7 +28,7 @@ namespace widget {
private:
draw::Color m_colorFg; //!< Forground color
draw::Color m_colorBg; //!< Background color
etk::Vector2D<float> m_displayPos; //!< direction of the cursor ...
vec2 m_displayPos; //!< direction of the cursor ...
float m_distance; //!< dintance from the center
float m_angle; //!< angle of the arraw (if < 0 : No arraw...) 0 is the TOP ...
bool m_lock; //!< flag to mark the lock when the cursor is free when we are outside the circle
@ -49,7 +49,7 @@ namespace widget {
// Derived function
virtual void OnRegenerateDisplay(void);
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
void SetLockMode(bool lockWhenOut) { m_lock = lockWhenOut; };
void SetDisplayMode(joystickMode_te newMode) { m_displayMode = newMode; };
/**

View File

@ -48,7 +48,7 @@ widget::Label::~Label(void)
bool widget::Label::CalculateMinSize(void)
{
etk::Vector3D<int32_t> minSize = m_oObjectText.CalculateSize(m_label);
ivec3 minSize = m_oObjectText.CalculateSize(m_label);
m_minSize.x = 3 + minSize.x;
m_minSize.y = 3 + minSize.y;
return true;
@ -86,14 +86,14 @@ void widget::Label::OnRegenerateDisplay(void)
tmpOriginY += paddingSize;
etk::Vector3D<float> textPos(tmpOriginX, tmpOriginY, 0);
vec3 textPos(tmpOriginX, tmpOriginY, 0);
m_oObjectText.SetPos(textPos);
m_oObjectText.Print(m_label);
}
}
bool widget::Label::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos)
bool widget::Label::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
{
//EWOL_DEBUG("Event on Label ...");
if (1 == IdInput) {

View File

@ -39,7 +39,7 @@ namespace widget {
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
};
};

View File

@ -57,7 +57,7 @@ bool widget::Layer::CalculateMinSize(void)
if (true == m_subWidget[iii]->CanExpentY()) {
m_userExpend.y = true;
}
etk::Vector2D<float> tmpSize = m_subWidget[iii]->GetMinSize();
vec2 tmpSize = m_subWidget[iii]->GetMinSize();
m_minSize.x = etk_max(tmpSize.x, m_minSize.x);
m_minSize.y = etk_max(tmpSize.y, m_minSize.y);
}
@ -174,13 +174,13 @@ void widget::Layer::OnRegenerateDisplay(void)
}
ewol::Widget * widget::Layer::GetWidgetAtPos(etk::Vector2D<float> pos)
ewol::Widget * widget::Layer::GetWidgetAtPos(vec2 pos)
{
// for all element in the sizer ...
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
if (NULL != m_subWidget[iii]) {
etk::Vector2D<float> tmpSize = m_subWidget[iii]->GetSize();
etk::Vector2D<float> tmpOrigin = m_subWidget[iii]->GetOrigin();
vec2 tmpSize = m_subWidget[iii]->GetSize();
vec2 tmpOrigin = m_subWidget[iii]->GetOrigin();
if( (tmpOrigin.x <= pos.x && tmpOrigin.x + tmpSize.x >= pos.x)
&& (tmpOrigin.y <= pos.y && tmpOrigin.y + tmpSize.y >= pos.y) )
{

View File

@ -47,7 +47,7 @@ namespace widget {
// Derived function
virtual void OnRegenerateDisplay(void);
// Derived function
virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D<float> pos);
virtual ewol::Widget * GetWidgetAtPos(vec2 pos);
// Derived function
virtual void OnObjectRemove(ewol::EObject * removeObject);
};

View File

@ -126,8 +126,8 @@ void widget::List::OnRegenerateDisplay(void)
ewol::Drawing * BGOObjects = new ewol::Drawing();
draw::Color basicBG = GetBasicBG();
BGOObjects->SetColor(basicBG);
BGOObjects->SetPos(etk::Vector3D<float>(0, 0, 0) );
BGOObjects->RectangleWidth(etk::Vector3D<float>(m_size.x, m_size.y, 0) );
BGOObjects->SetPos(vec3(0, 0, 0) );
BGOObjects->RectangleWidth(vec3(m_size.x, m_size.y, 0) );
int32_t startRaw = m_originScrooled.y / (minHeight + 2*m_paddingSizeY);
@ -150,7 +150,7 @@ void widget::List::OnRegenerateDisplay(void)
m_lineSize.Clear();
int32_t displayPositionY = m_size.y;
int32_t displayPositionX = 0;
etk::Vector2D<int32_t> tmpRegister(startRaw, displayPositionY);
ivec2 tmpRegister(startRaw, displayPositionY);
// add the default position raw :
m_lineSize.PushBack(tmpRegister);
@ -170,15 +170,15 @@ void widget::List::OnRegenerateDisplay(void)
displayPositionY-=(tmpFontHeight+m_paddingSizeY);
BGOObjects->SetColor(bg);
BGOObjects->SetPos(etk::Vector3D<float>(displayPositionX, displayPositionY, 0) );
BGOObjects->RectangleWidth(etk::Vector3D<float>(m_size.x-displayPositionX, tmpFontHeight+2*m_paddingSizeY, 0));
BGOObjects->SetPos(vec3(displayPositionX, displayPositionY, 0) );
BGOObjects->RectangleWidth(vec3(m_size.x-displayPositionX, tmpFontHeight+2*m_paddingSizeY, 0));
// get the maximum size of the colomn :
etk::Vector3D<float> textSize = tmpText->CalculateSize(myTextToWrite);
vec3 textSize = tmpText->CalculateSize(myTextToWrite);
sizeColom = etk_max(sizeColom, textSize.x);
tmpText->SetColor(fg);
tmpText->SetPos(etk::Vector3D<float>(tmpOriginX + displayPositionX, displayPositionY, 0) );
tmpText->SetPos(vec3(tmpOriginX + displayPositionX, displayPositionY, 0) );
tmpText->Print(myTextToWrite);
AddOObject(tmpText);
// madding move ...
@ -202,9 +202,9 @@ void widget::List::OnRegenerateDisplay(void)
}
}
bool widget::List::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos)
bool widget::List::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
{
etk::Vector2D<float> relativePos = RelativePosition(pos);
vec2 relativePos = RelativePosition(pos);
if (true == WidgetScrooled::OnEventInput(type, IdInput, typeEvent, pos)) {
ewol::widgetManager::FocusKeep(this);

View File

@ -29,7 +29,7 @@ namespace widget {
// Drawing capabilities ....
private:
etk::Vector<ewol::Compositing*> m_listOObject; //!< generic element to display...
etk::Vector<etk::Vector2D<int32_t> > m_lineSize;
etk::Vector<ivec2 > m_lineSize;
public:
void AddOObject(ewol::Compositing* newObject, int32_t pos=-1);
void ClearOObjectList(void);
@ -46,7 +46,7 @@ namespace widget {
// Derived function
virtual void OnRegenerateDisplay(void);
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
protected:
// function call to display the list :
virtual draw::Color GetBasicBG(void) {

View File

@ -146,11 +146,11 @@ void widget::Menu::OnReceiveMessage(ewol::EObject * CallerObject, const char * e
return;
}
// Get the button widget :
etk::Vector2D<float> newPosition;
vec2 newPosition;
ewol::Widget * eventFromWidget = static_cast<ewol::Widget*>(CallerObject);
if (NULL != eventFromWidget) {
etk::Vector2D<float> tmpOri = eventFromWidget->GetOrigin();
etk::Vector2D<float> tmpSize = eventFromWidget->GetSize();
vec2 tmpOri = eventFromWidget->GetOrigin();
vec2 tmpSize = eventFromWidget->GetSize();
// calculate the correct position
newPosition.x = tmpOri.x + tmpSize.x/2;
newPosition.y = tmpOri.y;

View File

@ -44,8 +44,8 @@ bool widget::PopUp::CalculateSize(float availlableX, float availlableY)
m_size.y = availlableY;
if (NULL != m_subWidget) {
etk::Vector2D<float> subWidgetSize;
etk::Vector2D<float> subWidgetOrigin;
vec2 subWidgetSize;
vec2 subWidgetOrigin;
subWidgetSize = m_subWidget->GetMinSize();
if (true == m_subWidget->CanExpentX()) {
subWidgetSize.x = m_size.x;
@ -81,7 +81,7 @@ bool widget::PopUp::CalculateMinSize(void)
m_minSize.y = 50.0;
if (NULL != m_subWidget) {
m_subWidget->CalculateMinSize();
etk::Vector2D<float> tmpSize = m_subWidget->GetMinSize();
vec2 tmpSize = m_subWidget->GetMinSize();
m_minSize.x = tmpSize.x;
m_minSize.y = tmpSize.y;
}
@ -149,18 +149,18 @@ void widget::PopUp::OnRegenerateDisplay(void)
AddOObject(BGOObjects);
BGOObjects->SetColor(m_colorEmptyArea);
BGOObjects->SetPos(etk::Vector3D<float>(0,0,0));
BGOObjects->RectangleWidth(etk::Vector3D<float>(m_size.x, m_size.y, 0));
BGOObjects->SetPos(vec3(0,0,0));
BGOObjects->RectangleWidth(vec3(m_size.x, m_size.y, 0));
// set the area in white ...
if (NULL != m_subWidget) {
etk::Vector2D<float> tmpSize = m_subWidget->GetSize();
etk::Vector2D<float> tmpOrigin = m_subWidget->GetOrigin();
vec2 tmpSize = m_subWidget->GetSize();
vec2 tmpOrigin = m_subWidget->GetOrigin();
BGOObjects->SetColor(m_colorBorder);
BGOObjects->SetPos(etk::Vector3D<float>(tmpOrigin.x-BORDER_SIZE_TMP, tmpOrigin.y-BORDER_SIZE_TMP,0) );
BGOObjects->RectangleWidth(etk::Vector3D<float>(tmpSize.x+2*BORDER_SIZE_TMP, tmpSize.y+2*BORDER_SIZE_TMP, 0) );
BGOObjects->SetPos(vec3(tmpOrigin.x-BORDER_SIZE_TMP, tmpOrigin.y-BORDER_SIZE_TMP,0) );
BGOObjects->RectangleWidth(vec3(tmpSize.x+2*BORDER_SIZE_TMP, tmpSize.y+2*BORDER_SIZE_TMP, 0) );
BGOObjects->SetColor(m_colorBackGroung);
BGOObjects->SetPos(etk::Vector3D<float>(tmpOrigin.x, tmpOrigin.y,0) );
BGOObjects->RectangleWidth(etk::Vector3D<float>(tmpSize.x, tmpSize.y, 0) );
BGOObjects->SetPos(vec3(tmpOrigin.x, tmpOrigin.y,0) );
BGOObjects->RectangleWidth(vec3(tmpSize.x, tmpSize.y, 0) );
}
if (NULL != m_subWidget) {
m_subWidget->OnRegenerateDisplay();
@ -168,14 +168,14 @@ void widget::PopUp::OnRegenerateDisplay(void)
}
ewol::Widget * widget::PopUp::GetWidgetAtPos(etk::Vector2D<float> pos)
ewol::Widget * widget::PopUp::GetWidgetAtPos(vec2 pos)
{
// calculate relative position
etk::Vector2D<float> relativePos = RelativePosition(pos);
vec2 relativePos = RelativePosition(pos);
// for the element in the pop-up ...
if (NULL != m_subWidget) {
etk::Vector2D<float> tmpSize = m_subWidget->GetSize();
etk::Vector2D<float> tmpOrigin = m_subWidget->GetOrigin();
vec2 tmpSize = m_subWidget->GetSize();
vec2 tmpOrigin = m_subWidget->GetOrigin();
if( (tmpOrigin.x <= relativePos.x && tmpOrigin.x + tmpSize.x >= relativePos.x)
&& (tmpOrigin.y <= relativePos.y && tmpOrigin.y + tmpSize.y >= relativePos.y) )
{

View File

@ -52,7 +52,7 @@ namespace widget {
// Derived function
virtual void OnRegenerateDisplay(void);
// Derived function
virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D<float> pos);
virtual ewol::Widget * GetWidgetAtPos(vec2 pos);
// Derived function
virtual void OnObjectRemove(ewol::EObject * removeObject);
};

View File

@ -72,11 +72,11 @@ void widget::ProgressBar::OnRegenerateDisplay(void)
int32_t tmpOriginX = 5;
int32_t tmpOriginY = 5;
tmpDraw->SetColor(m_textColorBgOn);
tmpDraw->SetPos(etk::Vector3D<float>(tmpOriginX, tmpOriginY, 0) );
tmpDraw->RectangleWidth(etk::Vector3D<float>(tmpSizeX*m_value, tmpSizeY, 0) );
tmpDraw->SetPos(vec3(tmpOriginX, tmpOriginY, 0) );
tmpDraw->RectangleWidth(vec3(tmpSizeX*m_value, tmpSizeY, 0) );
tmpDraw->SetColor(m_textColorBgOff);
tmpDraw->SetPos(etk::Vector3D<float>(tmpOriginX+tmpSizeX*m_value, tmpOriginY, 0) );
tmpDraw->RectangleWidth(etk::Vector3D<float>(tmpSizeX*(1.0-m_value), tmpSizeY, 0) );
tmpDraw->SetPos(vec3(tmpOriginX+tmpSizeX*m_value, tmpOriginY, 0) );
tmpDraw->RectangleWidth(vec3(tmpSizeX*(1.0-m_value), tmpSizeY, 0) );
// TODO : Create a better progress Bar ...
//tmpDraw->SetColor(m_textColorFg);

View File

@ -126,7 +126,7 @@ void widget::Scene::GenDraw(DrawProperty displayProp)
float ratio = m_size.x / m_size.y;
m_zoom = 1.0/1000.0;
//EWOL_INFO("ratio : " << ratio);
etk::Matrix4 tmpProjection;
mat4 tmpProjection;
if (ratio >= 1.0) {
tmpProjection = etk::matrix::Perspective(-ratio, ratio, -1, 1, -1, 1);
@ -134,8 +134,8 @@ void widget::Scene::GenDraw(DrawProperty displayProp)
ratio = 1.0/ratio;
tmpProjection = etk::matrix::Perspective(-1, 1, -ratio, ratio, -1, 1);
}
etk::Matrix4 tmpScale = etk::matrix::Scale(m_zoom, m_zoom, m_zoom);
etk::Matrix4 tmpMat = tmpProjection * tmpScale;
mat4 tmpScale = etk::matrix::Scale(m_zoom, m_zoom, m_zoom);
mat4 tmpMat = tmpProjection * tmpScale;
// set internal matrix system :
ewol::openGL::SetMatrix(tmpMat);
// Clear the screen with transparency ...
@ -148,7 +148,7 @@ void widget::Scene::GenDraw(DrawProperty displayProp)
}
etk::Vector2D<float> widget::Scene::RelativePosition(etk::Vector2D<float> pos)
vec2 widget::Scene::RelativePosition(vec2 pos)
{
// Remove origin of the widget
pos.x -= m_origin.x;

View File

@ -71,8 +71,8 @@ namespace widget {
virtual void ScenePeriodicCall(int64_t localTime, int32_t deltaTime) { };
// camera properties :
private:
etk::Vector3D<float> m_camRotation;
etk::Vector3D<float> m_camTranslation;
vec3 m_camRotation;
vec3 m_camTranslation;
float m_camAngleView;
float m_camdistanceViewStart;
float m_camdistanceViewStop;
@ -88,7 +88,7 @@ namespace widget {
* @param[in] pos Absolute position that you request convertion
* @return the relative position
*/
virtual etk::Vector2D<float> RelativePosition(etk::Vector2D<float> pos);
virtual vec2 RelativePosition(vec2 pos);
};
};

View File

@ -35,7 +35,7 @@ bool widget::SizerHori::CalculateSize(float availlableX, float availlableY)
int32_t nbWidgetNotFixedSize=0;
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
if (NULL != m_subWidget[iii]) {
etk::Vector2D<float> tmpSize = m_subWidget[iii]->GetMinSize();
vec2 tmpSize = m_subWidget[iii]->GetMinSize();
unexpendableSize += tmpSize.x;
if (false == m_subWidget[iii]->CanExpentX()) {
nbWidgetFixedSize++;
@ -52,12 +52,12 @@ bool widget::SizerHori::CalculateSize(float availlableX, float availlableY)
sizeToAddAtEveryOne=0;
}
}
etk::Vector2D<float> tmpOrigin;
vec2 tmpOrigin;
tmpOrigin.x = m_origin.x;
tmpOrigin.y = m_origin.y;
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
if (NULL != m_subWidget[iii]) {
etk::Vector2D<float> tmpSize = m_subWidget[iii]->GetMinSize();
vec2 tmpSize = m_subWidget[iii]->GetMinSize();
// Set the origin :
//EWOL_DEBUG("Set ORIGIN : " << tmpOrigin.x << "," << tmpOrigin.y << ")");
m_subWidget[iii]->SetOrigin(tmpOrigin.x, tmpOrigin.y);
@ -92,7 +92,7 @@ bool widget::SizerHori::CalculateMinSize(void)
if (true == m_subWidget[iii]->CanExpentY()) {
m_userExpend.y = true;
}
etk::Vector2D<float> tmpSize = m_subWidget[iii]->GetMinSize();
vec2 tmpSize = m_subWidget[iii]->GetMinSize();
m_minSize.x += tmpSize.x;
if (tmpSize.y>m_minSize.y) {
m_minSize.y = tmpSize.y;
@ -216,7 +216,7 @@ void widget::SizerHori::OnRegenerateDisplay(void)
}
ewol::Widget * widget::SizerHori::GetWidgetAtPos(etk::Vector2D<float> pos)
ewol::Widget * widget::SizerHori::GetWidgetAtPos(vec2 pos)
{
if (true == IsHide()) {
return NULL;
@ -224,8 +224,8 @@ ewol::Widget * widget::SizerHori::GetWidgetAtPos(etk::Vector2D<float> pos)
// for all element in the sizer ...
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
if (NULL != m_subWidget[iii]) {
etk::Vector2D<float> tmpSize = m_subWidget[iii]->GetSize();
etk::Vector2D<float> tmpOrigin = m_subWidget[iii]->GetOrigin();
vec2 tmpSize = m_subWidget[iii]->GetSize();
vec2 tmpOrigin = m_subWidget[iii]->GetOrigin();
if( (tmpOrigin.x <= pos.x && tmpOrigin.x + tmpSize.x >= pos.x)
&& (tmpOrigin.y <= pos.y && tmpOrigin.y + tmpSize.y >= pos.y) )
{

View File

@ -35,7 +35,7 @@ namespace widget {
// Derived function
virtual void OnRegenerateDisplay(void);
// Derived function
virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D<float> pos);
virtual ewol::Widget * GetWidgetAtPos(vec2 pos);
// Derived function
virtual void OnObjectRemove(ewol::EObject * removeObject);
// Derived function

View File

@ -37,7 +37,7 @@ bool widget::SizerVert::CalculateSize(float availlableX, float availlableY)
int32_t nbWidgetNotFixedSize=0;
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
if (NULL != m_subWidget[iii]) {
etk::Vector2D<float> tmpSize = m_subWidget[iii]->GetMinSize();
vec2 tmpSize = m_subWidget[iii]->GetMinSize();
unexpendableSize += tmpSize.y;
if (false == m_subWidget[iii]->CanExpentY()) {
nbWidgetFixedSize++;
@ -55,12 +55,12 @@ bool widget::SizerVert::CalculateSize(float availlableX, float availlableY)
sizeToAddAtEveryOne=0;
}
}
etk::Vector2D<float> tmpOrigin;
vec2 tmpOrigin;
tmpOrigin.x = m_origin.x;
tmpOrigin.y = m_origin.y;
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
if (NULL != m_subWidget[iii]) {
etk::Vector2D<float> tmpSize = m_subWidget[iii]->GetMinSize();
vec2 tmpSize = m_subWidget[iii]->GetMinSize();
// Set the origin :
//EWOL_DEBUG("Set ORIGIN : " << tmpOrigin.x << "," << tmpOrigin.y << ")");
m_subWidget[iii]->SetOrigin(tmpOrigin.x, tmpOrigin.y);
@ -95,7 +95,7 @@ bool widget::SizerVert::CalculateMinSize(void)
if (true == m_subWidget[iii]->CanExpentY()) {
m_userExpend.y = true;
}
etk::Vector2D<float> tmpSize = m_subWidget[iii]->GetMinSize();
vec2 tmpSize = m_subWidget[iii]->GetMinSize();
//EWOL_DEBUG(" Get minSize[" << iii << "] ("<< tmpSize.x << "," << tmpSize.y << ")");
m_minSize.y += tmpSize.y;
if (tmpSize.x>m_minSize.x) {
@ -219,7 +219,7 @@ void widget::SizerVert::OnRegenerateDisplay(void)
}
ewol::Widget * widget::SizerVert::GetWidgetAtPos(etk::Vector2D<float> pos)
ewol::Widget * widget::SizerVert::GetWidgetAtPos(vec2 pos)
{
if (true == IsHide()) {
return NULL;
@ -227,8 +227,8 @@ ewol::Widget * widget::SizerVert::GetWidgetAtPos(etk::Vector2D<float> pos)
// for all element in the sizer ...
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
if (NULL != m_subWidget[iii]) {
etk::Vector2D<float> tmpSize = m_subWidget[iii]->GetSize();
etk::Vector2D<float> tmpOrigin = m_subWidget[iii]->GetOrigin();
vec2 tmpSize = m_subWidget[iii]->GetSize();
vec2 tmpOrigin = m_subWidget[iii]->GetOrigin();
if( (tmpOrigin.x <= pos.x && tmpOrigin.x + tmpSize.x >= pos.x)
&& (tmpOrigin.y <= pos.y && tmpOrigin.y + tmpSize.y >= pos.y) )
{

View File

@ -35,7 +35,7 @@ namespace widget {
// Derived function
virtual void OnRegenerateDisplay(void);
// Derived function
virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D<float> pos);
virtual ewol::Widget * GetWidgetAtPos(vec2 pos);
// Derived function
virtual void OnObjectRemove(ewol::EObject * removeObject);
// Derived function

View File

@ -93,13 +93,13 @@ void widget::Slider::OnRegenerateDisplay(void)
tmpDraw->SetColor(m_textColorFg);
// draw a line :
tmpDraw->SetThickness(1);
tmpDraw->SetPos(etk::Vector3D<float>(dotRadius, m_size.y/2) );
tmpDraw->LineTo(etk::Vector3D<float>(m_size.x-dotRadius, m_size.y/2) );
tmpDraw->SetPos(vec3(dotRadius, m_size.y/2) );
tmpDraw->LineTo(vec3(m_size.x-dotRadius, m_size.y/2) );
tmpDraw->SetThickness(0);
draw::Color borderDot = m_textColorFg;
borderDot.a /= 2;
tmpDraw->SetPos(etk::Vector3D<float>(4+((float)(m_value-m_min)/(float)(m_max-m_min))*(float)(m_size.x-2*dotRadius), m_size.y/2) );
tmpDraw->SetPos(vec3(4+((float)(m_value-m_min)/(float)(m_max-m_min))*(float)(m_size.x-2*dotRadius), m_size.y/2) );
tmpDraw->SetColorBg(borderDot);
tmpDraw->Circle(dotRadius);
tmpDraw->SetColorBg(m_textColorFg);
@ -109,9 +109,9 @@ void widget::Slider::OnRegenerateDisplay(void)
}
bool widget::Slider::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos)
bool widget::Slider::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
{
etk::Vector2D<float> relativePos = RelativePosition(pos);
vec2 relativePos = RelativePosition(pos);
//EWOL_DEBUG("Event on Slider ...");
if (1 == IdInput) {
if( ewol::keyEvent::statusSingle == typeEvent

View File

@ -41,7 +41,7 @@ namespace widget {
// Derived function
virtual void OnRegenerateDisplay(void);
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
};
};

View File

@ -63,7 +63,7 @@ void widget::Spacer::OnRegenerateDisplay(void)
return;
}
m_draw.SetColor(m_color);
m_draw.SetPos(etk::Vector3D<float>(0, 0, 0) );
m_draw.RectangleWidth(etk::Vector3D<float>(m_size.x, m_size.y) );
m_draw.SetPos(vec3(0, 0, 0) );
m_draw.RectangleWidth(vec3(m_size.x, m_size.y) );
}

View File

@ -47,7 +47,7 @@ namespace widget {
// Derived function
virtual bool CalculateMinSize(void);
// Derived function
virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D<float> pos) { return NULL; };
virtual ewol::Widget * GetWidgetAtPos(vec2 pos) { return NULL; };
// Derived function
virtual void OnRegenerateDisplay(void);
// Derived function

View File

@ -83,7 +83,7 @@ bool widget::WSlider::CalculateMinSize(void)
if (true == m_subWidget[iii]->CanExpentY()) {
m_underExpend.y = true;
}
etk::Vector2D<float> tmpSize = m_subWidget[iii]->GetMinSize();
vec2 tmpSize = m_subWidget[iii]->GetMinSize();
m_minSize.x = etk_max(tmpSize.x, m_minSize.x);
m_minSize.y = etk_max(tmpSize.y, m_minSize.y);
}
@ -268,7 +268,7 @@ void widget::WSlider::OnRegenerateDisplay(void)
}
ewol::Widget * widget::WSlider::GetWidgetAtPos(etk::Vector2D<float> pos)
ewol::Widget * widget::WSlider::GetWidgetAtPos(vec2 pos)
{
// TODO : Review this ...
if (m_windowsDestination<0 || m_windowsDestination > m_subWidget.Size()) {
@ -278,8 +278,8 @@ ewol::Widget * widget::WSlider::GetWidgetAtPos(etk::Vector2D<float> pos)
int32_t iii = m_windowsDestination;
if (NULL != m_subWidget[iii]) {
etk::Vector2D<float> tmpSize = m_subWidget[iii]->GetSize();
etk::Vector2D<float> tmpOrigin = m_subWidget[iii]->GetOrigin();
vec2 tmpSize = m_subWidget[iii]->GetSize();
vec2 tmpOrigin = m_subWidget[iii]->GetOrigin();
if( (tmpOrigin.x <= pos.x && tmpOrigin.x + tmpSize.x >= pos.x)
&& (tmpOrigin.y <= pos.y && tmpOrigin.y + tmpSize.y >= pos.y) )
{

View File

@ -22,7 +22,7 @@ namespace widget {
// Derived function
virtual const char * const GetObjectType(void) { return "EwolWSlider"; };
private:
etk::Vector2D<bool> m_underExpend; // expend of the uner elements ...
bvec2 m_underExpend; // expend of the uner elements ...
public:
// Derived function
virtual bool CalculateSize(float availlableX, float availlableY);
@ -56,7 +56,7 @@ namespace widget {
// Derived function
virtual void OnRegenerateDisplay(void);
// Derived function
virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D<float> pos);
virtual ewol::Widget * GetWidgetAtPos(vec2 pos);
// Derived function
virtual void OnObjectRemove(ewol::EObject * removeObject);
// Derived function

View File

@ -136,10 +136,10 @@ void ewol::Widget::GenDraw(DrawProperty displayProp)
tmpOriginY,
tmpclipX,
m_size.y);
etk::Matrix4 tmpTranslate = etk::Matrix4::Translate(etk::Vector3D<float>((float)(-tmpclipX/2 - (tmpOriginX-m_origin.x)), (float)(-m_size.y/2.0), -1.0f));
etk::Matrix4 tmpScale = etk::Matrix4::Scale(etk::Vector3D<float>(m_zoom, m_zoom, 1.0f));
etk::Matrix4 tmpProjection = etk::Matrix4::Perspective(-tmpclipX/2, tmpclipX/2, -m_size.y/2, m_size.y/2, -1, 1);
etk::Matrix4 tmpMat = tmpProjection * tmpScale * tmpTranslate;
mat4 tmpTranslate = etk::Matrix4::Translate(vec3((float)(-tmpclipX/2 - (tmpOriginX-m_origin.x)), (float)(-m_size.y/2.0), -1.0f));
mat4 tmpScale = etk::Matrix4::Scale(vec3(m_zoom, m_zoom, 1.0f));
mat4 tmpProjection = etk::Matrix4::Perspective(-tmpclipX/2, tmpclipX/2, -m_size.y/2, m_size.y/2, -1, 1);
mat4 tmpMat = tmpProjection * tmpScale * tmpTranslate;
// set internal matrix system :
ewol::openGL::SetMatrix(tmpMat);
// Call the widget drawing methode
@ -153,10 +153,10 @@ void ewol::Widget::GenDraw(DrawProperty displayProp)
m_origin.y,
m_size.x,
m_size.y);
etk::Matrix4 tmpTranslate = etk::Matrix4::Translate(etk::Vector3D<float>(-m_size.x/2, -m_size.y/2, -1.0f));
etk::Matrix4 tmpScale = etk::Matrix4::Scale(etk::Vector3D<float>(m_zoom, m_zoom, 1.0f));
etk::Matrix4 tmpProjection = etk::Matrix4::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1);
etk::Matrix4 tmpMat = tmpProjection * tmpScale * tmpTranslate;
mat4 tmpTranslate = etk::Matrix4::Translate(vec3(-m_size.x/2, -m_size.y/2, -1.0f));
mat4 tmpScale = etk::Matrix4::Scale(vec3(m_zoom, m_zoom, 1.0f));
mat4 tmpProjection = etk::Matrix4::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1);
mat4 tmpMat = tmpProjection * tmpScale * tmpTranslate;
// set internal matrix system :
ewol::openGL::SetMatrix(tmpMat);
// Call the widget drawing methode
@ -203,12 +203,12 @@ void ewol::Widget::SetOrigin(float x, float y)
m_origin.y=y;
}
etk::Vector2D<float> ewol::Widget::GetOrigin(void)
vec2 ewol::Widget::GetOrigin(void)
{
return m_origin;
}
etk::Vector2D<float> ewol::Widget::RelativePosition(etk::Vector2D<float> pos)
vec2 ewol::Widget::RelativePosition(vec2 pos)
{
pos.x -= m_origin.x;
pos.y -= m_origin.y;
@ -229,20 +229,20 @@ void ewol::Widget::SetMinSize(float x, float y)
m_userMinSize.y = y;
}
etk::Vector2D<float> ewol::Widget::GetMinSize(void)
vec2 ewol::Widget::GetMinSize(void)
{
if (false==IsHide()) {
return m_minSize;
}
return etk::Vector2D<float>(0,0);
return vec2(0,0);
}
etk::Vector2D<float> ewol::Widget::GetSize(void)
vec2 ewol::Widget::GetSize(void)
{
if (false==IsHide()) {
return m_size;
}
return etk::Vector2D<float>(0,0);
return vec2(0,0);
}
void ewol::Widget::SetExpendX(bool newExpend)

View File

@ -24,9 +24,9 @@ namespace ewol {
namespace ewol {
class DrawProperty{
public :
etk::Vector2D<int32_t> m_windowsSize;
etk::Vector2D<int32_t> m_origin;
etk::Vector2D<int32_t> m_size;
ivec2 m_windowsSize;
ivec2 m_origin;
ivec2 m_size;
};
@ -84,13 +84,13 @@ namespace ewol {
protected:
// internal element calculated by the system
float m_zoom; //!< generic widget zoom
etk::Vector2D<float> m_origin; //!< internal ... I do not really known how i can use it ...
etk::Vector2D<float> m_size; //!< internal : current size of the widget
etk::Vector2D<float> m_minSize; //!< user define the minimum size of the widget
vec2 m_origin; //!< internal ... I do not really known how i can use it ...
vec2 m_size; //!< internal : current size of the widget
vec2 m_minSize; //!< user define the minimum size of the widget
// user configuaration
etk::Vector2D<float> m_userMinSize; //!< user define the minimum size of the widget
etk::Vector2D<bool> m_userExpend;
etk::Vector2D<bool> m_userFill;
vec2 m_userMinSize; //!< user define the minimum size of the widget
bvec2 m_userExpend;
bvec2 m_userFill;
public:
/**
* @brief Set the zoom property of the widget
@ -117,13 +117,13 @@ namespace ewol {
* @param ---
* @return coordonate of the origin requested
*/
etk::Vector2D<float> GetOrigin(void);
vec2 GetOrigin(void);
/**
* @brief Convert the absolute position in the local Position (Relative)
* @param[in] pos Absolute position that you request convertion
* @return the relative position
*/
virtual etk::Vector2D<float> RelativePosition(etk::Vector2D<float> pos);
virtual vec2 RelativePosition(vec2 pos);
/**
* @brief Parrent set the possible diplay size of the current widget whith his own possibilities
* By default this save the widget availlable size in the widget size
@ -154,13 +154,13 @@ namespace ewol {
* @param ---
* @return re size requested
*/
etk::Vector2D<float> GetMinSize(void);
vec2 GetMinSize(void);
/**
* @brief Get the widget size
* @param ---
* @return Requested size
*/
etk::Vector2D<float> GetSize(void);
vec2 GetSize(void);
/**
* @brief Set the horizontal expend capacity
* @param[in] newExpend new Expend state
@ -330,7 +330,7 @@ namespace ewol {
* @return NULL No widget found
* @return pointer on the widget found
*/
virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D<float> pos) { if (false==IsHide()) { return this; } return NULL; };
virtual ewol::Widget * GetWidgetAtPos(vec2 pos) { if (false==IsHide()) { return this; } return NULL; };
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
@ -340,7 +340,7 @@ namespace ewol {
* @return true the event is used
* @return false the event is not used
*/
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos) { return false; };
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos) { return false; };
/**
* @brief Event on the keybord (if no shortcut has been detected before).
* @param[in] type of the event (ewol::EVENT_KB_TYPE_DOWN or ewol::EVENT_KB_TYPE_UP)

View File

@ -52,36 +52,36 @@ void widget::WidgetScrooled::OnRegenerateDisplay(void)
tmpDraw->SetThickness(1);
if( m_size.y < m_maxSize.y
|| m_originScrooled.y!=0) {
tmpDraw->SetPos(etk::Vector3D<float>(m_size.x-(SCROLL_BAR_SPACE/2), 0) );
tmpDraw->LineTo(etk::Vector3D<float>(m_size.x-(SCROLL_BAR_SPACE/2), m_size.y ) );
tmpDraw->SetPos(vec3(m_size.x-(SCROLL_BAR_SPACE/2), 0) );
tmpDraw->LineTo(vec3(m_size.x-(SCROLL_BAR_SPACE/2), m_size.y ) );
float lenScrollBar = m_size.y*m_size.y / m_maxSize.y;
lenScrollBar = etk_avg(10, lenScrollBar, m_size.y);
float originScrollBar = m_originScrooled.y / (m_maxSize.y-m_size.y*m_limitScrolling);
originScrollBar = etk_avg(0.0, originScrollBar, 1.0);
originScrollBar *= (m_size.y-lenScrollBar);
tmpDraw->SetPos(etk::Vector3D<float>(m_size.x-SCROLL_BAR_SPACE, m_size.y - originScrollBar - lenScrollBar) );
tmpDraw->RectangleWidth(etk::Vector3D<float>(SCROLL_BAR_SPACE, lenScrollBar));
tmpDraw->SetPos(vec3(m_size.x-SCROLL_BAR_SPACE, m_size.y - originScrollBar - lenScrollBar) );
tmpDraw->RectangleWidth(vec3(SCROLL_BAR_SPACE, lenScrollBar));
}
if( m_size.x < m_maxSize.x
|| m_originScrooled.x!=0) {
tmpDraw->SetPos(etk::Vector3D<float>(0, (SCROLL_BAR_SPACE/2), 0) );
tmpDraw->LineTo(etk::Vector3D<float>(m_size.x-SCROLL_BAR_SPACE, (SCROLL_BAR_SPACE/2) ) );
tmpDraw->SetPos(vec3(0, (SCROLL_BAR_SPACE/2), 0) );
tmpDraw->LineTo(vec3(m_size.x-SCROLL_BAR_SPACE, (SCROLL_BAR_SPACE/2) ) );
float lenScrollBar = m_size.x*(m_size.x-SCROLL_BAR_SPACE) / m_maxSize.x;
lenScrollBar = etk_avg(10, lenScrollBar, (m_size.x-SCROLL_BAR_SPACE));
float originScrollBar = m_originScrooled.x / (m_maxSize.x-m_size.x*m_limitScrolling);
originScrollBar = etk_avg(0.0, originScrollBar, 1.0);
originScrollBar *= (m_size.x-SCROLL_BAR_SPACE-lenScrollBar);
tmpDraw->SetPos(etk::Vector3D<float>(originScrollBar, 0, 0) );
tmpDraw->Rectangle(etk::Vector3D<float>(lenScrollBar, SCROLL_BAR_SPACE) );
tmpDraw->SetPos(vec3(originScrollBar, 0, 0) );
tmpDraw->Rectangle(vec3(lenScrollBar, SCROLL_BAR_SPACE) );
}
AddOObject(tmpDraw);
}
}
bool widget::WidgetScrooled::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos)
bool widget::WidgetScrooled::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
{
etk::Vector2D<float> relativePos = RelativePosition(pos);
vec2 relativePos = RelativePosition(pos);
// corection due to the open Gl invertion ...
relativePos.y = m_size.y - relativePos.y;
if (SCROLL_MODE_NORMAL == m_scroollingMode) {
@ -351,10 +351,10 @@ void widget::WidgetScrooled::GenDraw(ewol::DrawProperty displayProp)
m_origin.y,
m_size.x,
m_size.y);
etk::Matrix4 tmpProjection = etk::Matrix4::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1);
etk::Matrix4 tmpScale = etk::Matrix4::Scale(etk::Vector3D<float>(m_zoom, m_zoom, 1.0) );
etk::Matrix4 tmpTranslate = etk::Matrix4::Translate(etk::Vector3D<float>(-m_maxSize.x/2, -m_maxSize.y/2, -1.0) );
etk::Matrix4 tmpMat = tmpProjection * tmpScale * tmpTranslate;
mat4 tmpProjection = etk::Matrix4::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1);
mat4 tmpScale = etk::Matrix4::Scale(vec3(m_zoom, m_zoom, 1.0) );
mat4 tmpTranslate = etk::Matrix4::Translate(vec3(-m_maxSize.x/2, -m_maxSize.y/2, -1.0) );
mat4 tmpMat = tmpProjection * tmpScale * tmpTranslate;
// set internal matrix system :
ewol::openGL::SetMatrix(tmpMat);
// Call the widget drawing methode
@ -366,9 +366,9 @@ void widget::WidgetScrooled::GenDraw(ewol::DrawProperty displayProp)
m_size.x,
m_size.y);
etk::Matrix4 tmpProjection = etk::Matrix4::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1);
etk::Matrix4 tmpTranslate = etk::Matrix4::Translate(etk::Vector3D<float>( -m_maxSize.x/2, -m_maxSize.y/2, -1.0) );
etk::Matrix4 tmpMat = tmpProjection * tmpTranslate;
mat4 tmpProjection = etk::Matrix4::Perspective(-m_size.x/2, m_size.x/2, -m_size.y/2, m_size.y/2, -1, 1);
mat4 tmpTranslate = etk::Matrix4::Translate(vec3( -m_maxSize.x/2, -m_maxSize.y/2, -1.0) );
mat4 tmpMat = tmpProjection * tmpTranslate;
// set internal matrix system :
ewol::openGL::SetMatrix(tmpMat);
// Call the widget drawing methode
@ -380,7 +380,7 @@ void widget::WidgetScrooled::GenDraw(ewol::DrawProperty displayProp)
}
void widget::WidgetScrooled::SetScrollingPositionDynamic(etk::Vector2D<float> borderWidth, etk::Vector2D<float> currentPosition, bool center)
void widget::WidgetScrooled::SetScrollingPositionDynamic(vec2 borderWidth, vec2 currentPosition, bool center)
{
if (true == center) {
borderWidth.x = m_size.x / 2 - borderWidth.x;

View File

@ -36,13 +36,13 @@ namespace widget {
void AddOObject(ewol::Compositing* newObject, int32_t pos=-1);
void ClearOObjectList(void);
protected:
etk::Vector2D<float> m_originScrooled;
etk::Vector2D<float> m_maxSize;
vec2 m_originScrooled;
vec2 m_maxSize;
float m_limitScrolling;
private:
scrollingMode_te m_scroollingMode; //!< mode of management of the scrooling
float m_pixelScrolling;
etk::Vector2D<float> m_highSpeedStartPos;
vec2 m_highSpeedStartPos;
highSpeedMode_te m_highSpeedMode;
int32_t m_highSpeedButton;
ewol::keyEvent::type_te m_highSpeedType;
@ -56,7 +56,7 @@ namespace widget {
// Derived function
virtual void OnDraw(ewol::DrawProperty& displayProp);
// Derived function
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
virtual bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
// Derived function
virtual void GenDraw(ewol::DrawProperty displayProp);
protected:
@ -77,7 +77,7 @@ namespace widget {
* @param[in] localSize new Maximum size
* @return ---
*/
void SetMaxSize(etk::Vector2D<float> localSize) { m_maxSize = localSize; };
void SetMaxSize(vec2 localSize) { m_maxSize = localSize; };
/**
* @brief Request a specific position for the scrolling of the current windows.
* @param[in] borderWidth Size of the border that requested the element might not to be
@ -85,7 +85,7 @@ namespace widget {
* @param[in] center True if the position might be at the center of the widget
* @return ---
*/
void SetScrollingPositionDynamic(etk::Vector2D<float> borderWidth, etk::Vector2D<float> currentPosition, bool center = false);
void SetScrollingPositionDynamic(vec2 borderWidth, vec2 currentPosition, bool center = false);
/**
* @brief Set the scrolling limit when arriving at he end of the widget
* @param[in] poucentageLimit pourcent of the limit of view nothing in the widget when arriving at the end ...

View File

@ -71,10 +71,10 @@ bool ewol::Windows::CalculateSize(float availlableX, float availlableY)
}
ewol::Widget * ewol::Windows::GetWidgetAtPos(etk::Vector2D<float> pos)
ewol::Widget * ewol::Windows::GetWidgetAtPos(vec2 pos)
{
// calculate relative position
etk::Vector2D<float> relativePos = RelativePosition(pos);
vec2 relativePos = RelativePosition(pos);
// event go directly on the pop-up
if (0 < m_popUpWidgetList.Size()) {
if (NULL == m_popUpWidgetList[m_popUpWidgetList.Size()-1]) {
@ -101,7 +101,7 @@ void ewol::Windows::SysDraw(void)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// clear the matrix system :
etk::Matrix4 newOne;
mat4 newOne;
ewol::openGL::SetBasicMatrix(newOne);
ewol::DrawProperty displayProp;

View File

@ -38,7 +38,7 @@ namespace ewol {
// Derived function
virtual bool CalculateSize(float availlableX, float availlableY);
// Derived function
virtual ewol::Widget * GetWidgetAtPos(etk::Vector2D<float> pos);
virtual ewol::Widget * GetWidgetAtPos(vec2 pos);
private:
bool m_hasDecoration;
public:

View File

@ -141,8 +141,8 @@ void widget::ParameterList::OnRegenerateDisplay(void)
// set background color :
ewol::Drawing * tmpDraw = new ewol::Drawing();
tmpDraw->SetColor(0xFFFFFFFF);
tmpDraw->SetPos(etk::Vector3D<float>(0,0,0) );
tmpDraw->RectangleWidth(etk::Vector3D<float>(m_size.x, m_size.y) );
tmpDraw->SetPos(vec3(0,0,0) );
tmpDraw->RectangleWidth(vec3(m_size.x, m_size.y) );
uint32_t displayableRaw = m_size.y / (minHeight + 2*m_paddingSizeY) +2;
@ -166,7 +166,7 @@ void widget::ParameterList::OnRegenerateDisplay(void)
ewol::Text * tmpText = new ewol::Text();
etk::Vector3D<float> textPos;
vec3 textPos;
textPos.x = (int32_t)tmpOriginX;
if (m_list[iii]->m_group == false) {
textPos.x += minHeight;
@ -186,7 +186,7 @@ void widget::ParameterList::OnRegenerateDisplay(void)
}
bool widget::ParameterList::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos)
bool widget::ParameterList::OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos)
{
if (true == WidgetScrooled::OnEventInput(type, IdInput, typeEvent, pos)) {
ewol::widgetManager::FocusKeep(this);
@ -194,7 +194,7 @@ bool widget::ParameterList::OnEventInput(ewol::keyEvent::type_te type, int32_t I
return true;
}
if (IdInput == 1 && typeEvent == ewol::keyEvent::statusSingle) {
etk::Vector2D<float> relativePos = RelativePosition(pos);
vec2 relativePos = RelativePosition(pos);
// corection for the openGl abstraction
relativePos.y = m_size.y - relativePos.y;
// TODO : Rework this ...

View File

@ -67,7 +67,7 @@ namespace widget {
// Derived function
void OnRegenerateDisplay(void);
// Derived function
bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, etk::Vector2D<float> pos);
bool OnEventInput(ewol::keyEvent::type_te type, int32_t IdInput, ewol::keyEvent::status_te typeEvent, vec2 pos);
protected:
// Derived function
void OnGetFocus(void);

View File

@ -52,7 +52,7 @@ void APP_Init(void)
#endif
#endif
etk::InitDefaultFolder(PROJECT_NAME);
ewol::ChangeSize(etk::Vector2D<int32_t>(800, 600));
ewol::ChangeSize(ivec2(800, 600));
#ifdef __TARGET_OS__Android
ewol::config::FontSetDefault("FreeSerif", 19);
#else