diff --git a/sources/appl/Buffer/BufferManager.cpp b/sources/appl/Buffer/BufferManager.cpp index 6b41070..25b3df6 100644 --- a/sources/appl/Buffer/BufferManager.cpp +++ b/sources/appl/Buffer/BufferManager.cpp @@ -9,8 +9,8 @@ #include #include #include -#include -#include +#include +#include #undef __class__ #define __class__ "classBufferManager" diff --git a/sources/appl/Buffer/BufferText.cpp b/sources/appl/Buffer/BufferText.cpp index 0279e0d..0500384 100644 --- a/sources/appl/Buffer/BufferText.cpp +++ b/sources/appl/Buffer/BufferText.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #undef __class__ @@ -92,7 +93,7 @@ void BufferText::SetModify(bool status) m_fileModify = status; // TODO : Remove from here etk::UString data = "Modify"; - ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgBufferState, data); + ewol::GetContext().GetEObjectManager().MultiCast().AnonymousSend(ednMsgBufferState, data); } } diff --git a/sources/appl/Colorize/ColorizeManager.cpp b/sources/appl/Colorize/ColorizeManager.cpp index 86fec20..cd2f0e8 100644 --- a/sources/appl/Colorize/ColorizeManager.cpp +++ b/sources/appl/Colorize/ColorizeManager.cpp @@ -10,8 +10,8 @@ #include #include #include -#include -#include +#include +#include #include #define PFX "ColorizeManager " diff --git a/sources/appl/Gui/BufferView.cpp b/sources/appl/Gui/BufferView.cpp index f72d199..50ac70b 100644 --- a/sources/appl/Gui/BufferView.cpp +++ b/sources/appl/Gui/BufferView.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #undef __class__ #define __class__ "BufferView" diff --git a/sources/appl/Gui/BufferView.h b/sources/appl/Gui/BufferView.h index 3c2aa7e..fe6c1bd 100644 --- a/sources/appl/Gui/BufferView.h +++ b/sources/appl/Gui/BufferView.h @@ -14,6 +14,7 @@ #include #include #include +#include namespace appl { diff --git a/sources/appl/Gui/CodeView.cpp b/sources/appl/Gui/CodeView.cpp index 66ddd18..4872282 100644 --- a/sources/appl/Gui/CodeView.cpp +++ b/sources/appl/Gui/CodeView.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #undef __class__ @@ -231,7 +231,7 @@ bool CodeView::OnEventInput(const ewol::EventInput& _event) limitedPos.setValue(etk_avg(1, limitedPos.x(), m_size.x()-1), etk_avg(1, limitedPos.y(), m_size.y()-1)); if (true == WidgetScrooled::OnEventInput(_event)) { - ewol::widgetManager::FocusKeep(this); + KeepFocus(); // nothing to do ... done on upper widget ... return true; } @@ -245,7 +245,7 @@ bool CodeView::OnEventInput(const ewol::EventInput& _event) if (ewol::keyEvent::typeMouse == _event.GetType()) { if (ewol::keyEvent::statusDown == _event.GetStatus()) { m_buttunOneSelected = true; - ewol::widgetManager::FocusKeep(this); + KeepFocus(); // TODO : Set something good BufferText* tmpBuffer = BufferManager::Get(m_bufferID); if (NULL!=tmpBuffer) { @@ -263,7 +263,7 @@ bool CodeView::OnEventInput(const ewol::EventInput& _event) } if (ewol::keyEvent::statusSingle == _event.GetStatus()) { if (ewol::keyEvent::typeMouse == _event.GetType()) { - ewol::widgetManager::FocusKeep(this); + KeepFocus(); BufferText* tmpBuffer = BufferManager::Get(m_bufferID); if (NULL!=tmpBuffer) { tmpBuffer->MouseEvent(limitedPos); @@ -312,7 +312,7 @@ bool CodeView::OnEventInput(const ewol::EventInput& _event) tmpBuffer->MouseEvent(limitedPos); } ewol::clipBoard::Request(ewol::clipBoard::clipboardSelection); - ewol::widgetManager::FocusKeep(this); + KeepFocus(); } } return true; @@ -456,14 +456,14 @@ void CodeView::OnGetFocus(void) /* ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_bufferID); */ - ewol::Keyboard(true); + ShowKeyboard(); APPL_INFO("Focus - In"); } void CodeView::OnLostFocus(void) { - ewol::Keyboard(false); + HideKeyboard(); APPL_INFO("Focus - out"); } diff --git a/sources/appl/Gui/MainWindows.cpp b/sources/appl/Gui/MainWindows.cpp index 83af6b7..5f99970 100644 --- a/sources/appl/Gui/MainWindows.cpp +++ b/sources/appl/Gui/MainWindows.cpp @@ -28,7 +28,8 @@ #include #include #include -#include +#include +#include #include namespace appl @@ -355,11 +356,11 @@ void MainWindows::OnReceiveMessage(const ewol::EMessage& _msg) } etk::UString windowsTitle = "edn - "; windowsTitle += directName; - ewol::SetTitle(windowsTitle); + SetTitle(windowsTitle); return; } else { m_widgetLabelFileName->SetLabel(""); - ewol::SetTitle("edn"); + SetTitle("edn"); } return; // TODO : Set the Title .... @@ -382,8 +383,8 @@ void MainWindows::OnReceiveMessage(const ewol::EMessage& _msg) tmpWidget->MenuAdd("About", "", tmpSubWidget); } } else if (_msg.GetMessage() == ednMsgGuiReloadShader) { - ewol::resource::ReLoadResources(); - ewol::ForceRedrawAll(); + ewol::GetContext().GetResourcesManager().ReLoadResources(); + ewol::GetContext().ForceRedrawAll(); } else if (_msg.GetMessage() == ednMsgGuiExit) { // TODO ... } diff --git a/sources/appl/Highlight/HighlightManager.cpp b/sources/appl/Highlight/HighlightManager.cpp index 6d6fa05..a599e5f 100644 --- a/sources/appl/Highlight/HighlightManager.cpp +++ b/sources/appl/Highlight/HighlightManager.cpp @@ -9,8 +9,8 @@ #include #include #include -#include -#include +#include +#include #undef __class__ #define __class__ "HighlightManager" diff --git a/sources/appl/ctags/CTagsManager.cpp b/sources/appl/ctags/CTagsManager.cpp index 9b24875..0e83224 100644 --- a/sources/appl/ctags/CTagsManager.cpp +++ b/sources/appl/ctags/CTagsManager.cpp @@ -10,7 +10,8 @@ #include #include #include -#include +#include +#include #include #include @@ -134,7 +135,7 @@ void CTagsManager::OnReceiveMessage(const ewol::EMessage& _msg) } else { tmpWidget->SetTitle("Open Exuberant Ctags File"); tmpWidget->SetValidateLabel("Open"); - ewol::WindowsPopUpAdd(tmpWidget); + ewol::GetContext().GetWindows()->PopUpWidgetPush(tmpWidget); tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpCtagsLoadFile); } } else if (_msg.GetData() == "ReLoad") { @@ -241,7 +242,7 @@ void CTagsManager::JumpTo(void) PrintTag(&entry); tmpWidget->AddCtagsNewItem(myfile.GetName(), lineID); } while (tagsFindNext (m_ctagFile, &entry) == TagSuccess); - ewol::WindowsPopUpAdd(tmpWidget); + ewol::GetContext().GetWindows()->PopUpWidgetPush(tmpWidget); tmpWidget->RegisterOnEvent(this, applEventctagsSelection); } } else { diff --git a/sources/appl/global.cpp b/sources/appl/global.cpp index 2594ef8..949edf9 100644 --- a/sources/appl/global.cpp +++ b/sources/appl/global.cpp @@ -9,10 +9,11 @@ #include #include #include -#include -#include +#include +#include +#include #include -#include +//#include #undef __class__ #define __class__ "globals" @@ -118,7 +119,7 @@ static myParamGlobal& l_obj(void) void globals::Init(void) { - ewol::userConfig::AddUserConfig(&l_obj()); + //ewol::userConfig::AddUserConfig(&l_obj()); } void globals::UnInit(void) @@ -305,7 +306,8 @@ void globals::ParameterGlobalsGui::OnReceiveMessage(const ewol::EMessage& _msg) etk::theme::SetName("GUI", "default");; } // Reload shaders and graphic system ... - ewol::resource::ReLoadResources(); + ewol::GetContext().GetResourcesManager().ReLoadResources(); + ewol::GetContext().ForceRedrawAll(); } } diff --git a/sources/appl/init.cpp b/sources/appl/init.cpp index 855559d..c5a4de9 100644 --- a/sources/appl/init.cpp +++ b/sources/appl/init.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include @@ -25,9 +25,10 @@ #include #include #include -#include +//#include #include -#include +//#include +#include MainWindows * basicWindows = NULL; @@ -37,52 +38,36 @@ MainWindows * basicWindows = NULL; * @param std IO * @return std IO */ -int main(int argc, const char *argv[]) +int main(int _argc, const char *_argv[]) { - // only one things to do : - return ewol::Run(argc, argv); + // only one things to do: + return ewol::Run(_argc, _argv); } /** * @brief main application function Initialisation */ -void APP_Init(void) +bool APP_Init(ewol::eContext& _context) { - #ifdef MODE_RELEASE - const char * debugMode = "Release"; - #else - const char * debugMode = "Debug"; - #endif - #ifdef __TARGET_OS__Linux - const char * osMode = "Linux"; - #elif defined(__TARGET_OS__Android) - const char * osMode = "Android"; - #elif defined(__TARGET_OS__Windows) - const char * osMode = "Windows"; - #elif defined(__TARGET_OS__IOs) - const char * osMode = "IOs"; - #elif defined(__TARGET_OS__MacOs) - const char * osMode = "MacOs"; - #else - const char * osMode = "Unknown"; - #endif - APPL_INFO("==> Init "PROJECT_NAME" (START) [" << osMode << "] (" << debugMode << ")"); + APPL_INFO("==> Init APPL (START) [" << ewol::GetBoardType() << "] (" << ewol::GetCompilationMode() << ")"); - ewol::ChangeSize(ivec2(800, 600)); + // TODO : Remove this : Move if in the windows properties + _context.SetSize(vec2(800, 600)); + + // select internal data for font ... + _context.GetFontDefault().SetUseExternal(true); #ifdef __TARGET_OS__Android - ewol::config::FontSetDefault("FreeSerif", 19); + _context.GetFontDefault().Set("FreeSerif", 19); #else - ewol::config::FontSetDefault("FreeSerif;DejaVuSansMono",14); + _context.GetFontDefault().Set("FreeSerif;DejaVuSansMono",14); #endif // set the application icon ... - ewol::SetIcon("DATA:icon.png"); + _context.SetIcon("DATA:icon.png"); // init internal global value globals::Init(); - // set the application icon ... - ewol::SetIcon("DATA:icon.png"); // init ALL Singleton : //(void)CTagsManager::getInstance(); @@ -98,52 +83,53 @@ void APP_Init(void) cTagsManager::Init(); // Request load of the user configuration ... - ewol::userConfig::Load(); + //ewol::userConfig::Load(); char cCurrentPath[FILENAME_MAX]; // get the curent program folder if (!getcwd(cCurrentPath, FILENAME_MAX)) { - return ; + return false; } cCurrentPath[FILENAME_MAX - 1] = '\0'; //APPL_INFO("The current working directory is " << cCurrentPath); - + basicWindows = new MainWindows(); if (NULL == basicWindows) { APPL_ERROR("Can not allocate the basic windows"); - ewol::Stop(); - return; + _context.Stop(); + return false; } // create the specific windows - ewol::WindowsSet(basicWindows); + _context.SetWindows(basicWindows); // add files APPL_INFO("show list of files : "); bool ctagDetected = false; - for( int32_t iii=0 ; iii Init "PROJECT_NAME" (END)"); + return true; } /** * @brief main application function Un-Initialisation */ -void APP_UnInit(void) +void APP_UnInit(ewol::eContext& _context) { APPL_INFO("==> Un-Init "PROJECT_NAME" (START)"); diff --git a/sources/lutin_edn.py b/sources/lutin_edn.py index 87d893a..2af37cd 100755 --- a/sources/lutin_edn.py +++ b/sources/lutin_edn.py @@ -8,8 +8,8 @@ def Create(target): myModule = lutinModule.module(__file__, 'edn', 'PACKAGE') # add the file to compile: myModule.AddSrcFile([ - 'appl/ctags/readtags.cpp', - 'appl/ctags/CTagsManager.cpp']) + 'appl/ctags/readtags.cpp', + 'appl/ctags/CTagsManager.cpp']) myModule.AddSrcFile([ 'appl/Debug.cpp', @@ -100,8 +100,8 @@ def Create(target): myModule.pkgSet("DESCRIPTION", "Text editor for sources code with ctags management") myModule.pkgSet("NAME", "Editeur de N'ours") - myModule.pkgAddRight("WRITE_EXTERNAL_STORAGE") - myModule.pkgAddRight("SET_ORIENTATION") + myModule.pkgAdd("RIGHT", "WRITE_EXTERNAL_STORAGE") + myModule.pkgAdd("RIGHT", "SET_ORIENTATION") # add the currrent module at the return myModule