[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - android/Bootstrap desktop/source

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Thu Jan 22 00:28:03 PST 2015


 android/Bootstrap/src/org/libreoffice/kit/Document.java |   12 ++++++++++++
 desktop/source/lib/lokandroid.cxx                       |    7 +++++++
 2 files changed, 19 insertions(+)

New commits:
commit 0994899f6835a85d1ee8cc3cd153f3659c543212
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Thu Jan 22 14:44:37 2015 +0900

    android: add postMouseEvent to LOKit JNI interface
    
    Change-Id: I652a0c365c4a1413226cdd4dc7910e65ac2a5285

diff --git a/android/Bootstrap/src/org/libreoffice/kit/Document.java b/android/Bootstrap/src/org/libreoffice/kit/Document.java
index 4c791cb..3cd9b0e 100644
--- a/android/Bootstrap/src/org/libreoffice/kit/Document.java
+++ b/android/Bootstrap/src/org/libreoffice/kit/Document.java
@@ -26,6 +26,10 @@ public class Document {
     public static final int DOCTYPE_DRAWING = 3;
     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 MessageCallback messageCallback = null;
 
@@ -86,6 +90,14 @@ public class Document {
     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
      */
     public interface MessageCallback {
diff --git a/desktop/source/lib/lokandroid.cxx b/desktop/source/lib/lokandroid.cxx
index 0290222..9ea5107 100644
--- a/desktop/source/lib/lokandroid.cxx
+++ b/desktop/source/lib/lokandroid.cxx
@@ -277,6 +277,13 @@ extern "C" SAL_JNI_EXPORT jint JNICALL Java_org_libreoffice_kit_Office_saveAs
     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 */
 
 extern "C" SAL_JNI_EXPORT jobject JNICALL Java_org_libreoffice_kit_DirectBufferAllocator_allocateDirectBufferNative


More information about the Libreoffice-commits mailing list