Update to the new system of internal patch for -RTTI in debug mode

This commit is contained in:
Edouard Dupin 2012-03-14 09:26:14 +01:00
parent 495cab7d27
commit 2997133eee
9 changed files with 280 additions and 6 deletions

View File

@ -33,6 +33,9 @@
#undef __class__
#define __class__ "classBufferManager"
//!< EObject name :
extern const char * const TYPE_EOBJECT_EDN_BUFFER_MANAGER = "BufferManager";
class classBufferManager: public ewol::EObject
{
public:
@ -40,6 +43,39 @@ class classBufferManager: public ewol::EObject
classBufferManager(void);
~classBufferManager(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
*/
bool CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_BUFFER_MANAGER << "\" != NULL(pointer) ");
return false;
}
if (objectType == TYPE_EOBJECT_EDN_BUFFER_MANAGER) {
return true;
} else {
if(true == ewol::EObject::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_BUFFER_MANAGER << "\" != \"" << 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_EDN_BUFFER_MANAGER;
}
public:
/**
* @brief Receive a message from an other EObject with a specific eventId and data
@ -78,6 +114,7 @@ class classBufferManager: public ewol::EObject
Buffer * BufferNotExiste; //!< When an error arrive in get buffer we return the Error buffer (not writable)
};
#define EDN_CAST_BUFFER_MANAGER(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_BUFFER_MANAGER,classBufferManager,curentPointer)
// Constructeur

View File

@ -32,6 +32,8 @@
#define PFX "ColorizeManager "
//!< EObject name :
extern const char * const TYPE_EOBJECT_EDN_COLORIZE_MANAGER = "ColorizeManager";
class classColorManager: public ewol::EObject
{
@ -39,7 +41,39 @@ class classColorManager: public ewol::EObject
// Constructeur
classColorManager(void);
~classColorManager(void);
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_EDN_COLORIZE_MANAGER << "\" != NULL(pointer) ");
return false;
}
if (objectType == TYPE_EOBJECT_EDN_COLORIZE_MANAGER) {
return true;
} else {
if(true == ewol::EObject::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_COLORIZE_MANAGER << "\" != \"" << 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_EDN_COLORIZE_MANAGER;
}
/**
* @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
@ -65,6 +99,8 @@ class classColorManager: public ewol::EObject
color_ts basicColors[COLOR_NUMBER_MAX];
};
#define EDN_CAST_COLORIZE_MANAGER(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_COLORIZE_MANAGER,classColorManager,curentPointer)
classColorManager::classColorManager(void)
{

View File

@ -35,6 +35,9 @@
#undef __class__
#define __class__ "BufferView"
extern const char * const TYPE_EOBJECT_EDN_BUFFER_VIEW = "BufferView";
BufferView::BufferView(void)
{
SetCanHaveFocus(true);
@ -49,6 +52,39 @@ BufferView::~BufferView(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
*/
bool BufferView::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_BUFFER_VIEW << "\" != NULL(pointer) ");
return false;
}
if (objectType == TYPE_EOBJECT_EDN_BUFFER_VIEW) {
return true;
} else {
if(true == ewol::List::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_BUFFER_VIEW << "\" != \"" << 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 BufferView::GetObjectType(void)
{
return TYPE_EOBJECT_EDN_BUFFER_VIEW;
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data

View File

@ -32,7 +32,8 @@
#include <MsgBroadcast.h>
#include <ewol/widget/List.h>
//!< EObject name :
extern const char * const TYPE_EOBJECT_EDN_BUFFER_VIEW;
class BufferView : public ewol::List
{
@ -40,6 +41,20 @@ class BufferView : public ewol::List
// Constructeur
BufferView(void);
~BufferView(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
*/
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
*/
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
@ -60,6 +75,7 @@ class BufferView : public ewol::List
int32_t m_selectedID;
};
#define EDN_CAST_BUFFER_VIEW(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_BUFFER_VIEW,BufferView,curentPointer)
#endif

View File

@ -40,9 +40,11 @@
#undef __class__
#define __class__ "ewol::CodeView"
#define __class__ "CodeView"
extern const char * const TYPE_EOBJECT_EDN_CODE_VIEW = "CodeView";
CodeView::CodeView(void)
{
m_label = "CodeView is disable ...";
@ -73,6 +75,41 @@ CodeView::~CodeView(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
*/
bool CodeView::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_CODE_VIEW << "\" != NULL(pointer) ");
return false;
}
if (objectType == TYPE_EOBJECT_EDN_CODE_VIEW) {
return true;
} else {
if(true == ewol::WidgetScrooled::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_CODE_VIEW << "\" != \"" << 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 CodeView::GetObjectType(void)
{
return TYPE_EOBJECT_EDN_CODE_VIEW;
}
bool CodeView::CalculateMinSize(void)
{
m_minSize.x = 50;

View File

@ -35,11 +35,28 @@
#include <etk/Types.h>
#include <ewol/widget/WidgetScrolled.h>
//!< EObject name :
extern const char * const TYPE_EOBJECT_EDN_CODE_VIEW;
class CodeView :public ewol::WidgetScrooled
{
public:
CodeView(void);
virtual ~CodeView(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
*/
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
*/
const char * const GetObjectType(void);
virtual bool CalculateMinSize(void);
private:
etk::UString m_label;
@ -96,5 +113,7 @@ class CodeView :public ewol::WidgetScrooled
virtual void OnDraw(void);
};
#define EDN_CAST_CODE_VIEW(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_CODE_VIEW,CodeView,curentPointer)
#endif

View File

@ -48,6 +48,8 @@
#undef __class__
#define __class__ "MainWindows"
extern const char * const TYPE_EOBJECT_EDN_MAIN_WINDOWS = "MainWindows";
MainWindows::MainWindows(void)
{
EDN_DEBUG("CREATE WINDOWS ... ");
@ -152,6 +154,41 @@ MainWindows::~MainWindows(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
*/
bool MainWindows::CheckObjectType(const char * const objectType)
{
if (NULL == objectType) {
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_MAIN_WINDOWS << "\" != NULL(pointer) ");
return false;
}
if (objectType == TYPE_EOBJECT_EDN_MAIN_WINDOWS) {
return true;
} else {
if(true == ewol::Windows::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_MAIN_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 MainWindows::GetObjectType(void)
{
return TYPE_EOBJECT_EDN_MAIN_WINDOWS;
}
const char *const ednEventPopUpFileSelected = "edn-mainWindows-openSelected";
const char *const ednEventPopUpFileSaveAs = "edn-mainWindows-saveAsSelected";

View File

@ -22,7 +22,8 @@
*
*******************************************************************************
*/
#ifndef __MAIN_WINDOWS_H__
#define __MAIN_WINDOWS_H__
#include <tools_debug.h>
#include <MsgBroadcast.h>
@ -32,9 +33,8 @@
#include <BufferManager.h>
#include <ewol/widget/Label.h>
extern const char * const TYPE_EOBJECT_EDN_MAIN_WINDOWS;
#ifndef __MAIN_WINDOWS_H__
#define __MAIN_WINDOWS_H__
class MainWindows : public ewol::Windows
{
private:
@ -44,6 +44,20 @@ class MainWindows : public ewol::Windows
// Constructeur
MainWindows(void);
~MainWindows(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
*/
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
*/
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
@ -53,6 +67,9 @@ class MainWindows : public ewol::Windows
*/
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
};
#define EDN_CAST_MAIN_WINDOWS(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_MAIN_WINDOWS,MainWindows,curentPointer)
#endif

View File

@ -33,6 +33,9 @@
#define __class__ "HighlightManager"
//!< EObject name :
extern const char * const TYPE_EOBJECT_EDN_HIGHLIGHT_MANAGER = "HighlightManager";
class localClassHighlightManager: public ewol::EObject
{
private:
@ -54,6 +57,41 @@ class localClassHighlightManager: public ewol::EObject
// clear the compleate list
listHighlight.Clear();
};
/**
* @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_EDN_HIGHLIGHT_MANAGER << "\" != NULL(pointer) ");
return false;
}
if (objectType == TYPE_EOBJECT_EDN_HIGHLIGHT_MANAGER) {
return true;
} else {
if(true == ewol::EObject::CheckObjectType(objectType)) {
return true;
}
EWOL_ERROR("check error : \"" << TYPE_EOBJECT_EDN_HIGHLIGHT_MANAGER << "\" != \"" << 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_EDN_HIGHLIGHT_MANAGER;
}
/**
* @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
@ -141,6 +179,7 @@ class localClassHighlightManager: public ewol::EObject
};
#define EDN_CAST_HIGHLIGHT_MANAGER(curentPointer) EWOL_CAST(TYPE_EOBJECT_EDN_HIGHLIGHT_MANAGER,localClassHighlightManager,curentPointer)
static localClassHighlightManager * localManager = NULL;