67 lines
2.1 KiB
C++
Raw Normal View History

/** @file
2014-12-04 23:30:36 +01:00
* @author Edouard DUPIN
* @copyright 2010, Edouard DUPIN, all right reserved
* @license BSD 3 clauses (see license file)
*/
#include <etk/types.hpp>
#include <ewol/ewol.hpp>
#include <gale/context/commandLine.hpp>
2014-12-04 23:30:36 +01:00
#include <appl/debug.hpp>
#include <appl/Windows.hpp>
#include <ewol/object/Object.hpp>
#include <ewol/widget/Manager.hpp>
#include <ewol/context/Context.hpp>
#include <appl/widget/VectorDisplay.hpp>
2014-12-04 23:30:36 +01:00
class MainApplication : public ewol::context::Application {
public:
2016-03-16 21:42:49 +01:00
void onCreate(ewol::Context& _context) override {
APPL_INFO(" == > CREATE ... " << PROJECT_NAME << " v" << APPL_VERSION << " (START) [" << gale::getBoardType() << "] (" << gale::getCompilationMode() << ") (BEGIN)");
2016-03-16 21:42:49 +01:00
for( int32_t iii=0 ; iii<_context.getCmd().size(); iii++) {
2017-08-28 00:05:43 +02:00
etk::String tmpppp = _context.getCmd().get(iii);
2016-03-16 21:42:49 +01:00
if ( tmpppp == "-h"
|| tmpppp == "--help") {
APPL_INFO(" -h/--help display this help" );
exit(0);
}
}
2014-12-04 23:30:36 +01:00
// TODO : Remove this : Move if in the windows properties
_context.setSize(vec2(800, 600));
// select internal data for font ...
_context.getFontDefault().setUseExternal(true);
_context.getFontDefault().set("FreeSerif;DejaVuSansMono", 19);
appl::widget::VectorDisplay::createManagerWidget(_context.getWidgetManager());
2016-03-16 21:42:49 +01:00
ewol::widget::WindowsShared basicWindows = appl::Windows::create();
2014-12-04 23:30:36 +01:00
// create the specific windows
_context.setWindows(basicWindows);
2016-03-16 21:42:49 +01:00
APPL_INFO("==> CREATE ... " PROJECT_NAME " (END)");
}
void onStart(ewol::Context& _context) override {
APPL_INFO("==> START ... " PROJECT_NAME " (BEGIN)");
// nothing to do ...
APPL_INFO("==> START ... " PROJECT_NAME " (END)");
2014-12-04 23:30:36 +01:00
}
2016-03-16 21:42:49 +01:00
void onStop(ewol::Context& _context) override {
APPL_INFO("==> STOP ... " PROJECT_NAME " (START)");
// nothing to do ...
APPL_INFO("==> STOP ... " PROJECT_NAME " (END)");
2014-12-04 23:30:36 +01:00
}
};
/**
* @brief Main of the program (This can be set in every case, but it is not used in Andoid...).
* @param std IO
* @return std IO
*/
int main(int _argc, const char *_argv[]) {
// second possibility
return ewol::run(new MainApplication(), _argc, _argv);
}