diff options
| author | dhewg | 2011-02-24 00:45:41 +0100 |
|---|---|---|
| committer | dhewg | 2011-02-24 23:18:32 +0100 |
| commit | 53b5808d4f16a44779ef5fd8a5c8ca5e262e0379 (patch) | |
| tree | 46a450260886ea184df0fca6eda5f7375e8cfdf1 /backends/platform/android/jni.h | |
| parent | f80d993860257a8e74936bc74eb99bda2fbfcaa4 (diff) | |
| download | scummvm-rg350-53b5808d4f16a44779ef5fd8a5c8ca5e262e0379.tar.gz scummvm-rg350-53b5808d4f16a44779ef5fd8a5c8ca5e262e0379.tar.bz2 scummvm-rg350-53b5808d4f16a44779ef5fd8a5c8ca5e262e0379.zip | |
ANDROID: Move rest of everything JNI
Diffstat (limited to 'backends/platform/android/jni.h')
| -rw-r--r-- | backends/platform/android/jni.h | 54 |
1 files changed, 50 insertions, 4 deletions
diff --git a/backends/platform/android/jni.h b/backends/platform/android/jni.h index 39276b9388..02eabba569 100644 --- a/backends/platform/android/jni.h +++ b/backends/platform/android/jni.h @@ -30,11 +30,16 @@ #include <jni.h> -extern jobject back_ptr; +#include "common/fs.h" +#include "common/archive.h" class OSystem_Android; class JNI { +private: + JNI(); + virtual ~JNI(); + public: static jint onLoad(JavaVM *vm); @@ -43,14 +48,24 @@ public: static void attachThread(); static void detachThread(); -private: - JNI(); - virtual ~JNI(); + static int getAudioSampleRate(); + static void initBackend(); + static void getPluginDirectories(Common::FSList &dirs); + static void setWindowCaption(const char *caption); + static void displayMessageOnOSD(const char *msg); + static void showVirtualKeyboard(bool enable); + static void addSysArchivesToSearchSet(Common::SearchSet &s, int priority); + + static inline bool setupSurface(); + static inline void destroySurface(); + static inline bool swapBuffers(); private: static JavaVM *_vm; // back pointer to (java) peer instance static jobject _jobj; + + static Common::Archive *_asset_archive; static OSystem_Android *_system; static jfieldID _FID_Event_type; @@ -63,6 +78,17 @@ private: static jfieldID _FID_Event_mouse_relative; static jfieldID _FID_ScummVM_nativeScummVM; + static jmethodID _MID_displayMessageOnOSD; + static jmethodID _MID_setWindowCaption; + static jmethodID _MID_initBackend; + static jmethodID _MID_audioSampleRate; + static jmethodID _MID_showVirtualKeyboard; + static jmethodID _MID_getSysArchives; + static jmethodID _MID_getPluginDirectories; + static jmethodID _MID_setupScummVMSurface; + static jmethodID _MID_destroyScummVMSurface; + static jmethodID _MID_swapBuffers; + static const JNINativeMethod _natives[]; static void throwByName(JNIEnv *env, const char *name, const char *msg); @@ -82,6 +108,26 @@ private: jint height); }; +inline bool JNI::setupSurface() { + JNIEnv *env = JNI::getEnv(); + + env->CallVoidMethod(_jobj, _MID_setupScummVMSurface); + + return !env->ExceptionCheck(); +} + +inline void JNI::destroySurface() { + JNIEnv *env = JNI::getEnv(); + + env->CallVoidMethod(_jobj, _MID_destroyScummVMSurface); +} + +inline bool JNI::swapBuffers() { + JNIEnv *env = JNI::getEnv(); + + return env->CallBooleanMethod(_jobj, _MID_swapBuffers); +} + #endif #endif |
