new event and try to find the tablette error

This commit is contained in:
Edouard Dupin 2012-01-25 23:30:59 +01:00
parent d0f57d33a7
commit 4b3456b28c
6 changed files with 32 additions and 10 deletions

View File

@ -11,6 +11,7 @@ import android.content.Context;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.KeyEvent;
// For No Title :
import android.view.Window;
@ -154,6 +155,11 @@ class EwolGLSurfaceView extends GLSurfaceView {
return true;
}
public boolean onKeyDown (int keyCode, KeyEvent event){
nativeEventUnknow(156);
return true;
}
EwolRenderer mRenderer;
}

View File

@ -62,13 +62,13 @@ void TOOLS_DisplayTime(void)
#ifdef __PLATFORM__Android
struct timeval now;
gettimeofday(&now, NULL);
sprintf(tmpdata, " %2dh %2dmin %2ds | ", (int32_t)(now.tv_sec/3600), (int32_t)(now.tv_sec/60)%60, (int32_t)(now.tv_sec%60));
sprintf(tmpdata, " %2dh %2dmin %2ds | ", (int32_t)(now.tv_sec/3600)%24, (int32_t)(now.tv_sec/60)%60, (int32_t)(now.tv_sec%60));
#else
time_t rawtime;
struct tm * timeinfo;
time(&rawtime);
timeinfo = localtime(&rawtime);
sprintf(tmpdata, " %2dh %2dmin %2ds | ", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
sprintf(tmpdata, " %2dh %2dmin %2ds | ", (timeinfo->tm_hour)%24, timeinfo->tm_min, timeinfo->tm_sec);
#endif
etk::cout << tmpdata ;
}

View File

@ -28,9 +28,9 @@
#include <cstdio>
#include <typeinfo>
#include <string.h>
#if defined(__PLATFORM__Android)
# include <string.h>
# include <android/log.h>
# define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "====> EWOL", __VA_ARGS__))
# define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, "====> EWOL", __VA_ARGS__))
@ -38,7 +38,7 @@
#endif
#define MAX_LOG_SIZE (16000)
#define MAX_LOG_SIZE_TMP (16000)
#define MAX_LOG_SIZE_TMP (512)
namespace etk{
class CEndl{};
@ -71,6 +71,11 @@ namespace etk{
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);
return *this;
}
CCout& operator << (long long t) {
snprintf(tmp, MAX_LOG_SIZE_TMP, "%lld", t);
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);
return *this;
}
CCout& operator << (double t) {
snprintf(tmp, MAX_LOG_SIZE_TMP, "%f", t);
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);

View File

@ -334,10 +334,10 @@ class FTFontInternal
}
EWOL_DEBUG("elem=" << listElement[iii].unicodeCharVal
<<" size=(" << tmpWidth << "," << tmpHeight << ")"
<< " for bitmap (left=" << slot->bitmap_left << ",top=" << slot->bitmap_top << ")");
EWOL_DEBUG(" BEARING=(" << (slot->metrics.horiBearingX>>6) << "," << (slot->metrics.vertBearingY>>6) << ")" );
EWOL_VERBOSE("elem=" << listElement[iii].unicodeCharVal
<<" size=(" << tmpWidth << "," << tmpHeight << ")"
<< " for bitmap (left=" << slot->bitmap_left << ",top=" << slot->bitmap_top << ")");
EWOL_VERBOSE(" BEARING=(" << (slot->metrics.horiBearingX>>6) << "," << (slot->metrics.vertBearingY>>6) << ")" );
for(int32_t j=0; j < tmpHeight;j++) {
for(int32_t i=0; i < tmpWidth; i++){
@ -363,11 +363,15 @@ class FTFontInternal
// update the Bitmap position drawing :
tmpRowStartPos += tmpWidth;
}
EWOL_DEBUG("End generation of the Fond bitmap, start adding texture");
// use the texture manager to have the texture availlable every restart of the screen
//textureId = LoadTexture(GL_TEXTURE_2D, 0, GL_ALPHA8, textureWidth, textureHeight, 0, GL_ALPHA, GL_UNSIGNED_BYTE, expanded_data, byfferDataSize * sizeof(GLubyte), "---FreeFont---" );
textureId = ewol::LoadTexture(GL_TEXTURE_2D, 0, GL_ALPHA, textureWidth, textureHeight, 0, GL_ALPHA, GL_UNSIGNED_BYTE, expanded_data, byfferDataSize * sizeof(GLubyte), "---FreeFont---" );
EWOL_DEBUG("end load texture font");
// With The Texture Created, We Don't Need The Expanded Data Anymore.
delete [] expanded_data;
EWOL_DEBUG("end load remode tmp data");
return false;
}
@ -414,6 +418,7 @@ class FTFont{
}
m_size = size;
m_listLoadedTTFont[m_trueTypeFontId]->GenerateBitmapFont(m_size, m_lineHeight, m_textureId, m_elements);
EWOL_DEBUG("plop");
}
~FTFont(void)
{
@ -500,6 +505,7 @@ void ewol::SetDefaultFont(etk::String fontName, int32_t size)
// save the default font parameters ...
s_currentDefaultFontName = fontName;
s_currentDefaultFontId = tmpId;
EWOL_DEBUG("MEGAPLOP 2");
}
int32_t ewol::GetDefaultFontId(void)

View File

@ -49,6 +49,8 @@ namespace guiAbstraction
void SendKeyboardEventMove(bool isDown, ewol::eventKbMoveType_te &keyInput);
};
int64_t GetCurrentTime(void);
//!< must be define in CPP by the application ...
void APP_Init(int argc, char *argv[]);
void APP_UnInit(void);

View File

@ -54,7 +54,7 @@ static etkFloat_t m_width = 320;
static etkFloat_t m_height = 480;
ewol::Windows* m_uniqueWindows = NULL;
static int64_t GetCurrentTime(void)
int64_t GetCurrentTime(void)
{
struct timeval now;
gettimeofday(&now, NULL);
@ -283,13 +283,16 @@ static bool isAlreadyInit = false;
void EWOL_NativeApplicationInit(void)
{
EWOL_WARNING("Event : Init Application");
int64_t time = GetCurrentTime();
EWOL_WARNING("Event : Init Application (start)" << time);
if (false == isAlreadyInit) {
guiAbstraction::Init(0, NULL);
ewol::Init(0, NULL);
APP_Init(0, NULL);
isAlreadyInit = true;
}
time = GetCurrentTime();
EWOL_WARNING("Event : Init Application (end)" << time);
}
void EWOL_NativeApplicationUnInit(void)