2011-10-13 14:17:23 +02:00
|
|
|
|
/**
|
|
|
|
|
*******************************************************************************
|
|
|
|
|
* @file Main.cpp
|
|
|
|
|
* @brief main fonction
|
|
|
|
|
* @author Edouard DUPIN
|
|
|
|
|
* @date 13/10/2011
|
|
|
|
|
* @par Project
|
2011-10-17 18:05:15 +02:00
|
|
|
|
* ewol
|
2011-10-13 14:17:23 +02:00
|
|
|
|
*
|
|
|
|
|
* @par Copyright
|
|
|
|
|
* Copyright 2011 Edouard DUPIN, all right reserved
|
|
|
|
|
*
|
|
|
|
|
* This software is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
* ANY WARRANTY.
|
|
|
|
|
*
|
|
|
|
|
* Licence summary :
|
|
|
|
|
* You can modify and redistribute the sources code and binaries.
|
|
|
|
|
* You can send me the bug-fix
|
|
|
|
|
*
|
|
|
|
|
* Term of the licence in in the file licence.txt.
|
|
|
|
|
*
|
|
|
|
|
*******************************************************************************
|
|
|
|
|
*/
|
|
|
|
|
|
2011-10-17 18:05:15 +02:00
|
|
|
|
|
2011-11-23 11:37:38 +01:00
|
|
|
|
#include <ewol/ewol.h>
|
|
|
|
|
#include <ewol/Font.h>
|
2011-11-23 18:26:25 +01:00
|
|
|
|
#include <ewol/themeManager.h>
|
2011-11-23 11:37:38 +01:00
|
|
|
|
#include <ewol/widget/Button.h>
|
|
|
|
|
#include <ewol/widget/CheckBox.h>
|
|
|
|
|
#include <ewol/widget/SizerHori.h>
|
|
|
|
|
#include <ewol/widget/SizerVert.h>
|
|
|
|
|
#include <ewol/widget/Test.h>
|
2011-10-17 18:05:15 +02:00
|
|
|
|
|
|
|
|
|
#include <unistd.h>
|
2011-10-13 14:17:23 +02:00
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
2011-10-21 15:07:56 +02:00
|
|
|
|
// need to run xcompmgr to have transparency
|
|
|
|
|
|
|
|
|
|
class Plop :public ewol::Windows
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Plop(void)
|
|
|
|
|
{
|
2011-11-08 15:59:25 +01:00
|
|
|
|
// generate the display :
|
|
|
|
|
ewol::SizerHori * mySizer = new ewol::SizerHori();
|
|
|
|
|
SetSubWidget(mySizer);
|
2011-10-21 15:07:56 +02:00
|
|
|
|
|
2011-11-08 15:59:25 +01:00
|
|
|
|
ewol::Button * myButton = new ewol::Button("Mon Labell 1");
|
|
|
|
|
mySizer->SubWidgetAdd(myButton);
|
|
|
|
|
|
|
|
|
|
ewol::SizerVert * mySizerVert = new ewol::SizerVert();
|
|
|
|
|
mySizer->SubWidgetAdd(mySizerVert);
|
|
|
|
|
|
|
|
|
|
myButton = new ewol::Button("BT 3");
|
|
|
|
|
myButton->SetExpendX(true);
|
2011-11-08 18:19:52 +01:00
|
|
|
|
//myButton->SetExpendY(true);
|
2011-11-08 15:59:25 +01:00
|
|
|
|
mySizerVert->SubWidgetAdd(myButton);
|
2011-11-09 09:50:05 +01:00
|
|
|
|
|
|
|
|
|
ewol::Test * myTest = new ewol::Test();
|
|
|
|
|
mySizerVert->SubWidgetAdd(myTest);
|
|
|
|
|
|
2011-11-21 07:33:30 +01:00
|
|
|
|
ewol::CheckBox * myCheckBox = new ewol::CheckBox("mon label d'exemple de test");
|
|
|
|
|
mySizerVert->SubWidgetAdd(myCheckBox);
|
|
|
|
|
myCheckBox = new ewol::CheckBox("Exemple 2");
|
|
|
|
|
mySizerVert->SubWidgetAdd(myCheckBox);
|
|
|
|
|
myCheckBox = new ewol::CheckBox("Exemple 3 et plus si afinit<69>");
|
|
|
|
|
mySizerVert->SubWidgetAdd(myCheckBox);
|
|
|
|
|
|
|
|
|
|
myTest = new ewol::Test();
|
2011-11-21 18:20:30 +01:00
|
|
|
|
myTest->SetExpendY(true);
|
2011-11-21 07:33:30 +01:00
|
|
|
|
mySizerVert->SubWidgetAdd(myTest);
|
2011-11-13 14:36:26 +01:00
|
|
|
|
myButton = new ewol::Button("4 4 BT");
|
2011-11-21 18:20:30 +01:00
|
|
|
|
myButton->SetExpendY(true);
|
2011-11-08 15:59:25 +01:00
|
|
|
|
mySizerVert->SubWidgetAdd(myButton);
|
|
|
|
|
|
|
|
|
|
myButton = new ewol::Button("Exemple 2");
|
|
|
|
|
myButton->SetExpendX(true);
|
|
|
|
|
mySizer->SubWidgetAdd(myButton);
|
2011-10-21 15:07:56 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
~Plop(void)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2011-12-04 13:34:24 +01:00
|
|
|
|
static Plop * myWindowsExample = NULL;
|
|
|
|
|
|
2011-10-13 14:17:23 +02:00
|
|
|
|
/**
|
2011-12-04 13:34:24 +01:00
|
|
|
|
* @brief main application function Initialisation
|
2011-10-13 14:17:23 +02:00
|
|
|
|
*/
|
2011-12-04 13:34:24 +01:00
|
|
|
|
void APP_Init(int argc, char *argv[])
|
2011-10-13 14:17:23 +02:00
|
|
|
|
{
|
2011-11-25 14:47:09 +01:00
|
|
|
|
ewol::ChangeSize(800, 600);
|
2011-11-06 20:24:44 +01:00
|
|
|
|
/*
|
2011-10-31 11:01:47 +01:00
|
|
|
|
if (true == ewol::AddFont("dataTest/TextMonospace.ebt", true, true, true) ) {
|
|
|
|
|
//fontID = GetFontIdWithFileName("dataTest/TextMonospace.ebt");
|
|
|
|
|
}
|
2011-11-06 20:24:44 +01:00
|
|
|
|
*/
|
2011-12-08 18:23:30 +01:00
|
|
|
|
ewol::SetFontFolder("dataTest/Font");
|
2011-12-05 10:12:08 +01:00
|
|
|
|
//ewol::SetDefaultFont("freefont/FreeMono", 14);
|
|
|
|
|
ewol::SetDefaultFont("ebtfont/Monospace", 14);
|
2011-12-05 18:14:43 +01:00
|
|
|
|
//ewol::theme::LoadDefault("dataTest/exemple.eol");
|
2011-12-08 18:23:30 +01:00
|
|
|
|
etk::File fileTmp("dataTest/exemple.eol", etk::FILE_TYPE_DATA);
|
|
|
|
|
ewol::theme::LoadDefault(fileTmp);
|
|
|
|
|
/*
|
2011-12-05 18:14:43 +01:00
|
|
|
|
etk::File tmpFile("/data/data/com.example.EwolActivity.app/assets/theme/exemple.eol");
|
|
|
|
|
if (tmpFile.Exist() ) {
|
|
|
|
|
EWOL_WARNING("file existed : " << tmpFile);
|
|
|
|
|
}
|
|
|
|
|
tmpFile = ("/data/data/com.example.EwolActivity/assets/theme/exemple.eol");
|
|
|
|
|
if (tmpFile.Exist() ) {
|
|
|
|
|
EWOL_WARNING("file existed : " << tmpFile);
|
|
|
|
|
}
|
|
|
|
|
tmpFile=("/data/com.example.EwolActivity.app/assets/theme/exemple.eol");
|
|
|
|
|
if (tmpFile.Exist() ) {
|
|
|
|
|
EWOL_WARNING("file existed : " << tmpFile);
|
|
|
|
|
}
|
|
|
|
|
tmpFile=("/data/com.example.EwolActivity/assets/theme/exemple.eol");
|
|
|
|
|
if (tmpFile.Exist() ) {
|
|
|
|
|
EWOL_WARNING("file existed : " << tmpFile);
|
|
|
|
|
}
|
|
|
|
|
tmpFile=("/data/data/com.example.ewolactivity.app/assets/theme/exemple.eol");
|
|
|
|
|
if (tmpFile.Exist() ) {
|
|
|
|
|
EWOL_WARNING("file existed : " << tmpFile);
|
|
|
|
|
}
|
|
|
|
|
tmpFile=("/data/data/com.example.ewolactivity/assets/theme/exemple.eol");
|
|
|
|
|
if (tmpFile.Exist() ) {
|
|
|
|
|
EWOL_WARNING("file existed : " << tmpFile);
|
|
|
|
|
}
|
|
|
|
|
tmpFile=("/data/com.example.ewolactivity.app/assets/theme/exemple.eol");
|
|
|
|
|
if (tmpFile.Exist() ) {
|
|
|
|
|
EWOL_WARNING("file existed : " << tmpFile);
|
|
|
|
|
}
|
|
|
|
|
tmpFile=("/data/com.example.ewolactivity/assets/theme/exemple.eol");
|
|
|
|
|
if (tmpFile.Exist() ) {
|
|
|
|
|
EWOL_WARNING("file existed : " << tmpFile);
|
|
|
|
|
}
|
2011-12-08 18:23:30 +01:00
|
|
|
|
*/
|
2011-12-05 18:14:43 +01:00
|
|
|
|
|
2011-10-31 13:01:33 +01:00
|
|
|
|
|
2011-12-04 13:34:24 +01:00
|
|
|
|
myWindowsExample = new Plop();
|
2011-10-31 13:01:33 +01:00
|
|
|
|
|
|
|
|
|
|
2011-10-21 15:07:56 +02:00
|
|
|
|
// create the specific windows
|
|
|
|
|
ewol::DisplayWindows(myWindowsExample);
|
2011-12-04 13:34:24 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief main application function Un-Initialisation
|
|
|
|
|
*/
|
|
|
|
|
void APP_UnInit(void)
|
|
|
|
|
{
|
2011-10-21 15:07:56 +02:00
|
|
|
|
delete(myWindowsExample);
|
2011-10-13 14:17:23 +02:00
|
|
|
|
}
|