diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-01-12 16:35:10 +0900 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-01-12 11:06:46 +0100 |
commit | 723b6a07e4c4dfb8fdafc186041557514b014014 (patch) | |
tree | 92a693499c490822bd813b49bea9e3e030c507ce | |
parent | 9f77740d8b8112de1b157abd892307e057b4f265 (diff) |
jni: add postKeyEvent to Office and redirect the call to LOK
Change-Id: I922ce1f735df236d2bdad33820ed98f18fc85963
-rw-r--r-- | android/Bootstrap/src/org/libreoffice/kit/Office.java | 2 | ||||
-rw-r--r-- | desktop/source/lib/lokandroid.cxx | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/android/Bootstrap/src/org/libreoffice/kit/Office.java b/android/Bootstrap/src/org/libreoffice/kit/Office.java index e7d26c5a9b8c..8759e85fe990 100644 --- a/android/Bootstrap/src/org/libreoffice/kit/Office.java +++ b/android/Bootstrap/src/org/libreoffice/kit/Office.java @@ -32,6 +32,8 @@ public class Office { return document; } + public native void postKeyEvent(int type, int code); + public native void destroy(); public native void destroyAndExit(); } diff --git a/desktop/source/lib/lokandroid.cxx b/desktop/source/lib/lokandroid.cxx index 06da8a97d423..773cba54a12f 100644 --- a/desktop/source/lib/lokandroid.cxx +++ b/desktop/source/lib/lokandroid.cxx @@ -51,14 +51,16 @@ const char* copyJavaString(JNIEnv* pEnv, jstring aJavaString) } // anonymous namespace -extern "C" SAL_JNI_EXPORT jstring JNICALL Java_org_libreoffice_kit_Office_getError(JNIEnv* pEnv, jobject aObject) +extern "C" SAL_JNI_EXPORT jstring JNICALL Java_org_libreoffice_kit_Office_getError + (JNIEnv* pEnv, jobject aObject) { LibreOfficeKit* pLibreOfficeKit = getHandle<LibreOfficeKit>(pEnv, aObject); char* pError = pLibreOfficeKit->pClass->getError(pLibreOfficeKit); return pEnv->NewStringUTF(pError); } -extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Office_destroy(JNIEnv* pEnv, jobject aObject) +extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Office_destroy + (JNIEnv* pEnv, jobject aObject) { LibreOfficeKit* pLibreOfficeKit = getHandle<LibreOfficeKit>(pEnv, aObject); pLibreOfficeKit->pClass->destroy(pLibreOfficeKit); @@ -73,6 +75,13 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Office_destroyAn _exit(0); } +extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Office_postKeyEvent + (JNIEnv* pEnv, jobject aObject, jint nType, jint nCode) +{ + LibreOfficeKit* pLibreOfficeKit = getHandle<LibreOfficeKit>(pEnv, aObject); + pLibreOfficeKit->pClass->postKeyEvent(pLibreOfficeKit, nType, nCode); +} + namespace { @@ -122,7 +131,8 @@ void messageCallback(int nType, const char* pPayload, void* pData) } // anonymous namespace -extern "C" SAL_JNI_EXPORT jobject JNICALL Java_org_libreoffice_kit_Office_documentLoadNative(JNIEnv* pEnv, jobject aObject, jstring documentPath) +extern "C" SAL_JNI_EXPORT jobject JNICALL Java_org_libreoffice_kit_Office_documentLoadNative + (JNIEnv* pEnv, jobject aObject, jstring documentPath) { const char* aCloneDocumentPath = copyJavaString(pEnv, documentPath); LibreOfficeKit* pLibreOfficeKit = getHandle<LibreOfficeKit>(pEnv, aObject); |