ewol/Sources/Main.cpp

159 lines
4.3 KiB
C++
Raw Normal View History

/**
*******************************************************************************
* @file Main.cpp
* @brief main fonction
* @author Edouard DUPIN
* @date 13/10/2011
* @par Project
2011-10-17 18:05:15 +02:00
* ewol
*
* @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>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
// 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-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);
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);
};
~Plop(void)
{
};
};
static Plop * myWindowsExample = NULL;
/**
* @brief main application function Initialisation
*/
void APP_Init(int argc, char *argv[])
{
ewol::ChangeSize(800, 600);
/*
2011-10-31 11:01:47 +01:00
if (true == ewol::AddFont("dataTest/TextMonospace.ebt", true, true, true) ) {
//fontID = GetFontIdWithFileName("dataTest/TextMonospace.ebt");
}
*/
ewol::SetFontFolder("dataTest/Font");
2011-12-05 10:12:08 +01:00
//ewol::SetDefaultFont("freefont/FreeMono", 14);
ewol::SetDefaultFont("ebtfont/Monospace", 14);
//ewol::theme::LoadDefault("dataTest/exemple.eol");
etk::File fileTmp("dataTest/exemple.eol", etk::FILE_TYPE_DATA);
ewol::theme::LoadDefault(fileTmp);
/*
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-10-31 13:01:33 +01:00
myWindowsExample = new Plop();
2011-10-31 13:01:33 +01:00
// create the specific windows
ewol::DisplayWindows(myWindowsExample);
}
/**
* @brief main application function Un-Initialisation
*/
void APP_UnInit(void)
{
delete(myWindowsExample);
}