Remove old coord type

This commit is contained in:
Edouard Dupin 2012-02-21 13:54:55 +01:00
parent 8e85f28fc8
commit 0e651c71ae
11 changed files with 89 additions and 81 deletions

View File

@ -37,13 +37,6 @@ namespace ewol {
#include <etk/VectorType.h> #include <etk/VectorType.h>
namespace ewol { namespace ewol {
extern "C" {
// TODO : Remove this bu coord2D_ts
typedef struct {
etkFloat_t x;
etkFloat_t y;
} coord;
}
typedef enum { typedef enum {
EVENT_INPUT_TYPE_DOWN, EVENT_INPUT_TYPE_DOWN,
EVENT_INPUT_TYPE_MOVE, EVENT_INPUT_TYPE_MOVE,
@ -100,9 +93,6 @@ namespace ewol {
char* GetCharTypeMoveEvent(eventKbMoveType_te type); char* GetCharTypeMoveEvent(eventKbMoveType_te type);
#define EWOL_EVENT_AREA (0)
#define EWOL_EVENT_SHORTCUT (1)
// TODO : Remove this and set it at the Windows only ...
extern "C" { extern "C" {
typedef struct { typedef struct {
const char * generateEventId; //!< event generate ID (to be unique it was pointer on the string name) const char * generateEventId; //!< event generate ID (to be unique it was pointer on the string name)
@ -129,26 +119,26 @@ namespace ewol {
// ---------------------------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------------------------
protected: protected:
// internal element calculated by the system // internal element calculated by the system
coord m_origin; //!< internal ... I do not really known how i can use it ... coord2D_ts m_origin; //!< internal ... I do not really known how i can use it ...
coord m_size; //!< internal : current size of the widget coord2D_ts m_size; //!< internal : current size of the widget
coord m_minSize; //!< user define the minimum size of the widget coord2D_ts m_minSize; //!< user define the minimum size of the widget
// user configuaration // user configuaration
coord m_userMinSize; //!< user define the minimum size of the widget coord2D_ts m_userMinSize; //!< user define the minimum size of the widget
bool m_userExpendX; bool m_userExpendX;
bool m_userExpendY; bool m_userExpendY;
bool m_userFillX; bool m_userFillX;
bool m_userFillY; bool m_userFillY;
public: public:
void SetOrigin(etkFloat_t x, etkFloat_t y) { m_origin.x=x; m_origin.y=y;}; void SetOrigin(etkFloat_t x, etkFloat_t y) { m_origin.x=x; m_origin.y=y;};
coord GetOrigin(void) { return m_origin; }; coord2D_ts GetOrigin(void) { return m_origin; };
virtual bool CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY); // this generate the current size ... virtual bool CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY); // this generate the current size ...
//update the min Size ... and the expend parameters for the sizer //update the min Size ... and the expend parameters for the sizer
virtual bool CalculateMinSize(void) {m_minSize.x = m_userMinSize.x; m_minSize.y = m_userMinSize.y; MarkToReedraw(); return true; }; virtual bool CalculateMinSize(void) {m_minSize.x = m_userMinSize.x; m_minSize.y = m_userMinSize.y; MarkToReedraw(); return true; };
virtual void SetMinSize(etkFloat_t x=-1, etkFloat_t y=-1) { m_userMinSize.x = x; m_userMinSize.y = y; }; virtual void SetMinSize(etkFloat_t x=-1, etkFloat_t y=-1) { m_userMinSize.x = x; m_userMinSize.y = y; };
coord GetMinSize(void) { return m_minSize; }; coord2D_ts GetMinSize(void) { return m_minSize; };
coord GetSize(void) { return m_size; }; coord2D_ts GetSize(void) { return m_size; };
void SetCurrentSise(etkFloat_t x=-1, etkFloat_t y=-1) { m_size.x = x; m_size.y = y; MarkToReedraw();}; void SetCurrentSise(etkFloat_t x=-1, etkFloat_t y=-1) { m_size.x = x; m_size.y = y; MarkToReedraw();};
coord GetCurrentSize(void) { return m_size; }; coord2D_ts GetCurrentSize(void) { return m_size; };
virtual void SetExpendX(bool newExpend=false) { m_userExpendX = newExpend; }; virtual void SetExpendX(bool newExpend=false) { m_userExpendX = newExpend; };
virtual bool CanExpentX(void) { return m_userExpendX; }; virtual bool CanExpentX(void) { return m_userExpendX; };
virtual void SetExpendY(bool newExpend=false) { m_userExpendY = newExpend; }; virtual void SetExpendY(bool newExpend=false) { m_userExpendY = newExpend; };

View File

@ -35,7 +35,7 @@ extern "C" {
}; };
static pthread_mutex_t localMutex; static pthread_mutex_t localMutex;
static bool IsInit = false;
// internal element of the widget manager : // internal element of the widget manager :
static etk::VectorType<widgetList_ts> m_widgetList; // all widget allocated ==> all time increment ... never removed ... static etk::VectorType<widgetList_ts> m_widgetList; // all widget allocated ==> all time increment ... never removed ...
@ -54,6 +54,7 @@ void ewol::widgetManager::Init(void)
m_widgetList.Clear(); m_widgetList.Clear();
m_focusWidgetDefault = NULL; m_focusWidgetDefault = NULL;
m_focusWidgetCurrent = NULL; m_focusWidgetCurrent = NULL;
IsInit = true;
} }
void ewol::widgetManager::UnInit(void) void ewol::widgetManager::UnInit(void)
@ -66,15 +67,16 @@ void ewol::widgetManager::UnInit(void)
ewol::widgetManager::RemoveAllMarkWidget(); ewol::widgetManager::RemoveAllMarkWidget();
EWOL_INFO(" Remove missing user widget"); EWOL_INFO(" Remove missing user widget");
for(int32_t iii=0; iii<m_widgetList.Size(); iii++) { while(0<m_widgetList.Size()) {
if (m_widgetList[iii].widgetPointer!=NULL) { if (m_widgetList[0].widgetPointer!=NULL) {
EWOL_WARNING("Un-Removed widget ... id=" << iii); MarkWidgetToBeRemoved(m_widgetList[0].widgetPointer);
FocusRemoveIfRemove(m_widgetList[iii].widgetPointer);
delete(m_widgetList[iii].widgetPointer);
m_widgetList[iii].widgetPointer=NULL;
} }
} }
m_widgetList.Clear(); // local acces ==> this control the mutex Lock
RemoveAllMarkWidget();
IsInit = false;
int ret = pthread_mutex_destroy(&localMutex); int ret = pthread_mutex_destroy(&localMutex);
EWOL_ASSERT(ret == 0, "Error destroying Mutex ..."); EWOL_ASSERT(ret == 0, "Error destroying Mutex ...");
} }
@ -116,6 +118,7 @@ void ewol::widgetManager::Rm(ewol::Widget * newWidget)
// Remove Element // Remove Element
m_widgetDeletedList.Erase(iii); m_widgetDeletedList.Erase(iii);
//Normal remove of the widget ... //Normal remove of the widget ...
//EWOL_DEBUG("Remove element " << iii);
return; return;
} }
} }
@ -253,7 +256,9 @@ void ewol::widgetManager::GetDoubleBufferFlipFlop(void)
void ewol::widgetManager::GetDoubleBufferStartDraw(void) void ewol::widgetManager::GetDoubleBufferStartDraw(void)
{ {
pthread_mutex_lock(&localMutex); if (IsInit) {
pthread_mutex_lock(&localMutex);
}
} }
bool ewol::widgetManager::GetDoubleBufferNeedDraw(void) bool ewol::widgetManager::GetDoubleBufferNeedDraw(void)
@ -267,7 +272,9 @@ bool ewol::widgetManager::GetDoubleBufferNeedDraw(void)
void ewol::widgetManager::GetDoubleBufferStopDraw(void) void ewol::widgetManager::GetDoubleBufferStopDraw(void)
{ {
pthread_mutex_unlock(&localMutex); if (IsInit) {
pthread_mutex_unlock(&localMutex);
}
} }
@ -312,21 +319,29 @@ void ewol::widgetManager::MarkWidgetToBeRemoved(ewol::Widget * expectedWidget)
void ewol::widgetManager::RemoveAllMarkWidget(void) void ewol::widgetManager::RemoveAllMarkWidget(void)
{ {
etk::VectorType<widgetList_ts> m_widgetDeletedList_tmp = m_widgetDeletedList; if (IsInit) {
pthread_mutex_lock(&localMutex); pthread_mutex_lock(&localMutex);
// flip/Flop all the widget registered : etk::VectorType<widgetList_ts> m_widgetDeletedList_tmp = m_widgetDeletedList;
for(int32_t iii=0; iii<m_widgetDeletedList_tmp.Size(); iii++) { /*
if (NULL != m_widgetDeletedList_tmp[iii].widgetPointer) { if (m_widgetDeletedList.Size() > 0 ) {
delete(m_widgetDeletedList_tmp[iii].widgetPointer); EWOL_DEBUG("NB element to remove : " << m_widgetDeletedList.Size());
m_widgetDeletedList_tmp[iii].widgetPointer = NULL;
} }
} */
pthread_mutex_unlock(&localMutex); // flip/Flop all the widget registered :
for(int32_t iii=0; iii<m_widgetDeletedList_tmp.Size(); iii++) {
if (m_widgetDeletedList.Size() != 0 ) { if (NULL != m_widgetDeletedList_tmp[iii].widgetPointer) {
EWOL_CRITICAL("Memory leak ==> not all the widget are auto-removed nb = " << m_widgetDeletedList.Size()); delete(m_widgetDeletedList_tmp[iii].widgetPointer);
// in every case clean the list ... m_widgetDeletedList_tmp[iii].widgetPointer = NULL;
m_widgetDeletedList.Clear(); }
}
/*
if (m_widgetDeletedList.Size() > 0 ) {
EWOL_CRITICAL("Memory leak ==> not all the widget are auto-removed nb = " << m_widgetDeletedList.Size());
// in every case clean the list ...
m_widgetDeletedList.Clear();
}
*/
pthread_mutex_unlock(&localMutex);
} }
} }

View File

@ -80,7 +80,7 @@ bool ewol::Windows::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY
int32_t keyboardHigh = 0; int32_t keyboardHigh = 0;
if (NULL != m_keyBoardwidget && false == m_keyBoardwidget->IsHide() ) { if (NULL != m_keyBoardwidget && false == m_keyBoardwidget->IsHide() ) {
m_keyBoardwidget->CalculateMinSize(); m_keyBoardwidget->CalculateMinSize();
coord tmpSize = m_keyBoardwidget->GetMinSize(); coord2D_ts tmpSize = m_keyBoardwidget->GetMinSize();
keyboardHigh = (int32_t)tmpSize.y; keyboardHigh = (int32_t)tmpSize.y;
m_keyBoardwidget->SetOrigin(0, m_size.y - keyboardHigh); m_keyBoardwidget->SetOrigin(0, m_size.y - keyboardHigh);
m_keyBoardwidget->CalculateSize(m_size.x, keyboardHigh); m_keyBoardwidget->CalculateSize(m_size.x, keyboardHigh);
@ -106,7 +106,7 @@ bool ewol::Windows::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY
bool ewol::Windows::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y) bool ewol::Windows::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y)
{ {
if (NULL != m_keyBoardwidget && false == m_keyBoardwidget->IsHide() ) { if (NULL != m_keyBoardwidget && false == m_keyBoardwidget->IsHide() ) {
coord tmpSize = m_keyBoardwidget->GetMinSize(); coord2D_ts tmpSize = m_keyBoardwidget->GetMinSize();
if (y > m_size.y - tmpSize.y) { if (y > m_size.y - tmpSize.y) {
m_keyBoardwidget->GenEventInput(IdInput, typeEvent, x, y); m_keyBoardwidget->GenEventInput(IdInput, typeEvent, x, y);
return true; return true;

View File

@ -247,8 +247,8 @@ void EWOL_SystemStart(void)
// init the thread : // init the thread :
EWOL_DEBUG("Create the thread"); EWOL_DEBUG("Create the thread");
pthread_attr_init(&androidJniThreadAttr); pthread_attr_init(&androidJniThreadAttr);
//pthread_attr_setdetachstate(&androidJniThreadAttr, PTHREAD_CREATE_JOINABLE) pthread_attr_setdetachstate(&androidJniThreadAttr, PTHREAD_CREATE_JOINABLE);
pthread_attr_setdetachstate(&androidJniThreadAttr, PTHREAD_CREATE_DETACHED); //pthread_attr_setdetachstate(&androidJniThreadAttr, PTHREAD_CREATE_DETACHED);
//pthread_attr_setscope( &androidJniThreadAttr, PTHREAD_SCOPE_SYSTEM); //pthread_attr_setscope( &androidJniThreadAttr, PTHREAD_SCOPE_SYSTEM);
/* // note android does not permit to change the thread priority ... /* // note android does not permit to change the thread priority ...
// try to set prio : // try to set prio :

View File

@ -69,8 +69,8 @@ bool ewol::ContextMenu::CalculateSize(etkFloat_t availlableX, etkFloat_t availla
m_size.y = availlableY; m_size.y = availlableY;
if (NULL != m_subWidget) { if (NULL != m_subWidget) {
coord subWidgetSize; coord2D_ts subWidgetSize;
coord subWidgetOrigin; coord2D_ts subWidgetOrigin;
subWidgetSize = m_subWidget->GetMinSize(); subWidgetSize = m_subWidget->GetMinSize();
if (true == m_subWidget->CanExpentX()) { if (true == m_subWidget->CanExpentX()) {
subWidgetSize.x = m_size.x; subWidgetSize.x = m_size.x;
@ -142,7 +142,7 @@ bool ewol::ContextMenu::CalculateMinSize(void)
m_minSize.y = 50.0; m_minSize.y = 50.0;
if (NULL != m_subWidget) { if (NULL != m_subWidget) {
m_subWidget->CalculateMinSize(); m_subWidget->CalculateMinSize();
coord tmpSize = m_subWidget->GetMinSize(); coord2D_ts tmpSize = m_subWidget->GetMinSize();
m_minSize.x = tmpSize.x; m_minSize.x = tmpSize.x;
m_minSize.y = tmpSize.y; m_minSize.y = tmpSize.y;
} }
@ -205,8 +205,8 @@ void ewol::ContextMenu::OnRegenerateDisplay(void)
AddOObject(BGOObjects); AddOObject(BGOObjects);
if (NULL != m_subWidget) { if (NULL != m_subWidget) {
coord tmpSize = m_subWidget->GetSize(); coord2D_ts tmpSize = m_subWidget->GetSize();
coord tmpOrigin = m_subWidget->GetOrigin(); coord2D_ts tmpOrigin = m_subWidget->GetOrigin();
// display border ... // display border ...
BGOObjects->SetColor(m_colorBorder); BGOObjects->SetColor(m_colorBorder);
@ -246,8 +246,8 @@ void ewol::ContextMenu::OnRegenerateDisplay(void)
bool ewol::ContextMenu::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y) bool ewol::ContextMenu::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y)
{ {
if (NULL != m_subWidget) { if (NULL != m_subWidget) {
coord tmpSize = m_subWidget->GetSize(); coord2D_ts tmpSize = m_subWidget->GetSize();
coord tmpOrigin = m_subWidget->GetOrigin(); coord2D_ts tmpOrigin = m_subWidget->GetOrigin();
if( (tmpOrigin.x <= x && tmpOrigin.x + tmpSize.x >= x) if( (tmpOrigin.x <= x && tmpOrigin.x + tmpSize.x >= x)
&& (tmpOrigin.y <= y && tmpOrigin.y + tmpSize.y >= y) ) && (tmpOrigin.y <= y && tmpOrigin.y + tmpSize.y >= y) )
{ {

View File

@ -155,8 +155,8 @@ bool ewol::Menu::OnEventAreaExternal(int32_t widgetID, const char * generateEven
newPosition.y = y; newPosition.y = y;
ewol::Widget * eventFromWidget = ewol::widgetManager::Get(widgetID); ewol::Widget * eventFromWidget = ewol::widgetManager::Get(widgetID);
if (NULL != eventFromWidget) { if (NULL != eventFromWidget) {
coord tmpOri = eventFromWidget->GetOrigin(); coord2D_ts tmpOri = eventFromWidget->GetOrigin();
coord tmpSize = eventFromWidget->GetSize(); coord2D_ts tmpSize = eventFromWidget->GetSize();
// calculate the correct position // calculate the correct position
newPosition.x = tmpOri.x + tmpSize.x/2; newPosition.x = tmpOri.x + tmpSize.x/2;
newPosition.y = tmpOri.y + tmpSize.y; newPosition.y = tmpOri.y + tmpSize.y;

View File

@ -60,8 +60,8 @@ bool ewol::PopUp::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY)
m_size.y = availlableY; m_size.y = availlableY;
if (NULL != m_subWidget) { if (NULL != m_subWidget) {
coord subWidgetSize; coord2D_ts subWidgetSize;
coord subWidgetOrigin; coord2D_ts subWidgetOrigin;
subWidgetSize = m_subWidget->GetMinSize(); subWidgetSize = m_subWidget->GetMinSize();
if (true == m_subWidget->CanExpentX()) { if (true == m_subWidget->CanExpentX()) {
subWidgetSize.x = m_size.x; subWidgetSize.x = m_size.x;
@ -97,7 +97,7 @@ bool ewol::PopUp::CalculateMinSize(void)
m_minSize.y = 50.0; m_minSize.y = 50.0;
if (NULL != m_subWidget) { if (NULL != m_subWidget) {
m_subWidget->CalculateMinSize(); m_subWidget->CalculateMinSize();
coord tmpSize = m_subWidget->GetMinSize(); coord2D_ts tmpSize = m_subWidget->GetMinSize();
m_minSize.x = tmpSize.x; m_minSize.x = tmpSize.x;
m_minSize.y = tmpSize.y; m_minSize.y = tmpSize.y;
} }
@ -164,8 +164,8 @@ void ewol::PopUp::OnRegenerateDisplay(void)
BGOObjects->Rectangle(0, 0, m_size.x, m_size.y); BGOObjects->Rectangle(0, 0, m_size.x, m_size.y);
// set the area in white ... // set the area in white ...
if (NULL != m_subWidget) { if (NULL != m_subWidget) {
coord tmpSize = m_subWidget->GetSize(); coord2D_ts tmpSize = m_subWidget->GetSize();
coord tmpOrigin = m_subWidget->GetOrigin(); coord2D_ts tmpOrigin = m_subWidget->GetOrigin();
BGOObjects->SetColor(m_colorBackGroung); BGOObjects->SetColor(m_colorBackGroung);
BGOObjects->Rectangle(tmpOrigin.x, tmpOrigin.y, tmpSize.x, tmpSize.y); BGOObjects->Rectangle(tmpOrigin.x, tmpOrigin.y, tmpSize.x, tmpSize.y);
} }
@ -178,8 +178,8 @@ void ewol::PopUp::OnRegenerateDisplay(void)
bool ewol::PopUp::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y) bool ewol::PopUp::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, etkFloat_t x, etkFloat_t y)
{ {
if (NULL != m_subWidget) { if (NULL != m_subWidget) {
coord tmpSize = m_subWidget->GetSize(); coord2D_ts tmpSize = m_subWidget->GetSize();
coord tmpOrigin = m_subWidget->GetOrigin(); coord2D_ts tmpOrigin = m_subWidget->GetOrigin();
if( (tmpOrigin.x <= x && tmpOrigin.x + tmpSize.x >= x) if( (tmpOrigin.x <= x && tmpOrigin.x + tmpSize.x >= x)
&& (tmpOrigin.y <= y && tmpOrigin.y + tmpSize.y >= y) ) && (tmpOrigin.y <= y && tmpOrigin.y + tmpSize.y >= y) )
{ {

View File

@ -53,7 +53,7 @@ bool ewol::SizerHori::CalculateSize(etkFloat_t availlableX, etkFloat_t availlabl
int32_t nbWidgetNotFixedSize=0; int32_t nbWidgetNotFixedSize=0;
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) { for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
if (NULL != m_subWidget[iii]) { if (NULL != m_subWidget[iii]) {
coord tmpSize = m_subWidget[iii]->GetMinSize(); coord2D_ts tmpSize = m_subWidget[iii]->GetMinSize();
unexpendableSize += tmpSize.x; unexpendableSize += tmpSize.x;
if (false == m_subWidget[iii]->CanExpentX()) { if (false == m_subWidget[iii]->CanExpentX()) {
nbWidgetFixedSize++; nbWidgetFixedSize++;
@ -70,12 +70,12 @@ bool ewol::SizerHori::CalculateSize(etkFloat_t availlableX, etkFloat_t availlabl
sizeToAddAtEveryOne=0; sizeToAddAtEveryOne=0;
} }
} }
coord tmpOrigin; coord2D_ts tmpOrigin;
tmpOrigin.x = 0; tmpOrigin.x = 0;
tmpOrigin.y = 0; tmpOrigin.y = 0;
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) { for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
if (NULL != m_subWidget[iii]) { if (NULL != m_subWidget[iii]) {
coord tmpSize = m_subWidget[iii]->GetMinSize(); coord2D_ts tmpSize = m_subWidget[iii]->GetMinSize();
// Set the origin : // Set the origin :
//EWOL_DEBUG("Set ORIGIN : " << tmpOrigin.x << "," << tmpOrigin.y << ")"); //EWOL_DEBUG("Set ORIGIN : " << tmpOrigin.x << "," << tmpOrigin.y << ")");
m_subWidget[iii]->SetOrigin(tmpOrigin.x, tmpOrigin.y); m_subWidget[iii]->SetOrigin(tmpOrigin.x, tmpOrigin.y);
@ -110,7 +110,7 @@ bool ewol::SizerHori::CalculateMinSize(void)
if (true == m_subWidget[iii]->CanExpentY()) { if (true == m_subWidget[iii]->CanExpentY()) {
m_userExpendY = true; m_userExpendY = true;
} }
coord tmpSize = m_subWidget[iii]->GetMinSize(); coord2D_ts tmpSize = m_subWidget[iii]->GetMinSize();
m_minSize.x += tmpSize.x; m_minSize.x += tmpSize.x;
if (tmpSize.y>m_minSize.y) { if (tmpSize.y>m_minSize.y) {
m_minSize.y = tmpSize.y; m_minSize.y = tmpSize.y;
@ -239,8 +239,8 @@ bool ewol::SizerHori::OnEventInput(int32_t IdInput, eventInputType_te typeEvent,
{ {
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) { for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
if (NULL != m_subWidget[iii]) { if (NULL != m_subWidget[iii]) {
coord tmpSize = m_subWidget[iii]->GetSize(); coord2D_ts tmpSize = m_subWidget[iii]->GetSize();
coord tmpOrigin = m_subWidget[iii]->GetOrigin(); coord2D_ts tmpOrigin = m_subWidget[iii]->GetOrigin();
if( (tmpOrigin.x <= x && tmpOrigin.x + tmpSize.x >= x) if( (tmpOrigin.x <= x && tmpOrigin.x + tmpSize.x >= x)
&& (tmpOrigin.y <= y && tmpOrigin.y + tmpSize.y >= y) ) && (tmpOrigin.y <= y && tmpOrigin.y + tmpSize.y >= y) )
{ {

View File

@ -54,7 +54,7 @@ bool ewol::SizerVert::CalculateSize(etkFloat_t availlableX, etkFloat_t availlabl
int32_t nbWidgetNotFixedSize=0; int32_t nbWidgetNotFixedSize=0;
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) { for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
if (NULL != m_subWidget[iii]) { if (NULL != m_subWidget[iii]) {
coord tmpSize = m_subWidget[iii]->GetMinSize(); coord2D_ts tmpSize = m_subWidget[iii]->GetMinSize();
unexpendableSize += tmpSize.y; unexpendableSize += tmpSize.y;
if (false == m_subWidget[iii]->CanExpentY()) { if (false == m_subWidget[iii]->CanExpentY()) {
nbWidgetFixedSize++; nbWidgetFixedSize++;
@ -72,12 +72,12 @@ bool ewol::SizerVert::CalculateSize(etkFloat_t availlableX, etkFloat_t availlabl
sizeToAddAtEveryOne=0; sizeToAddAtEveryOne=0;
} }
} }
coord tmpOrigin; coord2D_ts tmpOrigin;
tmpOrigin.x = 0; tmpOrigin.x = 0;
tmpOrigin.y = 0; tmpOrigin.y = 0;
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) { for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
if (NULL != m_subWidget[iii]) { if (NULL != m_subWidget[iii]) {
coord tmpSize = m_subWidget[iii]->GetMinSize(); coord2D_ts tmpSize = m_subWidget[iii]->GetMinSize();
// Set the origin : // Set the origin :
//EWOL_DEBUG("Set ORIGIN : " << tmpOrigin.x << "," << tmpOrigin.y << ")"); //EWOL_DEBUG("Set ORIGIN : " << tmpOrigin.x << "," << tmpOrigin.y << ")");
m_subWidget[iii]->SetOrigin(tmpOrigin.x, tmpOrigin.y); m_subWidget[iii]->SetOrigin(tmpOrigin.x, tmpOrigin.y);
@ -112,7 +112,7 @@ bool ewol::SizerVert::CalculateMinSize(void)
if (true == m_subWidget[iii]->CanExpentY()) { if (true == m_subWidget[iii]->CanExpentY()) {
m_userExpendY = true; m_userExpendY = true;
} }
coord tmpSize = m_subWidget[iii]->GetMinSize(); coord2D_ts tmpSize = m_subWidget[iii]->GetMinSize();
//EWOL_DEBUG(" Get minSize[" << iii << "] ("<< tmpSize.x << "," << tmpSize.y << ")"); //EWOL_DEBUG(" Get minSize[" << iii << "] ("<< tmpSize.x << "," << tmpSize.y << ")");
m_minSize.y += tmpSize.y; m_minSize.y += tmpSize.y;
if (tmpSize.x>m_minSize.x) { if (tmpSize.x>m_minSize.x) {
@ -239,8 +239,8 @@ bool ewol::SizerVert::OnEventInput(int32_t IdInput, eventInputType_te typeEvent,
{ {
for (int32_t iii=0; iii<m_subWidget.Size(); iii++) { for (int32_t iii=0; iii<m_subWidget.Size(); iii++) {
if (NULL != m_subWidget[iii]) { if (NULL != m_subWidget[iii]) {
coord tmpSize = m_subWidget[iii]->GetSize(); coord2D_ts tmpSize = m_subWidget[iii]->GetSize();
coord tmpOrigin = m_subWidget[iii]->GetOrigin(); coord2D_ts tmpOrigin = m_subWidget[iii]->GetOrigin();
if( (tmpOrigin.x <= x && tmpOrigin.x + tmpSize.x >= x) if( (tmpOrigin.x <= x && tmpOrigin.x + tmpSize.x >= x)
&& (tmpOrigin.y <= y && tmpOrigin.y + tmpSize.y >= y) ) && (tmpOrigin.y <= y && tmpOrigin.y + tmpSize.y >= y) )
{ {

View File

@ -44,11 +44,11 @@ namespace ewol {
class WidgetScrooled : virtual public ewol::Widget class WidgetScrooled : virtual public ewol::Widget
{ {
protected: protected:
coord m_originScrooled; coord2D_ts m_originScrooled;
coord m_maxSize; coord2D_ts m_maxSize;
private: private:
etkFloat_t m_pixelScrolling; etkFloat_t m_pixelScrolling;
coord m_highSpeedStartPos; coord2D_ts m_highSpeedStartPos;
highSpeedMode_te m_highSpeedMode; highSpeedMode_te m_highSpeedMode;
public: public:
WidgetScrooled(void); WidgetScrooled(void);

View File

@ -62,7 +62,10 @@ ewol::Keyboard::Keyboard(void)
ewol::Keyboard::~Keyboard(void) ewol::Keyboard::~Keyboard(void)
{ {
if (NULL != m_subWidget) {
ewol::widgetManager::MarkWidgetToBeRemoved(m_subWidget);
m_subWidget = NULL;
}
} }
#define ADD_BUTTON(upperWidget,widget,text,event) do { \ #define ADD_BUTTON(upperWidget,widget,text,event) do { \
@ -231,7 +234,7 @@ bool ewol::Keyboard::CalculateSize(etkFloat_t availlableX, etkFloat_t availlable
m_size.y = availlableY; m_size.y = availlableY;
if (NULL != m_subWidget) { if (NULL != m_subWidget) {
coord subWidgetSize; coord2D_ts subWidgetSize;
subWidgetSize = m_subWidget->GetMinSize(); subWidgetSize = m_subWidget->GetMinSize();
if (true == m_subWidget->CanExpentX()) { if (true == m_subWidget->CanExpentX()) {
subWidgetSize.x = m_size.x; subWidgetSize.x = m_size.x;
@ -243,7 +246,7 @@ bool ewol::Keyboard::CalculateSize(etkFloat_t availlableX, etkFloat_t availlable
subWidgetSize.x = (int32_t)subWidgetSize.x; subWidgetSize.x = (int32_t)subWidgetSize.x;
subWidgetSize.y = (int32_t)subWidgetSize.y; subWidgetSize.y = (int32_t)subWidgetSize.y;
m_subWidget->SetOrigin(m_origin.x, m_origin.y); m_subWidget->SetOrigin(0, 0);
m_subWidget->CalculateSize(subWidgetSize.x, subWidgetSize.y); m_subWidget->CalculateSize(subWidgetSize.x, subWidgetSize.y);
} }
MarkToReedraw(); MarkToReedraw();
@ -259,7 +262,7 @@ bool ewol::Keyboard::CalculateMinSize(void)
m_minSize.y = 50.0; m_minSize.y = 50.0;
if (NULL != m_subWidget) { if (NULL != m_subWidget) {
m_subWidget->CalculateMinSize(); m_subWidget->CalculateMinSize();
coord tmpSize = m_subWidget->GetMinSize(); coord2D_ts tmpSize = m_subWidget->GetMinSize();
m_minSize.x = tmpSize.x; m_minSize.x = tmpSize.x;
m_minSize.y = tmpSize.y; m_minSize.y = tmpSize.y;
} }