diff --git a/sources/appl/Gui/TextViewer.h b/sources/appl/Gui/TextViewer.h index 8924a75..b55c911 100644 --- a/sources/appl/Gui/TextViewer.h +++ b/sources/appl/Gui/TextViewer.h @@ -37,8 +37,16 @@ namespace appl { public: TextViewer(const std::string& _fontName="", int32_t _fontSize=-1); 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) + public: + /** + * @brief Get the buffer property (only for the class : template class TextViewerPluginData) + * @return pointer on buffer + */ + appl::Buffer* internalGetBuffer(void) { + return m_buffer; + } private: ewol::Text m_displayText; //!< Text display properties. ewol::Drawing m_displayDrawing; //!< Other diaplay requested. diff --git a/sources/appl/TextPluginData.h b/sources/appl/TextPluginData.h index f6e6b4f..00bcb7a 100644 --- a/sources/appl/TextPluginData.h +++ b/sources/appl/TextPluginData.h @@ -36,9 +36,7 @@ namespace appl { protected: TYPE* getDataRef(appl::TextViewer& _textDrawer) { 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.m_buffer) { - APPL_DEBUG("find data : " << iii); + if (m_specificData[iii].first == _textDrawer.internalGetBuffer()) { return m_specificData[iii].second; } } @@ -46,25 +44,11 @@ namespace appl { if (data == 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 ... return data; } 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, const ewol::EMessage& _msg) { TYPE* data = getDataRef(_textDrawer); @@ -103,14 +87,6 @@ namespace appl { } 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, const ewol::EMessage& _msg, TYPE& _data) {