[DEV] debug history manager

This commit is contained in:
Edouard DUPIN 2013-11-26 21:06:01 +01:00
parent 4d999bbb67
commit cc5afe2d55
2 changed files with 11 additions and 27 deletions

View File

@ -37,8 +37,16 @@ namespace appl {
public: public:
TextViewer(const std::string& _fontName="", int32_t _fontSize=-1); TextViewer(const std::string& _fontName="", int32_t _fontSize=-1);
virtual ~TextViewer(void); virtual ~TextViewer(void);
public: private:
appl::Buffer* m_buffer; //!< pointer on the current buffer to display (can be null if the buffer is remover or in state of changing buffer) appl::Buffer* m_buffer; //!< pointer on the current buffer to display (can be null if the buffer is remover or in state of changing buffer)
public:
/**
* @brief Get the buffer property (only for the class : template <typename TYPE> class TextViewerPluginData)
* @return pointer on buffer
*/
appl::Buffer* internalGetBuffer(void) {
return m_buffer;
}
private: private:
ewol::Text m_displayText; //!< Text display properties. ewol::Text m_displayText; //!< Text display properties.
ewol::Drawing m_displayDrawing; //!< Other diaplay requested. ewol::Drawing m_displayDrawing; //!< Other diaplay requested.

View File

@ -36,9 +36,7 @@ namespace appl {
protected: protected:
TYPE* getDataRef(appl::TextViewer& _textDrawer) { TYPE* getDataRef(appl::TextViewer& _textDrawer) {
for (size_t iii = 0; iii < m_specificData.size() ; ++iii) { for (size_t iii = 0; iii < m_specificData.size() ; ++iii) {
APPL_DEBUG("compare " << (int64_t)m_specificData[iii].first << " && " << (int64_t)&_textDrawer); if (m_specificData[iii].first == _textDrawer.internalGetBuffer()) {
if (m_specificData[iii].first == _textDrawer.m_buffer) {
APPL_DEBUG("find data : " << iii);
return m_specificData[iii].second; return m_specificData[iii].second;
} }
} }
@ -46,25 +44,11 @@ namespace appl {
if (data == NULL) { if (data == NULL) {
return NULL; return NULL;
} }
m_specificData.push_back(std::make_pair(_textDrawer.m_buffer, data)); m_specificData.push_back(std::make_pair(_textDrawer.internalGetBuffer(), data));
// create a new one ... // create a new one ...
return data; return data;
} }
protected: // Wrap all element with their internal data: (do not use theses function) protected: // Wrap all element with their internal data: (do not use theses function)
void onPluginEnable(appl::TextViewer& _textDrawer) {
TYPE* data = getDataRef(_textDrawer);
if (data == NULL) {
return;
}
return onPluginEnable(_textDrawer, *data);
}
void onPluginDisable(appl::TextViewer& _textDrawer) {
TYPE* data = getDataRef(_textDrawer);
if (data == NULL) {
return;
}
return onPluginDisable(_textDrawer, *data);
}
bool onReceiveMessage(appl::TextViewer& _textDrawer, bool onReceiveMessage(appl::TextViewer& _textDrawer,
const ewol::EMessage& _msg) { const ewol::EMessage& _msg) {
TYPE* data = getDataRef(_textDrawer); TYPE* data = getDataRef(_textDrawer);
@ -103,14 +87,6 @@ namespace appl {
} }
public: public:
virtual void onPluginEnable(appl::TextViewer& _textDrawer,
TYPE& _data) {
return;
}
virtual void onPluginDisable(appl::TextViewer& _textDrawer,
TYPE& _data) {
return;
}
virtual bool onReceiveMessage(appl::TextViewer& _textDrawer, virtual bool onReceiveMessage(appl::TextViewer& _textDrawer,
const ewol::EMessage& _msg, const ewol::EMessage& _msg,
TYPE& _data) { TYPE& _data) {