Add the type of the EObject to permit the debug of the static cast of the classe

This commit is contained in:
Edouard Dupin 2012-03-13 14:36:28 +01:00
parent 0ff213243f
commit 3e8b03ebf9
47 changed files with 1477 additions and 32 deletions

View File

@ -70,5 +70,13 @@ extern const char * ewolLibName;
# define EWOL_CHECK_INOUT(cond) do { } while (0) # define EWOL_CHECK_INOUT(cond) do { } while (0)
#endif #endif
// Main define for the check casting of the class in EWOL
#if EWOL_DEBUG_LEVEL > 2
# define EWOL_CAST(eObjectType,eObjectClass,curentPointer) (NULL==curentPointer) ? NULL : (curentPointer->CheckObjectType(eObjectType)) ? static_cast<eObjectClass*>(curentPointer) : NULL
#else
# define EWOL_CAST(eObjectType,eObjectClass,curentPointer) static_cast<eObjectClass*>(curentPointer)
#endif
#endif #endif

View File

@ -37,7 +37,6 @@ extern "C" {
} messageList_ts; } messageList_ts;
}; };
// internal element of the widget manager : // internal element of the widget manager :
static etk::VectorType<messageList_ts> m_messageList; // all widget allocated ==> all time increment ... never removed ... static etk::VectorType<messageList_ts> m_messageList; // all widget allocated ==> all time increment ... never removed ...
@ -161,6 +160,39 @@ int32_t ewol::EObject::GetId(void)
return m_uniqueId; return m_uniqueId;
}; };
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT = "EObject";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::EObject::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT) {
return true;
} else {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::EObject::GetObjectType(void)
{
return ewol::TYPE_EOBJECT;
}
/** /**
* @brief Add a specific event Id in the list to prevent wrong link on a EObject * @brief Add a specific event Id in the list to prevent wrong link on a EObject
@ -234,8 +266,26 @@ void ewol::EObject::RegisterOnEvent(ewol::EObject * destinationObject, const cha
EWOL_ERROR("Input ERROR NULL pointer Event Id..."); EWOL_ERROR("Input ERROR NULL pointer Event Id...");
return; return;
} }
if (NULL == eventIdgenerated) { // check if event existed :
EWOL_ERROR("Input ERROR NULL pointer destination Event Id..."); bool findIt = false;
for(int32_t iii=0; iii<m_availlableEventId.Size(); iii++) {
if (m_availlableEventId[iii] == eventId) {
findIt = true;
break;
}
}
if (false == findIt) {
EWOL_DEBUG("Try to register with a NON direct string name");
for(int32_t iii=0; iii<m_availlableEventId.Size(); iii++) {
if (0 == strncmp(m_availlableEventId[iii], eventId, 1024)) {
findIt = true;
eventIdgenerated = m_availlableEventId[iii];
break;
}
}
}
if (false == findIt) {
EWOL_ERROR("Can not register event on this WidgetType=" << GetObjectType() << " event=\"" << eventId << "\" ==> unknow event");
return; return;
} }
ewol::EventExtGen * tmpEvent = new ewol::EventExtGen(); ewol::EventExtGen * tmpEvent = new ewol::EventExtGen();
@ -245,7 +295,11 @@ void ewol::EObject::RegisterOnEvent(ewol::EObject * destinationObject, const cha
} }
tmpEvent->localEventId = eventId; tmpEvent->localEventId = eventId;
tmpEvent->destEObject = destinationObject; tmpEvent->destEObject = destinationObject;
tmpEvent->destEventId = eventIdgenerated; if (NULL != eventIdgenerated) {
tmpEvent->destEventId = eventIdgenerated;
} else {
tmpEvent->destEventId = eventId;
}
tmpEvent->destData = data; tmpEvent->destData = data;
m_externEvent.PushBack(tmpEvent); m_externEvent.PushBack(tmpEvent);
} }

View File

@ -36,7 +36,6 @@ namespace ewol {
void AnonymousSend(const char* const messageId, etk::UString& data); void AnonymousSend(const char* const messageId, etk::UString& data);
}; };
class EObject; class EObject;
/** /**
* local class for event generation * local class for event generation
@ -78,6 +77,21 @@ namespace ewol {
*/ */
int32_t GetId(void); int32_t GetId(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
protected: protected:
/** /**
* @brief Add a specific event Id in the list to prevent wrong link on a EObject * @brief Add a specific event Id in the list to prevent wrong link on a EObject
@ -135,12 +149,12 @@ namespace ewol {
* @return --- * @return ---
*/ */
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data); virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
}; };
extern const char * const TYPE_EOBJECT;
}; };
#define EWOL_CAST_EOBJECT(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT,ewol::EObject,curentPointer)
#endif #endif

View File

@ -104,6 +104,43 @@ ewol::Widget::Widget(void)
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET = "Widget";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::Widget::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET) {
return true;
} else {
if(true == ewol::EObject::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::Widget::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET;
}
/** /**
* @brief This will be equivalent at the destructor @ref ~Widget * @brief This will be equivalent at the destructor @ref ~Widget
* @note this fuction "mark" the widget as removed an inform the widget manager that the widget has been removed by the user. * @note this fuction "mark" the widget as removed an inform the widget manager that the widget has been removed by the user.

View File

@ -117,6 +117,21 @@ namespace ewol {
*/ */
// TODO : Set this in private if possible ... // TODO : Set this in private if possible ...
virtual ~Widget(void) { }; virtual ~Widget(void) { };
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
/** /**
* @brief This will be equivalent at the destructor @ref ~Widget * @brief This will be equivalent at the destructor @ref ~Widget
* @note this fuction "mark" the widget as removed an inform the widget manager that the widget has been removed by the user. * @note this fuction "mark" the widget as removed an inform the widget manager that the widget has been removed by the user.
@ -398,6 +413,11 @@ namespace ewol {
virtual void OnRegenerateDisplay(void) { }; virtual void OnRegenerateDisplay(void) { };
}; // end of the class Widget declaration }; // end of the class Widget declaration
extern const char * const TYPE_EOBJECT_WIDGET;
};// end of namespace };// end of namespace
#define EWOL_CAST_WIDGET(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET,ewol::Widget,curentPointer)
#endif #endif

View File

@ -75,6 +75,44 @@ ewol::Windows::~Windows(void)
} }
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_WINDOWS = "Windows";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::Windows::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_WINDOWS << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_WINDOWS) {
return true;
} else {
if(true == ewol::Widget::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_WINDOWS << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::Windows::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_WINDOWS;
}
bool ewol::Windows::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY) bool ewol::Windows::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY)
{ {
//EWOL_DEBUG("calculateMinSize on : " << m_currentCreateId); //EWOL_DEBUG("calculateMinSize on : " << m_currentCreateId);

View File

@ -38,6 +38,21 @@ namespace ewol {
public: public:
Windows(void); Windows(void);
virtual ~Windows(void); virtual ~Windows(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
// internal event at ewol system : // internal event at ewol system :
public: public:
void SysDraw(void); void SysDraw(void);
@ -100,7 +115,11 @@ namespace ewol {
*/ */
virtual void OnObjectRemove(ewol::EObject * removeObject); virtual void OnObjectRemove(ewol::EObject * removeObject);
}; };
extern const char * const TYPE_EOBJECT_WIDGET_WINDOWS;
}; };
#define EWOL_CAST_WIDGET_WINDOWS(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_WINDOWS,ewol::Windows,curentPointer)
#endif #endif

View File

@ -84,6 +84,45 @@ ewol::Button::~Button(void)
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_BUTTON = "Button";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::Button::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_BUTTON << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_BUTTON) {
return true;
} else {
if(true == ewol::Drawable::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_BUTTON << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::Button::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_BUTTON;
}
void ewol::Button::SetPadding(coord2D_ts newPadding) void ewol::Button::SetPadding(coord2D_ts newPadding)
{ {
m_padding = newPadding; m_padding = newPadding;
@ -199,6 +238,7 @@ bool ewol::Button::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, co
|| ewol::EVENT_INPUT_TYPE_DOUBLE == typeEvent || ewol::EVENT_INPUT_TYPE_DOUBLE == typeEvent
|| ewol::EVENT_INPUT_TYPE_TRIPLE == typeEvent) { || ewol::EVENT_INPUT_TYPE_TRIPLE == typeEvent) {
// nothing to do ... // nothing to do ...
//EWOL_DEBUG(" ==> generate event : " << ewolEventButtonPressed);
GenerateEventId(ewolEventButtonPressed); GenerateEventId(ewolEventButtonPressed);
MarkToReedraw(); MarkToReedraw();
return true; return true;

View File

@ -43,6 +43,21 @@ namespace ewol {
public: public:
Button(void); Button(void);
Button(etk::UString newLabel); Button(etk::UString newLabel);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
void Init(void); void Init(void);
virtual ~Button(void); virtual ~Button(void);
virtual bool CalculateMinSize(void); virtual bool CalculateMinSize(void);
@ -72,6 +87,10 @@ namespace ewol {
virtual bool OnEventInput(int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos); virtual bool OnEventInput(int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos);
virtual bool OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData); virtual bool OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData);
}; };
extern const char * const TYPE_EOBJECT_WIDGET_BUTTON;
}; };
#define EWOL_CAST_WIDGET_BUTTON(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_BUTTON,ewol::Button,curentPointer)
#endif #endif

View File

@ -79,6 +79,45 @@ ewol::ButtonColor::~ButtonColor(void)
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_BUTTON_COLOR = "ButtonColor";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::ButtonColor::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_BUTTON_COLOR << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_BUTTON_COLOR) {
return true;
} else {
if(true == ewol::Drawable::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_BUTTON_COLOR << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::ButtonColor::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_BUTTON_COLOR;
}
void ewol::ButtonColor::SetPadding(coord2D_ts newPadding) void ewol::ButtonColor::SetPadding(coord2D_ts newPadding)
{ {
m_padding = newPadding; m_padding = newPadding;
@ -262,20 +301,21 @@ void ewol::ButtonColor::OnReceiveMessage(ewol::EObject * CallerObject, const cha
{ {
if (eventId == ewolEventColorChooserChange) { if (eventId == ewolEventColorChooserChange) {
//==> this is an internal event ... //==> this is an internal event ...
ewol::ColorChooser * myColorChooser = static_cast<ewol::ColorChooser *>(CallerObject); ewol::ColorChooser * myColorChooser = EWOL_CAST_WIDGET_COLOR_CHOOSER(CallerObject);
if (NULL != myColorChooser) {
color_ts tmpColor = myColorChooser->GetColor(); color_ts tmpColor = myColorChooser->GetColor();
m_selectedColor = tmpColor; m_selectedColor = tmpColor;
m_textColorBg = m_selectedColor; m_textColorBg = m_selectedColor;
char colorText[256]; char colorText[256];
sprintf(colorText, "#%02X%02X%02X%02X", sprintf(colorText, "#%02X%02X%02X%02X",
(uint8_t)(tmpColor.red * 0xFF), (uint8_t)(tmpColor.red * 0xFF),
(uint8_t)(tmpColor.green * 0xFF), (uint8_t)(tmpColor.green * 0xFF),
(uint8_t)(tmpColor.blue * 0xFF), (uint8_t)(tmpColor.blue * 0xFF),
(uint8_t)(tmpColor.alpha * 0xFF)); (uint8_t)(tmpColor.alpha * 0xFF));
//set the new label ... //set the new label ...
SetLabel(colorText); SetLabel(colorText);
GenerateEventId(ewolEventButtonColorChange); GenerateEventId(ewolEventButtonColorChange);
}
} }
} }

View File

@ -39,6 +39,21 @@ namespace ewol {
public: public:
ButtonColor(void); ButtonColor(void);
ButtonColor(etk::UString newLabel); ButtonColor(etk::UString newLabel);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
void Init(void); void Init(void);
virtual ~ButtonColor(void); virtual ~ButtonColor(void);
virtual bool CalculateMinSize(void); virtual bool CalculateMinSize(void);
@ -79,6 +94,10 @@ namespace ewol {
*/ */
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data); virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
}; };
extern const char * const TYPE_EOBJECT_WIDGET_BUTTON_COLOR;
}; };
#define EWOL_CAST_WIDGET_BUTTON_COLOR(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_BUTTON_COLOR,ewol::ButtonColor,curentPointer)
#endif #endif

View File

@ -69,6 +69,45 @@ ewol::CheckBox::~CheckBox(void)
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_CHECKBOX = "CheckBox";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::CheckBox::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_CHECKBOX << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_CHECKBOX) {
return true;
} else {
if(true == ewol::Drawable::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_CHECKBOX << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::CheckBox::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_CHECKBOX;
}
bool ewol::CheckBox::CalculateMinSize(void) bool ewol::CheckBox::CalculateMinSize(void)
{ {
int32_t fontId = GetDefaultFontId(); int32_t fontId = GetDefaultFontId();

View File

@ -37,6 +37,21 @@ namespace ewol {
public: public:
CheckBox(void); CheckBox(void);
CheckBox(etk::UString newLabel); CheckBox(etk::UString newLabel);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
void Init(void); void Init(void);
virtual ~CheckBox(void); virtual ~CheckBox(void);
virtual bool CalculateMinSize(void); virtual bool CalculateMinSize(void);
@ -62,6 +77,11 @@ namespace ewol {
virtual bool OnEventInput(int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos); virtual bool OnEventInput(int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos);
virtual bool OnEventKb(eventKbType_te typeEvent, uniChar_t unicodeData); virtual bool OnEventKb(eventKbType_te typeEvent, uniChar_t unicodeData);
}; };
extern const char * const TYPE_EOBJECT_WIDGET_CHECKBOX;
}; };
#define EWOL_CAST_WIDGET_CHECKBOX(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_CHECKBOX,ewol::CheckBox,curentPointer)
#endif #endif

View File

@ -60,6 +60,45 @@ ewol::ColorBar::~ColorBar(void)
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_COLOR_BAR = "ColorBar";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::ColorBar::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_COLOR_BAR << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_COLOR_BAR) {
return true;
} else {
if(true == ewol::Drawable::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_COLOR_BAR << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::ColorBar::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_COLOR_BAR;
}
bool ewol::ColorBar::CalculateMinSize(void) bool ewol::ColorBar::CalculateMinSize(void)
{ {
m_minSize.x = 80; m_minSize.x = 80;

View File

@ -37,6 +37,21 @@ namespace ewol {
public: public:
ColorBar(void); ColorBar(void);
virtual ~ColorBar(void); virtual ~ColorBar(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
virtual bool CalculateMinSize(void); virtual bool CalculateMinSize(void);
color_ts GetCurrentColor(void); color_ts GetCurrentColor(void);
void SetCurrentColor(color_ts newOne); void SetCurrentColor(color_ts newOne);
@ -57,6 +72,11 @@ namespace ewol {
*/ */
virtual bool OnEventInput(int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos); virtual bool OnEventInput(int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos);
}; };
extern const char * const TYPE_EOBJECT_WIDGET_COLOR_BAR;
}; };
#define EWOL_CAST_WIDGET_COLOR_BAR(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_COLOR_BAR,ewol::ColorBar,curentPointer)
#endif #endif

View File

@ -61,6 +61,45 @@ ewol::ContextMenu::~ContextMenu(void)
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_CONTEXT_MENU = "ContextMenu";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::ContextMenu::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_CONTEXT_MENU << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_CONTEXT_MENU) {
return true;
} else {
if(true == ewol::EObject::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_CONTEXT_MENU << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::ContextMenu::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_CONTEXT_MENU;
}
bool ewol::ContextMenu::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY) bool ewol::ContextMenu::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY)
{ {
EWOL_DEBUG("CalculateSize(" << availlableX << "," << availlableY << ")"); EWOL_DEBUG("CalculateSize(" << availlableX << "," << availlableY << ")");

View File

@ -43,6 +43,21 @@ namespace ewol {
public: public:
ContextMenu(void); ContextMenu(void);
virtual ~ContextMenu(void); virtual ~ContextMenu(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
public: public:
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 ...
virtual bool CalculateMinSize(void); //update the min Size ... and the expend parameters for the sizer virtual bool CalculateMinSize(void); //update the min Size ... and the expend parameters for the sizer
@ -89,6 +104,11 @@ namespace ewol {
*/ */
virtual void OnFlipFlopEvent(void); virtual void OnFlipFlopEvent(void);
}; };
extern const char * const TYPE_EOBJECT_WIDGET_CONTEXT_MENU;
}; };
#define EWOL_CAST_WIDGET_CONTEXT_MENU(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_CONTEXT_MENU,ewol::ContextMenu,curentPointer)
#endif #endif

View File

@ -43,6 +43,45 @@ ewol::Drawable::~Drawable(void)
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_DRAWABLE = "Drawable";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::Drawable::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_DRAWABLE << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_DRAWABLE) {
return true;
} else {
if(true == ewol::Widget::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_DRAWABLE << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::Drawable::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_DRAWABLE;
}
void ewol::Drawable::AddOObject(ewol::OObject* newObject, int32_t pos) void ewol::Drawable::AddOObject(ewol::OObject* newObject, int32_t pos)
{ {
if (NULL == newObject) { if (NULL == newObject) {

View File

@ -34,6 +34,21 @@ namespace ewol {
public: public:
Drawable(void); Drawable(void);
virtual ~Drawable(void); virtual ~Drawable(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
private: private:
etk::VectorType<ewol::OObject*> m_listOObject[NB_BOUBLE_BUFFER]; //!< generic element to display... etk::VectorType<ewol::OObject*> m_listOObject[NB_BOUBLE_BUFFER]; //!< generic element to display...
@ -43,8 +58,13 @@ namespace ewol {
protected: protected:
virtual void OnDraw(void); virtual void OnDraw(void);
}; };
extern const char * const TYPE_EOBJECT_WIDGET_DRAWABLE;
}; };
#define EWOL_CAST_WIDGET_DRAWABLE(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_DRAWABLE,ewol::Drawable,curentPointer)
#endif #endif

View File

@ -85,6 +85,45 @@ ewol::Entry::~Entry(void)
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_ENTRY = "Entry";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::Entry::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_ENTRY << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_ENTRY) {
return true;
} else {
if(true == ewol::Drawable::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_ENTRY << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::Entry::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_ENTRY;
}
bool ewol::Entry::CalculateMinSize(void) bool ewol::Entry::CalculateMinSize(void)
{ {
int32_t fontId = GetDefaultFontId(); int32_t fontId = GetDefaultFontId();

View File

@ -40,6 +40,21 @@ namespace ewol {
Entry(void); Entry(void);
Entry(etk::UString newData); Entry(etk::UString newData);
virtual ~Entry(void); virtual ~Entry(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
void Init(void); void Init(void);
virtual bool CalculateMinSize(void); virtual bool CalculateMinSize(void);
void SetValue(etk::UString newData); void SetValue(etk::UString newData);
@ -76,6 +91,11 @@ namespace ewol {
virtual void OnGetFocus(void); virtual void OnGetFocus(void);
virtual void OnLostFocus(void); virtual void OnLostFocus(void);
}; };
extern const char * const TYPE_EOBJECT_WIDGET_ENTRY;
}; };
#define EWOL_CAST_WIDGET_ENTRY(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_ENTRY,ewol::Entry,curentPointer)
#endif #endif

View File

@ -64,6 +64,45 @@ ewol::Label::~Label(void)
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_LABEL = "Label";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::Label::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_LABEL << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_LABEL) {
return true;
} else {
if(true == ewol::Drawable::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_LABEL << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::Label::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_LABEL;
}
bool ewol::Label::CalculateMinSize(void) bool ewol::Label::CalculateMinSize(void)
{ {
int32_t fontId = GetDefaultFontId(); int32_t fontId = GetDefaultFontId();

View File

@ -37,6 +37,21 @@ namespace ewol {
public: public:
Label(void); Label(void);
Label(etk::UString newLabel); Label(etk::UString newLabel);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
void Init(void); void Init(void);
virtual ~Label(void); virtual ~Label(void);
virtual bool CalculateMinSize(void); virtual bool CalculateMinSize(void);
@ -57,6 +72,11 @@ namespace ewol {
*/ */
virtual bool OnEventInput(int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos); virtual bool OnEventInput(int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos);
}; };
extern const char * const TYPE_EOBJECT_WIDGET_LABEL;
}; };
#define EWOL_CAST_WIDGET_LABEL(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_LABEL,ewol::Label,curentPointer)
#endif #endif

View File

@ -60,6 +60,45 @@ ewol::List::~List(void)
} }
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_LIST = "List";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::List::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_LIST << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_LIST) {
return true;
} else {
if(true == ewol::WidgetScrooled::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_LIST << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::List::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_LIST;
}
bool ewol::List::CalculateMinSize(void) bool ewol::List::CalculateMinSize(void)
{ {
/*int32_t fontId = GetDefaultFontId(); /*int32_t fontId = GetDefaultFontId();

View File

@ -36,6 +36,21 @@ namespace ewol {
public: public:
List(void); List(void);
void Init(void); void Init(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
virtual ~List(void); virtual ~List(void);
virtual bool CalculateMinSize(void); virtual bool CalculateMinSize(void);
void SetLabel(etk::UString newLabel); void SetLabel(etk::UString newLabel);
@ -110,6 +125,11 @@ namespace ewol {
virtual void OnGetFocus(void); virtual void OnGetFocus(void);
virtual void OnLostFocus(void); virtual void OnLostFocus(void);
}; };
extern const char * const TYPE_EOBJECT_WIDGET_LIST;
}; };
#define EWOL_CAST_WIDGET_LIST(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_LIST,ewol::List,curentPointer)
#endif #endif

View File

@ -46,6 +46,45 @@ ewol::Menu::~Menu(void)
Clear(); Clear();
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_MENU = "Menu";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::Menu::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_MENU << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_MENU) {
return true;
} else {
if(true == ewol::SizerHori::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_MENU << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::Menu::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_MENU;
}
void ewol::Menu::SubWidgetRemoveAll(void) void ewol::Menu::SubWidgetRemoveAll(void)
{ {
EWOL_ERROR("Not availlable"); EWOL_ERROR("Not availlable");
@ -166,7 +205,7 @@ void ewol::Menu::OnReceiveMessage(ewol::EObject * CallerObject, const char * eve
} }
// Get the button widget : // Get the button widget :
coord2D_ts newPosition; coord2D_ts newPosition;
ewol::Widget * eventFromWidget = static_cast<ewol::Widget*>(CallerObject); ewol::Widget * eventFromWidget = EWOL_CAST_WIDGET(CallerObject);
if (NULL != eventFromWidget) { if (NULL != eventFromWidget) {
coord2D_ts tmpOri = eventFromWidget->GetOrigin(); coord2D_ts tmpOri = eventFromWidget->GetOrigin();
coord2D_ts tmpSize = eventFromWidget->GetSize(); coord2D_ts tmpSize = eventFromWidget->GetSize();

View File

@ -49,6 +49,21 @@ namespace ewol {
public: public:
Menu(void); Menu(void);
virtual ~Menu(void); virtual ~Menu(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
private: private:
virtual void SubWidgetRemoveAll(void); virtual void SubWidgetRemoveAll(void);
virtual void SubWidgetAdd(ewol::Widget* newWidget); virtual void SubWidgetAdd(ewol::Widget* newWidget);
@ -73,6 +88,11 @@ namespace ewol {
*/ */
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data); virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
}; };
extern const char * const TYPE_EOBJECT_WIDGET_MENU;
}; };
#define EWOL_CAST_WIDGET_MENU(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_MENU,ewol::Menu,curentPointer)
#endif #endif

View File

@ -52,6 +52,45 @@ ewol::PopUp::~PopUp(void)
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_POP_UP = "PopUp";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::PopUp::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_POP_UP << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_POP_UP) {
return true;
} else {
if(true == ewol::Drawable::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_POP_UP << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::PopUp::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_POP_UP;
}
bool ewol::PopUp::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY) bool ewol::PopUp::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY)
{ {
//EWOL_DEBUG("CalculateSize(" << availlableX << "," << availlableY << ")"); //EWOL_DEBUG("CalculateSize(" << availlableX << "," << availlableY << ")");

View File

@ -36,6 +36,21 @@ namespace ewol {
public: public:
PopUp(void); PopUp(void);
virtual ~PopUp(void); virtual ~PopUp(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
public: public:
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 ...
virtual bool CalculateMinSize(void); //update the min Size ... and the expend parameters for the sizer virtual bool CalculateMinSize(void); //update the min Size ... and the expend parameters for the sizer
@ -77,6 +92,11 @@ namespace ewol {
*/ */
virtual void OnObjectRemove(ewol::EObject * removeObject); virtual void OnObjectRemove(ewol::EObject * removeObject);
}; };
extern const char * const TYPE_EOBJECT_WIDGET_POP_UP;
}; };
#define EWOL_CAST_WIDGET_POP_UP(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_POP_UP,ewol::PopUp,curentPointer)
#endif #endif

View File

@ -42,6 +42,45 @@ ewol::SizerHori::~SizerHori(void)
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_SIZER_HORI = "SizerHori";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::SizerHori::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_SIZER_HORI << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_SIZER_HORI) {
return true;
} else {
if(true == ewol::Widget::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_SIZER_HORI << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::SizerHori::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_SIZER_HORI;
}
bool ewol::SizerHori::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY) bool ewol::SizerHori::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY)
{ {
//EWOL_DEBUG("Update Size"); //EWOL_DEBUG("Update Size");

View File

@ -35,6 +35,21 @@ namespace ewol {
public: public:
SizerHori(void); SizerHori(void);
virtual ~SizerHori(void); virtual ~SizerHori(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
public: public:
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 ...
virtual bool CalculateMinSize(void); //update the min Size ... and the expend parameters for the sizer virtual bool CalculateMinSize(void); //update the min Size ... and the expend parameters for the sizer
@ -77,6 +92,11 @@ namespace ewol {
*/ */
virtual void OnObjectRemove(ewol::EObject * removeObject); virtual void OnObjectRemove(ewol::EObject * removeObject);
}; };
extern const char * const TYPE_EOBJECT_WIDGET_SIZER_HORI;
}; };
#define EWOL_CAST_WIDGET_SIZER_HORI(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_SIZER_HORI,ewol::SizerHori,curentPointer)
#endif #endif

View File

@ -43,6 +43,45 @@ ewol::SizerVert::~SizerVert(void)
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_SIZER_VERT = "SizerVert";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::SizerVert::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_SIZER_VERT << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_SIZER_VERT) {
return true;
} else {
if(true == ewol::Widget::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_SIZER_VERT << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::SizerVert::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_SIZER_VERT;
}
bool ewol::SizerVert::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY) bool ewol::SizerVert::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY)
{ {
//EWOL_DEBUG("Update Size"); //EWOL_DEBUG("Update Size");

View File

@ -35,6 +35,21 @@ namespace ewol {
public: public:
SizerVert(void); SizerVert(void);
virtual ~SizerVert(void); virtual ~SizerVert(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
public: public:
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 ...
virtual bool CalculateMinSize(void); //update the min Size ... and the expend parameters for the sizer virtual bool CalculateMinSize(void); //update the min Size ... and the expend parameters for the sizer
@ -78,6 +93,11 @@ namespace ewol {
*/ */
virtual void OnObjectRemove(ewol::EObject * removeObject); virtual void OnObjectRemove(ewol::EObject * removeObject);
}; };
extern const char * const TYPE_EOBJECT_WIDGET_SIZER_VERT;
}; };
#define EWOL_CAST_WIDGET_SIZER_VERT(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_SIZER_VERT,ewol::SizerVert,curentPointer)
#endif #endif

View File

@ -63,6 +63,45 @@ ewol::Slider::~Slider(void)
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_SLIDER = "Slider";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::Slider::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_SLIDER << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_SLIDER) {
return true;
} else {
if(true == ewol::Drawable::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_SLIDER << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::Slider::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_SLIDER;
}
bool ewol::Slider::CalculateMinSize(void) bool ewol::Slider::CalculateMinSize(void)
{ {

View File

@ -37,6 +37,21 @@ namespace ewol {
public: public:
Slider(void); Slider(void);
virtual ~Slider(void); virtual ~Slider(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
virtual bool CalculateMinSize(void); virtual bool CalculateMinSize(void);
void SetValue(int32_t val); void SetValue(int32_t val);
int32_t GetValue(void); int32_t GetValue(void);
@ -62,6 +77,11 @@ namespace ewol {
*/ */
virtual bool OnEventInput(int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos); virtual bool OnEventInput(int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos);
}; };
extern const char * const TYPE_EOBJECT_WIDGET_SLIDER;
}; };
#define EWOL_CAST_WIDGET_SLIDER(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_SLIDER,ewol::Slider,curentPointer)
#endif #endif

View File

@ -43,6 +43,45 @@ ewol::Spacer::~Spacer(void)
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_SPACER = "Spacer";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::Spacer::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_SPACER << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_SPACER) {
return true;
} else {
if(true == ewol::Drawable::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_SPACER << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::Spacer::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_SPACER;
}
bool ewol::Spacer::CalculateMinSize(void) bool ewol::Spacer::CalculateMinSize(void)
{ {
m_minSize.x = m_size; m_minSize.x = m_size;

View File

@ -35,11 +35,31 @@ namespace ewol {
public: public:
Spacer(void); Spacer(void);
virtual ~Spacer(void); virtual ~Spacer(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
virtual bool CalculateMinSize(void); virtual bool CalculateMinSize(void);
void SetSize(etkFloat_t size); void SetSize(etkFloat_t size);
private: private:
etkFloat_t m_size; etkFloat_t m_size;
}; };
extern const char * const TYPE_EOBJECT_WIDGET_SPACER;
}; };
#define EWOL_CAST_WIDGET_SPACER(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_SPACER,ewol::Spacer,curentPointer)
#endif #endif

View File

@ -42,6 +42,45 @@ ewol::WidgetScrooled::~WidgetScrooled(void)
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_SCROOLED = "WidgetScrooled";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::WidgetScrooled::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_SCROOLED << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_SCROOLED) {
return true;
} else {
if(true == ewol::Widget::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_SCROOLED << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::WidgetScrooled::GetObjectType(void)
{
return ewol::TYPE_EOBJECT;
}
void ewol::WidgetScrooled::OnRegenerateDisplay(void) void ewol::WidgetScrooled::OnRegenerateDisplay(void)
{ {
#ifdef __MODE__Touch #ifdef __MODE__Touch

View File

@ -53,6 +53,21 @@ namespace ewol {
public: public:
WidgetScrooled(void); WidgetScrooled(void);
virtual ~WidgetScrooled(void); virtual ~WidgetScrooled(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
virtual void OnRegenerateDisplay(void); virtual void OnRegenerateDisplay(void);
/** /**
* @brief Event on an input of this Widget * @brief Event on an input of this Widget
@ -66,6 +81,11 @@ namespace ewol {
protected: protected:
void SetScrollingSize(etkFloat_t nbPixel) { m_pixelScrolling = nbPixel; }; void SetScrollingSize(etkFloat_t nbPixel) { m_pixelScrolling = nbPixel; };
}; };
extern const char * const TYPE_EOBJECT_WIDGET_SCROOLED;
}; };
#define EWOL_CAST_WIDGET_SCROOLED(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_SCROOLED,ewol::WidgetScrooled,curentPointer)
#endif #endif

View File

@ -127,6 +127,45 @@ ewol::ColorChooser::~ColorChooser(void)
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_COLOR_CHOOSER = "ColorChooser";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::ColorChooser::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_COLOR_CHOOSER << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_COLOR_CHOOSER) {
return true;
} else {
if(true == ewol::SizerVert::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_COLOR_CHOOSER << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::ColorChooser::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_COLOR_CHOOSER;
}
void ewol::ColorChooser::SetColor(color_ts newColor) void ewol::ColorChooser::SetColor(color_ts newColor)
{ {
m_currentColor = newColor; m_currentColor = newColor;

View File

@ -43,6 +43,21 @@ namespace ewol {
public: public:
ColorChooser(void); ColorChooser(void);
~ColorChooser(void); ~ColorChooser(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
/** /**
* @brief Receive a message from an other EObject with a specific eventId and data * @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from * @param[in] CallerObject Pointer on the EObject that information came from
@ -69,6 +84,11 @@ namespace ewol {
ewol::Slider* m_widgetAlpha; ewol::Slider* m_widgetAlpha;
color_ts m_currentColor; color_ts m_currentColor;
}; };
extern const char * const TYPE_EOBJECT_WIDGET_COLOR_CHOOSER;
}; };
#define EWOL_CAST_WIDGET_COLOR_CHOOSER(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_COLOR_CHOOSER,ewol::ColorChooser,curentPointer)
#endif #endif

View File

@ -63,6 +63,8 @@ void SortList(etk::VectorType<etk::UString *> &m_listDirectory)
const char * const ewolEventFileChooserSelectFolder = "ewol-event-file-chooser-Select-Folder"; const char * const ewolEventFileChooserSelectFolder = "ewol-event-file-chooser-Select-Folder";
//!< EObject name :
extern const char * const TYPE_EOBJECT_WIDGET_FOLDER_LIST = "FileChooserFolderList";
class FileChooserFolderList : public ewol::List class FileChooserFolderList : public ewol::List
{ {
@ -188,13 +190,50 @@ class FileChooserFolderList : public ewol::List
return false; return false;
} }
public:
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_WIDGET_FOLDER_LIST << "\" != NULL(pointer) ");
return false;
}
if (objectType == TYPE_EOBJECT_WIDGET_FOLDER_LIST) {
return true;
} else {
if(true == ewol::List::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_WIDGET_FOLDER_LIST << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void)
{
return TYPE_EOBJECT_WIDGET_FOLDER_LIST;
}
}; };
#define EWOL_CAST_WIDGET_FOLDER_LIST(curentPointer) EWOL_CAST(TYPE_EOBJECT_WIDGET_FOLDER_LIST,FileChooserFolderList,curentPointer)
#undef __class__ #undef __class__
#define __class__ "FileChooser(FileList)" #define __class__ "FileChooser(FileList)"
const char * const ewolEventFileChooserSelectFile = "ewol-event-file-chooser-Select-File"; const char * const ewolEventFileChooserSelectFile = "ewol-event-file-chooser-Select-File";
const char * const ewolEventFileChooserValidateFile = "ewol-event-file-chooser-Validate-File"; const char * const ewolEventFileChooserValidateFile = "ewol-event-file-chooser-Validate-File";
//!< EObject name :
extern const char * const TYPE_EOBJECT_WIDGET_FILE_LIST = "FileChooserFileList";
class FileChooserFileList : public ewol::List class FileChooserFileList : public ewol::List
{ {
@ -324,7 +363,43 @@ class FileChooserFileList : public ewol::List
return false; return false;
} }
public:
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_WIDGET_FILE_LIST << "\" != NULL(pointer) ");
return false;
}
if (objectType == TYPE_EOBJECT_WIDGET_FILE_LIST) {
return true;
} else {
if(true == ewol::List::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_WIDGET_FILE_LIST << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void)
{
return TYPE_EOBJECT_WIDGET_FILE_LIST;
}
}; };
#define EWOL_CAST_WIDGET_FILE_LIST(curentPointer) EWOL_CAST(TYPE_EOBJECT_WIDGET_FILE_LIST,FileChooserFileList,curentPointer)
#undef __class__ #undef __class__
@ -437,11 +512,11 @@ ewol::FileChooser::FileChooser(void)
mySpacer = new ewol::Spacer(); mySpacer = new ewol::Spacer();
mySpacer->SetExpendX(true); mySpacer->SetExpendX(true);
mySizerHori->SubWidgetAdd(mySpacer); mySizerHori->SubWidgetAdd(mySpacer);
m_widgetValidate = new ewol::Button("Open"); m_widgetValidate = new ewol::Button("Validate");
m_widgetCheckBox->RegisterOnEvent(this, ewolEventButtonPressed, ewolEventFileChooserValidate); m_widgetValidate->RegisterOnEvent(this, ewolEventButtonPressed, ewolEventFileChooserValidate);
mySizerHori->SubWidgetAdd(m_widgetValidate); mySizerHori->SubWidgetAdd(m_widgetValidate);
m_widgetCancel = new ewol::Button("Cancel"); m_widgetCancel = new ewol::Button("Cancel");
m_widgetCheckBox->RegisterOnEvent(this, ewolEventButtonPressed, ewolEventFileChooserCancel); m_widgetCancel->RegisterOnEvent(this, ewolEventButtonPressed, ewolEventFileChooserCancel);
mySizerHori->SubWidgetAdd(m_widgetCancel); mySizerHori->SubWidgetAdd(m_widgetCancel);
// set the default Folder properties: // set the default Folder properties:
@ -455,6 +530,45 @@ ewol::FileChooser::~FileChooser(void)
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_FILE_CHOOSER = "FileChooser";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::FileChooser::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_FILE_CHOOSER << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_FILE_CHOOSER) {
return true;
} else {
if(true == ewol::PopUp::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_FILE_CHOOSER << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::FileChooser::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_FILE_CHOOSER;
}
void ewol::FileChooser::SetTitle(etk::UString label) void ewol::FileChooser::SetTitle(etk::UString label)
{ {
if (NULL == m_widgetTitle) { if (NULL == m_widgetTitle) {
@ -527,7 +641,7 @@ void ewol::FileChooser::OnReceiveMessage(ewol::EObject * CallerObject, const cha
return; return;
} else if (ewolEventFileChooserSelectFolder == eventId) { } else if (ewolEventFileChooserSelectFolder == eventId) {
//==> this is an internal event ... //==> this is an internal event ...
FileChooserFolderList * myListFolder = static_cast<FileChooserFolderList *>(m_widgetListFolder); FileChooserFolderList * myListFolder = EWOL_CAST_WIDGET_FOLDER_LIST(m_widgetListFolder);
etk::UString tmpString = myListFolder->GetSelectedLine(); etk::UString tmpString = myListFolder->GetSelectedLine();
EWOL_DEBUG(" old PATH : \"" << m_folder << "\" + \"" << tmpString << "\""); EWOL_DEBUG(" old PATH : \"" << m_folder << "\" + \"" << tmpString << "\"");
m_folder = m_folder + tmpString; m_folder = m_folder + tmpString;
@ -552,7 +666,7 @@ void ewol::FileChooser::OnReceiveMessage(ewol::EObject * CallerObject, const cha
return; return;
} else if (ewolEventFileChooserSelectFile == eventId) { } else if (ewolEventFileChooserSelectFile == eventId) {
m_hasSelectedFile = true; m_hasSelectedFile = true;
FileChooserFileList * myListFile = static_cast<FileChooserFileList *>(m_widgetListFile); FileChooserFileList * myListFile = EWOL_CAST_WIDGET_FILE_LIST(m_widgetListFile);
etk::UString file = myListFile->GetSelectedLine(); etk::UString file = myListFile->GetSelectedLine();
SetFileName(file); SetFileName(file);
GenerateEventId(eventId); GenerateEventId(eventId);
@ -576,8 +690,8 @@ void ewol::FileChooser::UpdateCurrentFolder(void)
if (NULL == m_widgetListFolder) { if (NULL == m_widgetListFolder) {
return; return;
} }
FileChooserFileList * myListFile = static_cast<FileChooserFileList *>(m_widgetListFile); FileChooserFileList * myListFile = EWOL_CAST_WIDGET_FILE_LIST(m_widgetListFile);
FileChooserFolderList * myListFolder = static_cast<FileChooserFolderList *>(m_widgetListFolder); FileChooserFolderList * myListFolder = EWOL_CAST_WIDGET_FOLDER_LIST(m_widgetListFolder);
myListFile->ClearElements(); myListFile->ClearElements();
myListFolder->ClearElements(); myListFolder->ClearElements();

View File

@ -42,6 +42,21 @@ namespace ewol {
public: public:
FileChooser(void); FileChooser(void);
~FileChooser(void); ~FileChooser(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
/** /**
* @brief Receive a message from an other EObject with a specific eventId and data * @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from * @param[in] CallerObject Pointer on the EObject that information came from
@ -77,6 +92,11 @@ namespace ewol {
etk::UString m_folder; etk::UString m_folder;
etk::UString m_file; etk::UString m_file;
}; };
extern const char * const TYPE_EOBJECT_WIDGET_FILE_CHOOSER;
}; };
#define EWOL_CAST_WIDGET_FILE_CHOOSER(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_FILE_CHOOSER,ewol::FileChooser,curentPointer)
#endif #endif

View File

@ -183,6 +183,45 @@ void ewol::Keyboard::SetMode(keyboardMode_te mode)
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_KEYBORAD = "Keyboard";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::Keyboard::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_KEYBORAD << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_KEYBORAD) {
return true;
} else {
if(true == ewol::Drawable::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_KEYBORAD << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::Keyboard::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_KEYBORAD;
}
/** /**
* @brief Receive a message from an other EObject with a specific eventId and data * @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from * @param[in] CallerObject Pointer on the EObject that information came from
@ -197,7 +236,7 @@ void ewol::Keyboard::OnReceiveMessage(ewol::EObject * CallerObject, const char *
if (NULL == CallerObject) { if (NULL == CallerObject) {
return; return;
} }
ewol::Button * bt = static_cast<ewol::Button *>(CallerObject); ewol::Button * bt = EWOL_CAST_WIDGET_BUTTON(CallerObject);
EWOL_DEBUG("kbevent : \"" << bt->GetLabel() << "\""); EWOL_DEBUG("kbevent : \"" << bt->GetLabel() << "\"");
etk::UString data = bt->GetLabel(); etk::UString data = bt->GetLabel();
if (data == "DEL") { if (data == "DEL") {

View File

@ -43,6 +43,21 @@ namespace ewol {
public: public:
Keyboard(void); Keyboard(void);
~Keyboard(void); ~Keyboard(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
/** /**
* @brief Event generated to inform a flip-flop has occured on the current widget * @brief Event generated to inform a flip-flop has occured on the current widget
* @param --- * @param ---
@ -90,6 +105,11 @@ namespace ewol {
virtual void SetExpendX(bool newExpend=false); virtual void SetExpendX(bool newExpend=false);
virtual void SetExpendY(bool newExpend=false); virtual void SetExpendY(bool newExpend=false);
}; };
extern const char * const TYPE_EOBJECT_WIDGET_KEYBORAD;
}; };
#define EWOL_CAST_WIDGET_KEYBOARD(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_KEYBORAD,ewol::Keyboard,curentPointer)
#endif #endif

View File

@ -127,6 +127,45 @@ ewol::StdPopUp::~StdPopUp(void)
} }
//!< EObject name :
extern const char * const ewol::TYPE_EOBJECT_WIDGET_STD_POP_UP = "StdPopUp";
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool ewol::StdPopUp::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_STD_POP_UP << "\" != NULL(pointer) ");
return false;
}
if (objectType == ewol::TYPE_EOBJECT_WIDGET_STD_POP_UP) {
return true;
} else {
if(true == ewol::PopUp::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << ewol::TYPE_EOBJECT_WIDGET_STD_POP_UP << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const ewol::StdPopUp::GetObjectType(void)
{
return ewol::TYPE_EOBJECT_WIDGET_STD_POP_UP;
}
void ewol::StdPopUp::SetTitle(etk::UString label) void ewol::StdPopUp::SetTitle(etk::UString label)
{ {

View File

@ -44,6 +44,21 @@ namespace ewol {
public: public:
StdPopUp(void); StdPopUp(void);
~StdPopUp(void); ~StdPopUp(void);
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
virtual bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
virtual const char * const GetObjectType(void);
virtual bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y); virtual bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
void SetTitle(etk::UString text); void SetTitle(etk::UString text);
void SetComment(etk::UString text); void SetComment(etk::UString text);
@ -53,6 +68,11 @@ namespace ewol {
ewol::widget::Label* m_comment; ewol::widget::Label* m_comment;
ewol::widget::Button* m_button[6]; ewol::widget::Button* m_button[6];
}; };
extern const char * const TYPE_EOBJECT_WIDGET_STD_POP_UP;
}; };
#define EWOL_CAST_WIDGET_STD_POP_UP(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET_STD_POP_UP,ewol::StdPopUp,curentPointer)
#endif #endif