[DEV] update to the new ewol system

This commit is contained in:
Edouard DUPIN 2013-09-02 06:45:12 +02:00
parent b5371c4d13
commit ad12b68ead
12 changed files with 67 additions and 75 deletions

View File

@ -9,8 +9,8 @@
#include <appl/Debug.h> #include <appl/Debug.h>
#include <appl/global.h> #include <appl/global.h>
#include <BufferManager.h> #include <BufferManager.h>
#include <ewol/eObject/EObject.h> #include <ewol/renderer/EObject.h>
#include <ewol/eObject/EObjectManager.h> #include <ewol/renderer/EObjectManager.h>
#undef __class__ #undef __class__
#define __class__ "classBufferManager" #define __class__ "classBufferManager"

View File

@ -16,6 +16,7 @@
#include <ewol/widget/WidgetManager.h> #include <ewol/widget/WidgetManager.h>
#include <ewol/widget/Widget.h> #include <ewol/widget/Widget.h>
#include <ewol/clipBoard.h> #include <ewol/clipBoard.h>
#include <ewol/renderer/eContext.h>
#undef __class__ #undef __class__
@ -92,7 +93,7 @@ void BufferText::SetModify(bool status)
m_fileModify = status; m_fileModify = status;
// TODO : Remove from here // TODO : Remove from here
etk::UString data = "Modify"; etk::UString data = "Modify";
ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgBufferState, data); ewol::GetContext().GetEObjectManager().MultiCast().AnonymousSend(ednMsgBufferState, data);
} }
} }

View File

@ -10,8 +10,8 @@
#include <appl/global.h> #include <appl/global.h>
#include <ColorizeManager.h> #include <ColorizeManager.h>
#include <exml/exml.h> #include <exml/exml.h>
#include <ewol/eObject/EObject.h> #include <ewol/renderer/EObject.h>
#include <ewol/eObject/EObjectManager.h> #include <ewol/renderer/EObjectManager.h>
#include <etk/os/FSNode.h> #include <etk/os/FSNode.h>
#define PFX "ColorizeManager " #define PFX "ColorizeManager "

View File

@ -12,7 +12,7 @@
#include <BufferManager.h> #include <BufferManager.h>
#include <ColorizeManager.h> #include <ColorizeManager.h>
#include <MainWindows.h> #include <MainWindows.h>
#include <ewol/eObject/EObject.h> #include <ewol/renderer/EObject.h>
#undef __class__ #undef __class__
#define __class__ "BufferView" #define __class__ "BufferView"

View File

@ -14,6 +14,7 @@
#include <BufferManager.h> #include <BufferManager.h>
#include <appl/globalMsg.h> #include <appl/globalMsg.h>
#include <ewol/widget/List.h> #include <ewol/widget/List.h>
#include <ewol/widget/Windows.h>
namespace appl namespace appl
{ {

View File

@ -17,7 +17,7 @@
#include <SearchData.h> #include <SearchData.h>
#include <ewol/widget/WidgetManager.h> #include <ewol/widget/WidgetManager.h>
#include <ewol/eObject/EObject.h> #include <ewol/renderer/EObject.h>
#undef __class__ #undef __class__
@ -231,7 +231,7 @@ bool CodeView::OnEventInput(const ewol::EventInput& _event)
limitedPos.setValue(etk_avg(1, limitedPos.x(), m_size.x()-1), limitedPos.setValue(etk_avg(1, limitedPos.x(), m_size.x()-1),
etk_avg(1, limitedPos.y(), m_size.y()-1)); etk_avg(1, limitedPos.y(), m_size.y()-1));
if (true == WidgetScrooled::OnEventInput(_event)) { if (true == WidgetScrooled::OnEventInput(_event)) {
ewol::widgetManager::FocusKeep(this); KeepFocus();
// nothing to do ... done on upper widget ... // nothing to do ... done on upper widget ...
return true; return true;
} }
@ -245,7 +245,7 @@ bool CodeView::OnEventInput(const ewol::EventInput& _event)
if (ewol::keyEvent::typeMouse == _event.GetType()) { if (ewol::keyEvent::typeMouse == _event.GetType()) {
if (ewol::keyEvent::statusDown == _event.GetStatus()) { if (ewol::keyEvent::statusDown == _event.GetStatus()) {
m_buttunOneSelected = true; m_buttunOneSelected = true;
ewol::widgetManager::FocusKeep(this); KeepFocus();
// TODO : Set something good // TODO : Set something good
BufferText* tmpBuffer = BufferManager::Get(m_bufferID); BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) { if (NULL!=tmpBuffer) {
@ -263,7 +263,7 @@ bool CodeView::OnEventInput(const ewol::EventInput& _event)
} }
if (ewol::keyEvent::statusSingle == _event.GetStatus()) { if (ewol::keyEvent::statusSingle == _event.GetStatus()) {
if (ewol::keyEvent::typeMouse == _event.GetType()) { if (ewol::keyEvent::typeMouse == _event.GetType()) {
ewol::widgetManager::FocusKeep(this); KeepFocus();
BufferText* tmpBuffer = BufferManager::Get(m_bufferID); BufferText* tmpBuffer = BufferManager::Get(m_bufferID);
if (NULL!=tmpBuffer) { if (NULL!=tmpBuffer) {
tmpBuffer->MouseEvent(limitedPos); tmpBuffer->MouseEvent(limitedPos);
@ -312,7 +312,7 @@ bool CodeView::OnEventInput(const ewol::EventInput& _event)
tmpBuffer->MouseEvent(limitedPos); tmpBuffer->MouseEvent(limitedPos);
} }
ewol::clipBoard::Request(ewol::clipBoard::clipboardSelection); ewol::clipBoard::Request(ewol::clipBoard::clipboardSelection);
ewol::widgetManager::FocusKeep(this); KeepFocus();
} }
} }
return true; return true;
@ -456,14 +456,14 @@ void CodeView::OnGetFocus(void)
/* /*
ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_bufferID); ewol::widgetMessageMultiCast::Send(GetWidgetId(), ednMsgBufferId, m_bufferID);
*/ */
ewol::Keyboard(true); ShowKeyboard();
APPL_INFO("Focus - In"); APPL_INFO("Focus - In");
} }
void CodeView::OnLostFocus(void) void CodeView::OnLostFocus(void)
{ {
ewol::Keyboard(false); HideKeyboard();
APPL_INFO("Focus - out"); APPL_INFO("Focus - out");
} }

View File

@ -28,7 +28,8 @@
#include <ewol/widget/meta/FileChooser.h> #include <ewol/widget/meta/FileChooser.h>
#include <ewol/widget/meta/Parameter.h> #include <ewol/widget/meta/Parameter.h>
#include <ewol/widget/WidgetManager.h> #include <ewol/widget/WidgetManager.h>
#include <ewol/eObject/EObject.h> #include <ewol/renderer/EObject.h>
#include <ewol/renderer/eContext.h>
#include <date/date.h> #include <date/date.h>
namespace appl namespace appl
@ -355,11 +356,11 @@ void MainWindows::OnReceiveMessage(const ewol::EMessage& _msg)
} }
etk::UString windowsTitle = "edn - "; etk::UString windowsTitle = "edn - ";
windowsTitle += directName; windowsTitle += directName;
ewol::SetTitle(windowsTitle); SetTitle(windowsTitle);
return; return;
} else { } else {
m_widgetLabelFileName->SetLabel(""); m_widgetLabelFileName->SetLabel("");
ewol::SetTitle("edn"); SetTitle("edn");
} }
return; return;
// TODO : Set the Title .... // TODO : Set the Title ....
@ -382,8 +383,8 @@ void MainWindows::OnReceiveMessage(const ewol::EMessage& _msg)
tmpWidget->MenuAdd("About", "", tmpSubWidget); tmpWidget->MenuAdd("About", "", tmpSubWidget);
} }
} else if (_msg.GetMessage() == ednMsgGuiReloadShader) { } else if (_msg.GetMessage() == ednMsgGuiReloadShader) {
ewol::resource::ReLoadResources(); ewol::GetContext().GetResourcesManager().ReLoadResources();
ewol::ForceRedrawAll(); ewol::GetContext().ForceRedrawAll();
} else if (_msg.GetMessage() == ednMsgGuiExit) { } else if (_msg.GetMessage() == ednMsgGuiExit) {
// TODO ... // TODO ...
} }

View File

@ -9,8 +9,8 @@
#include <appl/Debug.h> #include <appl/Debug.h>
#include <appl/global.h> #include <appl/global.h>
#include <HighlightManager.h> #include <HighlightManager.h>
#include <ewol/eObject/EObject.h> #include <ewol/renderer/EObject.h>
#include <ewol/eObject/EObjectManager.h> #include <ewol/renderer/EObjectManager.h>
#undef __class__ #undef __class__
#define __class__ "HighlightManager" #define __class__ "HighlightManager"

View File

@ -10,7 +10,8 @@
#include <appl/global.h> #include <appl/global.h>
#include <CTagsManager.h> #include <CTagsManager.h>
#include <BufferManager.h> #include <BufferManager.h>
#include <ewol/eObject/EObject.h> #include <ewol/renderer/EObject.h>
#include <ewol/renderer/eContext.h>
#include <ewol/widget/meta/FileChooser.h> #include <ewol/widget/meta/FileChooser.h>
#include <appl/Gui/TagFileSelection.h> #include <appl/Gui/TagFileSelection.h>
@ -134,7 +135,7 @@ void CTagsManager::OnReceiveMessage(const ewol::EMessage& _msg)
} else { } else {
tmpWidget->SetTitle("Open Exuberant Ctags File"); tmpWidget->SetTitle("Open Exuberant Ctags File");
tmpWidget->SetValidateLabel("Open"); tmpWidget->SetValidateLabel("Open");
ewol::WindowsPopUpAdd(tmpWidget); ewol::GetContext().GetWindows()->PopUpWidgetPush(tmpWidget);
tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpCtagsLoadFile); tmpWidget->RegisterOnEvent(this, ewolEventFileChooserValidate, ednEventPopUpCtagsLoadFile);
} }
} else if (_msg.GetData() == "ReLoad") { } else if (_msg.GetData() == "ReLoad") {
@ -241,7 +242,7 @@ void CTagsManager::JumpTo(void)
PrintTag(&entry); PrintTag(&entry);
tmpWidget->AddCtagsNewItem(myfile.GetName(), lineID); tmpWidget->AddCtagsNewItem(myfile.GetName(), lineID);
} while (tagsFindNext (m_ctagFile, &entry) == TagSuccess); } while (tagsFindNext (m_ctagFile, &entry) == TagSuccess);
ewol::WindowsPopUpAdd(tmpWidget); ewol::GetContext().GetWindows()->PopUpWidgetPush(tmpWidget);
tmpWidget->RegisterOnEvent(this, applEventctagsSelection); tmpWidget->RegisterOnEvent(this, applEventctagsSelection);
} }
} else { } else {

View File

@ -9,10 +9,11 @@
#include <appl/global.h> #include <appl/global.h>
#include <ColorizeManager.h> #include <ColorizeManager.h>
#include <appl/globalMsg.h> #include <appl/globalMsg.h>
#include <ewol/eObject/EObject.h> #include <ewol/renderer/EObject.h>
#include <ewol/renderer/ResourceManager.h> #include <ewol/renderer/eContext.h>
#include <ewol/resources/ResourceManager.h>
#include <etk/os/FSNode.h> #include <etk/os/FSNode.h>
#include <ewol/UserConfig.h> //#include <ewol/UserConfig.h>
#undef __class__ #undef __class__
#define __class__ "globals" #define __class__ "globals"
@ -118,7 +119,7 @@ static myParamGlobal& l_obj(void)
void globals::Init(void) void globals::Init(void)
{ {
ewol::userConfig::AddUserConfig(&l_obj()); //ewol::userConfig::AddUserConfig(&l_obj());
} }
void globals::UnInit(void) void globals::UnInit(void)
@ -305,7 +306,8 @@ void globals::ParameterGlobalsGui::OnReceiveMessage(const ewol::EMessage& _msg)
etk::theme::SetName("GUI", "default");; etk::theme::SetName("GUI", "default");;
} }
// Reload shaders and graphic system ... // Reload shaders and graphic system ...
ewol::resource::ReLoadResources(); ewol::GetContext().GetResourcesManager().ReLoadResources();
ewol::GetContext().ForceRedrawAll();
} }
} }

View File

@ -9,7 +9,7 @@
#include <etk/types.h> #include <etk/types.h>
#include <etk/UString.h> #include <etk/UString.h>
#include <ewol/ewol.h> #include <ewol/ewol.h>
#include <ewol/eObject/EObject.h> #include <ewol/renderer/EObject.h>
#include <ewol/widget/WidgetManager.h> #include <ewol/widget/WidgetManager.h>
#include <appl/Debug.h> #include <appl/Debug.h>
@ -25,9 +25,10 @@
#include <readtags.h> #include <readtags.h>
#include <CTagsManager.h> #include <CTagsManager.h>
#include <globalMsg.h> #include <globalMsg.h>
#include <ewol/config.h> //#include <ewol/config.h>
#include <ewol/commandLine.h> #include <ewol/commandLine.h>
#include <ewol/UserConfig.h> //#include <ewol/UserConfig.h>
#include <ewol/renderer/eContext.h>
MainWindows * basicWindows = NULL; MainWindows * basicWindows = NULL;
@ -37,52 +38,36 @@ MainWindows * basicWindows = NULL;
* @param std IO * @param std IO
* @return std IO * @return std IO
*/ */
int main(int argc, const char *argv[]) int main(int _argc, const char *_argv[])
{ {
// only one things to do: // only one things to do:
return ewol::Run(argc, argv); return ewol::Run(_argc, _argv);
} }
/** /**
* @brief main application function Initialisation * @brief main application function Initialisation
*/ */
void APP_Init(void) bool APP_Init(ewol::eContext& _context)
{ {
#ifdef MODE_RELEASE APPL_INFO("==> Init APPL (START) [" << ewol::GetBoardType() << "] (" << ewol::GetCompilationMode() << ")");
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 << ")");
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 #ifdef __TARGET_OS__Android
ewol::config::FontSetDefault("FreeSerif", 19); _context.GetFontDefault().Set("FreeSerif", 19);
#else #else
ewol::config::FontSetDefault("FreeSerif;DejaVuSansMono",14); _context.GetFontDefault().Set("FreeSerif;DejaVuSansMono",14);
#endif #endif
// set the application icon ... // set the application icon ...
ewol::SetIcon("DATA:icon.png"); _context.SetIcon("DATA:icon.png");
// init internal global value // init internal global value
globals::Init(); globals::Init();
// set the application icon ...
ewol::SetIcon("DATA:icon.png");
// init ALL Singleton : // init ALL Singleton :
//(void)CTagsManager::getInstance(); //(void)CTagsManager::getInstance();
@ -98,12 +83,12 @@ void APP_Init(void)
cTagsManager::Init(); cTagsManager::Init();
// Request load of the user configuration ... // Request load of the user configuration ...
ewol::userConfig::Load(); //ewol::userConfig::Load();
char cCurrentPath[FILENAME_MAX]; char cCurrentPath[FILENAME_MAX];
// get the curent program folder // get the curent program folder
if (!getcwd(cCurrentPath, FILENAME_MAX)) { if (!getcwd(cCurrentPath, FILENAME_MAX)) {
return ; return false;
} }
cCurrentPath[FILENAME_MAX - 1] = '\0'; cCurrentPath[FILENAME_MAX - 1] = '\0';
//APPL_INFO("The current working directory is " << cCurrentPath); //APPL_INFO("The current working directory is " << cCurrentPath);
@ -112,38 +97,39 @@ void APP_Init(void)
if (NULL == basicWindows) { if (NULL == basicWindows) {
APPL_ERROR("Can not allocate the basic windows"); APPL_ERROR("Can not allocate the basic windows");
ewol::Stop(); _context.Stop();
return; return false;
} }
// create the specific windows // create the specific windows
ewol::WindowsSet(basicWindows); _context.SetWindows(basicWindows);
// add files // add files
APPL_INFO("show list of files : "); APPL_INFO("show list of files : ");
bool ctagDetected = false; bool ctagDetected = false;
for( int32_t iii=0 ; iii<ewol::commandLine::Size(); iii++) { for( int32_t iii=0 ; iii<_context.GetCmd().Size(); iii++) {
etk::UString tmpppp = ewol::commandLine::Get(iii); etk::UString tmpppp = _context.GetCmd().Get(iii);
if (tmpppp == "-t") { if (tmpppp == "-t") {
ctagDetected = true; ctagDetected = true;
} else if (true == ctagDetected) { } else if (true == ctagDetected) {
APPL_INFO("Load ctag file : \"" << tmpppp << "\"" ); APPL_INFO("Load ctag file : \"" << tmpppp << "\"" );
ctagDetected = false; ctagDetected = false;
ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgCtagsLoadFile, tmpppp); _context.GetEObjectManager().MultiCast().AnonymousSend(ednMsgCtagsLoadFile, tmpppp);
} else { } else {
APPL_INFO("need load file : \"" << tmpppp << "\"" ); APPL_INFO("need load file : \"" << tmpppp << "\"" );
ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgOpenFile, tmpppp); _context.GetEObjectManager().MultiCast().AnonymousSend(ednMsgOpenFile, tmpppp);
} }
} }
APPL_INFO("==> Init "PROJECT_NAME" (END)"); APPL_INFO("==> Init "PROJECT_NAME" (END)");
return true;
} }
/** /**
* @brief main application function Un-Initialisation * @brief main application function Un-Initialisation
*/ */
void APP_UnInit(void) void APP_UnInit(ewol::eContext& _context)
{ {
APPL_INFO("==> Un-Init "PROJECT_NAME" (START)"); APPL_INFO("==> Un-Init "PROJECT_NAME" (START)");

View File

@ -100,8 +100,8 @@ def Create(target):
myModule.pkgSet("DESCRIPTION", "Text editor for sources code with ctags management") myModule.pkgSet("DESCRIPTION", "Text editor for sources code with ctags management")
myModule.pkgSet("NAME", "Editeur de N'ours") myModule.pkgSet("NAME", "Editeur de N'ours")
myModule.pkgAddRight("WRITE_EXTERNAL_STORAGE") myModule.pkgAdd("RIGHT", "WRITE_EXTERNAL_STORAGE")
myModule.pkgAddRight("SET_ORIENTATION") myModule.pkgAdd("RIGHT", "SET_ORIENTATION")
# add the currrent module at the # add the currrent module at the
return myModule return myModule