diff --git a/sources/appl/GlyphDecoration.cpp b/sources/appl/GlyphDecoration.cpp index 2e324a9..f46f31a 100644 --- a/sources/appl/GlyphDecoration.cpp +++ b/sources/appl/GlyphDecoration.cpp @@ -44,7 +44,7 @@ void appl::GlyphDecoration::setBold(bool _enable) } } -etk::CCout& appl::operator <<(etk::CCout& _os, const appl::GlyphDecoration& _obj) +std::ostream& appl::operator <<(std::ostream& _os, const appl::GlyphDecoration& _obj) { _os << "{fg=" << _obj.getForeground(); _os << ",bg=" << _obj.getBackground(); diff --git a/sources/appl/GlyphDecoration.h b/sources/appl/GlyphDecoration.h index 4377576..28137f4 100644 --- a/sources/appl/GlyphDecoration.h +++ b/sources/appl/GlyphDecoration.h @@ -116,7 +116,7 @@ namespace appl { return m_bold; }; }; - etk::CCout& operator <<(etk::CCout& _os, const appl::GlyphDecoration& _obj); + std::ostream& operator <<(std::ostream& _os, const appl::GlyphDecoration& _obj); } #endif diff --git a/sources/appl/Gui/MainWindows.cpp b/sources/appl/Gui/MainWindows.cpp index b4e4b35..1851def 100644 --- a/sources/appl/Gui/MainWindows.cpp +++ b/sources/appl/Gui/MainWindows.cpp @@ -152,6 +152,7 @@ MainWindows::MainWindows(void) { #else myTextView = new appl::TextViewer("FreeMono;DejaVuSansMono;FreeSerif", 11); #endif + myTextView->setName("appl-text-viewer"); myTextView->setExpand(bvec2(true,true)); myTextView->setFill(bvec2(true,true)); mySizerVert2->subWidgetAdd(myTextView); @@ -304,6 +305,37 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) { if (NULL == tmpWidget) { APPL_ERROR("Can not allocate widget == > display might be in error"); } else { + #ifdef SDGSDFGSDFGSDFGSDFGSTERGDHFGHFDS + std::string menuDescription = "Properties\n"; + menuDescription += "\n"; + menuDescription += " Editor\n"; + menuDescription += " \n"; + menuDescription += " Editor Interface\n"; + menuDescription += " Editor\n"; + menuDescription += " appl-text-viewer\n"; + menuDescription += " \n"; + menuDescription += "\n"; + menuDescription += "\n"; + menuDescription += " Gui\n"; + menuDescription += " \n"; + menuDescription += " Font selection\n"; + menuDescription += " Font\n"; + menuDescription += " \n"; + menuDescription += " \n"; + menuDescription += " \n"; + menuDescription += " Color selection\n"; + menuDescription += " Color\n"; + menuDescription += " \n"; + menuDescription += " \n"; + menuDescription += " \n"; + menuDescription += " Theme selection\n"; + menuDescription += " Theme\n"; + menuDescription += " \n"; + menuDescription += " \n"; + menuDescription += "\n"; + + tmpWidget->setMenu(menuDescription); + #endif tmpWidget->setTitle("Properties"); popUpWidgetPush(tmpWidget); tmpWidget->menuAddGroup("Editor"); diff --git a/sources/appl/debug.cpp b/sources/appl/debug.cpp index bc0363f..250d0a9 100644 --- a/sources/appl/debug.cpp +++ b/sources/appl/debug.cpp @@ -8,4 +8,8 @@ #include -const char * applLog = "edn "; +int32_t appl::getLogId(void) { + static int32_t g_val = etk::log::registerInstance("edn"); + return g_val; +} + diff --git a/sources/appl/debug.h b/sources/appl/debug.h index eba864b..2d7c007 100644 --- a/sources/appl/debug.h +++ b/sources/appl/debug.h @@ -9,19 +9,43 @@ #ifndef __APPL_DEBUG_H__ #define __APPL_DEBUG_H__ -#include -#include +#include -extern const char * applLog; +namespace appl { + int32_t getLogId(void); +}; +// TODO : Review this problem of multiple intanciation of "std::stringbuf sb" +#define APPL_BASE(info,data) \ + do { \ + if (info <= etk::log::getLevel(appl::getLogId())) { \ + std::stringbuf sb; \ + std::ostream tmpStream(&sb); \ + tmpStream << data; \ + etk::log::logStream(appl::getLogId(), info, __LINE__, __class__, __func__, tmpStream); \ + } \ + } while(0) -#define APPL_CRITICAL(data) ETK_CRITICAL(applLog, data) -#define APPL_WARNING(data) ETK_WARNING(applLog, data) -#define APPL_ERROR(data) ETK_ERROR(applLog, data) -#define APPL_INFO(data) ETK_INFO(applLog, data) -#define APPL_DEBUG(data) ETK_DEBUG(applLog, data) -#define APPL_VERBOSE(data) ETK_VERBOSE(applLog, data) -#define APPL_ASSERT(cond, data) ETK_ASSERT(applLog, cond, data) -#define APPL_CHECK_INOUT(cond) ETK_CHECK_INOUT(applLog, cond) -#define APPL_TODO(cond) ETK_TODO(applLog, cond) +#define APPL_CRITICAL(data) APPL_BASE(1, data) +#define APPL_ERROR(data) APPL_BASE(2, data) +#define APPL_WARNING(data) APPL_BASE(3, data) +#ifdef DEBUG + #define APPL_INFO(data) APPL_BASE(4, data) + #define APPL_DEBUG(data) APPL_BASE(5, data) + #define APPL_VERBOSE(data) APPL_BASE(6, data) + #define APPL_TODO(data) APPL_BASE(4, "TODO : " << data) +#else + #define APPL_INFO(data) do { } while(false) + #define APPL_DEBUG(data) do { } while(false) + #define APPL_VERBOSE(data) do { } while(false) + #define APPL_TODO(data) do { } while(false) +#endif + +#define APPL_ASSERT(cond,data) \ + do { \ + if (!(cond)) { \ + APPL_CRITICAL(data); \ + assert(!#cond); \ + } \ + } while (0) #endif