android: add postMouseEvent to LOKit JNI interface

Change-Id: I652a0c365c4a1413226cdd4dc7910e65ac2a5285
This commit is contained in:
Tomaž Vajngerl 2015-01-22 14:44:37 +09:00 committed by Miklos Vajna
parent 3928932fe3
commit dbde7f6ab8
2 changed files with 19 additions and 0 deletions

View File

@ -26,6 +26,10 @@ public class Document {
public static final int DOCTYPE_DRAWING = 3; public static final int DOCTYPE_DRAWING = 3;
public static final int DOCTYPE_OTHER = 4; public static final int DOCTYPE_OTHER = 4;
public static final int MOUSE_BUTTON_DOWN = 0;
public static final int MOUSE_BUTTON_UP = 1;
public static final int MOUSE_MOVE = 2;
private final ByteBuffer handle; private final ByteBuffer handle;
private MessageCallback messageCallback = null; private MessageCallback messageCallback = null;
@ -85,6 +89,14 @@ public class Document {
public native void initializeForRendering(); public native void initializeForRendering();
/**
* Post a mouse event to LOK
* @param type - mouse event type
* @param x - x coordinate
* @param y - y coordinate
*/
public native void postMouseEvent(int type, int x, int y);
/** /**
* Callback to retrieve messages from LOK * Callback to retrieve messages from LOK
*/ */

View File

@ -277,6 +277,13 @@ extern "C" SAL_JNI_EXPORT jint JNICALL Java_org_libreoffice_kit_Office_saveAs
return result; return result;
} }
extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_postMouseEvent
(JNIEnv* pEnv, jobject aObject, jint type, jint x, jint y)
{
LibreOfficeKitDocument* pDocument = getHandle<LibreOfficeKitDocument>(pEnv, aObject);
pDocument->pClass->postMouseEvent(pDocument, type, x, y);
}
/* DirectBufferAllocator */ /* DirectBufferAllocator */
extern "C" SAL_JNI_EXPORT jobject JNICALL Java_org_libreoffice_kit_DirectBufferAllocator_allocateDirectBufferNative extern "C" SAL_JNI_EXPORT jobject JNICALL Java_org_libreoffice_kit_DirectBufferAllocator_allocateDirectBufferNative