[DEV] update to the new ewol system
This commit is contained in:
parent
b5371c4d13
commit
ad12b68ead
@ -9,8 +9,8 @@
|
||||
#include <appl/Debug.h>
|
||||
#include <appl/global.h>
|
||||
#include <BufferManager.h>
|
||||
#include <ewol/eObject/EObject.h>
|
||||
#include <ewol/eObject/EObjectManager.h>
|
||||
#include <ewol/renderer/EObject.h>
|
||||
#include <ewol/renderer/EObjectManager.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "classBufferManager"
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Widget.h>
|
||||
#include <ewol/clipBoard.h>
|
||||
#include <ewol/renderer/eContext.h>
|
||||
|
||||
|
||||
#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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,8 +10,8 @@
|
||||
#include <appl/global.h>
|
||||
#include <ColorizeManager.h>
|
||||
#include <exml/exml.h>
|
||||
#include <ewol/eObject/EObject.h>
|
||||
#include <ewol/eObject/EObjectManager.h>
|
||||
#include <ewol/renderer/EObject.h>
|
||||
#include <ewol/renderer/EObjectManager.h>
|
||||
#include <etk/os/FSNode.h>
|
||||
|
||||
#define PFX "ColorizeManager "
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <BufferManager.h>
|
||||
#include <ColorizeManager.h>
|
||||
#include <MainWindows.h>
|
||||
#include <ewol/eObject/EObject.h>
|
||||
#include <ewol/renderer/EObject.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "BufferView"
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include <BufferManager.h>
|
||||
#include <appl/globalMsg.h>
|
||||
#include <ewol/widget/List.h>
|
||||
#include <ewol/widget/Windows.h>
|
||||
|
||||
namespace appl
|
||||
{
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <SearchData.h>
|
||||
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/eObject/EObject.h>
|
||||
#include <ewol/renderer/EObject.h>
|
||||
|
||||
|
||||
#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");
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,8 @@
|
||||
#include <ewol/widget/meta/FileChooser.h>
|
||||
#include <ewol/widget/meta/Parameter.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>
|
||||
|
||||
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 ...
|
||||
}
|
||||
|
@ -9,8 +9,8 @@
|
||||
#include <appl/Debug.h>
|
||||
#include <appl/global.h>
|
||||
#include <HighlightManager.h>
|
||||
#include <ewol/eObject/EObject.h>
|
||||
#include <ewol/eObject/EObjectManager.h>
|
||||
#include <ewol/renderer/EObject.h>
|
||||
#include <ewol/renderer/EObjectManager.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "HighlightManager"
|
||||
|
@ -10,7 +10,8 @@
|
||||
#include <appl/global.h>
|
||||
#include <CTagsManager.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 <appl/Gui/TagFileSelection.h>
|
||||
|
||||
@ -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 {
|
||||
|
@ -9,10 +9,11 @@
|
||||
#include <appl/global.h>
|
||||
#include <ColorizeManager.h>
|
||||
#include <appl/globalMsg.h>
|
||||
#include <ewol/eObject/EObject.h>
|
||||
#include <ewol/renderer/ResourceManager.h>
|
||||
#include <ewol/renderer/EObject.h>
|
||||
#include <ewol/renderer/eContext.h>
|
||||
#include <ewol/resources/ResourceManager.h>
|
||||
#include <etk/os/FSNode.h>
|
||||
#include <ewol/UserConfig.h>
|
||||
//#include <ewol/UserConfig.h>
|
||||
|
||||
#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();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <etk/types.h>
|
||||
#include <etk/UString.h>
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/eObject/EObject.h>
|
||||
#include <ewol/renderer/EObject.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
|
||||
#include <appl/Debug.h>
|
||||
@ -25,9 +25,10 @@
|
||||
#include <readtags.h>
|
||||
#include <CTagsManager.h>
|
||||
#include <globalMsg.h>
|
||||
#include <ewol/config.h>
|
||||
//#include <ewol/config.h>
|
||||
#include <ewol/commandLine.h>
|
||||
#include <ewol/UserConfig.h>
|
||||
//#include <ewol/UserConfig.h>
|
||||
#include <ewol/renderer/eContext.h>
|
||||
|
||||
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<ewol::commandLine::Size(); iii++) {
|
||||
etk::UString tmpppp = ewol::commandLine::Get(iii);
|
||||
for( int32_t iii=0 ; iii<_context.GetCmd().Size(); iii++) {
|
||||
etk::UString tmpppp = _context.GetCmd().Get(iii);
|
||||
if (tmpppp == "-t") {
|
||||
ctagDetected = true;
|
||||
} else if (true == ctagDetected) {
|
||||
APPL_INFO("Load ctag file : \"" << tmpppp << "\"" );
|
||||
ctagDetected = false;
|
||||
ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgCtagsLoadFile, tmpppp);
|
||||
_context.GetEObjectManager().MultiCast().AnonymousSend(ednMsgCtagsLoadFile, tmpppp);
|
||||
} else {
|
||||
APPL_INFO("need load file : \"" << tmpppp << "\"" );
|
||||
ewol::EObjectMessageMultiCast::AnonymousSend(ednMsgOpenFile, tmpppp);
|
||||
_context.GetEObjectManager().MultiCast().AnonymousSend(ednMsgOpenFile, tmpppp);
|
||||
}
|
||||
}
|
||||
|
||||
APPL_INFO("==> 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)");
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user