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)
#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

View File

@ -37,7 +37,6 @@ extern "C" {
} messageList_ts;
};
// internal element of the widget manager :
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;
};
//!< 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
@ -234,8 +266,26 @@ void ewol::EObject::RegisterOnEvent(ewol::EObject * destinationObject, const cha
EWOL_ERROR("Input ERROR NULL pointer Event Id...");
return;
}
if (NULL == eventIdgenerated) {
EWOL_ERROR("Input ERROR NULL pointer destination Event Id...");
// check if event existed :
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;
}
ewol::EventExtGen * tmpEvent = new ewol::EventExtGen();
@ -245,7 +295,11 @@ void ewol::EObject::RegisterOnEvent(ewol::EObject * destinationObject, const cha
}
tmpEvent->localEventId = eventId;
tmpEvent->destEObject = destinationObject;
tmpEvent->destEventId = eventIdgenerated;
if (NULL != eventIdgenerated) {
tmpEvent->destEventId = eventIdgenerated;
} else {
tmpEvent->destEventId = eventId;
}
tmpEvent->destData = data;
m_externEvent.PushBack(tmpEvent);
}

View File

@ -36,7 +36,6 @@ namespace ewol {
void AnonymousSend(const char* const messageId, etk::UString& data);
};
class EObject;
/**
* local class for event generation
@ -78,6 +77,21 @@ namespace ewol {
*/
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:
/**
* @brief Add a specific event Id in the list to prevent wrong link on a EObject
@ -135,12 +149,12 @@ namespace ewol {
* @return ---
*/
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

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
* @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 ...
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
* @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) { };
}; // end of the class Widget declaration
extern const char * const TYPE_EOBJECT_WIDGET;
};// end of namespace
#define EWOL_CAST_WIDGET(curentPointer) EWOL_CAST(ewol::TYPE_EOBJECT_WIDGET,ewol::Widget,curentPointer)
#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)
{
//EWOL_DEBUG("calculateMinSize on : " << m_currentCreateId);

View File

@ -38,6 +38,21 @@ namespace ewol {
public:
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 :
public:
void SysDraw(void);
@ -100,7 +115,11 @@ namespace ewol {
*/
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

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)
{
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_TRIPLE == typeEvent) {
// nothing to do ...
//EWOL_DEBUG(" ==> generate event : " << ewolEventButtonPressed);
GenerateEventId(ewolEventButtonPressed);
MarkToReedraw();
return true;

View File

@ -43,6 +43,21 @@ namespace ewol {
public:
Button(void);
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);
virtual ~Button(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 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

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)
{
m_padding = newPadding;
@ -262,20 +301,21 @@ void ewol::ButtonColor::OnReceiveMessage(ewol::EObject * CallerObject, const cha
{
if (eventId == ewolEventColorChooserChange) {
//==> this is an internal event ...
ewol::ColorChooser * myColorChooser = static_cast<ewol::ColorChooser *>(CallerObject);
color_ts tmpColor = myColorChooser->GetColor();
m_selectedColor = tmpColor;
m_textColorBg = m_selectedColor;
char colorText[256];
sprintf(colorText, "#%02X%02X%02X%02X",
(uint8_t)(tmpColor.red * 0xFF),
(uint8_t)(tmpColor.green * 0xFF),
(uint8_t)(tmpColor.blue * 0xFF),
(uint8_t)(tmpColor.alpha * 0xFF));
//set the new label ...
SetLabel(colorText);
GenerateEventId(ewolEventButtonColorChange);
ewol::ColorChooser * myColorChooser = EWOL_CAST_WIDGET_COLOR_CHOOSER(CallerObject);
if (NULL != myColorChooser) {
color_ts tmpColor = myColorChooser->GetColor();
m_selectedColor = tmpColor;
m_textColorBg = m_selectedColor;
char colorText[256];
sprintf(colorText, "#%02X%02X%02X%02X",
(uint8_t)(tmpColor.red * 0xFF),
(uint8_t)(tmpColor.green * 0xFF),
(uint8_t)(tmpColor.blue * 0xFF),
(uint8_t)(tmpColor.alpha * 0xFF));
//set the new label ...
SetLabel(colorText);
GenerateEventId(ewolEventButtonColorChange);
}
}
}

View File

@ -39,6 +39,21 @@ namespace ewol {
public:
ButtonColor(void);
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);
virtual ~ButtonColor(void);
virtual bool CalculateMinSize(void);
@ -79,6 +94,10 @@ namespace ewol {
*/
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

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)
{
int32_t fontId = GetDefaultFontId();

View File

@ -37,6 +37,21 @@ namespace ewol {
public:
CheckBox(void);
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);
virtual ~CheckBox(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 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

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)
{
m_minSize.x = 80;

View File

@ -37,6 +37,21 @@ namespace ewol {
public:
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);
color_ts GetCurrentColor(void);
void SetCurrentColor(color_ts newOne);
@ -57,6 +72,11 @@ namespace ewol {
*/
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

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)
{
EWOL_DEBUG("CalculateSize(" << availlableX << "," << availlableY << ")");

View File

@ -43,6 +43,21 @@ namespace ewol {
public:
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:
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
@ -89,6 +104,11 @@ namespace ewol {
*/
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

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)
{
if (NULL == newObject) {

View File

@ -34,6 +34,21 @@ namespace ewol {
public:
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:
etk::VectorType<ewol::OObject*> m_listOObject[NB_BOUBLE_BUFFER]; //!< generic element to display...
@ -43,8 +58,13 @@ namespace ewol {
protected:
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

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)
{
int32_t fontId = GetDefaultFontId();

View File

@ -40,6 +40,21 @@ namespace ewol {
Entry(void);
Entry(etk::UString newData);
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);
virtual bool CalculateMinSize(void);
void SetValue(etk::UString newData);
@ -76,6 +91,11 @@ namespace ewol {
virtual void OnGetFocus(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

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)
{
int32_t fontId = GetDefaultFontId();

View File

@ -37,6 +37,21 @@ namespace ewol {
public:
Label(void);
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);
virtual ~Label(void);
virtual bool CalculateMinSize(void);
@ -57,6 +72,11 @@ namespace ewol {
*/
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

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)
{
/*int32_t fontId = GetDefaultFontId();

View File

@ -36,6 +36,21 @@ namespace ewol {
public:
List(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 bool CalculateMinSize(void);
void SetLabel(etk::UString newLabel);
@ -110,6 +125,11 @@ namespace ewol {
virtual void OnGetFocus(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

View File

@ -46,6 +46,45 @@ ewol::Menu::~Menu(void)
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)
{
EWOL_ERROR("Not availlable");
@ -166,7 +205,7 @@ void ewol::Menu::OnReceiveMessage(ewol::EObject * CallerObject, const char * eve
}
// Get the button widget :
coord2D_ts newPosition;
ewol::Widget * eventFromWidget = static_cast<ewol::Widget*>(CallerObject);
ewol::Widget * eventFromWidget = EWOL_CAST_WIDGET(CallerObject);
if (NULL != eventFromWidget) {
coord2D_ts tmpOri = eventFromWidget->GetOrigin();
coord2D_ts tmpSize = eventFromWidget->GetSize();

View File

@ -49,6 +49,21 @@ namespace ewol {
public:
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:
virtual void SubWidgetRemoveAll(void);
virtual void SubWidgetAdd(ewol::Widget* newWidget);
@ -73,6 +88,11 @@ namespace ewol {
*/
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

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)
{
//EWOL_DEBUG("CalculateSize(" << availlableX << "," << availlableY << ")");

View File

@ -36,6 +36,21 @@ namespace ewol {
public:
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:
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
@ -77,6 +92,11 @@ namespace ewol {
*/
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

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)
{
//EWOL_DEBUG("Update Size");

View File

@ -35,6 +35,21 @@ namespace ewol {
public:
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:
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
@ -77,6 +92,11 @@ namespace ewol {
*/
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

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)
{
//EWOL_DEBUG("Update Size");

View File

@ -35,6 +35,21 @@ namespace ewol {
public:
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:
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
@ -78,6 +93,11 @@ namespace ewol {
*/
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

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)
{

View File

@ -37,6 +37,21 @@ namespace ewol {
public:
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);
void SetValue(int32_t val);
int32_t GetValue(void);
@ -62,6 +77,11 @@ namespace ewol {
*/
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

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)
{
m_minSize.x = m_size;

View File

@ -35,11 +35,31 @@ namespace ewol {
public:
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);
void SetSize(etkFloat_t size);
private:
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

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)
{
#ifdef __MODE__Touch

View File

@ -53,6 +53,21 @@ namespace ewol {
public:
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);
/**
* @brief Event on an input of this Widget
@ -66,6 +81,11 @@ namespace ewol {
protected:
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

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)
{
m_currentColor = newColor;

View File

@ -43,6 +43,21 @@ namespace ewol {
public:
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
* @param[in] CallerObject Pointer on the EObject that information came from
@ -69,6 +84,11 @@ namespace ewol {
ewol::Slider* m_widgetAlpha;
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

View File

@ -63,6 +63,8 @@ void SortList(etk::VectorType<etk::UString *> &m_listDirectory)
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
{
@ -188,13 +190,50 @@ class FileChooserFolderList : public ewol::List
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__
#define __class__ "FileChooser(FileList)"
const char * const ewolEventFileChooserSelectFile = "ewol-event-file-chooser-Select-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
{
@ -324,7 +363,43 @@ class FileChooserFileList : public ewol::List
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__
@ -437,11 +512,11 @@ ewol::FileChooser::FileChooser(void)
mySpacer = new ewol::Spacer();
mySpacer->SetExpendX(true);
mySizerHori->SubWidgetAdd(mySpacer);
m_widgetValidate = new ewol::Button("Open");
m_widgetCheckBox->RegisterOnEvent(this, ewolEventButtonPressed, ewolEventFileChooserValidate);
m_widgetValidate = new ewol::Button("Validate");
m_widgetValidate->RegisterOnEvent(this, ewolEventButtonPressed, ewolEventFileChooserValidate);
mySizerHori->SubWidgetAdd(m_widgetValidate);
m_widgetCancel = new ewol::Button("Cancel");
m_widgetCheckBox->RegisterOnEvent(this, ewolEventButtonPressed, ewolEventFileChooserCancel);
m_widgetCancel->RegisterOnEvent(this, ewolEventButtonPressed, ewolEventFileChooserCancel);
mySizerHori->SubWidgetAdd(m_widgetCancel);
// 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)
{
if (NULL == m_widgetTitle) {
@ -527,7 +641,7 @@ void ewol::FileChooser::OnReceiveMessage(ewol::EObject * CallerObject, const cha
return;
} else if (ewolEventFileChooserSelectFolder == eventId) {
//==> 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();
EWOL_DEBUG(" old PATH : \"" << m_folder << "\" + \"" << tmpString << "\"");
m_folder = m_folder + tmpString;
@ -552,7 +666,7 @@ void ewol::FileChooser::OnReceiveMessage(ewol::EObject * CallerObject, const cha
return;
} else if (ewolEventFileChooserSelectFile == eventId) {
m_hasSelectedFile = true;
FileChooserFileList * myListFile = static_cast<FileChooserFileList *>(m_widgetListFile);
FileChooserFileList * myListFile = EWOL_CAST_WIDGET_FILE_LIST(m_widgetListFile);
etk::UString file = myListFile->GetSelectedLine();
SetFileName(file);
GenerateEventId(eventId);
@ -576,8 +690,8 @@ void ewol::FileChooser::UpdateCurrentFolder(void)
if (NULL == m_widgetListFolder) {
return;
}
FileChooserFileList * myListFile = static_cast<FileChooserFileList *>(m_widgetListFile);
FileChooserFolderList * myListFolder = static_cast<FileChooserFolderList *>(m_widgetListFolder);
FileChooserFileList * myListFile = EWOL_CAST_WIDGET_FILE_LIST(m_widgetListFile);
FileChooserFolderList * myListFolder = EWOL_CAST_WIDGET_FOLDER_LIST(m_widgetListFolder);
myListFile->ClearElements();
myListFolder->ClearElements();

View File

@ -42,6 +42,21 @@ namespace ewol {
public:
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
* @param[in] CallerObject Pointer on the EObject that information came from
@ -77,6 +92,11 @@ namespace ewol {
etk::UString m_folder;
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

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
* @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) {
return;
}
ewol::Button * bt = static_cast<ewol::Button *>(CallerObject);
ewol::Button * bt = EWOL_CAST_WIDGET_BUTTON(CallerObject);
EWOL_DEBUG("kbevent : \"" << bt->GetLabel() << "\"");
etk::UString data = bt->GetLabel();
if (data == "DEL") {

View File

@ -43,6 +43,21 @@ namespace ewol {
public:
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
* @param ---
@ -90,6 +105,11 @@ namespace ewol {
virtual void SetExpendX(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

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)
{

View File

@ -44,6 +44,21 @@ namespace ewol {
public:
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);
void SetTitle(etk::UString text);
void SetComment(etk::UString text);
@ -53,6 +68,11 @@ namespace ewol {
ewol::widget::Label* m_comment;
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