vendredi soir

This commit is contained in:
Edouard Dupin 2012-06-08 18:24:11 +02:00
parent 914df932d9
commit ba09b090a9
91 changed files with 661 additions and 822 deletions

View File

@ -488,10 +488,10 @@ color_ts etk::color::Create(uint8_t _red, uint8_t _green, uint8_t _blue, uint8_t
color_ts etk::color::Create(etkFloat_t _red, etkFloat_t _green, etkFloat_t _blue, etkFloat_t _alpha)
{
color_ts tmpColor;
_red = etk_avg(0.0, _red, 1.0);
_green = etk_avg(0.0, _green, 1.0);
_blue = etk_avg(0.0, _blue, 1.0);
_alpha = etk_avg(0.0, _alpha, 1.0);
_red = etk_avg((float)0, (float)_red, (float)1);
_green = etk_avg((float)0, (float)_green, (float)1);
_blue = etk_avg((float)0, (float)_blue, (float)1);
_alpha = etk_avg((float)0, (float)_alpha, (float)1);
tmpColor.red =(uint8_t)(_red*255);
tmpColor.green=(uint8_t)(_green*255);
tmpColor.blue =(uint8_t)(_blue*255);

View File

@ -167,82 +167,33 @@ namespace etk{
return *this;
}
CCout& operator << (Coord2D<float> t) {
CCout& operator << (Vector2D<float> t) {
snprintf(tmp, MAX_LOG_SIZE_TMP, "(%f,%f)", t.x, t.y);
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);
return *this;
}
CCout& operator << (Coord2D<int32_t> t) {
CCout& operator << (Vector2D<int32_t> t) {
snprintf(tmp, MAX_LOG_SIZE_TMP, "(%i,%i)", t.x, t.y);
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);
return *this;
}
CCout& operator << (Coord2D<oglt> t) {
snprintf(tmp, MAX_LOG_SIZE_TMP, "(%f,%f)", (float)t.x, (float)t.y);
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);
return *this;
}
CCout& operator << (Coord3D<float> t) {
CCout& operator << (Vector3D<float> t) {
snprintf(tmp, MAX_LOG_SIZE_TMP, "(%f,%f,%f)", t.x, t.y, t.z);
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);
return *this;
}
CCout& operator << (Coord3D<int32_t> t) {
CCout& operator << (Vector3D<int32_t> t) {
snprintf(tmp, MAX_LOG_SIZE_TMP, "(%i,%i,%i)", t.x, t.y, t.z);
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);
return *this;
}
CCout& operator << (Coord3D<oglt> t) {
snprintf(tmp, MAX_LOG_SIZE_TMP, "(%f,%f,%f)", (float)t.x, (float)t.y, (float)t.z);
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);
return *this;
}
CCout& operator << (coord2D_ts t) {
#if defined(EWOL_PECISION_FIXPOINT)
snprintf(tmp, MAX_LOG_SIZE_TMP, "(%f,%f)", UNFIXED(t.x), UNFIXED(t.y));
#elif defined(EWOL_PECISION_DOUBLE)
snprintf(tmp, MAX_LOG_SIZE_TMP, "(%lf,%lf)", t.x, t.y);
#else
snprintf(tmp, MAX_LOG_SIZE_TMP, "(%f,%f)", t.x, t.y);
#endif
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);
return *this;
}
CCout& operator << (coord3D_ts t) {
#if defined(EWOL_PECISION_FIXPOINT)
snprintf(tmp, MAX_LOG_SIZE_TMP, "(%f,%f,%f)", UNFIXED(t.x), UNFIXED(t.y), UNFIXED(t.z));
#elif defined(EWOL_PECISION_DOUBLE)
snprintf(tmp, MAX_LOG_SIZE_TMP, "(%lf,%lf,%lf)", t.x, t.y, t.z);
#else
snprintf(tmp, MAX_LOG_SIZE_TMP, "(%f,%f,%f)", t.x, t.y, t.z);
#endif
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);
return *this;
}
CCout& operator << (texCoord_ts t) {
#if defined(EWOL_PECISION_FIXPOINT)
snprintf(tmp, MAX_LOG_SIZE_TMP, "{%f,%f}", UNFIXED(t.u), UNFIXED(t.v));
#elif defined(EWOL_PECISION_DOUBLE)
snprintf(tmp, MAX_LOG_SIZE_TMP, "{%lf,%lf}", t.u, t.v);
#else
snprintf(tmp, MAX_LOG_SIZE_TMP, "{%f,%f}", t.u, t.v);
#endif
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);
return *this;
}
CCout& operator << (color_ts t) {
snprintf(tmp, MAX_LOG_SIZE_TMP, "#%02X%02X%02X%02X", t.red, t.green, t.blue, t.alpha);
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);
return *this;
}
CCout& operator << (clipping_ts t) {
#if defined(EWOL_PECISION_FIXPOINT)
snprintf(tmp, MAX_LOG_SIZE_TMP, "origin=(%f,%f) size=(%f,%f)", UNFIXED(t.x), UNFIXED(t.y), UNFIXED(t.w), UNFIXED(t.h));
#elif defined(EWOL_PECISION_DOUBLE)
snprintf(tmp, MAX_LOG_SIZE_TMP, "origin=(%lf,%lf) size=(%lf,%lf)", t.x, t.y, t.w, t.h);
#else
snprintf(tmp, MAX_LOG_SIZE_TMP, "origin=(%f,%f) size=(%f,%f)", t.x, t.y, t.w, t.h);
#endif
snprintf(tmp, MAX_LOG_SIZE_TMP, "origin=(%f,%f) size=(%f,%f)", t.x, t.y, t.w, t.h);
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);
return *this;
}

View File

@ -73,50 +73,33 @@ typedef enum {
#include <etk/TypesCoordonate.h>
extern "C"
{
#if defined(EWOL_PECISION_FIXPOINT)
// TODO : Remove deprecated elements :
typedef int32_t etkFloat_t;
#define oglTypeFloat_t GL_FIXED
#else
// TODO : Remove deprecated elements :
typedef float etkFloat_t;
#define oglTypeFloat_t GL_FLOAT
#endif
// TODO : Remove deprecated elements :
typedef struct {
etkFloat_t x;
etkFloat_t y;
etkFloat_t z;
}coord3D_ts;
// TODO : Remove deprecated elements :
typedef struct {
etkFloat_t x;
etkFloat_t y;
}coord2D_ts;
// TODO : Remove deprecated elements :
typedef struct {
etkFloat_t u;
etkFloat_t v;
}texCoord_ts;
typedef struct {
etkFloat_t x;
etkFloat_t y;
etkFloat_t w;
etkFloat_t h;
}clipping_ts;
typedef struct color_ts {
uint8_t red;
uint8_t green;
uint8_t blue;
uint8_t alpha;
}color_ts;
}
typedef oglt etkFloat_t;
#if defined(EWOL_PECISION_FIXPOINT)
#define oglTypeFloat_t GL_FIXED
#else
#define oglTypeFloat_t GL_FLOAT
#endif
typedef struct {
float u;
float v;
}texCoord_ts;
typedef struct {
float x;
float y;
float w;
float h;
}clipping_ts;
typedef struct color_ts {
uint8_t red;
uint8_t green;
uint8_t blue;
uint8_t alpha;
}color_ts;
#include <etk/Color.h>

File diff suppressed because it is too large Load Diff

View File

@ -53,30 +53,30 @@ namespace ewol
int32_t GetWidth(int32_t fontID, const etk::UString& unicodeString);
int32_t GetHeight(int32_t fontID);
int32_t DrawText(int32_t fontID,
coord2D_ts textPos,
Vector2D<float> textPos,
clipping_ts & drawClipping,
const etk::UString & unicodeString,
int32_t & fontTextureId,
etk::VectorType<coord2D_ts> & coord,
etk::VectorType<Vector2D<float> > & coord,
etk::VectorType<texCoord_ts> & coordTex);
int32_t DrawText(int32_t fontID,
coord2D_ts textPos,
Vector2D<float> textPos,
clipping_ts & drawClipping,
const uniChar_t unicodeChar,
int32_t & fontTextureId,
etk::VectorType<coord2D_ts> & coord,
etk::VectorType<Vector2D<float> > & coord,
etk::VectorType<texCoord_ts> & coordTex);
int32_t DrawText(int32_t fontID,
coord2D_ts textPos,
Vector2D<float> textPos,
const etk::UString & unicodeString,
int32_t & fontTextureId,
etk::VectorType<coord2D_ts> & coord,
etk::VectorType<Vector2D<float> > & coord,
etk::VectorType<texCoord_ts> & coordTex);
int32_t DrawText(int32_t fontID,
coord2D_ts textPos,
Vector2D<float> textPos,
const uniChar_t unicodeChar,
int32_t & fontTextureId,
etk::VectorType<coord2D_ts> & coord,
etk::VectorType<Vector2D<float> > & coord,
etk::VectorType<texCoord_ts> & coordTex);
int32_t LoadFont(etk::File fontFileName);
};

View File

@ -45,8 +45,8 @@ extern "C"
uniChar_t unicodeCharVal;
texCoord_ts posStart;
texCoord_ts posStop;
coord2D_ts bearing;
coord2D_ts size;
Vector2D<float> bearing;
Vector2D<float> size;
int32_t advance;
}freeTypeFontElement_ts;
};
@ -572,11 +572,11 @@ void ewol::UnloadFont(int32_t id)
}
int32_t ewol::DrawText(int32_t fontID,
coord2D_ts textPos,
Vector2D<float> textPos,
clipping_ts & drawClipping,
const etk::UString& unicodeString,
int32_t & fontTextureId,
etk::VectorType<coord2D_ts> & coord,
etk::VectorType<Vector2D<float>> & coord,
etk::VectorType<texCoord_ts> & coordTex)
{
if(fontID>=m_listLoadedFont.Size() || fontID < 0) {
@ -682,7 +682,7 @@ int32_t ewol::DrawText(int32_t fontID,
* | |
* 3------2
*/
coord2D_ts bitmapDrawPos[4];
Vector2D<float> bitmapDrawPos[4];
bitmapDrawPos[0].x = dxA;
bitmapDrawPos[1].x = dxB;
bitmapDrawPos[2].x = dxB;
@ -753,11 +753,11 @@ int32_t ewol::DrawText(int32_t fontID,
// TODO : Simplify this ...
int32_t ewol::DrawText(int32_t fontID,
coord2D_ts textPos,
Vector2D<float> textPos,
clipping_ts & drawClipping,
const uniChar_t unicodeChar,
int32_t & fontTextureId,
etk::VectorType<coord2D_ts> & coord,
etk::VectorType<Vector2D<float>> & coord,
etk::VectorType<texCoord_ts> & coordTex)
{
if(fontID>=m_listLoadedFont.Size() || fontID < 0) {
@ -838,7 +838,7 @@ int32_t ewol::DrawText(int32_t fontID,
* | |
* 3------2
*/
coord2D_ts bitmapDrawPos[4];
Vector2D<float> bitmapDrawPos[4];
bitmapDrawPos[0].x = dxA;
bitmapDrawPos[1].x = dxB;
bitmapDrawPos[2].x = dxB;
@ -907,10 +907,10 @@ int32_t ewol::DrawText(int32_t fontID,
int32_t ewol::DrawText(int32_t fontID,
coord2D_ts textPos,
Vector2D<float> textPos,
const etk::UString& unicodeString,
int32_t & fontTextureId,
etk::VectorType<coord2D_ts> & coord,
etk::VectorType<Vector2D<float>> & coord,
etk::VectorType<texCoord_ts> & coordTex)
{
if(fontID>=m_listLoadedFont.Size() || fontID < 0) {
@ -971,7 +971,7 @@ int32_t ewol::DrawText(int32_t fontID,
* | |
* 3------2
*/
coord2D_ts bitmapDrawPos[4];
Vector2D<float> bitmapDrawPos[4];
bitmapDrawPos[0].x = dxA;
bitmapDrawPos[1].x = dxB;
bitmapDrawPos[2].x = dxB;
@ -1041,10 +1041,10 @@ int32_t ewol::DrawText(int32_t fontID,
// TODO : Simplify this ...
int32_t ewol::DrawText(int32_t fontID,
coord2D_ts textPos,
Vector2D<float> textPos,
const uniChar_t unicodeChar,
int32_t & fontTextureId,
etk::VectorType<coord2D_ts> & coord,
etk::VectorType<Vector2D<float>> & coord,
etk::VectorType<texCoord_ts> & coordTex)
{
if(fontID>=m_listLoadedFont.Size() || fontID < 0) {
@ -1101,7 +1101,7 @@ int32_t ewol::DrawText(int32_t fontID,
* | |
* 3------2
*/
coord2D_ts bitmapDrawPos[4];
Vector2D<float> bitmapDrawPos[4];
bitmapDrawPos[0].x = dxA;
bitmapDrawPos[1].x = dxB;
bitmapDrawPos[2].x = dxB;

View File

@ -60,7 +60,7 @@ ewol::GameElement::GameElement(SceneElement & sceneElement, etk::UString& tmpNam
* @param[in] maxSize maximum size of the sprite
* @return the id of the sprite requested or -1 if it does not existed
*/
int32_t ewol::GameElement::LoadSprite(etk::VectorType<ewol::Sprite*> listOfElement[NB_BOUBLE_BUFFER], etk::UString fileName, coord2D_ts maxSize)
int32_t ewol::GameElement::LoadSprite(etk::VectorType<ewol::Sprite*> listOfElement[NB_BOUBLE_BUFFER], etk::UString fileName, Vector2D<float> maxSize)
{
for (int32_t iii=0; iii<listOfElement[0].Size(); iii++) {
if (listOfElement[0][iii] != NULL) {
@ -84,7 +84,7 @@ int32_t ewol::GameElement::LoadSprite(etk::VectorType<ewol::Sprite*> listOfEleme
}
etkFloat_t quadDist(coord2D_ts pos1, coord2D_ts pos2)
etkFloat_t quadDist(Vector2D<float> pos1, Vector2D<float> pos2)
{
etkFloat_t tmpVal1 = pos1.x - pos2.x;
etkFloat_t tmpVal2 = pos1.y - pos2.y;
@ -105,7 +105,7 @@ void ewol::GameElement::GetElementProperty(gameElementGenericProperty_ts &elemen
}
bool ewol::GameElement::HaveImpact(int32_t group, int32_t type, coord2D_ts position, etkFloat_t size)
bool ewol::GameElement::HaveImpact(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t size)
{
// check if it was in the same group
if (group == m_group) {

View File

@ -46,8 +46,8 @@ namespace ewol {
int32_t m_type;
int32_t m_power;
bool m_visible;
coord2D_ts m_position;
coord2D_ts m_speed;
Vector2D<float> m_position;
Vector2D<float> m_speed;
etkFloat_t m_size;
etkFloat_t m_angle;
etkFloat_t m_gravity;
@ -75,11 +75,11 @@ namespace ewol {
bool HasName(etk::UString tmpName) { return (tmpName == m_fileNameConfig); };
bool IsVisible(void) { return m_visible; };
void SetVisible(bool state) { m_visible = state; };
coord2D_ts PositionGet(void) { return m_position; };
void PositionSet(coord2D_ts state) { m_position = state; };
Vector2D<float> PositionGet(void) { return m_position; };
void PositionSet(Vector2D<float> state) { m_position = state; };
void PositionSet(etkFloat_t xxx, etkFloat_t yyy) { m_position.x = xxx; m_position.y = yyy; };
coord2D_ts SpeedGet(void) { return m_speed; };
void SpeedSet(coord2D_ts state) { m_speed = state; };
Vector2D<float> SpeedGet(void) { return m_speed; };
void SpeedSet(Vector2D<float> state) { m_speed = state; };
void SpeedSet(etkFloat_t xxx, etkFloat_t yyy) { m_speed.x = xxx; m_speed.y = yyy; };
etkFloat_t SizeGet(void) { return m_size; };
void SizeSet(etkFloat_t state) { m_size = state; };
@ -122,8 +122,8 @@ namespace ewol {
* @return ---
*/
virtual void RemoveElement(int32_t idOfElement) { };
virtual bool HaveImpact(int32_t group, int32_t type, coord2D_ts position, etkFloat_t size);
virtual bool Explosion(int32_t group, int32_t type, coord2D_ts position, etkFloat_t pxAtenuation, etkFloat_t power) { return false; } ;
virtual bool HaveImpact(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t size);
virtual bool Explosion(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t pxAtenuation, etkFloat_t power) { return false; } ;
/**
* @brief Requuest the draw of the current element, it will be done on the current Sprite list
* @param[in,out] listOfElement Reference on the list of sprite that we need to find if it exist or added a new one
@ -131,7 +131,7 @@ namespace ewol {
* @param[in] maxSize maximum size of the sprite
* @return the id of the sprite requested or -1 if it does not existed
*/
int32_t LoadSprite(etk::VectorType<ewol::Sprite*> listOfElement[NB_BOUBLE_BUFFER], etk::UString fileName, coord2D_ts maxSize);
int32_t LoadSprite(etk::VectorType<ewol::Sprite*> listOfElement[NB_BOUBLE_BUFFER], etk::UString fileName, Vector2D<float> maxSize);
virtual void Message(etk::UString control, etk::UString message) { } ;
};
@ -140,6 +140,6 @@ namespace ewol {
#include <ewol/widget/Scene.h>
etkFloat_t quadDist(coord2D_ts pos1, coord2D_ts pos2);
etkFloat_t quadDist(Vector2D<float> pos1, Vector2D<float> pos2);
#endif

View File

@ -142,7 +142,7 @@ LUAMOD_API int lua_GetPos(lua_State *L)
lua_pushnumber(L, (lua_Number)0 );
return 2;
}
coord2D_ts tmpPos = tmpObj->PositionGet();
Vector2D<float> tmpPos = tmpObj->PositionGet();
lua_pushnumber(L, (lua_Number)tmpPos.x );
lua_pushnumber(L, (lua_Number)tmpPos.y );
// return number of parameters
@ -157,7 +157,7 @@ LUAMOD_API int lua_SetPos(lua_State *L)
}
float x = luaL_checknumber(L, 1);
float y = luaL_checknumber(L, 2);
coord2D_ts tmpPos;
Vector2D<float> tmpPos;
tmpPos.x = x;
tmpPos.y = y;
tmpObj->PositionSet(tmpPos);
@ -173,7 +173,7 @@ LUAMOD_API int lua_GetSpeed(lua_State *L)
lua_pushnumber(L, (lua_Number)0 );
return 2;
}
coord2D_ts tmpPos = tmpObj->SpeedGet();
Vector2D<float> tmpPos = tmpObj->SpeedGet();
lua_pushnumber(L, (lua_Number)tmpPos.x );
lua_pushnumber(L, (lua_Number)tmpPos.y );
// return number of parameters
@ -188,7 +188,7 @@ LUAMOD_API int lua_SetSpeed(lua_State *L)
}
float x = luaL_checknumber(L, 1);
float y = luaL_checknumber(L, 2);
coord2D_ts tmpPos;
Vector2D<float> tmpPos;
tmpPos.x = x;
tmpPos.y = y;
tmpObj->SpeedSet(tmpPos);
@ -343,7 +343,7 @@ LUAMOD_API int lua_SpriteLoad(lua_State *L)
}
const char *filename = luaL_checkstring(L, 1);
int32_t maxSize = luaL_checkint(L, 2);
coord2D_ts size;
Vector2D<float> size;
size.x = maxSize;
size.y = size.x;
int32_t spriteID = tmpObj->LoadSprite( tmpScene->animated, filename, size);
@ -364,7 +364,7 @@ LUAMOD_API int lua_SpriteUnLoad(lua_State *L)
return 1;
}
float a = luaL_checkint(L, 1);
coord2D_ts tmpPos = tmpObj->PositionGet();
Vector2D<float> tmpPos = tmpObj->PositionGet();
tmpPos.y = a;
tmpObj->PositionSet(tmpPos);
*/
@ -380,7 +380,7 @@ LUAMOD_API int lua_SpriteDraw(lua_State *L)
return 0;
}
float spriteID = luaL_checknumber(L, 1);
coord2D_ts tmpPos;
Vector2D<float> tmpPos;
tmpPos.x = luaL_checknumber(L, 2);
tmpPos.y = luaL_checknumber(L, 3);
float angle = luaL_checknumber(L, 4);
@ -436,7 +436,7 @@ LUAMOD_API int lua_ElementSetPos(lua_State *L)
int32_t idElement = luaL_checkint(L, 1);
ewol::GameElement* tmpElem = tmpScene->GetElement(idElement);
if (NULL != tmpElem) {
coord2D_ts tmpPos;
Vector2D<float> tmpPos;
tmpPos.x = luaL_checknumber(L, 2);
tmpPos.y = luaL_checknumber(L, 3);
tmpElem->PositionSet(tmpPos);
@ -459,7 +459,7 @@ LUAMOD_API int lua_ElementGetPos(lua_State *L)
int32_t idElement = luaL_checkint(L, 1);
ewol::GameElement* tmpElem = tmpScene->GetElement(idElement);
if (NULL != tmpElem) {
coord2D_ts tmpPos = tmpElem->PositionGet();
Vector2D<float> tmpPos = tmpElem->PositionGet();
lua_pushnumber(L, (lua_Number)tmpPos.x );
lua_pushnumber(L, (lua_Number)tmpPos.y );
} else {
@ -827,7 +827,7 @@ void ewol::GameElementLua::Draw(etk::VectorType<ewol::Sprite*> & listOfSprite, e
}
bool ewol::GameElementLua::HaveImpact(int32_t group, int32_t type, coord2D_ts position, etkFloat_t size)
bool ewol::GameElementLua::HaveImpact(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t size)
{
// todo set a flag that permit lua to direct control of this ...
if (false == ewol::GameElement::HaveImpact(group, type, position, size) ) {
@ -870,7 +870,7 @@ bool ewol::GameElementLua::HaveImpact(int32_t group, int32_t type, coord2D_ts po
}
bool ewol::GameElementLua::Explosion(int32_t group, int32_t type, coord2D_ts position, etkFloat_t pxAtenuation, etkFloat_t power)
bool ewol::GameElementLua::Explosion(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t pxAtenuation, etkFloat_t power)
{
tmpObj = this;
bool retVal = false;

View File

@ -47,8 +47,8 @@ namespace ewol {
virtual void UnInit(void);
virtual bool Process(int64_t time, int32_t deltaTime);
virtual void Draw(etk::VectorType<ewol::Sprite*> & listOfSprite, etk::VectorType<ewol::Sprite*> & listOfEffects);
virtual bool HaveImpact(int32_t group, int32_t type, coord2D_ts position, etkFloat_t size);
virtual bool Explosion(int32_t group, int32_t type, coord2D_ts position, etkFloat_t pxAtenuation, etkFloat_t power);
virtual bool HaveImpact(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t size);
virtual bool Explosion(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t pxAtenuation, etkFloat_t power);
virtual void Message(etk::UString control, etk::UString message);
};
void RegisterLuaElementInFolder(ewol::SceneElement & sceneElement, etk::UString folder);

View File

@ -232,7 +232,7 @@ ewol::GameElement* ewol::SceneElement::GetElement(uint32_t idElement)
}
uint32_t ewol::SceneElement::GetNearestEnemy(coord2D_ts position, int32_t groupId)
uint32_t ewol::SceneElement::GetNearestEnemy(Vector2D<float> position, int32_t groupId)
{
uint32_t result = 0;
etkFloat_t lastQuadDistance = 9999999999999999.0;
@ -245,7 +245,7 @@ uint32_t ewol::SceneElement::GetNearestEnemy(coord2D_ts position, int32_t groupI
for (int32_t iii=0; iii<listAnimatedElements[groupEnemy[groupId][jjj]].Size(); iii++) {
if (NULL != listAnimatedElements[groupEnemy[groupId][jjj]][iii]) {
if (true == listAnimatedElements[groupEnemy[groupId][jjj]][iii]->CanBeCibledGet()) {
coord2D_ts tmpPos = listAnimatedElements[groupEnemy[groupId][jjj]][iii]->PositionGet();
Vector2D<float> tmpPos = listAnimatedElements[groupEnemy[groupId][jjj]][iii]->PositionGet();
etkFloat_t distance = quadDist(position, tmpPos);
if (distance <= lastQuadDistance) {
lastQuadDistance = distance;
@ -260,7 +260,7 @@ uint32_t ewol::SceneElement::GetNearestEnemy(coord2D_ts position, int32_t groupI
}
bool ewol::SceneElement::HaveImpact(int32_t group, int32_t type, coord2D_ts position, etkFloat_t size)
bool ewol::SceneElement::HaveImpact(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t size)
{
for (int32_t jjj=0; jjj<MAX_GROUP_NUMBER; jjj++) {
if (group != jjj) {
@ -276,7 +276,7 @@ bool ewol::SceneElement::HaveImpact(int32_t group, int32_t type, coord2D_ts posi
return false;
}
void ewol::SceneElement::Explosion(int32_t group, int32_t type, coord2D_ts position, etkFloat_t pxAtenuation, etkFloat_t power)
void ewol::SceneElement::Explosion(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t pxAtenuation, etkFloat_t power)
{
for (int32_t jjj=0; jjj<MAX_GROUP_NUMBER; jjj++) {
for (int32_t iii=0; iii<listAnimatedElements[jjj].Size(); iii++) {
@ -290,14 +290,14 @@ void ewol::SceneElement::Explosion(int32_t group, int32_t type, coord2D_ts posit
}
uint32_t ewol::SceneElement::GetElementAtPos(coord2D_ts position, int32_t maxDistanceDetection)
uint32_t ewol::SceneElement::GetElementAtPos(Vector2D<float> position, int32_t maxDistanceDetection)
{
uint32_t result = 0;
etkFloat_t lastQuadDistance = 9999999999999999.0;
for (int32_t jjj=0; jjj<MAX_GROUP_NUMBER; jjj++) {
for (int32_t iii=0; iii<listAnimatedElements[jjj].Size(); iii++) {
if (NULL != listAnimatedElements[jjj][iii]) {
coord2D_ts tmpPos = listAnimatedElements[jjj][iii]->PositionGet();
Vector2D<float> tmpPos = listAnimatedElements[jjj][iii]->PositionGet();
etkFloat_t distance = quadDist(position, tmpPos);
if (distance <= lastQuadDistance) {
lastQuadDistance = distance;
@ -312,7 +312,7 @@ uint32_t ewol::SceneElement::GetElementAtPos(coord2D_ts position, int32_t maxDis
return result;
}
void ewol::SceneElement::SetEventInput(uint32_t id, coord2D_ts position)
void ewol::SceneElement::SetEventInput(uint32_t id, Vector2D<float> position)
{
EWOL_TODO("but when ...");
}

View File

@ -37,9 +37,9 @@ namespace ewol {
uint32_t id; //!< unique id of the element
int32_t group; //!< element group
int32_t type; //!< element type
coord2D_ts position; //!< current position
coord2D_ts speed; //!< current speed
coord2D_ts size; //!< curent size of the element
Vector2D<float> position; //!< current position
Vector2D<float> speed; //!< current speed
Vector2D<float> size; //!< curent size of the element
etkFloat_t angle; //!< element angle
} gameElementGenericProperty_ts;
@ -76,11 +76,11 @@ 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(coord2D_ts position, int32_t groupId);
bool HaveImpact(int32_t group, int32_t type, coord2D_ts position, etkFloat_t size);
void Explosion(int32_t group, int32_t type, coord2D_ts position, etkFloat_t pxAtenuation, etkFloat_t power);
uint32_t GetElementAtPos(coord2D_ts position, int32_t maxDistanceDetection);
void SetEventInput(uint32_t id, coord2D_ts position);
uint32_t GetNearestEnemy(Vector2D<float> position, int32_t groupId);
bool HaveImpact(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t size);
void Explosion(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t pxAtenuation, etkFloat_t power);
uint32_t GetElementAtPos(Vector2D<float> position, int32_t maxDistanceDetection);
void SetEventInput(uint32_t id, Vector2D<float> position);
void SetEventExternButton(uint32_t id, int32_t btId, int32_t state);
void SetEventExternJoystick(uint32_t id, int32_t joyId, etkFloat_t angle, etkFloat_t distance, int32_t state);
};

View File

@ -45,14 +45,14 @@ namespace ewol {
protected:
bool m_hasClipping;
clipping_ts m_clipping;
coord2D_ts m_scaling; //!< scaling ol the object
Vector2D<float> m_scaling; //!< scaling ol the object
public:
OObject(void);
virtual ~OObject(void);
void clippingSet(clipping_ts clip) {m_clipping = clip; m_hasClipping = true;};
void clippingDisable(void) {m_hasClipping = false;};
void clippingEnable(void) {m_hasClipping = true;};
void scalingSet(coord2D_ts scale) {m_scaling = scale;};
void scalingSet(Vector2D<float> scale) {m_scaling = scale;};
virtual void Draw(void) = 0;
};
};

View File

@ -80,22 +80,21 @@ void ewol::OObject2DColored::Clear(void)
}
void generatePolyGone(etk::VectorType<coord2D_ts> & input, etk::VectorType<coord2D_ts> & output )
void generatePolyGone(etk::VectorType<Coord2D<oglt> > & input, etk::VectorType<Coord2D<oglt> > & output )
{
if (input.Size()<3) {
return;
}
coord2D_ts basePoint = input[0];
// TODO : Regenerate a linear poligone generation
for (int32_t iii=1; iii<input.Size()-1; iii++) {
output.PushBack(basePoint);
output.PushBack(input[0]);
output.PushBack(input[iii]);
output.PushBack(input[iii+1]);
}
//EWOL_DEBUG("generate Plygone : " << input.Size() << " ==> " << output.Size() );
}
void SutherlandHodgman(etk::VectorType<coord2D_ts> & input, etk::VectorType<coord2D_ts> & output, etkFloat_t sx, etkFloat_t sy, etkFloat_t ex, etkFloat_t ey)
void SutherlandHodgman(etk::VectorType<Coord2D<oglt> > & input, etk::VectorType<Coord2D<oglt> > & output, etkFloat_t sx, etkFloat_t sy, etkFloat_t ex, etkFloat_t ey)
{
// with Sutherland-Hodgman-Algorithm
if (input.Size() <0) {
@ -103,8 +102,8 @@ void SutherlandHodgman(etk::VectorType<coord2D_ts> & input, etk::VectorType<coor
}
//int32_t sizeInit=input.Size();
// last element :
coord2D_ts destPoint;
coord2D_ts lastElement = input[input.Size()-1];
Coord2D<oglt> destPoint;
Coord2D<oglt> lastElement = input[input.Size()-1];
bool inside = true;
if (lastElement.x < sx) {
inside = false;
@ -336,9 +335,13 @@ void ewol::OObject2DColored::SetColor(etkFloat_t red, etkFloat_t green, etkFloat
}
void ewol::OObject2DColored::SetPoint(coord2D_ts point)
void ewol::OObject2DColored::SetPoint(Vector2D<float> point)
{
m_triangle[m_triElement] = point;
// TODO : Clean this :
Coord2D<oglt> tmpElement;
tmpElement.x = point.x;
tmpElement.y = point.y;
m_triangle[m_triElement] = tmpElement;
m_triElement++;
if (m_triElement>=3) {
GenerateTriangle();

View File

@ -36,19 +36,19 @@ namespace ewol {
public:
virtual void Draw(void);
protected:
etk::VectorType<coord2D_ts> m_coord; //!< internal coord of the object
etk::VectorType<color_ts> m_coordColor; //!< internal color of the different point
etk::VectorType<Coord2D<oglt> > m_coord; //!< internal coord of the object
etk::VectorType<color_ts> m_coordColor; //!< internal color of the different point
//etk::VectorType<linkCoord_ts> m_linkCoord; //!< internal link between point to generate triangle
int32_t m_triElement;
color_ts m_color[3];
coord2D_ts m_triangle[3];
int32_t m_triElement;
color_ts m_color[3];
Coord2D<oglt> m_triangle[3];
void GenerateTriangle(void);
void ResetCount(void);
public:
void Clear(void);
void SetColor(etkFloat_t red, etkFloat_t green, etkFloat_t blue, etkFloat_t alpha = 1.0);
void SetColor(color_ts color);
void SetPoint(coord2D_ts point);
void SetPoint(Vector2D<float> point);
void SetPoint(etkFloat_t x, etkFloat_t y);
void Line(etkFloat_t sx, etkFloat_t sy, etkFloat_t ex, etkFloat_t ey, etkFloat_t thickness);
void Rectangle(etkFloat_t x, etkFloat_t y, etkFloat_t w, etkFloat_t h);

View File

@ -83,7 +83,7 @@ void ewol::OObject2DText::Clear(void)
m_coordTex.Clear();
}
int32_t ewol::OObject2DText::Text(coord2D_ts textPos, clipping_ts drawClipping, const etk::UString& unicodeString)
int32_t ewol::OObject2DText::Text(Vector2D<float> textPos, clipping_ts drawClipping, const etk::UString& unicodeString)
{
m_FontTextureId = 0;
if (m_FontId == -1) {
@ -93,7 +93,7 @@ int32_t ewol::OObject2DText::Text(coord2D_ts textPos, clipping_ts drawClipping,
return ewol::DrawText(m_FontId, textPos, drawClipping, unicodeString, m_FontTextureId, m_coord, m_coordTex);
}
int32_t ewol::OObject2DText::Text(coord2D_ts textPos, clipping_ts drawClipping, const uniChar_t unicodeChar)
int32_t ewol::OObject2DText::Text(Vector2D<float> textPos, clipping_ts drawClipping, const uniChar_t unicodeChar)
{
m_FontTextureId = 0;
if (m_FontId == -1) {

View File

@ -39,13 +39,13 @@ namespace ewol {
virtual void Draw(void);
// set a specific text
void Clear(void);
int32_t Text(coord2D_ts textPos, clipping_ts drawClipping, const etk::UString& unicodeString);
int32_t Text(coord2D_ts textPos, clipping_ts drawClipping, const uniChar_t unicodeChar);
int32_t Text(Vector2D<float> textPos, clipping_ts drawClipping, const etk::UString& unicodeString);
int32_t Text(Vector2D<float> textPos, clipping_ts drawClipping, const uniChar_t unicodeChar);
protected:
int32_t m_FontId; //!< font internal ID
color_ts m_textColorFg; //!< text color ...
int32_t m_FontTextureId; //!< font internal Texture ID
etk::VectorType<coord2D_ts> m_coord; //!< internal coord of the object
etk::VectorType<Vector2D<float> > m_coord; //!< internal coord of the object
etk::VectorType<texCoord_ts> m_coordTex; //!< internal texture coordinate for every point
};
};

View File

@ -99,7 +99,7 @@ void ewol::OObject2DTextColored::Clear(void)
m_coordColor.Clear();
}
int32_t ewol::OObject2DTextColored::Text(coord2D_ts textPos, const etk::UString& unicodeString)
int32_t ewol::OObject2DTextColored::Text(Vector2D<float> textPos, const etk::UString& unicodeString)
{
m_FontTextureId = 0;
if (m_FontId == -1) {
@ -119,7 +119,7 @@ int32_t ewol::OObject2DTextColored::Text(coord2D_ts textPos, const etk::UString&
return size;
}
int32_t ewol::OObject2DTextColored::Text(coord2D_ts textPos, const uniChar_t unicodeChar)
int32_t ewol::OObject2DTextColored::Text(Vector2D<float> textPos, const uniChar_t unicodeChar)
{
m_FontTextureId = 0;
if (m_FontId == -1) {

View File

@ -41,13 +41,13 @@ namespace ewol {
void SetColor(color_ts color);
// set a specific text
void Clear(void);
int32_t Text(coord2D_ts textPos, const etk::UString& unicodeString);
int32_t Text(coord2D_ts textPos, const uniChar_t unicodeChar);
int32_t Text(Vector2D<float> textPos, const etk::UString& unicodeString);
int32_t Text(Vector2D<float> textPos, const uniChar_t unicodeChar);
protected:
int32_t m_FontId; //!< font internal ID
color_ts m_color; //!< tmp text color ...
int32_t m_FontTextureId; //!< font internal Texture ID
etk::VectorType<coord2D_ts> m_coord; //!< internal coord of the object
etk::VectorType<Vector2D<float> > m_coord; //!< internal coord of the object
etk::VectorType<texCoord_ts> m_coordTex; //!< internal texture coordinate for every point
etk::VectorType<color_ts> m_coordColor; //!< internal color of the different point
public:

View File

@ -83,7 +83,7 @@ void ewol::OObject2DTextured::Clear(void)
void ewol::OObject2DTextured::Rectangle(etkFloat_t x, etkFloat_t y, etkFloat_t w, etkFloat_t h, etkFloat_t texX, etkFloat_t texY, etkFloat_t texSX, etkFloat_t texSY)
{
//EWOL_DEBUG("Add rectangle : ...");
coord2D_ts point;
Vector2D<float> point;
texCoord_ts tex;
tex.u = texX;

View File

@ -40,7 +40,7 @@ namespace ewol {
void Rectangle(etkFloat_t x, etkFloat_t y, etkFloat_t w, etkFloat_t h, etkFloat_t texX=0.0, etkFloat_t texY=0.0, etkFloat_t texSX=1.0, etkFloat_t texSY=1.0);
protected:
int32_t m_textureId; //!< texture internal ID
etk::VectorType<coord2D_ts> m_coord; //!< internal coord of the object
etk::VectorType<Vector2D<float> > m_coord; //!< internal coord of the object
etk::VectorType<texCoord_ts> m_coordTex; //!< internal texture coordinate for every point
};
};

View File

@ -84,7 +84,7 @@ void ewol::Sprite::Clear(void)
m_coordTex.Clear();
}
void ewol::Sprite::Element(coord2D_ts pos, etkFloat_t size, etkFloat_t angle)
void ewol::Sprite::Element(Vector2D<float> pos, etkFloat_t size, etkFloat_t angle)
{
angle -= M_PI/4;
size *= 0.7;
@ -98,7 +98,7 @@ void ewol::Sprite::Element(coord2D_ts pos, etkFloat_t size, etkFloat_t angle)
texD.u = 1.0;
texD.v = 0.0;
coord2D_ts point;
Vector2D<float> point;
etkFloat_t yyySin = sin(angle) * size;
etkFloat_t xxxCos = cos(angle) * size;

View File

@ -38,11 +38,11 @@ namespace ewol {
virtual ~Sprite(void);
virtual void Draw(void);
void Clear(void);
void Element(coord2D_ts pos, etkFloat_t size, etkFloat_t angle);
void Element(Vector2D<float> pos, etkFloat_t size, etkFloat_t angle);
bool HasName(etk::UString& name) { return name == m_name; };
protected:
int32_t m_textureId; //!< texture internal ID
etk::VectorType<coord2D_ts> m_coord; //!< internal coord of the object
etk::VectorType<Vector2D<float> > m_coord; //!< internal coord of the object
etk::VectorType<texCoord_ts> m_coordTex; //!< internal texture coordinate for every point
};
};

View File

@ -41,7 +41,7 @@ ewol::texture::TextureSVG::TextureSVG(etk::File & fileName, int32_t width, int32
m_loadOK = true;
}
if (width == -1) {
coord2D_ts elementSize = m_elementParsed.GetDefinedSize();
Vector2D<float> elementSize = m_elementParsed.GetDefinedSize();
m_width = elementSize.x;
m_height = elementSize.y;
} else {
@ -83,4 +83,4 @@ uint32_t ewol::texture::TextureSVG::DataSize(void)
void ewol::texture::TextureSVG::Display(void)
{
EWOL_DEBUG("SVG Texture : (" << m_width << "," << m_height << ") loadedOK=" << m_loadOK);
}
}

View File

@ -146,11 +146,11 @@ namespace ewol {
// ----------------------------------------------------------------------------------------------------------------
protected:
// internal element calculated by the system
coord2D_ts m_origin; //!< internal ... I do not really known how i can use it ...
coord2D_ts m_size; //!< internal : current size of the widget
coord2D_ts m_minSize; //!< user define the minimum size of the widget
Vector2D<float> m_origin; //!< internal ... I do not really known how i can use it ...
Vector2D<float> m_size; //!< internal : current size of the widget
Vector2D<float> m_minSize; //!< user define the minimum size of the widget
// user configuaration
coord2D_ts m_userMinSize; //!< user define the minimum size of the widget
Vector2D<float> m_userMinSize; //!< user define the minimum size of the widget
bool m_userExpendX;
bool m_userExpendY;
bool m_userFillX;
@ -169,13 +169,13 @@ namespace ewol {
* @param ---
* @return coordonate of the origin requested
*/
coord2D_ts GetOrigin(void) { return m_origin; };
Vector2D<float> GetOrigin(void) { return m_origin; };
/**
* @brief Convert the absolute position in the local Position (Relative)
* @param[in] pos Absolute position that you request convertion
* @return the relative position
*/
coord2D_ts RelativePosition(coord2D_ts pos) { pos.x -= m_origin.x; pos.y -= m_origin.y; return pos; };
Vector2D<float> RelativePosition(Vector2D<float> pos) { pos.x -= m_origin.x; pos.y -= m_origin.y; return 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
@ -206,13 +206,13 @@ namespace ewol {
* @param ---
* @return re size requested
*/
coord2D_ts GetMinSize(void) { return m_minSize; };
Vector2D<float> GetMinSize(void) { return m_minSize; };
/**
* @brief Get the widget size
* @param ---
* @return Requested size
*/
coord2D_ts GetSize(void) { return m_size; };
Vector2D<float> GetSize(void) { return m_size; };
/**
* @brief Set the horizontal expend capacity
* @param[in] newExpend new Expend state
@ -340,7 +340,7 @@ namespace ewol {
* @return NULL No widget found
* @return pointer on the widget found
*/
virtual ewol::Widget * GetWidgetAtPos(coord2D_ts pos) { return this; };
virtual ewol::Widget * GetWidgetAtPos(Vector2D<float> pos) { return this; };
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
@ -350,7 +350,7 @@ namespace ewol {
* @return true the event is used
* @return false the event is not used
*/
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos) { return false; };
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos) { return false; };
/**
* @brief Event on a short-cut of this Widget (in case of return false, the event on the keyevent will arrive in the function @ref OnEventKb)
* @param[in] shift The key Shift (left or/and right) is pressed (if true)

View File

@ -134,10 +134,10 @@ bool ewol::Windows::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY
* @return NULL No widget found
* @return pointer on the widget found
*/
ewol::Widget * ewol::Windows::GetWidgetAtPos(coord2D_ts pos)
ewol::Widget * ewol::Windows::GetWidgetAtPos(Vector2D<float> pos)
{
// calculate relative position
coord2D_ts relativePos = RelativePosition(pos);
Vector2D<float> relativePos = RelativePosition(pos);
// event go directly on the pop-up
if (0 < m_popUpWidgetList[m_currentCreateId].Size()) {
if (NULL == m_popUpWidgetList[m_currentCreateId][m_popUpWidgetList[m_currentCreateId].Size()-1]) {

View File

@ -72,7 +72,7 @@ namespace ewol {
* @return NULL No widget found
* @return pointer on the widget found
*/
virtual ewol::Widget * GetWidgetAtPos(coord2D_ts pos);
virtual ewol::Widget * GetWidgetAtPos(Vector2D<float> pos);
private:
bool m_hasDecoration;
public:

View File

@ -149,7 +149,7 @@ static void* BaseAppEntry(void* param)
//EWOL_DEBUG("Receive MSG : THREAD_INPUT_MOTION");
{
eventInputMotion_ts * tmpData = (eventInputMotion_ts*)data.data;
coord2D_ts pos;
Vector2D<float> pos;
pos.x = tmpData->x;
pos.y = tmpData->y;
ewol::eventInput::Motion(tmpData->type, tmpData->pointerID, pos);
@ -159,7 +159,7 @@ static void* BaseAppEntry(void* param)
//EWOL_DEBUG("Receive MSG : THREAD_INPUT_STATE");
{
eventInputState_ts * tmpData = (eventInputState_ts*)data.data;
coord2D_ts pos;
Vector2D<float> pos;
pos.x = tmpData->x;
pos.y = tmpData->y;
ewol::eventInput::State(tmpData->type, tmpData->pointerID, tmpData->state, pos);

View File

@ -47,9 +47,9 @@ typedef struct {
int32_t destinationInputId;
int64_t lastTimeEvent;
ewol::Widget* curentWidgetEvent;
coord2D_ts origin;
coord2D_ts size;
coord2D_ts downStart;
Vector2D<float> origin;
Vector2D<float> size;
Vector2D<float> downStart;
bool isDown;
bool isInside;
int32_t nbClickEvent; // 0 .. 1 .. 2 .. 3
@ -145,7 +145,7 @@ extern ewol::Windows* gui_uniqueWindows;
* @param[in] pos position of the event
* @return true if event has been greped
*/
static bool localEventInput(ewol::inputType_te type, ewol::Widget* destWidget, int32_t IdInput, ewol::eventInputType_te typeEvent, coord2D_ts pos)
static bool localEventInput(ewol::inputType_te type, ewol::Widget* destWidget, int32_t IdInput, ewol::eventInputType_te typeEvent, Vector2D<float> pos)
{
if (NULL != destWidget) {
if (type == ewol::INPUT_TYPE_MOUSE || type == ewol::INPUT_TYPE_FINGER) {
@ -190,7 +190,7 @@ extern int32_t offsetMoveClicked;
extern int32_t offsetMoveClickedDouble;
// note if id<0 ==> the it was finger event ...
void ewol::eventInput::Motion(ewol::inputType_te type, int pointerID, coord2D_ts pos)
void ewol::eventInput::Motion(ewol::inputType_te type, int pointerID, Vector2D<float> pos)
{
InputPoperty_ts *eventTable = NULL;
if (type == ewol::INPUT_TYPE_MOUSE) {
@ -245,7 +245,7 @@ void ewol::eventInput::Motion(ewol::inputType_te type, int pointerID, coord2D_ts
}
}
void ewol::eventInput::State(ewol::inputType_te type, int pointerID, bool isDown, coord2D_ts pos)
void ewol::eventInput::State(ewol::inputType_te type, int pointerID, bool isDown, Vector2D<float> pos)
{
InputPoperty_ts *eventTable = NULL;
if (type == ewol::INPUT_TYPE_MOUSE) {

View File

@ -39,8 +39,8 @@ namespace ewol
void Init(void);
void UnInit(void);
// note if id<0 ==> the it was finger event ...
void Motion(ewol::inputType_te type, int pointerID, coord2D_ts pos );
void State(ewol::inputType_te type, int pointerID, bool isDown, coord2D_ts pos);
void Motion(ewol::inputType_te type, int pointerID, Vector2D<float> pos );
void State(ewol::inputType_te type, int pointerID, bool isDown, Vector2D<float> pos);
/**
* @brief Inform object that an other object is removed ...

View File

@ -142,7 +142,7 @@ const char * const ewol::Button::GetObjectType(void)
}
void ewol::Button::SetPadding(coord2D_ts newPadding)
void ewol::Button::SetPadding(Vector2D<float> newPadding)
{
m_padding = newPadding;
}
@ -226,7 +226,7 @@ void ewol::Button::OnRegenerateDisplay(void)
int32_t fontHeight = ewol::GetHeight(fontId);
int32_t fontWidth = ewol::GetWidth(fontId, m_label.c_str());
*/
coord2D_ts textPos;
Vector2D<float> textPos;
textPos.x = tmpTextOriginX;
textPos.y = tmpTextOriginY;
@ -275,7 +275,7 @@ void ewol::Button::OnRegenerateDisplay(void)
* @return true the event is used
* @return false the event is not used
*/
bool ewol::Button::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos)
bool ewol::Button::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos)
{
//EWOL_DEBUG("Event on BT ...");
if (1 == IdInput) {

View File

@ -69,12 +69,12 @@ namespace ewol {
void SetValue(bool val);
bool GetValue(void);
void SetAlignement(textAlignement_te typeAlign);
void SetPadding(coord2D_ts newPadding);
void SetPadding(Vector2D<float> newPadding);
private:
bool m_hasAnImage;
etk::UString m_imageSelected;
textAlignement_te m_alignement;
coord2D_ts m_padding;
Vector2D<float> m_padding;
etk::UString m_label;
color_ts m_textColorFg; //!< Text color
color_ts m_textColorBg; //!< Background color
@ -90,7 +90,7 @@ namespace ewol {
* @return true the event is used
* @return false the event is not used
*/
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos);
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos);
virtual bool OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData);
};

View File

@ -126,7 +126,7 @@ const char * const ewol::ButtonColor::GetObjectType(void)
void ewol::ButtonColor::SetPadding(coord2D_ts newPadding)
void ewol::ButtonColor::SetPadding(Vector2D<float> newPadding)
{
m_padding = newPadding;
}
@ -214,7 +214,7 @@ void ewol::ButtonColor::OnRegenerateDisplay(void)
int32_t fontHeight = ewol::GetHeight(fontId);
int32_t fontWidth = ewol::GetWidth(fontId, m_label.c_str());
*/
coord2D_ts textPos;
Vector2D<float> textPos;
textPos.x = tmpTextOriginX;
textPos.y = tmpTextOriginY;
clipping_ts drawClipping;
@ -246,7 +246,7 @@ void ewol::ButtonColor::OnRegenerateDisplay(void)
* @return true the event is used
* @return false the event is not used
*/
bool ewol::ButtonColor::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos)
bool ewol::ButtonColor::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos)
{
//EWOL_DEBUG("Event on BT ...");
if (1 == IdInput) {
@ -264,7 +264,7 @@ bool ewol::ButtonColor::OnEventInput(ewol::inputType_te type, int32_t IdInput, e
return true;
}
// Get the button widget :
coord2D_ts newPosition;
Vector2D<float> newPosition;
newPosition.x = m_origin.x + m_size.x/2;
newPosition.y = m_origin.y;
@ -327,4 +327,4 @@ void ewol::ButtonColor::OnReceiveMessage(ewol::EObject * CallerObject, const cha
GenerateEventId(ewolEventButtonColorChange);
}
}
}
}

View File

@ -62,10 +62,10 @@ namespace ewol {
void SetValue(bool val);
bool GetValue(void);
void SetAlignement(textAlignement_te typeAlign);
void SetPadding(coord2D_ts newPadding);
void SetPadding(Vector2D<float> newPadding);
private:
textAlignement_te m_alignement;
coord2D_ts m_padding;
Vector2D<float> m_padding;
etk::UString m_label;
color_ts m_textColorFg; //!< Text color
color_ts m_textColorBg; //!< Background color
@ -83,7 +83,7 @@ namespace ewol {
* @return true the event is used
* @return false the event is not used
*/
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos);
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos);
color_ts GetCurrentColor(void) { return m_selectedColor; };
void SetCurrentColor(color_ts color);
/**

View File

@ -217,7 +217,7 @@ void ewol::ButtonImage::OnRegenerateDisplay(void)
* @return true the event is used
* @return false the event is not used
*/
bool ewol::ButtonImage::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos)
bool ewol::ButtonImage::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos)
{
//EWOL_DEBUG("Event on BT ...");
if (1 == IdInput) {
@ -242,7 +242,7 @@ bool ewol::ButtonImage::OnEventInput(ewol::inputType_te type, int32_t IdInput, e
}
} else if (0 == IdInput) {
if(ewol::EVENT_INPUT_TYPE_MOVE == typeEvent) {
coord2D_ts relPos = RelativePosition(pos);
Vector2D<float> relPos = RelativePosition(pos);
// check if over :
int32_t tmpSizeX = m_minSize.x;
@ -332,4 +332,4 @@ void ewol::ButtonImage::OnFlipFlopEvent(void)
}
}
}
}
}

View File

@ -80,7 +80,7 @@ namespace ewol {
* @return true the event is used
* @return false the event is not used
*/
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos);
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos);
virtual bool OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData);
/**
* @brief Event generated to inform a flip-flop has occured on the current widget

View File

@ -152,7 +152,7 @@ void ewol::CheckBox::OnRegenerateDisplay(void)
//int32_t posx = (m_size.x - fontWidth - 6)/2 + 25;
coord2D_ts textPos;
Vector2D<float> textPos;
textPos.x = boxSize+5;
textPos.y = posy;
clipping_ts drawClipping;
@ -189,7 +189,7 @@ void ewol::CheckBox::OnRegenerateDisplay(void)
* @return true the event is used
* @return false the event is not used
*/
bool ewol::CheckBox::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos)
bool ewol::CheckBox::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos)
{
//EWOL_DEBUG("Event on checkbox ...");
if (1 == IdInput) {

View File

@ -75,7 +75,7 @@ namespace ewol {
* @return true the event is used
* @return false the event is not used
*/
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos);
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos);
virtual bool OnEventKb(eventKbType_te typeEvent, uniChar_t unicodeData);
};

View File

@ -257,9 +257,9 @@ void ewol::ColorBar::OnRegenerateDisplay(void)
* @return true the event is used
* @return false the event is not used
*/
bool ewol::ColorBar::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos)
bool ewol::ColorBar::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos)
{
coord2D_ts relativePos = RelativePosition(pos);
Vector2D<float> 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

@ -57,8 +57,8 @@ namespace ewol {
void SetCurrentColor(color_ts newOne);
private:
color_ts m_currentColor;
coord2D_ts m_currentUserPos;
coord2D_ts m_padding;
Vector2D<float> m_currentUserPos;
Vector2D<float> m_padding;
public:
virtual void OnRegenerateDisplay(void);
public:
@ -71,7 +71,7 @@ namespace ewol {
* @return true the event is used
* @return false the event is not used
*/
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos);
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos);
};
extern const char * const TYPE_EOBJECT_WIDGET_COLOR_BAR;

View File

@ -103,8 +103,8 @@ bool ewol::ContextMenu::CalculateSize(etkFloat_t availlableX, etkFloat_t availla
m_size.y = availlableY;
if (NULL != m_subWidget[m_currentCreateId]) {
coord2D_ts subWidgetSize;
coord2D_ts subWidgetOrigin;
Vector2D<float> subWidgetSize;
Vector2D<float> subWidgetOrigin;
subWidgetSize = m_subWidget[m_currentCreateId]->GetMinSize();
if (true == m_subWidget[m_currentCreateId]->CanExpentX()) {
subWidgetSize.x = m_size.x;
@ -179,7 +179,7 @@ bool ewol::ContextMenu::CalculateMinSize(void)
m_minSize.y = 50.0;
if (NULL != m_subWidget[m_currentCreateId]) {
m_subWidget[m_currentCreateId]->CalculateMinSize();
coord2D_ts tmpSize = m_subWidget[m_currentCreateId]->GetMinSize();
Vector2D<float> tmpSize = m_subWidget[m_currentCreateId]->GetMinSize();
m_minSize.x = tmpSize.x;
m_minSize.y = tmpSize.y;
}
@ -241,8 +241,8 @@ void ewol::ContextMenu::OnRegenerateDisplay(void)
AddOObject(BGOObjects);
if (NULL != m_subWidget[m_currentCreateId]) {
coord2D_ts tmpSize = m_subWidget[m_currentCreateId]->GetSize();
coord2D_ts tmpOrigin = m_subWidget[m_currentCreateId]->GetOrigin();
Vector2D<float> tmpSize = m_subWidget[m_currentCreateId]->GetSize();
Vector2D<float> tmpOrigin = m_subWidget[m_currentCreateId]->GetOrigin();
// display border ...
BGOObjects->SetColor(m_colorBorder);
@ -297,14 +297,14 @@ void ewol::ContextMenu::OnRegenerateDisplay(void)
* @return NULL No widget found
* @return pointer on the widget found
*/
ewol::Widget * ewol::ContextMenu::GetWidgetAtPos(coord2D_ts pos)
ewol::Widget * ewol::ContextMenu::GetWidgetAtPos(Vector2D<float> pos)
{
// calculate relative position
coord2D_ts relativePos = RelativePosition(pos);
Vector2D<float> relativePos = RelativePosition(pos);
// Check for sub Element
if (NULL != m_subWidget[m_currentCreateId]) {
coord2D_ts tmpSize = m_subWidget[m_currentCreateId]->GetSize();
coord2D_ts tmpOrigin = m_subWidget[m_currentCreateId]->GetOrigin();
Vector2D<float> tmpSize = m_subWidget[m_currentCreateId]->GetSize();
Vector2D<float> tmpOrigin = m_subWidget[m_currentCreateId]->GetOrigin();
if( (tmpOrigin.x <= relativePos.x && tmpOrigin.x + tmpSize.x >= relativePos.x)
&& (tmpOrigin.y <= relativePos.y && tmpOrigin.y + tmpSize.y >= relativePos.y) )
{
@ -323,7 +323,7 @@ ewol::Widget * ewol::ContextMenu::GetWidgetAtPos(coord2D_ts pos)
* @return true the event is used
* @return false the event is not used
*/
bool ewol::ContextMenu::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos)
bool ewol::ContextMenu::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos)
{
//EWOL_INFO("Event ouside the context menu");
if (IdInput > 0) {
@ -344,7 +344,7 @@ bool ewol::ContextMenu::OnEventInput(ewol::inputType_te type, int32_t IdInput, e
}
void ewol::ContextMenu::SetPositionMark(markPosition_te position, coord2D_ts arrowPos)
void ewol::ContextMenu::SetPositionMark(markPosition_te position, Vector2D<float> arrowPos)
{
EWOL_DEBUG("set context menu at the position : (" << arrowPos.x << "," << arrowPos.y << ")");
m_arrawBorder = position;
@ -372,4 +372,4 @@ void ewol::ContextMenu::OnFlipFlopEvent(void)
if (NULL != m_subWidget[m_currentDrawId]) {
m_subWidget[m_currentDrawId]->OnFlipFlopEvent();
}
}
}

View File

@ -67,15 +67,15 @@ namespace ewol {
private:
color_ts m_colorBackGroung;
color_ts m_colorBorder;
coord2D_ts m_padding;
coord2D_ts m_arrowPos;
Vector2D<float> m_padding;
Vector2D<float> m_arrowPos;
etkFloat_t m_offset;
markPosition_te m_arrawBorder;
ewol::Widget* m_subWidget[NB_BOUBLE_BUFFER];
public:
void SubWidgetSet(ewol::Widget* newWidget);
void SubWidgetRemove(void);
void SetPositionMark(markPosition_te position, coord2D_ts arrowPos);
void SetPositionMark(markPosition_te position, Vector2D<float> arrowPos);
protected:
virtual void OnDraw(void);
public:
@ -87,7 +87,7 @@ namespace ewol {
* @return NULL No widget found
* @return pointer on the widget found
*/
virtual ewol::Widget * GetWidgetAtPos(coord2D_ts pos);
virtual ewol::Widget * GetWidgetAtPos(Vector2D<float> pos);
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
@ -97,7 +97,7 @@ namespace ewol {
* @return true the event is used
* @return false the event is not used
*/
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos);
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos);
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---

View File

@ -177,7 +177,7 @@ void ewol::Entry::OnRegenerateDisplay(void)
ewol::OObject2DText * tmpText = new ewol::OObject2DText("", -1, m_textColorFg);
coord2D_ts textPos;
Vector2D<float> textPos;
textPos.x = tmpTextOriginX + m_displayStartPosition;
textPos.y = tmpTextOriginY;
clipping_ts drawClipping;
@ -216,7 +216,7 @@ void ewol::Entry::OnRegenerateDisplay(void)
* @return true the event is used
* @return false the event is not used
*/
bool ewol::Entry::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos)
bool ewol::Entry::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos)
{
//EWOL_DEBUG("Event on Entry ...");
if (1 == IdInput) {

View File

@ -86,7 +86,7 @@ namespace ewol {
* @return true the event is used
* @return false the event is not used
*/
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos);
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos);
/**
* @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

@ -118,7 +118,7 @@ const char * const ewol::Image::GetObjectType(void)
}
void ewol::Image::SetPadding(coord2D_ts newPadding)
void ewol::Image::SetPadding(Vector2D<float> newPadding)
{
m_padding = newPadding;
}
@ -191,7 +191,7 @@ void ewol::Image::OnRegenerateDisplay(void)
* @return true the event is used
* @return false the event is not used
*/
bool ewol::Image::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos)
bool ewol::Image::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos)
{
//EWOL_DEBUG("Event on BT ...");
if (1 == IdInput) {

View File

@ -55,10 +55,10 @@ namespace ewol {
virtual ~Image(void);
virtual bool CalculateMinSize(void);
void SetFile(etk::UString newFile);
void SetPadding(coord2D_ts newPadding);
void SetPadding(Vector2D<float> newPadding);
private:
etk::UString m_imageSelected;
coord2D_ts m_padding;
Vector2D<float> m_padding;
color_ts m_textColorBg; //!< Background color
int32_t m_imageSize;
public:
@ -73,7 +73,7 @@ namespace ewol {
* @return true the event is used
* @return false the event is not used
*/
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos);
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos);
};
/**

View File

@ -243,13 +243,13 @@ Tangent Function: tan(teta) = Opposite / Adjacent
* @return true the event is used
* @return false the event is not used
*/
bool ewol::Joystick::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos)
bool ewol::Joystick::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos)
{
if (1 == IdInput) {
if( ewol::EVENT_INPUT_TYPE_DOWN == typeEvent
|| ewol::EVENT_INPUT_TYPE_MOVE == typeEvent) {
// get local relative position
coord2D_ts relativePos = RelativePosition(pos);
Vector2D<float> relativePos = RelativePosition(pos);
etkFloat_t 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

@ -43,7 +43,7 @@ namespace ewol {
private:
color_ts m_colorFg; //!< Forground color
color_ts m_colorBg; //!< Background color
coord2D_ts m_displayPos; //!< direction of the cursor ...
Vector2D<float> m_displayPos; //!< direction of the cursor ...
etkFloat_t m_distance; //!< dintance from the center
etkFloat_t 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
@ -90,7 +90,7 @@ namespace ewol {
* @return true the event is used
* @return false the event is not used
*/
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos);
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos);
void SetLockMode(bool lockWhenOut) { m_lock = lockWhenOut; };
void SetDisplayMode(joystickMode_te newMode) { m_displayMode = newMode; };
/**

View File

@ -141,7 +141,7 @@ void ewol::Label::OnRegenerateDisplay(void)
ewol::OObject2DText * tmpText = new ewol::OObject2DText("", -1, m_textColorFg);
coord2D_ts textPos;
Vector2D<float> textPos;
textPos.x = tmpOriginX;
textPos.y = tmpOriginY;
clipping_ts drawClipping;
@ -164,7 +164,7 @@ void ewol::Label::OnRegenerateDisplay(void)
* @return true the event is used
* @return false the event is not used
*/
bool ewol::Label::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos)
bool ewol::Label::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos)
{
//EWOL_DEBUG("Event on Label ...");
if (1 == IdInput) {

View File

@ -71,7 +71,7 @@ namespace ewol {
* @return true the event is used
* @return false the event is not used
*/
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos);
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos);
};
extern const char * const TYPE_EOBJECT_WIDGET_LABEL;

View File

@ -113,7 +113,7 @@ bool ewol::Layer::CalculateMinSize(void)
if (true == m_subWidget[m_currentCreateId][iii]->CanExpentY()) {
m_userExpendY = true;
}
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
Vector2D<float> tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
m_minSize.x = etk_max(tmpSize.x, m_minSize.x);
m_minSize.y = etk_max(tmpSize.y, m_minSize.y);
}
@ -236,13 +236,13 @@ void ewol::Layer::OnRegenerateDisplay(void)
* @return NULL No widget found
* @return pointer on the widget found
*/
ewol::Widget * ewol::Layer::GetWidgetAtPos(coord2D_ts pos)
ewol::Widget * ewol::Layer::GetWidgetAtPos(Vector2D<float> pos)
{
// for all element in the sizer ...
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
if (NULL != m_subWidget[m_currentCreateId][iii]) {
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetSize();
coord2D_ts tmpOrigin = m_subWidget[m_currentCreateId][iii]->GetOrigin();
Vector2D<float> tmpSize = m_subWidget[m_currentCreateId][iii]->GetSize();
Vector2D<float> tmpOrigin = m_subWidget[m_currentCreateId][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

@ -78,7 +78,7 @@ namespace ewol {
* @return NULL No widget found
* @return pointer on the widget found
*/
virtual ewol::Widget * GetWidgetAtPos(coord2D_ts pos);
virtual ewol::Widget * GetWidgetAtPos(Vector2D<float> pos);
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---

View File

@ -221,7 +221,7 @@ void ewol::List::OnRegenerateDisplay(void)
ewol::OObject2DText * tmpText = new ewol::OObject2DText("", -1, fg);
coord2D_ts textPos;
Vector2D<float> textPos;
textPos.x = tmpOriginX;
textPos.y = tmpOriginY + m_paddingSizeY;
tmpText->Text(textPos, drawClipping, myTextToWrite);
@ -246,9 +246,9 @@ void ewol::List::OnRegenerateDisplay(void)
* @return true the event is used
* @return false the event is not used
*/
bool ewol::List::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos)
bool ewol::List::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos)
{
coord2D_ts relativePos = RelativePosition(pos);
Vector2D<float> relativePos = RelativePosition(pos);
if (true == WidgetScrooled::OnEventInput(type, IdInput, typeEvent, pos)) {
ewol::widgetManager::FocusKeep(this);
// nothing to do ... done on upper widet ...

View File

@ -79,7 +79,7 @@ namespace ewol {
* @return true the event is used
* @return false the event is not used
*/
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos);
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos);
protected:
// function call to display the list :
virtual color_ts GetBasicBG(void) {

View File

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

View File

@ -101,8 +101,8 @@ bool ewol::PopUp::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY)
m_size.y = availlableY;
if (NULL != m_subWidget[m_currentCreateId]) {
coord2D_ts subWidgetSize;
coord2D_ts subWidgetOrigin;
Vector2D<float> subWidgetSize;
Vector2D<float> subWidgetOrigin;
subWidgetSize = m_subWidget[m_currentCreateId]->GetMinSize();
if (true == m_subWidget[m_currentCreateId]->CanExpentX()) {
subWidgetSize.x = m_size.x;
@ -138,7 +138,7 @@ bool ewol::PopUp::CalculateMinSize(void)
m_minSize.y = 50.0;
if (NULL != m_subWidget[m_currentCreateId]) {
m_subWidget[m_currentCreateId]->CalculateMinSize();
coord2D_ts tmpSize = m_subWidget[m_currentCreateId]->GetMinSize();
Vector2D<float> tmpSize = m_subWidget[m_currentCreateId]->GetMinSize();
m_minSize.x = tmpSize.x;
m_minSize.y = tmpSize.y;
}
@ -208,8 +208,8 @@ void ewol::PopUp::OnRegenerateDisplay(void)
BGOObjects->Rectangle(0, 0, m_size.x, m_size.y);
// set the area in white ...
if (NULL != m_subWidget[m_currentCreateId]) {
coord2D_ts tmpSize = m_subWidget[m_currentCreateId]->GetSize();
coord2D_ts tmpOrigin = m_subWidget[m_currentCreateId]->GetOrigin();
Vector2D<float> tmpSize = m_subWidget[m_currentCreateId]->GetSize();
Vector2D<float> tmpOrigin = m_subWidget[m_currentCreateId]->GetOrigin();
BGOObjects->SetColor(m_colorBorder);
BGOObjects->Rectangle(tmpOrigin.x-BORDER_SIZE_TMP, tmpOrigin.y-BORDER_SIZE_TMP, tmpSize.x+2*BORDER_SIZE_TMP, tmpSize.y+2*BORDER_SIZE_TMP);
BGOObjects->SetColor(m_colorBackGroung);
@ -227,14 +227,14 @@ void ewol::PopUp::OnRegenerateDisplay(void)
* @return NULL No widget found
* @return pointer on the widget found
*/
ewol::Widget * ewol::PopUp::GetWidgetAtPos(coord2D_ts pos)
ewol::Widget * ewol::PopUp::GetWidgetAtPos(Vector2D<float> pos)
{
// calculate relative position
coord2D_ts relativePos = RelativePosition(pos);
Vector2D<float> relativePos = RelativePosition(pos);
// for the element in the pop-up ...
if (NULL != m_subWidget[m_currentCreateId]) {
coord2D_ts tmpSize = m_subWidget[m_currentCreateId]->GetSize();
coord2D_ts tmpOrigin = m_subWidget[m_currentCreateId]->GetOrigin();
Vector2D<float> tmpSize = m_subWidget[m_currentCreateId]->GetSize();
Vector2D<float> tmpOrigin = m_subWidget[m_currentCreateId]->GetOrigin();
if( (tmpOrigin.x <= relativePos.x && tmpOrigin.x + tmpSize.x >= relativePos.x)
&& (tmpOrigin.y <= relativePos.y && tmpOrigin.y + tmpSize.y >= relativePos.y) )
{

View File

@ -78,7 +78,7 @@ namespace ewol {
* @return NULL No widget found
* @return pointer on the widget found
*/
virtual ewol::Widget * GetWidgetAtPos(coord2D_ts pos);
virtual ewol::Widget * GetWidgetAtPos(Vector2D<float> pos);
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---

View File

@ -92,7 +92,7 @@ bool ewol::SizerHori::CalculateSize(etkFloat_t availlableX, etkFloat_t availlabl
int32_t nbWidgetNotFixedSize=0;
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
if (NULL != m_subWidget[m_currentCreateId][iii]) {
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
Vector2D<float> tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
unexpendableSize += tmpSize.x;
if (false == m_subWidget[m_currentCreateId][iii]->CanExpentX()) {
nbWidgetFixedSize++;
@ -109,12 +109,12 @@ bool ewol::SizerHori::CalculateSize(etkFloat_t availlableX, etkFloat_t availlabl
sizeToAddAtEveryOne=0;
}
}
coord2D_ts tmpOrigin;
Vector2D<float> tmpOrigin;
tmpOrigin.x = m_origin.x;
tmpOrigin.y = m_origin.y;
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
if (NULL != m_subWidget[m_currentCreateId][iii]) {
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
Vector2D<float> tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
// Set the origin :
//EWOL_DEBUG("Set ORIGIN : " << tmpOrigin.x << "," << tmpOrigin.y << ")");
m_subWidget[m_currentCreateId][iii]->SetOrigin(tmpOrigin.x, tmpOrigin.y);
@ -149,7 +149,7 @@ bool ewol::SizerHori::CalculateMinSize(void)
if (true == m_subWidget[m_currentCreateId][iii]->CanExpentY()) {
m_userExpendY = true;
}
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
Vector2D<float> tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
m_minSize.x += tmpSize.x;
if (tmpSize.y>m_minSize.y) {
m_minSize.y = tmpSize.y;
@ -278,13 +278,13 @@ void ewol::SizerHori::OnRegenerateDisplay(void)
* @return NULL No widget found
* @return pointer on the widget found
*/
ewol::Widget * ewol::SizerHori::GetWidgetAtPos(coord2D_ts pos)
ewol::Widget * ewol::SizerHori::GetWidgetAtPos(Vector2D<float> pos)
{
// for all element in the sizer ...
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
if (NULL != m_subWidget[m_currentCreateId][iii]) {
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetSize();
coord2D_ts tmpOrigin = m_subWidget[m_currentCreateId][iii]->GetOrigin();
Vector2D<float> tmpSize = m_subWidget[m_currentCreateId][iii]->GetSize();
Vector2D<float> tmpOrigin = m_subWidget[m_currentCreateId][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

@ -77,7 +77,7 @@ namespace ewol {
* @return NULL No widget found
* @return pointer on the widget found
*/
virtual ewol::Widget * GetWidgetAtPos(coord2D_ts pos);
virtual ewol::Widget * GetWidgetAtPos(Vector2D<float> pos);
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---

View File

@ -93,7 +93,7 @@ bool ewol::SizerVert::CalculateSize(etkFloat_t availlableX, etkFloat_t availlabl
int32_t nbWidgetNotFixedSize=0;
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
if (NULL != m_subWidget[m_currentCreateId][iii]) {
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
Vector2D<float> tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
unexpendableSize += tmpSize.y;
if (false == m_subWidget[m_currentCreateId][iii]->CanExpentY()) {
nbWidgetFixedSize++;
@ -111,12 +111,12 @@ bool ewol::SizerVert::CalculateSize(etkFloat_t availlableX, etkFloat_t availlabl
sizeToAddAtEveryOne=0;
}
}
coord2D_ts tmpOrigin;
Vector2D<float> tmpOrigin;
tmpOrigin.x = m_origin.x;
tmpOrigin.y = m_origin.y;
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
if (NULL != m_subWidget[m_currentCreateId][iii]) {
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
Vector2D<float> tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
// Set the origin :
//EWOL_DEBUG("Set ORIGIN : " << tmpOrigin.x << "," << tmpOrigin.y << ")");
m_subWidget[m_currentCreateId][iii]->SetOrigin(tmpOrigin.x, tmpOrigin.y);
@ -151,7 +151,7 @@ bool ewol::SizerVert::CalculateMinSize(void)
if (true == m_subWidget[m_currentCreateId][iii]->CanExpentY()) {
m_userExpendY = true;
}
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
Vector2D<float> tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
//EWOL_DEBUG(" Get minSize[" << iii << "] ("<< tmpSize.x << "," << tmpSize.y << ")");
m_minSize.y += tmpSize.y;
if (tmpSize.x>m_minSize.x) {
@ -278,13 +278,13 @@ void ewol::SizerVert::OnRegenerateDisplay(void)
* @return NULL No widget found
* @return pointer on the widget found
*/
ewol::Widget * ewol::SizerVert::GetWidgetAtPos(coord2D_ts pos)
ewol::Widget * ewol::SizerVert::GetWidgetAtPos(Vector2D<float> pos)
{
// for all element in the sizer ...
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
if (NULL != m_subWidget[m_currentCreateId][iii]) {
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetSize();
coord2D_ts tmpOrigin = m_subWidget[m_currentCreateId][iii]->GetOrigin();
Vector2D<float> tmpSize = m_subWidget[m_currentCreateId][iii]->GetSize();
Vector2D<float> tmpOrigin = m_subWidget[m_currentCreateId][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

@ -78,7 +78,7 @@ namespace ewol {
* @return NULL No widget found
* @return pointer on the widget found
*/
virtual ewol::Widget * GetWidgetAtPos(coord2D_ts pos);
virtual ewol::Widget * GetWidgetAtPos(Vector2D<float> pos);
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---

View File

@ -171,9 +171,9 @@ void ewol::Slider::OnRegenerateDisplay(void)
* @return true the event is used
* @return false the event is not used
*/
bool ewol::Slider::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos)
bool ewol::Slider::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos)
{
coord2D_ts relativePos = RelativePosition(pos);
Vector2D<float> relativePos = RelativePosition(pos);
//EWOL_DEBUG("Event on Slider ...");
if (1 == IdInput) {
if( ewol::EVENT_INPUT_TYPE_SINGLE == typeEvent

View File

@ -76,7 +76,7 @@ namespace ewol {
* @return true the event is used
* @return false the event is not used
*/
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos);
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos);
};
extern const char * const TYPE_EOBJECT_WIDGET_SLIDER;

View File

@ -59,7 +59,7 @@ namespace ewol {
* @return NULL No widget found
* @return pointer on the widget found
*/
virtual ewol::Widget * GetWidgetAtPos(coord2D_ts pos) { return NULL; };
virtual ewol::Widget * GetWidgetAtPos(Vector2D<float> pos) { return NULL; };
private:
etkFloat_t m_size;
};

View File

@ -129,7 +129,7 @@ bool ewol::WSlider::CalculateMinSize(void)
if (true == m_subWidget[m_currentCreateId][iii]->CanExpentY()) {
m_userExpendY = true;
}
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
Vector2D<float> tmpSize = m_subWidget[m_currentCreateId][iii]->GetMinSize();
m_minSize.x = etk_max(tmpSize.x, m_minSize.x);
m_minSize.y = etk_max(tmpSize.y, m_minSize.y);
}
@ -323,7 +323,7 @@ void ewol::WSlider::OnRegenerateDisplay(void)
* @return NULL No widget found
* @return pointer on the widget found
*/
ewol::Widget * ewol::WSlider::GetWidgetAtPos(coord2D_ts pos)
ewol::Widget * ewol::WSlider::GetWidgetAtPos(Vector2D<float> pos)
{
// TODO : Review this ...
if (m_windowsDestination<0 || m_windowsDestination > m_subWidget[m_currentCreateId].Size()) {
@ -333,8 +333,8 @@ ewol::Widget * ewol::WSlider::GetWidgetAtPos(coord2D_ts pos)
int32_t iii = m_windowsDestination;
if (NULL != m_subWidget[m_currentCreateId][iii]) {
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetSize();
coord2D_ts tmpOrigin = m_subWidget[m_currentCreateId][iii]->GetOrigin();
Vector2D<float> tmpSize = m_subWidget[m_currentCreateId][iii]->GetSize();
Vector2D<float> tmpOrigin = m_subWidget[m_currentCreateId][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

@ -84,7 +84,7 @@ namespace ewol {
* @return NULL No widget found
* @return pointer on the widget found
*/
virtual ewol::Widget * GetWidgetAtPos(coord2D_ts pos);
virtual ewol::Widget * GetWidgetAtPos(Vector2D<float> pos);
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---

View File

@ -133,9 +133,9 @@ void ewol::WidgetScrooled::OnRegenerateDisplay(void)
* @return true the event is used
* @return false the event is not used
*/
bool ewol::WidgetScrooled::OnEventInput(ewol::inputType_te type, int32_t IdInput, ewol::eventInputType_te typeEvent, coord2D_ts pos)
bool ewol::WidgetScrooled::OnEventInput(ewol::inputType_te type, int32_t IdInput, ewol::eventInputType_te typeEvent, Vector2D<float> pos)
{
coord2D_ts relativePos = RelativePosition(pos);
Vector2D<float> relativePos = RelativePosition(pos);
if (SCROLL_MODE_NORMAL == m_scroollingMode) {
if (ewol::INPUT_TYPE_MOUSE==type && ( ewol::INPUT_TYPE_UNKNOW==m_highSpeedType || ewol::INPUT_TYPE_MOUSE==m_highSpeedType )) {
if (1 == IdInput && ewol::EVENT_INPUT_TYPE_DOWN == typeEvent) {
@ -407,7 +407,7 @@ void ewol::WidgetScrooled::GenDraw(void)
* @param[in] center True if the position might be at the center of the widget
* @return ---
*/
void ewol::WidgetScrooled::SetScrollingPositionDynamic(coord2D_ts borderWidth, coord2D_ts currentPosition, bool center)
void ewol::WidgetScrooled::SetScrollingPositionDynamic(Vector2D<float> borderWidth, Vector2D<float> currentPosition, bool center)
{
if (true == center) {
borderWidth.x = m_size.x / 2 - borderWidth.x;

View File

@ -50,13 +50,13 @@ namespace ewol {
void AddOObject(ewol::OObject* newObject, int32_t pos=-1);
void ClearOObjectList(void);
protected:
coord2D_ts m_originScrooled;
coord2D_ts m_maxSize;
Vector2D<float> m_originScrooled;
Vector2D<float> m_maxSize;
etkFloat_t m_zoom; //!< current zoom on the display
private:
scrollingMode_te m_scroollingMode; //!< mode of management of the scrooling
etkFloat_t m_pixelScrolling;
coord2D_ts m_highSpeedStartPos;
Vector2D<float> m_highSpeedStartPos;
highSpeedMode_te m_highSpeedMode;
int32_t m_highSpeedButton;
ewol::inputType_te m_highSpeedType;
@ -89,7 +89,7 @@ namespace ewol {
* @return true the event is used
* @return false the event is not used
*/
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, ewol::eventInputType_te typeEvent, coord2D_ts pos);
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, ewol::eventInputType_te typeEvent, Vector2D<float> pos);
/**
* @brief extern interface to request a draw ... (called by the drawing thread [Android, X11, ...])
* This function generate a clipping with the viewport openGL system. Like this a widget draw can not draw over an other widget
@ -116,7 +116,7 @@ namespace ewol {
* @param[in] localSize new Maximum size
* @return ---
*/
void SetMaxSize(coord2D_ts localSize) { m_maxSize = localSize; };
void SetMaxSize(Vector2D<float> 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
@ -124,7 +124,7 @@ namespace ewol {
* @param[in] center True if the position might be at the center of the widget
* @return ---
*/
void SetScrollingPositionDynamic(coord2D_ts borderWidth, coord2D_ts currentPosition, bool center = false);
void SetScrollingPositionDynamic(Vector2D<float> borderWidth, Vector2D<float> currentPosition, bool center = false);
};
extern const char * const TYPE_EOBJECT_WIDGET_SCROOLED;

View File

@ -109,7 +109,7 @@ void svg::Base::ParseTransform(TiXmlNode *node)
* @param[out] size parsed dimention
* @return ---
*/
void svg::Base::ParsePosition(const TiXmlNode *node, coord2D_ts &pos, coord2D_ts &size)
void svg::Base::ParsePosition(const TiXmlNode *node, Vector2D<float> &pos, Vector2D<float> &size)
{
pos.x = 0;
pos.y = 0;
@ -435,7 +435,7 @@ color_ts svg::Base::ParseColor(const char *inputData)
* @param[in] node standart XML node
* @return true if no problem arrived
*/
bool svg::Base::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax)
bool svg::Base::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax)
{
SVG_ERROR("NOT IMPLEMENTED");
sizeMax.x = 0;

View File

@ -54,13 +54,13 @@ namespace svg
Base(void) {};
Base(PaintState parentPaintState);
~Base(void) { };
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax);
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax);
//specific drawing for AAG librairy ...
virtual void AggDraw(svg::Renderer& myRenderer, agg::trans_affine& basicTrans) { };
virtual void Display(int32_t spacing) { };
void ParseTransform(TiXmlNode *node);
void ParsePosition(const TiXmlNode *node, coord2D_ts &pos, coord2D_ts &size);
void ParsePosition(const TiXmlNode *node, Vector2D<float> &pos, Vector2D<float> &size);
etkFloat_t ParseLength(const char *dataInput);
void ParsePaintAttr(const TiXmlNode *node);
color_ts ParseColor(const char *inputData);

View File

@ -38,7 +38,7 @@ svg::Circle::~Circle(void)
}
bool svg::Circle::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax)
bool svg::Circle::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax)
{
m_radius = 0.0;
m_position.x = 0.0;

View File

@ -32,12 +32,12 @@ namespace svg
class Circle : public svg::Base
{
private:
coord2D_ts m_position; //!< Position of the Circle
etkFloat_t m_radius; //!< Radius of the Circle
Vector2D<float> m_position; //!< Position of the Circle
float m_radius; //!< Radius of the Circle
public:
Circle(PaintState parentPaintState);
~Circle(void);
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax);
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax);
virtual void Display(int32_t spacing);
virtual void AggDraw(svg::Renderer& myRenderer, agg::trans_affine& basicTrans);
};

View File

@ -37,7 +37,7 @@ svg::Ellipse::~Ellipse(void)
}
bool svg::Ellipse::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax)
bool svg::Ellipse::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax)
{
ParseTransform(node);
ParsePaintAttr(node);

View File

@ -32,12 +32,12 @@ namespace svg
class Ellipse : public svg::Base
{
private:
coord2D_ts m_c; //!< Center property of the ellipse
coord2D_ts m_r; //!< Radius property of the ellipse
Vector2D<float> m_c; //!< Center property of the ellipse
Vector2D<float> m_r; //!< Radius property of the ellipse
public:
Ellipse(PaintState parentPaintState);
~Ellipse(void);
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax);
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax);
virtual void Display(int32_t spacing);
virtual void AggDraw(svg::Renderer& myRenderer, agg::trans_affine& basicTrans);
};

View File

@ -46,11 +46,11 @@ svg::Group::~Group(void)
}
bool svg::Group::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax)
bool svg::Group::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax)
{
// parse ...
coord2D_ts pos;
coord2D_ts size;
Vector2D<float> pos;
Vector2D<float> size;
ParseTransform(node);
ParsePosition(node, pos, size);
ParsePaintAttr(node);
@ -63,7 +63,7 @@ bool svg::Group::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D
sizeMax.x = 0;
sizeMax.y = 0;
coord2D_ts tmpPos;
Vector2D<float> tmpPos;
// parse all sub node :
for(TiXmlNode * child = node->FirstChild(); NULL != child; child = child->NextSibling() ) {
svg::Base *elementParser = NULL;

View File

@ -37,7 +37,7 @@ namespace svg
public:
Group(PaintState parentPaintState);
~Group(void);
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax);
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax);
virtual void Display(int32_t spacing);
virtual void AggDraw(svg::Renderer& myRenderer, agg::trans_affine& basicTrans);
};

View File

@ -40,7 +40,7 @@ svg::Line::~Line(void)
}
bool svg::Line::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax)
bool svg::Line::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax)
{
// line must have a minimum size...
m_paint.strokeWidth = 1;

View File

@ -32,12 +32,12 @@ namespace svg
class Line : public svg::Base
{
private:
coord2D_ts m_startPos; //!< Start line position
coord2D_ts m_stopPos; //!< Stop line position
Vector2D<float> m_startPos; //!< Start line position
Vector2D<float> m_stopPos; //!< Stop line position
public:
Line(PaintState parentPaintState);
~Line(void);
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax);
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax);
virtual void Display(int32_t spacing);
virtual void AggDraw(svg::Renderer& myRenderer, agg::trans_affine& basicTrans);
};

View File

@ -78,7 +78,7 @@ const char * extractCmd(const char * input, char& cmd, etk::VectorType<float>& o
return outputPointer;
}
bool svg::Path::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax)
bool svg::Path::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax)
{
ParseTransform(node);
ParsePaintAttr(node);

View File

@ -46,7 +46,7 @@ namespace svg
typedef struct {
pathEnum_te cmd;
bool relative;
etkFloat_t element[7];
float element[7];
}pathBasic_ts;
class Path : public svg::Base
@ -56,7 +56,7 @@ namespace svg
public:
Path(PaintState parentPaintState);
~Path(void);
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax);
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax);
virtual void Display(int32_t spacing);
virtual void AggDraw(svg::Renderer& myRenderer, agg::trans_affine& basicTrans);
private:

View File

@ -37,7 +37,7 @@ svg::Polygon::~Polygon(void)
}
bool svg::Polygon::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax)
bool svg::Polygon::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax)
{
ParseTransform(node);
ParsePaintAttr(node);
@ -58,7 +58,7 @@ bool svg::Polygon::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord
sizeMax.y = 0;
SVG_VERBOSE("Parse polygon : \"" << sss << "\"");
while ('\0' != sss[0]) {
coord2D_ts pos;
Vector2D<float> pos;
int32_t n;
if (sscanf(sss, "%f,%f%n", &pos.x, &pos.y, &n) == 2) {
m_listPoint.PushBack(pos);

View File

@ -37,12 +37,12 @@ namespace svg
class Polygon : public svg::Base
{
private:
etk::VectorType<coord2D_ts> m_listPoint; //!< list of all point of the polygone
PolygonMode_te m_diplayMode; //!< polygone specific display mode
etk::VectorType<Vector2D<float> > m_listPoint; //!< list of all point of the polygone
PolygonMode_te m_diplayMode; //!< polygone specific display mode
public:
Polygon(PaintState parentPaintState);
~Polygon(void);
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax);
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax);
virtual void Display(int32_t spacing);
virtual void AggDraw(svg::Renderer& myRenderer, agg::trans_affine& basicTrans);
};

View File

@ -37,7 +37,7 @@ svg::Polyline::~Polyline(void)
}
bool svg::Polyline::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax)
bool svg::Polyline::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax)
{
// line must have a minimum size...
m_paint.strokeWidth = 1;
@ -56,7 +56,7 @@ bool svg::Polyline::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coor
sizeMax.y = 0;
SVG_VERBOSE("Parse polyline : \"" << sss << "\"");
while ('\0' != sss[0]) {
coord2D_ts pos;
Vector2D<float> pos;
int32_t n;
if (sscanf(sss, "%f,%f %n", &pos.x, &pos.y, &n) == 2) {
m_listPoint.PushBack(pos);

View File

@ -33,11 +33,11 @@ namespace svg
class Polyline : public svg::Base
{
private:
etk::VectorType<coord2D_ts> m_listPoint; //!< list of all point of the polyline
etk::VectorType<Vector2D<float> > m_listPoint; //!< list of all point of the polyline
public:
Polyline(PaintState parentPaintState);
~Polyline(void);
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax);
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax);
virtual void Display(int32_t spacing);
virtual void AggDraw(svg::Renderer& myRenderer, agg::trans_affine& basicTrans);
};

View File

@ -42,7 +42,7 @@ svg::Rectangle::~Rectangle(void)
}
bool svg::Rectangle::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax)
bool svg::Rectangle::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax)
{
m_position.x = 0.0;
m_position.y = 0.0;

View File

@ -32,13 +32,13 @@ namespace svg
class Rectangle : public svg::Base
{
private:
coord2D_ts m_position; //!< position of the rectangle
coord2D_ts m_size; //!< size of the rectangle
coord2D_ts m_roundedCorner; //!< property of the rounded corner
Vector2D<float> m_position; //!< position of the rectangle
Vector2D<float> m_size; //!< size of the rectangle
Vector2D<float> m_roundedCorner; //!< property of the rounded corner
public:
Rectangle(PaintState parentPaintState);
~Rectangle(void);
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax);
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax);
virtual void Display(int32_t spacing);
virtual void AggDraw(svg::Renderer& myRenderer, agg::trans_affine& basicTrans);
};

View File

@ -55,11 +55,11 @@ namespace svg
public:
color_ts fill;
color_ts stroke;
etkFloat_t strokeWidth;
float strokeWidth;
bool flagEvenOdd;
lineCap_te lineCap;
lineJoin_te lineJoin;
coord2D_ts viewPort;
Vector2D<float> viewPort;
};
// basic definition type for the renderer
@ -74,7 +74,7 @@ namespace svg
Renderer(uint32_t width, uint32_t height);
~Renderer(void);
void WritePpm(etk::UString fileName);
coord2D_ts m_size;
Vector2D<float> m_size;
agg::rendering_buffer * m_renderingBuffer;
agg::pixfmt_rgba32 * m_pixFrame;
rendererBase_t * m_renderBase;

View File

@ -35,7 +35,7 @@ svg::Text::~Text(void)
}
bool svg::Text::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax)
bool svg::Text::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax)
{
sizeMax.x = 0;
sizeMax.y = 0;

View File

@ -36,7 +36,7 @@ namespace svg
public:
Text(PaintState parentPaintState);
~Text(void);
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, coord2D_ts& sizeMax);
virtual bool Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D<float>& sizeMax);
virtual void Display(int32_t spacing);
};
};

View File

@ -118,18 +118,18 @@ svg::Parser::Parser(etk::File fileName) : m_renderedElement(NULL)
m_version = version;
}
// parse ...
coord2D_ts pos;
Vector2D<float> pos;
ParseTransform(root);
ParsePosition(root, pos, m_size);
ParsePaintAttr(root);
SVG_VERBOSE("parsed .ROOT trans : (" << m_transformMatrix.sx << "," << m_transformMatrix.shy << "," << m_transformMatrix.shx << "," << m_transformMatrix.sy << "," << m_transformMatrix.tx << "," << m_transformMatrix.ty << ")");
coord2D_ts maxSize;
Vector2D<float> maxSize;
maxSize.x = 0.0;
maxSize.y = 0.0;
coord2D_ts size;
Vector2D<float> size;
// parse all sub node :
for(TiXmlNode * child = root->FirstChild(); NULL != child; child = child->NextSibling() ) {
svg::Base *elementParser = NULL;

View File

@ -39,7 +39,7 @@ namespace svg
etk::UString m_version;
etk::UString m_title;
etk::VectorType<svg::Base *> m_subElementList;
coord2D_ts m_size;
Vector2D<float> m_size;
svg::Renderer* m_renderedElement;
public:
@ -52,7 +52,7 @@ namespace svg
virtual void AggDraw(svg::Renderer& myRenderer, agg::trans_affine& basicTrans);
uint8_t* GetPointerOnData(void);
uint32_t GetSizeOnData(void);
coord2D_ts GetDefinedSize(void) { return m_size;};
Vector2D<float> GetDefinedSize(void) { return m_size;};
};
};