Work on android

This commit is contained in:
Edouard Dupin 2012-01-31 22:35:40 +01:00
parent a3b404ec4d
commit 7704b49594
4 changed files with 41 additions and 20 deletions

View File

@ -39,6 +39,7 @@ void EWOL_ThreadSetArchiveDir(int mode, const char* str);
void EWOL_ThreadResize(int w, int h );
void EWOL_ThreadEventInputMotion(int pointerID, float x, float y);
void EWOL_ThreadEventInputState(int pointerID, bool isUp, float x, float y);
void EWOL_NativeRender(void);
extern "C"

View File

@ -434,6 +434,7 @@ bool etk::File::LoadDataZip(void)
zip_stat_init(&zipFileProperty);
zip_stat_index(s_APKArchive, m_idZipFile, 0, &zipFileProperty);
TK_DEBUG("LOAD data from the files : \"" << GetCompleateName() << "\"");
/*
TK_DEBUG(" name=" << zipFileProperty.name);
TK_DEBUG(" index=" << zipFileProperty.index);
TK_DEBUG(" crc=" << zipFileProperty.crc);
@ -442,6 +443,7 @@ bool etk::File::LoadDataZip(void)
TK_DEBUG(" comp_size=" << zipFileProperty.comp_size);
TK_DEBUG(" comp_method=" << zipFileProperty.comp_method);
TK_DEBUG(" encryption_method=" << zipFileProperty.encryption_method);
*/
m_zipDataSize = zipFileProperty.size;
m_zipData = new char[m_zipDataSize +10];
if (NULL == m_zipData) {

View File

@ -74,6 +74,10 @@ typedef struct {
extern int EWOL_appArgC;
extern char *EWOL_appArgV[];
void EWOL_NativeEventInputMotion(int pointerID, float x, float y );
void EWOL_NativeEventInputState(int pointerID, bool isUp, float x, float y );
void EWOL_NativeResize(int w, int h );
static void* BaseAppEntry(void* param)
{
bool requestEndProcessing = false;
@ -95,7 +99,6 @@ static void* BaseAppEntry(void* param)
break;
case JNI_UN_INIT:
EWOL_DEBUG("Receive MSG : JNI_UN_INIT");
//Android : EWOL_NativeApplicationUnInit();
requestEndProcessing = true;
break;
case JNI_DONE:
@ -105,22 +108,21 @@ static void* BaseAppEntry(void* param)
EWOL_DEBUG("Receive MSG : JNI_RESIZE");
{
eventResize_ts * tmpData = (eventResize_ts*)data.data;
//Android : EWOL_NativeResize(tmpData->w, tmpData->h);
//Android : EWOL_NativeInit();
EWOL_NativeResize(tmpData->w, tmpData->h);
}
break;
case JNI_INPUT_MOTION:
EWOL_DEBUG("Receive MSG : JNI_INPUT_MOTION");
{
eventInputMotion_ts * tmpData = (eventInputMotion_ts*)data.data;
//Android : EWOL_NativeEventInputMotion(tmpData->pointerID, tmpData->x, tmpData->y);
EWOL_NativeEventInputMotion(tmpData->pointerID, tmpData->x, tmpData->y);
}
break;
case JNI_INPUT_STATE:
EWOL_DEBUG("Receive MSG : JNI_INPUT_STATE");
{
eventInputState_ts * tmpData = (eventInputState_ts*)data.data;
//Android : EWOL_NativeEventInputState(tmpData->pointerID, tmpData->state, tmpData->x, tmpData->y);
EWOL_NativeEventInputState(tmpData->pointerID, tmpData->state, tmpData->x, tmpData->y);
}
break;
case JNI_DATA_ARCHIVE_DIR:

View File

@ -42,7 +42,7 @@
#undef __class__
#define __class__ "AndroidJNI"
int EWOL_appArgC = 0;
char *EWOL_appArgV[] = NULL;
char **EWOL_appArgV = NULL;
static etkFloat_t m_width = 320;
static etkFloat_t m_height = 480;
@ -72,14 +72,6 @@ int32_t m_previous_y = -1;
int64_t m_previousTime = 0;
bool m_previousDouble = false;
bool firstInitDone = false;
/* Call to initialize the graphics state */
void EWOL_NativeInit(void)
{
EWOL_INFO("Init : Start All Application");
firstInitDone = true;
}
void EWOL_NativeResize(int w, int h )
@ -93,12 +85,6 @@ void EWOL_NativeResize(int w, int h )
}
}
/* Call to finalize the graphics state */
void EWOL_NativeDone(void)
{
EWOL_INFO("Renderer : Close All Application");
}
void EWOL_NativeEventInputMotion(int pointerID, float x, float y )
{
//EWOL_INFO("Event : Input Motion ID=" << pointerID << " x=" << x << " y=" << y);
@ -359,6 +345,14 @@ void Draw(void)
#undef __class__
#define __class__ "guiAbstraction"
void guiAbstraction::Run(void)
{
}
void guiAbstraction::Stop(void)
{
}
void guiAbstraction::SetDisplayOnWindows(ewol::Windows * newOne)
{
Setwindow(newOne);
@ -385,6 +379,28 @@ void guiAbstraction::ForceRedrawAll(void)
}
}
void guiAbstraction::ChangeSize(int32_t w, int32_t h)
{
}
void guiAbstraction::ChangePos(int32_t x, int32_t y)
{
}
void guiAbstraction::GetAbsPos(int32_t & x, int32_t & y)
{
}
bool guiAbstraction::IsPressedInput(int32_t inputID)
{
//if (true == guiAbstractionIsInit) {
// return myX11Access->IsPressedInput(inputID);
//} else {
// EWOL_CRITICAL("X11 ==> not init ... ");
return false;
//}
}
void guiAbstraction::SendKeyboardEvent(bool isDown, etk::String &keyInput)
{