[DEV] compilation back on Android/windows
This commit is contained in:
parent
508162dfc8
commit
d3eed67f00
2
Build
2
Build
@ -1 +1 @@
|
|||||||
Subproject commit 4016ab8885720c1e9117c7f9542f7c6d3f3e4bd3
|
Subproject commit 0793d9eb2c2da85dc3dbe854886ba6b2fbadf4bd
|
@ -42,6 +42,12 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __TARGET_OS__Windows
|
||||||
|
// For ctime
|
||||||
|
#include <time.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// zip file of the apk file for Android ==> set to zip file apk access
|
// zip file of the apk file for Android ==> set to zip file apk access
|
||||||
static etk::UString s_fileAPK = "";
|
static etk::UString s_fileAPK = "";
|
||||||
static etk::UString baseApplName = "ewolNoName";
|
static etk::UString baseApplName = "ewolNoName";
|
||||||
@ -137,12 +143,14 @@ void etk::InitDefaultFolder(const char * applName)
|
|||||||
#else
|
#else
|
||||||
char cCurrentPath[FILENAME_MAX];
|
char cCurrentPath[FILENAME_MAX];
|
||||||
if (!getcwd(cCurrentPath, FILENAME_MAX)) {
|
if (!getcwd(cCurrentPath, FILENAME_MAX)) {
|
||||||
baseFolderData = "./out/Linux/debug/staging/usr/share/";
|
baseFolderData = ".";
|
||||||
} else {
|
} else {
|
||||||
cCurrentPath[FILENAME_MAX - 1] = '\0';
|
cCurrentPath[FILENAME_MAX - 1] = '\0';
|
||||||
baseFolderData = cCurrentPath;
|
baseFolderData = cCurrentPath;
|
||||||
baseFolderData += "/out/Linux/debug/staging/usr/share/";
|
|
||||||
}
|
}
|
||||||
|
baseFolderData += "/out/Linux/debug/staging/";
|
||||||
|
baseFolderData += baseApplName;
|
||||||
|
baseFolderData += "/usr/share/";
|
||||||
#endif
|
#endif
|
||||||
baseFolderData += baseApplName;
|
baseFolderData += baseApplName;
|
||||||
baseFolderData += "/";
|
baseFolderData += "/";
|
||||||
@ -175,21 +183,21 @@ etk::UString etk::GetUserHomeFolder(void)
|
|||||||
|
|
||||||
|
|
||||||
#ifdef __TARGET_OS__Android
|
#ifdef __TARGET_OS__Android
|
||||||
bool etk::File::LoadDataZip(void)
|
bool etk::FSNode::LoadDataZip(void)
|
||||||
{
|
{
|
||||||
if (NULL != m_zipData) {
|
if (NULL != m_zipData) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
struct zip_file * m_zipPointerFile= zip_fopen_index(s_APKArchive, m_idZipFile, 0);
|
struct zip_file * m_zipPointerFile= zip_fopen_index(s_APKArchive, m_idZipFile, 0);
|
||||||
if (NULL == m_zipPointerFile) {
|
if (NULL == m_zipPointerFile) {
|
||||||
TK_ERROR("Can not find the file name=\"" << GetCompleateName() << "\"");
|
TK_ERROR("Can not find the file name" << *this);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// get the fileSize .... end read all the data from the zip files
|
// get the fileSize .... end read all the data from the zip files
|
||||||
struct zip_stat zipFileProperty;
|
struct zip_stat zipFileProperty;
|
||||||
zip_stat_init(&zipFileProperty);
|
zip_stat_init(&zipFileProperty);
|
||||||
zip_stat_index(s_APKArchive, m_idZipFile, 0, &zipFileProperty);
|
zip_stat_index(s_APKArchive, m_idZipFile, 0, &zipFileProperty);
|
||||||
TK_VERBOSE("LOAD data from the files : \"" << GetCompleateName() << "\"");
|
TK_VERBOSE("LOAD data from the files : " << *this );
|
||||||
/*
|
/*
|
||||||
TK_DEBUG(" name=" << zipFileProperty.name);
|
TK_DEBUG(" name=" << zipFileProperty.name);
|
||||||
TK_DEBUG(" index=" << zipFileProperty.index);
|
TK_DEBUG(" index=" << zipFileProperty.index);
|
||||||
@ -203,14 +211,14 @@ bool etk::File::LoadDataZip(void)
|
|||||||
m_zipDataSize = zipFileProperty.size;
|
m_zipDataSize = zipFileProperty.size;
|
||||||
m_zipData = new char[m_zipDataSize +10];
|
m_zipData = new char[m_zipDataSize +10];
|
||||||
if (NULL == m_zipData) {
|
if (NULL == m_zipData) {
|
||||||
TK_ERROR("File allocation ERROR : \"" << GetCompleateName() << "\"");
|
TK_ERROR("File allocation ERROR : " << *this);
|
||||||
zip_fclose(m_zipPointerFile);
|
zip_fclose(m_zipPointerFile);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
memset(m_zipData, 0, m_zipDataSize +10);
|
memset(m_zipData, 0, m_zipDataSize +10);
|
||||||
int32_t sizeTmp = zip_fread(m_zipPointerFile, m_zipData, m_zipDataSize);
|
int32_t sizeTmp = zip_fread(m_zipPointerFile, m_zipData, m_zipDataSize);
|
||||||
if (sizeTmp != m_zipDataSize) {
|
if (sizeTmp != m_zipDataSize) {
|
||||||
TK_ERROR("File load data ERROR : \"" << GetCompleateName() << "\"");
|
TK_ERROR("File load data ERROR : " << *this);
|
||||||
zip_fclose(m_zipPointerFile);
|
zip_fclose(m_zipPointerFile);
|
||||||
delete[] m_zipData;
|
delete[] m_zipData;
|
||||||
return false;
|
return false;
|
||||||
@ -407,7 +415,7 @@ void etk::FSNode::PrivateSetName(etk::UString& newName)
|
|||||||
|
|
||||||
bool isRoofFolder = false;
|
bool isRoofFolder = false;
|
||||||
#ifdef __TARGET_OS__Windows
|
#ifdef __TARGET_OS__Windows
|
||||||
for (char iii='a' ; iii<='z' iii++) {
|
for (char iii='a' ; iii<='z' ; iii++) {
|
||||||
char tmpVal[10];
|
char tmpVal[10];
|
||||||
char tmpValMaj[10];
|
char tmpValMaj[10];
|
||||||
sprintf(tmpVal, "%c:/", iii);
|
sprintf(tmpVal, "%c:/", iii);
|
||||||
@ -496,7 +504,7 @@ bool DirectCheckFile(etk::UString tmpFileNameDirect, bool checkInAPKIfNeeded=fal
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (tmpFileNameDirect == name) {
|
if (tmpFileNameDirect == name) {
|
||||||
return true
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -617,23 +625,23 @@ void etk::FSNode::UpdateFileSystemProperty(void)
|
|||||||
TK_ERROR("Can not get pointer on file in the APK file id " << iii);
|
TK_ERROR("Can not get pointer on file in the APK file id " << iii);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (tmpFileNameDirect == name) {
|
if (m_systemFileName == name) {
|
||||||
m_idZipFile = iii;
|
m_idZipFile = iii;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( -1 == m_idZipFile
|
if( -1 == m_idZipFile
|
||||||
|| m_idZipFile >= s_APKnbFiles)) {
|
|| m_idZipFile >= s_APKnbFiles) {
|
||||||
TK_ERROR("File Does not existed ... in APK : \"" << tmpFilename << "\"");
|
TK_ERROR("File Does not existed ... in APK : \"" << m_systemFileName << "\"");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// note : Zip does not support other think than file ...
|
// note : Zip does not support other think than file ...
|
||||||
// TODO : Suport folder parsing ...
|
// TODO : Suport folder parsing ...
|
||||||
m_typeNode=FSN_FILE;
|
m_typeNode=FSN_FILE;
|
||||||
m_rights.IsUserReadable(true);
|
m_rights.SetUserReadable(true);
|
||||||
// TODO : Set the time of the file (time program compilation)
|
// TODO : Set the time of the file (time program compilation)
|
||||||
// TODO : Set the USER ID in the group and the user Id ...
|
// TODO : Set the USER ID in the group and the user Id ...
|
||||||
TK_DBG_MODE("File existed ... in APK : \"" << tmpFilename << "\" ==> id=" << m_idZipFile);
|
TK_DBG_MODE("File existed ... in APK : \"" << m_systemFileName << "\" ==> id=" << m_idZipFile);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -649,9 +657,13 @@ void etk::FSNode::UpdateFileSystemProperty(void)
|
|||||||
case S_IFCHR: m_typeNode=etk::FSN_CHARACTER; break;
|
case S_IFCHR: m_typeNode=etk::FSN_CHARACTER; break;
|
||||||
case S_IFDIR: m_typeNode=etk::FSN_FOLDER; break;
|
case S_IFDIR: m_typeNode=etk::FSN_FOLDER; break;
|
||||||
case S_IFIFO: m_typeNode=etk::FSN_FIFO; break;
|
case S_IFIFO: m_typeNode=etk::FSN_FIFO; break;
|
||||||
|
#ifndef __TARGET_OS__Windows
|
||||||
case S_IFLNK: m_typeNode=etk::FSN_LINK; break;
|
case S_IFLNK: m_typeNode=etk::FSN_LINK; break;
|
||||||
|
#endif
|
||||||
case S_IFREG: m_typeNode=etk::FSN_FILE; break;
|
case S_IFREG: m_typeNode=etk::FSN_FILE; break;
|
||||||
|
#ifndef __TARGET_OS__Windows
|
||||||
case S_IFSOCK: m_typeNode=etk::FSN_SOCKET; break;
|
case S_IFSOCK: m_typeNode=etk::FSN_SOCKET; break;
|
||||||
|
#endif
|
||||||
default: m_typeNode=etk::FSN_UNKNOW; break;
|
default: m_typeNode=etk::FSN_UNKNOW; break;
|
||||||
}
|
}
|
||||||
// Right
|
// Right
|
||||||
@ -814,7 +826,7 @@ const etk::FSNode& etk::FSNode::operator= (const etk::FSNode &obj )
|
|||||||
m_PointerFile = NULL;
|
m_PointerFile = NULL;
|
||||||
}
|
}
|
||||||
#ifdef __TARGET_OS__Android
|
#ifdef __TARGET_OS__Android
|
||||||
m_idZipFile = etkF.m_idZipFile;
|
m_idZipFile = obj.m_idZipFile;
|
||||||
m_zipData = NULL;
|
m_zipData = NULL;
|
||||||
m_zipDataSize = 0;
|
m_zipDataSize = 0;
|
||||||
m_zipReadingOffset = 0;
|
m_zipReadingOffset = 0;
|
||||||
|
@ -33,20 +33,19 @@ LOCAL_EXPORT_LDLIBS += -ldl -llog
|
|||||||
|
|
||||||
|
|
||||||
FILE_ABSTRACTION:=$(LOCAL_PATH)/ewol/os/gui.Android.base.cpp
|
FILE_ABSTRACTION:=$(LOCAL_PATH)/ewol/os/gui.Android.base.cpp
|
||||||
FILE_ABSTRACTION_DEST:=ewol/os/gui.Android.cpp
|
FILE_ABSTRACTION_DEST:=ewol/os/gui.Android.tmp.cpp
|
||||||
|
|
||||||
EWOL_TMP_PATH:=$(LOCAL_PATH)
|
EWOL_TMP_PATH:=$(LOCAL_PATH)
|
||||||
|
|
||||||
$(shell rm $(FILE_ABSTRACTION_DEST) $(LOCAL_PATH)/$(FILE_ABSTRACTION_DEST))
|
$(shell rm -f $(LOCAL_PATH)/$(FILE_ABSTRACTION_DEST))
|
||||||
|
|
||||||
$(LOCAL_PATH)/$(FILE_ABSTRACTION_DEST): $(FILE_ABSTRACTION)
|
$(LOCAL_PATH)/$(FILE_ABSTRACTION_DEST): $(FILE_ABSTRACTION)
|
||||||
$(Q)mkdir -p $(dir $@)
|
$(Q)mkdir -p $(dir $@)
|
||||||
$(Q)cp -f $(FILE_ABSTRACTION) $@
|
$(Q)cp -f $(FILE_ABSTRACTION) $@
|
||||||
$(Q)sed -i "s|__PROJECT_ORG_TYPE__|$(subst _,$(empty),$(call convert-special-char,$(CONFIG___EWOL_APPL_ORGANISATION_TYPE__)))|" $@
|
$(Q)sed -i "s|__PROJECT_ORG_TYPE__|$(PROJECT_COMPAGNY_TYPE)|" $@
|
||||||
$(Q)sed -i "s|__PROJECT_VENDOR__|$(subst _,$(empty),$(call convert-special-char,$(CONFIG___EWOL_APPL_COMPAGNY__)))|" $@
|
$(Q)sed -i "s|__PROJECT_VENDOR__|$(PROJECT_COMPAGNY_NAME2)|" $@
|
||||||
$(Q)sed -i "s|__PROJECT_NAME__|$(subst _,$(empty),$(call convert-special-char,$(CONFIG___EWOL_APPL_NAME__)))|" $@
|
$(Q)sed -i "s|__PROJECT_NAME__|$(PROJECT_NAME2)|" $@
|
||||||
$(Q)sed -i "s|__PROJECT_PACKAGE__|$(subst _,$(empty),$(call convert-special-char,$(CONFIG___EWOL_APPL_NAME__)))|" $@
|
$(Q)sed -i "s|__PROJECT_PACKAGE__|$(PROJECT_NAME2)|" $@
|
||||||
|
|
||||||
$(FILE_ABSTRACTION_DEST): $(LOCAL_PATH)/$(FILE_ABSTRACTION_DEST)
|
$(FILE_ABSTRACTION_DEST): $(LOCAL_PATH)/$(FILE_ABSTRACTION_DEST)
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,27 +19,4 @@ menu "General"
|
|||||||
help
|
help
|
||||||
This is the application Title
|
This is the application Title
|
||||||
|
|
||||||
config __EWOL_APPL_ORGANISATION_TYPE__
|
|
||||||
prompt "OrganisationType"
|
|
||||||
string
|
|
||||||
default "com"
|
|
||||||
help
|
|
||||||
Can be manny things, but limit whith no space no special char and no Maj ... [a..z]
|
|
||||||
com : Commercial
|
|
||||||
net : Network??
|
|
||||||
org : Organisation
|
|
||||||
gov : Governement
|
|
||||||
mil : Military
|
|
||||||
edu : Education
|
|
||||||
pri : Private
|
|
||||||
museum : ...
|
|
||||||
|
|
||||||
|
|
||||||
config __EWOL_APPL_COMPAGNY__
|
|
||||||
prompt "Compagny Name"
|
|
||||||
string
|
|
||||||
default "Unknow"
|
|
||||||
help
|
|
||||||
This is the c name ...
|
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
@ -29,14 +29,6 @@ menu "Android"
|
|||||||
bool "2: Lock in portrait mode"
|
bool "2: Lock in portrait mode"
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
config __EWOL_ANDROID_ICON__
|
|
||||||
prompt "Select Icon"
|
|
||||||
string
|
|
||||||
default "@drawable/ic_luncher_ewol"
|
|
||||||
help
|
|
||||||
Select the source of the icon for the application ...
|
|
||||||
|
|
||||||
|
|
||||||
menu "Permissions"
|
menu "Permissions"
|
||||||
config __ANDROID_PERMISSION__WRITE_EXTERNAL_STORAGE__
|
config __ANDROID_PERMISSION__WRITE_EXTERNAL_STORAGE__
|
||||||
prompt "WRITE_EXTERNAL_STORAGE"
|
prompt "WRITE_EXTERNAL_STORAGE"
|
||||||
|
@ -219,4 +219,4 @@ void ewol::CmdLine::Add(etk::UString& newElement)
|
|||||||
int64_t ewol::GetTime(void)
|
int64_t ewol::GetTime(void)
|
||||||
{
|
{
|
||||||
return guiInterface::GetTime();
|
return guiInterface::GetTime();
|
||||||
}
|
}
|
||||||
|
25
Sources/libewol/ewol/os/gui.Android.cpp
Normal file
25
Sources/libewol/ewol/os/gui.Android.cpp
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/**
|
||||||
|
*******************************************************************************
|
||||||
|
* @file ewolAndroidAbstraction.cpp
|
||||||
|
* @brief User abstraction for Android (Sources)
|
||||||
|
* @author Edouard DUPIN
|
||||||
|
* @date 14/12/2011
|
||||||
|
* @par Project
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
*******************************************************************************
|
||||||
|
*/
|
||||||
|
// this include a dynamic generating file ==> this is really stupid, but it is needed for the dependency coherency
|
||||||
|
#include <ewol/os/gui.Android.tmp.cpp>
|
@ -48,7 +48,7 @@ int64_t guiInterface::GetTime(void)
|
|||||||
|
|
||||||
bool inputIsPressed[20];
|
bool inputIsPressed[20];
|
||||||
|
|
||||||
static eSystem::specialKey_ts guiKeyBoardMode;
|
static ewol::specialKey_ts guiKeyBoardMode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the new title of the windows
|
* @brief Set the new title of the windows
|
||||||
@ -262,7 +262,7 @@ int main(int argc, char *argv[])
|
|||||||
//start the basic thread :
|
//start the basic thread :
|
||||||
eSystem::Init();
|
eSystem::Init();
|
||||||
// get the icon file :
|
// get the icon file :
|
||||||
etk::File myIcon = APP_Icon();
|
etk::UString myIcon = APP_Icon();
|
||||||
//SetIcon(myIcon);
|
//SetIcon(myIcon);
|
||||||
|
|
||||||
// Run ...
|
// Run ...
|
||||||
|
@ -286,8 +286,9 @@ void guiInterface::SetTitle(etk::UString& title)
|
|||||||
Pixmap icon_pixmap;
|
Pixmap icon_pixmap;
|
||||||
|
|
||||||
// TODO : I don't understand why it does not work ....
|
// TODO : I don't understand why it does not work ....
|
||||||
void SetIcon(etk::FSNode bitmapFile)
|
void SetIcon(etk::UString inputFile)
|
||||||
{
|
{
|
||||||
|
etk::FSNode bitmapFile(inputFile);
|
||||||
#ifdef DEBUG_X11_EVENT
|
#ifdef DEBUG_X11_EVENT
|
||||||
EWOL_INFO("X11: try to set icon : " << bitmapFile);
|
EWOL_INFO("X11: try to set icon : " << bitmapFile);
|
||||||
#endif
|
#endif
|
||||||
@ -1175,7 +1176,7 @@ int main(int argc, char *argv[])
|
|||||||
//start the basic thread :
|
//start the basic thread :
|
||||||
eSystem::Init();
|
eSystem::Init();
|
||||||
// get the icon file :
|
// get the icon file :
|
||||||
etk::FSNode myIcon = APP_Icon();
|
etk::UString myIcon = APP_Icon();
|
||||||
SetIcon(myIcon);
|
SetIcon(myIcon);
|
||||||
|
|
||||||
// Run ...
|
// Run ...
|
||||||
|
@ -106,9 +106,9 @@ namespace guiInterface
|
|||||||
|
|
||||||
|
|
||||||
//!< must be define in CPP by the application ... this are the main init and unInit of the Application
|
//!< must be define in CPP by the application ... this are the main init and unInit of the Application
|
||||||
void APP_Init(void);
|
void APP_Init(void);
|
||||||
void APP_UnInit(void);
|
void APP_UnInit(void);
|
||||||
etk::FSNode APP_Icon(void);
|
etk::UString APP_Icon(void);
|
||||||
|
|
||||||
#define NB_MAX_INPUT (20)
|
#define NB_MAX_INPUT (20)
|
||||||
|
|
||||||
|
@ -6,15 +6,15 @@ LOCAL_MODULE := glew
|
|||||||
|
|
||||||
#http://glew.sourceforge.net/index.html
|
#http://glew.sourceforge.net/index.html
|
||||||
|
|
||||||
ifeq ("$(SHADER)","1")
|
#ifneq ("$(CONFIG__VIDEO__OPENGL_ES_2)","")
|
||||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/glew/include/
|
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/glew/include/
|
||||||
LOCAL_EXPORT_LDLIBS := $(LOCAL_PATH)/glew/lib/glew32s.lib -lopengl32 -lgdi32
|
LOCAL_EXPORT_LDLIBS := $(LOCAL_PATH)/glew/lib/glew32s.lib -lopengl32 -lgdi32
|
||||||
# to enable open gl 2 mode
|
# to enable open gl 2 mode
|
||||||
LOCAL_CFLAGS += -D__VIDEO__OPENGL_ES_2
|
LOCAL_CFLAGS += -D__VIDEO__OPENGL_ES_2
|
||||||
LOCAL_EXPORT_CFLAGS := -D__VIDEO__OPENGL_ES_2
|
LOCAL_EXPORT_CFLAGS := -D__VIDEO__OPENGL_ES_2
|
||||||
else
|
#else
|
||||||
LOCAL_EXPORT_LDLIBS := -lopengl32 -lgdi32
|
# LOCAL_EXPORT_LDLIBS := -lopengl32 -lgdi32
|
||||||
endif
|
#endif
|
||||||
|
|
||||||
include $(BUILD_PREBUILT)
|
include $(BUILD_PREBUILT)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user