[DEV] try to find keyboard error

This commit is contained in:
Edouard DUPIN 2014-01-03 21:30:51 +01:00
parent bd184d4f8f
commit cb6d3f0cb9
6 changed files with 187 additions and 21 deletions

2
build

@ -1 +1 @@
Subproject commit 0e08561a5db3080036ffd546c98dcd0a95d6f4a9
Subproject commit 35230a0e958143e3d7c313c7fee90fac2f51a4bf

2
external/etk vendored

@ -1 +1 @@
Subproject commit 8300237b2cc37bd36113c2830bdf1941fd0e8099
Subproject commit 9c6c819288c6ed209a6fa57ecfa788851abdecc8

View File

@ -11,14 +11,15 @@ package org.ewol;
import android.app.Activity;
import android.service.wallpaper.WallpaperService;
import android.service.wallpaper.WallpaperService.Engine;
import android.util.Log;
public class Ewol {
private int instanceID = -1; // local and private instance ID
private boolean m_hardKeyboardHidden = true;
public <T extends EwolCallback> Ewol(T activityInstance, int typeApplication) {
instanceID = -1;
m_hardKeyboardHidden = true;
instanceID = EWsetJavaVirtualMachineStart(activityInstance, typeApplication);
Log.d("Ewol", "new : " + instanceID);
}
@ -30,6 +31,13 @@ public class Ewol {
EWparamSetArchiveDir(instanceID, mode, myString);
}
public boolean getHardKeyboardHidden() {
return m_hardKeyboardHidden;
}
public void setHardKeyboardHidden(boolean val) {
m_hardKeyboardHidden = val;
}
// activity status
public void onCreate() { EWonCreate(instanceID); }
public void onStart() { EWonStart(instanceID); }

View File

@ -39,9 +39,12 @@ import android.util.Log;
import java.io.IOException;
//import activityRootView
import org.ewol.Ewol;
/**
* @brief Class :
*
@ -58,6 +61,7 @@ public abstract class EwolActivity extends Activity implements EwolCallback, Ewo
Log.e("EwolActivity", "error getting lib(): " + e);
}
}
public EwolActivity() {
// set the java evironement in the C sources :
EWOL = new Ewol(this, EWOL_APPL_TYPE_ACTIVITY);
@ -83,6 +87,7 @@ public abstract class EwolActivity extends Activity implements EwolCallback, Ewo
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setListnerToRootView();
// Load the application directory
EWOL.paramSetArchiveDir(1, getFilesDir().toString());
@ -172,19 +177,51 @@ public abstract class EwolActivity extends Activity implements EwolCallback, Ewo
// cleanup your object here
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
Log.e("EwolActivity", "Receive event ... ");
super.onConfigurationChanged(newConfig);
// Checks whether a hardware keyboard is available
if (newConfig.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO) {
EWOL.setHardKeyboardHidden(false);
Log.e("EwolActivity", "HARD Keyboard active = " + !EWOL.getHardKeyboardHidden() + " (visible)");
} else if (newConfig.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES) {
EWOL.setHardKeyboardHidden(true);
Log.e("EwolActivity", "HARD Keyboard active = " + !EWOL.getHardKeyboardHidden() + " (hidden)");
}
}
public void keyboardUpdate(boolean show) {
Log.e("EwolActivity", "keyboardUpdate(" + show + ")");
final InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
if(show) {
//EWOL.touchEvent();
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
Log.i("EwolActivity", "set keyboard status visibility :" + show);
final InputMethodManager imm;
try {
imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
} catch(Exception e) {
Log.e("EwolActivity", "Can not get keyboard manager ...");
return;
}
Log.i("EwolActivity", "Get input manager done");
if(show == true) {
try {
imm.showSoftInput(mGLView, InputMethodManager.SHOW_IMPLICIT);
} catch(Exception e) {
Log.e("EwolActivity", "Can not set keyboard state ... (exeption !!!!)");
}
Log.i("EwolActivity", "Display it Done");
} else {
imm.toggleSoftInput(0 ,InputMethodManager.HIDE_IMPLICIT_ONLY + InputMethodManager.HIDE_NOT_ALWAYS);
//imm.hideSoftInputFromWindow(view.getWindowToken(),0);
// this is a little sutid this ==> display keyboard to be sure that it toggle in the hide state ...
try {
imm.showSoftInput(mGLView, InputMethodManager.SHOW_IMPLICIT);
} catch(Exception e) {
Log.e("EwolActivity", "Can not set keyboard state ... (exeption !!!!)");
}
Log.i("EwolActivity", "Display it Done");
try {
imm.toggleSoftInput(0 ,InputMethodManager.HIDE_IMPLICIT_ONLY + InputMethodManager.HIDE_NOT_ALWAYS);
} catch(Exception e) {
Log.e("EwolActivity", "Can not set keyboard state ... (exeption !!!!)");
}
Log.i("EwolActivity", "Toggle it Done");
}
}

View File

@ -8,17 +8,12 @@
package org.ewol;
// import the ewol package :
/* No need in same package... */
//import org.ewol.Ewol;
//import org.ewol.EwolRendererGL;
import android.content.Context;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.KeyEvent;
import android.util.Log;
import org.ewol.Ewol;
@ -215,7 +210,7 @@ public class EwolSurfaceViewGL extends GLSurfaceView implements EwolConstants {
}
return true;
}
private boolean keyboardEvent(int keyCode, KeyEvent event, boolean isDown) {
int actionDone = event.getAction();
switch(keyCode)
@ -285,13 +280,12 @@ public class EwolSurfaceViewGL extends GLSurfaceView implements EwolConstants {
}
return false;
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
return keyboardEvent(keyCode, event, true);
}
public boolean onKeyUp(int keyCode, KeyEvent event) {
return keyboardEvent(keyCode, event, false);
}
}

View File

@ -11,6 +11,7 @@
#include <time.h>
#include <stdint.h>
#include <pthread.h>
#include <etk/os/Mutex.h>
#include <ewol/debug.h>
#include <ewol/context/Context.h>
//#include <ewol/renderer/audio/audio.h>
@ -31,6 +32,8 @@ int64_t ewol::getTime(void) {
// jni doc : /usr/lib/jvm/java-1.6.0-openjdk/include
static JavaVM* g_JavaVM=NULL; // global acces on the unique JVM !!!
etk::Mutex g_interfaceMutex;
void java_check_exception(JNIEnv* _env) {
if (_env->ExceptionOccurred()) {
@ -400,14 +403,18 @@ extern "C" {
// JNI onLoad
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* _jvm, void* _reserved) {
// get the java virtual machine handle ...
g_interfaceMutex.lock();
g_JavaVM = _jvm;
EWOL_DEBUG("JNI-> load the jvm ..." );
g_interfaceMutex.unLock();
return JNI_VERSION_1_6;
}
// JNI onUnLoad
JNIEXPORT void JNICALL JNI_OnUnload(JavaVM* _vm, void *_reserved) {
g_interfaceMutex.lock();
g_JavaVM = NULL;
EWOL_DEBUG("JNI-> Un-load the jvm ..." );
g_interfaceMutex.unLock();
}
/* Call to initialize the graphics state */
@ -416,11 +423,14 @@ extern "C" {
jint _id,
jint _mode,
jstring _myString) {
g_interfaceMutex.lock();
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
//EWOL_CRITICAL(" call with ID : " << _id);
@ -433,15 +443,19 @@ extern "C" {
_env->ReleaseStringUTFChars(_myString, str);
str = NULL;
}
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
jint Java_org_ewol_Ewol_EWsetJavaVirtualMachineStart(JNIEnv* _env,
jclass _classBase,
jobject _objCallback,
int _typeApplication) {
g_interfaceMutex.lock();
EWOL_DEBUG("*******************************************");
EWOL_DEBUG("** Creating EWOL context **");
EWOL_DEBUG("*******************************************");
EWOL_DEBUG("java->C (begin)");
AndroidContext* tmpContext = NULL;
if (org_ewol_EwolConstants_EWOL_APPL_TYPE_ACTIVITY == _typeApplication) {
tmpContext = new AndroidContext(_env, _classBase, _objCallback, AndroidContext::appl_application);
@ -449,139 +463,189 @@ extern "C" {
tmpContext = new AndroidContext(_env, _classBase, _objCallback, AndroidContext::appl_wallpaper);
} else {
EWOL_CRITICAL(" try to create an instance with no apply type: " << _typeApplication);
g_interfaceMutex.unLock();
return -1;
}
if (NULL == tmpContext) {
EWOL_ERROR("Can not allocate the main context instance _id=" << (s_listInstance.size()-1));
g_interfaceMutex.unLock();
return -1;
}
// for future case : all time this ...
s_listInstance.push_back(tmpContext);
int32_t newID = s_listInstance.size()-1;
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
return newID;
}
void Java_org_ewol_Ewol_EWsetJavaVirtualMachineStop(JNIEnv* _env, jclass _cls, jint _id) {
g_interfaceMutex.lock();
EWOL_DEBUG("*******************************************");
EWOL_DEBUG("** remove JVM Pointer **");
EWOL_DEBUG("*******************************************");
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
g_interfaceMutex.unLock();
return;
}
if (NULL == s_listInstance[_id]) {
EWOL_ERROR("the requested instance _id=" << (int32_t)_id << " is already removed ...");
g_interfaceMutex.unLock();
return;
}
s_listInstance[_id]->unInit(_env);
delete(s_listInstance[_id]);
s_listInstance[_id]=NULL;
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
void Java_org_ewol_Ewol_EWtouchEvent(JNIEnv* _env, jobject _thiz, jint _id) {
g_interfaceMutex.lock();
EWOL_DEBUG(" == > Touch Event");
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
java_check_exception(_env);
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
void Java_org_ewol_Ewol_EWonCreate(JNIEnv* _env, jobject _thiz, jint _id) {
g_interfaceMutex.lock();
EWOL_DEBUG("*******************************************");
EWOL_DEBUG("** Activity on Create **");
EWOL_DEBUG("*******************************************");
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
//s_listInstance[_id]->init();
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
void Java_org_ewol_Ewol_EWonStart(JNIEnv* _env, jobject _thiz, jint _id) {
g_interfaceMutex.lock();
EWOL_DEBUG("*******************************************");
EWOL_DEBUG("** Activity on Start **");
EWOL_DEBUG("*******************************************");
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
//SendSystemMessage(" testmessages ... ");
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
void Java_org_ewol_Ewol_EWonReStart(JNIEnv* _env, jobject _thiz, jint _id) {
g_interfaceMutex.lock();
EWOL_DEBUG("*******************************************");
EWOL_DEBUG("** Activity on Re-Start **");
EWOL_DEBUG("*******************************************");
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
void Java_org_ewol_Ewol_EWonResume(JNIEnv* _env, jobject _thiz, jint _id) {
g_interfaceMutex.lock();
EWOL_DEBUG("*******************************************");
EWOL_DEBUG("** Activity on resume **");
EWOL_DEBUG("*******************************************");
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
s_listInstance[_id]->OS_Resume();
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
void Java_org_ewol_Ewol_EWonPause(JNIEnv* _env, jobject _thiz, jint _id) {
g_interfaceMutex.lock();
EWOL_DEBUG("*******************************************");
EWOL_DEBUG("** Activity on pause **");
EWOL_DEBUG("*******************************************");
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
// All the openGl has been destroyed ...
s_listInstance[_id]->getResourcesManager().contextHasBeenDestroyed();
s_listInstance[_id]->OS_Suspend();
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
void Java_org_ewol_Ewol_EWonStop(JNIEnv* _env, jobject _thiz, jint _id) {
g_interfaceMutex.lock();
EWOL_DEBUG("*******************************************");
EWOL_DEBUG("** Activity on Stop **");
EWOL_DEBUG("*******************************************");
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
s_listInstance[_id]->OS_Stop();
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
void Java_org_ewol_Ewol_EWonDestroy(JNIEnv* _env, jobject _thiz, jint _id) {
g_interfaceMutex.lock();
EWOL_DEBUG("*******************************************");
EWOL_DEBUG("** Activity on Destroy **");
EWOL_DEBUG("*******************************************");
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
//s_listInstance[_id]->UnInit();
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
@ -595,14 +659,19 @@ extern "C" {
jint _pointerID,
jfloat _x,
jfloat _y) {
g_interfaceMutex.lock();
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
s_listInstance[_id]->OS_SetInputMotion(_pointerID+1, vec2(_x,_y));
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
void Java_org_ewol_Ewol_EWinputEventState(JNIEnv* _env,
@ -612,14 +681,19 @@ extern "C" {
jboolean _isUp,
jfloat _x,
jfloat _y) {
g_interfaceMutex.lock();
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
s_listInstance[_id]->OS_SetInputState(_pointerID+1, _isUp, vec2(_x,_y));
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
void Java_org_ewol_Ewol_EWmouseEventMotion(JNIEnv* _env,
@ -628,14 +702,19 @@ extern "C" {
jint _pointerID,
jfloat _x,
jfloat _y) {
g_interfaceMutex.lock();
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
s_listInstance[_id]->OS_SetMouseMotion(_pointerID+1, vec2(_x,_y));
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
void Java_org_ewol_Ewol_EWmouseEventState(JNIEnv* _env,
@ -645,28 +724,38 @@ extern "C" {
jboolean _isUp,
jfloat _x,
jfloat _y) {
g_interfaceMutex.lock();
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
s_listInstance[_id]->OS_SetMouseState(_pointerID+1, _isUp, vec2(_x,_y));
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
void Java_org_ewol_Ewol_EWunknowEvent(JNIEnv* _env,
jobject _thiz,
jint _id,
jint _pointerID) {
g_interfaceMutex.lock();
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
EWOL_DEBUG("Unknown IO event : " << _pointerID << " ???");
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
void Java_org_ewol_Ewol_EWkeyboardEventMove(JNIEnv* _env,
@ -674,14 +763,19 @@ extern "C" {
jint _id,
jint _type,
jboolean _isdown) {
g_interfaceMutex.lock();
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
EWOL_DEBUG("IO keyboard Move event : \"" << _type << "\" is down=" << _isdown);
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
void Java_org_ewol_Ewol_EWkeyboardEventKey(JNIEnv* _env,
@ -689,15 +783,20 @@ extern "C" {
jint _id,
jint _uniChar,
jboolean _isdown) {
g_interfaceMutex.lock();
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
EWOL_DEBUG("IO keyboard Key event : \"" << _uniChar << "\" is down=" << _isdown);
s_listInstance[_id]->ANDROID_SetKeyboard(_uniChar, _isdown);
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
void Java_org_ewol_Ewol_EWdisplayPropertyMetrics(JNIEnv* _env,
@ -705,15 +804,20 @@ extern "C" {
jint _id,
jfloat _ratioX,
jfloat _ratioY) {
g_interfaceMutex.lock();
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
// set the internal system ratio properties ...
ewol::Dimension::setPixelRatio(vec2(_ratioX,_ratioY), ewol::Dimension::Inch);
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
// TODO : set a return true or false if we want to grep this event ...
@ -722,11 +826,14 @@ extern "C" {
jint _id,
jint _keyVal,
jboolean _isdown) {
g_interfaceMutex.lock();
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
switch (_keyVal) {
@ -752,6 +859,8 @@ extern "C" {
EWOL_DEBUG("IO keyboard Key system event : \"" << _keyVal << "\" is down=" << _isdown);
break;
}
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
@ -761,14 +870,18 @@ extern "C" {
void Java_org_ewol_Ewol_EWrenderInit(JNIEnv* _env,
jobject _thiz,
jint _id) {
g_interfaceMutex.lock();
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
void Java_org_ewol_Ewol_EWrenderResize(JNIEnv* _env,
@ -776,28 +889,38 @@ extern "C" {
jint _id,
jint _w,
jint _h) {
g_interfaceMutex.lock();
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
s_listInstance[_id]->OS_Resize(vec2(_w, _h));
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
// TODO : Return tur or foalse to not redraw when the under draw has not be done (processing gain of time)
void Java_org_ewol_Ewol_EWrenderDraw(JNIEnv* _env,
jobject _thiz,
jint _id) {
g_interfaceMutex.lock();
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
EWOL_ERROR("Call C With an incorrect instance _id=" << (int32_t)_id);
// TODO : generate error in java to stop the current instance
g_interfaceMutex.unLock();
return;
}
s_listInstance[_id]->OS_Draw(true);
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
void Java_org_ewol_Ewol_EWaudioPlayback(JNIEnv* _env,
@ -806,6 +929,8 @@ extern "C" {
jshortArray _location,
jint _frameRate,
jint _nbChannels) {
g_interfaceMutex.lock();
EWOL_DEBUG("java->C (begin)");
if( _id >= s_listInstance.size()
|| _id<0
|| NULL == s_listInstance[_id] ) {
@ -825,6 +950,8 @@ extern "C" {
// release the short* pointer
_env->ReleaseShortArrayElements(_location, dst, 0);
//}
EWOL_DEBUG("java->C (end)");
g_interfaceMutex.unLock();
}
};